@paydock/client-sdk
Version:
Paydock client sdk
1 lines • 845 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).paydock={})}(this,(function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function n(e,t,n){return t=u(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,C(i.key),i)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=b(e))||t){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function a(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c.apply(null,arguments)}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},l.apply(null,arguments)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function p(){p=function(){return t};var e,t={},n=Object.prototype,i=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof C?t:C,s=Object.create(o.prototype),a=new R(i||[]);return r(s,"_invoke",{value:M(e,n,a)}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var h="suspendedStart",f="suspendedYield",m="executing",v="completed",g={};function C(){}function y(){}function b(){}var E={};l(E,s,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(I([])));_&&_!==n&&i.call(_,s)&&(E=_);var k=b.prototype=C.prototype=Object.create(E);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(r,o,s,a){var c=d(e[r],e,o);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(u).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}var o;r(this,"_invoke",{value:function(e,i){function r(){return new t((function(t,r){n(e,i,t,r)}))}return o=o?o.then(r,r):r()}})}function M(t,n,i){var r=h;return function(o,s){if(r===m)throw Error("Generator is already running");if(r===v){if("throw"===o)throw s;return{value:e,done:!0}}for(i.method=o,i.arg=s;;){var a=i.delegate;if(a){var c=O(a,i);if(c){if(c===g)continue;return c}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===h)throw r=v,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=m;var l=d(t,n,i);if("normal"===l.type){if(r=i.done?v:f,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=v,i.method="throw",i.arg=l.arg)}}}function O(t,n){var i=n.method,r=t.iterator[i];if(r===e)return n.delegate=null,"throw"===i&&t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;var o=d(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var s=o.arg;return s?s.done?(n[t.resultName]=s.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return y.prototype=b,r(k,"constructor",{value:b,configurable:!0}),r(b,"constructor",{value:y,configurable:!0}),y.displayName=l(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},S(T.prototype),l(T.prototype,a,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new T(u(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},S(k),l(k,c,"Generator"),l(k,s,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},t.values=I,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return a.type="throw",a.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var c=i.call(s,"catchLoc"),l=i.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;N(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:I(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),g}},t}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return a}}(e,t)||b(e,t)||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 v(e,t,n,i){var r=l(u(e.prototype),t,n);return"function"==typeof r?function(e){return r.apply(n,e)}:r}function g(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||b(e)||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 C(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function b(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}function E(e){var t="function"==typeof Map?new Map:void 0;return E=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(h())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var r=new(e.bind.apply(e,i));return n&&f(r,n.prototype),r}(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)},E(e)}var w=function(){return o((function e(){i(this,e)}),null,[{key:"isFacebook",value:function(){return-1!==navigator.userAgent.indexOf("FBSN/iOS")&&-1!==navigator.userAgent.indexOf("AppleWebKit")&&-1!==navigator.userAgent.indexOf("(KHTML, like Gecko)")}},{key:"isInstagram",value:function(){return-1!==navigator.userAgent.indexOf("iOS")&&-1!==navigator.userAgent.indexOf("Instagram")&&-1!==navigator.userAgent.indexOf("(KHTML, like Gecko)")}},{key:"isSupportPopUp",value:function(){return!this.isFacebook()&&!this.isInstagram()}},{key:"getLanguage",value:function(){return window.navigator.language||""}},{key:"getTimezoneOffset",value:function(){return(new Date).getTimezoneOffset()}},{key:"getBrowserName",value:function(){var e=navigator.userAgent;return e.indexOf("Firefox")>-1?"Mozilla Firefox":e.indexOf("Opera")>-1?"Opera":e.indexOf("Trident")>-1?"Microsoft Internet Explorer":e.indexOf("Edge")>-1?"Microsoft Edge":e.indexOf("Chrome")>-1?"Google Chrome or Chromium":e.indexOf("Safari")>-1?"Apple Safari":"unknown"}},{key:"isJavaEnabled",value:function(){return navigator.javaEnabled()}},{key:"getColorDepth",value:function(){return screen.colorDepth}},{key:"getScreenHeight",value:function(){return screen.height}},{key:"getScreenWidth",value:function(){return screen.width}},{key:"getBrowserInfo",value:function(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}])}(),_="/v1/charges/3ds",k=function(){return o((function e(t){i(this,e),this.api=t}),[{key:"preAuth",value:function(e,t){return"function"==typeof t?this.api.getClient("POST",_).send(c(c({},e),{_3ds:c(c({},e._3ds),{browser_details:{name:w.getBrowserName(),java_enabled:w.isJavaEnabled().toString(),language:w.getLanguage(),screen_height:w.getScreenHeight().toString(),screen_width:w.getScreenWidth().toString(),time_zone:w.getTimezoneOffset().toString(),color_depth:w.getColorDepth().toString()}})}),(function(e){t(e)})):this.api.getClientPromise("POST",_).send(c(c({},e),{_3ds:c(c({},e._3ds),{browser_details:{name:w.getBrowserName(),java_enabled:w.isJavaEnabled().toString(),language:w.getLanguage(),screen_height:w.getScreenHeight().toString(),screen_width:w.getScreenWidth().toString(),time_zone:w.getTimezoneOffset().toString(),color_depth:w.getColorDepth().toString()}})}))}}])}(),S="sandbox",T="sandbox-kovena",M="sandbox-demo-kovena",O="production",A="staging",N="staging_1",R="staging_2",I="staging_3",x="staging_4",P="staging_5",L="staging_6",D="staging_7",U="staging_8",F="staging_9",j="staging_10",H="staging_11",B="staging_12",z="staging_13",W="staging_14",V="staging_15",G=[{env:S,url:"https://widget-sandbox."},{env:T,url:"https://widget-sandbox."},{env:"sandbox-demo",url:"https://widget-sandbox-demo."},{env:M,url:"https://widget-sandbox-demo."},{env:O,url:"https://widget."},{env:A,url:"https://widsta."},{env:N,url:"https://widsta-1."},{env:R,url:"https://widsta-2."},{env:I,url:"https://widsta-3."},{env:x,url:"https://widsta-4."},{env:P,url:"https://widsta-5."},{env:L,url:"https://widsta-6."},{env:D,url:"https://widsta-7."},{env:U,url:"https://widsta-8."},{env:F,url:"https://widsta-9."},{env:j,url:"https://widsta-10."},{env:H,url:"https://widsta-11."},{env:B,url:"https://widsta-12."},{env:z,url:"https://widsta-13."},{env:W,url:"https://widsta-14."},{env:V,url:"https://widsta-15."}],q=[{env:S,url:"https://api-sandbox."},{env:O,url:"https://api."},{env:A,url:"https://apista."},{env:N,url:"https://apista-1."},{env:R,url:"https://apista-2."},{env:I,url:"https://apista-3."},{env:x,url:"https://apista-4."},{env:P,url:"https://apista-5."},{env:L,url:"https://apista-6."},{env:D,url:"https://apista-7."},{env:U,url:"https://apista-8."},{env:F,url:"https://apista-9."},{env:j,url:"https://apista-10."},{env:H,url:"https://apista-11."},{env:B,url:"https://apista-12."},{env:z,url:"https://apista-13."},{env:W,url:"https://apista-14."},{env:V,url:"https://apista-15."}],Y=[T,M],K=S,$="paydock.com",J="kovena.com",X=function(){return o((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;i(this,e),this.configs=t,this.setEnv(n)}),[{key:"setEnv",value:function(e,t){if(!this.isValidMode(this.configs,e))throw new Error("unknown env: ".concat(e));if(this.env=e,t&&!t.match("^([a-zA-Z0-9](?:(?:[a-zA-Z0-9-.]*(?!-)\\.(?![-.]))*[a-zA-Z0-9]+)?)$"))throw new Error("invalid: ".concat(t));t?this.alias=t:-1!==Y.indexOf(this.env)?this.alias=J:this.alias=$}},{key:"getEnv",value:function(){return this.env}},{key:"getConf",value:function(){for(var e in this.configs)if(this.configs.hasOwnProperty(e)&&this.configs[e].env===this.getEnv())return{url:-1!==this.configs[e].url.indexOf("localhost")?this.configs[e].url:this.configs[e].url+this.alias,env:this.configs[e].env};throw new Error("invalid env")}},{key:"isValidMode",value:function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n].env===t)return!0;return!1}}])}(),Z=function(){function e(){i(this,e)}return o(e,null,[{key:"version",get:function(){return e._version.trim()||null}}])}();Z.type="client",Z.headerKeys=Object.freeze({version:"x-sdk-version",type:"x-sdk-type"}),Z._version="v1.122.3";var Q=function(e,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Q(e,t)};function ee(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function te(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function ne(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))}function ie(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function re(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function oe(e,t,n){if(n||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function se(e){return"function"==typeof e}function ae(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}"function"==typeof SuppressedError&&SuppressedError;var ce=ae((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function le(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ue=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=ie(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(se(c))try{c()}catch(e){r=e instanceof ce?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=ie(l),d=u.next();!d.done;d=u.next()){var h=d.value;try{pe(h)}catch(e){r=null!=r?r:[],e instanceof ce?r=oe(oe([],re(r)),re(e.errors)):r.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}if(r)throw new ce(r)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)pe(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&le(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&le(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),de=ue.EMPTY;function he(e){return e instanceof ue||e&&"closed"in e&&se(e.remove)&&se(e.add)&&se(e.unsubscribe)}function pe(e){se(e)?e():e.unsubscribe()}var fe={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},me={setTimeout:function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,oe([e,t],re(n)))},clearTimeout:function(e){var t=me.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function ve(){}function ge(e){e()}var Ce=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,he(t)&&t.add(n)):n.destination=ke,n}return ee(t,e),t.create=function(e,t,n){return new we(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ue),ye=Function.prototype.bind;function be(e,t){return ye.call(e,t)}var Ee=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){_e(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){_e(e)}else _e(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){_e(e)}},e}(),we=function(e){function t(t,n,i){var r,o,s=e.call(this)||this;se(t)||!t?r={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=i?i:void 0}:s&&fe.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},r={next:t.next&&be(t.next,o),error:t.error&&be(t.error,o),complete:t.complete&&be(t.complete,o)}):r=t;return s.destination=new Ee(r),s}return ee(t,e),t}(Ce);function _e(e){var t;t=e,me.setTimeout((function(){throw t}))}var ke={closed:!0,next:ve,error:function(e){throw e},complete:ve},Se="function"==typeof Symbol&&Symbol.observable||"@@observable";function Te(e){return e}var Me=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var i,r=this,o=(i=e)&&i instanceof Ce||function(e){return e&&se(e.next)&&se(e.error)&&se(e.complete)}(i)&&he(i)?e:new we(e,t,n);return ge((function(){var e=r,t=e.operator,n=e.source;o.add(t?t.call(o,n):n?r._subscribe(o):r._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Oe(t))((function(t,i){var r=new we({next:function(t){try{e(t)}catch(e){i(e),r.unsubscribe()}},error:i,complete:t});n.subscribe(r)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Se]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?Te:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Oe(e))((function(e,n){var i;t.subscribe((function(e){return i=e}),(function(e){return n(e)}),(function(){return e(i)}))}))},e.create=function(t){return new e(t)},e}();function Oe(e){var t;return null!==(t=null!=e?e:fe.Promise)&&void 0!==t?t:Promise}var Ae=ae((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ne=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ee(t,e),t.prototype.lift=function(e){var t=new Re(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ae},t.prototype.next=function(e){var t=this;ge((function(){var n,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var r=ie(t.currentObservers),o=r.next();!o.done;o=r.next()){o.value.next(e)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;ge((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;ge((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,i=n.hasError,r=n.isStopped,o=n.observers;return i||r?de:(this.currentObservers=null,o.push(e),new ue((function(){t.currentObservers=null,le(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,i=t.thrownError,r=t.isStopped;n?e.error(i):r&&e.complete()},t.prototype.asObservable=function(){var e=new Me;return e.source=this,e},t.create=function(e,t){return new Re(e,t)},t}(Me),Re=function(e){function t(t,n){var i=e.call(this)||this;return i.destination=t,i.source=n,i}return ee(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:de},t}(Ne),Ie=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return ee(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,i=e._value;if(t)throw n;return this._throwIfClosed(),i},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Ne),xe="x-access-token",Pe="x-user-public-key",Le=function(){function e(){i(this,e)}return o(e,null,[{key:"validateJWT",value:function(e){if(!e)return null;var t=m(e.split("."),3),n=t[0],i=t[1],r=t[2];if(!n||!i||!r)return null;if(2+n.length+i.length+r.length!==e.length)return null;try{return{head:JSON.parse(atob(n)),body:JSON.parse(atob(i)),signature:r}}catch(e){return null}}},{key:"extractData",value:function(e){try{return JSON.parse(atob(e.meta))}catch(e){return null}}},{key:"extractMeta",value:function(e){try{return JSON.parse(atob(e.meta)).meta}catch(e){return null}}},{key:"extractEnv",value:function(e){try{return JSON.parse(atob(e.meta)).env}catch(e){return null}}},{key:"validateJWTWhitelistedDomains",value:function(e){var t;try{if(!e.meta)return!0;var n=this.extractData(e);return!n||(!(null===(t=n.whitelist_domains)||void 0===t?void 0:t.length)||n.whitelist_domains.includes(window.location.hostname))}catch(e){return!0}}},{key:"getAccessHeaderNameByToken",value:function(t){return e.validateJWT(t)?xe:Pe}}])}(),De=function(){function e(t){i(this,e),this.request=t}return o(e,[{key:"inner",value:function(){return this.request}},{key:"setHeader",value:function(e,t){return this.request.setRequestHeader(e,t),this}},{key:"setAccessToken",value:function(e){return this.setHeader("x-access-token",e)}},{key:"setPublicKey",value:function(e){return this.setHeader("x-user-public-key",e)}},{key:"setContentTypeJson",value:function(){return this.setHeader("Content-Type","application/json; charset=UTF-8")}},{key:"setSdkVersion",value:function(){return Z.version&&(this.setHeader(Z.headerKeys.version,Z.version),this.setHeader(Z.headerKeys.type,Z.type)),this}}],[{key:"create",value:function(t,n){var i=new XMLHttpRequest;return i.open(t,n,!0),new e(i)}}])}();function Ue(){return Math.floor(performance.now())}const Fe="undefined"!=typeof window&&!!window.document,je="undefined"!=typeof WorkerGlobalScope&&("undefined"!=typeof self&&self instanceof WorkerGlobalScope&&self.navigator instanceof WorkerNavigator||"undefined"!=typeof globalThis&&globalThis instanceof WorkerGlobalScope&&globalThis.navigator instanceof WorkerNavigator),He=Fe?window:"undefined"!=typeof WorkerGlobalScope&&("undefined"!=typeof self&&self instanceof WorkerGlobalScope&&self||"undefined"!=typeof globalThis&&globalThis instanceof WorkerGlobalScope&&globalThis),Be="complete"===He?.document?.readyState,ze=Boolean("hidden"===He?.document?.visibilityState),We=""+He?.location,Ve=/iPad|iPhone|iPod/.test(He.navigator?.userAgent),Ge=Ve&&"undefined"==typeof SharedWorker;(()=>{const e=He.navigator?.userAgent?.match(/Firefox[/\s](\d+\.\d+)/);Array.isArray(e)&&e.length>=2&&e[1]})();const qe=Boolean(Fe&&window.document.documentMode),Ye=!!He.navigator?.sendBeacon,Ke=Date.now()-Ue(),$e={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net"};function Je(){return He.NREUM||(He.NREUM={}),void 0===He.newrelic&&(He.newrelic=He.NREUM),He.NREUM}function Xe(){let e=Je();return e.o||(e.o={ST:He.setTimeout,SI:He.setImmediate,CT:He.clearTimeout,XHR:He.XMLHttpRequest,REQ:He.Request,EV:He.Event,PR:He.Promise,MO:He.MutationObserver,FETCH:He.fetch}),e}function Ze(e){let t=Je();return t.initializedAgents?.[e]}function Qe(){return function(){let e=Je();const t=e.info||{};e.info={beacon:$e.beacon,errorBeacon:$e.errorBeacon,...t}}(),function(){let e=Je();const t=e.init||{};e.init={...t}}(),Xe(),function(){let e=Je();const t=e.loader_config||{};e.loader_config={...t}}(),Je()}var et=Object.prototype.hasOwnProperty;function tt(e,t,n){if(et.call(e,t))return e[t];var i=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!1}),i}catch(e){}return e[t]=i,i}function nt(e,t){"function"==typeof console.warn&&(console.warn("New Relic: ".concat(e)),t&&console.warn(t))}function it(e,t){try{if(!e||"object"!=typeof e)return nt("Setting a Configurable requires an object as input");if(!t||"object"!=typeof t)return nt("Setting a Configurable requires a model to set its initial properties");const n=Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t)),i=0===Object.keys(n).length?e:n;for(let r in i)if(void 0!==e[r])try{if(null===e[r]){n[r]=null;continue}Array.isArray(e[r])&&Array.isArray(t[r])?n[r]=Array.from(new Set([...e[r],...t[r]])):"object"==typeof e[r]&&"object"==typeof t[r]?n[r]=it(e[r],t[r]):n[r]=e[r]}catch(e){nt("An error occurred while setting a property of a Configurable",e)}return n}catch(e){nt("An error occured while setting a Configurable",e)}}const rt={beacon:$e.beacon,errorBeacon:$e.errorBeacon,licenseKey:void 0,applicationID:void 0,sa:void 0,queueTime:void 0,applicationTime:void 0,ttGuid:void 0,user:void 0,account:void 0,product:void 0,extra:void 0,jsAttributes:{},userAttributes:void 0,atts:void 0,transactionName:void 0,tNamePlain:void 0},ot={};function st(e){if(!e)throw new Error("All info objects require an agent identifier!");if(!ot[e])throw new Error("Info for ".concat(e," was never set"));return ot[e]}function at(e,t){if(!e)throw new Error("All info objects require an agent identifier!");ot[e]=it(t,rt);const n=Ze(e);n&&(n.info=ot[e])}const ct=e=>{if(!e||"string"!=typeof e)return!1;try{document.createDocumentFragment().querySelector(e)}catch{return!1}return!0},lt=144e5,ut=18e5,dt="session-started",ht="session-pause",pt="session-reset",ft="session-resume",mt="session-update",vt="same-tab",gt="cross-tab",Ct={OFF:0,FULL:1,ERROR:2},yt="[data-nr-mask]",bt=()=>{const e={mask_selector:"*",block_selector:"[data-nr-block]",mask_input_options:{color:!1,date:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:!1,search:!1,tel:!1,text:!1,time:!1,url:!1,week:!1,textarea:!1,select:!1,password:!0}};return{feature_flags:[],proxy:{assets:void 0,beacon:void 0},privacy:{cookies_enabled:!0},ajax:{deny_list:void 0,block_internal:!0,enabled:!0,harvestTimeSeconds:10,autoStart:!0},distributed_tracing:{enabled:void 0,exclude_newrelic_header:void 0,cors_use_newrelic_header:void 0,cors_use_tracecontext_headers:void 0,allowed_origins:void 0},session:{expiresMs:lt,inactiveMs:ut},ssl:void 0,obfuscate:void 0,jserrors:{enabled:!0,harvestTimeSeconds:10,autoStart:!0},metrics:{enabled:!0,autoStart:!0},page_action:{enabled:!0,harvestTimeSeconds:30,autoStart:!0},page_view_event:{enabled:!0,autoStart:!0},page_view_timing:{enabled:!0,harvestTimeSeconds:30,long_task:!1,autoStart:!0},session_trace:{enabled:!0,harvestTimeSeconds:10,autoStart:!0},harvest:{tooManyRequestsDelay:60},session_replay:{autoStart:!0,enabled:!1,harvestTimeSeconds:60,preload:!1,sampling_rate:10,error_sampling_rate:100,collect_fonts:!1,inline_images:!1,inline_stylesheet:!0,mask_all_inputs:!0,get mask_text_selector(){return e.mask_selector},set mask_text_selector(t){ct(t)?e.mask_selector="".concat(t,",").concat(yt):""===t||null===t?e.mask_selector=yt:nt("An invalid session_replay.mask_selector was provided. '*' will be used.",t)},get block_class(){return"nr-block"},get ignore_class(){return"nr-ignore"},get mask_text_class(){return"nr-mask"},get block_selector(){return e.block_selector},set block_selector(t){ct(t)?e.block_selector+=",".concat(t):""!==t&&nt("An invalid session_replay.block_selector was provided and will not be used",t)},get mask_input_options(){return e.mask_input_options},set mask_input_options(t){t&&"object"==typeof t?e.mask_input_options={...t,password:!0}:nt("An invalid session_replay.mask_input_option was provided and will not be used",t)}},spa:{enabled:!0,harvestTimeSeconds:10,autoStart:!0},soft_navigations:{enabled:!0,harvestTimeSeconds:10,autoStart:!0}}},Et={},wt="All configuration objects require an agent identifier!";function _t(e){if(!e)throw new Error(wt);if(!Et[e])throw new Error("Configuration for ".concat(e," was never set"));return Et[e]}function kt(e,t){if(!e)throw new Error(wt);var n=_t(e);if(n){for(var i=t.split("."),r=0;r<i.length-1;r++)if("object"!=typeof(n=n[i[r]]))return;n=n[i[i.length-1]]}return n}const St={accountID:void 0,trustKey:void 0,agentID:void 0,licenseKey:void 0,applicationID:void 0,xpid:void 0},Tt={};function Mt(e){if(!e)throw new Error("All loader-config objects require an agent identifier!");if(!Tt[e])throw new Error("LoaderConfig for ".concat(e," was never set"));return Tt[e]}const Ot=Xe().o,At="1.260.1",Nt={buildEnv:"NPM",distMethod:"NPM",version:At,originTime:Ke},Rt={customTransaction:void 0,disabled:!1,isolatedBacklog:!1,loaderType:void 0,maxBytes:3e4,onerror:void 0,origin:""+He.location,ptid:void 0,releaseIds:{},appMetadata:{},session:void 0,denyList:void 0,harvestCount:0,timeKeeper:void 0},It={};function xt(e){if(!e)throw new Error("All runtime objects require an agent identifier!");if(!It[e])throw new Error("Runtime for ".concat(e," was never set"));return It[e]}function Pt(e){return function(e){try{const t=st(e);return!!t.licenseKey&&!!t.errorBeacon&&!!t.applicationID}catch(e){return!1}}(e)}class Lt{constructor(e){this.contextId=e}}function Dt(e,t){return e?15&e[t]:16*Math.random()|0}function Ut(){const e=He?.crypto||He?.msCrypto;let t,n=0;return e&&e.getRandomValues&&(t=e.getRandomValues(new Uint8Array(30))),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split("").map((e=>"x"===e?Dt(t,n++).toString(16):"y"===e?(3&Dt()|8).toString(16):e)).join("")}function Ft(e){const t=He?.crypto||He?.msCrypto;let n,i=0;t&&t.getRandomValues&&(n=t.getRandomValues(new Uint8Array(e)));const r=[];for(var o=0;o<e;o++)r.push(Dt(n,i++).toString(16));return r.join("")}const jt=Ut(),Ht="nr@context:".concat(jt),Bt=function e(t,n){var i={},r={},o={},s=!1;try{s=16===n.length&&xt(n).isolatedBacklog}catch(e){}var a={on:l,addEventListener:l,removeEventListener:function(e,t){var n=i[e];if(!n)return;for(var r=0;r<n.length;r++)n[r]===t&&n.splice(r,1)},emit:function(e,n,i,o,s){!1!==s&&(s=!0);if(Bt.aborted&&!o)return;t&&s&&t.emit(e,n,i);for(var l=c(i),d=u(e),p=d.length,f=0;f<p;f++)d[f].apply(l,n);var m=h()[r[e]];m&&m.push([a,e,n,l]);return l},get:d,listeners:u,context:c,buffer:function(e,t){const n=h();if(t=t||"feature",a.aborted)return;Object.entries(e||{}).forEach((e=>{let[i,o]=e;r[o]=t,t in n||(n[t]=[])}))},abort:function(){a._aborted=!0,Object.keys(a.backlog).forEach((e=>{delete a.backlog[e]}))},isBuffering:function(e){return!!h()[r[e]]},debugId:n,backlog:s?{}:t&&"object"==typeof t.backlog?t.backlog:{},isolatedBacklog:s};return Object.defineProperty(a,"aborted",{get:()=>{let e=a._aborted||!1;return e||(t&&(e=t.aborted),e)}}),a;function c(e){return e&&e instanceof Lt?e:e?tt(e,Ht,(()=>new Lt(Ht))):new Lt(Ht)}function l(e,t){i[e]=u(e).concat(t)}function u(e){return i[e]||[]}function d(t){return o[t]=o[t]||e(a,t)}function h(){return a.backlog}}(void 0,"globalEE"),zt=Je();zt.ee||(zt.ee=Bt);var Wt=Bt.get("handle");function Vt(e,t,n,i,r){r?(r.buffer([e],i),r.emit(e,t,n)):(Wt.buffer([e],i),Wt.emit(e,t,n))}const Gt=(e,t)=>Object.entries(e||{}).map((e=>{let[n,i]=e;return t(n,i)}));Yt.on=Kt;var qt=Yt.handlers={};function Yt(e,t,n,i){Kt(i||Wt,qt,e,t,n)}function Kt(e,t,n,i,r){r||(r="feature"),e||(e=Wt);var o=t[r]=t[r]||{};(o[n]=o[n]||[]).push([e,i])}const $t={ajax:"ajax",jserrors:"jserrors",metrics:"metrics",pageAction:"page_action",pageViewEvent:"page_view_event",pageViewTiming:"page_view_timing",sessionReplay:"session_replay",sessionTrace:"session_trace",softNav:"soft_navigations",spa:"spa"},Jt={[$t.pageViewEvent]:1,[$t.pageViewTiming]:2,[$t.metrics]:3,[$t.jserrors]:4,[$t.ajax]:5,[$t.sessionTrace]:6,[$t.pageAction]:7,[$t.spa]:8,[$t.softNav]:9,[$t.sessionReplay]:10},Xt={};function Zt(e,t){const n={staged:!1,priority:Jt[t]||0};en(e),Xt[e].get(t)||Xt[e].set(t,n)}function Qt(e,t){en(e),Xt[e].get(t)&&Xt[e].delete(t),Xt[e].size&&nn(e)}function en(e){if(!e)throw new Error("agentIdentifier required");Xt[e]||(Xt[e]=new Map)}function tn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"feature",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(en(e),!e||!Xt[e].get(t)||n)return rn(e,t);Xt[e].get(t).staged=!0,nn(e)}function nn(e){const t=Array.from(Xt[e]);t.every((e=>{let[t,n]=e;return n.staged}))&&(t.sort(((e,t)=>e[1].priority-t[1].priority)),t.forEach((t=>{let[n]=t;Xt[e].delete(n),rn(e,n)})))}function rn(e,t){const n=e?Bt.get(e):Bt,i=Yt.handlers;if(n.backlog&&i){var r=n.backlog[t],o=i[t];if(o){for(var s=0;r&&s<r.length;++s)on(r[s],o);Gt(o,(function(e,t){Gt(t,(function(t,n){n[0].on(e,n[1])}))}))}n.isolatedBacklog||delete i[t],n.backlog[t]=null,n.emit("drain-"+t,[])}}function on(e,t){var n=e[1];Gt(t[n],(function(t,n){var i=e[0];if(n[0]===i){var r=n[1],o=e[3],s=e[2];r.apply(o,s)}}))}class sn{constructor(e,t,n){this.agentIdentifier=e,this.aggregator=t,this.ee=Bt.get(e),this.featureName=n,this.blocked=!1}}let an=!1,cn=!1;try{const e={get passive(){return an=!0,!1},get signal(){return cn=!0,!1}};He.addEventListener("test",null,e),He.removeEventListener("test",null,e)}catch(e){}function ln(e,t){return an||cn?{capture:!!e,passive:an,signal:t}:!!e}function un(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;window.addEventListener(e,t,ln(n,i))}function dn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;document.addEventListener(e,t,ln(n,i))}function hn(){return"undefined"==typeof document||"complete"===document.readyState}function pn(e,t){if(hn())return e();un("load",e,t)}const fn=e=>Fe&&!0===kt(e,"privacy.cookies_enabled");function mn(e,t){return!!function(e){return!!Ot.MO&&fn(e)&&!0===kt(e,"session_trace.enabled")}(e)&&(!!t?.isNew||!!t?.state.sessionReplayMode)}function vn(e,t){const n=t.correctAbsoluteTimestamp(e);return{originalTimestamp:e,correctedTimestamp:n,timestampDiff:e-n,originTime:Ke,correctedOriginTime:t.correctedOriginTime,originTimeDiff:Math.floor(Ke-t.correctedOriginTime)}}function gn(e){var t=this;let n=!1;return function(){if(!n){n=!0;for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];e.apply(t,r)}}}class Cn extends sn{constructor(e,t,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];super(e,t,n),this.auto=i,this.abortHandler=void 0,this.featAggregate=void 0,this.onAggregateImported=void 0,!1===kt(this.agentIdentifier,"".concat(this.featureName,".autoStart"))&&(this.auto=!1),this.auto?Zt(e,n):this.ee.on("manual-start-all",gn((()=>{Zt(this.agentIdentifier,this.featureName),this.auto=!0,this.importAggregator()})))}importAggregator(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.featAggregate||!this.auto)return;this.onAggregateImported=new Promise((t=>{e=t}));const n=async()=>{let n;try{if(fn(this.agentIdentifier)){const{setupAgentSession:e}=await Promise.resolve().then((function(){return wc}));n=e(this.agentIdentifier)}}catch(e){nt("A problem occurred when starting up session manager. This page will not start or extend any session.",e),this.featureName===$t.sessionReplay&&this.abortHandler?.()}try{if(!this.#e(this.featureName,n))return tn(this.agentIdentifier,this.featureName),void e(!1);const{lazyFeatureLoader:i}=await Promise.resolve().then((function(){return _c})),{Aggregate:r}=await i(this.featureName,"aggregate");this.featAggregate=new r(this.agentIdentifier,this.aggregator,t),e(!0)}catch(t){nt("Downloading and initializing ".concat(this.featureName," failed..."),t),this.abortHandler?.(),tn(this.agentIdentifier,this.featureName,!0),e(!1),this.ee&&this.ee.abort()}};Fe?pn((()=>n()),!0):n()}#e(e,t){return e!==$t.sessionReplay||mn(this.agentIdentifier,t)}}const yn=$t.jserrors,bn=$t.sessionReplay,En={RECORD:"recordReplay",PAUSE:"pauseReplay",REPLAY_RUNNING:"replayRunning",ERROR_DURING_REPLAY:"errorDuringReplay"},wn=2,_n=4,kn={[Ct.ERROR]:15e3,[Ct.FULL]:3e5,[Ct.OFF]:0},Sn={message:"Session was reset",sm:"Reset"},Tn={message:"Recorder failed to import",sm:"Import"},Mn={message:"429: Too Many Requests",sm:"Too-Many"},On={message:"Payload was too large",sm:"Too-Big"},An={message:"Session Entity was set to OFF on another tab",sm:"Cross-Tab"},Nn={message:"Session Replay is not allowed and will not be started",sm:"Entitlement"},Rn="api",In=()=>{const e=new WeakSet;return(t,n)=>{if("object"==typeof n&&null!==n){if(e.has(n))return;e.add(n)}return n}};function xn(e){try{return JSON.stringify(e,In())}catch(e){try{Bt.emit("internal-error",[e])}catch(e){}}}class Pn{constructor(e,t,n,i,r){this.name="UncaughtError",this.message="string"==typeof e?e:xn(e),this.sourceURL=t,this.line=n,this.column=i,this.__newrelic=r}}function Ln(e){return Fn(e)?e:new Pn(void 0!==e?.message?e.message:e,e?.filename||e?.sourceURL,e?.lineno||e?.line,e?.colno||e?.col,e?.__newrelic)}function Dn(e){let t="Unhandled Promise Rejection";if(Fn(e?.reason))try{return e.reason.message=t+": "+e.reason.message,Ln(e.reason)}catch(t){return Ln(e.reason)}if(void 0===e.reason)return Ln(t);const n=Ln(e.reason);return n.message=t+": "+n?.message,n}function Un(e){if(e.error instanceof SyntaxError&&!/:\d+$/.test(e.error.stack?.trim())){const t=new Pn(e.message,e.filename,e.lineno,e.colno,e.error.__newrelic);return t.name=SyntaxError.name,t}return Fn(e.error)?e.error:Ln(e)}function Fn(e){return e instanceof Error&&!!e.stack}let jn=class extends Cn{static featureName=yn;#t=!1;constructor(e,t){super(e,t,yn,!(arguments.length>2&&void 0!==arguments[2])||arguments[2]);try{this.removeOnAbort=new AbortController}catch(e){}this.ee.on("internal-error",(e=>{this.abortHandler&&Vt("ierr",[Ln(e),Ue(),!0,{},this.#t],void 0,this.featureName,this.ee)})),this.ee.on(En.REPLAY_RUNNING,(e=>{this.#t=e})),He.addEventListener("unhandledrejection",(e=>{this.abortHandler&&Vt("err",[Dn(e),Ue(),!1,{unhandledPromiseRejection:1},this.#t],void 0,this.featureName,this.ee)}),ln(!1,this.removeOnAbort?.signal)),He.addEventListener("error",(e=>{this.abortHandler&&Vt("err",[Un(e),Ue(),!1,{},this.#t],void 0,this.featureName,this.ee)}),ln(!1,this.removeOnAbort?.signal)),this.abortHandler=this.#n,this.importAggregator()}#n(){this.removeOnAbort?.abort(),this.abortHandler=void 0}};const Hn=$t.pageViewEvent;let Bn=class extends Cn{static featureName=Hn;constructor(e,t){super(e,t,Hn,!(arguments.length>2&&void 0!==arguments[2])||arguments[2]),this.importAggregator()}};const zn=Object.values($t);function Wn(e){const t={};return zn.forEach((n=>{t[n]=function(e,t){return!0===kt(t,"".concat(e,".enabled"))}(n,e)})),t}const Vn=$t.metrics,Gn="storeSupportabilityMetrics",qn="storeEventMetrics",Yn=["setErrorHandler","finished","addToTrace","addRelease","addPageAction","setCurrentRouteName","setPageViewName","setCustomAttribute","interaction","noticeError","setUserId","setApplicationVersion","start",En.RECORD,En.PAUSE],Kn=["setErrorHandler","finished","addToTrace","addRelease"];function $n(){const e=Qe();Yn.forEach((t=>{e[t]=function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];let o=[];return Object.values(e.initializedAgents).forEach((e=>{e.exposed&&e.api[t]&&o.push(e.api[t](...i))})),o.length>1?o:o[0]}(t,...i)}}))}const Jn={};const Xn="newrelic";const Zn=new Set,Qn={};function ei(e,t){const n=Bt.get(t);Qn[t]??={},e&&"object"==typeof e&&(Zn.has(t)||(n.emit("rumresp",[e]),Qn[t]=e,Zn.add(t),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{He.dispatchEvent(new CustomEvent(Xn,{detail:e}))}catch(e){}}({loaded:!0})))}let ti=!1;function ni(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,{init:r,info:o,loader_config:s,runtime:a={loaderType:n},exposed:c=!0}=t;const l=Qe();o||(r=l.init,o=l.info,s=l.loader_config),function(e,t){if(!e)throw new Error(wt);Et[e]=it(t,bt());const n=Ze(e);n&&(n.init=Et[e])}(e.agentIdentifier,r||{}),function(e,t){if(!e)throw new Error("All loader-config objects require an agent identifier!");Tt[e]=it(t,St);const n=Ze(e);n&&(n.loader_config=Tt[e])}(e.agentIdentifier,s||{}),o.jsAttributes??={},je&&(o.jsAttributes.isWorker=!0),at(e.agentIdentifier,o);const u=_t(e.agentIdentifier),d=[o.beacon,o.errorBeacon];var h,p;ti||(u.proxy.assets&&(u.proxy.assets,d.push(u.proxy.assets)),u.proxy.beacon&&d.push(u.proxy.beacon),$n(),h="activatedFeatures",p=Qn,Je()[h]=p,e.runSoftNavOverSpa&&=!0===u.soft_navigations.enabled&&u.feature_flags.includes("soft_nav")),a.denyList=[...u.ajax.deny_list||[],...u.ajax.block_internal?d:[]],a.ptid=e.agentIdentifier,function(e,t){if(!e)throw new Error("All runtime objects require an agent identifier!");It[e]={...it(t,Rt),...Nt};const n=Ze(e);n&&(n.runtime=It[e])}(e.agentIdentifier,a),void 0===e.api&&(e.api=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t||Zt(e,"api");const i={};var r=Bt.get(e),o=r.get("tracer");Jn[e]=Ct.OFF,r.on(En.REPLAY_RUNNING,(t=>{Jn[e]=t}));var s="api-",a=s+"ixn-";function c(t,n,i,r){const o=st(e);return null===n?delete o.jsAttributes[t]:at(e,{...o,jsAttributes:{...o.jsAttributes,[t]:n}}),d(s,i,!0,r||null===n?"session":void 0)(t,n)}function l(){}Kn.forEach((e=>{i[e]=d(s,e,!0,"api")})),i.addPageAction=d(s,"addPageAction",!0,$t.pageAction),i.setPageViewName=function(t,n){if("string"==typeof t)return"/"!==t.charAt(0)&&(t="/"+t),xt(e).customTransaction=(n||"http://custom.transaction")+t,d(s,"setPageViewName",!0)()},i.setCustomAttribute=f