PageSourceSearch

https://www.northstarsuccess.com/Contact-North-Star-Success_files/rsa.js

js northstarsuccess.com collected 2026-10-04 06:28:36 UTC 206,655 bytes, 2 lines download raw bytes

vendor: 5,048 bytes, line 1
1var rudderanalytics=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,i,r,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(i,r)}function i(e){return function(){var t=this,i=arguments;return new Promise((function(r,o){var a=e.apply(t,i);function s(e){n(a,r,o,s,u,"next",e)}function u(e){n(a,r,o,s,u,"throw",e)}s(void 0)}))}}function r(e,t,n){return t=c(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,v()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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,k(i.key),i)}}function s(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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=c(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 c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(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&&p(e,t)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(){g=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:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=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 c(e,t,n,i){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new R(i||[]);return r(a,"_invoke",{value:P(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var v="suspendedStart",f="suspendedYield",h="executing",p="completed",y={};function m(){}function b(){}function k(){}var E={};l(E,a,(function(){return this}));var A=Object.getPrototypeOf,S=A&&A(A(M([])));S&&S!==n&&i.call(S,a)&&(E=S);var I=k.prototype=m.prototype=Object.create(E);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(r,o,a,s){var u=d(e[r],e,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&i.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.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 P(t,n,i){var r=v;return function(o,a){if(r===h)throw Error("Generator is already running");if(r===p){if("throw"===o)throw a;return{value:e,done:!0}}for(i.method=o,i.arg=a;;){var s=i.delegate;if(s){var u=O(s,i);if(u){if(u===y)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===v)throw r=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=h;var l=d(t,n,i);if("normal"===l.type){if(r=i.done?p:f,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=p,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&&
vendor: 4,261 bytes, line 1
1(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")),y;var o=d(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function C(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 D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];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 b.prototype=k,r(I,"constructor",{value:k,configurable:!0}),r(k,"constructor",{value:b,configurable:!0}),b.displayName=l(k,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,l(e,u,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},T(w.prototype),l(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new w(c(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(I),l(I,u,"Generator"),l(I,a,(function(){return this})),l(I,"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=M,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(D),!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 s.type="throw",s.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.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 a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},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),y},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),D(n),y}},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;D(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:M(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),y}},t}
1function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function y(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,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(u=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(e){l=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||A(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 m(e,t,n,i){var r=l(c(e.prototype),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function b(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)||A(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 k(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);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function E(e){return E="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},E(e)}function A(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 S(e){return null!=e&&"object"===E(e)&&!0===e["@@functional/placeholder"]}function I(e){return function t(n){return 0===arguments.length||S(n)?t:e.apply(this,arguments)}}function T(e){return function t(n,i){switch(arguments.length){case 0:return t;case 1:return S(n)?t:I((function(t){return e(n,t)}));default:return S(n)&&S(i)?t:S(n)?I((function(t){return e(t,i)})):S(i)?I((function(t){return e(n,t)})):e(n,i)}}}function w(e){return function t(n,i,r){switch(arguments.length){case 0:return t;case 1:return S(n)?t:T((function(t,i){return e(n,t,i)}));case 2:return S(n)&&S(i)?t:S(n)?T((function(t,n){return e(t,i,n)})):S(i)?T((function(t,i){return e(n,t,i)})):I((function(t){return e(n,i,t)}));default:return S(n)&&S(i)&&S(r)?t:S(n)&&S(i)?T((function(t,n){return e(t,n,r)})):S(n)&&S(r)?T((function(t,n){return e(t,i,n)})):S(i)&&S(r)?T((function(t,i){return e(n,t,i)})):S(n)?I((function(t){return e(t,i,r)})):S(i)?I((function(t){return e(n,t,r)})):S(r)?I((function(t){return e(n,i,t)})):e(n,i,r)}}}function P(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var O=I((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function C(e){return"[object Object]"===Object.prototype.toString.call(e)}var D=Number.isInteger||function(e){return(e|0)===e};function R(e,t){var n=e<0?t.length+e:e;return function(e){return"[object String]"===Object.prototype.toString.call(e)}(t)?t.charAt(n):t[n]}function M(e,t,n){if(n||(n=new L),function(e){var t=E(e);return null==e||"object"!=t&&"function"!=t}(e))return e;var i,r=function(t){var i=n.get(e);if(i)return i;for(var r in n.set(e,t),e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=M(e[r],!0,n));return t};switch(O(e)){case"Object":return r(Object.create(Object.getPrototypeOf(e)));case"Array":return r(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return i=e,new RegExp(i.source,i.flags?i.flags:(i.global?"g":"")+(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.sticky?"y":"")+(i.unicode?"u":"")+(i.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var L=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),i=this.map[n];i||(this.map[n]=i=[]),i.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],i=0;i<n.length;i+=1){if((o=n[i])[0]===e)return o[1]}else{var r=this.hash(e);if(n=this.map[r])for(i=0;i<n.length;i+=1){var o;if((o=n[i])[0]===e)return o[1]}}},e}(),_=I((function(e){return null!=e&&"function"==typeof e.clone?e.clone():M(e)}));function N(e,t){for(var n=t,i=0;i<e.length;i+=1){if(null==n)return;var r=e[i];n=D(r)?R(r,n):n[r]}return n}var x=w((function(e,t,n){var i,r={};for(i in n=n||{},t=t||{})P(i,t)&&(r[i]=P(i,n)?e(i,t[i],n[i]):t[i]);for(i in n)P(i,n)&&!P(i,r)&&(r[i]=n[i]);return r})),B=w((function e(t,n,i){return x((function(n,i,r){return C(i)&&C(r)?e(t,i,r):t(n,i,r)}),n,i)})),U=w((function(e,t,n){return B((function(t,n,i){return e(n,i)}),t,n)})),j=T(N),G=T((function(e,t){var n={};for(var i in t)e(t[i],i,t)&&(n[i]=t[i]);return n})),F=function(e){return"function"==typeof e&&Boolean(e.constructor&&e.call&&e.apply)},H=function(e){return"string"==typeof e},z=function(e){return null===e},Q=function(e){return void 0===e},K=function(e){return z(e)||Q(e)},V=function(e){return!Q(e)},q=function(e){return!K(e)},X=function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object E
1xception]":case"[object DOMException]":return!0;default:return e instanceof Error}},W=function(e,t){var n=t.split(".");return j(n,e)},J=function(e){return!z(e)&&function(e){return"object"===E(e)}(e)&&!Array.isArray(e)},Y=function(e){return!z(e)&&"[object Object]"===Object.prototype.toString.call(e)},$=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return _(t);var n=_(e);return t.forEach((function(e,t){n[t]=Array.isArray(e)||J(e)?Z(n[t],e):e})),n},Z=function(e,t){return U($,e,t)},ee=function(e){return Y(e)&&Object.keys(e).length>0},te=function(e){var t=G(V,e);return Object.keys(t).forEach((function(e){var n=t[e];Y(n)&&(t[e]=te(n))})),t},ne=function(e){var t=G(q,e);return Object.keys(t).forEach((function(e){var n=t[e];Y(n)&&(t[e]=ne(n))})),t},ie=function(e){if(ee(e))return ne(e)},re=function(e,t){return V(t)?V(e)?!0===e:t:!0===e},oe=function(e){return e.replace(/^\.+/,"")},ae=function(e){var t=e;if(!H(e)&&!K(e))try{t=JSON.stringify(e)}catch(mt){t=null}return t},se=function(e){return t=(new TextEncoder).encode(e),n=Array.from(t,(function(e){return String.fromCodePoint(e)})).join(""),globalThis.btoa(n);var t,n},ue=function(e){return(new TextDecoder).decode((t=e,n=globalThis.atob(t).split("").map((function(e){return e.charCodeAt(0)})),new Uint8Array(n)));var t,n},le=function(e,t,n,i,r){var o={category:e,name:t,properties:n,options:i,callback:void 0};F(r)&&(o.callback=r),F(i)&&(o.category=e,o.name=t,o.properties=n,o.options=void 0,o.callback=i),F(n)&&(o.category=e,o.name=t,o.properties=void 0,o.options=void 0,o.callback=n),F(t)&&(o.category=e,o.name=void 0,o.properties=void 0,o.options=void 0,o.callback=t),F(e)&&(o.category=void 0,o.name=void 0,o.properties=void 0,o.options=void 0,o.callback=e),Y(e)?(o.name=void 0,o.category=void 0,o.properties=e,F(t)?o.options=void 0:o.options=t):Y(t)&&(o.name=void 0,o.properties=t,F(n)?o.options=void 0:o.options=n),H(e)&&!H(t)&&(o.category=void 0,o.name=e),V(o.category)||(o.category=void 0),V(o.name)||(o.name=void 0),o.properties=o.properties?_(o.properties):{},V(o.options)?o.options=_(o.options):o.options=void 0;var a=H(o.name)?o.name:o.properties.name,s=H(o.category)?o.category:o.properties.category;return o.properties=Z(Y(o.properties)?o.properties:{},h(h({},a&&{name:a}),s&&{category:s})),o},ce=function(e,t,n,i){var r={name:e,properties:t,options:n,callback:void 0};return F(i)&&(r.callback=i),F(n)&&(r.properties=t,r.options=void 0,r.callback=n),F(t)&&(r.properties=void 0,r.options=void 0,r.callback=t),r.properties=q(r.properties)?_(r.properties):{},V(r.options)?r.options=_(r.options):r.options=void 0,r},de=function(e,t,n,i){var r={userId:e,traits:t,options:n,callback:void 0};return F(i)&&(r.callback=i),F(n)&&(r.userId=e,r.traits=t,r.options=void 0,r.callback=n),F(t)&&(r.userId=e,r.traits=void 0,r.options=void 0,r.callback=t),(Y(e)||z(e))&&(r.userId=null,r.traits=e,F(t)?r.options=void 0:r.options=t),r.userId=ae(r.userId),Y(r.traits)?r.traits=_(r.traits):r.traits=void 0,V(r.options)?r.options=_(r.options):r.options=void 0,r},ve=function(e,t,n,i){var r={to:e,from:t,options:n,callback:void 0};return F(i)&&(r.callback=i),F(n)&&(r.to=e,r.from=t,r.options=void 0,r.callback=n),F(t)?(r.to=e,r.from=void 0,r.options=void 0,r.callback=t):(Y(t)||z(t))&&(r.to=e,r.from=void 0,r.options=t),V(r.to)&&(r.to=ae(r.to)),V(r.from)?r.from=ae(r.from):r.from=void 0,V(r.options)?r.options=_(r.options):r.options=void 0,r},fe=function(e,t,n,i){var r={groupId:e,traits:t,options:n,callback:void 0};return F(i)&&(r.callback=i),F(n)&&(r.groupId=e,r.traits=t,r.options=void 0,r.callback=n),F(t)&&(r.groupId=e,r.traits=void 0,r.options=void 0,r.callback=t),(Y(e)||z(e))&&(r.groupId=null,r.traits=e,F(t)?r.options=void 0:r.options=t),r.groupId=ae(r.groupId),Y(r.traits)?r.traits=_(r.traits):r.traits=void 0,V(r.options)?r.options=_(r.options):r.options=void 0,r},he=function(e){return e.LOADED="Page Loaded",e.UNLOADED="Page Unloaded",e}({}),ge="API",pe="CapabilitiesManager",ye="ConfigManager",me="EventManager",be="PluginsManager",ke="UserSessionManager",Ee="ErrorHandler",Ae="PluginEngine",Se="Ready".concat(ge),Ie="Load".concat(ge),Te="AnalyticsCore";for(var we,Pe=[],Oe=0;Oe<256;Oe++)Pe[Oe]=(Oe+256).toString(16).substring(1);function Ce(){var e;(!we||Oe+16>4096)&&(e=4096,we=crypto.getRandomValues(new Uint8Array(e)),Oe=0);for(var t,n=0,i="";n<16;n++)t=we[Oe+n],i+=6==n?Pe[15&t|64]:8==n?Pe[63&t|128]:Pe[t],1&n&&n>1&&n<11&&(i+="-");return Oe+=16,i}for(var De,Re=256,Me=[];Re--;)Me[Re]=(Re+256).toString(16).substring(1);var Le=function(){return!K(globalThis.crypto)&&F(globalThis.crypto.getRandomValues)?Ce():function(){var e,t=0,n="";if(!De||Re+16>256){for(De=Array(t=256);t--;)De[t]=256*Math.random()|0;t=Re=0}for(;t<16;t++)e=De[Re+t],n+=6==t?Me[15&e|64]:8==t?Me[63&e|128]:Me[e],1&t&&t>1&&t<11&&(n+="-");return Re++,n}()},_e=function(e){var t=!1,n=!1;function i(){t||(t=!0,e(n),setTimeout((function(){t=!1}),0))}globalThis.addEventListener("beforeunload",(function(){n=!1,i()})),globalThis.addEventListener("blur",(function(){n=!0,i()})),globalThis.addEventListener("focus",(function(){t=!1})),document.addEventListener("pagehide",(function(){n="hidden"===document.visibilityState,i()})),document.addEventListener("visibilitychange",(function(){n=!0,"hidden"===document.visibilityState?i():t=!1}))},Ne=function(e){return e.toISOString()},xe=function(){return Ne(new Date)},Be=":: ",Ue=function(e,t){return'Failed to load the script with the id "'.concat(e,'" from URL "').concat(t,'".')},je="[Circular Reference]",Ge=function(e,t,n){var i=[];return function(r,o){if(!(null!=t&&t.includes(r)||e&&K(o))){if("object"!==E(o)||z(o))return o;for(;i.length>0&&i[i.length-1]!==this;)i.pop();return i.includes(o)?(null==n||n.warn(function(e,t){return"".concat(e).concat(Be,'A circular reference has been detected in the object and the property "').concat(t,'" has been dropped from the output.')}("JSONStringify",r)),je):(i.push(o),o)}}},Fe=function(e,t,n,i){try{return JSON.stringify(e,Ge(t,n,i))}catch(r){return null==i||i.warn("Failed to convert the value to a JSON string.",r),null}},He=function(e,t){var n=Array.isArray(e)?[]:{};for(var i in e)if(Object.hasOwnProperty.call(e,i)){var r=e[i],o=t.call(e,i,r);Y(o)||Array.isArray(o)?n[i]=He(o,t):n[i]=o}return n},ze=function(e,t){var n,i=(n=[],function(e,t){if(function(e){return"bigint"==typeof e}(t))return"[BigInt]";for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?je:(n.push(t),t)}),r=i.call(e,"",e);
1return Y(e)||Array.isArray(e)?He(e,i):r},Qe="[SDK DISPATCHED ERROR]",Ke=function(e){var t,n=e.stack,i=e.stacktrace,r=e["opera#sourceloc"],o=null!==(t=null!=n?n:i)&&void 0!==t?t:r;if(o&&"string"==typeof o)return o},Ve=function(e,t){var n=e;return X(e)?n.message="".concat(t,": ").concat(e.message):n=new Error("".concat(t,": ").concat(Fe(e))),n},qe=function(e){if(X(e)){var t=Ke(e);if(t){var n=e.stack,i=e.stacktrace,r=e["opera#sourceloc"];switch(t){case n:e.stack="".concat(n,"\n").concat(Qe);break;case i:e.stacktrace="".concat(i,"\n").concat(Qe);break;default:e["opera#sourceloc"]="".concat(r,"\n").concat(Qe)}}}globalThis.dispatchEvent(new ErrorEvent("error",{error:e,bubbles:!0,cancelable:!0,composed:!0}))},Xe="RudderLabs JavaScript SDK",We="3.16.1",Je="RudderJS-Initiated",Ye="preloadedEventsBuffer",$e="ajs_aid",Ze="ajs_uid",et="ajs_event",tt=18e5,nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"app";globalThis.RudderStackGlobals||(globalThis.RudderStackGlobals={}),globalThis.RudderStackGlobals[e]||(globalThis.RudderStackGlobals[e]={})},it=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"app";nt(n),globalThis.RudderStackGlobals[n][e]=t},rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"app";return nt(t),globalThis.RudderStackGlobals[t][e]};var ot=function(e,t){var n={};return e.forEach((function(i,r){if(r.startsWith(t)){var o=r.substring(t.length);n[o]=e.get(r)}})),n},at=function(e){var t=rt(Ye)||[];!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t="ajs_trait_",n="ajs_prop_",i=new URLSearchParams(globalThis.location.search);i.get(et)&&e.unshift(["track",i.get(et),ot(i,n)]),i.get(Ze)&&e.unshift(["identify",i.get(Ze),ot(i,t)]),i.get($e)&&e.unshift(["setAnonymousId",i.get($e)])}(t),t.length>0&&(e.enqueuePreloadBufferEvents(t),it(Ye,[]))},st=function(e,t){var n,i,r=e.shift();if(F(t[r])){switch(r){case"page":i=le.apply(void 0,b(e));break;case"track":i=ce.apply(void 0,b(e));break;case"identify":i=de.apply(void 0,b(e));break;case"alias":i=ve.apply(void 0,b(e));break;case"group":i=fe.apply(void 0,b(e));break;default:(n=t)[r].apply(n,b(e))}i&&t[r](i)}},ut=function(e,t,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;return new Promise((function(o,a){document.getElementById(t)&&a(new Error(function(e){return'A script with the id "'.concat(e,'" is already loaded. Skipping the loading of this script to prevent conflicts.')}(t)));try{var s;!function(e){var t,n=document.getElementsByTagName("head");if(n.length>0){var i,r;null===(i=n[0])||void 0===i||i.insertBefore(e,null===(r=n[0])||void 0===r?void 0:r.firstChild)}else{var o=document.getElementsByTagName("script");if(o.length>0&&null!==(t=o[0])&&void 0!==t&&t.parentNode){var a;null===(a=o[0])||void 0===a||a.parentNode.insertBefore(e,o[0])}else{var s=document.createElement("head");s.appendChild(e);var u=document.getElementsByTagName("html")[0];null==u||u.insertBefore(s,u.firstChild)}}}(function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=document.createElement("script");return a.type="text/javascript",a.onload=i,a.onerror=r,a.src=e,a.id=t,a.async=n,Object.keys(o).forEach((function(e){a.setAttribute(e,o[e])})),a.setAttribute("data-loader","RS_JS_SDK"),a}(e,t,i,(function(){globalThis.clearTimeout(s),o(t)}),(function(){globalThis.clearTimeout(s),a(new Error(Ue(t,e)))}),r)),s=globalThis.setTimeout((function(){a(new Error(function(e,t,n){return"A timeout of ".concat(n,' ms occurred while trying to load the script with id "').concat(e,'" from URL "').concat(t,'".')}(t,e,n)))}),n)}catch(u){a(Ve(u,Ue(t,e)))}}))},lt=function(){return s((function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;o(this,e),this.errorHandler=t,this.logger=n,this.timeout=i,this.onError=this.onError.bind(this)}),[{key:"loadJSFile",value:function(e){var t=this,n=e.url,i=e.id,r=e.timeout,o=e.async,a=e.callback,s=e.extraAttributes,u=!F(a);ut(n,i,r||this.timeout,o,s).then((function(e){u||a(e)})).catch((function(e){t.onError(e),u||a()}))}},{key:"onError",value:function(e){this.errorHandler.onError(e,"ExternalSrcLoader")}}])}(),ct=Symbol.for("preact-signals");function dt(){if(gt>1)gt--;else{for(var e,t=!1;void 0!==ht;){var n=ht;for(ht=void 0,pt++;void 0!==n;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Et(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=i}}if(pt=0,gt--,t)throw e}}function vt(e){if(gt>0)return e();gt++;try{return e()}finally{dt()}}var ft=void 0,ht=void 0,gt=0,pt=0,yt=0;function mt(e){if(void 0!==ft){var t=e.n;if(void 0===t||t.t!==ft)return t={i:0,S:e,p:ft.s,n:void 0,t:ft,e:void 0,x:void 0,r:t},void 0!==ft.s&&(ft.s.n=t),ft.s=t,e.n=t,32&ft.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=ft.s,t.n=void 0,ft.s.n=t,ft.s=t),t}}function bt(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function kt(e){return new bt(e)}function Et(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function At(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function St(e){for(var t=e.s,n=void 0;void 0!==t;){var i=t.p;-1===t.i?(t.S.U(t),void 0!==i&&(i.n=t.n),void 0!==t.n&&(t.n.p=i)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=i}e.s=n}function It(e){bt.call(this,void 0),this.x=e,this.s=void 0,this.g=yt-1,this.f=4}function Tt(e){var t=e.u;if(e.u=void 0,"function"==typeof t){gt++;var n=ft;ft=void 0;try{t()}catch(gc){throw e.f&=-2,e.f|=8,wt(e),gc}finally{ft=n,dt()}}}function wt(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Tt(e)}function Pt(e){if(ft!==this)throw new Error("Out-of-order effect");
1St(this),ft=e,this.f&=-2,8&this.f&&wt(this),dt()}function Ot(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Ct(e){var t=new Ot(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}bt.prototype.brand=ct,bt.prototype.h=function(){return!0},bt.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},bt.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},bt.prototype.subscribe=function(e){var t=this;return Ct((function(){var n=t.value,i=ft;ft=void 0;try{e(n)}finally{ft=i}}))},bt.prototype.valueOf=function(){return this.value},bt.prototype.toString=function(){return this.value+""},bt.prototype.toJSON=function(){return this.value},bt.prototype.peek=function(){var e=ft;ft=void 0;try{return this.value}finally{ft=e}},Object.defineProperty(bt.prototype,"value",{get:function(){var e=mt(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(pt>100)throw new Error("Cycle detected");this.v=e,this.i++,yt++,gt++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{dt()}}}}),(It.prototype=new bt).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===yt)return!0;if(this.g=yt,this.f|=1,this.i>0&&!Et(this))return this.f&=-2,!0;var e=ft;try{At(this),ft=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ft=e,St(this),this.f&=-2,!0},It.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}bt.prototype.S.call(this,e)},It.prototype.U=function(e){if(void 0!==this.t&&(bt.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},It.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(It.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=mt(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ot.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Ot.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Tt(this),At(this),gt++;var e=ft;return ft=this,Pt.bind(this,e)},Ot.prototype.N=function(){2&this.f||(this.f|=2,this.o=ht,ht=this)},Ot.prototype.d=function(){this.f|=8,1&this.f||wt(this)};var Dt=function(){return s((function e(){o(this,e),this.items=[]}),[{key:"enqueue",value:function(e){this.items.push(e)}},{key:"dequeue",value:function(){return 0===this.items.length?null:this.items.shift()}},{key:"isEmpty",value:function(){return 0===this.items.length}},{key:"size",value:function(){return this.items.length}},{key:"clear",value:function(){this.items=[]}}])}(),Rt={LOG:0,INFO:1,DEBUG:2,WARN:3,ERROR:4,NONE:5},Mt="ERROR",Lt=function(){return s((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"LOG",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:console;o(this,e),this.minLogLevel=Rt[t],this.scope=n,this.logProvider=i}),[{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.outputLog("LOG",t)}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.outputLog("INFO",t)}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.outputLog("DEBUG",t)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.outputLog("WARN",t)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.outputLog("ERROR",t)}},{key:"outputLog",value:function(e,t){var n,i;this.minLogLevel<=Rt[e]&&(null===(n=(i=this.logProvider)[e.toLowerCase()])||void 0===n||n.call.apply(n,[i].concat(b(this.formatLogData(t)))))}},{key:"setScope",value:function(e){this.scope=e||this.scope}},{key:"setMinLogLevel",value:function(e){this.minLogLevel=Rt[e],Q(this.minLogLevel)&&(this.minLogLevel=Rt.LOG)}},{key:"formatLogData",value:function(e){if(Array.isArray(e)&&e.length>0){var t="%c ".concat("RS SDK");this.scope&&(t="".concat(t," - ").concat(this.scope));var n=H(e[0])?e[0].trim():"",i=[t="".concat(t," %c ").concat(n),"font-weight: bold; background: black; color: white;","font-weight: normal;"];return H(e[0])||i.push(e[0]),i.push.apply(i,b(e.slice(1))),i}return e}}])}(),_t=new Lt,Nt=function(e){return e.HANDLEDEXCEPTION="handledException",e.UNHANDLEDEXCEPTION="unhandledException",e.UNHANDLEDREJECTION="unhandledPromiseRejection",e}({}),xt=["localStorage","memoryStorage","cookieStorage","sessionStorage","none"],Bt="cookieStorage",Ut="Unable to process/parse source configuration response",jt="Failed to fetch the source config",Gt=function(e){return"".concat(e).concat(Be,"The provided callback parameter is not a function.")},Ft=function(e,t,n){return"".concat(e," due to timeout or no connection (").concat(t?t.type:"",") at the client side for URL: ").concat(n)},Ht={All:!0},zt="js-integrations",Qt=new RegExp("^(https?:\\/\\/)(((([a-zA-Z\\d]([a-zA-Z\\d-]*[a-zA-Z\\d])*)\\.)+[a-zA-Z]{2,}|localhost|((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9]?)))(\\:\\d+)?(\\/[-a-zA-Z\\d%_.~+]*)*(\\?[;&a-zA-Z\\d%_.~+=-]*)?(\\#[-a-zA-Z\\d_]*)?$"),Kt="legacy",Vt="https://cdn.rudderlabs.com",qt="v3",Xt="".concat(Vt,"/").concat(qt,"/").concat(Kt,"/").concat(zt),Wt="".concat(Vt,"/").concat(qt,"/").concat(Kt,"/").concat("plugins"),Jt="https://api.rudderstack.com",Yt="v3",$t={iubenda:"IubendaConsentManager",oneTrust:"OneTrustConsentManager",ketch:"KetchConsentManager",custom:"CustomConsentManager"},Zt=u(u({},Yt,"StorageEncryption"),"legacy","StorageEncryptionLegacy"),en=u(u({},"xhr","XhrQueue"),"beacon","BeaconQueue"),tn=kt(_({configUrl:Jt,loadIntegration:!0,sessions:{autoTrack:!0,timeout:tt}
1,sameSiteCookie:"Lax",polyfillIfRequired:!0,integrations:Ht,useBeacon:!1,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:!0,lockPluginsVersion:!0,uaChTrackLevel:"none",plugins:[],useGlobalIntegrationsConfigInEvents:!1,bufferDataPlaneEventsUntilReady:!1,dataPlaneEventsBufferTimeout:1e4,storage:{encryption:{version:Yt},migrate:!0,cookie:{}},sendAdblockPage:!1,sameDomainCookiesOnly:!1,secureCookie:!1,sendAdblockPageOptions:{},useServerSideCookies:!1})),nn={userId:"",userTraits:{},anonymousId:"",groupId:"",groupTraits:{},initialReferrer:"",initialReferringDomain:"",sessionInfo:{},authToken:null},rn={autoTrack:!0,timeout:tt},on={userId:kt(nn.userId),userTraits:kt(nn.userTraits),anonymousId:kt(nn.anonymousId),groupId:kt(nn.groupId),groupTraits:kt(nn.groupTraits),initialReferrer:kt(nn.initialReferrer),initialReferringDomain:kt(nn.initialReferringDomain),sessionInfo:kt(nn.sessionInfo),authToken:kt(nn.authToken)},an={isOnline:kt(!0),storage:{isLocalStorageAvailable:kt(!1),isCookieStorageAvailable:kt(!1),isSessionStorageAvailable:kt(!1)},isBeaconAvailable:kt(!1),isLegacyDOM:kt(!1),isUaCHAvailable:kt(!1),isCryptoAvailable:kt(!1),isIE11:kt(!1),isAdBlocked:kt(!1)},sn={isErrorReportingEnabled:kt(!1),isMetricsReportingEnabled:kt(!1),breadcrumbs:kt([])},un=kt(void 0),ln={activeDataplaneUrl:kt(void 0),integrationsCDNPath:kt(Xt),pluginsCDNPath:kt(Wt),sourceConfigUrl:kt(void 0),status:kt(void 0),initialized:kt(!1),logLevel:kt(Mt),loaded:kt(!1),readyCallbacks:kt([]),writeKey:kt(void 0),dataPlaneUrl:kt(void 0)},cn={enabled:kt(!1),initialized:kt(!1),data:kt({}),activeConsentManagerPluginName:kt(void 0),preConsent:kt({enabled:!1}),postConsent:kt({}),resolutionStrategy:kt("and"),provider:kt(void 0),metadata:kt(void 0)},dn={retries:kt(0),dropped:kt(0),sent:kt(0),queued:kt(0),triggered:kt(0),metricsServiceUrl:kt(void 0)},vn={app:kt({name:Xe,namespace:"com.rudderlabs.javascript",version:We,installType:"cdn"}),traits:kt(null),library:kt({name:Xe,version:We,snippetVersion:globalThis.RudderSnippetVersion}),userAgent:kt(null),device:kt(null),network:kt(null),os:kt({name:"",version:""}),locale:kt(null),screen:kt({density:0,width:0,height:0,innerWidth:0,innerHeight:0}),"ua-ch":kt(void 0),timezone:kt(void 0)},fn={configuredDestinations:kt([]),activeDestinations:kt([]),loadOnlyIntegrations:kt({}),failedDestinations:kt([]),loadIntegration:kt(!0),initializedDestinations:kt([]),clientDestinationsReady:kt(!1),integrationsConfig:kt({})},hn={toBeProcessedArray:kt([]),readyCallbacksArray:kt([])},gn={ready:kt(!1),loadedPlugins:kt([]),failedPlugins:kt([]),pluginsToLoadFromConfig:kt([]),activePlugins:kt([]),totalPluginsToLoad:kt(0)},pn={encryptionPluginName:kt(void 0),migrate:kt(!1),type:kt(void 0),cookie:kt(void 0),entries:kt({}),trulyAnonymousTracking:kt(!1)},yn={isEnabledServerSideCookies:kt(!1),dataServiceUrl:kt(void 0)},mn={eventsQueuePluginName:kt(void 0),deliveryEnabled:kt(!0)},bn={enabled:kt(!1),pageLifecycle:{enabled:kt(!1),visitId:kt(void 0),pageLoadedTimestamp:kt(void 0)}},kn=h({},_({capabilities:an,consents:cn,context:vn,eventBuffer:hn,lifecycle:ln,loadOptions:tn,metrics:dn,nativeDestinations:fn,plugins:gn,reporting:sn,session:on,source:un,storage:pn,serverCookies:yn,dataPlaneEvents:mn,autoTrack:bn}));function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var An,Sn={exports:{}},In={exports:{}};In.exports;function Tn(){return An||(An=1,In.exports=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var i=["isConstructor","isEval","isNative","isToplevel"],r=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=["args"],s=["evalOrigin"],u=i.concat(r,o,a,s);function l(e){if(e)for(var n=0;n<u.length;n++)void 0!==e[u[n]]&&this["set"+t(u[n])](e[u[n]])}l.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof l)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new l(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",i=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:i?i+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},l.fromString=function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),i=e.substring(0,t),r=e.substring(t+1,n).split(","),o=e.substring(n+1);if(0===o.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),s=a[1],u=a[2],c=a[3];return new l({functionName:i,args:r||void 0,fileName:s,lineNumber:u||void 0,columnNumber:c||void 0})};for(var c=0;c<i.length;c++)l.prototype["get"+t(i[c])]=n(i[c]),l.prototype["set"+t(i[c])]=function(e){return function(t){this[e]=Boolean(t)}}(i[c]);for(var d=0;d<r.length;d++)l.prototype["get"+t(r[d])]=n(r[d]),l.prototype["set"+t(r[d])]=function(t){return function(n){if(!e(n))throw new TypeError(t+" must be a Number");this[t]=Number(n)}}(r[d]);for(var v=0;v<o.length;v++)l.prototype["get"+t(o[v])]=n(o[v]),l.prototype["set"+t(o[v])]=function(e){return function(t){this[e]=String(t)}}(o[v]);return l}()),In.exports}var wn;var Pn,On,Cn,Dn,Rn=(wn||(wn=1,Sn.exports=(Pn=Tn(),On=/(^|@)\S+:\d+/,Cn=/^\s*at .*(\S+:\d+|\(native\))/m,Dn=/^(eval@)?(\[native code])?$/,{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(Cn))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Cn)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;var i=this.extractLocation(n?n[1]:t),r=n&&t||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Pn({functionName:r,fileName:o,lineNumber:i[1],columnNumber:i[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Dn)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Pn({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new Pn({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),i=[],r=2,o=n.length;r<o;r+=2){var a=t.exec(n[r]);a&&i.push(new Pn({fileName:a[2],lineNumber:a[1],source:n[r]}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[],r=0,o=n.length;r<o;r+=2){var a=t.exec(n[r]);a&&i.push(new Pn({functionName:a[3]||void 0,fileName:a[2],lineNumber:a[1],source:n[r]}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(On)&&!e.match(/^Error created at/)}),this).map((function(e){var t,n=e.split("@"),i=this.extractLocation(n.pop()),r=n.shift()||"",o=r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;r.match(/\(([^)]*)\)/)&&(t=r.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new Pn({functionName:o,args:a,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})}),this)}}
1)),Sn.exports),Mn=En(Rn),Ln="global code",_n=function(e){return H(e)?e:""};function Nn(e,t,n,i){return{errorClass:_n(e),message:"".concat(n).concat(_n(t)),type:"browserjs",stacktrace:i.reduce((function(e,t){var n=function(e){var t,n={file:e.fileName,method:(t=e.functionName,V(t)&&/^global code$/i.test(t)?Ln:t),lineNumber:e.lineNumber,columnNumber:e.columnNumber};return n.lineNumber&&n.lineNumber>-1&&!n.file&&!n.method&&(n.file=Ln),n}(t);try{return"{}"===JSON.stringify(n)?e:e.concat(n)}catch(i){return e}}),[])}}var xn=function(e,t){var n,i,r;return X(e)&&H(Ke(e))?n=e:(t.warn((i=Ee,r=Fe(e),"".concat(i).concat(Be,"Ignoring a non-error: ").concat(r,"."))),n=void 0),n},Bn=function(e,t){try{return JSON.parse(e||"")}catch(n){t(Ve(n,"Failed to parse response data"))}},Un="The request failed",jn=[/Failed to fetch dynamically imported module: .*/],Gn=[/Failed to load the script with the id .*/,/A timeout of \d+ ms occurred while trying to load the script with id .*/],Fn=[new RegExp("".concat(Un,".*")),/A script with the id .* is already loaded\./],Hn={headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},method:"GET"},zn=function(e,t,n){var i=Z(Hn,t||{});return n&&(i.headers=Z(i.headers,{Authorization:n})),i.url=e,i},Qn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4,n=arguments.length>2?arguments[2]:void 0;return new Promise((function(i,r){var o;if(!0===e.sendRawData)o=e.data;else if(o=Fe(e.data,!1,[],n),z(o))return void r({error:new Error("Failed to prepare data for the request."),undefined:void 0,options:e});var a,s,u=new XMLHttpRequest,l=function(t){r({error:new Error(Ft(Un,t,e.url)),xhr:u,options:e})};u.ontimeout=l,u.onerror=l,u.onload=function(){var t,n,o,a,s;u.status>=200&&u.status<400?i({response:u.responseText,xhr:u,options:e}):r({error:new Error((t=Un,n=u.status,o=u.statusText,a=e.url,s=u.responseText,"".concat(t," with status ").concat(n," (").concat(o,") for URL: ").concat(a,". Response: ").concat(s.trim()))),xhr:u,options:e})},u.open(e.method,e.url,!0),!0===e.withCredentials&&(u.withCredentials=!0),u.timeout=t,Object.keys(e.headers).forEach((function(t){e.headers[t]&&u.setRequestHeader(t,e.headers[t])}));try{u.send(o)}catch(c){r({error:Ve(c,(a=Un,s=e.url,"".concat(a," for URL: ").concat(s))),xhr:u,options:e})}}))},Kn=function(){return s((function e(t){o(this,e),this.logger=t,this.onError=this.onError.bind(this)}),[{key:"init",value:function(e){this.errorHandler=e}},{key:"getData",value:(e=i(g().mark((function e(t){var n,i,r,o,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url,i=t.options,r=t.timeout,o=t.isRawResponse,e.prev=1,e.next=4,Qn(zn(n,i,this.basicAuthHeader),r,this.logger);case 4:return a=e.sent,e.abrupt("return",{data:o?a.response:Bn(a.response,this.onError),details:a});case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",{data:void 0,details:e.t0});case 11:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(t){return e.apply(this,arguments)})},{key:"getAsyncData",value:function(e){var t=this,n=e.callback,i=e.url,r=e.options,o=e.timeout,a=e.isRawResponse,s=!F(n);Qn(zn(i,r,this.basicAuthHeader),o,this.logger).then((function(e){s||n(a?e.response:Bn(e.response,t.onError),e)})).catch((function(e){s||n(void 0,e)}))}},{key:"onError",value:function(e){var t;null===(t=this.errorHandler)||void 0===t||t.onError(e,"HttpClient")}},{key:"setAuthHeader",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e:se("".concat(e,":"));this.basicAuthHeader="Basic ".concat(t)}},{key:"resetAuthHeader",value:function(){this.basicAuthHeader=void 0}}]);var e}(),Vn=new Kn(_t),qn=["www.test-host.com","localhost","127.0.0.1","[::1]"],Xn=["userId","userTraits","groupId","groupTraits","anonymousId","config","instance","eventBuffer","traits","authToken"],Wn=function(e){var t=Fe(e,!1,Xn);return null!==t?JSON.parse(t):{}},Jn=function(e,t,n,i){var r,o,a,s,u,l;return{id:"".concat(null!==(r=null===(o=e.value)||void 0===o?void 0:o.id)&&void 0!==r?r:n.writeKey.value,"..").concat(null!==(a=t.sessionInfo.value.id)&&void 0!==a?a:"NA","..").concat(null!==(s=i.pageLifecycle.visitId.value)&&void 0!==s?s:"NA"),name:null!==(u=null===(l=e.value)||void 0===l?void 0:l.name)&&void 0!==u?u:"NA"}},Yn=function(e,t){var n,i;return{locale:null!==(n=e.value)&&void 0!==n?n:"NA",userAgent:null!==(i=t.value)&&void 0!==i?i:"NA",time:new Date}},$n=function(e,t){var n={version:"1",message_id:Le(),source:{name:"js",sdk_version:t.context.app.value.version,write_key:t.lifecycle.writeKey.value,install_type:t.context.app.value.installType},errors:e};return Fe(n)},Zn=function(){return s((function e(t,n){o(this,e),u(this,"initialized",!1),this.httpClient=t,this.logger=n}),[{key:"init",value:function(){this.initialized||(this.attachErrorListeners(),this.initialized=!0)}},{key:"attachErrorListeners",value:function(){var e=this;globalThis.addEventListener("error",(function(t){e.onError(t,Ee,void 0,Nt.UNHANDLEDEXCEPTION)})),globalThis.addEventListener("unhandledrejection",(function(t){e.onError(t,Ee,void 0,Nt.UNHANDLEDREJECTION)}))}},{key:"onError",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nt.HANDLEDEXCEPTION;try{var o=function(e,t){switch(t){case Nt.UNHANDLEDEXCEPTION:return e.error||e;
1case Nt.UNHANDLEDREJECTION:return e.reason;case Nt.HANDLEDEXCEPTION:default:return e}}(e,r),a=xn(o,this.logger);if(Q(a))return;var s=i?"".concat(i," - "):"",u=function(e,t){try{var n=Mn.parse(e);return Nn(e.name,e.message,t,n)}catch(i){return Nn(e.name,e.message,t,[])}}(a,"".concat(n).concat(Be).concat(s)),l=Ke(a).includes(Qe);if(!l&&!function(e){var t,n=null===(t=e.stacktrace[0])||void 0===t?void 0:t.file;if(!n||"string"!=typeof n)return!1;var i=n.substring(n.lastIndexOf("/")+1),r=n.split("/");return r[r.length-2]===zt||["rsa"].some((function(e){return i.startsWith(e)&&i.endsWith(".js")}))}(u)&&r!==Nt.HANDLEDEXCEPTION)return;if(kn.reporting.isErrorReportingEnabled.value&&(t=u.message,jn.some((function(e){return e.test(t)}))||Gn.some((function(e){return e.test(t)}))?t.includes(Vt):!Fn.some((function(e){return e.test(t)})))){var c=function(e,t,n){var i,r=n.context,o=n.lifecycle,a=n.session,s=n.source,u=n.reporting,l=n.autoTrack,c=r.app,d=r.locale,v=r.userAgent,f=r.timezone,g=r.screen,p=r.library;return{payloadVersion:"5",notifier:{name:"RudderStack JavaScript SDK",version:c.value.version,url:"__REPOSITORY_URL__"},events:[{exceptions:[_(e)],severity:t.severity,unhandled:t.unhandled,severityReason:t.severityReason,app:{version:c.value.version,releaseStage:(i=globalThis.location.hostname,i&&qn.includes(i)?"development":"production"),type:c.value.installType},device:Yn(d,v),request:{url:globalThis.location.href.split("?")[0],clientIp:"[NOT COLLECTED]"},breadcrumbs:_(u.breadcrumbs.value),context:e.message,metaData:h({app:{snippetVersion:p.value.snippetVersion},device:h(h({},g.value),{},{timezone:f.value})},Wn(n)),user:Jn(s,a,o,l)}]}}(u,{severity:"error",unhandled:r!==Nt.HANDLEDEXCEPTION,severityReason:{type:r}},kn);this.httpClient.getAsyncData({url:kn.metrics.metricsServiceUrl.value,options:{method:"POST",data:$n(c,kn),sendRawData:!0},isRawResponse:!0})}(r===Nt.HANDLEDEXCEPTION||l)&&this.logger.error(u.message)}catch(d){this.logger.error(function(e){return"".concat(e).concat(Be,"Failed to handle the error.")}(Ee),d)}}},{key:"leaveBreadcrumb",value:function(e){try{kn.reporting.breadcrumbs.value=[].concat(b(kn.reporting.breadcrumbs.value),[(t=e,{type:"manual",name:t,timestamp:new Date,metaData:{}})])}catch(n){this.onError(n,"".concat(Ee).concat(Be,"Failed to log breadcrumb."))}var t}}])}(),ei=new Zn(Vn,_t),ti=function(){return s((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),u(this,"plugins",[]),u(this,"byName",{}),u(this,"cache",{}),u(this,"config",{throws:!0}),this.config=h({throws:!0},n),this.logger=t}),[{key:"register",value:function(e,t){if(e.name){if(this.byName[e.name]){var n=function(e,t){return"".concat(e).concat(Be,'Plugin "').concat(t,'" already exists.')}(Ae,e.name);if(this.config.throws)throw new Error(n);this.logger.error(n)}else{this.cache={},this.plugins=this.plugins.slice();var i=this.plugins.length;this.plugins.forEach((function(t,n){var r;null!==(r=t.deps)&&void 0!==r&&r.includes(e.name)&&(i=Math.min(i,n))})),this.plugins.splice(i,0,e),this.byName[e.name]=e,F(e.initialize)&&e.initialize(t)}}else{var r="".concat(Ae).concat(Be,"Plugin name is missing.");if(this.config.throws)throw new Error(r);this.logger.error(r,e)}}},{key:"unregister",value:function(e){var t=this.byName[e];if(t){var n=this.plugins.indexOf(t);if(-1!==n)this.cache={},delete this.byName[e],this.plugins=this.plugins.slice(),this.plugins.splice(n,1);else{var i=function(e,t){return"".concat(e).concat(Be,'Plugin "').concat(t,'" not found in plugins but found in byName. This indicates a bug in the plugin engine. Please report this issue to the development team.')}(Ae,e);if(this.config.throws)throw new Error(i);this.logger.error(i)}}else{var r=function(e,t){return"".concat(e).concat(Be,'Plugin "').concat(t,'" not found.')}(Ae,e);if(this.config.throws)throw new Error(r);this.logger.error(r)}}},{key:"getPlugin",value:function(e){return this.byName[e]}},{key:"getPlugins",value:function(e){var t=this,n=null!=e?e:".";return this.cache[n]||(this.cache[n]=this.plugins.filter((function(e){var i;if(null!==(i=e.deps)&&void 0!==i&&i.some((function(e){return!t.byName[e]}))){var r=e.deps.filter((function(e){return!t.byName[e]}));return t.logger.error(function(e,t,n){return"".concat(e).concat(Be,'Plugin "').concat(t,'" could not be loaded because some of its dependencies "').concat(n,'" do not exist.')}(Ae,e.name,r)),!1}return"."===n||function(e,t){return Boolean(W(e,t))}(e,n)}))),this.cache[n]}},{key:"processRawPlugins",value:function(e){e(this.plugins),this.cache={}}},{key:"invoke",value:function(e){for(var t,n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length,o=new Array(r>2?r-2:0),a=2;a<r;a++)o[a-2]=arguments[a];var s=e;if(!s)throw new Error("Failed to invoke plugin because the extension point name is missing.");var u=s.startsWith("!"),l=null!==(t=this.config.throws)&&void 0!==t?t:s.endsWith("!");if(!(s=s.replace(/(^!|!$)/g,"")))throw new Error("Failed to invoke plugin because the extension point name is invali
1d.");var c=s.split(".");c.pop();var d=c.join(".");return(i?this.getPlugins(s):[this.getPlugins(s)[0]]).map((function(e){var t=W(e,s);if(!F(t)||u)return t;try{return t.apply(W(e,d),o)}catch(i){if(l)throw i;n.logger.error(function(e,t,n){return"".concat(e).concat(Be,'Failed to invoke the "').concat(t,'" extension point of plugin "').concat(n,'".')}(Ae,s,e.name),i)}return null}))}},{key:"invokeSingle",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return this.invoke.apply(this,[e,!1].concat(n))[0]}},{key:"invokeMultiple",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return this.invoke.apply(this,[e,!0].concat(n))}}])}(),ni=new ti(_t,{throws:!0}),ii=function(e){return Boolean("cloud"!==e.config.connectionMode||!0===e.config.useNativeSDKToSend||!0===e.config.useNativeSDK)},ri=function(e){return Boolean("hybrid"===e.config.connectionMode||!0===e.config.useNativeSDKToSend)},oi=function(e){return e.filter(ii)},ai=["BeaconQueue","CustomConsentManager","DeviceModeDestinations","DeviceModeTransformation","ExternalAnonymousId","GoogleLinker","IubendaConsentManager","KetchConsentManager","NativeDestinationQueue","OneTrustConsentManager","StorageEncryption","StorageEncryptionLegacy","StorageMigrator","XhrQueue"],si=["Bugsnag","ErrorReporting"],ui="cookieStorage",li="localStorage",ci="sessionStorage",di="memoryStorage",vi="none",fi=function(e){return e.replace(/\/{2,}/g,"/")},hi=function(e){if(!H(e))return!1;try{return F(globalThis.URL)&&new URL(e),Qt.test(e)}catch(mt){return!1}},gi=function(e){return 429===e||!(e>=400&&e<500)},pi=function(e,t){try{return encodeURIComponent(e)}catch(n){return void(null==t||t.error("Failed to encode the cookie data.",n))}},yi=function(e){try{return decodeURIComponent(e)}catch(t){return}},mi=function(){var e,t,n,i=globalThis.document.cookie;return t={},(n=i.split(/\s*;\s*/))[0]?(n.forEach((function(n){var i=(e=n.split("="))[0]?yi(e[0]):void 0;i&&(t[i]=e[1]?yi(e[1]):void 0)})),t):t},bi=function(e,t,n,i){switch(arguments.length){case 4:case 3:case 2:return function(e,t,n,i){var r=h({},n||{}),o="".concat(pi(e,i),"=").concat(pi(t,i));z(t)&&(r.maxage=-1),r.maxage&&(r.expires=new Date(+new Date+r.maxage)),r.path&&(o+="; path=".concat(r.path)),r.domain&&(o+="; domain=".concat(r.domain)),r.expires&&(o+="; expires=".concat(r.expires.toUTCString())),r.samesite&&(o+="; samesite=".concat(r.samesite)),r.secure&&(o+="; secure"),globalThis.document.cookie=o}(e,t,n,i);case 1:return e?function(e){return mi()[e]}(e):mi();default:return mi()}},ki={userId:"rl_user_id",userTraits:"rl_trait",anonymousId:"rl_anonymous_id",groupId:"rl_group_id",groupTraits:"rl_group_trait",initialReferrer:"rl_page_init_referrer",initialReferringDomain:"rl_page_init_referring_domain",sessionInfo:"rl_session",authToken:"rl_auth_token"},Ei="RS_ENC_v3_",Ai=function(e){return null!=e&&e.startsWith(Ei)?ue(e.substring(10)):e},Si="QueueUtilities",Ii=function(e,t){return Fe(e,!0,void 0,t)},Ti=function(e,t){return Fe(e,!0,void 0,t)},wi=function(e,t){var n=Ii(e,t);if(n){var i=n.length;i>32768&&(null==t||t.warn(function(e,t,n){return"".concat(e).concat(Be,"The size of the event payload (").concat(t," bytes) exceeds the maximum limit of ").concat(n," bytes. Events with large payloads may be dropped in the future. Please review your instrumentation to ensure that event payloads are within the size limit.")}(Si,i,32768)))}else null==t||t.warn("".concat(Si).concat(Be,"Failed to validate event payload size. Please make sure that the event payload is within the size limit and is a valid JSON object."))},Pi=function(e,t){var n=_(e);return n.sentAt=t,n},Oi={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack",BATCH_QUEUE:"batchQueue"},Ci={maxItems:10,flushQueueInterval:6e5},Di="v1",Ri="BeaconQueuePlugin",Mi=function(e,t,n){var i={batch:e,sentAt:t};try{var r=Fe(i,!0);if(r)return new Blob([r],{type:"text/plain"});null==n||n.error("".concat(Ri).concat(Be,"Failed to convert events batch object to string."))}catch(o){null==n||n.error(function(e){return"".concat(e).concat(Be,"Failed to convert events batch object to Blob.")}(Ri),o)}},Li=function(e){return e[e.ASAP=1]="ASAP",e[e.RESCHEDULE=2]="RESCHEDULE",e[e.ABANDON=3]="ABANDON",e}({}),_i={setTimeout:function(e,t){return globalThis.setTimeout(e,t)},clearTimeout:function(e){return globalThis.clearTimeout(e)},Date:globalThis.Date,clockLateFactor:2},Ni=function(){return s((function e(){o(this,e),this.tasks={},this.nextId=1,this.clock=_i}),[{key:"now",value:function(){return+new this.clock.Date}},{key:"run",value:function(e,t,n){var i=(this.nextId+1).toString();return this.tasks[i]=this.clock.setTimeout(this.handle(i,e,t,n||Li.ASAP),t),i}},{key:"handle",value:function(e,t,n,i){var r=this,o=this.now();return function(){delete r.tasks[e];var a=o+n*(r.clock.clockLateFactor||2),s=r.now();if(!(i>=Li.RESCHEDULE&&a<s))return t();i===Li.RESCHEDULE&&r.run(t,n,i)}}},{key:"cancel",value:function(e){this.tasks[e]&&(this.clock.clearTimeout(this.tasks[e]),delete this.tasks[e])}},{key:"cancelAll",value:function(){Object.values(this.tasks).forEac
1h(this.clock.clearTimeout),this.tasks={}}}])}(),xi=1/0,Bi=1/0,Ui=524288,ji="Batch",Gi="Single",Fi=function(e,t){return e.time-t.time},Hi="RetryQueue",zi=function(){return s((function e(t,n,i,r){var a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:li,u=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0;o(this,e),this.storeManager=r,this.logger=u,this.name=t,this.id=Le(),this.processQueueCb=i,this.batchSizeCalcCb=l,this.maxItems=n.maxItems||Bi,this.maxAttempts=n.maxAttempts||xi,this.batch={enabled:!1},this.configureBatchMode(n),this.backoff={minRetryDelay:n.minRetryDelay||1e3,maxRetryDelay:n.maxRetryDelay||3e4,factor:n.backoffFactor||2,jitter:n.backoffJitter||0};var c=Math.max(null!==(a=n.timerScaleFactor)&&void 0!==a?a:1,1);c=Math.min(c,10),this.timeouts={ackTimer:Math.round(1e3*c),reclaimTimer:Math.round(3e3*c),reclaimTimeout:Math.round(1e4*c),reclaimWait:Math.round(500*c)},this.schedule=new Ni,this.processId="0",this.store=this.storeManager.setStore({id:this.id,name:this.name,validKeys:Oi,type:s,errorHandler:this.storeManager.errorHandler,logger:this.storeManager.logger}),this.setDefaultQueueEntries(),this.ack=this.ack.bind(this),this.checkReclaim=this.checkReclaim.bind(this),this.processHead=this.processHead.bind(this),this.flushBatch=this.flushBatch.bind(this),this.isPageAccessible=!0,this.flushBatchOnPageLeave(),this.scheduleTimeoutActive=!1}),[{key:"setDefaultQueueEntries",value:function(){this.setStorageEntry(Oi.IN_PROGRESS,{}),this.setStorageEntry(Oi.QUEUE,[]),this.setStorageEntry(Oi.BATCH_QUEUE,[])}},{key:"configureBatchMode",value:function(e){if(this.batchingInProgress=!1,Y(e.batch)){var t,n,i,r=e.batch;if(this.batch.enabled=!0===r.enabled,this.batch.enabled)this.batch.maxSize=Math.min(null!==(t=r.maxSize)&&void 0!==t?t:Ui,Ui),this.batch.maxItems=null!==(n=r.maxItems)&&void 0!==n?n:100,this.batch.flushInterval=null!==(i=r.flushInterval)&&void 0!==i?i:6e4}}},{key:"flushBatchOnPageLeave",value:function(){this.batch.enabled&&_e(this.flushBatch)}},{key:"getStorageEntry",value:function(e){return this.store.get(e)}},{key:"setStorageEntry",value:function(e,t){K(t)?this.store.remove(e):this.store.set(e,t)}},{key:"stop",value:function(){this.schedule.cancelAll(),this.scheduleTimeoutActive=!1}},{key:"start",value:function(){this.scheduleTimeoutActive&&this.stop(),this.scheduleTimeoutActive=!0,this.scheduleFlushBatch(),this.ack(),this.checkReclaim(),this.processHead()}},{key:"scheduleFlushBatch",value:function(){var e;this.batch.enabled&&null!==(e=this.batch)&&void 0!==e&&e.flushInterval&&(this.flushBatchTaskId&&this.schedule.cancel(this.flushBatchTaskId),this.flushBatchTaskId=this.schedule.run(this.flushBatch,this.batch.flushInterval,Li.ASAP))}},{key:"flushBatch",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.batchingInProgress){var t;this.isPageAccessible=e,this.batchingInProgress=!0;var n=null!==(t=this.getStorageEntry(Oi.BATCH_QUEUE))&&void 0!==t?t:[];if(n.length>0){n=n.slice(-n.length);var i=this.genQueueItem(n.map((function(e){return e.item})),ji);this.setStorageEntry(Oi.BATCH_QUEUE,[]),this.pushToMainQueue(i)}this.batchingInProgress=!1,this.scheduleFlushBatch()}}},{key:"shouldRetry",value:function(e,t){return t<=this.maxAttempts}},{key:"getDelay",value:function(e){var t=this.backoff.minRetryDelay*Math.pow(this.backoff.factor,e);if(this.backoff.jitter){var n=Math.random(),i=Math.floor(n*this.backoff.jitter*t);Math.floor(10*n)<5?t-=i:t+=i}return Number(Math.min(t,this.backoff.maxRetryDelay).toPrecision(1))}},{key:"enqueue",value:function(e){var t;(t=this.batch.enabled&&e.type===Gi?this.handleNewItemForBatch(e):e)&&this.pushToMainQueue(t)}},{key:"handleNewItemForBatch",value:function(e){var t,n,i=null!==(t=this.getStorageEntry(Oi.BATCH_QUEUE))&&void 0!==t?t:[];if(this.batchingInProgress)i.push(e);else{this.batchingInProgress=!0,(i=i.slice(-i.length)).push(e);var r=this.getBatchDispatchInfo(i);if(r.criteriaMet||r.criteriaExceeded){var o;if(r.criteriaExceeded?(o=i.slice(0,i.length-1),i=[e]):(o=i,i=[]),o.length>0){var a=o.every((function(e){return e.reclaimed})),s=o.map((function(e){return e.item}));n=a?this.genQueueItem(s,ji,!0):this.genQueueItem(s,ji)}
1this.scheduleFlushBatch()}this.batchingInProgress=!1}return this.setStorageEntry(Oi.BATCH_QUEUE,i),n}},{key:"pushToMainQueue",value:function(e){var t,n=null!==(t=this.getStorageEntry(Oi.QUEUE))&&void 0!==t?t:[];(n=this.maxItems>1?n.slice(-(this.maxItems-1)):[]).push(e),n=n.sort(Fi),this.setStorageEntry(Oi.QUEUE,n),this.scheduleTimeoutActive&&this.processHead()}},{key:"addItem",value:function(e){this.enqueue(this.genQueueItem(e))}},{key:"genQueueItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gi,n=arguments.length>2?arguments[2]:void 0;return h({item:e,attemptNumber:0,time:this.schedule.now(),id:Le(),type:t},V(n)?{reclaimed:n}:{})}},{key:"requeue",value:function(e){var t=e.attemptNumber,n=e.item,i=e.type,r=e.id,o=e.firstAttemptedAt,a=e.lastAttemptedAt,s=e.reclaimed,u=t+1;this.shouldRetry(n,u)&&this.enqueue({item:n,attemptNumber:u,time:this.schedule.now()+this.getDelay(u),id:null!=r?r:Le(),type:i,firstAttemptedAt:o,lastAttemptedAt:a,reclaimed:s})}},{key:"getBatchDispatchInfo",value:function(e){var t,n,i=!1,r=!1,o=null===(t=this.batch)||void 0===t?void 0:t.maxItems;if(V(o)&&(i=e.length===o,r=e.length>o),i||r)return{criteriaMet:i,criteriaExceeded:r};var a=!1,s=!1,u=null===(n=this.batch)||void 0===n?void 0:n.maxSize;if(V(u)&&V(this.batchSizeCalcCb)){var l=this.batchSizeCalcCb(e.map((function(e){return e.item})));a=l===u,s=l>u}return{criteriaMet:a,criteriaExceeded:s}}},{key:"processHead",value:function(){var e,t,n,i=this;this.schedule.cancel(this.processId);var r=null!==(e=this.getStorageEntry(Oi.QUEUE))&&void 0!==e?e:[],o=this.schedule.now(),a=[],s=function(e,t){return function(n,r){var o,a=null!==(o=i.getStorageEntry(Oi.IN_PROGRESS))&&void 0!==o?o:{},s=a[t],u=null==s?void 0:s.firstAttemptedAt,l=null==s?void 0:s.lastAttemptedAt;delete a[t],i.setStorageEntry(Oi.IN_PROGRESS,a),n&&i.requeue(h(h({},e),{},{firstAttemptedAt:u,lastAttemptedAt:l}))}},u=function(e,t){a.push({id:t,item:e.item,done:s(e,t),attemptNumber:e.attemptNumber})},l=null!==(t=this.getStorageEntry(Oi.IN_PROGRESS))&&void 0!==t?t:{};this.isPageAccessible||(l={});for(var c=Object.keys(l).length;r.length>0&&r[0].time<=o&&c++<this.maxItems;){var d=r.shift();if(d){var v=Le();this.isPageAccessible&&(l[v]={item:d.item,attemptNumber:d.attemptNumber,time:this.schedule.now(),type:d.type,firstAttemptedAt:d.firstAttemptedAt,lastAttemptedAt:d.lastAttemptedAt,reclaimed:d.reclaimed}),u(d,v)}}if(this.setStorageEntry(Oi.QUEUE,r),this.setStorageEntry(Oi.IN_PROGRESS,l),a.forEach((function(e){try{var t,n,r,o,a=i.schedule.now(),s=null!==(t=i.getStorageEntry(Oi.IN_PROGRESS))&&void 0!==t?t:{},u=s[e.id],l=null!==(n=null==u?void 0:u.firstAttemptedAt)&&void 0!==n?n:a,c=null!==(r=null==u?void 0:u.lastAttemptedAt)&&void 0!==r?r:a,d=Math.round((a-l)/1e3),v=Math.round((a-c)/1e3),f=null!==(o=null==u?void 0:u.reclaimed)&&void 0!==o&&o;u.firstAttemptedAt=l,u.lastAttemptedAt=a,s[e.id]=u,i.setStorageEntry(Oi.IN_PROGRESS,s);var h=i.shouldRetry(e.item,e.attemptNumber+1);i.processQueueCb(e.item,e.done,{retryAttemptNumber:e.attemptNumber,maxRetryAttempts:i.maxAttempts,willBeRetried:h,timeSinceFirstAttempt:d,timeSinceLastAttempt:v,reclaimed:f})}catch(y){var g,p="";e.attemptNumber<i.maxAttempts?(p="The item will be requeued.",e.attemptNumber>0&&(p="".concat(p," Retry attempt ").concat(e.attemptNumber," of ").concat(i.maxAttempts,".")),e.done(y)):(p="Retries exhausted (".concat(i.maxAttempts,"). The item will be dropped."),e.done()),null===(g=i.logger)||void 0===g||g.error(function(e,t){return"".concat(e).concat(Be,"An unknown error occurred while processing the queue item. ").concat(t)}(Hi,p),y)}})),r=null!==(n=this.getStorageEntry(Oi.QUEUE))&&void 0!==n?n:[],this.schedule.cancel(this.processId),r.length>0){var f=r[0].time-o;this.processId=this.schedule.run(this.processHead,f,Li.ASAP)}}},{key:"ack",value:function(){this.setStorageEntry(Oi.ACK,this.schedule.now()),null!=this.reclaimStartVal&&(this.reclaimStartVal=null,this.setStorageEntry(Oi.RECLAIM_START,null)),null!=this.reclaimEndVal&&(this.reclaimEndVal=null,this.setStorageEntry(Oi.RECLAIM_END,null)),this.schedule.run(this.ack,this.timeouts.ackTimer,Li.ASAP)}},{key:"reclaim",value:function(e){var t,n,i,r,o=this,a=this.storeManager.setStore({id:e,name:this.name,validKeys:Oi,type:li,errorHandler:this.storeManager.errorHandler,logger:this.storeManager.logger}),s={queue:null!==(t=this.getStorageEntry(Oi.QUEUE))&&void 0!==t?t:[]},u={inProgress:null!==(n=a.get(Oi.IN_PROGRESS))&&void 0!==n?n:{},batchQueue:null!==(i=a.get(Oi.BATCH_QUEUE))&&void 0!==i?i:[],queue:null!==(r=a.get(Oi.QUEUE))&&void 0!==r?r:[]},l=[],c=function(e,t){var n=function(e){var n,i=null!==(n=e.id)&&void 0!==n?n:Le();if(l.includes(i));else{var r,a=Array.isArray(e.item)?ji:Gi;
1s.queue.push({item:e.item,attemptNumber:e.attemptNumber+t,time:o.schedule.now(),id:i,type:null!==(r=e.type)&&void 0!==r?r:a,firstAttemptedAt:e.firstAttemptedAt,lastAttemptedAt:e.lastAttemptedAt,reclaimed:!0}),l.push(i)}};Array.isArray(e)?e.forEach(n):e&&Object.values(e).forEach(n)};c(u.queue,0),this.batch.enabled?u.batchQueue.forEach((function(e){var t,n,i=null!==(t=e.id)&&void 0!==t?t:Le();l.includes(i)||(o.enqueue(h(h({},e),{},{id:i,reclaimed:!0,type:null!==(n=e.type)&&void 0!==n?n:Gi,time:o.schedule.now()})),l.push(i))})):c(u.batchQueue,0),c(u.inProgress,1),s.queue.sort(Fi),this.setStorageEntry(Oi.QUEUE,s.queue),this.clearQueueEntries(a,1),this.processHead()}},{key:"clearQueueEntries",value:function(e,t){this.removeStorageEntry(e,0,t)}},{key:"removeStorageEntry",value:function(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=Object.keys(Oi),a=Oi[o[t]];globalThis.setTimeout((function(){try{e.remove(a),t+1<o.length&&i.removeStorageEntry(e,t+1,n)}catch(l){var s,u="NS_ERROR_STORAGE_BUSY";if((l.name===u||l.code===u||2153971713===l.code)&&r<2)i.removeStorageEntry(e,t,n+40,r+1);else null===(s=i.logger)||void 0===s||s.error(function(e,t,n){return"".concat(e).concat(Be,'Failed to remove local storage entry "').concat(t,'" (attempt: ').concat(n,".")}(Hi,a,r),l);2===r&&t+1<o.length&&i.removeStorageEntry(e,t+1,n)}}),n)}},{key:"checkReclaim",value:function(){var e=this,t=function(t){return function(){t.get(Oi.RECLAIM_START)===e.id&&(t.set(Oi.RECLAIM_END,e.id),e.schedule.run(function(t){return function(){t.get(Oi.RECLAIM_END)===e.id&&t.get(Oi.RECLAIM_START)===e.id&&e.reclaim(t.id)}}(t),e.timeouts.reclaimWait,Li.ABANDON))}};(function(t){var n=[],i=e.store.getOriginalEngine(),r=[];if(F(i.keys))r=i.keys();else for(var o=0;o<i.length;o++){var a=i.key(o);a&&r.push(a)}return r.forEach((function(i){var r=i?i.split("."):[];r.length>=3&&r[0]===t&&r[1]!==e.id&&r[2]===Oi.ACK&&n.push(e.storeManager.setStore({id:r[1],name:t,validKeys:Oi,type:li,errorHandler:e.storeManager.errorHandler,logger:e.storeManager.logger}))})),n}
1)(this.name).forEach((function(n){e.schedule.now()-n.get(Oi.ACK)<e.timeouts.reclaimTimeout||function(n){n.set(Oi.RECLAIM_START,e.id),n.set(Oi.ACK,e.schedule.now()),e.schedule.run(t(n),e.timeouts.reclaimWait,Li.ABANDON)}(n)})),this.schedule.run(this.checkReclaim,this.timeouts.reclaimTimer,Li.RESCHEDULE)}},{key:"clear",value:function(){this.schedule.cancelAll(),this.setDefaultQueueEntries()}}])}(),Qi="BeaconQueue",Ki=function(){return{name:Qi,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Qi])},dataplaneEventsQueue:{init:function(e,t,n,i,r){var o,a,s=e.lifecycle.writeKey.value,u=function(e,t){var n=new URL(e);return new URL(fi([n.pathname,"/","beacon","/",Di,"/","batch?writeKey=".concat(t)].join("")),n).href}(e.lifecycle.activeDataplaneUrl.value,s),l=(a=null!==(o=e.loadOptions.value.beaconQueueOptions)&&void 0!==o?o:{},Z(Ci,a)),c=new zi("".concat("rudder_beacon","_").concat(s),{batch:{enabled:!0,flushInterval:l.flushQueueInterval,maxSize:65536,maxItems:l.maxItems}},(function(e,t){null==r||r.debug("".concat(Ri).concat(Be,"Sending events to data plane."));var n=xe(),o=e.map((function(e){return Pi(e.event,n)})),a=Mi(o,n,r);if(a)try{var s=navigator.sendBeacon(u,a);s||null==r||r.error(function(e){return"".concat(e).concat(Be,"Failed to send events batch data to the browser's beacon queue. The events will be dropped.")}(Ri)),t(null,s)}catch(l){null==i||i.onError(l,Ri,function(e){return"Failed to send events batch data to the browser's beacon queue for URL ".concat(e,".")}(u)),t(null)}else t(null)}),n,li,r,(function(e){var t=xe(),n=e.map((function(e){return e.event}));return Mi(n,t,r).size}));return c},enqueue:function(e,t,n,i,r){n.sentAt=xe(),wi(n,r),t.addItem({event:n})}}}},Vi="CustomConsentManager",qi=function(){return{name:Vi,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Vi])},consentManager:{init:function(e,t){},updateConsentsInfo:function(e,t,n){},isDestinationConsented:function(e,t,n,i){if(!e.consents.initialized.value)return!0;var r=e.consents.data.value.allowedConsentIds;try{var o,a=t.consentManagement;if(!a)return!0;var s=a.find((function(t){return t.provider===e.consents.provider.value}));if(null==s||!s.consents)return!0;var u=s.consents.map((function(e){return e.consent.trim()})).filter((function(e){return e})),l=null!==(o=s.resolutionStrategy)&&void 0!==o?o:e.consents.resolutionStrategy.value,c=function(e){return r.includes(e)};return"or"===l?u.some(c)||0===u.length:u.every(c)}catch(d){return null==n||n.onError(d,"CustomConsentManagerPlugin","Failed to determine the consent status for the destination. Please check the destination configuration and try again."),!0}}}}},Xi="DeviceModeDestinationsPlugin",Wi=function(e,t){return"".concat(e).concat(Be,"Failed to load script for destination ").concat(t,".")},Ji=function(e,t){var n,i=null===(n=e.All)||void 0===n||n;return t.filter((function(t){var n,r,o=t.displayName;return i?(n=!0,r=e[o],Q(r)||!1!==Boolean(r)||(n=!1)):(n=!1,function(e){return!Q(e)&&!0===Boolean(e)}(e[o])&&(n=!0)),n}))},Yi="ACTIVE_CAMPAIGN",$i="ActiveCampaign",Zi="ADOBE_ANALYTICS",er="Adobe Analytics",tr="ADROLL",nr="Adroll",ir="AM",rr="Amplitude",or="APPCUES",ar="Appcues",sr="AXEPTIO",ur="Axeptio",lr="BINGADS",cr="Bing Ads",dr="BRAZE",vr="Braze",fr="BUGSNAG",hr="Bugsnag",gr="CHARTBEAT",pr="Chartbeat",yr="CLEVERTAP",mr="CleverTap",br="COMMANDBAR",kr="CommandBar",Er="CONVERTFLOW",Ar="Convertflow",Sr="CRITEO",Ir="Criteo",Tr="CUSTOMERIO",wr="Customer IO",Pr="DCM_FLOODLIGHT",Or="DCM Floodlight",Cr="DRIP",Dr="Drip",Rr="ENGAGE",Mr="Engage",Lr="FACEBOOK_PIXEL",_r="Facebook Pixel",Nr="FULLSTORY",xr="Fullstory",Br="GA",Ur="Google Analytics",jr="GA360",Gr="Google Analytics 360",Fr="GA4",Hr="Google Analytics 4 (GA4)",zr="GA4_V2",Qr="Google Analytics 4 (GA4) V2",Kr="GAINSIGHT_PX",Vr="Gainsight PX",qr="GOOGLE_OPTIMIZE",Xr="Google Optimize",Wr="GOOGLEADS",Jr="Google Ads",Yr="GTM",$r="Google Tag Manager",Zr="HEAP",eo="Heap.io",to="HOTJAR",no="Hotjar",io="HS",ro="HubSpot",oo="INTERCOM",ao="Intercom",so="ITERABLE",uo="Iterable",lo="JUNE",co="JUNE",vo="KEEN",fo="Keen",ho="KISSMETRICS",go="Kiss Metrics",po="KLAVIYO",yo="Klaviyo",mo="LAUNCHDARKLY",bo="LaunchDarkly",ko="LEMNISK",Eo="Lemnisk Marketing Automation",Ao="LINKEDIN_INSIGHT_TAG",So="Linkedin Insight Tag",Io="LIVECHAT",To="livechat",wo="LOTAME",Po="Lotame",Oo="LYTICS",Co="Lytics",Do="MATOMO",Ro="Matomo",Mo="MICROSOFT_CLARITY",Lo="Microsoft Clarity",_o="MOENGAGE",No="MoEngage",xo="MOUSEFLOW",Bo="Mouseflow",Uo="MP",jo="Mixpanel",Go="NINETAILED",Fo="Ninetailed",Ho="OLARK",zo="Olark",Qo="OPTIMIZELY",Ko="Optimizely Web",Vo="PENDO",qo="Pendo",Xo="PINTEREST_TAG",Wo="Pinterest Tag",Jo="PODSIGHTS",Yo="Podsights",$o="POST_AFFILIATE_PRO",Zo="Post Aff
1iliate Pro",ea="POSTHOG",ta="PostHog",na="PROFITWELL",ia="ProfitWell",ra="QUALAROO",oa="Qualaroo",aa="QUALTRICS",sa="Qualtrics",ua="QUANTUMMETRIC",la="Quantum Metric",ca="QUORA_PIXEL",da="Quora Pixel",va="REDDIT_PIXEL",fa="Reddit Pixel",ha="REFINER",ga="Refiner",pa="ROCKERBOX",ya="Rockerbox",ma="ROLLBAR",ba="rollbar",ka="SATISMETER",Ea="SatisMeter",Aa="SENDINBLUE",Sa="Sendinblue",Ia="SENTRY",Ta="Sentry",wa="SHYNET",Pa="Shynet",Oa="SNAP_PIXEL",Ca="Snap Pixel",Da="SNAPENGAGE",Ra="SnapEngage",Ma="SPOTIFYPIXEL",La="Spotify Pixel",_a="SPRIG",Na="Sprig",xa="TIKTOK_ADS",Ba="TikTok Ads",Ua="TVSQUARED",ja="TVSquared",Ga="VERO",Fa="Vero",Ha="VWO",za="WOOPRA",Qa="WOOPRA",Ka="XPIXEL",Va="XPixel",qa="YANDEX_METRICA",Xa="Yandex.Metrica",Wa="AdobeAnalytics";u({},er,Wa),u(u(u(u(u(u({"Adobe Analytics":Zi,ADOBEANALYTICS:Zi,"ADOBE ANALYTICS":Zi},Zi,Zi),"AdobeAnalytics",Zi),"adobeanalytics",Zi),"adobe analytics",Zi),"Adobe analytics",Zi),"adobe Analytics",Zi);var Ja="Amplitude";u({},rr,Ja),u(u(u(u({},ir,ir),"AMPLITUDE",ir),"Amplitude",ir),"am",ir);var Ya="Appcues";u({},ar,Ya),u(u(u(u({},or,or),"Appcues",or),"App Cues",or),"appcues",or);var $a="BingAds";u({},cr,$a),u(u(u(u(u(u(u({},lr,lr),"BingAds",lr),"bingads",lr),"Bing Ads",lr),"Bing ads",lr),"bing Ads",lr),"bing ads",lr);var Za="Braze";u({},vr,Za),u(u(u({},dr,dr),"Braze",dr),"braze",dr);var es="Bugsnag";u({},hr,es),u(u(u({},fr,fr),"bugsnag",fr),"Bugsnag",fr);var ts="Chartbeat";u({},pr,ts),u(u(u(u(u({},gr,gr),"Chartbeat",gr),"chartbeat",gr),"Chart Beat",gr),"chart beat",gr);var ns="Clevertap";u({},mr,ns),u(u(u({},yr,yr),"Clevertap",yr),"clevertap",yr);var is="Criteo";u({},Ir,is),u(u(u({},Sr,Sr),"Criteo",Sr),"criteo",Sr);var rs="CustomerIO";u({},wr,rs),u(u(u(u(u({},Tr,Tr),"Customerio",Tr),"Customer.io",Tr),"CUSTOMER.IO",Tr),"customer.io",Tr);var os="Drip";u({},Dr,os),u(u(u({},Cr,Cr),"Drip",Cr),"drip",Cr);var as="FacebookPixel";u({},_r,as),u(u(u(u(u(u(u({},Lr,Lr),"FB Pixel",Lr),"Facebook Pixel",Lr),"facebook pixel",Lr),"fbpixel",Lr),"FBPIXEL",Lr),"FB_PIXEL",Lr);var ss="Fullstory";u({},xr,ss),u(u(u(u(u(u(u(u({},Nr,Nr),"Fullstory",Nr),"FullStory",Nr),"full Story",Nr),"Full Story",Nr),"Full story",Nr),"full story",Nr),"fullstory",Nr);u({},Ur,"GA"),u(u(u(u(u({},Br,Br),"Google Analytics",Br),"GoogleAnalytics",Br),"GOOGLE ANALYTICS",Br),"google analytics",Br);u({},Hr,"GA4"),u(u(u(u(u(u(u(u(u(u({},Fr,Fr),"Google Analytics 4",Fr),"Google analytics 4",Fr),"google analytics 4",Fr),"Google Analytics4",Fr),"Google analytics4",Fr),"google analytics4",Fr),"Google Analytics 4 (GA4)",Fr),"google analytics 4 (ga4)",Fr),"GoogleAnalytics4",Fr);var us="GA4_V2";u({},Qr,us),u(u(u(u(u(u(u(u(u(u({},zr,zr),"Google Analytics 4 V2",zr),"Google analytics 4 V2",zr),"google analytics 4 V2",zr),"Google Analytics4 V2",zr),"Google analytics4 V2",zr),"google analytics4 V2",zr),"Google Analytics 4 (GA4) V2",zr),"google analytics 4 (ga4) V2",zr),"GoogleAnalytics4V2",zr);var ls="GoogleAds";u({},Jr,ls),u(u(u(u(u(u({},Wr,Wr),"Google Ads",Wr),"GoogleAds",Wr),"GOOGLE ADS",Wr),"google ads",Wr),"googleads",Wr);var cs="GoogleOptimize";u({},Xr,cs),u(u(u(u(u(u(u(u({},qr,qr),"Google Optimize",qr),"GoogleOptimize",qr),"Googleoptimize",qr),"GOOGLEOPTIMIZE",qr),"google optimize",qr),"Google optimize",qr),"GOOGLE OPTIMIZE",qr);var ds="GoogleTagManager";u({},$r,ds),u(u(u(u(u({},Yr,Yr),"Google Tag Manager",Yr),"google tag manager",Yr),"googletag manager",Yr),"googletagmanager",Yr);var vs="Heap";u({},eo,vs),u(u(u(u({},Zr,Zr),"Heap",Zr),"heap",Zr),"Heap.io",Zr);var fs="Hotjar";u({},no,fs),u(u(u(u(u({},to,to),"Hotjar",to),"hotjar",to),"Hot Jar",to),"hot jar",to);var hs="HubSpot";u({},ro,hs),u(u(u(u(u(u({},io,io),"Hubspot",io),"HUBSPOT",io),"hub spot",io),"Hub Spot",io),"Hub spot",io);var gs="INTERCOM";u({},ao,gs),u(u(u({},oo,oo),"Intercom",oo),"intercom",oo);var ps="Keen";u({},fo,ps),u(u(u(u(u({},vo,vo),"Keen",vo),"Keen.io",vo),"keen",vo),"keen.io",vo);var ys="Kissmetrics";u({},go,ys),u(u(u({},ho,ho),"Kissmetrics",ho),"kissmetrics",ho);var ms="Klaviyo";u({},yo,ms),u(u(u({},po,po),"Klaviyo",po),"klaviyo",po);var bs,ks="LaunchDarkly";u({},bo,ks),u(u(u(u(u(u({},mo,mo),"LaunchDarkly",mo),"Launch_Darkly",mo),"Launch Darkly",mo),"launchDarkly",mo),"launch darkly",mo);var Es="LinkedInInsightTag";u({},So,Es),u(u(u(u(u(u(u(u(u(u(bs={},Ao,Ao),"LinkedIn Insight Tag",Ao),"LinkedIn insight tag",Ao),"linkedIn insight tag",Ao),"Linkedin_insight_tag",Ao),"LinkedinInsighttag",Ao),"LinkedinInsightTag",Ao),"LinkedInInsightTag",Ao),"Linkedininsighttag",Ao),"LINKEDININSIGHTTAG",Ao),u(bs,"linkedininsighttag",Ao);var As="Lotame";u({},Po,As),u(u(u({},wo,wo),"Lotame",wo),"lotame",wo);var Ss="Lytics";u({},Co,Ss),u(u(u({},Oo,Oo),"Lytics",Oo),"lytics",Oo);var Is="Mixpanel";u({},jo,Is),u(u(u(u(u(u({},Uo,Uo),"MIXPANEL",Uo),"Mixpanel",Uo),"MIX PANEL",Uo),"Mix panel",Uo),"Mix Panel",Uo);var Ts="MoEngage";u({},No,Ts),u(u(u(u(u(u(u({},_o,_o),"MoEngage",_o),"moengage",_o),"Moengage",_o),"Mo Engage",_o),"mo engage",_o),"Mo engage",_o);var ws="Optimizely";u({},Ko,ws),u(u(u({},Qo,Qo),"Optimizely",Qo),"optimizely",Qo);var Ps,Os="Pendo";u({},qo,Os),u(u(u({}
1,Vo,Vo),"Pendo",Vo),"pendo",Vo);var Cs="PinterestTag";u({},Wo,Cs),u(u(u(u(u(u(u(u(u(u(Ps={},Xo,Xo),"PinterestTag",Xo),"Pinterest_Tag",Xo),"PINTERESTTAG",Xo),"pinterest",Xo),"PinterestAds",Xo),"Pinterest_Ads",Xo),"Pinterest",Xo),"Pinterest Tag",Xo),"Pinterest tag",Xo),u(u(u(u(Ps,"PINTEREST TAG",Xo),"pinterest tag",Xo),"Pinterest Ads",Xo),"Pinterest ads",Xo);var Ds="PostAffiliatePro";u({},Zo,Ds),u(u(u(u(u(u(u(u({},$o,$o),"PostAffiliatePro",$o),"Post_affiliate_pro",$o),"Post Affiliate Pro",$o),"Post affiliate pro",$o),"post affiliate pro",$o),"postaffiliatepro",$o),"POSTAFFILIATEPRO",$o);var Rs="Posthog";u({},ta,Rs),u(u(u(u(u(u(u({},ea,ea),"PostHog",ea),"Posthog",ea),"posthog",ea),"Post Hog",ea),"Post hog",ea),"post hog",ea);var Ms="ProfitWell";u({},ia,Ms),u(u(u(u(u(u(u({},na,na),"ProfitWell",na),"profitwell",na),"Profitwell",na),"Profit Well",na),"profit well",na),"Profit well",na);var Ls="Qualtrics";u({},sa,Ls),u(u(u({},aa,aa),"Qualtrics",aa),"qualtrics",aa);var _s="QuantumMetric";u({},la,_s),u(u(u(u(u(u(u(u({},ua,ua),"Quantum Metric",ua),"quantum Metric",ua),"quantum metric",ua),"QuantumMetric",ua),"quantumMetric",ua),"quantummetric",ua),"Quantum_Metric",ua);var Ns="RedditPixel";u({},fa,Ns),u(u(u(u(u(u(u(u({},va,va),"Reddit_Pixel",va),"RedditPixel",va),"REDDITPIXEL",va),"redditpixel",va),"Reddit Pixel",va),"REDDIT PIXEL",va),"reddit pixel",va);var xs="Sentry";u({},Ta,xs),u(u(u({},Ia,Ia),"sentry",Ia),"Sentry",Ia);var Bs="SnapPixel";u({},Ca,Bs),u(u(u(u(u(u(u(u({},Oa,Oa),"Snap_Pixel",Oa),"SnapPixel",Oa),"SNAPPIXEL",Oa),"snappixel",Oa),"Snap Pixel",Oa),"SNAP PIXEL",Oa),"snap pixel",Oa);var Us="TVSquared";u({},ja,Us),u(u(u(u(u(u(u(u(u({},Ua,Ua),"TVSquared",Ua),"tvsquared",Ua),"tvSquared",Ua),"TvSquared",Ua),"Tvsquared",Ua),"TV Squared",Ua),"tv squared",Ua),"tv Squared",Ua);u({},"VWO","VWO"),u(u(u(u(u(u(u(u({},Ha,Ha),"VisualWebsiteOptimizer",Ha),"Visualwebsiteoptimizer",Ha),"visualwebsiteoptimizer",Ha),"vwo",Ha),"Visual Website Optimizer",Ha),"Visual website optimizer",Ha),"visual website optimizer",Ha);var js="GA360";u({},Gr,js),u(u(u(u(u(u(u(u(u({},jr,jr),"Google Analytics 360",jr),"Google analytics 360",jr),"google analytics 360",jr),"Google Analytics360",jr),"Google analytics360",jr),"google analytics360",jr),"GoogleAnalytics360",jr),"GA 360",jr);var Gs="Adroll";u({},nr,Gs),u(u(u(u(u({},tr,tr),"Adroll",tr),"Ad roll",tr),"ad roll",tr),"adroll",tr);var Fs="DCMFloodlight";u({},Or,Fs),u(u(u(u(u(u(u(u(u({},Pr,Pr),"DCM Floodlight",Pr),"dcm floodlight",Pr),"Dcm Floodlight",Pr),"DCMFloodlight",Pr),"dcmfloodlight",Pr),"DcmFloodlight",Pr),"dcm_floodlight",Pr),"DCM_Floodlight",Pr);var Hs="Matomo";u({},Ro,Hs),u(u(u({},Do,Do),"Matomo",Do),"matomo",Do);var zs="Vero";u({},Fa,zs),u(u(u({},Ga,Ga),"Vero",Ga),"vero",Ga);var Qs="Mouseflow";u({},Bo,Qs),u(u(u(u(u(u(u(u(u({},xo,xo),"Mouseflow",xo),"mouseflow",xo),"mouseFlow",xo),"MouseFlow",xo),"Mouse flow",xo),"mouse flow",xo),"mouse Flow",xo),"Mouse Flow",xo);var Ks="Rockerbox";u({},ya,Ks),u(u(u(u(u(u(u({},pa,pa),"Rockerbox",pa),"rockerbox",pa),"RockerBox",pa),"Rocker box",pa),"rocker box",pa),"Rocker Box",pa);var Vs="ConvertFlow";u({},Ar,Vs),u(u(u(u(u(u(u(u(u(u({},Er,Er),"Convertflow",Er),"convertflow",Er),"convertFlow",Er),"ConvertFlow",Er),"Convert flow",Er),"convert flow",Er),"convert Flow",Er),"Convert Flow",Er),"CONVERT FLOW",Er);var qs="SnapEngage";u({},Ra,qs),u(u(u(u(u(u(u({},Da,Da),"SnapEngage",Da),"Snap_Engage",Da),"snapengage",Da),"SNAP ENGAGE",Da),"Snap Engage",Da),"snap engage",Da);var Xs="LiveChat";u({},To,Xs),u(u(u(u(u(u(u({},Io,Io),"LiveChat",Io),"Live_Chat",Io),"livechat",Io),"LIVE CHAT",Io),"Live Chat",Io),"live chat",Io);var Ws="Shynet";u({},Pa,Ws),u(u(u(u(u(u(u(u(u({},wa,wa),"shynet",wa),"ShyNet",wa),"shyNet",wa),"Shynet",wa),"shy net",wa),"Shy Net",wa),"shy Net",wa),"Shy net",wa);var Js="Woopra";u({},Qa,Js),u(u(u({},za,za),"Woopra",za),"woopra",za);var Ys="RollBar";u({},ba,Ys),u(u(u(u(u(u(u(u({},ma,ma),"RollBar",ma),"Roll_Bar",ma),"rollbar",ma),"Rollbar",ma),"ROLL BAR",ma),"Roll Bar",ma),"roll bar",ma);var $s="QuoraPixel";u({},da,$s),u(u(u(u(u(u(u(u(u(u({},ca,ca),"Quora Pixel",ca),"Quora pixel",ca),"QUORA PIXEL",ca),"QuoraPixel",ca),"Quorapixel",ca),"QUORAPIXEL",ca),"Quora_Pixel",ca),"quora_pixel",ca),"Quora",ca);var Zs="June";u({},co,Zs),u(u(u({},lo,lo),"June",lo),"june",lo);var eu="Engage";u({},Mr,eu),u(u(u({},Rr,Rr),"Engage",Rr),"engage",Rr);var tu="Iterable";u({},uo,tu),u(u(u({},so,so),"Iterable",so),"iterable",so);var nu="YandexMetrica";u({},Xa,nu),u(u(u(u(u({},qa,qa),"Yandexmetrica",qa),"yandexmetrica",qa),"yandexMetrica",qa),"YandexMetrica",qa);var iu="Refiner";u({},ga,iu),u(u(u({},ha,ha),"Refiner",ha),"refiner",ha);var ru="Qualaroo";u({},oa,ru),u(u(u({},ra,ra),"Qualaroo",ra),"qualaroo",ra);var ou="Podsights";u({},Yo,ou),u(u(u(u(u(u(u(u({},Jo,Jo),"Podsights",Jo),"PodSights",Jo),"pod Sights",Jo),"Pod Sights",Jo),"pod sights",Jo),"POD SIGHTS",Jo),"Pod sights",Jo);var au="Axeptio";u({},ur,au),u(u(u({},sr,sr),"Axeptio",sr),"axeptio",sr);var su="Satismeter";u({},Ea,su),u(u(u({},ka,ka),"Satismeter",ka),"SatisMeter",ka);var uu="MicrosoftClarity";u({},Lo,uu),u(u(u(u(u(u(u(u(u({},Mo,Mo),"Microsoft Clarity",Mo),"Microsoft clarity",Mo),"microsoft clarity",Mo),"Microsoft_clarity",Mo),"MicrosoftClarity",Mo),"MICROSOFTCLARITY",Mo),"microsoftclarity",Mo),"microsoftClarity",Mo);var lu="Sendinblue";u({},Sa,lu),u(u(u(u({},Aa,Aa),"Sendinblue",Aa),"sendinblue",Aa),"SendinBlue",Aa);var cu="Olark";u({},zo,cu),u(u(u({},Ho,Ho),"Olark",Ho),"olark",Ho);var du="Lemnisk";u({},Eo,du),u(u(u(u(u(u(u(u({},ko,ko),"LEMNISK_MARKETING_AUTOMATION",ko),"Lemnisk Marketing Automation",ko),"LemniskMarketingAutomation",ko),"lemniskmarketingautomation",ko),"lemniskMarketingAutomation",ko),"lemnisk",ko),"Lemnisk",ko);var vu="TiktokAds";u({},Ba,vu),u(u(u(u(u(u(u({},xa,xa),"TiktokAds",xa),"Tiktok ads",xa),"Tiktok Ads",xa),"Tik Tok Ads",xa),"tik tok ads",xa),"tiktokads",xa);var fu="ActiveCampaign";u({},$i,fu),u(u(u(u(u(u({ActiveCampaign:Yi,"Active Campaign":Yi,"ACTIVE CAMPAIGN":Yi},Yi,Yi),"activecampaign",Yi),"active campaign",Yi),"Active campaign",Yi),"active 
1Campaign",Yi),"active_campaign",Yi);var hu="Sprig";u({},Na,hu),u(u(u({},_a,_a),"Sprig",_a),"sprig",_a);var gu="SpotifyPixel";u({},La,gu),u(u(u(u({},Ma,Ma),"Spotify Pixel",Ma),"spotify pixel",Ma),"SPOTIFY_PIXEL",Ma);var pu="CommandBar";u({},kr,pu),u(u(u(u(u({},br,br),"Command Bar",br),"Commandbar",br),"COMMAND_BAR",br),"commandbar",br);var yu="Ninetailed";u({},Fo,yu),u(u(u(u({},Go,Go),"Ninetailed",Go),"ninetailed",Go),"NineTailed",Go);var mu="Gainsight_PX";u({},Vr,mu),u(u({},Kr,Kr),"Gainsight_PX",Kr);var bu,ku="XPixel";u({},Va,ku),u(u(u(u(u({},Ka,Ka),"XPixel",Ka),"Xpixel",Ka),"xpixel",Ka),"xPixel",Ka);var Eu,Au,Su,Iu,Tu,wu,Pu=(u(u(u(u(u(u(u(u(u(u(bu={},ro,hs),Ur,"GA"),no,fs),Jr,ls),"VWO","VWO"),$r,ds),vr,Za),ao,gs),fo,ps),go,ys),u(u(u(u(u(u(u(u(u(u(bu,wr,rs),pr,ts),_r,as),Po,As),Ko,ws),hr,es),xr,ss),ja,Us),Hr,"GA4"),Qr,us),u(u(u(u(u(u(u(u(u(u(bu,No,Ts),rr,Ja),qo,Os),Co,Ss),ar,Ya),ta,Rs),yo,ms),mr,ns),cr,$a),Wo,Cs),u(u(u(u(u(u(u(u(u(u(bu,er,Wa),So,Es),fa,Ns),Dr,os),eo,vs),Ir,is),jo,Is),sa,Ls),ia,Ms),Ta,xs),u(u(u(u(u(u(u(u(u(u(bu,la,_s),Ca,Bs),Zo,Ds),Xr,cs),bo,ks),Gr,js),nr,Gs),Or,Fs),Ro,Hs),Fa,zs),u(u(u(u(u(u(u(u(u(u(bu,Bo,Qs),ya,Ks),Ar,Vs),Ra,qs),To,Xs),Pa,Ws),Qa,Js),ba,Ys),da,$s),co,Zs),u(u(u(u(u(u(u(u(u(u(bu,Mr,eu),uo,tu),Xa,nu),ga,iu),oa,ru),Yo,ou),ur,au),Ea,su),Lo,uu),Sa,lu),u(u(u(u(u(u(u(u(u(u(bu,zo,cu),Eo,du),Ba,vu),$i,fu),Na,hu),La,gu),kr,pu),Fo,yu),Vr,mu),Va,ku)),Ou=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(n,i){var r,o,a=e.instance;if(!a.isLoaded()||a.isReady&&!a.isReady())if(t>=11e3)i(new Error((r=11e3,o=e.userFriendlyId,"A timeout of ".concat(r,' ms occurred while trying to check the ready status for "').concat(o,'" destination.'))));else{var s=Date.now();(function(e){return new Promise((function(t){globalThis.setTimeout(t,e)}))})(100).then((function(){var r=Date.now()-s;Ou(e,t+r).then(n).catch((function(e){return i(e)}))})).catch((function(e){return i(e)}))}else n(!0)}))},Cu=function(e,t,n,i,r,o){try{var a=_(e),s=function(e,t,n,i){var r,o,a=globalThis.rudderanalytics.getAnalyticsInstance(i.lifecycle.writeKey.value),s={loadIntegration:i.nativeDestinations.loadIntegration.value,logLevel:i.lifecycle.logLevel.value,loadOnlyIntegrations:null!==(r=null===(o=i.consents.postConsent.value)||void 0===o?void 0:o.integrations)&&void 0!==r?r:i.nativeDestinations.loadOnlyIntegrations.value,page:function(e,t,n,i,r){return a.page(le(ze(e),ze(t),ze(n),ze(i),ze(r)))},track:function(e,t,n,i){return a.track(ce(ze(e),ze(t),ze(n),ze(i)))},identify:function(e,t,n,i){return a.identify(de(ze(e),ze(t),ze(n),ze(i)))},alias:function(e,t,n,i){return a.alias(ve(ze(e),ze(t),ze(n),ze(i)))},group:function(e,t,n,i){return a.group(fe(ze(e),ze(t),ze(n),ze(i)))},getAnonymousId:function(e){return a.getAnonymousId(ze(e))},getUserId:function(){return a.getUserId()},getUserTraits:function(){return a.getUserTraits()},getGroupId:function(){return a.getGroupId()},getGroupTraits:function(){return a.getGroupTraits()},getSessionId:function(){return a.getSessionId()}};return new globalThis[e][t](_(n.config),s,{shouldApplyDeviceModeTransformation:n.shouldApplyDeviceModeTransformation,propagateEventsUntransformedOnError:n.propagateEventsUntransformedOnError,destinationId:n.id})}(n,i,e,t);a.instance=s,s.init(),Ou(a).then((function(){ri(a)&&(t.nativeDestinations.integrationsConfig.value=function(e,t,n){var i,r,o=t;if(F(null===(i=e.instance)||void 0===i?void 0:i.getDataForIntegrationsObject))try{var a;o=Z(t,ze(null===(a=e.instance)||void 0===a?void 0:a.getDataForIntegrationsObject()))}catch(s){null==n||n.onError(s,Xi,(r=e.userFriendlyId,"Failed to get integrations data for destination ".concat(r,".")))}return o}(a,t.nativeDestinations.integrationsConfig.value,r)),t.nativeDestinations.initializedDestinations.value=[].concat(b(t.nativeDestinations.initializedDestinations.value),[a])})).catch((function(n){t.nativeDestinations.failedDestinations.value=[].concat(b(t.nativeDestinations.failedDestinations.value),[e]),null==o||o.error(n)}))}catch(l){t.nativeDestinations.failedDestinations.value=[].concat(b(t.nativeDestinations.failedDestinations.value),[e]),null==r||r.onError(l,Xi,(u=e.userFriendlyId,"Failed to initialize destination ".concat(u,".")))}var u},Du="DeviceModeDestinations",Ru=function(){return{name:Du,initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Du])},nativeDestinations:{setActiveDestinations:function(e,t,n,i){var r,o;
1e.nativeDestinations.loadIntegration.value=e.loadOptions.value.loadIntegration;var a=e.nativeDestinations.configuredDestinations.value.filter((function(e){return!!Pu[e.displayName]||(null==n||n.onError(new Error((t=e.userFriendlyId,"Destination ".concat(t," is not supported."))),Xi),!1);var t})),s=Ji(null!==(r=null===(o=e.consents.postConsent.value)||void 0===o?void 0:o.integrations)&&void 0!==r?r:e.nativeDestinations.loadOnlyIntegrations.value,a).filter((function(r){var o;return null===(o=t.invokeSingle("consentManager.isDestinationConsented",e,r.config,n,i))||void 0===o||o}));e.nativeDestinations.activeDestinations.value=s},load:function(e,t,n,i,r){var o=e.lifecycle.integrationsCDNPath.value;e.nativeDestinations.activeDestinations.value.forEach((function(a){var s=Pu[a.displayName],u="".concat(s,"_RS"),l=s;if(l&&!function(e,t,n){var i;return Boolean((null===(i=globalThis[e])||void 0===i||null===(i=i[t])||void 0===i?void 0:i.prototype)&&void 0!==globalThis[e][t].prototype.constructor)}(u,l)){var c="".concat(o,"/").concat(s,".min.js");t.loadJSFile({url:c,id:a.userFriendlyId,callback:null!=r?r:function(t){t?Cu(a,e,u,l,n,i):(null==i||i.error(Wi(Xi,a.userFriendlyId)),e.nativeDestinations.failedDestinations.value=[].concat(b(e.nativeDestinations.failedDestinations.value),[a]))},timeout:1e4})}else l?Cu(a,e,u,l,n,i):null==i||i.error(Wi(Xi,a.displayName))}))}}}},Mu={minRetryDelay:500,backoffFactor:2,maxAttempts:3},Lu="DeviceModeTransformationPlugin",_u=function(e,t,n,i){return"".concat(e).concat(Be,'Event transformation unsuccessful for destination "').concat(t,'". Reason: ').concat(n,". ").concat(i,".")},Nu=function(e,t,n,i){return"".concat(e).concat(Be,"[Destination: ").concat(t,"].Transformation request failed with status: ").concat(n,". Retries exhausted. ").concat(i,".")},xu=function(e,t,n,i,r,o,a,s){var u="Sending untransformed event",l="Dropping the event",c=e.nativeDestinations.initializedDestinations.value.filter((function(e){return e&&n.includes(e.id)}
1));c.forEach((function(n){try{var c=[];switch(r){case 200:var d=JSON.parse(i).transformedBatch.find((function(e){return e.id===n.id}));null==d||d.payload.forEach((function(e){if("200"===e.status)c.push(e.event);else{var t="Unknown";"410"===e.status&&(t="Transformation is not available");var i=l;!0===n.propagateEventsUntransformedOnError?(i=u,c.push(o),null==s||s.warn(_u(Lu,n.displayName,t,i))):null==s||s.error(_u(Lu,n.displayName,t,i))}}));break;case 404:null==s||s.warn("".concat(Lu).concat(Be,"Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination.")),c.push(o);break;default:!0===n.propagateEventsUntransformedOnError?(null==s||s.warn(Nu(Lu,n.displayName,r,u)),c.push(o)):null==s||s.error(Nu(Lu,n.displayName,r,l))}null==c||c.forEach((function(i){ee(i)&&t.invokeSingle("destinationsEventsQueue.enqueueEventToDestination",e,i,n,a,s)}))}catch(mt){null==a||a.onError(mt,Lu,(v=n.displayName,"[Destination:".concat(v,"].")))}var v}))},Bu="DeviceModeTransformation",Uu=function(){return{name:Bu,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Bu])},transformEvent:{init:function(e,t,n,i,r,o){var a=e.lifecycle.writeKey.value;return n.setAuthHeader(a),new zi("".concat("rudder","_").concat(a),Mu,(function(i,a,s){var u,l,c=(u=i.event,l=i.destinationIds,{metadata:{"Custom-Authorization":i.token},batch:[{orderNo:Date.now(),destinationIds:l,event:u}]});n.getAsyncData({url:"".concat(e.lifecycle.activeDataplaneUrl.value,"/transform"),options:{method:"POST",data:Ti(c),sendRawData:!0},isRawResponse:!0,timeout:1e4,callback:function(n,u){var l,c,d,v=gi(null!==(l=null==u||null===(c=u.xhr)||void 0===c?void 0:c.status)&&void 0!==l?l:0);Q(null==u?void 0:u.error)||!v||s.retryAttemptNumber===s.maxRetryAttempts?(xu(e,t,i.destinationIds,n,null==u||null===(d=u.xhr)||void 0===d?void 0:d.status,i.event,r,o),a(null)):a(u)}})}),i,di)},enqueue:function(e,t,n,i){var r=i.map((function(e){return e.id}));t.addItem({event:n,destinationIds:r,token:e.session.authToken.value})}}}},ju={segment:"ajs_anonymous_id"},Gu="ExternalAnonymousId",Fu=function(){return{name:Gu,initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Gu])},storage:{getAnonymousId:function(e,t){var n,i;if(null!=t&&null!==(n=t.autoCapture)&&void 0!==n&&n.enabled&&t.autoCapture.source){var r=t.autoCapture.source.toLowerCase();if(!Object.keys(ju).includes(r))return i;if("segment"===r)i=function(e){var t,n=e(li);null!=n&&n.isEnabled&&(t=n.getItem(ju.segment));var i=e(ui);return!t&&null!=i&&i.isEnabled&&(t=i.getItem(ju.segment)),t}(e)}return i}}}},Hu=function(){var e;return null===(e=navigator)||void 0===e?void 0:e.language},zu=function(){var e;return null===(e=navigator)||void 0===e?void 0:e.userAgent},Qu=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=t.endsWith("..")?t.substring(0,t.length-2):t;return e=n,decodeURIComponent(globalThis.atob(e).split("").map((function(e){var t="00".concat(e.charCodeAt(0).toString(16));return"%".concat(t.slice(-2))})).join(""))},Ku=/^[\w.-]+$/,Vu="*",qu=function(e,t,n,i){var r=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join(Vu)}(n,i),o=t||0,a=function(e){for(var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),n=-1,i=0;i<e.length;i++)n=n>>>8^t[255&(n^e.charCodeAt(i))];return~n>>>0}([r,Math.floor(Date.now()/6e4)-o,e].join(Vu));return a.toString(36)},Xu=function(e){var t=function(e){var t=e.split(Vu),n=t.length%2==0;if(t.length<4||!n)return null;if(1!==Number(t.shift()))return null;var i=t.shift();return{checksum:null!=i?i:"",serializedIds:t.join(Vu)}}(e);if(!t)return null;var n=t.checksum,i=t.serializedIds;return i&&n&&function(e,t){for(var n=zu(),i=Hu(),r=0;r<=1;r+=1)if(qu(e,r,n,i)===t)return!0;return!1}(i,n)?function(e){if(!e)return{};for(var t={},n=e.split(Vu),i=0;i<n.length;i+=2){var r=n[i];Ku.test(r)&&(t[r]=Qu(n[i+1]))}return t}(i):null},Wu="GoogleLinker",Ju=function(){return{name:Wu,initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Wu])},userSession:{anonymousIdGoogleLinker:function(e){if(!e)return null;var t=e?Xu(e):null;return t?t.rs_amp_id:null}}}},Yu=function(e){return"".concat(e).concat(Be,"Failed to read the consent cookie.")},$u="IubendaConsentManagerPlugin",Zu=/^_iub_cs-\d+$/,el=function(e,t){var n=null;try{var i=null==e?void 0:e.setStore({id:$u,name:$u,type:ui,errorHandler:null==e?void 0:e.errorHandler,logger:null==e?void 0:e.logger});n=null==i?void 0:i.engine.getItem(function(e){try{var t=document.cookie.split("; ").find((function(e){var t=y(e.split("="),1)[0];return Zu.test((t||"").trim())}));if(!t)throw new Error("Iubenda Cookie not found with the specified pattern.");return y(t.split("="),1)[0]||""}catch(n){return null==e||e.error(Yu($u),n),""}}(t))}catch(a){return void(null==t||t.error(Yu($u),a))}if(!K(n)){var r,o;try{r=JSON.parse(decodeURIComponent(n))}catch(a){return void(null==t||t.error((o=$u,"".concat(o).concat(Be,"Failed to parse the consent cookie.")),a))}if(r)return r.purposes}},tl=function(e,t){var n=function(e){var t=[],n=[];return e&&Object.entries(e).forEach((function(e){var i=e[0];e[1]?t.push(i):n.push(i)})),{allowedConsentIds:t,deniedConsentIds:n}}(t);e.consents.initialized.value=V(t),e.consents.data.value=n},nl="IubendaConsentManager",il=function(){return{name:nl,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[nl])},consentManager:{init:function(e,t){globalThis.getIubendaUserConsentedPurposes=function(){var t;return null===(t=e.consents.data.value.allowedConsentIds)||void 0===t?void 0:t.slice()},globalThis.getIubendaUserDeniedPurposes=function(){var t;
1return null===(t=e.consents.data.value.deniedConsentIds)||void 0===t?void 0:t.slice()},globalThis.updateIubendaConsent=function(t){tl(e,t)}},updateConsentsInfo:function(e,t,n){var i;i=Q(globalThis._iub.cs.consent.purposes)?el(t,n):globalThis._iub.cs.consent.purposes,tl(e,i)},isDestinationConsented:function(e,t,n,i){if(!e.consents.initialized.value)return!0;var r=e.consents.data.value.allowedConsentIds,o=function(e){return r.includes(e)};try{var a=t.consentManagement;if(a){var s,u=a.find((function(t){return t.provider===e.consents.provider.value}));if(null==u||!u.consents)return!0;var l=u.consents.map((function(e){return e.consent.trim()})).filter((function(e){return e}));return"or"===(null!==(s=u.resolutionStrategy)&&void 0!==s?s:e.consents.resolutionStrategy.value)?l.some(o)||0===l.length:l.every(o)}return!0}catch(c){return null==n||n.onError(c,$u,"Failed to determine the consent status for the destination. Please check the destination configuration and try again."),!0}}}}},rl="KetchConsentManagerPlugin",ol=function(e,t){var n,i=null;try{var r=null==e?void 0:e.setStore({id:rl,name:rl,type:ui,errorHandler:null==e?void 0:e.errorHandler,logger:null==e?void 0:e.logger});i=null==r?void 0:r.engine.getItem("_ketch_consent_v1_")}catch(s){return void(null==t||t.error((n=rl,"".concat(n).concat(Be,"Failed to read the consent cookie.")),s))}if(!K(i)){var o;try{o=JSON.parse(ue(i))}catch(s){return void(null==t||t.error(function(e){return"".concat(e).concat(Be,"Failed to parse the consent cookie.")}(rl),s))}if(o){var a={};return Object.entries(o).forEach((function(e){var t=e[0],n=e[1];a[t]="granted"===(null==n?void 0:n.status)})),a}}},al=function(e,t){var n=function(e){var t=[],n=[];return e&&Object.entries(e).forEach((function(e){var i=e[0];e[1]?t.push(i):n.push(i)})),{allowedConsentIds:t,deniedConsentIds:n}}(t);e.consents.initialized.value=V(t),e.consents.data.value=n},sl="KetchConsentManager",ul=function(){return{name:sl,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[sl])},consentManager:{init:function(e,t){globalThis.getKetchUserConsentedPurposes=function(){var t;return null===(t=e.consents.data.value.allowedConsentIds)||void 0===t?void 0:t.slice()},globalThis.getKetchUserDeniedPurposes=function(){var t;return null===(t=e.consents.data.value.deniedConsentIds)||void 0===t?void 0:t.slice()},globalThis.updateKetchConsent=function(t){al(e,t)}},updateConsentsInfo:function(e,t,n){var i;i=Q(globalThis.ketchConsent)?ol(t,n):globalThis.ketchConsent,al(e,i)},isDestinationConsented:function(e,t,n,i){if(!e.consents.initialized.value)return!0;var r=e.consents.data.value.allowedConsentIds;try{var o=t.ketchConsentPurposes,a=t.consentManagement,s=function(e){return r.includes(e)};if(a){var u,l=null===(u=a.find((function(t){return t.provider===e.consents.provider.value})))||void 0===u?void 0:u.consents;if(!l)return!0;var c=l.map((function(e){return e.consent.trim()})).filter((function(e){return e}));return"or"===e.consents.resolutionStrategy.value?c.some(s)||0===c.length:c.every(s)}if(o){var d=o.map((function(e){return e.purpose.trim()})).filter((function(e){return e}));return d.some(s)||0===d.length}return!0}catch(v){return null==n||n.onError(v,rl,"Failed to determine the consent status for the destination. Please check the destination configuration and try again."),!0}}}}},ll={maxItems:100},cl="NativeDestinationQueuePlugin",dl=function(e){return e&&"string"==typeof e},vl=function(e,t,n,i){var r,o=e.type.toString();try{var a,s;null===(a=t.instance)||void 0===a||null===(s=a[o])||void 0===s||s.call(a,{message:e})}catch(u){null==n||n.onError(u,cl,(r=t.userFriendlyId,'Failed to forward event to destination "'.concat(r,'".')))}},fl="NativeDestinationQueue",hl=function(){return{name:fl,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[fl])},destinationsEventsQueue:{init:function(e,t,n,i,r,o){var a,s=(a=e.loadOptions.value.destinationsQueueOptions,Z(ll,a)),u=e.lifecycle.writeKey.value,l=new zi("".concat("rudder_destinations_events","_").concat(u),s,(function(n,a){var s=Ji(n.integrations,e.nativeDestinations.initializedDestinations.value),u=[],l=_(n);
1s.forEach((function(e){try{var t=!function(e,t,n){if("track"!==e)return!1;var i=n.config,r=i.blacklistedEvents,o=i.whitelistedEvents;switch(i.eventFilteringOption){case"blacklistedEvents":if(!dl(t))return!1;var a=t.trim();return!!Array.isArray(r)&&r.some((function(e){return e.eventName.trim()===a}));case"whitelistedEvents":if(!dl(t))return!0;var s=t.trim();return!Array.isArray(o)||!o.some((function(e){return e.eventName.trim()===s}));default:return!1}}(l.type,l.event,e);if(!t)return void(null==o||o.warn((n=cl,i=l.event,a=e.userFriendlyId,"".concat(n).concat(Be,'The "').concat(i,'" track event has been filtered for the "').concat(a,'" destination.'))));e.shouldApplyDeviceModeTransformation?u.push(e):vl(l,e,r)}catch(mt){null==r||r.onError(mt,cl)}var n,i,a})),u.length>0&&t.invokeSingle("transformEvent.enqueue",e,i,l,u,r,o),a(null)}),n,di);return l},enqueue:function(e,t,n,i,r){t.addItem(n)},enqueueEventToDestination:function(e,t,n,i,r){vl(t,n,i)}}}},gl="OneTrustConsentManagerPlugin",pl="OneTrustConsentManager",yl=function(){return{name:pl,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[pl])},consentManager:{init:function(e,t){},updateConsentsInfo:function(e,t,n){if(!globalThis.OneTrust||!globalThis.OnetrustActiveGroups)return null==n||n.error("".concat(gl).concat(Be,"Failed to access OneTrust SDK resources. Please ensure that the OneTrust SDK is loaded successfully before RudderStack SDK.")),void(e.consents.initialized.value=!1);var i=globalThis.OneTrust.GetDomainData().Groups,r=globalThis.OnetrustActiveGroups.split(",").filter((function(e){return e})),o=[];i.forEach((function(e){var t=e.CustomGroupId;r.includes(t)||o.push(t)})),e.consents.initialized.value=!0,e.consents.data.value={allowedConsentIds:r,deniedConsentIds:o}},isDestinationConsented:function(e,t,n,i){if(!e.consents.initialized.value)return!0;var r=e.consents.data.value.allowedConsentIds;try{var o=t.oneTrustCookieCategories,a=t.consentManagement,s=function(e){return r.includes(e)};if(a){var u,l=null===(u=a.find((function(t){return t.provider===e.consents.provider.value})))||void 0===u?void 0:u.consents;if(!l)return!0;var c=l.map((function(e){return e.consent.trim()})).filter((function(e){return e}));return"or"===e.consents.resolutionStrategy.value?c.some(s)||0===c.length:c.every(s)}if(o){var d=o.map((function(e){return e.oneTrustCookieCategory.trim()})).filter((function(e){return e}));return d.every(s)}return!0}catch(v){return null==n||n.onError(v,gl,"Failed to determine the consent status for the destination. Please check the destination configuration and try again."),!0}}}}},ml="StorageEncryption",bl=function(){return{name:ml,initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[ml])},storage:{encrypt:function(e){return function(e){return"".concat(Ei).concat(se(e))}(e)},decrypt:function(e){return Ai(e)}}}},kl=(null===(Eu="undefined"!=typeof globalThis?globalThis:void 0)||void 0===Eu?void 0:Eu.crypto)||(null===(Au="undefined"!=typeof global?global:void 0)||void 0===Au?void 0:Au.crypto)||(null===(Su="undefined"!=typeof window?window:void 0)||void 0===Su?void 0:Su.crypto)||(null===(Iu="undefined"!=typeof self?self:void 0)||void 0===Iu?void 0:Iu.crypto)||(null===(Tu="undefined"!=typeof frames?frames:void 0)||void 0===Tu||null===(Tu=Tu[0])||void 0===Tu?void 0:Tu.crypto);wu=kl?function(e){for(var t=[],n=0;n<e;n+=4)t.push(kl.getRandomValues(new Uint32Array(1))[0]);return new Al(t,e)}:function(e){for(var t,n=[],i=function(e){var t=e,n=987654321,i=4294967295;return function(){var e=((n=36969*(65535&n)+(n>>16)&i)<<16)+(t=18e3*(65535&t)+(t>>16)&i)&i;return e/=4294967296,(e+=.5)*(Math.random()>.5?1:-1)}},r=0;r<e;r+=4){var o=i(4294967296*(t||Math.random()));t=987654071*o(),n.push(4294967296*o()|0)}return new Al(n,e)};var El=function(){return s((function e(){o(this,e)}),[{key:"mixIn",value:function(e){return Object.assign(this,e)}},{key:"clone",value:function(){var e=new this.constructor;return Object.assign(e,this),e}}],[{key:"create",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n){if(v())return Reflect.construct.apply(null,arguments);var i=[null];return i.push.apply(i,t),new(e.bind.apply(e,i))}(this,t)}}])}(),Al=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4*n.length;o(this,t),e=r(this,t);var a=n;if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var s=a.byteLength,u=[],l=0;l<s;l+=1)u[l>>>2]|=a[l]<<24-l%4*8;e.words=u,e.sigBytes=s}else e.words=n,e.sigBytes=i;return e}return d(t,e),s(t,[{key:"toString",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sl).stringify(this)}},{key:"concat",value:function(e){var t=this.words,n=e.words,i=this.sigBytes,r=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o+=1){var a=n[o>>>2]>>>24-o%4*8&255;t[i+o>>>2]|=a<<24-(i+o)%4*8}else for(var s=0;s<r;s+=4)t[i+s>>>2]=n[s>>>2];return this.sigBytes+=r,this}},{key:"clamp",value:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=Math.ceil(t/4)}},{key:"clone",value:function(){var e=m(t,"clone",this,1).call(this);return e.words=this.words.slice(0),e}}])}(El);u(Al,"random",wu);for(var Sl={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r+=1){var o=t[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new Al(n,t/2)}},Il=function(e){for(var t=e.words,n=e.sigBytes,i=[],r=0;r<n;r+=1){var o=t[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},Tl=function(e){for(var t=e.length,n=[],i=0;i<t;i+=1)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new Al(n,t)},wl={stringify:function(e){try{return decodeURIComponent(escape(Il(e)))}catch(mt){throw new Error("Malformed UTF-8 data")}},parse:function(e){return Tl(unescape(encodeURIComponent(e)))}},Pl=function(e){function t(){var e;return o(this,t),(e=r(this,t))._minBufferSize=0,e}return d(t,e),s(t,[{key:"reset",value:function(){this._data=new Al,this._nDataBytes=0}},{key:"_append",value:function(e){var t=e;"string"==typeof t&&(t=wl.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes}},{key:"_process",value:function(e){var t,n=this._data,i=this.blockSize,r=n.words,o=n.sigBytes,a=o/(4*i),s=(a=e?Math.ceil(a):Math.max((0|a)-this._minBufferSize,0))*i,u=Math.min(4*s,o);if(s){for(var l=0;l<s;l+=i)this._doProcessBlock(r,l);t=r.splice(0,s),n.sigBytes-=u}return new Al(t,u)}},{key:"clone",value:function(){var e=m(t,"clone",this,1).call(this);return e._data=this._data.clone(),e}}])}(El),Ol=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).blockSize=16,n.cfg=Object.assign(new El,e),n.reset(),n}return d(t,e),s(t,[{key:"reset",value:function(){m(t,"reset",this,1).call(this),this._doReset()}},{key:"update",value:function(e){return this._append(e),this._process(),this}},{key:"finalize",value:function(e){return e&&this._append(e),this._doFinalize()}}],[{key:"_createHelper",value:function(e){return function(t,n){return new e(n).finalize(t)}}},{key:"_createHmacHelper",value:function(e){return function(t,n){return new Cl(e,n).finalize(t)}}}])}(Pl),Cl=function(e){function t(e,n){var i;o(this,t),i=r(this,t);var a=new e;i._hasher=a;var s=n;"string"==typeof s&&(s=wl.parse(s));var u=a.blockSize,l=4*u;s.sigBytes>l&&(s=a.finalize(n)),s.clamp();var c=s.clone();i._oKey=c;var d=s.clone();i._iKey=d;for(var v=c.words,f=d.words,h=0;h<u;h+=1)v[h]^=1549556828,f[h]^=909522486;return c.sigBytes=l,d.sigBytes=l,i.reset(),i}return d(t,e),s(t,[{key:"reset",value:function(){var e=this._hasher;e.reset(),e.update(this._iKey)}},{key:"update",value:function(e){return this._hasher.update(e),this}},{key:"finalize",value:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}}])}(El),Dl={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s+=1)r.push(i.charAt(a>>>6*(3-s)&63));var u=i.charAt(64);if(u)for(;r.length%4;)r.push(u);return r.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){this._reverseMap=[],i=this._reverseMap;for(var r=0;r<n.length;
1r+=1)i[n.charCodeAt(r)]=r}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return function(e,t,n){for(var i=[],r=0,o=0;o<t;o+=1)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[r>>>2]|=a<<24-r%4*8,r+=1}return Al.create(i,r)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},Rl=[],Ml=0;Ml<64;Ml+=1)Rl[Ml]=4294967296*Math.abs(Math.sin(Ml+1))|0;var Ll=function(e,t,n,i,r,o,a){var s=e+(t&n|~t&i)+r+a;return(s<<o|s>>>32-o)+t},_l=function(e,t,n,i,r,o,a){var s=e+(t&i|n&~i)+r+a;return(s<<o|s>>>32-o)+t},Nl=function(e,t,n,i,r,o,a){var s=e+(t^n^i)+r+a;return(s<<o|s>>>32-o)+t},xl=function(e,t,n,i,r,o,a){var s=e+(n^(t|~i))+r+a;return(s<<o|s>>>32-o)+t},Bl=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t,[{key:"_doReset",value:function(){this._hash=new Al([1732584193,4023233417,2562383102,271733878])}},{key:"_doProcessBlock",value:function(e,t){for(var n=e,i=0;i<16;i+=1){var r=t+i,o=e[r];n[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var a=this._hash.words,s=n[t+0],u=n[t+1],l=n[t+2],c=n[t+3],d=n[t+4],v=n[t+5],f=n[t+6],h=n[t+7],g=n[t+8],p=n[t+9],y=n[t+10],m=n[t+11],b=n[t+12],k=n[t+13],E=n[t+14],A=n[t+15],S=a[0],I=a[1],T=a[2],w=a[3];S=Ll(S,I,T,w,s,7,Rl[0]),w=Ll(w,S,I,T,u,12,Rl[1]),T=Ll(T,w,S,I,l,17,Rl[2]),I=Ll(I,T,w,S,c,22,Rl[3]),S=Ll(S,I,T,w,d,7,Rl[4]),w=Ll(w,S,I,T,v,12,Rl[5]),T=Ll(T,w,S,I,f,17,Rl[6]),I=Ll(I,T,w,S,h,22,Rl[7]),S=Ll(S,I,T,w,g,7,Rl[8]),w=Ll(w,S,I,T,p,12,Rl[9]),T=Ll(T,w,S,I,y,17,Rl[10]),I=Ll(I,T,w,S,m,22,Rl[11]),S=Ll(S,I,T,w,b,7,Rl[12]),w=Ll(w,S,I,T,k,12,Rl[13]),T=Ll(T,w,S,I,E,17,Rl[14]),I=Ll(I,T,w,S,A,22,Rl[15]),S=_l(S,I,T,w,u,5,Rl[16]),w=_l(w,S,I,T,f,9,Rl[17]),T=_l(T,w,S,I,m,14,Rl[18]),I=_l(I,T,w,S,s,20,Rl[19]),S=_l(S,I,T,w,v,5,Rl[20]),w=_l(w,S,I,T,y,9,Rl[21]),T=_l(T,w,S,I,A,14,Rl[22]),I=_l(I,T,w,S,d,20,Rl[23]),S=_l(S,I,T,w,p,5,Rl[24]),w=_l(w,S,I,T,E,9,Rl[25]),T=_l(T,w,S,I,c,14,Rl[26]),I=_l(I,T,w,S,g,20,Rl[27]),S=_l(S,I,T,w,k,5,Rl[28]),w=_l(w,S,I,T,l,9,Rl[29]),T=_l(T,w,S,I,h,14,Rl[30]),I=_l
1(I,T,w,S,b,20,Rl[31]),S=Nl(S,I,T,w,v,4,Rl[32]),w=Nl(w,S,I,T,g,11,Rl[33]),T=Nl(T,w,S,I,m,16,Rl[34]),I=Nl(I,T,w,S,E,23,Rl[35]),S=Nl(S,I,T,w,u,4,Rl[36]),w=Nl(w,S,I,T,d,11,Rl[37]),T=Nl(T,w,S,I,h,16,Rl[38]),I=Nl(I,T,w,S,y,23,Rl[39]),S=Nl(S,I,T,w,k,4,Rl[40]),w=Nl(w,S,I,T,s,11,Rl[41]),T=Nl(T,w,S,I,c,16,Rl[42]),I=Nl(I,T,w,S,f,23,Rl[43]),S=Nl(S,I,T,w,p,4,Rl[44]),w=Nl(w,S,I,T,b,11,Rl[45]),T=Nl(T,w,S,I,A,16,Rl[46]),I=Nl(I,T,w,S,l,23,Rl[47]),S=xl(S,I,T,w,s,6,Rl[48]),w=xl(w,S,I,T,h,10,Rl[49]),T=xl(T,w,S,I,E,15,Rl[50]),I=xl(I,T,w,S,v,21,Rl[51]),S=xl(S,I,T,w,b,6,Rl[52]),w=xl(w,S,I,T,c,10,Rl[53]),T=xl(T,w,S,I,y,15,Rl[54]),I=xl(I,T,w,S,u,21,Rl[55]),S=xl(S,I,T,w,g,6,Rl[56]),w=xl(w,S,I,T,A,10,Rl[57]),T=xl(T,w,S,I,f,15,Rl[58]),I=xl(I,T,w,S,k,21,Rl[59]),S=xl(S,I,T,w,d,6,Rl[60]),w=xl(w,S,I,T,m,10,Rl[61]),T=xl(T,w,S,I,l,15,Rl[62]),I=xl(I,T,w,S,p,21,Rl[63]),a[0]=a[0]+S|0,a[1]=a[1]+I|0,a[2]=a[2]+T|0,a[3]=a[3]+w|0}},{key:"_doFinalize",value:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32;var r=Math.floor(n/4294967296),o=n;t[15+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(t.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u+=1){var l=s[u];s[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a}},{key:"clone",value:function(){var e=m(t,"clone",this,1).call(this);return e._hash=this._hash.clone(),e}}])}(Ol);Ol._createHelper(Bl),Ol._createHmacHelper(Bl);var Ul=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).cfg=Object.assign(new El,{keySize:4,hasher:Bl,iterations:1},e),n}return d(t,e),s(t,[{key:"compute",value:function(e,t){for(var n,i=this.cfg,r=i.hasher.create(),o=Al.create(),a=o.words,s=i.keySize,u=i.iterations;a.length<s;){n&&r.update(n),n=r.update(e).finalize(t),r.reset();for(var l=1;l<u;l+=1)n=r.finalize(n),r.reset();o.concat(n)}return o.sigBytes=4*s,o}}])}(El),jl="function"!=typeof Object.assign?function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}:Object.assign,Gl=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t)).cfg=jl(new El,i),a._xformMode=e,a._key=n,a.reset(),a}return d(t,e),s(t,[{key:"reset",value:function(){m(t,"reset",this,1).call(this),this._doReset()}},{key:"process",value:function(e){return this._append(e),this._process()}},{key:"finalize",value:function(e){return e&&this._append(e),this._doFinalize()}}],[{key:"createEncryptor",value:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)}},{key:"createDecryptor",value:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)}},{key:"_createHelper",value:function(e){var t=function(e){return"string"==typeof e?Wl:ql};return{encrypt:function(n,i,r){return t(i).encrypt(e,n,i,r)},decrypt:function(n,i,r){return t(i).decrypt(e,n,i,r)}}}}])}(Pl);function Fl(e,t,n){var i,r=e,o=this._iv;o?(i=o,this._iv=void 0):i=this._prevBlock;for(var a=0;a<n;a+=1)r[t+a]^=i[a]}Gl._ENC_XFORM_MODE=1,Gl._DEC_XFORM_MODE=2,Gl.keySize=4,Gl.ivSize=4;var Hl=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t)}(function(e){function t(e,n){var i;return o(this,t),(i=r(this,t))._cipher=e,i._iv=n,i}return d(t,e),s(t,null,[{key:"createEncryptor",value:function(e,t){return this.Encryptor.create(e,t)}},{key:"createDecryptor",value:function(e,t){return this.Decryptor.create(e,t)}}])}(El));Hl.Encryptor=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t,[{key:"processBlock",value:function(e,t){var n=this._cipher,i=n.blockSize;Fl.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}])}(Hl),Hl.Decryptor=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t,[{key:"processBlock",value:function(e,t){var n=this._cipher,i=n.blockSize,r=e.slice(t,t+i);n.decryptBlock(e,t),Fl.call(this,e,t,i),this._prevBlock=r}}])}(Hl);var zl={pad:function(e,t){for(var n=4*t,i=n-e.sigBytes%n,r=i<<24|i<<16|i<<8|i,o=[],a=0;a<i;a+=4)o.push(r);var s=Al.create(o,i);e.concat(s)},unpad:function(e){var t=e,n=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=n}},Ql=function(e){function t(e,n,i){var a;return o(this,t),(a=r(this,t,[e,n,jl({mode:Hl,padding:zl},i)])).blockSize=4,a}return d(t,e),s(t,[{key:"reset",value:function(){var e;m(t,"reset",this,1).call(this);var n=this.cfg,i=n.iv,r=n.mode;this._xformMode===this.constructor._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode=e.call(r,this,i&&i.words),this._mode.__creator=e}},{key:"_doProcessBlock",value:function(e,t){this._mode.processBlock(e,t)}},{key:"_doFinalize",value:function(){var e,t=this.cfg.padding;return this._xformMode===this.constructor._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e}}])}(Gl),Kl=function(e){function t(e){var n;return o(this,t),(n=r(this,t)).mixIn(e),n}return d(t,e),s(t,[{key:"toString",value:function(e){return(e||this.formatter).stringify(this)}}])}(El),Vl={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?Al.create([1398893684,1701076831]).concat(n).concat(t):t).toString(Dl)},parse:function(e){var t,n=Dl.parse(e),i=n.words;return 1398893684===i[0]&&1701076831===i[1]&&(t=Al.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),Kl.create({ciphertext:n,salt:t})}},ql=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t,null,[{key:"encrypt",value:function(e,t,n,i){var r=jl(new El,this.cfg,i),o=e.createEncryptor(n,r),a=o.finalize(t),s=o.cfg;return Kl.create({ciphertext:a,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:o.blockSize,formatter:r.format})}},{key:"decrypt",value:function(e,t,n,i){var r=t,o=jl(new El,this.cfg,i);return r=this._parse(r,o.format),e.createDecryptor(n,o).finalize(r.ciphertext)}},{key:"_parse",value:function(e,t){return"string"==typeof e?t.parse(e,this):e}}])}(El);ql.cfg=jl(new El,{format:Vl});var Xl={execute:function(e,t,n,i,r){var o,a=i;a||(a=Al.random(8)),o=r?Ul.create({keySize:t+n,hasher:r}).compute(e,a):Ul.create({keySize:t+n}).compute(e,a);var s=Al.create(o.words.slice(t),4*n);return o.sigBytes=4*t,Kl.create({key:o,iv:s,salt:a})}},Wl=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t,null,[{key:"encrypt",value:function(e,t,n,i){var r=jl(new El,this.cfg,i),o=r.kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=o.iv;var a=ql.encrypt.call(this,e,t,o.key,r);return a.mixIn(o),a}},{key:"decrypt",value:function(e,t,n,i){var r=t,o=jl(new El,this.cfg,i);r=this._parse(r,o.format);var a=o.kdf.execute(n,e.keySize,e.ivSize,r.salt,o.hasher);return o.iv=a.iv,ql.decrypt.call(this,e,r,a.key,o)}}])}(ql);Wl.cfg=jl(ql.cfg,{kdf:Xl});for(var Jl=[],Yl=[],$l=[],Zl=[],ec=[],tc=[],nc=[],ic=[],rc=[],oc=[],ac=[],sc=0;sc<256;sc+=1)ac[sc]=sc<128?sc<<1:sc<<1^283;for(var uc=0,lc=0,cc=0;cc<256;cc+=1){var dc=lc^lc<<1^lc<<2^lc<<3^lc<<4;dc=dc>>>8^255&dc^99,Jl[uc]=dc,Yl[dc]=uc;var vc=ac[uc],fc=ac[vc],hc=ac[fc],gc=257*ac[dc]^16843008*dc;$l[uc]=gc<<24|gc>>>8,Zl[uc]=gc<<16|gc>>>16,ec[uc]=gc<<8|gc>>>
124,tc[uc]=gc,gc=16843009*hc^65537*fc^257*vc^16843008*uc,nc[dc]=gc<<24|gc>>>8,ic[dc]=gc<<16|gc>>>16,rc[dc]=gc<<8|gc>>>24,oc[dc]=gc,uc?(uc=vc^ac[ac[ac[hc^vc]]],lc^=ac[ac[lc]]):uc=lc=1}var pc=[0,1,2,4,8,16,32,64,128,27,54],yc=function(e){function t(){return o(this,t),r(this,t,arguments)}return d(t,e),s(t,[{key:"_doReset",value:function(){var e;if(!this._nRounds||this._keyPriorReset!==this._key){this._keyPriorReset=this._key;var t=this._keyPriorReset,n=t.words,i=t.sigBytes/4;this._nRounds=i+6;var r=4*(this._nRounds+1);this._keySchedule=[];for(var o=this._keySchedule,a=0;a<r;a+=1)a<i?o[a]=n[a]:(e=o[a-1],a%i?i>6&&a%i==4&&(e=Jl[e>>>24]<<24|Jl[e>>>16&255]<<16|Jl[e>>>8&255]<<8|Jl[255&e]):(e=Jl[(e=e<<8|e>>>24)>>>24]<<24|Jl[e>>>16&255]<<16|Jl[e>>>8&255]<<8|Jl[255&e],e^=pc[a/i|0]<<24),o[a]=o[a-i]^e);this._invKeySchedule=[];for(var s=this._invKeySchedule,u=0;u<r;u+=1){var l=r-u;e=u%4?o[l]:o[l-4],s[u]=u<4||l<=4?e:nc[Jl[e>>>24]]^ic[Jl[e>>>16&255]]^rc[Jl[e>>>8&255]]^oc[Jl[255&e]]}}}},{key:"encryptBlock",value:function(e,t){this._doCryptBlock(e,t,this._keySchedule,$l,Zl,ec,tc,Jl)}},{key:"decryptBlock",value:function(e,t){var n=e,i=n[t+1];n[t+1]=n[t+3],n[t+3]=i,this._doCryptBlock(n,t,this._invKeySchedule,nc,ic,rc,oc,Yl),i=n[t+1],n[t+1]=n[t+3],n[t+3]=i}},{key:"_doCryptBlock",value:function(e,t,n,i,r,o,a,s){for(var u=e,l=this._nRounds,c=u[t]^n[0],d=u[t+1]^n[1],v=u[t+2]^n[2],f=u[t+3]^n[3],h=4,g=1;g<l;g+=1){var p=i[c>>>24]^r[d>>>16&255]^o[v>>>8&255]^a[255&f]^n[h];h+=1;var y=i[d>>>24]^r[v>>>16&255]^o[f>>>8&255]^a[255&c]^n[h];h+=1;var m=i[v>>>24]^r[f>>>16&255]^o[c>>>8&255]^a[255&d]^n[h];h+=1;var b=i[f>>>24]^r[c>>>16&255]^o[d>>>8&255]^a[255&v]^n[h];h+=1,c=p,d=y,v=m,f=b}var k=(s[c>>>24]<<24|s[d>>>16&255]<<16|s[v>>>8&255]<<8|s[255&f])^n[h];h+=1;var E=(s[d>>>24]<<24|s[v>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^n[h];h+=1;var A=(s[v>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&d])^n[h];h+=1;var S=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[d>>>8&255]<<8|s[255&v])^n[h];h+=1,u[t]=k,u[t+1]=E,u[t+2]=A,u[t+3]=S}}])}(Ql);yc.keySize=8;var mc,bc=Ql._createHelper(yc),kc="RudderEncrypt:",Ec="Rudder",Ac=function(e){return e.startsWith(kc)?bc.decrypt(e.substring(14),Ec).toString(wl):e},Sc="StorageEncryptionLegacy",Ic=function(){return{name:Sc,initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Sc])},storage:{encrypt:function(e){return function(e){return"".concat(kc).concat(bc.encrypt(e,Ec).toString())}(e)},decrypt:function(e){return Ac(e)}}}},Tc="StorageMigrator",wc=function(){return{name:Tc,initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Tc])},storage:{migrate:function(e,t,n,i){try{var r=t.getItem(e);if(K(r))return null;var o=Ac(r);return o===r&&(o=Ai(r)),K(o)?null:JSON.parse(o)}catch(a){return null==n||n.onError(a,"StorageMigratorPlugin",function(e){return"Failed to retrieve or parse data for ".concat(e," from storage.")}(e)),null}}}}},Pc={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100},Oc="v1",Cc=function(e,t,n){return Fe({batch:e,sentAt:t},!0,void 0,n)},Dc=function(e,t){var n=new URL(e);return new URL(fi([n.pathname,"/",Oc,"/",t].join("")),n).href},Rc=function(e,t,n,i){var r,o,a,s,u=(a="XhrQueuePlugin",s=null!==(r=null==e||null===(o=e.error)||void 0===o?void 0:o.message)&&void 0!==r?r:"Unknown","".concat(a).concat(Be,"Failed to deliver event(s). Cause: ").concat(s,".")),l="The event(s) will be dropped.";t?n.willBeRetried?(u="".concat(u," The event(s) will be retried."),n.retryAttemptNumber>0&&(u="".concat(u," Retry attempt ").concat(n.retryAttemptNumber," of ").concat(n.maxRetryAttempts,"."))):u="".concat(u," Retries exhausted (").concat(n.maxRetryAttempts,"). ").concat(l):u="".concat(u," ").concat(l),null==i||i.error(u)},Mc=function(e,t,n,i){var r,o,a,s,u=xe();if(Array.isArray(e)){var l=e.map((function(e){return Pi(e.event,u)}));r=Cc(l,u,i),o=e[0]?_(e[0].headers):{},s=t.lifecycle.activeDataplaneUrl.value,a=Dc(s,"batch")}else{var c=e.url,d=e.event,v=e.headers,f=Pi(d,u);r=Ii(f,i),o=_(v),a=c}return o.SentAt=u,n.reclaimed&&(o.Reclaimed="true"),n.retryAttemptNumber>0&&(o["Retry-Attempt"]=n.retryAttemptNumber.toString(),o["Retried-After"]=n.timeSinceLastAttempt.toString(),o["Retried-After-First"]=n.timeSinceFirstAttempt.toString()),{data:r,headers:o,url:a}},Lc="XhrQueue",_c=function(){return{name:Lc,deps:[],initialize:function(e){e.plugins.loadedPlugins.value=[].concat(b(e.plugins.loadedPlugins.value),[Lc])},dataplaneEventsQueue:{init:function(e,t,n,i,r){var o=e.lifecycle.writeKey.value;t.setAuthHeader(o);var a,s=(a=e.loadOptions.value.queueOptions,Z(Pc,a));return new zi("".concat("rudder","_").concat(o),s,(function(n,i,o){var a=Mc(n,e,o,r),s=a.data,u=a.url,l=a.headers;t.getAsyncData({url:u,options:{method:"POST",headers:l,data:s,sendRawData:!0},isRawResponse:!0,timeout:3e4,callback:function(e,t){var n,a;if(Q(null==t?void 0:t.error))i(null);else{var s=gi(null!==(n=null==t||null===(a=t.xhr)||void 0===a?void 0:a.status)&&void 0!==n?n:0);Rc(t,s,o,r),i(s?t:null)}}})}),n,li,r,(function(e){var t,n=xe(),i=e.map((function(e){return e.event}));return null===(t=Cc(i,n,r))||void 0===t?void 0:t.length}))},enqueue:function(e,t,n,i,r){n.sentAt=xe(),wi(n,r);var o=e.lifecycle.activeDataplaneUrl.value,a=Dc(o,n.type),s={AnonymousId:se(n.anonymousId)};t.addItem({url:a,headers:s,event:n})}}}},Nc=h(h({},{}),{BeaconQueue:Ki,CustomConsentManager:qi,DeviceModeDestinations:Ru,DeviceModeTransformation:Uu,ExternalAnonymousId:Fu,GoogleLinker:Ju,IubendaConsentManager:il,KetchConsentManager:ul,NativeDestinationQueue:hl,OneTrustConsentManager:yl,StorageEncryption:bl,StorageEncryptionLegacy:Ic,StorageMigrator:wc,XhrQueue:_c}),xc=function(){return s((function e(t,n,i){o(this,e),this.engine=t,this.errorHandler=n,this.logger=i,this.onError=this.onError.bind(this)}),[{key:"init",value:function(){kn.lifecycle.status.value="pluginsLoading",this.setActivePlugins(),this.registerLocalPlugins(),this.registerRemotePlugins(),this.attachEffects()}},{key:"attachEffects",value:function(){Ct((function(){(0===kn.plugins.activePlugins.value.length||kn.plugins.loadedPlugins.value.length+kn.plugins.failedPlugins.value.length===kn.plugins.totalPluginsToLoad.value)&&vt((function(){kn.plugins.ready.value=!0,kn.lifecycle.status.value="pluginsReady"}))}))}},{key:"getPluginsToLoadBasedOnConfig",value:function(){var e=this,t=kn.plugins.pluginsToLoadFromConfig.value;if(!t)return[];t=t.filter((function(t){return!si.includes(t)||(e.logger.warn(function(e,t){return"".concat(e).concat(Be).concat(t," plugin is deprecated. Please exclude it from the load API options.")}(be,t)),!1)}));var n=[{configurationStatus:function(){return V(kn.dataPlaneEvents.eventsQueuePluginName.value)},configurationStatusStr:"Data plane events delivery is enabled",activePluginName:kn.dataPlaneEvents.eventsQueuePluginName.value,supportedPlugins:Object.values(en),shouldAddMissingPlugins:!0},{configurationStatus:function(){return oi(kn.nativeDestinations.configuredDestinations.value).length>0},configurationStatusStr:"Device mode destinations are connected to the source",supportedPlugins:["DeviceModeDestinations","NativeDestinationQueue"]},{configurationStatus:function(){return oi(kn.nativeDestinations.configuredDestinations.value).some((function(e){return e.shouldApplyDeviceModeTransformation}))},configurationStatusStr:"Device mode transformations are enabled for at least one destination",supportedPlugins:["DeviceModeTransformation"]},{configurationStatus:function(){return V(kn.consents.activeConsentManagerPluginName.value)},configurationStatusStr:"Consent management is enabled",activePluginName:kn.consents.activeConsentManagerPluginName.value,supportedPlugins:Object.values($t)},{configurationStatus:function(){return V(kn.storage.encryptionPluginName.value)},configurationStatusStr:"Storage encryption is enabled",activePluginName:kn.storage.encryptionPluginName.value,supportedPlugins:Object.values(Zt)},{configurationStatus:function(){return kn.storage.migrate.value},configurationStatusStr:"Storage migration is enabled",supportedPlugins:["StorageMigrator"]}];
1return n.forEach((function(n){n.configurationStatus()?(t=t.filter(n.activePluginName?function(e){return!(e!==n.activePluginName&&n.supportedPlugins.includes(e))}:function(e){return V(e)}),e.addMissingPlugins(n,false,t)):t=t.filter(void 0!==n.basePlugins?function(e){return!(n.basePlugins.includes(e)||n.supportedPlugins.includes(e))}:function(e){return!n.supportedPlugins.includes(e)})})),[].concat(b(Object.keys({})),b(t))}},{key:"addMissingPlugins",value:function(e,t,n){var i=e.shouldAddMissingPlugins||t,r=(e.activePluginName?[].concat(b(e.basePlugins||[]),[e.activePluginName]):b(e.supportedPlugins)).filter((function(e){return!n.includes(e)}));r.length>0&&(i&&n.push.apply(n,b(r)),this.logger.warn(function(e,t,n,i){var r=1===n.length,o=r?" '".concat(n[0],"' plugin was"):" ['".concat(n.join("', '"),"'] plugins were"),a="".concat(e).concat(Be).concat(t,", but").concat(o," not configured to load.");return i?"".concat(a," So, ").concat(r?"the plugin":"those plugins"," will be loaded automatically."):"".concat(a," Ignore if this was intentional. Otherwise, consider adding ").concat(r?"it":"them"," to the 'plugins' load API option.")}(be,e.configurationStatusStr,r,i)))}},{key:"setActivePlugins",value:function(){var e,t=this.getPluginsToLoadBasedOnConfig(),n=[].concat(b(Object.keys(Nc)),b(ai)),i=[],r=[];t.forEach((function(e){n.includes(e)?i.push(e):r.push(e)})),r.length>0&&this.logger.warn((e=r,"".concat(be).concat(Be,"Ignoring unknown plugins: ").concat(e.join(", "),"."))),vt((function(){kn.plugins.totalPluginsToLoad.value=t.length,kn.plugins.activePlugins.value=i,kn.plugins.failedPlugins.value=r}))}},{key:"registerLocalPlugins",value:function(){var e=this;Object.values(Nc).forEach((function(t){F(t)&&kn.plugins.activePlugins.value.includes(t().name)&&e.register([t()])}))}},{key:"registerRemotePlugins",value:function(){var e=this,t=(kn.plugins.activePlugins.value,h({},{}));Promise.all(Object.keys(t).map(function(){var n=i(g().mark((function n(i){return g().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t[i]().then((function(t){return e.register([t.default()])})).catch((function(t){kn.plugins.failedPlugins.value=[].concat(b(kn.plugins.failedPlugins.value),[i]),e.onError(t,i)}));case 2:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())).catch((function(t){e.onError(t)}))}},{key:"invokeMultiple",value:function(e){try{for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(t=this.engine).invokeMultiple.apply(t,[e].concat(i))}catch(mt){return this.onError(mt,e),[]}}},{key:"invokeSingle",value:function(e){try{for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(t=this.engine).invokeSingle.apply(t,[e].concat(i))}catch(mt){return this.onError(mt,e),null}}},{key:"register",value:function(e){var t=this;e.forEach((function(e){try{t.engine.register(e,kn)}catch(mt){kn.plugins.failedPlugins.value=[].concat(b(kn.plugins.failedPlugins.value),[e.name]),t.onError(mt)}}))}},{key:"unregisterLocalPlugins",value:function(){var e=this;Object.values(Nc).forEach((function(t){try{e.engine.unregister(t().name)}catch(mt){e.onError(mt)}}))}},{key:"onError",value:function(e,t){this.errorHandler.onError(e,be,t)}}])}(),Bc="clientDataInCookie",Uc="clientDataInLocalStorage",jc="clientDataInSessionStorage",Gc=["userId","userTraits","anonymousId","groupId","groupTraits","initialReferrer","initialReferringDomain","sessionInfo","authToken"],Fc=u(u(u(u({},ui,Bc),li,Uc),di,"clientDataInMemory"),ci,jc),Hc=function(e){var t,n="function"!=typeof globalThis.URL?function(e){var t=document.createElement("a");return t.href=e,t.hostname}(e):new URL(e).hostname,i=null!==(t=null==n?void 0:n.split("."))&&void 0!==t?t:[],r=i[i.length-1],o=[];if(4===i.length&&r&&r===parseInt(r,10).toString())return o;if(i.length<=1)return i[0]&&-1!==i[0].indexOf("localhost")?["localhost"]:o;for(var a=i.length-2;a>=0;a-=1)o.push(i.slice(a).join("."));return o},zc=function(){var e=".".concat(function(e){for(var t=Hc(e),n=0;n<t.length;n+=1){var i=t[n],r="__tld__",o={domain:"".concat(-1!==i.indexOf("localhost")?""
1:".").concat(i)};if(bi(r,1,o),bi(r))return bi(r,null,o),i}return""}(globalThis.location.href));return{maxage:31536e6,path:"/",domain:e&&"."!==e?e:void 0,samesite:"Lax",enabled:!0}},Qc=new(function(){return s((function e(t){o(this,e),u(this,"isEnabled",!0),u(this,"length",0),u(this,"data",{}),this.options={enabled:!0},this.logger=t}),[{key:"configure",value:function(e){return this.options=Z(this.options,null!=e?e:{}),this.isEnabled=Boolean(this.options.enabled),this.options}},{key:"setItem",value:function(e,t){return this.data[e]=t,this.length=Object.keys(this.data).length,t}},{key:"getItem",value:function(e){return e in this.data?this.data[e]:null}},{key:"removeItem",value:function(e){return e in this.data&&delete this.data[e],this.length=Object.keys(this.data).length,null}},{key:"clear",value:function(){this.data={},this.length=0}},{key:"key",value:function(e){var t;return null!==(t=this.keys()[e])&&void 0!==t?t:null}},{key:"keys",value:function(){return Object.keys(this.data)}}])}())(_t),Kc={exports:{}};var Vc=(mc||(mc=1,Kc.exports=function(){function e(e){return e=JSON.stringify(e),!!/^\{[\s\S]*\}$/.test(e)}function t(e){return void 0===e||"function"==typeof e?e+"":JSON.stringify(e)}function n(e){if("string"==typeof e)try{return JSON.parse(e)}catch(mt){return e}}function i(e){return"[object Function]"==={}.toString.call(e)}function r(e){return"[object Array]"===Object.prototype.toString.call(e)}function o(e){var t="_Is_Incognit",n="yes";try{e||(e=window.localStorage),e.setItem(t,n),e.removeItem(t)}catch(mt){var i={_data:{},setItem:function(e,t){return i._data[e]=String(t)},getItem:function(e){return i._data.hasOwnProperty(e)?i._data[e]:void 0},removeItem:function(e){return delete i._data[e]},clear:function(){return i._data={}}};e=i}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var a=o();function s(){if(!(this instanceof s))return new s}s.prototype={set:function(n,i){if(n&&!e(n))a.setItem(n,t(i));else if(e(n))for(var r in n)this.set(r,n[r]);return this},get:function(e){if(void 0===e){var t={};return this.forEach((function(e,n){return t[e]=n})),t}if("?"===e.charAt(0))return this.has(e.substr(1));var i=arguments;if(i.length>1){for(var r={},o=0,s=i.length;o<s;o++){var u=n(a.getItem(i[o]));this.has(i[o])&&(r[i[o]]=u)}return r}return n(a.getItem(e))},clear:function(){return a.clear(),this},remove:function(e){var t=this.get(e);return a.removeItem(e),t},has:function(e){return{}.hasOwnProperty.call(this.get(),e)},keys:function(){var e=[];return this.forEach((function(t){e.push(t)})),e},forEach:function(e){for(var t=0,n=a.length;t<n;t++){var i=a.key(t);e(i,this.get(i))}return this},search:function(e){for(var t=this.keys(),n={},i=0,r=t.length;i<r;i++)t[i].indexOf(e)>-1&&(n[t[i]]=this.get(t[i]));return n},len:function(){return a.length}};var u=null;function l(t,n){var o=arguments,a=null;if(u||(u=s()),0===o.length)return u.get();if(1===o.length){if("string"==typeof t)return u.get(t);if(e(t))return u.set(t)}if(2===o.length&&"string"==typeof t){if(!n)return u.remove(t);if(n&&"string"==typeof n)return u.set(t,n);n&&i(n)&&(a=null,a=n(t,u.get(t)),l.set(t,a))}if(2===o.length&&r(t)&&i(n))for(var c=0,d=t.length;c<d;c++)a=n(t[c],u.get(t[c])),l.set(t[c],a);return l}for(var c in s.prototype)l[c]=s.prototype[c];return l}()),Kc.exports),qc=En(Vc),Xc=function(){return!K(globalThis.navigator.userAgentData)},Wc={URL:function(){return!F(globalThis.URL)||!F(globalThis.URLSearchParams)},Promise:function(){return!F(globalThis.Promise)},"Number.isNaN":function(){return!F(globalThis.Number.isNaN)},"Number.isInteger":function(){return!F(globalThis.Number.isInteger)},"Array.from":function(){return!F(globalThis.Array.from)},"Array.prototype.find":function(){return!F(globalThis.Array.prototype.find)},"Array.prototype.includes":function(){return!F(globalThis.Array.prototype.includes)},"String.prototype.endsWith":function(){return!F(globalThis.String.prototype.endsWith)},"String.prototype.startsWith":function(){return!F(globalThis.String.prototype.startsWith)},"String.prototype.includes":function(){return!F(globalThis.String.prototype.includes)},"String.prototype.replaceAll":function(){return!F(globalThis.String.prototype.replaceAll)},"String.fromCodePoint":function(){return!F(globalThis.String.fromCodePoint)},"Object.entries":function(){return!F(globalThis.Object.entries)},"Object.values":function(){return!F(globalThis.Object.values)},"Object.assign":function(){return!F(globalThis.Object.assign)},"Object.fromEntries":function(){return!F(globalThis.Object.fromEntries)},"Element.prototype.dataset":function(){return(e=globalThis.document.createElement("div")).setAttribute("data-a-b","c"),!(e.dataset&&"c"===e.dataset.aB);var e},TextEncoder:function(){return!F(globalThis.TextEncoder)||!F(globalThis.TextDecoder)},requestAnimationFrame:function(){return!F(globalThis.requestAnimationFrame)||!F(globalThis.cancelAnimationFrame)},CustomEvent:function(){return!F(globalThis.CustomEvent)},"navigator.sendBeacon":function(){return!F(globalThis.navigator.sendBeacon)},ArrayBuffer:function(){return!F(globalThis.Uint8Array)},Set:function(){return!F(globalThis.Set)},atob:function(){return!F(globalThis.atob)}},Jc=function(){return{width:globalThis.screen.width,height:globalThis.screen.height,density:globalThis.devicePixelRatio,innerWidth:globalThis.innerWidth,innerHeight:globalThis.innerHeight}},Yc=function(e){var t=["QuotaExceededError","NS_ERROR_DOM_QUOTA_REACHED"].includes(e.name)||[22,1014].includes(e.code);return e instanceof DOMException&&t},$c=function(){var e,t,n,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:li,o=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0,s=(n=r,"".concat(pe).concat(Be,'The "').concat(n,'" storage type is ')),u="unavailable",l=!0;try{switch(r){case di:return!0;case ui:e=o,t="test_rudder_cookie";break;case li:e=null!=o?o:globalThis.localStorage,t="test_rudder_ls";break;case ci:e=null!=o?o:globalThis.sessionStorage,t="test_rudder_ss";break;default:return!1}if(e&&(e.setItem(t,"true"),e.getItem(t)))return e.removeItem(t),!0;l=!1}
1catch(c){l=!1,i=c,Yc(c)&&(u="full")}return l||null==a||a.warn("".concat(s).concat(u,"."),i),!1},Zc=new(function(){return s((function e(t){o(this,e),u(this,"isSupportAvailable",!0),u(this,"isEnabled",!0),u(this,"length",0),this.options={enabled:!0},this.logger=t}),[{key:"configure",value:function(e){return this.options=Z(this.options,null!=e?e:{}),this.isSupportAvailable=$c(li),this.isEnabled=Boolean(this.options.enabled&&this.isSupportAvailable),this.options}},{key:"setItem",value:function(e,t){qc.set(e,t),this.length=qc.len()}},{key:"getItem",value:function(e){var t=qc.get(e);return Q(t)?null:t}},{key:"removeItem",value:function(e){qc.remove(e),this.length=qc.len()}},{key:"clear",value:function(){qc.clear(),this.length=0}},{key:"key",value:function(e){var t;return null!==(t=this.keys()[e])&&void 0!==t?t:null}},{key:"keys",value:function(){return qc.keys()}}])}())(_t),ed=function(){return s((function e(t){o(this,e),u(this,"isSupportAvailable",!0),u(this,"isEnabled",!0),u(this,"length",0),this.options={enabled:!0},this.logger=t}),[{key:"configure",value:function(e){return this.options=Z(this.options,null!=e?e:{}),this.isSupportAvailable=$c(ci),this.isSupportAvailable&&(this.store=globalThis.sessionStorage),this.isEnabled=Boolean(this.options.enabled&&this.isSupportAvailable),this.options}},{key:"setItem",value:function(e,t){this.store&&(this.store.setItem(e,t),this.length=this.store.length)}},{key:"getItem",value:function(e){if(!this.store)return null;var t=this.store.getItem(e);return Q(t)?null:t}},{key:"removeItem",value:function(e){this.store&&(this.store.removeItem(e),this.length=this.store.length)}},{key:"clear",value:function(){var e;null===(e=this.store)||void 0===e||e.clear(),this.length=0}},{key:"key",value:function(e){var t,n;return null!==(t=null===(n=this.store)||void 0===n?void 0:n.key(e))&&void 0!==t?t:null}},{key:"keys",value:function(){var e=[];if(!this.store)return e;for(var t=0;t<this.store.length;t+=1){var n=this.store.key(t);null!==n&&e.push(n)}return e}}])}(),td=new ed(_t),nd=new(function(){return s((function e(t){o(this,e),u(this,"isSupportAvailable",!0),u(this,"isEnabled",!0),u(this,"length",0),this.logger=t}),[{key:"configure",value:function(e){return this.options||(this.options=zc()),this.options=Z(this.options,null!=e?e:{}),this.options.sameDomainCookiesOnly&&delete this.options.domain,this.isSupportAvailable=$c(ui,this),this.isEnabled=Boolean(this.options.enabled&&this.isSupportAvailable),this.options}},{key:"setItem",value:function(e,t){return bi(e,t,this.options,this.logger),this.length=Object.keys(bi()).length,!0}},{key:"getItem",value:function(e){var t=bi(e);return Q(t)?null:t}},{key:"removeItem",value:function(e){var t=this.setItem(e,null);return this.length=Object.keys(bi()).length,t}},{key:"clear",value:function(){}},{key:"key",value:function(e){var t;return null!==(t=this.keys()[e])&&void 0!==t?t:null}},{key:"keys",value:function(){return Object.keys(bi())}}])}())(_t),id=function(e){switch(e){case li:return Zc;case ci:return td;case di:return Qc;case ui:return nd;default:return Qc}},rd=function(){var e,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};!function(e){var t=nd.configure(e);kn.storage.cookie.value={maxage:t.maxage,path:t.path,domain:t.domain,samesite:t.samesite,expires:t.expires,secure:t.secure}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),e=t,Zc.configure(e),function(e){Qc.configure(e)}(n),function(e){td.configure(e)}(i)},od=function(){return s((function e(t,n,i){var r,a;o(this,e),this.id=t.id,this.name=t.name,this.isEncrypted=null!==(r=t.isEncrypted)&&void 0!==r&&r,this.validKeys=null!==(a=t.validKeys)&&void 0!==a?a:{},this.engine=n,this.noKeyValidation=0===Object.keys(this.validKeys).length,this.noCompoundKey=t.noCompoundKey,this.originalEngine=this.engine,this.errorHandler=t.errorHandler,this.logger=t.logger,this.pluginsManager=i}),[{key:"createValidKey",value:function(e){var t,n=this.name,i=this.id,r=this.validKeys,o=this.noKeyValidation,a=this.noCompoundKey;return o?a?e:[n,i,e].join("."):(Object.values(r).forEach((function(r){r===e&&(t=a?e:[n,i,e].join("."))})),t)}},{key:"swapQueueStoreToInMemoryEngine",value:function(){var e=this,t=this.name,n=this.id,i=this.validKeys,r=this.noCompoundKey,o=id(di);
1Object.keys(i).forEach((function(a){var s=e.get(i[a]),u=r?a:[t,n,a].join(".");o.setItem(u,s),e.remove(a)})),this.engine=o}},{key:"set",value:function(e,t){var n,i=this.createValidKey(e);if(i)try{this.engine.setItem(i,this.encrypt(Fe(t,!1,[],this.logger)))}catch(r){Yc(r)?(this.logger.warn((n="Store ".concat(this.id),"".concat(n).concat(Be,"The storage is either full or unavailable, so the data will not be persisted. Switching to in-memory storage."))),this.swapQueueStoreToInMemoryEngine(),this.set(e,t)):this.onError(Ve(r,function(e){return'Failed to save the value for "'.concat(e,'" to storage')}(e)))}}},{key:"get",value:function(e){var t,n=this.createValidKey(e);try{return n?(t=this.decrypt(this.engine.getItem(n)),K(t)?null:JSON.parse(t)):null}catch(i){return this.onError(new Error("".concat(function(e){return'Failed to retrieve or parse data for "'.concat(e,'" from storage')}(e),": ").concat(i.message))),H(t)&&t.startsWith("RudderEncrypt:")&&this.logger.warn(function(e){return"The cookie data for ".concat(e," seems to be encrypted using SDK versions < v3. The data is dropped. This can potentially stem from using SDK versions < v3 on other sites or web pages that can share cookies with this webpage. We recommend using the same SDK (v3) version everywhere or avoid disabling the storage data migration.")}(e)),null}}},{key:"remove",value:function(e){var t=this.createValidKey(e);t&&this.engine.removeItem(t)}},{key:"getOriginalEngine",value:function(){return this.originalEngine}},{key:"decrypt",value:function(e){return K(e)?null:this.crypto(e,"decrypt")}},{key:"encrypt",value:function(e){return this.crypto(e,"encrypt")}},{key:"crypto",value:function(e,t){var n=!this.isEncrypted||!e||"string"!=typeof e||""===function(e){return e.replace(/^\s+|\s+$/gm,"")}(e);if(n)return e;var i="storage.".concat(t),r=this.pluginsManager?this.pluginsManager.invokeSingle(i,e):e;return void 0===r?e:null!=r?r:""}},{key:"onError",value:function(e){this.errorHandler.onError(e,"Store ".concat(this.id))}}])}(),ad=function(){return s((function e(t,n,i){o(this,e),u(this,"stores",{}),u(this,"isInitialized",!1),this.errorHandler=n,this.logger=i,this.pluginsManager=t}),[{key:"init",value:function(){var e,t,n;if(!this.isInitialized){var i=kn.loadOptions.value,r={cookieStorageOptions:{samesite:i.sameSiteCookie,secure:i.secureCookie,domain:i.setCookieDomain,sameDomainCookiesOnly:i.sameDomainCookiesOnly},localStorageOptions:{},inMemoryStorageOptions:{},sessionStorageOptions:{}};rd(te(Z(null!==(e=r.cookieStorageOptions)&&void 0!==e?e:{},null!==(t=null===(n=kn.storage.cookie)||void 0===n?void 0:n.value)&&void 0!==t?t:{})),te(r.localStorageOptions),te(r.inMemoryStorageOptions),te(r.sessionStorageOptions)),this.initClientDataStores(),this.isInitialized=!0}}},{key:"initClientDataStores",value:function(){var e=this;this.initializeStorageState(),[di,li,ui,ci].forEach((function(t){var n;null!==(n=id(t))&&void 0!==n&&n.isEnabled&&e.setStore({id:Fc[t],name:Fc[t],isEncrypted:!0,noCompoundKey:!0,type:t,errorHandler:e.errorHandler,logger:e.logger})}))}},{key:"initializeStorageState",value:function(){var e,t=this,n=kn.storage.type.value,i=null===(e=kn.loadOptions.value.storage)||void 0===e?void 0:e.entries,r=kn.consents.postConsent.value.storage;(V(null==r?void 0:r.type)||V(null==r?void 0:r.entries))&&(n=null==r?void 0:r.type,i=null==r?void 0:r.entries);var o=!0,a={};
1Gc.forEach((function(e){var r,s,l,c=e,d=null===(r=i)||void 0===r||null===(r=r[e])||void 0===r?void 0:r.type,v=function(e,t){var n,i;if(e.consents.preConsent.value.enabled)switch(null===(i=e.consents.preConsent.value.storage)||void 0===i?void 0:i.strategy){case"none":n=vi;break;case"session":"sessionInfo"!==t&&(n=vi);break;case"anonymousId":"anonymousId"!==t&&(n=vi)}return n}(kn,e),f=null!==(s=null!==(l=null!=v?v:d)&&void 0!==l?l:n)&&void 0!==s?s:Bt,g=t.getResolvedStorageTypeForEntry(f,e);g!==vi&&(o=!1),a=h(h({},a),{},u({},e,{type:g,key:ki[c]}))})),vt((function(){kn.storage.type.value=n,kn.storage.entries.value=a,kn.storage.trulyAnonymousTracking.value=o}))}},{key:"getResolvedStorageTypeForEntry",value:function(e,t){var n,i,r,o,a,s=e;switch(e){case li:null!==(n=id(li))&&void 0!==n&&n.isEnabled||(s=di);break;case ci:null!==(i=id(ci))&&void 0!==i&&i.isEnabled||(s=di);break;case di:case vi:break;default:s=null!==(r=id(ui))&&void 0!==r&&r.isEnabled?ui:null!==(o=id(li))&&void 0!==o&&o.isEnabled?li:null!==(a=id(ci))&&void 0!==a&&a.isEnabled?ci:di}return s!==e&&this.logger.warn(function(e,t,n,i){return"".concat(e).concat(Be,'The storage type "').concat(n,'" is not available for entry "').concat(t,'". The SDK will initialize the entry with "').concat(i,'" storage type instead.')}("StoreManager",t,e,s)),s}},{key:"setStore",value:function(e){var t=id(e.type);return this.stores[e.id]=new od(e,t,this.pluginsManager),this.stores[e.id]}},{key:"getStore",value:function(e){return this.stores[e]}}])}(),sd=function(e){var t=new URL(e),n=t.host,i=t.protocol,r=n.split(".");return{topDomain:r.length>2?"".concat(r[r.length-2],".").concat(r[r.length-1]):n,protocol:i}},ud=function(e,t){var n=t?window.location.origin:function(e){var t=sd(e),n=t.topDomain,i=t.protocol;return"".concat(i,"//").concat(n)}(window.location.href),i=e.startsWith("/")?e.substring(1):e;return"".concat(n,"/").concat(i)},ld=function(e){return null!=e&&e.endsWith("/")?ld(e.substring(0,e.length-1)):e},cd=function(e){try{return new URL(e).host}catch(t){return null}},dd=function(e){var t;return null!==(t=cd(e))&&void 0!==t?t:""},vd=function(e){var t={};try{var n=new URL(e),i="utm_";n.searchParams.forEach((function(e,n){if(n.startsWith(i)){var r=n.substring(4);"campaign"===r&&(r="name"),t[r]=e}}))}catch(r){}return t},fd="none",hd="immediate",gd=function(e){return ee(e)||Array.isArray(e)},pd=function(e,t){var n,i,r=e.provider,o=r?$t[r]:void 0;return r&&!o&&(t.error((n=r,i=$t,"".concat(ye).concat(Be,'The consent manager "').concat(n,'" is not supported. Please choose one of the following supported consent managers: "').concat(Object.keys(i),'".'))),r=void 0),{provider:r,consentManagerPluginName:o}},yd=function(e,t){var n,i,r=[],o=[],a=!1,s=!0===(null==e?void 0:e.enabled);if(ee(e)&&s){var u=pd(e,t);i=u.provider,n=u.consentManagerPluginName,gd(e.allowedConsentIds)&&(r=e.allowedConsentIds,a=!0),gd(e.deniedConsentIds)&&(o=e.deniedConsentIds,a=!0)}var l={allowedConsentIds:r,deniedConsentIds:o};return{provider:i,consentManagerPluginName:n,initialized:a,enabled:s=s&&Boolean(n),consentsData:l}},md=function(){var e=document.querySelector("script[data-rsa-write-key]");if(e&&e.dataset.rsaWriteKey===kn.lifecycle.writeKey.value)return e.src;var t,n=/(?:^|\/)rsa(\.min)?\.js$/,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(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,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(document.getElementsByTagName("script"));try{for(i.s();!(t=i.n()).done;){var r=t.value.getAttribute("src");if(r&&n.test(r))return r}}catch(o){i.e(o)}finally{i.f()}},bd=function(e){var t,n,i;kn.reporting.isErrorReportingEnabled.value=!(n=e.source.config,!0!==(null==n||null===(i=n.statsCollection)||void 0===i||null===(i=i.errors)||void 0===i?void 0:i.enabled)||null!==(t=window.chrome)&&void 0!==t&&null!==(t=t.runtime)&&void 0!==t&&t.id),kn.reporting.isMetricsReportingEnabled.value=function(e){var t;return!0===(null==e||null===(t=e.statsCollection)||void 0===t||null===(t=t.metrics)||void 0===t?void 0:t.enabled)}(e.source.config)},kd=function(e){var t,n,i=kn.loadOptions.value,r=i.useServerSideCookies,o=i.dataServiceEndpoint,a=i.storage,s=i.setCookieDomain,u=i.sameDomainCookiesOnly,l=null==a?void 0:a.cookie,c=!1;if(r){var d;c=r;var v=null!==(d=l.domain)&&void 0!==d?d:s,f=V(v)&&(n=oe(v),!(sd(window.location.href).topDomain===n))||u,g=ud(null!=o?o:"rsaRequest",f);if(hi(g)){t=ld(g);var p=cd(window.location.href),y=cd(g);p!==y&&(l=h(h({},l),{},{samesite:"None",secure:!0})),!u&&f&&y!==oe(v)&&(c=!1,e.warn(function(e,t,n){return"".concat(e).concat(Be,"The provided cookie domain (").concat(t,") does not match the current webpage's domain (").concat(n,"). Hence, the cookies will be set client-side.")}(ye,v,y)))}else c=!1}
1return{sscEnabled:c,cookieOptions:l,finalDataServiceUrl:t}},Ed=function(e){var t,n=kn.loadOptions.value.storage,i=null==n?void 0:n.type;V(i)&&!function(e){return"string"==typeof e&&xt.includes(e)}(i)&&(e.warn(function(e,t,n){return"".concat(e).concat(Be,'The storage type "').concat(t,'" is not supported. Please choose one of the following supported types: "').concat(xt,'". The default type "').concat(n,'" will be used instead.')}(ye,i,Bt)),i=Bt);var r,o,a,s=null==n||null===(t=n.encryption)||void 0===t?void 0:t.version,u=s&&Zt[s];!Q(s)&&Q(u)?(e.warn((r=s,o=Zt,a=Yt,"".concat(ye).concat(Be,'The storage encryption version "').concat(r,'" is not supported. Please choose one of the following supported versions: "').concat(Object.keys(o),'". The default version "').concat(a,'" will be used instead.'))),s=Yt):Q(s)&&(s=Yt);var l=null==n?void 0:n.migrate,c=l&&s===Yt;!0===l&&c!==l&&e.warn(function(e,t,n){return"".concat(e).concat(Be,"The storage data migration has been disabled because the configured storage encryption version (").concat(t,") is not the latest (").concat(n,"). To enable storage data migration, please update the storage encryption version to the latest version.")}(ye,s,Yt));var d=kd(e),v=d.sscEnabled,f=d.finalDataServiceUrl,h=d.cookieOptions;vt((function(){kn.storage.type.value=i,kn.storage.cookie.value=h,kn.serverCookies.isEnabledServerSideCookies.value=v,kn.serverCookies.dataServiceUrl.value=f,kn.storage.encryptionPluginName.value=Zt[s],kn.storage.migrate.value=c}))},Ad=function(e){var t,n,i,r,o,a,s,u,l=yd(kn.loadOptions.value.consentManagement,e),c=l.provider,d=l.consentManagerPluginName,v=l.initialized,f=l.enabled,h=l.consentsData,g=kn.loadOptions.value.preConsent,p=null!==(t=null==g||null===(n=g.storage)||void 0===n?void 0:n.strategy)&&void 0!==t?t:fd;V(p)&&!["none","session","anonymousId"].includes(p)&&(p=fd,e.warn((a=ye,s=null==g||null===(o=g.storage)||void 0===o?void 0:o.strategy,u=fd,"".concat(a).concat(Be,'The pre-consent storage strategy "').concat(s,'" is not supported. Please choose one of the following supported strategies: "none, session, anonymousId". The default strategy "').concat(u,'" will be used instead.'))));var y,m=null!==(i=null==g||null===(r=g.events)||void 0===r?void 0:r.delivery)&&void 0!==i?i:hd;V(m)&&!["immediate","buffer"].includes(m)&&(m=hd,e.warn(function(e,t,n){return"".concat(e).concat(Be,'The pre-consent events delivery type "').concat(t,'" is not supported. Please choose one of the following supported types: "immediate, buffer". The default type "').concat(n,'" will be used instead.')}(ye,null==g||null===(y=g.events)||void 0===y?void 0:y.delivery,hd)));vt((function(){var e;kn.consents.activeConsentManagerPluginName.value=d,kn.consents.initialized.value=v,kn.consents.enabled.value=f,kn.consents.data.value=h,kn.consents.provider.value=c,kn.consents.preConsent.value={enabled:!0===(null===(e=kn.loadOptions.value.preConsent)||void 0===e?void 0:e.enabled)&&!1===v&&!0===f,storage:{strategy:p},events:{delivery:m}}}))},Sd=function(e){if(kn.dataPlaneEvents.deliveryEnabled.value){var t="XhrQueue",n=t;kn.loadOptions.value.useBeacon&&(kn.capabilities.isBeaconAvailable.value?n="BeaconQueue":(n=t,e.warn("".concat(ye).concat(Be,"The Beacon API is not supported by your browser. The events will be sent using XHR instead.")))),vt((function(){kn.dataPlaneEvents.eventsQueuePluginName.value=n}))}},Id=function(e,t,n,i,r){var o=new URLSearchParams({p:"cdn",v:We,build:Kt,writeKey:t,lockIntegrationsVersion:n.toString(),lockPluginsVersion:i.toString()}),a=Jt,s=o,u="/sourceConfig/",l="";if(hi(e)){var c=new URL(e);ld(c.pathname).endsWith("/sourceConfig")||(c.pathname="".concat(ld(c.pathname),"/sourceConfig/")),c.pathname=fi(c.pathname),o.forEach((function(e,t){null===c.searchParams.get(t)&&c.searchParams.set(t,e)})),a=c.origin,u=c.pathname,s=c.searchParams,l=c.hash}else r.warn(function(e,t){return"".concat(e).concat(Be,'The provided source config URL "').concat(t,'" is invalid. Using the default source config URL instead.')}(ye,e));return"".concat(a).concat(u,"?").concat(s).concat(l)},Td=function(e,t,n,i,r,o,a){var s,u,l;if(o){if(!hi(o))return a.error((u=e,l=o,"".concat(ye).concat(Be,'The base URL "').concat(l,'" for ').concat(u," is not val
1id."))),null;s=ld(o)}else if(s=n,"cdn"===kn.context.app.value.installType){var c=md();c&&(s=c.split("/").slice(0,-1).concat(t).join("/"))}return r&&(s=s.replace(new RegExp("/".concat(qt,"/").concat(Kt,"/").concat(t,"$")),"/".concat(i,"/").concat(Kt,"/").concat(t))),s},wd=function(){return s((function e(t,n,i){o(this,e),this.errorHandler=n,this.logger=i,this.httpClient=t,this.onError=this.onError.bind(this),this.processConfig=this.processConfig.bind(this)}),[{key:"attachEffects",value:function(){var e=this;Ct((function(){e.logger.setMinLogLevel(kn.lifecycle.logLevel.value)}))}},{key:"init",value:function(){var e=this,t=kn.loadOptions.value,n=t.logLevel,i=t.configUrl,r=t.lockIntegrationsVersion,o=t.lockPluginsVersion,a=t.destSDKBaseURL;t.pluginsSDKBaseURL;var s=t.integrations,u=function(e,t,n,i){return Td("integrations",zt,Xt,e,t,n,i)}(We,r,a,this.logger);z(u)||(this.attachEffects(),kn.lifecycle.activeDataplaneUrl.value=ld(kn.lifecycle.dataPlaneUrl.value),Ed(this.logger),Ad(this.logger),Sd(this.logger),vt((function(){kn.lifecycle.integrationsCDNPath.value=u,kn.lifecycle.pluginsCDNPath.value=undefined,n&&(kn.lifecycle.logLevel.value=n),kn.lifecycle.sourceConfigUrl.value=Id(i,kn.lifecycle.writeKey.value,r,o,e.logger),kn.metrics.metricsServiceUrl.value="".concat(kn.lifecycle.activeDataplaneUrl.value,"/").concat("rsaMetrics"),kn.nativeDestinations.loadOnlyIntegrations.value=s})),this.getConfig())}},{key:"onError",value:function(e,t){this.errorHandler.onError(e,ye,t)}},{key:"processConfig",value:function(e,t){if(V(e)){var n;try{n=H(e)?JSON.parse(e):e}catch(r){return void this.onError(r,Ut)}if(function(e){return Y(e)&&Y(e.source)&&!K(e.source.id)&&Y(e.source.config)&&Array.isArray(e.source.destinations)}(n))if(!1!==n.source.enabled){bd(n);var i=n.source.destinations.length>0?function(e){var t=[];return e.forEach((function(e){e.enabled&&!e.deleted&&t.push({id:e.id,displayName:e.destinationDefinition.displayName,config:e.config,shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,userFriendlyId:"".concat(e.destinationDefinition.displayName.replaceAll(" ","-"),"___").concat(e.id)})})),t}(n.source.destinations):[];vt((function(){var e;kn.source.value={config:n.source.config,name:n.source.name,id:n.source.id,workspaceId:n.source.workspaceId},kn.nativeDestinations.configuredDestinations.value=i,kn.plugins.pluginsToLoadFromConfig.value=null!==(e=kn.loadOptions.value.plugins)&&void 0!==e?e:[],function(e){var t,n=kn.consents.resolutionStrategy.value;if(Y(e.consentManagementMetadata)){var i,r;kn.consents.provider.value&&(n=null!==(i=null===(r=e.consentManagementMetadata.providers.find((function(e){return e.provider===kn.consents.provider.value})))||void 0===r?void 0:r.resolutionStrategy)&&void 0!==i?i:kn.consents.resolutionStrategy.value),t=e.consentManagementMetadata}"custom"===kn.consents.provider.value&&(n=void 0),vt((function(){kn.consents.metadata.value=_(t),kn.consents.resolutionStrategy.value=n}))}(n),kn.lifecycle.status.value="configured"}))}else this.logger.error("The source is disabled. Please enable the source in the dashboard to send events.");else this.onError(new Error(Ut))}else V(t)?this.onError(t.error,jt):this.onError(new Error(jt))}},{key:"getConfig",value:function(){var e,t=this,n=kn.loadOptions.value.getSourceConfig;if(n){if(!F(n))return void this.logger.error((e=ye,"".concat(e).concat(Be,'The "getSourceConfig" load API option must be a function that returns valid source configuration data.')));var i=n();i instanceof Promise?i.then((function(e){return t.processConfig(e)})).catch((function(e){t.onError(e,"SourceConfig")})):this.processConfig(i)}else this.httpClient.getAsyncData({url:kn.lifecycle.sourceConfigUrl.value,options:{headers:{"Content-Type":void 0}},callback:this.processConfig})}}])}(),Pd=function(){var e;return(null===(e=document)||void 0===e?void 0:e.referrer)||"$direct"},Od=function(){var e=function(){for(var e=document.getElementsByTagName("link"),t="",n=0;e[n];n+=1){var i=e[n];if("canonical"===i.getAttribute("rel")&&!t){var r;t=null!==(r=i.getAttribute("href"))&&void 0!==r?r:"";break}}return t}(),t=globalThis.location.pathname,n=globalThis.location.href,i=n,r=globalThis.location.search;if(e)try{var o=new URL(e);i=""===o.search?e+r:e,t=o.pathname}catch(l){}var a=function(e){var t=e;try{var n=new URL(e);t=n.origin+n.pathname+n.search}catch(i){}return t}(i),s=document.title,u=Pd();return{path:t,referrer:u,referring_domain:dd(u),search:r,title:s,url:a,tab_url:n}}
1,Cd="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=".concat(Object.keys(Wc).join("%2C")),Dd="rudderstackPolyfill",Rd=function(){return s((function e(t,n,i){o(this,e),this.httpClient=t,this.errorHandler=n,this.logger=i,this.externalSrcLoader=new lt(this.errorHandler,this.logger),this.onError=this.onError.bind(this),this.onReady=this.onReady.bind(this)}),[{key:"init",value:function(){this.prepareBrowserCapabilities(),this.attachWindowListeners()}},{key:"detectBrowserCapabilities",value:function(){var e=this;vt((function(){var t,n;kn.capabilities.storage.isCookieStorageAvailable.value=$c(ui,id(ui),e.logger),kn.capabilities.storage.isLocalStorageAvailable.value=$c(li,void 0,e.logger),kn.capabilities.storage.isSessionStorageAvailable.value=$c(ci,void 0,e.logger),kn.capabilities.isBeaconAvailable.value=!K(globalThis.navigator.sendBeacon)&&F(globalThis.navigator.sendBeacon),kn.capabilities.isUaCHAvailable.value=Xc(),kn.capabilities.isCryptoAvailable.value=!K(globalThis.crypto)&&F(globalThis.crypto.getRandomValues),kn.capabilities.isIE11.value=Boolean(globalThis.navigator.userAgent.match(/Trident.*rv:11\./)),kn.capabilities.isOnline.value=globalThis.navigator.onLine,kn.context.userAgent.value=function(){if(Q(globalThis.navigator))return null;var e=globalThis.navigator.userAgent,t=globalThis.navigator.brave;if(t&&Object.getPrototypeOf(t).isBrave){var n=e.match(/(chrome)\/([\w.]+)/i);n&&(e="".concat(e," Brave/").concat(n[2]))}return e}(),kn.context.locale.value=Q(globalThis.navigator)?null:null!==(t=globalThis.navigator.language)&&void 0!==t?t:globalThis.navigator.browserLanguage,kn.context.screen.value=Jc(),kn.context.timezone.value=null!=(n=/([A-Z]+[+-]\d+)/.exec((new Date).toString()))&&n[1]?n[1]:"NA",Xc()&&function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";"none"===n&&e(void 0),"default"===n&&e(navigator.userAgentData),"full"===n&&(null===(t=navigator.userAgentData)||void 0===t||t.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then((function(t){e(t)})).catch((function(){e()})))}((function(e){kn.context["ua-ch"].value=e}),kn.loadOptions.value.uaChTrackLevel)})),Ct((function(){var t,n,i;!0===kn.loadOptions.value.sendAdblockPage&&void 0!==kn.lifecycle.sourceConfigUrl.value&&(t=e.httpClient,n=new URL(kn.lifecycle.sourceConfigUrl.value),i="".concat(n.origin).concat(n.pathname,"?view=ad"),t.getAsyncData({url:i,options:{method:"HEAD",headers:{"Content-Type":void 0}},isRawResponse:!0,callback:function(e,t){var n;kn.capabilities.isAdBlocked.value=void 0!==(null==t?void 0:t.error)||(null==t||null===(n=t.xhr)||void 0===n?void 0:n.responseURL)!==i}}))}))}},{key:"prepareBrowserCapabilities",value:function(){var e=this;kn.capabilities.isLegacyDOM.value=function(){for(var e=Object.keys(Wc),t=!1,n=0;n<e.length;n++){var i=Wc[e[n]];if(F(i)&&i()){t=!0;break}}return t}();var t=kn.loadOptions.value.polyfillURL,n=Cd;if(q(t)&&(hi(t)?n=t:this.logger.warn(function(e,t){return"".concat(e).concat(Be,'The provided polyfill URL "').concat(t,'" is invalid. The default polyfill URL will be used instead.')}(pe,t))),kn.loadOptions.value.polyfillIfRequired&&kn.capabilities.isLegacyDOM.value&&hi(n)){var i=n!==kn.loadOptions.value.polyfillURL;if(i){var r="RS_polyfillCallback_".concat(kn.lifecycle.writeKey.value);globalThis[r]=function(){e.onReady(),delete globalThis[r]},n="".concat(n,"&callback=").concat(r)}this.externalSrcLoader.loadJSFile({url:n,id:Dd,async:!0,timeout:1e4,callback:function(t){t?i||e.onReady():e.onError(new Error(function(e,t){return'Failed to load the polyfill script with ID "'.concat(e,'" from URL ').concat(t,".")}(Dd,n)))}})}else this.onReady()}},{key:"attachWindowListeners",value:function(){globalThis.addEventListener("offline",(function(){kn.capabilities.isOnline.value=!1})),globalThis.addEventListener("online",(function(){kn.capabilities.isOnline.value=!0})),globalThis.addEventListener("resize",function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];globalThis.clearTimeout(n),n=globalThis.setTimeout((function(){e.apply(t,o)}),i)}}((function(){kn.context.screen.value=Jc()}),this))}},{key:"onReady",value:function(){this.detectBrowserCapabilities(),kn.lifecycle.status.value="browserCapabilitiesReady"}},{key:"onError",value:function(e){this.errorHandler.onError(e,pe)}}])}(),Md=["integrations","anonymousId","originalTimestamp"],Ld=["library","consentManagement","userAgent","ua-ch","screen"],_d=["id","anonymous_id","user_id","sent_at","t
1imestamp","received_at","original_timestamp","event","event_text","channel","context_ip","context_request_ip","context_passed_ip","group_id","previous_id"],Nd=function(e){return"number"==typeof e&&!Number.isNaN(e)},xd=function(e){return Nd(e)&&e>=0&&Number.isInteger(e)},Bd=function(e){var t=Date.now();return Boolean(!e||t>e)},Ud=function(e,t){return!!(e&&xd(e)&&(n=10,i=e,i.toString().length>=n))||(t.warn(function(e,t,n){return"".concat(e).concat(Be,"The provided session ID (").concat(t,') is either invalid, not a positive integer, or not at least "').concat(n,'" digits long. A new session ID will be auto-generated instead.')}(ke,e,10)),!1);var n,i},jd=function(e,t){return{id:Ud(e,t)?e:Date.now(),sessionStart:void 0,manualTrack:!0}},Gd=function(e){return Boolean(e===ui||e===li||e===ci||e===di)},Fd=function(){return Le()},Hd=function(e){var t=Od(),n={};return Object.keys(t).forEach((function(i){n[i]=(null==e?void 0:e[i])||t[i]})),n.initial_referrer=(null==e?void 0:e.initial_referrer)||kn.session.initialReferrer.value,n.initial_referring_domain=(null==e?void 0:e.initial_referring_domain)||kn.session.initialReferringDomain.value,n},zd=function(e,t,n){Y(e)&&Object.keys(e).forEach((function(e){(_d.includes(e)||_d.includes(e.toLowerCase()))&&n.warn(function(e,t,n,i){return"".concat(e).concat(Be,'The "').concat(t,'" property defined under "').concat(n,'" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (').concat(i,").")}(me,e,t,_d))}))},Qd=function(e,t,n){var i=e;return Object.keys(t).forEach((function(e){if(!Md.includes(e)&&!Ld.includes(e))if("context"!==e)i=Z(i,u({},e,t[e]));else if(!Q(t[e])&&Y(t[e])){var r={};Object.keys(t[e]).forEach((function(n){Ld.includes(n)||(r[n]=t[e][n])})),i=Z(i,h({},r))}else n.warn("".concat(me).concat(Be,'Please make sure that the "context" property in the event API\'s "options" argument is a valid object literal with key-value pairs.'))})),i},Kd=function(e,t,n){Y(t)&&(!function(e,t){t.anonymousId&&H(t.anonymousId)&&(e.anonymousId=t.anonymousId),ee(t.integrations)&&(e.integrations=t.integrations),t.originalTimestamp&&H(t.originalTimestamp)&&(e.originalTimestamp=t.originalTimestamp)}(e,t),e.context=Qd(e.context,t,n))},Vd=function(e,t,n,i){var r,o,a,s={channel:"web",context:h(h({traits:_(kn.session.userTraits.value),sessionId:kn.session.sessionInfo.value.id||void 0,sessionStart:kn.session.sessionInfo.value.sessionStart||void 0},kn.consents.enabled.value&&{consentManagement:{deniedConsentIds:_(kn.consents.data.value.deniedConsentIds),allowedConsentIds:_(kn.consents.data.value.allowedConsentIds),provider:kn.consents.provider.value,resolutionStrategy:kn.consents.resolutionStrategy.value}}),{},{"ua-ch":kn.context["ua-ch"].value,app:kn.context.app.value,library:kn.context.library.value,userAgent:kn.context.userAgent.value,os:kn.context.os.value,locale:kn.context.locale.value,screen:kn.context.screen.value,campaign:vd(globalThis.location.href),page:Hd(n),timezone:kn.context.timezone.value},kn.autoTrack.enabled.value&&{autoTrack:h({},kn.autoTrack.pageLifecycle.enabled.value&&{page:{visitId:kn.autoTrack.pageLifecycle.visitId.value}})}),originalTimestamp:xe(),messageId:Le(),userId:e.userId||kn.session.userId.value};(Gd(null===(r=kn.storage.entries.value.anonymousId)||void 0===r?void 0:r.type)?s.anonymousId=kn.session.anonymousId.value:s.anonymousId=Fd(),kn.storage.trulyAnonymousTracking.value&&(s.context.trulyAnonymousTracking=!0),"identify"===e.type)&&(s.context.traits=(null===(o=kn.storage.entries.value.userTraits)||void 0===o?void 0:o.type)!==vi?_(kn.session.userTraits.value):e.context.traits);"group"===e.type&&((e.groupId||kn.session.groupId.value)&&(s.groupId=e.groupId||kn.session.groupId.value),(e.traits||kn.session.groupTraits.value)&&(s.traits=(null===(a=kn.storage.entries.value.groupTraits)||void 0===a?void 0:a.type)!==vi?_(kn.session.groupTraits.value):e.traits));var u,l,c,d=Z(e,s);return void 0===d.event&&(d.event=null),void 0===d.properties&&(d.properties=null),Kd(d,t,i),function(e,t){var n=e.properties,i=e.traits,r=e.context.traits;zd(n,"properties",t),zd(i,"traits",t),zd(r,"context.traits",t)}(d,i),d.integrations=(u=d.integrations,l=kn.loadOptions.value.useGlobalIntegrationsConfigInEvents?null!==(c=kn.consents.postConsent.value.integrations)&&void 0!==c?c:kn.nativeDestinations.loadOnlyIntegrations.value:u||Ht,_(l)),d},qd=function(){return s((function e(t){o(this,e),this.logger=t}),[{key:"generatePageEvent",value:function(e,t,n,i){var r=null!=n?n:{};return r=function(e,t){var n=(null==t?void 0:t.page)||{},i=e,r=Od();return Object.keys(r).forEach((function(e){Q(i[e])&&(i[e]=n[e]||r[e])})),Q(i.initial_referrer)&&(i.initial_referrer=n.initial_referrer||kn.session.initialReferrer.value),Q(i.initial_referring_domain)&&(i.initial_referring_domain=n.initial_referring_domain||kn.session.initialReferringDomain.value),i}(r,i),Vd({properties:r,name:t,category:e,type:"page"},i,r,this.logger)}},{key:"generateTrackEvent",value:function(e,t,n){return Vd({properties:t,event:e,type:"track"},n,void 0,this.logger)}},{key:"generateIdentifyEvent",value:function(e,t,n){return Vd({userId:e,type:"identify",context:{traits:t}},n,void 0,this.logger)}},{key:"generateAliasEvent",value:function(e,t,n){var i=Vd({previousId:t,type:"alias"},n,void 0,this.logger);return i.userId=null!=e?e:i.userId,i}},{key:"generateGroupEvent",value:function(e,t,n){var i={type:"group"};return e&&(i.groupId=e),t&&(i.traits=t),Vd(i,n,void 0,this.logger)}},{key:"create",value:function(e){var t;switch(e.type){case"page":t=this.generatePageEvent(e.category,e.name,e.properties,e.options);break;case"track":t=this.generateTrackEvent(e.name,e.properties,e.options);break;case"identify":t=this.generateIdentifyEvent(e.userId,e.traits,e.options);break;case"alias":t=this.generateAliasEvent(e.to,e.from,e.options);break;default:t=this.generateGroupEvent(e.groupId,e.traits,e.options)}return t}}])}(),Xd=function(){return s((function e(t,n,i,r){o(this,e),this.eventRepository=t,this.userSessionManager=n,this.errorHandler=i,this.logger=r,this.eventFactory=new qd(this.logger)}),[{key:"init",value:function(){this.eventRepository.init()}},{key:"resume",value:function(){this.eventRepository.resume()}},{key:"addEvent",value:function(e){this.userSessionManager.refreshSession();var t=this.eventFactory.create(e);this.eventRepository.enqueue(t,e.callback)}}])}(),Wd=function(){return s((function e(t,n,i,r,a){o(this,e),this.storeManager=n,this.pluginsManager=t,this.logger=a,this.errorHandler=r,this.httpClient=i,this.onError=this.onError.bind(this),this.serverSideCookieDebounceFuncs={}}),[{key:"init",value:function(){this.syncStorageDataToState(),this.registerEffects()}},{key:"syncStorageDataToState",value:function(){this.migrateStorageIfNeeded(),this.migrateDataFromPreviousStorage(),this.setUserId(this.getUserId()),this.setUserTraits(this.getUserTraits()),this.setGroupId(this.getGroupId()),this.setGroupTraits(this.getGroupTraits());
1var e,t=kn.loadOptions.value,n=t.externalAnonymousIdCookieName,i=t.anonymousIdOptions;q(n)&&"string"==typeof n&&(e=this.getExternalAnonymousIdByCookieName(n)),this.setAnonymousId(null!=e?e:this.getAnonymousId(i)),this.setAuthToken(this.getAuthToken()),this.setInitialReferrerInfo(),this.configureSessionTracking()}},{key:"configureSessionTracking",value:function(){var e=this.getSessionInfo();if(this.isPersistenceEnabledForStorageEntry("sessionInfo")){var t=this.getConfiguredSessionTrackingInfo(),n=null!=e?e:rn;(e=h(h(h({},n),t),{},{autoTrack:t.autoTrack&&!0!==n.manualTrack})).autoTrack||!0===e.manualTrack||(e=nn.sessionInfo)}else e=nn.sessionInfo;kn.session.sessionInfo.value=e,kn.session.sessionInfo.value.autoTrack&&this.startOrRenewAutoTracking(kn.session.sessionInfo.value)}},{key:"setInitialReferrerInfo",value:function(){var e=this.getInitialReferrer(),t=this.getInitialReferringDomain();if(e&&t)this.setInitialReferrer(e),this.setInitialReferringDomain(t);else{var n=e||Pd();this.setInitialReferrer(n),this.setInitialReferringDomain(dd(n))}}},{key:"isPersistenceEnabledForStorageEntry",value:function(e){var t;return Gd(null===(t=kn.storage.entries.value[e])||void 0===t?void 0:t.type)}},{key:"migrateDataFromPreviousStorage",value:function(){var e=this,t=kn.storage.entries.value,n=[ui,li,ci];Object.keys(t).forEach((function(i){var r,o,a=i,s=null===(r=t[a])||void 0===r?void 0:r.type,u=null===(o=e.storeManager)||void 0===o?void 0:o.getStore(Fc[s]);u&&n.forEach((function(t){var n,i=null===(n=e.storeManager)||void 0===n?void 0:n.getStore(Fc[t]);if(i&&t!==s){var r=i.get(ki[a]);(function(e){return q(e)&&""!==e})(r)&&u.set(ki[a],r),i.remove(ki[a])}}))}))}},{key:"migrateStorageIfNeeded",value:function(){var e=this;if(kn.storage.migrate.value){var t=[];[Bc,Uc,jc].forEach((function(n){var i,r=null===(i=e.storeManager)||void 0===i?void 0:i.getStore(n);r&&t.push(r)})),Object.keys(ki).forEach((function(n){var i=ki[n];t.forEach((function(t){var n,r=null===(n=e.pluginsManager)||void 0===n?void 0:n.invokeSingle("storage.migrate",i,t.engine,e.errorHandler,e.logger);K(r)||t.set(i,r)}))}))}}},{key:"getConfiguredSessionTrackingInfo",value:function(){var e,t,n,i=!1!==(null===(e=kn.loadOptions.value.sessions)||void 0===e?void 0:e.autoTrack);if(!i)return{autoTrack:i};var r=null===(t=kn.loadOptions.value.sessions)||void 0===t?void 0:t.timeout;return xd(r)?n=r:(this.logger.warn(function(e,t,n){return"".concat(e).concat(Be,'The session timeout value "').concat(t,'" is not a number. The default timeout of ').concat(n," ms will be used instead.")}(ke,r,tt)),n=tt),0===n&&(this.logger.warn("".concat(ke).concat(Be,"The session timeout value is 0, which disables the automatic session tracking feature. If you want to enable session tracking, please provide a positive integer value for the timeout.")),i=!1),n>0&&n<1e4&&this.logger.warn(function(e,t,n){return"".concat(e).concat(Be,"The session timeout value ").concat(t," ms is less than the recommended minimum of ").concat(n," ms. Please consider increasing the timeout value to ensure optimal performance and reliability.")}(ke,n,1e4)),{timeout:n,autoTrack:i}}},{key:"onError",value:function(e,t){this.errorHandler.onError(e,ke,t)}},{key:"getEncryptedCookieData",value:function(e,t){var n=this,i=[];return e.forEach((function(e){var r=null==t?void 0:t.encrypt(Fe(e.value,!1,[],n.logger));q(r)&&i.push({name:e.name,value:r})})),i}},{key:"makeRequestToSetCookie",value:function(e,t){var n,i,r,o,a,s,u,l;null===(n=this.httpClient)||void 0===n||n.getAsyncData({url:kn.serverCookies.dataServiceUrl.value,options:{method:"POST",data:Fe({reqType:"setCookies",workspaceId:null===(i=kn.source.value)||void 0===i?void 0:i.workspaceId,data:{options:{maxAge:null===(r=kn.storage.cookie.value)||void 0===r?void 0:r.maxage,path:null===(o=kn.storage.cookie.value)||void 0===o?void 0:o.path,domain:null===(a=kn.storage.cookie.value)||void 0===a?void 0:a.domain,sameSite:null===(s=kn.storage.cookie.value)||void 0===s?void 0:s.samesite,secure:null===(u=kn.storage.cookie.value)||void 0===u?void 0:u.secure,expires:null===(l=kn.storage.cookie.value)||void 0===l?void 0:l.expires},cookies:e}}),sendRawData:!0,withCredentials:!0},isRawResponse:!0,callback:t})}},{key:"setServerSideCookies",value:function(e,t,n){var i=this;try{var r=this.getEncryptedCookieData(e,n);r.length>0&&this.makeRequestToSetCookie(r,(function(r,o){var a,s,u;200===(null==o||null===(a=o.xhr)||void 0===a?void 0:a.status)?e.forEach((function(e){var r,o=null==n?void 0:n.get(e.name),a=Fe(e.value,!1,[]);Fe(o,!1,[])!==a&&(i.logger.error((r=e.name,"The server failed to set the ".concat(r," cookie. As a fallback, the cookies will be set client side."))),t&&t(e.name,e.value))})):(i.logger.error((u=null==o||null===(s=o.xhr)||void 0===s?void 0:s.status,"The server responded with status ".concat(u," while setting the cookies. As a fallback, the cookies will be set client side."))),e.forEach((function(e){t&&t(e.name,e.value)})))}))}catch(mt){this.onError(mt,"Failed to set/remove cookies via server. As a fallback, the cookies will be managed client side."),e.forEach((function(e){t&&t(e.name,e.value)}))}}},{key:"syncValueToStorage",value:function(e,t){var n,i=this,r=kn.storage.entries.value,o=null===(n=r[e])||void 0===n?void 0:n.type;if(Gd(o)){var a,s,u=null===(a=this.storeManager)||void 0===a?void 0:a.getStore(Fc[o]),l=null===(s=r[e])||void 0===s?void 0:s.key;t&&(H(t)||ee(t))?kn.serverCookies.isEnabledServerSideCookies.value&&o===ui?(this.serverSideCookieDebounceFuncs[e]&&globalThis.clearTimeout(this.serverSideCookieDebounceFuncs[e]),this.serverSideCookieDebounceFuncs[e]=globalThis.setTimeout((function(){i.setServerSideCookies([{name:l,value:t}],(function(e,t){null==u||u.set(e,t)}),u)}),10)):null==u||u.set(l,t):null==u||u.remove(l)}}},{key:"registerEffects",value:function(){var e=this;
1Gc.forEach((function(t){Ct((function(){e.syncValueToStorage(t,kn.session[t].value)}))}))}},{key:"setAnonymousId",value:function(e,t){var n=e;if(H(e)&&n||(n=void 0),this.isPersistenceEnabledForStorageEntry("anonymousId")){var i;if(!n&&t)n=null===(i=this.pluginsManager)||void 0===i?void 0:i.invokeSingle("userSession.anonymousIdGoogleLinker",t);n=n||Fd()}else n=nn.anonymousId;kn.session.anonymousId.value=n}},{key:"getAnonymousId",value:function(e){var t,n=null===(t=kn.storage.entries.value.anonymousId)||void 0===t?void 0:t.type;if(Gd(n)){var i,r=this.getEntryValue("anonymousId");if(!r&&e)r=null===(i=this.pluginsManager)||void 0===i?void 0:i.invokeSingle("storage.getAnonymousId",id,e);kn.session.anonymousId.value=r||Fd()}return kn.session.anonymousId.value}},{key:"getEntryValue",value:function(e){var t,n=kn.storage.entries.value,i=null===(t=n[e])||void 0===t?void 0:t.type;if(Gd(i)){var r,o,a,s=null===(r=this.storeManager)||void 0===r?void 0:r.getStore(Fc[i]),u=null===(o=n[e])||void 0===o?void 0:o.key;return null!==(a=null==s?void 0:s.get(u))&&void 0!==a?a:null}return null}},{key:"getExternalAnonymousIdByCookieName",value:function(e){var t,n=id(ui);return null!=n&&n.isEnabled&&null!==(t=n.getItem(e))&&void 0!==t?t:null}},{key:"getUserId",value:function(){return this.getEntryValue("userId")}},{key:"getUserTraits",value:function(){return this.getEntryValue("userTraits")}},{key:"getGroupId",value:function(){return this.getEntryValue("groupId")}},{key:"getGroupTraits",value:function(){return this.getEntryValue("groupTraits")}},{key:"getInitialReferrer",value:function(){return this.getEntryValue("initialReferrer")}},{key:"getInitialReferringDomain",value:function(){return this.getEntryValue("initialReferringDomain")}},{key:"getSessionInfo",value:function(){return this.getEntryValue("sessionInfo")}},{key:"getAuthToken",value:function(){return this.getEntryValue("authToken")}},{key:"getSessionId",value:function(){var e,t,n=null!==(e=this.getSessionInfo())&&void 0!==e?e:nn.sessionInfo;return(n.autoTrack&&!Bd(n.expiresAt)||n.manualTrack)&&null!==(t=n.id)&&void 0!==t?t:null}},{key:"refreshSession",value:function(){var e,t=null!==(e=this.getSessionInfo())&&void 0!==e?e:nn.sessionInfo;(t.autoTrack||t.manualTrack)&&(t.autoTrack&&(this.startOrRenewAutoTracking(t),t=kn.session.sessionInfo.value),void 0===t.sessionStart?t=h(h({},t),{},{sessionStart:!0}):t.sessionStart&&(t=h(h({},t),{},{sessionStart:!1}))),kn.session.sessionInfo.value=t,"readyExecuted"!==kn.lifecycle.status.value&&this.syncValueToStorage("sessionInfo",t)}},{key:"reset",value:function(e,t){var n=this,i=kn.session,r=i.sessionInfo.value,o=r.manualTrack,a=r.autoTrack;vt((function(){i.userId.value=nn.userId,i.userTraits.value=nn.userTraits,i.groupId.value=nn.groupId,i.groupTraits.value=nn.groupTraits,i.authToken.value=nn.authToken,!0===e&&n.setAnonymousId(),t||(a?(i.sessionInfo.value=nn.sessionInfo,n.startOrRenewAutoTracking(i.sessionInfo.value)):o&&n.startManualTrackingInternal())}))}},{key:"setUserId",value:function(e){kn.session.userId.value=this.isPersistenceEnabledForStorageEntry("userId")&&e?e:nn.userId}},{key:"setUserTraits",value:function(e){var t;kn.session.userTraits.value=this.isPersistenceEnabledForStorageEntry("userTraits")&&Y(e)?Z(null!==(t=kn.session.userTraits.value)&&void 0!==t?t:nn.userTraits,e):nn.userTraits}},{key:"setGroupId",value:function(e){kn.session.groupId.value=this.isPersistenceEnabledForStorageEntry("groupId")&&e?e:nn.groupId}},{key:"setGroupTraits",value:function(e){var t;kn.session.groupTraits.value=this.isPersistenceEnabledForStorageEntry("groupTraits")&&Y(e)?Z(null!==(t=kn.session.groupTraits.value)&&void 0!==t?t:nn.groupTraits,e):nn.groupTraits}},{key:"setInitialReferrer",value:function(e){kn.session.initialReferrer.value=this.isPersistenceEnabledForStorageEntry("initialReferrer")&&e?e:nn.initialReferrer}},{key:"setInitialReferringDomain",value:function(e){kn.session.initialReferringDomain.value=this.isPersistenceEnabledForStorageEntry("initialReferringDomain")&&e?e:nn.initialReferringDomain}},{key:"startOrRenewAutoTracking",value:function(e){if(Bd(e.expiresAt))kn.session.sessionInfo.value=function(e){var t=Date.now(),n=e||tt;return{id:t,expiresAt:t+n,timeout:n,sessionStart:void 0,autoTrack:!0}}(e.timeout);
1else{var t=Date.now(),n=e.timeout;kn.session.sessionInfo.value=Z(e,{expiresAt:t+n})}}},{key:"start",value:function(e){kn.session.sessionInfo.value=jd(e,this.logger)}},{key:"startManualTrackingInternal",value:function(){this.start(Date.now())}},{key:"end",value:function(){kn.session.sessionInfo.value=nn.sessionInfo}},{key:"setAuthToken",value:function(e){kn.session.authToken.value=this.isPersistenceEnabledForStorageEntry("authToken")&&e?e:nn.authToken}}])}(),Jd=["BeaconQueue","CustomConsentManager","DeviceModeDestinations","DeviceModeTransformation","ExternalAnonymousId","GoogleLinker","IubendaConsentManager","KetchConsentManager","NativeDestinationQueue","OneTrustConsentManager","StorageEncryption","StorageEncryptionLegacy","StorageMigrator","XhrQueue"],Yd="dataplaneEventsQueue",$d="destinationsEventsQueue",Zd=function(e,t){var n=_(e),i=t.nativeDestinations.integrationsConfig.value,r=function(e,t){return Object.keys(e).filter((function(n){return!0!==e[n]||!t[n]})).reduce((function(t,n){var i=_(t);return i[n]=e[n],i}),{})}(e.integrations,i);return n.integrations=Z(i,r),n},ev=function(e,t,n,i){if(V(e))if(F(e))try{e.apply(void 0,b(t))}catch(r){i.error("".concat(n).concat(Be,"The callback threw an exception"),r)}else i.error(Gt(n))},tv=function(){return s((function e(t,n,i,r,a){o(this,e),this.pluginsManager=t,this.errorHandler=r,this.httpClient=i,this.logger=a,this.storeManager=n}),[{key:"init",value:function(){var e=this;this.dataplaneEventsQueue=this.pluginsManager.invokeSingle("".concat(Yd,".init"),kn,this.httpClient,this.storeManager,this.errorHandler,this.logger),this.dmtEventsQueue=this.pluginsManager.invokeSingle("".concat("transformEvent",".init"),kn,this.pluginsManager,this.httpClient,this.storeManager,this.errorHandler,this.logger),this.destinationsEventsQueue=this.pluginsManager.invokeSingle("".concat($d,".init"),kn,this.pluginsManager,this.storeManager,this.dmtEventsQueue,this.errorHandler,this.logger),Ct((function(){var t,n;!0===kn.nativeDestinations.clientDestinationsReady.value&&(null===(t=e.destinationsEventsQueue)||void 0===t||t.start(),null===(n=e.dmtEventsQueue)||void 0===n||n.start())}));var t,n=function(e){var t,n,i;return e.consents.preConsent.value.enabled&&"buffer"===(null===(t=e.consents.preConsent.value.events)||void 0===t?void 0:t.delivery)&&("session"===(null===(n=e.consents.preConsent.value.storage)||void 0===n?void 0:n.strategy)||"none"===(null===(i=e.consents.preConsent.value.storage)||void 0===i?void 0:i.strategy))}(kn);Ct((function(){var i,r,o=!0===kn.loadOptions.value.bufferDataPlaneEventsUntilReady&&!1===kn.nativeDestinations.clientDestinationsReady.value;!1!==kn.nativeDestinations.activeDestinations.value.some((function(e){return ri(e)}))&&!1!==o||n||!0===(null===(i=e.dataplaneEventsQueue)||void 0===i?void 0:i.scheduleTimeoutActive)||(globalThis.clearTimeout(t),null===(r=e.dataplaneEventsQueue)||void 0===r||r.start())})),!0===kn.loadOptions.value.bufferDataPlaneEventsUntilReady&&(t=globalThis.setTimeout((function(){var t,n;!0!==(null===(t=e.dataplaneEventsQueue)||void 0===t?void 0:t.scheduleTimeoutActive)&&(null===(n=e.dataplaneEventsQueue)||void 0===n||n.start())}),kn.loadOptions.value.dataPlaneEventsBufferTimeout))}},{key:"resume",value:function(){var e;if(!0!==(null===(e=this.dataplaneEventsQueue)||void 0===e?void 0:e.scheduleTimeoutActive)){var t,n,i;if(kn.consents.postConsent.value.discardPreConsentEvents)null===(n=this.dataplaneEventsQueue)||void 0===n||n.clear(),null===(i=this.destinationsEventsQueue)||void 0===i||i.clear();null===(t=this.dataplaneEventsQueue)||void 0===t||t.start()}}},{key:"enqueue",value:function(e,t){var n=Zd(e,kn);this.pluginsManager.invokeSingle("".concat(Yd,".enqueue"),kn,this.dataplaneEventsQueue,n,this.errorHandler,this.logger);var i=_(e);this.pluginsManager.invokeSingle("".concat($d,".enqueue"),kn,this.destinationsEventsQueue,i,this.errorHandler,this.logger);var r="".concat(e.type.charAt(0).toUpperCase()).concat(e.type.slice(1)).concat(ge);ev(t,[n],r,this.logger)}}])}(),nv=function(e){var t=new CustomEvent(e,{detail:{analyticsInstance:globalThis.rudderanalytics},bubbles:!0,cancelable:!0,composed:!0});globalThis.document.dispatchEvent(t)},iv=function(){return s((function e(){o(this,e),this.preloadBuffer=new Dt,this.initialized=!1,this.errorHandler=ei,this.logger=_t,this.externalSrcLoader=new lt(this.errorHandler,this.logger),this.httpClient=Vn,this.httpClient.init(this.errorHandler),this.capabilitiesManager=new Rd(this.httpClient,this.errorHandler,this.logger)}),[{key:"load",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};kn.lifecycle.status.value||(!function(e){return H(e)&&e.trim().length>0}(e)?this.logger.error(function(e,t){return"".concat(e).concat(Be,'The write key "').concat(t,'" is invali
1d. It must be a non-empty string. Please check that the write key is correct and try again.')}(Te,e)):!function(e){return hi(e)}(t)?this.logger.error(function(e,t){return"".concat(e).concat(Be,'The data plane URL "').concat(t,'" is invalid. It must be a valid URL string. Please check that the data plane URL is correct and try again.')}(Te,t)):(vt((function(){kn.lifecycle.writeKey.value=_(e),kn.lifecycle.dataPlaneUrl.value=_(t),kn.loadOptions.value=function(e,t){var n,i=_(t);return H(i.setCookieDomain)||(i.setCookieDomain=void 0),["Strict","Lax","None"].includes(i.sameSiteCookie)||(i.sameSiteCookie=void 0),i.secureCookie=re(i.secureCookie,e.secureCookie),i.sameDomainCookiesOnly=re(i.sameDomainCookiesOnly,e.sameDomainCookiesOnly),["none","default","full"].includes(i.uaChTrackLevel)||(i.uaChTrackLevel=void 0),i.integrations=ie(i.integrations),Array.isArray(i.plugins)||(i.plugins=Jd),i.useGlobalIntegrationsConfigInEvents=re(i.useGlobalIntegrationsConfigInEvents,e.useGlobalIntegrationsConfigInEvents),i.bufferDataPlaneEventsUntilReady=re(i.bufferDataPlaneEventsUntilReady,e.bufferDataPlaneEventsUntilReady),i.sendAdblockPage=re(i.sendAdblockPage,e.sendAdblockPage),i.useServerSideCookies=re(i.useServerSideCookies,e.useServerSideCookies),H(i.dataServiceEndpoint)||(i.dataServiceEndpoint=void 0),i.sendAdblockPageOptions=ie(i.sendAdblockPageOptions),i.loadIntegration=re(i.loadIntegration,e.loadIntegration),ee(i.storage)?(i.storage.migrate=re(i.storage.migrate,null===(n=e.storage)||void 0===n?void 0:n.migrate),i.storage.cookie=ie(i.storage.cookie),i.storage.encryption=ie(i.storage.encryption),i.storage=ne(i.storage)):i.storage=void 0,i.destinationsQueueOptions=ie(i.destinationsQueueOptions),i.queueOptions=ie(i.queueOptions),i.lockIntegrationsVersion=re(i.lockIntegrationsVersion,e.lockIntegrationsVersion),i.lockPluginsVersion=re(i.lockPluginsVersion,e.lockPluginsVersion),Nd(i.dataPlaneEventsBufferTimeout)||(i.dataPlaneEventsBufferTimeout=void 0),i.beaconQueueOptions=ie(i.beaconQueueOptions),i.preConsent=ie(i.preConsent),Z(e,ne(i))}(kn.loadOptions.value,i),kn.lifecycle.status.value="mounted"})),this.logger.setMinLogLevel(null!==(n=kn.loadOptions.value.logLevel)&&void 0!==n?n:Mt),it("state",kn,e),this.startLifecycle()))}},{key:"startLifecycle",value:function(){var e=this;Ct((function(){try{switch(kn.lifecycle.status.value){case"mounted":e.onMounted();break;case"browserCapabilitiesReady":e.onBrowserCapabilitiesReady();break;case"configured":e.onConfigured();break;case"pluginsLoading":case"destinationsLoading":case"readyExecuted":default:break;case"pluginsReady":e.onPluginsReady();break;case"initialized":e.onInitialized();break;case"loaded":e.onLoaded();break;case"destinationsReady":e.onDestinationsReady();break;case"ready":e.onReady()}}catch(t){e.errorHandler.onError(Ve(t,"Failed to load the SDK"),Te)}}))}},{key:"onBrowserCapabilitiesReady",value:function(){at(this),this.prepareInternalServices(),this.loadConfig()}},{key:"onLoaded",value:function(){this.processBufferedEvents(),!0===kn.consents.preConsent.value.enabled?kn.lifecycle.status.value="ready":this.loadDestinations()}},{key:"onMounted",value:function(){this.capabilitiesManager.init()}},{key:"enqueuePreloadBufferEvents",value:function(e){var t=this;Array.isArray(e)&&e.forEach((function(e){return t.preloadBuffer.enqueue(_(e))}))}},{key:"processDataInPreloadBuffer",value:function(){for(;this.preloadBuffer.size()>0;){var e=this.preloadBuffer.dequeue();e&&st(b(e),this)}}},{key:"prepareInternalServices",value:function(){this.pluginsManager=new xc(ni,this.errorHandler,this.logger),this.storeManager=new ad(this.pluginsManager,this.errorHandler,this.logger),this.configManager=new wd(this.httpClient,this.errorHandler,this.logger),this.userSessionManager=new Wd(this.pluginsManager,this.storeManager,this.httpClient,this.errorHandler,this.logger),this.eventRepository=new tv(this.pluginsManager,this.storeManager,this.httpClient,this.errorHandler,this.logger),this.eventManager=new Xd(this.eventRepository,this.userSessionManager,this.errorHandler,this.logger)}},{key:"loadConfig",value:function(){var e;kn.lifecycle.writeKey.value&&this.httpClient.setAuthHeader(kn.lifecycle.writeKey.value),null===(e=this.configManager)||void 0===e||e.init(
1)}},{key:"onPluginsReady",value:function(){var e,t,n,i,r;(null===(e=this.storeManager)||void 0===e||e.init(),null===(t=this.userSessionManager)||void 0===t||t.init(),kn.consents.enabled.value&&!kn.consents.initialized.value)&&(null===(i=this.pluginsManager)||void 0===i||i.invokeSingle("consentManager.init",kn,this.logger),!1===kn.consents.preConsent.value.enabled&&(null===(r=this.pluginsManager)||void 0===r||r.invokeSingle("consentManager.updateConsentsInfo",kn,this.storeManager,this.logger)));null===(n=this.eventManager)||void 0===n||n.init(),kn.lifecycle.status.value="initialized"}},{key:"onConfigured",value:function(){var e;null===(e=this.pluginsManager)||void 0===e||e.init()}},{key:"onInitialized",value:function(){this.processDataInPreloadBuffer();var e=kn.loadOptions.value.onLoaded;ev(e,[globalThis.rudderanalytics],Ie,this.logger),vt((function(){kn.lifecycle.loaded.value=!0,kn.lifecycle.status.value="loaded"})),this.initialized=!0,nv("RSA_Initialised")}},{key:"onReady",value:function(){var e=this;kn.lifecycle.status.value="readyExecuted",kn.eventBuffer.readyCallbacksArray.value.forEach((function(t){ev(t,[],Se,e.logger)})),nv("RSA_Ready")}},{key:"processBufferedEvents",value:function(){for(var e=kn.eventBuffer.toBeProcessedArray.value;e.length>0;){var t=e.shift();if(kn.eventBuffer.toBeProcessedArray.value=e,t){var n,i=t[0];if(F(this[i]))(n=this)[i].apply(n,b(t.slice(1)).concat([!0]))}e=kn.eventBuffer.toBeProcessedArray.value}}},{key:"loadDestinations",value:function(){var e,t;if(!kn.nativeDestinations.clientDestinationsReady.value){null===(e=this.pluginsManager)||void 0===e||e.invokeSingle("nativeDestinations.setActiveDestinations",kn,this.pluginsManager,this.errorHandler,this.logger);var n=kn.nativeDestinations.activeDestinations.value.length;0!==n?(kn.lifecycle.status.value="destinationsLoading",null===(t=this.pluginsManager)||void 0===t||t.invokeSingle("nativeDestinations.load",kn,this.externalSrcLoader,this.errorHandler,this.logger),Ct((function(){(0===n||kn.nativeDestinations.initializedDestinations.value.length+kn.nativeDestinations.failedDestinations.value.length===n)&&vt((function(){kn.lifecycle.status.value="destinationsReady",kn.nativeDestinations.clientDestinationsReady.value=!0}))}))):kn.lifecycle.status.value="destinationsReady"}}},{key:"onDestinationsReady",value:function(){"ready"!==kn.lifecycle.status.value&&(kn.lifecycle.status.value="ready")}},{key:"ready",value:function(e){var t="ready";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(t," invocation")),F(e)?"readyExecuted"===kn.lifecycle.status.value?ev(e,[],Se,this.logger):kn.eventBuffer.readyCallbacksArray.value=[].concat(b(kn.eventBuffer.readyCallbacksArray.value),[e]):this.logger.error(Gt(Se))):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[t,e]])}},{key:"page",value:function(e){var t,n="page";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(n," event")),kn.metrics.triggered.value+=1,null===(t=this.eventManager)||void 0===t||t.addEvent({type:"page",category:e.category,name:e.name,properties:e.properties,options:e.options,callback:e.callback}),!0===kn.capabilities.isAdBlocked.value&&e.category!==Je&&this.page(le(Je,"ad-block page request",{path:"/ad-blocked"},kn.loadOptions.value.sendAdblockPageOptions))):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[n,e]])}},{key:"track",value:function(e){var t,n="track";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(n," event - ").concat(e.name)),kn.metrics.triggered.value+=1,null===(t=this.eventManager)||void 0===t||t.addEvent({type:n,name:e.name||void 0,properties:e.properties,options:e.options,callback:e.callback})):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[n,e]])}},{key:"identify",value:function(e){var t,n,i="identify";if(kn.lifecycle.loaded.value){var r;if(this.errorHandler.leaveBreadcrumb("New ".concat(i," event")),kn.metrics.triggered.value+=1,Boolean(e.userId&&kn.session.userId.value&&e.userId!==kn.session.userId.value)&&this.reset(),!z(e.userId)
1)null===(r=this.userSessionManager)||void 0===r||r.setUserId(e.userId);null===(t=this.userSessionManager)||void 0===t||t.setUserTraits(e.traits),null===(n=this.eventManager)||void 0===n||n.addEvent({type:i,userId:e.userId,traits:e.traits,options:e.options,callback:e.callback})}else kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[i,e]])}},{key:"alias",value:function(e){var t,n,i,r,o,a="alias";if(kn.lifecycle.loaded.value){this.errorHandler.leaveBreadcrumb("New ".concat(a," event")),kn.metrics.triggered.value+=1;var s=null!==(t=null!==(n=e.from)&&void 0!==n?n:null===(i=this.userSessionManager)||void 0===i?void 0:i.getUserId())&&void 0!==t?t:null===(r=this.userSessionManager)||void 0===r?void 0:r.getAnonymousId();null===(o=this.eventManager)||void 0===o||o.addEvent({type:a,to:e.to,from:s,options:e.options,callback:e.callback})}else kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[a,e]])}},{key:"group",value:function(e){var t,n,i="group";if(kn.lifecycle.loaded.value){var r;if(this.errorHandler.leaveBreadcrumb("New ".concat(i," event")),kn.metrics.triggered.value+=1,!z(e.groupId))null===(r=this.userSessionManager)||void 0===r||r.setGroupId(e.groupId);null===(t=this.userSessionManager)||void 0===t||t.setGroupTraits(e.traits),null===(n=this.eventManager)||void 0===n||n.addEvent({type:i,groupId:e.groupId,traits:e.traits,options:e.options,callback:e.callback})}else kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[i,e]])}},{key:"reset",value:function(e){var t,n="reset";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(n," invocation, resetAnonymousId: ").concat(e)),null===(t=this.userSessionManager)||void 0===t||t.reset(e)):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[n,e]])}},{key:"getAnonymousId",value:function(e){var t;return null===(t=this.userSessionManager)||void 0===t?void 0:t.getAnonymousId(e)}},{key:"setAnonymousId",value:function(e,t){var n,i="setAnonymousId";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(i," invocation")),null===(n=this.userSessionManager)||void 0===n||n.setAnonymousId(e,t)):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[i,e,t]])}},{key:"getUserId",value:function(){return kn.session.userId.value}},{key:"getUserTraits",value:function(){return kn.session.userTraits.value}},{key:"getGroupId",value:function(){return kn.session.groupId.value}},{key:"getGroupTraits",value:function(){return kn.session.groupTraits.value}},{key:"startSession",value:function(e){var t,n="startSession";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(n," invocation")),null===(t=this.userSessionManager)||void 0===t||t.start(e)):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[n,e]])}},{key:"endSession",value:function(){var e,t="endSession";kn.lifecycle.loaded.value?(this.errorHandler.leaveBreadcrumb("New ".concat(t," invocation")),null===(e=this.userSessionManager)||void 0===e||e.end()):kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[[t]])}},{key:"getSessionId",value:function(){var e,t=null===(e=this.userSessionManager)||void 0===e?void 0:e.getSessionId();return null!=t?t:null}},{key:"consent",value:function(e){var t,n,i,r=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(kn.lifecycle.loaded.value){var a;if(this.errorHandler.leaveBreadcrumb("New consent invocation"),vt((function(){kn.consents.preConsent.value=h(h({},kn.consents.preConsent.value),{},{enabled:!1}),kn.consents.postConsent.value=function(e){var t={sendPageEvent:!1,trackConsent:!1,discardPreConsentEvents:!1};if(Y(e)){var n=_(e);t.storage=n.storage,ee(n.integrations)&&(t.integrations=n.integrations),t.discardPreConsentEvents=!0===n.discardPreConsentEvents,t.sendPageEvent=!0===n.sendPageEvent,t.trackConsent=!0===n.trackConsent,ee(n.consentManagement)&&(t.consentManagement=Z(n.consentManagement,{enabled:kn.consents.enabled.value}))}return t}(e);var t=yd(kn.consents.postConsent.value.consentManagement,r.logger),n=t.initialized,i=t.consentsData;kn.consents.initialized.value=n,kn.consents.data.value=i})),kn.consents.enabled.value&&!kn.consents.initialized.value)null===(a=this.pluginsManager)||void 0===a||a.invokeSingle("consentManager.updateConsentsInfo",kn,this.storeManager,this.logger);null===(t=this.storeManager)||void 0===t||t.initializeStorageState(),null===(n=this.userSessionManager)||void 0===n||n.syncStorageDataToState(),null===(i=this.eventManager)||void 0===i||i.resume(),this.loadDestinations(),this.sendTrackingEvents(o)}else kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[["consent",e]])}},{key:"sendTrackingEvents",value:function(e){if(kn.consents.postConsent.value.trackConsent){var t=ce("Consent Management Interaction");e?kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[["track",t]]):this.track(t)}if(kn.consents.postConsent.value.sendPageEvent){var n=le();e?kn.eventBuffer.toBeProcessedArray.value=[].concat(b(kn.eventBuffer.toBeProcessedArray.value),[["page",n]]):this.page(n)}}},{key:"setAuthToken",value:function(e){var t;null===(t=this.userSessionManager)||void 0===t||t.setAuthToken(e)}}])}(),rv=function(){return s((function e(){o(this,e),u(this,"analyticsInstances",{}),u(this,"defaultAnalyticsKey",""),u(this,"logger",_t);try{if(e.globalSingleton)return e.globalSingleton;e.initializeGlobalResources(),this.setDefaultInstanceKey=this.setDefaultInstanceKey.bind(this),this.getAnalyticsInstance=this.getAnalyticsInstance.bind(this),this.load=this.load.bind(this),this.ready=this.ready.bind(this),this.triggerBufferedLoadEvent=this.triggerBufferedLoadEvent.bind(this),this.page=this.page.bind(this),this.track=this.track.bind(this),this.identify=this.identify.bind(this),this.alias=this.alias.bind(this),this.group=this.group.bind(this),this.reset=this.reset.bind(this),this.getAnonymousId=this.getAnonymousId.bind(this),this.setAnonymousId=this.setAnonymousId.bind(this),this.getUserId=this.getUserId.bind(this),this.getUserTraits=this.getUserTraits.bind(this),this.getGroupId=this.getGroupId.bind(this),this.getGroupTraits=this.getGroupTraits.bind(this),this.startSession=this.startSession.bind(this),this.endSession=this.endSession.bind(this),this.get
1SessionId=this.getSessionId.bind(this),this.setAuthToken=this.setAuthToken.bind(this),this.consent=this.consent.bind(this),e.globalSingleton=this,kn.autoTrack.pageLifecycle.visitId.value=Le(),kn.autoTrack.pageLifecycle.pageLoadedTimestamp.value=Date.now(),this.triggerBufferedLoadEvent(),globalThis.rudderanalytics=this}catch(t){qe(t)}}),[{key:"setDefaultInstanceKey",value:function(e){H(e)&&e&&(this.defaultAnalyticsKey=e)}},{key:"getAnalyticsInstance",value:function(e){try{var t=e;return H(t)&&t||(t=this.defaultAnalyticsKey),Boolean(this.analyticsInstances[t])||(this.analyticsInstances[t]=new iv),this.analyticsInstances[t]}catch(n){return void qe(n)}}},{key:"load",value:function(e,t,n){try{var i;if(this.analyticsInstances[e])return;this.setDefaultInstanceKey(e);var r=rt(Ye);this.trackPageLifecycleEvents(r,n),function(e){var t="consent",n=e.filter((function(e){return e[0]===t})),i=e.filter((function(e){return e[0]!==t}));e.splice.apply(e,[0,e.length].concat(b(n),b(i)))}(r),it(Ye,_(r)),null===(i=this.getAnalyticsInstance(e))||void 0===i||i.load(e,t,ze(n))}catch(o){qe(o)}}},{key:"trackPageLifecycleEvents",value:function(e,t){var n=null!=t?t:{},i=n.autoTrack,r=n.useBeacon,o=null!=i?i:{},a=o.enabled,s=void 0!==a&&a,u=o.options,l=void 0===u?{}:u,c=o.pageLifecycle,d=null!=c?c:{},v=d.events,f=void 0===v?[he.LOADED,he.UNLOADED]:v,h=d.enabled,g=void 0===h?s:h,p=d.options,y=void 0===p?l:p;kn.autoTrack.pageLifecycle.enabled.value=g,kn.autoTrack.enabled.value=s||g,g&&(this.trackPageLoadedEvent(f,y,e),this.setupPageUnloadTracking(f,r,y))}},{key:"trackPageLoadedEvent",value:function(e,t,n){(0===e.length||e.includes(he.LOADED))&&n.unshift(["track",he.LOADED,{},h(h({},t),{},{originalTimestamp:Ne(new Date(kn.autoTrack.pageLifecycle.pageLoadedTimestamp.value))})])}},{key:"setupPageUnloadTracking",value:function(e,t,n){var i=this;(0===e.length||e.includes(he.UNLOADED))&&(!0===t?_e((function(e){if(!1===e&&kn.lifecycle.loaded.value){var t=Date.now(),r=t-kn.autoTrack.pageLifecycle.pageLoadedTimestamp.value;i.track(he.UNLOADED,{visitDuration:r},h(h({},n),{},{originalTimestamp:Ne(new Date(t))}))}})):this.logger.warn("".concat("RudderStackAnalytics").concat(Be,'Page Unloaded event can only be tracked when the Beacon transport is active. Please enable "useBeacon" load API option.')))}},{key:"triggerBufferedLoadEvent",value:function(){var e=Array.isArray(globalThis.rudderanalytics)?globalThis.rudderanalytics:[],t=function(e){for(var t=[],n=0;n<e.length;){if(e[n]&&"load"===e[n][0]){t=_(e[n]),e.splice(n,1);break}n+=1}return t}(e);it(Ye,_(b(e))),t.length>0&&(t.shift(),this.load.apply(null,t))}},{key:"ready",value:function(e){try{var t;null===(t=this.getAnalyticsInstance())||void 0===t||t.ready(ze(e))}catch(n){qe(n)}}},{key:"page",value:function(e,t,n,i,r){try{var o;null===(o=this.getAnalyticsInstance())||void 0===o||o.page(le(ze(e),ze(t),ze(n),ze(i),ze(r)))}catch(a){qe(a)}}},{key:"track",value:function(e,t,n,i){try{var r;null===(r=this.getAnalyticsInstance())||void 0===r||r.track(ce(ze(e),ze(t),ze(n),ze(i)))}catch(o){qe(o)}}},{key:"identify",value:function(e,t,n,i){try{var r;null===(r=this.getAnalyticsInstance())||void 0===r||r.identify(de(ze(e),ze(t),ze(n),ze(i)))}catch(o){qe(o)}}},{key:"alias",value:function(e,t,n,i){try{var r;null===(r=this.getAnalyticsInstance())||void 0===r||r.alias(ve(ze(e),ze(t),ze(n),ze(i)))}catch(o){qe(o)}}},{key:"group",value:function(e,t,n,i){try{var r;null===(r=this.getAnalyticsInstance())||void 0===r||r.group(fe(ze(e),ze(t),ze(n),ze(i)))}catch(o){qe(o)}}},{key:"reset",value:function(e){try{var t;null===(t=this.getAnalyticsInstance())||void 0===t||t.reset(ze(e))}catch(n){qe(n)}}},{key:"getAnonymousId",value:function(e){try{var t;return null===(t=this.getAnalyticsInstance())||void 0===t?void 0:t.getAnonymousId(ze(e))}catch(n){return void qe(n)}}},{key:"setAnonymousId",value:function(e,t){try{var n;null===(n=this.getAnalyticsInstance())||void 0===n||n.setAnonymousId(ze(e),ze(t))}catch(i){qe(i)}}},{key:"getUserId",value:function(){try{var e;return null===(e=this.getAnalyticsInstance())||void 0===e?void 0:e.getUserId()}catch(t){return void qe(t)}}},{key:"getUserTraits",value:function(){try{var e;return null===(e=this.getAnalyticsInstance())||void 0===e?void 0:e.getUserTraits()}catch(t){return void qe(t)}}},{key:"getGroupId",value:function(){try{var e;return null===(e=this.getAnalyticsInstance())||void 0===e?void 0:e.getGroupId()}catch(t){return void qe(t)}}},{key:"getGroupTraits",value:function(){try{var e;return null===(e=this.getAnalyticsInstance())||void 0===e?void 0:e.getGroupTraits()}catch(t){return void qe(t)}}},{key:"startSession",value:function(e){try{var t;null===(t=this.getAnalyticsInstance())||void 0===t||t.startSession(ze(e))}catch(n){qe(n)}}},{key:"endSession",value:function(){try{var e;null===(e=this.getAnalyticsInstance())||void 0===e||e.endSession()}catch(t){qe(t)}
1}},{key:"getSessionId",value:function(){try{var e;return null===(e=this.getAnalyticsInstance())||void 0===e?void 0:e.getSessionId()}catch(t){return void qe(t)}}},{key:"setAuthToken",value:function(e){try{var t;null===(t=this.getAnalyticsInstance())||void 0===t||t.setAuthToken(ze(e))}catch(n){qe(n)}}},{key:"consent",value:function(e){try{var t;null===(t=this.getAnalyticsInstance())||void 0===t||t.consent(ze(e))}catch(n){qe(n)}}}],[{key:"initializeGlobalResources",value:function(){ei.init(),nd.configure(),Zc.configure(),td.configure(),Qc.configure()}}])}();u(rv,"globalSingleton",null);var ov=new rv,av=ov.setDefaultInstanceKey,sv=ov.getAnalyticsInstance,uv=ov.load,lv=ov.ready,cv=ov.page,dv=ov.track,vv=ov.identify,fv=ov.alias,hv=ov.group,gv=ov.reset,pv=ov.getAnonymousId,yv=ov.setAnonymousId,mv=ov.getUserId,bv=ov.getUserTraits,kv=ov.getGroupId,Ev=ov.getGroupTraits,Av=ov.startSession,Sv=ov.endSession,Iv=ov.getSessionId,Tv=ov.consent,wv=ov.setAuthToken;return e.alias=fv,e.consent=Tv,e.endSession=Sv,e.getAnalyticsInstance=sv,e.getAnonymousId=pv,e.getGroupId=kv,e.getGroupTraits=Ev,e.getSessionId=Iv,e.getUserId=mv,e.getUserTraits=bv,e.group=hv,e.identify=vv,e.load=uv,e.page=cv,e.ready=lv,e.reset=gv,e.setAnonymousId=yv,e.setAuthToken=wv,e.setDefaultInstanceKey=av,e.startSession=Av,e.track=dv,e}({});
2//# sourceMappingURL=rsa.min.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.