rudder-sdk-js 2.40.5 → 2.41.0

Sign up to get free protection for your applications and to get access to all the features.
package/index.es.js CHANGED
@@ -1 +1 @@
1
- function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="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},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function u(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function d(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var r=Function.bind.apply(t,n);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var p={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}p.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var g=p.exports,y=h(g);function v(e){return null!=e&&"object"===n(e)&&!0===e["@@functional/placeholder"]}function m(e){return function t(n){return 0===arguments.length||v(n)?t:e.apply(this,arguments)}}function A(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return v(n)?t:m((function(t){return e(n,t)}));default:return v(n)&&v(r)?t:v(n)?m((function(t){return e(t,r)})):v(r)?m((function(t){return e(n,t)})):e(n,r)}}}function I(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return v(n)?t:A((function(t,r){return e(n,t,r)}));case 2:return v(n)&&v(r)?t:v(n)?A((function(t,n){return e(t,r,n)})):v(r)?A((function(t,r){return e(n,t,r)})):m((function(t){return e(n,r,t)}));default:return v(n)&&v(r)&&v(i)?t:v(n)&&v(r)?A((function(t,n){return e(t,n,i)})):v(n)&&v(i)?A((function(t,n){return e(t,r,n)})):v(r)&&v(i)?A((function(t,r){return e(n,t,r)})):v(n)?m((function(t){return e(t,r,i)})):v(r)?m((function(t){return e(n,t,i)})):v(i)?m((function(t){return e(n,r,t)})):e(n,r,i)}}}function b(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var E=m((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e,t,r){if(r||(r=new S),function(e){var t=n(e);return null==e||"object"!=t&&"function"!=t}(e))return e;var i,o=function(n){var i=r.get(e);if(i)return i;for(var o in r.set(e,n),e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t?O(e[o],!0,r):e[o]);return n};switch(E(e)){case"Object":return o(Object.create(Object.getPrototypeOf(e)));case"Array":return o([]);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 S=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.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],r=0;r<n.length;r+=1){var i=n[r];if(i[0]===e)return i[1]}else{var o=this.hash(e),s=this.map[o];if(s)for(var a=0;a<s.length;a+=1){var u=s[a];if(u[0]===e)return u[1]}}},e}(),T=m((function(e){return null!=e&&"function"==typeof e.clone?e.clone():O(e,!0)})),C=I((function(e,t,n){var r,i={};for(r in n=n||{},t=t||{})b(r,t)&&(i[r]=b(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)b(r,n)&&!b(r,i)&&(i[r]=n[r]);return i})),w=I((function e(t,n,r){return C((function(n,r,i){return k(r)&&k(i)?e(t,r,i):t(n,r,i)}),n,r)})),R=I((function(e,t,n){return w((function(t,n,r){return e(n,r)}),t,n)})),_=function(e){return null!=e&&"object"===n(e)&&!1===Array.isArray(e)},P=function(e,t,n){if(_(n)||(n={default:n}),!M(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));var r=Array.isArray(t),i="string"==typeof t,o=n.separator||".",s=n.joinChar||("string"==typeof o?o:".");if(!i&&!r)return e;if(i&&t in e)return L(t,e,n)?e[t]:n.default;var a=r?t:function(e,t,n){if("function"==typeof n.split)return n.split(e);return e.split(t)}(t,o,n),u=a.length,c=0;do{var l=a[c];for("number"==typeof l&&(l=String(l));l&&"\\"===l.slice(-1);)l=D([l.slice(0,-1),a[++c]||""],s,n);if(l in e){if(!L(l,e,n))return n.default;e=e[l]}else{for(var f=!1,h=c+1;h<u;)if(f=(l=D([l,a[h++]],s,n))in e){if(!L(l,e,n))return n.default;e=e[l],c=h-1;break}if(!f)return n.default}}while(++c<u&&M(e));return c===u?e:n.default};function D(e,t,n){return"function"==typeof n.join?n.join(e):e[0]+t+e[1]}function L(e,t,n){return"function"!=typeof n.isValid||n.isValid(e,t)}function M(e){return _(e)||Array.isArray(e)||"function"==typeof e}for(var x,N=h(P),B=256,G=[];B--;)G[B]=(B+256).toString(16).substring(1);for(var U,j=[],F=0;F<256;F++)j[F]=(F+256).toString(16).substring(1);function K(){var e;(!U||F+16>4096)&&(e=4096,U=crypto.getRandomValues(new Uint8Array(e)),F=0);for(var t,n=0,r="";n<16;n++)t=U[F+n],r+=6==n?j[15&t|64]:8==n?j[63&t|128]:j[t],1&n&&n>1&&n<11&&(r+="-");return F+=16,r}var H,Q,z,q,V,W,Y,X,J,$,Z,ee,te,ne,re,ie,oe,se,ae,ue,ce,le,fe,he,de,pe,ge,ye,ve,me,Ae,Ie,be,Ee,ke,Oe,Se,Te,Ce,we,Re,_e,Pe,De,Le,Me,xe,Ne,Be,Ge,Ue,je,Fe,Ke,He,Qe,ze,qe,Ve,We,Ye,Xe,Je,$e,Ze,et,tt,nt,rt,it,ot,st,at,ut=4,ct={setLogLevel:function(e){switch(e.toUpperCase()){case"INFO":ut=1;break;case"DEBUG":ut=2;break;case"WARN":ut=3;break;default:ut=4}},info:function(){var e;ut<=1&&(e=console).info.apply(e,arguments)},debug:function(){var e;ut<=2&&(e=console).log.apply(e,arguments)},warn:function(){var e;ut<=3&&(e=console).warn.apply(e,arguments)},error:function(){var e;ut<=4&&(e=console).error.apply(e,arguments)}},lt="ADOBE_ANALYTICS",ft=(H={"Adobe Analytics":lt,ADOBEANALYTICS:lt,"ADOBE ANALYTICS":lt},s(H,lt,lt),s(H,"AdobeAnalytics",lt),s(H,"adobeanalytics",lt),s(H,"adobe analytics",lt),s(H,"Adobe analytics",lt),s(H,"adobe Analytics",lt),H),ht=(Q={},s(Q,"AM","AM"),s(Q,"AMPLITUDE","AM"),s(Q,"Amplitude","AM"),s(Q,"am","AM"),Q),dt=(z={},s(z,"APPCUES","APPCUES"),s(z,"Appcues","APPCUES"),s(z,"App Cues","APPCUES"),s(z,"appcues","APPCUES"),z),pt=(q={},s(q,"BINGADS","BINGADS"),s(q,"BingAds","BINGADS"),s(q,"bingads","BINGADS"),s(q,"Bing Ads","BINGADS"),s(q,"Bing ads","BINGADS"),s(q,"bing Ads","BINGADS"),s(q,"bing ads","BINGADS"),q),gt=(V={},s(V,"BRAZE","BRAZE"),s(V,"Braze","BRAZE"),s(V,"braze","BRAZE"),V),yt=(W={},s(W,"BUGSNAG","BUGSNAG"),s(W,"bugsnag","BUGSNAG"),s(W,"Bugsnag","BUGSNAG"),W),vt="CHARTBEAT",mt=(Y={},s(Y,vt,vt),s(Y,"Chartbeat",vt),s(Y,"chartbeat",vt),s(Y,"Chart Beat",vt),s(Y,"chart beat",vt),Y),At=(X={},s(X,"CLEVERTAP","CLEVERTAP"),s(X,"Clevertap","CLEVERTAP"),s(X,"clevertap","CLEVERTAP"),X),It="COMSCORE",bt=(J={},s(J,It,It),s(J,"Comscore",It),s(J,"Com Score",It),s(J,"com Score",It),s(J,"com score",It),s(J,"Com score",It),J),Et=($={},s($,"CRITEO","CRITEO"),s($,"Criteo","CRITEO"),s($,"criteo","CRITEO"),$),kt="CUSTOMERIO",Ot=(Z={},s(Z,kt,kt),s(Z,"Customerio",kt),s(Z,"Customer.io",kt),s(Z,"CUSTOMER.IO",kt),s(Z,"customer.io",kt),Z),St=(ee={},s(ee,"DRIP","DRIP"),s(ee,"Drip","DRIP"),s(ee,"drip","DRIP"),ee),Tt="FACEBOOK_PIXEL",Ct=(te={},s(te,Tt,Tt),s(te,"FB Pixel",Tt),s(te,"Facebook Pixel",Tt),s(te,"facebook pixel",Tt),s(te,"fbpixel",Tt),s(te,"FBPIXEL",Tt),s(te,"FB_PIXEL",Tt),te),wt="FULLSTORY",Rt=(ne={},s(ne,wt,wt),s(ne,"Fullstory",wt),s(ne,"FullStory",wt),s(ne,"full Story",wt),s(ne,"Full Story",wt),s(ne,"Full story",wt),s(ne,"full story",wt),s(ne,"fullstory",wt),ne),_t=(re={},s(re,"GA","GA"),s(re,"Google Analytics","GA"),s(re,"GoogleAnalytics","GA"),s(re,"GOOGLE ANALYTICS","GA"),s(re,"google analytics","GA"),re),Pt=(ie={},s(ie,"GA4","GA4"),s(ie,"Google Analytics 4","GA4"),s(ie,"Google analytics 4","GA4"),s(ie,"google analytics 4","GA4"),s(ie,"Google Analytics4","GA4"),s(ie,"Google analytics4","GA4"),s(ie,"google analytics4","GA4"),s(ie,"GoogleAnalytics4","GA4"),ie),Dt="GOOGLEADS",Lt=(oe={},s(oe,Dt,Dt),s(oe,"Google Ads",Dt),s(oe,"GoogleAds",Dt),s(oe,"GOOGLE ADS",Dt),s(oe,"google ads",Dt),s(oe,"googleads",Dt),oe),Mt="GOOGLE_OPTIMIZE",xt=(se={},s(se,Mt,Mt),s(se,"Google Optimize",Mt),s(se,"GoogleOptimize",Mt),s(se,"Googleoptimize",Mt),s(se,"GOOGLEOPTIMIZE",Mt),s(se,"google optimize",Mt),s(se,"Google optimize",Mt),s(se,"GOOGLE OPTIMIZE",Mt),se),Nt=(ae={},s(ae,"GTM","GTM"),s(ae,"Google Tag Manager","GTM"),s(ae,"google tag manager","GTM"),s(ae,"googletag manager","GTM"),s(ae,"googletagmanager","GTM"),ae),Bt=(s(ue={},"HEAP","HEAP"),s(ue,"Heap","HEAP"),s(ue,"heap","HEAP"),s(ue,"Heap.io","HEAP"),ue),Gt=(s(ce={},"HOTJAR","HOTJAR"),s(ce,"Hotjar","HOTJAR"),s(ce,"hotjar","HOTJAR"),s(ce,"Hot Jar","HOTJAR"),s(ce,"hot jar","HOTJAR"),ce),Ut=(s(le={},"HS","HS"),s(le,"Hubspot","HS"),s(le,"HUBSPOT","HS"),s(le,"hub spot","HS"),s(le,"Hub Spot","HS"),s(le,"Hub spot","HS"),le),jt=(s(fe={},"INTERCOM","INTERCOM"),s(fe,"Intercom","INTERCOM"),s(fe,"intercom","INTERCOM"),fe),Ft=(s(he={},"KEEN","KEEN"),s(he,"Keen","KEEN"),s(he,"Keen.io","KEEN"),s(he,"keen","KEEN"),s(he,"keen.io","KEEN"),he),Kt="KISSMETRICS",Ht=(s(de={},Kt,Kt),s(de,"Kissmetrics",Kt),s(de,"kissmetrics",Kt),de),Qt=(s(pe={},"KLAVIYO","KLAVIYO"),s(pe,"Klaviyo","KLAVIYO"),s(pe,"klaviyo","KLAVIYO"),pe),zt="LAUNCHDARKLY",qt=(s(ge={},zt,zt),s(ge,"LaunchDarkly",zt),s(ge,"Launch_Darkly",zt),s(ge,"Launch Darkly",zt),s(ge,"launchDarkly",zt),s(ge,"launch darkly",zt),ge),Vt="LINKEDIN_INSIGHT_TAG",Wt=(s(ye={},Vt,Vt),s(ye,"LinkedIn Insight Tag",Vt),s(ye,"LinkedIn insight tag",Vt),s(ye,"linkedIn insight tag",Vt),s(ye,"Linkedin_insight_tag",Vt),s(ye,"LinkedinInsighttag",Vt),s(ye,"LinkedinInsightTag",Vt),s(ye,"LinkedInInsightTag",Vt),s(ye,"Linkedininsighttag",Vt),s(ye,"LINKEDININSIGHTTAG",Vt),s(ye,"linkedininsighttag",Vt),ye),Yt=(s(ve={},"LOTAME","LOTAME"),s(ve,"Lotame","LOTAME"),s(ve,"lotame","LOTAME"),ve),Xt=(s(me={},"LYTICS","LYTICS"),s(me,"Lytics","LYTICS"),s(me,"lytics","LYTICS"),me),Jt=(s(Ae={},"MP","MP"),s(Ae,"MIXPANEL","MP"),s(Ae,"Mixpanel","MP"),s(Ae,"MIX PANEL","MP"),s(Ae,"Mix panel","MP"),s(Ae,"Mix Panel","MP"),Ae),$t="MOENGAGE",Zt=(s(Ie={},$t,$t),s(Ie,"MoEngage",$t),s(Ie,"moengage",$t),s(Ie,"Moengage",$t),s(Ie,"Mo Engage",$t),s(Ie,"mo engage",$t),s(Ie,"Mo engage",$t),Ie),en="OPTIMIZELY",tn=(s(be={},en,en),s(be,"Optimizely",en),s(be,"optimizely",en),be),nn=(s(Ee={},"PENDO","PENDO"),s(Ee,"Pendo","PENDO"),s(Ee,"pendo","PENDO"),Ee),rn="PINTEREST_TAG",on=(s(ke={},rn,rn),s(ke,"PinterestTag",rn),s(ke,"Pinterest_Tag",rn),s(ke,"PINTERESTTAG",rn),s(ke,"pinterest",rn),s(ke,"PinterestAds",rn),s(ke,"Pinterest_Ads",rn),s(ke,"Pinterest",rn),s(ke,"Pinterest Tag",rn),s(ke,"Pinterest tag",rn),s(ke,"PINTEREST TAG",rn),s(ke,"pinterest tag",rn),s(ke,"Pinterest Ads",rn),s(ke,"Pinterest ads",rn),ke),sn="POST_AFFILIATE_PRO",an=(s(Oe={},sn,sn),s(Oe,"PostAffiliatePro",sn),s(Oe,"Post_affiliate_pro",sn),s(Oe,"Post Affiliate Pro",sn),s(Oe,"Post affiliate pro",sn),s(Oe,"post affiliate pro",sn),s(Oe,"postaffiliatepro",sn),s(Oe,"POSTAFFILIATEPRO",sn),Oe),un="POSTHOG",cn=(s(Se={},un,un),s(Se,"PostHog",un),s(Se,"Posthog",un),s(Se,"posthog",un),s(Se,"Post Hog",un),s(Se,"Post hog",un),s(Se,"post hog",un),Se),ln="PROFITWELL",fn=(s(Te={},ln,ln),s(Te,"ProfitWell",ln),s(Te,"profitwell",ln),s(Te,"Profitwell",ln),s(Te,"Profit Well",ln),s(Te,"profit well",ln),s(Te,"Profit well",ln),Te),hn="QUALTRICS",dn=(s(Ce={},hn,hn),s(Ce,"Qualtrics",hn),s(Ce,"qualtrics",hn),Ce),pn="QUANTUMMETRIC",gn=(s(we={},pn,pn),s(we,"Quantum Metric",pn),s(we,"quantum Metric",pn),s(we,"quantum metric",pn),s(we,"QuantumMetric",pn),s(we,"quantumMetric",pn),s(we,"quantummetric",pn),s(we,"Quantum_Metric",pn),we),yn="REDDIT_PIXEL",vn=(s(Re={},yn,yn),s(Re,"Reddit_Pixel",yn),s(Re,"RedditPixel",yn),s(Re,"REDDITPIXEL",yn),s(Re,"redditpixel",yn),s(Re,"Reddit Pixel",yn),s(Re,"REDDIT PIXEL",yn),s(Re,"reddit pixel",yn),Re),mn=(s(_e={},"SENTRY","SENTRY"),s(_e,"sentry","SENTRY"),s(_e,"Sentry","SENTRY"),_e),An="SNAP_PIXEL",In=(s(Pe={},An,An),s(Pe,"Snap_Pixel",An),s(Pe,"SnapPixel",An),s(Pe,"SNAPPIXEL",An),s(Pe,"snappixel",An),s(Pe,"Snap Pixel",An),s(Pe,"SNAP PIXEL",An),s(Pe,"snap pixel",An),Pe),bn="TVSQUARED",En=(s(De={},bn,bn),s(De,"TVSquared",bn),s(De,"tvsquared",bn),s(De,"tvSquared",bn),s(De,"TvSquared",bn),s(De,"Tvsquared",bn),s(De,"TV Squared",bn),s(De,"tv squared",bn),s(De,"tv Squared",bn),De),kn=(s(Le={},"VWO","VWO"),s(Le,"VisualWebsiteOptimizer","VWO"),s(Le,"Visualwebsiteoptimizer","VWO"),s(Le,"visualwebsiteoptimizer","VWO"),s(Le,"vwo","VWO"),s(Le,"Visual Website Optimizer","VWO"),s(Le,"Visual website optimizer","VWO"),s(Le,"visual website optimizer","VWO"),Le),On=(s(Me={},"GA360","GA360"),s(Me,"Google Analytics 360","GA360"),s(Me,"Google analytics 360","GA360"),s(Me,"google analytics 360","GA360"),s(Me,"Google Analytics360","GA360"),s(Me,"Google analytics360","GA360"),s(Me,"google analytics360","GA360"),s(Me,"GoogleAnalytics360","GA360"),s(Me,"GA 360","GA360"),Me),Sn=(s(xe={},"ADROLL","ADROLL"),s(xe,"Adroll","ADROLL"),s(xe,"Ad roll","ADROLL"),s(xe,"ad roll","ADROLL"),s(xe,"adroll","ADROLL"),xe),Tn="DCM_FLOODLIGHT",Cn=(s(Ne={},Tn,Tn),s(Ne,"DCM Floodlight",Tn),s(Ne,"dcm floodlight",Tn),s(Ne,"Dcm Floodlight",Tn),s(Ne,"DCMFloodlight",Tn),s(Ne,"dcmfloodlight",Tn),s(Ne,"DcmFloodlight",Tn),s(Ne,"dcm_floodlight",Tn),s(Ne,"DCM_Floodlight",Tn),Ne),wn=(s(Be={},"MATOMO","MATOMO"),s(Be,"Matomo","MATOMO"),s(Be,"matomo","MATOMO"),Be),Rn=(s(Ge={},"VERO","VERO"),s(Ge,"Vero","VERO"),s(Ge,"vero","VERO"),Ge),_n="MOUSEFLOW",Pn=(s(Ue={},_n,_n),s(Ue,"Mouseflow",_n),s(Ue,"mouseflow",_n),s(Ue,"mouseFlow",_n),s(Ue,"MouseFlow",_n),s(Ue,"Mouse flow",_n),s(Ue,"mouse flow",_n),s(Ue,"mouse Flow",_n),s(Ue,"Mouse Flow",_n),Ue),Dn="ROCKERBOX",Ln=(s(je={},Dn,Dn),s(je,"Rockerbox",Dn),s(je,"rockerbox",Dn),s(je,"RockerBox",Dn),s(je,"Rocker box",Dn),s(je,"rocker box",Dn),s(je,"Rocker Box",Dn),je),Mn="CONVERTFLOW",xn=(s(Fe={},Mn,Mn),s(Fe,"Convertflow",Mn),s(Fe,"convertflow",Mn),s(Fe,"convertFlow",Mn),s(Fe,"ConvertFlow",Mn),s(Fe,"Convert flow",Mn),s(Fe,"convert flow",Mn),s(Fe,"convert Flow",Mn),s(Fe,"Convert Flow",Mn),s(Fe,"CONVERT FLOW",Mn),Fe),Nn="SNAPENGAGE",Bn=(s(Ke={},Nn,Nn),s(Ke,"SnapEngage",Nn),s(Ke,"Snap_Engage",Nn),s(Ke,"snapengage",Nn),s(Ke,"SNAP ENGAGE",Nn),s(Ke,"Snap Engage",Nn),s(Ke,"snap engage",Nn),Ke),Gn="LIVECHAT",Un=(s(He={},Gn,Gn),s(He,"LiveChat",Gn),s(He,"Live_Chat",Gn),s(He,"livechat",Gn),s(He,"LIVE CHAT",Gn),s(He,"Live Chat",Gn),s(He,"live chat",Gn),He),jn="SHYNET",Fn=(s(Qe={},jn,jn),s(Qe,"shynet",jn),s(Qe,"ShyNet",jn),s(Qe,"shyNet",jn),s(Qe,"Shynet",jn),s(Qe,"shy net",jn),s(Qe,"Shy Net",jn),s(Qe,"shy Net",jn),s(Qe,"Shy net",jn),Qe),Kn=(s(ze={},"WOOPRA","WOOPRA"),s(ze,"Woopra","WOOPRA"),s(ze,"woopra","WOOPRA"),ze),Hn="ROLLBAR",Qn=(s(qe={},Hn,Hn),s(qe,"RollBar",Hn),s(qe,"Roll_Bar",Hn),s(qe,"rollbar",Hn),s(qe,"Rollbar",Hn),s(qe,"ROLL BAR",Hn),s(qe,"Roll Bar",Hn),s(qe,"roll bar",Hn),qe),zn="QUORA_PIXEL",qn=(s(Ve={},zn,zn),s(Ve,"Quora Pixel",zn),s(Ve,"Quora pixel",zn),s(Ve,"QUORA PIXEL",zn),s(Ve,"QuoraPixel",zn),s(Ve,"Quorapixel",zn),s(Ve,"QUORAPIXEL",zn),s(Ve,"Quora_Pixel",zn),s(Ve,"quora_pixel",zn),s(Ve,"Quora",zn),Ve),Vn=(s(We={},"JUNE","JUNE"),s(We,"June","JUNE"),s(We,"june","JUNE"),We),Wn=(s(Ye={},"ENGAGE","ENGAGE"),s(Ye,"Engage","ENGAGE"),s(Ye,"engage","ENGAGE"),Ye),Yn=(s(Xe={},"ITERABLE","ITERABLE"),s(Xe,"Iterable","ITERABLE"),s(Xe,"iterable","ITERABLE"),Xe),Xn="YANDEX_METRICA",Jn=(s(Je={},Xn,Xn),s(Je,"Yandexmetrica",Xn),s(Je,"yandexmetrica",Xn),s(Je,"yandexMetrica",Xn),s(Je,"YandexMetrica",Xn),Je),$n=(s($e={},"REFINER","REFINER"),s($e,"Refiner","REFINER"),s($e,"refiner","REFINER"),$e),Zn=(s(Ze={},"QUALAROO","QUALAROO"),s(Ze,"Qualaroo","QUALAROO"),s(Ze,"qualaroo","QUALAROO"),Ze),er="PODSIGHTS",tr=(s(et={},er,er),s(et,"Podsights",er),s(et,"PodSights",er),s(et,"pod Sights",er),s(et,"Pod Sights",er),s(et,"pod sights",er),s(et,"POD SIGHTS",er),s(et,"Pod sights",er),et),nr=(s(tt={},"AXEPTIO","AXEPTIO"),s(tt,"Axeptio","AXEPTIO"),s(tt,"axeptio","AXEPTIO"),tt),rr="SATISMETER",ir=(s(nt={},rr,rr),s(nt,"Satismeter",rr),s(nt,"SatisMeter",rr),s(nt,"SATISMETER",rr),nt),or="MICROSOFT_CLARITY",sr=(s(rt={},or,or),s(rt,"Microsoft Clarity",or),s(rt,"Microsoft clarity",or),s(rt,"microsoft clarity",or),s(rt,"Microsoft_clarity",or),s(rt,"MicrosoftClarity",or),s(rt,"MICROSOFTCLARITY",or),s(rt,"microsoftclarity",or),s(rt,"microsoftClarity",or),rt),ar="SENDINBLUE",ur=(s(it={},ar,ar),s(it,"Sendinblue",ar),s(it,"sendinblue",ar),s(it,"SendinBlue",ar),it),cr=(s(ot={},"OLARK","OLARK"),s(ot,"Olark","OLARK"),s(ot,"olark","OLARK"),ot),lr="LEMNISK",fr=(s(st={},lr,lr),s(st,"LEMNISK_MARKETING_AUTOMATION",lr),s(st,"Lemnisk Marketing Automation",lr),s(st,"LemniskMarketingAutomation",lr),s(st,"lemniskmarketingautomation",lr),s(st,"lemniskMarketingAutomation",lr),s(st,"lemnisk",lr),s(st,"Lemnisk",lr),st),hr="TIKTOK_ADS",dr=(s(at={},hr,hr),s(at,"TiktokAds",hr),s(at,"TIKTOK_ADS",hr),s(at,"Tiktok ads",hr),s(at,"Tiktok Ads",hr),s(at,"Tik Tok Ads",hr),s(at,"tik tok ads",hr),s(at,"tiktokads",hr),at),pr=t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t({All:"All"},ft),ht),dt),pt),gt),yt),mt),At),bt),Et),Ot),St),Ct),Rt),_t),Pt),On),Lt),xt),Nt),Bt),Gt),Ut),jt),Ft),Ht),Qt),qt),Wt),Yt),Xt),Jt),Zt),tn),nn),on),an),cn),fn),dn),gn),vn),mn),In),En),kn),Sn),Cn),wn),Rn),Pn),xn),Bn),Un),Fn),Kn),Qn),qn),Vn),Wn),Yn),Ln),Jn),$n),Zn),tr),nr),ir),sr),ur),cr),fr),dr),gr={All:"All",GA:"Google Analytics",GOOGLEADS:"Google Ads",BRAZE:"Braze",CHARTBEAT:"Chartbeat",COMSCORE:"Comscore",CUSTOMERIO:"Customer IO",DCM_Floodlight:"DCM Floodlight",FACEBOOK_PIXEL:"Facebook Pixel",GTM:"Google Tag Manager",HOTJAR:"Hotjar",HS:"HubSpot",INTERCOM:"Intercom",KEEN:"Keen",KISSMETRICS:"Kiss Metrics",LOTAME:"Lotame",VWO:"VWO",OPTIMIZELY:"Optimizely Web",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"Google Analytics 4",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"PostHog",PROFITWELL:"ProfitWell",KLAVIYO:"Klaviyo",CLEVERTAP:"CleverTap",BINGADS:"Bing Ads",PINTEREST_TAG:"Pinterest Tag",SNAP_PIXEL:"Snap Pixel",LINKEDIN_INSIGHT_TAG:"Linkedin Insight Tag",REDDIT_PIXEL:"Reddit Pixel",DRIP:"Drip",HEAP:"Heap.io",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",SENTRY:"Sentry",GOOGLE_OPTIMIZE:"Google Optimize",POST_AFFILIATE_PRO:"Post Affiliate Pro",LAUNCHDARKLY:"LaunchDarkly",GA360:"Google Analytics 360",ADROLL:"Adroll",VERO:"Vero",MATOMO:"Matomo",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"Quora Pixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"Yandex.Metrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"Microsoft Clarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TikTok Ads"},yr=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],vr="https://api.rudderlabs.com/sourceConfig/?p=npm&v=2.40.5",mr="".concat("https://cdn.rudderlabs.com","/").concat("v1.1","/").concat("js-integrations"),Ar=["Lax","None","Strict"],Ir=["US","EU"],br=["oneTrust","ketch"],Er=["library","consentManagement"],kr=["none","default","full"],Or={All:!0},Sr=["Request failed with status:"],Tr=function(e){var t=window.RudderStackGlobals&&window.RudderStackGlobals.errorReporting;t&&e instanceof Error&&t.notify(e)},Cr=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return T(t);var n=T(e);return t.forEach((function(e,t){n[t]=wr(n[t],e)})),n},wr=function(e,t){return R(Cr,e,t)},Rr=function(e,t){return JSON.stringify(e,function(e){var t=[];return function(r,i){if(!e||null!=i){if("object"!==n(i)||null===i)return i;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?(ct.debug("Circular Reference detected for key: ".concat(r)),"[Circular Reference]"):(t.push(i),i)}}}(t))},_r=function(e){return function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}(e)&&Object.keys(e).length>0},Pr=function(e,t,r){var i,o;try{i="string"==typeof e?e:e instanceof Error||e.message?e.message:Rr(e)}catch(e){i=""}if("object"===n(o=e)&&null!==o&&"target"in o){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&("RS_JS_SDK"!==e.target.dataset.loader||"true"!==e.target.dataset.isnonnativesdk))return"";if(i="error in script loading:: src:: ".concat(e.target.src," id:: ").concat(e.target.id),"ad-block"===e.target.id)return r.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:i},r.sendAdblockPageOptions),""}return"[handleError]::".concat(t||"",' "').concat(i,'"')},Dr=function(e,t,n){var r;try{r=Pr(e,t,n)}catch(t){ct.error("[handleError] Exception:: ",t),ct.error("[handleError] Original error:: ",Rr(e)),Tr(t)}r&&(ct.error(r),function(e){return!e.message||!Sr.some((function(t){return e.message.includes(t)}))}(e)&&Tr(e))};function Lr(e){return e&&e.endsWith("/")?e.replace(/\/+$/,""):e}function Mr(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?K():function(){var e,t=0,n="";if(!x||B+16>256){for(x=Array(t=256);t--;)x[t]=256*Math.random()|0;t=B=0}for(;t<16;t++)e=x[B+t],n+=6==t?G[15&e|64]:8==t?G[63&e|128]:G[e],1&t&&t>1&&t<11&&(n+="-");return B++,n}()}function xr(){return(new Date).toISOString()}function Nr(e,t){Object.keys(e).forEach((function(n){e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!=n&&null!=t[n]&&t[n]!=n&&delete e[n])}))}function Br(e){Nr(e,pr)}function Gr(e){Nr(e,gr)}function Ur(e,t){var r=[];if(!t||0===t.length)return r;var i=!0;void 0!==e.All&&(i=e.All);var o=[];return"string"==typeof t[0]?t.forEach((function(e){o.push({intgName:e,intObj:e})})):"object"===n(t[0])&&t.forEach((function(e){o.push({intgName:e.name,intObj:e})})),o.forEach((function(t){var n=t.intgName,o=t.intObj;if(i){var s=!0;void 0!==e[n]&&!1===Boolean(e[n])&&(s=!1),s&&r.push(o)}else void 0!==e[n]&&!0===Boolean(e[n])&&r.push(o)})),r}var jr=function(){for(var e,t=document.getElementsByTagName("script"),n=!1,r=0;r<t.length;r+=1){var i=Lr(t[r].getAttribute("src"));if(i){var o=i.match(/^.*rudder-analytics(-staging)?(\.min)?\.js$/);if(o){e=i,n=void 0!==o[1];break}}}return{sdkURL:e,isStaging:n}},Fr=function(e){return"string"==typeof e||null==e?e:JSON.stringify(e)},Kr=function(e){return!(!e||"string"!=typeof e||0===e.trim().length)},Hr=function(e,t,n){try{var r=e.source.dataplanes||{};if(Object.keys(r).length){var i=function(e){var t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&Ir.includes(t.toUpperCase())?t.toUpperCase():void ct.error("Invalid residencyServer input")}(n),o=r[i]||r.US;if(o){var s=function(e){if(Array.isArray(e)&&e.length){var t=e.find((function(e){return!0===e.default}));if(t&&Kr(t.url))return t.url}}(o);if(s)return s}}if(Kr(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}},Qr={exports:{}};var zr,qr={exports:{}},Vr=d(Object.freeze({__proto__:null,default:{}}));function Wr(){return zr?qr.exports:(zr=1,qr.exports=(e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==f&&f.crypto&&(n=f.crypto),!n)try{n=Vr}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},s=o.lib={},a=s.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=o.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},h=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*c,o);if(c){for(var f=0;f<c;f+=s)this._doProcessBlock(i,f);n=i.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=p.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math),e));var e}var Yr,Xr={exports:{}};function Jr(){return Yr?Xr.exports:(Yr=1,Xr.exports=(e=Wr(),function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],o=0,s=0;s<t;s++)if(s%4){var a=r[e.charCodeAt(s-1)]<<s%4*2|r[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return n.create(i,o)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(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,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64));var e}var $r,Zr={exports:{}};function ei(){return $r?Zr.exports:($r=1,Zr.exports=(e=Wr(),function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],A=e[t+8],I=e[t+9],b=e[t+10],E=e[t+11],k=e[t+12],O=e[t+13],S=e[t+14],T=e[t+15],C=o[0],w=o[1],R=o[2],_=o[3];C=c(C,w,R,_,s,7,a[0]),_=c(_,C,w,R,u,12,a[1]),R=c(R,_,C,w,d,17,a[2]),w=c(w,R,_,C,p,22,a[3]),C=c(C,w,R,_,g,7,a[4]),_=c(_,C,w,R,y,12,a[5]),R=c(R,_,C,w,v,17,a[6]),w=c(w,R,_,C,m,22,a[7]),C=c(C,w,R,_,A,7,a[8]),_=c(_,C,w,R,I,12,a[9]),R=c(R,_,C,w,b,17,a[10]),w=c(w,R,_,C,E,22,a[11]),C=c(C,w,R,_,k,7,a[12]),_=c(_,C,w,R,O,12,a[13]),R=c(R,_,C,w,S,17,a[14]),C=l(C,w=c(w,R,_,C,T,22,a[15]),R,_,u,5,a[16]),_=l(_,C,w,R,v,9,a[17]),R=l(R,_,C,w,E,14,a[18]),w=l(w,R,_,C,s,20,a[19]),C=l(C,w,R,_,y,5,a[20]),_=l(_,C,w,R,b,9,a[21]),R=l(R,_,C,w,T,14,a[22]),w=l(w,R,_,C,g,20,a[23]),C=l(C,w,R,_,I,5,a[24]),_=l(_,C,w,R,S,9,a[25]),R=l(R,_,C,w,p,14,a[26]),w=l(w,R,_,C,A,20,a[27]),C=l(C,w,R,_,O,5,a[28]),_=l(_,C,w,R,d,9,a[29]),R=l(R,_,C,w,m,14,a[30]),C=f(C,w=l(w,R,_,C,k,20,a[31]),R,_,y,4,a[32]),_=f(_,C,w,R,A,11,a[33]),R=f(R,_,C,w,E,16,a[34]),w=f(w,R,_,C,S,23,a[35]),C=f(C,w,R,_,u,4,a[36]),_=f(_,C,w,R,g,11,a[37]),R=f(R,_,C,w,m,16,a[38]),w=f(w,R,_,C,b,23,a[39]),C=f(C,w,R,_,O,4,a[40]),_=f(_,C,w,R,s,11,a[41]),R=f(R,_,C,w,p,16,a[42]),w=f(w,R,_,C,v,23,a[43]),C=f(C,w,R,_,I,4,a[44]),_=f(_,C,w,R,k,11,a[45]),R=f(R,_,C,w,T,16,a[46]),C=h(C,w=f(w,R,_,C,d,23,a[47]),R,_,s,6,a[48]),_=h(_,C,w,R,m,10,a[49]),R=h(R,_,C,w,S,15,a[50]),w=h(w,R,_,C,y,21,a[51]),C=h(C,w,R,_,k,6,a[52]),_=h(_,C,w,R,p,10,a[53]),R=h(R,_,C,w,b,15,a[54]),w=h(w,R,_,C,u,21,a[55]),C=h(C,w,R,_,A,6,a[56]),_=h(_,C,w,R,T,10,a[57]),R=h(R,_,C,w,v,15,a[58]),w=h(w,R,_,C,O,21,a[59]),C=h(C,w,R,_,g,6,a[60]),_=h(_,C,w,R,E,10,a[61]),R=h(R,_,C,w,d,15,a[62]),w=h(w,R,_,C,I,21,a[63]),o[0]=o[0]+C|0,o[1]=o[1]+w|0,o[2]=o[2]+R|0,o[3]=o[3]+_|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,u=a.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+i+s;return(a<<o|a>>>32-o)+t}function l(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,n,r,i,o,s){var a=e+(t^n^r)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+i+s;return(a<<o|a>>>32-o)+t}n.MD5=o._createHelper(u),n.HmacMD5=o._createHmacHelper(u)}(Math),e.MD5));var e}var ti,ni={exports:{}},ri={exports:{}};function ii(){return ti?ri.exports:(ti=1,ri.exports=(a=Wr(),t=(e=a).lib,n=t.WordArray,r=t.Hasher,i=e.algo,o=[],s=i.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],u=n[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var l=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=l<<1|l>>>31}var f=(r<<5|r>>>27)+u+o[c];f+=c<20?1518500249+(i&s|~i&a):c<40?1859775393+(i^s^a):c<60?(i&s|i&a|s&a)-1894007588:(i^s^a)-899497514,u=a,a=s,s=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=r._createHelper(s),e.HmacSHA1=r._createHmacHelper(s),a.SHA1));var e,t,n,r,i,o,s,a}var oi,si,ai={exports:{}};function ui(){return si?ni.exports:(si=1,ni.exports=function(e){return n=(t=e).lib,r=n.Base,i=n.WordArray,o=t.algo,s=o.MD5,a=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),s=i.create(),a=s.words,u=r.keySize,c=r.iterations;a.length<u;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var l=1;l<c;l++)n=o.finalize(n),o.reset();s.concat(n)}return s.sigBytes=4*u,s}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},e.EvpKDF;var t,n,r,i,o,s,a}(Wr(),ii(),oi||(oi=1,ai.exports=(e=Wr(),void function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,u=s.words,c=0;c<n;c++)a[c]^=1549556828,u[c]^=909522486;o.sigBytes=s.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()))));var e}var ci,li,fi={exports:{}};var hi=h(Qr.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],o=[],s=[],a=[],u=[],c=[],l=[],f=[],h=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,i[n]=p,o[p]=n;var g=e[n],y=e[g],v=e[y],m=257*e[p]^16843008*p;s[n]=m<<24|m>>>8,a[n]=m<<16|m>>>16,u[n]=m<<8|m>>>24,c[n]=m,m=16843009*v^65537*y^257*g^16843008*n,l[p]=m<<24|m>>>8,f[p]=m<<16|m>>>16,h[p]=m<<8|m>>>24,d[p]=m,n?(n=g^e[e[e[v^g]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<n?o[s]=t[s]:(c=o[s-1],s%n?n>6&&s%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[s/n|0]<<24),o[s]=o[s-n]^c);for(var a=this._invKeySchedule=[],u=0;u<r;u++){if(s=r-u,u%4)var c=o[s];else c=o[s-4];a[u]=u<4||s<=4?c:l[i[c>>>24]]^f[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,h,d,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,s,a){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p<u;p++){var g=r[c>>>24]^i[l>>>16&255]^o[f>>>8&255]^s[255&h]^n[d++],y=r[l>>>24]^i[f>>>16&255]^o[h>>>8&255]^s[255&c]^n[d++],v=r[f>>>24]^i[h>>>16&255]^o[c>>>8&255]^s[255&l]^n[d++],m=r[h>>>24]^i[c>>>16&255]^o[l>>>8&255]^s[255&f]^n[d++];c=g,l=y,f=v,h=m}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^n[d++],y=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&c])^n[d++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[d++],m=(a[h>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^n[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});t.AES=n._createHelper(g)}(),e.AES}(Wr(),Jr(),ei(),ui(),ci||(ci=1,fi.exports=(li=Wr(),ui(),void(li.lib.Cipher||function(e){var t=li,n=t.lib,r=n.Base,i=n.WordArray,o=n.BufferedBlockAlgorithm,s=t.enc;s.Utf8;var a=s.Base64,u=t.algo.EvpKDF,c=n.Cipher=o.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?m:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});n.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},f=n.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=l.CBC=function(){var t=f.extend();function n(t,n,r){var i,o=this._iv;o?(i=o,this._iv=e):i=this._prevBlock;for(var s=0;s<r;s++)t[n+s]^=i[s]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=o}}),t}(),d=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,o=r<<24|r<<16|r<<8|r,s=[],a=0;a<r;a+=4)s.push(o);var u=i.create(s,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:h,padding:d}),reset:function(){var e;c.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var p=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(a)},parse:function(e){var t,n=a.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=i.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),p.create({ciphertext:n,salt:t})}},y=n.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),s=i.cfg;return p.create({ciphertext:o,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=i.random(8));var o=u.create({keySize:t+n}).compute(e,r),s=i.create(o.words.slice(t),4*n);return o.sigBytes=4*t,p.create({key:o,iv:s,salt:r})}},m=n.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:v}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=y.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()))))),di={exports:{}},pi=h(di.exports=function(e){return e.enc.Utf8}(Wr())),gi="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function yi(){throw new Error("setTimeout has not been defined")}function vi(){throw new Error("clearTimeout has not been defined")}var mi=yi,Ai=vi;function Ii(e){if(mi===setTimeout)return setTimeout(e,0);if((mi===yi||!mi)&&setTimeout)return mi=setTimeout,setTimeout(e,0);try{return mi(e,0)}catch(t){try{return mi.call(null,e,0)}catch(t){return mi.call(this,e,0)}}}"function"==typeof gi.setTimeout&&(mi=setTimeout),"function"==typeof gi.clearTimeout&&(Ai=clearTimeout);var bi,Ei=[],ki=!1,Oi=-1;function Si(){ki&&bi&&(ki=!1,bi.length?Ei=bi.concat(Ei):Oi=-1,Ei.length&&Ti())}function Ti(){if(!ki){var e=Ii(Si);ki=!0;for(var t=Ei.length;t;){for(bi=Ei,Ei=[];++Oi<t;)bi&&bi[Oi].run();Oi=-1,t=Ei.length}bi=null,ki=!1,function(e){if(Ai===clearTimeout)return clearTimeout(e);if((Ai===vi||!Ai)&&clearTimeout)return Ai=clearTimeout,clearTimeout(e);try{Ai(e)}catch(t){try{return Ai.call(null,e)}catch(t){return Ai.call(this,e)}}}(e)}}function Ci(e,t){this.fun=e,this.array=t}Ci.prototype.run=function(){this.fun.apply(null,this.array)};function wi(){}var Ri=wi,_i=wi,Pi=wi,Di=wi,Li=wi,Mi=wi,xi=wi;var Ni=gi.performance||{},Bi=Ni.now||Ni.mozNow||Ni.msNow||Ni.oNow||Ni.webkitNow||function(){return(new Date).getTime()};var Gi=new Date;var Ui,ji,Fi={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei.push(new Ci(e,t)),1!==Ei.length||ki||Ii(Ti)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ri,addListener:_i,once:Pi,off:Di,removeListener:Li,removeAllListeners:Mi,emit:xi,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Bi.call(Ni),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Gi)/1e3}},Ki={exports:{}};function Hi(){if(ji)return Ui;ji=1;var e=1e3,t=60*e,r=60*t,i=24*r,o=7*i,s=365.25*i;function a(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return Ui=function(u,c){c=c||{};var l=n(u);if("string"===l&&u.length>0)return function(n){if((n=String(n)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*t;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(u);if("number"===l&&isFinite(u))return c.long?function(n){var o=Math.abs(n);if(o>=i)return a(n,o,i,"day");if(o>=r)return a(n,o,r,"hour");if(o>=t)return a(n,o,t,"minute");if(o>=e)return a(n,o,e,"second");return n+" ms"}(u):function(n){var o=Math.abs(n);if(o>=i)return Math.round(n/i)+"d";if(o>=r)return Math.round(n/r)+"h";if(o>=t)return Math.round(n/t)+"m";if(o>=e)return Math.round(n/e)+"s";return n+"ms"}(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))},Ui}var Qi,zi,qi,Vi=function(e){function t(e){var r,i,o,s=null;function a(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(a.enabled){var o=a,s=Number(new Date),u=s-(r||s);o.diff=u,o.prev=r,o.curr=s,r=s,n[0]=t.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var c=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(e,r){if("%%"===e)return"%";c++;var i=t.formatters[r];if("function"==typeof i){var s=n[c];e=i.call(o,s),n.splice(c,1),c--}return e})),t.formatArgs.call(o,n);var l=o.log||t.log;l.apply(o,n)}}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o)},set:function(e){s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){var r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){var e=[].concat(u(t.names.map(r)),u(t.skips.map(r).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){var n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Hi(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(n){t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};Qi=Ki,(zi=Ki.exports).formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Qi.exports.humanize(this.diff),this.useColors){var t="color: "+this.color;e.splice(1,0,t,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,t)}},zi.save=function(e){try{e?zi.storage.setItem("debug",e):zi.storage.removeItem("debug")}catch(e){}},zi.load=function(){var e;try{e=zi.storage.getItem("debug")}catch(e){}return!e&&void 0!==Fi&&"env"in Fi&&(e=Fi.env.DEBUG),e},zi.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},zi.storage=function(){try{return localStorage}catch(e){}}(),zi.destroy=(qi=!1,function(){qi||(qi=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),zi.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],zi.log=console.debug||console.log||function(){},Qi.exports=Vi(zi),Qi.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}};var Wi=Ki.exports,Yi=Wi("cookie");function Xi(e,t,n){n=n||{};var r=Zi(e)+"="+Zi(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.samesite&&(r+="; samesite="+n.samesite),n.secure&&(r+="; secure"),document.cookie=r}function Ji(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i<r.length;++i)n[eo((t=r[i].split("="))[0])]=eo(t[1]);return n}(e)}function $i(e){return Ji()[e]}function Zi(e){try{return encodeURIComponent(e)}catch(t){Yi("error `encode(%o)` - %o",e,t)}}function eo(e){try{return decodeURIComponent(e)}catch(t){Yi("error `decode(%o)` - %o",e,t)}}var to=h((function(e,t,n){switch(arguments.length){case 3:case 2:return Xi(e,t,n);case 1:return $i(e);default:return Ji()}})),no={exports:{}},ro=Math.max,io=function(e,t){var n=t?t.length:0;if(!n)return[];for(var r=ro(Number(e)||0,0),i=ro(n-r,0),o=new Array(i),s=0;s<i;s+=1)o[s]=t[s+r];return o},oo=Math.max,so=function(e){if(null==e||!e.length)return[];for(var t=new Array(oo(e.length-2,0)),n=1;n<e.length;n+=1)t[n-1]=e[n];return t},ao=io,uo=so,co=Object.prototype.hasOwnProperty,lo=Object.prototype.toString,fo=function(e){return Boolean(e)&&"object"===n(e)},ho=function(e){return Boolean(e)&&"[object Object]"===lo.call(e)},po=function(e,t,n,r){return co.call(t,r)&&void 0===e[r]&&(e[r]=n),t},go=function(e,t,n,r){return co.call(t,r)&&(ho(e[r])&&ho(n)?e[r]=vo(e[r],n):void 0===e[r]&&(e[r]=n)),t},yo=function(e,t){if(!fo(t))return t;e=e||po;for(var n=ao(2,arguments),r=0;r<n.length;r+=1)for(var i in n[r])e(t,n[r],n[r][i],i);return t},vo=function(e){return yo.apply(null,[go,e].concat(uo(arguments)))};no.exports=function(e){return yo.apply(null,[null,e].concat(uo(arguments)))},no.exports.deep=vo;var mo=h(no.exports),Ao={exports:{}},Io=Wi("cookie"),bo=function(e,t,n){switch(arguments.length){case 3:case 2:return Eo(e,t,n);case 1:return Oo(e);default:return ko()}};function Eo(e,t,n){n=n||{};var r=So(e)+"="+So(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.secure&&(r+="; secure"),document.cookie=r}function ko(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i<r.length;++i)n[To((t=r[i].split("="))[0])]=To(t[1]);return n}(e)}function Oo(e){return ko()[e]}function So(e){try{return encodeURIComponent(e)}catch(t){Io("error `encode(%o)` - %o",e,t)}}function To(e){try{return decodeURIComponent(e)}catch(t){Io("error `decode(%o)` - %o",e,t)}}!function(e,t){var n=bo;function r(e){for(var n=t.cookie,r=t.levels(e),i=0;i<r.length;++i){var o="__tld__",s=r[i],a={domain:"."+s};if(n(o,1,a),n(o))return n(o,null,a),s}return""}r.levels=function(e){var t,n,r=("function"!=typeof window.URL?(t=e,(n=document.createElement("a")).href=t,n.hostname):new URL(e).hostname).split("."),i=r[r.length-1],o=[];if(4===r.length&&i===parseInt(i,10))return o;if(r.length<=1)return o;for(var s=r.length-2;s>=0;--s)o.push(r.slice(s).join("."));return o},r.cookie=n,t=e.exports=r}(Ao,Ao.exports);var Co=h(Ao.exports),wo=new(function(){function e(t){r(this,e),this.cOpts={},this.options(t),this.isSupportAvailable=this.checkSupportAvailability()}return o(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this.cOpts;var t=".".concat(Co(window.location.href));return"."===t&&(t=null),this.cOpts=mo(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),this.cOpts}},{key:"set",value:function(e,t){try{return to(e,t,T(this.cOpts)),!0}catch(e){return ct.error(e),!1}}},{key:"get",value:function(e){return to(e)}},{key:"remove",value:function(e){try{return to(e,null,T(this.cOpts)),!0}catch(e){return!1}}},{key:"checkSupportAvailability",value:function(){var e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}]),e}())({}),Ro={exports:{}},_o=h(Ro.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(t){return e}}function r(e){return"[object Function]"==={}.toString.call(e)}function i(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(t){var r={_data:{},setItem:function(e,t){return r._data[e]=String(t)},getItem:function(e){return r._data.hasOwnProperty(e)?r._data[e]:void 0},removeItem:function(e){return delete r._data[e]},clear:function(){return r._data={}}};e=r}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var s=o();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))s.setItem(n,t(r));else if(e(n))for(var i in n)this.set(i,n[i]);return this},get:function(e){if(!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 r=arguments;if(r.length>1){for(var i={},o=0,a=r.length;o<a;o++){var u=n(s.getItem(r[o]));this.has(r[o])&&(i[r[o]]=u)}return i}return n(s.getItem(e))},clear:function(){return s.clear(),this},remove:function(e){var t=this.get(e);return s.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=s.length;t<n;t++){var r=s.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,i=t.length;r<i;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n}};var u=null;function c(t,n){var o=arguments,s=null;if(u||(u=a()),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&&r(n)&&(s=null,s=n(t,u.get(t)),c.set(t,s))}if(2===o.length&&i(t)&&r(n))for(var l=0,f=t.length;l<f;l++)s=n(t[l],u.get(t[l])),c.set(t[l],s);return c}for(var l in a.prototype)c[l]=a.prototype[l];return c}()),Po=new(function(){function e(t){r(this,e),this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(t)}return o(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===arguments.length||(mo(e,{enabled:!0}),this.enabled=e.enabled&&this.enabled,this.sOpts=e),this.sOpts}},{key:"set",value:function(e,t){return _o.set(e,t)}},{key:"get",value:function(e){return _o.get(e)}},{key:"remove",value:function(e){return _o.remove(e)}},{key:"checkSupportAvailability",value:function(){var e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}]),e}())({}),Do=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},Lo="rl_user_id",Mo="rl_trait",xo="rl_anonymous_id",No="rl_group_id",Bo="rl_group_trait",Go="rl_page_init_referrer",Uo="rl_page_init_referring_domain",jo="rl_session",Fo="rl_auth_token",Ko="RudderEncrypt:",Ho="RS_ENC_v3_",Qo="Rudder",zo={segment:"ajs_anonymous_id"};function qo(e){try{return e?JSON.parse(e):null}catch(t){return ct.error(t),e||null}}function Vo(e){return e.replace(/^\s+|\s+$/gm,"")}function Wo(e){return e&&"string"==typeof e&&""!==Vo(e)?e.substring(0,Ko.length)===Ko?hi.decrypt(e.substring(Ko.length),Qo).toString(pi):e.substring(0,Ho.length)===Ho?Do(e.substring(Ho.length)):e:e}var Yo=function(){function e(){r(this,e),wo.isSupportAvailable?this.storage=wo:(Po.enabled&&(this.storage=Po),this.storage||ct.error("No storage is available :: initializing the SDK without storage"))}return o(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.storage.options(e)}},{key:"setItem",value:function(e,t){this.storage.set(e,function(e){return""===Vo(e)?e:"".concat(Ko).concat(hi.encrypt(e,Qo).toString())}(function(e){return JSON.stringify(e)}(t)))}},{key:"setStringItem",value:function(e,t){"string"==typeof t?this.setItem(e,t):ct.error("[Storage] ".concat(e," should be string"))}},{key:"setUserId",value:function(e){this.setStringItem(Lo,e)}},{key:"setUserTraits",value:function(e){this.setItem(Mo,e)}},{key:"setGroupId",value:function(e){this.setStringItem(No,e)}},{key:"setGroupTraits",value:function(e){this.setItem(Bo,e)}},{key:"setAnonymousId",value:function(e){this.setStringItem(xo,e)}},{key:"setInitialReferrer",value:function(e){this.setItem(Go,e)}},{key:"setInitialReferringDomain",value:function(e){this.setItem(Uo,e)}},{key:"setSessionInfo",value:function(e){this.setItem(jo,e)}},{key:"setAuthToken",value:function(e){this.setItem(Fo,e)}},{key:"getItem",value:function(e){return qo(Wo(this.storage.get(e)))}},{key:"getUserId",value:function(){return this.getItem(Lo)}},{key:"getUserTraits",value:function(){return this.getItem(Mo)}},{key:"getGroupId",value:function(){return this.getItem(No)}},{key:"getGroupTraits",value:function(){return this.getItem(Bo)}},{key:"fetchExternalAnonymousId",value:function(e){var t,n=e.toLowerCase();return Object.keys(zo).includes(n)&&"segment"===n?(Po.enabled&&(t=Po.get(zo[n])),!t&&wo.isSupportAvailable&&(t=wo.get(zo[n])),t):t}},{key:"getAnonymousId",value:function(e){var t=qo(Wo(this.storage.get(xo)));if(t)return t;var n=N(e,"autoCapture.source");if(!0===N(e,"autoCapture.enabled")&&"string"==typeof n){var r=this.fetchExternalAnonymousId(n);if(r)return r}return t}},{key:"getInitialReferrer",value:function(){return this.getItem(Go)}},{key:"getInitialReferringDomain",value:function(){return this.getItem(Uo)}},{key:"getSessionInfo",value:function(){return this.getItem(jo)}},{key:"getAuthToken",value:function(){return this.getItem(Fo)}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"removeSessionInfo",value:function(){this.removeItem(jo)}},{key:"clear",value:function(e){this.storage.remove(Lo),this.storage.remove(Mo),this.storage.remove(No),this.storage.remove(Bo),this.storage.remove(Fo),e&&this.storage.remove(xo)}}]),e}(),Xo=new Yo;function Jo(){return document.referrer||"$direct"}function $o(e){var t=e.split("/");return t.length>=3?t[2]:""}function Zo(){for(var e=document.getElementsByTagName("link"),t=0;e[t];t+=1){var n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function es(){var e=Zo(),t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}var n=window.location,r=n.search,i=n.href,o=document.title,s=function(e){var t,n=Zo(),r=(t=n?n.includes("?")?n:n+e:window.location.href).indexOf("#");return r>-1?t.slice(0,r):t}(r),a=i,u=Jo();return{path:t,referrer:u,referring_domain:$o(u),search:r,title:o,url:s,tab_url:a,initial_referrer:Xo.getInitialReferrer()||"",initial_referring_domain:Xo.getInitialReferringDomain()||""}}for(var ts,ns=o((function e(){r(this,e),this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.40.5"})),rs=o((function e(){r(this,e),this.name="RudderLabs JavaScript SDK",this.version="2.40.5"})),is=o((function e(){r(this,e),this.name="",this.version=""})),os=o((function e(){r(this,e),this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0})),ss=o((function e(){var t;r(this,e),this.app=new ns,this.traits=null,this.library=new rs,this.userAgent=function(){if("undefined"==typeof navigator)return null;var e=navigator.userAgent,t=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}(),this.device=null,this.network=null,this.os=new is,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(t=new os,"undefined"==typeof window||(t.width=window.screen.width,t.height=window.screen.height,t.density=window.devicePixelRatio,t.innerWidth=window.innerWidth,t.innerHeight=window.innerHeight),t)})),as=function(){function e(){r(this,e),this.channel="web",this.context=new ss,this.type=null,this.messageId=Mr(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}}return o(e,[{key:"getProperty",value:function(e){return this.properties[e]}},{key:"addProperty",value:function(e,t){this.properties[e]=t}}]),e}(),us=function(){function e(){r(this,e),this.message=new as}return o(e,[{key:"setType",value:function(e){this.message.type=e}},{key:"setProperty",value:function(e){this.message.properties=e}},{key:"setUserProperty",value:function(e){this.message.user_properties=e}},{key:"setUserId",value:function(e){this.message.userId=e}},{key:"setEventName",value:function(e){this.message.event=e}},{key:"getElementContent",value:function(){return this.message}}]),e}(),cs=function(){function e(){r(this,e),this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null}return o(e,[{key:"setType",value:function(e){return this.type=e,this}},{key:"build",value:function(){var e=new us;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}]),e}(),ls={},fs=256,hs=[];fs--;)hs[fs]=(fs+256).toString(16).substring(1);ls.v4=function(){var e,t=0,n="";if(!ts||fs+16>256){for(ts=Array(t=256);t--;)ts[t]=256*Math.random()|0;t=fs=0}for(;t<16;t++)e=ts[fs+t],n+=6==t?hs[15&e|64]:8==t?hs[63&e|128]:hs[e],1&t&&t>1&&t<11&&(n+="-");return fs++,n};var ds={},ps=Object.prototype.hasOwnProperty,gs=String.prototype.charAt,ys=Object.prototype.toString,vs=function(e,t){return gs.call(e,t)},ms=function(e,t){return ps.call(e,t)},As=function(e,t){t=t||ms;for(var n=[],r=0,i=e.length;r<i;r+=1)t(e,r)&&n.push(String(r));return n},Is=function(e){return null==e?[]:(t=e,"[object String]"===ys.call(t)?As(e,vs):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?As(e,ms):function(e,t){t=t||ms;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t},bs=Is,Es=ls.v4,ks={_data:{},length:0,setItem:function(e,t){return this._data[e]=t,this.length=bs(this._data).length,t},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(e){return e in this._data&&delete this._data[e],this.length=bs(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(e){return bs(this._data)[e]}};ds.defaultEngine=function(){try{if(!window.localStorage)return!1;var e=Es();window.localStorage.setItem(e,"test_value");var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===t}catch(e){return!1}}()?window.localStorage:ks,ds.inMemoryEngine=ks;var Os=Is,Ss=Object.prototype.toString,Ts="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Ss.call(e)},Cs=function(e){return null!=e&&(Ts(e)||"function"!==e&&function(e){var t=n(e);return"number"===t||"object"===t&&"[object Number]"===Ss.call(e)}(e.length))},ws=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},Rs=function(e,t){for(var n=Os(t),r=0;r<n.length&&!1!==e(t[n[r]],n[r],t);r+=1);},_s=function(e,t){return(Cs(t)?ws:Rs).call(this,e,t)},Ps=ds.defaultEngine,Ds=ds.inMemoryEngine,Ls=_s,Ms=Is,xs=JSON;function Ns(e,t,n,r){this.id=t,this.name=e,this.keys=n||{},this.engine=r||Ps,this.originalEngine=this.engine}Ns.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,xs.stringify(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},Ns.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:xs.parse(t)}catch(e){return null}},Ns.prototype.getOriginalEngine=function(){return this.originalEngine},Ns.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},Ns.prototype._createValidKey=function(e){var t,n=this.name,r=this.id;return Ms(this.keys).length?(Ls((function(i){i===e&&(t=[n,r,e].join("."))}),this.keys),t):[n,r,e].join(".")},Ns.prototype._swapEngine=function(){var e=this;Ls((function(t){var n=e.get(t);Ds.setItem([e.name,e.id,t].join("."),n),e.remove(t)}),this.keys),this.engine=Ds};var Bs=Ns;var Gs=_s,Us={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},js=Us,Fs={ASAP:1,RESCHEDULE:2,ABANDON:3};function Ks(){this.tasks={},this.nextId=1}Ks.prototype.now=function(){return+new js.Date},Ks.prototype.run=function(e,t,n){var r=this.nextId++;return this.tasks[r]=js.setTimeout(this._handle(r,e,t,n||Fs.ASAP),t),r},Ks.prototype.cancel=function(e){this.tasks[e]&&(js.clearTimeout(this.tasks[e]),delete this.tasks[e])},Ks.prototype.cancelAll=function(){Gs(js.clearTimeout,this.tasks),this.tasks={}},Ks.prototype._handle=function(e,t,n,r){var i=this,o=i.now();return function(){if(delete i.tasks[e],!(r>=Fs.RESCHEDULE&&o+2*n<i.now()))return t();r===Fs.RESCHEDULE&&i.run(t,n,r)}},Ks.setClock=function(e){js=e},Ks.resetClock=function(){js=Us},Ks.Modes=Fs;var Hs=Ks,Qs=ls.v4,zs=Bs,qs=_s,Vs=Hs,Ws=Wi("localstorage-retry");function Ys(e,t){return function(){return e.apply(t,arguments)}}function Xs(e,t,n){"function"==typeof t&&(n=t),this.name=e,this.id=Qs(),this.fn=n,this.maxItems=t.maxItems||1/0,this.maxAttempts=t.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:t.minRetryDelay||1e3,MAX_RETRY_DELAY:t.maxRetryDelay||3e4,FACTOR:t.backoffFactor||2,JITTER:t.backoffJitter||0},this.timeouts={ACK_TIMER:1e3,RECLAIM_TIMER:3e3,RECLAIM_TIMEOUT:1e4,RECLAIM_WAIT:500},this.keys={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack"},this._schedule=new Vs,this._processId=0,this._store=new zs(this.name,this.id,this.keys),this._store.set(this.keys.IN_PROGRESS,{}),this._store.set(this.keys.QUEUE,[]),this._ack=Ys(this._ack,this),this._checkReclaim=Ys(this._checkReclaim,this),this._processHead=Ys(this._processHead,this),this._running=!1}g(Xs.prototype),Xs.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},Xs.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},Xs.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},Xs.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},Xs.prototype.addItem=function(e){this._enqueue({item:e,attemptNumber:0,time:this._schedule.now(),id:Qs()})},Xs.prototype.requeue=function(e,t,n,r){this.shouldRetry(e,t,n)?this._enqueue({item:e,attemptNumber:t,time:this._schedule.now()+this.getDelay(t),id:r||Qs()}):this.emit("discard",e,t)},Xs.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},Xs.prototype._processHead=function(){var e=this,t=this._store;this._schedule.cancel(this._processId);var n=t.get(this.keys.QUEUE)||[],r=t.get(this.keys.IN_PROGRESS)||{},i=this._schedule.now(),o=[];function s(n,r){o.push({item:n.item,done:function(i,o){var s=t.get(e.keys.IN_PROGRESS)||{};delete s[r],t.set(e.keys.IN_PROGRESS,s),e.emit("processed",i,o,n.item),i&&e.requeue(n.item,n.attemptNumber+1,i,n.id)}})}for(var a=Object.keys(r).length;n.length&&n[0].time<=i&&a++<e.maxItems;){var u=n.shift(),c=Qs();r[c]={item:u.item,attemptNumber:u.attemptNumber,time:e._schedule.now()},s(u,c)}t.set(this.keys.QUEUE,n),t.set(this.keys.IN_PROGRESS,r),qs((function(t){try{e.fn(t.item,t.done)}catch(e){Ws("Process function threw error: "+e)}}),o),n=t.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),n.length>0&&(this._processId=this._schedule.run(this._processHead,n[0].time-i,Vs.Modes.ASAP))},Xs.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER,Vs.Modes.ASAP)},Xs.prototype._checkReclaim=function(){var e=this;qs((function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)<e.timeouts.RECLAIM_TIMEOUT||function(t){t.set(e.keys.RECLAIM_START,e.id),t.set(e.keys.ACK,e._schedule.now()),e._schedule.run((function(){t.get(e.keys.RECLAIM_START)===e.id&&(t.set(e.keys.RECLAIM_END,e.id),e._schedule.run((function(){t.get(e.keys.RECLAIM_END)===e.id&&t.get(e.keys.RECLAIM_START)===e.id&&e._reclaim(t.id)}),e.timeouts.RECLAIM_WAIT,Vs.Modes.ABANDON))}),e.timeouts.RECLAIM_WAIT,Vs.Modes.ABANDON)}(t))}),function(t){for(var n=[],r=e._store.getOriginalEngine(),i=0;i<r.length;i++){var o=r.key(i);if(null!==o){var s=o.split(".");3===s.length&&s[0]===t&&"ack"===s[2]&&n.push(new zs(t,s[1],e.keys))}}return n}(this.name)),this._schedule.run(this._checkReclaim,this.timeouts.RECLAIM_TIMER,Vs.Modes.RESCHEDULE)},Xs.prototype._reclaim=function(e){var t=this,n=new zs(this.name,e,this.keys),r={queue:this._store.get(this.keys.QUEUE)||[]},i={inProgress:n.get(this.keys.IN_PROGRESS)||{},queue:n.get(this.keys.QUEUE)||[]},o=[],s=function(e,n){qs((function(e){var i=e.id||Qs();o.indexOf(i)>=0?t.emit("duplication",e.item,e.attemptNumber):(r.queue.push({item:e.item,attemptNumber:e.attemptNumber+n,time:t._schedule.now(),id:i}),o.push(i))}),e)};s(i.queue,0),s(i.inProgress,1),r.queue=r.queue.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,r.queue);try{this._clearOtherQueue(n,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(n,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},Xs.prototype._clearOtherQueue=function(e,t){var n=this;setTimeout((function(){e.remove(n.keys.IN_PROGRESS),setTimeout((function(){e.remove(n.keys.QUEUE),setTimeout((function(){e.remove(n.keys.RECLAIM_START),setTimeout((function(){e.remove(n.keys.RECLAIM_END),setTimeout((function(){e.remove(n.keys.ACK)}),t)}),t)}),t)}),t)}),t)};var Js=h(Xs),$s={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100},Zs=function(){function e(){r(this,e),this.url="",this.writeKey=""}return o(e,[{key:"init",value:function(e,t,n){var r=this;this.url=t,this.writeKey=e,n&&a($s,n),this.payloadQueue=new Js("rudder",$s,(function(e,t){e.message.sentAt=xr(),r.processQueueElement(e.url,e.headers,e.message,1e4,(function(e,n){if(e)return t(e);t(null,n)}))})),this.payloadQueue.start()}},{key:"processQueueElement",value:function(e,t,n,r,i){try{var o=new XMLHttpRequest;for(var s in o.open("POST",e,!0),t)o.setRequestHeader(s,t[s]);o.timeout=r,o.ontimeout=i,o.onerror=i,o.onreadystatechange=function(){if(4===o.readyState)if(429===o.status||o.status>=500&&o.status<600){var t="".concat("Request failed with status:",' "').concat(o.status,'" status text: "').concat(o.statusText,'" for URL: "').concat(e,'"'),n=new Error(t);Dr(n),i(n)}else i(null,o.status)},o.send(Rr(n,!0))}catch(e){i(e)}}},{key:"enqueue",value:function(e,t){var n={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(this.writeKey,":"))),AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:"".concat(this.url,"/v1/").concat(t),headers:n,message:e})}}]),e}(),ea="queue",ta=64e3,na=function(){function e(){r(this,e),this.storage=Po,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName="".concat(ea,".").concat(Date.now())}return o(e,[{key:"sendQueueDataForBeacon",value:function(){this.sendDataFromQueueAndDestroyQueue()}},{key:"init",value:function(e,t,n){this.url=t,this.writekey=e,n.maxItems&&(this.maxItems=n.maxItems),n.flushQueueInterval&&(this.flushQueueTimeOutInterval=n.flushQueueInterval),this.sendQueueDataForBeacon=this.sendQueueDataForBeacon.bind(this),this.attachListeners()}},{key:"attachListeners",value:function(){var e=this;window.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.sendQueueDataForBeacon()}))}},{key:"getQueue",value:function(){return this.storage.get(this.queueName)}},{key:"setQueue",value:function(e){this.storage.set(this.queueName,e)}},{key:"enqueue",value:function(e){var t=this.getQueue()||[];(t=t.slice(-(this.maxItems-1))).push(e);var n=t.slice(0);Rr({batch:n},!0).length>ta&&(n=t.slice(0,t.length-1),this.flushQueue(n),(t=this.getQueue()).push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}},{key:"sendDataFromQueueAndDestroyQueue",value:function(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}},{key:"sendDataFromQueue",value:function(){var e=this.getQueue();if(e&&e.length>0){var t=e.slice(0,e.length);this.flushQueue(t)}}},{key:"flushQueue",value:function(e){if(e&&e.length>0){e.forEach((function(e){e.sentAt=(new Date).toISOString()}));var t=Rr({batch:e},!0),n=new Blob([t],{type:"text/plain"}),r="".concat(this.url,"?writeKey=").concat(this.writekey);try{"function"!=typeof navigator.sendBeacon&&Dr(new Error("Beacon API is not supported by browser")),navigator.sendBeacon(r,n)||Dr(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message="".concat(e.message," - While sending Beacon data to: ").concat(r),Dr(e)}}this.setQueue([]),this.clearTimer()}},{key:"setTimer",value:function(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}},{key:"clearTimer",value:function(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}]),e}(),ra=function(){function e(){r(this,e),this.queue=void 0}return o(e,[{key:"initialize",value:function(e,t,r){var i={},o=Lr(t);r&&r.useBeacon&&navigator.sendBeacon?(r.beaconQueueOptions&&null!=r.beaconQueueOptions&&"object"===n(r.beaconQueueOptions)&&(i=r.beaconQueueOptions),o="".concat(o,"/beacon/v1/batch"),this.queue=new na):(r&&r.useBeacon&&ct.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),r&&r.queueOptions&&null!=r.queueOptions&&"object"===n(r.queueOptions)&&(i=r.queueOptions),this.queue=new Zs),this.queue.init(e,o,i)}},{key:"enqueue",value:function(e,t){var n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||xr(),n.sentAt=xr(),Rr(n,!0).length>32e3&&ct.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}}]),e}(),ia=new ra,oa={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0},sa=function(){function e(){r(this,e),this.callback=void 0,this.processQueueElements=!1}return o(e,[{key:"init",value:function(e,t){var n=this;e&&a(oa,e),t&&(this.callback=t),this.payloadQueue=new Js("rs_events",oa,(function(e,t){n.processQueueElement(e.type,e.rudderElement,(function(e,n){if(e)return t(e);t(null,n)}))})),this.payloadQueue.start()}},{key:"activateProcessor",value:function(){this.processQueueElements=!0}},{key:"processQueueElement",value:function(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,us.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}},{key:"enqueue",value:function(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}]),e}(),aa=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r=document.getElementById(e);if(r)return;var i=document.createElement("script");i.src=t,i.async=void 0===n.async||n.async,i.type="text/javascript",i.id=e,!0!==n.skipDatasetAttributes&&(i.setAttribute("data-loader","RS_JS_SDK"),void 0!==n.isNonNativeSDK&&i.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));var o=document.getElementsByTagName("head");if(o.length>0)o[0].insertBefore(i,o[0].firstChild);else{var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(i,s)}}catch(s){Dr(s)}},ua=function(){return navigator&&navigator.language},ca=function(){return navigator&&navigator.userAgent};function la(e){return decodeURIComponent(atob(e).split("").map((function(e){return"%".concat("00".concat(e.charCodeAt(0).toString(16)).slice(-2))})).join(""))}function fa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return la(e=e.endsWith("..")?e.substr(0,e.length-2):e)}var ha=/^[a-zA-Z0-9\-_.]+$/;function da(e,t,n,r){var i=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join("*")}(n,r),o=t||0,s=function(e){for(var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),n=-1,r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([i,Math.floor(Date.now()/6e4)-o,e].join("*"));return s.toString(36)}function pa(e){var t=function(e){var t=e.split("*"),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join("*")}}(e);if(!t)return null;var n=t.checksum,r=t.serializedIds;return function(e,t){for(var n=ca(),r=ua(),i=0;i<=1;i+=1)if(da(e,i,n,r)===t)return!0;return!1}(r,n)?function(e){for(var t={},n=e.split("*"),r=0;r<n.length;r+=2){var i=n[r];if(ha.test(i)){var o=fa(n[r+1]);t[i]=o}}return t}(r):null}var ga={HS:"HubSpot",GA:"GA",HOTJAR:"Hotjar",GOOGLEADS:"GoogleAds",VWO:"VWO",GTM:"GoogleTagManager",BRAZE:"Braze",INTERCOM:"INTERCOM",KEEN:"Keen",KISSMETRICS:"Kissmetrics",CUSTOMERIO:"CustomerIO",CHARTBEAT:"Chartbeat",COMSCORE:"Comscore",FACEBOOK_PIXEL:"FacebookPixel",LOTAME:"Lotame",OPTIMIZELY:"Optimizely",BUGSNAG:"Bugsnag",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"GA4",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"Posthog",KLAVIYO:"Klaviyo",CLEVERTAP:"Clevertap",BINGADS:"BingAds",PINTEREST_TAG:"PinterestTag",ADOBE_ANALYTICS:"AdobeAnalytics",LINKEDIN_INSIGHT_TAG:"LinkedInInsightTag",REDDIT_PIXEL:"RedditPixel",DRIP:"Drip",HEAP:"Heap",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",PROFITWELL:"ProfitWell",SENTRY:"Sentry",QUANTUMMETRIC:"QuantumMetric",SNAP_PIXEL:"SnapPixel",POST_AFFILIATE_PRO:"PostAffiliatePro",GOOGLE_OPTIMIZE:"GoogleOptimize",LAUNCHDARKLY:"LaunchDarkly",GA360:"GA360",ADROLL:"Adroll",DCM_FLOODLIGHT:"DCMFloodlight",MATOMO:"Matomo",VERO:"Vero",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"QuoraPixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"YandexMetrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"MicrosoftClarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TiktokAds"},ya=function(){function e(){var t=this;if(r(this,e),this.isInitialized=!1,window.OneTrust&&window.OnetrustActiveGroups){this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter((function(e){return e}));var n=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],n.forEach((function(e){var n=e.CustomGroupId,r=e.GroupName;t.userSetConsentGroupIds.includes(n)?t.userSetConsentGroupNames.push(r.toUpperCase().trim()):t.userDeniedConsentGroupIds.push(n)})),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map((function(e){return e.toUpperCase()})),this.isInitialized=!0}else ct.error("OneTrust resources are not accessible.")}return o(e,[{key:"isEnabled",value:function(e){var t=this;try{if(!this.isInitialized)return!0;var n=e.oneTrustCookieCategories;if(!n)return!0;var r=n.map((function(e){return e.oneTrustCookieCategory})).filter((function(e){return e}));return r.every((function(e){return t.userSetConsentGroupIds.includes(e.toUpperCase().trim())||t.userSetConsentGroupNames.includes(e.toUpperCase().trim())}))}catch(e){return ct.error("Error during onetrust cookie consent management ".concat(e)),!0}}},{key:"getDeniedList",value:function(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}]),e}(),va=function(){function e(){var t=this;if(r(this,e),this.updatePurposes=function(e){e&&Object.entries(e).forEach((function(e){var n=e[0];e[1]?t.userConsentedPurposes.push(n):t.userDeniedPurposes.push(n)}))},this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=function(e){e&&(t.userConsentedPurposes=[],t.userDeniedPurposes=[],t.updatePurposes(e))},window.getKetchUserConsentedPurposes=function(){return t.userConsentedPurposes.slice()},window.getKetchUserDeniedPurposes=function(){return t.userDeniedPurposes.slice()},window.ketchConsent)this.updatePurposes(window.ketchConsent);else{var n=this.getConsent();this.updatePurposes(n)}}return o(e,[{key:"isEnabled",value:function(e){var t=this;try{var n=e.ketchConsentPurposes;if(!n||0===n.length)return!0;var r=n.map((function(e){return e.purpose})).filter((function(e){return e}));return r.some((function(e){return t.userConsentedPurposes.includes(e.trim())}))}catch(e){return ct.error("Error occured checking ketch consent state ".concat(e)),!0}}},{key:"getDeniedList",value:function(){return this.userDeniedPurposes}},{key:"getConsent",value:function(){var e=wo.get("_ketch_consent_v1_");if(e){var t;try{t=JSON.parse(atob(e))}catch(e){return void ct.error("Error occured while parsing consent cookie ".concat(e))}if(t){var n={};return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];r&&r.status&&(n[t]="granted"===r.status)})),n}}}}]),e}(),ma=function(e){var t,n;return null!=e&&null!==(t=e.oneTrust)&&void 0!==t&&t.enabled?new ya:null!=e&&null!==(n=e.ketch)&&void 0!==n&&n.enabled?new va:null},Aa=function(){function e(){r(this,e),this.storage=Xo,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}}return o(e,[{key:"initialize",value:function(e){try{var t;if(this.sessionInfo.autoTrack=!(!1===(null==e||null===(t=e.sessions)||void 0===t?void 0:t.autoTrack)||this.sessionInfo.manualTrack),null!=e&&e.sessions&&!isNaN(e.sessions.timeout)){var n=e.sessions.timeout;0===n&&(ct.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),n>0&&n<1e4&&ct.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=n}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){Dr(e)}}},{key:"isValidSession",value:function(e){return e<=this.sessionInfo.expiresAt}},{key:"generateSessionId",value:function(){return Date.now()}},{key:"startAutoTracking",value:function(){var e=Date.now();this.isValidSession(e)||(this.sessionInfo={},this.sessionInfo.id=e,this.sessionInfo.expiresAt=e+this.timeout,this.sessionInfo.sessionStart=!0,this.sessionInfo.autoTrack=!0),this.storage.setSessionInfo(this.sessionInfo)}},{key:"validateSessionId",value:function(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;ct.error('[Session]:: "sessionId" should at least be "'.concat(10,'" digits long'))}else ct.error('[Session]:: "sessionId" should only be a positive integer')}},{key:"start",value:function(e){var t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}},{key:"getSessionId",value:function(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}},{key:"end",value:function(){this.sessionInfo={},this.storage.removeSessionInfo()}},{key:"getSessionInfo",value:function(){var e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){var t=Date.now();this.isValidSession(t)?this.sessionInfo.expiresAt=t+this.timeout:this.startAutoTracking()}this.sessionInfo.sessionStart&&(e.sessionStart=!0,this.sessionInfo.sessionStart=!1),e.sessionId=this.sessionInfo.id,this.storage.setSessionInfo(this.sessionInfo)}return e}},{key:"reset",value:function(){var e=this.sessionInfo,t=e.manualTrack;e.autoTrack?(this.sessionInfo={},this.startAutoTracking()):t&&this.start()}}]),e}(),Ia=new Aa,ba=["integrations","anonymousId","originalTimestamp"],Ea=["Bugsnag","bugsnag"],ka="0d96a60df267f4a13f808bbaa54e535c",Oa=["rudder-analytics.min.js","rudder-analytics-staging.min.js","rudder-analytics.js"].concat(u(Object.keys(ga).map((function(e){return"".concat(ga[e],".min.js")}))),u(Object.keys(ga).map((function(e){return"".concat(ga[e],"-staging.min.js")}))),u(Object.keys(ga).map((function(e){return"".concat(ga[e],".js")})))),Sa=function(e){var t=e&&e._client&&e._client._notifier&&e._client._notifier.version;if(!t){var n=e({apiKey:ka,releaseStage:"version-test",beforeSend:function(){return!1}});t=n.notifier&&n.notifier.version,n=void 0}return t&&"6"===t.charAt(0)},Ta=function(e){Ea.every((function(e){return!function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}(window,e)}))&&aa(e,"https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js",{isNonNativeSDK:"true",skipDatasetAttributes:!0})},Ca=function(){function e(t,n){r(this,e),this.pluginName="rs-bugsnag",this.sourceId=t,this.onClientReady=n,this.initClientOnLibReadyInterval=void 0,this.init()}return o(e,[{key:"init",value:function(){var e=this;if(!window.RudderStackGlobals||!window.RudderStackGlobals.errorReporting){if(!ka.match(/{{.+}}/)){Ta(this.pluginName);var t=window.bugsnag;"function"!=typeof t?(this.initClientOnLibReadyInterval=setInterval((function(){var t=window.bugsnag;"function"==typeof t&&(Sa(t)&&e.initClient(),clearInterval(e.initClientOnLibReadyInterval))}),100),setTimeout((function(){clearInterval(e.initClientOnLibReadyInterval)}),1e4)):Sa(t)&&this.initClient()}}}},{key:"initClient",value:function(){var e,t=window.bugsnag;this.client=t({apiKey:ka,appVersion:"2.40.5",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:(e=window.location.hostname,e&&["www.rs-unit-test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production")}),this.onClientReady()}},{key:"onError",value:function(){var e=this.sourceId;return function(t){try{return!!function(e){var t=N(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;var n=t.substring(t.lastIndexOf("/")+1);return Oa.includes(n)}(t)&&(function(e,t){e.updateMetaData("source",{metadataSource:t});var n=e.errorMessage;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"}(t,e),!0)}catch(e){return!1}}}},{key:"notify",value:function(e){this.client&&this.client.notify(e)}},{key:"leaveBreadcrumb",value:function(e){this.client&&this.client.leaveBreadcrumb(e)}}]),e}(),wa=["rs-bugsnag"],Ra=function(){function e(t){r(this,e),this.isEnabled=!1,this.providerName="rs-bugsnag",this.provider=void 0,this.logger=t,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)}return o(e,[{key:"init",value:function(e,t){e&&t?!0===function(e){return N(e,"statsCollection.errors.enabled")||!1}(e)?(this.enable(),this.setProviderName(function(e){return N(e,"statsCollection.errors.provider")}(e)),this.initProvider(e,t)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}},{key:"setProviderName",value:function(e){e?!e||wa.includes(e)?this.providerName=e:this.logger.error("[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ".concat(wa.join(","))):this.providerName="rs-bugsnag"}},{key:"initProvider",value:function(e,t){if("rs-bugsnag"===this.providerName)this.provider=new Ca(t,this.onClientReady)}},{key:"onClientReady",value:function(){this.exposeToGlobal()}},{key:"exposeToGlobal",value:function(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals.errorReporting=this}},{key:"leaveBreadcrumb",value:function(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error("[Analytics] ErrorReporting :: leaveBreadcrumb method ".concat(e.toString()))}}},{key:"notify",value:function(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error("[Analytics] ErrorReporting :: notify method ".concat(e.toString()))}}}]),e}(),_a=new(function(){function e(){r(this,e),this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null}return o(e,[{key:"init",value:function(e,t,n){this.dataPlaneUrl=Lr(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}},{key:"enqueue",value:function(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}},{key:"sendEventForTransformation",value:function(e,t){var n=this;return new Promise((function(r,i){var o="".concat(n.dataPlaneUrl,"/transform"),s={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(n.writeKey,":")))};try{var a=new XMLHttpRequest;a.open("POST",o,!0),Object.keys(s).forEach((function(e){return a.setRequestHeader(e,s[e])})),a.timeout=1e4,a.onreadystatechange=function(){if(4===a.readyState)try{var o=a.status,s=a.response;switch(o){case 200:return s=JSON.parse(s),void r({status:o,transformedPayload:s.transformedBatch});case 400:var u=s?"".concat(s):"Invalid request payload";return void r({status:o,errorMessage:u});case 404:return void r({status:o});default:if(t>0){var c=t-1;setTimeout((function(){return n.sendEventForTransformation(e,c).then(r).catch(i)}),500*Math.pow(2,n.retryAttempt-c))}else r({status:o,errorMessage:"Retries exhausted"})}}catch(e){i(e)}},a.send(Rr(e,!0))}catch(e){i(e)}}))}},{key:"checkQueueLengthAndProcess",value:function(){this.queue.length>0&&this.process()}},{key:"process",value:function(){var e=this;this.isTransformationProcessing=!0;var t,n,r=this.queue.shift(),i=(t=r.event,n=r.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:n,event:t.message}]});this.sendEventForTransformation(i,this.retryAttempt).then((function(t){e.isTransformationProcessing=!1,r.cb(t),e.checkQueueLengthAndProcess()})).catch((function(t){Dr("string"==typeof t?t:t.message),e.isTransformationProcessing=!1,r.cb({status:0}),e.checkQueueLengthAndProcess()}))}},{key:"start",value:function(){var e=this;setInterval((function(){e.isTransformationProcessing||e.checkQueueLengthAndProcess()}),100)}},{key:"setAuthToken",value:function(e){this.authToken=e}}]),e}()),Pa=function(){function e(){r(this,e),this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=Xo,this.eventRepository=ia,this.preProcessQueue=new sa,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallbacks=[],this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1,this.loadIntegration=!0,this.bufferDataPlaneEventsUntilReady=!1,this.dataPlaneEventsBufferTimeout=1e4,this.integrationsData={},this.dynamicallyLoadedIntegrations={},this.destSDKBaseURL=mr,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=Ia,this.version="2.40.5",this.lockIntegrationsVersion=!1,this.errorReporting=new Ra(ct),this.deniedConsentIds=[],this.transformationHandler=_a}return o(e,[{key:"initializeUser",value:function(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits=this.storage.getUserTraits()||{},this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits=this.storage.getGroupTraits()||{},this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}},{key:"setInitialPageProperties",value:function(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){var e=Jo();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain($o(e))}}},{key:"allModulesInitialized",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(n){e.clientIntegrations.every((function(t){return null!=e.dynamicallyLoadedIntegrations["".concat(ga[t.name]).concat("_RS")]}))||t>=2e4?n(e):e.pause(1e3).then((function(){return e.allModulesInitialized(t+1e3).then(n)}))}))}},{key:"executeReadyCallback",value:function(){this.readyCallbacks.forEach((function(e){return e()}))}},{key:"integrationSDKLoaded",value:function(e,t){return window[e]&&window[e][t]&&window[e][t].prototype&&void 0!==window[e][t].prototype.constructor}},{key:"processResponse",value:function(e,t){var r=this;try{var i=t;try{if("string"==typeof t&&(i=JSON.parse(t)),!i||"object"!==n(i)||Array.isArray(i))return void ct.error("Invalid source configuration")}catch(e){return void Dr(e)}try{this.errorReporting.init(i.source.config,i.source.id)}catch(e){Dr(e)}if(this.serverUrl=Hr(i,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.loaded=!0,this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),this.options&&"function"==typeof this.options.onLoaded&&this.options.onLoaded(this),function(e){if(e.toBeProcessedArray.length>0)for(;e.toBeProcessedArray.length>0;){var t=u(e.toBeProcessedArray[0]);e.toBeProcessedArray.shift();var n=t[0];t.shift(),e[n].apply(e,u(t))}}(this),i.source.destinations.forEach((function(e){e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config,destinationInfo:{shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,destinationId:e.id}})}),this),this.clientIntegrations=Ur(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{var o=ma(this.cookieConsentOptions);this.deniedConsentIds=o&&o.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter((function(e){return!o||o&&o.isEnabled(e.config)}))}catch(e){Dr(e)}this.clientIntegrations=this.clientIntegrations.filter((function(e){return!!ga[e.name]||(ct.error("[Analytics] Integration:: ".concat(e.name," not available for initialization")),!1)}));var s="";jr().isStaging&&(s="-staging"),this.bufferDataPlaneEventsUntilReady&&setTimeout((function(){r.processBufferedCloudModeEvents()}),this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach((function(e){var t=ga[e.name],n="".concat(t).concat("_RS"),i="".concat(r.destSDKBaseURL,"/").concat(t).concat(s,".min.js");window.hasOwnProperty(n)||aa(n,i,{isNonNativeSDK:!0});var o=r,a=setInterval((function(){if(o.integrationSDKLoaded(n,t)){var i,s=window[n];clearInterval(a);try{var u="[Analytics] processResponse :: trying to initialize integration name:: ".concat(n);r.errorReporting.leaveBreadcrumb(u),(i=new s[t](e.config,o,e.destinationInfo)).init(),o.isInitialized(i).then((function(){o.dynamicallyLoadedIntegrations[n]=s[t]}))}catch(e){var c="[Analytics] 'integration.init()' failed :: ".concat(n," :: ").concat(e.message);Dr(e,c),o.failedToBeLoadedIntegration.push(i)}}}),100);setTimeout((function(){clearInterval(a)}),1e4)}));var a=this;this.allModulesInitialized().then((function(){if(!a.clientIntegrations||0===a.clientIntegrations.length)return r.clientIntegrationsReady=!0,r.executeReadyCallback(),void(r.toBeProcessedByIntegrationArray=[]);a.replayEvents(a)}))}catch(e){Dr(e)}}},{key:"sendDataToDestination",value:function(e,t,n){try{if(e[n]){var r=T(t);e[n](r)}}catch(t){var i="[sendToNative]:: [Destination: ".concat(e.name,"]:: ");Dr(t,i)}}},{key:"sendTransformedDataToDestination",value:function(e,t,n){var r=this;try{Gr(t.message.integrations);var i=e.map((function(e){return e.destinationId}));this.transformationHandler.enqueue(t,i,(function(i){var o=i.status,s=i.transformedPayload,a=i.errorMessage;e.forEach((function(e){try{switch(o){case 200:var i=s.find((function(t){return t.id===e.destinationId})),u=[];null==i||i.payload.forEach((function(n){if("200"===n.status)u.push(n);else{var r='[DMT]:: Event transformation unsuccessful for destination "'.concat(e.name,'". Reason: '),i="Unknown";"410"===n.status&&(i="Transformation is not available");var o="Dropping the event",s=ct.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",s=ct.warn,u.push({event:t.message})),s("".concat(r," ").concat(i,". ").concat(o,"."))}})),null==u||u.forEach((function(t){_r(t.event)&&r.sendDataToDestination(e,{message:t.event},n)}));break;case 404:ct.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),r.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(ct.warn("[DMT]::[Destination: ".concat(e.name,"] :: Transformation request failed with status: ").concat(o," ").concat(a,". Sending untransformed event.")),r.sendDataToDestination(e,t,n)):ct.error("[DMT]::[Destination: ".concat(e.name,"] :: Transformation request failed with status: ").concat(o," ").concat(a,". Dropping the event."))}}catch(t){t instanceof Error&&(t.message="[DMT]::[Destination:".concat(e.name,"]:: ").concat(t.message)),Dr(t)}}))}))}catch(e){e instanceof Error&&(e.message="[DMT]:: ".concat(e.message)),Dr(e)}}},{key:"processAndSendEventsToDeviceMode",value:function(e,t,n){var r=this,i=[],o=[];e.forEach((function(e){!r.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?o.push(e):i.push(e))})),i.forEach((function(e){r.sendDataToDestination(e,t,n)})),o.length>0&&this.sendTransformedDataToDestination(o,t,n)}},{key:"queueEventForDataPlane",value:function(e,t){var n=t.message.integrations||{All:!0};t.message.integrations=function(e,t){var n=T(e),r=Object.keys(t).filter((function(e){return!(!0===t[e]&&n[e])})).reduce((function(e,n){return e[n]=t[n],e}),{});return wr(n,r)}(this.integrationsData,n),this.eventRepository.enqueue(t,e)}},{key:"processBufferedCloudModeEvents",value:function(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}},{key:"replayEvents",value:function(e){var t,n,r,i=this;this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration,e.clientIntegrationObjects.every((function(e){return!e.isReady||e.isReady()}))&&(this.integrationsData=(t=this.integrationsData,n=e.clientIntegrationObjects,r=T(t),n.forEach((function(e){if(e.getDataForIntegrationsObject)try{r=wr(r,e.getDataForIntegrationsObject())}catch(e){ct.debug("[Analytics: prepareDataForIntegrationsObj]",e)}})),r),e.clientIntegrationsReady=!0,e.executeReadyCallback()),this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach((function(t){var n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&Br(t[0].message.integrations);var r=Ur(t[0].message.integrations,e.clientIntegrationObjects);i.processAndSendEventsToDeviceMode(r,t[0],n)})),e.toBeProcessedByIntegrationArray=[]}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"isInitialized",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){e.isLoaded()?(t.successfullyLoadedIntegration.push(e),r(t)):n>=1e4?(t.failedToBeLoadedIntegration.push(e),r(t)):t.pause(1e3).then((function(){return t.isInitialized(e,n+1e3).then(r)}))}))}},{key:"page",value:function(e,t,r,i,o){if(this.errorReporting.leaveBreadcrumb("Page event"),this.loaded){"function"==typeof i&&(o=i,i=null),"function"==typeof r&&(o=r,i=r=null),"function"==typeof t&&(o=t,i=r=t=null),"function"==typeof e&&(o=e,i=r=t=e=null),"object"===n(e)&&null!=e&&null!=e&&(i=t,r=e,t=e=null),"object"===n(t)&&null!=t&&null!=t&&(i=r,r=t,t=null),"string"==typeof e&&"string"!=typeof t&&(t=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!=e&&this.sendSampleRequest();var s=T(r),a=T(i),u=(new cs).setType("page").build();s||(s={}),t&&(u.message.name=s.name=t),e&&(u.message.category=s.category=e),u.message.properties=this.getPageProperties(s),this.processAndSendDataToDestinations("page",u,a,o)}else this.toBeProcessedArray.push(["page"].concat(Array.prototype.slice.call(arguments)))}},{key:"track",value:function(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),this.loaded){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);var i=T(t),o=T(n),s=(new cs).setType("track").build();e&&s.setEventName(e),s.setProperty(i||{}),this.processAndSendDataToDestinations("track",s,o,r)}else this.toBeProcessedArray.push(["track"].concat(Array.prototype.slice.call(arguments)))}},{key:"identify",value:function(e,t,r,i){if(this.errorReporting.leaveBreadcrumb("Identify event"),this.loaded){"function"==typeof r&&(i=r,r=null),"function"==typeof t&&(i=t,r=null,t=null),"object"===n(e)&&(r=t,t=e,e=this.userId);var o=Fr(e);o&&this.userId&&o!==this.userId&&this.reset(),this.userId=o,this.storage.setUserId(this.userId);var s=T(t),a=T(r);if(s){for(var u in s)this.userTraits[u]=s[u];this.storage.setUserTraits(this.userTraits)}var c=(new cs).setType("identify").build();this.processAndSendDataToDestinations("identify",c,a,i)}else this.toBeProcessedArray.push(["identify"].concat(Array.prototype.slice.call(arguments)))}},{key:"alias",value:function(e,t,r,i){if(this.errorReporting.leaveBreadcrumb("Alias event"),this.loaded){"function"==typeof r&&(i=r,r=null),"function"==typeof t&&(i=t,r=null,t=null),"function"==typeof e&&(i=e,r=null,t=null,e=null),"object"===n(t)&&(r=t,t=null),"object"===n(e)&&(r=e,t=null,e=null);var o=(new cs).setType("alias").build();o.message.previousId=Fr(t)||(this.userId?this.userId:this.getAnonymousId()),o.message.userId=Fr(e);var s=T(r);this.processAndSendDataToDestinations("alias",o,s,i)}else this.toBeProcessedArray.push(["alias"].concat(Array.prototype.slice.call(arguments)))}},{key:"group",value:function(e,t,r,i){if(this.errorReporting.leaveBreadcrumb("Group event"),this.loaded){if(0!==arguments.length){"function"==typeof r&&(i=r,r=null),"function"==typeof t&&(i=t,r=null,t=null),"object"===n(e)&&(r=t,t=e,e=this.groupId),"function"==typeof e&&(i=e,r=null,t=null,e=this.groupId),this.groupId=Fr(e),this.storage.setGroupId(this.groupId);var o=T(t),s=T(r),a=(new cs).setType("group").build();if(o)for(var u in o)this.groupTraits[u]=o[u];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",a,s,i)}}else this.toBeProcessedArray.push(["group"].concat(Array.prototype.slice.call(arguments)))}},{key:"IsEventBlackListed",value:function(e,t){if(!e||"string"!=typeof e)return!1;var n=pr[t],r=this.clientIntegrations.find((function(e){return e.name===n})).config,i=r.blacklistedEvents,o=r.whitelistedEvents,s=r.eventFilteringOption;if(!s)return!1;var a=e.trim().toUpperCase();switch(s){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(i)&&i.some((function(e){return e.eventName.trim().toUpperCase()===a}));case"whitelistedEvents":return!Array.isArray(o)||!o.some((function(e){return e.eventName.trim().toUpperCase()===a}))}}},{key:"shouldUseGlobalIntegrationsConfigInEvents",value:function(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}},{key:"processAndSendDataToDestinations",value:function(e,n,r,i){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),n.message.context.traits=t({},this.userTraits),n.message.anonymousId=this.anonymousId,n.message.userId=n.message.userId?n.message.userId:this.userId,"group"==e&&(this.groupId&&(n.message.groupId=this.groupId),this.groupTraits&&(n.message.traits=t({},this.groupTraits)));try{var o=this.uSession.getSessionInfo(),s=o.sessionId,a=o.sessionStart;n.message.context.sessionId=s,a&&(n.message.context.sessionStart=!0)}catch(e){Dr(e)}f=this.cookieConsentOptions,h=!1,Object.keys(f).forEach((function(e){br.includes(e)&&"boolean"==typeof f[e].enabled&&!0===f[e].enabled&&(h=!0)})),h&&(n.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(n,r),function(e,t){var n=e.properties,r=e.traits;n&&Object.keys(n).forEach((function(e){yr.indexOf(e.toLowerCase())>=0&&ct.error("Warning! : Reserved keyword used in properties--\x3e ".concat(e," with ").concat(t," call"))})),r&&Object.keys(r).forEach((function(e){yr.indexOf(e.toLowerCase())>=0&&ct.error("Warning! : Reserved keyword used in traits--\x3e ".concat(e," with ").concat(t," call"))}));var i=e.context.traits;i&&Object.keys(i).forEach((function(e){yr.indexOf(e.toLowerCase())>=0&&ct.error("Warning! : Reserved keyword used in traits --\x3e ".concat(e," with ").concat(t," call"))}))}(n.message,e);var u=n.message.integrations;u?Br(u):u=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:Or,n.message.integrations=u;try{n.message.context["ua-ch"]=this.uach}catch(e){Dr(e)}if(this.clientIntegrationObjects){var c=Ur(u,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(c,n,e)}else this.toBeProcessedByIntegrationArray.push([e,n]);var l=T(n);Gr(l.message.integrations),!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,l):this.preProcessQueue.enqueue(e,l),i&&"function"==typeof i&&i(l)}catch(e){Dr(e)}var f,h}},{key:"utm",value:function(e){var t={};try{var n=new URL(e),r="utm_";n.searchParams.forEach((function(e,n){if(n.startsWith(r)){var i=n.substring(r.length);"campaign"===i&&(i="name"),t[i]=e}}))}catch(e){}return t}},{key:"addCampaignInfo",value:function(e){var t=e.message.context;t&&"object"===n(t)&&(e.message.context.campaign=this.utm(window.location.href))}},{key:"processOptionsParam",value:function(e,r){var i=e.message,o=i.type,a=i.properties;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===o?a:void 0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"===n(t)&&null!==t&&Object.keys(t).forEach((function(n){ba.includes(n)&&(e[n]=t[n])}))}(e.message,r),e.message.context=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.context;return"object"!==n(r)||null===r||Object.keys(r).forEach((function(e){if(!ba.includes(e)&&!Er.includes(e))if("context"!==e)i=wr(i,s({},e,r[e]));else if("object"===n(r[e])&&null!==r[e]){var o={};Object.keys(r[e]).forEach((function(t){Er.includes(t)||(o[t]=r[e][t])})),i=wr(i,t({},o))}else ct.error("[Analytics: processOptionsParam] context passed in options ".concat(e," is not object."))})),i}(e.message,r)}},{key:"getPageProperties",value:function(e,t){var n=es(),r=t&&t.page||{};for(var i in n)void 0===e[i]&&(e[i]=r[i]||n[i]);return e}},{key:"getContextPageProperties",value:function(e){var t=es(),n={};for(var r in t)n[r]=e&&e[r]?e[r]:t[r];return n}},{key:"reset",value:function(e){this.errorReporting.leaveBreadcrumb("reset API :: flag: ".concat(e)),this.loaded?(e&&(this.anonymousId=""),this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.uSession.reset(),this.storage.clear(e)):this.toBeProcessedArray.push(["reset",e])}},{key:"getAnonymousId",value:function(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"getUserId",value:function(){return this.userId}},{key:"getSessionId",value:function(){return this.uSession.getSessionId()}},{key:"getUserTraits",value:function(){return this.userTraits}},{key:"getGroupId",value:function(){return this.groupId}},{key:"getGroupTraits",value:function(){return this.groupTraits}},{key:"setAnonymousId",value:function(e,t){var n=t?pa(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||Mr(),this.storage.setAnonymousId(this.anonymousId)}},{key:"isValidWriteKey",value:function(e){return e&&"string"==typeof e&&e.trim().length>0}},{key:"isValidServerUrl",value:function(e){return e&&"string"==typeof e&&e.trim().length>0}},{key:"isDatasetAvailable",value:function(){var e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}},{key:"loadAfterPolyfill",value:function(e,r,i){var o=this;if("object"===n(r)&&null!==r&&(i=r,r=null),i&&i.logLevel&&(this.logLevel=i.logLevel,ct.setLogLevel(i.logLevel)),!this.isValidWriteKey(e))throw Error("Unable to load the SDK due to invalid writeKey");if(!this.storage||0===Object.keys(this.storage).length)throw Error("Cannot proceed as no storage is available");i&&i.cookieConsentManager&&(this.cookieConsentOptions=i.cookieConsentManager),this.writeKey=e,this.serverUrl=r,this.options=i;var s={};if(i&&i.setCookieDomain&&(s=t(t({},s),{},{domain:i.setCookieDomain})),i&&"boolean"==typeof i.secureCookie&&(s=t(t({},s),{},{secure:i.secureCookie})),i&&-1!==Ar.indexOf(i.sameSiteCookie)&&(s=t(t({},s),{},{samesite:i.sameSiteCookie})),this.storage.options(s),i&&"string"==typeof i.uaChTrackLevel&&kr.includes(i.uaChTrackLevel)&&(this.uaChTrackLevel=i.uaChTrackLevel),navigator.userAgentData&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then((function(t){e(t)}))}((function(e){o.uach=e}),this.uaChTrackLevel),i&&i.integrations&&(a(this.loadOnlyIntegrations,i.integrations),Br(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=i&&!0===i.useGlobalIntegrationsConfigInEvents,i&&i.sendAdblockPage&&(this.sendAdblockPage=!0),i&&i.sendAdblockPageOptions&&"object"===n(i.sendAdblockPageOptions)&&(this.sendAdblockPageOptions=i.sendAdblockPageOptions),this.uSession.initialize(i),i&&i.clientSuppliedCallbacks){var u={};Object.keys(this.methodToCallbackMapping).forEach((function(e){o.methodToCallbackMapping.hasOwnProperty(e)&&i.clientSuppliedCallbacks[o.methodToCallbackMapping[e]]&&(u[e]=i.clientSuppliedCallbacks[o.methodToCallbackMapping[e]])})),a(this.clientSuppliedCallbacks,u),this.registerCallbacks(!0)}if(i&&null!=i.loadIntegration&&(this.loadIntegration=!!i.loadIntegration),i&&"boolean"==typeof i.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===i.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),i&&"number"==typeof i.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=i.dataPlaneEventsBufferTimeout),i&&void 0!==i.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===i.lockIntegrationsVersion),this.initializeUser(i?i.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=function(e,t,n){var r="";if(n){if(!(r=Lr(n))){var i="CDN base URL for integrations is not valid";throw Dr({message:"[Analytics] load:: ".concat(i)}),Error("Failed to load Rudder SDK: ".concat(i))}return r}var o=jr().sdkURL;return r=o?o.split("/").slice(0,-1).concat("js-integrations").join("/"):mr,t&&(r=r.replace("v1.1",e)),r}(this.version,this.lockIntegrationsVersion,i&&i.destSDKBaseURL),i&&i.getSourceConfig)if("function"!=typeof i.getSourceConfig)Dr(new Error('option "getSourceConfig" must be a function'));else{var c=i.getSourceConfig();c instanceof Promise?c.then((function(e){return o.processResponse(200,e)})).catch(Dr):this.processResponse(200,c)}else{var l=function(e){return vr.concat(vr.includes("?")?"&":"?").concat(e?"writeKey=".concat(e):"")}(e);i&&i.configUrl&&(l=function(e,t){var n=e;-1===n.indexOf("sourceConfig")&&(n="".concat(Lr(n),"/sourceConfig/")),n="/"===n.slice(-1)?n:"".concat(n,"/");var r=t.split("?")[1],i=n.split("?");return i.length>1&&i[1]!==r?"".concat(i[0],"?").concat(r):"".concat(n,"?").concat(r)}(i.configUrl,l));try{!function(e,t,n,r){var i=r.bind(e),o=new XMLHttpRequest;o.open("GET",t,!0),o.setRequestHeader("Authorization","Basic ".concat(btoa("".concat(n,":")))),o.onload=function(){var e=o.status;200==e?i(200,o.responseText):(Dr(new Error("".concat("Request failed with status:"," ").concat(e," for url: ").concat(t))),i(e))},o.send()}(this,l,e,this.processResponse)}catch(e){Dr(e)}}}},{key:"arePolyfillsRequired",value:function(e){return(!e||"boolean"!=typeof e.polyfillIfRequired||e.polyfillIfRequired)&&(!String.prototype.endsWith||!String.prototype.startsWith||!String.prototype.includes||!Array.prototype.find||!Array.prototype.includes||"function"!=typeof window.URL||"undefined"==typeof Promise||!Object.entries||!Object.values||!String.prototype.replaceAll||!this.isDatasetAvailable()||"function"!=typeof TextDecoder||"function"!=typeof Uint8Array)}},{key:"load",value:function(e,t,n){if(!this.loaded){var r=T(n);if(this.arePolyfillsRequired(r)){var i="polyfill";aa(i,"https://polyfill.io/v3/polyfill.min.js?features=Number.isNaN%2CURL%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll%2CTextDecoder%2Uint8Array",{skipDatasetAttributes:!0});var o=this,s=setInterval((function(){!window.hasOwnProperty(i)&&null===document.getElementById(i)||"undefined"==typeof Promise||(clearInterval(s),o.loadAfterPolyfill(e,t,r))}),100);setTimeout((function(){clearInterval(s)}),1e4)}else this.loadAfterPolyfill(e,t,r)}}},{key:"ready",value:function(e){this.loaded?"function"!=typeof e?ct.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}},{key:"initializeCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach((function(t){e.methodToCallbackMapping.hasOwnProperty(t)&&e.on(t,(function(){}))}))}},{key:"registerCallbacks",value:function(e){var t=this;e||Object.keys(this.methodToCallbackMapping).forEach((function(e){t.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[t.methodToCallbackMapping[e]]&&(t.clientSuppliedCallbacks[e]=window.rudderanalytics[t.methodToCallbackMapping[e]])})),Object.keys(this.clientSuppliedCallbacks).forEach((function(e){t.clientSuppliedCallbacks.hasOwnProperty(e)&&t.on(e,t.clientSuppliedCallbacks[e])}))}},{key:"sendSampleRequest",value:function(){aa("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{isNonNativeSDK:!0})}},{key:"startSession",value:function(e){this.uSession.start(e)}},{key:"endSession",value:function(){this.uSession.end()}},{key:"setAuthToken",value:function(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):ct.error("Provided input should be in string format")}}]),e}(),Da=new Pa;y(Da),window.addEventListener("error",(function(e){Dr(e,void 0,Da)}),!0),Da.initializeCallbacks(),Da.registerCallbacks(!1);var La,Ma=window.rudderanalytics,xa=Array.isArray(Ma);if(xa)for(var Na=0;Na<Ma.length;){if(Ma[Na]&&"load"===Ma[Na][0]){La=Ma[Na],Ma.splice(Na,1);break}Na+=1}!function(e){var t="ajs_trait_",n="ajs_prop_";function r(e,t){var n={};return Object.keys(e).forEach((function(r){r.startsWith(t)&&(n[r.substr(t.length)]=e[r])})),n}var i=function(e){var t={};try{new URL(e).searchParams.forEach((function(e,n){t[n]=e}))}catch(e){}return t}(e);i.ajs_aid&&Da.toBeProcessedArray.push(["setAnonymousId",i.ajs_aid]),i.ajs_uid&&Da.toBeProcessedArray.push(["identify",i.ajs_uid,r(i,t)]),i.ajs_event&&Da.toBeProcessedArray.push(["track",i.ajs_event,r(i,n)])}(window.location.href),xa&&Ma.forEach((function(e){return Da.toBeProcessedArray.push(e)})),La&&La.length>0&&(La.shift(),Da.load.apply(Da,u(La)));var Ba=Da.ready.bind(Da),Ga=Da.identify.bind(Da),Ua=Da.page.bind(Da),ja=Da.track.bind(Da),Fa=Da.alias.bind(Da),Ka=Da.group.bind(Da),Ha=Da.reset.bind(Da),Qa=Da.load.bind(Da),za=Da.initialized=!0,qa=Da.getUserId.bind(Da),Va=Da.getSessionId.bind(Da),Wa=Da.getUserTraits.bind(Da),Ya=Da.getAnonymousId.bind(Da),Xa=Da.setAnonymousId.bind(Da),Ja=Da.getGroupId.bind(Da),$a=Da.getGroupTraits.bind(Da),Za=Da.startSession.bind(Da),eu=Da.endSession.bind(Da),tu=Da.setAuthToken.bind(Da);export{Fa as alias,eu as endSession,Ya as getAnonymousId,Ja as getGroupId,$a as getGroupTraits,Va as getSessionId,qa as getUserId,Wa as getUserTraits,Ka as group,Ga as identify,za as initialized,Qa as load,Ua as page,Ba as ready,Ha as reset,Xa as setAnonymousId,tu as setAuthToken,Za as startSession,ja as track};
1
+ function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="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},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function u(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function d(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];n.push.apply(n,arguments);var r=Function.bind.apply(t,n);return new r}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var p={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}p.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var g=p.exports,y=h(g);function v(e){return null!=e&&"object"===n(e)&&!0===e["@@functional/placeholder"]}function m(e){return function t(n){return 0===arguments.length||v(n)?t:e.apply(this,arguments)}}function A(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return v(n)?t:m((function(t){return e(n,t)}));default:return v(n)&&v(r)?t:v(n)?m((function(t){return e(t,r)})):v(r)?m((function(t){return e(n,t)})):e(n,r)}}}function I(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return v(n)?t:A((function(t,r){return e(n,t,r)}));case 2:return v(n)&&v(r)?t:v(n)?A((function(t,n){return e(t,r,n)})):v(r)?A((function(t,r){return e(n,t,r)})):m((function(t){return e(n,r,t)}));default:return v(n)&&v(r)&&v(i)?t:v(n)&&v(r)?A((function(t,n){return e(t,n,i)})):v(n)&&v(i)?A((function(t,n){return e(t,r,n)})):v(r)&&v(i)?A((function(t,r){return e(n,t,r)})):v(n)?m((function(t){return e(t,r,i)})):v(r)?m((function(t){return e(n,t,i)})):v(i)?m((function(t){return e(n,r,t)})):e(n,r,i)}}}function b(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var E=m((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e,t,r){if(r||(r=new S),function(e){var t=n(e);return null==e||"object"!=t&&"function"!=t}(e))return e;var i,o=function(n){var i=r.get(e);if(i)return i;for(var o in r.set(e,n),e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t?O(e[o],!0,r):e[o]);return n};switch(E(e)){case"Object":return o(Object.create(Object.getPrototypeOf(e)));case"Array":return o([]);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 S=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.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],r=0;r<n.length;r+=1){var i=n[r];if(i[0]===e)return i[1]}else{var o=this.hash(e),s=this.map[o];if(s)for(var a=0;a<s.length;a+=1){var u=s[a];if(u[0]===e)return u[1]}}},e}(),C=m((function(e){return null!=e&&"function"==typeof e.clone?e.clone():O(e,!0)})),T=I((function(e,t,n){var r,i={};for(r in n=n||{},t=t||{})b(r,t)&&(i[r]=b(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)b(r,n)&&!b(r,i)&&(i[r]=n[r]);return i})),w=I((function e(t,n,r){return T((function(n,r,i){return k(r)&&k(i)?e(t,r,i):t(n,r,i)}),n,r)})),R=I((function(e,t,n){return w((function(t,n,r){return e(n,r)}),t,n)})),_=function(e){return null!=e&&"object"===n(e)&&!1===Array.isArray(e)},P=function(e,t,n){if(_(n)||(n={default:n}),!M(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));var r=Array.isArray(t),i="string"==typeof t,o=n.separator||".",s=n.joinChar||("string"==typeof o?o:".");if(!i&&!r)return e;if(i&&t in e)return L(t,e,n)?e[t]:n.default;var a=r?t:function(e,t,n){if("function"==typeof n.split)return n.split(e);return e.split(t)}(t,o,n),u=a.length,c=0;do{var l=a[c];for("number"==typeof l&&(l=String(l));l&&"\\"===l.slice(-1);)l=D([l.slice(0,-1),a[++c]||""],s,n);if(l in e){if(!L(l,e,n))return n.default;e=e[l]}else{for(var f=!1,h=c+1;h<u;)if(f=(l=D([l,a[h++]],s,n))in e){if(!L(l,e,n))return n.default;e=e[l],c=h-1;break}if(!f)return n.default}}while(++c<u&&M(e));return c===u?e:n.default};function D(e,t,n){return"function"==typeof n.join?n.join(e):e[0]+t+e[1]}function L(e,t,n){return"function"!=typeof n.isValid||n.isValid(e,t)}function M(e){return _(e)||Array.isArray(e)||"function"==typeof e}for(var x,N=h(P),B=256,G=[];B--;)G[B]=(B+256).toString(16).substring(1);for(var U,j=[],F=0;F<256;F++)j[F]=(F+256).toString(16).substring(1);function K(){var e;(!U||F+16>4096)&&(e=4096,U=crypto.getRandomValues(new Uint8Array(e)),F=0);for(var t,n=0,r="";n<16;n++)t=U[F+n],r+=6==n?j[15&t|64]:8==n?j[63&t|128]:j[t],1&n&&n>1&&n<11&&(r+="-");return F+=16,r}var H,Q,z,V,q,W,Y,X,J,$,Z,ee,te,ne,re,ie,oe,se,ae,ue,ce,le,fe,he,de,pe,ge,ye,ve,me,Ae,Ie,be,Ee,ke,Oe,Se,Ce,Te,we,Re,_e,Pe,De,Le,Me,xe,Ne,Be,Ge,Ue,je,Fe,Ke,He,Qe,ze,Ve,qe,We,Ye,Xe,Je,$e,Ze,et,tt,nt,rt,it,ot,st,at,ut,ct=4,lt={setLogLevel:function(e){switch(e.toUpperCase()){case"INFO":ct=1;break;case"DEBUG":ct=2;break;case"WARN":ct=3;break;default:ct=4}},info:function(){var e;ct<=1&&(e=console).info.apply(e,arguments)},debug:function(){var e;ct<=2&&(e=console).log.apply(e,arguments)},warn:function(){var e;ct<=3&&(e=console).warn.apply(e,arguments)},error:function(){var e;ct<=4&&(e=console).error.apply(e,arguments)}},ft="ADOBE_ANALYTICS",ht=(H={"Adobe Analytics":ft,ADOBEANALYTICS:ft,"ADOBE ANALYTICS":ft},s(H,ft,ft),s(H,"AdobeAnalytics",ft),s(H,"adobeanalytics",ft),s(H,"adobe analytics",ft),s(H,"Adobe analytics",ft),s(H,"adobe Analytics",ft),H),dt=(Q={},s(Q,"AM","AM"),s(Q,"AMPLITUDE","AM"),s(Q,"Amplitude","AM"),s(Q,"am","AM"),Q),pt=(z={},s(z,"APPCUES","APPCUES"),s(z,"Appcues","APPCUES"),s(z,"App Cues","APPCUES"),s(z,"appcues","APPCUES"),z),gt=(V={},s(V,"BINGADS","BINGADS"),s(V,"BingAds","BINGADS"),s(V,"bingads","BINGADS"),s(V,"Bing Ads","BINGADS"),s(V,"Bing ads","BINGADS"),s(V,"bing Ads","BINGADS"),s(V,"bing ads","BINGADS"),V),yt=(q={},s(q,"BRAZE","BRAZE"),s(q,"Braze","BRAZE"),s(q,"braze","BRAZE"),q),vt=(W={},s(W,"BUGSNAG","BUGSNAG"),s(W,"bugsnag","BUGSNAG"),s(W,"Bugsnag","BUGSNAG"),W),mt="CHARTBEAT",At=(Y={},s(Y,mt,mt),s(Y,"Chartbeat",mt),s(Y,"chartbeat",mt),s(Y,"Chart Beat",mt),s(Y,"chart beat",mt),Y),It=(X={},s(X,"CLEVERTAP","CLEVERTAP"),s(X,"Clevertap","CLEVERTAP"),s(X,"clevertap","CLEVERTAP"),X),bt="COMSCORE",Et=(J={},s(J,bt,bt),s(J,"Comscore",bt),s(J,"Com Score",bt),s(J,"com Score",bt),s(J,"com score",bt),s(J,"Com score",bt),J),kt=($={},s($,"CRITEO","CRITEO"),s($,"Criteo","CRITEO"),s($,"criteo","CRITEO"),$),Ot="CUSTOMERIO",St=(Z={},s(Z,Ot,Ot),s(Z,"Customerio",Ot),s(Z,"Customer.io",Ot),s(Z,"CUSTOMER.IO",Ot),s(Z,"customer.io",Ot),Z),Ct=(ee={},s(ee,"DRIP","DRIP"),s(ee,"Drip","DRIP"),s(ee,"drip","DRIP"),ee),Tt="FACEBOOK_PIXEL",wt=(te={},s(te,Tt,Tt),s(te,"FB Pixel",Tt),s(te,"Facebook Pixel",Tt),s(te,"facebook pixel",Tt),s(te,"fbpixel",Tt),s(te,"FBPIXEL",Tt),s(te,"FB_PIXEL",Tt),te),Rt="FULLSTORY",_t=(ne={},s(ne,Rt,Rt),s(ne,"Fullstory",Rt),s(ne,"FullStory",Rt),s(ne,"full Story",Rt),s(ne,"Full Story",Rt),s(ne,"Full story",Rt),s(ne,"full story",Rt),s(ne,"fullstory",Rt),ne),Pt=(re={},s(re,"GA","GA"),s(re,"Google Analytics","GA"),s(re,"GoogleAnalytics","GA"),s(re,"GOOGLE ANALYTICS","GA"),s(re,"google analytics","GA"),re),Dt=(ie={},s(ie,"GA4","GA4"),s(ie,"Google Analytics 4","GA4"),s(ie,"Google analytics 4","GA4"),s(ie,"google analytics 4","GA4"),s(ie,"Google Analytics4","GA4"),s(ie,"Google analytics4","GA4"),s(ie,"google analytics4","GA4"),s(ie,"Google Analytics 4 (GA4)","GA4"),s(ie,"google analytics 4 (ga4)","GA4"),s(ie,"GoogleAnalytics4","GA4"),ie),Lt="GOOGLEADS",Mt=(oe={},s(oe,Lt,Lt),s(oe,"Google Ads",Lt),s(oe,"GoogleAds",Lt),s(oe,"GOOGLE ADS",Lt),s(oe,"google ads",Lt),s(oe,"googleads",Lt),oe),xt="GOOGLE_OPTIMIZE",Nt=(se={},s(se,xt,xt),s(se,"Google Optimize",xt),s(se,"GoogleOptimize",xt),s(se,"Googleoptimize",xt),s(se,"GOOGLEOPTIMIZE",xt),s(se,"google optimize",xt),s(se,"Google optimize",xt),s(se,"GOOGLE OPTIMIZE",xt),se),Bt=(ae={},s(ae,"GTM","GTM"),s(ae,"Google Tag Manager","GTM"),s(ae,"google tag manager","GTM"),s(ae,"googletag manager","GTM"),s(ae,"googletagmanager","GTM"),ae),Gt=(ue={},s(ue,"HEAP","HEAP"),s(ue,"Heap","HEAP"),s(ue,"heap","HEAP"),s(ue,"Heap.io","HEAP"),ue),Ut=(s(ce={},"HOTJAR","HOTJAR"),s(ce,"Hotjar","HOTJAR"),s(ce,"hotjar","HOTJAR"),s(ce,"Hot Jar","HOTJAR"),s(ce,"hot jar","HOTJAR"),ce),jt=(s(le={},"HS","HS"),s(le,"Hubspot","HS"),s(le,"HUBSPOT","HS"),s(le,"hub spot","HS"),s(le,"Hub Spot","HS"),s(le,"Hub spot","HS"),le),Ft=(s(fe={},"INTERCOM","INTERCOM"),s(fe,"Intercom","INTERCOM"),s(fe,"intercom","INTERCOM"),fe),Kt=(s(he={},"KEEN","KEEN"),s(he,"Keen","KEEN"),s(he,"Keen.io","KEEN"),s(he,"keen","KEEN"),s(he,"keen.io","KEEN"),he),Ht="KISSMETRICS",Qt=(s(de={},Ht,Ht),s(de,"Kissmetrics",Ht),s(de,"kissmetrics",Ht),de),zt=(s(pe={},"KLAVIYO","KLAVIYO"),s(pe,"Klaviyo","KLAVIYO"),s(pe,"klaviyo","KLAVIYO"),pe),Vt="LAUNCHDARKLY",qt=(s(ge={},Vt,Vt),s(ge,"LaunchDarkly",Vt),s(ge,"Launch_Darkly",Vt),s(ge,"Launch Darkly",Vt),s(ge,"launchDarkly",Vt),s(ge,"launch darkly",Vt),ge),Wt="LINKEDIN_INSIGHT_TAG",Yt=(s(ye={},Wt,Wt),s(ye,"LinkedIn Insight Tag",Wt),s(ye,"LinkedIn insight tag",Wt),s(ye,"linkedIn insight tag",Wt),s(ye,"Linkedin_insight_tag",Wt),s(ye,"LinkedinInsighttag",Wt),s(ye,"LinkedinInsightTag",Wt),s(ye,"LinkedInInsightTag",Wt),s(ye,"Linkedininsighttag",Wt),s(ye,"LINKEDININSIGHTTAG",Wt),s(ye,"linkedininsighttag",Wt),ye),Xt=(s(ve={},"LOTAME","LOTAME"),s(ve,"Lotame","LOTAME"),s(ve,"lotame","LOTAME"),ve),Jt=(s(me={},"LYTICS","LYTICS"),s(me,"Lytics","LYTICS"),s(me,"lytics","LYTICS"),me),$t=(s(Ae={},"MP","MP"),s(Ae,"MIXPANEL","MP"),s(Ae,"Mixpanel","MP"),s(Ae,"MIX PANEL","MP"),s(Ae,"Mix panel","MP"),s(Ae,"Mix Panel","MP"),Ae),Zt="MOENGAGE",en=(s(Ie={},Zt,Zt),s(Ie,"MoEngage",Zt),s(Ie,"moengage",Zt),s(Ie,"Moengage",Zt),s(Ie,"Mo Engage",Zt),s(Ie,"mo engage",Zt),s(Ie,"Mo engage",Zt),Ie),tn="OPTIMIZELY",nn=(s(be={},tn,tn),s(be,"Optimizely",tn),s(be,"optimizely",tn),be),rn=(s(Ee={},"PENDO","PENDO"),s(Ee,"Pendo","PENDO"),s(Ee,"pendo","PENDO"),Ee),on="PINTEREST_TAG",sn=(s(ke={},on,on),s(ke,"PinterestTag",on),s(ke,"Pinterest_Tag",on),s(ke,"PINTERESTTAG",on),s(ke,"pinterest",on),s(ke,"PinterestAds",on),s(ke,"Pinterest_Ads",on),s(ke,"Pinterest",on),s(ke,"Pinterest Tag",on),s(ke,"Pinterest tag",on),s(ke,"PINTEREST TAG",on),s(ke,"pinterest tag",on),s(ke,"Pinterest Ads",on),s(ke,"Pinterest ads",on),ke),an="POST_AFFILIATE_PRO",un=(s(Oe={},an,an),s(Oe,"PostAffiliatePro",an),s(Oe,"Post_affiliate_pro",an),s(Oe,"Post Affiliate Pro",an),s(Oe,"Post affiliate pro",an),s(Oe,"post affiliate pro",an),s(Oe,"postaffiliatepro",an),s(Oe,"POSTAFFILIATEPRO",an),Oe),cn="POSTHOG",ln=(s(Se={},cn,cn),s(Se,"PostHog",cn),s(Se,"Posthog",cn),s(Se,"posthog",cn),s(Se,"Post Hog",cn),s(Se,"Post hog",cn),s(Se,"post hog",cn),Se),fn="PROFITWELL",hn=(s(Ce={},fn,fn),s(Ce,"ProfitWell",fn),s(Ce,"profitwell",fn),s(Ce,"Profitwell",fn),s(Ce,"Profit Well",fn),s(Ce,"profit well",fn),s(Ce,"Profit well",fn),Ce),dn="QUALTRICS",pn=(s(Te={},dn,dn),s(Te,"Qualtrics",dn),s(Te,"qualtrics",dn),Te),gn="QUANTUMMETRIC",yn=(s(we={},gn,gn),s(we,"Quantum Metric",gn),s(we,"quantum Metric",gn),s(we,"quantum metric",gn),s(we,"QuantumMetric",gn),s(we,"quantumMetric",gn),s(we,"quantummetric",gn),s(we,"Quantum_Metric",gn),we),vn="REDDIT_PIXEL",mn=(s(Re={},vn,vn),s(Re,"Reddit_Pixel",vn),s(Re,"RedditPixel",vn),s(Re,"REDDITPIXEL",vn),s(Re,"redditpixel",vn),s(Re,"Reddit Pixel",vn),s(Re,"REDDIT PIXEL",vn),s(Re,"reddit pixel",vn),Re),An=(s(_e={},"SENTRY","SENTRY"),s(_e,"sentry","SENTRY"),s(_e,"Sentry","SENTRY"),_e),In="SNAP_PIXEL",bn=(s(Pe={},In,In),s(Pe,"Snap_Pixel",In),s(Pe,"SnapPixel",In),s(Pe,"SNAPPIXEL",In),s(Pe,"snappixel",In),s(Pe,"Snap Pixel",In),s(Pe,"SNAP PIXEL",In),s(Pe,"snap pixel",In),Pe),En="TVSQUARED",kn=(s(De={},En,En),s(De,"TVSquared",En),s(De,"tvsquared",En),s(De,"tvSquared",En),s(De,"TvSquared",En),s(De,"Tvsquared",En),s(De,"TV Squared",En),s(De,"tv squared",En),s(De,"tv Squared",En),De),On=(s(Le={},"VWO","VWO"),s(Le,"VisualWebsiteOptimizer","VWO"),s(Le,"Visualwebsiteoptimizer","VWO"),s(Le,"visualwebsiteoptimizer","VWO"),s(Le,"vwo","VWO"),s(Le,"Visual Website Optimizer","VWO"),s(Le,"Visual website optimizer","VWO"),s(Le,"visual website optimizer","VWO"),Le),Sn=(s(Me={},"GA360","GA360"),s(Me,"Google Analytics 360","GA360"),s(Me,"Google analytics 360","GA360"),s(Me,"google analytics 360","GA360"),s(Me,"Google Analytics360","GA360"),s(Me,"Google analytics360","GA360"),s(Me,"google analytics360","GA360"),s(Me,"GoogleAnalytics360","GA360"),s(Me,"GA 360","GA360"),Me),Cn=(s(xe={},"ADROLL","ADROLL"),s(xe,"Adroll","ADROLL"),s(xe,"Ad roll","ADROLL"),s(xe,"ad roll","ADROLL"),s(xe,"adroll","ADROLL"),xe),Tn="DCM_FLOODLIGHT",wn=(s(Ne={},Tn,Tn),s(Ne,"DCM Floodlight",Tn),s(Ne,"dcm floodlight",Tn),s(Ne,"Dcm Floodlight",Tn),s(Ne,"DCMFloodlight",Tn),s(Ne,"dcmfloodlight",Tn),s(Ne,"DcmFloodlight",Tn),s(Ne,"dcm_floodlight",Tn),s(Ne,"DCM_Floodlight",Tn),Ne),Rn=(s(Be={},"MATOMO","MATOMO"),s(Be,"Matomo","MATOMO"),s(Be,"matomo","MATOMO"),Be),_n=(s(Ge={},"VERO","VERO"),s(Ge,"Vero","VERO"),s(Ge,"vero","VERO"),Ge),Pn="MOUSEFLOW",Dn=(s(Ue={},Pn,Pn),s(Ue,"Mouseflow",Pn),s(Ue,"mouseflow",Pn),s(Ue,"mouseFlow",Pn),s(Ue,"MouseFlow",Pn),s(Ue,"Mouse flow",Pn),s(Ue,"mouse flow",Pn),s(Ue,"mouse Flow",Pn),s(Ue,"Mouse Flow",Pn),Ue),Ln="ROCKERBOX",Mn=(s(je={},Ln,Ln),s(je,"Rockerbox",Ln),s(je,"rockerbox",Ln),s(je,"RockerBox",Ln),s(je,"Rocker box",Ln),s(je,"rocker box",Ln),s(je,"Rocker Box",Ln),je),xn="CONVERTFLOW",Nn=(s(Fe={},xn,xn),s(Fe,"Convertflow",xn),s(Fe,"convertflow",xn),s(Fe,"convertFlow",xn),s(Fe,"ConvertFlow",xn),s(Fe,"Convert flow",xn),s(Fe,"convert flow",xn),s(Fe,"convert Flow",xn),s(Fe,"Convert Flow",xn),s(Fe,"CONVERT FLOW",xn),Fe),Bn="SNAPENGAGE",Gn=(s(Ke={},Bn,Bn),s(Ke,"SnapEngage",Bn),s(Ke,"Snap_Engage",Bn),s(Ke,"snapengage",Bn),s(Ke,"SNAP ENGAGE",Bn),s(Ke,"Snap Engage",Bn),s(Ke,"snap engage",Bn),Ke),Un="LIVECHAT",jn=(s(He={},Un,Un),s(He,"LiveChat",Un),s(He,"Live_Chat",Un),s(He,"livechat",Un),s(He,"LIVE CHAT",Un),s(He,"Live Chat",Un),s(He,"live chat",Un),He),Fn="SHYNET",Kn=(s(Qe={},Fn,Fn),s(Qe,"shynet",Fn),s(Qe,"ShyNet",Fn),s(Qe,"shyNet",Fn),s(Qe,"Shynet",Fn),s(Qe,"shy net",Fn),s(Qe,"Shy Net",Fn),s(Qe,"shy Net",Fn),s(Qe,"Shy net",Fn),Qe),Hn=(s(ze={},"WOOPRA","WOOPRA"),s(ze,"Woopra","WOOPRA"),s(ze,"woopra","WOOPRA"),ze),Qn="ROLLBAR",zn=(s(Ve={},Qn,Qn),s(Ve,"RollBar",Qn),s(Ve,"Roll_Bar",Qn),s(Ve,"rollbar",Qn),s(Ve,"Rollbar",Qn),s(Ve,"ROLL BAR",Qn),s(Ve,"Roll Bar",Qn),s(Ve,"roll bar",Qn),Ve),Vn="QUORA_PIXEL",qn=(s(qe={},Vn,Vn),s(qe,"Quora Pixel",Vn),s(qe,"Quora pixel",Vn),s(qe,"QUORA PIXEL",Vn),s(qe,"QuoraPixel",Vn),s(qe,"Quorapixel",Vn),s(qe,"QUORAPIXEL",Vn),s(qe,"Quora_Pixel",Vn),s(qe,"quora_pixel",Vn),s(qe,"Quora",Vn),qe),Wn=(s(We={},"JUNE","JUNE"),s(We,"June","JUNE"),s(We,"june","JUNE"),We),Yn=(s(Ye={},"ENGAGE","ENGAGE"),s(Ye,"Engage","ENGAGE"),s(Ye,"engage","ENGAGE"),Ye),Xn=(s(Xe={},"ITERABLE","ITERABLE"),s(Xe,"Iterable","ITERABLE"),s(Xe,"iterable","ITERABLE"),Xe),Jn="YANDEX_METRICA",$n=(s(Je={},Jn,Jn),s(Je,"Yandexmetrica",Jn),s(Je,"yandexmetrica",Jn),s(Je,"yandexMetrica",Jn),s(Je,"YandexMetrica",Jn),Je),Zn=(s($e={},"REFINER","REFINER"),s($e,"Refiner","REFINER"),s($e,"refiner","REFINER"),$e),er=(s(Ze={},"QUALAROO","QUALAROO"),s(Ze,"Qualaroo","QUALAROO"),s(Ze,"qualaroo","QUALAROO"),Ze),tr="PODSIGHTS",nr=(s(et={},tr,tr),s(et,"Podsights",tr),s(et,"PodSights",tr),s(et,"pod Sights",tr),s(et,"Pod Sights",tr),s(et,"pod sights",tr),s(et,"POD SIGHTS",tr),s(et,"Pod sights",tr),et),rr=(s(tt={},"AXEPTIO","AXEPTIO"),s(tt,"Axeptio","AXEPTIO"),s(tt,"axeptio","AXEPTIO"),tt),ir="SATISMETER",or=(s(nt={},ir,ir),s(nt,"Satismeter",ir),s(nt,"SatisMeter",ir),s(nt,"SATISMETER",ir),nt),sr="MICROSOFT_CLARITY",ar=(s(rt={},sr,sr),s(rt,"Microsoft Clarity",sr),s(rt,"Microsoft clarity",sr),s(rt,"microsoft clarity",sr),s(rt,"Microsoft_clarity",sr),s(rt,"MicrosoftClarity",sr),s(rt,"MICROSOFTCLARITY",sr),s(rt,"microsoftclarity",sr),s(rt,"microsoftClarity",sr),rt),ur="SENDINBLUE",cr=(s(it={},ur,ur),s(it,"Sendinblue",ur),s(it,"sendinblue",ur),s(it,"SendinBlue",ur),it),lr=(s(ot={},"OLARK","OLARK"),s(ot,"Olark","OLARK"),s(ot,"olark","OLARK"),ot),fr="LEMNISK",hr=(s(st={},fr,fr),s(st,"LEMNISK_MARKETING_AUTOMATION",fr),s(st,"Lemnisk Marketing Automation",fr),s(st,"LemniskMarketingAutomation",fr),s(st,"lemniskmarketingautomation",fr),s(st,"lemniskMarketingAutomation",fr),s(st,"lemnisk",fr),s(st,"Lemnisk",fr),st),dr="TIKTOK_ADS",pr=(s(at={},dr,dr),s(at,"TiktokAds",dr),s(at,"TIKTOK_ADS",dr),s(at,"Tiktok ads",dr),s(at,"Tiktok Ads",dr),s(at,"Tik Tok Ads",dr),s(at,"tik tok ads",dr),s(at,"tiktokads",dr),at),gr="ACTIVE_CAMPAIGN",yr=(s(ut={ActiveCampaign:gr,"Active Campaign":gr,"ACTIVE CAMPAIGN":gr},gr,gr),s(ut,"activecampaign",gr),s(ut,"active campaign",gr),s(ut,"Active campaign",gr),s(ut,"active Campaign",gr),s(ut,"active_campaign",gr),ut),vr=t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t(t({All:"All"},ht),dt),pt),gt),yt),vt),At),It),Et),kt),St),Ct),wt),_t),Pt),Dt),Sn),Mt),Nt),Bt),Gt),Ut),jt),Ft),Kt),Qt),zt),qt),Yt),Xt),Jt),$t),en),nn),rn),sn),un),ln),hn),pn),yn),mn),An),bn),kn),On),Cn),wn),Rn),_n),Dn),Nn),Gn),jn),Kn),Hn),zn),qn),Wn),Yn),Xn),Mn),$n),Zn),er),nr),rr),or),ar),cr),lr),hr),pr),yr),mr={All:"All",GA:"Google Analytics",GOOGLEADS:"Google Ads",BRAZE:"Braze",CHARTBEAT:"Chartbeat",COMSCORE:"Comscore",CUSTOMERIO:"Customer IO",DCM_Floodlight:"DCM Floodlight",FACEBOOK_PIXEL:"Facebook Pixel",GTM:"Google Tag Manager",HOTJAR:"Hotjar",HS:"HubSpot",INTERCOM:"Intercom",KEEN:"Keen",KISSMETRICS:"Kiss Metrics",LOTAME:"Lotame",VWO:"VWO",OPTIMIZELY:"Optimizely Web",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"Google Analytics 4 (GA4)",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"PostHog",PROFITWELL:"ProfitWell",KLAVIYO:"Klaviyo",CLEVERTAP:"CleverTap",BINGADS:"Bing Ads",PINTEREST_TAG:"Pinterest Tag",SNAP_PIXEL:"Snap Pixel",LINKEDIN_INSIGHT_TAG:"Linkedin Insight Tag",REDDIT_PIXEL:"Reddit Pixel",DRIP:"Drip",HEAP:"Heap.io",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",SENTRY:"Sentry",GOOGLE_OPTIMIZE:"Google Optimize",POST_AFFILIATE_PRO:"Post Affiliate Pro",LAUNCHDARKLY:"LaunchDarkly",GA360:"Google Analytics 360",ADROLL:"Adroll",VERO:"Vero",MATOMO:"Matomo",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"Quora Pixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"Yandex.Metrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"Microsoft Clarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TikTok Ads",ACTIVE_CAMPAIGN:"ActiveCampaign"},Ar=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],Ir="https://api.rudderlabs.com/sourceConfig/?p=npm&v=2.41.0",br="".concat("https://cdn.rudderlabs.com","/").concat("v1.1","/").concat("js-integrations"),Er=["Lax","None","Strict"],kr=["US","EU"],Or=["oneTrust","ketch"],Sr=["library","consentManagement"],Cr=["none","default","full"],Tr={All:!0},wr=["Request failed with status:"],Rr=function(e){var t=window.RudderStackGlobals&&window.RudderStackGlobals.errorReporting;t&&e instanceof Error&&t.notify(e)},_r=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return C(t);var n=C(e);return t.forEach((function(e,t){n[t]=Pr(n[t],e)})),n},Pr=function(e,t){return R(_r,e,t)},Dr=function(e,t){return JSON.stringify(e,function(e){var t=[];return function(r,i){if(!e||null!=i){if("object"!==n(i)||null===i)return i;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?(lt.debug("Circular Reference detected for key: ".concat(r)),"[Circular Reference]"):(t.push(i),i)}}}(t))},Lr=function(e){return function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}(e)&&Object.keys(e).length>0},Mr=function(e,t,r){var i,o;try{i="string"==typeof e?e:e instanceof Error||e.message?e.message:Dr(e)}catch(e){i=""}if("object"===n(o=e)&&null!==o&&"target"in o){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&("RS_JS_SDK"!==e.target.dataset.loader||"true"!==e.target.dataset.isnonnativesdk))return"";if(i="error in script loading:: src:: ".concat(e.target.src," id:: ").concat(e.target.id),"ad-block"===e.target.id)return r.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:i},r.sendAdblockPageOptions),""}return"[handleError]::".concat(t||"",' "').concat(i,'"')},xr=function(e,t,n){var r;try{r=Mr(e,t,n)}catch(t){lt.error("[handleError] Exception:: ",t),lt.error("[handleError] Original error:: ",Dr(e)),Rr(t)}r&&(lt.error(r),function(e){return!e.message||!wr.some((function(t){return e.message.includes(t)}))}(e)&&Rr(e))};function Nr(e){return e&&e.endsWith("/")?e.replace(/\/+$/,""):e}function Br(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?K():function(){var e,t=0,n="";if(!x||B+16>256){for(x=Array(t=256);t--;)x[t]=256*Math.random()|0;t=B=0}for(;t<16;t++)e=x[B+t],n+=6==t?G[15&e|64]:8==t?G[63&e|128]:G[e],1&t&&t>1&&t<11&&(n+="-");return B++,n}()}function Gr(){return(new Date).toISOString()}function Ur(e,t){Object.keys(e).forEach((function(n){e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!==n&&void 0!==t[n]&&t[n]!==n&&delete e[n])}))}function jr(e){Ur(e,vr)}function Fr(e){Ur(e,mr)}function Kr(e,t){var r=[];if(!t||0===t.length)return r;var i=!0;void 0!==e.All&&(i=e.All);var o=[];return"string"==typeof t[0]?t.forEach((function(e){o.push({intgName:e,intObj:e})})):"object"===n(t[0])&&t.forEach((function(e){o.push({intgName:e.name,intObj:e})})),o.forEach((function(t){var n=t.intgName,o=t.intObj;if(i){var s=!0;void 0!==e[n]&&!1===Boolean(e[n])&&(s=!1),s&&r.push(o)}else void 0!==e[n]&&!0===Boolean(e[n])&&r.push(o)})),r}var Hr=function(){for(var e,t=document.getElementsByTagName("script"),n=!1,r=0;r<t.length;r+=1){var i=Nr(t[r].getAttribute("src"));if(i){var o=i.match(/^.*rudder-analytics(-staging)?(\.min)?\.js$/);if(o){e=i,n=void 0!==o[1];break}}}return{sdkURL:e,isStaging:n}},Qr=function(e){return"string"==typeof e||null==e?e:JSON.stringify(e)},zr=function(e){return"string"==typeof e&&e.trim().length>0},Vr=function(e,t,n){try{var r=e.source.dataplanes||{};if(Object.keys(r).length>0){var i=function(e){var t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&kr.includes(t.toUpperCase())?t.toUpperCase():void lt.error("Invalid residencyServer input")}(n),o=r[i]||r.US;if(o){var s=function(e){if(Array.isArray(e)&&e.length>0){var t=e.find((function(e){return!0===e.default}));if(t&&zr(t.url))return t.url}}(o);if(s)return s}}if(zr(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}},qr={exports:{}};var Wr,Yr={exports:{}},Xr=d(Object.freeze({__proto__:null,default:{}}));function Jr(){return Wr?Yr.exports:(Wr=1,Yr.exports=(e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==f&&f.crypto&&(n=f.crypto),!n)try{n=Xr}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},s=o.lib={},a=s.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=o.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},h=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*c,o);if(c){for(var f=0;f<c;f+=s)this._doProcessBlock(i,f);n=i.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=p.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math),e));var e}var $r,Zr={exports:{}};function ei(){return $r?Zr.exports:($r=1,Zr.exports=(e=Jr(),function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],o=0,s=0;s<t;s++)if(s%4){var a=r[e.charCodeAt(s-1)]<<s%4*2|r[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return n.create(i,o)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(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,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64));var e}var ti,ni={exports:{}};function ri(){return ti?ni.exports:(ti=1,ni.exports=(e=Jr(),function(t){var n=e,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],A=e[t+8],I=e[t+9],b=e[t+10],E=e[t+11],k=e[t+12],O=e[t+13],S=e[t+14],C=e[t+15],T=o[0],w=o[1],R=o[2],_=o[3];T=c(T,w,R,_,s,7,a[0]),_=c(_,T,w,R,u,12,a[1]),R=c(R,_,T,w,d,17,a[2]),w=c(w,R,_,T,p,22,a[3]),T=c(T,w,R,_,g,7,a[4]),_=c(_,T,w,R,y,12,a[5]),R=c(R,_,T,w,v,17,a[6]),w=c(w,R,_,T,m,22,a[7]),T=c(T,w,R,_,A,7,a[8]),_=c(_,T,w,R,I,12,a[9]),R=c(R,_,T,w,b,17,a[10]),w=c(w,R,_,T,E,22,a[11]),T=c(T,w,R,_,k,7,a[12]),_=c(_,T,w,R,O,12,a[13]),R=c(R,_,T,w,S,17,a[14]),T=l(T,w=c(w,R,_,T,C,22,a[15]),R,_,u,5,a[16]),_=l(_,T,w,R,v,9,a[17]),R=l(R,_,T,w,E,14,a[18]),w=l(w,R,_,T,s,20,a[19]),T=l(T,w,R,_,y,5,a[20]),_=l(_,T,w,R,b,9,a[21]),R=l(R,_,T,w,C,14,a[22]),w=l(w,R,_,T,g,20,a[23]),T=l(T,w,R,_,I,5,a[24]),_=l(_,T,w,R,S,9,a[25]),R=l(R,_,T,w,p,14,a[26]),w=l(w,R,_,T,A,20,a[27]),T=l(T,w,R,_,O,5,a[28]),_=l(_,T,w,R,d,9,a[29]),R=l(R,_,T,w,m,14,a[30]),T=f(T,w=l(w,R,_,T,k,20,a[31]),R,_,y,4,a[32]),_=f(_,T,w,R,A,11,a[33]),R=f(R,_,T,w,E,16,a[34]),w=f(w,R,_,T,S,23,a[35]),T=f(T,w,R,_,u,4,a[36]),_=f(_,T,w,R,g,11,a[37]),R=f(R,_,T,w,m,16,a[38]),w=f(w,R,_,T,b,23,a[39]),T=f(T,w,R,_,O,4,a[40]),_=f(_,T,w,R,s,11,a[41]),R=f(R,_,T,w,p,16,a[42]),w=f(w,R,_,T,v,23,a[43]),T=f(T,w,R,_,I,4,a[44]),_=f(_,T,w,R,k,11,a[45]),R=f(R,_,T,w,C,16,a[46]),T=h(T,w=f(w,R,_,T,d,23,a[47]),R,_,s,6,a[48]),_=h(_,T,w,R,m,10,a[49]),R=h(R,_,T,w,S,15,a[50]),w=h(w,R,_,T,y,21,a[51]),T=h(T,w,R,_,k,6,a[52]),_=h(_,T,w,R,p,10,a[53]),R=h(R,_,T,w,b,15,a[54]),w=h(w,R,_,T,u,21,a[55]),T=h(T,w,R,_,A,6,a[56]),_=h(_,T,w,R,C,10,a[57]),R=h(R,_,T,w,v,15,a[58]),w=h(w,R,_,T,O,21,a[59]),T=h(T,w,R,_,g,6,a[60]),_=h(_,T,w,R,E,10,a[61]),R=h(R,_,T,w,d,15,a[62]),w=h(w,R,_,T,I,21,a[63]),o[0]=o[0]+T|0,o[1]=o[1]+w|0,o[2]=o[2]+R|0,o[3]=o[3]+_|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,u=a.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+i+s;return(a<<o|a>>>32-o)+t}function l(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,n,r,i,o,s){var a=e+(t^n^r)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+i+s;return(a<<o|a>>>32-o)+t}n.MD5=o._createHelper(u),n.HmacMD5=o._createHmacHelper(u)}(Math),e.MD5));var e}var ii,oi={exports:{}},si={exports:{}};function ai(){return ii?si.exports:(ii=1,si.exports=(a=Jr(),t=(e=a).lib,n=t.WordArray,r=t.Hasher,i=e.algo,o=[],s=i.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],u=n[4],c=0;c<80;c++){if(c<16)o[c]=0|e[t+c];else{var l=o[c-3]^o[c-8]^o[c-14]^o[c-16];o[c]=l<<1|l>>>31}var f=(r<<5|r>>>27)+u+o[c];f+=c<20?1518500249+(i&s|~i&a):c<40?1859775393+(i^s^a):c<60?(i&s|i&a|s&a)-1894007588:(i^s^a)-899497514,u=a,a=s,s=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=r._createHelper(s),e.HmacSHA1=r._createHmacHelper(s),a.SHA1));var e,t,n,r,i,o,s,a}var ui,ci,li={exports:{}};function fi(){return ci?oi.exports:(ci=1,oi.exports=function(e){return n=(t=e).lib,r=n.Base,i=n.WordArray,o=t.algo,s=o.MD5,a=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),s=i.create(),a=s.words,u=r.keySize,c=r.iterations;a.length<u;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var l=1;l<c;l++)n=o.finalize(n),o.reset();s.concat(n)}return s.sigBytes=4*u,s}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},e.EvpKDF;var t,n,r,i,o,s,a}(Jr(),ai(),ui||(ui=1,li.exports=(e=Jr(),void function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,u=s.words,c=0;c<n;c++)a[c]^=1549556828,u[c]^=909522486;o.sigBytes=s.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()))));var e}var hi,di,pi={exports:{}};var gi=h(qr.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,i=[],o=[],s=[],a=[],u=[],c=[],l=[],f=[],h=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,i[n]=p,o[p]=n;var g=e[n],y=e[g],v=e[y],m=257*e[p]^16843008*p;s[n]=m<<24|m>>>8,a[n]=m<<16|m>>>16,u[n]=m<<8|m>>>24,c[n]=m,m=16843009*v^65537*y^257*g^16843008*n,l[p]=m<<24|m>>>8,f[p]=m<<16|m>>>16,h[p]=m<<8|m>>>24,d[p]=m,n?(n=g^e[e[e[v^g]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s<r;s++)s<n?o[s]=t[s]:(c=o[s-1],s%n?n>6&&s%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[s/n|0]<<24),o[s]=o[s-n]^c);for(var a=this._invKeySchedule=[],u=0;u<r;u++){if(s=r-u,u%4)var c=o[s];else c=o[s-4];a[u]=u<4||s<=4?c:l[i[c>>>24]]^f[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,c,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,f,h,d,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,s,a){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p<u;p++){var g=r[c>>>24]^i[l>>>16&255]^o[f>>>8&255]^s[255&h]^n[d++],y=r[l>>>24]^i[f>>>16&255]^o[h>>>8&255]^s[255&c]^n[d++],v=r[f>>>24]^i[h>>>16&255]^o[c>>>8&255]^s[255&l]^n[d++],m=r[h>>>24]^i[c>>>16&255]^o[l>>>8&255]^s[255&f]^n[d++];c=g,l=y,f=v,h=m}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^n[d++],y=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&c])^n[d++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[d++],m=(a[h>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^n[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});t.AES=n._createHelper(g)}(),e.AES}(Jr(),ei(),ri(),fi(),hi||(hi=1,pi.exports=(di=Jr(),fi(),void(di.lib.Cipher||function(e){var t=di,n=t.lib,r=n.Base,i=n.WordArray,o=n.BufferedBlockAlgorithm,s=t.enc;s.Utf8;var a=s.Base64,u=t.algo.EvpKDF,c=n.Cipher=o.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?m:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});n.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},f=n.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=l.CBC=function(){var t=f.extend();function n(t,n,r){var i,o=this._iv;o?(i=o,this._iv=e):i=this._prevBlock;for(var s=0;s<r;s++)t[n+s]^=i[s]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=o}}),t}(),d=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,o=r<<24|r<<16|r<<8|r,s=[],a=0;a<r;a+=4)s.push(o);var u=i.create(s,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:h,padding:d}),reset:function(){var e;c.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var p=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(a)},parse:function(e){var t,n=a.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=i.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),p.create({ciphertext:n,salt:t})}},y=n.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),s=i.cfg;return p.create({ciphertext:o,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=i.random(8));var o=u.create({keySize:t+n}).compute(e,r),s=i.create(o.words.slice(t),4*n);return o.sigBytes=4*t,p.create({key:o,iv:s,salt:r})}},m=n.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:v}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=y.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()))))),yi={exports:{}},vi=h(yi.exports=function(e){return e.enc.Utf8}(Jr())),mi="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function Ai(){throw new Error("setTimeout has not been defined")}function Ii(){throw new Error("clearTimeout has not been defined")}var bi=Ai,Ei=Ii;function ki(e){if(bi===setTimeout)return setTimeout(e,0);if((bi===Ai||!bi)&&setTimeout)return bi=setTimeout,setTimeout(e,0);try{return bi(e,0)}catch(t){try{return bi.call(null,e,0)}catch(t){return bi.call(this,e,0)}}}"function"==typeof mi.setTimeout&&(bi=setTimeout),"function"==typeof mi.clearTimeout&&(Ei=clearTimeout);var Oi,Si=[],Ci=!1,Ti=-1;function wi(){Ci&&Oi&&(Ci=!1,Oi.length?Si=Oi.concat(Si):Ti=-1,Si.length&&Ri())}function Ri(){if(!Ci){var e=ki(wi);Ci=!0;for(var t=Si.length;t;){for(Oi=Si,Si=[];++Ti<t;)Oi&&Oi[Ti].run();Ti=-1,t=Si.length}Oi=null,Ci=!1,function(e){if(Ei===clearTimeout)return clearTimeout(e);if((Ei===Ii||!Ei)&&clearTimeout)return Ei=clearTimeout,clearTimeout(e);try{Ei(e)}catch(t){try{return Ei.call(null,e)}catch(t){return Ei.call(this,e)}}}(e)}}function _i(e,t){this.fun=e,this.array=t}_i.prototype.run=function(){this.fun.apply(null,this.array)};function Pi(){}var Di=Pi,Li=Pi,Mi=Pi,xi=Pi,Ni=Pi,Bi=Pi,Gi=Pi;var Ui=mi.performance||{},ji=Ui.now||Ui.mozNow||Ui.msNow||Ui.oNow||Ui.webkitNow||function(){return(new Date).getTime()};var Fi=new Date;var Ki,Hi,Qi={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Si.push(new _i(e,t)),1!==Si.length||Ci||ki(Ri)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Di,addListener:Li,once:Mi,off:xi,removeListener:Ni,removeAllListeners:Bi,emit:Gi,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*ji.call(Ui),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Fi)/1e3}},zi={exports:{}};function Vi(){if(Hi)return Ki;Hi=1;var e=1e3,t=60*e,r=60*t,i=24*r,o=7*i,s=365.25*i;function a(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return Ki=function(u,c){c=c||{};var l=n(u);if("string"===l&&u.length>0)return function(n){if((n=String(n)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*t;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(u);if("number"===l&&isFinite(u))return c.long?function(n){var o=Math.abs(n);if(o>=i)return a(n,o,i,"day");if(o>=r)return a(n,o,r,"hour");if(o>=t)return a(n,o,t,"minute");if(o>=e)return a(n,o,e,"second");return n+" ms"}(u):function(n){var o=Math.abs(n);if(o>=i)return Math.round(n/i)+"d";if(o>=r)return Math.round(n/r)+"h";if(o>=t)return Math.round(n/t)+"m";if(o>=e)return Math.round(n/e)+"s";return n+"ms"}(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))},Ki}var qi,Wi,Yi,Xi=function(e){function t(e){var r,i,o,s=null;function a(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(a.enabled){var o=a,s=Number(new Date),u=s-(r||s);o.diff=u,o.prev=r,o.curr=s,r=s,n[0]=t.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var c=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(e,r){if("%%"===e)return"%";c++;var i=t.formatters[r];if("function"==typeof i){var s=n[c];e=i.call(o,s),n.splice(c,1),c--}return e})),t.formatArgs.call(o,n);var l=o.log||t.log;l.apply(o,n)}}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o)},set:function(e){s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){var r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){var e=[].concat(u(t.names.map(r)),u(t.skips.map(r).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){var n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Vi(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(n){t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};qi=zi,(Wi=zi.exports).formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+qi.exports.humanize(this.diff),this.useColors){var t="color: "+this.color;e.splice(1,0,t,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,t)}},Wi.save=function(e){try{e?Wi.storage.setItem("debug",e):Wi.storage.removeItem("debug")}catch(e){}},Wi.load=function(){var e;try{e=Wi.storage.getItem("debug")}catch(e){}return!e&&void 0!==Qi&&"env"in Qi&&(e=Qi.env.DEBUG),e},Wi.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},Wi.storage=function(){try{return localStorage}catch(e){}}(),Wi.destroy=(Yi=!1,function(){Yi||(Yi=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),Wi.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Wi.log=console.debug||console.log||function(){},qi.exports=Xi(Wi),qi.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}};var Ji=zi.exports,$i=Ji("cookie");function Zi(e,t,n){n=n||{};var r=no(e)+"="+no(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.samesite&&(r+="; samesite="+n.samesite),n.secure&&(r+="; secure"),document.cookie=r}function eo(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i<r.length;++i)n[ro((t=r[i].split("="))[0])]=ro(t[1]);return n}(e)}function to(e){return eo()[e]}function no(e){try{return encodeURIComponent(e)}catch(t){$i("error `encode(%o)` - %o",e,t)}}function ro(e){try{return decodeURIComponent(e)}catch(t){$i("error `decode(%o)` - %o",e,t)}}var io=h((function(e,t,n){switch(arguments.length){case 3:case 2:return Zi(e,t,n);case 1:return to(e);default:return eo()}})),oo={exports:{}},so=Math.max,ao=function(e,t){var n=t?t.length:0;if(!n)return[];for(var r=so(Number(e)||0,0),i=so(n-r,0),o=new Array(i),s=0;s<i;s+=1)o[s]=t[s+r];return o},uo=Math.max,co=function(e){if(null==e||!e.length)return[];for(var t=new Array(uo(e.length-2,0)),n=1;n<e.length;n+=1)t[n-1]=e[n];return t},lo=ao,fo=co,ho=Object.prototype.hasOwnProperty,po=Object.prototype.toString,go=function(e){return Boolean(e)&&"object"===n(e)},yo=function(e){return Boolean(e)&&"[object Object]"===po.call(e)},vo=function(e,t,n,r){return ho.call(t,r)&&void 0===e[r]&&(e[r]=n),t},mo=function(e,t,n,r){return ho.call(t,r)&&(yo(e[r])&&yo(n)?e[r]=Io(e[r],n):void 0===e[r]&&(e[r]=n)),t},Ao=function(e,t){if(!go(t))return t;e=e||vo;for(var n=lo(2,arguments),r=0;r<n.length;r+=1)for(var i in n[r])e(t,n[r],n[r][i],i);return t},Io=function(e){return Ao.apply(null,[mo,e].concat(fo(arguments)))};oo.exports=function(e){return Ao.apply(null,[null,e].concat(fo(arguments)))},oo.exports.deep=Io;var bo=h(oo.exports),Eo={exports:{}},ko=Ji("cookie"),Oo=function(e,t,n){switch(arguments.length){case 3:case 2:return So(e,t,n);case 1:return To(e);default:return Co()}};function So(e,t,n){n=n||{};var r=wo(e)+"="+wo(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.secure&&(r+="; secure"),document.cookie=r}function Co(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i<r.length;++i)n[Ro((t=r[i].split("="))[0])]=Ro(t[1]);return n}(e)}function To(e){return Co()[e]}function wo(e){try{return encodeURIComponent(e)}catch(t){ko("error `encode(%o)` - %o",e,t)}}function Ro(e){try{return decodeURIComponent(e)}catch(t){ko("error `decode(%o)` - %o",e,t)}}!function(e,t){var n=Oo;function r(e){for(var n=t.cookie,r=t.levels(e),i=0;i<r.length;++i){var o="__tld__",s=r[i],a={domain:"."+s};if(n(o,1,a),n(o))return n(o,null,a),s}return""}r.levels=function(e){var t,n,r=("function"!=typeof window.URL?(t=e,(n=document.createElement("a")).href=t,n.hostname):new URL(e).hostname).split("."),i=r[r.length-1],o=[];if(4===r.length&&i===parseInt(i,10))return o;if(r.length<=1)return o;for(var s=r.length-2;s>=0;--s)o.push(r.slice(s).join("."));return o},r.cookie=n,t=e.exports=r}(Eo,Eo.exports);var _o=h(Eo.exports),Po=new(function(){function e(t){r(this,e),this.cOpts={},this.options(t),this.isSupportAvailable=this.checkSupportAvailability()}return o(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this.cOpts;var t=".".concat(_o(window.location.href));return"."===t&&(t=null),this.cOpts=bo(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),this.cOpts}},{key:"set",value:function(e,t){try{return io(e,t,C(this.cOpts)),!0}catch(e){return lt.error(e),!1}}},{key:"get",value:function(e){return io(e)}},{key:"remove",value:function(e){try{return io(e,null,C(this.cOpts)),!0}catch(e){return!1}}},{key:"checkSupportAvailability",value:function(){var e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}]),e}())({}),Do={exports:{}},Lo=h(Do.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(t){return e}}function r(e){return"[object Function]"==={}.toString.call(e)}function i(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(t){var r={_data:{},setItem:function(e,t){return r._data[e]=String(t)},getItem:function(e){return r._data.hasOwnProperty(e)?r._data[e]:void 0},removeItem:function(e){return delete r._data[e]},clear:function(){return r._data={}}};e=r}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var s=o();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))s.setItem(n,t(r));else if(e(n))for(var i in n)this.set(i,n[i]);return this},get:function(e){if(!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 r=arguments;if(r.length>1){for(var i={},o=0,a=r.length;o<a;o++){var u=n(s.getItem(r[o]));this.has(r[o])&&(i[r[o]]=u)}return i}return n(s.getItem(e))},clear:function(){return s.clear(),this},remove:function(e){var t=this.get(e);return s.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=s.length;t<n;t++){var r=s.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,i=t.length;r<i;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n}};var u=null;function c(t,n){var o=arguments,s=null;if(u||(u=a()),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&&r(n)&&(s=null,s=n(t,u.get(t)),c.set(t,s))}if(2===o.length&&i(t)&&r(n))for(var l=0,f=t.length;l<f;l++)s=n(t[l],u.get(t[l])),c.set(t[l],s);return c}for(var l in a.prototype)c[l]=a.prototype[l];return c}()),Mo=new(function(){function e(t){r(this,e),this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(t)}return o(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===arguments.length||(bo(e,{enabled:!0}),this.enabled=e.enabled&&this.enabled,this.sOpts=e),this.sOpts}},{key:"set",value:function(e,t){return Lo.set(e,t)}},{key:"get",value:function(e){return Lo.get(e)}},{key:"remove",value:function(e){return Lo.remove(e)}},{key:"checkSupportAvailability",value:function(){var e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}]),e}())({}),xo=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},No="rl_user_id",Bo="rl_trait",Go="rl_anonymous_id",Uo="rl_group_id",jo="rl_group_trait",Fo="rl_page_init_referrer",Ko="rl_page_init_referring_domain",Ho="rl_session",Qo="rl_auth_token",zo="RudderEncrypt:",Vo="RS_ENC_v3_",qo="Rudder",Wo={segment:"ajs_anonymous_id"};function Yo(e){try{return e?JSON.parse(e):null}catch(t){return lt.error(t),e||null}}function Xo(e){return e.replace(/^\s+|\s+$/gm,"")}function Jo(e){return e&&"string"==typeof e&&""!==Xo(e)?e.substring(0,zo.length)===zo?gi.decrypt(e.substring(zo.length),qo).toString(vi):e.substring(0,Vo.length)===Vo?xo(e.substring(Vo.length)):e:e}var $o=function(){function e(){r(this,e),Po.isSupportAvailable?this.storage=Po:(Mo.enabled&&(this.storage=Mo),this.storage||lt.error("No storage is available :: initializing the SDK without storage"))}return o(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.storage.options(e)}},{key:"setItem",value:function(e,t){this.storage.set(e,function(e){return""===Xo(e)?e:"".concat(zo).concat(gi.encrypt(e,qo).toString())}(function(e){return JSON.stringify(e)}(t)))}},{key:"setStringItem",value:function(e,t){"string"==typeof t?this.setItem(e,t):lt.error("[Storage] ".concat(e," should be string"))}},{key:"setUserId",value:function(e){this.setStringItem(No,e)}},{key:"setUserTraits",value:function(e){this.setItem(Bo,e)}},{key:"setGroupId",value:function(e){this.setStringItem(Uo,e)}},{key:"setGroupTraits",value:function(e){this.setItem(jo,e)}},{key:"setAnonymousId",value:function(e){this.setStringItem(Go,e)}},{key:"setInitialReferrer",value:function(e){this.setItem(Fo,e)}},{key:"setInitialReferringDomain",value:function(e){this.setItem(Ko,e)}},{key:"setSessionInfo",value:function(e){this.setItem(Ho,e)}},{key:"setAuthToken",value:function(e){this.setItem(Qo,e)}},{key:"getItem",value:function(e){return Yo(Jo(this.storage.get(e)))}},{key:"getUserId",value:function(){return this.getItem(No)}},{key:"getUserTraits",value:function(){return this.getItem(Bo)}},{key:"getGroupId",value:function(){return this.getItem(Uo)}},{key:"getGroupTraits",value:function(){return this.getItem(jo)}},{key:"fetchExternalAnonymousId",value:function(e){var t,n=e.toLowerCase();return Object.keys(Wo).includes(n)&&"segment"===n?(Mo.enabled&&(t=Mo.get(Wo[n])),!t&&Po.isSupportAvailable&&(t=Po.get(Wo[n])),t):t}},{key:"getAnonymousId",value:function(e){var t=Yo(Jo(this.storage.get(Go)));if(t)return t;var n=N(e,"autoCapture.source");if(!0===N(e,"autoCapture.enabled")&&"string"==typeof n){var r=this.fetchExternalAnonymousId(n);if(r)return r}return t}},{key:"getInitialReferrer",value:function(){return this.getItem(Fo)}},{key:"getInitialReferringDomain",value:function(){return this.getItem(Ko)}},{key:"getSessionInfo",value:function(){return this.getItem(Ho)}},{key:"getAuthToken",value:function(){return this.getItem(Qo)}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"removeSessionInfo",value:function(){this.removeItem(Ho)}},{key:"clear",value:function(e){this.storage.remove(No),this.storage.remove(Bo),this.storage.remove(Uo),this.storage.remove(jo),this.storage.remove(Qo),e&&this.storage.remove(Go)}}]),e}(),Zo=new $o;function es(){return document.referrer||"$direct"}function ts(e){var t=e.split("/");return t.length>=3?t[2]:""}function ns(){for(var e=document.getElementsByTagName("link"),t=0;e[t];t+=1){var n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function rs(){var e=ns(),t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}var n=window.location,r=n.search,i=n.href,o=document.title,s=function(e){var t,n=ns(),r=(t=n?n.includes("?")?n:n+e:window.location.href).indexOf("#");return r>-1?t.slice(0,r):t}(r),a=i,u=es();return{path:t,referrer:u,referring_domain:ts(u),search:r,title:o,url:s,tab_url:a,initial_referrer:Zo.getInitialReferrer()||"",initial_referring_domain:Zo.getInitialReferringDomain()||""}}for(var is,os=o((function e(){r(this,e),this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.41.0"})),ss=o((function e(){r(this,e),this.name="RudderLabs JavaScript SDK",this.version="2.41.0"})),as=o((function e(){r(this,e),this.name="",this.version=""})),us=o((function e(){r(this,e),this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0})),cs=o((function e(){var t;r(this,e),this.app=new os,this.traits=null,this.library=new ss,this.userAgent=function(){if("undefined"==typeof navigator)return null;var e=navigator.userAgent,t=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}(),this.device=null,this.network=null,this.os=new as,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(t=new us,"undefined"==typeof window||(t.width=window.screen.width,t.height=window.screen.height,t.density=window.devicePixelRatio,t.innerWidth=window.innerWidth,t.innerHeight=window.innerHeight),t)})),ls=function(){function e(){r(this,e),this.channel="web",this.context=new cs,this.type=null,this.messageId=Br(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}}return o(e,[{key:"getProperty",value:function(e){return this.properties[e]}},{key:"addProperty",value:function(e,t){this.properties[e]=t}}]),e}(),fs=function(){function e(){r(this,e),this.message=new ls}return o(e,[{key:"setType",value:function(e){this.message.type=e}},{key:"setProperty",value:function(e){this.message.properties=e}},{key:"setUserProperty",value:function(e){this.message.user_properties=e}},{key:"setUserId",value:function(e){this.message.userId=e}},{key:"setEventName",value:function(e){this.message.event=e}},{key:"getElementContent",value:function(){return this.message}}]),e}(),hs=function(){function e(){r(this,e),this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null}return o(e,[{key:"setType",value:function(e){return this.type=e,this}},{key:"build",value:function(){var e=new fs;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}]),e}(),ds={},ps=256,gs=[];ps--;)gs[ps]=(ps+256).toString(16).substring(1);ds.v4=function(){var e,t=0,n="";if(!is||ps+16>256){for(is=Array(t=256);t--;)is[t]=256*Math.random()|0;t=ps=0}for(;t<16;t++)e=is[ps+t],n+=6==t?gs[15&e|64]:8==t?gs[63&e|128]:gs[e],1&t&&t>1&&t<11&&(n+="-");return ps++,n};var ys={},vs=Object.prototype.hasOwnProperty,ms=String.prototype.charAt,As=Object.prototype.toString,Is=function(e,t){return ms.call(e,t)},bs=function(e,t){return vs.call(e,t)},Es=function(e,t){t=t||bs;for(var n=[],r=0,i=e.length;r<i;r+=1)t(e,r)&&n.push(String(r));return n},ks=function(e){return null==e?[]:(t=e,"[object String]"===As.call(t)?Es(e,Is):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?Es(e,bs):function(e,t){t=t||bs;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t},Os=ks,Ss=ds.v4,Cs={_data:{},length:0,setItem:function(e,t){return this._data[e]=t,this.length=Os(this._data).length,t},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(e){return e in this._data&&delete this._data[e],this.length=Os(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(e){return Os(this._data)[e]}};ys.defaultEngine=function(){try{if(!window.localStorage)return!1;var e=Ss();window.localStorage.setItem(e,"test_value");var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===t}catch(e){return!1}}()?window.localStorage:Cs,ys.inMemoryEngine=Cs;var Ts=ks,ws=Object.prototype.toString,Rs="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===ws.call(e)},_s=function(e){return null!=e&&(Rs(e)||"function"!==e&&function(e){var t=n(e);return"number"===t||"object"===t&&"[object Number]"===ws.call(e)}(e.length))},Ps=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},Ds=function(e,t){for(var n=Ts(t),r=0;r<n.length&&!1!==e(t[n[r]],n[r],t);r+=1);},Ls=function(e,t){return(_s(t)?Ps:Ds).call(this,e,t)},Ms=ys.defaultEngine,xs=ys.inMemoryEngine,Ns=Ls,Bs=ks,Gs=JSON;function Us(e,t,n,r){this.id=t,this.name=e,this.keys=n||{},this.engine=r||Ms,this.originalEngine=this.engine}Us.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,Gs.stringify(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},Us.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:Gs.parse(t)}catch(e){return null}},Us.prototype.getOriginalEngine=function(){return this.originalEngine},Us.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},Us.prototype._createValidKey=function(e){var t,n=this.name,r=this.id;return Bs(this.keys).length?(Ns((function(i){i===e&&(t=[n,r,e].join("."))}),this.keys),t):[n,r,e].join(".")},Us.prototype._swapEngine=function(){var e=this;Ns((function(t){var n=e.get(t);xs.setItem([e.name,e.id,t].join("."),n),e.remove(t)}),this.keys),this.engine=xs};var js=Us;var Fs=Ls,Ks={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},Hs=Ks,Qs={ASAP:1,RESCHEDULE:2,ABANDON:3};function zs(){this.tasks={},this.nextId=1}zs.prototype.now=function(){return+new Hs.Date},zs.prototype.run=function(e,t,n){var r=this.nextId++;return this.tasks[r]=Hs.setTimeout(this._handle(r,e,t,n||Qs.ASAP),t),r},zs.prototype.cancel=function(e){this.tasks[e]&&(Hs.clearTimeout(this.tasks[e]),delete this.tasks[e])},zs.prototype.cancelAll=function(){Fs(Hs.clearTimeout,this.tasks),this.tasks={}},zs.prototype._handle=function(e,t,n,r){var i=this,o=i.now();return function(){if(delete i.tasks[e],!(r>=Qs.RESCHEDULE&&o+2*n<i.now()))return t();r===Qs.RESCHEDULE&&i.run(t,n,r)}},zs.setClock=function(e){Hs=e},zs.resetClock=function(){Hs=Ks},zs.Modes=Qs;var Vs=zs,qs=ds.v4,Ws=js,Ys=Ls,Xs=Vs,Js=Ji("localstorage-retry");function $s(e,t){return function(){return e.apply(t,arguments)}}function Zs(e,t,n){"function"==typeof t&&(n=t),this.name=e,this.id=qs(),this.fn=n,this.maxItems=t.maxItems||1/0,this.maxAttempts=t.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:t.minRetryDelay||1e3,MAX_RETRY_DELAY:t.maxRetryDelay||3e4,FACTOR:t.backoffFactor||2,JITTER:t.backoffJitter||0},this.timeouts={ACK_TIMER:1e3,RECLAIM_TIMER:3e3,RECLAIM_TIMEOUT:1e4,RECLAIM_WAIT:500},this.keys={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack"},this._schedule=new Xs,this._processId=0,this._store=new Ws(this.name,this.id,this.keys),this._store.set(this.keys.IN_PROGRESS,{}),this._store.set(this.keys.QUEUE,[]),this._ack=$s(this._ack,this),this._checkReclaim=$s(this._checkReclaim,this),this._processHead=$s(this._processHead,this),this._running=!1}g(Zs.prototype),Zs.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},Zs.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},Zs.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},Zs.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},Zs.prototype.addItem=function(e){this._enqueue({item:e,attemptNumber:0,time:this._schedule.now(),id:qs()})},Zs.prototype.requeue=function(e,t,n,r){this.shouldRetry(e,t,n)?this._enqueue({item:e,attemptNumber:t,time:this._schedule.now()+this.getDelay(t),id:r||qs()}):this.emit("discard",e,t)},Zs.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},Zs.prototype._processHead=function(){var e=this,t=this._store;this._schedule.cancel(this._processId);var n=t.get(this.keys.QUEUE)||[],r=t.get(this.keys.IN_PROGRESS)||{},i=this._schedule.now(),o=[];function s(n,r){o.push({item:n.item,done:function(i,o){var s=t.get(e.keys.IN_PROGRESS)||{};delete s[r],t.set(e.keys.IN_PROGRESS,s),e.emit("processed",i,o,n.item),i&&e.requeue(n.item,n.attemptNumber+1,i,n.id)}})}for(var a=Object.keys(r).length;n.length&&n[0].time<=i&&a++<e.maxItems;){var u=n.shift(),c=qs();r[c]={item:u.item,attemptNumber:u.attemptNumber,time:e._schedule.now()},s(u,c)}t.set(this.keys.QUEUE,n),t.set(this.keys.IN_PROGRESS,r),Ys((function(t){try{e.fn(t.item,t.done)}catch(e){Js("Process function threw error: "+e)}}),o),n=t.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),n.length>0&&(this._processId=this._schedule.run(this._processHead,n[0].time-i,Xs.Modes.ASAP))},Zs.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER,Xs.Modes.ASAP)},Zs.prototype._checkReclaim=function(){var e=this;Ys((function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)<e.timeouts.RECLAIM_TIMEOUT||function(t){t.set(e.keys.RECLAIM_START,e.id),t.set(e.keys.ACK,e._schedule.now()),e._schedule.run((function(){t.get(e.keys.RECLAIM_START)===e.id&&(t.set(e.keys.RECLAIM_END,e.id),e._schedule.run((function(){t.get(e.keys.RECLAIM_END)===e.id&&t.get(e.keys.RECLAIM_START)===e.id&&e._reclaim(t.id)}),e.timeouts.RECLAIM_WAIT,Xs.Modes.ABANDON))}),e.timeouts.RECLAIM_WAIT,Xs.Modes.ABANDON)}(t))}),function(t){for(var n=[],r=e._store.getOriginalEngine(),i=0;i<r.length;i++){var o=r.key(i);if(null!==o){var s=o.split(".");3===s.length&&s[0]===t&&"ack"===s[2]&&n.push(new Ws(t,s[1],e.keys))}}return n}(this.name)),this._schedule.run(this._checkReclaim,this.timeouts.RECLAIM_TIMER,Xs.Modes.RESCHEDULE)},Zs.prototype._reclaim=function(e){var t=this,n=new Ws(this.name,e,this.keys),r={queue:this._store.get(this.keys.QUEUE)||[]},i={inProgress:n.get(this.keys.IN_PROGRESS)||{},queue:n.get(this.keys.QUEUE)||[]},o=[],s=function(e,n){Ys((function(e){var i=e.id||qs();o.indexOf(i)>=0?t.emit("duplication",e.item,e.attemptNumber):(r.queue.push({item:e.item,attemptNumber:e.attemptNumber+n,time:t._schedule.now(),id:i}),o.push(i))}),e)};s(i.queue,0),s(i.inProgress,1),r.queue=r.queue.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,r.queue);try{this._clearOtherQueue(n,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(n,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},Zs.prototype._clearOtherQueue=function(e,t){var n=this;setTimeout((function(){e.remove(n.keys.IN_PROGRESS),setTimeout((function(){e.remove(n.keys.QUEUE),setTimeout((function(){e.remove(n.keys.RECLAIM_START),setTimeout((function(){e.remove(n.keys.RECLAIM_END),setTimeout((function(){e.remove(n.keys.ACK)}),t)}),t)}),t)}),t)}),t)};var ea=h(Zs),ta={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100},na=function(){function e(){r(this,e),this.url="",this.writeKey=""}return o(e,[{key:"init",value:function(e,t,n){var r=this;this.url=t,this.writeKey=e,n&&a(ta,n),this.payloadQueue=new ea("rudder",ta,(function(e,t){e.message.sentAt=Gr(),r.processQueueElement(e.url,e.headers,e.message,1e4,(function(e,n){if(e)return t(e);t(null,n)}))})),this.payloadQueue.start()}},{key:"processQueueElement",value:function(e,t,n,r,i){try{var o=new XMLHttpRequest;for(var s in o.open("POST",e,!0),t)o.setRequestHeader(s,t[s]);o.timeout=r,o.ontimeout=i,o.onerror=i,o.onreadystatechange=function(){if(4===o.readyState)if(429===o.status||o.status>=500&&o.status<600){var t="".concat("Request failed with status:",' "').concat(o.status,'" status text: "').concat(o.statusText,'" for URL: "').concat(e,'"'),n=new Error(t);xr(n),i(n)}else i(null,o.status)},o.send(Dr(n,!0))}catch(e){i(e)}}},{key:"enqueue",value:function(e,t){var n={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(this.writeKey,":"))),AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:"".concat(this.url,"/v1/").concat(t),headers:n,message:e})}}]),e}(),ra="queue",ia=64e3,oa=function(){function e(){r(this,e),this.storage=Mo,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName="".concat(ra,".").concat(Date.now())}return o(e,[{key:"sendQueueDataForBeacon",value:function(){this.sendDataFromQueueAndDestroyQueue()}},{key:"init",value:function(e,t,n){this.url=t,this.writekey=e,n.maxItems&&(this.maxItems=n.maxItems),n.flushQueueInterval&&(this.flushQueueTimeOutInterval=n.flushQueueInterval),this.sendQueueDataForBeacon=this.sendQueueDataForBeacon.bind(this),this.attachListeners()}},{key:"attachListeners",value:function(){var e=this;window.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.sendQueueDataForBeacon()}))}},{key:"getQueue",value:function(){return this.storage.get(this.queueName)}},{key:"setQueue",value:function(e){this.storage.set(this.queueName,e)}},{key:"enqueue",value:function(e){var t=this.getQueue()||[];(t=t.slice(-(this.maxItems-1))).push(e);var n=t.slice(0);Dr({batch:n},!0).length>ia&&(n=t.slice(0,t.length-1),this.flushQueue(n),(t=this.getQueue()).push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}},{key:"sendDataFromQueueAndDestroyQueue",value:function(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}},{key:"sendDataFromQueue",value:function(){var e=this.getQueue();if(e&&e.length>0){var t=e.slice(0,e.length);this.flushQueue(t)}}},{key:"flushQueue",value:function(e){if(e&&e.length>0){e.forEach((function(e){e.sentAt=(new Date).toISOString()}));var t=Dr({batch:e},!0),n=new Blob([t],{type:"text/plain"}),r="".concat(this.url,"?writeKey=").concat(this.writekey);try{"function"!=typeof navigator.sendBeacon&&xr(new Error("Beacon API is not supported by browser")),navigator.sendBeacon(r,n)||xr(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message="".concat(e.message," - While sending Beacon data to: ").concat(r),xr(e)}}this.setQueue([]),this.clearTimer()}},{key:"setTimer",value:function(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}},{key:"clearTimer",value:function(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}]),e}(),sa=function(){function e(){r(this,e),this.queue=void 0}return o(e,[{key:"initialize",value:function(e,t,r){var i={},o=Nr(t);r&&r.useBeacon&&navigator.sendBeacon?(r.beaconQueueOptions&&null!=r.beaconQueueOptions&&"object"===n(r.beaconQueueOptions)&&(i=r.beaconQueueOptions),o="".concat(o,"/beacon/v1/batch"),this.queue=new oa):(r&&r.useBeacon&&lt.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),r&&r.queueOptions&&null!=r.queueOptions&&"object"===n(r.queueOptions)&&(i=r.queueOptions),this.queue=new na),this.queue.init(e,o,i)}},{key:"enqueue",value:function(e,t){var n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||Gr(),n.sentAt=Gr(),Dr(n,!0).length>32e3&&lt.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}}]),e}(),aa=new sa,ua={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0},ca=function(){function e(){r(this,e),this.callback=void 0,this.processQueueElements=!1}return o(e,[{key:"init",value:function(e,t){var n=this;e&&a(ua,e),t&&(this.callback=t),this.payloadQueue=new ea("rs_events",ua,(function(e,t){n.processQueueElement(e.type,e.rudderElement,(function(e,n){if(e)return t(e);t(null,n)}))})),this.payloadQueue.start()}},{key:"activateProcessor",value:function(){this.processQueueElements=!0}},{key:"processQueueElement",value:function(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,fs.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}},{key:"enqueue",value:function(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}]),e}(),la=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r=document.getElementById(e);if(r)return;var i=document.createElement("script");i.src=t,i.async=void 0===n.async||n.async,i.type="text/javascript",i.id=e,!0!==n.skipDatasetAttributes&&(i.setAttribute("data-loader","RS_JS_SDK"),void 0!==n.isNonNativeSDK&&i.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));var o=document.getElementsByTagName("head");if(o.length>0)o[0].insertBefore(i,o[0].firstChild);else{var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(i,s)}}catch(s){xr(s)}},fa=function(){return navigator&&navigator.language},ha=function(){return navigator&&navigator.userAgent};function da(e){return decodeURIComponent(atob(e).split("").map((function(e){return"%".concat("00".concat(e.charCodeAt(0).toString(16)).slice(-2))})).join(""))}function pa(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return da(e=e.endsWith("..")?e.substr(0,e.length-2):e)}var ga=/^[a-zA-Z0-9\-_.]+$/;function ya(e,t,n,r){var i=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join("*")}(n,r),o=t||0,s=function(e){for(var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),n=-1,r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([i,Math.floor(Date.now()/6e4)-o,e].join("*"));return s.toString(36)}function va(e){var t=function(e){var t=e.split("*"),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join("*")}}(e);if(!t)return null;var n=t.checksum,r=t.serializedIds;return function(e,t){for(var n=ha(),r=fa(),i=0;i<=1;i+=1)if(ya(e,i,n,r)===t)return!0;return!1}(r,n)?function(e){for(var t={},n=e.split("*"),r=0;r<n.length;r+=2){var i=n[r];if(ga.test(i)){var o=pa(n[r+1]);t[i]=o}}return t}(r):null}var ma={HS:"HubSpot",GA:"GA",HOTJAR:"Hotjar",GOOGLEADS:"GoogleAds",VWO:"VWO",GTM:"GoogleTagManager",BRAZE:"Braze",INTERCOM:"INTERCOM",KEEN:"Keen",KISSMETRICS:"Kissmetrics",CUSTOMERIO:"CustomerIO",CHARTBEAT:"Chartbeat",COMSCORE:"Comscore",FACEBOOK_PIXEL:"FacebookPixel",LOTAME:"Lotame",OPTIMIZELY:"Optimizely",BUGSNAG:"Bugsnag",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"GA4",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"Posthog",KLAVIYO:"Klaviyo",CLEVERTAP:"Clevertap",BINGADS:"BingAds",PINTEREST_TAG:"PinterestTag",ADOBE_ANALYTICS:"AdobeAnalytics",LINKEDIN_INSIGHT_TAG:"LinkedInInsightTag",REDDIT_PIXEL:"RedditPixel",DRIP:"Drip",HEAP:"Heap",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",PROFITWELL:"ProfitWell",SENTRY:"Sentry",QUANTUMMETRIC:"QuantumMetric",SNAP_PIXEL:"SnapPixel",POST_AFFILIATE_PRO:"PostAffiliatePro",GOOGLE_OPTIMIZE:"GoogleOptimize",LAUNCHDARKLY:"LaunchDarkly",GA360:"GA360",ADROLL:"Adroll",DCM_FLOODLIGHT:"DCMFloodlight",MATOMO:"Matomo",VERO:"Vero",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"QuoraPixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"YandexMetrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"MicrosoftClarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TiktokAds",ACTIVE_CAMPAIGN:"ActiveCampaign"},Aa=function(){function e(){var t=this;if(r(this,e),this.isInitialized=!1,window.OneTrust&&window.OnetrustActiveGroups){this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter((function(e){return e}));var n=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],n.forEach((function(e){var n=e.CustomGroupId,r=e.GroupName;t.userSetConsentGroupIds.includes(n)?t.userSetConsentGroupNames.push(r.toUpperCase().trim()):t.userDeniedConsentGroupIds.push(n)})),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map((function(e){return e.toUpperCase()})),this.isInitialized=!0}else lt.error("OneTrust resources are not accessible.")}return o(e,[{key:"isEnabled",value:function(e){var t=this;try{if(!this.isInitialized)return!0;var n=e.oneTrustCookieCategories;if(!n)return!0;var r=n.map((function(e){return e.oneTrustCookieCategory})).filter((function(e){return e}));return r.every((function(e){return t.userSetConsentGroupIds.includes(e.toUpperCase().trim())||t.userSetConsentGroupNames.includes(e.toUpperCase().trim())}))}catch(e){return lt.error("Error during onetrust cookie consent management ".concat(e)),!0}}},{key:"getDeniedList",value:function(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}]),e}(),Ia=function(){function e(){var t=this;if(r(this,e),this.updatePurposes=function(e){e&&Object.entries(e).forEach((function(e){var n=e[0];e[1]?t.userConsentedPurposes.push(n):t.userDeniedPurposes.push(n)}))},this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=function(e){e&&(t.userConsentedPurposes=[],t.userDeniedPurposes=[],t.updatePurposes(e))},window.getKetchUserConsentedPurposes=function(){return t.userConsentedPurposes.slice()},window.getKetchUserDeniedPurposes=function(){return t.userDeniedPurposes.slice()},window.ketchConsent)this.updatePurposes(window.ketchConsent);else{var n=this.getConsent();this.updatePurposes(n)}}return o(e,[{key:"isEnabled",value:function(e){var t=this;try{var n=e.ketchConsentPurposes;if(!n||0===n.length)return!0;var r=n.map((function(e){return e.purpose})).filter((function(e){return e}));return r.some((function(e){return t.userConsentedPurposes.includes(e.trim())}))}catch(e){return lt.error("Error occured checking ketch consent state ".concat(e)),!0}}},{key:"getDeniedList",value:function(){return this.userDeniedPurposes}},{key:"getConsent",value:function(){var e=Po.get("_ketch_consent_v1_");if(e){var t;try{t=JSON.parse(atob(e))}catch(e){return void lt.error("Error occured while parsing consent cookie ".concat(e))}if(t){var n={};return Object.entries(t).forEach((function(e){var t=e[0],r=e[1];r&&r.status&&(n[t]="granted"===r.status)})),n}}}}]),e}(),ba=function(e){var t,n;return null!=e&&null!==(t=e.oneTrust)&&void 0!==t&&t.enabled?new Aa:null!=e&&null!==(n=e.ketch)&&void 0!==n&&n.enabled?new Ia:null},Ea=function(){function e(){r(this,e),this.storage=Zo,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}}return o(e,[{key:"initialize",value:function(e){try{var t;if(this.sessionInfo.autoTrack=!(!1===(null==e||null===(t=e.sessions)||void 0===t?void 0:t.autoTrack)||this.sessionInfo.manualTrack),null!=e&&e.sessions&&!isNaN(e.sessions.timeout)){var n=e.sessions.timeout;0===n&&(lt.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),n>0&&n<1e4&&lt.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=n}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){xr(e)}}},{key:"isValidSession",value:function(e){return e<=this.sessionInfo.expiresAt}},{key:"generateSessionId",value:function(){return Date.now()}},{key:"startAutoTracking",value:function(){var e=Date.now();this.isValidSession(e)||(this.sessionInfo={},this.sessionInfo.id=e,this.sessionInfo.expiresAt=e+this.timeout,this.sessionInfo.sessionStart=!0,this.sessionInfo.autoTrack=!0),this.storage.setSessionInfo(this.sessionInfo)}},{key:"validateSessionId",value:function(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;lt.error('[Session]:: "sessionId" should at least be "'.concat(10,'" digits long'))}else lt.error('[Session]:: "sessionId" should only be a positive integer')}},{key:"start",value:function(e){var t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}},{key:"getSessionId",value:function(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}},{key:"end",value:function(){this.sessionInfo={},this.storage.removeSessionInfo()}},{key:"getSessionInfo",value:function(){var e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){var t=Date.now();this.isValidSession(t)?this.sessionInfo.expiresAt=t+this.timeout:this.startAutoTracking()}this.sessionInfo.sessionStart&&(e.sessionStart=!0,this.sessionInfo.sessionStart=!1),e.sessionId=this.sessionInfo.id,this.storage.setSessionInfo(this.sessionInfo)}return e}},{key:"reset",value:function(){var e=this.sessionInfo,t=e.manualTrack;e.autoTrack?(this.sessionInfo={},this.startAutoTracking()):t&&this.start()}}]),e}(),ka=new Ea,Oa=["integrations","anonymousId","originalTimestamp"],Sa=["Bugsnag","bugsnag"],Ca="0d96a60df267f4a13f808bbaa54e535c",Ta=["rudder-analytics.min.js","rudder-analytics-staging.min.js","rudder-analytics.js"].concat(u(Object.keys(ma).map((function(e){return"".concat(ma[e],".min.js")}))),u(Object.keys(ma).map((function(e){return"".concat(ma[e],"-staging.min.js")}))),u(Object.keys(ma).map((function(e){return"".concat(ma[e],".js")})))),wa=function(e){var t=e&&e._client&&e._client._notifier&&e._client._notifier.version;if(!t){var n=e({apiKey:Ca,releaseStage:"version-test",beforeSend:function(){return!1}});t=n.notifier&&n.notifier.version,n=void 0}return t&&"6"===t.charAt(0)},Ra=function(e){Sa.every((function(e){return!function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}(window,e)}))&&la(e,"https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js",{isNonNativeSDK:"true",skipDatasetAttributes:!0})},_a=function(){function e(t,n){r(this,e),this.pluginName="rs-bugsnag",this.sourceId=t,this.onClientReady=n,this.initClientOnLibReadyInterval=void 0,this.init()}return o(e,[{key:"init",value:function(){var e=this;if(!window.RudderStackGlobals||!window.RudderStackGlobals.errorReporting){if(!Ca.match(/{{.+}}/)){Ra(this.pluginName);var t=window.bugsnag;"function"!=typeof t?(this.initClientOnLibReadyInterval=setInterval((function(){var t=window.bugsnag;"function"==typeof t&&(wa(t)&&e.initClient(),clearInterval(e.initClientOnLibReadyInterval))}),100),setTimeout((function(){clearInterval(e.initClientOnLibReadyInterval)}),1e4)):wa(t)&&this.initClient()}}}},{key:"initClient",value:function(){var e,t=window.bugsnag;this.client=t({apiKey:Ca,appVersion:"2.41.0",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:(e=window.location.hostname,e&&["www.rs-unit-test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production"),networkBreadcrumbsEnabled:!1}),this.onClientReady()}},{key:"onError",value:function(){var e=this.sourceId;return function(t){try{return!!function(e){var t=N(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;var n=t.substring(t.lastIndexOf("/")+1);return Ta.includes(n)}(t)&&(function(e,t){e.updateMetaData("source",{metadataSource:t});var n=e.errorMessage;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"}(t,e),!0)}catch(e){return!1}}}},{key:"notify",value:function(e){this.client&&this.client.notify(e)}},{key:"leaveBreadcrumb",value:function(e){this.client&&this.client.leaveBreadcrumb(e)}}]),e}(),Pa=["rs-bugsnag"],Da=function(){function e(t){r(this,e),this.isEnabled=!1,this.providerName="rs-bugsnag",this.provider=void 0,this.logger=t,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)}return o(e,[{key:"init",value:function(e,t){e&&t?!0===function(e){return N(e,"statsCollection.errors.enabled")||!1}(e)?(this.enable(),this.setProviderName(function(e){return N(e,"statsCollection.errors.provider")}(e)),this.initProvider(e,t)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}},{key:"setProviderName",value:function(e){e?!e||Pa.includes(e)?this.providerName=e:this.logger.error("[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ".concat(Pa.join(","))):this.providerName="rs-bugsnag"}},{key:"initProvider",value:function(e,t){if("rs-bugsnag"===this.providerName)this.provider=new _a(t,this.onClientReady)}},{key:"onClientReady",value:function(){this.exposeToGlobal()}},{key:"exposeToGlobal",value:function(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals.errorReporting=this}},{key:"leaveBreadcrumb",value:function(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error("[Analytics] ErrorReporting :: leaveBreadcrumb method ".concat(e.toString()))}}},{key:"notify",value:function(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error("[Analytics] ErrorReporting :: notify method ".concat(e.toString()))}}}]),e}(),La=new(function(){function e(){r(this,e),this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null}return o(e,[{key:"init",value:function(e,t,n){this.dataPlaneUrl=Nr(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}},{key:"enqueue",value:function(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}},{key:"sendEventForTransformation",value:function(e,t){var n=this;return new Promise((function(r,i){var o="".concat(n.dataPlaneUrl,"/transform"),s={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(n.writeKey,":")))};try{var a=new XMLHttpRequest;a.open("POST",o,!0),Object.keys(s).forEach((function(e){return a.setRequestHeader(e,s[e])})),a.timeout=1e4,a.onreadystatechange=function(){if(4===a.readyState)try{var o=a.status,s=a.response;switch(o){case 200:return s=JSON.parse(s),void r({status:o,transformedPayload:s.transformedBatch});case 400:var u=s?"".concat(s):"Invalid request payload";return void r({status:o,errorMessage:u});case 404:return void r({status:o});default:if(t>0){var c=t-1;setTimeout((function(){return n.sendEventForTransformation(e,c).then(r).catch(i)}),500*Math.pow(2,n.retryAttempt-c))}else r({status:o,errorMessage:"Retries exhausted"})}}catch(e){i(e)}},a.send(Dr(e,!0))}catch(e){i(e)}}))}},{key:"checkQueueLengthAndProcess",value:function(){this.queue.length>0&&this.process()}},{key:"process",value:function(){var e=this;this.isTransformationProcessing=!0;var t,n,r=this.queue.shift(),i=(t=r.event,n=r.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:n,event:t.message}]});this.sendEventForTransformation(i,this.retryAttempt).then((function(t){e.isTransformationProcessing=!1,r.cb(t),e.checkQueueLengthAndProcess()})).catch((function(t){xr("string"==typeof t?t:t.message),e.isTransformationProcessing=!1,r.cb({status:0}),e.checkQueueLengthAndProcess()}))}},{key:"start",value:function(){var e=this;setInterval((function(){e.isTransformationProcessing||e.checkQueueLengthAndProcess()}),100)}},{key:"setAuthToken",value:function(e){this.authToken=e}}]),e}()),Ma=function(){function e(){r(this,e),this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=Zo,this.eventRepository=aa,this.preProcessQueue=new ca,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallbacks=[],this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1,this.loadIntegration=!0,this.bufferDataPlaneEventsUntilReady=!1,this.dataPlaneEventsBufferTimeout=1e4,this.integrationsData={},this.dynamicallyLoadedIntegrations={},this.destSDKBaseURL=br,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=ka,this.version="2.41.0",this.lockIntegrationsVersion=!1,this.errorReporting=new Da(lt),this.deniedConsentIds=[],this.transformationHandler=La}return o(e,[{key:"initializeUser",value:function(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits=this.storage.getUserTraits()||{},this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits=this.storage.getGroupTraits()||{},this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}},{key:"setInitialPageProperties",value:function(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){var e=es();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain(ts(e))}}},{key:"allModulesInitialized",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(n){e.clientIntegrations.every((function(t){return null!=e.dynamicallyLoadedIntegrations["".concat(ma[t.name]).concat("_RS")]}))||t>=2e4?n(e):e.pause(1e3).then((function(){return e.allModulesInitialized(t+1e3).then(n)}))}))}},{key:"executeReadyCallback",value:function(){this.readyCallbacks.forEach((function(e){return e()}))}},{key:"integrationSDKLoaded",value:function(e,t){return window[e]&&window[e][t]&&window[e][t].prototype&&void 0!==window[e][t].prototype.constructor}},{key:"processResponse",value:function(e,t){var r=this;try{var i=t;try{if("string"==typeof t&&(i=JSON.parse(t)),!i||"object"!==n(i)||Array.isArray(i))return void lt.error("Invalid source configuration")}catch(e){return void xr(e)}try{this.errorReporting.init(i.source.config,i.source.id)}catch(e){xr(e)}if(this.serverUrl=Vr(i,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.loaded=!0,this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),this.options&&"function"==typeof this.options.onLoaded&&this.options.onLoaded(this),function(e){if(e.toBeProcessedArray.length>0)for(;e.toBeProcessedArray.length>0;){var t=u(e.toBeProcessedArray[0]);e.toBeProcessedArray.shift();var n=t[0];t.shift(),e[n].apply(e,u(t))}}(this),i.source.destinations.forEach((function(e){e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config,destinationInfo:{shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,destinationId:e.id}})}),this),this.clientIntegrations=Kr(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{var o=ba(this.cookieConsentOptions);this.deniedConsentIds=o&&o.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter((function(e){return!o||o&&o.isEnabled(e.config)}))}catch(e){xr(e)}this.clientIntegrations=this.clientIntegrations.filter((function(e){return!!ma[e.name]||(lt.error("[Analytics] Integration:: ".concat(e.name," not available for initialization")),!1)}));var s="";Hr().isStaging&&(s="-staging"),this.bufferDataPlaneEventsUntilReady&&setTimeout((function(){r.processBufferedCloudModeEvents()}),this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach((function(e){var t=ma[e.name],n="".concat(t).concat("_RS"),i="".concat(r.destSDKBaseURL,"/").concat(t).concat(s,".min.js");window.hasOwnProperty(n)||la(n,i,{isNonNativeSDK:!0});var o=r,a=setInterval((function(){if(o.integrationSDKLoaded(n,t)){var i,s=window[n];clearInterval(a);try{var u="[Analytics] processResponse :: trying to initialize integration name:: ".concat(n);r.errorReporting.leaveBreadcrumb(u),(i=new s[t](e.config,o,e.destinationInfo)).init(),o.isInitialized(i).then((function(){o.dynamicallyLoadedIntegrations[n]=s[t]}))}catch(e){var c="[Analytics] 'integration.init()' failed :: ".concat(n," :: ").concat(e.message);xr(e,c),o.failedToBeLoadedIntegration.push(i)}}}),100);setTimeout((function(){clearInterval(a)}),1e4)}));var a=this;this.allModulesInitialized().then((function(){if(!a.clientIntegrations||0===a.clientIntegrations.length)return r.clientIntegrationsReady=!0,r.executeReadyCallback(),void(r.toBeProcessedByIntegrationArray=[]);a.replayEvents(a)}))}catch(e){xr(e)}}},{key:"sendDataToDestination",value:function(e,t,n){try{if(e[n]){var r=C(t);e[n](r)}}catch(t){var i="[sendToNative]:: [Destination: ".concat(e.name,"]:: ");xr(t,i)}}},{key:"sendTransformedDataToDestination",value:function(e,t,n){var r=this;try{Fr(t.message.integrations);var i=e.map((function(e){return e.destinationId}));this.transformationHandler.enqueue(t,i,(function(i){var o=i.status,s=i.transformedPayload,a=i.errorMessage;e.forEach((function(e){try{switch(o){case 200:var i=s.find((function(t){return t.id===e.destinationId})),u=[];null==i||i.payload.forEach((function(n){if("200"===n.status)u.push(n);else{var r='[DMT]:: Event transformation unsuccessful for destination "'.concat(e.name,'". Reason: '),i="Unknown";"410"===n.status&&(i="Transformation is not available");var o="Dropping the event",s=lt.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",s=lt.warn,u.push({event:t.message})),s("".concat(r," ").concat(i,". ").concat(o,"."))}})),null==u||u.forEach((function(t){Lr(t.event)&&r.sendDataToDestination(e,{message:t.event},n)}));break;case 404:lt.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),r.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(lt.warn("[DMT]::[Destination: ".concat(e.name,"] :: Transformation request failed with status: ").concat(o," ").concat(a,". Sending untransformed event.")),r.sendDataToDestination(e,t,n)):lt.error("[DMT]::[Destination: ".concat(e.name,"] :: Transformation request failed with status: ").concat(o," ").concat(a,". Dropping the event."))}}catch(t){t instanceof Error&&(t.message="[DMT]::[Destination:".concat(e.name,"]:: ").concat(t.message)),xr(t)}}))}))}catch(e){e instanceof Error&&(e.message="[DMT]:: ".concat(e.message)),xr(e)}}},{key:"processAndSendEventsToDeviceMode",value:function(e,t,n){var r=this,i=[],o=[];e.forEach((function(e){!r.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?o.push(e):i.push(e))})),i.forEach((function(e){r.sendDataToDestination(e,t,n)})),o.length>0&&this.sendTransformedDataToDestination(o,t,n)}},{key:"queueEventForDataPlane",value:function(e,t){var n=t.message.integrations||{All:!0};t.message.integrations=function(e,t){var n=C(e),r=Object.keys(t).filter((function(e){return!(!0===t[e]&&n[e])})).reduce((function(e,n){return e[n]=t[n],e}),{});return Pr(n,r)}(this.integrationsData,n),this.eventRepository.enqueue(t,e)}},{key:"processBufferedCloudModeEvents",value:function(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}},{key:"replayEvents",value:function(e){var t,n,r,i=this;this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration,e.clientIntegrationObjects.every((function(e){return!e.isReady||e.isReady()}))&&(this.integrationsData=(t=this.integrationsData,n=e.clientIntegrationObjects,r=C(t),n.forEach((function(e){if(e.getDataForIntegrationsObject)try{r=Pr(r,e.getDataForIntegrationsObject())}catch(e){lt.debug("[Analytics: prepareDataForIntegrationsObj]",e)}})),r),e.clientIntegrationsReady=!0,e.executeReadyCallback()),this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach((function(t){var n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&jr(t[0].message.integrations);var r=Kr(t[0].message.integrations,e.clientIntegrationObjects);i.processAndSendEventsToDeviceMode(r,t[0],n)})),e.toBeProcessedByIntegrationArray=[]}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"isInitialized",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){e.isLoaded()?(t.successfullyLoadedIntegration.push(e),r(t)):n>=1e4?(t.failedToBeLoadedIntegration.push(e),r(t)):t.pause(1e3).then((function(){return t.isInitialized(e,n+1e3).then(r)}))}))}},{key:"page",value:function(e,t,r,i,o){if(this.errorReporting.leaveBreadcrumb("Page event"),this.loaded){"function"==typeof i&&(o=i,i=null),"function"==typeof r&&(o=r,i=r=null),"function"==typeof t&&(o=t,i=r=t=null),"function"==typeof e&&(o=e,i=r=t=e=null),"object"===n(e)&&null!=e&&null!=e&&(i=t,r=e,t=e=null),"object"===n(t)&&null!=t&&null!=t&&(i=r,r=t,t=null),"string"==typeof e&&"string"!=typeof t&&(t=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!=e&&this.sendSampleRequest();var s=C(r),a=C(i),u=(new hs).setType("page").build();s||(s={}),t&&(u.message.name=s.name=t),e&&(u.message.category=s.category=e),u.message.properties=this.getPageProperties(s),this.processAndSendDataToDestinations("page",u,a,o)}else this.toBeProcessedArray.push(["page"].concat(Array.prototype.slice.call(arguments)))}},{key:"track",value:function(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),this.loaded){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);var i=C(t),o=C(n),s=(new hs).setType("track").build();e&&s.setEventName(e),s.setProperty(i||{}),this.processAndSendDataToDestinations("track",s,o,r)}else this.toBeProcessedArray.push(["track"].concat(Array.prototype.slice.call(arguments)))}},{key:"identify",value:function(e,t,r,i){if(this.errorReporting.leaveBreadcrumb("Identify event"),this.loaded){"function"==typeof r&&(i=r,r=null),"function"==typeof t&&(i=t,r=null,t=null),"object"===n(e)&&(r=t,t=e,e=this.userId);var o=Qr(e);o&&this.userId&&o!==this.userId&&this.reset(),this.userId=o,this.storage.setUserId(this.userId);var s=C(t),a=C(r);if(s){for(var u in s)this.userTraits[u]=s[u];this.storage.setUserTraits(this.userTraits)}var c=(new hs).setType("identify").build();this.processAndSendDataToDestinations("identify",c,a,i)}else this.toBeProcessedArray.push(["identify"].concat(Array.prototype.slice.call(arguments)))}},{key:"alias",value:function(e,t,r,i){if(this.errorReporting.leaveBreadcrumb("Alias event"),this.loaded){"function"==typeof r&&(i=r,r=null),"function"==typeof t&&(i=t,r=null,t=null),"function"==typeof e&&(i=e,r=null,t=null,e=null),"object"===n(t)&&(r=t,t=null),"object"===n(e)&&(r=e,t=null,e=null);var o=(new hs).setType("alias").build();o.message.previousId=Qr(t)||(this.userId?this.userId:this.getAnonymousId()),o.message.userId=Qr(e);var s=C(r);this.processAndSendDataToDestinations("alias",o,s,i)}else this.toBeProcessedArray.push(["alias"].concat(Array.prototype.slice.call(arguments)))}},{key:"group",value:function(e,t,r,i){if(this.errorReporting.leaveBreadcrumb("Group event"),this.loaded){if(0!==arguments.length){"function"==typeof r&&(i=r,r=null),"function"==typeof t&&(i=t,r=null,t=null),"object"===n(e)&&(r=t,t=e,e=this.groupId),"function"==typeof e&&(i=e,r=null,t=null,e=this.groupId),this.groupId=Qr(e),this.storage.setGroupId(this.groupId);var o=C(t),s=C(r),a=(new hs).setType("group").build();if(o)for(var u in o)this.groupTraits[u]=o[u];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",a,s,i)}}else this.toBeProcessedArray.push(["group"].concat(Array.prototype.slice.call(arguments)))}},{key:"IsEventBlackListed",value:function(e,t){if(!e||"string"!=typeof e)return!1;var n=vr[t],r=this.clientIntegrations.find((function(e){return e.name===n})).config,i=r.blacklistedEvents,o=r.whitelistedEvents,s=r.eventFilteringOption;if(!s)return!1;var a=e.trim().toUpperCase();switch(s){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(i)&&i.some((function(e){return e.eventName.trim().toUpperCase()===a}));case"whitelistedEvents":return!Array.isArray(o)||!o.some((function(e){return e.eventName.trim().toUpperCase()===a}))}}},{key:"shouldUseGlobalIntegrationsConfigInEvents",value:function(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}},{key:"processAndSendDataToDestinations",value:function(e,n,r,i){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),n.message.context.traits=t({},this.userTraits),n.message.anonymousId=this.anonymousId,n.message.userId=n.message.userId?n.message.userId:this.userId,"group"==e&&(this.groupId&&(n.message.groupId=this.groupId),this.groupTraits&&(n.message.traits=t({},this.groupTraits)));try{var o=this.uSession.getSessionInfo(),s=o.sessionId,a=o.sessionStart;n.message.context.sessionId=s,a&&(n.message.context.sessionStart=!0)}catch(e){xr(e)}f=this.cookieConsentOptions,h=!1,Object.keys(f).forEach((function(e){Or.includes(e)&&"boolean"==typeof f[e].enabled&&!0===f[e].enabled&&(h=!0)})),h&&(n.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(n,r),function(e,t){var n=e.properties,r=e.traits,i=e.context;n&&Object.keys(n).forEach((function(e){Ar.indexOf(e.toLowerCase())>=0&&lt.error("Warning! : Reserved keyword used in properties--\x3e ".concat(e," with ").concat(t," call"))})),r&&Object.keys(r).forEach((function(e){Ar.indexOf(e.toLowerCase())>=0&&lt.error("Warning! : Reserved keyword used in traits--\x3e ".concat(e," with ").concat(t," call"))}));var o=i.traits;o&&Object.keys(o).forEach((function(e){Ar.indexOf(e.toLowerCase())>=0&&lt.error("Warning! : Reserved keyword used in traits --\x3e ".concat(e," with ").concat(t," call"))}))}(n.message,e);var u=n.message.integrations;u?jr(u):u=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:Tr,n.message.integrations=u;try{n.message.context["ua-ch"]=this.uach}catch(e){xr(e)}if(this.clientIntegrationObjects){var c=Kr(u,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(c,n,e)}else this.toBeProcessedByIntegrationArray.push([e,n]);var l=C(n);Fr(l.message.integrations),!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,l):this.preProcessQueue.enqueue(e,l),i&&"function"==typeof i&&i(l)}catch(e){xr(e)}var f,h}},{key:"utm",value:function(e){var t={};try{var n=new URL(e),r="utm_";n.searchParams.forEach((function(e,n){if(n.startsWith(r)){var i=n.substring(r.length);"campaign"===i&&(i="name"),t[i]=e}}))}catch(e){}return t}},{key:"addCampaignInfo",value:function(e){var t=e.message.context;t&&"object"===n(t)&&(e.message.context.campaign=this.utm(window.location.href))}},{key:"processOptionsParam",value:function(e,r){var i=e.message,o=i.type,a=i.properties;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===o?a:void 0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"===n(t)&&null!==t&&Object.keys(t).forEach((function(n){Oa.includes(n)&&(e[n]=t[n])}))}(e.message,r),e.message.context=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.context;return"object"!==n(r)||null===r||Object.keys(r).forEach((function(e){if(!Oa.includes(e)&&!Sr.includes(e))if("context"!==e)i=Pr(i,s({},e,r[e]));else if("object"===n(r[e])&&null!==r[e]){var o={};Object.keys(r[e]).forEach((function(t){Sr.includes(t)||(o[t]=r[e][t])})),i=Pr(i,t({},o))}else lt.error("[Analytics: processOptionsParam] context passed in options ".concat(e," is not object."))})),i}(e.message,r)}},{key:"getPageProperties",value:function(e,t){var n=rs(),r=t&&t.page||{};for(var i in n)void 0===e[i]&&(e[i]=r[i]||n[i]);return e}},{key:"getContextPageProperties",value:function(e){var t=rs(),n={};for(var r in t)n[r]=e&&e[r]?e[r]:t[r];return n}},{key:"reset",value:function(e){this.errorReporting.leaveBreadcrumb("reset API :: flag: ".concat(e)),this.loaded?(e&&(this.anonymousId=""),this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.uSession.reset(),this.storage.clear(e)):this.toBeProcessedArray.push(["reset",e])}},{key:"getAnonymousId",value:function(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"getUserId",value:function(){return this.userId}},{key:"getSessionId",value:function(){return this.uSession.getSessionId()}},{key:"getUserTraits",value:function(){return this.userTraits}},{key:"getGroupId",value:function(){return this.groupId}},{key:"getGroupTraits",value:function(){return this.groupTraits}},{key:"setAnonymousId",value:function(e,t){var n=t?va(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||Br(),this.storage.setAnonymousId(this.anonymousId)}},{key:"isValidWriteKey",value:function(e){return e&&"string"==typeof e&&e.trim().length>0}},{key:"isValidServerUrl",value:function(e){return e&&"string"==typeof e&&e.trim().length>0}},{key:"isDatasetAvailable",value:function(){var e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}},{key:"loadAfterPolyfill",value:function(e,r,i){var o=this;if("object"===n(r)&&null!==r&&(i=r,r=null),i&&i.logLevel&&(this.logLevel=i.logLevel,lt.setLogLevel(i.logLevel)),!this.isValidWriteKey(e))throw Error("Unable to load the SDK due to invalid writeKey");if(!this.storage||0===Object.keys(this.storage).length)throw Error("Cannot proceed as no storage is available");i&&i.cookieConsentManager&&(this.cookieConsentOptions=i.cookieConsentManager),this.writeKey=e,this.serverUrl=r,this.options=i;var s={};if(i&&i.setCookieDomain&&(s=t(t({},s),{},{domain:i.setCookieDomain})),i&&"boolean"==typeof i.secureCookie&&(s=t(t({},s),{},{secure:i.secureCookie})),i&&-1!==Er.indexOf(i.sameSiteCookie)&&(s=t(t({},s),{},{samesite:i.sameSiteCookie})),this.storage.options(s),i&&"string"==typeof i.uaChTrackLevel&&Cr.includes(i.uaChTrackLevel)&&(this.uaChTrackLevel=i.uaChTrackLevel),navigator.userAgentData&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then((function(t){e(t)}))}((function(e){o.uach=e}),this.uaChTrackLevel),i&&i.integrations&&(a(this.loadOnlyIntegrations,i.integrations),jr(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=i&&!0===i.useGlobalIntegrationsConfigInEvents,i&&i.sendAdblockPage&&(this.sendAdblockPage=!0),i&&i.sendAdblockPageOptions&&"object"===n(i.sendAdblockPageOptions)&&(this.sendAdblockPageOptions=i.sendAdblockPageOptions),this.uSession.initialize(i),i&&i.clientSuppliedCallbacks){var u={};Object.keys(this.methodToCallbackMapping).forEach((function(e){o.methodToCallbackMapping.hasOwnProperty(e)&&i.clientSuppliedCallbacks[o.methodToCallbackMapping[e]]&&(u[e]=i.clientSuppliedCallbacks[o.methodToCallbackMapping[e]])})),a(this.clientSuppliedCallbacks,u),this.registerCallbacks(!0)}if(i&&null!=i.loadIntegration&&(this.loadIntegration=!!i.loadIntegration),i&&"boolean"==typeof i.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===i.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),i&&"number"==typeof i.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=i.dataPlaneEventsBufferTimeout),i&&void 0!==i.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===i.lockIntegrationsVersion),this.initializeUser(i?i.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=function(e,t,n){var r="";if(n){if(!(r=Nr(n))){var i="CDN base URL for integrations is not valid";throw xr({message:"[Analytics] load:: ".concat(i)}),Error("Failed to load Rudder SDK: ".concat(i))}return r}var o=Hr().sdkURL;return r=o?o.split("/").slice(0,-1).concat("js-integrations").join("/"):br,t&&(r=r.replace("v1.1",e)),r}(this.version,this.lockIntegrationsVersion,i&&i.destSDKBaseURL),i&&i.getSourceConfig)if("function"!=typeof i.getSourceConfig)xr(new Error('option "getSourceConfig" must be a function'));else{var c=i.getSourceConfig();c instanceof Promise?c.then((function(e){return o.processResponse(200,e)})).catch(xr):this.processResponse(200,c)}else{var l=function(e){return Ir.concat(Ir.includes("?")?"&":"?").concat(e?"writeKey=".concat(e):"")}(e);i&&i.configUrl&&(l=function(e,t){var n=e;-1===n.indexOf("sourceConfig")&&(n="".concat(Nr(n),"/sourceConfig/")),n="/"===n.slice(-1)?n:"".concat(n,"/");var r=t.split("?")[1],i=n.split("?");return i.length>1&&i[1]!==r?"".concat(i[0],"?").concat(r):"".concat(n,"?").concat(r)}(i.configUrl,l));try{!function(e,t,n,r){var i=r.bind(e),o=new XMLHttpRequest;o.open("GET",t,!0),o.setRequestHeader("Authorization","Basic ".concat(btoa("".concat(n,":")))),o.onload=function(){var e=o.status,n=o.responseText;200===e?i(200,n):(xr(new Error("".concat("Request failed with status:"," ").concat(e," for url: ").concat(t))),i(e))},o.send()}(this,l,e,this.processResponse)}catch(e){xr(e)}}}},{key:"arePolyfillsRequired",value:function(e){return(!e||"boolean"!=typeof e.polyfillIfRequired||e.polyfillIfRequired)&&(!String.prototype.endsWith||!String.prototype.startsWith||!String.prototype.includes||!Array.prototype.find||!Array.prototype.includes||"function"!=typeof window.URL||"undefined"==typeof Promise||!Object.entries||!Object.values||!String.prototype.replaceAll||!this.isDatasetAvailable()||"function"!=typeof TextDecoder||"function"!=typeof Uint8Array)}},{key:"load",value:function(e,t,n){if(!this.loaded){var r=C(n);if(this.arePolyfillsRequired(r)){var i="polyfill";la(i,"https://polyfill.io/v3/polyfill.min.js?features=Number.isNaN%2CURL%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll%2CTextDecoder%2Uint8Array",{skipDatasetAttributes:!0});var o=this,s=setInterval((function(){!window.hasOwnProperty(i)&&null===document.getElementById(i)||"undefined"==typeof Promise||(clearInterval(s),o.loadAfterPolyfill(e,t,r))}),100);setTimeout((function(){clearInterval(s)}),1e4)}else this.loadAfterPolyfill(e,t,r)}}},{key:"ready",value:function(e){this.loaded?"function"!=typeof e?lt.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}},{key:"initializeCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach((function(t){e.methodToCallbackMapping.hasOwnProperty(t)&&e.on(t,(function(){}))}))}},{key:"registerCallbacks",value:function(e){var t=this;e||Object.keys(this.methodToCallbackMapping).forEach((function(e){t.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[t.methodToCallbackMapping[e]]&&(t.clientSuppliedCallbacks[e]=window.rudderanalytics[t.methodToCallbackMapping[e]])})),Object.keys(this.clientSuppliedCallbacks).forEach((function(e){t.clientSuppliedCallbacks.hasOwnProperty(e)&&t.on(e,t.clientSuppliedCallbacks[e])}))}},{key:"sendSampleRequest",value:function(){la("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{isNonNativeSDK:!0})}},{key:"startSession",value:function(e){this.uSession.start(e)}},{key:"endSession",value:function(){this.uSession.end()}},{key:"setAuthToken",value:function(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):lt.error("Provided input should be in string format")}}]),e}(),xa=new Ma;y(xa),window.addEventListener("error",(function(e){xr(e,void 0,xa)}),!0),xa.initializeCallbacks(),xa.registerCallbacks(!1);var Na,Ba=window.rudderanalytics,Ga=Array.isArray(Ba);if(Ga)for(var Ua=0;Ua<Ba.length;){if(Ba[Ua]&&"load"===Ba[Ua][0]){Na=Ba[Ua],Ba.splice(Ua,1);break}Ua+=1}!function(e){var t="ajs_trait_",n="ajs_prop_";function r(e,t){var n={};return Object.keys(e).forEach((function(r){r.startsWith(t)&&(n[r.substr(t.length)]=e[r])})),n}var i=function(e){var t={};try{new URL(e).searchParams.forEach((function(e,n){t[n]=e}))}catch(e){}return t}(e);i.ajs_aid&&xa.toBeProcessedArray.push(["setAnonymousId",i.ajs_aid]),i.ajs_uid&&xa.toBeProcessedArray.push(["identify",i.ajs_uid,r(i,t)]),i.ajs_event&&xa.toBeProcessedArray.push(["track",i.ajs_event,r(i,n)])}(window.location.href),Ga&&Ba.forEach((function(e){return xa.toBeProcessedArray.push(e)})),Na&&Na.length>0&&(Na.shift(),xa.load.apply(xa,u(Na)));var ja=xa.ready.bind(xa),Fa=xa.identify.bind(xa),Ka=xa.page.bind(xa),Ha=xa.track.bind(xa),Qa=xa.alias.bind(xa),za=xa.group.bind(xa),Va=xa.reset.bind(xa),qa=xa.load.bind(xa),Wa=xa.initialized=!0,Ya=xa.getUserId.bind(xa),Xa=xa.getSessionId.bind(xa),Ja=xa.getUserTraits.bind(xa),$a=xa.getAnonymousId.bind(xa),Za=xa.setAnonymousId.bind(xa),eu=xa.getGroupId.bind(xa),tu=xa.getGroupTraits.bind(xa),nu=xa.startSession.bind(xa),ru=xa.endSession.bind(xa),iu=xa.setAuthToken.bind(xa);export{Qa as alias,ru as endSession,$a as getAnonymousId,eu as getGroupId,tu as getGroupTraits,Xa as getSessionId,Ya as getUserId,Ja as getUserTraits,za as group,Fa as identify,Wa as initialized,qa as load,Ka as page,ja as ready,Va as reset,Za as setAnonymousId,iu as setAuthToken,nu as startSession,Ha as track};