PageSourceSearch

https://www.rebtel.com/js/rebtel-tracking.global.js

js rebtel.com collected 2026-10-01 09:09:54 UTC 695,468 bytes, 22 lines download raw bytes

1var RebtelTracking=(function(exports){'use strict';var kf=Object.create;var Ys=Object.defineProperty,xf=Object.defineProperties,Of=Object.getOwnPropertyDescriptor,Nf=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertyNames,xc=Object.getOwnPropertySymbols,Mf=Object.getPrototypeOf,Nc=Object.prototype.hasOwnProperty,Uf=Object.prototype.propertyIsEnumerable;var Oc=(t,e,r)=>e in t?Ys(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r,be=(t,e)=>{for(var r in e||(e={}))Nc.call(e,r)&&Oc(t,r,e[r]);if(xc)for(var r of xc(e))Uf.call(e,r)&&Oc(t,r,e[r]);return t},Cr=(t,e)=>xf(t,Nf(e));var ti=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Lf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Df(e))!Nc.call(t,i)&&i!==r&&Ys(t,i,{get:()=>e[i],enumerable:!(n=Of(e,i))||n.enumerable});return t};var ri=(t,e,r)=>(r=t!=null?kf(Mf(t)):{},Lf(Ys(r,"default",{value:t,enumerable:true}),t));var Lc=ti(ea=>{Object.defineProperty(ea,"__esModule",{value:true});var ht="GoogleAdWords",$f=82,ii={SessionStart:1,SessionEnd:2,PageView:3,PageEvent:4,CrashReport:5,OptOut:6,Commerce:16},Dc="GoogleAds.ECData",Js={Denied:"denied",Granted:"granted"},Bf=["ad_storage","ad_user_data","ad_personalization","analytics_storage"],Zs=function(){var t=this,e=false,r,n,i,o=[],s={},a="",u,l=[],c;t.name=ht;function d(w){var U=false,L=function(){},q=function(){},ee,ge;if(e){B(l);try{if(window.gtag&&r.enableGtag=="True"){var Re=v(w.ConsentState);X(Re),r.enableEnhancedConversions==="True"&&h(w.CustomFlags)&&(window.enhanced_conversion_data=p(w.CustomFlags[Dc])),L=M,q=_,f=S;}else if(window.google_trackConversion)L=V,q=y,f=T;else return l.push({action:d,data:w}),"Can't send to forwarder "+ht+", not initialized. Event added to queue.";var ee=ie(w),Fe=he(w);return ee&&(w.EventDataType==ii.PageView||w.EventDataType==ii.PageEvent?ge=q(w,ee,Fe):w.EventDataType==ii.Commerce&&w.ProductAction&&(ge=f(w,ee,Fe)),ge&&(U=L(ge)),U&&u)?(u(t,w),"Successfully sent to "+ht):"Can't send to forwarder: "+ht+". Event not mapped"}catch(Ie){return console.error("Can	 send to forwarder",Ie),"Can't send to forwarder: "+ht+" "+Ie}}else l.push({action:d,data:w});return "Can't send to forwarder "+ht+", not initialized. Event added to queue."}function h(w){return w&&Object.keys(w).length&&w[Dc]}function p(w){if(typeof w=="string")try{return JSON.parse(w)}catch(U){return console.warn("Unrecognized Enhanced Conversion Data Format",w,U),{}}else return typeof w=="object"?Qs(w):(console.warn("Unrecognized Enhanced Conversion Data Format",w),{})}function f(w,U,L){return w.ProductAction&&w.ProductAction.ProductList&&w.ProductAction.ProductActionType?window.gtag&&r.enableGtag=="True"?S(w,U,L):window.google_trackConversion?T(w,U,L):(console.error("Unrecognized Commerce Event",w),false):false}function g(){var w={};if(window.mParticle&&window.mParticle.Identity&&window.mParticle.Identity.getCurrentUser){var U=window.mParticle.Identity.getCurrentUser();if(!U)return {};var L=window.mParticle.Identity.getCurrentUser().getConsentState();L&&L.getGDPRConsentState&&(w=L.getGDPRConsentState());}return w}function v(w){return w&&w.getGDPRConsentState?w.getGDPRConsentState():{}}function m(){var w={};return w.google_conversion_value=0,w.google_conversion_language="en",w.google_conversion_format="3",w.google_conversion_color="ffffff",w.google_remarketing_only=r.remarketingOnly=="True",w.google_conversion_id=r.conversionId,w}function y(w,U,L){var q=m();return q.google_conversion_label=U,q.google_custom_params=L,q}function T(w,U,L){var q=m();return q.google_conversion_label=U,w.ProductAction.ProductActionType===mParticle.ProductActionType.Purchase&&w.ProductAction.TransactionId&&(q.google_conversion_order_id=w.ProductAction.TransactionId),w.CurrencyCode&&(q.google_conversion_currency=w.CurrencyCode),w.ProductAction.TotalAmount&&(q.google_conversion_value=w.ProductAction.TotalAmount),q.google_custom_params=L,q}function k(){var w={},U={ad_user_data:"defaultAdUserDataConsent",ad_personalization:"defaultAdPersonalizationConsent",ad_storage:"defaultAdStorageConsentWeb",analytics_storage:"defaultAnalyticsStorageConsentWeb"};
1return Object.keys(U).forEach(function(L){var q=U[L],ee=r[q];ee&&q&&(w[L]=Js[ee]);}),w}function N(w){return {send_to:c+"/"+w,value:0,language:"en",remarketing_only:r.remarketingOnly=="True"}}function _(w,U,L){if(!U)return null;var q=N(U);return q.transaction_id=w.SourceMessageId,Uc(q,L)}function S(w,U,L){if(!U)return null;var q=N(U);return w.ProductAction.ProductActionType===mParticle.ProductActionType.Purchase&&w.ProductAction.TransactionId?q.transaction_id=w.ProductAction.TransactionId:q.transaction_id=w.SourceMessageId,w.CurrencyCode&&(q.currency=w.CurrencyCode),w.ProductAction.TotalAmount&&(q.value=w.ProductAction.TotalAmount),Uc(q,L)}function M(w){try{gtag("event","conversion",w);}catch(U){return console.error("gtag is not available to send payload: ",w,U),false}return  true}function X(w){if(a&&r.consentMappingWeb&&!Xs(w)){var U=re(w,o),L=JSON.stringify(U);L!==a&&(G(U),a=L);}}function J(w){a=JSON.stringify(w);try{gtag("consent","default",w);}catch(U){return console.error("gtag is not available to send consent defaults: ",w,U),false}return  true}function G(w){try{gtag("consent","update",w);}catch(U){return console.error("gtag is not available to send consent update: ",w,U),false}return  true}function V(w){try{window.google_trackConversion(w);}catch(U){return console.error("google_trackConversion is not available to send payload: ",w,U),false}return  true}function re(w,U){if(!U)return {};for(var L=Qs(s),q=0;q<=U.length-1;q++){var ee=U[q],ge=ee.map.toLowerCase(),Re=ee.value;w[ge]&&Bf.indexOf(Re)!==-1&&(L[Re]=w[ge].Consented?Js.Granted:Js.Denied);}return L}function ie(w){var U=Pe(w.EventDataType,w.EventCategory,w.EventName),L=w.EventDataType===ii.PageEvent?"EventClass.Id":"EventClassDetails.Id",q=null,ee=ye(U,L,n);return ee&&(q=ee.value),q}function he(w){var U={},L=w.EventAttributes,q=w.EventDataType===ii.PageEvent?"EventAttributeClass.Id":"EventAttributeClassDetails.Id";if(L){for(var ee in L)if(L.hasOwnProperty(ee)){var ge=Pe(w.EventDataType,w.EventCategory,ee),Re=ye(ge,q,i);Re&&(U[Re.value]=L[ee]);}}return U}function ye(w,U,L){if(L){var q=L.filter(function(ee){return ee.jsmap&&ee.maptype&&ee.value?ee.jsmap==w&&ee.maptype==U:false});if(q&&q.length>0)return q[0]}return null}function Pe(w,U,L){var q=[w,U,L].join("");return mParticle.generateHash(q)}function je(){(function(){window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments);};var w=document.createElement("script");w.async=true,w.onload=function(){gtag("js",new Date),r.enableEnhancedConversions==="True"?gtag("config",c,{allow_enhanced_conversions:true}):gtag("config",c),e=true,B(l);},w.src="https://www.googletagmanager.com/gtag/js?id="+c,document.getElementsByTagName("head")[0].appendChild(w);})();}function z(){(function(){var w=document.createElement("script");w.type="text/javascript",w.async=true,w.onload=function(){e=true,B(l);},w.src=(document.location.protocol=="https:"?"https":"http")+"://www.googleadservices.com/pagead/conversion_async.js",document.getElementsByTagName("head")[0].appendChild(w);})();}function R(w,U,L){window.enhanced_conversion_data={},r=w,u=U;try{if(!r.conversionId||(c="AW-"+r.conversionId,L!==!0?r.enableGtag=="True"?je():z():(e=!0,B(l)),!r.conversionId))return "Can't initialize forwarder: "+ht+", conversionId is not defined";if(window.gtag&&r.enableGtag==="True"){r.consentMappingWeb?o=Hf(r.consentMappingWeb):o=[],s=k();var q=Qs(s),ee=g(),ge=re(ee,o);Xs(q)?Xs(ge)||J(ge):J(q),X(ee);}r.remarketingOnly=r.remarketingOnly=="True";try{r.labels&&(n=JSON.parse(r.labels.replace(/&quot;/g,'"'))),r.customParameters&&(i=JSON.parse(r.customParameters.replace(/&quot;/g,'"')));}catch(Re){return "Can't initialize forwarder: "+ht+", Could not process event to label mapping"}return "Successfully initialized: "+ht}catch(Re){return "Failed to initialize: "+ht}}function B(w){var U;if((window.gtag||window.google_trackConversion)&&w.length>0)try{for(;w.length>0;)U=w.shift(),U.action(U.data);}catch(L){console.error("Error on mParticle Adwords Kit",L);}}this.init=R,this.process=d,this.processQueue=B;};function zf(){return $f}function jf(t){if(!t){console.log("You must pass a config object to register the kit "+ht);return}if(!Mc(t)){console.log("'config' must be an object. You passed in a "+typeof t);return}Mc(t.kits)?t.kits[ht]={constructor:Zs}:(t.kits={},t.kits[ht]={constructor:Zs}),console.log("Successfully registered "+ht+" to your mParticle configuration");}function Hf(t){return JSON.parse(t.replace(/&quot;/g,'"'))}function Mc(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===false}function Xs(t){return t==null||!(Object.keys(t)||t).length}function Uc(){for(var t={},e=0;e<arguments.length;e+=1)for(var r=arguments[e],n=Object.keys(r),i=0;i<n.length;i+=1)t[n[i]]=r[n[i]];return t}function Qs(t){return JSON.parse(JSON.stringify(t))}typeof window!="undefined"&&window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:ht,constructor:Zs,getId:zf});var Vf={register:jf};ea.default=Vf;});var Wc=ti(go=>{Object.defineProperty(go,"__esModule",{value:true});var ia={Denied:"denied",Granted:"granted"},om=["ad_storage","ad_user_data","ad_personalization","analytics_storage"];function co(t){this.common=t||{};}co.prototype.getUserConsentState=function(){var t={};if(mParticle.Identity&&mParticle.Identity.getCurrentUser){var e=mParticle.Identity.getCurrentUser();if(!e)return {};var r=mParticle.Identity.getCurrentUser().getConsentState();r&&r.getGDPRConsentState&&(t=r.getGDPRConsentState());}return t};co.prototype.getConsentSettings=function(){var t={},e={ad_user_data:"defaultAdUserDataConsentSDK",ad_personalization:"defaultAdPersonalizationConsentSDK",ad_storage:"defaultAdStorageConsentSDK",analytics_storage:"defaultAnalyticsStorageConsentSDK"},r=this.common.forwarderSettings;return Object.keys(e).forEach(function(n){var i=e[n],o=r[i];o&&i&&(t[n]=ia[o]);}),t};co.prototype.generateConsentStatePayloadFromMappings=function(t,e){if(!e)return {};for(var r=this.common.cloneObject(this.common.consentPayloadDefaults),n=0;n<=e.length-1;n++){var i=e[n],o=i.map.toLowerCase(),s=i.value;t[o]&&om.indexOf(s)!==-1&&(r[s]=t[o].Consented?ia.Granted:ia.Denied);}return r};var sm=co,am=40,um=40,lm=100,cm=100,dm=300,hm=420,pm=1e3,gm=24,fm=36,mm=10,vm="page_title",bm="page_location",_m="page_referrer",ym=["item_category","item_category2","item_category3","item_category4","item_category5"],na=["google_","firebase_","ga_"],wm=/[^a-zA-Z0-9_]/g;function oa(t,e){return t&&t.length>e?t.substring(0,e):t}function kn(t){return t==null||!(Object.keys(t)||t).length}function rt(){this.consentMappings=[],this.consentPayloadDefaults={},this.consentPayloadAsString="",this.consentHandler=new sm(this);}rt.prototype.forwarderSettings=null;rt.prototype.mergeObjects=function(){for(var t={},e=0;e<arguments.length;e+=1)for(var r=arguments[e],n=Object.keys(r),i=0;i<n.length;i+=1)t[n[i]]=r[n[i]];return t};rt.prototype.truncateAttributes=function(t,e,r){var n={};return kn(t)||Object.keys(t).forEach(function(i){var o=oa(i,e),s;switch(o){case vm:s=dm;break;case _m:s=hm;break;case bm:s=pm;break;default:s=r;}var a=oa(t[i],s);n[o]=a;}),n};rt.prototype.limitAttributes=function(t,e){if(kn(t))return {};var r=Object.keys(t);r.sort();var n=r.slice(0,e).reduce(function(i,o){return i[o]=t[o],i},{});return n};rt.prototype.limitEventAttributes=function(t){return this.limitAttributes(t,cm)};rt.prototype.limitProductAttributes=function(t){var e={},r={};for(var n in t)ym.indexOf(n)>=0?r[n]=t[n]:e[n]=t[n];var i=this.limitAttributes(e,mm);return this.mergeObjects(i,r)};
1rt.prototype.getEventConsentState=function(t){return t&&t.getGDPRConsentState?t.getGDPRConsentState():{}};rt.prototype.maybeSendConsentUpdateToGoogle=function(t){if(this.consentPayloadAsString&&this.consentMappings&&!this.isEmpty(t)){var e=this.consentHandler.generateConsentStatePayloadFromMappings(t,this.consentMappings),r=JSON.stringify(e);r!==this.consentPayloadAsString&&(gtag("consent","update",e),this.consentPayloadAsString=r);}};rt.prototype.sendDefaultConsentPayloadToGoogle=function(t){this.consentPayloadAsString=JSON.stringify(t),gtag("consent","default",t);};rt.prototype.truncateEventName=function(t){return oa(t,am)};rt.prototype.truncateEventAttributes=function(t){return this.truncateAttributes(t,um,lm)};rt.prototype.standardizeParameters=function(t){var e={};for(var r in t){var n=this.standardizeName(r);e[n]=t[r];}return e};rt.prototype.standardizeName=function(t){if(window.GoogleAnalytics4Kit.hasOwnProperty("setCustomNameStandardization"))try{t=window.GoogleAnalytics4Kit.setCustomNameStandardization(t);}catch(a){console.warn("Error calling setCustomNameStandardization callback. Check your callback.  Data will still be sent without user-defined standardization. See our docs for proper use - https://docs.mparticle.com/integrations/google-analytics-4/event/",a);}function e(a){return a.replace(wm,"_")}function r(a){return !kn(a)&&/^[a-zA-Z]/.test(a.charAt(0))}function n(a){var u=false;if(!kn(a))for(var l=0;l<na.length;l++){var c=na[l];if(a.indexOf(c)===0){u=true;break}}return u}function i(a){for(var u=a.slice();!kn(u)&&u.charAt(0).match(/[^a-zA-Z]/i);)u=u.substring(1);return u}function o(a){var u=a.slice();return na.forEach(function(l){u.indexOf(l)===0&&(u=u.replace(l,""));}),u}for(var s=e(t);!r(s)||n(s);)s=i(s),s=o(s);return s};rt.prototype.truncateUserAttributes=function(t){return this.truncateAttributes(t,gm,fm)};rt.prototype.getUserId=function(t,e,r){if(t){var n={none:"None",customerId:"CustomerId",other:"Other",other2:"Other2",other3:"Other3",other4:"Other4",other5:"Other5",other6:"Other6",other7:"Other7",other8:"Other8",other9:"Other9",other10:"Other10",mpid:"mpid"},i,o=t.getUserIdentities().userIdentities;if(e!==n.none){switch(e){case "CustomerId":i=o.customerid;break;case n.other:i=o.other;break;case n.other2:i=o.other2;break;case n.other3:i=o.other3;break;case n.other4:i=o.other4;break;case n.other5:i=o.other5;break;case n.other6:i=o.other6;break;case n.other7:i=o.other7;break;case n.other8:i=o.other8;break;case n.other9:i=o.other9;break;case n.other10:i=o.other10;break;case n.mpid:i=t.getMPID();break;default:console.warn("External identity type not found for setting identity on GA4. User not set. Please double check your implementation.");}return i?r=="True"&&(i=window.mParticle.generateHash(i)):console.warn("External identity type of "+e+" not set on the user"),i}}};rt.prototype.cloneObject=function(t){return JSON.parse(JSON.stringify(t))};rt.prototype.isEmpty=kn;var Sm=rt,Cm=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Zr=Cm;function en(t){Zr.common=this.common=t||{};}var $e={Unknown:0,AddToCart:10,Click:14,Checkout:12,CheckoutOption:13,Impression:22,Purchase:16,Refund:17,RemoveFromCart:11,ViewDetail:15,AddToWishlist:20},lo={PromotionClick:19,PromotionView:18},ho="GA4.CommerceEventType",Bc="GA4.ShippingTier",zc="GA4.PaymentType",sa="add_shipping_info",aa="add_payment_info",Vc="view_cart";en.prototype.logCommerceEvent=function(t){var e=true,r=true,n={},i=false,o=t.EventAttributes||{},s=t&&t.ProductAction?t.ProductAction.Affiliation:null;if(t.EventCategory===$e.Unknown&&t.CustomFlags&&t.CustomFlags[ho]===Vc)return i=true,this.logViewCart(t,s);if(t.EventCategory===$e.Impression)return this.logImpressionEvent(t,s);if(t.EventCategory===lo.PromotionClick||t.EventCategory===lo.PromotionView)return this.logPromotionEvent(t);switch(t.EventCategory){case $e.AddToCart:case $e.RemoveFromCart:n=Em(t,s);break;case $e.Checkout:n=Pm(t,s);break;case $e.Click:n=Tm(t,s),e=false,r=false;break;case $e.Purchase:n=Om(t,s);break;case $e.Refund:n=Nm(t,s);break;case $e.ViewDetail:n=km(t,s);break;case $e.AddToWishlist:n=Dm(t,s);break;case $e.CheckoutOption:return this.logCheckoutOptionEvent(t,s);default:if(!i)return console.error("Unsupported Commerce Event. Event not sent.",t),false}return this.common.forwarderSettings.enableDataCleansing&&(o=this.common.standardizeParameters(o)),n=this.common.mergeObjects(n,this.common.limitEventAttributes(o)
1),e&&(n.currency=t.CurrencyCode),r&&(n.value=t.CustomFlags&&t.CustomFlags["GA4.Value"]||t.ProductAction.TotalAmount||null),this.sendCommerceEventToGA4(si(t),n)};en.prototype.sendCommerceEventToGA4=function(t,e){return this.common.forwarderSettings.measurementId&&(e.send_to=this.common.forwarderSettings.measurementId),gtag("event",t,e),true};en.prototype.logCheckoutOptionEvent=function(t,e){try{var r=t.CustomFlags,n=r[ho],i;switch((!r||!n)&&console.error('Your checkout option event for the Google Analytics 4 integration is missing a custom flag for "GA4.CommerceEventType". The event was sent using the deprecated set_checkout_option event.  Review mParticle docs for GA4 for the custom flags to add.'),n){case sa:i=Mm(t,e);break;case aa:i=Um(t,e);break;default:i=Im(t,e);break}}catch(o){return console.error("There is an issue with the custom flags in your CheckoutOption event. The event was not sent.  Plrease review the docs and fix.",o),false}return i=this.common.mergeObjects(i,this.common.limitEventAttributes(t.EventAttributes)),this.sendCommerceEventToGA4(si(t),i)};en.prototype.logPromotionEvent=function(t){var e=this;try{var r;return t.PromotionAction.PromotionList.forEach(function(n){r=xm(n),r=e.common.mergeObjects(r,e.common.limitEventAttributes(t.EventAttributes)),e.sendCommerceEventToGA4(si(t),r);}),!0}catch(n){return console.error("Error logging Promotions to GA4. Promotions not logged.",n),false}};en.prototype.logImpressionEvent=function(t,e){var r=this;try{var n;return t.ProductImpressions.forEach(function(i){n=Am(i,e),n=r.common.mergeObjects(n,r.common.limitEventAttributes(t.EventAttributes)),r.sendCommerceEventToGA4(si(t),n);}),!0}catch(i){return console.log("Error logging Impressions to GA4. Impressions not logged",i),false}};en.prototype.logViewCart=function(t,e){var r=$m(t,e);return r=this.common.mergeObjects(r,this.common.limitEventAttributes(t.EventAttributes)),r.currency=t.CurrencyCode,r.value=t.CustomFlags&&t.CustomFlags["GA4.Value"]||t.ProductAction.TotalAmount||null,this.sendCommerceEventToGA4(si(t),r)};function Em(t,e){return {items:At(t.ProductAction.ProductList,e)}}function Pm(t,e){return {items:At(t.ProductAction.ProductList,e),coupon:t.ProductAction?t.ProductAction.CouponCode:null}}function Im(t,e){var r=t.EventAttributes;return r.items=At(t.ProductAction.ProductList,e),r.coupon=t.ProductAction?t.ProductAction.CouponCode:null,r}function Am(t,e){return {item_list_id:t.ProductImpressionList,item_list_name:t.ProductImpressionList,items:At(t.ProductList,e)}}function Tm(t,e){return {items:At(t.ProductAction.ProductList,e)}}function km(t,e){return {items:At(t.ProductAction.ProductList,e)}}function xm(t){return Rm(t)}function Om(t,e){return {transaction_id:t.ProductAction.TransactionId,value:t.ProductAction.TotalAmount,coupon:t.ProductAction.CouponCode,shipping:t.ProductAction.ShippingAmount,tax:t.ProductAction.TaxAmount,items:At(t.ProductAction.ProductList,e)}}function Nm(t,e){return {transaction_id:t.ProductAction.TransactionId,value:t.ProductAction.TotalAmount,coupon:t.ProductAction.CouponCode,shipping:t.ProductAction.ShippingAmount,tax:t.ProductAction.TaxAmount,items:At(t.ProductAction.ProductList,e)}}function Dm(t,e){return {value:t.ProductAction.TotalAmount,items:At(t.ProductAction.ProductList,e)}}function Mm(t,e){return {coupon:t.ProductAction&&t.ProductAction.CouponCode?t.ProductAction.CouponCode:null,shipping_tier:t.CustomFlags&&t.CustomFlags[Bc]?t.CustomFlags[Bc]:null,items:At(t.ProductAction.ProductList,e)}}function Um(t,e){return {coupon:t.ProductAction&&t.ProductAction.CouponCode?t.ProductAction.CouponCode:null,payment_type:t.CustomFlags&&t.CustomFlags[zc]?t.CustomFlags[zc]:null,items:At(t.ProductAction.ProductList,e)}}function qc(t){return t.split(/(?=[A-Z])/).join("_").toLowerCase()}function Lm(t,e){var r={};e&&(r.affiliation=e),r=Zr.common.mergeObjects(r,Zr.common.limitProductAttributes(t.Attributes));for(var n in t)switch(n){case "Sku":r.item_id=t.Sku;break;case "Name":r.item_name=t.Name;break;case "Brand":r.item_brand=t.Brand;break;case "Category":r.item_category=t.Category;break;case "CouponCode":r.coupon=t.CouponCode;break;case "Variant":r.item_variant=t.Variant;break;case "Position":r.index=t.Position;break;case "Attributes":break;default:r[qc(n)]=t[n];}return Zr.common.forwarderSettings.enableDataCleansing?Zr.common.standardizeParameters(r):r}function Rm(t){var e={};for(var r in t)switch(r){case "Id":e.promotion_id=t.Id;break;case "Creative":e.creative_name=t.Creative;break;case "Name":e.promotion_name=t.Name;break;case "Position":e.creative_slot=t.Position;break;default:e[qc(r)]=t[r];}return Zr.common.forwarderSettings.enableDataCleansing?Zr.common.standardizeParameters(e):e}function At(t,e){var r=[];return t.forEach(function(n){r.push(Lm(n,e));}),r}function si(t){switch(t.EventCategory){case $e.AddToCart:return "add_to_cart";case $e.AddToWishlist:return "add_to_wishlist";case $e.RemoveFromCart:return "remove_from_cart";case $e.Purchase:return "purchase";case $e.Checkout:return "begin_checkout";case $e.CheckoutOption:return Fm(t.CustomFlags);case $e.Click:return "select_item";case $e.Impression:return "view_item_list";case $e.Refund:return "refund";case $e.ViewDetail:return "view_item";case lo.PromotionClick:return "select_promotion";case lo.PromotionView:return "view_promotion";case $e.Unknown:if(t.CustomFlags&&t.CustomFlags[ho]===Vc)return "view_cart";break;default:return console.error("Product Action Type not supported"),null}}function Fm(t){switch(t[ho]){case sa:return sa;case aa:return aa;default:return "set_checkout_option"}}function $m(t,e){return {items:At(t.ProductAction.ProductList,e)}}var Bm=en;function ai(t){this.common=t||{};}ai.prototype.sendEventToGA4=function(t,e){var r,n;this.common.forwarderSettings.enableDataCleansing?(r=this.common.standardizeName(t),n=this.common.standardizeParameters(e)):(r=t,n=e),n=this.common.limitEventAttributes(n),this.common.forwarderSettings.measurementId&&(n.send_to=this.common.forwarderSettings.measurementId),gtag("event",this.common.truncateEventName(r),this.common.truncateEventAttributes(n));};
1ai.prototype.logEvent=function(t){var e=this.common.getEventConsentState(t.ConsentState);this.common.maybeSendConsentUpdateToGoogle(e),this.sendEventToGA4(t.EventName,t.EventAttributes);};ai.prototype.logError=function(){console.warn("Google Analytics 4 does not support error events.");};ai.prototype.logPageView=function(t){var e="GA4.Title",r="GA4.Location",n="GA4.Referrer",i="Google.Title",o="Google.Location",s="Google.DocumentReferrer",a=location.href,u=document.title,l=document.referrer;t.CustomFlags&&(t.CustomFlags.hasOwnProperty(e)?u=t.CustomFlags[e]:t.CustomFlags.hasOwnProperty(i)&&(u=t.CustomFlags[i]),t.CustomFlags.hasOwnProperty(r)?a=t.CustomFlags[r]:t.CustomFlags.hasOwnProperty(o)&&(a=t.CustomFlags[o]),t.CustomFlags.hasOwnProperty(n)?l=t.CustomFlags[n]:t.CustomFlags.hasOwnProperty(s)&&(l=t.CustomFlags[s]));var c=this.common.mergeObjects({page_title:u,page_location:a,page_referrer:l},t.EventAttributes),d=this.common.getEventConsentState(t.ConsentState);return this.common.maybeSendConsentUpdateToGoogle(d),this.sendEventToGA4("page_view",c),true};var zm=ai;function tn(t){this.common=t||{};}tn.prototype.onUserIdentified=function(t){var e=this.common.getUserId(t,this.common.forwarderSettings.externalUserIdentityType,this.common.forwarderSettings.hashUserId);gtag("config",this.common.forwarderSettings.measurementId,{send_page_view:false,user_id:e});};tn.prototype.onIdentifyComplete=function(t,e){};tn.prototype.onLoginComplete=function(t,e){};tn.prototype.onLogoutComplete=function(t,e){};tn.prototype.onModifyComplete=function(t,e){};tn.prototype.onSetUserIdentity=function(t,e,r){};var jm=tn,Kc={name:"GoogleAnalytics4",moduleId:160,initForwarder:function(t,e,r,n,i,o,s,a){mParticle._setIntegrationDelay(this.moduleId,true),window.GoogleAnalytics4Kit=window.GoogleAnalytics4Kit||{},a.forwarderSettings=t,a.forwarderSettings.enableDataCleansing=a.forwarderSettings.enableDataCleansing==="True";var u=t.measurementId,l=t.externalUserIdentityType,c=t.hashUserId,d={send_page_view:t.enablePageView==="True"};if(t.consentMappingSDK?a.consentMappings=Vm(t.consentMappingSDK):(a.consentMappings=[],a.consentPayloadDefaults={},a.consentPayloadAsString=""),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments);},gtag("js",new Date),window.mParticle.getVersion().split(".")[0]==="2"){var h=a.getUserId(mParticle.Identity.getCurrentUser(),l,c);h&&(d.user_id=h);}if(gtag("config",u,d),gtag("get",u,"client_id",function(m){Hm(m,Kc.moduleId);}),e)s=true;else {var p=document.createElement("script");p.type="text/javascript",p.async=true,p.src="https://www.googletagmanager.com/gtag/js?id="+u,(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(p),p.onload=function(){if(s=true,window.dataLayer&&gtag&&o.length>0){for(var m=0;m<o.length;m++)i(o[m]);o=[];}};}a.consentPayloadDefaults=a.consentHandler.getConsentSettings();var f=a.cloneObject(a.consentPayloadDefaults),g=a.consentHandler.getUserConsentState(),v=a.consentHandler.generateConsentStatePayloadFromMappings(g,a.consentMappings);return a.isEmpty(f)?a.isEmpty(v)||a.sendDefaultConsentPayloadToGoogle(v):a.sendDefaultConsentPayloadToGoogle(f),a.maybeSendConsentUpdateToGoogle(g),s}};function Hm(t,e){var r="client_id",n={};n[r]=t,window.mParticle.setIntegrationAttribute(e,n),window.mParticle._setIntegrationDelay(e,false);}function Vm(t){return JSON.parse(t.replace(/&quot;/g,'"'))}var oi=Kc,qm={onSessionStart:function(t){},onSessionEnd:function(t){}},jc=qm;function po(t){this.common=t||{};}po.prototype.sendUserPropertiesToGA4=function(t){gtag("set","user_properties",this.common.truncateUserAttributes(t));};po.prototype.onRemoveUserAttribute=function(t){var e={};e[t]=null,this.sendUserPropertiesToGA4(e);};po.prototype.onSetUserAttribute=function(t,e){var r={};r[t]=e,this.sendUserPropertiesToGA4(r);};var Km=po,oe=oi.name,Gm=oi.moduleId,Qr={SessionStart:1,SessionEnd:2,PageView:3,PageEvent:4,CrashReport:5,OptOut:6,Commerce:16,Media:20},ua=function(){var t=this,e=false,r,n,i=[];t.name=oi.name,t.moduleId=oi.moduleId,t.common=new Sm;function o(_,S,M,X,J,G,V,re,ie,he){r=_,typeof window!="undefined"&&window.mParticle.isTestEnvironment?n=function(){}:n=S;try{oi.initForwarder(_,M,J,G,s,i,e,t.common,V,re,ie,he),t.eventHandler=new zm(t.common),t.identityHandler=new jm(t.common),t.userAttributeHandler=new Km(t.common),t.commerceHandler=new Bm(t.common),e=!0;}catch(ye){console.log("Failed to initialize "+oe+" - "+ye);}}function s(_){var S=false;if(e)try{return _.EventDataType===Qr.SessionStart?S=a(_):_.EventDataType===Qr.SessionEnd?S=u(_):_.EventDataType===Qr.CrashReport?S=l(_):_.EventDataType===Qr.PageView?S=c(_):_.EventDataType===Qr.Commerce?S=h(_):(_.EventDataType===Qr.PageEvent||_.EventDataType===Qr.Media)&&(S=d(_)),S===!0&&n?(n(t,_),"Successfully sent to "+oe):"Error logging event or event type not supported on forwarder "+oe}catch(M){return "Failed to send to "+oe+" "+M}else return i.push(_),"Can't send to forwarder "+oe+", not initialized. Event added to queue."}function a(_){try{return jc.onSessionStart(_),!0}catch(S){return {error:"Error starting session on forwarder "+oe+"; "+S}}}function u(_){try{return jc.onSessionEnd(_),!0}catch(S){return {error:"Error ending session on forwarder "+oe+"; "+S}}}function l(_){try{return t.eventHandler.logError(_),!0}catch(S){return {error:"Error logging error on forwarder "+oe+"; "+S}}}function c(_){try{return t.eventHandler.logPageView(_),!0}catch(S){return {error:"Error logging page view on forwarder "+oe+"; "+S}}}function d(_){try{return t.eventHandler.logEvent(_),!0}catch(S){return {error:"Error logging event on forwarder "+oe+"; "+S}}}function h(_){try{return t.commerceHandler.logCommerceEvent(_),!0}catch(S){return {error:"Error logging purchase event on forwarder "+oe+"; "+S}}}function p(_,S){if(e)try{return t.userAttributeHandler.onSetUserAttribute(_,S,r),"Successfully set user attribute on forwarder "+oe}
1catch(M){return "Error setting user attribute on forwarder "+oe+"; "+M}else return "Can't set user attribute on forwarder "+oe+", not initialized"}function f(_){if(e)try{return t.userAttributeHandler.onRemoveUserAttribute(_,r),"Successfully removed user attribute on forwarder "+oe}catch(S){return "Error removing user attribute on forwarder "+oe+"; "+S}else return "Can't remove user attribute on forwarder "+oe+", not initialized"}function g(_,S){if(e)try{return t.identityHandler.onSetUserIdentity(r,_,S),"Successfully set user Identity on forwarder "+oe}catch(M){return "Error removing user attribute on forwarder "+oe+"; "+M}else return "Can't call setUserIdentity on forwarder "+oe+", not initialized"}function v(_){if(e)try{return t.identityHandler.onUserIdentified(_),"Successfully called onUserIdentified on forwarder "+oe}catch(S){return {error:"Error calling onUserIdentified on forwarder "+oe+"; "+S}}else return "Can't set new user identities on forwader  "+oe+", not initialized"}function m(_,S){if(e)try{return t.identityHandler.onIdentifyComplete(_,S),"Successfully called onIdentifyComplete on forwarder "+oe}catch(M){return {error:"Error calling onIdentifyComplete on forwarder "+oe+"; "+M}}else return "Can't call onIdentifyCompleted on forwader  "+oe+", not initialized"}function y(_,S){if(e)try{return t.identityHandler.onLoginComplete(_,S),"Successfully called onLoginComplete on forwarder "+oe}catch(M){return {error:"Error calling onLoginComplete on forwarder "+oe+"; "+M}}else return "Can't call onLoginComplete on forwader  "+oe+", not initialized"}function T(_,S){if(e)try{return t.identityHandler.onLogoutComplete(_,S),"Successfully called onLogoutComplete on forwarder "+oe}catch(M){return {error:"Error calling onLogoutComplete on forwarder "+oe+"; "+M}}else return "Can't call onLogoutComplete on forwader  "+oe+", not initialized"}function k(_,S){if(e)try{return t.identityHandler.onModifyComplete(_,S),"Successfully called onModifyComplete on forwarder "+oe}catch(M){return {error:"Error calling onModifyComplete on forwarder "+oe+"; "+M}}else return "Can't call onModifyComplete on forwader  "+oe+", not initialized"}function N(_){if(e)try{return t.initialization.setOptOut(_),"Successfully called setOptOut on forwarder "+oe}catch(S){return {error:"Error calling setOptOut on forwarder "+oe+"; "+S}}else return "Can't call setOptOut on forwader  "+oe+", not initialized"}this.init=o,this.process=s,this.setUserAttribute=p,this.removeUserAttribute=f,this.onUserIdentified=v,this.setUserIdentity=g,this.onIdentifyComplete=m,this.onLoginComplete=y,this.onLogoutComplete=T,this.onModifyComplete=k,this.setOptOut=N;};function Wm(){return Gm}function Hc(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===false}function Ym(t){if(!t){console.log("You must pass a config object to register the kit "+oe);return}if(!Hc(t)){console.log("'config' must be an object. You passed in a "+typeof t);return}Hc(t.kits)?t.kits[oe]={constructor:ua}:(t.kits={},t.kits[oe]={constructor:ua}),console.log("Successfully registered "+oe+" to your mParticle configuration");}typeof window!="undefined"&&window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:oe,constructor:ua,getId:Wm});var Gc={register:Ym},Jm=Gc.register;go.default=Gc;go.register=Jm;});var td=ti(bo=>{Object.defineProperty(bo,"__esModule",{value:true});var la={Denied:"denied",Granted:"granted"},Xm=["ad_storage","ad_user_data","ad_personalization","analytics_storage","functionality_storage","personalization_storage","security_storage"];function fo(t){this.common=t||{};}fo.prototype.getUserConsentState=function(){var t={};if(mParticle.Identity&&mParticle.Identity.getCurrentUser){var e=mParticle.Identity.getCurrentUser();if(!e)return {};var r=mParticle.Identity.getCurrentUser().getConsentState();r&&r.getGDPRConsentState&&(t=r.getGDPRConsentState());}return t};fo.prototype.getConsentSettings=function(){var t={},e={ad_user_data:"defaultAdUserDataConsentWeb",ad_personalization:"defaultAdPersonalizationConsentWeb",ad_storage:"defaultAdStorageConsentWeb",analytics_storage:"defaultAnalyticsStorageConsentWeb",functionality_storage:"defaultFunctionalityStorageConsentWeb",personalization_storage:"defaultPersonalizationStorageConsentWeb",security_storage:"defaultSecurityStorageConsentWeb"},r=this.common.settings;return Object.keys(e).forEach(function(n){var i=e[n],o=r[i];o&&i&&(t[n]=la[o]);}),t};fo.prototype.generateConsentStatePayloadFromMappings=function(t,e){if(!e)return {};for(var r=this.common.cloneObject(this.common.consentPayloadDefaults),n=0;n<=e.length-1;n++){var i=e[n],o=i.map.toLowerCase(),s=i.value;t[o]&&Xm.indexOf(s)!==-1&&(r[s]=t[o].Consented?la.Granted:la.Denied);}return r};var Qm=fo;function Tt(){this.customDataLayerName=null,this.consentMappings=[],this.consentPayloadDefaults={},this.consentPayloadAsString="",this.consentHandler=new Qm(this);}Tt.prototype.buildMPID=function(t,e){var r="";return t&&t.hasOwnProperty("MPID")?r=t.MPID:e&&e.hasOwnProperty("getMPID")&&(r=e.getMPID()),r};Tt.prototype.buildUserAttributes=function(t,e){var r={};return t&&t.hasOwnProperty("UserAttributes")?r=t.UserAttributes:e&&e.hasOwnProperty("getAllUserAttributes")&&(r=e.getAllUserAttributes()),r};Tt.prototype.buildUserIdentities=function(t,e){var r={};return t.hasOwnProperty("UserIdentities")?t.UserIdentities.forEac
1h(function(n){var i=mParticle.IdentityType.getIdentityName(n.Type);r[i]=n.Identity;}):e.hasOwnProperty("getUserIdentities")&&e.getUserIdentities().userIdentities&&(r=e.getUserIdentities().userIdentities),r};Tt.prototype.buildConsentObject=function(t){var e={},r=t.ConsentState||mParticle.Identity.getCurrentUser().getConsentState();return r&&r.getGDPRConsentState&&r.getGDPRConsentState()&&(e=r.getGDPRConsentState()),{gdpr:e}};Tt.prototype.send=function(t){var e={},r={},n=t||{},i=n.event||{},o=n.user||{},s=i.EventName||"Custom Event",a={mpid:this.buildMPID(i,o),consent_state:this.buildConsentObject(i),attributes:this.buildUserAttributes(i,o),identities:this.buildUserIdentities(i,o)},u={name:s,type:n.eventType||"custom_event",attributes:i.EventAttributes||{}};if(e.event=s,r={device_application_stamp:i.DeviceId||mParticle.getDeviceId()||"",user:a,event:u},e.mp_data=r,n.eventPayload)for(var l in n.eventPayload)n.eventPayload.hasOwnProperty(l)&&(e[l]=n.eventPayload[l]);window[this.customDataLayerName].push(e);};Tt.prototype.sendConsent=function(t,e){var r=this.customDataLayerName;function n(){window[r].push(arguments);}n("consent",t,e);};Tt.prototype.getEventConsentState=function(t){return t&&t.getGDPRConsentState?t.getGDPRConsentState():{}};Tt.prototype.maybeSendConsentUpdateToGoogle=function(t){if(this.consentPayloadAsString&&this.consentMappings&&!this.isEmpty(t)){var e=this.consentHandler.generateConsentStatePayloadFromMappings(t,this.consentMappings),r=JSON.stringify(e);r!==this.consentPayloadAsString&&(this.sendConsent("update",e),this.consentPayloadAsString=r);}};Tt.prototype.sendDefaultConsentPayloadToGoogle=function(t){this.consentPayloadAsString=JSON.stringify(t),this.sendConsent("default",t);};Tt.prototype.cloneObject=function(t){return JSON.parse(JSON.stringify(t))};Tt.prototype.isEmpty=function(e){return e==null||!(Object.keys(e)||e).length};var Zm=Tt,Er={AddToCart:10,Click:14,Checkout:12,CheckoutOption:13,Impression:22,Purchase:16,Refund:17,RemoveFromCart:11,ViewDetail:15},Yc={PromotionClick:19,PromotionView:18};function Et(t){this.common=t||{};}Et.prototype.buildAddToCart=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{currencyCode:t.CurrencyCode||"USD",add:{products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.buildCheckout=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{checkout:{actionField:{step:t.ProductAction.CheckoutStep,option:t.ProductAction.CheckoutOptions},products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.buildCheckoutOption=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{checkout_option:{actionField:{step:t.ProductAction.CheckoutStep,option:t.ProductAction.CheckoutOptions},products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.buildRemoveFromCart=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{currencyCode:t.CurrencyCode||"USD",remove:{products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.buildImpression=function(t,e){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{currencyCode:t.CurrencyCode||"USD",impressions:Pr(e.ProductList)}}}};Et.prototype.buildProductClick=function(t){var e={};return t.EventAttributes&&t.EventAttributes.hasOwnProperty("list")&&(e.list=t.EventAttributes.list),{event:t,eventType:"commerce_event",eventPayload:{ecommerce:{click:{actionField:e,products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.buildProductViewDetail=function(t){var e={};return t.EventAttributes&&t.EventAttributes.hasOwnProperty("list")&&(e.list=t.EventAttributes.list),{event:t,eventType:"commerce_event",eventPayload:{ecommerce:{detail:{actionField:e,products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.buildPromoClick=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{promoClick:{promotions:Zc(t.PromotionAction.PromotionList)}}}}};Et.prototype.buildPromoView=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{promoView:{promotions:Zc(t.PromotionAction.PromotionList)}}}}};Et.prototype.buildPurchase=function(t){var e=t.ProductAction;return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{purchase:{actionField:{id:e.TransactionId||"",affiliation:e.Affiliation||"",revenue:e.TotalAmount||"",tax:e.TaxAmount||"",shipping:e.ShippingAmount||"",coupon:e.CouponCode||""},products:Pr(e.ProductList)}}}}};Et.prototype.buildRefund=function(t){return {event:t,eventType:"commerce_event",eventPayload:{ecommerce:{refund:{actionField:{id:t.ProductAction.TransactionId||""},products:Pr(t.ProductAction.ProductList)}}}}};Et.prototype.logCommerceEvent=function(t){var e=this;switch(t.EventCategory){case Er.AddToCart:var t=e.buildAddToCart(t);break;case Er.Checkout:var t=e.buildCheckout(t);break;case Er.CheckoutOption:var t=e.buildCheckoutOption(t);break;case Er.Click:var t=e.buildProductClick(t);break;case Er.Impression:try{t.ProductImpressions.forEach(function(n){var i=e.buildImpression(t,n);e.common.send(i);});}catch(n){return console.log("error logging impressions",n),false}return  true;case Er.Purchase:var t=e.buildPurchase(t);break;case Er.Refund:var t=e.buildRefund(t);break;case Er.RemoveFromCart:var t=e.buildRemoveFromCart(t);break;case Er.ViewDetail:var t=e.buildProductViewDetail(t);break;case Yc.PromotionClick:var t=e.buildPromoClick(t);break;case Yc.PromotionView:var t=e.buildPromoView(t);break;default:return console.error("Unknown Commerce Type",t),false}return e.common.send(t),true};function Qc(t){return t.split(/(?=[A-Z])/).join("_").toLowerCase()}function ev(t){var e={};for(var r in t)r==="Sku"?e.id=t.Sku:e[Qc(r)]=t[r];return e}function tv(t){var e={};for(var r in t)e[Qc(r)]=t[r];return e}function Pr(t){var e=[];return t.forEach(function(r){e.push(ev(r));}),e}function Zc(t){var e=[];return t.forEach(function(r){e.push(tv(r));}),e}var rv=Et;function mo(t){this.common=t||{};}
1mo.prototype.logEvent=function(t){var e=this.common.getEventConsentState(t.ConsentState);return this.common.maybeSendConsentUpdateToGoogle(e),this.common.send({event:t}),true};mo.prototype.logError=function(){};mo.prototype.logPageView=function(t){var e=this.common.getEventConsentState(t.ConsentState);return this.common.maybeSendConsentUpdateToGoogle(e),this.common.send({event:t,eventType:"screen_view"}),true};var nv=mo;function nn(t){this.common=t||{};}nn.prototype.onUserIdentified=function(t){this.common.send({event:{EventName:"User Identified"},user:t});};nn.prototype.onIdentifyComplete=function(t,e){this.common.send({event:{EventName:"Identify Complete"},user:t});};nn.prototype.onLoginComplete=function(t,e){this.common.send({event:{EventName:"Login Complete"},user:t});};nn.prototype.onLogoutComplete=function(t,e){this.common.send({event:{EventName:"Logout Complete"},user:t});};nn.prototype.onModifyComplete=function(t,e){this.common.send({event:{EventName:"Modify Complete"},user:t});};nn.prototype.onSetUserIdentity=function(t,e,r){};var iv=nn,ov={name:"GoogleTagManager",moduleId:140,initForwarder:function(t,e,r,n,i,o,s,a){a.settings=t,a.settings.consentMappingWeb?a.consentMappings=pv(a.settings.consentMappingWeb):(a.consentMappings=[],a.consentPayloadDefaults={},a.consentPayloadAsString="");var u=cv(t.containerId);if(!u)return console.error("Container ID is not valid and is required for Google Tag Manager Integration"),false;var l=t.includeContainer==="True",c=dv(t.dataLayerName);if(!c)return console.error("DataLayer Name is not valid. Please check that you have entered it correctly."),false;var d=hv(t.previewUrl);!d&&t.previewUrl&&console.warn("Invalid previewUrl detected. Please check that you have entered it correctly."),a.customDataLayerName=c,window[a.customDataLayerName]=window[a.customDataLayerName]||[],e||!l?true:sv(u,a.customDataLayerName,d,a.settings.preventAutoBlock),a.consentPayloadDefaults=a.consentHandler.getConsentSettings();var h=a.cloneObject(a.consentPayloadDefaults),p=a.consentHandler.getUserConsentState(),f=a.consentHandler.generateConsentStatePayloadFromMappings(p,a.consentMappings);a.isEmpty(h)?a.isEmpty(f)||a.sendDefaultConsentPayloadToGoogle(f):a.sendDefaultConsentPayloadToGoogle(h),a.maybeSendConsentUpdateToGoogle(p);}};function sv(t,e,r,n){var i="https://www.googletagmanager.com/gtm.js",o=lv(r);return r&&o.id===t?i+="?"+uv(r)+"&l="+e:i+="?id="+t,i+="&l="+e,av(i,e,n),true}function av(t,e,r){window[e].push({"gtm.start":new Date().getTime(),event:"gtm.js"});var n=document.createElement("script");n.type="text/javascript",n.async=true,n.src=t,r==="True"&&n.setAttributeNode(window.document.createAttribute("data-ot-ignore")),(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(n);}function uv(t){var e=t||"";return e.split("?")[1]}function lv(t){var e=t||"",r={},n=e.split("?");return !n[1]||n.length>2?{}:(n[1].split("&").forEach(function(i){var o=i.split("=");r[o[0]]=o[1];}),r)}function cv(t){var e=t||"";return e.trim().match(/^[a-zA-Z0-9-_]+$/)?e.trim():""}function dv(t){var e=t||"";return e.trim().match(/^[a-zA-Z0-9-_]+$/)?e.trim():""}function hv(t){var e=t||"",r=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/gm;return e.trim().match(r)?e.trim():""}function pv(t){return JSON.parse(t.replace(/&quot;/g,'"'))}var ui=ov,gv={onSessionStart:function(t){},onSessionEnd:function(t){}},Jc=gv;function vo(t){this.common={};}vo.prototype.onRemoveUserAttribute=function(t,e){this.common.send({event:{EventName:"Remove User Attribute"},options:{key:t}});};vo.prototype.onSetUserAttribute=function(t,e,r){this.common.send({event:{EventName:"Set User Attribute"},options:{key:t,value:e}});};vo.prototype.onConsentStateUpdated=function(t,e,r){this.common.send({event:{EventName:"Consent State Update"},options:{old_state:t,new_state:e}});};var fv=vo,se=ui.name,mv=ui.moduleId,rn={SessionStart:1,SessionEnd:2,PageView:3,PageEvent:4,CrashReport:5,OptOut:6,Commerce:16,Media:20},ca=function(){var t=this,e=false,r,n,i=[];t.name=ui.name,t.moduleId=ui.moduleId,t.common=new Zm;function o(_,S,M,X,J,G,V,re,ie,he){r=_,typeof window!="undefined"&&window.mParticle.isTestEnvironment?n=function(){}:n=S;try{ui.initForwarder(_,M,J,G,s,i,e,t.common,V,re,ie,he),t.eventHandler=new nv(t.common),t.identityHandler=new iv(t.common),t.userAttributeHandler=new fv(t.common),t.commerceHandler=new rv(t.common),e=!0;}catch(ye){console.log("Failed to initialize "+se+" - "+ye);}}function s(_){var S=false;if(e)try{return _.EventDataType===rn.SessionStart?S=a(_):_.EventDataType===rn.SessionEnd?S=u(_):_.EventDataType===rn.CrashReport?S=l(_):_.EventDataType===rn.PageView?S=c(_):_.EventDataType===rn.Commerce?S=h(_):(_.EventDataType===rn.PageEvent||_.EventDataType===rn.Media)&&(S=d(_)),S===!0&&n?(n(t,_),"Successfully sent to "+se):"Error logging event or event type not supported on forwarder "+se}catch(M){return "Failed to send to "+se+" "+M}else return i.push(_),"Can't send to forwarder "+se+", not initialized. Event added to queue."}function a(_){try{return Jc.onSessionStart(_)}catch(S){return {error:"Error starting session on forwarder "+se+"; "+S}}}function u(_){try{return Jc.onSessionEnd(_)}catch(S){return {error:"Error ending session on forwarder "+se+"; "+S}}}function l(_){try{return t.eventHandler.logError(_)}catch(S){return {error:"Error logging error on forwarder "+se+"; "+S}}}function c(_){try{return t.eventHandler.logPageView(_)}catch(S){return {error:"Error logging page view on forwarder "+se+"; "+S}}}function d(_){try{return t.eventHandler.logEvent(_)}catch(S){return {error:"Error logging event on forwarder "+se+"; "+S}}}function h(_){try{return t.commerceHandler.logCommerceEvent(_)}catch(S){return {error:"Error logging purchase event on forwarder "+se+"; "+S}}}function p(_,S){if(e)try{return t.userAttributeHandler.onSetUserAttribute(_,S,r),"Successfully set user attribute on forwarder "+se}
1catch(M){return "Error setting user attribute on forwarder "+se+"; "+M}else return "Can't set user attribute on forwarder "+se+", not initialized"}function f(_){if(e)try{return t.userAttributeHandler.onRemoveUserAttribute(_,r),"Successfully removed user attribute on forwarder "+se}catch(S){return "Error removing user attribute on forwarder "+se+"; "+S}else return "Can't remove user attribute on forwarder "+se+", not initialized"}function g(_,S){if(e)try{return t.identityHandler.onSetUserIdentity(r,_,S),"Successfully set user Identity on forwarder "+se}catch(M){return "Error removing user attribute on forwarder "+se+"; "+M}else return "Can't call setUserIdentity on forwarder "+se+", not initialized"}function v(_){if(e)try{return t.identityHandler.onUserIdentified(_),"Successfully called onUserIdentified on forwarder "+se}catch(S){return {error:"Error calling onUserIdentified on forwarder "+se+"; "+S}}else return "Can't set new user identities on forwader  "+se+", not initialized"}function m(_,S){if(e)try{return t.identityHandler.onIdentifyComplete(_,S),"Successfully called onIdentifyComplete on forwarder "+se}catch(M){return {error:"Error calling onIdentifyComplete on forwarder "+se+"; "+M}}else return "Can't call onIdentifyCompleted on forwader  "+se+", not initialized"}function y(_,S){if(e)try{return t.identityHandler.onLoginComplete(_,S),"Successfully called onLoginComplete on forwarder "+se}catch(M){return {error:"Error calling onLoginComplete on forwarder "+se+"; "+M}}else return "Can't call onLoginComplete on forwader  "+se+", not initialized"}function T(_,S){if(e)try{return t.identityHandler.onLogoutComplete(_,S),"Successfully called onLogoutComplete on forwarder "+se}catch(M){return {error:"Error calling onLogoutComplete on forwarder "+se+"; "+M}}else return "Can't call onLogoutComplete on forwader  "+se+", not initialized"}function k(_,S){if(e)try{return t.identityHandler.onModifyComplete(_,S),"Successfully called onModifyComplete on forwarder "+se}catch(M){return {error:"Error calling onModifyComplete on forwarder "+se+"; "+M}}else return "Can't call onModifyComplete on forwader  "+se+", not initialized"}function N(_){if(e)try{return t.initialization.setOptOut(_),"Successfully called setOptOut on forwarder "+se}catch(S){return {error:"Error calling setOptOut on forwarder "+se+"; "+S}}else return "Can't call setOptOut on forwader  "+se+", not initialized"}this.init=o,this.process=s,this.setUserAttribute=p,this.removeUserAttribute=f,this.onUserIdentified=v,this.setUserIdentity=g,this.onIdentifyComplete=m,this.onLoginComplete=y,this.onLogoutComplete=T,this.onModifyComplete=k,this.setOptOut=N;};function vv(){return mv}function Xc(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===false}function bv(t){if(!t){console.log("You must pass a config object to register the kit "+se);return}if(!Xc(t)){console.log("'config' must be an object. You passed in a "+typeof t);return}Xc(t.kits)?t.kits[se]={constructor:ca}:(t.kits={},t.kits[se]={constructor:ca}),console.log("Successfully registered "+se+" to your mParticle configuration");}typeof window!="undefined"&&window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:se,constructor:ca,getId:vv});var ed={register:bv},_v=ed.register;bo.default=ed;bo.register=_v;});var np=ti(Mu=>{Object.defineProperty(Mu,"__esModule",{value:true});function Q_(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype;}else r={};return Object.defineProperty(r,"__esModule",{value:true}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:true,get:function(){return t[n]}});}),r}var xe={init:function(t){t===void 0&&xe.zg!==void 0||(xe.zg=!!t),xe.t||(xe.t=true);},destroy:function(){xe.t=false,xe.zg=void 0,xe.vd=void 0;},setLogger:function(t){typeof t=="function"?(xe.init(),xe.vd=t):xe.info("Ignoring setLogger call since logger is not a function");},toggleLogging:function(){xe.init(),xe.zg?(console.log("Disabling Braze logging"),xe.zg=false):(console.log("Enabled Braze logging"),xe.zg=true);},info:function(t){if(xe.zg){let e="Braze: "+t;xe.vd!=null?xe.vd(e):console.log(e);}},warn:function(t){if(xe.zg){let e="Braze SDK Warning: "+t+" (v5.5.0)";xe.vd!=null?xe.vd(e):console.warn(e);}},error:function(t){if(xe.zg){let e="Braze SDK Error: "+t+" (v5.5.0)";xe.vd!=null?xe.vd(e):console.error(e);}}},b=xe,Z_={Tn:function(t){let e=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}},le={CustomEvent:"ce",Pr:"p",Ku:"pc",Ua:"i",Ls:"ie",M:"cci",R:"ccic",k:"ccc",F:"ccd",ql:"ss",xl:"se",Xi:"si",$i:"sc",Oi:"sbc",mo:"iec",Ju:"lr",Eu:"uae",O:"ci",D:"cc",Xu:"lcaa",Gu:"lcar",On:"inc",Ln:"add",Rn:"rem",$n:"set",Bn:"ncam",Hu:"sgu",Fr:"ffi"},ey={Ar:"feed_displayed"},ty={W:function(){let t=(e=false)=>{let r=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+r.substr(0,4)+"-"+r.substr(4,4):r};return t()+t(true)+t(true)+t()}},xr=ty,we=class{constructor(e,r){this.database=e,this.vd=r,this.parent=typeof window=="undefined"?self:window,this.database=e,this.vd=r;}Dd(){if("indexedDB"in this.parent)return this.parent.indexedDB}isSupported(){var e;try{if(this.Dd()==null)return !1;{let r=(e=this.Dd())===null||e===void 0?void 0:e.open("Braze IndexedDB Support Test");
1if(r&&(r.onupgradeneeded=()=>r.result.close(),r.onsuccess=()=>r.result.close()),typeof window!="undefined"){let n=window,i=n.chrome||n.browser||n.pd;if(i&&i.runtime&&i.runtime.id)return this.vd.info("Not using IndexedDB for storage because we are running inside an extension"),!1}return !0}}catch(r){return this.vd.info("Not using IndexedDB for storage due to following error: "+r),false}}Bd(e,r){var n;let i=(n=this.Dd())===null||n===void 0?void 0:n.open(this.database.Sd,this.database.VERSION);if(i==null)return typeof r=="function"&&r(),false;let o=this;return i.onupgradeneeded=s=>{var a;o.vd.info("Upgrading indexedDB "+o.database.Sd+" to v"+o.database.VERSION+"...");let u=(a=s.target)===null||a===void 0?void 0:a.result;for(let l in o.database.hs){let c=l;o.database.hs.hasOwnProperty(l)&&!u.objectStoreNames.contains(o.database.hs[c])&&u.createObjectStore(o.database.hs[c]);}},i.onsuccess=s=>{var a;let u=(a=s.target)===null||a===void 0?void 0:a.result;u.onversionchange=()=>{u.close(),typeof r=="function"&&r(),o.vd.error("Needed to close the database unexpectedly because of an upgrade in another tab");},e(u);},i.onerror=s=>{var a;let u=s;return o.vd.info("Could not open indexedDB "+o.database.Sd+" v"+o.database.VERSION+": "+((a=u.target)===null||a===void 0?void 0:a.errorCode)),typeof r=="function"&&r(),true},true}setItem(e,r,n,i,o){if(!this.isSupported())return typeof o=="function"&&o(),false;let s=this;return this.Bd(a=>{if(!a.objectStoreNames.contains(e))return s.vd.error("Could not store object "+r+" in "+e+" on indexedDB "+s.database.Sd+" - "+e+" is not a valid objectStore"),typeof o=="function"&&o(),void a.close();let u=a.transaction([e],"readwrite");u.oncomplete=()=>a.close();let l=u.objectStore(e).put(n,r);l.onerror=()=>{s.vd.error("Could not store object "+r+" in "+e+" on indexedDB "+s.database.Sd),typeof o=="function"&&o();},l.onsuccess=()=>{typeof i=="function"&&i();};},o)}getItem(e,r,n){if(!this.isSupported())return  false;let i=this;return this.Bd(o=>{if(!o.objectStoreNames.contains(e))return i.vd.error("Could not retrieve object "+r+" in "+e+" on indexedDB "+i.database.Sd+" - "+e+" is not a valid objectStore"),void o.close();let s=o.transaction([e],"readonly");s.oncomplete=()=>o.close();let a=s.objectStore(e).get(r);a.onerror=()=>{i.vd.error("Could not retrieve object "+r+" in "+e+" on indexedDB "+i.database.Sd);},a.onsuccess=u=>{var l;let c=(l=u.target)===null||l===void 0?void 0:l.result;c!=null&&n(c);};})}jr(e,r,n){if(!this.isSupported())return typeof n=="function"&&n(),false;let i=this;return this.Bd(o=>{if(!o.objectStoreNames.contains(e))return i.vd.error("Could not retrieve last record from "+e+" on indexedDB "+i.database.Sd+" - "+e+" is not a valid objectStore"),typeof n=="function"&&n(),void o.close();let s=o.transaction([e],"readonly");s.oncomplete=()=>o.close();let a=s.objectStore(e).openCursor(null,"prev");a.onerror=()=>{i.vd.error("Could not open cursor for "+e+" on indexedDB "+i.database.Sd),typeof n=="function"&&n();},a.onsuccess=u=>{var l;let c=(l=u.target)===null||l===void 0?void 0:l.result;c!=null&&c.value!=null&&c.key!=null?r(c.key,c.value):typeof n=="function"&&n();};},n)}re(e,r){if(!this.isSupported())return  false;let n=this;return this.Bd(i=>{if(!i.objectStoreNames.contains(e))return n.vd.error("Could not delete record "+r+" from "+e+" on indexedDB "+n.database.Sd+" - "+e+" is not a valid objectStore"),void i.close();let o=i.transaction([e],"readwrite");o.oncomplete=()=>i.close(),o.objectStore(e).delete(r).onerror=()=>{n.vd.error("Could not delete record "+r+" from "+e+" on indexedDB "+n.database.Sd);};})}ss(e,r){if(!this.isSupported())return  false;let n=this;return this.Bd(i=>{if(!i.objectStoreNames.contains(e))return n.vd.error("Could not retrieve objects from "+e+" on indexedDB "+n.database.Sd+" - "+e+" is not a valid objectStore"),void i.close();let o=i.transaction([e],"readwrite");o.oncomplete=()=>i.close();let s=o.objectStore(e),a=s.openCursor(),u=[];a.onerror=()=>{u.length>0?(n.vd.info("Cursor closed midway through for "+e+" on indexedDB "+n.database.Sd),r(u)):n.vd.error("Could not open cursor for "+e+" on indexedDB "+n.database.Sd);},a.onsuccess=l=>{var c;let d=(c=l.target)===null||c===void 0?void 0:c.result;
1d!=null?(d.value!=null&&d.key!=null&&(s.delete(d.key).onsuccess=()=>{u.push(d.value);}),typeof d.continue=="function"&&d.continue()):u.length>0&&r(u);};})}clearData(){if(!this.isSupported())return  false;let e=[];for(let n in this.database.hs){let i=n;this.database.hs.hasOwnProperty(n)&&this.database.hs[i]!==this.database.hs.ae&&e.push(this.database.hs[i]);}let r=this;return this.Bd(function(n){let i=n.transaction(e,"readwrite");i.oncomplete=()=>n.close();for(let o=0;o<e.length;o++){let s=e[o];i.objectStore(s).clear().onerror=function(){r.vd.error("Could not clear "+this.source.name+" on indexedDB "+r.database.Sd);};}i.onerror=function(){r.vd.error("Could not clear object stores on indexedDB "+r.database.Sd);};})}};we.ts={Zt:{Sd:"AppboyServiceWorkerAsyncStorage",VERSION:6,hs:{Ka:"data",hr:"pushClicks",cu:"pushSubscribed",Cd:"fallbackDevice",es:"cardUpdates",ae:"optOut",wr:"pendingData",jh:"sdkAuthenticationSignature"},ie:1}};var Zd={Eo:"allowCrawlerActivity",_o:"baseUrl",Io:"noCookies",So:"devicePropertyAllowlist",Aa:"disablePushTokenMaintenance",Ao:"enableLogging",No:"enableSdkAuthentication",qa:"manageServiceWorkerExternally",Oo:"minimumIntervalBetweenTriggerActionsInSeconds",Ro:"sessionTimeoutInSeconds",Po:"appVersion",Lo:"appVersionNumber",Ma:"serviceWorkerLocation",ka:"safariWebsitePushId",zn:"localization",bo:"contentSecurityNonce",Do:"allowUserSuppliedJavascript",jo:"inAppMessageZIndex",ho:"openInAppMessagesInNewTab",en:"openNewsFeedCardsInNewTab",Lh:"requireExplicitInAppMessageDismissal",Mo:"doNotLoadFontAwesome",Uo:"deviceId",_a:"serviceWorkerScope",Wo:"sdkFlavor",tn:"openCardsInNewTab"};function rs(t){let e=[],r;for(let n in t)r=n,Object.prototype.hasOwnProperty.call(t,r)&&t[r]!==void 0&&e.push(t[r]);return e}function gr(t,e,r,n){let i=rs(t);return i.indexOf(e)!==-1||(b.error(`${r} Valid values from ${n} are "${i.join('"/"')}".`),false)}function Ze(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}function Yt(t){return Object.prototype.toString.call(t)==="[object Date]"}function Pi(t){return Object.prototype.toString.call(t)==="[object Object]"}function ry(t,...e){t==null&&(t=[]);let r=[],n=arguments.length;for(let i=0,o=t.length;i<o;i++){let s=t[i];if(r.indexOf(s)!==-1)continue;let a=1;for(a=1;a<n&&arguments[a].indexOf(s)!==-1;a++);a===n&&r.push(s);}return r}function Dt(t){let e=[];for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}function vn(t,e){if(t===e)return t!==0||1/t==1/e;if(t==null||e==null)return t===e;let r=t.toString();if(r!==e.toString())return  false;switch(r){case "[object RegExp]":case "[object String]":return ""+t==""+e;case "[object Number]":return +t!=+t?+e!=+e:+t==0?1/+t==1/e:+t==+e;case "[object Date]":case "[object Boolean]":return +t==+e}let n=r==="[object Array]";if(!n){if(typeof t!="object"||typeof e!="object")return  false;let a=t.constructor,u=e.constructor;if(a!==u&&!(typeof a=="function"&&a instanceof a&&typeof u=="function"&&u instanceof u)&&"constructor"in t&&"constructor"in e)return  false}let i=[],o=[],s=i.length;for(;s--;)if(i[s]===t)return o[s]===e;if(i.push(t),o.push(e),n){if(s=t.length,s!==e.length)return  false;for(;s--;)if(!vn(t[s],e[s]))return  false}else {let a=Dt(t),u;if(s=a.length,Dt(e).length!==s)return  false;for(;s--;)if(u=a[s],!Object.prototype.hasOwnProperty.call(e,u)||!vn(t[u],e[u]))return  false}return i.pop(),o.pop(),true}function Ii(t,e=false){let r=t/1e3;return e&&(r=Math.floor(r)),r}function ny(t){return 1e3*t}function Qt(t){if(t==null)return null;let e=parseInt(t.toString());return isNaN(e)?null:new Date(1e3*e)}function Fo(t){return t!=null&&Yt(t)?t.toISOString().replace(/\.[0-9]{3}Z$/,""):t}function fn(t){return t==null||t===""?null:new Date(t)}function iy(t){return t==null||t===""?new Date().valueOf():t}function eh(t){return (new Date().valueOf()-t.valueOf())/1e3}function th(t){return (t.valueOf()-new Date().valueOf())/1e3}var rh=100,wu="inAppMessage must be an InAppMessage object",Su="must be a Card object",oy=500,sy="logCustomEvent",Mn="setCustomUserAttribute",Wt="Braze must be initialized before calling methods.",ay=30,uy=30,ly=72e5,cy=3,nh=1,Ke=class{constructor(){this._e={};}Nt(e){if(typeof e!="function")return null;let r=xr.W();return this._e[r]=e,r}removeSubscription(e){delete this._e[e];}removeAllSubscriptions(){this._e={};}ic(){return Object.keys(this._e).length}Rt(e){let r=[];for(let n in this._e){let i=this._e[n];
1r.push(i(e));}return r}},D=class t{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v){this.id=e,this.viewed=r,this.title=n,this.imageUrl=i,this.description=o,this.created=s,this.updated=a,this.categories=u,this.expiresAt=l,this.url=c,this.linkText=d,this.aspectRatio=h,this.extras=p,this.pinned=f,this.dismissible=g,this.clicked=v,this.id=e,this.viewed=r||false,this.title=n||"",this.imageUrl=i,this.description=o||"",this.created=s||null,this.updated=a||null,this.categories=u||[],this.expiresAt=l||null,this.url=c,this.linkText=d,h==null?this.aspectRatio=null:(h=parseFloat(h.toString()),this.aspectRatio=isNaN(h)?null:h),this.extras=p||{},this.pinned=f||false,this.dismissible=g||false,this.dismissed=false,this.clicked=v||false,this.isControl=false,this.test=false,this.Et=null,this.Tt=null,this.It=null;}subscribeToClickedEvent(e){return this.St().Nt(e)}subscribeToDismissedEvent(e){return this.At().Nt(e)}removeSubscription(e){this.St().removeSubscription(e),this.At().removeSubscription(e);}removeAllSubscriptions(){this.St().removeAllSubscriptions(),this.At().removeAllSubscriptions();}dismissCard(){if(!this.dismissible||this.dismissed)return;typeof this.logCardDismissal=="function"&&this.logCardDismissal();let e=this.T;!e&&this.id&&(e=document.getElementById(this.id)),e&&(e.style.height=e.offsetHeight+"px",e.className=e.className+" ab-hide",setTimeout(function(){e&&e.parentNode&&(e.style.height="0",e.style.margin="0",setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e);},t.Dt));},oy));}St(){return this.Et==null&&(this.Et=new Ke),this.Et}At(){return this.Tt==null&&(this.Tt=new Ke),this.Tt}K(){let e=new Date().valueOf();return !(this.It!=null&&e-this.It<t.Ct)&&(this.It=e,this.viewed=true,true)}p(){this.viewed=true,this.clicked=true,this.St().Rt();}N(){return !(!this.dismissible||this.dismissed)&&(this.dismissed=true,this.At().Rt(),true)}Lt(e){if(e==null||e[t._t.ht]!==this.id)return  true;if(e[t._t.Ot])return  false;if(e[t._t.nt]!=null&&this.updated!=null&&parseInt(e[t._t.nt])<Ii(this.updated.valueOf()))return  true;if(e[t._t.et]&&!this.viewed&&(this.viewed=true),e[t._t.zt]&&!this.clicked&&(this.clicked=e[t._t.zt]),e[t._t.rt]!=null&&(this.title=e[t._t.rt]),e[t._t.ot]!=null&&(this.imageUrl=e[t._t.ot]),e[t._t.ct]!=null&&(this.description=e[t._t.ct]),e[t._t.nt]!=null){let r=Qt(e[t._t.nt]);r!=null&&(this.updated=r);}if(e[t._t.lt]!=null){let r;r=e[t._t.lt]===t.Mt?null:Qt(e[t._t.lt]),this.expiresAt=r;}if(e[t._t.URL]!=null&&(this.url=e[t._t.URL]),e[t._t.ft]!=null&&(this.linkText=e[t._t.ft]),e[t._t.xt]!=null){let r=parseFloat(e[t._t.xt].toString());this.aspectRatio=isNaN(r)?null:r;}return e[t._t.bt]!=null&&(this.extras=e[t._t.bt]),e[t._t.gt]!=null&&(this.pinned=e[t._t.gt]),e[t._t.jt]!=null&&(this.dismissible=e[t._t.jt]),e[t._t.kt]!=null&&(this.test=e[t._t.kt]),true}Y(){b.error("Must be implemented in a subclass");}};D.Mt=-1,D._t={ht:"id",et:"v",jt:"db",Ot:"r",nt:"ca",gt:"p",lt:"ea",bt:"e",Z:"tp",ot:"i",rt:"tt",ct:"ds",URL:"u",ft:"dm",xt:"ar",zt:"cl",kt:"t"},D.it={st:"captioned_image",Pt:"text_announcement",Ut:"short_news",Gt:"banner_image",Xt:"control"},D.tt={ht:"id",et:"v",jt:"db",dt:"cr",nt:"ca",gt:"p",ut:"t",lt:"ea",bt:"e",Z:"tp",ot:"i",rt:"tt",ct:"ds",URL:"u",ft:"dm",xt:"ar",zt:"cl",kt:"s"},D.vt={Vt:"ADVERTISING",Wt:"ANNOUNCEMENTS",wt:"NEWS",Ft:"SOCIAL"},D.Dt=400,D.Ct=1e4;var $o=class extends D{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f){super(e,r,null,n,null,i,o,s,a,u,l,c,d,h,p,f),this._="ab-image-only",this.S=false,this.test=false;}Y(){let e={};return e[D.tt.Z]=D.it.Gt,e[D.tt.ht]=this.id,e[D.tt.et]=this.viewed,e[D.tt.ot]=this.imageUrl,e[D.tt.nt]=this.updated,e[D.tt.dt]=this.created,e[D.tt.ut]=this.categories,e[D.tt.lt]=this.expiresAt,e[D.tt.URL]=this.url,e[D.tt.ft]=this.linkText,e[D.tt.xt]=this.aspectRatio,e[D.tt.bt]=this.extras,e[D.tt.gt]=this.pinned,e[D.tt.jt]=this.dismissible,e[D.tt.zt]=this.clicked,e[D.tt.kt]=this.test,e}},Bo=class extends D{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v){super(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v),this._="ab-captioned-image",this.S=true,this.test=false;}Y(){let e={};return e[D.tt.Z]=D.it.st,e[D.tt.ht]=this.id,e[D.tt.et]=this.viewed,e[D.tt.rt]=this.title,e[D.tt.ot]=this.imageUrl,e[D.tt.ct]=this.description,e[D.tt.nt]=this.updated,e[D.tt.dt]=this.created,e[D.tt.ut]=this.categories,e[D.tt.lt]=this.expiresAt,e[D.tt.URL]=this.url,e[D.tt.ft]=this.linkText,e[D.tt.xt]=this.aspectRatio,e[D.tt.bt]=this.extras,e[D.tt.gt]=this.pinned,e[D.tt.jt]=this.dismissible,e[D.tt.zt]=this.clicked,e[D.tt.kt]=this.test,e}},zo=class extends D{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v){super(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v),this._="ab-classic-card",this.S=true;}Y(){let e={};return e[D.tt.Z]=D.it.Ut,e[D.tt.ht]=this.id,e[D.tt.et]=this.viewed,e[D.tt.rt]=this.title,e[D.tt.ot]=this.imageUrl,e[D.tt.ct]=this.description,e[D.tt.nt]=this.updated,e[D.tt.dt]=this.created,e[D.tt.ut]=this.categories,e[D.tt.lt]=this.expiresAt,e[D.tt.URL]=this.url,e[D.tt.ft]=this.linkText,e[D.tt.xt]=this.aspectRatio,e[D.tt.bt]=this.extras,e[D.tt.gt]=this.pinned,e[D.tt.jt]=this.dismissible,e[D.tt.zt]=this.clicked,e[D.tt.kt]=this.test,e}},bn=class extends D{constructor(e,r,n,i,o,s){super(e,r,null,null,null,null,n,null,i,null,null,null,o,s),this.isControl
1=true,this._="ab-control-card",this.S=false;}Y(){let e={};return e[D.tt.Z]=D.it.Xt,e[D.tt.ht]=this.id,e[D.tt.et]=this.viewed,e[D.tt.nt]=this.updated,e[D.tt.lt]=this.expiresAt,e[D.tt.bt]=this.extras,e[D.tt.gt]=this.pinned,e[D.tt.kt]=this.test,e}};function Wa(t){let e=t==null?void 0:t.j(E.C._E),r;return e&&(r={label:e.l,name:e.a}),r}var Mt=class t{constructor(e,r,n,i,o){this.userId=e,this.type=r,this.time=n,this.sessionId=i,this.data=o,this.userId=e,this.type=r,this.time=iy(n),this.sessionId=i,this.data=o;}Mr(){var e;let r={name:this.type,time:Ii(this.time),data:this.data||{},session_id:this.sessionId};this.userId!=null&&(r.user_id=this.userId);let n=((e=P.Sr())===null||e===void 0?void 0:e.Fh())||false;if(!r.user_id&&!n){let i=Wa(P.l());i&&(r.alias=i);}return r}Y(){return {u:this.userId,t:this.type,ts:this.time,s:this.sessionId,d:this.data}}static fromJson(e){return new t(e.user_id,e.name,e.time,e.session_id,e.data)}static RE(e){return e!=null&&Pi(e)&&e.t!=null&&e.t!==""}static qn(e){return new t(e.u,e.t,e.ts,e.s,e.d)}},Jt=t=>t instanceof Error?t.message:String(t),hr=class t{constructor(e,r,n){this.eu=e,e==null&&(e=xr.W()),!n||isNaN(n)?this.Dl=new Date().valueOf():this.Dl=n,this.eu=e,this.Wl=new Date().valueOf(),this.Hl=r;}Y(){return `g:${encodeURIComponent(this.eu)}|e:${this.Hl}|c:${this.Dl}|l:${this.Wl}`}static hE(e){if(typeof e!="string")return null;let r=e.lastIndexOf("|e:"),n=e.substring(0,r),i=n.split("g:")[1],o;return o=/[|:]/.test(i)?encodeURIComponent(i):i,e=e.replace(n,`g:${o}`)}static qn(e){let r;if(typeof e=="string")try{let n=e.split("|");if(!Ze(n)||n.length!==4)return null;let i=s=>s.split(":")[1],o=s=>{let a=parseInt(i(s));if(!isNaN(a))return a};r=new t(decodeURIComponent(i(n[0])),o(n[1]),o(n[2])),r.Wl=o(n[3]);}catch(n){b.info(`Unable to parse cookie string ${e}, failed with error: ${Jt(n)}`);}else {if(e==null||e.g==null)return null;r=new t(e.g,e.e,e.c),r.Wl=e.l;}return r}};function jo(t){let e=t.length;for(let r=t.length-1;r>=0;r--){let n=t.charCodeAt(r);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&r--;}return e}function dy(t){try{t=t.replace(/-/g,"+").replace(/_/g,"/");let e=window.atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);let n=new Uint16Array(r.buffer);return String.fromCharCode(...n)}catch(e){return b.error("Unable to decode Base64: "+e),null}}var ae={types:{ro:"container",logCustomEvent:"logCustomEvent",setEmailNotificationSubscriptionType:"setEmailNotificationSubscriptionType",setPushNotificationSubscriptionType:"setPushNotificationSubscriptionType",setCustomUserAttribute:"setCustomUserAttribute",requestPushPermission:"requestPushPermission",addToSubscriptionGroup:"addToSubscriptionGroup",removeFromSubscriptionGroup:"removeFromSubscriptionGroup",addToCustomAttributeArray:"addToCustomAttributeArray",removeFromCustomAttributeArray:"removeFromCustomAttributeArray",no:"openLink",ao:"openLinkInWebView"},properties:{type:"type",oo:"steps",eo:"args"}},wi={Vi:"unknownBrazeAction",Yi:"noPushPrompt"},Ya=(t,e)=>{switch(t){case wi.Vi:return `${e} contains an unknown braze action type and will not be displayed.`;case wi.Yi:return `${e} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;default:return ""}};function Cu(t){try{let e=t.match(Si),r=e?e[0].length:null,n=r?t.substring(r):null;if(r==null||r>t.length-1||!n)return void b.error(`Did not find base64 encoded brazeAction in url to process : ${t}`);let i=dy(n);return i?JSON.parse(i):void b.error(`Failed to decode base64 encoded brazeAction: ${n}`)}catch(e){return void b.error(`Failed to process brazeAction URL ${t} : ${Jt(e)}`)}}function lh(t,e){let r=false;if(e){for(let n of e)if(r=r||t(n),r)return  true}return  false}function Eu(t){let e=ae.properties.type,r=ae.properties.oo;try{if(t==null)return !0;let n=t[e];return n===ae.types.ro?lh(Eu,t[r]):!_y(n)}catch(n){return  true}}function ch(t){if(!t||!dh(t))return  false;let e=ae.properties.type,r=ae.properties.oo,n=t[e];return n===ae.types.ro?lh(ch,t[r]):n===ae.types.requestPushPermission}var hy=/^[^\x00-\x1F\x22]+$/,py=/[$.]/,gy=["$add","$update","$remove","$identifier_key","$identifier_value","$new_object","$time","$google_ad_personalization","$google_ad_user_data"],fy=new RegExp(/^.+@.+\..+$/),Si=/^brazeActions:\/\/v\d+\//;function Nt(t,e,r){let n=t!=null&&typeof t=="string"&&(t===""||t.match(hy)!=null);return n||b.error(`Cannot ${e} because ${r} "${t}
1" is invalid.`),n}function Pu(t){return t!=null&&t.match(py)&&gy.indexOf(t)===-1&&b.warn("Custom attribute keys cannot contain '$' or '.'"),Nt(t,"set custom user attribute","the given key")}function Iu(t){let e=typeof t;return t==null||e==="number"||e==="boolean"||Yt(t)||e==="string"}function Ja(t,e,r){let n=r!==-1;if(n&&r>50)return b.error("Nested attributes cannot be more than 50 levels deep."),false;let i=n?r+1:-1;if(Ze(t)&&Ze(e)){for(let o=0;o<t.length&&o<e.length;o++)if(Yt(t[o])&&(e[o]=Fo(t[o])),!Ja(t[o],e[o],i))return  false}else {if(!Pi(t))return Iu(t);for(let o of Dt(t)){let s=t[o];if(n&&!Pu(o)||(Yt(s)&&(e[o]=Fo(s)),!Ja(s,e[o],i)))return  false}}return  true}function my(t,e,r,n,i){let o;return o=Pi(t)||Ze(t)?Ja(t,e,i?1:-1):Iu(t),o||b.error(`Cannot ${r} because ${n} "${t}" is invalid.`),o}function xt(t,e,r,n=false){let i=typeof t=="string"||t===null&&n;return i||b.error(`Cannot ${e} because ${r} "${t}" is invalid.`),i}function ns(t,e,r,n,i){if(t==null&&(t={}),typeof t!="object"||Ze(t))return b.error(`${e} requires that ${r} be an object. Ignoring ${i}.`),[false,null];let o,s;e===Mn?(o=76800,s="75KB"):(o=51200,s="50KB");let a=JSON.stringify(t);if(jo(a)>o)return b.error(`Could not ${n} because ${r} was greater than the max size of ${s}.`),[false,null];let u;try{u=JSON.parse(a);}catch(l){return b.error(`Could not ${n} because ${r} did not contain valid JSON.`),[false,null]}for(let l in t){if(e===Mn&&!Pu(l))return [false,null];if(!Nt(l,n,`the ${i} property name`))return [false,null];let c=t[l];if(e!==Mn&&c==null){delete t[l],delete u[l];continue}if(Yt(c)&&(u[l]=Fo(c)),!my(c,u[l],n,`the ${i} property "${l}"`,e===Mn))return [false,null]}return [true,u]}function vy(t,e){let r=false,n=false,i=()=>{b.error("Custom attribute arrays must be either string arrays or object arrays.");};for(let o of e)if(typeof o=="string"){if(n)return i(),[false,false];if(!Nt(o,`set custom user attribute "${t}"`,"the element in the given array"))return [false,false];r=true;}else {if(!Pi(o))return i(),[false,false];if(r)return i(),[false,false];if(!ns(o,Mn,"attribute value",`set custom user attribute "${t}"`,"custom user attribute"))return [false,false];n=true;}return [r,n]}function by(t){return typeof t=="string"&&t.toLowerCase().match(fy)!=null}function dh(t){if(!(ae.properties.type in t))return  false;switch(t[ae.properties.type]){case ae.types.ro:if(ae.properties.oo in t)return  true;break;case ae.types.logCustomEvent:case ae.types.setEmailNotificationSubscriptionType:case ae.types.setPushNotificationSubscriptionType:case ae.types.setCustomUserAttribute:case ae.types.addToSubscriptionGroup:case ae.types.removeFromSubscriptionGroup:case ae.types.addToCustomAttributeArray:case ae.types.removeFromCustomAttributeArray:case ae.types.no:case ae.types.ao:if(ae.properties.eo in t)return  true;break;case ae.types.requestPushPermission:return  true;default:return  false}return  false}function _y(t){let e=false;return Object.keys(ae.types).forEach(r=>{ae.types[r]!==t.toString()||(e=true);}),e}var Ne=class t{constructor(e,r){this.yt=e,this.Ui=r,this.yt=e,this.Ui=r;}getUserId(e){let r=this.yt.getUserId();if(typeof e!="function")return r;b.warn("The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)"),e(r);}addAlias(e,r){return !xt(e,"add alias","the alias",false)||e.length<=0?(b.error("addAlias requires a non-empty alias"),false):!xt(r,"add alias","the label",false)||r.length<=0?(b.error("addAlias requires a non-empty label"),false):this.Ui.Cn(e,r).L}setFirstName(e){return !!xt(e,"set first name","the firstName",true)&&this.yt.nu("first_name",e)}setLastName(e){return !!xt(e,"set last name","the lastName",true)&&this.yt.nu("last_name",e)}setEmail(e){return e===null||by(e)?this.yt.nu("email",e):(b.error(`Cannot set email address - "${e}" did not pass RFC-5322 validation.`),false)}setGender(e){return typeof e=="string"&&(e=e.toLowerCase()),!(e!==null&&!gr(t.Genders,e,`Gender "${e}" is not a valid gender.`,"User.Genders"))&&this.yt.nu("gender",e)}setDateOfBirth(e,r,n){return e===null&&r===null&&n===null?this.yt.nu("dob",null):(e=e!=null?parseInt(e.toString()):null,r=r!=null?parseInt(r.toString()):null,n=n!=null?parseInt(n.toString()):null,e==null||r==null||n==null||isNaN(e)||isNaN(r)||isNaN(n)||r>12||r<1||n>31||n<1?(b.error("Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);"),false):this.yt.nu("dob",`${e}-${r}-${n}`))}setCountry(e){return !!xt(e,"set country","the country",true)&&this.yt.nu("country",e)}setHomeCity(e){return !!xt(e,"set home city","the homeCity",true)&&this.yt.nu("home_city",e)}setLanguage(e){return !!xt(e,"set language","the language",true)&&this.yt.nu("language",e)}setEmailNotificationSubscriptionType(e){return !!gr(t.NotificationSubscriptionTypes,e,`Email notification setting "${e}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.yt.nu("email_subscribe",e)}setPushNotificationSubscriptionType(e){return !!gr(t.NotificationSubscriptionTypes,e,`Push notification setting "${e}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.yt.nu("push_subscribe",e)}setPhoneNumber(e){return !!xt(e,"set phone number","the phoneNumber",true)&&(e===null||e.match(t.En)?this.yt.nu("phone",e):(b.error(`Cannot set phone number - "${e}
1" did not pass validation.`),false))}setLastKnownLocation(e,r,n,i,o){return e==null||r==null?(b.error("Cannot set last-known location - latitude and longitude are required."),false):(e=parseFloat(e.toString()),r=parseFloat(r.toString()),n!=null&&(n=parseFloat(n.toString())),i!=null&&(i=parseFloat(i.toString())),o!=null&&(o=parseFloat(o.toString())),isNaN(e)||isNaN(r)||n!=null&&isNaN(n)||i!=null&&isNaN(i)||o!=null&&isNaN(o)?(b.error("Cannot set last-known location - all supplied parameters must be numeric."),false):e>90||e<-90||r>180||r<-180?(b.error("Cannot set last-known location - latitude and longitude are bounded by \xB190 and \xB1180 respectively."),false):n!=null&&n<0||o!=null&&o<0?(b.error("Cannot set last-known location - accuracy and altitudeAccuracy may not be negative."),false):this.Ui.setLastKnownLocation(this.yt.getUserId(),e,r,i,n,o).L)}setCustomUserAttribute(e,r,n){if(!Pu(e))return  false;let i=o=>{let[s]=ns(o,Mn,"attribute value",`set custom user attribute "${e}"`,"custom user attribute");return s};if(Ze(r)){let[o,s]=vy(e,r);if(!o&&!s&&r.length!==0)return  false;if(o||r.length===0)return this.Ui.Fn(le.$n,e,r).L;for(let a of r)if(!i(a))return  false}else if(Pi(r)){if(!i(r))return  false;if(n)return this.Ui.Fn(le.Bn,e,r).L}else if(!(r!==void 0&&Iu(r))||(Yt(r)&&(r=Fo(r)),typeof r=="string"&&!Nt(r,`set custom user attribute "${e}"`,"the element in the given array")))return  false;return this.yt.setCustomUserAttribute(e,r)}addToCustomAttributeArray(e,r){return !!Nt(e,"add to custom user attribute array","the given key")&&!(r!=null&&!Nt(r,"add to custom user attribute array","the given value"))&&this.Ui.Fn(le.Ln,e,r).L}removeFromCustomAttributeArray(e,r){return !!Nt(e,"remove from custom user attribute array","the given key")&&!(r!=null&&!Nt(r,"remove from custom user attribute array","the given value"))&&this.Ui.Fn(le.Rn,e,r).L}incrementCustomUserAttribute(e,r){if(!Nt(e,"increment custom user attribute","the given key"))return  false;r==null&&(r=1);let n=parseInt(r.toString());return isNaN(n)||n!==parseFloat(r.toString())?(b.error(`Cannot increment custom user attribute because the given incrementValue "${r}" is not an integer.`),false):this.Ui.Fn(le.On,e,n).L}setCustomLocationAttribute(e,r,n){return !!Nt(e,"set custom location attribute","the given key")&&((r!==null||n!==null)&&(r=r!=null?parseFloat(r.toString()):null,n=n!=null?parseFloat(n.toString()):null,r==null&&n!=null||r!=null&&n==null||r!=null&&(isNaN(r)||r>90||r<-90)||n!=null&&(isNaN(n)||n>180||n<-180))?(b.error("Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by \xB190 and \xB1180 respectively, or must both be null for removal."),false):this.Ui.Gn(e,r,n).L)}addToSubscriptionGroup(e){return !xt(e,"add user to subscription group","subscription group ID",false)||e.length<=0?(b.error("addToSubscriptionGroup requires a non-empty subscription group ID"),false):this.Ui.Hn(e,t.Kn.SUBSCRIBED).L}removeFromSubscriptionGroup(e){return !xt(e,"remove user from subscription group","subscription group ID",false)||e.length<=0?(b.error("removeFromSubscriptionGroup requires a non-empty subscription group ID"),false):this.Ui.Hn(e,t.Kn.UNSUBSCRIBED).L}Pn(e,r,n,i,o){this.yt.Pn(e,r,n,i,o),this.Ui.Mn();}Sn(e){this.yt.Sn(e);}};Ne.Genders={MALE:"m",FEMALE:"f",OTHER:"o",UNKNOWN:"u",NOT_APPLICABLE:"n",PREFER_NOT_TO_SAY:"p"},Ne.NotificationSubscriptionTypes={OPTED_IN:"opted_in",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},Ne.En=/^[0-9 .\\(\\)\\+\\-]+$/,Ne.Kn={SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},Ne.Yn="user_id",Ne.lu="custom",Ne.lr=997;var Ho=class{constructor(){}ef(){}sf(){}Da(e){}static ff(e,r){if(e&&r){if(e=e.toLowerCase(),Ze(r.nf)){for(let n=0;n<r.nf.length;n++)if(e.indexOf(r.nf[n].toLowerCase())!==-1)return r.identity}else if(e.indexOf(r.nf.toLowerCase())!==-1)return r.identity}}},qt={rO:"Chrome",eO:"Edge",oO:"Opera",Bg:"Safari",OO:"Firefox"},cr={xg:"Android",io:"iOS",Pg:"Mac",Og:"Windows"},Xa=class t extends Ho{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.browser=null,this.version=null,this.userAgentData){let e=this.hc();this.browser=e.browser||"Unknown Browser",this.version=e.version||"Unknown Version";}this.OS=null;}ef(){return this.browser}sf(){return this.version}Da(e){if(this.OS)return Promise.resolve(this.OS);let r=n=>{for(let i=0;i<e.length;i++){let o=t.ff(n,e[i]);if(o)return this.OS=o,this.OS}return n};return this.userAgentData.platform?Promise.resolve(r(this.userAgentData.platform)):this.getHighEntropyValues().then(n=>n.platform?r(n.platform):navigator.platform).catch(()=>navigator.platform)}hc(){let e={},r=this.userAgentData.brands;if(r&&r.length)for(let n of r){let i=this.uc(qt),o=n.brand.match(i);if(o&&o.length>
10){e.browser=o[0],e.version=n.version;break}}return e}uc(e){let r=[];for(let n in e){let i=n;r.push(e[i]);}return new RegExp("("+r.join("|")+")","i")}getHighEntropyValues(){return this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues(["platform"]):Promise.reject()}},Qa=class t extends Ho{constructor(){super(),this.fd=t.hc(navigator.userAgent||"");}ef(){return this.fd[0]||"Unknown Browser"}sf(){return this.fd[1]||"Unknown Version"}Da(e){for(let r=0;r<e.length;r++){let n=e[r].string,i=t.ff(n,e[r]);if(i)return i===cr.Pg&&navigator.maxTouchPoints>1&&(i=cr.io),Promise.resolve(i)}return Promise.resolve(navigator.platform)}static hc(e){let r,n=e.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(e.indexOf("(Web0S; Linux/SmartTV)")!==-1)return ["LG Smart TV",null];if(e.indexOf("CrKey")!==-1)return ["Chromecast",null];if(e.indexOf("BRAVIA")!==-1||e.indexOf("SonyCEBrowser")!==-1||e.indexOf("SonyDTV")!==-1)return ["Sony Smart TV",null];if(e.indexOf("PhilipsTV")!==-1)return ["Philips Smart TV",null];if(e.match(/\b(Roku)\b/))return ["Roku",null];if(e.match(/\bAFTM\b/))return ["Amazon Fire Stick",null];if(n[1]===qt.rO&&(r=e.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/),r!=null))return r=r.slice(1),r[0]=r[0].replace("OPR",qt.oO),r[0]=r[0].replace("EdgA",qt.eO),r[0]==="Edg"&&(r[0]=qt.eO),[r[0],r[1]];if(n[1]===qt.Bg&&(r=e.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/),r!=null))return r=r.slice(1),r[0]=r[0].replace("EdgiOS",qt.eO),[r[0],r[1]];if(n=n[2]?[n[1],n[2]]:[null,null],n[0]===qt.Bg&&(r=e.match(/version\/(\.?\d+(\.\d+)*)/i))!=null&&n.splice(1,1,r[1]),(r=e.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))!=null&&n.splice(1,1,r[2]),n[0]===qt.oO&&(r=e.match(/mini\/(\.?\d+(\.\d+)*)/i))!=null)return ["Opera Mini",r[1]||""];if(n[0]){let i=n[0].toLowerCase();i==="crios"&&(n[0]=qt.rO),i==="tizen"&&(n[0]="Samsung Smart TV",n[1]=null),i==="samsungbrowser"&&(n[0]="Samsung Browser");}return n}},Vo=class t{constructor(){let e=navigator.userAgentData?Xa:Qa;this.Sg=new e,this.userAgent=navigator.userAgent,this.browser=this.Sg.ef(),this.version=this.Sg.sf(),this.OS=null,this.Da().then(n=>this.OS=n);let r=navigator;this.language=(r.userLanguage||r.language||r.browserLanguage||r.systemLanguage||"").toLowerCase(),this.Qo=t.vg(this.userAgent);}IE(){return this.browser===qt.Bg}Ca(){return this.OS||null}Da(){return this.OS?Promise.resolve(this.OS):this.Sg.Da(t.kg).then(e=>(this.OS=e,e))}static vg(e){e=e.toLowerCase();let r=["googlebot","bingbot","slurp","duckduckbot","baiduspider","yandex","facebookexternalhit","sogou","ia_archiver","https://github.com/prerender/prerender","aolbuild","bingpreview","msnbot","adsbot","mediapartners-google","teoma","taiko"];for(let n=0;n<r.length;n++)if(e.indexOf(r[n])!==-1)return  true;return  false}};Vo.kg=[{string:navigator.platform,nf:"Win",identity:cr.Og},{string:navigator.platform,nf:"Mac",identity:cr.Pg},{string:navigator.platform,nf:"BlackBerry",identity:"BlackBerry"},{string:navigator.platform,nf:"FreeBSD",identity:"FreeBSD"},{string:navigator.platform,nf:"OpenBSD",identity:"OpenBSD"},{string:navigator.platform,nf:"Nintendo",identity:"Nintendo"},{string:navigator.platform,nf:"SunOS",identity:"SunOS"},{string:navigator.platform,nf:"PlayStation",identity:"PlayStation"},{string:navigator.platform,nf:"X11",identity:"X11"},{string:navigator.userAgent,nf:["iPhone","iPad","iPod"],identity:cr.io},{string:navigator.platform,nf:"Pike v",identity:cr.io},{string:navigator.userAgent,nf:["Web0S"],identity:"WebOS"},{string:navigator.platform,nf:["Linux armv7l","Android"],identity:cr.xg},{string:navigator.userAgent,nf:["Android"],identity:cr.xg},{string:navigator.platform,nf:"Linux",identity:"Linux"}];var St=new Vo,E={iu:{su:"ab.storage.userId",Uo:"ab.storage.deviceId",El:"ab.storage.sessionId"},C:{ec:"ab.test",tE:"ab.storage.events",eE:"ab.storage.attributes",sE:"ab.storage.attributes.anonymous_user",Fa:"ab.storage.device",Jh:"ab.storage.sdk_metadata",Qh:"ab.storage.session_id_for_cached_metadata",In:"ab.storage.pushToken",Ai:"ab.storage.newsFeed",Bi:"ab.storage.lastNewsFeedRefresh",J:"ab.storage.cardImpressions",ul:"ab.storage.serverConfig",rE:"ab.storage.triggers",oE:"ab.storage.triggers.ts",Nl:"ab.storage.messagingSessionStart",bs:"ab.storage.cc",js:"ab.storage.ccLastFullSync",Rs:"ab.storage.ccLastCardUpdated",nE:"ab.storage.ccRateLimitCurrentTokenCount",Ru:"ab.storage.globalRateLimitCurrentTokenCount",bu:"ab.storage.dynamicRateLimitCurrentTokenCount",v:"ab.storage.ccClicks",H:"ab.storage.ccImpressions",A:"ab.storage.ccDismissals",aE:"ab.storage.lastDisplayedTriggerTimesById",iE:"ab.storage.lastDisplayedTriggerTime",EE:"ab.storage.triggerFireInstancesById",wh:"ab.storage.signature",xs:"ab.storage.brazeSyncRetryCount",Us:"ab.storage.sdkVersion",vi:"ab.storage.ff",wi:"ab.storage.ffImpressions",zi:"ab.storage.ff
1LastRefreshAt",Si:"ab.storage.ff.sessionId",lE:"ab.storage.lastReqToEndpoint",SE:"ab.storage.requestAttempts",Xr:"ab.storage.deferredIam",du:"ab.storage.lastSdkReq",_E:"ab.storage.alias"},se:"ab.optOut"},ot=class t{constructor(e,r){this.uE=e,this.TE=r,this.uE=e,this.TE=r;}Vh(e){let r=Dt(E.iu),n=new t.ee(e);for(let i of r)n.remove(E.iu[i]);}uu(e,r){let n=null;r!=null&&r instanceof hr&&(n=r.Y()),this.uE.store(e,n);}cE(e){let r=this.tu(e);r!=null&&(r.Wl=new Date().valueOf(),this.uu(e,r));}tu(e){let r=this.uE.br(e),n=(o=>{let s;try{s=JSON.parse(o);}catch(a){s=null;}return s})(r),i;if(n)i=hr.qn(n)||null,i&&this.uu(e,i);else {let o=hr.hE(r);i=hr.qn(o)||null,o!==r&&i&&this.uu(e,i);}return i}Al(e){this.uE.remove(e);}Kh(){let e=Dt(E.iu),r;for(let n of e)r=this.tu(E.iu[n]),r!=null&&this.uu(E.iu[n],r);}zo(e){let r;if(e==null||e.length===0)return  false;r=Ze(e)?e:[e];let n=this.TE.br(E.C.tE);n!=null&&Ze(n)||(n=[]);for(let i=0;i<r.length;i++)n.push(r[i].Y());return this.TE.store(E.C.tE,n)}kl(e){return e!=null&&this.zo([e])}AE(){let e=this.TE.br(E.C.tE);this.TE.remove(E.C.tE),e==null&&(e=[]);let r=[],n=false,i=null;if(Ze(e))for(let o=0;o<e.length;o++)Mt.RE(e[o])?r.push(Mt.qn(e[o])):i=o;else n=true;if(n||i!=null){let o="Stored events could not be deserialized as Events";n&&(o+=", was "+Object.prototype.toString.call(e)+" not an array"),i!=null&&(o+=", value at index "+i+" does not look like an event"),o+=", serialized values were of type "+typeof e+": "+JSON.stringify(e),r.push(new Mt(null,le.Ls,new Date().valueOf(),null,{e:o}));}return r}I(e,r){return !!gr(E.C,e,"StorageManager cannot store object.","STORAGE_KEYS.OBJECTS")&&this.TE.store(e,r)}j(e){return !!gr(E.C,e,"StorageManager cannot retrieve object.","STORAGE_KEYS.OBJECTS")&&this.TE.br(e)}ii(e){return !!gr(E.C,e,"StorageManager cannot remove object.","STORAGE_KEYS.OBJECTS")&&(this.TE.remove(e),true)}clearData(){let e=Dt(E.iu),r=Dt(E.C);for(let n=0;n<e.length;n++){let i=e[n];this.uE.remove(E.iu[i]);}for(let n=0;n<r.length;n++){let i=r[n];this.TE.remove(E.C[i]);}}gE(e){return e||E.C.sE}Pa(e){let r=this.TE.br(E.C.eE);r==null&&(r={});let n=this.gE(e[Ne.Yn]),i=r[n];for(let o in e)o!==Ne.Yn&&(r[n]==null||i&&i[o]==null)&&this.mu(e[Ne.Yn],o,e[o]);}mu(e,r,n){let i=this.TE.br(E.C.eE);i==null&&(i={});let o=this.gE(e),s=i[o];if(s==null&&(s={},e!=null&&(s[Ne.Yn]=e)),r===Ne.lu){s[r]==null&&(s[r]={});for(let a in n)s[r][a]=n[a];}else s[r]=n;return i[o]=s,this.TE.store(E.C.eE,i)}OE(){let e=this.TE.br(E.C.eE);this.TE.remove(E.C.eE);let r=[];for(let n in e)e[n]!=null&&r.push(e[n]);return r}ru(e){let r=this.TE.br(E.C.eE);if(r!=null){let s=this.gE(null),a=r[s];a!=null&&(r[s]=void 0,this.TE.store(E.C.eE,r),a[Ne.Yn]=e,this.Pa(a));}let n=this.tu(E.iu.El),i=null;n!=null&&(i=n.eu);let o=this.AE();if(o!=null)for(let s=0;s<o.length;s++){let a=o[s];a.userId==null&&a.sessionId==i&&(a.userId=e),this.kl(a);}}dE(){return this.TE.fE}};ot.rc=class{constructor(t){this.rn=t,this.rn=t,this.fE=St.IE()?3:10;}bE(t){return t+"."+this.rn}store(t,e){let r={v:e};try{return localStorage.setItem(this.bE(t),JSON.stringify(r)),!0}catch(n){return b.info("Storage failure: "+Jt(n)),false}}br(t){try{let e=null,r=localStorage.getItem(this.bE(t));return r!=null&&(e=JSON.parse(r)),e==null?null:e.v}catch(e){return b.info("Storage retrieval failure: "+Jt(e)),null}}remove(t){try{localStorage.removeItem(this.bE(t));}catch(e){return b.info("Storage removal failure: "+Jt(e)),false}}},ot.ac=class{constructor(){this.mE={},this.KE=5242880,this.fE=3;}store(t,e){let r={value:e},n=this.YE(e);return n>this.KE?(b.info("Storage failure: object is \u2248"+n+" bytes which is greater than the max of "+this.KE),false):(this.mE[t]=r,true)}YE(t){let e=[],r=[t],n=0;for(;r.length;){let i=r.pop();if(typeof i=="boolean")n+=4;else if(typeof i=="string")n+=2*i.length;else if(typeof i=="number")n+=8;else if(typeof i=="object"&&e.indexOf(i)===-1){let o,s;e.push(i);for(let a in i)s=i,o=a,r.push(s[o]);}}return n}br(t){let e=this.mE[t];return e==null?null:e.value}remove(t){this.mE[t]=null;}},ot.ee=class{constructor(t,e){this.rn=t,this.NE=e,this.rn=t,this.CE=this.GE(),this.DE=576e3,this.NE=!!e;}bE(t){return this.rn!=null?t+"."+this.rn:t}GE(){let t=0,e=document.location.hostname,r=e.split("."),n="ab._gd";
1for(;t<r.length-1&&document.cookie.indexOf(n+"="+n)===-1;)t++,e="."+r.slice(-1-t).join("."),document.cookie=n+"="+n+";domain="+e+";";return document.cookie=n+"=;expires="+new Date(0).toUTCString()+";domain="+e+";",e}ne(){let t=new Date;return t.setTime(t.getTime()+60*this.DE*1e3),t.getFullYear()}ME(){let t=rs(E.iu),e=document.cookie.split(";");for(let r=0;r<e.length;r++){let n=e[r];for(;n.charAt(0)===" ";)n=n.substring(1);let i=false;for(let o=0;o<t.length;o++)if(n.indexOf(t[o])===0){i=true;break}if(i){let o=n.split("=")[0];o.indexOf("."+this.rn)===-1&&this.pE(o);}}}store(t,e){this.ME();let r=new Date;r.setTime(r.getTime()+60*this.DE*1e3);let n="expires="+r.toUTCString(),i="domain="+this.CE,o;o=this.NE?e:encodeURIComponent(e);let s=this.bE(t)+"="+o+";"+n+";"+i+";path=/";return s.length>=4093?(b.info("Storage failure: string is "+s.length+" chars which is too large to store as a cookie."),false):(document.cookie=s,true)}br(t){let e=[],r=this.bE(t)+"=",n=document.cookie.split(";");for(let i=0;i<n.length;i++){let o=n[i];for(;o.charAt(0)===" ";)o=o.substring(1);if(o.indexOf(r)===0)try{let s;s=this.NE?o.substring(r.length,o.length):decodeURIComponent(o.substring(r.length,o.length)),e.push(s);}catch(s){return b.info("Storage retrieval failure: "+Jt(s)),this.remove(t),null}}return e.length>0?e[e.length-1]:null}remove(t){this.pE(this.bE(t));}pE(t){let e=t+"=;expires="+new Date(0).toUTCString();document.cookie=e,document.cookie=e+";path=/";let r=e+";domain="+this.CE;document.cookie=r,document.cookie=r+";path=/";}},ot.tc=class{constructor(t,e,r){this.rn=t,this.vE=[],e&&this.vE.push(new ot.ee(t)),r&&this.vE.push(new ot.rc(t)),this.vE.push(new ot.ac);}store(t,e){let r=true;for(let n=0;n<this.vE.length;n++)r=this.vE[n].store(t,e)&&r;return r}br(t){for(let e=0;e<this.vE.length;e++){let r=this.vE[e].br(t);if(r!=null)return r}return null}remove(t){new ot.ee(this.rn).remove(t);for(let e=0;e<this.vE.length;e++)this.vE[e].remove(t);}};var Za=class{constructor(e,r,n){this.u=e,this.Jn=r,this.Qn=n,this.u=e,this.Jn=r||false,this.Qn=n,this.Xn=new Ke,this.Zn=0,this.gh=1;}Fh(){return this.Jn}kh(){return this.u.j(E.C.wh)}setSdkAuthenticationSignature(e){let r=this.kh();this.u.I(E.C.wh,e);let n=we.ts.Zt;new we(n,b).setItem(n.hs.jh,this.gh,e),r!==e&&this.Vs();}xh(){this.u.ii(E.C.wh);let e=we.ts.Zt;new we(e,b).re(e.hs.jh,this.gh);}subscribeToSdkAuthenticationFailures(e){return this.Qn.Nt(e)}qh(e){this.Qn.Rt(e);}yh(){this.Xn.removeAllSubscriptions();}Bh(){this.Zn+=1;}Gh(){return this.Zn}Vs(){this.Zn=0;}},_n=class{constructor(){}Ss(e){}changeUser(e=false){}clearData(e=false){}},eu=class{constructor(e){this.id=e,this.id=e;}Mr(){let e={};return this.browser!=null&&(e.browser=this.browser),this.Ta!=null&&(e.browser_version=this.Ta),this.os!=null&&(e.os_version=this.os),this.resolution!=null&&(e.resolution=this.resolution),this.language!=null&&(e.locale=this.language),this.timeZone!=null&&(e.time_zone=this.timeZone),this.userAgent!=null&&(e.user_agent=this.userAgent),e}},lr={BROWSER:"browser",BROWSER_VERSION:"browserVersion",OS:"os",RESOLUTION:"resolution",LANGUAGE:"language",TIME_ZONE:"timeZone",USER_AGENT:"userAgent"},tu=class{constructor(e,r){this.u=e,this.Ia=r,this.u=e,r==null&&(r=rs(lr)),this.Ia=r;}ce(e=true){let r=this.u.tu(E.iu.Uo);r==null&&(r=new hr(xr.W()),e&&this.u.uu(E.iu.Uo,r));let n=new eu(r.eu);for(let i=0;i<this.Ia.length;i++)switch(this.Ia[i]){case lr.BROWSER:n.browser=St.browser;break;case lr.BROWSER_VERSION:n.Ta=St.version;break;case lr.OS:n.os=this.Da();break;case lr.RESOLUTION:n.Sa=screen.width+"x"+screen.height;break;case lr.LANGUAGE:n.language=St.language;break;case lr.TIME_ZONE:n.timeZone=this.Oa(new Date);break;case lr.USER_AGENT:n.userAgent=St.userAgent;}return n}Da(){if(St.Ca())return St.Ca();let e=this.u.j(E.C.Fa);return e&&e.os_version?e.os_version:St.Da()}Oa(e){let r=false;if(typeof Intl!="undefined"&&typeof Intl.DateTimeFormat=="function")try{if(typeof Intl.DateTimeFormat().resolvedOptions=="function"){let i=Intl.DateTimeFormat().resolvedOptions().timeZone;if(i!=null&&i!=="")return i}}catch(i){b.info("Intl.DateTimeFormat threw an error, cannot detect user's time zone:"+Jt(i)),r=true;}if(r)return "";let n=e.getTimezoneOffset();return this.Ga(n)}Ga(e){let r=Math.trunc(e/60),n=Math.trunc(e%60),i="GMT";return e!==0&&(i+=e<0?"+":"-",i+=("00"+Math.abs(r)).slice(-2)+":"+("00"+Math.abs(n)).slice(-2)),i}},pn={Na:"invalid_api_key",Xa:"blacklisted",$a:"no_device_identifier",Ba:"invalid_json_response",Ra:"empty_response",__:"sdk_auth_error"},ne={_s:{Ka:"data",Xs:"content_cards/sync",Ri:"feature_flags/sync",Tr:"template"},ku:t=>t==null?void 0:t.j(E.C.lE),sm:t=>t==null?void 0:t.j(E.C.SE),nm:(t,e)=>{t==null||t.I(E.C.lE,e);},um:(t,e)=>{t==null||t.I(E.C.SE,e);},Wa:(t,e)=>{if(!t||!e)return  -1;let r=ne.ku(t);if(r==null)return  -1;let n=r[e];return n==null||isNaN(n)?-1:n},Ya:(t,e)=>{let r=nh;if(!t||!e)return r;let n=ne.sm(t);return n==null?r:(r=n[e],r==null||isNaN(r)?nh:r)},Hs:(t,e,r)=>{if(!t||!e)return;let n=ne.ku(t);n==null&&(n={}),n[e]=r,ne.nm(t,n);},Ws:(t,e,r)=>{if(!t||!e)return;let n=ne.sm(t);n==null&&(n={}),n[e]=r,ne.um(t,n);},ti:(t,e)=>{if(!t||!e)return;let r=ne.Ya(t,e);ne.Ws(t,e,r+1);}},ru=class{constructor(e,r,n,i,o,s,a,u,l,c,d,h){this.on=e,this.u=r,this.Ko=n,this.yt=i,this.oi=o,this.qt=s,this.rn=a,this.Go=u,this.Bo=l,this.Vo=c,this.appVersion=d,this.Xh=h,this.Hh=p=>p==null?"":`${p} `,this.on=e,this.u=r,this.Ko=n,this.yt=i,this.oi=o,this.qt=s,this.rn=a,this.Go=u,this.Bo=l,this.Vo=c,this.appVersion=d,this.Xh=h,this.Yh=["npm"];}$s(e,r=false,n=false){let i=this.on.ce(!n),o=i.Mr(),s=this.u.j(E.C.Fa);vn(s,o)||(e.device=o),e.api_key=this.rn,e.time=Ii(new Date().valueOf(),true);let a=this.u.j(E.C.Jh)||[],u=this.u.j(E.C.Qh)||"";if(this.Yh.length>0&&(!vn(a,this.Yh)||u!==this.oi.xi())&&(e.sdk_metadata=this.Yh),e.sdk_version=this.Bo,this.Vo&&(e.sdk_flavor=this.Vo),e.app_version=this.appVersion,e.app_version_code=this.Xh,e.device_id=i.id,r){let l=this.yt.getUserId();l!=null&&(e.user_id=l);}if(!e.user_id&&!this.Ko.Fh()){let l=Wa(this.u);l&&(e.alias=l);}return e}Qs(e,r,n){let i=r.auth_error,o=r.error;if(!i&&!o)return  true;if(i){let s;this.Ko.Bh();let a={errorCode:i.error_code};for(let l of n)Ze(l)&&l[0]==="X-Braze-Auth-Signature"&&(a.signature=l[1]);e.respond_with&&e.respond_with.user_id?a.userId=e.respond_with.user_id:e.user_id&&(a.userId=e.user_id);let u=i.reason;return u?(a.reason=u,s=`due to ${u}`):s=`with error code ${i.error_code}.`,this.Ko.Fh()||(s+=' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),b.error(`SDK Authentication failed ${s}`),this.Zh(e.events||[],e.attributes||[]),this.Ko.qh(a),false}if(o){let s,a=o;switch(a){case pn.Ra:return s="Received successful response with empty body.",Qe.q(le.Ls,{e:s}),b.info(s),false;
1case pn.Ba:return s="Received successful response with invalid JSON",Qe.q(le.Ls,{e:s+": "+r.response}),b.info(s),false;case pn.Na:a=`The API key "${e.api_key}" is invalid for the baseUrl ${this.Go}`;break;case pn.Xa:a="Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";break;case pn.$a:a="No device identifier. Please contact [email protected]";}b.error("Backend error: "+a);}return  false}La(e,r,n,i){return !!(e&&e.length!==0||r&&r.length!==0||n||i)}Ea(e,r,n,i,o=false){let s=[],a=g=>g||"",u=a(this.yt.getUserId()),l=this.Ir(e,r),c=[],d=[],h,p=null;if(n.length>0){let g=[];for(let v of n){if(h=v.Mr(),this.Ko.Fh()){if(u&&!h.user_id){p||(p={}),p.events||(p.events=[]),p.events.push(h);continue}if(a(h.user_id)!==u){d.push(h);continue}}g.push(h);}g.length>0&&(l.events=g);}if(i.length>0){let g=[];for(let v of i)v&&(this.Ko.Fh()&&a(v.user_id)!==u?c.push(v):g.push(v));g.length>0&&(l.attributes=g);}if(this.Zh(d,c),l=this.$s(l,true,o),p){p=this.$s(p,false,o);let g={requestData:p,headers:this.Ps(p,ne._s.Ka)};s.push(g);}if(l&&!this.La(l.events,l.attributes,e,r))return p?s:null;let f={requestData:l,headers:this.Ps(l,ne._s.Ka)};return s.push(f),s}Zh(e,r){if(e){let n=[];for(let i of e){let o=Mt.fromJson(i);o.time=ny(o.time),n.push(o);}this.u.zo(n);}if(r)for(let n of r)this.u.Pa(n);}Ys(e,r){let n="HTTP error ";e!=null&&(n+=e+" "),n+=r,b.error(n);}qr(e){return Qe.q(le.Ua,{n:e})}Ir(e,r,n){let i={};e&&(i.feed=true),r&&(i.triggers=true);let o=n!=null?n:this.yt.getUserId();if(o&&(i.user_id=o),!i.user_id&&!this.Ko.Fh()){let s=Wa(this.u);s&&(i.alias=s);}return i.config={config_time:this.qt.hi()},{respond_with:i}}Ha(e){let r=new Date().valueOf(),n=ly.toString(),i=ne.Wa(this.u,e);return i!==-1&&(n=(r-i).toString()),n}Ps(e,r,n=false){let i=[["X-Braze-Api-Key",this.rn]],o=this.Ha(r);i.push(["X-Braze-Last-Req-Ms-Ago",o]);let s=ne.Ya(this.u,r).toString();i.push(["X-Braze-Req-Attempt",s]);let a=false;if(e.respond_with!=null&&e.respond_with.triggers&&(i.push(["X-Braze-TriggersRequest","true"]),a=true),e.respond_with!=null&&e.respond_with.feed&&(i.push(["X-Braze-FeedRequest","true"]),a=true),r===ne._s.Xs){i.push(["X-Braze-ContentCardsRequest","true"]);let u=this.u.j(E.C.xs);u&&n||(u=0,this.u.I(E.C.xs,u)),i.push(["BRAZE-SYNC-RETRY-COUNT",u.toString()]),a=true;}if(r===ne._s.Ri&&(i.push(["X-Braze-FeatureFlagsRequest","true"]),a=true),a&&i.push(["X-Braze-DataRequest","true"]),this.Ko.Fh()){let u=this.Ko.kh();u!=null&&i.push(["X-Braze-Auth-Signature",u]);}return i}Ja(e,r,n,i){window.setTimeout(()=>{b.info(`Retrying rate limited ${this.Hh(i)}SDK request.`),this.Gs(r,n,i);},e);}Gs(e,r,n,i){if(!this.Qa(n))return b.info(`${this.Hh(n)}SDK request being rate limited.`),void(typeof i=="function"&&i());let o=this.Va();if(!o.Za)return b.info(`${this.Hh(n)}SDK request being rate limited. Request will be retried in ${Math.trunc(o.au/1e3)} seconds.`),void this.Ja(o.au,e,r,n);this.u.I(E.C.du,new Date().valueOf());let s=e.device;s&&s.os_version instanceof Promise?s.os_version.then(a=>{e.device.os_version=a,r(o.fu);}):r(o.fu);}vu(e){var r;(r=this.u)===null||r===void 0||r.I(E.C.Ru,e);}gu(e,r){let n=this.pu();n==null&&(n={}),n[e]=r,this.u.I(E.C.bu,n);}qu(){var e;return (e=this.u)===null||e===void 0?void 0:e.j(E.C.Ru)}pu(){var e;return (e=this.u)===null||e===void 0?void 0:e.j(E.C.bu)}Au(e,r,n,i,o=""){let s;if(o){let u=this.pu();s=u==null||isNaN(u[o])?r:u[o];}else s=this.qu(),(s==null||isNaN(s))&&(s=r);let a=(e-i)/1e3;return s=Math.min(s+a/n,r),s}Du(e,r){return Math.max(0,(1-e)*r*1e3)}Tu(e,r=""){var n,i,o,s,a;let u={Za:true,fu:-1,au:0};if(e==null&&(e=true),!e&&!r)return u;let l,c,d=null;if(e)d=(n=this.u)===null||n===void 0?void 0:n.j(E.C.du);else {let f=ne.ku(this.u);if(f==null||f[r]==null)return u;d=f[r];}if(d==null||isNaN(d)||(e?(l=((i=this.qt)===null||i===void 0?void 0:i.Cu())||-1,c=((o=this.qt)===null||o===void 0?void 0:o.Su())||-1):(l=((s=this.qt)===null||s===void 0?void 0:s.Bu(r))||-1,c=((a=this.qt)===null||a===void 0?void 0:a.wu(r))||-1),l===-1||c===-1))return u;let h=new Date().valueOf(),p=this.Au(h,l,c,d,r);return p<1?(u.Za=false,u.au=this.Du(p,c),u):(p=Math.trunc(p)-1,u.fu=p,e?this.vu(p):this.gu(r,p),u)}Va(){return this.Tu(true)}Qa(e){let r=this.Tu(false,e);return !(r&&!r.Za)}Vs(){this.Ko.Vs();}Os(){return this.Go}addSdkMetadata(e){for(let r of e)this.Yh.indexOf(r)===-1&&this.Yh.push(r);}},is={Ks:t=>{let e,r;try{let n=()=>
1{b.error("This browser does not have any supported ajax options!");},i=!1;if(window.XMLHttpRequest&&(i=!0),!i)return void n();e=new XMLHttpRequest;let o=()=>{typeof t.error=="function"&&t.error(e.status),typeof t.Zs=="function"&&t.Zs(!1);};e.onload=()=>{let a=!1;if(e.readyState===4)if(a=e.status>=200&&e.status<300||e.status===304,a){if(typeof t.L=="function"){let u,l;try{u=JSON.parse(e.responseText),l=e.getAllResponseHeaders();}catch(c){let d={error:e.responseText===""?pn.Ra:pn.Ba,response:e.responseText};(0,t.L)(d,l);}u&&t.L(u,l);}typeof t.Zs=="function"&&t.Zs(!0);}else o();},e.onerror=()=>{o();},e.ontimeout=()=>{o();},r=JSON.stringify(t.data),e.open("POST",t.url,!0),e.setRequestHeader("Content-type","application/json"),e.setRequestHeader("X-Requested-With","XMLHttpRequest");let s=t.headers||[];for(let a of s)e.setRequestHeader(a[0],a[1]);e.send(r);}catch(n){b.error(`Network request error: ${Jt(n)}`);}}},yy=t=>{let e={},r=t.toString().split(`\r
2`);if(!r)return e;let n,i;for(let o of r)o&&(n=o.slice(0,o.indexOf(":")).toLowerCase().trim(),i=o.slice(o.indexOf(":")+1).trim(),e[n]=i);return e},os=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),fr=class{constructor(e=false,r=[]){this.L=e,this.ge=r,this.L=e,this.ge=r;}P(e){this.L=this.L&&e.L,this.ge.push(...e.ge);}},Ir={pn:()=>"serviceWorker"in navigator&&typeof ServiceWorkerRegistration!="undefined"&&"showNotification"in ServiceWorkerRegistration.prototype&&"PushManager"in window,yn:()=>"safari"in window&&"pushNotification"in window.safari&&typeof window.safari.pushNotification.permission=="function"&&typeof window.safari.pushNotification.requestPermission=="function",isPushSupported:()=>Ir.pn()||Ir.yn(),isPushBlocked:()=>{let t=Ir.isPushSupported()&&"Notification"in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission==="denied",e=Ir.isPushSupported()&&(!("Notification"in window)||window.Notification==null);return t||e},isPushPermissionGranted:()=>Ir.isPushSupported()&&"Notification"in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission==="granted",Wi:()=>!Ir.isPushBlocked()&&Ir.isPushSupported()&&!Ir.isPushPermissionGranted()},bt=Ir,nu=class{constructor(e,r,n,i,o,s,a,u,l,c){this.rn=e,this.baseUrl=r,this.oi=n,this.on=i,this.yt=o,this.qt=s,this.u=a,this.yu=u,this.Ko=l,this.$t=c,this.rn=e,this.baseUrl=r,this.ju=0,this.fE=a.dE()||0,this.$u=null,this.oi=n,this.on=i,this.yt=o,this.qt=s,this.u=a,this.Ko=l,this.$t=c,this.yu=u,this.Fu=new Ke,this.Lu=null,this.Mu=50,this.Pu=false;}xu(e,r){return !e&&!r&&this.Ko.Gh()>=this.Mu}Iu(e){let r=this.oi.Gl();if(e.length>0){let n=this.yt.getUserId();for(let i of e){let o=!i.userId&&!n||i.userId===n;i.type===le.ql&&o&&(r=true);}}return r}Nu(e=false,r=false,n=true,i,o,s,a=false,u=false){n&&this.Ou();let l=this.u.AE(),c=this.u.OE(),d=false,h=(m,y,T=-1)=>{let k=false,N=new Date().valueOf();ne.Hs(this.u,ne._s.Ka,N),T!==-1&&y.push(["X-Braze-Req-Tokens-Remaining",T.toString()]),is.Ks({url:this.baseUrl+"/data/",data:m,headers:y,L:_=>{m.respond_with!=null&&m.respond_with.triggers&&(this.ju=Math.max(this.ju-1,0)),this.$t.Qs(m,_,y)?(this.Ko.Vs(),this.qt.al(_),m.respond_with!=null&&m.respond_with.user_id!=this.yt.getUserId()||(m.device!=null&&this.u.I(E.C.Fa,m.device),m.sdk_metadata!=null&&(this.u.I(E.C.Jh,m.sdk_metadata),this.u.I(E.C.Qh,this.oi.xi())),this.yu(_),ne.Ws(this.u,ne._s.Ka,1),typeof i=="function"&&i())):_.auth_error&&(k=true);},error:()=>{m.respond_with!=null&&m.respond_with.triggers&&(this.ju=Math.max(this.ju-1,0)),this.$t.Zh(m.events,m.attributes),typeof o=="function"&&o();},Zs:_=>{if(typeof s=="function"&&s(_),n&&!d){if(_&&!k)this.zu();else {ne.ti(this.u,ne._s.Ka);let S=this.$u;(S==null||S<1e3*this.fE)&&(S=1e3*this.fE),this.zu(Math.min(3e5,os(1e3*this.fE,3*S)));}d=true;}}});},p=this.Iu(l),f=r||p;if(this.xu(a,p))return void b.info("Declining to flush data due to 50 consecutive authentication failures");if(n&&!this.$t.La(l,c,e,f))return this.zu(),void(typeof s=="function"&&s(true));let g=this.$t.Ea(e,f,l,c,u);f&&this.ju++;let v=false;if(g)for(let m of g)this.$t.Gs(m.requestData,y=>h(m.requestData,m.headers,y),ne._s.Ka,o),v=true;this.Ko.Fh()&&n&&!v?this.zu():p&&(b.info("Invoking new session subscriptions"),this.Fu.Rt());}Uu(){return this.ju>0}zu(e=1e3*this.fE){this.Pu||(this.Ou(),this.Lu=window.setTimeout(()=>{if(document.hidden){let r="visibilitychange",n=()=>{document.hidden||(document.removeEventListener(r,n,false),this.Nu());};document.addEventListener(r,n,false);}else this.Nu();},e),this.$u=e);}Ou(){this.Lu!=null&&(clearTimeout(this.Lu),this.Lu=null);}initialize(){this.Pu=false,this.zu();}destroy(){this.Fu.removeAllSubscriptions(),this.Ko.yh(),this.Ou(),this.Pu=true,this.Nu(void 0,void 0,false,void 0,void 0,void 0,void 0,true),this.Lu=null;}mr(e){return this.Fu.Nt(e)}openSession(){let e=this.oi.xi()!==this.oi.xo();e&&(this.u.cE(E.iu.Uo),this.u.cE(E.iu.su)),this.Nu(void 0,false,void 0,()=>{this.u.ii(E.C.wi);}),this.Mn(),e&&Promise.resolve().then(function(){return Sw}).then(r=>{if(this.Pu)return;let n=r.default.m();if(n!=null&&(bt.isPushPermissionGranted()||bt.isPushBlocked())){let i=()=>{n.mn()?b.info("Push token maintenance is disabled, not refreshing token for backend."):n.subscribe();},o=(u,l)=>{l&&i();},s=()=>{let u=this.u.j(E.C.In);(u==null||u)&&i();},a=we.ts.Zt;new we(a,b).jr(a.hs.cu,o,s);}});}_u(){this.u.ii(E.C.vi),this.u.ii(E.C.bs),this.u.ii(E.C.Xr);}changeUser(e,r,n){let i=this.yt.getUserId();if(i!==e){this.oi.yl(),this._u(),i!=null&&this.Nu(void 0,false,void 0,void 0,void 0),this.yt.ou(e),n?this.Ko.setSdkAuthenticationSignature(n):this.Ko.xh();for(let o=0;o<r.length;o++)r[o].changeUser(i==null);i!=null&&this.u.ii(E.C.J),this.u.ii(E.C.Fa),this.u.ii(E.C.nE),this.u.ii(E.C._E),this.openSession(),b.info('Changed user to "'+e+'".');}else {let o="Doing nothing.";n&&this.Ko.kh()!==n&&(this.Ko.setSdkAuthenticationSignature(n),o="Updated SDK authentication signature"),b.info(`Current user is already ${e}. ${o}`);}}requestImmediateDataFlush(e){this.Ou(),this.oi.xo(),this.Nu(void 0,void 0,void 0,void 0,()=>{b.error("Failed to flush data, request will be retried automatically.");},e,true);}requestFeedRefresh(){this.oi.xo(),this.Nu(true);}$r(e,r){this.oi.xo(),b.info("Requesting explicit trigger refresh."),this.Nu(void 0,true,void 0,e,r);}Cn(e,r){let n=le.Eu,i={a:e,l:r},o=Qe.q(n,i);return o&&(b.info(`Logged alias ${e} with label ${r}`),this.u.I(E.C._E,i)),o}Fn(e,r,n){if(this.qt.hu(r))return b.info(`Custom Attribute "${r}" is blocklisted, ignoring.`),new fr;let i={key:r,value:n},o=Qe.q(e,i);if(o){let s=typeof n=="object"?JSON.stringify(n,null,2):n;b.info(`Logged custom attribute: ${r} with value: ${s}`);}return o}setLastKnownLocation(e,r,n,i,o,s){let a={latitude:r,longitude:n};i!=null&&(a.altitude=i),o!=null&&(a.ll_accuracy=o),s!=null&&(a.alt_accuracy=s);let u=Qe.q(le.Ju,a,e||void 0);return u&&b.info(`Set user last known location as ${JSON.stringify(a,null,2)}`),u}kr(e,r){let n=this.oi.xo();return new Mt(this.yt.getUserId(),le.Ku,e,n,{cid:r})}Wu(e,r){return new we(e,r)}Mn(){let e=we.ts.Zt;this.Wu(e,b).setItem(e.hs.Ka,1,{baseUrl:this.baseUrl,data:{api_key:this.rn,device_id:this.on.ce().id},userId:this.yt.getUserId(),sdkAuthEnabled:this.Ko.Fh()});}yr(e){for(let r of e)if(r.api_key===this.rn)this.$t.Zh(r.events,r.attributes);else {let n=we.ts.Zt;new we(n,b).setItem(n.hs.wr,xr.W(),r);}}Gn(e,r,n){if(this.qt.hu(e))return b.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new fr;let i,o;return r===null&&n===null?(i=le.Gu,o={key:e}):(i=le.Xu,o={key:e,latitude:r,longitude:n}),Qe.q(i,o)}Hn(e,r){let n={group_id:e,status:r};return Qe.q(le.Hu,n)}},_i=class t{constructor(e=0,r=[],n=[],i=[],o=null,s=null,a={enabled:false},u={enabled:false,refresh_rate_limit:void 0},l={enabled:true,capacity:ay,refill_rate:uy,endpoint_overrides:{}}){this.hl=e,this.gl=r,this.fl=n,this.bl=i,this.Rl=o,this.cl=s,this.ml=a,this.ai=u,this.ol=l,this.hl=e,this.gl=r,this.fl=n,this.bl=i,this.Rl=o,this.cl=s,this.ml=a,this.ai=u,this.ol=l;}
2Y(){return {s:"5.5.0",l:this.hl,e:this.gl,a:this.fl,p:this.bl,m:this.Rl,v:this.cl,c:this.ml,f:this.ai,grl:this.ol}}static qn(e){let r=e.l;return e.s!=="5.5.0"&&(r=0),new t(r,e.e,e.a,e.p,e.m,e.v,e.c,e.f,e.grl)}},iu=class{constructor(e){this.u=e,this.u=e,this.tl=new Ke,this.el=new Ke,this.il=new Ke,this.sl=null,this.rl=null;}ll(){if(this.rl==null){let e=this.u.j(E.C.ul);this.rl=e!=null?_i.qn(e):new _i;}return this.rl}hi(){return this.ll().hl}al(e){if(e!=null&&e.config!=null){let r=e.config;if(r.time>this.ll().hl){let n=u=>u==null?this.ll().ol:u,i=new _i(r.time,r.events_blacklist,r.attributes_blacklist,r.purchases_blacklist,r.messaging_session_timeout,r.vapid_public_key,r.content_cards,r.feature_flags,n(r.global_request_rate_limit)),o=false;i.cl!=null&&this.Wn()!==i.cl&&(o=true);let s=false;i.ml.enabled!=null&&this.ei()!==i.ml.enabled&&(s=true);let a=false;i.ai.enabled!=null&&this.mi()!==i.ai.enabled&&(a=true),this.rl=i,this.u.I(E.C.ul,i.Y()),o&&this.tl.Rt(),s&&this.el.Rt(),a&&this.il.Rt();}}}_n(e){let r=this.tl.Nt(e);return this.sl&&this.tl.removeSubscription(this.sl),this.sl=r,r}Ms(e){return this.el.Nt(e)}bi(e){return this.il.Nt(e)}me(e){return this.ll().gl.indexOf(e)!==-1}hu(e){return this.ll().fl.indexOf(e)!==-1}Dr(e){return this.ll().bl.indexOf(e)!==-1}dl(){return this.ll().Rl}Wn(){return this.ll().cl}ei(){return this.ll().ml.enabled||false}Cl(){let e=this.ll().ol;return !(!e||e.enabled==null)&&e.enabled}Cu(){if(!this.Cl())return  -1;let e=this.ll().ol;return e.capacity==null||e.capacity<10?-1:e.capacity}Su(){if(!this.Cl())return  -1;let e=this.ll().ol;return e.refill_rate==null||e.refill_rate<=0?-1:e.refill_rate}vl(e){let r=this.ll().ol.endpoint_overrides;return r==null?null:r[e]}Bu(e){let r=this.vl(e);return r==null||isNaN(r.capacity)||r.capacity<=0?-1:r.capacity}wu(e){let r=this.vl(e);return r==null||isNaN(r.refill_rate)||r.refill_rate<=0?-1:r.refill_rate}mi(){return this.ll().ai.enabled&&this.Di()==null?(Qe.q(le.Ls,{e:"Missing feature flag refresh_rate_limit."}),false):this.ll().ai.enabled||false}Di(){return this.ll().ai.refresh_rate_limit}},ou=class{constructor(e,r,n,i){this.u=e,this.yt=r,this.qt=n,this.wl=i,this.u=e,this.yt=r,this.qt=n,this.Sl=1e3,(i==null||isNaN(i))&&(i=1800),i<this.Sl/1e3&&(b.info("Specified session timeout of "+i+"s is too small, using the minimum session timeout of "+this.Sl/1e3+"s instead."),i=this.Sl/1e3),this.wl=i;}jl(e,r){return new Mt(this.yt.getUserId(),le.xl,e,r.eu,{d:Ii(e-r.Dl)})}xi(){let e=this.u.tu(E.iu.El);return e==null?null:e.eu}Gl(){let e=new Date().valueOf(),r=this.qt.dl(),n=this.u.j(E.C.Nl);if(n!=null&&r==null)return  false;let i=false;return n==null?i=true:r!=null&&(i=e-n>1e3*r),i&&this.u.I(E.C.Nl,e),i}zl(e,r){return r==null||r.Hl==null||!(e-r.Dl<this.Sl)&&r.Hl<e}xo(){let e=new Date().valueOf(),r=e+1e3*this.wl,n=this.u.tu(E.iu.El);if(this.zl(e,n)){let i="Generating session start event with time "+e;if(n!=null){let s=n.Wl;s-n.Dl<this.Sl&&(s=n.Dl+this.Sl),this.u.kl(this.jl(s,n)),i+=" (old session ended "+s+")";}i+=". Will expire "+r.valueOf(),b.info(i);let o=new hr(xr.W(),r);return this.u.kl(new Mt(this.yt.getUserId(),le.ql,e,o.eu)),this.u.uu(E.iu.El,o),this.u.j(E.C.Nl)==null&&this.u.I(E.C.Nl,e),o.eu}if(n!=null)return n.Wl=e,n.Hl=r,this.u.uu(E.iu.El,n),n.eu}yl(){let e=this.u.tu(E.iu.El);e!=null&&(this.u.Al(E.iu.El),this.u.kl(this.jl(new Date().valueOf(),e)));}},hh={Wh:function(t,e=false){let r=false;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(E.C.ec,"true"),localStorage.getItem(E.C.ec
2)&&(localStorage.removeItem(E.C.ec),r=!0);}catch(s){if(!(s instanceof Error&&(s.name==="QuotaExceededError"||s.name==="NS_ERROR_DOM_QUOTA_REACHED")&&localStorage.length>0))throw s;r=!0;}}catch(s){b.info("Local Storage not supported!");}let n=hh.oc(),i=new ot.tc(t,n&&!e,r),o;return o=r?new ot.rc(t):new ot.ac,new ot(i,o)},oc:function(){return navigator.cookieEnabled||"cookie"in document&&(document.cookie.length>0||(document.cookie="test").indexOf.call(document.cookie,"test")>-1)}},mr=class t{constructor(e,r){this.triggerId=e,this.messageExtras=r,this.triggerId=e,this.messageExtras=r,this.extras={},this.isControl=true;}static fromJson(e){return new t(e.trigger_id,e.message_extras)}};function wy(t,e=false,r=false,n=false){if(t==null)return  false;e=e||false,r=r||false;let i=t.getBoundingClientRect();return i!=null&&(i.top>=0&&i.top<=(window.innerHeight||document.documentElement.clientHeight)||!e)&&(i.left>=0||!n)&&(i.bottom>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!r)&&(i.right<=(window.innerWidth||document.documentElement.clientWidth)||!n)}var gn={dc:null,po:wy},pr={Oe:"up",Qe:"down",U:"left",V:"right"};function ph(){if(gn.dc==null){gn.dc=false;try{let t=Object.defineProperty({},"passive",{get:()=>{gn.dc=!0;}});window.addEventListener("testPassive",()=>{},t),window.removeEventListener("testPassive",()=>{},t);}catch(t){b.error(Jt(t));}}return gn.dc}function Ci(t,e,r=()=>{}){t.addEventListener(e,r,!!ph()&&{passive:true});}function Sy(t){return gn.po(t,true,false,false)}function Cy(t){return gn.po(t,false,true,false)}function ih(t){if(t.onclick){let e=document.createEvent("MouseEvents");e.initEvent("click",true,true),t.onclick.apply(t,[e]);}}function yi(t,e,r){let n=null,i=null;Ci(t,"touchstart",o=>{n=o.touches[0].clientX,i=o.touches[0].clientY;}),Ci(t,"touchmove",o=>{if(n==null||i==null)return;let s=n-o.touches[0].clientX,a=i-o.touches[0].clientY;Math.abs(s)>Math.abs(a)&&Math.abs(s)>=25?((s>0&&e===pr.U||s<0&&e===pr.V)&&r(o),n=null,i=null):Math.abs(a)>=25&&((a>0&&e===pr.Oe&&t.scrollTop===t.scrollHeight-t.offsetHeight||a<0&&e===pr.Qe&&t.scrollTop===0)&&r(o),n=null,i=null);});}function gh(t,e,r){let n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("viewBox",t),i.setAttribute("xmlns",n);let o=document.createElementNS(n,"path");return o.setAttribute("d",e),r!=null&&o.setAttribute("fill",r),i.appendChild(o),i}var Ar={Fo:32,lo:9,To:13,mh:27},fh=t=>t!==null&&t.tagName==="IFRAME",C=class t{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,k,N,_,S,M,X,J,G,V,re,ie){this.message=e,this.messageAlignment=r,this.slideFrom=n,this.extras=i,this.triggerId=o,this.clickAction=s,this.uri=a,this.openTarget=u,this.dismissType=l,this.duration=c,this.icon=d,this.imageUrl=h,this.imageStyle=p,this.iconColor=f,this.iconBackgroundColor=g,this.backgroundColor=v,this.textColor=m,this.closeButtonColor=y,this.animateIn=T,this.animateOut=k,this.header=N,this.headerAlignment=_,this.headerTextColor=S,this.frameColor=M,this.buttons=X,this.cropType=J,this.orientation=G,this.htmlId=V,this.css=re,this.messageExtras=ie,this.message=e,this.messageAlignment=r||t.TextAlignment.CENTER,this.duration=c||5e3,this.slideFrom=n||t.SlideFrom.BOTTOM,this.extras=i||{},this.triggerId=o,this.clickAction=s||t.ClickAction.NONE,this.uri=a,this.openTarget=u||t.OpenTarget.NONE,this.dismissType=l||t.DismissType.AUTO_DISMISS,this.icon=d,this.imageUrl=h,this.imageStyle=p||t.ImageStyle.TOP,this.iconColor=f||t.th.ih,this.iconBackgroundColor=g||t.th.sh,this.backgroundColor=v||t.th.ih,this.textColor=m||t.th.hh,this.closeButtonColor=y||t.th.eh,this.animateIn=T,this.animateIn==null&&(this.animateIn=true),this.animateOut=k,this.animateOut==null&&(this.animateOut=true),this.header=N,this.headerAlignment=_||t.TextAlignment.CENTER,this.headerTextColor=S||t.th.hh,this.frameColor=M||t.th.Eh,this.buttons=X||[],this.cropType=J||t.CropType.FIT_CENTER,this.orientation=G,this.htmlId=V,this.css=re,this.isControl=false,this.messageExtras=ie,this.nh=false,this.Th=false,this.vo=false,this.oh=false,this.Re=null,this.ke=null,this.Et=new Ke,this.rh=new Ke,this.qe=t.TextAlignment.CENTER;}subscribeToClickedEvent(e){return this.Et.Nt(e)}subscribeToDismissedEvent(e){return this.rh.Nt(e)}removeSubscription(e){this.Et.removeSubscription(e),this.rh.removeSubscription(e);}removeAllSubscriptions(){this.Et.removeAllSubscriptions(),this.rh.removeAllSubscriptions();}closeMessage(){this.Cr(this.Re);}$e(){return  true}do(){return this.$e()}Ce(){return this.htmlId!=null&&this.htmlId.length>4}ve(){return this.Ce()&&this.css!=null&&this.css.length>0}we(){if(this.Ce()&&this.ve())return this.htmlId+"-css"}K(){return !this.Th&&(this.Th=true,true)}Wr(){return this.Th}p(e){return !this.vo&&(this.vo=true,this.Et.Rt(),true)}N(){return !this.oh&&(this.oh=true,this.rh.Rt(),true)}hide(e){if(e&&e.parentNode){let r=e.closest(".ab-iam-root");
2if(r==null&&(r=e),this.$e()&&r.parentNode!=null){let n=r.parentNode.classList;n&&n.contains(t.lh)&&n.remove(t.lh),document.body.removeEventListener("touchmove",t.uh);}r.className=r.className.replace(t.ah,t.Ih);}return this.animateOut||false}Cr(e,r){if(e==null)return;let n;this.Re=null,n=e.className.indexOf("ab-in-app-message")===-1?e.getElementsByClassName("ab-in-app-message")[0]:e;let i=false;n&&(i=this.hide(n));let o=document.body,s;o!=null&&(s=o.scrollTop);let a=()=>{if(e&&e.parentNode){let l=e.closest(".ab-iam-root");l==null&&(l=e),l.parentNode&&l.parentNode.removeChild(l);}let u=this.we();if(u!=null){let l=document.getElementById(u);l&&l.parentNode&&l.parentNode.removeChild(l);}o!=null&&St.browser==="Safari"&&(o.scrollTop=s),r?r():this.N();};i?setTimeout(a,t.Ah):a(),this.ke&&this.ke.focus();}Ge(){return document.createTextNode(this.message||"")}Ae(e){let r="";this.message||this.header||!this.$e()||(r="Modal Image"),e.setAttribute("alt",r);}static uh(e){if(e.targetTouches&&e.targetTouches.length>1)return;let r=e.target;r&&r.classList&&r.classList.contains("ab-message-text")&&r.scrollHeight>r.clientHeight||document.querySelector(`.${t.lh}`)&&e.cancelable&&e.preventDefault();}Oh(e){let r=e.parentNode;this.$e()&&r!=null&&this.orientation!==t.Orientation.LANDSCAPE&&(r.classList!=null&&r.classList.add(t.lh),document.body.addEventListener("touchmove",t.uh,!!ph()&&{passive:false})),e.className+=" "+t.ah;}static _h(e){if(e.keyCode===Ar.mh&&!P.nn(ue.Lh)&&document.querySelectorAll(".ab-modal-interactions").length>0){let r=document.getElementsByClassName("ab-html-message"),n=false;for(let i of r){let o=null;fh(i)&&i.contentWindow&&(o=i.contentWindow.document.getElementsByClassName("ab-programmatic-close-button")[0]),o!=null&&(ih(o),n=true);}if(!n){let i=document.querySelectorAll(".ab-modal-interactions > .ab-close-button")[0];i!=null&&ih(i);}}}Nh(){this.nh||P.nn(ue.Lh)||(document.addEventListener("keydown",t._h,false),P.Sh(()=>{document.removeEventListener("keydown",t._h);}),this.nh=true);}Y(e){let r={};return e&&(r[t.tt.Yr]=this.message,r[t.tt.Zr]=this.messageAlignment,r[t.tt.Rh]=this.slideFrom,r[t.tt.bt]=this.extras,r[t.tt.ea]=this.triggerId,r[t.tt.ra]=this.clickAction,r[t.tt.URI]=this.uri,r[t.tt.sa]=this.openTarget,r[t.tt.ta]=this.dismissType,r[t.tt.ia]=this.duration,r[t.tt.aa]=this.icon,r[t.tt.ot]=this.imageUrl,r[t.tt.oa]=this.imageStyle,r[t.tt.pa]=this.iconColor,r[t.tt.ma]=this.iconBackgroundColor,r[t.tt.na]=this.backgroundColor,r[t.tt.ua]=this.textColor,r[t.tt.ca]=this.closeButtonColor,r[t.tt.fa]=this.animateIn,r[t.tt.da]=this.animateOut,r[t.tt.la]=this.header,r[t.tt.ga]=this.headerAlignment,r[t.tt.ja]=this.headerTextColor,r[t.tt.xa]=this.frameColor,r[t.tt.za]=this.buttons,r[t.tt.ha]=this.cropType,r[t.tt.va]=this.orientation,r[t.tt.wa]=this.htmlId,r[t.tt.CSS]=this.css,r[t.tt.Z]=e,r[t.tt.ya]=this.messageExtras),r}};C.th={hh:4281545523,ih:4294967295,sh:4278219733,Mh:4293914607,Dh:4283782485,Eh:3224580915,eh:4288387995},C.Le={Ch:"hd",ze:"ias",dh:"of",Uh:"do",bh:"umt",Ph:"tf",ph:"te"},C.SlideFrom={TOP:"TOP",BOTTOM:"BOTTOM"},C.ClickAction={NEWS_FEED:"NEWS_FEED",URI:"URI",NONE:"NONE"},C.DismissType={AUTO_DISMISS:"AUTO_DISMISS",MANUAL:"SWIPE"},C.OpenTarget={NONE:"NONE",BLANK:"BLANK"},C.ImageStyle={TOP:"TOP",GRAPHIC:"GRAPHIC"},C.Orientation={PORTRAIT:"PORTRAIT",LANDSCAPE:"LANDSCAPE"},C.TextAlignment={START:"START",CENTER:"CENTER",END:"END"},C.CropType={CENTER_CROP:"CENTER_CROP",FIT_CENTER:"FIT_CENTER"},C.Be={Qr:"SLIDEUP",Lr:"MODAL",Ue:"MODAL_STYLED",Hr:"FULL",Kr:"WEB_HTML",Me:"HTML",Ve:"HTML_FULL"},C.Ah=500,C.fh=200,C.ah="ab-show",C.Ih="ab-hide",C.lh="ab-pause-scrolling",C.tt={Yr:"m",Zr:"ma",Rh:"sf",bt:"e",ea:"ti",ra:"ca",URI:"u",sa:"oa",ta:"dt",ia:"d",aa:"i",ot:"iu",oa:"is",pa:"ic",ma:"ibc",na:"bc",ua:"tc",ca:"cbc",fa:"ai",da:"ao",la:"h",ga:"ha",ja:"htc",xa:"fc",za:"b",ha:"ct",va:"o",wa:"hi",CSS:"css",Z:"type",uo:"messageFields",ya:"me"};var Ut=class t extends C{constructor(e,r,n,i,o,s,a,u,l,c,d,h){super(e,void 0,void 0,r,n,void 0,void 0,void 0,i=i||C.DismissType.MANUAL,o,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s,a,void 0,void 0,void 0,u,void 0,void 0,void 0,l,c,h),this.messageFields=d,this.messageFields=d;}do(){return  false}p(e){if(this.xe===C.Be.Kr){if(this.vo)return  false;this.vo=true;}return this.Et.Rt(e),true}Y(){let e=super.Y(t.it);return e[C.tt.uo]=this.messageFields,e}static Jr(e){return new t(e[C.tt.Yr],e[C.tt.bt],e[C.tt.ea],e[C.tt.ta],e[C.tt.ia],e[C.tt.fa],e[C.tt.da],e[C.tt.xa],e[C.tt.wa],e[C.tt.CSS],e[C.tt.uo],e[C.tt.ya])}};Ut.it=C.Be.Kr;var Vr=class t{constructor(e,r,n,i,o,s,a){this.text=e,this.backgroundColor=r,this.textColor=n,this.borderColor=i,this.clickAction=o,this.uri=s,this.id=a,this.text=e||"",this.backgroundColor=r||C.th.sh,this.textColor=n||C.th.ih,this.borderColor=i||this.backgroundColor,this.clickAction=o||C.ClickAction.NONE,this.uri=s,a==null&&(a=t.Ki),this.id=a,this.vo=false,this.Et=new Ke;}subscribeToClickedEvent(e){return this.Et.Nt(e)}removeSubscription(e){this.Et.removeSubscription(e);}removeAllSubscriptions(){this.Et.removeAllSubscriptions();}p(){return !this.vo&&(this.vo=true,this.Et.Rt(),true)}static fromJson(e){return new t(e.text,e.bg_color,e.text_color,e.border_color,e.click_action,e.uri,e.id)}};Vr.Ki=-1;var vr=class t extends C{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,k,N,_,S,M,X,J,G,V,re){u=u||C.DismissType.MANUAL,J=J||C.Orientation.PORTRAIT,super(e,r,void 0,n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,k,N,_,S,M,X=X||C.CropType.CENTER_CROP,J,G,V,re),this.qe=C.TextAlignment.CENTER;}Y(){return super.Y(t.it)}static Jr(e){return new t(e[C.tt.Yr],e[C.tt.Zr],e[C.tt.bt],e[C.tt.ea],e[C.tt.ra],e[C.tt.URI],e[C.tt.sa],e[C.tt.ta],e[C.tt.ia],e[C.tt.aa],e[C.tt.ot],e[C.tt.oa],e[C.tt.pa],e[C.tt.ma],e[C.tt.na],e[C.tt.ua],e[C.tt.ca],e[C.tt.fa],e[C.tt.da],e[C.tt.la],e[C.tt.ga],e[C.tt.ja],e[C.tt.xa],vh(e[C.tt.za]),e[C.tt.ha],e[C.tt.va],e[C.tt.wa],e[C.tt.CSS],e[C.tt.ya])}};vr.it=C.Be.Hr;var Or=class t extends C{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,k,N,_,S,M,X,J,G,V){super(e,r,void 0,n,i,o,s,a,u=u||C.DismissType.MANUAL,l,c,d,h,p,f,g,v,m,y,T,k,N,_,S,M,X=X||C.CropType.FIT_CENTER,void 0,J,G,V),this.qe=C.TextAlignment.CENTER;}Y(){return super.Y(t.it)}static Jr(e){return new t(e[C.tt.Yr],e[C.tt.Zr],e[C.tt.bt],e[C.tt.ea],e[C.tt.ra],e[C.tt.URI],e[C.tt.sa],e[C.tt.ta],e[C.tt.ia],e[C.tt.aa],e[C.tt.ot],e[C.tt.oa],e[C.tt.pa],e[C.tt.ma],e[C.tt.na],e[C.tt.ua],e[C.tt.ca],e[C.tt.fa],e[C.tt.da],e[C.tt.la],e[C.tt.ga],e[C.tt.ja],e[C.tt.xa],vh(e[C.tt.za]),e[C.tt.ha],e[C.tt.wa],e[C.tt.CSS],e[C.tt.ya])}};Or.it=C.Be.Lr;var br=class t extends C{constructor(e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,k,N,_){v=v||C.th.Dh,g=g||C.th.Mh,super(e,r=r||C.TextAlignment.START,n,i,o,s,a,u,l,c,d,h,void 0,p,f,g,v,m,y,T,void 0,void 0,void 0,void 0,void 0,void 0,void 0,k,N,_),this.qe=C.TextAlignment.START;}$e(){return  false}Ge(){let e=document.createElement("span");return e.appendChild(document.createTextNode(this.message||"")),e}Oh(e){let r=e.getElementsByClassName("ab-in-app-message")[0];gn.po(r,true,true)||(this.slideFrom===C.SlideFrom.TOP?r.style.top="0px":r.style.bottom="0px"),super.Oh(e);}Y(){return super.Y(t.it)}static Jr(e){return new t(e[C.tt.Yr],e[C.tt.Zr],e[C.tt.Rh],e[C.tt.bt],e[C.tt.ea],e[C.tt.ra],e[C.tt.URI],e[C.tt.sa],e[C.tt.ta],e[C.tt.ia],e[C.tt.aa],e[C.tt.ot],e[C.tt.pa],e[C.tt.ma],e[C.tt.na],e[C.tt.ua],e[C.tt.ca],e[C.tt.fa],e[C.tt.da],e[C.tt.wa],e[C.tt.CSS],e[C.tt.ya])}};br.it=C.Be.Qr;function mh(t){if(!t)return null;if(t.is_control)return mr.fromJson(t);let e=t.type;e!=null&&(e=e.toUpperCase());let r=t.message,n=t.text_align_message,i=t.slide_from,o=t.extras,s=t.trigger_id,a=t.click_action,u=t.uri,l=t.open_target,c=t.message_close,d=t.duration,h=t.icon,p=t.image_url,f=t.image_style,g=t.icon_color,v=t.icon_bg_color,m=t.bg_color,y=t.text_color,T=t.close_btn_color,k=t.header,N=t.text_align_header,_=t.header_text_color,S=t.frame_color,M=[],X=t.btns;X==null&&(X=[]);for(let je=0;je<X.length;je++)M.push(Vr.fromJson(X[je]));let J=t.crop_type,G=t.orientation,V=t.animate_in,re=t.animate_out,ie=t.html_id,he=t.css;ie!=null&&ie!==""&&he!=null&&he!==""||(ie=void 0,he=void 0);let ye=t.message_extras,Pe;if(e===Or.it||e===C.Be.Ue)Pe=new Or(r,n,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,V,re,k,N,_,S,M,J,ie,he,ye);else if(e===vr.it)Pe=new vr(r,n,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,V,re,k,N,_,S,M,J,G,ie,he,ye);else if(e===br.it)Pe=new br(r,n,i,o,s,a,u,l,c,d,h,p,g,v,m,y,T,V,re,
2ie,he,ye);else {if(e!==Ut.it&&e!==C.Be.Me&&e!==C.Be.Ve)return void b.error("Ignoring message with unknown type "+e);{let je=t.message_fields;Pe=new Ut(r,o,s,c,d,V,re,S,ie,he,je,ye),Pe.trusted=t.trusted||false;}}return Pe.xe=e,Pe}function vh(t){let e=[];for(let r of t)e.push(new Vr(r.text,r.backgroundColor,r.textColor,r.borderColor,r.clickAction,r.uri,r.id));return e}var qo=class t{constructor(e){this.Bl=e,this.Bl=e;}Jl(e){return this.Bl==null||this.Bl===e[0]}static fromJson(e){return new t(e?e.event_name:null)}Y(){return this.Bl}},Un=class t{constructor(e,r,n,i){this.Tl=e,this._l=r,this.comparator=n,this.Ll=i,this.Tl=e,this._l=r,this.comparator=n,this.Ll=i,this._l===t.Ol.Il&&this.comparator!==t.Ql.Ul&&this.comparator!==t.Ql.Xl&&this.comparator!==t.Ql.Fl&&this.comparator!==t.Ql.Kl&&(this.Ll=Qt(this.Ll));}Jl(e){let r=null;switch(e!=null&&(r=e[this.Tl]),this.comparator){case t.Ql.Pl:return r!=null&&r.valueOf()===this.Ll.valueOf();case t.Ql.Yl:return r==null||r.valueOf()!==this.Ll.valueOf();case t.Ql.Zl:return r!=null&&typeof r==typeof this.Ll&&r>this.Ll;case t.Ql.Ul:return this._l===t.Ol.Il?r!=null&&Yt(r)&&eh(r)<=this.Ll.valueOf():r!=null&&typeof r==typeof this.Ll&&r>=this.Ll;case t.Ql.$l:return r!=null&&typeof r==typeof this.Ll&&r<this.Ll;case t.Ql.Xl:return this._l===t.Ol.Il?r!=null&&Yt(r)&&eh(r)>=this.Ll.valueOf():r!=null&&typeof r==typeof this.Ll&&r<=this.Ll;case t.Ql.Qu:return r!=null&&typeof r=="string"&&typeof r==typeof this.Ll&&r.match(this.Ll)!=null;case t.Ql.Vu:return r!=null;case t.Ql.Yu:return r==null;case t.Ql.Fl:return r!=null&&Yt(r)&&th(r)<this.Ll;case t.Ql.Kl:return r!=null&&Yt(r)&&th(r)>this.Ll;case t.Ql.Zu:return r==null||typeof r!=typeof this.Ll||typeof r!="string"||r.match(this.Ll)==null}return  false}static fromJson(e){return new t(e.property_key,e.property_type,e.comparator,e.property_value)}Y(){let e=this.Ll;return Yt(this.Ll)&&(e=Ii(e.valueOf())),{k:this.Tl,t:this._l,c:this.comparator,v:e}}static qn(e){return new t(e.k,e.t,e.c,e.v)}};Un.Ol={yE:"boolean",HE:"number",LE:"string",Il:"date"},Un.Ql={Pl:1,Yl:2,Zl:3,Ul:4,$l:5,Xl:6,Qu:10,Vu:11,Yu:12,Fl:15,Kl:16,Zu:17};var Ln=class t{constructor(e){this.filters=e,this.filters=e;}Jl(e){let r=true;for(let n=0;n<this.filters.length;n++){let i=this.filters[n],o=false;for(let s=0;s<i.length;s++)if(i[s].Jl(e)){o=true;break}if(!o){r=false;break}}return r}static fromJson(e){if(e==null||!Ze(e))return null;let r=[];for(let n=0;n<e.length;n++){let i=[],o=e[n];for(let s=0;s<o.length;s++)i.push(Un.fromJson(o[s]));r.push(i);}return new t(r)}Y(){let e=[];for(let r=0;r<this.filters.length;r++){let n=this.filters[r],i=[];for(let o=0;o<n.length;o++)i.push(n[o].Y());e.push(i);}return e}static qn(e){let r=[];for(let n=0;n<e.length;n++){let i=[],o=e[n];for(let s=0;s<o.length;s++)i.push(Un.qn(o[s]));r.push(i);}return new t(r)}},Ko=class t{constructor(e,r){this.Bl=e,this.Ml=r,this.Bl=e,this.Ml=r;}Jl(e){if(this.Bl==null||this.Ml==null)return  false;let r=e[0],n=e[1];return r===this.Bl&&this.Ml.Jl(n)}static fromJson(e){return new t(e?e.event_name:null,e?Ln.fromJson(e.property_filters):null)}Y(){return {e:this.Bl,pf:this.Ml?this.Ml.Y():null}}},Go=class t{constructor(e,r){this.tf=e,this.if=r,this.tf=e,this.if=r;}Jl(e){if(this.tf==null)return  false;let r=Oe.rf(e[0],this.tf);if(!r)return  false;let n=this.if==null||this.if.length===0;if(this.if!=null){for(let i=0;i<this.if.length;i++)if(this.if[i]===e[1]){n=true;break}}return r&&n}static fromJson(e){return new t(e?e.id:null,e?e.buttons:null)}Y(){return this.tf}},Wo=class t{constructor(e){this.productId=e,this.productId=e;}Jl(e){return this.productId==null||e[0]===this.productId}static fromJson(e){return new t(e?e.product_id:null)}Y(){return this.productId}},Yo=class t{constructor(e,r){this.productId=e,this.Ml=r,this.productId=e,this.Ml=r;}Jl(e){if(this.productId==null||this.Ml==null)return  false;let r=e[0],n=e[1];return r===this.productId&&this.Ml.Jl(n)}static fromJson(e){return new t(e?e.product_id:null,e?Ln.fromJson(e.property_filters):null)}Y(){return {id:this.productId,pf:this.Ml?this.Ml.Y():null}}},Jo=class t{constructor(e){this.tf=e,this.tf=e;}Jl(e){return this.tf==null||Oe.rf(e[0],this.tf)}static fromJson(e){return new t(e?e.campaign_id:null)}Y(){return this.tf}},Je={OPEN:"open",Rr:"purchase",vr:"push_click",ue:"custom_event",Vr:"iam_click",kt:"test"},Oe=class t{constructor(e,r){this.type=e,this.data=r,this.type=e,this.data=r;}sc(e,r){return t.cc[this.type]===e&&(this.data==null||this.data.Jl(r))}static rf(e,r){let n=null;try{n=window.atob(e);}catch(i){return b.info("Failed to unencode analytics id "+e+": "+Jt(i)),false}return r===n.split("_")[0]}static fromJson(e){let r=e.type,n=null;switch(r){case t.Er.OPEN:case t.Er.kt:break;case t.Er.Rr:n=Wo.fromJson(e.data);break;case t.Er.nc:n=Yo.fromJson(e.data);break;case t.Er.vr:n=Jo.fromJson(e.data);break;case t.Er.ue:n=qo.fromJson(e.data);break;case t.Er.lc:n=Ko.fromJson(e.data);break;case t.Er.Vr:n=Go.fromJson(e.data);}return new t(r,n)}
2Y(){return {t:this.type,d:this.data?this.data.Y():null}}static qn(e){let r,n=null;switch(e.t){case t.Er.OPEN:case t.Er.kt:break;case t.Er.Rr:n=new Wo(e.d);break;case t.Er.nc:r=e.d||{},n=new Yo(r.id,Ln.qn(r.pf||[]));break;case t.Er.vr:n=new Jo(e.d);break;case t.Er.ue:n=new qo(e.d);break;case t.Er.lc:r=e.d||{},n=new Ko(r.e,Ln.qn(r.pf||[]));break;case t.Er.Vr:n=new Go(e.d);}return new t(e.t,n)}};Oe.Er={OPEN:"open",Rr:"purchase",nc:"purchase_property",vr:"push_click",ue:"custom_event",lc:"custom_event_property",Vr:"iam_click",kt:"test"},Oe.cc={},Oe.cc[Oe.Er.OPEN]=Je.OPEN,Oe.cc[Oe.Er.Rr]=Je.Rr,Oe.cc[Oe.Er.nc]=Je.Rr,Oe.cc[Oe.Er.vr]=Je.vr,Oe.cc[Oe.Er.ue]=Je.ue,Oe.cc[Oe.Er.lc]=Je.ue,Oe.cc[Oe.Er.Vr]=Je.Vr,Oe.cc[Oe.Er.kt]=Je.kt;var dr=class t{constructor(e,r=[],n,i,o=0,s,a,u=0,l=t.td,c,d,h){this.id=e,this.sd=r,this.startTime=n,this.endTime=i,this.priority=o,this.type=s,this.data=a,this.ed=u,this.rd=l,this.Or=c,this.hd=d,this.od=h,this.id=e,this.sd=r||[],n===void 0&&(n=null),this.startTime=n,i===void 0&&(i=null),this.endTime=i,this.priority=o||0,this.type=s,this.ed=u||0,c==null&&(c=1e3*(this.ed+30)),this.Or=c,this.data=a,l!=null&&(this.rd=l),this.hd=d,this.od=h||null;}nd(e){return this.od==null||this.rd!==t.td&&e-this.od>=1e3*this.rd}ad(e){this.od=e;}ud(e){let r=e+1e3*this.ed;return Math.max(r-new Date().valueOf(),0)}dd(e){let r=new Date().valueOf()-e,n=e==null||isNaN(r)||this.Or==null||r<this.Or;return n||b.info(`Trigger action ${this.type} is no longer eligible for display - fired ${r}ms ago and has a timeout of ${this.Or}ms.`),!n}static fromJson(e){let r=e.id,n=[];for(let p=0;p<e.trigger_condition.length;p++)n.push(Oe.fromJson(e.trigger_condition[p]));let i=Qt(e.start_time),o=Qt(e.end_time),s=e.priority,a=e.type,u=e.delay,l=e.re_eligibility,c=e.timeout,d=e.data,h=e.min_seconds_since_last_trigger;return gr(t.Er,a,"Could not construct Trigger from server data","Trigger.Types")?new t(r,n,i,o,s,a,d,u,l,c,h):null}Y(){let e=[];for(let r=0;r<this.sd.length;r++)e.push(this.sd[r].Y());return {i:this.id,c:e,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.ed,r:this.rd,tm:this.Or,ss:this.hd,ld:this.od}}static qn(e){let r=[],n=e.c||[];for(let i=0;i<n.length;i++)r.push(Oe.qn(n[i]));return new t(e.i,r,fn(e.s),fn(e.e),e.p,e.t,e.da,e.d,e.r,e.tm,e.ss,e.ld)}};dr.Er={_r:"inapp",md:"templated_iam"},dr.td=-1;function bh(t,e,r){let n=document.querySelector("head"),i=`ab-${e}-css-definitions-${"5.5.0".replace(/\./g,"-")}`;if(!n)return;let o=n.ownerDocument||document;if(o.getElementById(i)==null){let s=o.createElement("style");s.innerHTML=r||"",s.id=i;let a=P.nn(ue.bo);a!=null&&s.setAttribute("nonce",a),n.appendChild(s);}}function _h(){if(P.nn(ue.Mo))return;let t="https://use.fontawesome.com/7f85a56ba4.css";if(document.querySelector('link[rel=stylesheet][href="'+t+'"]')===null){let e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",t),document.getElementsByTagName("head")[0].appendChild(e);}}function Ey(t){bh(t,"feed","body>.ab-feed{position:fixed;top:0;right:0;bottom:0;width:421px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}body>.ab-feed .ab-feed-body{position:absolute;top:0;left:0;right:0;border:none;border-left:1px solid #d0d0d0;padding-top:70px;min-height:100%}body>.ab-feed .ab-initial-spinner{float:none}body>.ab-feed .ab-no-cards-message{position:absolute;width:100%;margin-left:-20px;top:40%}.ab-feed{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);-moz-box-shadow:0 1px 7px 1px rgba(66,82,113,.15);box-shadow:0 1px 7px 1px rgba(66,82,113,.15);width:402px;background-color:#eee;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',s
2ans-serif;font-size:13px;line-height:130%;letter-spacing:normal;overflow-y:auto;overflow-x:visible;z-index:9011;-webkit-overflow-scrolling:touch}.ab-feed :focus,.ab-feed:focus{outline:0}.ab-feed .ab-feed-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:1px solid #d0d0d0;border-top:none;padding:20px 20px 0 20px}.ab-feed.ab-effect-slide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px);-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-feed.ab-effect-slide.ab-show{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-feed.ab-effect-slide.ab-hide{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card{position:relative;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100%;border:1px solid #d0d0d0;margin-bottom:20px;overflow:hidden;background-color:#fff;-webkit-transition:height .4s ease-in-out,margin .4s ease-in-out;-moz-transition:height .4s ease-in-out,margin .4s ease-in-out;-o-transition:height .4s ease-in-out,margin .4s ease-in-out;transition:height .4s ease-in-out,margin .4s ease-in-out}.ab-feed .ab-card .ab-pinned-indicator{position:absolute;right:0;top:0;margin-right:-1px;width:0;height:0;border-style:solid;border-width:0 24px 24px 0;border-color:transparent #1676d0 transparent transparent}.ab-feed .ab-card .ab-pinned-indicator .fa-star{position:absolute;right:-21px;top:2px;font-size:9px;color:#fff}.ab-feed .ab-card.ab-effect-card.ab-hide{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-left{-webkit-transform:translateX(-450px);-moz-transform:translateX(-450px);-ms-transform:translateX(-450px);transform:translateX(-450px)}.ab-feed .ab-card.ab-effect-card.ab-hide.ab-swiped-right{-webkit-transform:translateX(450px);-moz-transform:translateX(450px);-ms-transform:translateX(450px);transform:translateX(450px)}.ab-feed .ab-card.ab-effect-card.ab-hide:not(.ab-swiped-left):not(.ab-swiped-right){opacity:0}.ab-feed .ab-card .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;top:0;z-index:9021;opacity:0;-webkit-transition:.5s;-moz-transition:.5s;-o-transition:.5s;transition:.5s}.ab-feed .ab-card .ab-close-button[dir=rtl]{left:0}.ab-feed .ab-card .ab-close-button[dir=ltr]{right:0}.ab-feed .ab-card .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-feed .ab-card .ab-close-button svg.ab-chevron{display:none}.ab-feed .ab-card .ab-close-button:active{background-color:transparent}.ab-feed .ab-card .ab-close-button:focus{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover{background-color:transparent}.ab-feed .ab-card .ab-close-button:hover svg{fill-opacity:.8}.ab-feed .ab-card .ab-close-button:hover{opacity:1}.ab-feed .ab-card .ab-close-button:focus{opacity:1}.ab-feed .ab-card a{float:none;color:inherit;text-decoration:none}.ab-feed .ab-card a:hover{text-decoration:underline}.ab-feed .ab-card .ab-image-area{float:none;display:inline-block;vertical-align:top;line-height:0;overflow:hidden;width:100%;-webkit-box-sizing:initial;-moz-box-sizing:initial;box-sizing:initial}.ab-feed .ab-card .ab-image-area img{float:none;height:auto;width:100%}
2.ab-feed .ab-card.ab-image-only .ab-card-body{display:none}.ab-feed .ab-card .ab-card-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:100%;position:relative}.ab-feed .ab-card .ab-unread-indicator{position:absolute;bottom:0;margin-right:-1px;width:100%;height:5px;background-color:#1676d0}.ab-feed .ab-card .ab-unread-indicator.read{background-color:transparent}.ab-feed .ab-card .ab-title{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:18px;line-height:130%;padding:20px 25px 0 25px}.ab-feed .ab-card .ab-description{float:none;color:#545454;padding:15px 25px 20px 25px;word-wrap:break-word;white-space:pre-wrap}.ab-feed .ab-card .ab-description.ab-no-title{padding-top:20px}.ab-feed .ab-card .ab-url-area{float:none;color:#1676d0;margin-top:12px;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',s
2ans-serif}.ab-feed .ab-card.ab-classic-card .ab-card-body{min-height:40px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body{min-height:100px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body[dir=ltr]{padding-left:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-card-body[dir=rtl]{padding-right:72px}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area{width:60px;height:60px;padding:20px 0 25px 25px;position:absolute}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area[dir=rtl]{padding:20px 25px 25px 0}.ab-feed .ab-card.ab-classic-card.with-image .ab-image-area img{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;max-width:100%;max-height:100%;width:auto;height:auto}.ab-feed .ab-card.ab-classic-card.with-image .ab-title{background-color:transparent;font-size:16px}.ab-feed .ab-card.ab-classic-card.with-image .ab-description{padding-top:10px}.ab-feed .ab-card.ab-control-card{height:0;width:0;margin:0;border:0}.ab-feed .ab-feed-buttons-wrapper{float:none;position:relative;background-color:#282828;height:50px;-webkit-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);-moz-box-shadow:0 2px 3px 0 rgba(178,178,178,.5);box-shadow:0 2px 3px 0 rgba(178,178,178,.5);z-index:1}.ab-feed .ab-feed-buttons-wrapper .ab-close-button,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{float:none;cursor:pointer;color:#fff;font-size:18px;padding:16px;-webkit-transition:.2s;-moz-transition:.2s;-o-transition:.2s;transition:.2s}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover,.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{font-size:22px}.ab-feed .ab-feed-buttons-wrapper .ab-close-button{float:right}.ab-feed .ab-feed-buttons-wrapper .ab-close-button:hover{padding-top:12px;padding-right:14px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button{padding-left:17px}.ab-feed .ab-feed-buttons-wrapper .ab-refresh-button:hover{padding-top:13px;padding-left:14px}.ab-feed .ab-no-cards-message{text-align:center;margin-bottom:20px}@media (max-width:600px){body>.ab-feed{width:100%}}");}function yh(){Ey(),_h();}function Py(t){bh(t,"iam",".ab-pause-scrolling,body.ab-pause-scrolling,html.ab-pause-scrolling{overflow:hidden;touch-action:none}.ab-iam-root.v3{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:9011;-webkit-tap-highlight-color:transparent}.ab-iam-root.v3:focus{outline:0}.ab-iam-root.v3.ab-effect-fullscreen,.ab-iam-root.v3.ab-effect-html,.ab-iam-root.v3.ab-effect-modal{opacity:0}.ab-iam-root.v3.ab-effect-fullscreen.ab-show,.ab-iam-root.v3.ab-effect-html.ab-show,.ab-iam-root.v3.ab-effect-modal.ab-show{opacity:1}.ab-iam-root.v3.ab-effect-fullscreen.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-html.ab-show.ab-animate-in,.ab-iam-root.v3.ab-effect-modal.ab-show.ab-animate-in{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.ab-iam-root.v3.ab-effect-fullscreen.ab-hide,.ab-iam-root.v3.ab-effect-html.ab-hide,.ab-iam-root.v3.ab-effect-modal.ab-hide{opacity:0}.ab-iam-root.v3.ab-effect-fullscreen.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-html.ab-hide.ab-animate-out,.ab-iam-root.v3.ab-effect-modal.ab-hide.ab-animate-out{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.ab-iam-root.v3.ab-effect-slide .ab-in-app-message{-webkit-transform:translateX(535px);-moz-transform:translateX(535px);-ms-transform:translateX(535px);transform:translateX(535px)}.ab-iam-root.v3.ab-effect-slide.ab-show .ab-in-app-message{-webkit-transform:translateX(0);-moz-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.ab-iam-root.v3.ab-effect-slide.ab-show.ab-animate-in .ab-in-app-message{-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message{-webkit-transform:translateX(535px);-moz-transform:translateX(535px);-ms-transform:translateX(535px);transform:translateX(535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-left{-webkit-transform:translateX(-535px);-moz-transform:translateX(-535px);-ms-transform:translateX(-535px);transform:translateX(-535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-up{-webkit-transform:translateY(-535px);-moz-transform:translateY(-535px);-ms-transform:translateY(-535px);transform:translateY(-535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide .ab-in-app-message.ab-swiped-down{-webkit-transform:translateY(535px);-moz-transform:translateY(535px);-ms-transform:translateY(535px);transform:translateY(535px)}.ab-iam-root.v3.ab-effect-slide.ab-hide.ab-animate-out .ab-in-app-message{-webkit-transition:transform .5s ease-in-out;-moz-transition:transform .5s ease-in-out;-o-transition:transform .5s ease-in-out;transition:transform .5s ease-in-out}.ab-iam-root.v3 .ab-ios-scroll-wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;pointer-events:all;touch-action:auto;-webkit-overflow-scrolling:touch}.ab-iam-root.v3 .ab-in-app-message{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:fixed;text-align:center;-webkit-box-shadow:0 0 4px rgba(0,0,0,.3);-moz-box-shadow:0 0 4px rgba(0,0,0,.3);box-shadow:0 0 4px rgba(0,0,0,.3);line-height:normal;letter-spacing:normal;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',s
2ans-serif;z-index:9011;max-width:100%;overflow:hidden;display:inline-block;pointer-events:all;color:#333;color-scheme:normal}.ab-iam-root.v3 .ab-in-app-message.ab-no-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.ab-iam-root.v3 .ab-in-app-message :focus,.ab-iam-root.v3 .ab-in-app-message:focus{outline:0}.ab-iam-root.v3 .ab-in-app-message.ab-clickable{cursor:pointer}.ab-iam-root.v3 .ab-in-app-message.ab-background{background-color:#fff}.ab-iam-root.v3 .ab-in-app-message .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;top:0;z-index:9021}.ab-iam-root.v3 .ab-in-app-message .ab-close-button[dir=rtl]{left:0}.ab-iam-root.v3 .ab-in-app-message .ab-close-button[dir=ltr]{right:0}.ab-iam-root.v3 .ab-in-app-message .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-iam-root.v3 .ab-in-app-message .ab-close-button svg.ab-chevron{display:none}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:active{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:focus{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:hover{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-close-button:hover svg{fill-opacity:.8}.ab-iam-root.v3 .ab-in-app-message .ab-message-text{float:none;line-height:1.5;margin:20px 25px;max-width:100%;overflow:hidden;overflow-y:auto;vertical-align:text-bottom;word-wrap:break-word;white-space:pre-wrap;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',s
2ans-serif}.ab-iam-root.v3 .ab-in-app-message .ab-message-text.start-aligned{text-align:start}.ab-iam-root.v3 .ab-in-app-message .ab-message-text.end-aligned{text-align:end}.ab-iam-root.v3 .ab-in-app-message .ab-message-text.center-aligned{text-align:center}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar{-webkit-appearance:none;width:14px}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-thumb{-webkit-appearance:none;border:4px solid transparent;background-clip:padding-box;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;background-color:rgba(0,0,0,.2)}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-button{width:0;height:0;display:none}.ab-iam-root.v3 .ab-in-app-message .ab-message-text::-webkit-scrollbar-corner{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-message-header{float:none;letter-spacing:0;margin:0;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;display:block;font-size:20px;margin-bottom:10px;line-height:1.3}.ab-iam-root.v3 .ab-in-app-message .ab-message-header.start-aligned{text-align:start}.ab-iam-root.v3 .ab-in-app-message .ab-message-header.end-aligned{text-align:end}.ab-iam-root.v3 .ab-in-app-message .ab-message-header.center-aligned{text-align:center}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-modal,.ab-iam-root.v3 .ab-in-app-message.ab-slideup{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;font-size:14px;font-weight:700;margin:20px;margin-top:calc(constant(safe-area-inset-top,0) + 20px);margin-right:calc(constant(safe-area-inset-right,0) + 20px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 20px);margin-left:calc(constant(safe-area-inset-left,0) + 20px);margin-top:calc(env(safe-area-inset-top,0) + 20px);margin-right:calc(env(safe-area-inset-right,0) + 20px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 20px);margin-left:calc(env(safe-area-inset-left,0) + 20px);max-height:150px;padding:10px;right:0;background-color:#efefef}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone{max-height:66px;margin:10px;margin-top:calc(constant(safe-area-inset-top,0) + 10px);margin-right:calc(constant(safe-area-inset-right,0) + 10px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 10px);margin-left:calc(constant(safe-area-inset-left,0) + 10px);margin-top:calc(env(safe-area-inset-top,0) + 10px);margin-right:calc(env(safe-area-inset-right,0) + 10px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 10px);margin-left:calc(env(safe-area-inset-left,0) + 10px);max-width:90%;max-width:calc(100% - 40px);min-width:90%;min-width:calc(100% - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-close-button svg:not(.ab-chevron){display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button{display:block;height:20px;padding:0 20px 0 18px;pointer-events:none;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:12px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-close-button svg.ab-chevron{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone.ab-clickable .ab-message-text{border-right-width:40px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text{max-width:100%;border-right-width:10px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text span{max-height:66px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-message-text.ab-with-image{max-width:80%;max-width:calc(100% - 50px - 5px - 10px - 25px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area{width:50px;height:50px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.simulate-phone .ab-image-area img{max-width:100%;max-height:100%;width:auto;height:auto}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:active .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-message-text{opacity:.8}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:active .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:focus .ab-close-button svg.ab-chevron,.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable:hover .ab-close-button svg.ab-chevron{fill-opacity:.8}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:table-cell;border-color:transparent;border-style:solid;border-width:5px 25px 5px 10px;max-width:430px;vertical-align:middle;margin:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text[dir=rtl]{border-width:5px 10px 5px 25px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text span{dis
2play:block;max-height:150px;overflow:auto}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image{max-width:365px;border-top:0;border-bottom:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background-color:transparent;background-size:15px;border:none;width:15px;min-width:15px;height:15px;cursor:pointer;display:block;font-size:15px;line-height:0;padding-top:15px;padding-right:15px;padding-left:15px;padding-bottom:15px;position:absolute;top:0;z-index:9021}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button[dir=rtl]{left:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button[dir=ltr]{right:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;fill:#9b9b9b;height:auto;width:100%}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg.ab-chevron{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:active{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:focus{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:hover{background-color:transparent}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button:hover svg{fill-opacity:.8}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area{float:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:table-cell;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;vertical-align:top;width:60px;margin:0}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area.ab-icon-area{width:auto}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area img{float:none;width:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message.ab-modal{font-size:14px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area{float:none;position:relative;display:block;overflow:hidden}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area .ab-center-cropped-img,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area .ab-center-cropped-img{background-size:cover;background-repeat:no-repeat;background-position:50% 50%;position:absolute;top:0;right:0;bottom:0;left:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-icon,.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-icon{margin-top:20px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic{padding:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-message-text,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-message-text{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-message-buttons{bottom:0;left:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area{float:none;height:auto;margin:0}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area img,.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area img{display:block;top:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none}.ab-iam-root.v3 .ab-in-app-message.ab-modal{padding-top:20px;width:450px;max-width:450px;max-height:720px}.ab-iam-root.v3 .ab-in-app-message.ab-modal.simulate-phone{max-width:91%;max-width:calc(100% - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal.simulate-phone.graphic .ab-image-area img{max-width:91vw;max-width:calc(100vw - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text{max-height:660px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-image{max-height:524.82758621px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-icon{max-height:610px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons{margin-bottom:93px;max-height:587px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-image{max-height:451.82758621px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-message-text.ab-with-buttons.ab-with-icon{max-height:537px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area{margin-top:-20px;max-height:155.17241379px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area img{max-width:100%;max-height:155.17241379px}.ab-iam-root.v3 .ab-in-app-message.ab-modal .ab-image-area.ab-icon-area{height:auto}.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic{width:auto;overflow:hidden}.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-modal.graphic .ab-image-area img{width:auto;max-height:720px;max-width:450px}
2.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen{width:450px;max-height:720px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape{width:720px;max-height:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape .ab-image-area{height:225px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape.graphic .ab-image-area{height:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape .ab-message-text{max-height:112px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-message-text{max-height:247px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-message-text.ab-with-buttons{margin-bottom:93px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area{height:360px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.graphic .ab-image-area{height:720px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone{-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone:not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.simulate-phone.graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-html-message{background-color:transparent;border:none;height:100%;overflow:auto;position:relative;touch-action:auto;width:100%}.ab-iam-root.v3 .ab-in-app-message .ab-message-buttons{position:absolute;bottom:0;width:100%;padding:17px 25px 30px 25px;z-index:inherit;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ab-iam-root.v3 .ab-in-app-message .ab-message-button{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;cursor:pointer;display:inline-block;font-size:14px;font-weight:700;font-family:'Helvetica Neue Light','Helvetica Neue',Helvetica,Arial,'Lucida Grande',s
2ans-serif;height:44px;line-height:normal;letter-spacing:normal;margin:0;max-width:100%;min-width:80px;padding:0 12px;position:relative;text-transform:none;width:48%;width:calc(50% - 5px);border:1px solid #1b78cf;-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease;overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;word-wrap:normal;white-space:nowrap}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:first-of-type{float:left;background-color:#fff;color:#1b78cf}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:last-of-type{float:right;background-color:#1b78cf;color:#fff}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:first-of-type:last-of-type{float:none;width:auto}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:after{-webkit-transition:.2s ease;-moz-transition:.2s ease;-o-transition:.2s ease;transition:.2s ease}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:hover{opacity:.8}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:active:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.08)}.ab-iam-root.v3 .ab-in-app-message .ab-message-button:focus:after{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.15)}.ab-iam-root.v3 .ab-in-app-message .ab-message-button a{color:inherit;text-decoration:inherit}.ab-iam-root.v3 .ab-in-app-message img{float:none;display:inline-block}.ab-iam-root.v3 .ab-in-app-message .ab-icon{float:none;display:inline-block;padding:10px;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px}.ab-iam-root.v3 .ab-in-app-message .ab-icon .fa{float:none;font-size:30px;width:30px}.ab-iam-root.v3 .ab-start-hidden{visibility:hidden}.ab-iam-root.v3 .ab-centered{margin:auto;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.ab-iam-root.v3{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.ab-iam-root.v3 .ab-page-blocker{position:fixed;top:0;left:0;width:100%;height:100%;z-index:9001;pointer-events:all;background-color:rgba(51,51,51,.75)}@media (max-width:600px){.ab-iam-root.v3 .ab-in-app-message.ab-slideup{max-height:66px;margin:10px;margin-top:calc(constant(safe-area-inset-top,0) + 10px);margin-right:calc(constant(safe-area-inset-right,0) + 10px);margin-bottom:calc(constant(safe-area-inset-bottom,0) + 10px);margin-left:calc(constant(safe-area-inset-left,0) + 10px);margin-top:calc(env(safe-area-inset-top,0) + 10px);margin-right:calc(env(safe-area-inset-right,0) + 10px);margin-bottom:calc(env(safe-area-inset-bottom,0) + 10px);margin-left:calc(env(safe-area-inset-left,0) + 10px);max-width:90%;max-width:calc(100% - 40px);min-width:90%;min-width:calc(100% - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button{display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-close-button svg:not(.ab-chevron){display:none}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-close-button{display:block;height:20px;padding:0 20px 0 18px;pointer-events:none;top:50%;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:12px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-close-button svg.ab-chevron{display:inline}.ab-iam-root.v3 .ab-in-app-message.ab-slideup.ab-clickable .ab-message-text{border-right-width:40px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text{max-width:100%;border-right-width:10px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text span{max-height:66px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-icon,.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-message-text.ab-with-image{max-width:80%;max-width:calc(100% - 50px - 5px - 10px - 25px)}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area{width:50px;height:50px}.ab-iam-root.v3 .ab-in-app-message.ab-slideup .ab-image-area img{max-width:100%;max-height:100%;width:auto;height:auto}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape{-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-close-button,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-message-text,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape .ab-message-text.ab-with-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape:not(.graphic),.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen:not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape:not(.graphic) .ab-message-buttons,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen:not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic{display:block}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic .ab-image-area,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.graphic .ab-message-button,.ab-iam-root.v3 .ab-in-app-message:not(.force-desktop).ab-fullscreen.landscape.graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-width:480px){.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop){max-width:91%;max-width:calc(100% - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img{max-width:91vw;max-width:calc(100vw - 30px)}}@media (max-height:750px){.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop){max-height:91%;max-height:calc(100% - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop).graphic .ab-image-area img{max-height:91vh;max-height:calc(100vh - 30px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text{max-height:65vh;max-height:calc(100vh - 30px - 60px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-image{max-height:45vh;max-height:calc(100vh - 30px - 155.17241379310346px - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-icon{max-height:45vh;max-height:calc(100vh - 30px - 70px - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons{max-height:50vh;max-height:calc(100vh - 30px - 93px - 40px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-image{max-height:30vh;max-height:calc(100vh - 30px - 155.17241379310346px - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-modal:not(.force-desktop) .ab-message-text.ab-with-buttons.ab-with-icon{max-height:30vh;max-height:calc(100vh - 30px - 70px - 93px - 20px)}}@media (min-width:601px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen .ab-image-area img{max-height:100%;max-width:100%}}@media (max-height:750px) and (min-width:601px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important;width:450px}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen:not(.landscape):not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-height:480px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-area-inset-bottom,0)}}@media (max-width:750px){.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop){-webkit-transition:top none;-moz-transition:top none;-o-transition:top none;transition:top none;top:0;right:0;bottom:0;left:0;height:100%;width:100%;max-height:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:none;-moz-transform:none;-ms-transform:none;transform:none;height:auto!important}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-close-button{margin-right:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-right:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0));margin-left:calc(constant(safe-area-inset-bottom,0) + constant(safe-area-inset-top,0));margin-left:calc(env(safe-area-inset-bottom,0) + env(safe-area-inset-top,0))}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-image-area,.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-image-area{height:50%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text{max-height:48%;max-height:calc(50% - 20px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop) .ab-message-text.ab-with-buttons{margin-bottom:20px;max-height:30%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).landscape .ab-message-text.ab-with-buttons{max-height:20%;max-height:calc(50% - 93px - 20px)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic){padding-bottom:0;padding-bottom:constant(safe-area-inset-bottom,0);padding-bottom:env(safe-area-inset-bottom,0)}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop):not(.graphic) .ab-message-buttons{padding-top:0;position:relative}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic{display:block}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-image-area{height:100%}.ab-iam-root.v3 .ab-in-app-message.ab-fullscreen.landscape:not(.force-desktop).graphic .ab-message-button{margin-bottom:0;margin-bottom:constant(safe-area-inset-bottom,0);margin-bottom:env(safe-
2area-inset-bottom,0)}}");}function wh(){Py(),_h();}function Iy(t){let e="";return t.animateIn&&(e+=" ab-animate-in"),t.animateOut&&(e+=" ab-animate-out"),t instanceof vr?e+=" ab-effect-fullscreen":t instanceof Ut?e+=" ab-effect-html":t instanceof Or?e+=" ab-effect-modal":t instanceof br&&(e+=" ab-effect-slide"),e}function Sh(t,e,r,n="ltr"){let i=document.createElement("button");i.setAttribute("aria-label",t),i.setAttribute("tabindex","0"),i.setAttribute("role","button"),i.dir=n,Ci(i,"touchstart"),i.className="ab-close-button";let o=gh("0 0 15 15","M15 1.5L13.5 0l-6 6-6-6L0 1.5l6 6-6 6L1.5 15l6-6 6 6 1.5-1.5-6-6 6-6z",e);return i.appendChild(o),i.addEventListener("keydown",s=>{s.keyCode!==Ar.Fo&&s.keyCode!==Ar.To||(r(),s.stopPropagation());}),i.onclick=s=>{r(),s.stopPropagation();},i}function Ay(t){return t!=null&&(t=parseInt(t.toString()),!isNaN(t)&&(4278190080&t)>>>24==0)}function Gt(t,e){return t==null||(t=parseInt(t.toString()),isNaN(t))?"":(e&&!isNaN(parseFloat(e.toString()))||(e=1),"rgba("+[(16711680&(t>>>=0))>>>16,(65280&t)>>>8,255&t,((4278190080&t)>>>24)/255*e].join(",")+")")}function Xo(t){if(!P.X())return  false;if(!(t instanceof C||t instanceof mr))return b.error(wu),false;let e=t instanceof mr?le.mo:le.Xi;return _r.m().q(t,e).L}function Ch(t){if(!P.X())return  false;if(!(t instanceof C))return b.error(wu),false;let e=_r.m().q(t,le.$i);if(e){t.Wr()||Xo(t);for(let r=0;r<e.ge.length;r++)qe.rr().fe(Je.Vr,[t.triggerId],e.ge[r]);}return e.L}var Hr={PORTRAIT:0,LANDSCAPE:1};function Ty(){return screen.width<=600}function ky(){if("orientation"in window)return Math.abs(window.orientation)===90||window.orientation===270?Hr.LANDSCAPE:Hr.PORTRAIT;let t=window;if("screen"in t){let e=t.screen.orientation||screen.mozOrientation||screen.msOrientation;return e!=null&&typeof e=="object"&&(e=e.type),e==="landscape-primary"||e==="landscape-secondary"?Hr.LANDSCAPE:Hr.PORTRAIT}return Hr.PORTRAIT}function xy(t,e,r){t&&(e||r!=null&&r.metaKey?window.open(t):window.location=t);}function Oy(){return window.location.href}var yn={openUri:xy,fo:Ty,co:ky,Zo:Oy};function Au(){if(P.X())return P.pr()}function ss(t,e,r){if(P.X())if(Si.test(t)){let n=Cu(t);if(!n)return;let i=o=>{if(!dh(o))return void b.error(`Decoded Braze Action json is invalid: ${JSON.stringify(o,null,2)}`);let s=ae.properties.type,a=ae.properties.oo,u=ae.properties.eo,l=o[s];if(l===ae.types.ro){let c=o[a];for(let d of c)i(d);}else {let c=o[u],d,h;switch(l){case ae.types.logCustomEvent:Promise.resolve().then(function(){return Vh}).then(({logCustomEvent:p})=>{P.so()?(h=Array.prototype.slice.call(c),p(...h)):b.error(Wt);});break;case ae.types.requestPushPermission:Promise.resolve().then(function(){return Qh}).then(({requestPushPermission:p})=>{P.so()?St.browser==="Safari"&&St.OS===cr.io?window.navigator.standalone&&p():p():b.error(Wt);});break;case ae.types.setEmailNotificationSubscriptionType:case ae.types.setPushNotificationSubscriptionType:case ae.types.setCustomUserAttribute:case ae.types.addToSubscriptionGroup:case ae.types.removeFromSubscriptionGroup:case ae.types.addToCustomAttributeArray:case ae.types.removeFromCustomAttributeArray:d=Au(),d&&d[l](...Array.prototype.slice.call(c));break;case ae.types.no:case ae.types.ao:h=Array.prototype.slice.call(c),yn.openUri(...h);break;default:b.info(`Ignoring unknown Braze Action: ${l}`);}}};i(n);}else yn.openUri(t,e,r);}function Ny(t,e){ss(t,e);}function Eh(t){t==null&&(t="");let e=t.split("?").slice(1).join("?"),r={};if(e!=null){let n=e.split("&");for(let i=0;i<n.length;i++){let o=n[i].split("=");o[0]!==""&&(r[o[0]]=o[1]);}}return r}function su(t){return !(!t||(t=t.toString().toLowerCase()).lastIndexOf("javascript:",0)!==0&&t.lastIndexOf("data:",0)!==0)}function Qo(t,e,r){if(!P.X())return  false;if(!(t instanceof Ut))return b.error("inAppMessage argument to logInAppMessageHtmlClick must be an HtmlMessage object."),false;let n=le.$i;e!=null&&(n=le.Oi);let i=_r.m().q(t,n,e,r);if(i.L)for(let o=0;o<i.ge.length;o++)qe.rr().fe(Je.Vr,[t.triggerId,e],i.ge[o]);return i.L}var oh=(t,e,r,n)=>{let i=r.getAttribute("href"),o=r.onclick;return s=>{if(o!=null&&typeof o=="function"&&o.bind(r)(s)===false)return;let a=Eh(i).abButtonId;if(a!=null&&a!==""||(a=r.getAttribute("id")||void 0),i!=null&&i!==""&&i.indexOf("#")!==0){let u=(r.getAttribute("target")||"").toLowerCase().replace("_","")==="blank",l=n||t.openTarget===C.OpenTarget.BLANK||u,c=()=>{Qo(t,a,i),yn.openUri(i,l,s);};l?c():t.Cr(e,c);}else Qo(t,a,i||void 0);return s.stopPropagation(),false}},sh=(t,e,r)=>{let n=`([\\w]+)\\s*=\\s*document.createElement\\(['"]${r}['"]\\)`,i=t.match(new RegExp(n));if(i){let o=`${i[1]}.setAttribute("nonce", "${e}")`;return `${t.slice(0,i.index+i[0].length)};${o};${t.slice(i.index+i[0].length)}`}return null},Dy=(t,e,r)=>{let n={closeMessage:function(){t.Cr(e);},logClick:function(){Qo(t,...arguments);},display:{},web:{}},i=function(){return function(){let v=arguments;Promise.resolve().then(function(){return Qh}).then(m=>{P.so()?m.requestPushPermission(...Array.prototype.slice.call(v)):b.error(Wt);});}},o={requestImmediateDataFlush:function(){let v=arguments;Promise.resolve().then(function(){return cw}).then(({requestImmediateDataFlush:m})=>{P.so()?m(...Array.prototype.slice.call(v)):b.error(Wt);});},logCustomEvent:function(){let v=arguments;Promise.resolve().then(function(){return Vh}).then(({logCustomEvent:m})=>
2{if(!P.so())return void b.error(Wt);m(...Array.prototype.slice.call(v));});},logPurchase:function(){let v=arguments;Promise.resolve().then(function(){return aw}).then(({logPurchase:m})=>{if(!P.so())return void b.error(Wt);m(...Array.prototype.slice.call(v));});},unregisterPush:function(){let v=arguments;Promise.resolve().then(function(){return Cw}).then(({unregisterPush:m})=>{P.so()?m(...Array.prototype.slice.call(v)):b.error(Wt);});},requestPushPermission:i(),changeUser:function(){let v=arguments;Promise.resolve().then(function(){return Zy}).then(({changeUser:m})=>{if(!P.so())return void b.error(Wt);m(...Array.prototype.slice.call(v));});}},s=function(v){return function(){o[v](...Array.prototype.slice.call(arguments));}};for(let v of Dt(o))n[v]=s(v);let a=["setFirstName","setLastName","setEmail","setGender","setDateOfBirth","setCountry","setHomeCity","setEmailNotificationSubscriptionType","setLanguage","addAlias","setPushNotificationSubscriptionType","setPhoneNumber","setCustomUserAttribute","addToCustomAttributeArray","removeFromCustomAttributeArray","incrementCustomUserAttribute","setCustomLocationAttribute","addToSubscriptionGroup","removeFromSubscriptionGroup"],u=function(v){return function(){let m=Au();m&&m[v](...Array.prototype.slice.call(arguments));}},l={};for(let v=0;v<a.length;v++)l[a[v]]=u(a[v]);n.getUser=function(){return l};let c={showFeed:r},d=function(v){return function(){let m=arguments;t.Cr(e,function(){c[v](...Array.prototype.slice.call(m));});}},h=n.display;for(let v of Dt(c))h[v]=d(v);let p={registerAppboyPushMessages:i()},f=function(v){return function(){p[v](...Array.prototype.slice.call(arguments));}},g=n.web;for(let v of Dt(p))g[v]=f(v);return n};function My(t,e,r,n,i,o){let s=document.createElement("iframe");s.setAttribute("title","Modal Message"),i&&(s.style.zIndex=(i+1).toString());let a=null;if(o!=null){a=document.createElement("html"),a.innerHTML=t.message||"";let u=a.getElementsByTagName("style");for(let c=0;c<u.length;c++)u[c].setAttribute("nonce",o);let l=a.getElementsByTagName("script");for(let c=0;c<l.length;c++){l[c].setAttribute("nonce",o),l[c].innerHTML=l[c].innerHTML.replace(/<style>/g,`<style nonce='${o}'>`);let d=sh(l[c].innerHTML,o,"script");d&&(l[c].innerHTML=d);let h=sh(l[c].innerHTML,o,"style");h&&(l[c].innerHTML=h);}}if(s.srcdoc=a?a.innerHTML:t.message||"",s.onload=()=>{let u=s.contentWindow;u.focus();let l=u.document.getElementsByTagName("head")[0];if(l!=null){if(t.ve()){let f=document.createElement("style");f.innerHTML=t.css||"",f.id=t.we()||"",o!=null&&f.setAttribute("nonce",o),l.appendChild(f);}let p=u.document.createElement("base");p!=null&&(p.setAttribute("target","_parent"),l.appendChild(p));}let c=u.document.getElementsByTagName("title");c&&c.length>0&&s.setAttribute("title",c[0].textContent||"");let d=Dy(t,s,e);if(u.appboyBridge=d,u.brazeBridge=d,t.xe!==C.Be.Me){let p=u.document.getElementsByTagName("a");for(let g=0;g<p.length;g++)p[g].onclick=oh(t,s,p[g],n);let f=u.document.getElementsByTagName("button");for(let g=0;g<f.length;g++)f[g].onclick=oh(t,s,f[g],n);}let h=u.document.body;if(h!=null){t.Ce()&&(h.id=t.htmlId||"");let p=document.createElement("hidden");p.onclick=d.closeMessage,p.className="ab-programmatic-close-button",h.appendChild(p);}u.dispatchEvent(new CustomEvent("ab.BridgeReady")),s.className.indexOf("ab-start-hidden")!==-1&&(s.className=s.className.replace("ab-start-hidden",""),r(s));},s.className="ab-in-app-message ab-start-hidden ab-html-message ab-modal-interactions",St.OS===cr.io){let u=document.createElement("div");return u.className="ab-ios-scroll-wrapper",u.appendChild(s),t.Re=u,u}return t.Re=s,s}function Ph(t,e){var r;if(!P.X())return  false;if(!(t instanceof Vr))return b.error("button must be an InAppMessageButton object"),false;if(!(e instanceof C))return b.error(wu),false;let n=_r.m().Ji(t,e);if(n.L)for(let i=0;i<n.ge.length;i++)qe.rr().fe(Je.Vr,[e.triggerId,(r=t.id)===null||r===void 0?void 0:r.toString()],n.ge[i]);return n.L}var ja={Je:t=>{let e=t.querySelectorAll(".ab-close-button, .ab-message-text, .ab-message-button"),r;for(let n=0;n<e.length;n++)r=e[n],r.tabIndex=0;if(e.length>0){let n=e[0],i=e[e.length-1];t.addEventListener("keydown",o=>{let s=document.activeElement;
2o.keyCode===Ar.lo&&(o.shiftKey||s!==i&&s!==t?!o.shiftKey||s!==n&&s!==t||(o.preventDefault(),i.focus()):(o.preventDefault(),n.focus()));});}},Ke:(t,e)=>{e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label","Modal Message"),t&&e.setAttribute("aria-labelledby",t);},He:(t,e,r,n)=>{if(t.buttons&&t.buttons.length>0){let i=document.createElement("div");i.className="ab-message-buttons",r.appendChild(i);let o=r.getElementsByClassName("ab-message-text")[0];o!=null&&(o.className+=" ab-with-buttons");let s=a=>u=>(t.Cr(r,()=>{Ph(a,t),a.clickAction===C.ClickAction.URI?ss(a.uri||"",n||t.openTarget===C.OpenTarget.BLANK,u):a.clickAction===C.ClickAction.NEWS_FEED&&e();}),u.stopPropagation(),false);for(let a=0;a<t.buttons.length;a++){let u=t.buttons[a],l=document.createElement("button");l.className="ab-message-button",l.setAttribute("type","button"),Ci(l,"touchstart");let c=u.text;u.text===""&&(c="\xA0"),l.appendChild(document.createTextNode(c)),t.ve()||(l.style.backgroundColor=Gt(u.backgroundColor),l.style.color=Gt(u.textColor),l.style.borderColor=Gt(u.borderColor)),l.onclick=s(u),i.appendChild(l);}}}};function Uy(t,e,r,n,i,o,s,a=document.body,u="ltr"){if(t.ke=document.activeElement,t instanceof Ut)return My(t,e,r,i,o,s);let l=(function(c,d,h,p,f,g,v=document.body,m="ltr"){let y=null,T=document.createElement("div");T.dir=m,T.className="ab-in-app-message ab-start-hidden ab-background",g&&(T.style.zIndex=(g+1).toString()),c.$e()&&(T.className+=" ab-modal-interactions",T.setAttribute("tabindex","-1")),c.ve()||(T.style.color=Gt(c.textColor),T.style.backgroundColor=Gt(c.backgroundColor),Ay(c.backgroundColor)&&(T.className+=" ab-no-shadow"));let k=()=>{T.className.indexOf("ab-start-hidden")!==-1&&(T.className=T.className.replace("ab-start-hidden",""),document.querySelectorAll(".ab-iam-img-loading").length>0?p(`Cannot show in-app message ${c.message} because another message is being shown.`,C.Le.ze):h(T));},N=(G=true)=>{let V=document.querySelectorAll(".ab-iam-root");V&&V.length!==0||(V=v.querySelectorAll(".ab-iam-root")),V&&V.length>0&&(V[0].classList.remove("ab-iam-img-loading"),y&&(clearTimeout(y),y=null),G?k():b.error(`Cannot show in-app message ${c.message} because the image failed to load.`));};c.imageStyle===C.ImageStyle.GRAPHIC&&(T.className+=" graphic"),c.orientation===C.Orientation.LANDSCAPE&&(T.className+=" landscape"),c.buttons!=null&&c.buttons.length===0&&(c.clickAction!==C.ClickAction.NONE&&(T.className+=" ab-clickable"),T.onclick=G=>(c.Cr(T,()=>{Ch(c),c.clickAction===C.ClickAction.URI?ss(c.uri||"",f||c.openTarget===C.OpenTarget.BLANK,G):c.clickAction===C.ClickAction.NEWS_FEED&&d();}),G.stopPropagation(),false));let _=Sh("Close Message",c.ve()?void 0:Gt(c.closeButtonColor),()=>{c.Cr(T);},m);T.appendChild(_),g&&(_.style.zIndex=(g+2).toString());let S=document.createElement("div");S.className="ab-message-text",S.dir=m;let M=(c.messageAlignment||c.qe).toLowerCase();S.className+=" "+M+"-aligned";let X=false,J=document.createElement("div");if(J.className="ab-image-area",c.imageUrl){if(c.cropType===C.CropType.CENTER_CROP){let G=document.createElement("span");G.className="ab-center-cropped-img",G.style.backgroundImage="url("+c.imageUrl+")",G.setAttribute("role","img"),G.setAttribute("aria-label","Modal Image"),c.Ae(G),J.appendChild(G);}else {let G=document.createElement("img");if(G.setAttribute("src",c.imageUrl),c.Ae(G),document.querySelectorAll(".ab-iam-img-loading").length===0){X=true;let V=document.querySelectorAll(".ab-iam-root");V&&V.length>0&&V[0].classList.add("ab-iam-img-loading"),y=window.setTimeout(()=>{N(false);},6e4),G.onload=()=>{N();},G.onerror=()=>{N(false);};}J.appendChild(G);}T.appendChild(J),S.className+=" ab-with-image";}else if(c.icon){J.className+=" ab-icon-area";let G=document.createElement("span");G.className="ab-icon",c.ve()||(G.style.backgroundColor=Gt(c.iconBackgroundColor),G.style.color=Gt(c.iconColor));let V=document.createElement("i");V.className="fa",V.appendChild(document.createTextNode(c.icon)),V.setAttribute("aria-hidden","true"),G.appendChild(V),J.appendChild(G),T.appendChild(J),S.className+=" ab-with-icon";}if(Ci(S,"touchstart"),c.header&&c.header.length>0){let G=document.createElement("h1");G.className="ab-message-header",c.De=xr.W(),G.id=c.De;let V=(c.headerAlignment||C.TextAlignment.CENTER).toLowerCase();G.className+=" "+V+"-aligned",c.ve()||(G.style.color=Gt(c.headerTextColor)),G.appendChild(document.createTextNode(c.header)),S.appendChild(G);}return S.appendChild(c.Ge()),T.appendChild(S),X||k(),c.Re=T,T})(t,e,r,n,i,o,a,u);if(t instanceof vr||t instanceof Or){let c=t instanceof vr?"ab-fullscreen":"ab-modal";l.className+=` ${c} ab-centered`,ja.He(t,e,l,i),ja.Je(l),ja.Ke(t.De,l);}else if(t instanceof br){l.className+=" ab-slideup";let c=l.getElementsByClassName("ab-close-button")[0];if(c!=null){let p=gh("0 0 11.38 19.44","M11.38 9.72l-9.33 9.72L0 17.3l7.27-7.58L0 2.14 2.05 0l9.33 9.72z",t.ve(
2)?void 0:Gt(t.closeButtonColor));p.setAttribute("class","ab-chevron"),c.appendChild(p);}let d,h;yi(l,pr.U,p=>{l.className+=" ab-swiped-left",c!=null&&c.onclick!=null&&c.onclick(p);}),yi(l,pr.V,p=>{l.className+=" ab-swiped-right",c!=null&&c.onclick!=null&&c.onclick(p);}),t.slideFrom===C.SlideFrom.TOP?(d=pr.Oe,h=" ab-swiped-up"):(d=pr.Qe,h=" ab-swiped-down"),yi(l,d,p=>{l.className+=h,c!=null&&c.onclick!=null&&c.onclick(p);});}return l}var Ha={en:{NO_CARDS_MESSAGE:"We have no updates for you at this time.<br/>Please check again later.",FEED_TIMEOUT_MESSAGE:"Sorry, this refresh timed out.<br/>Please try again later."},ar:{NO_CARDS_MESSAGE:"\u0644\u064A\u0633 \u0644\u062F\u064A\u0646\u0627 \u0623\u064A \u062A\u062D\u062F\u064A\u062B. \u064A\u0631\u062C\u0649 \u0627\u0644\u062A\u062D\u0642\u0642 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649 \u0644\u0627\u062D\u0642\u0627\u064B",FEED_TIMEOUT_MESSAGE:"\u064A\u0631\u062C\u0649 \u062A\u0643\u0631\u0627\u0631 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0644\u0627\u062D\u0642\u0627"},cs:{NO_CARDS_MESSAGE:"V tuto chv\xEDli pro v\xE1s nem\xE1me \u017E\xE1dn\xE9 aktualizace.<br/>Zkontrolujte pros\xEDm znovu pozd\u011Bji.",FEED_TIMEOUT_MESSAGE:"Pros\xEDm zkuste to znovu pozd\u011Bji."},da:{NO_CARDS_MESSAGE:"Vi har ingen updates.<br/>Pr\xF8v venligst senere.",FEED_TIMEOUT_MESSAGE:"Pr\xF8v venligst senere."},de:{NO_CARDS_MESSAGE:"Derzeit sind keine Updates verf\xFCgbar.<br/>Bitte sp\xE4ter noch einmal versuchen.",FEED_TIMEOUT_MESSAGE:"Bitte sp\xE4ter noch einmal versuchen."},es:{NO_CARDS_MESSAGE:"No tenemos actualizaciones.<br/>Por favor compru\xE9belo m\xE1s tarde.",FEED_TIMEOUT_MESSAGE:"Por favor int\xE9ntelo m\xE1s tarde."},"es-mx":{NO_CARDS_MESSAGE:"No tenemos ninguna actualizaci\xF3n.<br/>Vuelva a verificar m\xE1s tarde.",FEED_TIMEOUT_MESSAGE:"Por favor, vuelva a intentarlo m\xE1s tarde."},et:{NO_CARDS_MESSAGE:"Uuendusi pole praegu saadaval.<br/>Proovige hiljem uuesti.",FEED_TIMEOUT_MESSAGE:"Palun proovige hiljem uuesti."},fi:{NO_CARDS_MESSAGE:"P\xE4ivityksi\xE4 ei ole saatavilla.<br/>Tarkista my\xF6hemmin uudelleen.",FEED_TIMEOUT_MESSAGE:"Yrit\xE4 my\xF6hemmin uudelleen."},fr:{NO_CARDS_MESSAGE:"Aucune mise \xE0 jour disponible.<br/>Veuillez v\xE9rifier ult\xE9rieurement.",FEED_TIMEOUT_MESSAGE:"Veuillez r\xE9essayer ult\xE9rieurement."},he:{NO_CARDS_MESSAGE:".\u05D0\u05D9\u05DF \u05DC\u05E0\u05D5 \u05E2\u05D3\u05DB\u05D5\u05E0\u05D9\u05DD. \u05D1\u05D1\u05E7\u05E9\u05D4 \u05D1\u05D3\u05D5\u05E7 \u05E9\u05D5\u05D1 \u05D1\u05E7\u05E8\u05D5\u05D1",FEED_TIMEOUT_MESSAGE:".\u05D1\u05D1\u05E7\u05E9\u05D4 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E7\u05E8\u05D5\u05D1"},hi:{NO_CARDS_MESSAGE:"\u0939\u092E\u093E\u0930\u0947 \u092A\u093E\u0938 \u0915\u094B\u0908 \u0905\u092A\u0921\u0947\u091F \u0928\u0939\u0940\u0902 \u0939\u0948\u0902\u0964 \u0915\u0943\u092A\u092F\u093E \u092C\u093E\u0926 \u092E\u0947\u0902 \u092B\u093F\u0930 \u0938\u0947 \u091C\u093E\u0901\u091A \u0915\u0930\u0947\u0902.\u0964",FEED_TIMEOUT_MESSAGE:"\u0915\u0943\u092A\u092F\u093E \u092C\u093E\u0926 \u092E\u0947\u0902 \u0926\u094B\u092C\u093E\u0930\u093E \u092A\u094D\u0930\u092F\u093E\u0938 \u0915\u0930\u0947\u0902\u0964."},id:{NO_CARDS_MESSAGE:"Kami tidak memiliki pembaruan. Coba lagi nanti.",FEED_TIMEOUT_MESSAGE:"Coba lagi nanti."},it:{NO_CARDS_MESSAGE:"Non ci sono aggiornamenti.<br/>Ricontrollare pi\xF9 tardi.",FEED_TIMEOUT_MESSAGE:"Riprovare pi\xF9 tardi."},ja:{NO_CARDS_MESSAGE:"\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u306F\u3042\u308A\u307E\u305B\u3093\u3002<br/>\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",FEED_TIMEOUT_MESSAGE:"\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u8A66\u3057\u3066\u304F\u3060\u3055\u3044\u3002"},ko:{NO_CARDS_MESSAGE:"\uC5C5\uB370\uC774\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C\uC5D0 \uB2E4\uC2DC \uD655\uC778\uD574 \uC8FC\uC2ED\uC2DC\uC624.",FEED_TIMEOUT_MESSAGE:"\uB098\uC911\uC5D0 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC2ED\uC2DC\uC624."},ms:{NO_CARDS_MESSAGE:"Tiada kemas kini. Sila periksa kemudian.",FEED_TIMEOUT_MESSAGE:"Sila cuba kemudian."},nl:{NO_CARDS_MESSAGE:"Er zijn geen updates.<br/>Probeer het later opnieuw.",FEED_TIMEOUT_MESSAGE:"Probeer het later opnieuw."},no:{NO_CARDS_MESSAGE:"Vi har ingen oppdateringer.<br/>Vennligst sjekk igjen senere.",FEED_TIMEOUT_MESSAGE:"Vennligst pr\xF8v igjen senere."},pl:{NO_CARDS_MESSAGE:"Brak aktualizacji.<br/>Prosz\u0119 sprawdzi\u0107 ponownie p\xF3\u017Aniej.",FEED_TIMEOUT_MESSAGE:"Prosz\u0119 spr\xF3bowa\u0107 ponownie p\xF3\u017Aniej."},pt:{NO_CARDS_MESSAGE:"N\xE3o temos atualiza\xE7\xF5es.<br/>Por favor, verifique mais tarde.",FEED_TIMEOUT_MESSAGE:"Por favor, tente mais tarde."},"pt-br":{NO_CARDS_MESSAGE:"N\xE3o temos nenhuma atualiza\xE7\xE3o.<br/>Verifique novamente mais tarde.",FEED_TIMEOUT_MESSAGE:"Tente novamente mais tarde."},ru:{NO_CARDS_MESSAGE:"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B.<br/>\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u043D\u043E\u0432\u0430 \u043F\u043E\u0437\u0436\u0435.",FEED_TIMEOUT_MESSAGE:"\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443 \u043F\u043E\u0437\u0436\u0435."},sv:{NO_CARDS_MESSAGE:"Det finns inga uppdateringar.<br/>
2F\xF6rs\xF6k igen senare.",FEED_TIMEOUT_MESSAGE:"F\xF6rs\xF6k igen senare."},th:{NO_CARDS_MESSAGE:"\u0E40\u0E23\u0E32\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E32\u0E23\u0E2D\u0E31\u0E1E\u0E40\u0E14\u0E15 \u0E01\u0E23\u0E38\u0E13\u0E32\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A\u0E20\u0E32\u0E22\u0E2B\u0E25\u0E31\u0E07.",FEED_TIMEOUT_MESSAGE:"\u0E01\u0E23\u0E38\u0E13\u0E32\u0E25\u0E2D\u0E07\u0E43\u0E2B\u0E21\u0E48\u0E20\u0E32\u0E22\u0E2B\u0E25\u0E31\u0E07."},uk:{NO_CARDS_MESSAGE:"\u041E\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u044F \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0456.<br/>\u043B\u0430\u0441\u043A\u0430, \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0437\u043D\u043E\u0432\u0443 \u043F\u0456\u0437\u043D\u0456\u0448\u0435.",FEED_TIMEOUT_MESSAGE:"\u0411\u0443\u0434\u044C \u043B\u0430\u0441\u043A\u0430, \u0441\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437 \u043F\u0456\u0437\u043D\u0456\u0448\u0435."},vi:{NO_CARDS_MESSAGE:"Ch\xFAng t\xF4i kh\xF4ng c\xF3 c\u1EADp nh\u1EADt n\xE0o.<br/>Vui l\xF2ng ki\u1EC3m tra l\u1EA1i sau.",FEED_TIMEOUT_MESSAGE:"Vui l\xF2ng th\u1EED l\u1EA1i sau."},"zh-hk":{NO_CARDS_MESSAGE:"\u66AB\u6642\u6C92\u6709\u66F4\u65B0.<br/>\u8ACB\u7A0D\u5019\u518D\u8A66.",FEED_TIMEOUT_MESSAGE:"\u8ACB\u7A0D\u5019\u518D\u8A66."},"zh-hans":{NO_CARDS_MESSAGE:"\u6682\u65F6\u6CA1\u6709\u66F4\u65B0.<br/>\u8BF7\u7A0D\u540E\u518D\u8BD5.",FEED_TIMEOUT_MESSAGE:"\u8BF7\u7A0D\u5019\u518D\u8BD5."},"zh-hant":{NO_CARDS_MESSAGE:"\u66AB\u6642\u6C92\u6709\u66F4\u65B0.<br/>\u8ACB\u7A0D\u5019\u518D\u8A66.",FEED_TIMEOUT_MESSAGE:"\u8ACB\u7A0D\u5019\u518D\u8A66."},"zh-tw":{NO_CARDS_MESSAGE:"\u66AB\u6642\u6C92\u6709\u66F4\u65B0.<br/>\u8ACB\u7A0D\u5019\u518D\u8A66.",FEED_TIMEOUT_MESSAGE:"\u8ACB\u7A0D\u5019\u518D\u8A66."},zh:{NO_CARDS_MESSAGE:"\u6682\u65F6\u6CA1\u6709\u66F4\u65B0.<br/>\u8BF7\u7A0D\u540E\u518D\u8BD5.",FEED_TIMEOUT_MESSAGE:"\u8BF7\u7A0D\u5019\u518D\u8BD5."}},au=class{constructor(e,r=false){if(this.language=e,e!=null&&(e=e.toLowerCase()),e!=null&&Ha[e]==null){let n=e.indexOf("-");n>0&&(e=e.substring(0,n));}if(Ha[e]==null){let n="Braze does not yet have a localization for language "+e+", defaulting to English. Please contact us if you are willing and able to help us translate our SDK into this language.";r?b.error(n):b.info(n),e="en";}this.language=e;}get(e){return Ha[this.language][e]}wo(){switch(this.language){case "ar":case "he":case "fa":return "rtl";default:return "ltr"}}},Ot={t:false,i:null,m:()=>{if(Ot.o(),!Ot.i){let t=St.language,e=false;P.nn(ue.zn)&&(t=P.nn(ue.zn),e=true),Ot.i=new au(t,e);}return Ot.i},o:()=>{Ot.t||(P.g(Ot),Ot.t=true);},destroy:()=>{Ot.i=null,Ot.t=false;}};function Ih(t,e,r){if(!P.X())return;if(wh(),t==null)return  false;if(t instanceof mr)return b.info("User received control for a multivariate test, logging to Braze servers."),Xo(t),true;if(!(t instanceof C)||t.constructor===C)return  false;t.Nh();let n=t instanceof Ut;if(n&&!t.trusted&&!P.tr())return b.error('HTML in-app messages are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these messages.'),false;if(e==null&&(e=document.body),t.$e()&&e.querySelectorAll(".ab-modal-interactions").length>0)return b.info(`Cannot show in-app message ${t.message} because another message is being shown.`),false;if(yn.fo()){let a=yn.co();if(a===Hr.PORTRAIT&&t.orientation===C.Orientation.LANDSCAPE||a===Hr.LANDSCAPE&&t.orientation===C.Orientation.PORTRAIT){let u=a===Hr.PORTRAIT?"portrait":"landscape",l=t.orientation===C.Orientation.PORTRAIT?"portrait":"landscape";return b.info(`Not showing ${l} in-app message ${t.message} because the screen is currently ${u}`),false}}if(!P.tr()){let a=false;if(t.buttons&&t.buttons.length>0){let u=t.buttons;for(let l=0;l<u.length;l++)if(u[l].clickAction===C.ClickAction.URI){let c=u[l].uri;a=su(c);}}else t.clickAction===C.ClickAction.URI&&(a=su(t.uri));if(a)return b.error('Javascript click actions are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable these actions.'),false}let i=document.createElement("div");if(i.className="ab-iam-root v3",i.className+=Iy(t),i.setAttribute("role","complementary"),t.Ce()&&(i.id=t.htmlId),P.nn(ue.jo)&&(i.style.zIndex=(P.nn(ue.jo)+1).toString()),e.appendChild(i),t.ve()){let a=document.createElement("style");a.innerHTML=t.css,a.id=t.we(),P.nn(ue.bo)!=null&&a.setAttribute("nonce",P.nn(ue.bo)),document.getElementsByTagName("head")[0].appendChild(a);}let o=t instanceof br,s=Uy(t,()=>{Promise.resolve().then(function(){return vw}).then(a=>{P.so()?a.showFeed():b.error(Wt);});},a=>{if(t.$e()&&t.do()){let u=document.createElement("div");
2if(u.className="ab-page-blocker",t.ve()||(u.style.backgroundColor=Gt(t.frameColor)),P.nn(ue.jo)&&(u.style.zIndex=P.nn(ue.jo).toString()),i.appendChild(u),!P.nn(ue.Lh)){let l=new Date().valueOf();u.onclick=c=>{new Date().valueOf()-l>C.fh&&(t.Cr(a),c.stopPropagation());};}i.appendChild(a),a.focus(),t.Oh(i);}else if(o){let u=document.querySelectorAll(".ab-slideup"),l=null;for(let c=u.length-1;c>=0;c--)if(u[c]!==a){l=u[c];break}if(t.slideFrom===C.SlideFrom.TOP){let c=0;l!=null&&(c=l.offsetTop+l.offsetHeight),a.style.top=Math.max(c,0)+"px";}else {let c=0;l!=null&&(c=(window.innerHeight||document.documentElement.clientHeight)-l.offsetTop),a.style.bottom=Math.max(c,0)+"px";}}else if(n&&!P.nn(ue.Lh)){let u=t;fh(a)&&a.contentWindow&&a.contentWindow.addEventListener("keydown",function(l){l.keyCode===Ar.mh&&u.closeMessage();});}Xo(t),t.dismissType===C.DismissType.AUTO_DISMISS&&setTimeout(()=>{i.contains(a)&&t.Cr(a);},t.duration),typeof r=="function"&&r();},a=>{b.info(a);},P.nn(ue.ho),P.nn(ue.jo),P.nn(ue.bo),e,Ot.m().wo());return (n||o)&&(i.appendChild(s),t.Oh(i)),true}function Ah(t){if(P.X())return typeof t!="function"?null:_r.m().Mi(function(e){return t(e[0]),e.slice(1)})}function Ly(){if(!P.X())return;wh();let t=_r.m();if(t._i()==null){let e=Ah(r=>Ih(r));t.Pi(e);}return t._i()}function Ry(t){if(P.X())return t instanceof mr?(b.info("Not deferring since this is a ControlMessage."),false):t instanceof C?_r.m().je(t):(b.info("Not an instance of InAppMessage, ignoring."),false)}function Fy(){if(P.X())return _r.m().Se()}var uu=class{constructor(e,r,n,i){this.$t=e,this.oi=r,this.u=n,this.yt=i,this.$t=e,this.oi=r,this.u=n,this.yt=i,this._e=new Ke,P.Ht(this._e),this.Xe=1e3,this.We=6e4,this.Ye=null;}Ze(){return this._e}Mi(e){return this._e.Nt(e)}_i(){return this.Ye}Pi(e){this.Ye=e;}q(e,r,n,i){let o=new fr,s;if(e instanceof mr)s={trigger_ids:[e.triggerId]};else {if(r===le.$i||e instanceof Ut&&r===le.Oi){if(!e.p(i))return b.info("This in-app message has already received a click. Ignoring analytics event."),o}else if(r===le.Xi&&!e.K())return b.info("This in-app message has already received an impression. Ignoring analytics event."),o;s=this.Hi(e);}return s==null?o:(e.messageExtras&&(s.message_extras=e.messageExtras),n!=null&&(s.bid=n),Qe.q(r,s))}Ji(e,r){let n=new fr;if(!e.p())return b.info("This in-app message button has already received a click. Ignoring analytics event."),n;let i=this.Hi(r);return i==null?n:e.id===Vr.Ki?(b.info("This in-app message button does not have a tracking id. Not logging event to Braze servers."),n):(e.id!=null&&(i.bid=e.id),Qe.q(le.Oi,i)
2)}Li(e){let r=e.messageFields;return r!=null&&r.is_push_primer||false}Qi(e){if(!(e instanceof C))return;let r=o=>{if(!o)return;let s=Cu(o);return Eu(s)?Ya(wi.Vi,"In-App Message"):ch(s)&&!bt.Wi()?Ya(wi.Yi,"In-App Message"):void 0};if(this.Li(e)&&!bt.Wi())return "In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.";let n=e.buttons||[],i;for(let o of n)if(o.clickAction===C.ClickAction.URI&&o.uri&&Si.test(o.uri)&&(i=r(o.uri),i))return i;return e.clickAction===C.ClickAction.URI&&e.uri&&Si.test(e.uri)?r(e.uri):void 0}Zi(e,r,n,i){let o=this.$t;if(!o)return;let s=o.Ir(false,false),a=o.$s(s);a.template={trigger_id:e.triggerId,trigger_event_type:r},n!=null&&(a.template.data=n.Mr());let u=o.Ps(a,ne._s.Tr);o.Gs(a,(l=-1)=>{if(!this.$t)return;let c=new Date().valueOf();ne.Hs(this.u,ne._s.Tr,c),l!==-1&&u.push(["X-Braze-Req-Tokens-Remaining",l.toString()]),is.Ks({url:`${this.$t.Os()}/template/`,data:a,headers:u,L:d=>{if(ne.Ws(this.u,ne._s.Tr,1),!this.$t.Qs(a,d,u))return void(typeof e.Br=="function"&&e.Br());if(this.$t.Vs(),d==null||d.templated_message==null)return;let h=d.templated_message;if(h.type!==dr.Er._r)return;let p=mh(h.data);if(p==null)return;let f=this.Qi(p);if(f)return b.error(f),void(typeof e.Br=="function"&&e.Br());typeof e.Gr=="function"&&e.Gr(p);},error:d=>{let h=`getting user personalization for message ${e.triggerId}`;if(new Date().valueOf()-e.Nr<e.Or){ne.ti(this.u,ne._s.Tr);let p=Math.min(e.Or,this.We),f=this.Xe;i==null&&(i=f);let g=Math.min(p,os(f,3*i));h+=`. Retrying in ${g} ms`,setTimeout(()=>{this.Zi(e,r,n,g);},g);}this.$t.Ys(d,h);}});},ne._s.Tr);}Hi(e){if(e.triggerId==null)return b.info("The in-app message has no analytics id. Not logging event to Braze servers."),null;let r={};return e.triggerId!=null&&(r.trigger_ids=[e.triggerId]),r}je(e){return !!this.u&&!(!(e&&e instanceof C&&e.constructor!==C)||e instanceof mr)&&this.u.I(E.C.Xr,e.Y())}Se(){if(!this.u)return null;let e=this.u.j(E.C.Xr);if(!e)return null;let r;switch(e.type){case C.Be.Hr:r=vr.Jr(e);break;case C.Be.Kr:case C.Be.Me:case C.Be.Ve:r=Ut.Jr(e);break;case C.Be.Lr:case C.Be.Ue:r=Or.Jr(e);break;case C.Be.Qr:r=br.Jr(e);}return r&&this.Ur(),r}Ur(){this.u&&this.u.ii(E.C.Xr);}},sr={i:null,t:false,m:()=>(sr.o(),sr.i||(sr.i=new uu(P.nr(),P.zr(),P.l(),P.er())),sr.i),o:()=>{sr.t||(P.g(sr),sr.t=true);},destroy:()=>{sr.i=null,sr.t=false;}},_r=sr,lu=class t{constructor(e,r,n,i,o){this.triggerId=e,this.Gr=r,this.Br=n,this.Nr=i,this.Or=o,this.triggerId=e,this.Gr=r,this.Br=n,this.Nr=i,this.Or=o;}static fromJson(e,r,n,i,o){return e==null||e.trigger_id==null?null:new t(e.trigger_id,r,n,i,o)}},cu=class extends _n{constructor(e,r,n,i,o){super(),this.tg=e,this.Bt=r,this.u=n,this.Ui=i,this.ig=o,this.tg=e,this.Bt=r,this.u=n,this.Ui=i,this.ig=o,this.sg=[],this.eg=[],this.hg=null,this.ng={},this.og={},this.triggers=[],this.lg=0,this.ag(),this.gg();}fg(){if(this.u){this.hg=this.u.j(E.C.iE)||this.hg,this.ng=this.u.j(E.C.EE)||this.ng,this.og=this.u.j(E.C.aE)||this.og;for(let e=0;e<this.triggers.length;e++){let r=this.triggers[e];r.id&&this.og[r.id]!=null&&r.ad(this.og[r.id]);}}}ag(){if(!this.u)return;this.lg=this.u.j(E.C.oE)||0;let e=this.u.j(E.C.rE)||[],r=[];for(let n=0;n<e.length;n++)r.push(dr.qn(e[n]));this.triggers=r,this.fg();}gg(){let e=this,r=function(o,s,a,u,l){return function(){e.cg(o,s,a,u,l);}},n={};for(let o of this.triggers)o.id&&(n[o.id]=o);let i=false;for(let o=0;o<this.triggers.length;o++){let s=this.triggers[o];if(s.id&&this.ng[s.id]!=null){let a=this.ng[s.id],u=[];for(let l=0;l<a.length;l++){let c=a[l],d=s.ud(c.Nr||0);if(d>0){let h,p;u.push(c),c.ug!=null&&(h=c.ug),c.dg!=null&&Mt.RE(c.dg)&&(p=Mt.qn(c.dg));let f=[];if(c.pg&&Ze(c.pg))for(let g=0;g<c.pg.length;g++){let v=n[c.pg[g]];v!=null&&f.push(v);}this.eg.push(window.setTimeout(r(s,c.Nr||0,h,p,f),d));}}this.ng[s.id].length>u.length&&(this.ng[s.id]=u,i=true,this.ng[s.id].length===0&&delete this.ng[s.id]);}}i&&this.u&&this.u.I(E.C.EE,this.ng);}mg(){if(!this.u)return;let e=[];for(let r=0;r<this.triggers.length;r++)e.push(this.triggers[r].Y());this.lg=new Date().valueOf(),this.u.I(E.C.rE,e),this.u.I(E.C.oE,this.lg);}bg(){this.u&&((this.u.j(E.C.oE)||0)>this.lg?this.ag():this.fg());}Ss(e){let r=false;if(e!=null&&e.triggers){this.ig.Ur(),this.fg();let n={},i={};this.triggers=[];for(let a=0;a<e.triggers.length;a++){let u=dr.fromJson(e.triggers[a]);if(u){u.id&&this.og[u.id]!=null&&(u.ad(this.og[u.id]),n[u.id]=this.og[u.id]),u.id&&this.ng[u.i
2d]!=null&&(i[u.id]=this.ng[u.id]);for(let l=0;l<u.sd.length;l++)if(u.sd[l].sc(Je.kt,null)){r=true;break}this.triggers.push(u);}}vn(this.og,n)||(this.og=n,this.u&&this.u.I(E.C.aE,this.og)),vn(this.ng,i)||(this.ng=i,this.u&&this.u.I(E.C.EE,this.ng)),this.mg(),r&&(b.info("Trigger with test condition found, firing test."),this.fe(Je.kt)),this.fe(Je.OPEN);let o=this.sg,s;this.sg=[];for(let a=0;a<o.length;a++)s=Array.prototype.slice.call(o[a]),this.fe(...s);}}cg(e,r,n,i,o){let s=d=>{this.fg();let h=new Date().valueOf();e.dd(r)||(navigator.onLine===false&&e.type===dr.Er._r&&d.imageUrl?b.info(`Not showing ${e.type} trigger action ${e.id} due to offline state.`):e.nd(h)&&this.wg(e,h,n)?this.Bt.ic()===0?b.info(`Not displaying trigger ${e.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`):(this.Bt.Rt([d]),this.yg(e,h)):b.info(`Not displaying trigger ${e.id} because display time fell outside of the acceptable time window.`));},a=()=>{this.fg();let d=o.pop();if(d!=null)if(this.Tg(d,r,n,i,o),d.dd(r)){let h=`Server aborted in-app message display, but the timeout on fallback trigger ${d.id} has already elapsed.`;o.length>0&&(h+=" Continuing to fall back."),b.info(h),a();}else {b.info(`Server aborted in-app message display. Falling back to lower priority ${d.type} trigger action ${e.id}.`);let h=1e3*d.ed-(new Date().valueOf()-r);h>0?this.eg.push(window.setTimeout(()=>{this.cg(d,r,n,i,o);},h)):this.cg(d,r,n,i,o);}},u,l,c;switch(e.type){case dr.Er._r:if(u=mh(e.data),u==null){b.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`);break}if(l=this.ig.Qi(u),l){b.error(l),a();break}s(u);break;case dr.Er.md:if(c=lu.fromJson(e.data,s,a,r,e.Or||0),c==null){b.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`);break}this.ig.Zi(c,n,i);break;default:b.error(`Trigger ${e.id} was of unexpected type ${e.type}, ignoring.`);}}fe(e,r=null,n){if(!gr(Je,e,"Cannot fire trigger action.","TriggerEvents"))return;if(this.Ui&&this.Ui.Uu())return b.info("Trigger sync is currently in progress, awaiting sync completion before firing trigger event."),void this.sg.push(arguments);this.bg();let i=new Date().valueOf(),o=i-(this.hg||0),s=true,a=true,u=[];for(let c=0;c<this.triggers.length;c++){let d=this.triggers[c],h=i+1e3*d.ed;if(d.nd(h)&&(d.startTime==null||d.startTime.valueOf()<=i)&&(d.endTime==null||d.endTime.valueOf()>=i)){let p=false;for(let f=0;f<d.sd.length;f++)if(d.sd[f].sc(e,r)){p=true;break}p&&(s=false,this.wg(d,h,e)&&(a=false,u.push(d)));}}if(s)return void b.info(`Trigger event ${e} did not match any trigger conditions.`);if(a)return void b.info(`Ignoring ${e} trigger event because a trigger was displayed ${o/1e3}s ago.`);u.sort((c,d)=>c.priority-d.priority);let l=u.pop();l!=null&&(b.info(`Firing ${l.type} trigger action ${l.id} from trigger event ${e}.`),this.Tg(l,i,e,n,u),l.ed===0?this.cg(l,i,e,n,u):this.eg.push(window.setTimeout(()=>{this.cg(l,i,e,n,u);},1e3*l.ed)));}changeUser(e=false){if(this.triggers=[],this.u&&this.u.ii(E.C.rE),!e){this.sg=[],this.hg=null,this.og={},this.ng={};for(let r=0;r<this.eg.length;r++)clearTimeout(this.eg[r]);this.eg=[],this.u&&(this.u.ii(E.C.iE),this.u.ii(E.C.aE),this.u.ii(E.C.EE));}}clearData(){this.triggers=[],this.hg=null,this.og={},this.ng={};for(let e=0;e<this.eg.length;e++)clearTimeout(this.eg[e]);this.eg=[];}wg(e,r,n){if(this.hg==null)return  true;if(n===Je.kt)return b.info("Ignoring minimum interval between trigger because it is a test type."),true;let i=e.hd;return i==null&&(i=this.tg),r-this.hg>=1e3*i}Tg(e,r,n,i,o){this.fg(),e.id&&(this.ng[e.id]=this.ng[e.id]||[]);let s={},a;s.Nr=r,s.ug=n,i!=null&&(a=i.Y()),s.dg=a;let u=[];for(let l of o)l.id&&u.push(l.id);s.pg=u,e.id&&this.ng[e.id].push(s),this.u&&this.u.I(E.C.EE,this.ng);}yg(e,r){this.fg(),e.ad(r),this.hg=r,e.id&&(this.og[e.id]=r),this.u&&(this.u.I(E.C.iE,r),this.u.I(E.C.aE,this.og));}},qe={t:false,provider:null,rr:()=>(qe.o(),qe.provider||qe.rg(),qe.provider),rg:()=>{if(!qe.provider){let t=P.nn(ue.Oo);qe.provider=new cu(t!=null?t:30,_r.m().Ze(),P.l(),P.cr(),_r.m()),P.ar(qe.provider);}},o:()=>{qe.t||(qe.rg(),P.g(qe),qe.t=true);},destroy:()=>{qe.provider=null,qe.t=false;}},Zo=class t{constructor(e,r,n,i,o){this.endpoint=e,this.Vn=r,this.publicKey=n,this.Vl=i,this.cl=o,this.endpoint=e||null,this.Vn=r||null,this.publicKey=n||null,this.Vl=i||null,this.cl=o||null;}Y(){return {e:this.endpoint,c:this.Vn,p:this.publicKey,u:this.Vl,v:this.cl}}static qn(e){return new t(e.e,fn(e.c),e.p,e.u,e.v)}},du=class{constructor(e,r){this.qt=e,this.u=r,this.qt=e,this.u=r;}getUserId(){let e=this.u.tu(E.iu.su);if(e==null)return null;let r=e.eu,n=jo(r);if(n>Ne.lr){for(;n>Ne.lr;)r=r.slice(0,r.length-1),n=jo(r);e.eu=r,this.u.uu(E.iu.su,e);}return r}ou(e){let r=this.getUserId()==null;this.u.uu(E.iu.su,new hr(e)),r&&this.u.ru(e);}setCustomUserAttribute(e,r){if(this.qt.hu(e))return b.info('Custom Attribute "'+e+'" is blocklisted, ignoring.'),false;let n={};return n[e]=r,this.nu(Ne.lu,n,true)}nu(e,r,n=false,i=false){let o=this.u.mu(this.getUserId(),e,r),s="",a=e,u=r;return n&&(s=" custom",typeof r=="object"&&(a=Object.keys(r)[0],u=r[a],typeof u=="object"&&(u=JSON.stringify(u,null,2)))),!i&&o&&b.info(`Logged${s} attribute ${a} with value ${u}`),o}Pn(e,r,n,i,o){this.nu("push_token",e,false,true),this.nu("custom_push_public_key",n,false,true),this.nu("custom_push_user_auth",i,false,true),this.nu("custom_push_vapid_public_key",o,false,true);let s=we.ts.Zt,a=new we(s,b),u=new Zo(e,r,n,i,o);this.u.I(E.C.In,u.Y()),a.setItem(s.hs.cu,s.ie,true);}
2Sn(e){if(this.nu("push_token",null,false,true),this.nu("custom_push_public_key",null,false,true),this.nu("custom_push_user_auth",null,false,true),this.nu("custom_push_vapid_public_key",null,false,true),e){let r=we.ts.Zt,n=new we(r,b);this.u.I(E.C.In,false),n.setItem(r.hs.cu,r.ie,false);}}},ue={Eo:"allowCrawlerActivity",_o:"baseUrl",Io:"noCookies",Aa:"disablePushTokenMaintenance",Ao:"enableLogging",No:"enableSdkAuthentication",qa:"manageServiceWorkerExternally",Oo:"minimumIntervalBetweenTriggerActionsInSeconds",Ro:"sessionTimeoutInSeconds",Po:"appVersion",Lo:"appVersionNumber",Ma:"serviceWorkerLocation",ka:"safariWebsitePushId",zn:"localization",bo:"contentSecurityNonce",Do:"allowUserSuppliedJavascript",jo:"inAppMessageZIndex",ho:"openInAppMessagesInNewTab",tn:"openCardsInNewTab",en:"openNewsFeedCardsInNewTab",Lh:"requireExplicitInAppMessageDismissal",Mo:"doNotLoadFontAwesome",Uo:"deviceId",_a:"serviceWorkerScope",Wo:"sdkFlavor"},hu=class{constructor(){this.rn="",this.Bo="",this.Vo=void 0,this.Ko=null,this.on=null,this.$t=null,this.Ui=null,this.qt=null,this.oi=null,this.u=null,this.yt=null,this.Go="",this.isInitialized=false,this.$o=false,this.qo=new Ke,this.Jo=new Ke,this.options={},this.Yo=[],this.Ho=[],this._e=[],this.Bo="5.5.0";}Xo(e){this.qo.Nt(e);}Sh(e){this.Jo.Nt(e);}initialize(e,r){if(this.so())return b.info("Braze has already been initialized with an API key."),true;this.options=r||{};let n=this.nn(ue.Ao),i=Eh(yn.Zo());if(i&&i.brazeLogging==="true"&&(n=true),b.init(n),b.info(`Initialization Options: ${JSON.stringify(this.options,null,2)}`),e==null||e===""||typeof e!="string")return b.error("Braze requires a valid API key to be initialized."),false;this.rn=e;let o=this.nn(ue._o);if(o==null||o===""||typeof o!="string")return b.error("Braze requires a valid baseUrl to be initialized."),false;/^https?:/.test(o)===false&&(o=`https://${o}`);let s=o;if(o=document.createElement("a"),o.href=s,o.pathname==="/"&&(o=`${o}api/v3`),this.Go=o.toString(),St.Qo&&!this.nn(ue.Eo))return b.info("Ignoring activity from crawler bot "+navigator.userAgent),this.$o=true,false;let a=this.nn(ue.Io)||false;if(this.u=hh.Wh(e,a),a&&this.u.Vh(e),new ot.ee(null,true).br(E.se))return b.info("Ignoring all activity due to previous opt out"),this.$o=true,false;for(let h of Dt(this.options))rs(Zd).indexOf(h)===-1&&b.warn(`Ignoring unknown initialization option '${h}'.`);let u=["mparticle","wordpress","tealium"];if(this.nn(ue.Wo)!=null){let h=this.nn(ue.Wo);u.indexOf(h)!==-1?this.Vo=h:b.error("Invalid sdk flavor passed: "+h);}let l=this.nn(Zd.So);if(l!=null)if(Ze(l)){let h=[];for(let p=0;p<l.length;p++)gr(lr,l[p],"devicePropertyAllowlist contained an invalid value.","DeviceProperties")&&h.push(l[p]);l=h;}else b.error("devicePropertyAllowlist must be an array. Defaulting to all properties."),l=null;let c=this.nn(ue.Uo);if(c){let h=new hr(c);this.u.uu(E.iu.Uo,h);}this.on=new tu(this.u,l),this.qt=new iu(this.u),this.yt=new du(this.qt,this.u),this.oi=new ou(this.u,this.yt,this.qt,this.nn(ue.Ro));let d=new Ke;return this.Ko=new Za(this.u,this.nn(ue.No),d),this.Ht(d),this.$t=new ru(this.on,this.u,this.Ko,this.yt,this.oi,this.qt,this.rn,this.Go,this.Bo,this.Vo||"",this.nn(ue.Po),this.nn(ue.Lo)),this.Ui=new nu(this.rn,this.Go,this.oi,this.on,this.yt,this.qt,this.u,h=>{if(this.so())for(let p of this.gr())p.Ss(h);},this.Ko,this.$t),this.Ui.initialize(),a||this.u.Kh(),b.info(`Initialized for the Braze backend at "${this.nn(ue._o)}" with API key "${this.rn}".`),qe.o(),this.qt.bi(()=>{var h;this.isInitialized&&(!((h=this.qt)===null||h===void 0)&&h.mi())&&Promise.resolve().then(function(){return ah}).then(p=>{this.isInitialized&&(0, p.default)();});}),this.Ui.mr(()=>{var h;this.isInitialized&&(!((h=this.qt)===null||h===void 0)&&h.mi())&&Promise.resolve().then(function(){return ah}).then(p=>{this.isInitialized&&(0, p.default)(void 0,void 0,true);});}),this.qo.Rt(this.options),this.isInitialized=true,window.dispatchEvent(new CustomEvent("braze.initialized")),true}destroy(e){if(b.destroy(),this.so()){this.Jo.Rt(),this.Jo.removeAllSubscriptions();for(let r of this.Yo)r.destroy();this.Yo=[];for(let r of this.Ho)r.clearData(false);this.Ho=[],this.removeAllSubscriptions(),this._e=[],this.Ui!=null&&this.Ui.destroy(),this.Ui=null,this.Ko=null,this.on=null,this.$t
2=null,this.qt=null,this.oi=null,this.yt=null,this.options={},this.Vo=void 0,this.isInitialized=false,this.$o=false,e&&(this.u=null);}}X(){return !this.$h()&&(!!this.so()||(console.warn(Wt),false))}ba(){return this.rn}Sr(){return this.Ko}Os(){return this.Go}te(){return this.on}nr(){return this.$t}nn(e){return this.options[e]}gr(){return this.Ho}cr(){return this.Ui}ir(){return this.qt}zr(){return this.oi}l(){return this.u}pr(){if(this.yt&&this.Ui)return new Ne(this.yt,this.Ui)}er(){return this.yt}tr(){return this.nn(ue.Do)===true}g(e){let r=false;for(let n of this.Yo)n===e&&(r=true);r||this.Yo.push(e);}ar(e){let r=false;for(let n of this.Ho)n.constructor===e.constructor&&(r=true);e instanceof _n&&!r&&this.Ho.push(e);}Ht(e){e instanceof Ke&&this._e.push(e);}removeAllSubscriptions(){if(this.X())for(let e of this._e)e.removeAllSubscriptions();}removeSubscription(e){if(this.X())for(let r of this._e)r.removeSubscription(e);}oe(e){this.$o=e;}so(){return this.isInitialized}$h(){return this.$o}ks(){return this.Bo}},P=new hu,$y={q:(t,e,r)=>{var n,i;let o=new fr,s=P.zr();if(!s)return b.info(`Not logging event with type "${t}" because the current session ID could not be found.`),o;let a=s.xo();return o.ge.push(new Mt(r||((n=P.er())===null||n===void 0?void 0:n.getUserId()),t,new Date().valueOf(),a,e)),o.L=((i=P.l())===null||i===void 0?void 0:i.zo(o.ge))||false,o}},Qe=$y,pu=class{constructor(e){this.u=e,this.u=e;}h(e,r){let n=new fr;if(e.p(),e.url==null||e.url==="")return b.info(`Card ${e.id} has no url. Not logging click to Braze servers.`),n;if(r&&e.id&&this.u){let s=this.u.j(E.C.v)||{};s[e.id]=true,this.u.I(E.C.v,s);}let i=this.$([e]);if(i==null)return n;let o=r?le.k:le.D;return Qe.q(o,i)}B(e){let r=new fr;if(!e.N())return b.info(`Card ${e.id} refused this dismissal. Ignoring analytics event.`),r;if(e.id&&this.u){let i=this.u.j(E.C.A)||{};i[e.id]=true,this.u.I(E.C.A,i);}let n=this.$([e]);return n==null?r:Qe.q(le.F,n)}G(e,r){let n=new fr(true),i=[],o=[],s={};this.u&&(s=r?this.u.j(E.C.H)||{}:this.u.j(E.C.J)||{});for(let l of e)l.K()?(l instanceof bn?o.push(l):i.push(l),l.id&&(s[l.id]=true)):b.info(`Card ${l.id} logged an impression too recently. Ignoring analytics event.`);let a=this.$(i),u=this.$(o);if(a==null&&u==null)return n.L=false,n;if(this.u&&(r?this.u.I(E.C.H,s):this.u.I(E.C.J,s)),a!=null){let l=r?le.M:le.O,c=Qe.q(l,a);n.P(c);}if(u!=null&&r){let l=Qe.q(le.R,u);n.P(l);}return n}$(e){let r,n=null;for(let i=0;i<e.length;i++)r=e[i].id,r!=null&&r!==""&&(n=n||{},n.ids=n.ids||[],n.ids.push(r));return n}},ar={t:false,i:null,m:()=>(ar.o(),ar.i||(ar.i=new pu(P.l())),ar.i),o:()=>{ar.t||(P.g(ar),ar.t=true);},destroy:()=>{ar.i=null,ar.t=false;}},Tu=ar;function as(t,e){return !!P.X()&&(t instanceof D?Tu.m().h(t,e).L:(b.error("card "+Su),false))}function Th(t){return !!P.X()&&(t instanceof D?Tu.m().B(t).L:(b.error("card "+Su),false))}function us(t,e){if(!P.X())return  false;if(!Ze(t))return b.error("cards must be an array"),false;for(let r of t)if(!(r instanceof D))return b.error(`Each card in cards ${Su}`),false;return Tu.m().G(t,e).L}function By(t){return us(t,true)}function zy(t){return as(t,true)}var Tr=class{constructor(e,r){this.cards=e,this.lastUpdated=r,this.cards=e,this.lastUpdated=r;}getUnreadCardCount(){let e=0;for(let r of this.cards)r.viewed||r instanceof bn||e++;return e}dr(){b.error("Must be implemented in a subclass");}logCardImpressions(e){b.error("Must be implemented in a subclass");}logCardClick(e){b.error("Must be implemented in a subclass");}sr(){b.error("Must be implemented in a subclass");}};Tr.ur=6e4,Tr.Ah=500,Tr.Co=1e4;function ku(t,e,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v,m){let y;if(e===D.it.Pt||e===D.it.Ut)y=new zo(t,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v);else if(e===D.it.st)y=new Bo(t,r,n,i,o,s,a,u,l,c,d,h,p,f,g,v);else if(e===D.it.Gt)y=new $o(t,r,i,s,a,u,l,c,d,h,p,f,g,v);else {if(e!==D.it.Xt)return b.error("Ignoring card with unknown type "+e),null;y=new bn(t,r,a,l,p,f);}return m&&(y.test=m),y}function Va(t){if(t[D._t.Ot])return null;let e=t[D._t.ht],r=t[D._t.Z],n=t[D._t.et],i=t[D._t.rt],o=t[D._t.ot],s=t[D._t.ct],a=Qt(t[D._t.nt]),u=a,l;return l=t[D._t.lt]===D.Mt?null:Qt(t[D._t.lt]),ku(e,r,n,i,o,s,u,a,null,l,t[D._t.URL],t[D._t.ft],t[D._t.xt],t[D._t.bt],t[D._t.gt],t[D._t.jt],t[D._t.zt],t[D._t.kt]||false)}function jy(t){return ku(t.id,t.type,t.viewed,t.title,t.image,t.description,Qt(t.created),Qt(t.updated),t.categories,Qt(t.expires_at),t.url,t.domain,t.aspect_ratio,t.extras,false,false)}function kh(t){return ku(t[D.tt.ht],t[D.tt.Z],t[D.tt.et],t[D.tt.rt],t[D.tt.ot],t[D.tt.ct],fn(t[D.tt.dt]),fn(t[D.tt.nt]),t[D.tt.ut],fn(t[D.tt.lt]),t[D.tt.URL],t[D.tt.ft],t[D.tt.xt],t[D.tt.bt],t[D.tt.gt],t[D.tt.jt],t[D.tt.zt],t[D.tt.kt]||false)||void 0}var gu=class extends _n{constructor(e,r,n,i,o){super(),this.yt=e,this.u=r,this.qt=n,this.Jt=i,this.$t=o,this.yt=e,this.u=r,this.qt=n,this.Jt=i,this.$t=o,this.Bt=new Ke,P.Ht(this.Bt),this.Kt=0,this.Qt=0,this.cards=[],this.Yt();let s=we.ts.Zt;new we(s,b).ss(s.hs.es,a=>{this.rs(a);}),this.ns=null,this.os=null,this.ls=null,this.us=null,this.cs=null,this.fs=10,this.ds=0;}ps(){return this.ns}vs(e){this.ns=e;}ws(){return this.os}Cs(e){this.os=e;}Yt(){if(!this.u)return;let e=this.u.j(E.C.bs)||[],r=[];for(let n=0;n<e.length;n++){let i=kh(e[n]);i!=null&&r.push(i);}this.cards=this.gs(this.ys(r,false)),this.Kt=this.u.j(E.C.js)||this.Kt,this.Qt=this.u.j(E.C.Rs)||this.Qt;}Ns(e,r=false,n=0,i=0){let o;if(r){o=[];for(let s of this.cards)s.test&&o.push(s);}else o=this.cards.slice();for(let s=0;s<e.length;s++){let a=e[s],u=null;for(let l=0;l<this.cards.length;l++)if(a.id===this.cards[l].id){u=this.cards[l];break}if(r){let l=Va(a);u!=null&&u.viewed&&l&&(l.viewed=true),l!=null&&o.push(l);}else if(u==null){let l=Va(a);l!=null&&o.push(l);}else if(!u.Lt(a)){for(let l=0;l<o.length;l++)if(a.id===o[l].id){o.splice(l,1);break}}}this.cards=this.gs(this.ys(o,r)),this.Ts(),this.Kt=n,this.Qt=i,this.u&&(this.u.I(E.C.js,this.Kt),this.u.I(E.C.Rs,this.Qt));}Ss(e){if(this.Ds()&&e!=null&&e.cards){this.u&&this.u.I(E.C.Us,P.ks());let r=e.full_sync;r||this.Yt(),this.Ns(e.cards,r,e.last_full_sync_at,e.last_card_updated_at),this.Bt.Rt(this.As(true));}}Fs(e){this.u&&this.u.I(E.C.xs,e);}zs(e,r,n){let i=()=>{this.qs(r,n,true);},o=e?yy(e):null,s;if(this.Es(),!o||!o["retry-after"])return void this.Fs(0);let a=o["retry-after"];if(isNaN(a)&&!isNaN(Date.parse(a)))s=Date.parse(a)-new Date().getTime(),s<0&&i();else {if(isNaN(parseFloat(a.toString())))return Qe.q(le.Ls,{e:"Received unexpected value for retry-after header in /sync response"+": "+a}),void this.Fs(0);s=1e3*parseFloat(a.toString());}this.ls=window.setTimeout(()=>{i();},s);let u=0;this.u&&(u=this.u.j(E.C.xs)),(u==null||isNaN(parseInt(u.toString())))&&(u=0),this.Fs(parseInt(u.toString())+1);}rs(e){var r;if(!this.Ds())return;this.Yt();let n=this.cards.slice(),i=null;i=(r=this.yt)===null||r===void 0?void 0:r.getUserId();for(let o=0;o<e.length;
2o++)if(i===e[o].userId||i==null&&e[o].userId==null){let s=e[o].card,a=null;for(let u=0;u<this.cards.length;u++)if(s.id===this.cards[u].id){a=this.cards[u];break}if(a==null){let u=Va(s);u!=null&&n.push(u);}else if(!a.Lt(s)){for(let u=0;u<n.length;u++)if(s.id===n[u].id){n.splice(u,1);break}}}this.cards=this.gs(this.ys(n,false)),this.Ts(),this.Bt.Rt(this.As(true));}ys(e,r){let n={},i={},o={};this.u&&(n=this.u.j(E.C.v)||{},i=this.u.j(E.C.H)||{},o=this.u.j(E.C.A)||{});let s={},a={},u={};for(let l=0;l<e.length;l++){let c=e[l].id;c&&(n[c]&&(e[l].clicked=true,s[c]=true),i[c]&&(e[l].viewed=true,a[c]=true),o[c]&&(e[l].dismissed=true,u[c]=true));}return r&&this.u&&(this.u.I(E.C.v,s),this.u.I(E.C.H,a),this.u.I(E.C.A,u)),e}gs(e){let r=[],n=new Date,i={};this.u&&(i=this.u.j(E.C.A)||{});let o=false;for(let s=0;s<e.length;s++){let a=e[s].url;if(!this.Jt&&a&&su(a)){b.error(`Card with url ${a} will not be displayed because Javascript URLs are disabled. Use the "allowUserSuppliedJavascript" option for braze.initialize to enable this card.`);continue}let u=e[s].expiresAt,l=true;if(u!=null&&(l=u>=n),l=l&&!e[s].dismissed,l)r.push(e[s]);else {let c=e[s].id;c&&(i[c]=true),o=true;}}return o&&this.u&&this.u.I(E.C.A,i),r}Ts(){var e;let r=[];for(let n=0;n<this.cards.length;n++)r.push(this.cards[n].Y());(e=this.u)===null||e===void 0||e.I(E.C.bs,r);}Es(){this.ls&&(clearTimeout(this.ls),this.ls=null);}Is(){this.us!=null&&(clearTimeout(this.us),this.us=null);}Js(e=1e3*this.fs,r,n){this.Is(),this.us=window.setTimeout(()=>{this.qs(r,n,true);},e),this.cs=e;}qs(e,r,n=false,i=true){var o;let s=this.$t,a=this.u;if(!s||!a)return void(typeof r=="function"&&r());if(!n&&(this.Es(),this.Fs(0)),!this.Ds())return void((o=this.qt)===null||o===void 0||o.Ms(()=>{this.qs(e,r);}));i&&this.Is();let u=s.$s({},true);a.j(E.C.Us)!==P.ks()&&this.Bs(),u.last_full_sync_at=this.Kt,u.last_card_updated_at=this.Qt;let l=s.Ps(u,ne._s.Xs,n),c=false;s.Gs(u,(d=-1)=>{if(this.u){let h=new Date().valueOf();ne.Hs(this.u,ne._s.Xs,h);}d!==-1&&l.push(["X-Braze-Req-Tokens-Remaining",d.toString()]),is.Ks({url:`${s.Os()}/content_cards/sync`,data:u,headers:l,L:(h,p)=>{if(!s.Qs(u,h,l))return c=true,void(typeof r=="function"&&r());s.Vs(),this.zs(p,e,r),this.Ss(h),c=false,ne.Ws(this.u,ne._s.Xs,1),typeof e=="function"&&e();},error:h=>{s.Ys(h,"retrieving content cards"),c=true,typeof r=="function"&&r();},Zs:()=>{if(c&&i&&!this.us&&this.ds+1<cy){ne.ti(this.u,ne._s.Xs);let h=this.cs;(h==null||h<1e3*this.fs)&&(h=1e3*this.fs),this.Js(Math.min(3e5,os(1e3*this.fs,3*h)),e,r),this.ds=this.ds+1;}}});},ne._s.Xs,r);}As(e){e||this.Yt();let r=this.gs(this.cards);r.sort((i,o)=>i.pinned&&!o.pinned?-1:o.pinned&&!i.pinned?1:i.updated&&o.updated&&i.updated>o.updated?-1:i.updated&&o.updated&&o.updated>i.updated?1:0);let n=Math.max(this.Qt||0,this.Kt||0);return n===0&&(n=void 0),this.u&&this.u.j(E.C.Rs)===this.Qt&&n===void 0&&(n=this.Qt),new Xt(r,Qt(n))}si(e){return this.Bt.Nt(e)}Bs(){this.Kt=0,this.Qt=0,this.u&&(this.u.ii(E.C.js),this.u.ii(E.C.Rs));}changeUser(e){e||(this.cards=[],this.Bt.Rt(new Xt(this.cards.slice(),null)),this.u&&(this.u.ii(E.C.bs),this.u.ii(E.C.v),this.u.ii(E.C.H),this.u.ii(E.C.A))),this.Bs();}clearData(e){this.Kt=0,this.Qt=0,this.cards=[],this.Bt.Rt(new Xt(this.cards.slice(),null)),e&&this.u&&(this.u.ii(E.C.bs),this.u.ii(E.C.v),this.u.ii(E.C.H),this.u.ii(E.C.A),this.u.ii(E.C.js),this.u.ii(E.C.Rs));}Ds(){return !!this.qt&&(!!this.qt.ei()||(this.qt.hi()!==0&&this.ri(),false))}ri(){this.Bt.Rt(new Xt([],new Date)),this.u&&this.u.ii(E.C.bs);}},jt={t:false,provider:null,rr:()=>(jt.o(),jt.provider||(jt.provider=new gu(P.er(),P.l(),P.ir(),P.tr(),P.nr()),P.ar(jt.provider)),jt.provider),o:()=>{jt.t||(P.g(jt),jt.t=true);},destroy:()=>{jt.provider=null,jt.t=false;}},Ei=jt;function xh(t,e){if(P.X())return Ei.rr().qs(t,e)}var Xt=class extends Tr{constructor(e,r){super(e,r);}getUnviewedCardCount(){return super.getUnreadCardCount()}logCardImpressions(e){us(e,true);}logCardClick(e){return as(e,true)}sr(){xh();}dr(){return  true}};Xt.ur=6e4;function Hy(){if(P.X())return Ei.rr().As(false)}function Vy(t){return t!=null&&!!t.getAttribute("data-ab-had-top-impression")}function qy(t){t!=null&&t.setAttribute("data-ab-had-top-impression","true");}function Ky(t){return t!=null&&!!t.getAttribute("data-ab-had-bottom-impression")}function Gy(t){t!=null&&t.setAttribute("data-ab-had-bottom-impression","true");}function Oh(t){if(t!=null){let e=t.querySelectorAll(".ab-unread-indicator")[0];e!=null&&(e.className+=" read");}}function Wy(t){return t.getAttribute("data-ab-card-id")}function Yy(t,e){let r="";t.title||t.description||(r="Feed Image"),e.setAttribute("alt",r);}function Nh(t,e){let r=e.querySelectorAll(".ab-image-area"),n,i=0;r.length>0&&(i=r[0].offsetWidth);for(let o of t)if(n=o.T,n&&o.imageUrl&&typeof o.aspectRatio=="number"){let s=i/o.aspectRatio;s&&(n.style.height=`${s}px`);}}function Jy(t,e,r,n="ltr"){let i=document.createElement("div");
2i.dir=n,i.className="ab-card ab-effect-card "+t._,t.id&&(i.setAttribute("data-ab-card-id",t.id),i.setAttribute("id",t.id)),i.setAttribute("role","article"),i.setAttribute("tabindex","0");let o="",s=false;t.url&&t.url!==""&&(o=t.url,s=true);let a=p=>(Oh(i),s&&(e(t),ss(o,r,p)),false);if(t.pinned){let p=document.createElement("div");p.className="ab-pinned-indicator";let f=document.createElement("i");f.className="fa fa-star",p.appendChild(f),i.appendChild(p);}if(t.imageUrl&&t.imageUrl!==""){let p=document.createElement("div");p.dir=n,p.className="ab-image-area";let f=document.createElement("img");if(f.setAttribute("src",t.imageUrl),f.onload=()=>{i.style.height="auto";},Yy(t,f),p.appendChild(f),i.className+=" with-image",s&&!t.S){let g=document.createElement("a");g.setAttribute("href",o),g.onclick=a,g.appendChild(p),i.appendChild(g);}else i.appendChild(p);}let u=document.createElement("div");if(u.className="ab-card-body",u.dir=n,t.dismissible){t.logCardDismissal=()=>Th(t);let p=Sh("Dismiss Card",void 0,t.dismissCard.bind(t),n);i.appendChild(p),yi(u,pr.U,f=>{i.className+=" ab-swiped-left",p.onclick(f);}),yi(u,pr.V,f=>{i.className+=" ab-swiped-right",p.onclick(f);});}let l="",c=false;if(t.title&&t.title!==""&&(l=t.title,c=true),c){let p=document.createElement("h1");if(p.className="ab-title",p.id=xr.W(),i.setAttribute("aria-labelledby",p.id),s){let f=document.createElement("a");f.setAttribute("href",o),f.onclick=a,f.appendChild(document.createTextNode(l)),p.appendChild(f);}else p.appendChild(document.createTextNode(l));u.appendChild(p);}let d=document.createElement("div");if(d.className=c?"ab-description":"ab-description ab-no-title",d.id=xr.W(),i.setAttribute("aria-describedby",d.id),t.description&&d.appendChild(document.createTextNode(t.description)),s){let p=document.createElement("div");p.className="ab-url-area";let f=document.createElement("a");f.setAttribute("href",o),t.linkText&&f.appendChild(document.createTextNode(t.linkText)),f.onclick=a,p.appendChild(f),d.appendChild(p);}u.appendChild(d),i.appendChild(u);let h=document.createElement("div");return h.className="ab-unread-indicator",t.viewed&&(h.className+=" read"),i.appendChild(h),t.T=i,i}function Dh(t){P.X()&&P.removeSubscription(t);}var Mh="data-last-requested-refresh",fu={};function Rn(t){t&&(t.className=t.className.replace("ab-show","ab-hide"),setTimeout(()=>{t&&t.parentNode&&t.parentNode.removeChild(t);},Tr.Ah));let e=t.getAttribute("data-update-subscription-id");e!=null&&Dh(e);let r=t.getAttribute("data-listener-id");r!=null&&(window.removeEventListener("scroll",fu[r]),delete fu[r]);}function Uh(t,e){let r=Ot.m(),n=document.createElement("div");if(n.className="ab-feed-body",n.setAttribute("aria-label","Feed"),n.setAttribute("role","feed"),t.lastUpdated==null){let i=document.createElement("div");i.className="ab-no-cards-message";let o=document.createElement("i");o.className="fa fa-spinner fa-spin fa-4x ab-initial-spinner",i.appendChild(o),n.appendChild(i);}else {let i=false,o=s=>t.logCardClick(s);for(let s of t.cards){let a=s instanceof bn;!a||t.dr()?(n.appendChild(Jy(s,o,e,r.wo())),i=i||!a):b.error("Received a control card for a legacy news feed. Control cards are only supported with content cards.");}if(!i){let s=document.createElement("div");s.className="ab-no-cards-message",s.innerHTML=r.get("NO_CARDS_MESSAGE")||"",s.setAttribute("role","article"),n.appendChild(s);}}return n}function ls(t,e){if(t!=null&&e!=null){let r=[],n=e.querySelectorAll(".ab-card");t.yo||(t.yo={});for(let i=0;i<n.length;i++){let o=Wy(n[i]),s=Sy(n[i]),a=Cy(n[i]);if(t.yo[o]){s||a||Oh(n[i]);continue}let u=Vy(n[i]),l=Ky(n[i]),c=u,d=l;if(!u&&s&&(u=true,qy(n[i])),!l&&a&&(l=true,Gy(n[i])),u&&l){if(c&&d)continue;for(let h of t.cards)if(h.id===o){t.yo[h.id]=true,r.push(h);break}}}r.length>0&&t.logCardImpressions(r);}}function xu(t,e){if(t==null||e==null)return;e.setAttribute("aria-busy","true");let r=e.querySelectorAll(".ab-refresh-button")[0];r!=null&&(r.className+=" fa-spin");let n=new Date().valueOf().toString();e.setAttribute("data-last-requested-refresh",n),setTimeout(()=>{if(e.getAttribute("data-last-requested-refresh")===n){let i=e.querySelectorAll(".fa-spin");for(let s=0;s<i.length;s++)i[s].className=i[s].className.replace(/fa-spin/g,"");let o=e.querySelectorAll(".ab-initial-spinner")[0];if(o!=null){let s=document.createElement("span");s.innerHTML=Ot.m().get("FEED_TIMEOUT_MESSAGE")||"",o.parentNode!=null&&(o.parentNode.appendChild(s),o.parentNode.removeChild(o));}e.getAttribute("aria-busy")==="true"&&e.setAttribute("aria-busy","false");}},Tr.Co),t.sr();}function Lh(t,e,r){let n=document.createElement("div");n.className="ab-feed ab-hide ab-effect-slide",n.setAttribute("role","dialog"),n.setAttribute("aria-label","Feed"),n.setAttribute("tabindex","-1");let i=document.createElement("div");i.className="ab-feed-buttons-wrapper",i.setAttribute("role","group"),n.appendChild(i);let o=document.createElement("i");o.className="fa fa-times ab-close-button",o.setAttribute("aria-label","Close Feed"),o.setAttribute("tabindex","0"),o.setAttribute("role","button");let s=c=>{Rn(n),c.stopPropagation();};o.addEventListener("keydown",c=>{c.keyCode!==Ar.Fo&&c.keyCode!==Ar.To||s(c);}),o.onclick=s;let a=document.createElement("i");a.className="fa fa-refresh ab-refresh-button",t&&t.lastUpdated==null&&(a.className+=" fa-spin"),a.setAttribute("aria-label","Refresh Feed"),a.setAttribute("tabindex","0"),a.setAttribute("role","button");let u=c=>{xu(t,n),c.stopPropagation();};a.addEventListener("keydown",c=>{c.keyCode!==Ar.Fo&&c.keyCode!==Ar.To||u(c);}),a.onclick=u,i.appendChild(a),i.appendChild(o),n.appendChild(Uh(t,e));let l=()=>ls(t,n);if(n.addEventListener("scroll",l),!r){window.addEventListener("scroll",l);let c=xr.W();fu[c]=l,n.setAttribute("data-listener-id",c);}return n}function es(t,e,r,n,i){if(!Ze(e))return;let o=[];for(let s of e)if(s instanceof D){if(s.url&&Si.test(s.url)){let a=Cu(s.url);if(Eu(a)){b.error(Ya(wi.Vi,"Content Card"));continue}}
2o.push(s);}if(t.cards=o,t.lastUpdated=r,n!=null)if(n.setAttribute("aria-busy","false"),t.lastUpdated==null)Rn(n);else {let s=n.querySelectorAll(".ab-feed-body")[0];if(s!=null){let a=Uh(t,i);s.parentNode&&s.parentNode.replaceChild(a,s),ls(t,a.parentNode);}}}function Rh(t,e){t&&e.setAttribute("data-update-subscription-id",t);}function Fh(t){if(!P.X())return;let e=document.querySelectorAll(".ab-feed");for(let r=0;r<e.length;r++)(t==null||t!=null&&e[r].parentNode===t)&&Rn(e[r]);}function $h(t,e){if(!P.X())return;yh();let r=false;t==null&&(t=document.body,r=true);let n=P.nn(ue.tn)||P.nn(ue.en)||false,i=Ei.rr().As(false);typeof e=="function"&&es(i,e(i.cards.slice()),i.lastUpdated,null,n);let o=Lh(i,n,r),s=Ei.rr(),a=s.ps();(i.lastUpdated==null||new Date().valueOf()-i.lastUpdated.valueOf()>Xt.ur)&&(a==null||new Date().valueOf()-a>Xt.ur)&&(b.info(`Cached content cards were older than max TTL of ${Xt.ur} ms, requesting an update from the server.`),xu(i,o),s.vs(new Date().valueOf()));let u=new Date().valueOf(),l=Bh(function(h){let p=o.querySelectorAll(".ab-refresh-button")[0];if(p!=null){let g=500,v=g-=new Date().valueOf()-u,m=o.getAttribute(Mh);m&&(v=parseInt(m),isNaN(v)||(g-=new Date().valueOf()-v)),setTimeout(function(){p.className=p.className.replace(/fa-spin/g,"");},Math.max(g,0));}let f=h.cards;typeof e=="function"&&(f=e(f.slice())),es(i,f,h.lastUpdated,o,n);});Rh(l,o);let c=function(h){let p=h.querySelectorAll(".ab-feed"),f=null;for(let g=0;g<p.length;g++)p[g].parentNode===h&&(f=p[g]);f!=null?(Rn(f),f.parentNode!=null&&f.parentNode.replaceChild(o,f)):h.appendChild(o),setTimeout(function(){o.className=o.className.replace("ab-hide","ab-show");},0),r&&o.focus(),ls(i,o),Nh(i.cards,h);};var d;t!=null?c(t):window.onload=(d=window.onload,function(){typeof d=="function"&&d(new Event("oldLoad")),c(document.body);});}function Bh(t){if(!P.X())return;let e=Ei.rr(),r=e.si(t);if(!e.ws()){let n=P.cr();if(n){let i=n.mr(()=>{e.qs();});i&&e.Cs(i);}}return r}function Xy(t,e){P.X()&&(document.querySelectorAll(".ab-feed").length>0?Fh():$h(t,e));}var zh={GOOGLE_TAG_MANAGER:"gg",MPARTICLE:"mp",SEGMENT:"sg",TEALIUM:"tl",MANUAL:"manu",NPM:"npm",CDN:"wcd",SHOPIFY:"shp"};function Qy(t){if(!P.X())return;let e=P.nr();if(e){if(!Ze(t))return b.error("Cannot set SDK metadata because metadata is not an array."),false;for(let r of t)if(!gr(zh,r,"sdkMetadata contained an invalid value.","BrazeSdkMetadata"))return  false;return e.addSdkMetadata(t),true}}function jh(t,e){if(!P.X())return;if(t==null||t.length===0||t!=t)return void b.error("changeUser requires a non-empty userId.");if(jo(t)>Ne.lr)return void b.error(`Rejected user id "${t}" because it is longer than ${Ne.lr} bytes.`);if(e!=null&&!xt(e,"set signature for new user","signature"))return;let r=P.cr();r&&r.changeUser(t.toString(),P.gr(),e);}var Zy=Object.freeze({__proto__:null,changeUser:jh});function ew(){b.info("Destroying Braze instance"),P.destroy(true);}function tw(){let t=P.cr();t&&t.requestImmediateDataFlush();let e=new ot.ee(null,true),r="This-cookie-will-expire-in-"+e.ne();e.store(E.se,r);let n=we.ts.Zt;new we(n,b).setItem(n.hs.ae,n.ie,true),b.info("disableSDK was called"),P.destroy(false),P.oe(true);}function rw(){new ot.ee(null,true).remove(E.se);let t=we.ts.Zt;new we(t,b).re(t.hs.ae,t.ie),b.info("enableSDK was called"),P.destroy(false),P.oe(false);}function nw(t){if(!P.X())return;let e=P.te();if(!e)return;let r=e.ce().id;if(typeof t!="function")return r;b.warn("The callback for getDeviceId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getDeviceId()`)"),t(r);}function iw(t,e){return P.initialize(t,e)}function ow(){return !!new ot.ee(null,true).br(E.se)}function sw(){return P.so()}function Hh(t,e){if(!P.X())return  false;if(t==null||t.length<=0)return b.error(`logCustomEvent requires a non-empty eventName, got "${t}". Ignoring event.`),false;if(!Nt(t,"log custom event","the event name"))return  false;let[r,n]=ns(e,sy,"eventProperties",`log custom event "${t}"`,"event");if(!r)return  false;let i=P.ir();if(i&&i.me(t))return b.info(`Custom Event "${t}" is blocklisted, ignoring.`),false;let o=Qe.q(le.CustomEvent,{n:t,p:n});if(o.L){b.info(`Logged custom event "${t}".`);for(let s of o.ge)qe.rr().fe(Je.ue,[t,e],s);}return o.L}var Vh=Object.freeze({__proto__:null,logCustomEvent:Hh});function qh(t,e,r,n,i){if(!P.X())return  false;if(r==null&&(r="USD"),n==null&&(n=1),t==null||t.length<=0)return b.error(`logPurchase requires a non-empty productId, got "${t}", ignoring.`),false;if(!Nt(t,"log purchase","the purchase name"))return  false;if(e==null||isNaN(parseFloat(e.toString())))return b.error(`logPurchase requires a numeric price, got ${e}, ignoring.`),false;let o=parseFloat(e.toString()).toFixed(2);if(n==null||isNaN(parseInt(n.toString())))return b.error(`logPurchase requires an integer quantity, got ${n}, ignoring.`),false;let s=parseInt(n.toString());if(s<1||s>rh)return b.error(`logPurchase requires a quantity >1 and <${rh}, got ${s}, ignoring.`),false;if(r=r!=null?r.toUpperCase():r,["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTC","BTN","BWP","BYR","BZD","CAD","CDF","CHF","CLF","CLP","CNY","COP","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EEK","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GGP","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","IMP","INR","IQD","IRR","ISK","JEP","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LTL","LVL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRO","MTL","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLL","SOS","SRD","STD","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VEF","VND","VUV","WST","XAF","XAG","XAU","XCD","XDR","XOF","XPD","XPF","XPT","YER","ZAR","ZMK","ZMW","ZWL"].indexOf(r)===-1)return b.error(`logPurchase requires a valid currencyCode, got ${r}, ignoring.`),false;let[a,u]=ns(i,"logPurchase","purchaseProperties",`log purchase "${t}"`,"purchase");if(!a)return  false;let l=P.ir();if(l&&l.Dr(t))return b.info(`Purchase "${t}" is blocklisted, ignoring.`),false;let c=Qe.q(le.Pr,{pid:t,c:r,p:o,q:s,pr:u});if(c.L){b.info(`Logged ${s} purchase${s>1?"s":""} of "${t}" for ${r} ${o}.`);for(let d of c.ge)qe.rr().fe(Je.Rr,[t,i],d);}return c.L}var aw=Object.freeze({__proto__:null,logPurchase:qh});function uw(){if(!P.X())return;let t=P.cr();if(!t)return;t.openSession();let e=we.ts.Zt,r=new we(e,b);r.jr(e.hs.hr,(n,i)=>{let o=i.lastClick,s=i.trackingString;b.info(`Firing push click trigger from ${s} push click at ${o}`);let a=t.kr(o,s),u=function(){qe.rr().fe(Je.vr,[s],a);};t.$r(u,u),r.re(e.hs.hr,n);}),r.ss(e.hs.wr,function(n){t.yr(n);});}function lw(){P.X()&&P.removeAllSubscriptions();}function Kh(t){if(!P.X())return;let e=P.cr();e&&e.requestImmediateDataFlush(t);}var cw=Object.freeze({__proto__:null,requestImmediateDataFlush:Kh});function dw(t){b.setLogger(t);}function hw(t){if(!P.X()||t===""||!xt(t,"set signature","signature",false))return  false;let e=P.Sr();return !!e&&(e.setSdkAuthenticationSignature(t),true)}function pw(t){var e;if(P.X())return (e=P.Sr())===null||e===void 0?void 0:e.subscribeToSdkAuthenticationFailures(t)}function gw(){b.toggleLogging();}function fw(){let t=P.l();if(t==null)return void b.warn(Wt);t.clearData();let e=Dt(we.ts);for(let r=0;r<e.length;r++){let n=e[r],i=we.ts[n];new we(i,b).clearData();}if(P.X())for(let r of P.gr())r.clearData(true);}var mu=class extends _n{constructor(e,r){super(),this.u=e,this.Ui=r,this.cards=[],this.ki=null,this.u=e,this.Ui=r,this.Bt=new Ke,P.Ht(this.Bt),this.Yt();}Yt(){let e=[];this.u&&(e=this.u.j(E.C.Ai)||[]);let r=[];for(let n=0;n<e.length;n++){let i=kh(e[n]);i!=null&&r.push(i);}this.cards=r,this.u&&(this.ki=fn(this.u.j(E.C.Bi)));}Ei(e){let r=[],n=null,i={};this.u&&(i=this.u.j(E.C.J)||{});let o={};for(let s=0;s<e.length;s++){n=e[s];let a=jy(n);if(a!=null){let u=a.id;u&&i[u]&&(a.viewed=true,o[u]=true),r.push(a);}}this.cards=r,this.Ts(),this.ki=new Date,this.u&&(this.u.I(E.C.J,o),this.u.I(E.C.Bi,this.ki));}Ts(){var e;let r=[];for(let n=0;n<this.cards.length;n++)r.push(this.cards[n].Y());(e=this.u)===null||e===void 0||e.I(E.C.Ai,r);}Ss(e){e!=null&&e.feed&&(this.Yt(),this.Ei(e.feed),this.Bt.Rt(new kr(this.cards.slice(),this.ki)));}Gi(){this.Yt();let e=[],r=new Date;for(let n=0;n<this.cards.length;n++){let i=this.cards[n].expiresAt,o=true;i!=null&&(o=i>=r),o&&e.push(this.cards[n]);}return new kr(e,this.ki)}qs(){this.Ui&&this.Ui.requestFeedRefresh();}si(e){return this.Bt.Nt(e)}clearData(e){e==null&&(e=false),this.cards=[],this.ki=null,e&&this.u&&(this.u.ii(E.C.Ai),this.u.ii(E.C.Bi)),this.Bt.Rt(new kr(this.cards.slice(),this.ki));}},Ht={t:false,provider:null,rr:()=>(Ht.o(),Ht.provider||(Ht.provider=new mu(P.l(),P.cr()),P.ar(Ht.provider)),Ht.provider),o:()=>{Ht.t||(P.g(Ht),Ht.t=true);},destroy:()=>{Ht.provider=null,Ht.t=false;}},cs=Ht;function Gh(){if(P.X())return cs.rr().qs()}var kr=class extends Tr{constructor(e,r){super(e,r);}logCardImpressions(e){us(e,false);}logCardClick(e){return as(e,false)}sr(){Gh();}dr(){return  false}};function mw(){if(P.X())return cs.rr().Gi()}function Wh(){if(!P.X())return;let t=document.querySelectorAll(".ab-feed");for(let e=0;e<t.length;e++)Rn(t[e]);}function Yh(){var t;
2if(P.X())return (t=P.nr())===null||t===void 0?void 0:t.qr(ey.Ar).L}function Ou(t,e,r){if(!P.X())return;yh();let n=(d,h)=>{if(h==null)return d;let p=[];for(let g=0;g<h.length;g++)p.push(h[g].toLowerCase());let f=[];for(let g=0;g<d.length;g++){let v=[],m=d[g].categories||[];for(let y=0;y<m.length;y++)v.push(m[y].toLowerCase());ry(v,p).length>0&&f.push(d[g]);}return f},i=P.nn(ue.tn)||P.nn(ue.en)||false,o=false;t==null&&(t=document.body,o=true);let s,a=false;e==null?(s=cs.rr().Gi(),es(s,n(s.cards,r),s.lastUpdated,null,i),a=true):s=new kr(n(e,r),new Date);let u=Lh(s,i,o);if(a){(s.lastUpdated==null||new Date().valueOf()-s.lastUpdated.valueOf()>kr.ur)&&(b.info(`Cached feed was older than max TTL of ${kr.ur} ms, requesting an update from the server.`),xu(s,u));let d=new Date().valueOf(),h=Jh(function(p){let f=u.querySelectorAll(".ab-refresh-button")[0];if(f!=null){let g=500;g-=new Date().valueOf()-d;let v=u.getAttribute(Mh);if(v){let m=parseInt(v);isNaN(m)||(g-=new Date().valueOf()-m);}setTimeout(function(){f.className=f.className.replace(/fa-spin/g,"");},Math.max(g,0));}es(s,n(p.cards,r),p.lastUpdated,u,i);});Rh(h,u);}let l=d=>{let h=d.querySelectorAll(".ab-feed"),p=null;for(let f=0;f<h.length;f++)h[f].parentNode===d&&(p=h[f]);p!=null?(Rn(p),p.parentNode&&p.parentNode.replaceChild(u,p)):d.appendChild(u),setTimeout(function(){u.className=u.className.replace("ab-hide","ab-show");},0),o&&u.focus(),Yh(),ls(s,u),s&&Nh(s.cards,d);};var c;t!=null?l(t):window.onload=(c=window.onload,function(){typeof c=="function"&&c(new Event("oldLoad")),l(document.body);});}var vw=Object.freeze({__proto__:null,showFeed:Ou});function Jh(t){if(P.X())return cs.rr().si(t)}function bw(t,e,r){P.X()&&(document.querySelectorAll(".ab-feed").length>0?Wh():Ou(t,e,r));}function _w(){if(P.X())return bt.isPushBlocked()}function yw(){if(P.X())return bt.isPushPermissionGranted()}function ww(){if(P.X())return bt.isPushSupported()}var ts=class t{constructor(e,r,n,i,o,s,a,u,l,c,d){this.sn=e,this.rn=r,this.on=n,this.un=o,this.an=s,this.hn=a,this.qt=u,this.cn=l,this.fn=c,this.u=d,this.sn=e,this.rn=r,this.on=n,this.ln=i+"/safari/"+r,this.un=o||"/service-worker.js",this.hn=a,this.qt=u,this.cn=l||false,this.fn=c||false,this.u=d,this.dn=bt.pn(),this.bn=bt.yn();}mn(){return this.fn}gn(e,r,n,i,o){e.unsubscribe().then(s=>{s?this.vn(r,n,i,o):(b.error("Failed to unsubscribe device from push."),typeof o=="function"&&o(false));}).catch(s=>{b.error("Push unsubscription error: "+s),typeof o=="function"&&o(false);});}wn(e,r,n){var i;let o=(c=>{if(typeof c=="string")return c;if(c.endpoint.indexOf("https://android.googleapis.com/gcm/send")!==0)return c.endpoint;let d=c.endpoint,h=c;return h.kn&&c.endpoint.indexOf(h.kn)===-1&&(d=c.endpoint+"/"+h.kn),d})(e),s=null,a=null,u=e;if(u.getKey!=null)try{let c=Array.from(new Uint8Array(u.getKey("p256dh"))),d=Array.from(new Uint8Array(u.getKey("auth")));s=btoa(String.fromCharCode.apply(null,c)),a=btoa(String.fromCharCode.apply(null,d));}catch(c){b.error(Jt(c));}let l=(c=>{let d;return c.options&&(d=c.options.applicationServerKey)&&d.byteLength&&d.byteLength>0?btoa(String.fromCharCode.apply(null,Array.from(new Uint8Array(d)))).replace(/\+/g,"-").replace(/\//g,"_"):null})(u);(i=this.sn)===null||i===void 0||i.Pn(o,r,s,a,l),o&&typeof n=="function"&&n(o,s,a);}Dn(){var e;(e=this.sn)===null||e===void 0||e.Sn(true);}An(e,r){var n;(n=this.sn)===null||n===void 0||n.Sn(false),b.info(e),typeof r=="function"&&r(false);}jn(e,r,n,i){var o;if(r.permission==="default")try{window.safari.pushNotification.requestPermission(this.ln,e,{api_key:this.rn,device_id:((o=this.on)===null||o===void 0?void 0:o.ce().id)||""},s=>{s.permission==="granted"&&this.sn&&this.sn.setPushNotificationSubscriptionType(Ne.NotificationSubscriptionTypes.OPTED_IN),this.jn(e,s,n,i);});}catch(s){this.An("Could not request permission for push: "+s,i);}else r.permission==="denied"?this.An("The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",i):r.permission==="granted"&&(b.info("Device successfully subscribed to push."),this.wn(r.deviceToken,new Date,n));}requestPermission(e,r,n){let i=s=>{switch(s){case "granted":return void(typeof e=="function"&&e());case "default":return void(typeof r=="function"&&r());case "denied":return void(typeof n=="function"&&n());default:b.error("Received unexpected permission result "+s);}},o=false;if(window.Notification.permission!=="default")i(Notification.permission);else {let s=window.Notification.requestPermission(a=>{o&&i(a);});s?s.then(a=>{i(a);}):o=true;}}vn(e,r,n,i){let o={userVisibleOnly:true};r!=null&&(o.applicationServerKey=r),e.pushManager.subscribe(o).then(s=>{b.info("Device successfully subscribed to push."),this.wn(s,new Date,n);}).catch(s=>{bt.isPushBlocked()?(b.info("Permission for push notifications was denied."),typeof i=="function"&&i(false)):(b.error("Push subscription failed: "+s),typeof i=="function"&&i(true));});}xn(){if(this.cn)return navigator.serviceWorker.getRegistration(this.un);let e=this.an?{scope:this.an}:void 0;return navigator.serviceWorker.register(this.un,e).then(()=>navigator.serviceWorker.ready.then(r=>
2(r&&typeof r.update=="function"&&r.update().catch(n=>{b.info("ServiceWorker update failed: "+n);}),r)))}Nn(e){this.cn||(e.unregister(),b.info("Service worker successfully unregistered."));}subscribe(e,r){if(!bt.isPushSupported())return b.info(t.Un),void(typeof r=="function"&&r(false));if(this.dn){if(!this.cn&&window.location!=null){let a=this.un;a.indexOf(window.location.host)===-1&&(a=window.location.host+a),a.indexOf(window.location.protocol)===-1&&(a=window.location.protocol+"//"+a);}if(bt.isPushBlocked())return void this.An("Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",r);if(this.qt&&!this.qt.Wn()&&this.qt.hi()===0)return b.info("Waiting for VAPID key from server config before subscribing to push."),void this.qt._n(()=>{this.subscribe(e,r);});let n=()=>{b.info("Permission for push notifications was denied."),typeof r=="function"&&r(false);},i=()=>{let a="Permission for push notifications was ignored.";bt.isPushBlocked()&&(a+=" The browser has automatically blocked further permission requests for a period (probably 1 week)."),b.info(a),typeof r=="function"&&r(true);},o=bt.isPushPermissionGranted(),s=()=>{!o&&this.sn&&this.sn.setPushNotificationSubscriptionType(Ne.NotificationSubscriptionTypes.OPTED_IN),this.xn().then(a=>{if(a==null)return b.error("No service worker registration. Set the `manageServiceWorkerExternally` initialization option to false or ensure that your service worker is registered before calling registerPush."),void(typeof r=="function"&&r(true));a.pushManager.getSubscription().then(u=>{var l;let c=null;if(((l=this.qt)===null||l===void 0?void 0:l.Wn())!=null&&(c=Z_.Tn(this.qt.Wn())),u){let d,h=null,p=null;if(this.u&&(d=this.u.j(E.C.In)),d&&!Ze(d)){let f;try{f=Zo.qn(d).Vn;}catch(g){f=null;}f==null||isNaN(f.getTime())||f.getTime()===0||(h=f,p=new Date(h),p.setMonth(h.getMonth()+6));}c!=null&&u.options&&u.options.applicationServerKey&&u.options.applicationServerKey.byteLength&&u.options.applicationServerKey.byteLength>0&&!vn(c,new Uint8Array(u.options.applicationServerKey))?(u.options.applicationServerKey.byteLength>12?b.info("Device was already subscribed to push using a different VAPID provider, creating new subscription."):b.info("Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription."),this.gn(u,a,c,e,r)):u.expirationTime&&new Date(u.expirationTime).valueOf()<=new Date().valueOf()?(b.info("Push subscription is expired, creating new subscription."),this.gn(u,a,c,e,r)):d&&Ze(d)?this.gn(u,a,c,e,r):p==null?(b.info("No push subscription creation date found, creating new subscription."),this.gn(u,a,c,e,r)):p.valueOf()<=new Date().valueOf()?(b.info("Push subscription older than 6 months, creating new subscription."),this.gn(u,a,c,e,r)):(b.info("Device already subscribed to push, sending existing subscription to backend."),this.wn(u,h,e));}else this.vn(a,c,e,r);}).catch(u=>{b.error("Error checking current push subscriptions: "+u);});}).catch(a=>{b.error("ServiceWorker registration failed: "+a);});};this.requestPermission(s,i,n);}else if(this.bn){if(this.hn==null||this.hn==="")return b.error("You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari"),void(typeof r=="function"&&r(true));let n=window.safari.pushNotification.permission(this.hn);this.jn(this.hn,n,e,r);}}unsubscribe(e,r){if(!bt.isPushSupported())return b.info(t.Un),void(typeof r=="function"&&r());this.dn?navigator.serviceWorker.getRegistration(this.un).then(n=>{n?n.pushManager.getSubscription().then(i=>{i?(this.Dn(),i.unsubscribe().then(o=>{o?(b.info("Device successfully unsubscribed from push."),typeof e=="function"&&e()):(b.error("Failed to unsubscribe device from push."),typeof r=="function"&&r()),this.Nn(n);}).catch(o=>{b.error("Push unsubscription error: "+o),typeof r=="function"&&r();})):(b.info("Device already unsubscribed from push."),typeof e=="function"&&e());}).catch(i=>{b.error("Error unsubscribing from push: "+i),typeof r=="function"&&r();}):(b.info("Device already unsubscribed from push."),typeof e=="function"&&e());}):this.bn&&(this.Dn(),b.info("Device unsubscribed from push."),typeof e=="function"&&e());}};ts.Un="Push notifications are not supported in this browser.";var ur={t:false,i:null,m:()=>(ur.o(),ur.i||(ur.i=new ts(P.pr(),P.ba(),P.te(),P.Os(),P.nn(ue.Ma),P.nn(ue._a),P.nn(ue.ka),P.ir(),P.nn(ue.qa),P.nn(ue.Aa),P.l())),ur.i),o:()=>{ur.t||(P.g(ur),ur.t=true);},destroy:()=>{ur.i=null,ur.t=false;}},Nu=ur,Sw=Object.freeze({__proto__:null,default:Nu});function Xh(t,e){if(P.X())return Nu.m().subscribe((r,n,i)=>{let o=P.cr();o&&o.requestImmediateDataFlush(),typeof t=="function"&&t(r,n,i);},e)}var Qh=Object.freeze({__proto__:null,requestPushPermission:Xh});function Zh(t,e){if(P.X())return Nu.m().unsubscribe(t,e)}var Cw=Object.freeze({__proto__:null,unregisterPush:Zh}),Xe=class t{constructor(e,r=false,n={},i){this.id=e,this.enabled=r,this.properties=n,this.trackingString=i,this.id=e,this.enabled=r,this.properties=n,this.trackingString=i;}he(e,r,n){let i=this.properties[e];return i==null?(this.ye(e),null):r(i)?i.value:(this.Pe(n),null)}getStringProperty(e){return this.he(e,this.be,"string")}getNumberProperty(e){return this.he(e,this.Ie,"number")}getBooleanProperty(e){return this.he(e,this.de,"boolean")}getImageProperty(e){return this.he(e,this.Te,"image")}getJsonProperty(e){return this.he(e,this.Ee,"jsonobject")}getTimestampProperty(e){return this.he(e,this.Ne,"datetime")}Y(){let e={};return e[t.tt.ht]=this.id,e[t.tt.le]=this.enabled,e[t.tt.pe]=this.properties,e[t.tt.Fe]=this.trackingString,e}Pe(e){b.info(`Property is not of type ${e}.`);}ye(e){b.info(`${e} not found in feature flag properties.`);}be(e){return e.type==="string"&&typeof e.value=="string"}Ie(e){return e.type==="number"&&typeof e.value=="number"}de(e){return e.type==="boolean"&&typeof e.value=="boolean"}Te(e){return e.type==="image"&&typeof e.value=="string"}Ee(e){return e.type==="jsonobject"&&typeof e.value=="object"&&e.value.constructor==Object}Ne(e){return e.type==="datetime"&&typeof e.value=="number"}};Xe.tt={ht:"id",le:"e",pe:"pr",Fe:"fts"},Xe._t={ht:"id",le:"enabled",pe:"properties",Fe:"fts"};function Ew(t){if(t[Xe._t.ht]&&typeof t[Xe._t.le]=="boolean")return new Xe(t[Xe._t.ht],t[Xe._t.le],t[Xe._t.pe],t[Xe._t.Fe]);b.info(`Unable to create feature flag from ${JSON.stringify(t,null,2)}`);}function Pw(t){if(t[Xe.tt.ht]&&typeof t[Xe.tt.le]=="boolean")return new Xe(t[Xe.tt.ht],t[Xe.tt.le],t[Xe.tt.pe],t[Xe.tt.Fe]);
2b.info(`Unable to deserialize feature flag from ${JSON.stringify(t,null,2)}`);}var vu=class extends _n{constructor(e,r,n,i){super(),this.qt=e,this.$t=r,this.u=n,this.oi=i,this.ai=[],this.ni=0,this.qt=e,this.$t=r,this.u=n,this.oi=i,this.li=null,this.ui=new Ke,this.fi=10,this.ci=null,this.di=null,P.Ht(this.ui);}Ss(e){var r;if(!((r=this.qt)===null||r===void 0)&&r.mi()&&e!=null&&e.feature_flags){this.ai=[];for(let n of e.feature_flags){let i=Ew(n);i&&this.ai.push(i);}this.ni=new Date().getTime(),this.gi(),this.ui.Rt(this.ai);}}Fi(){let e={};this.u&&(e=this.u.j(E.C.vi));let r={};for(let n in e){let i=Pw(e[n]);i&&(r[i.id]=i);}return r}pi(){var e;return ((e=this.u)===null||e===void 0?void 0:e.j(E.C.wi))||{}}ji(e){this.u&&this.u.I(E.C.wi,e);}si(e){return this.ui.Nt(e)}refreshFeatureFlags(e,r,n=false,i=true){let o=()=>{typeof r=="function"&&r(),this.ui.Rt(this.ai);};if(!this.yi(n))return !this.li&&this.qt&&(this.li=this.qt.bi(()=>{this.refreshFeatureFlags(e,r);})),void o();let s=this.$t;if(!s)return void o();i&&this.Ci();let a=s.$s({},true),u=s.Ps(a,ne._s.Ri),l=false;s.Gs(a,(c=-1)=>{if(!this.$t)return void o();let d=new Date().valueOf();ne.Hs(this.u,ne._s.Ri,d),c!==-1&&u.push(["X-Braze-Req-Tokens-Remaining",c.toString()]),is.Ks({url:`${this.$t.Os()}/feature_flags/sync`,headers:u,data:a,L:h=>{if(!this.$t.Qs(a,h,u))return l=true,void o();this.$t.Vs(),this.Ss(h),l=false,ne.Ws(this.u,ne._s.Ri,1),typeof e=="function"&&e();},error:h=>{this.$t.Ys(h,"retrieving feature flags"),l=true,o();},Zs:()=>{if(i&&l&&!this.di){ne.ti(this.u,ne._s.Ri);let h=this.ci;(h==null||h<1e3*this.fi)&&(h=1e3*this.fi),this.Ti(Math.min(3e5,os(1e3*this.fi,3*h)),e,r,n);}}});},ne._s.Ri,r);}Ci(){this.di!=null&&(clearTimeout(this.di),this.di=null);}Ti(e=1e3*this.fi,r,n,i=false){this.Ci(),this.di=window.setTimeout(()=>{this.refreshFeatureFlags(r,n,i);},e),this.ci=e;}yi(e){if(!this.qt)return  false;if(!e){let r=this.qt.Di();if(r==null)return  false;let n=false;if(!isNaN(r)){if(r===-1)return b.info("Feature flag refreshes not allowed"),false;n=new Date().getTime()>=(this.ni||0)+1e3*r;}if(!n)return b.info(`Feature flag refreshes were rate limited to ${r} seconds`),false}return this.qt.mi()}Ii(){var e;return ((e=this.u)===null||e===void 0?void 0:e.j(E.C.Si))||null}qi(){var e,r;(e=this.u)===null||e===void 0||e.I(E.C.Si,(r=this.oi)===null||r===void 0?void 0:r.xi());}Ni(){var e;let r=(e=this.oi)===null||e===void 0?void 0:e.xi(),n=this.Ii();return n==null||r===n}gi(){if(!this.u)return;let e={};for(let r of this.ai){let n=r.Y();e[r.id]=n;}this.u.I(E.C.vi,e),this.u.I(E.C.zi,this.ni),this.qi();}},Vt={t:false,provider:null,rr:()=>(Vt.o(),Vt.provider||(Vt.provider=new vu(P.ir(),P.nr(),P.l(),P.zr()),P.ar(Vt.provider)),Vt.provider),o:()=>{Vt.t||(P.g(Vt),Vt.t=true);},destroy:()=>{Vt.provider=null,Vt.t=false;}},mn=Vt;function ep(t,e,r=false){if(P.X())return mn.rr().refreshFeatureFlags(t,e,r)}function tp(t,e){ep(t,e);}var ah=Object.freeze({__proto__:null,refreshFeatureFlags:tp,default:ep});function Iw(t){if(!P.X())return;let e=P.ir();if(e&&!e.mi())return b.info("Feature flags are not enabled."),null;let r=mn.rr().Fi();return r[t]?r[t]:null}function rp(){if(!P.X())return;let t=[],e=P.ir();if(e&&!e.mi())return b.info("Feature flags are not enabled."),t;let r=mn.rr().Fi();for(let n in r)t.push(r[n]);return t}function Aw(t){if(!P.X())return;let e=mn.rr();if(e.Ni()){let r=rp();r&&typeof t=="function"&&t(r);}return e.si(t)}function Tw(t){if(!P.X())return;if(!t)return  false;let e="Not logging a feature flag impression. The feature flag was not part of any matching experiment.",r=mn.rr().Fi();if(!r[t])return b.info(e),false;let n=r[t].trackingString;if(!n)return b.info(e),false;let i=mn.rr().pi();if(i[n])return b.info("Not logging another feature flag impression. This ID was already logged this session."),false;i[n]=true,mn.rr().ji(i);let o={fid:t,fts:n};return Qe.q(le.Fr,o).L}var kw=Object.freeze({__proto__:null,WindowUtils:yn,logCardClick:as,logCardDismissal:Th,logCardImpressions:us,logContentCardImpressions:By,logContentCardClick:zy,Card:D,ImageOnly:$o,CaptionedImage:Bo,ClassicCard:zo,ControlCard:bn,ContentCards:Xt,getCachedContentCards:Hy,hideContentCards:Fh,requestContentCardsRefresh:xh,showContentCards:$h,subscribeToContentCardsUpdates:Bh,toggleContentCards:Xy,addSdkMetadata:Qy,changeUser:jh,destroy:ew,BrazeSdkMetadata:zh,DeviceProperties:lr,disableSDK:tw,enableSDK:rw,getDeviceId:nw,getUser:Au,initialize:iw,isDisabled:ow,isInitialized:sw,logCustomEvent:Hh,logPurchase:qh,openSession:u
2w,removeAllSubscriptions:lw,removeSubscription:Dh,requestImmediateDataFlush:Kh,setLogger:dw,setSdkAuthenticationSignature:hw,subscribeToSdkAuthenticationFailures:pw,toggleLogging:gw,wipeData:fw,handleBrazeAction:Ny,Feed:kr,getCachedFeed:mw,destroyFeed:Wh,logFeedDisplayed:Yh,requestFeedRefresh:Gh,showFeed:Ou,subscribeToFeedUpdates:Jh,toggleFeed:bw,InAppMessage:C,InAppMessageButton:Vr,ControlMessage:mr,FullScreenMessage:vr,HtmlMessage:Ut,ModalMessage:Or,SlideUpMessage:br,automaticallyShowInAppMessages:Ly,logInAppMessageButtonClick:Ph,logInAppMessageClick:Ch,logInAppMessageHtmlClick:Qo,logInAppMessageImpression:Xo,showInAppMessage:Ih,subscribeToInAppMessage:Ah,deferInAppMessage:Ry,getDeferredInAppMessage:Fy,isPushBlocked:_w,isPushPermissionGranted:yw,isPushSupported:ww,requestPushPermission:Xh,unregisterPush:Zh,User:Ne,FeatureFlag:Xe,refreshFeatureFlags:tp,getFeatureFlag:Iw,subscribeToFeatureFlagsUpdates:Aw,getAllFeatureFlags:rp,logFeatureFlagImpression:Tw}),xw=Q_(kw);window.braze=xw;var Kt="Appboy",Du="v4",bu=28,Ow="4.2.2",qa={PageView:3,PageEvent:4,Commerce:16},at=mParticle.CommerceEventType,uh={"01":"sdk.iad-01.braze.com","02":"sdk.iad-02.braze.com","03":"sdk.iad-03.braze.com","04":"sdk.iad-04.braze.com","05":"sdk.iad-05.braze.com","06":"sdk.iad-06.braze.com","08":"sdk.iad-08.braze.com",EU:"sdk.fra-01.braze.eu",EU02:"sdk.fra-02.braze.eu"},_u=function(){var t=this,e,r={},n,i,o,s;t.name=Kt,t.suffix=Du;var a={$LastName:"setLastName",$FirstName:"setFirstName",Email:"setEmail",$Gender:"setGender",$Country:"setCountry",$City:"setHomeCity",$Mobile:"setPhoneNumber",$Age:"setDateOfBirth",last_name:"setLastName",first_name:"setFirstName",email:"setEmail",gender:"setGender",country:"setCountry",home_city:"setHomeCity",email_subscribe:"setEmailNotificationSubscriptionType",push_subscribe:"setPushNotificationSubscriptionType",phone:"setPhoneNumber",dob:"setDateOfBirth"},u=false,l=false,c=["$google_ad_user_data","$google_ad_personalization"],d;function h(A){var O=false;return u?O=p(A):O=f(A),O===true}function p(A){var O=1,$=Ka(A.EventAttributes,{products:[]}),Q=g(A.EventCategory);if(!A.ProductAction)return  false;A.ProductAction.TransactionId&&($["Transaction Id"]=A.ProductAction.TransactionId),A.ProductAction.ProductList&&A.ProductAction.ProductList.length&&($.products=X(A.ProductAction.ProductList)),tt("braze.logPurchase",Q,A.ProductAction.TotalAmount,A.CurrencyCode,O,$);var fe=braze.logPurchase(Q,A.ProductAction.TotalAmount,A.CurrencyCode,O,$);return fe===true}function f(A){var O=false;return A.ProductAction.ProductList&&A.ProductAction.ProductList.forEach(function($){var Q;l?Q=$.Sku:Q=$.Name;var fe=Fe(Q);$.Attributes==null&&($.Attributes={}),$.Attributes.Sku=$.Sku;var Ye=Ka($.Attributes,{"Transaction Id":A.ProductAction.TransactionId}),$t=Ie(Ye);if($t==null)return "Properties did not pass validation for "+fe;var An=parseFloat($.Price);tt("braze.logPurchase",fe,An,A.CurrencyCode,$.Quantity,$t),O=braze.logPurchase(fe,An,A.CurrencyCode,$.Quantity,$t);}),O===true}function g(A){let O="eCommerce",$;switch(A){case at.ProductAddToCart:$="add_to_cart";break;case at.ProductRemoveFromCart:$="remove_from_cart";break;case at.ProductCheckout:$="checkout";break;case at.ProductCheckoutOption:$="checkout_option";break;case at.ProductClick:$="click";break;case at.ProductViewDetail:$="view_detail";break;case at.ProductPurchase:$="purchase";break;case at.ProductRefund:$="refund";break;case at.ProductAddToWishlist:$="add_to_wishlist";break;case at.ProductRemoveFromWishlist:$="remove_from_wishlist";break;case at.PromotionView:$="view";break;case at.PromotionClick:$="click";break;case at.ProductImpression:$="Impression";break;default:$="unknown";break}return [O,$].join(" - ")}function v(A){var O,$,Q,fe=A.EventAttributes||{};fe.hostname=window.location.hostname,fe.title=window.document.title,e.setEventNameForPageView==="True"?Q=A.EventName:Q=window.location.pathname,O=Fe(Q),$=Ie(fe),tt("braze.logCustomEvent",O,$);var Ye=braze.logCustomEvent(O,$);return Ye===true}function m(A,O){if(A==="dob")if(O instanceof Date)tt("braze.getUser().setDateOfBirth",O.getFullYear(),O.getMonth()+1,O.getDate()),braze.getUser().setDateOfBirth(O.getFullYear(),O.getMonth()+1,O.getDate());else return "Can't call removeUserAttribute or setUserAttribute on forwarder "+Kt+", removeUserAttribute or setUserAttribute must set 'dob' to a date";else if(A==="$Age")if(typeof O=="number"){var $=new Date().getFullYear()-O;tt("braze.getUser().setDateOfBirth",$,1,1),braze.getUser().setDateOfBirth($,1,1);}else return "$Age must be a number";else {if(O==null&&(O=""),typeof O!="string")return "Can't call removeUserAttribute or setUserAttribute on forwarder "+Kt+", removeUserAttribute or setUserAttribute must set this value to a string";var Q=[];Q.push(O),tt("braze.getUser()."+a[A],Q);var fe=braze.getUser();if(!fe[a[A]].apply(fe,Q))return "removeUserAttribute or setUserAttribute on forwarder "+Kt+" failed to call, an invali
2d attribute value was passed in"}}function y(A){var O=Fe(A.EventName),$=Ie(A.EventAttributes);if($==null)return "Properties did not pass validation for "+O;tt("braze.logCustomEvent",O,$);var Q=braze.logCustomEvent(O,$);return Q===true}function T(A){var O=false;if(R(A),A.EventDataType==qa.Commerce)O=k(A);else if(A.EventDataType==qa.PageEvent)O=y(A);else if(A.EventDataType==qa.PageView)e.forwardScreenViews=="True"&&(O=v(A));else return "Can't send event type to forwarder "+Kt+", event type is not supported";O===true&&n&&n(t,A);}function k(A){var O=false;return A.EventCategory===at.ProductPurchase?(O=h(A),O===true):(O=N(A),O===true)}function N(A){return u?_(A):G(A)}function _(A){let O={},$=g(A.EventCategory);try{switch(A.EventCategory){case at.PromotionClick:case at.PromotionView:O.promotions=S(A.PromotionAction);break;case at.ProductImpression:O.impressions=M(A.ProductImpressions);break;default:A.ProductAction.ProductList&&(O.products=X(A.ProductAction.ProductList));var Q=A.ProductAction.TransactionId,fe=A.ProductAction.TotalAmount,Ye=A.ProductAction.TaxAmount,$t=A.ProductAction.ShippingAmount,An=A.ProductAction.Affiliation;Q&&(O["Transaction Id"]=Q),fe&&(O["Total Amount"]=fe),Ye&&(O["Tax Amount"]=Ye),$t&&(O["Shipping Amount"]=$t),An&&(O.Affiliation=An);}var Ws=Ie(A.EventAttributes);let Tn={EventName:$,EventAttributes:Ka(O,Ws)};var ei=y(Tn);return ei}catch(Tn){return "Error logging commerce event"+Tn.message}}function S(A){return A&&A.PromotionList?A.PromotionList:[]}function M(A){return A.length?A.map(function(O){return {"Product Impression List":O.ProductImpressionList,products:X(O.ProductList)}}):[]}function X(A){let O=[];return !A||A.length===0||A.forEach(function($){{var Q=J(Ie($));O.push(Q);}}),O}function J(A){var O={};for(var $ in A)switch($){case "Sku":O.Id=A[$];break;case "Name":O.Name=l?A.Sku:A.Name;break;case "CouponCode":O["Coupon Code"]=A[$];break;case "TotalAmount":O["Total Product Amount"]=A[$];break;default:O[$]=A[$];}return O}function G(A){var O=false,$=mParticle.eCommerce.expandCommerceEvent(A);if($!==null){for(var Q=0;Q<$.length;Q++){var fe=false;try{O=y($[Q]),O===!0&&(fe=!0);}catch(Ye){return "Error logging page event"+Ye.message}}O=fe===true;}return O}function V(A){if(A in a)return m(A,null);var O=Fe(A);tt("braze.getUser().setCustomUserAttribute",O,null),braze.getUser().setCustomUserAttribute(O,null);}function re(A,O){if(A in a)return m(A,O);var $=Fe(A),Q=Fe(O);if(O!=null&&Q==null)return "Value did not pass validation for "+A;tt("braze.getUser().setCustomUserAttribute",$,Q),braze.getUser().setCustomUserAttribute($,Q);}function ie(A,O){if(window.mParticle.getVersion().split(".")[0]==="1")if(O==window.mParticle.IdentityType.CustomerId)tt("braze.changeUser",A),braze.changeUser(A);else if(O==window.mParticle.IdentityType.Email)tt("braze.getUser().setEmail",A),braze.getUser().setEmail(A);else return "Can't call setUserIdentity on forwarder "+Kt+", identity type not supported."}function he(A){tt("calling MpBrazeKit.onUserIdentified");try{var O,$=A.getUserIdentities().userIdentities;e.userIdentificationType==="MPID"?O=A.getMPID():O=$[e.userIdentificationType.toLowerCase()],O&&(tt("braze.changeUser",O),braze.changeUser(O)),$.email&&(tt("braze.getUser().setEmail",$.email),braze.getUser().setEmail($.email));}
2catch(Q){tt("Error in calling MpBrazeKit.onUserIdentified",Q.message);}}function ye(){braze.subscribeToInAppMessage(function(A){var O=true,$=false;if(A instanceof braze.InAppMessage){var Q=A.extras["msg-id"];Q=="push-primer"&&($=true,(!braze.isPushSupported()||braze.isPushPermissionGranted()||braze.isPushBlocked())&&(O=false),A.buttons[0]!=null&&A.buttons[0].subscribeToClickedEvent(function(){braze.requestPushPermission();}));}($&&O||!$&&e.register_inapp==="True")&&braze.showInAppMessage(A);});}function Pe(A){braze.openSession(),A.softPushCustomEventName&&(tt("braze.logCustomEvent",A.softPushCustomEventName),braze.logCustomEvent(A.softPushCustomEventName));}function je(A){var O=U(A),$=w(O);Ga($)||(d=JSON.stringify($),z($));}function z(A){for(var O in A)braze.getUser().setCustomUserAttribute(O,A[O]);}function R(A){if(d&&!Ga(o)){var O=B(A.ConsentState);if(!Ga(O)){var $=w(O),Q=JSON.stringify($);Q!==d&&(z($),d=Q);}}}function B(A){return A&&A.getGDPRConsentState?A.getGDPRConsentState():{}}function w(A){if(!o)return {};for(var O={},$={google_ad_user_data:"$google_ad_user_data",google_ad_personalization:"$google_ad_personalization"},Q=0;Q<=o.length-1;Q++){var fe=o[Q],Ye=fe.map.toLowerCase(),$t=$[fe.value];A[Ye]&&$t&&c.indexOf($t)!==-1&&(O[$t]=A[Ye].Consented);}return O}function U(A){var O={},$=A.getConsentState();return $&&$.getGDPRConsentState&&(O=$.getGDPRConsentState()),O}function L(A){return JSON.parse(A.replace(/&quot;/g,'"'))}function q(A,O,$,Q,fe,Ye,$t,An,Ws){t.logger||(t.logger={verbose:function(){}}),s=Ws;try{e=A,u=e.bundleCommerceEventData==="True",l=e.forwardSkuAsProductName==="True",n=O,r.sessionTimeoutInSeconds=e.ABKSessionTimeoutKey||1800,r.sdkFlavor="mparticle",r.allowUserSuppliedJavascript=e.enableHtmlInAppMessages=="True",r.doNotLoadFontAwesome=e.doNotLoadFontAwesome=="True",e.safariWebsitePushId&&(r.safariWebsitePushId=e.safariWebsitePushId),e.serviceWorkerLocation&&(r.serviceWorkerLocation=e.serviceWorkerLocation),e.consentMappingSDK&&(o=L(e.consentMappingSDK),o.length&&(i=!0));var ei=e.cluster||e.dataCenterLocation;if(uh.hasOwnProperty(ei))r.baseUrl=uh[ei];else {var Tn=ge(ei);Tn&&(r.baseUrl=Tn);}if(s&&s[bu.toString()]){var kc=s[bu.toString()];typeof kc.initOptions=="function"&&kc.initOptions(r);}if($!==!0)braze.initialize(e.apiKey,r),ee(e);else {if(!braze.initialize(e.apiKey,r))return "Failed to initialize: "+Kt;ee(e);}return "Successfully initialized: "+Kt}catch(Tf){return "Failed to initialize: "+Kt+" with error: "+Tf.message}}function ee(A){braze.addSdkMetadata(["mp"]),ye();let O=mParticle.Identity!==null?mParticle.Identity.getCurrentUser():null,$=O?O.getMPID():null;O&&$&&(he(O),i&&je(O)),Pe(A);}function ge(A){if(A){var O=A.replace(/&amp;/g,"&");O=A.replace(/&quot;/g,'"');try{var $=JSON.parse(O);if($&&$.JS)return "https://"+$.JS+"/api/v3"}catch(Q){console.log("Unable to configure custom Braze cluster: "+Q.toString());}}}function Re(A){return typeof A=="string"?A.substr(0,1)==="$"?A.replace(/^\$+/g,""):A:null}function Fe(A){if(typeof A=="string")return Re(A);if(Array.isArray(A)){var O=[];for(var $ in A){var Q=A[$],fe=Re(Q);if(fe==null)return null;O.push(fe);}return O}return A}function Ie(A){var O={},$,Q,fe;if(A==null&&(A={}),typeof A!="object")return null;for(var Ye in A)$=A[Ye],Q=Fe(Ye),fe=typeof $=="string"?Fe($):$,O[Q]=fe;return O}this.init=q,this.process=T,this.setUserIdentity=ie,this.setUserAttribute=re,this.onUserIdentified=he,this.removeUserAttribute=V,this.decodeClusterSetting=ge;function tt(A){var O="mParticle - Braze Web Kit log:",$=Array.prototype.slice.call(arguments,1);O+=`
3`+A+`:
4`,$.forEach(function(Q){yu(Q)||Array.isArray(Q)?O+=JSON.stringify(Q):O+=Q,O+=`,
5`;}),t.logger.verbose(O);}};function Nw(){return bu}function Dw(t){var e=[Kt,Du].join("-");if(!t){window.console.log("You must pass a config object to register the kit "+e);return}if(!yu(t)){window.console.log("'config' must be an object. You passed in a "+typeof t);return}yu(t.kits)?t.kits[e]={constructor:_u}:(t.kits={},t.kits[e]={constructor:_u}),window.console.log("Successfully registered "+e+" to your mParticle configuration");}window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:Kt,constructor:_u,getId:Nw,suffix:Du});function Ka(){for(var t={},e=0;e<arguments.length;e+=1)for(var r=arguments[e],n=Object.keys(r),i=0;i<n.length;i+=1)t[n[i]]=r[n[i]];return t}function yu(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===false}function Ga(t){return t==null||!(Object.keys(t)||t).length}var Mw={register:Dw,getVersion:function(){return Ow}};Mu.default=Mw;});var op=ti($u=>
5{Object.defineProperty($u,"__esModule",{value:true});var Ru="GoogleAnalytics4",Uu=160,Fu="Server",Lu=function(){var t=this;t.name=Ru,t.suffix=Fu;function e(r,n,i){mParticle._setIntegrationDelay(Uu,true);var o=r.measurementId;if(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments);},gtag("js",new Date),gtag("get",o,"client_id",function(a){Uw(a,Uu);}),!i){var s=document.createElement("script");s.type="text/javascript",s.async=true,s.src="https://www.googletagmanager.com/gtag/js?id="+o,(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(s);}}this.init=e;};function Uw(t,e){var r="client_id",n={};n[r]=t,mParticle.setIntegrationAttribute(e,n),mParticle._setIntegrationDelay(e,false);}function Lw(){return Uu}window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:Ru,constructor:Lu,getId:Lw,suffix:Fu});function Rw(t){var e=[Ru,Fu].join("-");if(!t){window.console.log("You must pass a config object to register the kit "+e);return}if(!ip(t)){window.console.log("'config' must be an object. You passed in a "+typeof t);return}ip(t.kits)?t.kits[e]={constructor:Lu}:(t.kits={},t.kits[e]={constructor:Lu}),window.console.log("Successfully registered "+e+" to your mParticle configuration");}function ip(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===false}var Fw={register:Rw};$u.default=Fw;});var ni=null;function Rf(t){ni=t;}function ao(){if(ni===null)throw new Error("@rebtel/rebtel-web-tracking: getConfig() called before initTracking(). Call initTracking(config) at app startup.");return ni}function dt(){return ni}function Ff(){ni=null;}var ap=ri(Lc());function qf(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===false}var Kf=Object.freeze({__proto__:null,default:qf});function Gf(t){return t&&t.default||t}var ta=Gf(Kf),Bt="Facebook",Wf=45,uo={SessionStart:1,SessionEnd:2,PageView:3,PageEvent:4,CrashReport:5,OptOut:6,Commerce:16},Yf={Other:0,CustomerId:1,Facebook:2,Twitter:3,Google:4,Microsoft:5,Yahoo:6,Email:7,FacebookCustomAudienceId:9,Other2:10,Other3:11,Other4:12,Other5:13,Other6:14,Other7:15,Other8:16,Other9:17,Other10:18,MobileNumber:19,PhoneNumber2:20,PhoneNumber3:21},Rc=[],Jf="AddToCart",Xf="AddToWishlist",Qf="InitiateCheckout",Zf="PageView",em="Purchase",tm="RemoveFromCart",rm="ViewContent",ra=function(){var t=this,e=false,r=null,n,i;t.name=Bt;function o(m,y,T,k,N,_){n=m,r=y,Rc=[mParticle.ProductActionType.Checkout,mParticle.ProductActionType.Purchase,mParticle.ProductActionType.AddToCart,mParticle.ProductActionType.RemoveFromCart,mParticle.ProductActionType.AddToWishlist,mParticle.ProductActionType.ViewDetail];try{if(!T){(function(J,G,V,re,ie,he,ye){J.fbq||(ie=J.fbq=function(){ie.callMethod?ie.callMethod.apply(ie,arguments):ie.queue.push(arguments);},J._fbq||(J._fbq=ie),ie.push=ie,ie.loaded=!0,ie.version="2.0",ie.queue=[],he=G.createElement(V),he.async=!0,he.src=re,ye=G.getElementsByTagName(V)[0],ye.parentNode.insertBefore(he,ye));})(window,document,"script","https://connect.facebook.net/en_US/fbevents.js");var S={};if(n.externalUserIdentityType&&_&&_.length>0){var M=Yf[n.externalUserIdentityType],X=_.filter(function(J){if(J.Type===M)return J.Identity});X.length>0&&(S.external_id=X[0].Identity);}}return n.disablePushState==="True"&&(fbq.disablePushState=!0),fbq("init",n.pixelId,S),s(),e=!0,"Successfully initialized: "+Bt}catch(J){return "Can't initialize forwarder: "+Bt+":"+J}}function s(){i=n.productAttributeMapping?JSON.parse(n.productAttributeMapping.replace(/&quot;/g,'"')):[];}function a(m){var y=false;if(!e)return "Can't send forwarder "+Bt+", not initialized";try{return m.EventDataType==uo.PageView?(y=!0,l(m)):m.EventDataType==uo.PageEvent?(y=!0,c(m)):m.EventDataType==uo.Commerce&&(y=u(m)),y&&r&&r(t,m),"Successfully sent to forwarder "+Bt}catch(T){return "Can't send to forwarder: "+Bt+" "+T}}function u(m){if(m.ProductAction&&m.ProductAction.ProductList&&m.ProductAction.ProductActionType&&Rc.indexOf(m.ProductAction.ProductActionType)>-1){var y,T,k=d(m),N=g(m),_=n.sendProductNamesasContents||false;k.currency=m.CurrencyCode||"USD",m.EventName&&(k.content_name=m.EventName);var S=m.ProductAction.ProductList.reduce(function(V,re){return re.Sku&&V.push(re.Sku),V},[]);if(S&&S.length>0&&(k.content_ids=S),_){var M=v(m.ProductAction.ProductList);M&&M.length>0&&(k.content_name=M);}m.ProductAction.TransactionId&&(k.order_id=m.ProductAction.TransactionId);var X=f(m.ProductAction.ProductList);if(X&&X.length>0&&(k.contents=X),m.ProductAction.ProductActionType==mParticle.ProductActionType.AddToWishlist||m.ProductAction.ProductActionType==mParticle.ProductActionType.Checkout){var J=p(m);J&&(k.content_category=J),m.ProductAction.ProductActionType==mParticle.ProductActionType.Checkout&&m.ProductAction.CheckoutStep&&(k.checkout_step=m.ProductAction.CheckoutStep);}if(m.ProductAction.ProductActionType==mParticle.ProductActionType.AddToCart||m.ProductAction.ProductActionType==mParticle.ProductActionType.AddToWishlist||m.ProductAction.ProductActionType==mParticle.ProductActionType.ViewDetail)T=m.ProductAction.ProductList.reduce(function(V,re){return h(re.Price)&&h(re.Quantity)&&(V+=re.Price*re.Quantity),V},0),k.value=T,m.ProductAction.ProductActionType==mParticle.ProductActionType.AddToWishlist?y=Xf:m.ProductAction.ProductActionType==mParticle.ProductActionType.AddToCart?y=Jf:y=rm;else if(m.ProductAction.ProductActionType==mParticle.ProductActionType.Checkout||m.ProductAction.ProductActionType==mParticle.ProductActionType.Purchase){y=m.ProductAction.ProductActionType==mParticle.ProductActionType.Checkout?Qf:em,m.ProductAction.TotalAmount&&(k.value=m.ProductAction.TotalAmount);var G=m.ProductAction.ProductList.reduce(function(V,re){return h(re.Quantity)&&(V+=re.Quantity),V},0);k.num_items=G;}else if(m.ProductAction.ProductActionType==mParticle.ProductActionType.RemoveFromCart)return y=tm,m.ProductAction.TotalAmount?T=m.ProductAction.TotalAmount:T=m.ProductAction.ProductList.reduce(function(V,re){return h(re.TotalAmount)&&(V+=re.TotalAmount),V},0),k.value=T,fbq("trackCustom",y||"customEvent",k,N),true;if(y)fbq("track",y,k,N);else return  false;return  true}return  false}function l(m){c(m,Zf);}function c(m,y){var T=d(m),k=g(m);y=y||m.EventName,m.EventName&&(T.content_name=m.EventName),fbq("trackCustom",y||"customEvent",T,k);}function d(m){var y={};if(m&&m.EventAttributes)try{y=JSON.parse(JSON.stringify(m.EventAttributes));}catch(T){}return y}function h(m){return !isNaN(parseFloat(m))&&isFinite(m)}function p(m){var y,T;if(m.EventDataType==uo.Commerce?(y=m.EventCategory?mParticle.CommerceEventType:mParticle.ProductActionType,T=m.EventCategory||m.ProductAction.ProductActionType):(y=mParticle.EventType,T=m.EventCategory),y&&T){for(var k in y)if(T==y[k])return k}return null}
5function f(m){return !m||m.length===0?[]:m.filter(function(y){return y&&y.Sku}).map(function(y){var T={id:y.Sku,quantity:h(y.Quantity)?y.Quantity:1,name:y.Name,brand:y.Brand,category:y.Category,variant:y.Variant,item_price:h(y.Price)?y.Price:null};return i.forEach(function(k){if(!(!ta(k)||!k.map||!k.value)){var N=k.map,_=k.value,S=null;y.hasOwnProperty(N)?S=y[N]:y.Attributes&&y.Attributes[N]&&(S=y.Attributes[N]),S!=null&&(T[_]=S);}}),T})}function g(m){return {eventID:m.SourceMessageId||null}}function v(m){return !m||m.length===0?[]:m.filter(function(y){return y&&y.Name}).map(function(y){return y.Name})}this.init=o,this.process=a;};function nm(){return Wf}function im(t){if(!t){console.log("You must pass a config object to register the kit "+Bt);return}if(!ta(t)){console.log("'config' must be an object. You passed in a "+typeof t);return}ta(t.kits)?t.kits[Bt]={constructor:ra}:(t.kits={},t.kits[Bt]={constructor:ra}),console.log("Successfully registered "+Bt+" to your mParticle configuration");}typeof window!="undefined"&&window&&window.mParticle&&window.mParticle.addForwarder&&window.mParticle.addForwarder({name:Bt,constructor:ra,getId:nm});var Fc={register:im};Fc.register;var $c=Fc;var up=ri(Wc()),lp=ri(td());typeof globalThis!="undefined"&&(globalThis.regeneratorRuntime=void 0);var tr={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(t)))}catch(e){console.error("Error encoding cookie values into Base64:"+e);}return this._encode(t)},_encode:function(t){var e,r,n,i,o,s,a,u="",l=0;for(t=rd.encode(t);l<t.length;)e=t.charCodeAt(l++),r=t.charCodeAt(l++),n=t.charCodeAt(l++),i=e>>2,o=(3&e)<<4|r>>4,s=(15&r)<<2|n>>6,a=63&n,isNaN(r)?s=a=64:isNaN(n)&&(a=64),u=u+tr._keyStr.charAt(i)+tr._keyStr.charAt(o)+tr._keyStr.charAt(s)+tr._keyStr.charAt(a);return u},decode:function(t){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(t)))}catch(e){}return tr._decode(t)},_decode:function(t){var e,r,n,i,o,s,a,u="",l=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");l<t.length;)i=tr._keyStr.indexOf(t.charAt(l++)),o=tr._keyStr.indexOf(t.charAt(l++)),s=tr._keyStr.indexOf(t.charAt(l++)),a=tr._keyStr.indexOf(t.charAt(l++)),e=i<<2|o>>4,r=(15&o)<<4|s>>2,n=(3&s)<<6|a,u+=String.fromCharCode(e),s!==64&&(u+=String.fromCharCode(r)),a!==64&&(u+=String.fromCharCode(n));return u=rd.decode(u),u}},rd={encode:function(t){for(var e,r="",n=0;n<t.length;n++)e=t.charCodeAt(n),128>e?r+=String.fromCharCode(e):127<e&&2048>e?(r+=String.fromCharCode(192|e>>6),r+=String.fromCharCode(128|63&e)):(r+=String.fromCharCode(224|e>>12),r+=String.fromCharCode(128|63&e>>6),r+=String.fromCharCode(128|63&e));return r},decode:function(t){for(var e="",r=0,n=0,i=0,o=0;r<t.length;)n=t.charCodeAt(r),128>n?(e+=String.fromCharCode(n),r++):191<n&&224>n?(i=t.charCodeAt(r+1),e+=String.fromCharCode((31&n)<<6|63&i),r+=2):(i=t.charCodeAt(r+1),o=t.charCodeAt(r+2),e+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&o),r+=3);return e}},pi={forEach:function(e,r){var n,i;if(this==null)throw new TypeError(" this is null or not defined");var o=Object(this),s=o.length>>>0;if(typeof e!="function")throw new TypeError(e+" is not a function");for(1<arguments.length&&(n=r),i=0;i<s;){var a;i in o&&(a=o[i],e.call(n,a,i,o)),i++;}},map:function(e,r){var n,i,o;if(this===null)throw new TypeError(" this is null or not defined");var s=Object(this),a=s.length>>>0;if(typeof e!="function")throw new TypeError(e+" is not a function");for(1<arguments.length&&(n=r),i=Array(a),o=0;o<a;){var u,l;o in s&&(u=s[o],l=e.call(n,u,o,s),i[o]=l),o++;}return i},filter:function(e){if(this===void 0||this===null)throw new TypeError;var r=Object(this),n=r.length>>>0;if(typeof e!="function")throw new TypeError;for(var i=[],o=2<=arguments.length?arguments[1]:void 0,s=0;s<n;s++)if(s in r){var a=r[s];e.call(o,a,s,r)&&i.push(a);}return i},isArray:function(e){return Object.prototype.toString.call(e)==="[object Array]"},Base64:tr},yv="2.47.0",F={sdkVersion:yv,sdkVendor:"mparticle",platform:"web",Messages:{DeprecationMessages:{MethodIsDeprecatedPostfix:"is a deprecated method and will be removed in future releases",AlternativeMethodPrefix:"Please use the alternate method:"},ErrorMessages:{NoToken:"A token must be specified.",EventNameInvalidType:"Event name must be a valid string value.",EventDataInvalidType:"Event data must be a valid object hash.",LoggingDisabled:"Event logging is currently disabled.",CookieParseError:"Could not parse cookie",EventEmpty:"Event object is null or undefined, cancelling send",APIRequestEmpty:"APIRequest is null or undefined, cancelling send",NoEventType:"Event type must be specified.",TransactionIdRequired:"Transaction ID is required",TransactionRequired:"A transaction attributes object is required",PromotionIdRequired:"Promotion ID is required",BadAttribute:"Attribute value cannot be object or array",BadKey:"Key value cannot be object or array",BadLogPurchase:"Transaction attributes and a product are both required to log a purchase, https://docs.mparticle.com/?javascript#measuring-transactions",AudienceAPINotEnabled:"Your workspace is not enabled to retrieve user audiences."},InformationMessages:{CookieSearch:"Searching for cookie",CookieFound:"Cookie found, parsing values",CookieNotFound:"Cookies not found",CookieSet:"Setting cookie",CookieSync:"Performing cookie sync",SendBegin:"Starting to send event",SendIdentityBegin:"Starting to send event to identity server",SendWindowsPhone:"Sending event to Windows Phone container",SendIOS:"Calling iOS path: ",SendAndroid:"Calling Android JS interface method: ",SendHttp:"Sending event to mParticle HTTP service",SendAliasHttp:"Sending alias request to mParticle HTTP service",SendIdentityHttp:"Sending event to mParticle HTTP service",StartingNewSession:"Starting new Session",StartingLogEvent:"Starting to log event",StartingLogOptOut:"Starting to log user opt in/out",StartingEndSession:"Starting to end session",StartingInitialization:"Starting to initialize",StartingLogCommerceEvent:"Starting to log commerce event",StartingAliasRequest:"Starting to Alias MPIDs",LoadingConfig:"Loading configuration options",AbandonLogEvent:"Cannot log event, logging disabled or developer token not set",AbandonAliasUsers:"Cannot Alias Users, logging disabled or developer token not set",AbandonStartSession:"Cannot start session, logging disabled or developer token not set",AbandonEndSession:"Cannot end session, logging disabled or developer token not set",NoSessionToEnd:"Cannot end session, no active session found"}
5,ValidationMessages:{ModifyIdentityRequestUserIdentitiesPresent:"identityRequests to modify require userIdentities to be present. Request not sent to server. Please fix and try again",IdentityRequesetInvalidKey:"There is an invalid key on your identityRequest object. It can only contain a `userIdentities` object and a `onUserAlias` function. Request not sent to server. Please fix and try again.",OnUserAliasType:"The onUserAlias value must be a function.",UserIdentities:"The userIdentities key must be an object with keys of identityTypes and values of strings. Request not sent to server. Please fix and try again.",UserIdentitiesInvalidKey:"There is an invalid identity key on your `userIdentities` object within the identityRequest. Request not sent to server. Please fix and try again.",UserIdentitiesInvalidValues:"All user identity values must be strings or null. Request not sent to server. Please fix and try again.",AliasMissingMpid:"Alias Request must contain both a destinationMpid and a sourceMpid",AliasNonUniqueMpid:"Alias Request's destinationMpid and sourceMpid must be unique",AliasMissingTime:"Alias Request must have both a startTime and an endTime",AliasStartBeforeEndTime:"Alias Request's endTime must be later than its startTime"}},NativeSdkPaths:{LogEvent:"logEvent",SetUserAttribute:"setUserAttribute",RemoveUserAttribute:"removeUserAttribute",SetSessionAttribute:"setSessionAttribute",AddToCart:"addToCart",RemoveFromCart:"removeFromCart",ClearCart:"clearCart",SetUserAttributeList:"setUserAttributeList",RemoveAllUserAttributes:"removeAllUserAttributes",Identify:"identify",Logout:"logout",Login:"login",Modify:"modify",Alias:"aliasUsers",Upload:"upload"},StorageNames:{localStorageName:"mprtcl-api",localStorageNameV3:"mprtcl-v3",cookieName:"mprtcl-api",cookieNameV2:"mprtcl-v2",cookieNameV3:"mprtcl-v3",localStorageNameV4:"mprtcl-v4",localStorageProductsV4:"mprtcl-prodv4",cookieNameV4:"mprtcl-v4",currentStorageName:"mprtcl-v4",currentStorageProductsName:"mprtcl-prodv4"},DefaultConfig:{cookieDomain:null,cookieExpiration:365,logLevel:null,timeout:300,sessionTimeout:30,maxProducts:20,forwarderStatsTimeout:5e3,integrationDelayTimeout:5e3,maxCookieSize:3e3,aliasMaxWindow:90,uploadInterval:0},DefaultBaseUrls:{v1SecureServiceUrl:"jssdks.mparticle.com/v1/JS/",v2SecureServiceUrl:"jssdks.mparticle.com/v2/JS/",v3SecureServiceUrl:"jssdks.mparticle.com/v3/JS/",configUrl:"jssdkcdns.mparticle.com/JS/v2/",identityUrl:"identity.mparticle.com/v1/",aliasUrl:"jssdks.mparticle.com/v1/identity/",userAudienceUrl:"nativesdks.mparticle.com/v1/"},CNAMEUrlPaths:{v1SecureServiceUrl:"/webevents/v1/JS/",v2SecureServiceUrl:"/webevents/v2/JS/",v3SecureServiceUrl:"/webevents/v3/JS/",configUrl:"/tags/JS/v2/",identityUrl:"/identity/v1/",aliasUrl:"/webevents/v1/identity/"},Base64CookieKeys:{csm:1,sa:1,ss:1,lsa:1,ua:1,ui:1,csd:1,ia:1,con:1},SDKv2NonMPIDCookieKeys:{gs:1,cu:1,l:1,globalSettings:1,currentUserMPID:1},HTTPCodes:{noHttpCoverage:-1,activeIdentityRequest:-2,activeSession:-3,validationIssue:-4,nativeIdentityRequest:-5,loggingDisabledOrMissingAPIKey:-6,tooManyRequests:429},FeatureFlags:{ReportBatching:"reportBatching",EventBatchingIntervalMillis:"eventBatchingIntervalMillis",OfflineStorage:"offlineStorage",DirectUrlRouting:"directURLRouting",CacheIdentity:"cacheIdentity",AudienceAPI:"audienceAPI",CaptureIntegrationSpecificIds:"captureIntegrationSpecificIds",CaptureIntegrationSpecificIdsV2:"captureIntegrationSpecificIdsV2",AstBackgroundEvents:"astBackgroun
5dEvents"},DefaultInstance:"default_instance",CCPAPurpose:"data_sale_opt_out",IdentityMethods:{Modify:"modify",Logout:"logout",Login:"login",Identify:"identify"},Environment:{Development:"development",Production:"production"},CaptureIntegrationSpecificIdsV2Modes:{All:"all",None:"none",RoktOnly:"roktonly"}},wv=86400,Sv=1e3,va=200,nd=202,da=400,Cv={SDKState:"functional",Products:"targeting",OfflineEvents:"functional",IdentityCache:"functional",TimeOnSite:"targeting"},ba=function(t,e){return ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n;}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);},ba(t,e)};function gi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ba(t,e);function r(){this.constructor=t;}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r);}var pe=function(){return pe=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);}return e},pe.apply(this,arguments)};function nr(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o);})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c));}catch(d){s(d);}}function u(c){try{l(n.throw(c));}catch(d){s(d);}}function l(c){c.done?o(c.value):i(c.value).then(a,u);}l((n=n.apply(t,[])).next());})}function ir(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r);}catch(c){l=[6,c],i=0;}finally{n=o=0;}if(l[0]&5)throw l[1];return {value:l[0]?l[1]:void 0,done:true}}}function Ev(t,e,r){for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var id=F.Messages,Pv=function(t){return Ov(Mv(t))},Iv=function(t){return Nv(Dv(t))},wa=function(t,e){if(!t)return  false;var r=0;if(Array.prototype.indexOf)return 0<=t.indexOf(e,0);for(var n=t.length;r<n;r++)if(r in t&&t[r]===e)return  true;return  false},Av=function(t,e){if(e&&t){for(var r in t)if(t.hasOwnProperty(r)&&r.toLowerCase()===e.toLowerCase())return r}return null},wd=function(t,e){var r=[t,id.DeprecationMessages.MethodIsDeprecatedPostfix];return e&&(r.push(e),r.push(id.DeprecationMessages.MethodIsDeprecatedPostfix)),r.join(" ")};function zt(t){var e,r=0;if(t==null)return 0;if(t=t.toString().toLowerCase(),Array.prototype.reduce)return t.split("").reduce(function(i,o){return i=(i<<5)-i+o.charCodeAt(0),i&i},0);if(t.length===0)return r;for(var n=0;n<t.length;n++)e=t.charCodeAt(n),r=(r<<5)-r+e,r&=r;return r}var Tv=function(){var t,e;return window.crypto&&window.crypto.getRandomValues&&(t=window.crypto.getRandomValues(new Uint8Array(1))),t?(e^t[0]%16>>e/4).toString(16):(e^16*Math.random()>>e/4).toString(16)},Sa=function(t){return t===void 0&&(t=""),t?Tv():"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,Sa)},kv=function(t){if(!t)return 100;var e=zt(t);return Math.abs(e%100)+1},it=function(t){var e=Object.prototype.toString.call(t);return e==="[object Object]"||e==="[object Error]"},rr=function(t){if(isNaN(t)||!isFinite(t))return 0;var e=parseFloat(t);return isNaN(e)?0:e},xv=function(t){try{return t?JSON.parse(t.replace(/&quot;/g,'"')):[]}
5catch(e){throw new Error("Settings string contains invalid JSON")}},on=function(t){return Ca(t)?t:null},Ov=function(t){return t.replace(/,/g,"|")},Nv=function(t){return t.replace(/\|/g,",")},Dv=function(t){return t.replace(/\'/g,'"')},Mv=function(t){return t.replace(/\"/g,"'")},od=function(t,e){return t.replace("%%mpid%%",e)},sd=function(t){return t.replace(/&amp;/g,"&")},Uv=function(t,e,r){var n=sd(e),i=r?sd(r):null,o=od(n,t),s=i?od(i,t):"";return o+encodeURIComponent(s)},Lv=function(t){return t!=="false"&&t!=="0"&&!!t},Rv=function(t){return decodeURIComponent(t.replace(/\+/g," "))},Fv=function(t){return t.indexOf('"')===0&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")),t},Sd=function(t){return typeof t=="string"},un=function(t){return typeof t=="number"},$v=function(t){return typeof t=="boolean"},fi=function(t){return typeof t=="function"},Bv=function(t){return t!==void 0&&!it(t)&&!Array.isArray(t)},ad=function(t){return un(t)||Sd(t)||$v(t)},zv=function(t){return Ca(t)?t.toString().toLowerCase().replace(/[^0-9a-zA-Z]+/g,"_"):""},jv=function(t){return t===zv(t)},Ca=function(t){return Sd(t)||un(t)},_e=function(t){return t==null||!(Object.keys(t)||t).length},Hv=function(t,e){return t.slice(0,e).concat(t.slice(e+1),t[e])},Vv=function(t,e){e===void 0&&(e=[]);var r,n={},i={};if(!t)return n;if(typeof URL!="undefined"&&typeof URLSearchParams!="undefined"){var o=new URL(t);r=new URLSearchParams(o.search);}else r=qv(t);return r.forEach(function(s,a){i[a.toLowerCase()]=s;}),_e(e)?i:(e.forEach(function(s){var a=i[s.toLowerCase()];a&&(n[s]=a);}),n)},qv=function(t){var e={},r=t.split("?")[1]||"",n=r.split("&");return n.forEach(function(i){var o=i.split("="),s=o[0],a=o.slice(1),u=a.join("=");if(s&&u!==void 0)try{e[s]=decodeURIComponent(u||"");}catch(l){console.error("Failed to decode value for key ".concat(s,": ").concat(l));}}),{get:function(o){return e[o]},forEach:function(o){for(var s in e)e.hasOwnProperty(s)&&o(e[s],s);}}},Kv=function(t){var e=(function(){try{return typeof window=="undefined"?[]:window.document.cookie.split(";").map(function(n){return n.trim()})}catch(n){return console.error("Unable to parse cookies",n),[]}})();return (function(n,i){for(var o={},s=0,a=n;s<a.length;s++){var u=a[s],l=u.split("="),c=l[0],d=l[1];(!i||i.includes(c))&&(o[c]=d);}return o})(e,t)},_o=function(){return typeof window!="undefined"&&window.location?window.location.href:""},ud=function(t,e,r){var n={};if(!_e(t)){for(var i in t)if(t.hasOwnProperty(i)){var o=r(i);wa(e,o)||(n[i]=t[i]);}}return n},Gv=function(t,e,r){var n;return ((n=t.kitConfigs)===null||n===void 0?void 0:n.find(function(i){return i.name===e&&i.moduleId===r}))||null},an={SessionStart:1,SessionEnd:2,PageView:3,PageEvent:4,CrashReport:5,OptOut:6,AppStateTransition:10,Profile:14,Commerce:16,Media:20,UserAttributeChange:17,UserIdentityChange:18},nt={Unknown:0,Navigation:1,Location:2,Search:3,Transaction:4,UserContent:5,UserPreference:6,Social:7,Other:8,Media:9,getName:function(e){return e===nt.Unknown?"Unknown":e===nt.Navigation?"Navigation":e===nt.Location?"Location":e===nt.Search?"Search":e===nt.Transaction?"Transaction":e===nt.UserContent?"User Content":e===nt.UserPreference?"User Preference":e===nt.Social?"Social":e===ft.ProductAddToCart?"Product Added to Cart":e===ft.ProductAddToWishlist?"Product Added to Wishlist":e===ft.ProductCheckout?"Product Checkout":e===ft.ProductCheckoutOption?"Product Checkout Options":e===ft.ProductClick?"Product Click":e===ft.ProductImpression?"Product Impression":e===ft.ProductPurchase?"Product Purchased":e===ft.ProductRefund?"Product Refunded":e===ft.ProductRemoveFromCart?"Product Removed From Cart":e===ft.ProductRemoveFromWishlist?"Product Removed from Wishlist":e===ft.ProductViewDetail?"Product View Details":e===ft.PromotionClick?"Promotion Click":e===ft.PromotionView?"Promotion View":"Other"}},ft={ProductAddToCart:10,ProductRemoveFromCart:11,ProductCheckout:12,ProductCheckoutOption:13,ProductClick:14,ProductViewDetail:15,ProductPurchase:16,ProductRefund:17,PromotionView:18,PromotionClick:19,ProductAddToWishlist:20,ProductRemoveFromWishlist:21,ProductImpression:22},te={Other:0,CustomerId:1,Facebook:2,Twitter:3,Google:4,Microsoft:5,Yahoo:6,Email:7,FacebookCustomAudienceId:9,Other2:10,Other3:11,Other4:12,Other5:13,Other6:14,Other7:15,Other8:16,Other9:17,Other10:18,MobileNumber:19,PhoneNumber2:20,PhoneNumber3:21,isValid:function(e){if(typeof e=="number"){for(var r in te)if(te.hasOwnProperty(r)&&te[r]===e)return  true}return  false},getName:function(e){return e===window.mParticle.IdentityType.CustomerId?"Customer ID":e===window.mParticle.IdentityType.Facebook?"Facebook ID":e===window.mParticle.IdentityType.Twitter?"Twitter ID":e===window.mParticle.IdentityType.Google?"Google ID":e===window.mParticle.IdentityType.Microsoft?"Microsoft ID":e===window.mParticle.IdentityType.Yahoo?"Yahoo ID":e===window.mParticle.IdentityType.Email?"Email":e===window.mParticle.IdentityType.FacebookCustomAudienceId?"Facebook App User ID":"Other ID"},getIdentityType:function(e){return e==="other"?te.Other:e==="customerid"?te.CustomerId:e==="facebook"?te.Facebook:e==="twitter"?te.Twitter:e==="google"?te.Google:e==="microsoft"?te.Microsoft:e==="yahoo"?te.Yahoo:e==="email"?te.Email:e==="facebookcustomaudie
5nceid"?te.FacebookCustomAudienceId:e==="other2"?te.Other2:e==="other3"?te.Other3:e==="other4"?te.Other4:e==="other5"?te.Other5:e==="other6"?te.Other6:e==="other7"?te.Other7:e==="other8"?te.Other8:e==="other9"?te.Other9:e==="other10"?te.Other10:e==="mobile_number"?te.MobileNumber:e==="phone_number_2"?te.PhoneNumber2:e=="phone_number_3"&&te.PhoneNumber3},getIdentityName:function(e){return e===te.Other?"other":e===te.CustomerId?"customerid":e===te.Facebook?"facebook":e===te.Twitter?"twitter":e===te.Google?"google":e===te.Microsoft?"microsoft":e===te.Yahoo?"yahoo":e===te.Email?"email":e===te.FacebookCustomAudienceId?"facebookcustomaudienceid":e===te.Other2?"other2":e===te.Other3?"other3":e===te.Other4?"other4":e===te.Other5?"other5":e===te.Other6?"other6":e===te.Other7?"other7":e===te.Other8?"other8":e===te.Other9?"other9":e===te.Other10?"other10":e===te.MobileNumber?"mobile_number":e===te.PhoneNumber2?"phone_number_2":e===te.PhoneNumber3?"phone_number_3":null},getValuesAsStrings:function(){return Object.values(te).map(function(e){return un(e)?e.toString():void 0}).filter(function(e){return e!==void 0})},getNewIdentitiesByName:function(e){var r={},n=te.getValuesAsStrings();for(var i in e)if(n.includes(i)){var o=te.getIdentityName(rr(i));r[o]=e[i];}return r}},Me={Unknown:0,AddToCart:1,RemoveFromCart:2,Checkout:3,CheckoutOption:4,Click:5,ViewDetail:6,Purchase:7,Refund:8,AddToWishlist:9,RemoveFromWishlist:10,getName:function(e){return e===Me.AddToCart?"Add to Cart":e===Me.RemoveFromCart?"Remove from Cart":e===Me.Checkout?"Checkout":e===Me.CheckoutOption?"Checkout Option":e===Me.Click?"Click":e===Me.ViewDetail?"View Detail":e===Me.Purchase?"Purchase":e===Me.Refund?"Refund":e===Me.AddToWishlist?"Add to Wishlist":e===Me.RemoveFromWishlist?"Remove from Wishlist":"Unknown"},getExpansionName:function(e){return e===Me.AddToCart?"add_to_cart":e===Me.RemoveFromCart?"remove_from_cart":e===Me.Checkout?"checkout":e===Me.CheckoutOption?"checkout_option":e===Me.Click?"click":e===Me.ViewDetail?"view_detail":e===Me.Purchase?"purchase":e===Me.Refund?"refund":e===Me.AddToWishlist?"add_to_wishlist":e===Me.RemoveFromWishlist?"remove_from_wishlist":"unknown"}},sn={Unknown:0,PromotionView:1,PromotionClick:2,getName:function(e){return e===sn.PromotionView?"view":e===sn.PromotionClick?"click":"unknown"},getExpansionName:function(e){return e===sn.PromotionView?"view":e===sn.PromotionClick?"click":"unknown"}},Wv={Logout:3},Yv={AppInit:1},I={MessageType:an,EventType:nt,CommerceEventType:ft,IdentityType:te,ProfileMessageType:Wv,ApplicationTransitionType:Yv,ProductActionType:Me,PromotionActionType:sn,Environment:F.Environment};function wt(t){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wt(t)}var kt;(function(t){t[t.Unknown=0]="Unknown",t[t.AddToCart=1]="AddToCart",t[t.RemoveFromCart=2]="RemoveFromCart",t[t.Checkout=3]="Checkout",t[t.CheckoutOption=4]="CheckoutOption",t[t.Click=5]="Click",t[t.ViewDetail=6]="ViewDetail",t[t.Purchase=7]="Purchase",t[t.Refund=8]="Refund",t[t.AddToWishlist=9]="AddToWishlist",t[t.RemoveFromWishlist=10]="RemoveFromWishlist";})(kt||(kt={}));function Jv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j={};(function(t){Object.defineProperty(t,"__esModule",{value:true}),(function(e){e.unknown="Unknown",e.iOS="IOS",e.android="Android",e.windowsPhone="WindowsPhone",e.mobileWeb="MobileWeb",e.unityIOS="UnityIOS",e.unityAndroid="UnityAndroid",e.desktop="Desktop",e.tvOS="TVOS",e.roku="Roku",e.outOfBand="OutOfBand",e.alexa="Alexa",e.smartTV="SmartTV",e.fireTV="FireTV",e.xbox="Xbox";})(t.ApplicationInformationOsEnum||(t.ApplicationInformationOsEnum={})),(function(e){e.applicationStateTransition="application_state_transition";})(t.ApplicationStateTransitionEventEventTypeEnum||(t.ApplicationStateTransitionEventEventTypeEnum={})),(function(e){e.applicationInitialized="application_initialized",e.applicationExit="application_exit",e.applicationBackgroun
5d="application_background",e.applicationForeground="application_foreground";})(t.ApplicationStateTransitionEventDataApplicationTransitionTypeEnum||(t.ApplicationStateTransitionEventDataApplicationTransitionTypeEnum={})),(function(e){e.unknown="unknown",e.development="development",e.production="production";})(t.BatchEnvironmentEnum||(t.BatchEnvironmentEnum={})),(function(e){e.breadcrumb="breadcrumb";})(t.BreadcrumbEventEventTypeEnum||(t.BreadcrumbEventEventTypeEnum={})),(function(e){e.commerceEvent="commerce_event";})(t.CommerceEventEventTypeEnum||(t.CommerceEventEventTypeEnum={})),(function(e){e.addToCart="add_to_cart",e.removeFromCart="remove_from_cart",e.checkout="checkout",e.checkoutOption="checkout_option",e.click="click",e.viewDetail="view_detail",e.purchase="purchase",e.refund="refund",e.promotionView="promotion_view",e.promotionClick="promotion_click",e.addToWishlist="add_to_wishlist",e.removeFromWishlist="remove_from_wishlist",e.impression="impression";})(t.CommerceEventDataCustomEventTypeEnum||(t.CommerceEventDataCustomEventTypeEnum={})),(function(e){e.crashReport="crash_report";})(t.CrashReportEventEventTypeEnum||(t.CrashReportEventEventTypeEnum={})),(function(e){e.customEvent="custom_event";})(t.CustomEventEventTypeEnum||(t.CustomEventEventTypeEnum={})),(function(e){e.navigation="navigation",e.location="location",e.search="search",e.transaction="transaction",e.userContent="user_content",e.userPreference="user_preference",e.social="social",e.media="media",e.other="other",e.unknown="unknown";})(t.CustomEventDataCustomEventTypeEnum||(t.CustomEventDataCustomEventTypeEnum={})),(function(e){e.portrait="portrait",e.portraitUpsideDown="portrait_upside_down",e.landscape="landscape",e.landscapeLeft="LandscapeLeft",e.landscapeRight="LandscapeRight",e.faceUp="FaceUp",e.faceDown="FaceDown",e.square="Square";})(t.DeviceCurrentStateDeviceOrientationEnum||(t.DeviceCurrentStateDeviceOrientationEnum={})),(function(e){e.portrait="portrait",e.portraitUpsideDown="portrait_upside_down",e.landscape="landscape",e.landscapeLeft="LandscapeLeft",e.landscapeRight="LandscapeRight",e.faceUp="FaceUp",e.faceDown="FaceDown",e.square="Square";})(t.DeviceCurrentStateStatusBarOrientationEnum||(t.DeviceCurrentStateStatusBarOrientationEnum={})),(function(e){e.iOS="iOS",e.android="Android",e.web="web",e.desktop="desktop",e.tvOS="tvOS",e.roku="roku",e.outOfBand="out_of_band",e.smartTV="smart_tv",e.xbox="xbox";})(t.DeviceInformationPlatformEnum||(t.DeviceInformationPlatformEnum={})),(function(e){e.unknown="unknown",e.sessionStart="session_start",e.sessionEnd="session_end",e.screenView="screen_view",e.customEvent="custom_event",e.crashReport="crash_report",e.optOut="opt_out",e.firstRun="first_run",e.preAttribution="pre_attribution",e.pushRegistration="push_registration",e.applicationStateTransition="application_state_transition",e.pushMessage="push_message",e.networkPerformance="network_performance",e.breadcrumb="breadcrumb",e.profile="profile",e.pushReaction="push_reaction",e.commerceEvent="commerce_event",e.userAttributeChange="user_attribute_change",e.userIdentityChange="user_identity_change",e.uninstall="uninstall",e.validationResult="validation_result";})(t.EventTypeEnum||(t.EventTypeEnum={})),(function(e){e.other="other",e.customerId="customer_id",e.facebook="facebook",e.twitter="twitter",e.google="google",e.microsoft="microsoft",e.yahoo="yahoo",e.email="email",e.alias="alias",e.facebookCustomAudienceId="facebook_custom_audience_id",e.otherId2="other_id_2",e.otherId3="other_id_3",e.otherId4="other_id_4",e.otherId5="other_id_5",e.otherId6="other_id_6",e.otherId7="other_id_7",e.otherId8="other_id_8",e.otherId9="other_id_9",e.otherId10="other_id_10",e.mobileNumber="mobile_number",e.phoneNumber2="phone_number_2",e.phoneNumber3="phone_number_3";})(t.IdentityTypeEnum||(t.IdentityTypeEnum={})),(function(e){e.networkPerformance="network_performance";})(t.NetworkPerformanceEventEventTypeEnum||(t.NetworkPerformanceEventEventTypeEnum={})),(function(e){e.optOut="opt_out";})(t.OptOutEventEnum||(t.OptOutEventEnum={})),(function(e){e.unknown="unknown",e.addToCart="add_to_cart",e.removeFromCart="remove_from_cart",e.checkout="checkout",e.checkoutOption="checkout_option",e.click="click",e.viewDetail="view_detail",e.purchase="purchase",e.refund="refund",e.addToWishlist="add_to_wishlist",e.removeFromWishlist="remove_from_wish_list";})(t.ProductActionActionEnum||(t.ProductActionActionEnum={})),(function(e){e.profile="profile";})(t.ProfileEventEventTypeEnum||(t.ProfileEventEventTypeEnum={})),(function(e){e.signup="signup",e.login="login",e.logout="logout",e.update="update",e.delete="delete";})(t.ProfileEventDataProfileEventTypeEnum||(t.ProfileEventDataProfileEventTypeEnum={})),(function(e){e.view="view",e.click="click";})(t.PromotionActionActionEnum||(t.PromotionActionActionEnum={})),(function(e){e.pushMessage="push_message";})(t.PushMessageEventEventTypeEnum||(t.PushMessageEventEventTypeEnum={})),(function(e){e.sent="sent",e.received="received",e.action="action";})(t.PushMessageEventDataPushMessageTypeEnum||(t.PushMessageEventDataPushMessageTypeEnum={})),(function(e){e.notRunning="not_running",e.background="background",e.foreground="foreground";})(t.PushMessageEventDataApplicationStateEnum||(t.PushMessageEventDataApplicationStateEnum={})),(function(e){e.received="Received",e.directOpen="DirectOpen",e.read="Read",e.influencedOpen="InfluencedOpen",e.displayed="Displayed";})(t.PushMessageEventDataPushMessageBehaviorEnum||(t.PushMessageEventDataPushMessageBehaviorEnum={})),(function(e){e.pushRegistration="push_registration";})(t.PushRegistrationEventEventTypeEnum||(t.PushRegistrationEventEventTypeEnum={})),(function(e){e.sessionEnd="session_end";})(t.SessionEndEventEventTypeEnum||(t.SessionEndEventEventTypeEnum={})),(function(e){e.sessionStart="session_start";})(t.SessionStartEventEventTypeEnum||(t.SessionStartEventEventTypeEnum={})),(function(e){e.native="native",e.javascript="javascript",e.pixel="pixel",e.desktop="desktop",e.partner="partner",e.serverToServer="server_to_server";})(t.SourceInformationChannelEnum||(t.SourceInformationChannelEnum={})),(function(e){e.userAttributeChange="user_attribute_change";})(t.UserAttributeChangeEventEventTypeEnum||(t.UserAttributeChangeEventEventTypeEnum={})),(function(e){e.userIdentityChange="user_identity_change";})(t.UserIdentityChangeEventEventTypeEnum||(t.UserIdentityChangeEventEventTypeEnum={}));})(j);var ke;(function(t){t.other="other",t.customerId="customerid",t.facebook="facebook",t.twitter="twitter",t.google="google",t.microsoft="microsoft",t.yahoo="yahoo",t.email="email",t.alias="al
5ias",t.facebookCustomAudienceId="facebookcustomaudienceid",t.otherId2="other2",t.otherId3="other3",t.otherId4="other4",t.otherId5="other5",t.otherId6="other6",t.otherId7="other7",t.otherId8="other8",t.otherId9="other9",t.otherId10="other10",t.mobileNumber="mobile_number",t.phoneNumber2="phone_number_2",t.phoneNumber3="phone_number_3";})(ke||(ke={}));var Cd=F.FeatureFlags,Xv=Cd.CaptureIntegrationSpecificIds,Qv=Cd.CaptureIntegrationSpecificIdsV2;function Ed(t,e,r){if(!t||!e||1>e.length)return null;for(var n,i=r._IntegrationCapture,o=r._Helpers,s=o.getFeatureFlag,a=r.Identity.getCurrentUser(),u=[],l=null,c=0,d=e;c<d.length;c++)if(n=d[c],n){l=n;var h=_a(n);h&&u.push(h);}if(!l)return null;var p=null;_e(l.ConsentState)?!_e(a)&&(p=a.getConsentState()):p=l.ConsentState;var f={source_request_id:r._Helpers.generateUniqueId(),mpid:t,timestamp_unixtime_ms:new Date().getTime(),environment:l.Debug?j.BatchEnvironmentEnum.development:j.BatchEnvironmentEnum.production,events:u,mp_deviceid:l.DeviceId,sdk_version:l.SDKVersion,application_info:{application_version:l.AppVersion,application_name:l.AppName,package:l.Package,sideloaded_kits_count:r._Store.sideloadedKitsCount},device_info:{platform:j.DeviceInformationPlatformEnum.web,screen_width:typeof window!="undefined"&&typeof window.screen!="undefined"?window.screen.width:0,screen_height:typeof window!="undefined"&&typeof window.screen!="undefined"?window.screen.height:0},user_attributes:l.UserAttributes,user_identities:rb(l.UserIdentities),consent_state:Zv(p),integration_attributes:l.IntegrationAttributes};l.DataPlan&&l.DataPlan.PlanId&&(f.context={data_plan:{plan_id:l.DataPlan.PlanId,plan_version:l.DataPlan.PlanVersion||void 0}});var g=s&&!!s(Xv),v=s&&s(Qv),m=v&&v!==F.CaptureIntegrationSpecificIdsV2Modes.None||g===true;if(m){var y=i==null?void 0:i.getClickIdsAsPartnerIdentities();_e(y)||(f.partner_identities=y);}return f}function Zv(t){if(_e(t))return null;var e={gdpr:eb(t.getGDPRConsentState()),ccpa:tb(t.getCCPAConsentState())};return e}function eb(t){if(!t)return null;var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]={consented:t[r].Consented,hardware_id:t[r].HardwareId,document:t[r].ConsentDocument,timestamp_unixtime_ms:t[r].Timestamp,location:t[r].Location});return e}function tb(t){if(!t)return null;var e={data_sale_opt_out:{consented:t.Consented,hardware_id:t.HardwareId,document:t.ConsentDocument,timestamp_unixtime_ms:t.Timestamp,location:t.Location}};return e}function rb(t){if(!t||!t.length)return null;for(var e,r={},n=0,i=t;n<i.length;n++)switch(e=i[n],e.Type){case I.IdentityType.CustomerId:r.customer_id=e.Identity;break;case I.IdentityType.Email:r.email=e.Identity;break;case I.IdentityType.Facebook:r.facebook=e.Identity;break;case I.IdentityType.FacebookCustomAudienceId:r.facebook_custom_audience_id=e.Identity;break;case I.IdentityType.Google:r.google=e.Identity;break;case I.IdentityType.Microsoft:r.microsoft=e.Identity;break;case I.IdentityType.Other:r.other=e.Identity;break;case I.IdentityType.Other2:r.other_id_2=e.Identity;break;case I.IdentityType.Other3:r.other_id_3=e.Identity;break;case I.IdentityType.Other4:r.other_id_4=e.Identity;break;case I.IdentityType.Other5:r.other_id_5=e.Identity;break;case I.IdentityType.Other6:r.other_id_6=e.Identity;break;case I.IdentityType.Other7:r.other_id_7=e.Identity;break;case I.IdentityType.Other8:r.other_id_8=e.Identity;break;case I.IdentityType.Other9:r.other_id_9=e.Identity;break;case I.IdentityType.Other10:r.other_id_10=e.Identity;break;case I.IdentityType.MobileNumber:r.mobile_number=e.Identity;break;case I.IdentityType.PhoneNumber2:r.phone_number_2=e.Identity;break;case I.IdentityType.PhoneNumber3:r.phone_number_3=e.Identity;break}return r}function _a(t){if(!t)return null;switch(t.EventDataType){case I.MessageType.AppStateTransition:return db(t);case I.MessageType.Commerce:return lb(t);case I.MessageType.CrashReport:return cb(t);case I.MessageType.OptOut:return fb(t);case I.MessageType.PageEvent:return mb(t);case I.MessageType.PageView:return gb(t);case I.MessageType.Profile:return null;case I.MessageType.SessionEnd:return hb(t);case I.MessageType.SessionStart:return pb(t);case I.MessageType.UserAttributeChange:return _b(t);
5case I.MessageType.UserIdentityChange:return yb(t)}return null}function nb(t){return t?t===kt.AddToCart?j.ProductActionActionEnum.addToCart:t===kt.AddToWishlist?j.ProductActionActionEnum.addToWishlist:t===kt.Checkout?j.ProductActionActionEnum.checkout:t===kt.CheckoutOption?j.ProductActionActionEnum.checkoutOption:t===kt.Click?j.ProductActionActionEnum.click:t===kt.Purchase?j.ProductActionActionEnum.purchase:t===kt.Refund?j.ProductActionActionEnum.refund:t===kt.RemoveFromCart?j.ProductActionActionEnum.removeFromCart:t===kt.RemoveFromWishlist?j.ProductActionActionEnum.removeFromWishlist:t===kt.ViewDetail?j.ProductActionActionEnum.viewDetail:j.ProductActionActionEnum.unknown:j.ProductActionActionEnum.unknown}function ib(t){if(!t.ProductAction)return null;var e={action:nb(t.ProductAction.ProductActionType),checkout_step:t.ProductAction.CheckoutStep,checkout_options:t.ProductAction.CheckoutOptions,transaction_id:t.ProductAction.TransactionId,affiliation:t.ProductAction.Affiliation,total_amount:t.ProductAction.TotalAmount,tax_amount:t.ProductAction.TaxAmount,shipping_amount:t.ProductAction.ShippingAmount,coupon_code:t.ProductAction.CouponCode,products:Ea(t.ProductAction.ProductList)};return e}function Ea(t){if(!t||!t.length)return null;for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r],o={id:i.Sku,name:i.Name,brand:i.Brand,category:i.Category,variant:i.Variant,total_product_amount:i.TotalAmount,position:i.Position,price:i.Price,quantity:i.Quantity,coupon_code:i.CouponCode,custom_attributes:i.Attributes};e.push(o);}return e}function ob(t){if(!t.PromotionAction)return null;var e={action:t.PromotionAction.PromotionActionType,promotions:sb(t.PromotionAction.PromotionList)};return e}function sb(t){if(!t||!t.length)return null;for(var e=[],r=0,n=t;r<n.length;r++){var i=n[r],o={id:i.Id,name:i.Name,creative:i.Creative,position:i.Position};e.push(o);}return e}function ab(t){if(!t.ProductImpressions)return null;for(var e=[],r=0,n=t.ProductImpressions;r<n.length;r++){var i=n[r],o={product_impression_list:i.ProductImpressionList,products:Ea(i.ProductList)};e.push(o);}return e}function ub(t){if(!t.ShoppingCart||!t.ShoppingCart.ProductList||!t.ShoppingCart.ProductList.length)return null;var e={products:Ea(t.ShoppingCart.ProductList)};return e}function lb(t){var e=or(t),r={custom_flags:t.CustomFlags,product_action:ib(t),promotion_action:ob(t),product_impressions:ab(t),shopping_cart:ub(t),currency_code:t.CurrencyCode};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.commerceEvent,data:r}}function cb(t){var e=or(t),r={message:t.EventName};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.crashReport,data:r}}function db(t){var e=or(t),r=j.ApplicationStateTransitionEventDataApplicationTransitionTypeEnum,n=r.applicationBackground,i=r.applicationInitialized,o=t.IsBackgroundAST?n:i,s={application_transition_type:o,is_first_run:t.IsFirstRun,is_upgrade:false,launch_referral:t.LaunchReferral};return s=Object.assign(s,e),{event_type:j.EventTypeEnum.applicationStateTransition,data:s}}function hb(t){var e=or(t),r={session_duration_ms:t.SessionLength};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.sessionEnd,data:r}}function pb(t){var e=or(t),r={};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.sessionStart,data:r}}function gb(t){var e=or(t),r={custom_flags:t.CustomFlags,screen_name:t.EventName};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.screenView,data:r}}function fb(t){var e=or(t),r={is_opted_out:t.OptOut};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.optOut,data:r}}function mb(t){var e=or(t),r={custom_event_type:vb(t.EventCategory),custom_flags:t.CustomFlags,event_name:t.EventName};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.customEvent,data:r}}function vb(t){return t===I.EventType.Other?j.CustomEventDataCustomEventTypeEnum.other:t===I.EventType.Location?j.CustomEventDataCustomEventTypeEnum.location:t===I.EventType.Navigation?j.CustomEventDataCustomEventTypeEnum.navigation:t===I.EventType.Search?j.CustomEventDataCustomEventTypeEnum.search:t===I.EventType.Social?j.CustomEventDataCustomEventTypeEnum.social:t===I.EventType.Transaction?j.CustomEventDataCustomEventTypeEnum.transaction:t===I.EventType.UserContent?j.CustomEventDataCustomEventTypeEnum.userContent:t===I.EventType.UserPreference?j.CustomEventDataCustomEventTypeEnum.userPreference:t===I.EventType.Media?j.CustomEventDataCustomEventTypeEnum.media:t===I.CommerceEventType.ProductAddToCart?j.CommerceEventDataCustomEventTypeEnum.addToCart:t===I.CommerceEventType.ProductAddToWishlist?j.
5CommerceEventDataCustomEventTypeEnum.addToWishlist:t===I.CommerceEventType.ProductCheckout?j.CommerceEventDataCustomEventTypeEnum.checkout:t===I.CommerceEventType.ProductCheckoutOption?j.CommerceEventDataCustomEventTypeEnum.checkoutOption:t===I.CommerceEventType.ProductClick?j.CommerceEventDataCustomEventTypeEnum.click:t===I.CommerceEventType.ProductImpression?j.CommerceEventDataCustomEventTypeEnum.impression:t===I.CommerceEventType.ProductPurchase?j.CommerceEventDataCustomEventTypeEnum.purchase:t===I.CommerceEventType.ProductRefund?j.CommerceEventDataCustomEventTypeEnum.refund:t===I.CommerceEventType.ProductRemoveFromCart?j.CommerceEventDataCustomEventTypeEnum.removeFromCart:t===I.CommerceEventType.ProductRemoveFromWishlist?j.CommerceEventDataCustomEventTypeEnum.removeFromWishlist:t===I.CommerceEventType.ProductViewDetail?j.CommerceEventDataCustomEventTypeEnum.viewDetail:t===I.CommerceEventType.PromotionClick?j.CommerceEventDataCustomEventTypeEnum.promotionClick:t===I.CommerceEventType.PromotionView?j.CommerceEventDataCustomEventTypeEnum.promotionView:j.CustomEventDataCustomEventTypeEnum.unknown}function or(t){var e={timestamp_unixtime_ms:t.Timestamp,session_uuid:t.SessionId,session_start_unixtime_ms:t.SessionStartDate,custom_attributes:t.EventAttributes,location:bb(t.Location),source_message_id:t.SourceMessageId,active_time_on_site_ms:t.ActiveTimeOnSite};return e}function bb(t){return t&&Object.keys(t).length?{latitude:t.lat,longitude:t.lng}:null}function _b(t){var e=or(t),r={user_attribute_name:t.UserAttributeChanges.UserAttributeName,new:t.UserAttributeChanges.New,old:t.UserAttributeChanges.Old,deleted:t.UserAttributeChanges.Deleted,is_new_attribute:t.UserAttributeChanges.IsNewAttribute};return r=pe(pe({},r),e),{event_type:j.EventTypeEnum.userAttributeChange,data:r}}function yb(t){var e=or(t),r={new:{identity_type:ld(t.UserIdentityChanges.New.IdentityType),identity:t.UserIdentityChanges.New.Identity||null,timestamp_unixtime_ms:t.Timestamp,created_this_batch:t.UserIdentityChanges.New.CreatedThisBatch},old:{identity_type:ld(t.UserIdentityChanges.Old.IdentityType),identity:t.UserIdentityChanges.Old.Identity||null,timestamp_unixtime_ms:t.Timestamp,created_this_batch:t.UserIdentityChanges.Old.CreatedThisBatch}};return r=Object.assign(r,e),{event_type:j.EventTypeEnum.userIdentityChange,data:r}}function ld(t){return t===ke.other?j.IdentityTypeEnum.other:t===ke.customerId?j.IdentityTypeEnum.customerId:t===ke.facebook?j.IdentityTypeEnum.facebook:t===ke.twitter?j.IdentityTypeEnum.twitter:t===ke.google?j.IdentityTypeEnum.google:t===ke.microsoft?j.IdentityTypeEnum.microsoft:t===ke.yahoo?j.IdentityTypeEnum.yahoo:t===ke.email?j.IdentityTypeEnum.email:t===ke.alias?j.IdentityTypeEnum.alias:t===ke.facebookCustomAudienceId?j.IdentityTypeEnum.facebookCustomAudienceId:t===ke.otherId2?j.IdentityTypeEnum.otherId2:t===ke.otherId3?j.IdentityTypeEnum.otherId3:t===ke.otherId4?j.IdentityTypeEnum.otherId4:t===ke.otherId5?j.IdentityTypeEnum.otherId5:t===ke.otherId6?j.IdentityTypeEnum.otherId6:t===ke.otherId7?j.IdentityTypeEnum.otherId7:t===ke.otherId8?j.IdentityTypeEnum.otherId8:t===ke.otherId9?j.IdentityTypeEnum.otherId9:t===ke.otherId10?j.IdentityTypeEnum.otherId10:t===ke.mobileNumber?j.IdentityTypeEnum.mobileNumber:t===ke.phoneNumber2?j.IdentityTypeEnum.phoneNumber2:t===ke.phoneNumber3?j.IdentityTypeEnum.phoneNumber3:void 0}var Pa=(function(){function t(e,r,n){this._storageKey=e,this.storageObject=r,this.logger=(n==null?void 0:n.logger)||{verbose:function(){},warning:function(){},error:function(){}},this.contents=this.retrieve();}return t.prototype.store=function(e){var r;this.contents=e,r=un(e)||!_e(e)?JSON.stringify(e):"";try{this.storageObject.setItem(this._storageKey,r),this.logger.verbose("Saving item to Storage: ".concat(r));}catch(n){this.logger.error("Cannot Save items to Storage: ".concat(r)),this.logger.error(n);}},t.prototype.retrieve=function(){var e=this.storageObject.getItem(this._storageKey);return this.contents=e?JSON.parse(e):null,this.logger.verbose("Retrieving item from Storage: ".concat(e)),this.contents},t.prototype.purge=function(){this.logger.verbose("Purging Storage"),this.contents=null,this.storageObject.removeItem(this._storageKey);},t})(),Ia=(function(t){function e(r,n){return t.call(this,r,window.localStorage,n)||this}return gi(e,t),e})(Pa),wb=(function(t){function e(r,n){return t.call(this,r,window.sessionStorage,n)||this}return gi(e,t),e})(Pa),Sb=(function(t){function e(r,n){var i=t.call(this,r,window.localStorage,n)||this;return i.contents=null,i}return gi(e,t),e.prototype.store=function(){this.contents=null;},e.prototype.retrieve=function(){return this.contents},e})(Pa),Pd=(function(){function t(e){this.url=e;}return t})(),Nn=(function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return gi(e,t),e.prototype.upload=function(r,n){return nr(this,void 0,void 0,function(){var i;return ir(this,function(o){switch(o.label){case 0:return i=n||this.url,[4,fetch(i,r)];case 1:return [2,o.sent()]}})})},e})(Pd),Dn=(function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return gi(e,t),e.prototype.upload=function(r){return nr(this,void 0,void 0,function(){var n;return ir(this,function(i){switch(i.label){case 0:return [4,this.makeRequest
5(this.url,r.body,r.method,r.headers)];case 1:return n=i.sent(),[2,n]}})})},e.prototype.makeRequest=function(r,n,i,o){return i===void 0&&(i="post"),o===void 0&&(o={}),nr(this,void 0,void 0,function(){var s;return ir(this,function(){return s=new XMLHttpRequest,[2,new Promise(function(a,u){for(var l in s.onreadystatechange=function(){s.readyState!==4||a(s);},s.onerror=function(){u(s);},s.open(i,r),o)o.hasOwnProperty(l)&&s.setRequestHeader(l,o[l]);s.send(n);})]})})},e})(Pd);function Cb(t,e){return !t||e.getMPID()!==t.getMPID()||t.isLoggedIn()!==e.isLoggedIn()}function Eb(t,e){return !t||t.getMPID()&&e.mpid&&e.mpid!==t.getMPID()}function Aa(t,e){if(e){if(!t)return e.MPID=null,e.ConsentState=null,e.UserAttributes=null,void(e.UserIdentities=null);if(!(e.MPID&&e.MPID===t.getMPID())){e.MPID=t.getMPID(),e.ConsentState=t.getConsentState(),e.UserAttributes=t.getAllUserAttributes();var r=t.getUserIdentities().userIdentities,n={};for(var i in r){var o=I.IdentityType.getIdentityType(i);o!==false&&(n[o]=r[i]);}var s=[];if(it(n)&&Object.keys(n).length)for(var a in n){var u={};u.Identity=n[a],u.Type=rr(a),s.push(u);}e.UserIdentities=s;}}}var Pb=(function(){function t(e,r){var n;this.offlineStorageEnabled=false,this.lastASTEventTime=0,this.AST_DEBOUNCE_MS=1e3,this.mpInstance=e,this.uploadIntervalMillis=r,this.batchingEnabled=r>=t.MINIMUM_INTERVAL_MILLIS,this.uploadIntervalMillis<t.MINIMUM_INTERVAL_MILLIS&&(this.uploadIntervalMillis=t.MINIMUM_INTERVAL_MILLIS),this.eventsQueuedForProcessing=[],this.batchesQueuedForProcessing=[],this.offlineStorageEnabled=this.isOfflineStorageAvailable()&&!e._Store.getPrivacyFlag("OfflineEvents"),this.offlineStorageEnabled&&(this.eventVault=new wb("".concat(e._Store.storageName,"-events"),{logger:e.Logger}),this.batchVault=new Ia("".concat(e._Store.storageName,"-batches"),{logger:e.Logger}),(n=this.eventsQueuedForProcessing).push.apply(n,this.eventVault.retrieve()));var i=this.mpInstance._Store,o=i.SDKConfig,s=i.devToken,a=this.mpInstance._Helpers.createServiceUrl(o.v3SecureServiceUrl,s);this.uploadUrl="".concat(a,"/events"),this.uploader=window.fetch?new Nn(this.uploadUrl):new Dn(this.uploadUrl),this.triggerUploadInterval(true,false),this.addEventListeners();}return t.prototype.isOfflineStorageAvailable=function(){var e=this.mpInstance,r=e._Helpers.getFeatureFlag,n=e._Store.deviceId,i=r(F.FeatureFlags.OfflineStorage),o=parseInt(i,10),s=kv(n);return o>=s},t.prototype.shouldDebounceAndUpdateLastASTTime=function(){var e=Date.now();return e-this.lastASTEventTime<this.AST_DEBOUNCE_MS||(this.lastASTEventTime=e,false)},t.prototype.createBackgroundASTEvent=function(){var e=Date.now(),r=this.mpInstance,n=r._Store,i=r.Identity,o=r._timeOnSiteTimer,s=r._Helpers,a=n.sessionId,u=n.deviceId,l=n.sessionStartDate,c=n.SDKConfig,d=s.generateUniqueId,h=s.getFeatureFlag,p=i.getCurrentUser,f={AppName:c.appName,AppVersion:c.appVersion,Package:c.package,EventDataType:an.AppStateTransition,Timestamp:e,SessionId:a,DeviceId:u,IsFirstRun:false,SourceMessageId:d(),SDKVersion:F.sdkVersion,CustomFlags:{},EventAttributes:{},SessionStartDate:(l==null?void 0:l.getTime())||e,Debug:c.isDevelopmentMode,ActiveTimeOnSite:(o==null?void 0:o.getTimeInForeground())||0,IsBackgroundAST:true},g=pe({},f.CustomFlags),v=n.integrationAttributes,m=h(F.FeatureFlags.CaptureIntegrationSpecificIds),y=h(F.FeatureFlags.CaptureIntegrationSpecificIdsV2)||"",T=y&&y!==F.CaptureIntegrationSpecificIdsV2Modes.None||m===true;if(T){this.mpInstance._IntegrationCapture.capture();var k=this.mpInstance._IntegrationCapture.getClickIdsAsCustomFlags();g=pe(pe({},k),g);var N=this.mpInstance._IntegrationCapture.getClickIdsAsIntegrationAttributes();v=pe(pe({},N),v);}return f.CustomFlags=g,f.IntegrationAttributes=v,Aa(p(),f),f},t.prototype.addEventListeners=function(){var e=this,r=this,n=function(){var i=e.mpInstance._Helpers.getFeatureFlag,o=F.FeatureFlags.AstBackgroundEvents;if(i(o)){if(r.shouldDebounceAndUpdateLastASTTime())return;var s=r.createBackgroundASTEvent();r.queueEvent(s);}r.prepareAndUpload(false,r.isBeaconAvailable());};document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&n();}),window.addEventListener("beforeunload",n),window.addEventListener("pagehide",n);},t.prototype.isBeaconAvailable=function(){return !!navigator.sendBeacon},t.prototype.triggerUploadInterval=function(e,r){var n=this;e===void 0&&(e=false),r===void 0&&(r=false),setTimeout(function(){n.prepareAndUpload(e,r);},this.uploadIntervalMillis);},t.prototype.queueEvent=function(e){if(!_e(e)){var r=this.mpInstance.Logger.verbose;this.eventsQueuedForProcessing.push(e),this.offlineStorageEnabled&&this.eventVault&&this.eventVault.store(this.eventsQueuedForProcessing),r("Queuing event: ".concat(JSON.stringify(e))),r("Queued event count: ".concat(this.eventsQueuedForProcessing.length)),this.shouldTriggerImmediateUpload(e.EventDataType)&&this.prepareAndUpload(false,false);}},t.prototype.shouldTriggerImmediateUpload=function(e){var r=[an.Commerce,an.UserIdentityChange];return !this.batchingEnabled||r.includes(e)},t.createNewBatches=function(e,r,n){if(!r||!e||!e.length)return null;for(var i,o=[],s=new Map,a=0,u=e;a<u.length;a++){if(i=u[a],!i.MPID){var l=r.getMPID();i.MPID=l;}var c=s.get(i.MPID);c||(c=[]),c.push(i),s.set(i.MPID,c);}for(var d=0,h=Array.from(s.entries());d<h.length;d++){for(var p=h[d],l=p[0],f=p[1],g=new Map,v=0,m=f;v<m.length;v++){var i=m[v],c=g.get(i.SessionId);c||(c=[]),c.push(i),g.set(i.SessionId,c);}for(var y=0,T=Array.from(g.entries());y<T.length;y++){var k=T[y],N=Ed(l,k[1],n),_=n._Store.SDKConfig.onCreateBatch;
5_&&(N=_(N),N?N.modified=true:n.Logger.warning("Skiping batch upload because no batch was returned from onCreateBatch callback")),N&&o.push(N);}}return o},t.prototype.prepareAndUpload=function(e,r){return e===void 0&&(e=false),r===void 0&&(r=false),nr(this,void 0,void 0,function(){var n,i,o,s,a,u,l,c;return ir(this,function(d){switch(d.label){case 0:return n=this.mpInstance.Identity.getCurrentUser(),i=this.eventsQueuedForProcessing,this.eventsQueuedForProcessing=[],this.offlineStorageEnabled&&this.eventVault&&this.eventVault.store([]),o=[],_e(i)||(o=t.createNewBatches(i,n,this.mpInstance)),this.offlineStorageEnabled&&this.batchVault&&((u=this.batchesQueuedForProcessing).unshift.apply(u,this.batchVault.retrieve()),this.batchVault.purge()),_e(o)||(l=this.batchesQueuedForProcessing).push.apply(l,o),s=this.batchesQueuedForProcessing,this.batchesQueuedForProcessing=[],[4,this.uploadBatches(this.mpInstance.Logger,s,r)];case 1:return a=d.sent(),_e(a)||(c=this.batchesQueuedForProcessing).unshift.apply(c,a),!r&&this.offlineStorageEnabled&&this.batchVault&&(this.batchVault.store(this.batchesQueuedForProcessing),this.batchesQueuedForProcessing=[]),e&&this.triggerUploadInterval(e,false),[2]}})})},t.prototype.uploadBatches=function(e,r,n){return nr(this,void 0,void 0,function(){var i,o,s,a,u,l;return ir(this,function(c){switch(c.label){case 0:if(i=r.filter(function(d){return !_e(d.events)}),_e(i))return [2,null];e.verbose("Uploading batches: ".concat(JSON.stringify(i))),e.verbose("Batch count: ".concat(i.length)),o=0,c.label=1;case 1:return o<i.length?(s={method:"POST",headers:{Accept:t.CONTENT_TYPE,"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify(i[o])},n&&this.isBeaconAvailable()?(a=new Blob([s.body],{type:"text/plain;charset=UTF-8"}),navigator.sendBeacon(this.uploadUrl,a),[3,5]):[3,2]):[3,6];case 2:return c.trys.push([2,4,,5]),[4,this.uploader.upload(s)];case 3:if(u=c.sent(),200<=u.status&&300>u.status)e.verbose("Upload success for request ID: ".concat(i[o].source_request_id));else {if(500<=u.status||u.status===429)return e.error("HTTP error status ".concat(u.status," received")),[2,i.slice(o,i.length)];if(401<=u.status)return e.error("HTTP error status ".concat(u.status," while uploading - please verify your API key.")),[2,null];throw console.error("HTTP error status ".concat(u.status," while uploading events."),u),new Error("Uncaught HTTP Error ".concat(u.status,".  Batch upload will be re-attempted."))}return [3,5];case 4:return l=c.sent(),e.error("Error sending event to mParticle servers. ".concat(l)),[2,i.slice(o,i.length)];case 5:return o++,[3,1];case 6:return [2,null]}})})},t.CONTENT_TYPE="text/plain;charset=UTF-8",t.MINIMUM_INTERVAL_MILLIS=500,t})();function Id(t,e){this.uploader=null;var r=this;this.queueEventForBatchUpload=function(n){if(!this.uploader){var i=rr(t._Helpers.getFeatureFlag(F.FeatureFlags.EventBatchingIntervalMillis));this.uploader=new Pb(t,i);}this.uploader.queueEvent(n),t._Persistence.update();},this.processQueuedEvents=function(){var n,i=t.Identity.getCurrentUser();if(i&&(n=i.getMPID()),t._Store.eventQueue.length&&n){var o=t._Store.eventQueue;t._Store.eventQueue=[],this.appendUserInfoToEvents(i,o),o.forEach(function(s){r.sendEventToServer(s);});}},this.appendUserInfoToEvents=function(n,i){i.forEach(function(o){o.MPID||Aa(n,o);});},this.sendEventToServer=function(n,i){var o=t._Helpers.extend({shouldUploadEvent:true},i);if(t._Store.webviewBridgeEnabled)return void t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.LogEvent,JSON.stringify(n));var s,a=t.Identity.getCurrentUser();return a&&(s=a.getMPID()),t._Store.requireDelay=t._Helpers.isDelayedByIntegration(t._preInit.integrationDelays,t._Store.integrationDelayTimeoutStart,Date.now()),!s||t._Store.requireDelay||!t._Store.configurationLoaded?(t.Logger.verbose("Event was added to eventQueue. eventQueue will be processed once a valid MPID is returned or there is no more integration imposed delay."),void t._Store.eventQueue.push(n)):(this.processQueuedEvents(),void(_e(n)||(o.shouldUploadEvent&&this.queueEventForBatchUpload(n),n.EventName!==I.MessageType.AppStateTransition&&(e&&e.kitBlockingEnabled&&(n=e.createBlockedEvent(n)),n&&t._Forwarders.sendEventToForwarders(n)))))},this.sendBatchForwardingStatsToServer=function(n,i){var o,s;try{o=t._Helpers.createServiceUrl(t._Store.SDKConfig.v2SecureServiceUrl,t._Store.devToken),s={uuid:t._Helpers.generateUniqueId(),data:n},i&&(i.open("post",o+"/Forwarding"),i.send(JSON.stringify(s)));}catch(a){t.Logger.error("Error sending forwarding stats to mParticle servers.");}},this.initializeForwarderStatsUploader=function(){var n=t._Store.SDKConfig.v1SecureServiceUrl,i=t._Store.devToken,o="https://".concat(n).concat(i,"/Forwarding"),s=window.fetch?new 
5Nn(o):new Dn(o);return s},this.prepareForwardingStats=function(n,i){var o,s=t._Forwarders.getForwarderStatsQueue();if(n&&n.isVisible){o={mid:n.id,esid:n.eventSubscriptionId,n:i.EventName,attrs:i.EventAttributes,sdk:i.SDKVersion,dt:i.EventDataType,et:i.EventCategory,dbg:i.Debug,ct:i.Timestamp,eec:i.ExpandedEventCount,dp:i.DataPlan};var a=t._Forwarders,u=a.sendSingleForwardingStatsToServer,l=a.setForwarderStatsQueue;t._Helpers.getFeatureFlag(F.FeatureFlags.ReportBatching)?(s.push(o),l(s)):u(o);}};}var Ib=F.IdentityMethods.Modify,Ad={isNumber:un,isFunction:fi,isStringOrNumber:Ca,isValidAttributeValue:Bv,isValidKeyValue:function(e){return !(!e||it(e)||Array.isArray(e)||this.isFunction(e))},removeFalsyIdentityValues:function(e,r){if(!e||!e.userIdentities)return e;var n={},i=pe({},e.userIdentities);for(var o in e.userIdentities)if(e.userIdentities.hasOwnProperty(o)){var s=e.userIdentities[o];s===null||s||(r.warning("Identity value for '".concat(o,"' is falsy (").concat(s,"). This value will be removed from the request.")),delete i[o]);}return n.userIdentities=i,n},validateIdentities:function(e,r){var n={userIdentities:1,onUserAlias:1,copyUserAttributes:1};if(e){if(r===Ib&&(it(e.userIdentities)&&!Object.keys(e.userIdentities).length||!it(e.userIdentities)))return {valid:false,error:F.Messages.ValidationMessages.ModifyIdentityRequestUserIdentitiesPresent};for(var i in e)if(e.hasOwnProperty(i)){if(!n[i])return {valid:false,error:F.Messages.ValidationMessages.IdentityRequesetInvalidKey};if(i==="onUserAlias"&&!Ad.isFunction(e[i]))return {valid:false,error:F.Messages.ValidationMessages.OnUserAliasType}}if(Object.keys(e).length===0)return {valid:true};if(e.userIdentities===void 0)return {valid:false,error:F.Messages.ValidationMessages.UserIdentities};if(e.userIdentities!==null&&!it(e.userIdentities))return {valid:false,error:F.Messages.ValidationMessages.UserIdentities};if(it(e.userIdentities)&&Object.keys(e.userIdentities).length){for(var o in e.userIdentities)if(e.userIdentities.hasOwnProperty(o)){if(I.IdentityType.getIdentityType(o)===false)return {valid:false,error:F.Messages.ValidationMessages.UserIdentitiesInvalidKey};if(typeof e.userIdentities[o]!="string"&&e.userIdentities[o]!==null)return {valid:false,error:F.Messages.ValidationMessages.UserIdentitiesInvalidValues}}}}return {valid:true}}},He=(function(){function t(){}t.hashEventType=function(r){return zt(r)},t.hashEventName=function(r,n){return zt(n+r)},t.hashEventAttributeKey=function(r,n,i){return zt(r+n+i)},t.hashUserAttribute=function(r){return zt(r)},t.hashUserIdentity=function(r){return r},t.hashConsentPurpose=function(r,n){return zt(r+n)},t.hashAttributeConditionalForwarding=function(r){return zt(r).toString()},t.hashConsentPurposeConditionalForwarding=function(r,n){return this.hashConsentPurpose(r,n).toString()};var e;return e=t,t.filterUserAttributes=function(r,n){return ud(r,n,function(i){return e.hashUserAttribute(i)})},t.filterUserIdentities=function(r,n){return ud(r,n,function(i){return e.hashUserIdentity(te.getIdentityType(i))})},t.isFilteredUserAttribute=function(r,n){var i=e.hashUserAttribute(r);return n&&wa(n,i)},t})(),yo=F.StorageNames;function Ab(t){var e=this;this.canLog=function(){return !!(t._Store.isEnabled&&(t._Store.devToken||t._Store.webviewBridgeEnabled))},this.getFeatureFlag=function(r){return t._Store.SDKConfig.flags.hasOwnProperty(r)?t._Store.SDKConfig.flags[r]:null},this.invokeCallback=function(r,n,i,o,s){r||t.Logger.warning("There is no callback provided");try{e.Validators.isFunction(r)&&r({httpCode:n,body:i,getUser:function(){return o||t.Identity.getCurrentUser()},getPreviousUser:function(){if(!s){var u=t.Identity.getUsers(),l=u.shift(),c=o||t.Identity.getCurrentUser();return l&&c&&l.getMPID()===c.getMPID()&&(l=u.shift()),l||null}return t.Identity.getUser(s)}});}catch(a){t.Logger.error("There was an error with your callback: "+a);}},this.invokeAliasCallback=function(r,n,i){r||t.Logger.warning("There is no callback provided");try{if(e.Validators.isFunction(r)){var o={httpCode:n};i&&(o.message=i),r(o);}}catch(s){t.Logger.error("There was an error with your callback: "+s);}},this.extend=function(){var r,n,i,o,s,a,u=arguments[0]||{},l=1,c=arguments.length,d=false,h={hasOwn:Object.prototype.hasOwnProperty,class2type:{},type:function(f){return f==null?f+"":h.class2type[Object.prototype.toString.call(f)]||"object"},isPlainObject:function(f){if(!f||h.type(f)!=="object"||f.nodeType||h.isWindow(f))return  false;try{if(f.constructor&&!h.hasOwn.call(f,"constructor")&&!h.hasOwn.call(f.constructor.prototype,"isPrototypeOf"))return !1}catch(v){return  false}for(var g in f);return g===void 0||h.hasOwn.call(f,g)},isArray:Array.isArray||function(p){return h.type(p)==="array"},isFunction:function(f){return h.type(f)==="function"},isWindow:function(f){return f!=null&&f==f.window}};for(typeof u=="boolean"&&(d=u,u=arguments[1]||{},l=2),wt(u)==="object"||h.isFunction(u)||(u={}),c===l&&(u=this,--l);l<c;l++)if((r=arguments[l])!=null)for(n in r)i=u[n],o=r[n],u!==o&&(d&&o&&(h.isPlainObject(o)||(s=h.isArray(o)))?(s?(s=false,a=i&&h.isArray(i)?i:[]):a=i&&h.isPlainObject(i)?i:{},u[n]=e.extend(d,a,o)):o!==void 0&&(u[n]=o));return u},this.createServiceUrl=function(r,n){var i,o=window.mParticle&&t._Store.SDKConfig.forceHttps?"https://":window.location.protocol+"//";
5return i=t._Store.SDKConfig.forceHttps?"https://"+r:o+r,n&&(i+=n),i},this.createXHR=function(r){var n;try{n=new window.XMLHttpRequest;}catch(i){t.Logger.error("Error creating XMLHttpRequest object.");}if(n&&r&&"withCredentials"in n)n.onreadystatechange=r;else if(typeof window.XDomainRequest!="undefined"){t.Logger.verbose("Creating XDomainRequest object");try{n=new window.XDomainRequest,n.onload=r;}catch(i){t.Logger.error("Error creating XDomainRequest object");}}return n},this.filterUserIdentities=function(r,n){var i=[];if(r&&Object.keys(r).length){for(var o in r)if(r.hasOwnProperty(o)){var s=I.IdentityType.getIdentityType(o);if(!e.inArray(n,s)){var a={Type:s,Identity:r[o]};s===I.IdentityType.CustomerId?i.unshift(a):i.push(a);}}}return i},this.filterUserIdentitiesForForwarders=He.filterUserIdentities,this.filterUserAttributes=He.filterUserAttributes,this.isEventType=function(r){for(var n in I.EventType)if(I.EventType.hasOwnProperty(n)&&I.EventType[n]===r)return  true;return  false},this.sanitizeAttributes=function(r,n){if(!r||!e.isObject(r))return null;var i={};for(var o in r)r.hasOwnProperty(o)&&e.Validators.isValidAttributeValue(r[o])?i[o]=r[o]:t.Logger.warning("For '"+n+"', the corresponding attribute value of '"+o+"' must be a string, number, boolean, or null.");return i},this.isDelayedByIntegration=function(r,n,i){if(i-n>t._Store.SDKConfig.integrationDelayTimeout)return  false;for(var o in r)if(r[o]===true)return  true;return  false},this.createMainStorageName=function(r){return r?yo.currentStorageName+"_"+r:yo.currentStorageName},this.createProductStorageName=function(r){return r?yo.currentStorageProductsName+"_"+r:yo.currentStorageProductsName},this.converted=Fv,this.findKeyInObject=Av,this.parseNumber=rr,this.inArray=wa,this.isObject=it,this.decoded=Rv,this.parseStringOrNumber=on,this.generateHash=zt,this.generateUniqueId=Sa,this.Validators=Ad;}var li=F.Messages,cd="mParticleAndroid",ha="mParticle";function Tb(t){var e=this;this.initializeSessionAttributes=function(r){var n=F.NativeSdkPaths.SetSessionAttribute,i=JSON.stringify({key:"$src_env",value:"webview"}),o=JSON.stringify({key:"$src_key",value:r});e.sendToNative(n,i),r&&e.sendToNative(n,o);},this.isBridgeV2Available=function(r){if(!r)return  false;var n=ha+"_"+r+"_v2";return !!(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.hasOwnProperty(n))||!!(window.mParticle&&window.mParticle.uiwebviewBridgeName&&window.mParticle.uiwebviewBridgeName===n)||!!window.hasOwnProperty(cd+"_"+r+"_v2")},this.isWebviewEnabled=function(r,n){return t._Store.bridgeV2Available=e.isBridgeV2Available(r),t._Store.bridgeV1Available=e.isBridgeV1Available(),n===2?t._Store.bridgeV2Available:!(window.mParticle&&window.mParticle.uiwebviewBridgeName&&window.mParticle.uiwebviewBridgeName!==ha+"_"+r+"_v2")&&2>n&&(t._Store.bridgeV2Available||t._Store.bridgeV1Available)},this.isBridgeV1Available=function(){return !!(t._Store.SDKConfig.useNativeSdk||window.mParticleAndroid||t._Store.SDKConfig.isIOS)},this.sendToNative=function(r,n){return t._Store.bridgeV2Available&&t._Store.SDKConfig.minWebviewBridgeVersion===2||t._Store.bridgeV2Available&&2>t._Store.SDKConfig.minWebviewBridgeVersion?void e.sendViaBridgeV2(r,n,t._Store.SDKConfig.requiredWebviewBridgeName):t._Store.bridgeV1Available&&2>t._Store.SDKConfig.minWebviewBridgeVersion?void e.sendViaBridgeV1(r,n):void 0},this.sendViaBridgeV1=function(r,n){window.mParticleAndroid&&window.mParticleAndroid.hasOwnProperty(r)?(t.Logger.verbose(li.InformationMessages.SendAndroid+r),window.mParticleAndroid[r](n)):t._Store.SDKConfig.isIOS&&(t.Logger.verbose(li.InformationMessages.SendIOS+r),e.sendViaIframeToIOS(r,n));},this.sendViaIframeToIOS=function(r,n){var i=document.createElement("IFRAME");i.setAttribute("src","mp-sdk://"+r+"/"+encodeURIComponent(n)),document.documentElement.appendChild(i),i.parentNode.removeChild(i);},this.sendViaBridgeV2=function(r,n,i){if(i){var o,s,a=window[cd+"_"+i+"_v2"],u=ha+"_"+i+"_v2";return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers[u]&&(o=window.webkit.messageHandlers[u]),t.uiwebviewBridgeName===u&&(s=t[u]),a&&a.hasOwnProperty(r)?(t.Logger.verbose(li.InformationMessages.SendAndroid+r),void a[r](n)):void(o?(t.
5Logger.verbose(li.InformationMessages.SendIOS+r),o.postMessage(JSON.stringify({path:r,value:n?JSON.parse(n):null}))):s&&(t.Logger.verbose(li.InformationMessages.SendIOS+r),e.sendViaIframeToIOS(r,n)))}};}var kb=F.Messages,xb=kb.InformationMessages,Ob=864e5;function Nb(t){var e=this;this.attemptCookieSync=function(r,n){var i=t._Store,o=i.pixelConfigurations,s=i.webviewBridgeEnabled;if(r&&!s){var a=t._Persistence.getPersistence();_e(a)||o.forEach(function(u){var l,c,d=false,h=u.filteringConsentRuleValues,p=u.pixelUrl,f=u.redirectUrl,g=u.moduleId,v=u.frequencyCap,m=(h||{}).values;if(!_e(p)&&(_e(m)||(d=true),!(d&&n))){var y=t._Consent.isEnabledForUserConsent;if(y(h,t.Identity.getCurrentUser())){var T=(c=(l=a[r])===null||l===void 0?void 0:l.csd)!==null&&c!==void 0?c:{},k=T[g]||null;if(Db(v,k)){var N=Uv(r,p,f);e.performCookieSync(N,g.toString(),r,T);}}}});}},this.performCookieSync=function(r,n,i,o){var s=document.createElement("img");t.Logger.verbose(xb.CookieSync),s.onload=function(){o[n]=new Date().getTime(),t._Persistence.saveUserCookieSyncDatesToPersistence(i,o);},s.src=r;};}var Db=function(t,e){return !e||new Date().getTime()>new Date(e).getTime()+t*Ob},Ao=F.IdentityMethods,Mb=Ao.Identify,Ub=Ao.Modify,Lb=Ao.Login,Rb=Ao.Logout,dd="x-mp-max-age",Fb=function(t,e,r,n,i){if(!i){var o=Vb(n==null?void 0:n.cacheMaxAge);t===Lb||t===Mb?$b(t,e,o,r,n):(t===Ub||t===Rb)&&r.purge();}},$b=function(t,e,r,n,i){var o=i.responseText,s=i.status,a=n.retrieve()||{},u=Ta(t,e),l=zt(u),c=o.mpid,d=o.is_logged_in;a[l]={responseText:JSON.stringify({mpid:c,is_logged_in:d}),status:s,expireTimestamp:r},n.store(a);},Ta=function(t,e){var r="".concat(t,":").concat("device_application_stamp","=").concat(e.device_application_stamp,";"),n=Object.keys(e).length,i="";if(n){var o=[];for(var s in e)s!=="device_application_stamp"&&(o[I.IdentityType.getIdentityType(s)]=e[s]);i=o.reduce(function(a,u,l){var c=I.IdentityType.getIdentityName(l);return "".concat(a).concat(c,"=").concat(u,";")},r);}return i},Bb=function(t,e,r){var n=r==null?void 0:r.retrieve();if(!n)return  false;var i=Ta(t,e),o=zt(i);if(!n.hasOwnProperty(o))return  false;var s=n[o].expireTimestamp;return !(s<new Date().getTime())},zb=function(t,e,r){var n=Ta(t,e),i=zt(n),o=r.retrieve(),s=o?o[i]:null;return {responseText:qb(s.responseText),expireTimestamp:s.expireTimestamp,status:s.status}},jb=function(t,e){var r={};if(it(t==null?void 0:t.userIdentities))for(var n in t.userIdentities)r[n]=t.userIdentities[n];return r.device_application_stamp=e,r},Hb=function(t){var e=t.retrieve()||{},r=new Date().getTime();for(var n in e)e[n].expireTimestamp<r&&delete e[n];t.store(e);},hd=function(t,e,r,n,i,o,s){var a=Bb(s,t,e);if(a){var u=zb(s,t,e);return r(u,n,i,o,s,t,true),true}return  false},Vb=function(t){return t===void 0&&(t=wv),new Date().getTime()+t*Sv},qb=function(t){return t?JSON.parse(t):{}},Kb=function(t,e){if(!t||e==null||!e.userIdentities)return  false;var r=t.getUserIdentities().userIdentities,n=e.userIdentities;return JSON.stringify(r)!==JSON.stringify(n)},ci=F.Messages;function Gb(t){var e=this;this.initialize=function(){if(t._Store.sessionId){var r=6e4*t._Store.SDKConfig.sessionTimeout;if(new Date>new Date(t._Store.dateLastEventSent.getTime()+r))e.endSession(),e.startNewSession();else {var n=t.Identity.getCurrentUser(),i=t._Store.SDKConfig.identifyRequest;Kb(n,i)&&(t.Identity.identify(t._Store.SDKConfig.identifyRequest,t._Store.SDKConfig.identityCallback),t._Store.identifyCalled=true,t._Store.SDKConfig.identityCallback=null);}}else e.startNewSession();},this.getSession=function(){return t.Logger.warning(wd("SessionManager.getSession()","SessionManager.getSessionId()")),this.get
5SessionId()},this.getSessionId=function(){return t._Store.sessionId},this.startNewSession=function(){if(t.Logger.verbose(ci.InformationMessages.StartingNewSession),t._Helpers.canLog()){t._Store.sessionId=t._Helpers.generateUniqueId().toUpperCase();var r=t.Identity.getCurrentUser(),n=r?r.getMPID():null;if(n&&(t._Store.currentSessionMPIDs=[n]),!t._Store.sessionStartDate){var i=new Date;t._Store.sessionStartDate=i,t._Store.dateLastEventSent=i;}e.setSessionTimer(),t._Store.identifyCalled||(t.Identity.identify(t._Store.SDKConfig.identifyRequest,t._Store.SDKConfig.identityCallback),t._Store.identifyCalled=true,t._Store.SDKConfig.identityCallback=null),t._Events.logEvent({messageType:I.MessageType.SessionStart});}else t.Logger.verbose(ci.InformationMessages.AbandonStartSession);},this.endSession=function(r){var n,i,o,s,a;if(t.Logger.verbose(ci.InformationMessages.StartingEndSession),r)return t._Events.logEvent({messageType:I.MessageType.SessionEnd}),t._Store.nullifySession(),void((n=t._timeOnSiteTimer)===null||n===void 0?void 0:n.resetTimer());if(!t._Helpers.canLog())return t.Logger.verbose(ci.InformationMessages.AbandonEndSession),void((i=t._timeOnSiteTimer)===null||i===void 0?void 0:i.resetTimer());var u,l,c=t._Persistence.getPersistence();if(!c||c.gs&&!c.gs.sid)return t.Logger.verbose(ci.InformationMessages.NoSessionToEnd),void((o=t._timeOnSiteTimer)===null||o===void 0?void 0:o.resetTimer());if(c.gs.sid&&t._Store.sessionId!==c.gs.sid&&(t._Store.sessionId=c.gs.sid),(s=c==null?void 0:c.gs)===null||s===void 0?void 0:s.les){u=6e4*t._Store.SDKConfig.sessionTimeout;var d=new Date().getTime();l=d-c.gs.les,l<u?e.setSessionTimer():(t._Events.logEvent({messageType:I.MessageType.SessionEnd}),t._Store.sessionStartDate=null,t._Store.nullifySession());}(a=t._timeOnSiteTimer)===null||a===void 0||a.resetTimer();},this.setSessionTimer=function(){var r=6e4*t._Store.SDKConfig.sessionTimeout;t._Store.globalTimer=window.setTimeout(function(){e.endSession();},r);},this.resetSessionTimer=function(){t._Store.webviewBridgeEnabled||(!t._Store.sessionId&&e.startNewSession(),e.clearSessionTimeout(),e.setSessionTimer()),e.startNewSessionIfNeeded();},this.clearSessionTimeout=function(){clearTimeout(t._Store.globalTimer);},this.startNewSessionIfNeeded=function(){if(!t._Store.webviewBridgeEnabled){var r=t._Persistence.getPersistence();!t._Store.sessionId&&r&&(r.sid?t._Store.sessionId=r.sid:e.startNewSession());}};}var wo=F.Messages;function Wb(t){var e=this;this.convertTransactionAttributesToProductAction=function(r,n){r.hasOwnProperty("Id")&&(n.TransactionId=r.Id),r.hasOwnProperty("Affiliation")&&(n.Affiliation=r.Affiliation),r.hasOwnProperty("CouponCode")&&(n.CouponCode=r.CouponCode),r.hasOwnProperty("Revenue")&&(n.TotalAmount=this.sanitizeAmount(r.Revenue,"Revenue")),r.hasOwnProperty("Shipping")&&(n.ShippingAmount=this.sanitizeAmount(r.Shipping,"Shipping")),r.hasOwnProperty("Tax")&&(n.TaxAmount=this.sanitizeAmount(r.Tax,"Tax")),r.hasOwnProperty("Step")&&(n.CheckoutStep=r.Step),r.hasOwnProperty("Option")&&(n.CheckoutOptions=r.Option);},this.getProductActionEventName=function(r){switch(r){case I.ProductActionType.AddToCart:return "AddToCart";case I.ProductActionType.AddToWishlist:return "AddToWishlist";case I.ProductActionType.Checkout:return "Checkout";case I.ProductActionType.CheckoutOption:return "CheckoutOption";case I.ProductActionType.Click:return "Click";case I.ProductActionType.Purchase:return "Purchase";case I.ProductActionType.Refund:return "Refund";case I.ProductActionType.RemoveFromCart:return "RemoveFromCart";case I.ProductActionType.RemoveFromWishlist:return "RemoveFromWishlist";case I.ProductActionType.ViewDetail:return "ViewDetail";case I.ProductActionType.Unknown:default:return "Unknown"}},this.getPromotionActionEventName=function(r){return r===I.PromotionActionType.PromotionClick?"PromotionClick":r===I.PromotionActionType.PromotionView?"PromotionView":"Unknown"},this.convertProductActionToEventType=function(r){return r===I.ProductActionType.AddToCart?I.CommerceEventType.ProductAddToCart:r===I.ProductActionType.AddToWishlist?I.CommerceEventType.ProductAddToWishlist:r===I.ProductActionType.Checkout?I.CommerceEventType.ProductCheckout:r===I.ProductActionType.CheckoutOption?I.CommerceEventType.ProductCheckoutOption:r===I.ProductActionType.Click?I.CommerceEventType.ProductClick:r===I.ProductActionType.Purchase?I.C
5ommerceEventType.ProductPurchase:r===I.ProductActionType.Refund?I.CommerceEventType.ProductRefund:r===I.ProductActionType.RemoveFromCart?I.CommerceEventType.ProductRemoveFromCart:r===I.ProductActionType.RemoveFromWishlist?I.CommerceEventType.ProductRemoveFromWishlist:r===I.ProductActionType.Unknown?I.EventType.Unknown:r===I.ProductActionType.ViewDetail?I.CommerceEventType.ProductViewDetail:(t.Logger.error("Could not convert product action type "+r+" to event type"),null)},this.convertPromotionActionToEventType=function(r){return r===I.PromotionActionType.PromotionClick?I.CommerceEventType.PromotionClick:r===I.PromotionActionType.PromotionView?I.CommerceEventType.PromotionView:(t.Logger.error("Could not convert promotion action type "+r+" to event type"),null)},this.generateExpandedEcommerceName=function(r,n){return "eCommerce - "+r+" - "+(n?"Total":"Item")},this.extractProductAttributes=function(r,n){n.CouponCode&&(r["Coupon Code"]=n.CouponCode),n.Brand&&(r.Brand=n.Brand),n.Category&&(r.Category=n.Category),n.Name&&(r.Name=n.Name),n.Sku&&(r.Id=n.Sku),n.Price&&(r["Item Price"]=n.Price),n.Quantity&&(r.Quantity=n.Quantity),n.Position&&(r.Position=n.Position),n.Variant&&(r.Variant=n.Variant),r["Total Product Amount"]=n.TotalAmount||0;},this.extractTransactionId=function(r,n){n.TransactionId&&(r["Transaction Id"]=n.TransactionId);},this.extractActionAttributes=function(r,n){e.extractTransactionId(r,n),n.Affiliation&&(r.Affiliation=n.Affiliation),n.CouponCode&&(r["Coupon Code"]=n.CouponCode),n.TotalAmount&&(r["Total Amount"]=n.TotalAmount),n.ShippingAmount&&(r["Shipping Amount"]=n.ShippingAmount),n.TaxAmount&&(r["Tax Amount"]=n.TaxAmount),n.CheckoutOptions&&(r["Checkout Options"]=n.CheckoutOptions),n.CheckoutStep&&(r["Checkout Step"]=n.CheckoutStep);},this.extractPromotionAttributes=function(r,n){n.Id&&(r.Id=n.Id),n.Creative&&(r.Creative=n.Creative),n.Name&&(r.Name=n.Name),n.Position&&(r.Position=n.Position);},this.buildProductList=function(r,n){return n?Array.isArray(n)?n:[n]:r.ShoppingCart.ProductList},this.createProduct=function(r,n,i,o,s,a,u,l,c,d){return d=t._Helpers.sanitizeAttributes(d,r),typeof r!="string"?(t.Logger.error("Name is required when creating a product"),null):t._Helpers.Validators.isStringOrNumber(n)?t._Helpers.Validators.isStringOrNumber(i)?(i=t._Helpers.parseNumber(i),l&&!t._Helpers.Validators.isNumber(l)&&(t.Logger.error("Position must be a number, it will be set to null."),l=null),o=t._Helpers.Validators.isStringOrNumber(o)?t._Helpers.parseNumber(o):1,{Name:r,Sku:n,Price:i,Quantity:o,Brand:u,Variant:s,Category:a,Position:l,CouponCode:c,TotalAmount:o*i,Attributes:d}):(t.Logger.error("Price is required when creating a product, and must be a string or a number"),null):(t.Logger.error("SKU is required when creating a product, and must be a string or a number"),null)},this.createPromotion=function(r,n,i,o){return t._Helpers.Validators.isStringOrNumber(r)?{Id:r,Creative:n,Name:i,Position:o}:(t.Logger.error(wo.ErrorMessages.PromotionIdRequired),null)},this.createImpression=function(r,n){return typeof r=="string"?n?{Name:r,Product:n}:(t.Logger.error("Product is required when creating an impression."),null):(t.Logger.error("Name is required when creating an impression."),null)},this.createTransactionAttributes=function(r,n,i,o,s,a){return t._Helpers.Validators.isStringOrNumber(r)?{Id:r,Affiliation:n,CouponCode:i,Revenue:o,Shipping:s,Tax:a}:(t.Logger.error(wo.ErrorMessages.TransactionIdRequired),null)},this.expandProductImpression=function(r){var n=[];return r.ProductImpressions&&r.ProductImpressions.forEach(function(i){i.ProductList&&i.ProductList.forEach(function(o){var s=t._Helpers.extend(false,{},r.EventAttributes);if(o.Attributes)for(var a in o.Attributes)s[a]=o.Attributes[a];e.extractProductAttributes(s,o),i.ProductImpressionList&&(s["Product Impression List"]=i.ProductImpressionList);var u=t._ServerModel.createEventObject({messageType:I.MessageType.PageEvent,name:e.generateExpandedEcommerceName("Impression"),data:s,eventType:I.EventType.Transaction});n.push(u);});}),n},this.expandCommerceEvent=function(r){return r?e.expandProductAction(r).concat(e.expandPromotionAction(r)).concat(e.expandProductImpression(r)):null},this.expandPromotionAction=function(r){var n=[];if(!r.PromotionAction)return n;var i=r.PromotionAction.PromotionList;
5return i.forEach(function(o){var s=t._Helpers.extend(false,{},r.EventAttributes);e.extractPromotionAttributes(s,o);var a=t._ServerModel.createEventObject({messageType:I.MessageType.PageEvent,name:e.generateExpandedEcommerceName(I.PromotionActionType.getExpansionName(r.PromotionAction.PromotionActionType)),data:s,eventType:I.EventType.Transaction});n.push(a);}),n},this.expandProductAction=function(r){var n=[];if(!r.ProductAction)return n;var i=false;if(r.ProductAction.ProductActionType===I.ProductActionType.Purchase||r.ProductAction.ProductActionType===I.ProductActionType.Refund){var o=t._Helpers.extend(false,{},r.EventAttributes);o["Product Count"]=r.ProductAction.ProductList?r.ProductAction.ProductList.length:0,e.extractActionAttributes(o,r.ProductAction),r.CurrencyCode&&(o["Currency Code"]=r.CurrencyCode);var s=t._ServerModel.createEventObject({messageType:I.MessageType.PageEvent,name:e.generateExpandedEcommerceName(I.ProductActionType.getExpansionName(r.ProductAction.ProductActionType),true),data:o,eventType:I.EventType.Transaction});n.push(s);}else i=true;var a=r.ProductAction.ProductList;return a&&a.forEach(function(u){var l=t._Helpers.extend(false,r.EventAttributes,u.Attributes);i?e.extractActionAttributes(l,r.ProductAction):e.extractTransactionId(l,r.ProductAction),e.extractProductAttributes(l,u);var c=t._ServerModel.createEventObject({messageType:I.MessageType.PageEvent,name:e.generateExpandedEcommerceName(I.ProductActionType.getExpansionName(r.ProductAction.ProductActionType)),data:l,eventType:I.EventType.Transaction});n.push(c);}),n},this.createCommerceEventObject=function(r,n){var i,o=t._Helpers.extend;return t.Logger.verbose(wo.InformationMessages.StartingLogCommerceEvent),t._Helpers.canLog()?(i=t._ServerModel.createEventObject({messageType:I.MessageType.Commerce,sourceMessageId:n==null?void 0:n.sourceMessageId}),i.EventName="eCommerce - ",i.CurrencyCode=t._Store.currencyCode,i.ShoppingCart=[],i.CustomFlags=o(i.CustomFlags,r),i):(t.Logger.verbose(wo.InformationMessages.AbandonLogEvent),null)},this.sanitizeAmount=function(r,n){if(!t._Helpers.Validators.isStringOrNumber(r)){var i=[n,"must be of type number. A",wt(r),"was passed. Converting to 0"].join(" ");return t.Logger.warning(i),0}return t._Helpers.parseNumber(r)};}var Yb=(function(){function t(e){this.isTrackerActive=false,this.localStorageName="",this.startTime=0,this.totalTime=0,this.localStorageName="mprtcl-tos-".concat(e),this.timerVault=new Ia(this.localStorageName),this.loadTimeFromStorage(),this.addHandlers(),document.hidden===false&&this.startTracking();}return t.prototype.addHandlers=function(){var e=this;document.addEventListener("visibilitychange",function(){return e.handleVisibilityChange()}),window.addEventListener("blur",function(){return e.handleWindowBlur()}),window.addEventListener("focus",function(){return e.handleWindowFocus()}),window.addEventListener("storage",function(r){return e.syncAcrossTabs(r)}),window.addEventListener("beforeunload",function(){return e.updateTimeInPersistence()});},t.prototype.handleVisibilityChange=function(){document.hidden?this.stopTracking():this.startTracking();},t.prototype.handleWindowBlur=function(){this.isTrackerActive&&this.stopTracking();},t.prototype.handleWindowFocus=function(){this.isTrackerActive||this.startTracking();},t.prototype.syncAcrossTabs=function(e){if(e.key===this.localStorageName&&e.newValue!==null){var r=parseFloat(e.newValue)||0;this.totalTime=r;}},t.prototype.updateTimeInPersistence=function(){this.isTrackerActive&&this.timerVault.store(Math.round(this.totalTime));},t.prototype.loadTimeFromStorage=function(){var e=this.timerVault.retrieve();un(e)&&e!==null&&(this.totalTime=e);},t.prototype.startTracking=function(){document.hidden||(this.startTime=Math.floor(performance.now()),this.isTrackerActive=true);},t.prototype.stopTracking=function(){this.isTrackerActive&&(this.setTotalTime(),this.updateTimeInPersistence(),this.isTrackerActive=false);},t.prototype.setTotalTime=function(){if(this.isTrackerActive){var e=Math.floor(performance.now());this.totalTime+=e-this.startTime,this.startTime=e;}},t.prototype.getTimeInForeground=function(){return this.setTotalTime(),this.updateTimeInPersistence(),this.totalTime},t.prototype.resetTimer=function(){this.totalTime=0,this.updateTimeInPersistence();},t})();function Jb(t){var e={};for(var r in F.DefaultConfig)F.DefaultConfig.hasOwnProperty(r)&&(e[r]=F.DefaultConfig[r]);if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);for(var r in F.DefaultBaseUrls)e[r]=F.DefaultBaseUrls[r];return e}function Td(t,e,r){var n=this,i=e._Helpers,o=i.createMainStorageName,s=i.createProductStorageName,a=e._NativeSdkHelpers.isWebviewEnabled,u={isEnabled:true,noFunctional:false,noTargeting:false,sessionAttributes:{},localSessionAttributes:{},currentSessionMPIDs:[],consentState:null,sessionId:null,isFirstRun:null,clientId:null,deviceId:null,devToken:null,
5serverSettings:{},dateLastEventSent:null,sessionStartDate:null,currentPosition:null,isTracking:false,watchPositionId:null,cartProducts:[],eventQueue:[],currencyCode:null,globalTimer:null,context:null,configurationLoaded:false,identityCallInFlight:false,SDKConfig:{},nonCurrentUserMPIDs:{},identifyCalled:false,isLoggedIn:false,cookieSyncDates:{},integrationAttributes:{},requireDelay:true,isLocalStorageAvailable:null,storageName:null,prodStorageName:null,activeForwarders:[],kits:{},sideloadedKits:[],configuredForwarders:[],pixelConfigurations:[],wrapperSDKInfo:{name:"none",version:null,isInfoSet:false},persistenceData:{gs:{}}};for(var l in u)this[l]=u[l];if(this.devToken=r||null,this.integrationDelayTimeoutStart=Date.now(),this.SDKConfig=Jb(t),t){t.hasOwnProperty("flags")||(this.SDKConfig.flags={}),this.SDKConfig.flags=pd(t),t.deviceId&&(this.deviceId=t.deviceId),this.SDKConfig.isDevelopmentMode=!!t.hasOwnProperty("isDevelopmentMode")&&Lv(t.isDevelopmentMode);var c=gd(t,this.SDKConfig.flags,r);for(var d in c)this.SDKConfig[d]=c[d];if(t.hasOwnProperty("logLevel")&&(this.SDKConfig.logLevel=t.logLevel),this.SDKConfig.useNativeSdk=!!t.useNativeSdk,this.SDKConfig.kits=t.kits||{},this.SDKConfig.sideloadedKits=t.sideloadedKits||[],this.SDKConfig.isIOS=t.hasOwnProperty("isIOS")?t.isIOS:!!(window.mParticle&&window.mParticle.isIOS)&&window.mParticle.isIOS,this.SDKConfig.useCookieStorage=!!t.hasOwnProperty("useCookieStorage")&&t.useCookieStorage,this.SDKConfig.maxProducts=t.hasOwnProperty("maxProducts")?t.maxProducts:F.DefaultConfig.maxProducts,this.SDKConfig.maxCookieSize=t.hasOwnProperty("maxCookieSize")?t.maxCookieSize:F.DefaultConfig.maxCookieSize,t.hasOwnProperty("appName")&&(this.SDKConfig.appName=t.appName),t.hasOwnProperty("package")&&(this.SDKConfig.package=t.package),this.SDKConfig.integrationDelayTimeout=t.hasOwnProperty("integrationDelayTimeout")?t.integrationDelayTimeout:F.DefaultConfig.integrationDelayTimeout,t.hasOwnProperty("identifyRequest")&&(this.SDKConfig.identifyRequest=t.identifyRequest),t.hasOwnProperty("identityCallback")){var h=t.identityCallback;e._Helpers.Validators.isFunction(h)?this.SDKConfig.identityCallback=t.identityCallback:e.Logger.warning("The optional callback must be a function. You tried entering a(n) "+wt(h)+" . Callback not set. Please set your callback again.");}if(t.hasOwnProperty("appVersion")&&(this.SDKConfig.appVersion=t.appVersion),t.hasOwnProperty("appName")&&(this.SDKConfig.appName=t.appName),t.hasOwnProperty("sessionTimeout")&&(this.SDKConfig.sessionTimeout=t.sessionTimeout),t.hasOwnProperty("dataPlan")){this.SDKConfig.dataPlan={PlanVersion:null,PlanId:null};var p=t.dataPlan;p.planId&&(jv(p.planId)?this.SDKConfig.dataPlan.PlanId=p.planId:e.Logger.error("Your data plan id must be a string and match the data plan slug format (i.e. under_case_slug)")),p.planVersion&&(un(p.planVersion)?this.SDKConfig.dataPlan.PlanVersion=p.planVersion:e.Logger.error("Your data plan version must be a number"));}else this.SDKConfig.dataPlan={};if(this.SDKConfig.forceHttps=!t.hasOwnProperty("forceHttps")||t.forceHttps,this.SDKConfig.customFlags=t.customFlags||{},this.SDKConfig.minWebviewBridgeVersion=t.hasOwnProperty("minWebviewBridgeVersion")?t.minWebviewBridgeVersion:1,this.SDKConfig.aliasMaxWindow=t.hasOwnProperty("aliasMaxWindow")?t.aliasMaxWindow:F.DefaultConfig.aliasMaxWindow,t.hasOwnProperty("dataPlanOptions")){var f=t.dataPlanOptions;f.hasOwnProperty("dataPlanVersion")&&f.hasOwnProperty("blockUserAttributes")&&f.hasOwnProperty("blockEventAttributes")&&f.hasOwnProperty("blockEvents")&&f.hasOwnProperty("blockUserIdentities")||e.Logger.error('Ensure your config.dataPlanOptions object has the following keys: a "dataPlanVersion" object, and "blockUserAttributes", "blockEventAttributes", "blockEvents", "blockUserIdentities" booleans');}t.hasOwnProperty("onCreateBatch")&&(typeof t.onCreateBatch=="function"?this.SDKConfig.onCreateBatch=t.onCreateBatch:(e.Logger.error("config.onCreateBatch must be a function"),this.SDKConfig.onCreateBatch=void 0));}this._getFromPersistence=function(g,v){return g?(n.syncPersistenceData(),n.persistenceData&&n.persistenceData[g]&&n.persistenceData[g][v]?n.persistenceData[g][v]:null):null},this._setPersistence=function(g,v,m){var y;g&&(n.syncPersistenceData(),n.persistenceData&&(n.persistenceData[g]?n.persistenceData[g][v]=m:n.persistenceData[g]=(y={},y[v]=m,y),it(n.persistenceData[g][v])&&_e(n.persistenceData[g][v])&&delete n.persistenceData[g][v],e._Persistence.savePersistence(n.persistenceData)));},this.hasInvalidIdentifyRequest=function(){var g=n.SDKConfig.identifyRequest;return it(g)&&it(g.userIdentities)&&_e(g.userIdentities)||!g},this.getConsentState=function(g){var v=e._Consent.ConsentSerialization.fromMinifiedJsonObject,m=n._getFromPersistence(g,"con");return _e(m)?null:v(m)},this.setConsentState=function(g,v){var m=e._Consent.ConsentSerialization.toMinifiedJsonObject;(v||v===null)&&n._setPersistence(g,"con",m(v));},this.getNoFunctional=function(){return n.noFunctional},this.setNoFunctional=function(g){n.noFunctional=g;},this.getNoTargeting=function(){return n.noTargeting},this.setNoTargeting=function(g){n.noTargeting=g;},this.getPrivacyFlag=function(g){var v=Cv[g];return v==="functional"?n.getNoFunctional():v==="targeting"&&n.getNoTargeting()},this.getDeviceId=function(){return n.deviceId},this.setDeviceId=function(g){n.deviceId=g,n.persistenceData.gs.das=g,e._Persistence.update(
5);},this.getFirstSeenTime=function(g){return n._getFromPersistence(g,"fst")},this.setFirstSeenTime=function(g,v){if(g){var m=v||new Date().getTime();n._setPersistence(g,"fst",m);}},this.getLastSeenTime=function(g){if(!g)return null;var v=e.Identity.getCurrentUser();return g===(v==null?void 0:v.getMPID())?new Date().getTime():n._getFromPersistence(g,"lst")},this.setLastSeenTime=function(g,v){if(g){var m=v||new Date().getTime();n._setPersistence(g,"lst",m);}},this.getLocalSessionAttributes=function(){return n.localSessionAttributes||{}},this.setLocalSessionAttribute=function(g,v){var m;n.localSessionAttributes[g]=v,n.persistenceData.gs.lsa=pe(pe({},n.persistenceData.gs.lsa||{}),(m={},m[g]=v,m)),e._Persistence.savePersistence(n.persistenceData);},this.syncPersistenceData=function(){var g=e._Persistence.getPersistence();n.persistenceData=e._Helpers.extend({},n.persistenceData,g);},this.getUserAttributes=function(g){return n._getFromPersistence(g,"ua")||{}},this.setUserAttributes=function(g,v){return n._setPersistence(g,"ua",v)},this.getUserIdentities=function(g){return n._getFromPersistence(g,"ui")||{}},this.setUserIdentities=function(g,v){n._setPersistence(g,"ui",v);},this.addMpidToSessionHistory=function(g,v){var m=n.currentSessionMPIDs.indexOf(g);return g&&v!==g&&0>m?void n.currentSessionMPIDs.push(g):void(0<=m&&(n.currentSessionMPIDs=Hv(n.currentSessionMPIDs,m)))},this.nullifySession=function(){n.sessionId=null,n.dateLastEventSent=null,n.sessionAttributes={},n.localSessionAttributes={},e._Persistence.update();},this.processConfig=function(g){var v,m=g.workspaceToken,y=g.requiredWebviewBridgeName;n.SDKConfig.flags=pd(g);var T=gd(g,n.SDKConfig.flags,r);for(var k in T)n.SDKConfig[k]=T[k];var N=(v=g==null?void 0:g.launcherOptions)!==null&&v!==void 0?v:{},_=N.noFunctional,S=N.noTargeting;_!=null&&n.setNoFunctional(_),S!=null&&n.setNoTargeting(S),m?(n.SDKConfig.workspaceToken=m,!n.getPrivacyFlag("TimeOnSite")&&(e._timeOnSiteTimer=new Yb(m))):e.Logger.warning("You should have a workspaceToken on your config object for security purposes."),n.storageName=o(m),n.prodStorageName=s(m),n.SDKConfig.requiredWebviewBridgeName=y||m,n.webviewBridgeEnabled=a(n.SDKConfig.requiredWebviewBridgeName,n.SDKConfig.minWebviewBridgeVersion),n.configurationLoaded=true;};}function pd(t){var e={},r=F.FeatureFlags,n=r.ReportBatching,i=r.EventBatchingIntervalMillis,o=r.OfflineStorage,s=r.DirectUrlRouting,a=r.CacheIdentity,u=r.AudienceAPI,l=r.CaptureIntegrationSpecificIds,c=r.CaptureIntegrationSpecificIdsV2,d=r.AstBackgroundEvents;return t.flags?(e[n]=t.flags[n]||false,e[i]=rr(t.flags[i])||F.DefaultConfig.uploadInterval,e[o]=t.flags[o]||"0",e[s]=t.flags[s]==="True",e[a]=t.flags[a]==="True",e[u]=t.flags[u]==="True",e[l]=t.flags[l]==="True",e[c]=t.flags[c]||"none",e[d]=t.flags[d]==="True",e):{}}function gd(t,e,r){return r?e.directURLRouting?Qb(t,r):Xb(t):{}}function Xb(t){var e=F.DefaultBaseUrls,r=F.CNAMEUrlPaths,n={};if(!_e(t.domain)){for(var i in r)n[i]="".concat(t.domain).concat(r[i]);return n}for(var o in e)n[o]=t[o]||e[o];return n}function Qb(t,e){var r=F.DefaultBaseUrls,n={},i=e.split("-"),o=1>=i.length?"us1":i[0];for(var s in r){if(s=="configUrl"){n[s]=t[s]||r[s];continue}if(t.hasOwnProperty(s))n[s]=t[s];else {var a=r[s].split(".");n[s]=Ev([a[0],o],a.slice(1)).join(".");}}return n}function Zb(t){var e=this,r=t.logLevel||"warning";this.logger=t.hasOwnProperty("logger")?t.logger:new e_,this.verbose=function(n){r!=="none"&&e.logger.verbose&&r==="verbose"&&e.logger.verbose(n);},this.warning=function(n){r!=="none"&&e.logger.warning&&(r==="verbose"||r==="warning")&&e.logger.warning(n);},this.error=function(n){r!=="none"&&e.logger.error&&e.logger.error(n);},this.setLogLevel=function(n){r=n;};}function e_(){this.verbose=function(t){console&&console.info&&console.info(t);},this.error=function(t){console&&console.error&&console.error(t);},this.warning=function(t){console&&console.warn&&console.warn(t);};}var er=pi.Base64,xn=F.Messages,So=F.Base64CookieKeys,di=F.SDKv2NonMPIDCookieKeys,zr=F.StorageNames;function t_(t){function e(o){var s=t._Store;return o.gs.sid=s.sessionId,o.gs.ie=s.isEnabled,o.gs.sa=s.sessionAttributes,o.gs.lsa=s.localSessionAttributes,o.gs.ss=s.serverSettings,o.gs.dt=s.devToken,o.gs.les=s.dateLastEventSent?s.dateLastEventSent.getTime():null,o.gs.av=s.SDKConfig.appVersion,o.gs.cgid=s.clientId,o.gs.das=s.deviceId,o.gs.c=s.context,o.gs.ssd=s.sessionStartDate?s.sessionStartDate.getTime():0,o.gs.ia=s.integrationAttributes,o}function r(o){localStorage.removeItem(o);}function n(o,s,a){return i.encodePersistence(JSON.stringify(o))+";expires="+s+";path=/"+a}var i=this;this.useLocalStorage=function(){return !t._Store.SDKConfig.useCookieStorage&&t._Store.isLocalStorageAvailable},this.initializeStorage=function(){try{var o,s,a=i.getLocalStorage(),u=i.getCookie();if(a||u?t._Store.isFirstRun=!1:(t._Store.isFirstRun=!0,t._Store.mpid=0),t._Store.getPrivacyFlag("SDKState"))return;t._Store.isLocalStorageAvailable||(t._Store.SDKConfig.useCookieStorage=!0),t._Store.isLocalStorageAvailable?(o=window.localStorage,t._Store.SDKConfig.useCookieStorage?(a?(s=u?t._Helpers.extend(!1,a,u):a,o.removeItem(t._Store.storageName)):u&&(s=u),i.storeDataInMemory(s)):u?(s=a?t._Helpers.extend(!1,a,u):u,i.storeDataInMemory(s),i.expireCookies(t._Store.storageName)):i.storeDataInMemory(a)):i.storeDataInMemory(u);try{if(t._Store.isLocalStorageAvailable){var l=localStorage.getItem(t._Store.prodStorageName);if(l)var c=JSON.parse(er.decode(l));t._Store.mpid&&i.storeProductsInMemory(c,t._Store.mpid);}}
5catch(h){t._Store.isLocalStorageAvailable&&localStorage.removeItem(t._Store.prodStorageName),t._Store.cartProducts=[],t.Logger.error("Error loading products in initialization: "+h);}for(var d in s)s.hasOwnProperty(d)&&(di[d]||(t._Store.nonCurrentUserMPIDs[d]=s[d]));i.update();}catch(h){i.useLocalStorage()&&t._Store.isLocalStorageAvailable?localStorage.removeItem(t._Store.storageName):i.expireCookies(t._Store.storageName),t.Logger.error("Error initializing storage: "+h);}},this.update=function(){t._Store.webviewBridgeEnabled||t._Store.getPrivacyFlag("SDKState")||(t._Store.SDKConfig.useCookieStorage&&i.setCookie(),i.setLocalStorage());},this.storeProductsInMemory=function(o,s){if(o)try{t._Store.cartProducts=o[s]&&o[s].cp?o[s].cp:[];}catch(a){t.Logger.error(xn.ErrorMessages.CookieParseError);}},this.storeDataInMemory=function(o,s){try{o?(t._Store.mpid=s||o.cu||0,o.gs=o.gs||{},t._Store.sessionId=o.gs.sid||t._Store.sessionId,t._Store.isEnabled=typeof o.gs.ie=="undefined"?t._Store.isEnabled:o.gs.ie,t._Store.sessionAttributes=o.gs.sa||t._Store.sessionAttributes,t._Store.localSessionAttributes=o.gs.lsa||t._Store.localSessionAttributes,t._Store.serverSettings=o.gs.ss||t._Store.serverSettings,t._Store.devToken=t._Store.devToken||o.gs.dt,t._Store.SDKConfig.appVersion=t._Store.SDKConfig.appVersion||o.gs.av,t._Store.clientId=o.gs.cgid||t._Store.clientId||t._Helpers.generateUniqueId(),t._Store.deviceId=t._Store.deviceId||o.gs.das||t._Helpers.generateUniqueId(),t._Store.integrationAttributes=o.gs.ia||{},t._Store.context=o.gs.c||t._Store.context,t._Store.currentSessionMPIDs=o.gs.csm||t._Store.currentSessionMPIDs,t._Store.isLoggedIn=o.l===!0,o.gs.les&&(t._Store.dateLastEventSent=new Date(o.gs.les)),t._Store.sessionStartDate=o.gs.ssd?new Date(o.gs.ssd):new Date,o=s?o[s]:o[o.cu]):(t.Logger.verbose(xn.InformationMessages.CookieNotFound),t._Store.clientId=t._Store.clientId||t._Helpers.generateUniqueId(),t._Store.deviceId=t._Store.deviceId||t._Helpers.generateUniqueId());}catch(a){t.Logger.error(xn.ErrorMessages.CookieParseError);}},this.determineLocalStorageAvailability=function(o){var s;
5window.mParticle&&window.mParticle._forceNoLocalStorage&&(o=void 0);try{return o.setItem("mparticle","test"),s=o.getItem("mparticle")==="test",o.removeItem("mparticle"),s&&o}catch(a){return  false}},this.getUserProductsFromLS=function(o){if(!t._Store.isLocalStorageAvailable)return [];var s,a,u,l=localStorage.getItem(t._Store.prodStorageName);if(l&&(s=er.decode(l)),o)try{return s&&(u=JSON.parse(s)),a=s&&u[o]&&u[o].cp&&Array.isArray(u[o].cp)?u[o].cp:[],a}catch(c){return []}else return []},this.getAllUserProductsFromLS=function(){var o,s,a=localStorage.getItem(t._Store.prodStorageName);a&&(o=er.decode(a));try{s=JSON.parse(o);}catch(u){s={};}return s},this.setLocalStorage=function(){if(t._Store.isLocalStorageAvailable){var o=t._Store.storageName,s=i.getAllUserProductsFromLS(),a=i.getLocalStorage()||{},u=t.Identity.getCurrentUser(),l=u?u.getMPID():null,c={cp:s[l]?s[l].cp:[]};if(l){s=s||{},s[l]=c;try{window.localStorage.setItem(encodeURIComponent(t._Store.prodStorageName),er.encode(JSON.stringify(s)));}catch(d){t.Logger.error("Error with setting products on localStorage.");}}if(!t._Store.SDKConfig.useCookieStorage){a.gs=a.gs||{},a.l=t._Store.isLoggedIn?1:0,t._Store.sessionId&&(a.gs.csm=t._Store.currentSessionMPIDs),a.gs.ie=t._Store.isEnabled,l&&(a.cu=l),Object.keys(t._Store.nonCurrentUserMPIDs).length&&(a=t._Helpers.extend({},a,t._Store.nonCurrentUserMPIDs),t._Store.nonCurrentUserMPIDs={}),a=e(a);try{window.localStorage.setItem(encodeURIComponent(o),i.encodePersistence(JSON.stringify(a)));}catch(d){t.Logger.error("Error with setting localStorage item.");}}}},this.getLocalStorage=function(){if(!t._Store.isLocalStorageAvailable)return null;var o,s=t._Store.storageName,a=i.decodePersistence(window.localStorage.getItem(s)),u={};if(a)for(o in a=JSON.parse(a),a)a.hasOwnProperty(o)&&(u[o]=a[o]);return Object.keys(u).length?u:null},this.expireCookies=function(o){var s,a,u,l=new Date;u=i.getCookieDomain(),a=u===""?"":";domain="+u,l.setTime(l.getTime()-864e5),s="; expires="+l.toUTCString(),document.cookie=o+"="+s+"; path=/"+a;},this.getCookie=function(){var o,s,a,u,l,c,d=t._Store.storageName,h=d?void 0:{};t.Logger.verbose(xn.InformationMessages.CookieSearch);try{o=window.document.cookie.split("; ");}catch(p){return t.Logger.verbose("Unable to parse undefined cookie"),null}for(s=0,a=o.length;s<a;s++){try{u=o[s].split("="),l=u.shift(),c=u.join("=");}catch(p){t.Logger.verbose("Unable to parse cookie: "+l+". Skipping.");}if(d&&d===l){h=t._Helpers.converted(c);break}d||(h[l]=t._Helpers.converted(c));}return h?(t.Logger.verbose(xn.InformationMessages.CookieFound),JSON.parse(i.decodePersistence(h))):null},this.setCookie=function(){var o,s=t.Identity.getCurrentUser();s&&(o=s.getMPID());var a,u,l,c=new Date,d=t._Store.storageName,h=i.getCookie()||{},p=new Date(c.getTime()+1e3*(60*(60*(24*t._Store.SDKConfig.cookieExpiration)))).toGMTString();a=i.getCookieDomain(),u=a===""?"":";domain="+a,h.gs=h.gs||{},t._Store.sessionId&&(h.gs.csm=t._Store.currentSessionMPIDs),o&&(h.cu=o),h.l=t._Store.isLoggedIn?1:0,h=e(h),Object.keys(t._Store.nonCurrentUserMPIDs).length&&(h=t._Helpers.extend({},h,t._Store.nonCurrentUserMPIDs),t._Store.nonCurrentUserMPIDs={}),l=i.reduceAndEncodePersistence(h,p,u,t._Store.SDKConfig.maxCookieSize),t.Logger.verbose(xn.InformationMessages.CookieSet),window.document.cookie=encodeURIComponent(d)+"="+l;},this.reduceAndEncodePersistence=function(o,s,a,u){var l,c=o.gs.csm?o.gs.csm:[];if(c.length){var h={};for(var p in o)o.hasOwnProperty(p)&&(di[p]||p===o.cu||(h[p]=1));if(Object.keys(h).length)for(var f in h)l=n(o,s,a),l.length>u&&h.hasOwnProperty(f)&&c.indexOf(f)===-1&&delete o[f];for(var g,v=0;v<c.length&&(l=n(o,s,a),l.length>u);v++)g=c[v],o[g]?(t.Logger.verbose("Size of new encoded cookie is larger than maxCookieSize setting of "+u+". Removing from cookie the earliest logged in MPID containing: "+JSON.stringify(o[g],0,2)),delete o[g]):t.Logger.error("Unable to save MPID data to cookies because the resulting encoded cookie is larger than the maxCookieSize setting of "+u+". We recommend using a maxCookieSize of 1500.");}else for(var d in o)o.hasOwnProperty(d)&&(l=n(o,s,a),l.length>u&&!di[d]&&d!==o.cu&&delete o[d]);return l}
5,this.findPrevCookiesBasedOnUI=function(o){var s,a=t._Persistence.getPersistence();if(o){for(var u in o.userIdentities)if(a&&Object.keys(a).length){for(var l in a)if(a[l].mpid){var c=a[l].ui;for(var d in c)if(u===d&&o.userIdentities[u]===c[d]){s=l;break}}}}s&&i.storeDataInMemory(a,s);},this.encodePersistence=function(o){for(var s in o=JSON.parse(o),o.gs)o.gs.hasOwnProperty(s)&&(So[s]?o.gs[s]&&(Array.isArray(o.gs[s])&&o.gs[s].length||t._Helpers.isObject(o.gs[s])&&Object.keys(o.gs[s]).length)?o.gs[s]=er.encode(JSON.stringify(o.gs[s])):delete o.gs[s]:s==="ie"?o.gs[s]=o.gs[s]?1:0:!o.gs[s]&&delete o.gs[s]);for(var a in o)if(o.hasOwnProperty(a)&&!di[a])for(s in o[a])o[a].hasOwnProperty(s)&&So[s]&&(t._Helpers.isObject(o[a][s])&&Object.keys(o[a][s]).length?o[a][s]=er.encode(JSON.stringify(o[a][s])):delete o[a][s]);return Pv(JSON.stringify(o))},this.decodePersistence=function(o){try{if(o){if(o=JSON.parse(Iv(o)),t._Helpers.isObject(o)&&Object.keys(o).length){for(var s in o.gs)o.gs.hasOwnProperty(s)&&(So[s]?o.gs[s]=JSON.parse(er.decode(o.gs[s])):s==="ie"&&(o.gs[s]=!!o.gs[s]));for(var a in o)if(o.hasOwnProperty(a))if(di[a])a==="l"&&(o[a]=!!o[a]);else for(s in o[a])o[a].hasOwnProperty(s)&&So[s]&&o[a][s].length&&(o[a][s]=JSON.parse(er.decode(o[a][s])));}return JSON.stringify(o)}}catch(u){t.Logger.error("Problem with decoding cookie",u);}},this.getCookieDomain=function(){if(t._Store.SDKConfig.cookieDomain)return t._Store.SDKConfig.cookieDomain;var o=i.getDomain(document,location.hostname);return o===""?"":"."+o},this.getDomain=function(o,s){var a,u,l=s.split(".");for(a=l.length-1;0<=a;a--)if(u=l.slice(a).join("."),o.cookie="mptest=cookie;domain=."+u+";",-1<o.cookie.indexOf("mptest=cookie"))return o.cookie="mptest=;domain=."+u+";expires=Thu, 01 Jan 1970 00:00:01 GMT;",u;return ""},this.getCartProducts=function(o){var s,a=localStorage.getItem(t._Store.prodStorageName);return a&&(s=JSON.parse(er.decode(a)),s&&s[o]&&s[o].cp)?s[o].cp:[]},this.setCartProducts=function(o){if(t._Store.isLocalStorageAvailable)try{window.localStorage.setItem(encodeURIComponent(t._Store.prodStorageName),er.encode(JSON.stringify(o)));}catch(s){t.Logger.error("Error with setting products on localStorage.");}},this.saveUserCookieSyncDatesToPersistence=function(o,s){if(s){var a=i.getPersistence();a&&(a[o]?a[o].csd=s:a[o]={csd:s}),i.savePersistence(a);}},this.swapCurrentUser=function(o,s,a){if(o&&s&&o!==s){var u=i.getPersistence();u&&(u.cu=s,u.gs.csm=a,i.savePersistence(u));}},this.savePersistence=function(o){if(!t._Store.getPrivacyFlag("SDKState")){var s,a=i.encodePersistence(JSON.stringify(o)),u=new Date,l=t._Store.storageName,c=new Date(u.getTime()+1e3*(60*(60*(24*t._Store.SDKConfig.cookieExpiration)))).toGMTString(),d=i.getCookieDomain();if(s=d===""?"":";domain="+d,t._Store.SDKConfig.useCookieStorage){var h=i.reduceAndEncodePersistence(o,c,s,t._Store.SDKConfig.maxCookieSize);window.document.cookie=encodeURIComponent(l)+"="+h;}else t._Store.isLocalStorageAvailable&&localStorage.setItem(t._Store.storageName,a);}},this.getPersistence=function(){if(t._Store.getPrivacyFlag("SDKState"))return null;var o=this.useLocalStorage()?this.getLocalStorage():this.getCookie();return o},this.getFirstSeenTime=function(o){if(!o)return null;var s=i.getPersistence();return s&&s[o]&&s[o].fst?s[o].fst:null},this.setFirstSeenTime=function(o,s){if(o){s||(s=new Date().getTime());var a=i.getPersistence();a&&(!a[o]&&(a[o]={}),!a[o].fst&&(a[o].fst=s,i.savePersistence(a)));}},this.getLastSeenTime=function(o){if(!o)return null;if(o===t.Identity.getCurrentUser().getMPID())return new Date().getTime();var s=i.getPersistence();return s&&s[o]&&s[o].lst?s[o].lst:null},this.setLastSeenTime=function(o,s){if(o){s||(s=new Date().getTime());var a=i.getPersistence();a&&a[o]&&(a[o].lst=s,i.savePersistence(a));}},this.getDeviceId=function(){return t._Store.deviceId},this.setDeviceId=function(o){t._Store.deviceId=o,i.update();},this.resetPersistence=function(){r(zr.localStorageName),r(zr.localStorageNameV3),r(zr.localStorageNameV4),r(t._Store.prodStorageName),r(t._Store.storageName),r(zr.localStorageProductsV4),i.expireCookies(zr.cookieName),i.expireCookies(zr.cookieNameV2),i.expireCookies(zr.cookieNameV3),i.expireCookies(zr.cookieNameV4),i.expireCookies(t._Store.prodStorageName),i.expireCookies(t._Store.storageName),mParticle._isTestEnv&&(r(t._Helpers.createMainStorageName("abcdef")),i.expireCookies(t._Helpers.createMainStorageName("abcdef")),r(t._Helpers.createProductStorageName("abcdef")));},this.forwardingStatsBatches={uploadsTable:{},forwardingStatsEventQueue:[]};}var On=F.Messages;function r_(t){var e=this;this.logEvent=function(r,n){if(t.Logger.verbose(On.InformationMessages.StartingLogEvent+": "+r.name),t._Helpers.canLog()){var i=t._ServerModel.createEventObject(r);t._APIClient.sendEventToServer(i,n);}else t.Logger.verbose(On.InformationMessages.AbandonLogEvent);},this.startTracking=function(r){function n(o,s){if(o)try{s?o(s):o();}catch(a){t.Logger.error("Error invoking the callback passed to startTrackingLocation."),t.Logger.error(a);}}if(!t._Store.isTracking)"geolocation"in navigator&&(t._Store.watchPositionId=navigator.geolocation.watchPosition(function(s){t._Store.currentPosition={lat:s.coords.latitude,lng:s.coords.longitude},n(r,s),r=null,t._Store.isTracking=true;},function(){n(r),r=null,t._Store.isTracking=false;}));else {var i={coords:{latitude:t._Store.currentPosition.lat,longitude:t._Store.currentPosition.lng}};n(r,i);}},this.stopTracking=function(){t._Store.isTracking&&(navigator.geolocation.clearWatch(t._Store.watchPositionId),t._Store.currentPosition=null,t._Store.isTracking=false);},this.logOptOut=function(){t.Logger.verbose(On.InformationMessages.StartingLogOptOut);var r=t._ServerModel.createEventObject({messageType:I.MessageType.OptOut,eventType:I.EventType.Other});t._APIClient.sendEventToServer(r);},this.logAST=function(){e.logEvent({messageType:I.MessageType.AppStateTransition});},this.logCheckoutEvent=function(r,n,i,o){var s=t._Ecommerce.createCommerceEventObject(o);s&&(s.EventName+=t._Ecommerce.getProductActionEventName(I.ProductActionType.Checkout),s.EventCategory=I.CommerceEventType.ProductCheckout,s.ProductAction={ProductActionType:I.ProductActionType.Checkout,CheckoutStep:r,CheckoutOptions:n,ProductList:[]},e.logCommerceEvent(s,i));},this.logProductActionEvent=function(r,n,i,o,s,a){var u=t._Ecommerce.createCommerceEventObject(o,a),l=Array.isArray(n)?n:[n];l.forEach(function(c){c.TotalAmount&&(c.TotalAmount=t._Ecommerce.sanitizeAmount(c.TotalAmount,"TotalAmount")),c.Position&&(c.Position=t._Ecommerce.sanitizeAmount(c.Position,"Position")),c.Price&&(c.Price=t._Ecommerce.sanitizeAmount(c.Price,"Price")),c.Quantity&&(c.Quantity=t._Ecommerce.sanitizeAmount(c.Quantity,"Quantity"));}),u&&(u.EventCategory=t._Ecommerce.convertProductActionToEventType(r),u.EventName+=t._Ecommerce.getProductActionEventName(r),u.ProductAction={ProductActionType:r,ProductList:l},t._Helpers.isObject(s)&&t._Ecommerce.convertTransactionAttributesToProductAction(s,u.ProductAction),e.logCommerceEvent(u,i,a));},this.logPurchaseEvent=function(r,n,i,o){var s=t._Ecommerce.createCommerceEventObject(o);s&&(s.EventName+=t._Ecommerce.getProductActionEventName(I.ProductActionType.Purchase),s.EventCategory=I.CommerceEventType.ProductPurchase,s.ProductAction={ProductActionType:I.ProductActionType.Purchase},s.ProductAction.ProductList=t._Ecommerce.buildProductList(s,n),t._Ecommerce.convertTransactionAttributesToProductAction(r,s.ProductAction),e.logCommerceEvent(s,i));},this.logRefundEvent=function(r,n,i,o){if(!r)return void t.Logger.error(On.ErrorMessages.TransactionRequired);var s=t._Ecommerce.createCommerceEventObject(o);s&&(s.EventName+=t._Ecommerce.getProductActionEventName(I.ProductActionType.Refund),s.EventCategory=I.CommerceEventType.ProductRefund,s.ProductAction={ProductActionType:I.ProductActionType.Refund},s.ProductAction.ProductList=t._Ecommerce.buildProductList(s,n),t._Ecommerce.convertTransactionAttributesToProductAction(r,s.ProductAction),e.logCommerceEvent(s,i));},this.logPromotionEvent=function(r,n,i,o,s){var a=t._Ecommerce.createCommerceEventObject(o);a&&(a.EventName+=t._Ecommerce.getPromotionActionEventName(r),a.EventCategory=t._Ecommerce.convertPromotionActionToEventType(r),a.PromotionAction={PromotionActionType:r,PromotionList:Array.isArray(n)?n:[n]}
5,e.logCommerceEvent(a,i,s));},this.logImpressionEvent=function(r,n,i,o){var s=t._Ecommerce.createCommerceEventObject(i);s&&(s.EventName+="Impression",s.EventCategory=I.CommerceEventType.ProductImpression,!Array.isArray(r)&&(r=[r]),s.ProductImpressions=[],r.forEach(function(a){s.ProductImpressions.push({ProductImpressionList:a.Name,ProductList:Array.isArray(a.Product)?a.Product:[a.Product]});}),e.logCommerceEvent(s,n,o));},this.logCommerceEvent=function(r,n,i){return t.Logger.verbose(On.InformationMessages.StartingLogCommerceEvent),r.ProductAction&&r.EventCategory===null?void t.Logger.error("Commerce event not sent.  The mParticle.ProductActionType you passed was invalid. Re-check your code."):(n=t._Helpers.sanitizeAttributes(n,r.EventName),void(t._Helpers.canLog()?(t._Store.webviewBridgeEnabled&&(r.ShoppingCart={}),n&&(r.EventAttributes=n),t._APIClient.sendEventToServer(r,i),t._Persistence.update()):t.Logger.verbose(On.InformationMessages.AbandonLogEvent)))},this.addEventHandler=function(r,n,i,o,s){var a,u,l=[],c=function(h){var p=function(){a.href?window.location.href=a.href:a.submit&&a.submit();};t.Logger.verbose("DOM event triggered, handling event"),e.logEvent({messageType:I.MessageType.PageEvent,name:typeof i=="function"?i(a):i,data:typeof o=="function"?o(a):o,eventType:s||I.EventType.Other}),(a.href&&a.target!=="_blank"||a.submit)&&(h.preventDefault?h.preventDefault():h.returnValue=false,setTimeout(p,t._Store.SDKConfig.timeout));};if(!n)return void t.Logger.error("Can't bind event, selector is required");if(typeof n=="string"?l=document.querySelectorAll(n):n.nodeType&&(l=[n]),l.length)for(t.Logger.verbose("Found "+l.length+" element"+(1<l.length?"s":"")+", attaching event handlers"),u=0;u<l.length;u++)a=l[u],a.addEventListener?a.addEventListener(r,c,false):a.attachEvent?a.attachEvent("on"+r,c):a["on"+r]=c;else t.Logger.verbose("No elements found");};}function fd(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value;}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(n,i);}function n_(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){fd(o,n,i,s,a,"next",u);}function a(u){fd(o,n,i,s,a,"throw",u);}s(void 0);})}}var ka={exports:{}},xa={exports:{}};(function(t){function e(r){"@babel/helpers - typeof";return t.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t.exports.__esModule=true,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=true,t.exports.default=t.exports;})(xa);var i_=xa.exports;(function(t){var e=i_.default;function r(){t.exports=r=function(){return i},t.exports.__esModule=true,t.exports.default=t.exports;var n,i={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(z,R,B){z[R]=B.value;},u=typeof Symbol=="function"?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",d=u.toStringTag||"@@toStringTag";function h(z,R,B){return Object.defineProperty(z,R,{value:B,enumerable:true,configurable:true,writable:true}),z[R]}try{h({},"");}catch(z){h=function(B,w,U){return B[w]=U};}function p(z,R,B,w){var U=R&&R.prototype instanceof k?R:k,L=Object.create(U.prototype),q=new Pe(w||[]);return a(L,"_invoke",{value:re(z,B,q)}),L}function f(z,R,B){try{return {type:"normal",arg:z.call(R,B)}}catch(w){return {type:"throw",arg:w}}}i.wrap=p;var g="suspendedStart",v="suspendedYield",m="executing",y="completed",T={};function k(){}function N(){}function _(){}var S={};h(S,l,function(){return this});var M=Object.getPrototypeOf,X=M&&M(M(je([])));X&&X!==o&&s.call(X,l)&&(S=X);var J=_.prototype=k.prototype=Object.create(S);function G(z){["next","throw","return"].forEach(function(R){h(z,R,function(B){return this._invoke(R,B)});});}function V(z,R){function B(U,L,q,ee){var ge=f(z[U],z,L);if(ge.type!=="throw"){var Re=ge.arg,Fe=Re.value;return Fe&&e(Fe)=="object"&&s.call(Fe,"__await")?R.resolve(Fe.__await).then(function(Ie){B("next",Ie,q,ee);},function(Ie){B("throw",Ie,q,ee);}):R.resolve(Fe).then(function(Ie){Re.value=Ie,q(Re);},function(Ie){return B("throw",Ie,q,ee)})}ee(ge.arg);}var w;a(this,"_invoke",{value:function(L,q){function ee(){return new R(function(ge,Re){B(L,q,ge,Re);})}return w=w?w.then(ee,ee):ee()}});}function re(z,R,B){var w=g;return function(U,L){if(w===m)throw new Error("Generator is already running");if(w===y){if(U==="throw")throw L;return {value:n,done:true}}for(B.method=U,B.arg=L;;){var q=B.delegate;if(q){var ee=ie(q,B);if(ee){if(ee===T)continue;return ee}}if(B.method==="next")B.sent=B._sent=B.arg;else if(B.method==="throw"){if(w===g)throw w=y,B.arg;B.dispatchException(B.arg);}else B.method==="return"&&B.abrupt("return",B.arg);w=m;var ge=f(z,R,B);if(ge.type==="normal"){if(w=B.done?y:v,ge.arg===T)continue;return {value:ge.arg,done:B.done}}ge.type==="throw"&&(w=y,B.method="throw",B.arg=ge.arg);}}}function ie(z,R){var B=R.method,w=z.iterator[B];if(w===n)return R.delegate=null,B==="throw"&&z.iterator.return&&
5(R.method="return",R.arg=n,ie(z,R),R.method==="throw")||B!=="return"&&(R.method="throw",R.arg=new TypeError("The iterator does not provide a '"+B+"' method")),T;var U=f(w,z.iterator,R.arg);if(U.type==="throw")return R.method="throw",R.arg=U.arg,R.delegate=null,T;var L=U.arg;return L?L.done?(R[z.resultName]=L.value,R.next=z.nextLoc,R.method!=="return"&&(R.method="next",R.arg=n),R.delegate=null,T):L:(R.method="throw",R.arg=new TypeError("iterator result is not an object"),R.delegate=null,T)}function he(z){var R={tryLoc:z[0]};1 in z&&(R.catchLoc=z[1]),2 in z&&(R.finallyLoc=z[2],R.afterLoc=z[3]),this.tryEntries.push(R);}function ye(z){var R=z.completion||{};R.type="normal",delete R.arg,z.completion=R;}function Pe(z){this.tryEntries=[{tryLoc:"root"}],z.forEach(he,this),this.reset(true);}function je(z){if(z||z===""){var R=z[l];if(R)return R.call(z);if(typeof z.next=="function")return z;if(!isNaN(z.length)){var B=-1,w=function U(){for(;++B<z.length;)if(s.call(z,B))return U.value=z[B],U.done=false,U;return U.value=n,U.done=true,U};return w.next=w}}throw new TypeError(e(z)+" is not iterable")}return N.prototype=_,a(J,"constructor",{value:_,configurable:true}),a(_,"constructor",{value:N,configurable:true}),N.displayName=h(_,d,"GeneratorFunction"),i.isGeneratorFunction=function(z){var R=typeof z=="function"&&z.constructor;return !!R&&(R===N||(R.displayName||R.name)==="GeneratorFunction")},i.mark=function(z){return Object.setPrototypeOf?Object.setPrototypeOf(z,_):(z.__proto__=_,h(z,d,"GeneratorFunction")),z.prototype=Object.create(J),z},i.awrap=function(z){return {__await:z}},G(V.prototype),h(V.prototype,c,function(){return this}),i.AsyncIterator=V,i.async=function(z,R,B,w,U){U===void 0&&(U=Promise);var L=new V(p(z,R,B,w),U);return i.isGeneratorFunction(R)?L:L.next().then(function(q){return q.done?q.value:L.next()})},G(J),h(J,d,"Generator"),h(J,l,function(){return this}),h(J,"toString",function(){return "[object Generator]"}),i.keys=function(z){var R=Object(z),B=[];for(var w in R)B.push(w);return B.reverse(),function U(){for(;B.length;){var L=B.pop();if(L in R)return U.value=L,U.done=false,U}return U.done=true,U}},i.values=je,Pe.prototype={constructor:Pe,reset:function(R){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=false,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(ye),!R)for(var B in this)B.charAt(0)==="t"&&s.call(this,B)&&!isNaN(+B.slice(1))&&(this[B]=n);},stop:function(){this.done=true;var R=this.tryEntries[0].completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(R){if(this.done)throw R;var B=this;function w(Re,Fe){return q.type="throw",q.arg=R,B.next=Re,Fe&&(B.method="next",B.arg=n),!!Fe}for(var U=this.tryEntries.length-1;U>=0;--U){var L=this.tryEntries[U],q=L.completion;if(L.tryLoc==="root")return w("end");if(L.tryLoc<=this.prev){var ee=s.call(L,"catchLoc"),ge=s.call(L,"finallyLoc");if(ee&&ge){if(this.prev<L.catchLoc)return w(L.catchLoc,true);if(this.prev<L.finallyLoc)return w(L.finallyLoc)}else if(ee){if(this.prev<L.catchLoc)return w(L.catchLoc,true)}else {if(!ge)throw new Error("try statement without catch or finally");if(this.prev<L.finallyLoc)return w(L.finallyLoc)}}}},abrupt:function(R,B){for(var w=this.tryEntries.length-1;w>=0;--w){var U=this.tryEntries[w];if(U.tryLoc<=this.prev&&s.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var L=U;break}}L&&(R==="break"||R==="continue")&&L.tryLoc<=B&&B<=L.finallyLoc&&(L=null);var q=L?L.completion:{};return q.type=R,q.arg=B,L?(this.method="next",this.next=L.finallyLoc,T):this.complete(q)},complete:function(R,B){if(R.type==="throw")throw R.arg;return R.type==="break"||R.type==="continue"?this.next=R.arg:R.type==="return"?(this.rval=this.arg=R.arg,this.method="return",this.next="end"):R.type==="normal"&&B&&(this.next=B),T},finish:function(R){for(var B=this.tryEntries.length-1;B>=0;--B){var w=this.tryEntries[B];if(w.finallyLoc===R)return this.complete(w.completion,w.afterLoc),ye(w),T}},catch:function(R){for(var B=this.tryEntries.length-1;B>=0;--B){var w=this.tryEntries[B];if(w.tryLoc===R){var U=w.completion;if(U.type==="throw"){var L=U.arg;ye(w);}return L}}throw new Error("illegal catch attempt")},delegateYield:function(R,B,w){return this.delegate={iterator:je(R),resultName:B,nextLoc:w},this.method==="next"&&(this.arg=n),T}},i}t.exports=r,t.exports.__esModule=true,t.exports.default=t.exports;})(ka);var o_=ka.exports,Io=o_(),s_=Io;try{regeneratorRuntime=Io;}catch(t){typeof globalThis=="object"?globalThis.regeneratorRuntime=Io:Function("r","regeneratorRuntime = r")(Io);}var md=Jv(s_);function ya(t,e,r,n){var i=this;return {getUserIdentities:function(){var s={},a=r._Store.getUserIdentities(t);for(var u in a)if(a.hasOwnProperty(u)){var l=I.IdentityType.getIdentityName(r._Helpers.parseNumber(u));n&&(!n||n.isIdentityBlocked(l))||(s[l]=a[u]);}return s=r._Helpers.filterUserIdentitiesForForwarders(s,e.userIdentityFilters),{userIdentities:s}},getMPID:function(){return t},getUserAttributesLists:function(s){var a,u={};for(var l in a=i.getAllUserAttributes(),a)a.hasOwnProperty(l)&&Array.isArray(a[l])&&(n&&(!n||n.isAttributeKeyBlocked(l))||(u[l]=a[l].slice()));return u=r._Helpers.filterUserAttributes(u,s.userAttributeFilters),u},getAllUserAttributes:function(){var s={},a=r._Store.getUserAttributes(t);if(a)for(var u in a)a.hasOwnProperty(u)&&(n&&(!n||n.isAttributeKeyBlocked(u))||(Array.isArray(a[u])?s[u]=a[u].slice():s[u]=a[u]));return s=r._Helpers.filterUserAttributes(s,e.userAttributeFilters),s}}}var To=F.IdentityMethods,a_=To.Modify,u_=To.Identify,l_=To.Login,c_=To.Logout;function d_(t,e){var r=this,n=this;this.forwarderStatsUploader=new Id(t,e).initializeForwarderStatsUploader();var i={setUserAttribute:"setUserAttribute",removeUserAttribute:"removeUserAttribute"};this.initForwarders=function(o,s){var a=t.Identity.getCurrentUser();!t._Store.webviewBridgeEnabled&&t._Store.configuredForwarders&&(t._Store.configuredForwarders.sort(function(u,l){return u.settings.PriorityValue=u.settings.PriorityValue||0,l.settings.PriorityValue=l.settings.PriorityValue||0,-1*(u.settings.PriorityValue-l.settings.PriorityValue)}),t._Store.activeForwarders=t._Store.configuredForwarders.filter(function(u){if(!t._Consent.isEnabledForUserConsent(u.filteringConsentRuleValues,a)||!n.isEnabledForUserAttributes(u.filteringUserAttributeValue,a)||!n.isEnabledForUnknownUser(u.excludeAnonymousUser,a))return  false;var l=t._Helpers.filterUserIdentities(o,u.userIdentityFilters),c=t._Helpers.filterUserAttributes(a?a.getAllUserAttributes():{},u.userAttributeFilters);return u.initialized||(u.logger=t.Logger,u.init(u.settings,s,false,null,c,l,t._Store.SDKConfig.appVersion,t._Store.SDKConfig.appName,t._Store.SDKConfig.customFlags,t._Store.clientId),u.initialized=true),true}));},this.isEnabledForUserAttributes=function(o,s){if(!o||!t._Helpers.isObject(o)||!Object.keys(o).length)return  true;var a,u,l;if(!s)return  false;l=s.getAllUserAttributes();var c=false;try{if(l&&t._Helpers.isObject(l)&&Object.keys(l).length){for(var d in l)if(l.hasOwnProperty(d)&&(a=He.hashAttributeConditionalForwarding(d),u=He.hashAttributeConditionalForwarding(l[d]),a===o.userAttributeName&&u===o.userAttributeValue)){c=!0;break}}return !o||o.includeOnMatch===c}catch(h){return  true}},this.isEnabledForUnknownUser=function(o,s){return !!(s&&s.isLoggedIn()||!o)},this.applyToForwarders=function(o,s){t._Store.activeForwarders.length&&t._Store.activeForwarders.forEac
5h(function(a){var u=a[o];if(u)try{var l=a[o](s);l&&t.Logger.verbose(l);}catch(c){t.Logger.verbose(c);}});},this.sendEventToForwarders=function(o){var s,a,u,l=function(k,N){k.UserIdentities&&k.UserIdentities.length&&k.UserIdentities.forEach(function(_,S){t._Helpers.inArray(N,He.hashUserIdentity(_.Type))&&(k.UserIdentities.splice(S,1),0<S&&S--);});},c=function(k,N){var _;if(N)for(var S in k.EventAttributes)k.EventAttributes.hasOwnProperty(S)&&(_=He.hashEventAttributeKey(k.EventCategory,k.EventName,S),t._Helpers.inArray(N,_)&&delete k.EventAttributes[S]);},d=function(k,N){return !!(k&&k.length&&t._Helpers.inArray(k,N))},h=[I.MessageType.PageEvent,I.MessageType.PageView,I.MessageType.Commerce];if(!t._Store.webviewBridgeEnabled&&t._Store.activeForwarders){a=He.hashEventName(o.EventName,o.EventCategory),u=He.hashEventType(o.EventCategory);for(var p=0;p<t._Store.activeForwarders.length;p++){if(-1<h.indexOf(o.EventDataType)&&t._Store.activeForwarders[p].filteringEventAttributeValue&&t._Store.activeForwarders[p].filteringEventAttributeValue.eventAttributeName&&t._Store.activeForwarders[p].filteringEventAttributeValue.eventAttributeValue){var f=null;if(o.EventAttributes)for(var g in o.EventAttributes){var v;if(v=He.hashAttributeConditionalForwarding(g),v===t._Store.activeForwarders[p].filteringEventAttributeValue.eventAttributeName&&(f={name:v,value:He.hashAttributeConditionalForwarding(o.EventAttributes[g])}),f)break}var m=f!==null&&f.value===t._Store.activeForwarders[p].filteringEventAttributeValue.eventAttributeValue,y=t._Store.activeForwarders[p].filteringEventAttributeValue.includeOnMatch===true?m:!m;if(!y)continue}if(s={},s=t._Helpers.extend(true,s,o),!(o.EventDataType===I.MessageType.PageEvent&&(d(t._Store.activeForwarders[p].eventNameFilters,a)||d(t._Store.activeForwarders[p].eventTypeFilters,u)))){{if(o.EventDataType===I.MessageType.Commerce&&d(t._Store.activeForwarders[p].eventTypeFilters,u))continue;if(o.EventDataType===I.MessageType.PageView&&d(t._Store.activeForwarders[p].screenNameFilters,a))continue}if(s.EventAttributes&&(o.EventDataType===I.MessageType.PageEvent?c(s,t._Store.activeForwarders[p].attributeFilters):o.EventDataType===I.MessageType.PageView&&c(s,t._Store.activeForwarders[p].screenAttributeFilters)),l(s,t._Store.activeForwarders[p].userIdentityFilters),s.UserAttributes=t._Helpers.filterUserAttributes(s.UserAttributes,t._Store.activeForwarders[p].userAttributeFilters),t._Store.activeForwarders[p].process){t.Logger.verbose("Sending message to forwarder: "+t._Store.activeForwarders[p].name);var T=t._Store.activeForwarders[p].process(s);T&&t.Logger.verbose(T);}}}}},this.handleForwarderUserAttributes=function(o,s,a){e&&e.isAttributeKeyBlocked(s)||!t._Store.activeForwarders.length||t._Store.activeForwarders.forEach(function(u){var l=u[o];if(l&&!He.isFilteredUserAttribute(s,u.userAttributeFilters))try{var c;o===i.setUserAttribute?c=u.setUserAttribute(s,a):o===i.removeUserAttribute&&(c=u.removeUserAttribute(s)),c&&t.Logger.verbose(c);}catch(d){t.Logger.error(d);}});},this.setForwarderUserIdentities=function(o){t._Store.activeForwarders.forEach(function(s){var a=t._Helpers.filterUserIdentities(o,s.userIdentityFilters);s.setUserIdentity&&a.forEach(function(u){var l=s.setUserIdentity(u.Identity,u.Type);l&&t.Logger.verbose(l);});});},this.setForwarderOnUserIdentified=function(o){t._Store.activeForwarders.forEach(function(s){var a=ya(o.getMPID(),s,t,e);if(s.onUserIdentified){var u=s.onUserIdentified(a);u&&t.Logger.verbose(u);}});},this.setForwarderOnIdentityComplete=function(o,s){var a;t._Store.activeForwarders.forEach(function(u){var l=ya(o.getMPID(),u,t,e),c=l.getUserIdentities();s===u_?u.onIdentifyComplete&&(a=u.onIdentifyComplete(l,c),a&&t.Logger.verbose(a)):s===l_?u.onLoginComplete&&(a=u.onLoginComplete(l,c),a&&t.Logger.verbose(a)):s===c_?u.onLogoutComplete&&(a=u.onLogoutComplete(l,c),a&&t.Logger.verbose(a)):s===a_&&u.onModifyComplete&&(a=u.onModifyComplete(l,c),a&&t.Logger.verbose(a));});},this.getForwarderStatsQueue=function(){return t._Persistence.forwardingStatsBatches.forwardingStatsEventQueue},this.setForwarderStatsQueue=function(o){t._Persistence.forwardingStatsBatches.forwardingStatsEventQueue=o;},this.processForwarders=function(o,s){o?(this.processUIEnabledKits(o),this.processSideloadedKits(o),n.initForwarders(t._Store.SDKConfig.identifyRequest.userIdentities,s)):t.Logger.w
5arning("No config was passed. Cannot process forwarders");},this.processUIEnabledKits=function(o){var s=this.returnKitConstructors();try{Array.isArray(o.kitConfigs)&&o.kitConfigs.length&&o.kitConfigs.forEach(function(a){n.configureUIEnabledKit(a,s);});}catch(a){t.Logger.error("MP Kits not configured propertly. Kits may not be initialized. "+a);}},this.returnKitConstructors=function(){var o={};return _e(t._Store.SDKConfig.kits)?!_e(t._preInit.forwarderConstructors)&&t._preInit.forwarderConstructors.forEach(function(s){if(s.suffix){var a="".concat(s.name,"-").concat(s.suffix);o[a]=s;}else o[s.name]=s;}):o=t._Store.SDKConfig.kits,o},this.configureUIEnabledKit=function(o,s){var a=null,u=o;for(var l in s){var c=void 0;if(u.suffix&&(c="".concat(u.name,"-").concat(u.suffix)),(l===c||l===u.name)&&(u.isDebug===t._Store.SDKConfig.isDevelopmentMode||u.isSandbox===t._Store.SDKConfig.isDevelopmentMode)){a=this.returnConfiguredKit(s[l],u),t._Store.configuredForwarders.push(a);break}}},this.processSideloadedKits=function(o){try{if(Array.isArray(o.sideloadedKits)){var s={kits:{}},a=o.sideloadedKits;for(var u in a.forEach(function(d){try{d.kitInstance.register(s);var h=d.kitInstance.name;s.kits[h].filters=d.filterDictionary;}catch(p){console.error("Error registering sideloaded kit "+d.kitInstance.name);}}),s.kits){var l=s.kits[u];n.configureSideloadedKit(l);}if(!_e(s.kits)){var c=Object.keys(s.kits);t._Store.sideloadedKitsCount=c.length;}}}catch(d){t.Logger.error("Sideloaded Kits not configured propertly. Kits may not be initialized. "+d);}},this.configureSideloadedKit=function(o){t._Store.configuredForwarders.push(this.returnConfiguredKit(o,o.filters));},this.returnConfiguredKit=function(o){var s=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},a=new o.constructor;return a.id=s.moduleId,a.isSandbox=s.isDebug||s.isSandbox,a.hasSandbox=s.hasDebugString==="true",a.isVisible=s.isVisible||true,a.settings=s.settings||{},a.eventNameFilters=s.eventNameFilters||[],a.eventTypeFilters=s.eventTypeFilters||[],a.attributeFilters=s.attributeFilters||[],a.screenNameFilters=s.screenNameFilters||[],a.screenAttributeFilters=s.screenAttributeFilters||[],a.userIdentityFilters=s.userIdentityFilters||[],a.userAttributeFilters=s.userAttributeFilters||[],a.filteringEventAttributeValue=s.filteringEventAttributeValue||{},a.filteringUserAttributeValue=s.filteringUserAttributeValue||{},a.eventSubscriptionId=s.eventSubscriptionId||null,a.filteringConsentRuleValues=s.filteringConsentRuleValues||{},a.excludeAnonymousUser=s.excludeAnonymousUser||false,a},this.configurePixel=function(o){(o.isDebug===t._Store.SDKConfig.isDevelopmentMode||o.isProduction!==t._Store.SDKConfig.isDevelopmentMode)&&t._Store.pixelConfigurations.push(o);},this.processPixelConfigs=function(o){try{_e(o.pixelConfigs)||o.pixelConfigs.forEach(function(s){n.configurePixel(s);});}catch(s){t.Logger.error("Cookie Sync configs not configured propertly. Cookie Sync may not be initialized. "+s);}},this.sendSingleForwardingStatsToServer=(function(){var o=n_(md.mark(function s(a){var u,l,c,d;return md.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return l={method:"post",body:JSON.stringify(a),headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"text/plain;charset=UTF-8"}},h.next=3,r.forwarderStatsUploader.upload(l);case 3:c=h.sent,d=c.status===202?"Successfully sent forwarding stats to mParticle Servers":"Issue with forwarding stats to mParticle Servers, received HTTP Code of "+c.statusText,t==null||(u=t.Logger)===null||u===void 0||u.verbose(d);case 6:case "end":return h.stop()}},s)}));return function(){return o.apply(this,arguments)}})();}var Co=I.MessageType,h_=I.ApplicationTransitionType;function p_(t,e){var r=[];for(var n in e.flags={},t.CustomFlags)r=[],t.CustomFlags.hasOwnProperty(n)&&(Array.isArray(t.CustomFlags[n])?t.CustomFlags[n].forEac
5h(function(i){ad(i)&&r.push(i.toString());}):ad(t.CustomFlags[n])&&r.push(t.CustomFlags[n].toString()),r.length&&(e.flags[n]=r));}function g_(t){return {id:on(t.Sku),nm:on(t.Name),pr:rr(t.Price),qt:rr(t.Quantity),br:on(t.Brand),va:on(t.Variant),ca:on(t.Category),ps:rr(t.Position),cc:on(t.CouponCode),tpa:rr(t.TotalAmount),attrs:t.Attributes}}function pa(t){return t?t.map(function(e){return g_(e)}):[]}function kd(t){var e=this;this.convertToConsentStateV2DTO=function(r){if(!r)return null;var n={},i=r.getGDPRConsentState();if(i){var o={};for(var s in n.gdpr=o,i)if(i.hasOwnProperty(s)){var a=i[s];n.gdpr[s]={},typeof a.Consented=="boolean"&&(o[s].c=a.Consented),typeof a.Timestamp=="number"&&(o[s].ts=a.Timestamp),typeof a.ConsentDocument=="string"&&(o[s].d=a.ConsentDocument),typeof a.Location=="string"&&(o[s].l=a.Location),typeof a.HardwareId=="string"&&(o[s].h=a.HardwareId);}}var u=r.getCCPAConsentState();return u&&(n.ccpa={data_sale_opt_out:{c:u.Consented,ts:u.Timestamp,d:u.ConsentDocument,l:u.Location,h:u.HardwareId}}),n},this.createEventObject=function(r,n){var i,o={},s={},a=r.messageType===I.MessageType.OptOut?!t._Store.isEnabled:null;if(t._Store.sessionId||r.messageType===I.MessageType.OptOut||t._Store.webviewBridgeEnabled){var u=pe({},r.customFlags),l=t._Store.integrationAttributes,c=t._Helpers.getFeatureFlag,d=c&&c(F.FeatureFlags.CaptureIntegrationSpecificIds),h=c&&(c(F.FeatureFlags.CaptureIntegrationSpecificIdsV2)||""),p=h&&h!==F.CaptureIntegrationSpecificIdsV2Modes.None||d===true;if(p){t._IntegrationCapture.capture();var f=t._IntegrationCapture.getClickIdsAsCustomFlags();u=pe(pe({},f),u);var g=t._IntegrationCapture.getClickIdsAsIntegrationAttributes();l=pe(pe({},g),l);}s=r.hasOwnProperty("toEventAPIObject")?r.toEventAPIObject():{EventName:r.name||r.messageType,EventCategory:r.eventType,EventAttributes:t._Helpers.sanitizeAttributes(r.data,r.name),ActiveTimeOnSite:(i=t._timeOnSiteTimer)===null||i===void 0?void 0:i.getTimeInForeground(),SourceMessageId:r.sourceMessageId||t._Helpers.generateUniqueId(),EventDataType:r.messageType,CustomFlags:u,UserAttributeChanges:r.userAttributeChanges,UserIdentityChanges:r.userIdentityChanges},r.messageType!==I.MessageType.SessionEnd&&(t._Store.dateLastEventSent=new Date),o={Store:t._Store.serverSettings,SDKVersion:F.sdkVersion,SessionId:t._Store.sessionId,SessionStartDate:t._Store.sessionStartDate?t._Store.sessionStartDate.getTime():0,Debug:t._Store.SDKConfig.isDevelopmentMode,Location:t._Store.currentPosition,OptOut:a,ExpandedEventCount:0,AppVersion:t.getAppVersion(),AppName:t.getAppName(),Package:t._Store.SDKConfig.package,ClientGeneratedId:t._Store.clientId,DeviceId:t._Store.deviceId,IntegrationAttributes:l,CurrencyCode:t._Store.currencyCode,DataPlan:t._Store.SDKConfig.dataPlan?t._Store.SDKConfig.dataPlan:{}},s.EventDataType===Co.AppStateTransition&&(s.IsFirstRun=t._Store.isFirstRun,s.LaunchReferral=window.location.href||null),s.CurrencyCode=t._Store.currencyCode;var v=n||t.Identity.getCurrentUser();return Aa(v,s),r.messageType===I.MessageType.SessionEnd&&(s.SessionLength=t._Store.dateLastEventSent.getTime()-t._Store.sessionStartDate.getTime(),s.currentSessionMPIDs=t._Store.currentSessionMPIDs,s.EventAttributes=t._Store.sessionAttributes,t._Store.currentSessionMPIDs=[],t._Store.sessionStartDate=null),o.Timestamp=t._Store.dateLastEventSent.getTime(),t._Helpers.extend({},s,o)}return null},this.convertEventToV2DTO=function(r){var n={n:r.EventName,et:r.EventCategory,ua:r.UserAttributes,ui:r.UserIdentities,ia:r.IntegrationAttributes,str:r.Store,attrs:r.EventAttributes,sdk:r.SDKVersion,sid:r.SessionId,sl:r.SessionLength,ssd:r.SessionStartDate,dt:r.EventDataType,dbg:r.Debug,ct:r.Timestamp,lc:r.Location,o:r.OptOut,eec:r.ExpandedEventCount,av:r.AppVersion,cgid:r.ClientGeneratedId,das:r.DeviceId,mpid:r.MPID,smpids:r.currentSessionMPIDs};r.DataPlan&&r.DataPlan.PlanId&&(n.dp_id=r.DataPlan.PlanId,r.DataPlan.PlanVersion&&(n.dp_v=r.DataPlan.PlanVersion));var i=e.convertToConsentStateV2DTO(r.ConsentState);return i&&(n.con=i),r.EventDataType===Co.AppStateTransition&&(n.fr=r.IsFirstRun,n.iu=false,n.at=h_.AppInit,n.lr=r.LaunchReferral,n.attrs=null),r.CustomFlags&&p_(r,n),r.EventDataType===Co.Commerce?(n.cu=r.CurrencyCode,r.ShoppingCart&&(n.sc={pl:pa(r.ShoppingCart.ProductList)}),r.ProductAction?n.pd={an:r.ProductAction.ProductActionType,cs:t._Helpers.parseNumber(r.ProductAction.CheckoutStep),co:r.ProductAction.CheckoutOptions,pl:pa(r.ProductAction.ProductList),ti:r.ProductAction.TransactionId,ta:r.ProductAction.Affiliation,tcc:r.ProductAction.CouponCode,tr:t._Helpers.parseNumber(r.ProductAction.TotalAmount),ts:t._Helpers.parseNumber(r.ProductAction.ShippingAmount),tt:t._Helpers.parseNumber(r.ProductAction.TaxAmount)}:r.PromotionAction?n.pm={an:r.PromotionAction.PromotionActionType,pl:r.PromotionAction.PromotionList.map(function(o){return {id:o.Id,nm:o.Name,cr:o.Creative,ps:o.Position?o.Position:0}})}:r.ProductImpressions&&(n.pi=r.ProductImpressions.map(function(o){return {pil:o.ProductImpressionList,pl:pa(o.ProductList)}}))):r.EventDataType===Co.Profile&&(n.pet=r.ProfileMessageType),n};}function f_(t){function e(){var r=t._Forwarders.getForwarderStatsQueue(),n=t._Persistence.forwardingStatsBatches.uploadsTable,i=Date.now();for(var o in r.length&&(n[i]={uploading:false,data:r},t._Forwarders.setForwarderStatsQueue([])),n)(function(s){if(n.hasOwnProperty(s)&&n[s].uploading===false){var a=function(){u.readyState===4&&(u.status===200||u.status===202?(t.Logger.verbose("Successfully sent  "+u.statusText+" from server"),delete n[s]):u.status.toString()[0]==="4"?u.status!==429&&delete n[s]:n[s].uploading=false);},u=t._Helpers.createXHR(a),l=n[s].data;n[s].uploading=true,t._APIClient.sendBatchForwardingStatsToServer(l,u);}})(o);}this.startForwardingStatsTimer=function(){mParticle._forwardingStatsTimer=setInterval(function(){e();},t._Store.SDKConfig.forwarderStatsTimeout);};}var m_=(function(){function t(e,r,n){this.url="",this.logger=n,this.url="https://".concat(e).concat(r,"/audience"),this.userAudienceAPI=window.fetch?new 
5Nn(this.url):new Dn(this.url);}return t.prototype.sendGetUserAudienceRequest=function(e,r){return nr(this,void 0,void 0,function(){var n,i,o,s,a,u;return ir(this,function(l){switch(l.label){case 0:this.logger.verbose("Fetching user audiences from server"),n={method:"GET",headers:{Accept:"*/*"}},i="".concat(this.url,"?mpid=").concat(e),l.label=1;case 1:return l.trys.push([1,6,,7]),[4,this.userAudienceAPI.upload(n,i)];case 2:return o=l.sent(),200<=o.status&&300>o.status?(this.logger.verbose("User Audiences successfully received"),[4,o.json()]):[3,4];case 3:s=l.sent(),a={currentAudienceMemberships:s==null?void 0:s.audience_memberships};try{r(a);}catch(c){throw new Error("Error invoking callback on user audience response.")}return [3,5];case 4:throw o.status===401?new Error("`HTTP error status ${userAudiencePromise.status} while retrieving User Audiences - please verify your API key.`"):o.status===403?new Error("`HTTP error status ${userAudiencePromise.status} while retrieving User Audiences - please verify your workspace is enabled for audiences.`"):new Error("Uncaught HTTP Error ".concat(o.status,"."));case 5:return [3,7];case 6:return u=l.sent(),this.logger.error("Error retrieving audiences. ".concat(u)),[3,7];case 7:return [2]}})})},t})(),xd=function(t){return _e(t)||t.forEach(function(e){fi(e)?e():Array.isArray(e)&&v_(e);}),[]},v_=function(t){var e=t,r=e.splice(0,1)[0];if(typeof window!="undefined"&&window.mParticle&&window.mParticle[e[0]])window.mParticle[r].apply(window.mParticle,e);else {var n=r.split(".");try{for(var i,o=window.mParticle,s=window.mParticle,a=0,u=n;a<u.length;a++)i=u[a],s=o,o=o[i];o.apply(s,e);}catch(l){throw new Error("Unable to compute proper mParticle function "+l)}}},De=F.Messages,st=F.HTTPCodes,Od=F.FeatureFlags,ko=F.IdentityMethods,b_=De.ErrorMessages,__=Od.CacheIdentity,Eo=ko.Identify,hi=ko.Modify,ga=ko.Login,vd=ko.Logout;function y_(t){var e=t._Helpers,r=e.getFeatureFlag,n=e.extend,i=this;this.idCache=null,this.audienceManager=null,this.IdentityRequest={preProcessIdentityRequest:function(s,a,u){t.Logger.verbose(De.InformationMessages.StartingLogEvent+": "+u);var l=t._Helpers.Validators.removeFalsyIdentityValues(s,t.Logger),c=t._Helpers.Validators.validateIdentities(l,u);if(!c.valid)return t.Logger.error("ERROR: "+c.error),{valid:false,error:c.error};if(a&&!t._Helpers.Validators.isFunction(a)){var d="The optional callback must be a function. You tried entering a(n) "+wt(a);return t.Logger.error(d),{valid:false,error:d}}return {valid:true,cleanedIdentities:l}},createIdentityRequest:function(s,a,u,l,c,d,h){var p={client_sdk:{platform:a,sdk_vendor:u,sdk_version:l},context:d,environment:t._Store.SDKConfig.isDevelopmentMode?"development":"production",request_id:t._Helpers.generateUniqueId(),request_timestamp_ms:new Date().getTime(),previous_mpid:h||null,known_identities:jb(s,c)};return p},createModifyIdentityRequest:function(s,a,u,l,c,d){return {client_sdk:{platform:u,sdk_vendor:l,sdk_version:c},context:d,environment:t._Store.SDKConfig.isDevelopmentMode?"development":"production",request_id:t._Helpers.generateUniqueId(),request_timestamp_ms:new Date().getTime(),identity_changes:this.createIdentityChanges(s,a)}},createIdentityChanges:function(s,a){var u,l=[];
5if(a&&it(a)&&s&&it(s))for(u in a)l.push({old_value:s[u]||null,new_value:a[u],identity_type:u});return l},combineUserIdentities:function(s,a){var u={},l=n({},s,a);for(var c in l){var d=I.IdentityType.getIdentityType(c);d!==false&&0<=d&&(u[I.IdentityType.getIdentityType(c)]=l[c]);}return u},createAliasNetworkRequest:function(s){return {request_id:t._Helpers.generateUniqueId(),request_type:"alias",environment:t._Store.SDKConfig.isDevelopmentMode?"development":"production",api_key:t._Store.devToken,data:{destination_mpid:s.destinationMpid,source_mpid:s.sourceMpid,start_unixtime_ms:s.startTime,end_unixtime_ms:s.endTime,scope:s.scope,device_application_stamp:t._Store.deviceId}}},convertAliasToNative:function(s){return {DestinationMpid:s.destinationMpid,SourceMpid:s.sourceMpid,StartUnixtimeMs:s.startTime,EndUnixtimeMs:s.endTime}},convertToNative:function(s){var a=[];if(s&&s.userIdentities){for(var u in s.userIdentities)s.userIdentities.hasOwnProperty(u)&&a.push({Type:I.IdentityType.getIdentityType(u),Identity:s.userIdentities[u]});return {UserIdentities:a}}}},this.IdentityAPI={HTTPCodes:st,identify:function(s,a){var u,l=t.Identity.getCurrentUser(),c=t._Identity.IdentityRequest.preProcessIdentityRequest(s,a,Eo);if(l&&(u=l.getMPID()),c.valid){var d=t._Identity.IdentityRequest.createIdentityRequest(c.cleanedIdentities,F.platform,F.sdkVendor,F.sdkVersion,t._Store.deviceId,t._Store.context,u);if(t._Helpers.getFeatureFlag(F.FeatureFlags.CacheIdentity)){var h=hd(d.known_identities,i.idCache,i.parseIdentityResponse,u,a,s,Eo);if(h)return}t._Helpers.canLog()?t._Store.webviewBridgeEnabled?(t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.Identify,JSON.stringify(t._Identity.IdentityRequest.convertToNative(s))),t._Helpers.invokeCallback(a,st.nativeIdentityRequest,"Identify request sent to native sdk")):t._IdentityAPIClient.sendIdentityRequest(d,Eo,a,s,i.parseIdentityResponse,u,d.known_identities):(t._Helpers.invokeCallback(a,st.loggingDisabledOrMissingAPIKey,De.InformationMessages.AbandonLogEvent),t.Logger.verbose(De.InformationMessages.AbandonLogEvent));}else t._Helpers.invokeCallback(a,st.validationIssue,c.error),t.Logger.verbose(c);},logout:function(s,a){var u,l=t.Identity.getCurrentUser(),c=t._Identity.IdentityRequest.preProcessIdentityRequest(s,a,vd);if(l&&(u=l.getMPID()),c.valid){var d,h=t._Identity.IdentityRequest.createIdentityRequest(c.cleanedIdentities,F.platform,F.sdkVendor,F.sdkVersion,t._Store.deviceId,t._Store.context,u);t._Helpers.canLog()?t._Store.webviewBridgeEnabled?(t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.Logout,JSON.stringify(t._Identity.IdentityRequest.convertToNative(s))),t._Helpers.invokeCallback(a,st.nativeIdentityRequest,"Logout request sent to native sdk")):(t._IdentityAPIClient.sendIdentityRequest(h,vd,a,s,i.parseIdentityResponse,u),d=t._ServerModel.createEventObject({messageType:I.MessageType.Profile}),d.ProfileMessageType=I.ProfileMessageType.Logout,t._Store.activeForwarders.length&&t._Store.activeForwarders.forEach(function(p){p.logOut&&p.logOut(d);})):(t._Helpers.invokeCallback(a,st.loggingDisabledOrMissingAPIKey,De.InformationMessages.AbandonLogEvent),t.Logger.verbose(De.InformationMessages.AbandonLogEvent));}else t._Helpers.invokeCallback(a,st.validationIssue,c.error),t.Logger.verbose(c);},login:function(s,a){var u,l=t.Identity.getCurrentUser(),c=t._Identity.IdentityRequest.preProcessIdentityRequest(s,a,ga);if(l&&(u=l.getMPID()),c.valid){var d=t._Identity.IdentityRequest.createIdentityRequest(c.cleanedIdentities,F.platform,F.sdkVendor,F.sdkVersion,t._Store.deviceId,t._Store.context,u);if(t._Helpers.getFeatureFlag(F.FeatureFlags.CacheIdentity)){var h=hd(d.known_identities,i.idCache,i.parseIdentityResponse,u,a,s,ga);if(h)return}t._Helpers.canLog()?t._Store.webviewBridgeEnabled?(t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.Login,JSON.stringify(t._Identity.IdentityRequest.convertToNative(s))),t._Helpers.invokeCallback(a,st.nativeIdentityRequest,"Login request sent to native sdk")):t._IdentityAPIClient.sendIdentityRequest(d,ga,a,s,i.parseIdentityResponse,u,d.known_identities):(t._Helpers.invokeCallback(a,st.loggingDisabledOrMissingAPIKey,De.InformationMessages.AbandonLogEvent),t.Logger.verbose(De.InformationMessages.AbandonLogEvent));}else t._Helpers.invokeCallback(a,st.validationIssue,c.error),t.Logger.verbose(c);},modify:function(s,a){var u,l=t.Identity.getCurrentUser(),c=t._Identity.IdentityRequest.preProcessIdentityRequest(s,a,hi);if(l&&(u=l.getMPID()),c.valid){var d=s&&s.userIdentities?c.cleanedIdentities.userIdentities:{},h=t._Identity.IdentityRequest.createModifyIdentityRequest(l?l.getUserIdentities().userIdentities:{},d,F.platform,F.sdkVendor,F.sdkVersion,t._Store.context);t._Helpers.canLog()?t._Store.webviewBridgeEnabled?(t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.Modify,JSON.stringify(t._Identity.IdentityRequest.convertToNative(s))),t._Helpers.invokeCallback(a,st.nativeIdentityRequest,"Modify request sent to native sdk")):t._IdentityAPIClient.sendIdentityRequest(h,hi,a,s,i.parseIdentityResponse,u,h.known_identities):(t._Helpers.invokeCallback(a,st.loggingDisabledOrMissingAPIKey,De.InformationMessages.AbandonLogEvent),t.Logger.verbose(De.InformationMessages.AbandonLogEvent));}else t._Helpers.invokeCallback(a,st.validationIssue,c.error),t.Logger.verbose(c);},getCurrentUser:function(){var s;return t._Store?(s=t._Store.mpid,s?(s=t._Store.mpid.slice(),i.mParticleUser(s,t._Store.isLoggedIn)):t._Store.webviewBridgeEnabled?i.mParticleUser():null):null},getUser:function(s){var a=t._Persistence.getPersistence();return a&&a[s]&&!F.SDKv2NonMPIDCookieKeys.hasOwnProperty(s)?i.mParticleUser(s):null},getUsers:function(){var s=t._Persistence.getPersistence(),a=[];if(s)for(var u in s)F.SDKv2NonMPIDCookieKeys.hasOwnProperty(u)||a.push(i.mParticleUser(u));return a.sort(function(l,c){var d=l.getLastSeenTime()||0,h=c.getLastSeenTime()||0;return d>h?-1:1}),a},aliasUsers:function(s,a){var u;if(s.destinationMpid&&s.sourceMpid||(u=De.ValidationMessages.AliasMissingMpid),s.destinationMpid===s.sourceMpid&&(u=De.ValidationMessages.AliasNonUniqueMpid),s.startTime&&s.endTime||(u=De.ValidationMessages.AliasMissingTime),s.startTime>s.endTime&&(u=De.ValidationMessages.AliasStartBeforeEndTime),u)return t.Logger.w
5arning(u),void t._Helpers.invokeAliasCallback(a,st.validationIssue,u);if(!t._Helpers.canLog())t._Helpers.invokeAliasCallback(a,st.loggingDisabledOrMissingAPIKey,De.InformationMessages.AbandonAliasUsers),t.Logger.verbose(De.InformationMessages.AbandonAliasUsers);else if(t._Store.webviewBridgeEnabled)t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.Alias,JSON.stringify(t._Identity.IdentityRequest.convertAliasToNative(s))),t._Helpers.invokeAliasCallback(a,st.nativeIdentityRequest,"Alias request sent to native sdk");else {t.Logger.verbose(De.InformationMessages.StartingAliasRequest+": "+s.sourceMpid+" -> "+s.destinationMpid);var l=t._Identity.IdentityRequest.createAliasNetworkRequest(s);t._IdentityAPIClient.sendAliasRequest(l,a);}},createAliasRequest:function(s,a){try{if(!a||!s)return t.Logger.error("'destinationUser' and 'sourceUser' must both be present"),null;var u=s.getFirstSeenTime();u||t.Identity.getUsers().forEach(function(d){d.getFirstSeenTime()&&(!u||d.getFirstSeenTime()<u)&&(u=d.getFirstSeenTime());});var l=new Date().getTime()-1e3*(60*(60*(24*t._Store.SDKConfig.aliasMaxWindow))),c=s.getLastSeenTime()||new Date().getTime();return u<l&&(u=l,c<u&&t.Logger.warning("Source User has not been seen in the last "+t._Store.SDKConfig.maxAliasWindow+" days, Alias Request will likely fail")),{destinationMpid:a.getMPID(),sourceMpid:s.getMPID(),startTime:u,endTime:c}}catch(d){return t.Logger.error("There was a problem with creating an alias request: "+d),null}}},this.mParticleUser=function(o,s){var a=this;return {getUserIdentities:function(){var l={},c=t._Store.getUserIdentities(o);for(var d in c)c.hasOwnProperty(d)&&(l[I.IdentityType.getIdentityName(t._Helpers.parseNumber(d))]=c[d]);return {userIdentities:l}},getMPID:function(){return o},setUserTag:function(l){return t._Helpers.Validators.isValidKeyValue(l)?void this.setUserAttribute(l,null):void t.L
5ogger.error(De.ErrorMessages.BadKey)},removeUserTag:function(l){return t._Helpers.Validators.isValidKeyValue(l)?void this.removeUserAttribute(l):void t.Logger.error(De.ErrorMessages.BadKey)},setUserAttribute:function(l,c){if(t._SessionManager.resetSessionTimer(),t._Helpers.canLog()){if(!t._Helpers.Validators.isValidAttributeValue(c))return void t.Logger.error(De.ErrorMessages.BadAttribute);if(!t._Helpers.Validators.isValidKeyValue(l))return void t.Logger.error(De.ErrorMessages.BadKey);if(t._Store.webviewBridgeEnabled)t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.SetUserAttribute,JSON.stringify({key:l,value:c}));else {var d,h,p=this.getAllUserAttributes(),f=t._Helpers.findKeyInObject(p,l);f?(h=false,d=p[f],delete p[f]):h=true,p[l]=c,t._Store.setUserAttributes(o,p),a.sendUserAttributeChangeEvent(l,c,d,h,false,this),t._Forwarders.initForwarders(a.IdentityAPI.getCurrentUser().getUserIdentities(),t._APIClient.prepareForwardingStats),t._Forwarders.handleForwarderUserAttributes("setUserAttribute",l,c);}}},setUserAttributes:function(l){if(t._SessionManager.resetSessionTimer(),!it(l))t.Logger.error("Must pass an object into setUserAttributes. You passed a "+wt(l));else if(t._Helpers.canLog())for(var c in l)l.hasOwnProperty(c)&&this.setUserAttribute(c,l[c]);},removeUserAttribute:function(l){var c,d;if(t._SessionManager.resetSessionTimer(),!t._Helpers.Validators.isValidKeyValue(l))return void t.Logger.error(De.ErrorMessages.BadKey);if(t._Store.webviewBridgeEnabled)t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.RemoveUserAttribute,JSON.stringify({key:l,value:null}));else {c=t._Persistence.getPersistence(),d=this.getAllUserAttributes();var h=t._Helpers.findKeyInObject(d,l);h&&(l=h);var p=d[l]?d[l].toString():null;delete d[l],c&&c[o]&&(c[o].ua=d,t._Persistence.savePersistence(c,o)),a.sendUserAttributeChangeEvent(l,null,p,false,true,this),t._Forwarders.initForwarders(a.IdentityAPI.getCurrentUser().getUserIdentities(),t._APIClient.prepareForwardingStats),t._Forwarders.handleForwarderUserAttributes("removeUserAttribute",l,null);}},setUserAttributeList:function(l,c){if(t._SessionManager.resetSessionTimer(),!t._Helpers.Validators.isValidKeyValue(l))return void t.Logger.error(De.ErrorMessages.BadKey);if(!Array.isArray(c))return void t.Logger.error("The value you passed in to setUserAttributeList must be an array. You passed in a "+(typeof value=="undefined"?"undefined":wt(value)));var d=c.slice();if(t._Store.webviewBridgeEnabled)t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.SetUserAttributeList,JSON.stringify({key:l,value:d}));else {var h,p,f,g=this.getAllUserAttributes(),v=t._Helpers.findKeyInObject(g,l);if(v?(p=false,h=g[v],delete g[v]):p=true,g[l]=d,t._Store.setUserAttributes(o,g),!h||!Array.isArray(h))f=true;else if(c.length!==h.length)f=true;else for(var m=0;m<c.length;m++)if(h[m]!==c[m]){f=true;break}f&&a.sendUserAttributeChangeEvent(l,c,h,p,false,this),t._Forwarders.initForwarders(a.IdentityAPI.getCurrentUser().getUserIdentities(),t._APIClient.prepareForwardingStats),t._Forwarders.handleForwarderUserAttributes("setUserAttribute",l,d);}},removeAllUserAttributes:function(){var l;if(t._SessionManager.resetSessionTimer(),t._Store.webviewBridgeEnabled)t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.RemoveAllUserAttributes);else if(l=this.getAllUserAttributes(),t._Forwarders.initForwarders(a.IdentityAPI.getCurrentUser().getUserIdentities(),t._APIClient.prepareForwardingStats),l)for(var c in l)l.hasOwnProperty(c)&&t._Forwarders.handleForwarderUserAttributes("removeUserAttribute",c,null),this.removeUserAttribute(c);},getUserAttributesLists:function(){var l,c={};for(var d in l=this.getAllUserAttributes(),l)l.hasOwnProperty(d)&&Array.isArray(l[d])&&(c[d]=l[d].slice());return c},getAllUserAttributes:function(){var l=t._Store.getUserAttributes,c={},d=l(o);if(d)for(var h in d)d.hasOwnProperty(h)&&(c[h]=Array.isArray(d[h])?d[h].slice():d[h]);return c},getCart:function(){return t.Logger.warning("Deprecated function Identity.getCurrentUser().getCart() will be removed in future releases"),a.mParticleUserCart(o)}
5,getConsentState:function(){return t._Store.getConsentState(o)},setConsentState:function(l){t._Store.setConsentState(o,l),t._Forwarders.initForwarders(this.getUserIdentities().userIdentities,t._APIClient.prepareForwardingStats),t._CookieSyncManager.attemptCookieSync(this.getMPID());},isLoggedIn:function(){return s},getLastSeenTime:function(){return t._Persistence.getLastSeenTime(o)},getFirstSeenTime:function(){return t._Persistence.getFirstSeenTime(o)},getUserAudiences:function(l){return t._Helpers.getFeatureFlag(Od.AudienceAPI)?(a.audienceManager===null&&(a.audienceManager=new m_(t._Store.SDKConfig.userAudienceUrl,t._Store.devToken,t.Logger,o)),void a.audienceManager.sendGetUserAudienceRequest(o,l)):void t.Logger.error(b_.AudienceAPINotEnabled)}}},this.mParticleUserCart=function(o){return {add:function(a,u){t.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().add() will be removed in future releases");var l,c,d;d=Array.isArray(a)?a.slice():[a],d.forEach(function(h){h.Attributes=t._Helpers.sanitizeAttributes(h.Attributes);}),t._Store.webviewBridgeEnabled?t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.AddToCart,JSON.stringify(d)):(t._SessionManager.resetSessionTimer(),c=t._Persistence.getUserProductsFromLS(o),c=c.concat(d),u===true&&t._Events.logProductActionEvent(I.ProductActionType.AddToCart,d),c.length>t._Store.SDKConfig.maxProducts&&(t.Logger.verbose("The cart contains "+c.length+" items. Only "+t._Store.SDKConfig.maxProducts+" can currently be saved in cookies."),c=c.slice(-t._Store.SDKConfig.maxProducts)),l=t._Persistence.getAllUserProductsFromLS(),l[o].cp=c,t._Persistence.setCartProducts(l));},remove:function(a,u){t.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().remove() will be removed in future releases");var l,c,d=-1,h=null;t._Store.webviewBridgeEnabled?t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.RemoveFromCart,JSON.stringify(a)):(t._SessionManager.resetSessionTimer(),c=t._Persistence.getUserProductsFromLS(o),c&&(c.forEach(function(p,f){p.Sku===a.Sku&&(d=f,h=p);}),-1<d&&(c.splice(d,1),u===true&&t._Events.logProductActionEvent(I.ProductActionType.RemoveFromCart,h))),l=t._Persistence.getAllUserProductsFromLS(),l[o].cp=c,t._Persistence.setCartProducts(l));},clear:function(){t.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().clear() will be removed in future releases");var a;t._Store.webviewBridgeEnabled?t._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.ClearCart):(t._SessionManager.resetSessionTimer(),a=t._Persistence.getAllUserProductsFromLS(),a&&a[o]&&a[o].cp&&(a[o].cp=[],a[o].cp=[],t._Persistence.setCartProducts(a)));},getCartProducts:function(){return t.Logger.warning("Deprecated function Identity.getCurrentUser().getCart().getCartProducts() will be removed in future releases"),t._Persistence.getCartProducts(o)}}},this.parseIdentityResponse=function(o,s,a,u,l,c,d){var h,p,f,g=t.Identity.getUser(s),v=g?g.getMPID():null,m=g?g.getUserIdentities().userIdentities:{},y={};t._Store.identityCallInFlight=false;try{var T,k,N;if(t.Logger.verbose('Parsing "'+l+'" identity response from server'),p=(T=o.responseText)!==null&&T!==void 0?T:null,t._Store.isLoggedIn=((k=p)===null||k===void 0?void 0:k.is_logged_in)||!1,Eb(g,p)&&(t._Store.mpid=p.mpid,g&&t._Persistence.setLastSeenTime(s),h=!t._Persistence.getFirstSeenTime(p.mpid),t._Persistence.setFirstSeenTime(p.mpid)),o.status===va){r(__)&&Fb(l,c,i.idCache,o,d);var _=i.IdentityAPI.getUser(p.mpid),S=_?_.getUserIdentities().userIdentities:{};l===hi?(y=t._Identity.IdentityRequest.combineUserIdentities(m,u.userIdentities),t._Store.setUserIdentities(s,y)):(l===Eo&&g&&p.mpid===v&&t._Persistence.setFirstSeenTime(p.mpid),t._Store.addMpidToSessionHistory(p.mpid,s),t._CookieSyncManager.attemptCookieSync(p.mpid,h),t._Persistence.swapCurrentUser(s,p.mpid,t._Store.currentSessionMPIDs),u&&!_e(u.userIdentities)&&(y=i.IdentityRequest.combineUserIdentities(S,u.userIdentities)),t._Store.setUserIdentities(p.mpid,y),t._Persistence.update(),t._Store.syncPersistenceData(),t._Persistence.findPrevCookiesB
5asedOnUI(u),t._Store.context=p.context||t._Store.context),f=t.Identity.getCurrentUser(),w_(g,f,u,t.Logger);var M=t._Persistence.getPersistence();f&&(t._Persistence.storeDataInMemory(M,f.getMPID()),i.reinitForwardersOnUserChange(g,f),i.setForwarderCallbacks(f,l));var X=te.getNewIdentitiesByName(y),J=l===hi?m:S;i.sendUserIdentityChangeEvent(X,l,p.mpid,J);}if(a){var G=o.status===0?st.noHttpCoverage:o.status;t._Helpers.invokeCallback(a,G,p||null,f);}else p&&!_e(p.errors)&&t.Logger.error("Received HTTP response code of "+o.status+" - "+p.errors[0].message);t.Logger.verbose("Successfully parsed Identity Response"),(N=t._APIClient)===null||N===void 0||N.processQueuedEvents();}catch(V){a&&t._Helpers.invokeCallback(a,o.status,p||null),t.Logger.error("Error parsing JSON response from Identity server: "+V);}t._Store.isInitialized=true,t._RoktManager.isReady()&&(t._RoktManager.currentUser=t.Identity.getCurrentUser()),t._preInit.readyQueue=xd(t._preInit.readyQueue);},this.sendUserIdentityChangeEvent=function(o,s,a,u){if(a||s===hi){var l=this.IdentityAPI.getUser(a);for(var c in o)if(u[c]!==o[c]){var d,h=!u[c],p=i.createUserIdentityChange(c,o[c],u[c],h,l);(d=t._APIClient)===null||d===void 0||d.sendEventToServer(p);}}},this.createUserIdentityChange=function(o,s,a,u,l){var c;return c=t._ServerModel.createEventObject({messageType:I.MessageType.UserIdentityChange,userIdentityChanges:{New:{IdentityType:o,Identity:s,CreatedThisBatch:u},Old:{IdentityType:o,Identity:a,CreatedThisBatch:false}},userInMemory:l}),c},this.sendUserAttributeChangeEvent=function(o,s,a,u,l,c){var d=i.createUserAttributeChange(o,s,a,u,l,c);if(d){var h;(h=t._APIClient)===null||h===void 0||h.sendEventToServer(d);}},this.createUserAttributeChange=function(o,s,a,u,l,c){typeof a=="undefined"&&(a=null);var d;return s!==a&&(d=t._ServerModel.createEventObject({messageType:I.MessageType.UserAttributeChange,userAttributeChanges:{UserAttributeName:o,New:s,Old:a,Deleted:l,IsNewAttribute:u}},c)),d},this.reinitForwardersOnUserChange=function(o,s){if(Cb(o,s)){var a;(a=t._Forwarders)===null||a===void 0||a.initForwarders(s.getUserIdentities().userIdentities,t._APIClient.prepareForwardingStats);}},this.setForwarderCallbacks=function(o,s){var a,u,l;(a=t._Forwarders)===null||a===void 0||a.setForwarderUserIdentities(o.getUserIdentities().userIdentities),(u=t._Forwarders)===null||u===void 0||u.setForwarderOnIdentityComplete(o,s),(l=t._Forwarders)===null||l===void 0||l.setForwarderOnUserIdentified(o);};}function w_(t,e,r,n){if(r&&r.onUserAlias&&fi(r.onUserAlias))try{n.warning(wd("onUserAlias")),r.onUserAlias(t,e);}catch(i){n.error("There was an error with your onUserAlias function - "+i);}}var pt=F.CCPAPurpose;function S_(t){var e=this;this.isEnabledForUserConsent=function(r,n){if(!r||!r.values||!r.values.length)return  true;if(!n)return  false;var i,o={},s=n.getConsentState();if(s){var a=s.getGDPRConsentState();if(a)for(var u in a)a.hasOwnProperty(u)&&(i=He.hashConsentPurposeConditionalForwarding("1",u),o[i]=a[u].Consented);var l=s.getCCPAConsentState();l&&(i=He.hashConsentPurposeConditionalForwarding("2",pt),o[i]=l.Consented);}var c=r.values.some(function(d){var h=d.consentPurpose,p=d.hasConsented;return !!o.hasOwnProperty(h)&&o[h]===p});return r.includeOnMatch===c},this.createPrivacyConsent=function(r,n,i,o,s){return typeof r=="boolean"?n&&isNaN(n)?(t.Logger.error("Timestamp must be a valid number when constructing a Consent object."),null):i&&typeof i!="string"?(t.Logger.error("Document must be a valid string when constructing a Consent object."),null):o&&typeof o!="string"?(t.Logger.error("Location must be a valid string when constructing a Consent object."),null):s&&typeof s!="string"?(t.Logger.error("Hardware ID must be a valid string when constructing a Consent object."),null):{Consented:r,Timestamp:n||Date.now(),ConsentDocument:i,Location:o,HardwareId:s}:(t.Logger.error("Consented boolean is required when constructing a Consent object."),null)},this.ConsentSerialization={toMinifiedJsonObject:function(n){var i,o={};if(n){var s=n.getGDPRConsentState();if(s){for(var a in o.gdpr={},s)if(s.hasOwnProperty(a)){var u=s[a];o.gdpr[a]={},typeof u.Consented=="boolean"&&(o.gdpr[a].c=u.Consented),typeof u.Timestamp=="number"&&(o.gdpr[a].ts=u.Timestamp),typeof u.ConsentDocument=="string"&&(o.gdpr[a].d=u.ConsentDocument),typeof u.Location=="str
5ing"&&(o.gdpr[a].l=u.Location),typeof u.HardwareId=="string"&&(o.gdpr[a].h=u.HardwareId);}}var l=n.getCCPAConsentState();l&&(o.ccpa=(i={},i[pt]={},i),typeof l.Consented=="boolean"&&(o.ccpa[pt].c=l.Consented),typeof l.Timestamp=="number"&&(o.ccpa[pt].ts=l.Timestamp),typeof l.ConsentDocument=="string"&&(o.ccpa[pt].d=l.ConsentDocument),typeof l.Location=="string"&&(o.ccpa[pt].l=l.Location),typeof l.HardwareId=="string"&&(o.ccpa[pt].h=l.HardwareId));}return o},fromMinifiedJsonObject:function(n){var i=e.createConsentState();if(n.gdpr){for(var o in n.gdpr)if(n.gdpr.hasOwnProperty(o)){var s=e.createPrivacyConsent(n.gdpr[o].c,n.gdpr[o].ts,n.gdpr[o].d,n.gdpr[o].l,n.gdpr[o].h);i.addGDPRConsentState(o,s);}}if(n.ccpa&&n.ccpa.hasOwnProperty(pt)){var a=e.createPrivacyConsent(n.ccpa[pt].c,n.ccpa[pt].ts,n.ccpa[pt].d,n.ccpa[pt].l,n.ccpa[pt].h);i.setCCPAConsentState(a);}return i}},this.createConsentState=function(r){function n(p){if(typeof p!="string")return null;var f=p.trim();return f.length?f.toLowerCase():null}function i(p,f){var g=n(p);if(!g)return t.Logger.error("Purpose must be a string."),this;if(!it(f))return t.Logger.error("Invoked with a bad or empty consent object."),this;var v=e.createPrivacyConsent(f.Consented,f.Timestamp,f.ConsentDocument,f.Location,f.HardwareId);return v&&(c[g]=v),this}function o(p){if(!p)c={};else if(it(p))for(var f in c={},p)p.hasOwnProperty(f)&&this.addGDPRConsentState(f,p[f]);return this}function s(p){var f=n(p);return f?(delete c[f],this):this}function a(){return Object.assign({},c)}function u(p){if(!it(p))return t.Logger.error("Invoked with a bad or empty CCPA consent object."),this;var f=e.createPrivacyConsent(p.Consented,p.Timestamp,p.ConsentDocument,p.Location,p.HardwareId);return f&&(d[pt]=f),this}function l(){return delete d[pt],this}var c={},d={};if(r){var h=e.createConsentState();return h.setGDPRConsentState(r.getGDPRConsentState()),h.setCCPAConsentState(r.getCCPAConsentState()),h}return {setGDPRConsentState:o,addGDPRConsentState:i,setCCPAConsentState:u,getCCPAConsentState:function(){return d[pt]},getGDPRConsentState:a,removeGDPRConsentState:s,removeCCPAState:function(){return t.Logger.warning("removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead"),l()},removeCCPAConsentState:l}};}var me={ScreenView:"screen_view",CustomEvent:"custom_event",UserAttributes:"user_attributes",UserIdentities:"user_identities",ProductAction:"product_action",PromotionAction:"promotion_action",ProductImpression:"product_impression"},C_=(function(){function t(e,r){var n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y=this;if(this.dataPlanMatchLookups={},this.blockEvents=false,this.blockEventAttributes=false,this.blockUserAttributes=false,this.blockUserIdentities=false,this.kitBlockingEnabled=false,e&&!e.document)return void(this.kitBlockingEnabled=false);this.kitBlockingEnabled=true,this.mpInstance=r,this.blockEvents=(o=(i=(n=e==null?void 0:e.document)===null||n===void 0?void 0:n.dtpn)===null||i===void 0?void 0:i.blok)===null||o===void 0?void 0:o.ev,this.blockEventAttributes=(u=(a=(s=e==null?void 0:e.document)===null||s===void 0?void 0:s.dtpn)===null||a===void 0?void 0:a.blok)===null||u===void 0?void 0:u.ea,this.blockUserAttributes=(d=(c=(l=e==null?void 0:e.document)===null||l===void 0?void 0:l.dtpn)===null||c===void 0?void 0:c.blok)===null||d===void 0?void 0:d.ua,this.blockUserIdentities=(f=(p=(h=e==null?void 0:e.document)===null||h===void 0?void 0:h.dtpn)===null||p===void 0?void 0:p.blok)===null||f===void 0?void 0:f.id;var T=(m=(v=(g=e==null?void 0:e.document)===null||g===void 0?void 0:g.dtpn)===null||v===void 0?void 0:v.vers)===null||m===void 0?void 0:m.version_document,k=T==null?void 0:T.data_points;if(T)try{0<(k==null?void 0:k.length)&&k.forEach(function(N){return y.addToMatchLookups(N)});}catch(N){this.mpInstance.Logger.error("There was an issue with the data plan: "+N);}}return t.prototype.addToMatchLookups=function(e){var r,n,i;if(!e.match||!e.validator)return void this.mpInstance.Logger.warning("Data Plan Point is not valid' + ".concat(e));var o=this.generateMatchKey(e.match),s=this.getPlannedProperties(e.match.type,e.validator);this.dataPlanMatchLookups[o]=s,(((r=e==null?void 0:e.match)===null||r===void 0?void 0:r.type)===me.ProductImpression||((n=e==null?void 0:e.match)===null||n===void 0?void 0:n.type)===me.ProductAction||((i=e==null?void 0:e.match)===null||i===void 0?void 0:i.type)===me.PromotionAction)&&(o=this.generateProductAttributeMatchKey(e.match),s=this.getProductProperties(e.match.type,e.validator),this.dataPlanMatchLookups[o]=s);},t.prototype.generateMatchKey=function(e){var r=e.criteria||"";switch(e.type){case me.CustomEvent:var n=r;return [me.CustomEvent,n.custom_event_type,n.event_name].join(":");case me.ScreenView:return [me.ScreenView,"",r.screen_name].join(":");case me.ProductAction:return [e.type,r.action].join(":");case me.PromotionAction:return [e.type,r.action].join(":");case me.ProductImpression:return [e.type,r.action].join(":");case me.UserIdentities:case me.UserAttributes:return [e.type].join(":");default:return null}},t.prototype.generateProductAttributeMatchKey=function(e){var r=e.criteria||"";switch(e.type){case me.ProductAction:return [e.type,r.action,"ProductAttributes"].join(":");case me.PromotionAction:return [e.type,r.action,"ProductAttributes"].join(":");case me.ProductImpression:return [e.type,"ProductAttributes"].join(":");default:return null}},t.prototype.getPlannedProperties=function(e,r){var n,i,o,s,a,u,l,c,d,h;switch(e){case me.CustomEvent:case me.ScreenView:case me.ProductAction:case me.PromotionAction:case me.ProductImpression:if(d=(s=(o=(i=(n=r==null?void 0:r.definition)===null||n===void 0?void 0:n.properties)===null||i===void 0?void 0:i.data)===null||o===void 0?void 0:o.properties)===null||s===void 0?void 0:s.custom_attributes,d){if(d.additionalProperties===true||d.additionalProperties===void 0)return  true;for(var p,f={},g=0,v=Object.keys(d.properties);g<v.length;g++)p=v[g],f[p]=true;return f}return ((l=(u=(a=r==null?void 0:r.definition)===null||a===void 0?void 0:a.properties)===null||u===void 0?void 0:u.data)===null||l===void 0?void 0:l.additionalProperties)!==false||{};case me.UserAttributes:case me.UserIdentities:if(h=(c=r==null?void 0:r.definition)===null||c===void 0?void 0:c.additionalProperties,h===true||h===void 0)return  true;for(var p,f={},m=r.definition.properties,y=0,T=Object.keys(m);y<T.length;y++)p=T[y],f[p]=true;return f;default:return null}},t.prototype.getProductProperties=function(e,r){var n,i,o,s,a,u,l,c,d,h,p,f,g,v,m,y,T,k,N,_;switch(e){case me.ProductImpression:if(_=(h=(d=(c=(l=(u=(a=(s=(o=(i=(n=r==null?void 0:r.definition)===null||n===void 0?void 0:n.properties)===null||i===void 0?void 0:i.data)===null||o===void 0?void 0:o.properties)===null||s===void 0?void 0:s.product_impressions)===null||a===void 0?void 0:a.items)===null||u===void 0?void 0:u.properties)===null||l===void 0?void 0:l.products)===null||c===void 0?void 0:c.items)===null||d===void 0?void 0:d.properties)===null||h===void 0?void 0:h.custom_attributes,(_==null?void 0:_.additionalProperties)===false){for(var S,M={},X=0,J=Object.keys(_==null?void 0:_.properties);X<J.length;X++)S=J[X],M[S]=true;return M}return  true;case me.ProductAction:case me.PromotionAction:if(_=(N=(k=(T=(y=(m=(v=(g=(f=(p=r==null?void 0:r.definition)===null||p===void 0?void 0:p.properties)===null||f===void 0?void 0:f.data)===null||g===void 0?void 0:g.properties)===null||v===void 0?void 0:v.product_action)===null||m===void 0?void 0:m.properties)===null||y===void 0?void 0:y.products)===null||T===void 0?void 0:T.items)===null||k===void 0?void 0:k.properties)===null||N===void 0?void 0:N.custom_attributes,_&&_.additionalProperties===false){for(var S,M={},G=0,V=Object.keys(_==null?void 0:_.properties);G<V.length;G++)S=V[G],M[S]=true;return M}return  true;default:return null}},t.prototype.getMatchKey=function(e){switch(e.event_type){case j.EventTypeEnum.screenView:var r=e;return r.data?["screen_view","",r.data.screen_name].join(":"):null;case j.EventTypeEnum.commerceEvent:var n=e,i=[];if(n&&n.data){var o=n.data,s=o.product_action,a=o.product_impressions,u=o.promotion_action;s?(i.push(me.ProductAction),i.push(s.action)):u?(i.push(me.PromotionAction),i.push(u.action)):a&&i.push(me.ProductImpression);}return i.join(":");case j.EventTypeEnum.customEvent:var l=e;return l.data?["custom_event",l.data.custom_event_type,l.data.event_name].join(":"):null;default:return null}},t.prototype.getProductAttributeMatchKey=function(e){if(e.event_type===j.EventTypeEnum.commerceEvent){var r=[],n=e.data,i=n.product_action,o=n.product_impressions,s=n.promotion_action;return i?(r.push(me.ProductAction),r.push(i.action),r.push("ProductAttributes")):s?(r.push(me.PromotionAction),r.push(s.action),r.push("ProductAttributes")):o&&(r.push(me.ProductImpression),r.push("ProductAttributes")),r.j
5oin(":")}else return null},t.prototype.createBlockedEvent=function(e){try{return e&&(e=this.transformEventAndEventAttributes(e)),e&&e.EventDataType===I.MessageType.Commerce&&(e=this.transformProductAttributes(e)),e&&(e=this.transformUserAttributes(e),e=this.transformUserIdentities(e)),e}catch(r){return e}},t.prototype.transformEventAndEventAttributes=function(e){var r=pe({},e),n=_a(r),i=this.getMatchKey(n),o=this.dataPlanMatchLookups[i];if(this.blockEvents&&!o)return null;if(this.blockEventAttributes){if(o===true)return r;if(o){for(var s,a=0,u=Object.keys(r.EventAttributes);a<u.length;a++)s=u[a],o[s]||delete r.EventAttributes[s];return r}return r}return r},t.prototype.transformProductAttributes=function(e){function r(u,l){l.forEach(function(c){for(var d,h=0,p=Object.keys(c.Attributes);h<p.length;h++)d=p[h],u[d]||delete c.Attributes[d];});}var n,i=pe({},e),o=_a(i),s=this.getProductAttributeMatchKey(o),a=this.dataPlanMatchLookups[s];if(this.blockEvents&&!a)return null;if(this.blockEventAttributes){if(a===true)return i;if(a){switch(e.EventCategory){case I.CommerceEventType.ProductImpression:i.ProductImpressions.forEach(function(u){r(a,u==null?void 0:u.ProductList);});break;case I.CommerceEventType.ProductPurchase:r(a,(n=i.ProductAction)===null||n===void 0?void 0:n.ProductList);break;default:this.mpInstance.Logger.warning("Product Not Supported ");}return i}return i}return i},t.prototype.transformUserAttributes=function(e){var r=pe({},e);if(this.blockUserAttributes){var n=this.dataPlanMatchLookups.user_attributes;if(this.mpInstance._Helpers.isObject(n))for(var i,o=0,s=Object.keys(r.UserAttributes);o<s.length;o++)i=s[o],n[i]||delete r.UserAttributes[i];}return r},t.prototype.isAttributeKeyBlocked=function(e){if(!this.blockUserAttributes)return  false;var r=this.dataPlanMatchLookups.user_attributes;return !(typeof r=="boolean"&&r)&&wt(r)==="object"&&r[e]!==true},t.prototype.isIdentityBlocked=function(e){if(!this.blockUserIdentities)return  false;if(this.blockUserIdentities){var r=this.dataPlanMatchLookups.user_identities;if(r===true)return  false;if(!r[e])return  true}else return  false;return  false},t.prototype.transformUserIdentities=function(e){var r,n=this,i=pe({},e);if(this.blockUserIdentities){var o=this.dataPlanMatchLookups.user_identities;this.mpInstance._Helpers.isObject(o)&&(!((r=i==null?void 0:i.UserIdentities)===null||r===void 0)&&r.length)&&i.UserIdentities.forEach(function(s,a){var u=I.IdentityType.getIdentityName(n.mpInstance._Helpers.parseNumber(s.Type));o[u]||i.UserIdentities.splice(a,1);});}return i},t})(),E_=function(t,e,r,n){var i=n?"1":"0",o=["env=".concat(i)],s=r||{},a=s.planId,u=s.planVersion;return a&&o.push("plan_id=".concat(a)),u&&o.push("plan_version=".concat(u)),"".concat(t+e+"/config","?").concat(o.join("&"))};function P_(t,e,r){var n=this,i="https://"+r._Store.SDKConfig.configUrl,o=e.isDevelopmentMode,s=e.dataPlan,a=E_(i,t,s,o),u=window.fetch?new Nn(a):new Dn(a);this.getSDKConfiguration=function(){return nr(n,void 0,void 0,function(){var l,c,d,h,p,f,g;return ir(this,function(v){switch(v.label){case 0:c={method:"get",headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"text/plain;charset=UTF-8"},body:null},v.label=1;case 1:return v.trys.push([1,6,,7]),[4,u.upload(c)];case 2:return d=v.sent(),d.status!==200?[3,5]:((p=r==null?void 0:r.Logger)===null||p===void 0||p.verbose("Successfully received configuration from server"),d.json?[4,d.json()]:[3,4]);case 3:return l=v.sent(),[2,l];case 4:return h=d,l=JSON.parse(h.responseText),[2,l];case 5:return (f=r==null?void 0:r.Logger)===null||f===void 0||f.verbose("Issue with receiving configuration from server, received HTTP Code of "+d.statusText),[3,7];case 6:return v.sent(),(g=r==null?void 0:r.Logger)===null||g===void 0||g.error("Error getting forwarder configuration from mParticle servers."),[3,7];case 7:return [2,e]}})})};}var fa=F.HTTPCodes,Po=F.Messages,I_=F.IdentityMethods,A_=I_.Modify;function T_(t){this.sendAliasRequest=function(e,r){return nr(this,void 0,void 0,function(){var n,i,o,s,a,u,l,c,d,h,p,f,T,g,v,m,y,T;return ir(this,function(k){switch(k.label){case 0:n=t.Logger,i=n.verbose,o=n.error,s=t._Helpers.invokeAliasCallback,a=t._Store.SDKConfig.aliasUrl,u=t._Store.devToken,i(Po.InformationMessages.SendAliasHttp),l="https://".concat(a).concat(u,"/Alias"),c=window.fetch?new 
5Nn(l):new Dn(l),d={method:"post",headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"application/json"},body:JSON.stringify(e)},k.label=1;case 1:return k.trys.push([1,13,,14]),[4,c.upload(d)];case 2:return h=k.sent(),p=void 0,f=void 0,T=void 0,g=h.status,g===nd?[3,3]:g===va?[3,3]:g===da?[3,4]:[3,11];case 3:return f="Received Alias Response from server: "+JSON.stringify(h.status),[3,12];case 4:if(!h.json)return [3,9];k.label=5;case 5:return k.trys.push([5,7,,8]),[4,h.json()];case 6:return p=k.sent(),[3,8];case 7:return k.sent(),i("The request has no response body"),[3,8];case 8:return [3,10];case 9:v=h,p=v.responseText?JSON.parse(v.responseText):"",k.label=10;case 10:return m=p,m!=null&&m.message&&(T=m.message),f="Issue with sending Alias Request to mParticle Servers, received HTTP Code of "+h.status,m!=null&&m.code&&(f+=" - "+m.code),[3,12];case 11:throw new Error("Received HTTP Code of "+h.status);case 12:return i(f),s(r,h.status,T),[3,14];case 13:return y=k.sent(),T=y.message||y.toString(),o("Error sending alias request to mParticle servers. "+T),s(r,fa.noHttpCoverage,T),[3,14];case 14:return [2]}})})},this.sendIdentityRequest=function(e,r,n,i,o,s,a){return nr(this,void 0,void 0,function(){var u,l,c,d,h,p,f,g,v,m,y,T,k,N,S,_,S;return ir(this,function(M){switch(M.label){case 0:if(u=t.Logger,l=u.verbose,c=u.error,d=t._Helpers.invokeCallback,l(Po.InformationMessages.SendIdentityBegin),!e)return c(Po.ErrorMessages.APIRequestEmpty),[2];if(l(Po.InformationMessages.SendIdentityHttp),t._Store.identityCallInFlight)return d(n,fa.activeIdentityRequest,"There is currently an Identity request processing. Please wait for this to return before requesting again"),[2];h=s||null,p=this.getUploadUrl(r,s),f=window.fetch?new Nn(p):new Dn(p),g={method:"post",headers:{Accept:"text/plain;charset=UTF-8","Content-Type":"application/json","x-mp-key":t._Store.devToken},body:JSON.stringify(e)},t._Store.identityCallInFlight=true,M.label=1;case 1:return M.trys.push([1,9,,10]),[4,f.upload(g)];case 2:return v=M.sent(),m=void 0,y=void 0,T=v.status,T===nd?[3,3]:T===va?[3,3]:T===da?[3,3]:[3,7];case 3:return v.json?[4,v.json()]:[3,5];case 4:return k=M.sent(),m=this.getIdentityResponseFromFetch(v,k),[3,6];case 5:m=this.getIdentityResponseFromXHR(v),M.label=6;case 6:return m.status===da?(N=m.responseText,y="Issue with sending Identity Request to mParticle Servers, received HTTP Code of "+m.status,N!=null&&N.Errors&&(S=N.Errors.map(function(X){return X.message}).join(", "),y+=" - "+S)):(y="Received Identity Response from server: ",y+=JSON.stringify(m.responseText)),[3,8];case 7:throw new Error("Received HTTP Code of "+v.status);case 8:return t._Store.identityCallInFlight=false,l(y),o(m,h,n,i,r,a,false),[3,10];case 9:return _=M.sent(),t._Store.identityCallInFlight=false,S=_.message||_.toString(),c("Error sending identity request to servers - "+S),d(n,fa.noHttpCoverage,S),[3,10];case 10:return [2]}})})},this.getUploadUrl=function(e,r){var n=t._Helpers.createServiceUrl(t._Store.SDKConfig.identityUrl),i=e===A_?n+r+"/"+e:n+e;return i},this.getIdentityResponseFromFetch=function(e,r){return {status:e.status,responseText:r,cacheMaxAge:parseInt(e.headers.get(dd))||0,expireTimestamp:0}},this.getIdentityResponseFromXHR=function(e){return {status:e.status,responseText:e.responseText?JSON.parse(e.responseText):{},cacheMaxAge:rr(e.getResponseHeader(dd)||""),expireTimestamp:0}};}var k_=function(t,e,r){if(!t||!e)return "";var n=e==null?void 0:e.split("//");if(!n)return "";var i=n[1].split("/"),o=i[0].split("."),s=1;3<=o.length&&(s=2);var a=r||Date.now();return "fb.".concat(s,".").concat(a,".").concat(t)},vt={CUSTOM_FLAGS:"custom_flags",PARTNER_IDENTITIES:"partner_identities",INTEGRATION_ATTRIBUTES:"integration_attributes"},x_={fbclid:{mappedKey:"Facebook.ClickId",processor:k_,output:vt.CUSTOM_FLAGS},_fbp:{mappedKey:"Facebook.BrowserId",output:vt.CUSTOM_FLAGS},_fbc:{mappedKey:"Facebook.ClickId",output:vt.CUSTOM_FLAGS},gclid:{mappedKey:"GoogleEnhancedConversions.Gclid",output:vt.CUSTOM_FLAGS},gbraid:{mappedKey:"GoogleEnhancedConversions.Gbraid",output:vt.CUSTOM_FLAGS},wbraid:{mappedKey:"GoogleEnhancedConversions.Wbraid",output:vt.CUSTOM_FLAGS},ttclid:{mappedKey:"TikTok.Callback",output:vt.CUSTOM_FLAGS},_ttp:{mappedKey:"tiktok_cookie_id",output:vt.PARTNER_IDENTITIES},ScCid:{mappedKey:"SnapchatConversions.ClickId",output:vt.CUSTOM_FLAGS}},bd={rtid:{mappedKey:"passbackconversiontrackingid",output:vt.INTEGRATION_ATTRIBUTES,moduleId:1277},rclid:{mappedKey:"passbackconversiontrackingid",output:vt.INTEGRATION_ATTRIBUTES,moduleId:1277},RoktTransactionId:{mappedKey:"passbackconversiontrackingid",output:vt.INTEGRATION_ATTRIBUTES,moduleId:1277}},O_=(function(){function t(e){this.initialTimestamp=Date.now(),this.captureMode=e,this.filteredPartnerIdentityMappings=this.filterMappings(vt.PARTNER_IDENTITIES),this.filteredCustomFlagMappings=this.filterMappings(vt.CUSTOM_FLAGS),this.filteredIntegrationAttributeMappings=this.filterMappings(vt.INTEGRATION_ATTRIBUTES);}return t.prototype.capture=function(){var e=this.captureQueryParams()||{},r=this.captureCookies()||{},n=this.captureLocalStorage()||{};e.fbclid&&r._fbc&&delete r._fbc;var i=e.rtid||e.rclid,o=n.RoktTransactionId,s=r.RoktTransactionId;i?(o&&delete n.RoktTransactionId,s&&delete r.RoktTransactionId):o&&s&&delete r.RoktTransactionId,this.clickIds=pe(pe(pe(pe({},this.clickIds),e),n),r);},t.prototype.captureCookies=function(){var e=this.getAllowedKeysForMode(),r=Kv(e);return this.applyProcessors(r,_o(),this.initialTimestamp)},t.prototype.captureQueryParams=function(){var e=this.getQueryParams();return this.applyProcessors(e,_o(),this.initialTimestamp)},t.prototype.captureLocalStorage=function(){for(var e=this.getAllowedKeysForMode(),r={},n=0,i=e;n<i.length;n++){var o=i[n],s=localStorage.getItem(o);s&&(r[o]=s);}return this.applyProcessors(r,_o(),this.initialTimestamp)},t.prototype.getQueryParams=function(){var e=this.getAllowedKeysForMode();return Vv(_o(),e)},t.prototype.getClickIdsAsCustomFlags=function(){return this.getClickIds(this.clickIds,this.filteredCustomFlagMappings)},t.prototype.getClickIdsAsPartnerIdentities=function(){return this.getClickIds(this.clickIds,this.filteredPartnerIdentityMappings)},t.prototype.getClickIdsAsIntegrationAttributes=function(){var e,r,n,i={};for(var o in this.clickIds)if(this.clickIds.hasOwnProperty(o)){var s=this.clickIds[o],a=(r=this.filteredIntegrationAttributeMappings[o])===null||r===void 0?void 0:r.mappedKey;if(!_e(a)){var u=(n=this.filteredIntegrationAttributeMappings[o])===null||n===void 0?void 0:n.moduleId;u&&!i[u]&&(i[u]=(e={},e[a]=s,e));}}return i},t.prototype.getClickIds=function(e,r){var n,i={};if(!e)return i;for(var o in e)if(e.hasOwnProperty(o)){var s=e[o],a=(n=r[o])===null||n===void 0?void 0:n.mappedKey;
5_e(a)||(i[a]=s);}return i},t.prototype.applyProcessors=function(e,r,n){var i,o={},s=this.getActiveIntegrationMapping();for(var a in e)if(e.hasOwnProperty(a)){var u=e[a],l=(i=s[a])===null||i===void 0?void 0:i.processor;o[a]=l?l(u,r,n):u;}return o},t.prototype.filterMappings=function(e){var r={},n=this.getActiveIntegrationMapping();for(var i in n)n[i].output===e&&(r[i]=n[i]);return r},t.prototype.getAllowedKeysForMode=function(){return Object.keys(this.getActiveIntegrationMapping())},t.prototype.getActiveIntegrationMapping=function(){return this.captureMode===F.CaptureIntegrationSpecificIdsV2Modes.RoktOnly?bd:this.captureMode===F.CaptureIntegrationSpecificIdsV2Modes.All?pe(pe({},x_),bd):{}},t})(),N_=(function(){function t(){this.kit=null,this.filters={},this.currentUser=null,this.messageQueue=new Map,this.sandbox=null,this.placementAttributesMapping=[];}return t.prototype.init=function(e,r,n,i,o,s){var a=e||{},u=a.userAttributeFilters,l=a.settings,c=(l||{}).placementAttributesMapping;this.identityService=n,this.store=i,this.logger=o,this.filters={userAttributeFilters:u,filterUserAttributes:He.filterUserAttributes,filteredUser:r};try{this.placementAttributesMapping=xv(c);}catch(h){this.logger.error("Error parsing placement attributes mapping from config: "+h);}var d=(s==null?void 0:s.sandbox)||false;this.launcherOptions=pe({sandbox:d},s==null?void 0:s.launcherOptions),s!=null&&s.domain&&(this.domain=s.domain);},t.prototype.attachKit=function(e){this.kit=e,this.processMessageQueue();},t.prototype.selectPlacements=function(e){var r,n;return nr(this,void 0,void 0,function(){var i,o,s,a,u,l,c,d,h,p,f=this;return ir(this,function(g){switch(g.label){case 0:if(!this.isReady())return [2,this.deferredCall("selectPlacements",e)];g.label=1;case 1:if(g.trys.push([1,6,,7]),i=e.attributes,o=(i==null?void 0:i.sandbox)||null,s=this.mapPlacementAttributes(i,this.placementAttributesMapping),this.currentUser=this.identityService.getCurrentUser(),a=((n=(r=this.currentUser)===null||r===void 0?void 0:r.getUserIdentities())===null||n===void 0?void 0:n.userIdentities)||{},u=a.email,l=s.email,!l||u&&u===l)return [3,5];u&&u!==l&&this.logger.warning("Email mismatch detected. Current email, ".concat(u," differs from email passed to selectPlacements call, ").concat(l,". Proceeding to call identify with ").concat(l,". Please verify your implementation.")),g.label=2;case 2:return g.trys.push([2,4,,5]),[4,new Promise(function(v){f.identityService.identify({userIdentities:pe(pe({},a),{email:l})},function(){v();});})];case 3:return g.sent(),[3,5];case 4:return c=g.sent(),this.logger.error("Failed to identify user with new email: "+JSON.stringify(c)),[3,5];case 5:return this.setUserAttributes(s),d=pe(pe({},s),o===null?{}:{sandbox:o}),h=pe(pe({},e),{attributes:d}),[2,this.kit.selectPlacements(h)];case 6:return p=g.sent(),[2,Promise.reject(p instanceof Error?p:new Error("Unknown error occurred"))];case 7:return [2]}})})},t.prototype.hashAttributes=function(e){if(!this.isReady())return this.deferredCall("hashAttributes",e);try{return this.kit.hashAttributes(e)}catch(r){return Promise.reject(r instanceof Error?r:new Error("Unknown error occurred"))}},t.prototype.setExtensionData=function(e){if(!this.isReady())return void this.deferredCall("setExtensionData",e);try{this.kit.setExtensionData(e);}catch(n){var r=n instanceof Error?n.message:n+"";throw new Error("Error setting extension data: "+r)}},t.prototype.use=function(e){if(!this.isReady())return this.deferredCall("use",e);try{return this.kit.use(e)}catch(r){return Promise.reject(r instanceof Error?r:new Error("Error using extension: "+e))}},t.prototype.getLocalSessionAttributes=function(){return this.store.getLocalSessionAttributes()},t.prototype.setLocalSessionAttribute=function(e,r){this.store.setLocalSessionAttribute(e,r);},t.prototype.isReady=function(){return !!(this.kit&&this.kit.launcher)},t.prototype.setUserAttributes=function(e){var r=["sandbox"],n={};for(var i in e)e.hasOwnProperty(i)&&r.indexOf(i)===-1&&(n[i]=e[i]);try{this.currentUser.setUserAttributes(n);}catch(o){this.logger.error("Error setting user attributes: "+o);}},t.prototype.mapPlacementAttributes=function(e,r){for(var n,i={},o=0,s=r;o<s.length;o++)n=s[o],i[n.map]=n.value;var a={};for(var u in e)if(e.hasOwnProperty(u)){var l=i[u]||u;a[l]=e[u];}return a},t.prototype.processMessageQueue=function(){var e,r=this;this.isReady()&&this.messageQueue.size!==0&&((e=this.logger)===null||e===void 0||e.verbose("RoktManager: Processing ".concat(this.messageQueue.size," queued messages")),this.messageQueue.forEach(function(n){var i,o,s;if(!(n.methodName in r)||!fi(r[n.methodName]))return void((i=r.logger)===null||i===void 0?void 0:i.error("RoktManager: Method ".concat(n.methodName," not found")));(o=r.logger)===null||o===void 0||o.verbose("RoktManager: Processing queued message: ".concat(n.methodName," with payload: ").concat(JSON.stringify(n.payload)));try{var a=r[n.methodName](n.payload);r.completePendingPromise(n.messageId,a);}catch(l){var u=l instanceof Error?l.message:l+"";(s=r.logger)===null||s===void 0||s.error("RoktManager: Error processing message '".concat(n.methodName,"': ").concat(u)),r.completePendingPromise(n.messageId,Promise.reject(l));}}),this.messageQueue.clear());},t.prototype.queueMessage=function(e){this.messageQueue.set(e.messageId,e);},t.prototype.deferredCall=function(e,r){var n=this;return new Promise(function(i,o){var s="".concat(e,"_").concat(Sa());n.queueMessage({messageId:s,methodName:e,payload:r,resolve:i,reject:o});})},t.prototype.completePendingPromise=function(e,r){if(e&&this.messageQueue.has(e)){var n=this.messageQueue.get(e);n.resolve&&Promise.resolve(r).then(function(i){return n.resolve(i)}).catch(function(i){return n.reject(i)}),this.messageQueue.delete(e);}},t})(),jr=F.Messages,D_=F.HTTPCodes,Oa=F.FeatureFlags,ma=F.CaptureIntegrationSpecificIdsV2Modes,M_=Oa.ReportBatching,U_=Oa.CaptureIntegrationSpecificIds,L_=Oa.CaptureIntegrationSpecificIdsV2,R_=jr.InformationMessages.StartingInitialization;function _d(t){var e=this;this._instanceName=t,this._NativeSdkHelpers=new Tb(this),this._SessionManager=new Gb(this),this._Persistence=new t_(this),this._Helpers=new Ab(this),this._Events=new r_(this),this._CookieSyncManager=new Nb(this),this._ServerModel=new kd(this),this._Ecommerce=new Wb(this),this._ForwardingStatsUploader=new f_(this),this._Consent=new S_(this),this._IdentityAPIClient=new T_(this),this._preInit={ready
5Queue:[],integrationDelays:{},forwarderConstructors:[]},this._RoktManager=new N_,this.IdentityType=te,this.EventType=nt,this.CommerceEventType=ft,this.PromotionType=sn,this.ProductActionType=Me,this._Identity=new y_(this),this.Identity=this._Identity.IdentityAPI,this.generateHash=this._Helpers.generateHash,this.getDeviceId=this._Persistence.getDeviceId,typeof window!="undefined"&&window.mParticle&&window.mParticle.config&&window.mParticle.config.hasOwnProperty("rq")&&(this._preInit.readyQueue=window.mParticle.config.rq),this.init=function(r,n){var i=this;if(n||console.warn("You did not pass a config object to init(). mParticle will not initialize properly"),B_(this,r,n),!n)return void console.error("No config available on the window, please pass a config object to mParticle.init()");if(!n.hasOwnProperty("requestConfig")||n.requestConfig){var o=new P_(r,n,this);o.getSDKConfiguration().then(function(s){var a=i._Helpers.extend({},n,s);yd(r,a,i);});}else yd(r,n,this);},this.setLogLevel=function(r){e.Logger.setLogLevel(r);},this.reset=function(r){try{r._Persistence.resetPersistence(),r._Store&&delete r._Store;}catch(n){console.error("Cannot reset mParticle",n);}},this._resetForTests=function(r,n,i){i._Store&&delete i._Store,i._Store=new Td(r,i),i._Store.isLocalStorageAvailable=i._Persistence.determineLocalStorageAvailability(window.localStorage),i._Events.stopTracking(),n||i._Persistence.resetPersistence(),i._Persistence.forwardingStatsBatches.uploadsTable={},i._Persistence.forwardingStatsBatches.forwardingStatsEventQueue=[],i._preInit={readyQueue:[],pixelConfigurations:[],integrationDelays:{},forwarderConstructors:[],isDevelopmentMode:false};},this.ready=function(r){e.isInitialized()&&typeof r=="function"?r():e._preInit.readyQueue.push(r);},this.getEnvironment=function(){return e._Store.SDKConfig.isDevelopmentMode?F.Environment.Development:F.Environment.Production},this.getVersion=function(){return F.sdkVersion},this.setAppVersion=function(r){var n=gt(function(){e.setAppVersion(r);},e);n||(e._Store.SDKConfig.appVersion=r,e._Persistence.update());},this.setDeviceId=function(r){var n=gt(function(){e.setDeviceId(r);},e);n||this._Store.setDeviceId(r);},this.isInitialized=function(){return !!e._Store&&e._Store.isInitialized},this.getAppName=function(){return e._Store.SDKConfig.appName},this.setAppName=function(r){var n=gt(function(){e.setAppName(r);},e);n||(e._Store.SDKConfig.appName=r);},this.getAppVersion=function(){return e._Store.SDKConfig.appVersion},this.stopTrackingLocation=function(){e._SessionManager.resetSessionTimer(),e._Events.stopTracking();}
5,this.startTrackingLocation=function(r){fi(r)||e.Logger.warning("Warning: Location tracking is triggered, but not including a callback into the `startTrackingLocation` may result in events logged too quickly and not being associated with a location."),e._SessionManager.resetSessionTimer(),e._Events.startTracking(r);},this.setPosition=function(r,n){var i=gt(function(){e.setPosition(r,n);},e);i||(e._SessionManager.resetSessionTimer(),typeof r=="number"&&typeof n=="number"?e._Store.currentPosition={lat:r,lng:n}:e.Logger.error("Position latitude and/or longitude must both be of type number"));},this.startNewSession=function(){e._SessionManager.startNewSession();},this.endSession=function(){e._SessionManager.endSession(true);},this.logBaseEvent=function(r,n){var i=gt(function(){e.logBaseEvent(r,n);},e);if(!i)return e._SessionManager.resetSessionTimer(),typeof r.name!="string"?void e.Logger.error(jr.ErrorMessages.EventNameInvalidType):(r.eventType||(r.eventType=nt.Unknown),e._Helpers.canLog()?void e._Events.logEvent(r,n):void e.Logger.error(jr.ErrorMessages.LoggingDisabled))},this.logEvent=function(r,n,i,o,s){var a=gt(function(){e.logEvent(r,n,i,o,s);},e);if(!a)return e._SessionManager.resetSessionTimer(),typeof r!="string"?void e.Logger.error(jr.ErrorMessages.EventNameInvalidType):(n||(n=nt.Unknown),e._Helpers.isEventType(n)?e._Helpers.canLog()?void e._Events.logEvent({messageType:an.PageEvent,name:r,data:i,eventType:n,customFlags:o},s):void e.Logger.error(jr.ErrorMessages.LoggingDisabled):void e.Logger.error("Invalid event type: "+n+`, must be one of: 
6`+JSON.stringify(nt)))},this.logError=function(r,n){var i=gt(function(){e.logError(r,n);},e);if(!i&&(e._SessionManager.resetSessionTimer(),!!r)){typeof r=="string"&&(r={message:r});var o={m:r.message?r.message:r,s:"Error",t:r.stack||null};if(n){var s=e._Helpers.sanitizeAttributes(n,o.m);for(var a in s)o[a]=s[a];}e._Events.logEvent({messageType:an.CrashReport,name:r.name?r.name:"Error",eventType:nt.Other,data:o});}},this.logLink=function(r,n,i,o){e._Events.addEventHandler("click",r,n,o,i);},this.logForm=function(r,n,i,o){e._Events.addEventHandler("submit",r,n,o,i);},this.logPageView=function(r,n,i,o){var s=gt(function(){e.logPageView(r,n,i,o);},e);if(!s){if(e._SessionManager.resetSessionTimer(),e._Helpers.canLog()){if(e._Helpers.Validators.isStringOrNumber(r)||(r="PageView"),!n)n={hostname:window.location.hostname,title:window.document.title};else if(!e._Helpers.isObject(n))return void e.Logger.error("The attributes argument must be an object. A "+wt(n)+" was entered. Please correct and retry.");if(i&&!e._Helpers.isObject(i))return void e.Logger.error("The customFlags argument must be an object. A "+wt(i)+" was entered. Please correct and retry.")}e._Events.logEvent({messageType:an.PageView,name:r,data:n,eventType:nt.Unknown,customFlags:i},o);}},this.upload=function(){var r,n;e._Helpers.canLog()&&(e._Store.webviewBridgeEnabled?e._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.Upload):(n=(r=e._APIClient)===null||r===void 0?void 0:r.uploader)===null||n===void 0||n.prepareAndUpload(false,false));},this.Consent={createCCPAConsent:e._Consent.createPrivacyConsent,createGDPRConsent:e._Consent.createPrivacyConsent,createConsentState:e._Consent.createConsentState},this.eCommerce={Cart:{add:function(n,i){e.Logger.warning("Deprecated function eCommerce.Cart.add() will be removed in future releases");var o,s=e.Identity.getCurrentUser();s&&(o=s.getMPID()),e._Identity.mParticleUserCart(o).add(n,i);},remove:function(n,i){e.Logger.warning("Deprecated function eCommerce.Cart.remove() will be removed in future releases");var o,s=e.Identity.getCurrentUser();s&&(o=s.getMPID()),e._Identity.mParticleUserCart(o).remove(n,i);},clear:function(){e.Logger.warning("Deprecated function eCommerce.Cart.clear() will be removed in future releases");var n,i=e.Identity.getCurrentUser();i&&(n=i.getMPID()),e._Identity.mParticleUserCart(n).clear();}},setCurrencyCode:function(n){var i=gt(function(){e.eCommerce.setCurrencyCode(n);},e);return i?void 0:typeof n=="string"?(e._SessionManager.resetSessionTimer(),void(e._Store.currencyCode=n)):void e.Logger.error("Code must be a string")},createProduct:function(n,i,o,s,a,u,l,c,d,h){return e._Ecommerce.createProduct(n,i,o,s,a,u,l,c,d,h)},createPromotion:function(n,i,o,s){return e._Ecommerce.createPromotion(n,i,o,s)},createImpression:function(n,i){return e._Ecommerce.createImpression(n,i)},createTransactionAttributes:function(n,i,o,s,a,u){return e._Ecommerce.createTransactionAttributes(n,i,o,s,a,u)}
6,logCheckout:function(n,i,o,s){return e.Logger.warning("mParticle.logCheckout is deprecated, please use mParticle.logProductAction instead"),e._Store.isInitialized?(e._SessionManager.resetSessionTimer(),void e._Events.logCheckoutEvent(n,i,o,s)):void e.ready(function(){e.eCommerce.logCheckout(n,i,o,s);})},logProductAction:function(n,i,o,s,a,u){var l=gt(function(){e.eCommerce.logProductAction(n,i,o,s,a,u);},e);l||(e._SessionManager.resetSessionTimer(),e._Events.logProductActionEvent(n,i,o,s,a,u));},logPurchase:function(n,i,o,s,a){return e.Logger.warning("mParticle.logPurchase is deprecated, please use mParticle.logProductAction instead"),e._Store.isInitialized?n&&i?(e._SessionManager.resetSessionTimer(),void e._Events.logPurchaseEvent(n,i,s,a)):void e.Logger.error(jr.ErrorMessages.BadLogPurchase):void e.ready(function(){e.eCommerce.logPurchase(n,i,o,s,a);})},logPromotion:function(n,i,o,s,a){var u=gt(function(){e.eCommerce.logPromotion(n,i,o,s,a);},e);u||(e._SessionManager.resetSessionTimer(),e._Events.logPromotionEvent(n,i,o,s,a));},logImpression:function(n,i,o,s){var a=gt(function(){e.eCommerce.logImpression(n,i,o,s);},e);a||(e._SessionManager.resetSessionTimer(),e._Events.logImpressionEvent(n,i,o,s));},logRefund:function(n,i,o,s,a){return e.Logger.warning("mParticle.logRefund is deprecated, please use mParticle.logProductAction instead"),e._Store.isInitialized?(e._SessionManager.resetSessionTimer(),void e._Events.logRefundEvent(n,i,s,a)):void e.ready(function(){e.eCommerce.logRefund(n,i,o,s,a);})},expandCommerceEvent:function(n){return e._Ecommerce.expandCommerceEvent(n)}},this.setSessionAttribute=function(r,n){var i=gt(function(){e.setSessionAttribute(r,n);},e);if(!i&&e._Helpers.canLog()){if(!e._Helpers.Validators.isValidAttributeValue(n))return void e.Logger.error(jr.ErrorMessages.BadAttribute);if(!e._Helpers.Validators.isValidKeyValue(r))return void e.Logger.error(jr.ErrorMessages.BadKey);if(e._Store.webviewBridgeEnabled)e._NativeSdkHelpers.sendToNative(F.NativeSdkPaths.SetSessionAttribute,JSON.stringify({key:r,value:n}));else {var o=e._Helpers.findKeyInObject(e._Store.sessionAttributes,r);o&&(r=o),e._Store.sessionAttributes[r]=n,e._Persistence.update(),e._Forwarders.applyToForwarders("setSessionAttribute",[r,n]);}}},this.setOptOut=function(r){var n=gt(function(){e.setOptOut(r);},e);n||(e._SessionManager.resetSessionTimer(),e._Store.isEnabled=!r,e._Events.logOptOut(),e._Persistence.update(),e._Store.activeForwarders.length&&e._Store.activeForwarders.forEach(function(i){if(i.setOptOut){var o=i.setOptOut(r);o&&e.Logger.verbose(o);}}));},this.setIntegrationAttribute=function(r,n){var i=gt(function(){e.setIntegrationAttribute(r,n);},e);if(!i){if(typeof r!="number")return void e.Logger.error("integrationId must be a number");if(n===null)e._Store.integrationAttributes[r]={};else {if(!e._Helpers.isObject(n))return void e.Logger.error("Attrs must be an object with keys and values. You entered a "+wt(n));if(Object.keys(n).length===0)e._Store.integrationAttributes[r]={};else for(var o in n)if(typeof o!="string"){e.Logger.error("Keys must be strings, you entered a "+wt(o));continue}else if(typeof n[o]=="string")e._Helpers.isObject(e._Store.integrationAttributes[r])||(e._Store.integrationAttributes[r]={}),e._Store.integrationAttributes[r][o]=n[o];else {e.Logger.error("Values for integration attributes must be strings. You entered a "+wt(n[o]));continue}}e._Persistence.update();}},this.getIntegrationAttributes=function(r){return e._Store.integrationAttributes[r]?e._Store.integrationAttributes[r]:{}},this.addForwarder=function(r){e._preInit.forwarderConstructors.push(r);},this.configurePixel=function(r){e._Forwarders.configurePixel(r);},this._getActiveForwarders=function(){return e._Store.activeForwarders},this._getIntegrationDelays=function(){return e._preInit.integrationDelays},this._setIntegrationDelay=function(r,n){if(e._preInit.integrationDelays[r]=n,n!==true){var i=Object.keys(e._preInit.integrationDelays);if(i.length!==0){var o=i.some(function(s){return e._preInit.integrationDelays[s]===true});o||e._APIClient.processQueuedEvents();}}},this._setWrapperSDKInfo=function(r,n){var i=gt(function(){e._setWrapperSDKInfo(r,n);},e);i||(e._Store.wrapperSDKInfo===void 0||!e._Store.wrapperSDKInfo.isInfoSet)&&(e._Store.wrapperSDKInfo={name:r,version:n,isInfoSet:true});};}function yd(t,e,r){var n=F_(e,r),i=r._Helpers.getFeatureFlag;if(r._APIClient=new Id(r,n),r._Forwarders=new d_(r,n),r._Store.processConfig(e),r._Identity.idCache=$_(r),Hb(r._Identity.idCache),r._Store.webviewBridgeEnabled)r._NativeSdkHelpers.initializeSessionAttributes(t);else {r._Persistence.initializeStorage(),r._Store.syncPersistenceData();var o=r.Identity.getCurrentUser(),s=o?o.getMPID():null,a=o?o.getUserIdentities().userIdentities:{};r._Store.SDKConfig.identifyRequest=r._Store.hasInvalidIdentifyRequest()?{userIdentities:a}:r._Store.SDKConfig.identifyRequest,i(M_)&&r._ForwardingStatsUploader.startForwardingStatsTimer();var u=i(U_),l=i(L_),c=l&&l!==ma.None||u===true;if(c){var d;u||l===ma.All?d="all":l===ma.RoktOnly&&(d="roktonly"),r._IntegrationCapture=new O_(d),r._IntegrationCapture.capture();}var h=Gv(e,"Rokt",181);if(h){var p=h.userAttributeFilters,f=ya(s,{userAttributeFilters:p},r),g={sandbox:e==null?void 0:e.isDevelopmentMode,launcherOptions:e==null?void 0:e.launcherOptions,domain:e==null?void 0:e.domain};r._RoktManager.init(h,f,r.Identity,r._Store,r.Logger,g);}r._Forwarders.processForwarders(e,r._APIClient.prepareForwardingStats),r._Forwarders.processPixelConfigs(e),r._SessionManager.initialize(),r._Events.logAST(),z_(r,o,s,a);}(r._Store.mpid&&!r._Store.identifyCalled||r._Store.webviewBridgeEnabled)&&(r._Store.isInitialized=true,r._preInit.ready
6Queue=xd(r._preInit.readyQueue)),r._Store.isFirstRun&&(r._Store.isFirstRun=false);}function F_(t,e){var r,n,i,o;return t.dataPlanOptions&&(e.Logger.verbose("Customer provided data plan found"),o=t.dataPlanOptions,n={document:{dtpn:{vers:o.dataPlanVersion,blok:{ev:o.blockEvents,ea:o.blockEventAttributes,ua:o.blockUserAttributes,id:o.blockUserIdentities}}}}),n||(t.dataPlan&&t.dataPlan.document?t.dataPlan.document.error_message?i=t.dataPlan.document.error_message:(e.Logger.verbose("Data plan found from mParticle.js"),n=t.dataPlan):t.dataPlanResult&&(t.dataPlanResult.error_message?i=t.dataPlanResult.error_message:(e.Logger.verbose("Data plan found from /config"),n={document:t.dataPlanResult}))),i&&e.Logger.error(i),n&&(r=new C_(n,e)),r}function $_(t){var e="".concat(t._Store.storageName,"-id-cache");return t._Store.getPrivacyFlag("IdentityCache")?new Sb(e,{logger:t.Logger}):new Ia(e,{logger:t.Logger})}function B_(t,e,r){t.Logger=new Zb(r),t._Store=new Td(r,t,e),window.mParticle.Store=t._Store,t.Logger.verbose(R_);try{t._Store.isLocalStorageAvailable=t._Persistence.determineLocalStorageAvailability(window.localStorage);}catch(n){t.Logger.warning("localStorage is not available, using cookies if available"),t._Store.isLocalStorageAvailable=false;}}function z_(t,e,r,n){!t._Store.identifyCalled&&t._Store.SDKConfig.identityCallback&&e&&r&&t._Store.SDKConfig.identityCallback({httpCode:D_.activeSession,getUser:function(){return t._Identity.mParticleUser(r)},getPreviousUser:function(){var o=t.Identity.getUsers(),s=o.shift(),a=s.getMPID();return s&&a===r&&(s=o.shift()),s||null},body:{mpid:r,is_logged_in:t._Store.isLoggedIn,matched_identities:n,context:null,is_ephemeral:false}});}function gt(t,e){return !e.isInitialized()&&(e.ready(function(){t();}),true)}var Ae=function(){return null},j_=(function(){function t(){}return t.prototype.getMPInstance=function(){return {_Helpers:{sanitizeAttributes:window.mParticle.getInstance()._Helpers.sanitizeAttributes,generateHash:function(){return "mockHash"},generateUniqueId:function(){return "mockId"},extend:window.mParticle.getInstance()._Helpers.extend,createServiceUrl:Ae,parseNumber:Ae,isObject:Ae,Validators:null},_resetForTests:Ae,_APIClient:null,_timeOnSiteTimer:{getTimeInForeground:Ae},MPSideloadedKit:null,_Consent:null,_Events:null,_Forwarders:null,_NativeSdkHelpers:null,_Persistence:null,_preInit:null,Consent:null,_ServerModel:null,_SessionManager:null,_Store:{sessionId:"mockSessionId",sideloadedKits:[],devToken:"test_dev_token",isFirstRun:true,isEnabled:true,sessionAttributes:{},currentSessionMPIDs:[],consentState:null,clientId:null,deviceId:null,serverSettings:{},dateLastEventSent:null,sessionStartDate:null,currentPosition:null,isTracking:false,watchPositionId:null,cartProducts:[],eventQueue:[],currencyCode:null,globalTimer:null,context:null,configurationLoaded:false,identityCallInFlight:false,nonCurrentUserMPIDs:{},identifyCalled:false,isLoggedIn:false,cookieSyncDates:{},integrationAttributes:{},requireDelay:true,isLocalStorageAvailable:null,integrationDelayTimeoutStart:null,storageName:null,prodStorageName:null,activeForwarders:[],kits:{},configuredForwarders:[],pixelConfigurations:[],wrapperSDKInfo:{name:"none",version:null,isInfoSet:false},SDKConfig:{isDevelopmentMode:false,onCreateBatch:Ae}},config:null,eCommerce:null,Identity:{getCurrentUser:Ae,IdentityAPI:{},identify:Ae,login:Ae,logout:Ae,modify:Ae},Logger:{verbose:Ae,error:Ae,warning:Ae},ProductActionType:null,ServerModel:null,addForwarder:Ae,generateHash:Ae,getAppVersion:Ae,getAppName:Ae,getInstance:Ae,getDeviceId:Ae,init:Ae,logBaseEvent:Ae,logEvent:Ae,logLevel:"none",setPosition:Ae,upload:Ae}},t.prototype.createSDKEventFunction=function(e){return new kd(this.getMPInstance()).createEventObject(e)},t.prototype.returnBatch=function(e){var r=this,n=this.getMPInstance(),i=Array.isArray(e)?e.map(function(s){return r.createSDKEventFunction(s)}):[this.createSDKEventFunction(e)],o=Ed("0",i,n);return o},t})(),H_=(function(){function t(e){this.filterDictionary={eventTypeFilters:[],eventNameFilters:[],screenNameFilters:[],screenAttributeFilters:[],userIdentityFilters:[],userAttributeFilters:[],attributeFilters:[],consentRegulationFilters:[],consentRegulationPurposeFilters:[],messageTypeFilters:[],messageTypeStateFilters:[],filteringEventAttributeValue:{},filteringUserAttributeValue:{},filteringConsentRuleValues:{}},this.kitInstance=e;}return t.prototype.addEventTypeFilter=function(e){var r=He.hashEventType(e);this.filterDictionary.eventTypeFilters.push(r);},t.prototype.addEventNameFilter=function(e,r){var n=He.hashEventName(r,e);this.filterDictionary.eventNameFilters.push(n);},t.prototype.addEventAttributeFilter=function(e,r,n){var i=He.hashEventAttributeKey(e,r,n);this.filterDictionary.attributeFilters.push(i);},t.prototype.addScreenNameFilter=function(e){var r=He.hashEventName(e,nt.Unknown);this.filterDictionary.screenNameFilters.push(r);},t.prototype.addScreenAttributeFilter=function(e,r){var n=He.hashEventAttributeKey(nt.Unknown,e,r);this.filterDictionary.screenAttributeFilters.push(n);},t.prototype.addUserIdentityFilter=function(e){var r=He.hashUserIdentity(e);this.filterDictionary.userIdentityFilters.push(r);},t.prototype.addUserAttributeFilter=function(e){var r=He.hashUserAttribute(e);this.filterDictionary.userAttributeFilters.push(r);},t})();Array.prototype.forEach||(Array.prototype.forEach=pi.forEach),Array.prototype.map||(Array.prototype.map=pi.map),Array.prototype.filter||(Array.prototype.filter=pi.filter),Array.isArray||(Array.prototype.isArray=pi.isArray);function V_(){var t=this;this.Store={},this._instances={},this.IdentityType=te,this.EventType=nt,this.CommerceEventType=ft,this.PromotionType=sn,this.ProductActionType=Me,this.MPSideloadedKit=H_,typeof window!="undefined"&&(this.isIOS=!!(window.mParticle&&window.mParticle.isIOS)&&window.mParticle.isIOS,this.config=window.mParticle&&window.mParticle.config?window.mParticle.config:{}),this.init=function(e,r,n){!r&&window.mParticle&&window.mParticle.config&&(console.warn("You did not pass a config object to mParticle.init(). Attempting to use the window.mParticle.config if it exists. Please note that in a future release, this may not work and mParticle will not initialize properly"),r=window.mParticle?window.mParticle.config:{}),n=(n&&n.length!==0?n:F.DefaultInstance).toLowerCase();var i=t._instances[n];i===void 0&&(i=new _d(n),t._instances[n]=i),i.init(e,r,n);},this.getInstance=function(e){var r;return e?(r=t._instances[e.toLowerCase()],r||(console.log("You tried to initialize an instance named "+e+". This instance does not exist. Check your instance name or initialize a new instance with this name before calling it."),null)):(e=F.DefaultInstance,r=t._instances[e],r||(r=new _d(e),t._instances[F.DefaultInstance]=r),r)},this.Rokt=t.getInstance()._RoktManager,this.getDeviceId=function(){return t.getInstance().getDeviceId()},this.setDeviceId=function(e){return t.getInstance().setDeviceId(e)},this.isInitialized=function(){return t.getInstance().isInitialized()},this.startNewSession=function(){t.getInstance().startNewSession();},this.endSession=function(){t.getInstance().endSession();},this.setLogLevel=function(e){t.getInstance().setLogLevel(e);},this.ready=function(e){t.getInstance().ready(e);},this.setAppVersion=function(e){t.getInstance().setAppVersion(e);},this.getAppName=function(){return t.getInstance().getAppName()},this.setAppName=function(e){t.getInstance().setAppName(e);},this.getAppVersion=function(){return t.getInstance().getAppVersion()},this.getEnvironment=function(){return t.getInstance().getEnvironment()},this.stopTrackingLocation=function(){t.getInstance().stopTrackingLocation();},this.startTrackingLocation=function(e){t.getInstance().startTrackingLocation(e);},this.setPosition=function(e,r){t.getInstance().setPosition(e,r);},this.startNewSession=function(){t.getInstance().startNewSession();},this.endSession=function(){t.getInstance().endSession();},this.logBaseEvent=function(e,r){t.getInstance().logBaseEvent(e,r);},this.logEvent=function(e,r,n,i,o){t.getInstance().logEvent(e,r,n,i,o);},this.logError=function(e,r){t.getInstance().logError(e,r);},this.logLink=function(e,r,n,i){t.getInstance().logLink(e,r,n,i);},this.logForm=function(e,r,n,i){t.getInstance().logForm(e,r,n,i);},this.logPageView=function(e,r,n,i){t.getInstance().logPageView(e,r,n,i);},this.upload=function(){t.getInstance().upload();},this.eCommerce={Cart:{add:function(r,n){t.getInstance().eCommerce.Cart.add(r,n);},remove:function(r,n){t.getInstance().eCommerce.Cart.remove(r,n);},clear:function(){t.getInstance().eCommerce.Cart.clear();}},setCurrencyCode:function(r){t.getInstance().eCommerce.setCurrencyCode(r);},createProduct:function(r,n,i,o,s,a,u,l,c,d){return t.getInstance().eCommerce.createProduct(r,n,i,o,s,a,u,l,c,d)},createPromotion:function(r,n,i,o){return t.getInstance().eCommerce.createPromotion(r,n,i,o)},createImpression:function(r,n){return t.getInstance().eCommerce.createImpression(r,n)},createTransactionAttributes:function(r,n,i,o,s,a){return t.getInstance().eCommerce.createTransactionAttributes(r,n,i,o,s,a)},logCheckout:function(r,n,i,o){t.getInstance().eCommerce.logCheckout(r,n,i,o);},logProductAction:function(r,n,i,o,s,a){t.getInstance().eCommerce.logProductAction(r,n,i,o,s,a);},logPurchase:function(r,n,i,o,s){t.getInstance().eCommerce.logPurchase(r,n,i,o,s);},logPromotion:function(r,n,i,o,s){t.getInstance().eCommerce.logPromotion(r,n,i,o,s);},logImpression:function(r,n,i,o){t.getInstance().eCommerce.logImpression(r,n,i,o);},logRefund:function(r,n,i,o,s){t.getInstance().eCommerce.logRefund(r,n,i,o,s);},expandCommerceEvent:function(r){return t.getInstance().eCommerce.expandCommerceEvent(r)}},this.setSessionAttribute=function(e,r){t.getInstance().setSessionAttribute(e,r);},this.setOptOut=function(e){t.getInstance().setOptOut(e);},this.setIntegrationAttribute=function(e,r){t.getInstance().setIntegrationAttribute(e,r);},this.getIntegrationAttributes=function(e){return t.getInstance().getIntegrationAttributes(e)},this.Identity={HTTPCodes:F.HTTPCodes,aliasUsers:function(r,n){t.getInstance().Identity.aliasUsers(r,n);},createAliasRequest:function(r,n){return t.getInstance().Identity.createAliasRequest(r,
6n)},getCurrentUser:function(){return t.getInstance().Identity.getCurrentUser()},getUser:function(r){return t.getInstance().Identity.getUser(r)},getUsers:function(){return t.getInstance().Identity.getUsers()},identify:function(r,n){t.getInstance().Identity.identify(r,n);},login:function(r,n){t.getInstance().Identity.login(r,n);},logout:function(r,n){t.getInstance().Identity.logout(r,n);},modify:function(r,n){t.getInstance().Identity.modify(r,n);}},this.sessionManager={getSession:function(){return t.getInstance()._SessionManager.getSession()}},this.Consent={createConsentState:function(){return t.getInstance().Consent.createConsentState()},createGDPRConsent:function(r,n,i,o,s){return t.getInstance().Consent.createGDPRConsent(r,n,i,o,s)},createCCPAConsent:function(r,n,i,o,s){return t.getInstance().Consent.createGDPRConsent(r,n,i,o,s)}},this.reset=function(){t.getInstance().reset(t.getInstance());},this._resetForTests=function(e,r){typeof r=="boolean"?t.getInstance()._resetForTests(e,r,t.getInstance()):t.getInstance()._resetForTests(e,false,t.getInstance());},this.configurePixel=function(e){t.getInstance().configurePixel(e);},this._setIntegrationDelay=function(e,r){t.getInstance()._setIntegrationDelay(e,r);},this._getIntegrationDelays=function(){return t.getInstance()._getIntegrationDelays()},this.getVersion=function(){return t.getInstance().getVersion()},this.generateHash=function(e){return t.getInstance().generateHash(e)},this.addForwarder=function(e){t.getInstance().addForwarder(e);},this._getActiveForwarders=function(){return t.getInstance()._getActiveForwarders()},this._setWrapperSDKInfo=function(e,r){t.getInstance()._setWrapperSDKInfo(e,r);};}var Na=new V_;typeof window!="undefined"&&(window.mParticle=Na,window.mParticle._BatchValidator=new j_);function xo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)n!=="__proto__"&&(t[n]=r[n]);}return t}var q_={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Da(t,e){function r(i,o,s){if(typeof document!="undefined"){s=xo({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var u in s)s[u]&&(a+="; "+u,s[u]!==true&&(a+="="+s[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+a}}function n(i){if(!(typeof document=="undefined"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},a=0;a<o.length;a++){var u=o[a].split("="),l=u.slice(1).join("=");try{var c=decodeURIComponent(u[0]);if(c in s||(s[c]=t.read(l,c)),i===c)break}catch(d){}}return i?s[i]:s}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",xo({},o,{expires:-1}));},withAttributes:function(i){return Da(this.converter,xo({},this.attributes,i))},withConverter:function(i){return Da(xo({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Te=Da(q_,{path:"/"});var Nd="userIdentities",Oo="currency",No="geolocation",Do="mParticleDeviceId",Dd="selectedProduct",ln="ttclid",Ma="_ttp",Md="_fbp",Ud="_fbc",L
6d="rdt_cid",Rd="_rdt_uuid",Fd="stable-id",$d="posthog-distinct-id";var Mo=new Set(["utm_id","utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_source_platform","utm_creative_format","utm_marketing_tactic","gad_source","gclid","gbraid","wbraid","msclkid","fbclid","ttclid"]);var Ua=(u=>(u.Navigation="navigation",u.Location="location",u.Search="search",u.Transaction="transaction",u.UserContent="user_content",u.UserPreference="user_preference",u.Social="social",u.Other="other",u))(Ua||{}),Uo={navigation:1,location:2,search:3,transaction:4,user_content:5,user_preference:6,social:7,other:8},Be={LOGIN_ATTEMPT:{name:"login_attempt",kind:"navigation"},OTP_ATTEMPT:{name:"otp_attempt",kind:"navigation"},SMS_OPT_OUT:{name:"sms_opt_out_web",kind:"user_preference"},LINK_CLICKED:{name:"link_clicked",kind:"navigation"},LANDING_PAGE_SUBMIT:{name:"landing_page_submit",kind:"transaction"},PRODUCT_SELECTED:{name:"product_selected",kind:"transaction"},SUBSCRIPTION_OPTION_VIEWED:{name:"subscription_option_viewed",kind:"transaction"},SUBSCRIPTION_OPTION_SELECTED:{name:"subscription_option_selected",kind:"transaction"},PURCHASE_ATTEMPT:{name:"purchase_attempt",kind:"transaction"},PURCHASE_FAILED:{name:"purchase_failed",kind:"transaction"},PURCHASE_SUCCEEDED:{name:"purchase_succeeded",kind:"transaction"},ADD_PAYMENT_METHOD_ATTEMPT:{name:"add_payment_method_attempt",kind:"transaction"},ADD_PAYMENT_METHOD_SUCCEEDED:{name:"add_payment_method_succeeded",kind:"transaction"},ADD_PAYMENT_METHOD_FAILED:{name:"add_payment_method_failed",kind:"transaction"}};var Bd=()=>{if(typeof navigator=="undefined")return {userAgent:"unknown",platform:"unknown"};let t=navigator;if(t.userAgentData){let{brands:e,platform:r}=t.userAgentData;return {brands:e,platform:r}}return {userAgent:navigator.userAgent,platform:navigator.platform}},La="client_id",zd="ga_session_id",Lo=()=>new Promise((t,e)=>{var r;try{let n=(r=dt())==null?void 0:r.gtmMeasurementId;typeof window.gtag=="function"?window.gtag("get",n,"session_id",t):t(null);}catch(n){e(n);}}),jd=()=>new Promise((t,e)=>{var r;try{let n=(r=dt())==null?void 0:r.gtmMeasurementId;typeof window.gtag=="function"?window.gtag("get",n,La,t):t(null);}catch(n){e(n);}}),K_=t=>{if(t==null)return {};let e={};return typeof t.customerId=="string"?e.customerId=t.customerId:typeof t.customerid=="string"&&(e.customerId=t.customerid),typeof t.email=="string"&&(e.email=t.email),typeof t.firstName=="string"&&(e.firstName=t.firstName),typeof t.lastName=="string"&&(e.lastName=t.lastName),typeof t.mobileNumber=="string"?e.mobileNumber=t.mobileNumber:typeof t.mobile_number=="string"&&(e.mobileNumber=t.mobile_number),e},cn=()=>{try{let t=Te.get(Nd);if(t==null)return {};let e=JSON.parse(t);return K_(e)}catch(t){return {}}};var mt=()=>typeof window!="undefined"?window.mParticle:void 0,dn=t=>{var r;let e=(r=mt())==null?void 0:r.Identity.getCurrentUser();e==null||e.setUserAttributes(t);};function Ra(t={}){var a,u,l,c;let e=Te.get(Md),r=Te.get(Ud),n=Te.get(Ld),i=Te.get(Rd),o=Te.get(ln),s=cn();return be(Cr(be(be(be(be(be({},e&&{"Facebook.BrowserId":e}),r&&{"Facebook.ClickId":r}),n&&{"Reddit.ClickURL":window.location.origin+window.location.pathname}),i&&{"Reddit.UUID":i}),t),{"GoogleAds.ECData":{email:(a=s.email)!=null?a:null,phone_number:(u=s.mobileNumber)!=null?u:null,first_name:(l=s.firstName)!=null?l:null,last_name:(c=s.lastName)!=null?c:null}}),o&&{"TikTok.URL":window.location.origin+window.location.pathname,"TikTok.Referrer":document.referrer||"","TikTok.Callback":o})}function Fa(){let t=dt();return {expires:30,domain:t==null?void 0:t.cookieDomain}}var Hd=t=>{if(!t)return;let e=new URLSearchParams(window.location.search),r=Fa(),n=Array.from(Mo).reduce((o,s)=>(o[s]=e.get(s)||null,o),{});Object.values(n).some(o=>o!==null)?(dn(n),Array.from(Mo).forEach(o=>{Te.set(o,n[o],r);})):(Array.from(Mo).forEach(s=>{let a=Te.get(s);a&&a!=="null"&&(n[s]=a);}),Object.values(n).some(s=>s!==null)&&dn(n));},Vd=()=>{let e=new URLSearchParams(window.location.search).get(ln);e&&Te.set(ln,JSON.stringify(e),Fa());let r=!e&&Te.get(ln)?Te.get(ln):null;(r||e)&&dn({[ln]:e||r});let n=Te.get(Ma);n&&dn({[Ma]:n});},qd=()=>{var t;(t=mt())==null||t.ready(async()=>{var r;let e=(r=mt())==null?void 0:r.getIntegrationAttributes(160);e&&Object.keys(e).length>0&&dn(e);});},Kd=t=>{var n;let e=Te.get(Fd),r={};e&&(r[$d]=e,(n=t.getUser())==null||n.setUserAttributes(r));};async function $a(t){return Promise.all([Lo(),jd()]).then(([e,r])=>{var i;let n={};e&&(n[zd]=e),r&&(n[La]=r),Object.keys(n).length>0&&((i=t.getUser())==null||i.setUserAttributes(n));})}var Gd=()=>{var e;let t=(e=mt())==null?void 0:e.getDeviceId();t&&Te.set(Do,t,Fa());};function Wd(t){var n,i,o,s,a;if(typeof window=="undefined"||!window.dataLayer||!t.transaction)return;let e=t.properties,r={event:"purchase",attributes:{transaction_id:t.transaction.id,value:t.transaction.revenue,tax:t.transaction.tax,currency:t.currency,destination_country:(n=e.destination_country)!=null?n:null,new_paying_user:!!e.is_new_paying_user,is_new_paying_user:!!e.is_new_paying_user,service_category:(i=e.service_category)!=null?i:"",product_category:(o=e.product_category)!=null?o:"",product_sub_category:(s=e.product_sub_category)!=null?s:null,ltv:(a=e.ltv)!=null?a:null,items:t.products.map(u=>({item_id:u.id,item_name:u.name}))}};window.dataLayer.push(r);}var G_=(t,e)=>t.eCommerce.createProduct(e.name,e.id,e.price,1,void 0,e.category);function Yd({email:t,customerId:e,mobileNumber:r}){let n={};return e&&(n.customerid=e),t&&(n.email=t),r&&(n.mobile_number=r),Object.keys(n).length>0?{userIdentities:n}:void 0}var Jd=t=>{t.getUser()&&(Hd(t.getUser()),qd(),Vd(),$a(t),Kd(t),Gd());},mi=()=>{var t,e;try{return (e=(t=mt())==null?void 0:t.isInitialized())!=null?e:!1}catch(r){return  false}},vi=t=>{var r,n;if(typeof window=="undefined")return;let e=Bd();(n=(r=dt())==null?void 0:r.reporter)==null||n.captureMessage("mParticle is missing",{context:t,browserInfo:e});},W_=async t=>new Promise(e=>{var r,n,i,o;try{let s=mt();if(!s){e();return}let a=async l=>{var h,p,f,g;await $a(l);let c=(h=l.getPreviousUser())==null?void 0:h.getUserIdentities().userIdentities.customerid,d=(p=l.getUser())==null?void 0:p.getUserIdentities().userIdentities.customerid;if(typeof c=="undefined"&&d){l.getUser().setUserAttributes(l.getPreviousUser().getAllUserAttributes());let v=s.Identity.createAliasRequest(l.getPreviousUser(),l.getUser());try{s.Identity.aliasUsers(v,()=>e());}catch(m){(g=(f=dt())==null?void 0:f.reporter)==null||g.captureMessage("mParticle.aliasUsers failed"),e();}}else e();},u={customerid:t.userId};t.email&&(u.email=t.email),t.mobileNumber&&(u.mobile_number=t.mobileNumber),s.isInitialized()||(n=(r=dt())==null?void 0:r.reporter)==null||n.captureMessage("Skipping mParticle.login() because mParticle was not initialized.",{gtag:typeof window.gtag,url:window.location.href}),s.Identity.login({userIdentities:u},a);}catch(s){(o=(i=dt())==null?void 0:i.reporter)==null||o.captureException(s,{context:"mParticle.Identity.login()"}),e();}});function Ba(t){var e;return (e=dt())!=null&&e.mparticle.isDevMode?Cr(be({},t),{debug_mode:true}):t}var Xd={name:"mparticle",trackEvent(t,e){var r;(r=mt())==null||r.ready(()=>{var n;(n=mt())==null||n.logEvent(t.name,Uo[t.kind],Ba(e),Ra());});},trackScreen(t,e){var r;(r=mt())==null||r.ready(()=>{var o,s,a;let n=String((o=e.virtual_page_url)!=null?o:""),i=Ra({"GA4.Location":n+window.location.search,"GA4.Title":String((s=e.title)!=null?s:"")});(a=mt())==null||a.logPageView("Web Page",Ba(e),i);});},trackCommerce(t){var e;if(t.kind==="purchase"){Wd(t);return}t.kind==="checkout"&&((e=mt())==null||e.ready(()=>{let r=mt();if(!r)return;let n=t.products[0];if(!n)return;let i=G_(r,n);r.eCommerce.setCurrencyCode(t.currency);let o=t.transaction?{Id:t.transaction.id,Revenue:t.transaction.revenue,Tax:t.transaction.tax}:void 0;r.eCommerce.logProductAction(r.ProductActionType.Checkout,i,Ba(t.properties),void 0,o);}));},identify(t){return W_(t)},logout(){var t;(t=mt())==null||t.ready(async()=>{var e;(e=mt())==null||e.Identity.logout({});});},setUserProperties(t){var e;(e=mt())==null||e.ready(()=>{dn(t);});}};var hn=()=>typeof window!="undefined"?window.posthog:void 0,Y_={session_id:"ga_session_id"};function Ro(t){var r;let e={};for(let[n,i]of Object.entries(t))e[(r=Y_[n])!=null?r:n]=i;return e}
6var J_="checkout_commerce",Qd={name:"posthog",trackEvent(t,e){var r;(r=hn())==null||r.capture(t.name,Ro(e));},trackScreen(t,e){var r,n;(n=hn())==null||n.capture("$pageview",be({$current_url:String((r=e.virtual_page_url)!=null?r:window.location.href)},Ro(e)));},trackCommerce(t){var r,n,i,o,s,a,u;if(t.kind==="checkout"){let l=t.products[0];(r=hn())==null||r.capture(J_,be(be(be({currency_code:t.currency},l&&{product_id:l.id,product_name:l.name,price:l.price}),t.transaction&&{transaction_id:t.transaction.id,value:t.transaction.revenue,tax:t.transaction.tax}),Ro(t.properties)));return}if(t.kind!=="purchase"||!t.transaction)return;let e=t.properties;(u=hn())==null||u.capture("purchase",{transaction_id:t.transaction.id,value:t.transaction.revenue,tax:t.transaction.tax,currency:t.currency,destination_country:(n=e.destination_country)!=null?n:null,is_new_paying_user:!!e.is_new_paying_user,service_category:(i=e.service_category)!=null?i:"",product_category:(o=e.product_category)!=null?o:"",product_sub_category:(s=e.product_sub_category)!=null?s:null,ltv:(a=e.ltv)!=null?a:null,items:t.products.map(l=>({item_id:l.id,item_name:l.name}))});},identify(t){var r;let e={};t.email&&(e.email=t.email),t.mobileNumber&&(e.phone=t.mobileNumber),(r=hn())==null||r.identify(t.userId,e);},logout(){var t;(t=hn())==null||t.reset();},setUserProperties(t){var e;(e=hn())==null||e.setPersonProperties(Ro(t));}};var X_=[Xd,Qd];function bi(t){var r,n;let e=(n=(r=dt())==null?void 0:r.adapters)==null?void 0:n[t];return e===void 0?true:typeof e=="function"?e():e}function za(){return X_.filter(t=>bi(t.name))}var sp=false;function Fn(t){var r;let e=[t,t==null?void 0:t.default,(r=t==null?void 0:t.default)==null?void 0:r.default];for(let n of e)if(n&&typeof n.register=="function")return n;throw new Error("@rebtel/rebtel-web-tracking: mParticle kit is missing register()")}async function $w(){var g;if(typeof window=="undefined"||sp||!bi("mparticle"))return;let t=ao(),{apiId:e,workspaceToken:r,dataPlanId:n,proxyUrls:i,onCreateBatch:o,isDevMode:s}=t.mparticle;if(!e)return;sp=true;let{email:a,customerId:u,mobileNumber:l}=cn(),c=Yd({email:a,customerId:u,mobileNumber:l}),d=Te.get(Do),h=be(be(be({deviceId:d,isDevelopmentMode:s,workspaceToken:r,identityCallback:Jd,identifyRequest:c},n&&{dataPlan:{planId:n}}),i&&{v1SecureServiceUrl:i.v1Secure,v2SecureServiceUrl:i.v2Secure,v3SecureServiceUrl:i.v3Secure,configUrl:i.config,identityUrl:i.identity,aliasUrl:i.alias}),o&&{onCreateBatch:o}),p=await Promise.resolve().then(()=>ri(np())),f=await Promise.resolve().then(()=>ri(op()));Fn(p).register(h),Fn($c).register(h),Fn(up.default).register(h),Fn(f).register(h),Fn(ap.default).register(h),Fn(lp.default).register(h),Na.init(e,h),(g=t.reporter)==null||g.addBreadcrumb({category:"tracking",message:"Initialize mParticle",level:"info"});}var x=typeof window!="undefined"?window:void 0,ct=typeof globalThis!="undefined"?globalThis:x;typeof self=="undefined"&&(ct.self=ct),typeof File=="undefined"&&(ct.File=function(){});var og=Array.prototype,cp=og.forEach,dp=og.indexOf,It=ct==null?void 0:ct.navigator,H=ct==null?void 0:ct.document,lt=ct==null?void 0:ct.location,nl=ct==null?void 0:ct.fetch,il=ct!=null&&ct.XMLHttpRequest&&"withCredentials"in new ct.XMLHttpRequest?ct.XMLHttpRequest:void 0,hp=ct==null?void 0:ct.AbortController,Ct=It==null?void 0:It.userAgent,Z=x!=null?x:{},Dr={DEBUG:false,LIB_VERSION:"1.353.0"};function pp(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value;}catch(l){return void r(l)}a.done?e(u):Promise.resolve(u).then(n,i);}function Mr(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(u){pp(o,n,i,s,a,"next",u);}function a(u){pp(o,n,i,s,a,"throw",u);}s(void 0);}))}}function Y(){return Y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n]);}return t},Y.apply(null,arguments)}function sg(t,e){if(t==null)return {};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n];}return r}var Bw=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],zw=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
6spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],gp=function(t,e){if(e===void 0&&(e=[]),!t)return  false;var r=t.toLowerCase();return zw.concat(e).some((n=>{var i=n.toLowerCase();return r.indexOf(i)!==-1}))};function ce(t,e){return t.indexOf(e)!==-1}var js=function(t){return t.trim()},ol=function(t){return t.replace(/^\$/,"")},jw=Array.isArray,ag=Object.prototype,ug=ag.hasOwnProperty,Hs=ag.toString,ve=jw||function(t){return Hs.call(t)==="[object Array]"},Rr=t=>typeof t=="function",et=t=>t===Object(t)&&!ve(t),Vn=t=>{if(et(t)){for(var e in t)if(ug.call(t,e))return  false;return  true}return  false},K=t=>t===void 0,Ge=t=>Hs.call(t)=="[object String]",sl=t=>Ge(t)&&t.trim().length===0,Zt=t=>t===null,de=t=>K(t)||Zt(t),Br=t=>Hs.call(t)=="[object Number]"&&t==t,jn=t=>Br(t)&&t>0,$r=t=>Hs.call(t)==="[object Boolean]",Hw=t=>t instanceof FormData,Vw=t=>ce(Bw,t);function al(t){return t===null||typeof t!="object"}function _s(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function lg(t){return !K(Event)&&(function(e,r){try{return e instanceof r}catch(n){return  false}})(t,Event)}var qw=[true,"true",1,"1","yes"],Bu=t=>ce(qw,t),Kw=[false,"false",0,"0","no"];function Sr(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),Br(t)?t>r?(n.warn(" cannot be  greater than max: "+r+". Using max value instead."),r):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),Sr(i||r,e,r,n))}var ul=class{constructor(e){this.t={},this.i=e.i,this.o=Sr(e.bucketSize,0,100,e.h),this.m=Sr(e.refillRate,0,this.o,e.h),this.$=Sr(e.refillInterval,0,864e5,e.h);}S(e,r){var n=r-e.lastAccess,i=Math.floor(n/this.$);if(i>0){var o=i*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+i*this.$;}}consumeRateLimit(e){var r,n=Date.now(),i=String(e),o=this.t[i];return o?this.S(o,n):(o={tokens:this.o,lastAccess:n},this.t[i]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((r=this.i)==null||r.call(this,e)),o.tokens===0)}stop(){this.t={};}},Rt="Mobile",ys="iOS",Fr="Android",Gi="Tablet",cg=Fr+" "+Gi,dg="iPad",hg="Apple",pg=hg+" Watch",Wi="Safari",Wn="BlackBerry",gg="Samsung",fg=gg+"Browser",mg=gg+" Internet",Cn="Chrome",Gw=Cn+" OS",vg=Cn+" "+ys,mc="Internet Explorer",bg=mc+" "+Rt,vc="Opera",Ww=vc+" Mini",bc="Edge",_g="Microsoft "+bc,Kn="Firefox",yg=Kn+" "+ys,Yi="Nintendo",Ji="PlayStation",Gn="Xbox",wg=Fr+" "+Rt,Sg=Rt+" "+Wi,Li="Windows",ll=Li+" Phone",fp="Nokia",cl="Ouya",Cg="Generic",Yw=Cg+" "+Rt.toLowerCase(),Eg=Cg+" "+Gi.toLowerCase(),dl="Konqueror",_t="(\\d+(\\.\\d+)?)",zu=new RegExp("Version/"+_t),Jw=new RegExp(Gn,"i"),Xw=new RegExp(Ji+" \\w+","i"),Qw=new RegExp(Yi+" \\w+","i"),_c=new RegExp(Wn+"|PlayBook|BB10","i"),Zw={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ds,mp,ju,eS=(t,e)=>e&&ce(e,hg)||(function(r){return ce(r,Wi)&&!ce(r,Cn)&&!ce(r,Fr)})(t),Pg=function(t,e){return e=e||"",ce(t," OPR/")&&ce(t,"Mini")?Ww:ce(t," OPR/")?vc:_c.test(t)?Wn:ce(t,"IE"+Rt)||ce(t,"WPDesktop")?bg:ce(t,fg)?mg:ce(t,bc)||ce(t,"Edg/")?_g:ce(t,"FBIOS")?"Facebook "+Rt:ce(t,"UCWEB")||ce(t,"UCBrowser")?"UC Browser":ce(t,"CriOS")?vg:ce(t,"CrMo")||ce(t,Cn)?Cn:ce(t,Fr)&&ce(t,Wi)?wg:ce(t,"FxiOS")?yg:ce(t.toLowerCase(),dl.toLowerCase())?dl:eS(t,e)?ce(t,Rt)?Sg:Wi:ce(t,Kn)?Kn:ce(t,"MSIE")||ce(t,"Trident/")?mc:ce(t,"Gecko")?Kn:""},tS={[bg]:[new RegExp("rv:"+_t)],[_g]:[new RegExp(bc+"?\\/"+_t)],[Cn]:[new RegExp("("+Cn+"|CrMo)\\/"+_t)],[vg]:[new RegExp("CriOS\\/"+_t)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+_t)],[Wi]:[zu],[Sg]:[zu],[vc]:[new RegExp("(Opera|OPR)\\/"+_t)],[Kn]:[new RegExp(Kn+"\\/"+_t)],[yg]:[new RegExp("FxiOS\\/"+_t)],[dl]:[new RegExp("Konqueror[:/]?"+_t,"i")],[Wn]:[new RegExp(Wn+" "+_t),zu],[wg]:[new RegExp("android\\s"+_t,"i")],[mg]:[new RegExp(fg+"\\/"+_t)],[mc]:[new RegExp("(rv:|MSIE )"+_t)],Mozilla:[new RegExp("rv:"+_t)]},rS=function(t,e){var r=Pg(t,e),n=tS[r];if(K(n))return null;for(var i=0;i<n.length;i++){var o=n[i],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},vp=[[new RegExp(Gn+"; "+Gn+" (.*?)[);]","i"),t=>[Gn,t&&t[1]||""]],[new RegExp(Yi,"i"),[Yi,""]],[new RegExp(Ji,"i"),[Ji,""]],[_c,[Wn,""]],[new RegExp(Li,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return [ll,""];if(new RegExp(Rt).test(e)&&!/IEMobile\b/.test(e))return [Li+" "+Rt,""];
6var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var n=r[1],i=Zw[n]||"";return /arm/i.test(e)&&(i="RT"),[Li,i]}return [Li,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return [ys,e.join(".")]}return [ys,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=K(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Fr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Fr+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return [Fr,e.join(".")]}return [Fr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".");}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gw,""]],[/Linux|debian/i,["Linux",""]]],bp=function(t){return Qw.test(t)?Yi:Xw.test(t)?Ji:Jw.test(t)?Gn:new RegExp(cl,"i").test(t)?cl:new RegExp("("+ll+"|WPDesktop)","i").test(t)?ll:/iPad/.test(t)?dg:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?pg:_c.test(t)?Wn:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(fp,"i").test(t)?fp:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Rt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Fr:cg:new RegExp("(pda|"+Rt+")","i").test(t)?Yw:new RegExp(Gi,"i").test(t)&&!new RegExp(Gi+" pc","i").test(t)?Eg:""},nS=t=>t instanceof Error;function iS(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return ju&&r.length===mp||(mp=r.length,ju=r.reduce(((n,i)=>{ds||(ds={});var o=ds[i];if(o)n[o[0]]=o[1];else for(var s=t(i),a=s.length-1;a>=0;a--){var u=s[a],l=u==null?void 0:u.filename,c=e[i];if(l&&c){n[l]=c,ds[i]=[l,c];break}}return n}),{})),ju}}var hl=class{constructor(e,r,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=r,this.modifiers=n;}buildFromUnknown(e,r){r===void 0&&(r={});var n=r&&r.mechanism||{handled:true,type:"generic"},i=this.buildCoercingContext(n,r,0).apply(e),o=this.buildParsingContext(r),s=this.parseStacktrace(i,o);return {$exception_list:this.convertToExceptionList(s,n),$exception_level:"error"}}modifyFrames(e){var r=this;return Mr((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&ve(n.stacktrace.frames)&&(n.stacktrace.frames=yield r.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){var r;return {type:"Error",value:"Unknown error",stack:(r=e.syntheticException)==null?void 0:r.stack,synthetic:true}}parseStacktrace(e,r){var n,i;return e.cause!=null&&(n=this.parseStacktrace(e.cause,r)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?r.skipFirstLines:0),r.chunkIdMap)),Y({},e,{cause:n,stack:i})}applyChunkIds(e,r){return e.map((n=>(n.filename&&r&&(n.chunk_id=r[n.filename]),n)))}applyCoercers(e,r){for(var n of this.coercers)if(n.match(e))return n.coerce(e,r);return this.coerceFallback(r)}applyModifiers(e){var r=this;return Mr((function*(){var n=e;for(var i of r.modifiers)n=yield i(n);return n}))()}convertToExceptionList(e,r){var n,i,o,s={type:e.type,value:e.value,mechanism:{type:(n=r.type)!==null&&n!==void 0?n:"generic",handled:(i=r.handled)===null||i===void 0||i,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,Y({},r,{handled:true}))),a}buildParsingContext(e){var r;return {chunkIdMap:iS(this.stackParser),skipFirstLines:(r=e.skipFirstLines)!==null&&r!==void 0?r:1}}buildCoercingContext(e,r,n){n===void 0&&(n=0);var i=(o,s)=>{if(s<=4){var a=this.buildCoercingContext(e,r,s);return this.applyCoercers(o,a)}};return Y({},r,{syntheticException:n==0?r.syntheticException:void 0,mechanism:e,apply:o=>i(o,n),next:o=>i(o,n+1)})}},Yn="?";function pl(t,e,r,n,i){var o={platform:t,filename:e,function:r==="<anonymous>"?Yn:r,in_app:true};return K(n)||(o.lineno=n),K(i)||(o.colno=i),o}var Ig=(t,e)=>{var r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:Yn,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},oS=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,sS=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,aS=/\((\S*)(?::(\d+))(?::(\d+))\)/,uS=(t,e)=>{var r=oS.exec(t);if(r){var[,n,i,o]=r;return pl(e,n,Yn,+i,+o)}var s=sS.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var a=aS.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3]);}var[u,l]=Ig(s[1]||Yn,s[2]);return pl(e,l,u,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},lS=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,cS=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,dS=(t,e)=>{var r=lS.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=cS.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="");}var i=r[3],o=r[1]||Yn;return [o,i]=Ig(o,i),pl(e,i,o,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},_p=/\(error: (.*)\)/,yp=50;function hS(){return (function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(i,o){o===void 0&&(o=0);for(var s=[],a=i.split(`
7`),u=o;u<a.length;u++){var l=a[u];if(!(l.length>1024)){var c=_p.test(l)?l.replace(_p,"$1"):l;if(!c.match(/\S*Error: /)){for(var d of r){var h=d(c,t);if(h){s.push(h);break}}if(s.length>=yp)break}}}return (function(p){if(!p.length)return [];var f=Array.from(p);return f.reverse(),f.slice(0,yp).map((g=>{return Y({},g,{filename:g.filename||(v=f,v[v.length-1]||{}).filename,function:g.function||Yn});var v;}))})(s)}})("web:javascript",uS,dS)}var gl=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,r){var n=Ge(e.stack);return {type:this.getType(e),value:this.getValue(e),stack:n?e.stack:void 0,cause:e.cause?r.next(e.cause):void 0,synthetic:false}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var r=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?r+": "+e.message:r}isDOMException(e){return _s(e,"DOMException")}isDOMError(e){return _s(e,"DOMError")}},fl=class{match(e){return (r=>r instanceof Error)(e)}coerce(e,r){return {type:this.getType(e),value:this.getMessage(e,r),stack:this.getStack(e),cause:e.cause?r.next(e.cause):void 0,synthetic:false}}getType(e){return e.name||e.constructor.name}getMessage(e,r){var n=e.message;return n.error&&typeof n.error.message=="string"?String(n.error.message):String(n)}getStack(e){return e.stacktrace||e.stack||void 0}},ml=class{constructor(){}match(e){return _s(e,"ErrorEvent")&&e.error!=null}coerce(e,r){var n,i=r.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:true}}},pS=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,vl=class{match(e){return typeof e=="string"}coerce(e,r){var n,[i,o]=this.getInfos(e);return {type:i!=null?i:"Error",value:o!=null?o:e,stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:true}}getInfos(e){var r="Error",n=e,i=e.match(pS);return i&&(r=i[1],n=i[2]),[r,n]}},gS=["fatal","error","warning","log","info","debug"];function Ag(t,e){e===void 0&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return "[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");
7if(!(i.length>e))return n===r.length||i.length<=e?i:i.slice(0,e)+"..."}return ""}var bl=class{match(e){return typeof e=="object"&&e!==null}coerce(e,r){var n,i=this.getErrorPropertyFromObject(e);return i?r.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(n=r.syntheticException)==null?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:true}}getType(e){return lg(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var r="'"+e.name+"' captured as exception";return "message"in e&&typeof e.message=="string"&&(r+=" with message: '"+e.message+"'"),r}if("message"in e&&typeof e.message=="string")return e.message;var n=this.getObjectClassName(e);return (n&&n!=="Object"?"'"+n+"'":"Object")+" captured as exception with keys: "+Ag(e)}isSeverityLevel(e){return Ge(e)&&!sl(e)&&gS.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];if(nS(n))return n}}getObjectClassName(e){try{var r=Object.getPrototypeOf(e);return r?r.constructor.name:void 0}catch(n){return}}},_l=class{match(e){return lg(e)}coerce(e,r){var n,i=e.constructor.name;return {type:i,value:i+" captured as exception with keys: "+Ag(e),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:true}}},yl=class{match(e){return al(e)}coerce(e,r){var n;return {type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:true}}},wl=class{match(e){return _s(e,"PromiseRejectionEvent")}coerce(e,r){var n,i=this.getUnhandledRejectionReason(e);return al(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(n=r.syntheticException)==null?void 0:n.stack,synthetic:true}:r.apply(i)}getUnhandledRejectionReason(e){if(al(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(r){}return e}},Tg=function(t,e){var{debugEnabled:r}=e===void 0?{}:e,n={k:function(i){if(x&&(Dr.DEBUG||Z.POSTHOG_DEBUG||r)&&!K(x.console)&&x.console){for(var o=("__rrweb_original__"in x.console[i])?x.console[i].__rrweb_original__:x.console[i],s=arguments.length,a=new Array(s>1?s-1:0),u=1;u<s;u++)a[u-1]=arguments[u];o(t,...a);}},info:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];n.k("log",...o);},warn:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];n.k("warn",...o);},error:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];n.k("error",...o);},critical:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];console.error(t,...o);},uninitializedWarning:i=>{n.error("You must initialize PostHog before calling "+i);},createLogger:(i,o)=>Tg(t+" "+i,o)};return n},W=Tg("[PostHog.js]"),Le=W.createLogger,fS=Le("[ExternalScriptsLoader]"),wp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return fS.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=H==null?void 0:H.querySelectorAll("script");if(n){for(var i,o=function(){if(n[s].src===e){var u=n[s];return u.__posthog_loading_callback_fired?{v:r()}:(u.addEventListener("load",(l=>{u.__posthog_loading_callback_fired=true,r(void 0,l);})),u.onerror=l=>r(l),{v:void 0})}},s=0;s<n.length;s++)if(i=o())return i.v}var a=()=>{if(!H)return r("document not found");var u=H.createElement("script");if(u.type="text/javascript",u.crossOrigin="anonymous",u.src=e,u.onload=d=>{u.__posthog_loading_callback_fired=true,r(void 0,d);},u.onerror=d=>r(d),t.config.prepare_external_dependency_script&&(u=t.config.prepare_external_dependency_script(u)),!u)return r("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")H.head.appendChild(u);else {var l,c=H.querySelectorAll("body > script");c.length>0?(l=c[0].parentNode)==null||l.insertBefore(u,c[0]):H.body.appendChild(u);}};H!=null&&H.body?a():H==null||H.addEventListener("DOMContentLoaded",a);};Z.__PosthogExtensions__=Z.__PosthogExtensions__||{},Z.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var n="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(n="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;n=n+"&t="+Math.floor(Date.now()/i)*i;}var o=t.requestRouter.endpointFor("assets",n);wp(t,o,r);},Z.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var n=t.requestRouter.endpointFor("api",e);wp(t,n,r);};var ws={};function Jr(t,e,r){if(ve(t)){if(cp&&t.forEach===cp)t.forEach(e,r);else if("length"in t&&t.length===+t.length){for(var n=0,i=t.length;n<i;n++)if(n in t&&e.call(r,t[n],n)===ws)return}}}function Ce(t,e,r){if(!de(t)){if(ve(t))return Jr(t,e,r);
7if(Hw(t)){for(var n of t.entries())if(e.call(r,n[1],n[0])===ws)return}else for(var i in t)if(ug.call(t,i)&&e.call(r,t[i],i)===ws)return}}var Ve=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Jr(r,(function(i){for(var o in i)i[o]!==void 0&&(t[o]=i[o]);})),t},Xn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Jr(r,(function(i){Jr(i,(function(o){t.push(o);}));})),t};function vs(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n}var Sp=function(t){try{return t()}catch(e){return}},mS=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.apply(this,r)}catch(i){W.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),W.critical(i);}}},yc=function(t){var e={};return Ce(t,(function(r,n){(Ge(r)&&r.length>0||Br(r))&&(e[n]=r);})),e};function vS(t,e){return r=t,n=o=>Ge(o)&&!Zt(e)?o.slice(0,e):o,i=new Set,(function o(s,a){return s!==Object(s)?n?n(s,a):s:i.has(s)?void 0:(i.add(s),ve(s)?(u=[],Jr(s,(l=>{u.push(o(l));}))):(u={},Ce(s,((l,c)=>{i.has(l)||(u[c]=o(l,c));}))),u);var u;})(r);var r,n,i;}var bS=["herokuapp.com","vercel.app","netlify.app"];function _S(t){var e=t==null?void 0:t.hostname;if(!Ge(e))return  false;var r=e.split(".").slice(-2).join(".");for(var n of bS)if(r===n)return  false;return  true}function kg(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function We(t,e,r,n){var{capture:i=false,passive:o=true}=n!=null?n:{};t==null||t.addEventListener(e,r,{capture:i,passive:o});}function xg(t){return t.name==="ph_toolbar_internal"}var Og="$people_distinct_id",Ri="__alias",Fi="__timers",Cp="$autocapture_disabled_server_side",Sl="$heatmaps_enabled_server_side",Ep="$exception_capture_enabled_server_side",Cl="$error_tracking_suppression_rules",Pp="$error_tracking_capture_extension_exceptions",Ip="$web_vitals_enabled_server_side",Ng="$dead_clicks_enabled_server_side",Ap="$product_tours_enabled_server_side",Tp="$web_vitals_allowed_metrics",hs="$session_recording_remote_config",Ss="$sesid",Dg="$session_is_sampled",qn="$enabled_feature_flags",$i="$early_access_features",El="$feature_flag_details",Bi="$stored_person_properties",Sn="$stored_group_properties",Pl="$surveys",Cs="$flag_call_reported",Il="$feature_flag_errors",yr="$user_state",Al="$client_session_props",Tl="$capture_rate_limit",kl="$initial_campaign_params",xl="$initial_referrer_info",Es="$initial_person_info",Ps="$epp",Mg="__POSTHOG_TOOLBAR__",Ai="$posthog_cookieless",yS=[Og,Ri,"__cmpns",Fi,"$session_recording_enabled_server_side",Sl,Ss,qn,Cl,yr,$i,El,Sn,Bi,Pl,Cs,Il,Al,Tl,kl,xl,Ps,Es];function kp(t){return t instanceof Element&&(t.id===Mg||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Vs(t){return !!t&&t.nodeType===1}function Xr(t,e){return !!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Ug(t){return !!t&&t.nodeType===3}function Lg(t){return !!t&&t.nodeType===11}function wc(t){return t?js(t).split(/\s+/):[]}function xp(t){var e=x==null?void 0:x.location.href;return !!(e&&t&&t.some((r=>e.match(r))))}function Is(t){var e="";switch(typeof t.className){case "string":e=t.className;break;case "object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e="";}return wc(e)}function Rg(t){return de(t)?null:js(t).split(/(\s+)/).filter((e=>Xi(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zi(t){var e="";return Ol(t)&&!jg(t)&&t.childNodes&&t.childNodes.length&&Ce(t.childNodes,(function(r){var n;Ug(r)&&r.textContent&&(e+=(n=Rg(r.textContent))!==null&&n!==void 0?n:"");})),js(e)}function Fg(t){return K(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e;}var Sc=["a","button","form","input","select","textarea","label"];function $g(t,e){if(K(e))return  true;var r,n=function(o){if(e.some((s=>o.matches(s))))return {v:true}};for(var i of t)if(r=n(i))return r.v;return  false}function Bg(t){var e=t.parentNode;return !(!e||!Vs(e))&&e}var wS=["next","previous","prev",">","<"],Op=10,Np=[".ph-no-rageclick",".ph-no-capture"];function SS(t,e){if(!x||Cc(t))return  false;var r,n,i;if($r(e)?(r=!!e&&Np,n=void 0):(r=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:Np,n=e==null?void 0:e.content_ignorelist),r===false)return  false;var{targetElementList:o}=zg(t,false);return !(function(s,a){if(s===false||K(s))return  false;var u;if(s===true)u=wS;
7else {if(!ve(s))return  false;if(s.length>Op)return W.error("[PostHog] content_ignorelist array cannot exceed "+Op+" items. Use css_selector_ignorelist for more complex matching."),false;u=s.map((l=>l.toLowerCase()));}return a.some((l=>{var{safeText:c,ariaLabel:d}=l;return u.some((h=>c.includes(h)||d.includes(h)))}))})(n,o.map((s=>{var a;return {safeText:Zi(s).toLowerCase(),ariaLabel:((a=s.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}})))&&!$g(o,r)}var Cc=t=>!t||Xr(t,"html")||!Vs(t),zg=(t,e)=>{if(!x||Cc(t))return {parentIsUsefulElement:false,targetElementList:[]};for(var r=false,n=[t],i=t;i.parentNode&&!Xr(i,"body");)if(Lg(i.parentNode))n.push(i.parentNode.host),i=i.parentNode.host;else {var o=Bg(i);if(!o)break;if(e||Sc.indexOf(o.tagName.toLowerCase())>-1)r=true;else {var s=x.getComputedStyle(o);s&&s.getPropertyValue("cursor")==="pointer"&&(r=true);}n.push(o),i=o;}return {parentIsUsefulElement:r,targetElementList:n}};function CS(t,e,r,n,i){var o,s,a,u;if(r===void 0&&(r=void 0),!x||Cc(t)||(o=r)!=null&&o.url_allowlist&&!xp(r.url_allowlist)||(s=r)!=null&&s.url_ignorelist&&xp(r.url_ignorelist))return  false;if((a=r)!=null&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((f=>e.type===f)))return  false}var{parentIsUsefulElement:c,targetElementList:d}=zg(t,n);if(!(function(f,g){var v=g==null?void 0:g.element_allowlist;if(K(v))return  true;var m,y=function(k){if(v.some((N=>k.tagName.toLowerCase()===N)))return {v:true}};for(var T of f)if(m=y(T))return m.v;return  false})(d,r)||!$g(d,(u=r)==null?void 0:u.css_selector_allowlist))return  false;var h=x.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return  true;var p=t.tagName.toLowerCase();switch(p){case "html":return  false;case "form":return (i||["submit"]).indexOf(e.type)>=0;case "input":case "select":case "textarea":return (i||["change","click"]).indexOf(e.type)>=0;default:return c?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(Sc.indexOf(p)>-1||t.getAttribute("contenteditable")==="true")}}function Ol(t){for(var e=t;e.parentNode&&!Xr(e,"body");e=e.parentNode){var r=Is(e);if(ce(r,"ph-sensitive")||ce(r,"ph-no-capture"))return  false}if(ce(Is(t),"ph-include"))return  true;var n=t.type||"";if(Ge(n))switch(n.toLowerCase()){case "hidden":case "password":return  false}var i=t.name||t.id||"";return !(Ge(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function jg(t){return !!(Xr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Xr(t,"select")||Xr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Hg="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",ES=new RegExp("^(?:"+Hg+")$"),PS=new RegExp(Hg),Vg="\\d{3}-?\\d{2}-?\\d{4}",IS=new RegExp("^("+Vg+")$"),AS=new RegExp("("+Vg+")");function Xi(t,e){return e===void 0&&(e=true),!(de(t)||Ge(t)&&(t=js(t),(e?ES:PS).test((t||"").replace(/[- ]/g,""))||(e?IS:AS).test(t)))}function qg(t){var e=Zi(t);return Xi(e=(e+" "+Kg(t)).trim())?e:""}function Kg(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ce(t.childNodes,(function(r){var n;if(r&&((n=r.tagName)==null?void 0:n.toLowerCase())==="span")try{var i=Zi(r);e=(e+" "+i).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+Kg(r)).trim());}catch(o){W.error("[AutoCapture]",o);}})),e}function TS(t){return (function(e){var r=e.map((n=>{var i,o,s="";if(n.tag_name&&(s+=n.tag_name),n.attr_class)for(var a of(n.attr_class.sort(),n.attr_class))s+="."+a.replace(/"/g,"");var u=Y({},n.text?{text:n.text}:{},{"nth-child":(i=n.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(o=n.nth_of_type)!==null&&o!==void 0?o:0},n.href?{href:n.href}:{},n.attr_id?{attr_id:n.attr_id}:{},n.attributes),l={};return vs(u).sort(((c,d)=>{var[h]=c,[p]=d;return h.localeCompare(p)})).forEach((c=>{var[d,h]=c;return l[Dp(d.toString())]=Dp(h.toString())})),s+=":",s+=vs(l).map((c=>{var[d,h]=c;return d+'="'+h+'"'})).join("")}));return r.join(";")})((function(e){return e.map((r=>{var n,i,o={text:(n=r.$el_text)==null?void 0:n.slice(0,400),tag_name:r.tag_name,href:(i=r.attr__href)==null?void 0:i.slice(0,2048),attr_class:kS(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return vs(r).filter((s=>{var[a]=s;return a.indexOf("attr__")===0}
7)).forEach((s=>{var[a,u]=s;return o.attributes[a]=u})),o}))})(t))}function Dp(t){return t.replace(/"|\\"/g,'\\"')}function kS(t){var e=t.attr__class;return e?ve(e)?e:wc(e):void 0}var As=class{constructor(e){this.disabled=e===false;var r=et(e)?e:{};this.thresholdPx=r.threshold_px||30,this.timeoutMs=r.timeout_ms||1e3,this.clickCount=r.click_count||3,this.clicks=[];}isRageClick(e,r,n){if(this.disabled)return  false;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(r-i.y)<this.thresholdPx&&n-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:r,timestamp:n}),this.clicks.length===this.clickCount)return  true}else this.clicks=[{x:e,y:r,timestamp:n}];return  false}},Ts=t=>{var e=H==null?void 0:H.createElement("a");return K(e)?null:(e.href=t,e)},xS=function(t,e){var r,n;e===void 0&&(e="&");var i=[];return Ce(t,(function(o,s){K(o)||K(s)||s==="undefined"||(r=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),n=encodeURIComponent(s),i[i.length]=n+"="+r);})),i.join(e)},ks=function(t,e){for(var r,n=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0]===e){r=o;break}}if(!ve(r)||r.length<2)return "";var s=r[1];try{s=decodeURIComponent(s);}catch(a){W.error("Skipping decoding for malformed query param: "+s);}return s.replace(/\+/g," ")},eo=function(t,e,r){if(!t||!e||!e.length)return t;for(var n=t.split("#"),i=n[0]||"",o=n[1],s=i.split("?"),a=s[1],u=s[0],l=(a||"").split("&"),c=[],d=0;d<l.length;d++){var h=l[d].split("=");ve(h)&&(e.includes(h[0])?c.push(h[0]+"="+r):c.push(l[d]));}var p=u;return a!=null&&(p+="?"+c.join("&")),o!=null&&(p+="#"+o),p},xs=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},Hu="$copy_autocapture",Mp=Le("[AutoCapture]");function Vu(t,e){return e.length>t?e.slice(0,t)+"...":e}function OS(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Vs(e));return e}function NS(t,e,r,n){var i=t.tagName.toLowerCase(),o={tag_name:i};Sc.indexOf(i)>-1&&!r&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=Vu(1024,qg(t)):o.$el_text=Vu(1024,Zi(t)));var s=Is(t);s.length>0&&(o.classes=s.filter((function(c){return c!==""}))),Ce(t.attributes,(function(c){var d;if((!jg(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(n==null||!n.includes(c.name))&&!e&&Xi(c.value)&&(d=c.name,!Ge(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var h=c.value;c.name==="class"&&(h=wc(h).join(" ")),o["attr__"+c.name]=Vu(1024,h);}}));for(var a=1,u=1,l=t;l=OS(l);)a++,l.tagName===t.tagName&&u++;return o.nth_child=a,o.nth_of_type=u,o}function DS(t,e){for(var r,n,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsC
7hainAsString:u}=e,l=[t],c=t;c.parentNode&&!Xr(c,"body");)Lg(c.parentNode)?(l.push(c.parentNode.host),c=c.parentNode.host):(l.push(c.parentNode),c=c.parentNode);var d,h=[],p={},f=false,g=false;if(Ce(l,(k=>{var N=Ol(k);k.tagName.toLowerCase()==="a"&&(f=k.getAttribute("href"),f=N&&f&&Xi(f)&&f),ce(Is(k),"ph-no-capture")&&(g=true),h.push(NS(k,o,s,a));var _=(function(S){if(!Ol(S))return {};var M={};return Ce(S.attributes,(function(X){if(X.name&&X.name.indexOf("data-ph-capture-attribute")===0){var J=X.name.replace("data-ph-capture-attribute-",""),G=X.value;J&&G&&Xi(G)&&(M[J]=G);}})),M})(k);Ve(p,_);})),g)return {props:{},explicitNoCapture:g};if(s||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=qg(t):h[0].$el_text=Zi(t)),f){var v,m;h[0].attr__href=f;var y=(v=Ts(f))==null?void 0:v.host,T=x==null||(m=x.location)==null?void 0:m.host;y&&T&&y!==T&&(d=f);}return {props:Ve({$event_type:i.type,$ce_version:1},u?{}:{$elements:h},{$elements_chain:TS(h)},(r=h[0])!=null&&r.$el_text?{$el_text:(n=h[0])==null?void 0:n.$el_text}:{},d&&i.type==="click"?{$external_click_url:d}:{},p)}}var Nl=class{constructor(e){this.P=false,this.T=null,this.I=false,this.instance=e,this.rageclicks=new As(e.config.rageclick),this.C=null;}get R(){var e,r,n=et(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),n.url_ignorelist=(r=n.url_ignorelist)==null?void 0:r.map((i=>new RegExp(i))),n}F(){if(this.isBrowserSupported()){if(x&&H){var e=n=>{n=n||(x==null?void 0:x.event);try{this.O(n);}catch(i){Mp.error("Failed to capture event",i);}};if(We(H,"submit",e,{capture:true}),We(H,"change",e,{capture:true}),We(H,"click",e,{capture:true}),this.R.capture_copied_text){var r=n=>{n=n||(x==null?void 0:x.event),this.O(n,Hu);};We(H,"copy",r,{capture:true}),We(H,"cut",r,{capture:true});}}}else Mp.info("Disabling Automatic Event Collection because this browser is not supported");}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=true);}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Cp]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled();}setElementSelectors(e){this.C=e;}getElementSelectors(e){var r,n=[];return (r=this.C)==null||r.forEach((i=>{var o=H==null?void 0:H.querySelectorAll(i);o==null||o.forEach((s=>{e===s&&n.push(i);}));})),n}get isEnabled(){var e,r,n=(e=this.instance.persistence)==null?void 0:e.props[Cp],i=this.T;if(Zt(i)&&!$r(n)&&!this.instance.M())return  false;var o=(r=this.T)!==null&&r!==void 0?r:!!n;return !!this.instance.config.autocapture&&!o}O(e,r){if(r===void 0&&(r="$autocapture"),this.isEnabled){var n,i=Fg(e);Ug(i)&&(i=i.parentNode||null),r==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&SS(i,this.instance.config.rageclick)&&this.O(e,"$rageclick");var o=r===Hu;if(i&&CS(i,e,this.R,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:a}=DS(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(a)return  false;var u=this.getElementSelectors(i);if(u&&u.length>0&&(s.$element_selectors=u),r===Hu){var l,c=Rg(x==null||(l=x.getSelection())==null?void 0:l.toString()),d=e.type||"clipboard";if(!c)return  false;s.$selected_content=c,s.$copy_type=d;}return this.instance.capture(r,s),true}}}isBrowserSupported(){return Rr(H==null?void 0:H.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Br(t)&&isFinite(t)&&Math.floor(t)===t});var Up="0123456789abcdef",Dl=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,n,i){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||e<0||r<0||n<0||i<0||e>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|r>>>8,o[7]=r,o[8]=128|n>>>24,o[9]=n>
7>>16,o[10]=n>>>8,o[11]=n,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new t(o)}toString(){for(var e="",r=0;r<this.bytes.length;r++)e=e+Up.charAt(this.bytes[r]>>>4)+Up.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var r=0;r<16;r++){var n=this.bytes[r]-e.bytes[r];if(n!==0)return Math.sign(n)}return 0}},Ml=class{constructor(){this.A=0,this.j=0,this.D=new Ul;}generate(){var e=this.generateOrAbort();if(K(e)){this.A=0;var r=this.generateOrAbort();if(K(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else {if(!(e+1e4>this.A))return;this.j++,this.j>4398046511103&&(this.A++,this.L());}return Dl.fromFieldsV7(this.A,Math.trunc(this.j/Math.pow(2,30)),this.j&Math.pow(2,30)-1,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32());}},Lp,Gg=t=>{if(typeof UUIDV7_DENY_WEAK_RNG!="undefined"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};x&&!K(x.crypto)&&crypto.getRandomValues&&(Gg=t=>crypto.getRandomValues(t));var Ul=class{constructor(){this.N=new Uint32Array(8),this.U=1/0;}nextUint32(){return this.U>=this.N.length&&(Gg(this.N),this.U=0),this.N[this.U++]}},Yr=()=>MS().toString(),MS=()=>(Lp||(Lp=new Ml)).generate(),Ti="",US=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function LS(t,e){if(e){var r=(function(i,o){if(o===void 0&&(o=H),Ti)return Ti;if(!o||["localhost","127.0.0.1"].includes(i))return "";for(var s=i.split("."),a=Math.min(s.length,8),u="dmn_chk_"+Yr();!Ti&&a--;){var l=s.slice(a).join("."),c=u+"=1;domain=."+l+";path=/";o.cookie=c+";max-age=3",o.cookie.includes(u)&&(o.cookie=c+";max-age=0",Ti=l);}return Ti})(t);if(!r){var n=(i=>{var o=i.match(US);return o?o[0]:""})(t);n!==r&&W.info("Warning: cookie subdomain discovery mismatch",n,r),r=n;}return r?"; domain=."+r:""}return ""}var wr={H:()=>!!H,B:function(t){W.error("cookieStore error: "+t);},q:function(t){if(H){try{for(var e=t+"=",r=H.cookie.split(";").filter((o=>o.length)),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch(o){}return null}},W:function(t){var e;try{e=JSON.parse(wr.q(t))||{};}catch(r){}return e},G:function(t,e,r,n,i){if(H)try{var o="",s="",a=LS(H.location.hostname,n);if(r){var u=new Date;u.setTime(u.getTime()+24*r*60*60*1e3),o="; expires="+u.toUTCString();}i&&(s="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return l.length>3686.4&&W.warn("cookieStore warning: large cookie, len="+l.length),H.cookie=l,l}catch(c){return}},V:function(t,e){if(H!=null&&H.cookie)try{wr.G(t,"",-1,e);}catch(r){return}}},qu=null,Ue={H:function(){if(!Zt(qu))return qu;var t=true;if(K(x))t=false;else try{var e="__mplssupport__";Ue.G(e,"xyz"),Ue.q(e)!=='"xyz"'&&(t=!1),Ue.V(e);}catch(r){t=false;}return t||W.error("localStorage unsupported; falling back to cookie store"),qu=t,t},B:function(t){W.error("localStorage error: "+t);},q:function(t){try{return x==null?void 0:x.localStorage.getItem(t)}catch(e){Ue.B(e);}return null},W:function(t){try{return JSON.parse(Ue.q(t))||{}}catch(e){}return null},G:function(t,e){try{x==null||x.localStorage.setItem(t,JSON.stringify(e));}catch(r){Ue.B(r);}},V:function(t){try{x==null||x.localStorage.removeItem(t);}catch(e){Ue.B(e);}}},RS=["$device_id","distinct_id",Ss,Dg,Ps,Es,yr],ps={},FS={H:function(){return  true},B:function(t){W.error("memoryStorage error: "+t);},q:function(t){return ps[t]||null},W:function(t){return ps[t]||null},G:function(t,e){ps[t]=e;},V:function(t){delete ps[t];}},wn=null,ut={H:function(){if(!Zt(wn))return wn;if(wn=true,K(x))wn=false;else try{var t="__support__";ut.G(t,"xyz"),ut.q(t)!=='"xyz"'&&(wn=!1),ut.V(t);}catch(e){wn=false;}return wn},B:function(t){W.error("sessionStorage error: ",t);},q:function(t){try{return x==null?void 0:x.sessionStorage.getItem(t)}catch(e){ut.B(e);}return null},W:function(t){try{return JSON.parse(ut.q(t))||null}catch(e){}return null},G:function(t,e){try{x==null||x.sessionStorage.setItem(t,JSON.stringify(e));}catch(r){ut.B(r);}},V:function(t){try{x==null||x.sessionStorage.removeItem(t);}catch(e){ut.B(e);}}}
7,Ur=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Ll=class{constructor(e){this._instance=e;}get R(){return this._instance.config}get consent(){return this.J()?Ur.DENIED:this.K}isOptedOut(){return this.R.cookieless_mode==="always"||this.consent===Ur.DENIED||this.consent===Ur.PENDING&&(this.R.opt_out_capturing_by_default||this.R.cookieless_mode==="on_reject")}isOptedIn(){return !this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ur.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie);}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie);}get X(){var{token:e,opt_out_capturing_cookie_prefix:r,consent_persistence_name:n}=this._instance.config;return n||(r?r+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Bu(e)?Ur.GRANTED:ce(Kw,e)?Ur.DENIED:Ur.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ue:wr;var r=e==="localStorage"?wr:Ue;r.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Bu(r.q(this.X))),r.V(this.X,this.R.cross_subdomain_cookie));}return this.Z}J(){return !!this.R.respect_dnt&&!!kg([It==null?void 0:It.doNotTrack,It==null?void 0:It.msDoNotTrack,Z.doNotTrack],(e=>Bu(e)))}},gs=Le("[Dead Clicks]"),$S=()=>true,BS=t=>{var e,r=!((e=t.instance.persistence)==null||!e.get_property(Ng)),n=t.instance.config.capture_dead_clicks;return $r(n)?n:!!et(n)||r},Os=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,r,n){this.instance=e,this.isEnabled=r,this.onCapture=n,this.startIfEnabledOrStop();}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Ng]:e.captureDeadClicks}),this.startIfEnabledOrStop());}startIfEnabledOrStop(){this.isEnabled(this)?this.it((()=>{this.et();})):this.stop();}it(e){var r,n;(r=Z.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture&&e(),(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?gs.error("failed to load script",i):e();}));}et(){var e;if(H){if(!this.tt&&(e=Z.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var r=et(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};r.__onCapture=this.onCapture,this.tt=Z.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.tt.start(H),gs.info("starting...");}}else gs.error("`document` not found. Cannot start.");}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,gs.info("stopping..."));}},ki=Le("[ExceptionAutocapture]"),Rl=class{constructor(e){var r,n,i;this.rt=()=>{var o;if(x&&this.isEnabled&&(o=Z.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=Z.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=Z.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,u=Z.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=s(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=a(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=u(this.captureException.bind(this)));}catch(l){ki.error("failed to start",l),this.ut();}}},this._instance=e,this.ht=!((r=this._instance.persistence)==null||!r.props[Ep]),this.dt=new ul({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:ki}),this.R=this.vt(),this.startIfEnabledOrStop();}vt(){var e=this._instance.config.capture_exceptions,r={capture_unhandled_errors:false,capture_unhandled_rejections:false,capture_console_errors:false};return et(e)?r=Y({},r,e):(K(e)?this.ht:e)&&(r=Y({},r,{capture_unhandled_errors:true,capture_unhandled_rejections:true})),r}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ki.info("enabled"),this.ut(),this.it(this.rt)):this.ut();}it(e){var r,n;
7(r=Z.__PosthogExtensions__)!=null&&r.errorWrappingFunctions&&e(),(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return ki.error("failed to load script",i);e();}));}ut(){var e,r,n;(e=this.st)==null||e.call(this),this.st=void 0,(r=this.nt)==null||r.call(this),this.nt=void 0,(n=this.ot)==null||n.call(this),this.ot=void 0;}onRemoteConfig(e){if("autocaptureExceptions"in e){var r=e.autocaptureExceptions;this.ht=!!r||false,this._instance.persistence&&this._instance.persistence.register({[Ep]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop();}}onConfigChange(){this.R=this.vt();}captureException(e){var r,n,i=(r=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&r!==void 0?r:"Exception";this.dt.consumeRateLimit(i)?ki.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e);}};function Rp(t,e,r){try{if(!(e in t))return ()=>{};var n=t[e],i=r(n);return Rr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=n;}}catch(o){return ()=>{}}}var Fl=class{constructor(e){var r;this._instance=e,this.ct=(x==null||(r=x.location)==null?void 0:r.pathname)||"";}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(W.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges());}stop(){this.ft&&this.ft(),this.ft=void 0,W.info("History API monitoring stopped");}monitorHistoryChanges(){var e,r;if(x&&x.history){var n=this;(e=x.history.pushState)!=null&&e.__posthog_wrapped__||Rp(x.history,"pushState",(i=>function(o,s,a){i.call(this,o,s,a),n._t("pushState");})),(r=x.history.replaceState)!=null&&r.__posthog_wrapped__||Rp(x.history,"replaceState",(i=>function(o,s,a){i.call(this,o,s,a),n._t("replaceState");})),this.bt();}}_t(e){try{var r,n=x==null||(r=x.location)==null?void 0:r.pathname;if(!n)return;n!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=n;}catch(i){W.error("Error capturing "+e+" pageview",i);}}bt(){if(!this.ft){var e=()=>{this._t("popstate");};We(x,"popstate",e),this.ft=()=>{x&&x.removeEventListener("popstate",e);};}}},Ku=Le("[SegmentIntegration]");function zS(t,e){var r=t.config.segment;if(!r)return e();(function(n,i){var o=n.config.segment;if(!o)return i();var s=u=>{var l=()=>u.anonymousId()||Yr();n.config.get_device_id=l,u.id()&&(n.register({distinct_id:u.id(),$device_id:l()}),n.persistence.set_property(yr,"identified")),i();},a=o.user();"then"in a&&Rr(a.then)?a.then(s):s(a);})(t,(()=>{r.register((n=>{Promise&&Promise.resolve||Ku.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,s)=>{if(!s)return o;o.event.userId||o.event.anonymousId===n.get_distinct_id()||(Ku.info("No userId set, resetting PostHog"),n.reset()),o.event.userId&&o.event.userId!==n.get_distinct_id()&&(Ku.info("UserId set, identifying with PostHog"),n.identify(o.event.userId));var a=n.calculateEventProperties(s,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return {name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>true,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(t)).then((()=>{e();}));}));}var Wg="posthog-js";function Yg(t,e){var{organization:r,projectId:n,prefix:i,severityAllowList:o=["error"],sendExceptionsToPostHog:s=true}=e===void 0?{}:e;return a=>{var u,l,c,d,h;if(!(o==="*"||o.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var p=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=p,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:true}));var f=((u=a.exception)==null?void 0:u.values)||[],g=f.map((m=>Y({},m,{stacktrace:m.stacktrace?Y({},m.stacktrace,{type:"raw",frames:(m.stacktrace.frames||[]).map((y=>Y({},y,{platform:"web:javascript"})))}):void 0}))),v={$exception_message:((l=f[0])==null?void 0:l.value)||a.message,$exception_type:(c=f[0])==null?void 0:c.type,$exception_level:a.level,$exception_list:g,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=f[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(h=f[0])==null?void 0:h.type,$sentry_tags:a.tags};return r&&n&&(v.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+a.event_id),s&&t.exceptions.sendExceptionEvent(v),a}}var $l=class{constructor(e,r,n,i,o,s){this.name=Wg,this.setupOnce=function(a){a(Yg(e,{organization:r,projectId:n,prefix:i,severityAllowList:o,sendExceptionsToPostHog:s==null||s}));};}},jS=x!=null&&x.location?xs(x.location.hash,"__posthog")||xs(location.hash,"state"):null,Fp="_postHogToolbarParam
7s",$p=Le("[Toolbar]"),Wr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Wr||{}),Bl=class{constructor(e){this.instance=e;}yt(e){Z.ph_toolbar_state=e;}wt(){var e;return (e=Z.ph_toolbar_state)!==null&&e!==void 0?e:Wr.UNINITIALIZED}maybeLoadToolbar(e,r,n){if(e===void 0&&(e=void 0),r===void 0&&(r=void 0),n===void 0&&(n=void 0),xg(this.instance.config)||!x||!H)return  false;e=e!=null?e:x.location,n=n!=null?n:x.history;try{if(!r){try{x.localStorage.setItem("test","test"),x.localStorage.removeItem("test");}catch(a){return !1}r=x==null?void 0:x.localStorage;}var i,o=jS||xs(e.hash,"__posthog")||xs(e.hash,"state"),s=o?Sp((()=>JSON.parse(atob(decodeURIComponent(o)))))||Sp((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(r.getItem(Fp)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch(a){return  false}}xt(e){var r=Z.ph_load_toolbar||Z.ph_load_editor;!de(r)&&Rr(r)?r(e,this.instance):$p.warn("No toolbar load function found");}loadToolbar(e){var r=!(H==null||!H.getElementById(Mg));if(!x||r)return  false;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=Y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:false}:{});if(x.localStorage.setItem(Fp,JSON.stringify(Y({},i,{source:void 0}))),this.wt()===Wr.LOADED)this.xt(i);else if(this.wt()===Wr.UNINITIALIZED){var o;this.yt(Wr.LOADING),(o=Z.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return $p.error("[Toolbar] Failed to load",s),void this.yt(Wr.UNINITIALIZED);this.yt(Wr.LOADED),this.xt(i);})),We(x,"turbolinks:load",(()=>{this.yt(Wr.UNINITIALIZED),this.loadToolbar(i);}));}return  true}$t(e){return this.loadToolbar(e)}maybeLoadEditor(e,r,n){return e===void 0&&(e=void 0),r===void 0&&(r=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,r,n)}},HS=Le("[TracingHeaders]"),zl=class{constructor(e){this.Et=void 0,this.St=void 0,this.rt=()=>{var r,n;K(this.Et)&&((r=Z.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),K(this.St)&&((n=Z.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));},this._instance=e;}it(e){var r,n;(r=Z.__PosthogExtensions__)!=null&&r.tracingHeadersPatchFns&&e(),(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return HS.error("failed to load script",i);e();}));}startIfEnabledOrStop(){var e,r;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.Et)==null||e.call(this),(r=this.St)==null||r.call(this),this.Et=void 0,this.St=void 0);}},fs="https?://(.*)",Qn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],VS=Xn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Qn),to="<masked>",qS=["li_fat_id"];function Jg(t,e,r){if(!H)return {};var n,i=e?Xn([],Qn,r||[]):[],o=Xg(eo(H.URL,i,to),t),s=(n={},Ce(qS,(function(a){var u=wr.q(a);n[a]=u||null;})),n);return Ve(s,o)}function Xg(t,e){var r=VS.concat(e||[]),n={};return Ce(r,(function(i){var o=ks(t,i);n[i]=o||null;})),n}function Qg(t){var e=(function(o){return o?o.search(fs+"google.([^/?]*)")===0?"google":o.search(fs+"bing.com")===0?"bing":o.search(fs+"yahoo.com")===0?"yahoo":o.search(fs+"duckduckgo.com")===0?"duckduckgo":null:null})(t),r=e!="yahoo"?"q":"p",n={};if(!Zt(e)){n.$search_engine=e;var i=H?ks(H.referrer,r):"";i.length&&(n.ph_keyword=i);}return n}function Bp(){return navigator.language||navigator.userLanguage}function Zg(){return (H==null?void 0:H.referrer)||"$direct"}function ef(t,e){var r=t?Xn([],Qn,e||[]):[],n=lt==null?void 0:lt.href.substring(0,1e3);return {r:Zg().substring(0,1e3),u:n?eo(n,r,to):void 0}}function tf(t){var e,{r,u:n}=t,i={$referrer:r,$referring_domain:r==null?void 0:r=="$direct"?"$direct":(e=Ts(r))==null?void 0:e.host};
7if(n){i.$current_url=n;var o=Ts(n);i.$host=o==null?void 0:o.host,i.$pathname=o==null?void 0:o.pathname;var s=Xg(n);Ve(i,s);}if(r){var a=Qg(r);Ve(i,a);}return i}function rf(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function KS(){try{return new Date().getTimezoneOffset()}catch(t){return}}function GS(t,e){if(!Ct)return {};var r,n,i,o=t?Xn([],Qn,e||[]):[],[s,a]=(function(u){for(var l=0;l<vp.length;l++){var[c,d]=vp[l],h=c.exec(u),p=h&&(Rr(d)?d(h,u):d);if(p)return p}return ["",""]})(Ct);return Ve(yc({$os:s,$os_version:a,$browser:Pg(Ct,navigator.vendor),$device:bp(Ct),$device_type:(n=Ct,i=bp(n),i===dg||i===cg||i==="Kobo"||i==="Kindle Fire"||i===Eg?Gi:i===Yi||i===Gn||i===Ji||i===cl?"Console":i===pg?"Wearable":i?Rt:"Desktop"),$timezone:rf(),$timezone_offset:KS()}),{$current_url:eo(lt==null?void 0:lt.href,o,to),$host:lt==null?void 0:lt.host,$pathname:lt==null?void 0:lt.pathname,$raw_user_agent:Ct.length>1e3?Ct.substring(0,997)+"...":Ct,$browser_version:rS(Ct,navigator.vendor),$browser_language:Bp(),$browser_language_prefix:(r=Bp(),typeof r=="string"?r.split("-")[0]:void 0),$screen_height:x==null?void 0:x.screen.height,$screen_width:x==null?void 0:x.screen.width,$viewport_height:x==null?void 0:x.innerHeight,$viewport_width:x==null?void 0:x.innerWidth,$lib:"web",$lib_version:Dr.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var qr=Le("[Web Vitals]"),zp=9e5,jl=class{constructor(e){var r;this.kt=false,this.P=false,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((n,i)=>Y({},n,{["$web_vitals_"+i.name+"_event"]:Y({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0});},this.It=n=>{var i,o=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(true);if(K(o))qr.error("Could not read session ID. Dropping metrics!");else {this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Ct();K(s)||(de(n==null?void 0:n.name)||de(n==null?void 0:n.value)?qr.error("Invalid metric received",n):this.Rt&&n.value>=this.Rt?qr.error("Ignoring metric with value >= "+this.Rt,n):(this.N.url!==s&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),K(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=K(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.N.metrics.push(Y({},n,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()));}},this.rt=()=>{if(!this.P){var n,i,o,s,a=Z.__PosthogExtensions__;K(a)||K(a.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:i,onFCP:o,onINP:s}=a.postHogWebVitalsCallbacks),n&&i&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.It.bind(this)),this.P=true):qr.error("web vitals callbacks not loaded - not starting");}},this._instance=e,this.kt=!((r=this._instance.persistence)==null||!r.props[Ip]),this.startIfEnabled();}get allowedMetrics(){var e,r,n=et(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return de(n)?((r=this._instance.persistence)==null?void 0:r.props[Tp])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return (et(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=et(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Rt(){var e=et(this._instance.config.capture_performance)&&Br(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:zp;return 0<e&&e<=6e4?zp:e}get isEnabled(){var e=lt==null?void 0:lt.protocol;if(e!=="http:"&&e!=="https:")return qr.info("Web Vitals are disabled on non-http/https protocols"),false;var r=et(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:$r(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return $r(r)?r:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(qr.info("enabled, starting..."),this.it(this.rt));}onRemoteConfig(e){if("capturePerformance"in e){var r=et(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=et(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ip]:r}),this._instance.persistence.register({[Tp]:n})),this.kt=r,this.startIfEnabled();}}it(e){var r,n;if((r=Z.__PosthogExtensions__)!=null&&r.postHogWebVitalsCallbacks)e();else {var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,i,(o=>{o?qr.error("failed to load script",o):e();}));}}Ct(){var e=x?x.location.href:void 0;if(e){var r=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,i=r?Xn([],Qn,n||[]):[];return eo(e,i,to)}qr.error("Could not determine current URL");}},WS=Le("[Heatmaps]");function jp(t){return et(t)&&"clientX"in t&&"clientY"in t&&Br(t.clientX)&&Br(t.clientY)}var Hl=class{constructor(e){var r;this.kt=false,this.P=false,this.Ft=null,this.instance=e,this.kt=!((r=this.instance.persistence)==null||!r.props[Sl]),this.rageclicks=new As(e.config.rageclick);}get flushIntervalMilliseconds(){var e=5e3;return et(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return de(this.instance.config.capture_heatmaps)?de(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==false}startIfEnabled(){if(this.isEnabled){if(this.P)return;WS.info("starting..."),this.Ot(),this.Mt();}else {var e;clearInterval((e=this.Ft)!==null&&e!==void 0?e:void 0),this.At(),this.getAndClearBuffer();}}onRemoteConfig(e){if("heatmaps"in e){var r=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Sl]:r}),this.kt=r,this.startIfEnabled();}}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick");}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft=(function(e){return (e==null?void 0:e.visibilityState)==="visible"})(H)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null;}Ot(){x&&H&&(this.Nt=this.Lt.bind(this),We(x,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||(x==null?void 0:x.event)),We(H,"click",this.Ut,{capture:true}),this.zt=e=>this.Ht(e||(x==null?void 0:x.event)),We(H,"mousemove",this.zt,{capture:true}),this.Bt=new Os(this.instance,$S,this.jt.bind(this)),this.Bt.startIfEnabledOrStop(),this.qt=this.Mt.bind(this),We(H,"visibilitychange",this.qt),this.P=true);}At(){var e;x&&H&&(this.Nt&&x.removeEventListener("beforeunload",this.Nt),this.Ut&&H.removeEventListener("click",this.Ut,{capture:true}),this.zt&&H.removeEventListener("mousemove",this.zt,{capture:true}),this.qt&&H.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),(e=this.Bt)==null||e.stop(),this.P=false);}Gt(e,r){var n=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(a,u,l){for(var c=a;c&&Vs(c)&&!Xr(c,"body");){if(c===l)return  false;if(ce(u,x==null?void 0:x.getComputedStyle(c).position))return  true;c=Bg(c);}return  false})(Fg(e),["fixed","sticky"],o);return {x:e.clientX+(s?0:i),y:e.clientY+(s?0:n),target_fixed:s,type:r}}Dt(e,r){var n;if(r===void 0&&(r="click"),!kp(e.target)&&jp(e)){var i=this.Gt(e,r);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vt(Y({},i,{type:"rageclick"})),this.Vt(i);}}Ht(e){!kp(e.target)&&jp(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout((()=>{this.Vt(this.Gt(e,"mousemove"));}),500));}Vt(e){if(x){var r=x.location.href,n=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,o=n?Xn([],Qn,i||[]):[],s=eo(r,o,to);this.N=this.N||{},this.N[s]||(this.N[s]=[]),this.N[s].push(e);}}Lt(){this.N&&!Vn(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()});}},Ns=class{constructor(e){this.Jt=(r,n,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(W.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:r,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext());},this._instance=e,this.Yt();}Yt(){var e;this.Xt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Jt);}destroy(){var e;(e=this.Xt)==null||e.call(this),this.Xt=void 0;}doPageView(e,r){var n,i=this.Qt(e,r);return this.Kt={pathname:(n=x==null?void 0:x.location.pathname)!==null&&n!==void 0?n:"",pageViewId:r,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var r;return this.Qt(e,(r=this.Kt)==null?void 0:r.pageViewId)}doEvent(){var e;return {$pageview_id:(e=this.Kt)==null?void 0:e.pageViewId}}Qt(e,r){var n=this.Kt;if(!n)return {$pageview_id:r};var i={$pageview_id:r,$prev_pageview_id:n.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:a,maxScrollY:u,maxContentHeight:l,lastContentY:c,maxContentY:d}=o;if(!(K(s)||K(a)||K(u)||K(l)||K(c)||K(d))){s=Math.ceil(s),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d);var h=s<=1?1:Sr(a/s,0,1,W),p=s<=1?1:Sr(u/s,0,1,W),f=l<=1?1:Sr(c/l,0,1,W),g=l<=1?1:Sr(d/l,0,1,W);i=Ve(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:f,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:g});}}return n.pathname&&(i.$prev_pageview_pathname=n.pathname),n.timestamp&&(i.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),i}};var Lr=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),Ft=Uint8Array,yt=Uint16Array,Jn=Uint32Array,Ec=new Ft([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Pc=new Ft([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Hp=new Ft([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nf=function(t,e){for(var r=new yt(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new Jn(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return [r,i]},of=nf(Ec,2),YS=of[0],Vl=of[1];YS[28]=258,Vl[258]=28;for(ql=nf(Pc,0)[1],Ds=new yt(32768),Ee=0;Ee<32768;++Ee)Kr=(43690&Ee)>>>1|(21845&Ee)<<1,Kr=(61680&(Kr=(52428&Kr)>>>2|(13107&Kr)<<2))>>>4|(3855&Kr)<<4,Ds[Ee]=((65280&Kr)>>>8|(255&Kr)<<8)>>>1;var Kr,ql,Ds,Ee,Vi=function(t,e,r){for(var n=t.length,i=0,o=new yt(e);i<n;++i)++o[t[i]-1];var s,a=new yt(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;for(s=new yt(n),i=0;i<n;++i)s[i]=Ds[a[t[i]-1]++]>>>15-t[i];return s},En=new Ft(288);for(Ee=0;Ee<144;++Ee)En[Ee]=8;for(Ee=144;Ee<256;++Ee)En[Ee]=9;for(Ee=256;Ee<280;++Ee)En[Ee]=7;for(Ee=280;Ee<288;++Ee)En[Ee]=8;var Ms=new Ft(32);for(Ee=0;Ee<32;++Ee)Ms[Ee]=5;var JS=Vi(En,9),XS=Vi(Ms,5),sf=function(t){return (t/8>>
70)+(7&t&&1)},af=function(t,e,r){(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof yt?yt:t instanceof Jn?Jn:Ft)(r-e);return n.set(t.subarray(e,r)),n},Nr=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8;},xi=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16;},Gu=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return [new Ft(0),0];if(i==1){var s=new Ft(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(N,_){return N.f-_.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,c=1,d=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=i-1;)a=r[r[l].f<r[d].f?l++:d++],u=r[l!=c&&r[l].f<r[d].f?l++:d++],r[c++]={s:-1,f:a.f+u.f,l:a,r:u};var h=o[0].s;for(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var p=new yt(h+1),f=Kl(r[c-1],p,0);if(f>e){n=0;var g=0,v=f-e,m=1<<v;for(o.sort((function(N,_){return p[_.s]-p[N.s]||N.f-_.f}));n<i;++n){var y=o[n].s;if(!(p[y]>e))break;g+=m-(1<<f-p[y]),p[y]=e;}for(g>>>=v;g>0;){var T=o[n].s;p[T]<e?g-=1<<e-p[T]++-1:++n;}for(;n>=0&&g;--n){var k=o[n].s;p[k]==e&&(--p[k],++g);}f=e;}return [new Ft(p),f]},Kl=function(t,e,r){return t.s==-1?Math.max(Kl(t.l,e,r+1),Kl(t.r,e,r+1)):e[t.s]=r},Vp=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new yt(++e),n=0,i=t[0],o=1,s=function(u){r[n++]=u;},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else {if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0);}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0);}for(;o--;)s(i);o=1,i=t[a];}return [r.subarray(0,n),e]},Oi=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},Gl=function(t,e,r){var n=r.length,i=sf(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<n;++o)t[i+o+4]=r[o];return 8*(i+4+n)},qp=function(t,e,r,n,i,o,s,a,u,l,c){Nr(e,c++,r),++i[256];for(var d=Gu(i,15),h=d[0],p=d[1],f=Gu(o,15),g=f[0],v=f[1],m=Vp(h),y=m[0],T=m[1],k=Vp(g),N=k[0],_=k[1],S=new yt(19),M=0;M<y.length;++M)S[31&y[M]]++;for(M=0;M<N.length;++M)S[31&N[M]]++;for(var X=Gu(S,7),J=X[0],G=X[1],V=19;V>4&&!J[Hp[V-1]];--V);var re,ie,he,ye,Pe=l+5<<3,je=Oi(i,En)+Oi(o,Ms)+s,z=Oi(i,h)+Oi(o,g)+s+14+3*V+Oi(S,J)+(2*S[16]+3*S[17]+7*S[18]);if(Pe<=je&&Pe<=z)return Gl(e,c,t.subarray(u,u+l));if(Nr(e,c,1+(z<je)),c+=2,z<je){re=Vi(h,p),ie=h,he=Vi(g,v),ye=g;var R=Vi(J,G);for(Nr(e,c,T-257),Nr(e,c+5,_-1),Nr(e,c+10,V-4),c+=14,M=0;M<V;++M)Nr(e,c+3*M,J[Hp[M]]);c+=3*V;for(var B=[y,N],w=0;w<2;++w){var U=B[w];for(M=0;M<U.length;++M){var L=31&U[M];Nr(e,c,R[L]),c+=J[L],L>15&&(Nr(e,c,U[M]>>>5&127),c+=U[M]>>>12);}}}else re=JS,ie=En,he=XS,ye=Ms;for(M=0;M<a;++M)if(n[M]>255){L=n[M]>>>18&31,xi(e,c,re[L+257]),c+=ie[L+257],L>7&&(Nr(e,c,n[M]>>>23&31),c+=Ec[L]);var q=31&n[M];xi(e,c,he[q]),c+=ye[q],q>3&&(xi(e,c,n[M]>>>5&8191),c+=Pc[q]);}else xi(e,c,re[n[M]]),c+=ie[n[M]];return xi(e,c,re[256]),c+ie[256]},QS=new Jn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ZS=(function(){for(var t=new Jn(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r;}return t})(),e0=function(t,e,r,n,i){return (function(o,s,a,u,l,c){var d=o.length,h=new Ft(u+d+5*(1+Math.floor(d/7e3))+l),p=h.subarray(u,h.length-l),f=0;if(!s||d<8)for(var g=0;g<=d;g+=65535){var v=g+65535;v<d?f=Gl(p,f,o.subarray(g,v)):(p[g]=c,f=Gl(p,f,o.subarray(g,d)));}else {for(var m=QS[s-1],y=m>>>13,T=8191&m,k=(1<<a)-1,N=new yt(32768),_=new yt(k+1),S=Math.ceil(a/3),M=2*S,X=function(Ye){return (o[Ye]^o[Ye+1]<<S^o[Ye+2]<<M)&k},J=new Jn(25e3),G=new yt(288),V=new yt(32),re=0,ie=0,he=(g=0,0),ye=0,Pe=0;g<d;++g){var je=X(g),z=32767&g,R=_[je];if(N[z]=R,_[je]=z,ye<=g){var B=d-g;if((re>7e3||he>24576)&&B>423){f=qp(o,p,0,J,G,V,ie,he,Pe,g-Pe,f),he=re=ie=0,Pe=g;for(var w=0;w<286;++w)G[w]=0;for(w=0;w<30;++w)V[w]=0;}var U=2,L=0,q=T,ee=z-R&32767;if(B>2&&je==X(g-ee))for(var ge=Math.min(y,B)-1,Re=Math.min(32767,g),Fe=Math.min(258,B);ee<=Re&&--q&&z!=R;){if(o[g+U]==o[g+U-ee]){for(var Ie=0;Ie<Fe&&o[g+Ie]==o[g+Ie-ee];++Ie);if(Ie>U){if(U=Ie,L=ee,Ie>ge)break;var tt=Math.min(ee,Ie-2),A=0;for(w=0;w<tt;++w){var O=g-ee+w+32768&32767,$=O-N[O]+32768&32767;$>A&&(A=$,R=O);}}}ee+=(z=R)-(R=N[z])+32768&32767;}if(L){J[he++]=268435456|Vl[U]<<18|ql[L];var Q=31&Vl[U],fe=31&ql[L];ie+=Ec[Q]+Pc[fe],++G[257+Q],++V[fe],ye=g+U,++re;}else J[he++]=o[g],++G[o[g]];}}
7f=qp(o,p,c,J,G,V,ie,he,Pe,g-Pe,f);}return af(h,0,u+sf(f)+l)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,n,true)},Wu=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8;};function t0(t,e){e===void 0&&(e={});var r=(function(){var a=4294967295;return {p:function(u){for(var l=a,c=0;c<u.length;++c)l=ZS[255&l^u[c]]^l>>>8;a=l;},d:function(){return 4294967295^a}}})(),n=t.length;r.p(t);var i,o=e0(t,e,10+((i=e).filename&&i.filename.length+1||0),8),s=o.length;return (function(a,u){var l=u.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=u.level<2?4:u.level==9?2:0,a[9]=3,u.mtime!=0&&Wu(a,4,Math.floor(new Date(u.mtime||Date.now())/1e3)),l){a[3]=8;for(var c=0;c<=l.length;++c)a[c+10]=l.charCodeAt(c);}})(o,e),Wu(o,s-8,r.d()),Wu(o,s-4,n),o}var r0=function(t){var e,r,n,i,o="";for(e=r=0,n=(t=(t+"").replace(/\r\n/g,`
8`).replace(/\r/g,`
9`)).length,i=0;i<n;i++){var s=t.charCodeAt(i),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),Zt(a)||(r>e&&(o+=t.substring(e,r)),o+=a,e=r=i+1);}return r>e&&(o+=t.substring(e,t.length)),o},n0=!!il||!!nl,Kp="text/plain",Us=function(t,e,r){var n;r===void 0&&(r=true);var[i,o]=t.split("?"),s=Y({},e),a=(n=o==null?void 0:o.split("&").map((l=>{var c,[d,h]=l.split("="),p=r&&(c=s[d])!==null&&c!==void 0?c:h;return delete s[d],d+"="+p})))!==null&&n!==void 0?n:[],u=xS(s);return u&&a.push(u),i+"?"+a.join("&")},zi=(t,e)=>JSON.stringify(t,((r,n)=>typeof n=="bigint"?n.toString():n),e),Yu=t=>{var{data:e,compression:r}=t;if(e){if(r===Lr.GZipJS){var n=t0((function(u,l){var c=u.length;if(typeof TextEncoder!="undefined")return new TextEncoder().encode(u);for(var d=new Ft(u.length+(u.length>>>1)),h=0,p=function(m){d[h++]=m;},f=0;f<c;++f){if(h+5>d.length){var g=new Ft(h+8+(c-f<<1));g.set(d),d=g;}var v=u.charCodeAt(f);v<128||l?p(v):v<2048?(p(192|v>>>6),p(128|63&v)):v>55295&&v<57344?(p(240|(v=65536+(1047552&v)|1023&u.charCodeAt(++f))>>>18),p(128|v>>>12&63),p(128|v>>>6&63),p(128|63&v)):(p(224|v>>>12),p(128|v>>>6&63),p(128|63&v));}return af(d,0,h)})(zi(e)),{mtime:0}),i=new Blob([n],{type:Kp});return {contentType:Kp,body:i,estimatedSize:i.size}}if(r===Lr.Base64){var o=(function(u){var l,c,d,h,p,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,v=0,m="",y=[];if(!u)return u;u=r0(u);do l=(p=u.charCodeAt(g++)<<16|u.charCodeAt(g++)<<8|u.charCodeAt(g++))>>18&63,c=p>>12&63,d=p>>6&63,h=63&p,y[v++]=f.charAt(l)+f.charAt(c)+f.charAt(d)+f.charAt(h);while(g<u.length);switch(m=y.join(""),u.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"=";}return m})(zi(e)),s=(u=>"data="+encodeURIComponent(typeof u=="string"?u:zi(u)))(o);return {contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=zi(e);return {contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},bs=[];nl&&bs.push({transport:"fetch",method:t=>{var e,r,{contentType:n,body:i,estimatedSize:o}=(e=Yu(t))!==null&&e!==void 0?e:{},s=new Headers;Ce(t.headers,(function(c,d){s.append(d,c);})),n&&s.append("Content-Type",n);var a=t.url,u=null;if(hp){var l=new hp;u={signal:l.signal,timeout:setTimeout((()=>l.abort()),t.timeout)};}nl(a,Y({method:(t==null?void 0:t.method)||"GET",headers:s,keepalive:t.method==="POST"&&(o||0)<52428.8,body:i,signal:(r=u)==null?void 0:r.signal},t.fetchOptions)).then((c=>c.text().then((d=>{var h={statusCode:c.status,text:d};if(c.status===200)try{h.json=JSON.parse(d);}catch(p){W.error(p);}t.callback==null||t.callback(h);})))).catch((c=>{W.error(c),t.callback==null||t.callback({statusCode:0,error:c});})).finally((()=>u?clearTimeout(u.timeout):null));}}),il&&bs.push({transport:"XHR",method:t=>{var e,r=new il;r.open(t.method||"GET",t.url,true);var{contentType:n,body:i}=(e=Yu(t))!==null&&e!==void 0?e:{};Ce(t.headers,(function(o,s){r.setRequestHeader(s,o);})),n&&r.setRequestHeader("Content-Type",n),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=true),r.onreadystatechange=()=>{if(r.readyState===4){var o={statusCode:r.status,text:r.responseText};if(r.status===200)try{o.json=JSON.parse(r.responseText);}catch(s){}t.callback==null||t.callback(o);}},r.send(i);}}),It!=null&&It.sendBeacon&&bs.push({transport:"sendBeacon",method:t=>{var e=Us(t.url,{beacon:"1"});try{var r,{contentType:n,body:i}=(r=Yu(t))!==null&&r!==void 0?r:{},o=typeof i=="string"?new Blob([i],{type:n}):i;It.sendBeacon(e,o);}catch(s){}}});var Ls=function(t,e){if(!(function(r){try{new RegExp(r);}catch(n){return  false}return  true})(e))return  false;try{return new RegExp(e).test(t)}catch(r){return  false}};function Gp(t,e,r){return zi({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var uf={exact:(t,e)=>e.some((r=>t.some((n=>r===n)))),is_not:(t,e)=>e.every((r=>t.every((n=>r!==n)))),regex:(t,e)=>e.some((r=>t.some((n=>Ls(r,n))))),not_regex:(t,e)=>e.every((r=>t.every((n=>!Ls(r,n))))),icontains:(t,e)=>e.map(ms).some((r=>t.map(ms).some((n=>r.includes(n))))),not_icontains:(t,e)=>e.map(ms).every((r=>t.map(ms).every((n=>!r.includes(n))))),gt:(t,e)=>e.some((r=>{var n=parseFloat(r);return !isNaN(n)&&t.some((i=>n>parseFloat(i)))})),lt:(t,e)=>e.some((r=>{var n=parseFloat(r);return !isNaN(n)&&t.some((i=>n<parseFloat(i)))}))},ms=t=>t.toLowerCase();function lf(t,e){return !t||Object.entries(t).every((r=>{var[n,i]=r,o=e==null?void 0:e[n];if(K(o)||Zt(o))return  false;var s=[String(o)],a=uf[i.operator];return !!a&&a(i.values,s)}))}var Ju=Le("[Error tracking]"),Wl=class{constructor(e){var r,n;this.Zt=[],this.ti=new hl([new gl,new wl,new ml,new fl,new _l,new bl,new vl,
9new yl],hS()),this._instance=e,this.Zt=(r=(n=this._instance.persistence)==null?void 0:n.get_property(Cl))!==null&&r!==void 0?r:[];}onRemoteConfig(e){var r,n,i;if("errorTracking"in e){var o=(r=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&r!==void 0?r:[],s=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Zt=o,this._instance.persistence&&this._instance.persistence.register({[Cl]:this.Zt,[Pp]:s});}}get ii(){var e,r=!!this._instance.get_property(Pp),n=this._instance.config.error_tracking.captureExtensionExceptions;return (e=n!=null?n:r)!==null&&e!==void 0&&e}buildProperties(e,r){return this.ti.buildFromUnknown(e,{syntheticException:r==null?void 0:r.syntheticException,mechanism:{handled:r==null?void 0:r.handled}})}sendExceptionEvent(e){var r=e.$exception_list;if(this.ei(r)){if(this.ri(r))return void Ju.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(r))return void Ju.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(r))return void Ju.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:true,_batchKey:"exceptionEvent",oi:true})}ri(e){if(e.length===0)return  false;var r=e.reduce(((n,i)=>{var{type:o,value:s}=i;return Ge(o)&&o.length>0&&n.$exception_types.push(o),Ge(s)&&s.length>0&&n.$exception_values.push(s),n}),{$exception_types:[],$exception_values:[]});return this.Zt.some((n=>{var i=n.values.map((o=>{var s,a=uf[o.operator],u=ve(o.value)?o.value:[o.value],l=(s=r[o.key])!==null&&s!==void 0?s:[];return u.length>0&&a(u,l)}));return n.type==="OR"?i.some(Boolean):i.every(Boolean)}))}si(e){return e.flatMap((r=>{var n,i;return (n=(i=r.stacktrace)==null?void 0:i.frames)!==null&&n!==void 0?n:[]})).some((r=>r.filename&&r.filename.startsWith("chrome-extension://")))}ni(e){if(e.length>0){var r,n,i,o,s=(r=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[],a=s[s.length-1];return (i=a==null||(o=a.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&i!==void 0&&i}return  false}ei(e){return !de(e)&&ve(e)}},Pt=Le("[FeatureFlags]"),Ni=Le("[FeatureFlags]",{debugEnabled:true}),i0="errors_while_computing_flags",o0="flag_missing",s0="quota_limited",a0="timeout",u0="connection_error",l0="unknown_error",c0=t=>"api_error_"+t,Xu="$active_feature_flags",$n="$override_feature_flags",Wp="$feature_flag_payloads",Di="$override_feature_flag_payloads",Yp="$feature_flag_request_id",Jp="$feature_flag_evaluated_at",Xp=t=>{var e={};for(var[r,n]of vs(t||{}))n&&(e[r]=n);return e},d0=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((r=>{var n;return [r,(n=e[r].variant)!==null&&n!==void 0?n:e[r].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((r=>e[r].enabled)).filter((r=>{var n;return (n=e[r].metadata)==null?void 0:n.payload})).map((r=>{var n;return [r,(n=e[r].metadata)==null?void 0:n.payload]})))):Pt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},h0=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),Yl=class{constructor(e){this.ai=false,this.li=false,this.ui=false,this.hi=false,this.di=false,this.vi=false,this.ci=false,this._instance=e,this.featureFlagEventHandlers=[];}fi(){var e,r=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return !this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(Pt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=true),r!=null&&r.length?r.filter((n=>{var i=n&&typeof n=="string"&&n.trim().length>0;return i||Pt.error("Invalid evaluation context found:",n,"Expected non-empty string"),i})):[]}pi(){return this.fi().length>0}get hasLoadedFlags(){return this.li}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(El),r=this._instance.get_property($n),n=this._instance.get_property(Di);if(!n&&!r)return e||{};var i=Ve({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(r||{})])];for(var s of o){var a,u,l=i[s],c=r==null?void 0:r[s],d=K(c)?(a=l==null?void 0:l.enabled)!==null&&a!==void 0&&a:!!c,h=K(c)?l.variant:typeof c=="string"?c:void 0,p=n==null?void 0:n[s],f=Y({},l,{enabled:d,variant:d?h!=null?h:l==null?void 0:l.variant:void 0});d!==(l==null?void 0:l.enabled)&&(f.original_enabled=l==null?void 0:l.enabled),h!==(l==null?void 0:l.variant)&&(f.original_variant=l==null?void 0:l.variant),p&&(f.metadata=Y({},l==null?void 0:l.metadata,{payload:p,original_payload:l==null||(u=l.metadata)==null?void 0:u.payload})),i[s]=f;}return this.ai||(Pt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}
9),this.ai=true),i}getFlagVariants(){var e=this._instance.get_property(qn),r=this._instance.get_property($n);if(!r)return e||{};for(var n=Ve({},e),i=Object.keys(r),o=0;o<i.length;o++)n[i[o]]=r[i[o]];return this.ai||(Pt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:r,finalFlags:n}),this.ai=true),n}getFlagPayloads(){var e=this._instance.get_property(Wp),r=this._instance.get_property(Di);if(!r)return e||{};for(var n=Ve({},e||{}),i=Object.keys(r),o=0;o<i.length;o++)n[i[o]]=r[i[o]];return this.ai||(Pt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:r,finalPayloads:n}),this.ai=true),n}reloadFeatureFlags(){this.hi||this._instance.config.advanced_disable_feature_flags||this.gi||(this._instance.mi.emit("featureFlagsReloading",true),this.gi=setTimeout((()=>{this.bi();}),5));}yi(){clearTimeout(this.gi),this.gi=void 0;}ensureFlagsLoaded(){this.li||this.ui||this.gi||this.reloadFeatureFlags();}setAnonymousDistinctId(e){this.$anon_distinct_id=e;}setReloadingPaused(e){this.hi=e;}bi(e){var r;if(this.yi(),!this._instance.M())if(this.ui)this.di=true;else {var n=this._instance.config.token,i=this._instance.get_property("$device_id"),o={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Y({},((r=this._instance.persistence)==null?void 0:r.get_initial_props())||{},this._instance.get_property(Bi)||{}),group_properties:this._instance.get_property(Sn),timezone:rf()};Zt(i)||K(i)||(o.$device_id=i),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(o.disable_flags=true),this.pi()&&(o.evaluation_contexts=this.fi());var s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+s);this.ui=true,this._instance._send_request({method:"POST",url:a,data:o,compression:this._instance.config.disable_compression?void 0:Lr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:u=>{var l,c,d,h=true;if(u.statusCode===200&&(this.di||(this.$anon_distinct_id=void 0),h=false),this.ui=false,!o.disable_flags||this.di){this.vi=!h;var p=[];u.error?u.error instanceof Error?p.push(u.error.name==="AbortError"?a0:u0):p.push(l0):u.statusCode!==200&&p.push(c0(u.statusCode)),(l=u.json)!=null&&l.errorsWhileComputingFlags&&p.push(i0);var f=!((c=u.json)==null||(c=c.quotaLimited)==null||!c.includes(h0.FeatureFlags));if(f&&p.push(s0),(d=this._instance.persistence)==null||d.register({[Il]:p}),f)Pt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else {var g;o.disable_flags||this.receivedFeatureFlags((g=u.json)!==null&&g!==void 0?g:{},h),this.di&&(this.di=false,this.bi());}}}});}}getFeatureFlag(e,r){var n;if(r===void 0&&(r={}),!r.fresh||this.vi){if(this.li||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlagResult(e,r);return (n=i==null?void 0:i.variant)!==null&&n!==void 0?n:i==null?void 0:i.enabled}Pt.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`);}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var r=this.getFeatureFlagResult(e,{send_event:false});return r==null?void 0:r.payload}getFeatureFlagResult(e,r){if(r===void 0&&(r={}),!r.fresh||this.vi)if(this.li||this.getFlags()&&this.getFlags().length>0){var n=this.getFlagVariants(),i=e in n,o=n[e],s=this.getFlagPayloads()[e],a=String(o),u=this._instance.get_property(Yp)||void 0,l=this._instance.get_property(Jp)||void 0,c=this._instance.get_property(Cs)||{};if((r.send_event||!("send_event"in r))&&(!(e in c)||!c[e].includes(a))){var d,h,p,f,g,v,m,y,T,k;ve(c[e])?c[e].push(a):c[e]=[a],(d=this._instance.persistence)==null||d.register({[Cs]:c});var N=this.getFeatureFlagDetails(e),_=[...(h=this._instance.get_property(Il))!==null&&h!==void 0?h:[]];K(o)&&_.push(o0);var S={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:s||null,$feature_flag_request_id:u,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((p=this._instance.config.bootstrap)==null||(p=p.featureFlags)==null?void 0:p[e])||null,$feature_flag_bootstrapped_payload:((f=this._instance.config.bootstrap)==null||(f=f.featureFlagPayloads)==null?void 0:f[e])||null,$used_bootstrap_value:!this.vi};K(N==null||(g=N.metadata)==null?void 0:g.version)||(S.$feature_flag_version=N.metadata.version);var M,X=(v=N==null||(m=N.reason)==null?void 0:m.description)!==null&&v!==void 0?v:N==null||(y=N.reason)==null?void 0:y.code;X&&(S.$feature_flag_reason=X),N!=null&&(T=N.metadata)!=null&&T.id&&(S.$feature_flag_id=N.metadata.id),K(N==null?void 0:N.original_variant)&&K(N==null?void 0:N.original_enabled)||(S.$feature_flag_original_response=K(N.original_variant)?N.original_enabled:N.original_variant),N!=null&&(k=N.metadata)!=null&&k.original_payload&&(S.$feature_flag_original_payload=N==null||(M=N.metadata)==null?void 0:M.original_payload),_.length&&(S.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",S);}if(i){var J=s;if(!K(s))try{J=JSON.parse(s);}catch(G){}
9return {key:e,enabled:!!o,variant:typeof o=="string"?o:void 0,payload:J}}}else Pt.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`);}getRemoteConfigPayload(e,r){var n=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:n};this.pi()&&(i.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this._instance.config.disable_compression?void 0:Lr.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var s,a=(s=o.json)==null?void 0:s.featureFlagPayloads;r((a==null?void 0:a[e])||void 0);}});}isFeatureEnabled(e,r){if(r===void 0&&(r={}),!r.fresh||this.vi){if(this.li||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,r);return K(n)?void 0:!!n}Pt.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`);}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e);}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((r=>r!==e));}receivedFeatureFlags(e,r){if(this._instance.persistence){this.li=true;var n=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();((function(s,a,u,l,c){u===void 0&&(u={}),l===void 0&&(l={}),c===void 0&&(c={});var d=d0(s),h=d.flags,p=d.featureFlags,f=d.featureFlagPayloads;if(p){var g=s.requestId,v=s.evaluatedAt;if(ve(p)){Pt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var m={};if(p)for(var y=0;y<p.length;y++)m[p[y]]=true;a&&a.register({[Xu]:p,[qn]:m});}else {var T=p,k=f,N=h;if(s.errorsWhileComputingFlags)if(h){var _=new Set(Object.keys(h).filter((S=>{var M;return !((M=h[S])!=null&&M.failed)})));T=Y({},u,Object.fromEntries(Object.entries(T).filter((S=>{var[M]=S;return _.has(M)})))),k=Y({},l,Object.fromEntries(Object.entries(k||{}).filter((S=>{var[M]=S;return _.has(M)})))),N=Y({},c,Object.fromEntries(Object.entries(N||{}).filter((S=>{var[M]=S;return _.has(M)}))));}else T=Y({},u,T),k=Y({},l,k),N=Y({},c,N);a&&a.register(Y({[Xu]:Object.keys(Xp(T)),[qn]:T||{},[Wp]:k||{},[El]:N||{}},g?{[Yp]:g}:{},v?{[Jp]:v}:{}));}}}))(e,this._instance.persistence,n,i,o),this.wi(r);}}override(e,r){r===void 0&&(r=false),Pt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:r});}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Pt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===false)return this._instance.persistence.unregister($n),this._instance.persistence.unregister(Di),this.wi(),Ni.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var r,n=e;if(this.ai=!!((r=n.suppressWarning)!==null&&r!==void 0&&r),"flags"in n){if(n.flags===false)this._instance.persistence.unregister($n),Ni.info("Flag overrides cleared");else if(n.flags){if(ve(n.flags)){for(var i={},o=0;o<n.flags.length;o++)i[n.flags[o]]=true;this._instance.persistence.register({[$n]:i});}else this._instance.persistence.register({[$n]:n.flags});Ni.info("Flag overrides set",{flags:n.flags});}}return "payloads"in n&&(n.payloads===false?(this._instance.persistence.unregister(Di),Ni.info("Payload overrides cleared")):n.payloads&&(this._instance.persistence.register({[Di]:n.payloads}),Ni.info("Payload overrides set",{payloads:n.payloads}))),void this.wi()}this.wi();}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.li){var{flags:r,flagVariants:n}=this.xi();e(r,n);}return ()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,r,n){var i,o=(this._instance.get_property($i)||[]).find((l=>l.flagKey===e)),s={["$feature_enrollment/"+e]:r},a={$feature_flag:e,$feature_enrollment:r,$set:s};o&&(a.$early_access_feature_name=o.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,false);var u=Y({},this.getFlagVariants(),{[e]:r});(i=this._instance.persistence)==null||i.register({[Xu]:Object.keys(Xp(u)),[qn]:u}),this.wi();}getEarlyAccessFeatures(e,r,n){r===void 0&&(r=false);var i=this._instance.get_property($i),o=n?"&"+n.map((s=>"stage="+s)).join("&"):"";if(i&&!r)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,u;if(s.json){var l=s.json.earlyAccessFeatures;return (a=this._instance.persistence)==null||a.unregister($i),(u=this._instance.persistence)==null||u.register({[$i]:l}),e(l)}}});}xi(){var e=this.getFlags(),r=this.getFlagVariants();return {flags:e.filter((n=>r[n])),flagVariants:Object.keys(r).filter((n=>r[n])).reduce(((n,i)=>(n[i]=r[i],n)),{})}}wi(e){var{flags:r,flagVariants:n}=this.xi();
9this.featureFlagEventHandlers.forEach((i=>i(r,n,{errorsLoading:e})));}setPersonPropertiesForFlags(e,r){r===void 0&&(r=true);var n=this._instance.get_property(Bi)||{};this._instance.register({[Bi]:Y({},n,e)}),r&&this._instance.reloadFeatureFlags();}resetPersonPropertiesForFlags(){this._instance.unregister(Bi);}setGroupPropertiesForFlags(e,r){r===void 0&&(r=true);var n=this._instance.get_property(Sn)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((i=>{n[i]=Y({},n[i],e[i]),delete e[i];})),this._instance.register({[Sn]:Y({},n,e)}),r&&this._instance.reloadFeatureFlags();}resetGroupPropertiesForFlags(e){if(e){var r=this._instance.get_property(Sn)||{};this._instance.register({[Sn]:Y({},r,{[e]:{}})});}else this._instance.unregister(Sn);}reset(){this.li=false,this.ui=false,this.hi=false,this.di=false,this.vi=false,this.$anon_distinct_id=void 0,this.yi(),this.ai=false;}},p0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],qi=class{constructor(e,r){this.R=e,this.props={},this.$i=false,this.Ei=(n=>{var i="";return n.token&&(i=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.Si(e),this.load(),e.debug&&W.info("Persistence loaded",e.persistence,Y({},this.props)),this.update_config(e,e,r),this.save();}isDisabled(){return !!this.ki}Si(e){p0.indexOf(e.persistence.toLowerCase())===-1&&(W.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var r=(function(i){i===void 0&&(i=[]);var o=[...RS,...i];return Y({},Ue,{W:function(s){try{var a={};try{a=wr.W(s)||{};}catch(l){}var u=Ve(a,JSON.parse(Ue.q(s)||"{}"));return Ue.G(s,u),u}catch(l){}return null},G:function(s,a,u,l,c,d){try{Ue.G(s,a,void 0,void 0,d);var h={};o.forEach((p=>{a[p]&&(h[p]=a[p]);})),Object.keys(h).length&&wr.G(s,h,u,l,c,d);}catch(p){Ue.B(p);}},V:function(s,a){try{x==null||x.localStorage.removeItem(s),wr.V(s,a);}catch(u){Ue.B(u);}}})})(e.cookie_persisted_properties||[]),n=e.persistence.toLowerCase();return n==="localstorage"&&Ue.H()?Ue:n==="localstorage+cookie"&&r.H()?r:n==="sessionstorage"&&ut.H()?ut:n==="memory"?FS:n==="cookie"?wr:r.H()?r:wr}properties(){var e={};return Ce(this.props,(function(r,n){if(n===qn&&et(r))for(var i=Object.keys(r),o=0;o<i.length;o++)e["$feature/"+i[o]]=r[i[o]];else a=n,u=false,(Zt(s=yS)?u:dp&&s.indexOf===dp?s.indexOf(a)!=-1:(Ce(s,(function(l){if(u||(u=l===a))return ws})),u))||(e[n]=r);var s,a,u;})),e}load(){if(!this.ki){var e=this.Y.W(this.Ei);e&&(this.props=Ve({},e));}}save(){this.ki||this.Y.G(this.Ei,this.props,this.Pi,this.Ti,this.Ii,this.R.debug);}remove(){this.Y.V(this.Ei,false),this.Y.V(this.Ei,true);}clear(){this.remove(),this.props={};}register_once(e,r,n){if(et(e)){K(r)&&(r="None"),this.Pi=K(n)?this.Ci:n;var i=false;if(Ce(e,((o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==r||(this.props[s]=o,i=true);})),i)return this.save(),true}return  false}register(e,r){if(et(e)){this.Pi=K(r)?this.Ci:r;var n=false;if(Ce(e,((i,o)=>{e.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,n=true);})),n)return this.save(),true}return  false}unregister(e){e in this.props&&(delete this.props[e],this.save());}update_campaign_params(){if(!this.$i){var e=Jg(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);Vn(yc(e))||this.register(e),this.$i=true;}}update_search_keyword(){var e;this.register((e=H==null?void 0:H.referrer)?Qg(e):{});}update_referrer_info(){var e;this.register_once({$referrer:Zg(),$referring_domain:H!=null&&H.referrer&&((e=Ts(H.referrer))==null?void 0:e.host)||"$direct"},void 0);}set_initial_person_info(){this.props[kl]||this.props[xl]||this.register_once({[Es]:ef(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0);}get_initial_props(){var e={};Ce([xl,kl],(s=>{var a=this.props[s];a&&Ce(a,(function(u,l){e["$initial_"+ol(l)]=u;}));}));var r,n,i=this.props[Es];if(i){var o=(r=tf(i),n={},Ce(r,(function(s,a){n["$initial_"+ol(a)]=s;})),n);Ve(e,o);}return e}
9safe_merge(e){return Ce(this.props,(function(r,n){n in e||(e[n]=r);})),e}update_config(e,r,n){if(this.Ci=this.Pi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==r.persistence||!((s,a)=>{if(s.length!==a.length)return  false;var u=[...s].sort(),l=[...a].sort();return u.every(((c,d)=>c===l[d]))})(e.cookie_persisted_properties||[],r.cookie_persisted_properties||[])){var i=this.Si(e),o=this.props;this.clear(),this.Y=i,this.props=o,this.save();}}set_disabled(e){this.ki=e,this.ki?this.remove():this.save();}set_cross_subdomain(e){e!==this.Ti&&(this.Ti=e,this.remove(),this.save());}set_secure(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save());}set_event_timer(e,r){var n=this.props[Fi]||{};n[e]=r,this.props[Fi]=n,this.save();}remove_event_timer(e){var r=(this.props[Fi]||{})[e];return K(r)||(delete this.props[Fi][e],this.save()),r}get_property(e){return this.props[e]}set_property(e,r){this.props[e]=r,this.save();}},Qp=Le("[Product Tours]"),Qu="ph_product_tours",Jl=class{constructor(e){this.Ri=null,this.Fi=null,this._instance=e;}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[Ap]:!!e.productTours}),this.loadIfEnabled());}loadIfEnabled(){var e,r;this.Ri||(e=this._instance).config.disable_product_tours||(r=e.persistence)==null||!r.get_property(Ap)||this.it((()=>this.Oi()));}it(e){var r,n;(r=Z.__PosthogExtensions__)!=null&&r.generateProductTours?e():(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(i=>{i?Qp.error("Could not load product tours script",i):e();}));}Oi(){var e;!this.Ri&&(e=Z.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ri=Z.__PosthogExtensions__.generateProductTours(this._instance,true));}getProductTours(e,r){if(r===void 0&&(r=false),!ve(this.Fi)||r){var n=this._instance.persistence;if(n){var i=n.props[Qu];if(ve(i)&&!r)return this.Fi=i,void e(i,{isLoaded:true})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:o=>{var s=o.statusCode;if(s!==200||!o.json){var a="Product Tours API could not be loaded, status: "+s;return Qp.error(a),void e([],{isLoaded:false,error:a})}var u=ve(o.json.product_tours)?o.json.product_tours:[];this.Fi=u,n&&n.register({[Qu]:u}),e(u,{isLoaded:true});}});}else e(this.Fi,{isLoaded:true});}getActiveProductTours(e){de(this.Ri)?e([],{isLoaded:false,error:"Product tours not loaded"}):this.Ri.getActiveProductTours(e);}showProductTour(e){var r;(r=this.Ri)==null||r.showTourById(e);}previewTour(e){this.Ri?this.Ri.previewTour(e):this.it((()=>{var r;this.Oi(),(r=this.Ri)==null||r.previewTour(e);}));}dismissProductTour(){var e;(e=this.Ri)==null||e.dismissTour("user_clicked_skip");}nextStep(){var e;(e=this.Ri)==null||e.nextStep();}previousStep(){var e;(e=this.Ri)==null||e.previousStep();}clearCache(){var e;this.Fi=null,(e=this._instance.persistence)==null||e.unregister(Qu);}resetTour(e){var r;(r=this.Ri)==null||r.resetTour(e);}resetAllTours(){var e;(e=this.Ri)==null||e.resetAllTours();}cancelPendingTour(e){var r;(r=this.Ri)==null||r.cancelPendingTour(e);}},Mi=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({});((function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}))({});((function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}))({});((function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}))({});var Zu=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({});((function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}))({});((function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}))({});((function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}))({});var ji=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t})({}),el=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_
9START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t})({}),Xl=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),Se=Le("[Surveys]"),cf="seenSurvey_",g0=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},Zp=t=>((e,r)=>{var n=""+e+r.id;return r.current_iteration&&r.current_iteration>0&&(n=""+e+r.id+"_"+r.current_iteration),n})(cf,t),f0=[Zu.Popover,Zu.Widget,Zu.API],m0={ignoreConditions:false,ignoreDelay:false,displayType:Xl.Popover},Qi=class{constructor(){this.Mi={},this.Mi={};}on(e,r){return this.Mi[e]||(this.Mi[e]=[]),this.Mi[e].push(r),()=>{this.Mi[e]=this.Mi[e].filter((n=>n!==r));}}emit(e,r){for(var n of this.Mi[e]||[])n(r);for(var i of this.Mi["*"]||[])i(e,r);}};function Bn(t,e,r){if(de(t))return  false;switch(r){case "exact":return t===e;case "contains":var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t);case "regex":try{return new RegExp(e).test(t)}catch(i){return  false}default:return  false}}var Ql=class{constructor(e){this.Ai=new Qi,this.ji=(r,n)=>this.Di(r,n)&&this.Li(r,n)&&this.Ni(r,n)&&this.Ui(r,n),this.Di=(r,n)=>n==null||!n.event||(r==null?void 0:r.event)===(n==null?void 0:n.event),this._instance=e,this.zi=new Set,this.Hi=new Set;}init(){var e;if(!K((e=this._instance)==null?void 0:e._addCaptureHook)){var r;(r=this._instance)==null||r._addCaptureHook(((n,i)=>{this.on(n,i);}));}}register(e){var r,n;if(!K((r=this._instance)==null?void 0:r._addCaptureHook)&&(e.forEach((s=>{var a,u;(a=this.Hi)==null||a.add(s),(u=s.steps)==null||u.forEach((l=>{var c;(c=this.zi)==null||c.add((l==null?void 0:l.event)||"");}));})),(n=this._instance)!=null&&n.autocapture)){var i,o=new Set;e.forEach((s=>{var a;(a=s.steps)==null||a.forEach((u=>{u!=null&&u.selector&&o.add(u==null?void 0:u.selector);}));})),(i=this._instance)==null||i.autocapture.setElementSelectors(o);}}on(e,r){var n;r!=null&&e.length!=0&&(this.zi.has(e)||this.zi.has(r==null?void 0:r.event))&&this.Hi&&((n=this.Hi)==null?void 0:n.size)>0&&this.Hi.forEach((i=>{this.Bi(r,i)&&this.Ai.emit("actionCaptured",i.name);}));}qi(e){this.onAction("actionCaptured",(r=>e(r)));}Bi(e,r){if((r==null?void 0:r.steps)==null)return  false;for(var n of r.steps)if(this.ji(e,n))return  true;return  false}onAction(e,r){return this.Ai.on(e,r)}Li(e,r){if(r!=null&&r.url){var n,i=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!i||typeof i!="string"||!Bn(i,r.url,r.url_matching||"contains"))return  false}return  true}Ni(e,r){return !!this.Wi(e,r)&&!!this.Gi(e,r)&&!!this.Vi(e,r)}Wi(e,r){var n;if(r==null||!r.href)return  true;var i=this.Ji(e);if(i.length>0)return i.some((a=>Bn(a.href,r.href,r.href_matching||"exact")));var o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return !!s&&Bn((o=s.match(/(?::|")href="(.*?)"/))?o[1]:"",r.href,r.href_matching||"exact")}Gi(e,r){var n;if(r==null||!r.text)return  true;var i=this.Ji(e);if(i.length>0)return i.some((l=>Bn(l.text,r.text,r.text_matching||"exact")||Bn(l.$el_text,r.text,r.text_matching||"exact")));var o,s,a,u=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";return !!u&&(o=(function(l){for(var c,d=[],h=/(?::|")text="(.*?)"/g;!de(c=h.exec(l));)d.includes(c[1])||d.push(c[1]);return d})(u),s=r.text,a=r.text_matching||"exact",o.some((l=>Bn(l,s,a))))}Vi(e,r){var n,i;if(r==null||!r.selector)return  true;var o=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(o!=null&&o.includes(r.selector))return  true;var s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(r.selector_regex&&s)try{return new RegExp(r.selector_regex).test(s)}catch(a){return  false}return  false}Ji(e){var r;return (e==null||(r=e.properties)==null?void 0:r.$elements)==null?[]:e==null?void 0:e.properties.$elements}Ui(e,r){return r==null||!r.properties||r.properties.length===0||lf(r.properties.reduce(((n,i)=>{var o=ve(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return n[i.key]={values:o,operator:i.operator||"exact"},n}),{}),e==null?void 0:e.properties)}},Zl=class{constructor(e){this._instance=e,this.Ki=new Map,this.Yi=new Map,this.Xi=new Map;}Qi(e,r){return !!e&&lf(e.propertyFilters,r==null?void 0:r.properties)}Zi(e,r){var n=new Map;return e.forEach((i=>{var o;(o=i.conditions)==null||(o=o[r])==null||(o=o.values)==null||o.forEach((s=>{if(s!=null&&s.name){var a=n.get(s.name)||[];a.push(i.id),n.set(s.name,a);}}));})),n}te(e,r,n){var i=(n===Mi.Activation?this.Ki:this.Yi).get(e),o=[];return this.ie((s=>{o=s.filter((a=>i==null?void 0:i.includes(a.id)));})),o.filter((s=>{var a,u=(a=s.conditions)==null||(a=a[n])==null||(a=a.values)==null?void 0:a.find((l=>l.name===e));return this.Qi(u,r)}))}register(e){var r;K((r=this._instance)==null?void 0:r._addCaptureHook)||(this.ee(e),this.re(e));}re(e){var r=e.filter((n=>{var i,o;return ((i=n.conditions)==null?void 0:i.actions)&&((o=n.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));r.length!==0&&(this.se==null&&(this.se=new Ql(this._instance),this.se.init(),this.se.qi((n=>{this.onAction(n);}))),r.forEach((n=>{var i,o,s,a,u;
9n.conditions&&(i=n.conditions)!=null&&i.actions&&(o=n.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=n.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.se)==null||a.register(n.conditions.actions.values),(u=n.conditions)==null||(u=u.actions)==null||(u=u.values)==null||u.forEach((l=>{if(l&&l.name){var c=this.Xi.get(l.name);c&&c.push(n.id),this.Xi.set(l.name,c||[n.id]);}})));})));}ee(e){var r,n=e.filter((o=>{var s,a;return ((s=o.conditions)==null?void 0:s.events)&&((a=o.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),i=e.filter((o=>{var s,a;return ((s=o.conditions)==null?void 0:s.cancelEvents)&&((a=o.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));(n.length!==0||i.length!==0)&&((r=this._instance)==null||r._addCaptureHook(((o,s)=>{this.onEvent(o,s);})),this.Ki=this.Zi(e,Mi.Activation),this.Yi=this.Zi(e,Mi.Cancellation));}onEvent(e,r){var n,i=this.ne(),o=this.oe(),s=this.ae(),a=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[o])||[];if(s===e&&r&&a.length>0){var u,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:r,existingActivatedItems:a});var c=(r==null||(u=r.properties)==null?void 0:u.$survey_id)||(r==null||(l=r.properties)==null?void 0:l.$product_tour_id);if(c){var d=a.indexOf(c);d>=0&&(a.splice(d,1),this.le(a));}}else {if(this.Yi.has(e)){var h=this.te(e,r,Mi.Cancellation);h.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map((f=>f.id))}),h.forEach((f=>{var g=a.indexOf(f.id);g>=0&&a.splice(g,1),this.ue(f.id);})),this.le(a));}if(this.Ki.has(e)){i.info("event name matched",{event:e,eventPayload:r,items:this.Ki.get(e)});var p=this.te(e,r,Mi.Activation);this.le(a.concat(p.map((f=>f.id))||[]));}}}onAction(e){var r,n=this.oe(),i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[n])||[];this.Xi.has(e)&&this.le(i.concat(this.Xi.get(e)||[]));}le(e){var r,n=this.ne(),i=this.oe(),o=[...new Set(e)].filter((s=>!this.he(s)));n.info("updating activated items",{activatedItems:o}),(r=this._instance)==null||(r=r.persistence)==null||r.register({[i]:o});}getActivatedIds(){var e,r=this.oe(),n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[r];return n||[]}getEventToItemsMap(){return this.Ki}de(){return this.se}},ec=class extends Zl{constructor(e){super(e);}oe(){return "$surveys_activated"}ae(){return ji.SHOWN}ie(e){var r;(r=this._instance)==null||r.getSurveys(e);}ue(e){var r;(r=this._instance)==null||r.cancelPendingSurvey(e);}ne(){return Se}he(){return  false}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},tc=class{constructor(e){this.ve=void 0,this._surveyManager=null,this.ce=false,this.fe=[],this.pe=null,this._instance=e,this._surveyEventReceiver=null;}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var r=e.surveys;if(de(r))return Se.warn("Flags not loaded yet. Not loading surveys.");var n=ve(r);this.ve=n?r.length>0:r,Se.info("flags response received, isSurveysEnabled: "+this.ve),this.loadIfEnabled();}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],r=0;r<localStorage.length;r++){var n=localStorage.key(r);(n!=null&&n.startsWith(cf)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n);}e.forEach((i=>localStorage.removeItem(i)));}loadIfEnabled(){if(!this._surveyManager)if(this.ce)Se.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Se.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Se.info("Not loading surveys in cookieless mode without consent.");else {var e=Z==null?void 0:Z.__PosthogExtensions__;if(e){if(!K(this.ve)||this._instance.config.advanced_enable_surveys){var r=this.ve||this._instance.config.advanced_enable_surveys;this.ce=true;try{var n=e.generateSurveys;if(n)return void this._e(n,r);var i=e.loadExternalDependency;if(!i)return void this.ge("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.ge("Could not load surveys script",o):this._e(e.generateSurveys,r);}));}catch(o){throw this.ge("Error initializing surveys",o),o}finally{this.ce=false;}}}else Se.error("PostHog Extensions not found.");}}_e(e,r){this._surveyManager=e(this._instance,r),this._surveyEventReceiver=new ec(this._instance),Se.info("Surveys loaded successfully"),this.me({isLoaded:true});}ge(e,r){Se.error(e,r),this.me({isLoaded:false,error:e});}onSurveysLoaded(e){return this.fe.push(e),this._surveyManager&&this.me({isLoaded:true}),()=>{this.fe=this.fe.filter((r=>r!==e));}}getSurveys(e,r){if(r===void 0&&(r=false),this._instance.config.disable_surveys)return Se.info("Disabled. Not loading surveys."),e([]);var n,i=this._instance.get_property(Pl);if(i&&!r)return e(i,{isLoaded:true});typeof Promise!="undefined"&&this.pe?this.pe.then((o=>{var{surveys:s,context:a}=o;return e(s,a)})):(typeof Promise!="undefined"&&(this.pe=new Promise((o=>{n=o;}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:o=>{var s;this.pe=null;var a=o.statusCode;if(a!==200||!o.json){var u="Surveys API could not be loaded, status: "+a;Se.error(u);var l={isLoaded:false,error:u};return e([],l),void(n==null||n({surveys:[],context:l}))}var c,d=o.json.surveys||[],h=d.filter((f=>(function(g){return !(!g.start_date||g.end_date)})(f)&&((function(g){var v;return !((v=g.conditions)==null||(v=v.events)==null||(v=v.values)==null||!v.length)})(f)||(function(g){var v;return !((v=g.conditions)==null||(v=v.actions)==null||(v=v.values)==null||!v.length)})(f))));h.length>0&&((c=this._surveyEventReceiver)==null||c.register(h)),(s=this._instance.persistence)==null||s.register({[Pl]:d});var p={isLoaded:true};e(d,p),n==null||n({surveys:d,context:p});}}));}me(e){for(var r of this.fe)try{if(!e.isLoaded)return r([],e);
9this.getSurveys(r);}catch(n){Se.error("Error in survey callback",n);}}getActiveMatchingSurveys(e,r){if(r===void 0&&(r=false),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,r);Se.warn("init was not called");}be(e){var r=null;return this.getSurveys((n=>{var i;r=(i=n.find((o=>o.id===e)))!==null&&i!==void 0?i:null;})),r}ye(e){if(de(this._surveyManager))return {eligible:false,reason:"SDK is not enabled or survey functionality is not yet loaded"};var r=typeof e=="string"?this.be(e):e;return r?this._surveyManager.checkSurveyEligibility(r):{eligible:false,reason:"Survey not found"}}canRenderSurvey(e){if(de(this._surveyManager))return Se.warn("init was not called"),{visible:false,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var r=this.ye(e);return {visible:r.eligible,disabledReason:r.reason}}canRenderSurveyAsync(e,r){return de(this._surveyManager)?(Se.warn("init was not called"),Promise.resolve({visible:false,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((n=>{this.getSurveys((i=>{var o,s=(o=i.find((u=>u.id===e)))!==null&&o!==void 0?o:null;if(s){var a=this.ye(s);n({visible:a.eligible,disabledReason:a.reason});}else n({visible:false,disabledReason:"Survey not found"});}),r);}))}renderSurvey(e,r,n){var i;if(de(this._surveyManager))Se.warn("init was not called");else {var o=typeof e=="string"?this.be(e):e;if(o!=null&&o.id)if(f0.includes(o.type)){var s=H==null?void 0:H.querySelector(r);if(s)return (i=o.appearance)!=null&&i.surveyPopupDelaySeconds?(Se.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;Se.info("Rendering survey "+o.id+" with delay of "+((a=o.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.render
9Survey(o,s,n),Se.info("Survey "+o.id+" rendered");}),1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,s,n);Se.warn("Survey element not found");}else Se.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Se.warn("Survey not found");}}displaySurvey(e,r){var n;if(de(this._surveyManager))Se.warn("init was not called");else {var i=this.be(e);if(i){var o=i;if((n=i.appearance)!=null&&n.surveyPopupDelaySeconds&&r.ignoreDelay&&(o=Y({},i,{appearance:Y({},i.appearance,{surveyPopupDelaySeconds:0})})),r.displayType!==Xl.Popover&&r.initialResponses&&Se.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),r.ignoreConditions===false){var s=this.canRenderSurvey(i);if(!s.visible)return void Se.warn("Survey is not eligible to be displayed: ",s.disabledReason)}r.displayType!==Xl.Inline?this._surveyManager.handlePopoverSurvey(o,r):this.renderSurvey(o,r.selector,r.properties);}else Se.warn("Survey not found");}}cancelPendingSurvey(e){de(this._surveyManager)?Se.warn("init was not called"):this._surveyManager.cancelSurvey(e);}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload();}},Lt=Le("[Conversations]"),rc=class{constructor(e){this.we=void 0,this._conversationsManager=null,this.xe=false,this.$e=null,this._instance=e;}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var r=e.conversations;de(r)||($r(r)?this.we=r:(this.we=r.enabled,this.$e=r),this.loadIfEnabled());}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.we=void 0,this.$e=null;}loadIfEnabled(){if(!(this._conversationsManager||this.xe||this._instance.config.disable_conversations||xg(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=Z==null?void 0:Z.__PosthogExtensions__;if(e&&!K(this.we)&&this.we)if(this.$e&&this.$e.token){this.xe=true;try{var r=e.initConversations;if(r)return this.Ee(r),void(this.xe=!1);var n=e.loadExternalDependency;if(!n)return void this.Se("PostHog loadExternalDependency extension not found.");n(this._instance,"conversations",(i=>{i||!e.initConversations?this.Se("Could not load conversations script",i):this.Ee(e.initConversations),this.xe=!1;}));}catch(i){this.Se("Error initializing conversations",i),this.xe=false;}}else Lt.error("Conversations enabled but missing token in remote config.");}}Ee(e){if(this.$e)try{this._conversationsManager=e(this.$e,this._instance),Lt.info("Conversations loaded successfully");}catch(r){this.Se("Error completing conversations initialization",r);}else Lt.error("Cannot complete initialization: remote config is null");}Se(e,r){Lt.error(e,r),this._conversationsManager=null,this.xe=false;}show(){this._conversationsManager?this._conversationsManager.show():Lt.warn("Conversations not loaded yet.");}hide(){this._conversationsManager&&this._conversationsManager.hide();}isAvailable(){return this.we===true&&!Zt(this._conversationsManager)}isVisible(){var e,r;return (e=(r=this._conversationsManager)==null?void 0:r.isVisible())!==null&&e!==void 0&&e}sendMessage(e,r,n){var i=this;return Mr((function*(){return i._conversationsManager?i._conversationsManager.sendMessage(e,r,n):(Lt.warn("Conversations not available yet."),null)}))()}getMessages(e,r){var n=this;return Mr((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,r):(Lt.warn("Conversations not available yet."),null)}))()}markAsRead(e){var r=this;return Mr((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Lt.warn("Conversations not available yet."),null)}))()}getTickets(e){var r=this;return Mr((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Lt.warn("Conversations not available yet."),null)}))()}requestRestoreLink(e){var r=this;return Mr((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(Lt.warn("Conversations not available yet."),null)}))()}restoreFromToken(e){var r=this;return Mr((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(Lt.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var e=this;return Mr((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Lt.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,r;return (e=(r=this._conversationsManager)==null?void 0:r.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,r;
9return (e=(r=this._conversationsManager)==null?void 0:r.getWidgetSessionId())!==null&&e!==void 0?e:null}},nc=class{constructor(e){var r;this.ke=false,this.Pe=false,this._instance=e,this._instance&&(r=this._instance.config.logs)!=null&&r.captureConsoleLogs&&(this.ke=true);}onRemoteConfig(e){var r,n=(r=e.logs)==null?void 0:r.captureConsoleLogs;!de(n)&&n&&(this.ke=true,this.loadIfEnabled());}reset(){}loadIfEnabled(){if(this.ke&&!this.Pe){var e=Le("[logs]"),r=Z==null?void 0:Z.__PosthogExtensions__;if(r){var n=r.loadExternalDependency;n?n(this._instance,"logs",(i=>{var o;i||(o=r.logs)==null||!o.initializeLogs?e.error("Could not load logs script",i):(r.logs.initializeLogs(this._instance),this.Pe=true);})):e.error("PostHog loadExternalDependency extension not found.");}else e.error("PostHog Extensions not found.");}}},eg=Le("[RateLimiter]"),ic=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=false,this.checkForLimiting=r=>{var n=r.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((i=>{eg.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4;}));}catch(i){return void eg.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:n})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(true).isRateLimited;}get captureEventsPerSecond(){var e;return ((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var r,n,i;e===void 0&&(e=false);var{captureEventsBurstLimit:o,captureEventsPerSecond:s}=this,a=new Date().getTime(),u=(r=(n=this.instance.persistence)==null?void 0:n.get_property(Tl))!==null&&r!==void 0?r:{tokens:o,last:a};u.tokens+=(a-u.last)/1e3*s,u.last=a,u.tokens>o&&(u.tokens=o);var l=u.tokens<1;return l||e||(u.tokens=Math.max(0,u.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+o+" events burst limit."},{skip_client_rate_limiting:true}),this.lastEventRateLimited=l,(i=this.instance.persistence)==null||i.set_property(Tl,u),{isRateLimited:l,remainingTokens:u.tokens}}isServerRateLimited(e){var r=this.serverLimits[e||"events"]||false;return r!==false&&new Date().getTime()<r}},Ui=Le("[RemoteConfig]"),Rs=class{constructor(e){this._instance=e;}get remoteConfig(){var e;return (e=Z._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Te(e){var r,n;(r=Z.__PosthogExtensions__)!=null&&r.loadExternalDependency?(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e();}Ie(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:r=>{e(r.json);}});}load(){try{if(this.remoteConfig)return Ui.info("Using preloaded remote config",this.remoteConfig),this.Ce(this.remoteConfig),void this.Re();if(this._instance.M())return void Ui.warn("Remote config is disabled. Falling back to local config.");this.Te((e=>{if(!e)return Ui.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ie((r=>{this.Ce(r),this.Re();}));this.Ce(e),this.Re();}));}catch(e){Ui.error("Error loading remote config",e);}}stop(){this.Fe&&(clearInterval(this.Fe),this.Fe=void 0);}refresh(){this._instance.M()||(H==null?void 0:H.visibilityState)==="hidden"||this._instance.featureFlags.reloadFeatureFlags();}Re(){this.Fe||(this.Fe=setInterval((()=>{this.refresh();}),3e5));}Ce(e){e||Ui.error("Failed to fetch remote config from PostHog."),this._instance.Ce(e!=null?e:{}),(e==null?void 0:e.hasFeatureFlags)!==false&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded());}},oc=3e3,sc=class{constructor(e,r){this.Oe=true,this.Me=[],this.Ae=Sr((r==null?void 0:r.flush_interval_ms)||oc,250,5e3,W.createLogger("flush interval"),oc),this.je=e;}enqueue(e){this.Me.push(e),this.De||this.Le();}unload(){this.Ne();var e=this.Me.length>0?this.Ue():{},r=Object.values(e);[...r.filter((n=>n.url.indexOf("/e")===0)),...r.filter((n=>n.url.indexOf("/e")!==0))].map((n=>{this.je(Y({},n,{transport:"sendBeacon"}));}));}enable(){this.Oe=false,this.Le();}Le(){var e=this;this.Oe||(this.De=setTimeout((()=>
9{if(this.Ne(),this.Me.length>0){var r=this.Ue(),n=function(){var o=r[i],s=new Date().getTime();o.data&&ve(o.data)&&Ce(o.data,(a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp;})),e.je(o);};for(var i in r)n();}}),this.Ae));}Ne(){clearTimeout(this.De),this.De=void 0;}Ue(){var e={};return Ce(this.Me,(r=>{var n,i=r,o=(i?i.batchKey:null)||i.url;K(e[o])&&(e[o]=Y({},i,{data:[]})),(n=e[o].data)==null||n.push(i.data);})),this.Me=[],e}},v0=["retriesPerformedSoFar"],ac=class{constructor(e){this.ze=false,this.He=3e3,this.Me=[],this._instance=e,this.Me=[],this.Be=true,!K(x)&&"onLine"in x.navigator&&(this.Be=x.navigator.onLine,this.qe=()=>{this.Be=true,this.Lt();},this.We=()=>{this.Be=false;},We(x,"online",this.qe),We(x,"offline",this.We));}get length(){return this.Me.length}retriableRequest(e){var{retriesPerformedSoFar:r}=e,n=sg(e,v0);jn(r)&&(n.url=Us(n.url,{retry_count:r})),this._instance._send_request(Y({},n,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(r!=null?r:0)<10?this.Ge(Y({retriesPerformedSoFar:r},n)):n.callback==null||n.callback(i);}}));}Ge(e){var r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(function(s){var a=3e3*Math.pow(2,s),u=a/2,l=Math.min(18e5,a),c=(Math.random()-.5)*(l-u);return Math.ceil(l+c)})(r),i=Date.now()+n;this.Me.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),W.warn(o),this.ze||(this.ze=true,this.Ve());}Ve(){if(this.Je&&clearTimeout(this.Je),this.Me.length===0)return this.ze=false,void(this.Je=void 0);this.Je=setTimeout((()=>{this.Be&&this.Me.length>0&&this.Lt(),this.Ve();}),this.He);}Lt(){var e=Date.now(),r=[],n=this.Me.filter((o=>o.retryAt<e||(r.push(o),false)));if(this.Me=r,n.length>0)for(var{requestOptions:i}of n)this.retriableRequest(i);}unload(){for(var{requestOptions:e}of(this.Je&&(clearTimeout(this.Je),this.Je=void 0),this.ze=false,K(x)||(this.qe&&(x.removeEventListener("online",this.qe),this.qe=void 0),this.We&&(x.removeEventListener("offline",this.We),this.We=void 0)),this.Me))try{this._instance._send_request(Y({},e,{transport:"sendBeacon"}));}catch(r){W.error(r);}this.Me=[];}},uc=class{constructor(e){this.Ke=()=>{var r,n,i,o;this.Ye||(this.Ye={});var s=this.scrollElement(),a=this.scrollY(),u=s?Math.max(0,s.scrollHeight-s.clientHeight):0,l=a+((s==null?void 0:s.clientHeight)||0),c=(s==null?void 0:s.scrollHeight)||0;this.Ye.lastScrollY=Math.ceil(a),this.Ye.maxScrollY=Math.max(a,(r=this.Ye.maxScrollY)!==null&&r!==void 0?r:0),this.Ye.maxScrollHeight=Math.max(u,(n=this.Ye.maxScrollHeight)!==null&&n!==void 0?n:0),this.Ye.lastContentY=l,this.Ye.maxContentY=Math.max(l,(i=this.Ye.maxContentY)!==null&&i!==void 0?i:0),this.Ye.maxContentHeight=Math.max(c,(o=this.Ye.maxContentHeight)!==null&&o!==void 0?o:0);},this._instance=e;}getContext(){return this.Ye}resetContext(){var e=this.Ye;return setTimeout(this.Ke,0),e}startMeasuringScrollPosition(){We(x,"scroll",this.Ke,{capture:true}),We(x,"scrollend",this.Ke,{capture:true}),We(x,"resize",this.Ke);}scrollElement(){if(!this._instance.config.scroll_root_selector)return x==null?void 0:x.document.documentElement;var e=ve(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var r of e){var n=x==null?void 0:x.document.querySelector(r);if(n)return n}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return x&&(x.scrollY||x.pageYOffset||x.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return x&&(x.scrollX||x.pageXOffset||x.document.documentElement.scrollLeft)||0}},b0=t=>ef(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties),Fs=class{constructor(e,r,n,i){this.Xe=o=>{var s=this.Qe();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Ze(this._instance)};this.tr.register({[Al]:a});}},this._instance=e,this.ir=r,this.tr=n,this.Ze=i||b0,this.ir.onSessionId(this.Xe);}Qe(){return this.tr.props[Al]}getSetOnceProps(){var e,r=(e=this.Qe())==null?void 0:e.props;return r?"r"in r?tf(r):{$referring_domain:r.referringDomain,$pathname:r.initialPathName,utm_source:r.utm_source,utm_campaign:r.utm_campaign,utm_medium:r.utm_medium,utm_content:r.utm_content,utm_term:r.utm_term}:{}}getSessionProps(){var e={};return Ce(yc(this.getSetOnceProps()),((r,n)=>{n==="$current_url"&&(n="url"),e["$session_entry_"+ol(n)]=r;})),e}},tl=Le("[SessionId]"),$s=class{on(e,r){return this.er.on(e,r)}constructor(e,r,n){var i;if(this.rr=[],this.sr=void 0,this.er=new Qi,this.nr=(c,d)=>!(!jn(c)||!jn(d))&&Math.abs(c-d)>
9this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.tr=e.persistence,this.ar=void 0,this.lr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ur=r||Yr,this.hr=n||Yr;var o=this.R.persistence_name||this.R.token,s=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Sr(s,60,36e3,tl.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.dr(),this.vr="ph_"+o+"_window_id",this.cr="ph_"+o+"_primary_window_exists",this.pr()){var a=ut.W(this.vr),u=ut.W(this.cr);a&&!u?this.ar=a:ut.V(this.vr),ut.G(this.cr,true);}if((i=this.R.bootstrap)!=null&&i.sessionID)try{var l=(c=>{var d=c.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.R.bootstrap.sessionID);this._r(this.R.bootstrap.sessionID,new Date().getTime(),l);}catch(c){tl.error("Invalid sessionID in bootstrap",c);}this.gr();}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return K(this.rr)&&(this.rr=[]),this.rr.push(e),this.lr&&e(this.lr,this.ar),()=>{this.rr=this.rr.filter((r=>r!==e));}}pr(){return this.R.persistence!=="memory"&&!this.tr.ki&&ut.H()}mr(e){e!==this.ar&&(this.ar=e,this.pr()&&ut.G(this.vr,e));}br(){return this.ar?this.ar:this.pr()?ut.W(this.vr):null}_r(e,r,n){e===this.lr&&r===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this.lr=e,this.tr.register({[Ss]:[r,e,n]}));}yr(){var e=this.tr.props[Ss];return ve(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._r(null,null,null);}destroy(){clearTimeout(this.wr),this.wr=void 0,this.sr&&x&&(x.removeEventListener("beforeunload",this.sr,{capture:false}),this.sr=void 0),this.rr=[];}gr(){this.sr=()=>{this.pr()&&ut.V(this.cr);},We(x,"beforeunload",this.sr,{capture:false});}checkAndGetSessionAndWindowId(e,r){if(e===void 0&&(e=false),r===void 0&&(r=null),this.R.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var n=r||new Date().getTime(),[i,o,s]=this.yr(),a=this.br(),u=jn(s)&&Math.abs(n-s)>864e5,l=false,c=!o,d=!c&&!e&&this.nr(n,i);c||d||u?(o=this.ur(),a=this.hr(),tl.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}}),s=n,l=true):a||(a=this.hr(),l=true);var h=jn(i)&&e&&!u?i:n,p=jn(s)?s:new Date().getTime();
9return this.mr(a),this._r(o,h,p),e||this.dr(),l&&this.rr.forEach((f=>f(o,a,l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0))),{sessionId:o,windowId:a,sessionStartTimestamp:p,changeReason:l?{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:u}:void 0,lastActivityTimestamp:i}}dr(){clearTimeout(this.wr),this.wr=setTimeout((()=>{var[e]=this.yr();if(this.nr(new Date().getTime(),e)){var r=this.lr;this.resetSessionId(),this.er.emit("forcedIdleReset",{idleSessionId:r});}}),1.1*this.sessionTimeoutMs);}},_0=["$set_once","$set"],Gr=Le("[SiteApps]"),lc=class{constructor(e){this._instance=e,this.$r=[],this.apps={};}get isEnabled(){return !!this._instance.config.opt_in_site_apps}Er(e,r){if(r){var n=this.globalsForEvent(r);this.$r.push(n),this.$r.length>1e3&&(this.$r=this.$r.slice(10));}}get siteAppLoaders(){var e;return (e=Z._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Er.bind(this));this.Sr=()=>{e(),this.$r=[],this.Sr=void 0;};}}globalsForEvent(e){var r,n,i,o,s,a,u;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,p]of Object.entries(d))l[h]={id:c[h],type:h,properties:p};var{$set_once:f,$set:g}=e;return {event:Y({},sg(e,_0),{properties:Y({},e.properties,g?{$set:Y({},(r=(n=e.properties)==null?void 0:n.$set)!==null&&r!==void 0?r:{},g)}:{},f?{$set_once:Y({},(i=(o=e.properties)==null?void 0:o.$set_once)!==null&&i!==void 0?i:{},f)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(u=e.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var r=this.apps[e.id],n=()=>{var a;!r.errored&&this.$r.length&&(Gr.info("Processing "+this.$r.length+" events for site app with id "+e.id),this.$r.forEach((u=>r.processEvent==null?void 0:r.processEvent(u))),r.processedBuffer=true),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.Sr)==null||a.call(this));},i=false,o=a=>{r.errored=!a,r.loaded=true,Gr.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&n();};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a);}});s&&(r.processEvent=s),i=!0;}catch(a){Gr.error("Error while initializing PostHog app with config id "+e.id,a),o(false);}if(i&&r.loaded)try{n();}catch(a){Gr.error("Error while processing buffered events PostHog app with config id "+e.id,a),r.errored=true;}}kr(){var e=this.siteAppLoaders||[];for(var r of e)this.apps[r.id]={id:r.id,loaded:false,errored:false,processedBuffer:false};for(var n of e)this.setupSiteApp(n);}Pr(e){if(Object.keys(this.apps).length!==0){var r=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(r);}catch(i){Gr.error("Error while processing event "+e.event+" for site app "+n.id,i);}}}onRemoteConfig(e){var r,n,i,o=this;if((r=this.siteAppLoaders)!=null&&r.length)return this.isEnabled?(this.kr(),void this._instance.on("eventCaptured",(l=>this.Pr(l)))):void Gr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Sr)==null||n.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var s=function(l){var c;Z["__$$ph_site_app_"+l]=o._instance,(c=Z.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(o._instance,u,(d=>{if(d)return Gr.error("Error while initializing PostHog app with config id "+l,d)}));};for(var{id:a,url:u}of e.siteApps)s(a);}else Gr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');}},df=function(t,e){if(!t)return  false;var r=t.userAgent;if(r&&gp(r,e))return  true;try{var n=t==null?void 0:t.userAgentData;if(n!=null&&n.brands&&n.brands.some((i=>gp(i==null?void 0:i.brand,e))))return !0}catch(i){}return !!t.webdriver},Hi=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),tg="i.posthog.com",cc=class{constructor(e){this.Tr={},this.instance=e;}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,r=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return r||(r=this.apiHost.replace("."+tg,".posthog.com")),r==="https://app.posthog.com"?"https://us.posthog.com":r}get region(){return this.Tr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Tr[this.apiHost]=Hi.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Tr[this.apiHost]=Hi.EU:this.Tr[this.apiHost]=Hi.CUSTOM),this.Tr[this.apiHost]}endpointFor(e,r){if(r===void 0&&(r=""),r&&(r=r[0]==="/"?r:"/"+r),e==="ui")return this.uiHost+r;if(e==="flags")return this.flagsApiHost+r;if(this.region===Hi.CUSTOM)return this.apiHost+r;var n=tg+r;switch(e){case "assets":return "https://"+this.region+"-assets."+n;case "api":return "https://"+this.region+"."+n}}},y0={icontains:(t,e)=>!!x&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!x&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!x&&Ls(e.href,t),not_regex:(t,e)=>!!x&&!Ls(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},dc=class t{constructor(e){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=false),r.getWebExperiments((i=>{t.Ir("retrieved web experiments from the server"),r.Cr=new Map,i.forEac
9h((o=>{if(o.feature_flag_key){var s;r.Cr&&(t.Ir("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=r.Cr)==null||s.set(o.feature_flag_key,o));var a=r._instance.getFeatureFlag(o.feature_flag_key);Ge(a)&&o.variants[a]&&r.Rr(o.name,a,o.variants[a].transforms);}else if(o.variants)for(var u in o.variants){var l=o.variants[u];t.Fr(l)&&r.Rr(o.name,u,l.transforms);}}));}),n);},this._instance=e,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n);}));}onFeatureFlags(e){if(this._is_bot())t.Ir("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(de(this.Cr))return this.Cr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Ir("applying feature flags",e),e.forEach((r=>{var n;if(this.Cr&&(n=this.Cr)!=null&&n.has(r)){var i,o=this._instance.getFeatureFlag(r),s=(i=this.Cr)==null?void 0:i.get(r);o&&s!=null&&s.variants[o]&&this.Rr(s.name,o,s.variants[o].transforms);}}));}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var r=ks(e==null?void 0:e.search,"__experiment_id"),n=ks(e==null?void 0:e.search,"__experiment_variant");r&&n&&(t.Ir("previewing web experiments "+r+" && "+n),this.getWebExperiments((i=>{this.Or(parseInt(r),n,i);}),false,true));}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic();}getWebExperiments(e,r,n){if(this._instance.config.disable_web_experiments&&!n)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!r)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var s=o.json.experiments||[];return e(s)}});}Or(e,r,n){var i=n.filter((o=>o.id===e));i&&i.length>0&&(t.Ir("Previewing web experiment ["+i[0].name+"] with variant ["+r+"]"),this.Rr(i[0].name,r,i[0].variants[r].transforms));}static Fr(e){return !de(e.conditions)&&t.Mr(e)&&t.Ar(e)}static Mr(e){var r;if(de(e.conditions)||de((r=e.conditions)==null?void 0:r.url))return  true;var n,i,o,s=t.getWindowLocation();return !!s&&((n=e.conditions)==null||!n.url||y0[(i=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,s))}
9static getWindowLocation(){return x==null?void 0:x.location}static Ar(e){var r;if(de(e.conditions)||de((r=e.conditions)==null?void 0:r.utm))return  true;var n=Jg();if(n.utm_source){var i,o,s,a,u,l,c,d,h=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==n.utm_campaign,p=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==n.utm_source,f=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_medium||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_medium)==n.utm_medium,g=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return h&&f&&g&&p}return  false}static Ir(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];W.info("[WebExperiments] "+e,n);}Rr(e,r,n){this._is_bot()?t.Ir("Refusing to render web experiment since the viewer is a likely bot"):r!=="control"?n.forEach((i=>{if(i.selector){var o;t.Ir("applying transform of variant "+r+" for experiment "+e+" ",i);var s=(o=document)==null?void 0:o.querySelectorAll(i.selector);s==null||s.forEach((a=>{var u=a;i.html&&(u.innerHTML=i.html),i.css&&u.setAttribute("style",i.css);}));}})):t.Ir("Control variants leave the page unmodified.");}_is_bot(){return It&&this._instance?df(It,this._instance.config.custom_blocked_useragents):void 0}},w0=Le("[PostHog ExternalIntegrations]"),S0={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},hc=class{constructor(e){this._instance=e;}it(e,r){var n;(n=Z.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(i=>{if(i)return w0.error("failed to load script",i);r();}));}startIfEnabledOrStop(){var e=this,r=function(s){var a,u,l;!i||(a=Z.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.it(S0[s],(()=>{var c;(c=Z.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.start(e._instance);})),!i&&(u=Z.__PosthogExtensions__)!=null&&(u=u.integrations)!=null&&u[s]&&((l=Z.__PosthogExtensions__)==null||(l=l.integrations)==null||(l=l[s])==null||l.stop());};for(var[n,i]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;r(n);}}};Le("[SessionRecording]");var pc="[SessionRecording]",zn=Le(pc),Bs=class{get started(){var e;return !((e=this.jr)==null||!e.isStarted)}get status(){return this.jr?this.jr.status:this.Dr&&!this.Lr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=false,this.Dr=false,this.Nr=false,this.Ur=void 0,this._instance=e,!this._instance.sessionManager)throw zn.error("started without valid sessionManager"),new Error(pc+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(pc+' cannot be used with cookieless_mode="always"')}get Lr(){var e,r=!((e=this._instance.get_property(hs))==null||!e.enabled),n=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return x&&r&&n&&!i}startIfEnabledOrStop(e){var r;if(!this.Lr||(r=this.jr)==null||!r.isStarted){var n=!K(Object.assign)&&!K(Array.from);this.Lr&&n?(this.zr(e),zn.info("starting")):this.stopRecording();}}zr(e){var r,n,i;this.Lr&&(Z!=null&&(r=Z.__PosthogExtensions__)!=null&&(r=r.rrweb)!=null&&r.record&&(n=Z.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Hr(e):(i=Z.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.Br,(o=>{if(o)return zn.error("could not load recorder",o);this.Hr(e);})));}stopRecording(){var e,r;(e=this.Ur)==null||e.call(this),this.Ur=void 0,(r=this.jr)==null||r.stop();}qr(){var e;(e=this._instance.persistence)==null||e.unregister(Dg);}Wr(e){if(this._instance.persistence){var r,n,i=this._instance.persistence,o=()=>{var s=e.sessionRecording===false?void 0:e.sessionRecording,a=s==null?void 0:s.sampleRate,u=de(a)?null:parseFloat(a);de(u)&&this.qr();var l=s==null?void 0:s.minimumDurationMilliseconds;i.register({[hs]:Y({cache_timestamp:Date.now(),enabled:!!s},s,{networkPayloadCapture:Y({capturePerformance:e.capturePerformance},s==null?void 0:s.networkPayloadCapture),canvasRecording:{enabled:s==null?void 0:s.recordCanvas,fps:s==null?void 0:s.canvasFps,quality:s==null?void 0:s.canvasQuality},sampleRate:u,minimumDurationMilliseconds:K(l)?null:l,endpoint:s==null?void 0:s.endpoint,triggerMatchType:s==null?void 0:s.triggerMatchType,masking:s==null?void 0:s.masking,urlTriggers:s==null?void 0:s.urlTriggers})});};o(),(r=this.Ur)==null||r.call(this),this.Ur=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(o);}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==false?(this.Nr=false,this.Wr(e),this.Dr=true,this.startIfEnabledOrStop()):this.Dr=true:zn.info("skipping remote config with no sessionRecording",e);}log(e,r){var n;r===void 0&&(r="log"),(n=this.jr)!=null&&n.log?this.jr.log(e,r):zn.warn("log called before recorder was ready");}get Br(){var e,r,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(hs);return (n==null||(r=n.scriptConfig)==null?void 0:r.script)||"lazy-recorder"}Gr(){var e,r=this._instance.get_property(hs);if(!r)return  false;var n=(e=(typeof r=="object"?r:JSON.parse(r)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=3e5}Hr(e){var r,n;if((r=Z.__PosthogExtensions__)==null||!r.initSessionRecording)throw Error("Called on script loaded before session recording is available");
9this.jr||(this.jr=(n=Z.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.jr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Gr()?this.jr.start(e):this.Nr||(this.Nr=true,zn.info("persisted remote config is stale, requesting fresh config before starting"),new Rs(this._instance).load());}onRRwebEmit(e){var r;(r=this.jr)==null||r.onRRwebEmit==null||r.onRRwebEmit(e);}overrideLinkedFlag(){var e,r;this.jr||(r=this._instance.persistence)==null||r.register({$replay_override_linked_flag:true}),(e=this.jr)==null||e.overrideLinkedFlag();}overrideSampling(){var e,r;this.jr||(r=this._instance.persistence)==null||r.register({$replay_override_sampling:true}),(e=this.jr)==null||e.overrideSampling();}overrideTrigger(e){var r,n;this.jr||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:true}),(r=this.jr)==null||r.overrideTrigger(e);}get sdkDebugProperties(){var e;return ((e=this.jr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,r){var n;return !((n=this.jr)==null||!n.tryAddCustomEvent(e,r))}},Ki={},rl=0,gc=()=>{},Hn="posthog",hf=!n0&&(Ct==null?void 0:Ct.indexOf("MSIE"))===-1&&(Ct==null?void 0:Ct.indexOf("Mozilla"))===-1,rg=t=>{var e;return Y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:true,cross_subdomain_cookie:_S(H==null?void 0:H.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:gc,save_campaign_params:true,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:true,capture_pageleave:"if_capture_pageview",defaults:t!=null?t:"unset",__preview_deferred_init_extensions:false,debug:lt&&Ge(lt==null?void 0:lt.search)&&lt.search.indexOf("__posthog_debug=true")!==-1||false,cookie_expiration:365,upgrade:false,disable_session_recording:false,disable_persistence:false,disable_web_experiments:true,disable_surveys:false,disable_surveys_automatic_display:false,disable_conversations:false,disable_product_tours:false,disable_external_dependency_loading:false,enable_recording_console_log:void 0,secure_cookie:(x==null||(e=x.location)==null?void 0:e.protocol)==="https:",ip:false,opt_out_capturing_by_default:false,opt_out_persistence_by_default:false,opt_out_useragent_filter:false,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:false,property_denylist:[],respect_dnt:false,sanitize_properties:null,request_headers:{},request_batching:true,properties_string_max_length:65535,mask_all_element_attributes:false,mask_all_text:false,mask_personal_data_properties:false,custom_personal_data_properties:[],advanced_disable_flags:false,advanced_disable_decide:false,advanced_disable_feature_flags:false,advanced_disable_feature_flags_on_first_load:false,advanced_only_evaluate_survey_feature_flags:false,advanced_enable_surveys:false,advanced_disable_toolbar_metrics:false,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:r=>{var n="Bad HTTP status: "+r.statusCode+" "+r.text;W.error(n);},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:false,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:oc},error_tracking:{},_onCapture:gc,__preview_eager_load_replay:false},(r=>({rageclick:!(r&&r>="2025-11-30")||{content_ignorelist:true},capture_pageview:!(r&&r>="2025-05-24")||"history_change",session_recording:r&&r>="2025-11-30"?{strictMinimumDuration:true}:{},external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},ng=t=>{var e={};K(t.process_person)||(e.person_profiles=t.process_person),K(t.xhr_headers)||(e.request_headers=t.xhr_headers),K(t.cookie_name)||(e.persistence_name=t.cookie_name),K(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),K(t.store_google)||(e.save_campaign_params=t.store_google),K(t.verbose)||(e.debug=t.verbose);var r=Ve({},e,t);return ve(t.property_blacklist)&&(K(t.property_denylist)?r.property_denylist=t.property_blacklist:ve(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:W.error("Invalid value for property_denylist config: "+t.property_denylist)),r},fc=class{constructor(){this.__forceAllowLocalhost=false;}get Vr(){return this.__forceAllowLocalhost}set Vr(e){W.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e;}},zs=class t{get decideEndpointWasHit(){var e,r;return (e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,r;return (e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new fc,this.Jr=false,this.version=Dr.LIB_VERSION,this.mi=new Qi,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rg(),this.SentryIntegration=$l,this.sentryIntegration=e=>(function(r,n){var i=Yg(r,n);return {name:Wg,processEvent:o=>i(o)}})(this,e),this.__request_queue=[],this.__loaded=false,this.analyticsDefaultEndpoint="/e/",this.Kr=false,this.Yr=null,this.Xr=null,this.Qr=null,this.featureFlags=new Yl(this),this.toolbar=ne
9w Bl(this),this.scrollManager=new uc(this),this.pageViewManager=new Ns(this),this.surveys=new tc(this),this.conversations=new rc(this),this.logs=new nc(this),this.experiments=new dc(this),this.exceptions=new Wl(this),this.rateLimiter=new ic(this),this.requestRouter=new cc(this),this.consent=new Ll(this),this.externalIntegrations=new hc(this),this.people={set:(e,r,n)=>{var i=Ge(e)?{[e]:r}:e;this.setPersonProperties(i),n==null||n({});},set_once:(e,r,n)=>{var i=Ge(e)?{[e]:r}:e;this.setPersonProperties(void 0,i),n==null||n({});}},this.on("eventCaptured",(e=>W.info('send "'+(e==null?void 0:e.event)+'"',e)));}init(e,r,n){if(n&&n!==Hn){var i,o=(i=Ki[n])!==null&&i!==void 0?i:new t;return o._init(e,r,n),Ki[n]=o,Ki[Hn][n]=o,o}return this._init(e,r,n)}_init(e,r,n){var i;if(r===void 0&&(r={}),K(e)||sl(e))return W.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=true,this.config={},r.debug=this.Zr(r.debug),this.ts=r,this.es=[],r.person_profiles?this.Xr=r.person_profiles:r.process_person&&(this.Xr=r.process_person),this.set_config(Ve({},rg(r.defaults),ng(r),{name:n,token:e})),this.config.on_xhr_error&&W.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:Lr.GZipJS;var o=this.rs();this.persistence=new qi(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new qi(Y({},this.config,{persistence:"sessionStorage"}),o);var s=Y({},this.persistence.props),a=Y({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.ss=new sc((y=>this.ns(y)),this.config.request_queue_config),this.os=new ac(this),this.__request_queue=[];var u=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new $s(this),this.sessionPropsManager=new Fs(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(W.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.ls(u);}),0)):(W.info("Initializing extensions synchronously"),this.ls(u)),Dr.DEBUG=Dr.DEBUG||this.config.debug,Dr.DEBUG&&W.info("Starting in debug mode",{this:this,config:r,thisC:Y({},this.config),p:s,s:a}),((i=r.bootstrap)==null?void 0:i.distinctID)!==void 0){var l,c,d=this.config.get_device_id(Yr()),h=(l=r.bootstrap)!=null&&l.isIdentifiedID?d:r.bootstrap.distinctID;this.persistence.set_property(yr,(c=r.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:r.bootstrap.distinctID,$device_id:h});}if(this.us()){var p,f,g=Object.keys(((p=r.bootstrap)==null?void 0:p.featureFlags)||{}).filter((y=>{var T;return !((T=r.bootstrap)==null||(T=T.featureFlags)==null||!T[y])})).reduce(((y,T)=>{var k;return y[T]=((k=r.bootstrap)==null||(k=k.featureFlags)==null?void 0:k[T])||false,y}),{}),v=Object.keys(((f=r.bootstrap)==null?void 0:f.featureFlagPayloads)||{}).filter((y=>g[y])).reduce(((y,T)=>{var k,N;return (k=r.bootstrap)!=null&&(k=k.featureFlagPayloads)!=null&&k[T]&&(y[T]=(N=r.bootstrap)==null||(N=N.featureFlagPayloads)==null?void 0:N[T]),y}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v});}if(u)this.register_once({distinct_id:Ai,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(Yr());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(yr,"anonymous");}return We(x,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:false}),this.toolbar.maybeLoadToolbar(),r.segment?zS(this,(()=>this.hs())):this.hs(),Rr(this.config._onCapture)&&this.config._onCapture!==gc&&(W.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(y=>this.config._onCapture(y.event,y)))),this.config.ip&&W.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}ls(e){var r=performance.now();this.historyAutocapture=new Fl(this),this.historyAutocapture.startIfEnabled();var n=[];n.push((()=>{new zl(this).startIfEnabledOrStop();})),n.push((()=>{var i;this.siteApps=new lc(this),(i=this.siteApps)==null||i.init();})),e||n.push((()=>{this.sessionRecording=new Bs(this),this.sessionRecording.startIfEnabledOrStop();})),this.config.disable_scroll_properties||n.push((()=>{this.scrollManager.startMeasuringScrollPosition();})),n.push((()=>{this.autocapture=new Nl(this),this.autocapture.startIfEnabled();})),n.push((()=>{this.surveys.loadIfEnabled();})),n.push((()=>{this.logs.loadIfEnabled();})),n.push((()=>{this.conversations.loadIfEnabled();})),n.push((()=>{this.productTours=new Jl(this),this.productTours.loadIfEnabled();})),n.push((()=>{this.heatmaps=new Hl(this),this.heatmaps.startIfEnabled();})),n.push((()=>{this.webVitalsAutocapture=new jl(this);})),n.push((()=>{this.exceptionObserver=new Rl(this),this.exceptionObserver.startIfEnabledOrStop();})),n.push((()=>{this.deadClicksAutocapture=new Os(this,BS),this.deadClicksAutocapture.startIfEnabledOrStop();})),n.push((()=>
9{if(this.ds){var i=this.ds;this.ds=void 0,this.Ce(i);}})),this.vs(n,r);}vs(e,r){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&e.length>0)return void setTimeout((()=>{this.vs(e,r);}),0);var n=e.shift();if(n)try{n();}catch(o){W.error("Error initializing extension:",o);}}var i=Math.round(performance.now()-r);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&W.info("PostHog extensions initialized ("+i+"ms)");}Ce(e){var r,n,i,o,s,a,u,l,c;if(!H||!H.body)return W.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ce(e);}),500);this.config.__preview_deferred_init_extensions&&(this.ds=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=ce(e.supportedCompression,Lr.GZipJS)?Lr.GZipJS:ce(e.supportedCompression,Lr.Base64)?Lr.Base64:void 0),(r=e.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Xr?this.Xr:"identified_only"}),(n=this.siteApps)==null||n.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(a=this.productTours)==null||a.onRemoteConfig(e),(u=this.webVitalsAutocapture)==null||u.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e);}hs(){try{this.config.loaded(this);}catch(n){W.critical("`loaded` function failed",n);}if(this.cs(),this.config.internal_or_test_user_hostname&&lt!=null&&lt.hostname){var e=lt.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?e===r:r.test(e))&&this.setInternalOrTestUser();}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.fs();}),1),this.ps=new Rs(this),this.ps.load();}cs(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.ss)==null||e.enable());}_dom_loaded(){this.is_capturing()&&Jr(this.__request_queue,(e=>this.ns(e))),this.__request_queue=[],this.cs();}_handle_unload(){var e,r;this.surveys.handlePageUnload(),this.config.request_batching?(this._s()&&this.capture("$pageleave"),(e=this.ss)==null||e.unload(),(r=this.os)==null||r.unload()):this._s()&&this.capture("$pageleave",null,{transport:"sendBeacon"});}_send_request(e){this.__loaded&&(hf?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Us(e.url,{ip:this.config.ip?1:0}),e.headers=Y({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(r=>{var n,i,o,s=Y({},r);s.timeout=s.timeout||6e4,s.url=Us(s.url,{_:new Date().getTime().toString(),ver:Dr.LIB_VERSION,compression:s.compression});var a=(n=s.transport)!==null&&n!==void 0?n:"fetch",u=bs.filter((c=>!s.disableTransport||!c.transport||!s.disableTransport.includes(c.transport))),l=(i=(o=kg(u,(c=>c.transport===a)))==null?void 0:o.method)!==null&&i!==void 0?i:u[0].method;if(!l)throw new Error("No available transport method");l(s);})(Y({},e,{callback:r=>{var n,i;this.rateLimiter.checkForLimiting(r),r.statusCode>=400&&((n=(i=this.config).on_request_error)==null||n.call(i,r)),e.callback==null||e.callback(r);}}))));}ns(e){this.os?this.os.retriableRequest(e):this._send_request(e);}_execute_array(e){rl++;try{var r,n=[],i=[],o=[];Jr(e,(a=>{a&&(r=a[0],ve(r)?o.push(a):Rr(a)?a.call(this):ve(a)&&r==="alias"?n.push(a):ve(a)&&r.indexOf("capture")!==-1&&Rr(this[r])?o.push(a):i.push(a));}));var s=function(a,u){Jr(a,(function(l){if(ve(l[0])){var c=u;Ce(l,(function(d){c=c[d[0]].apply(c,d.slice(1));}));}else this[l[0]].apply(this,l.slice(1));}),u);};s(n,this),s(i,this),s(o,this);}finally{rl--;}}us(){var e,r;return ((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((r=this.config.bootstrap)==null?void 0:r.featureFlags).length>0||false}push(e){if(rl>0&&ve(e)&&Ge(e[0])){var r=t.prototype[e[0]];Rr(r)&&r.apply(this,e.slice(1));}else this._execute_array([e]);}capture(e,r,n){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ss){if(this.is_capturing())if(!K(e)&&Ge(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){r!=null&&r.$current_url&&!Ge(r==null?void 0:r.$current_url)&&(W.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),e!=="$exception"||n!=null&&n.oi||W.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,u=(n==null?void 0:n.timestamp)||a,l=Yr(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,r||{},u,l)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),s&&(c.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),n!=null&&n.$set&&(c.$set=n==null?void 0:n.$set);var d,h=e!=="$groupidentify",p=this.gs(n==null?void 0:n.$set_once,h);if(p&&(c.$set_once=p),(c=vS(c,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=u,K(n==null?void 0:n.timestamp)||(c.properties.$event_time_override_provided=true,c.properties.$event_time_override_system_time=a),e===ji.DISM
9ISSED||e===ji.SENT){var f=r==null?void 0:r[el.SURVEY_ID],g=r==null?void 0:r[el.SURVEY_ITERATION];d={id:f,current_iteration:g},localStorage.getItem(Zp(d))||localStorage.setItem(Zp(d),"true"),c.$set=Y({},c.$set,{[g0({id:f,current_iteration:g},e===ji.SENT?"responded":"dismissed")]:true});}else e===ji.SHOWN&&(c.$set=Y({},c.$set,{[el.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var v=Y({},c.properties.$set,c.$set);if(Vn(v)||this.setPersonPropertiesForFlags(v),!de(this.config.before_send)){var m=this.bs(c);if(!m)return;c=m;}this.mi.emit("eventCaptured",c);var y={method:"POST",url:(i=n==null?void 0:n._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return !this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.ns(y):this.ss.enqueue(y),c}W.critical("This capture call is ignored due to client rate limiting.");}}else W.error("No event name provided to posthog.capture");}else W.uninitializedWarning("posthog.capture");}_addCaptureHook(e){return this.on("eventCaptured",(r=>e(r.event,r)))}calculateEventProperties(e,r,n,i,o){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var s=o?void 0:this.persistence.remove_event_timer(e),a=Y({},r);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=true),e==="$snapshot"){var u=Y({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!Ge(a.distinct_id)&&!Br(a.distinct_id)||sl(a.distinct_id))&&W.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,c=GS(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,n.getTime());a.$session_id=d,a.$window_id=h;}this.sessionPropsManager&&Ve(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&Ve(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(p=this.os)==null?void 0:p.length;}catch(m){a.$sdk_debug_error_capturing_properties=String(m);}if(this.requestRouter.region===Hi.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),l=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,i),a=Ve(a,l),e==="$pageview"&&H&&(a.title=H.title),!K(s)){var f=n.getTime()-s;a.$duration=parseFloat((f/1e3).toFixed(3));}Ct&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ve({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ve(this.config.property_denylist)?Ce(this.config.property_denylist,(function(m){delete a[m];})):W.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(W.error("sanitize_properties is deprecated. Use before_send instead"),a=g(a,e));var v=this.ys();return a.$process_person_profile=v,v&&!o&&this.ws("_calculate_event_properties"),a}gs(e,r){var n;if(r===void 0&&(r=true),!this.persistence||!this.ys()||this.Jr)return e;var i=this.persistence.get_initial_props(),o=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),s=Ve({},i,o||{},e||{}),a=this.config.sanitize_properties;return a&&(W.error("sanitize_properties is deprecated. Use before_send instead"),s=a(s,"$set_once")),r&&(this.Jr=true),Vn(s)?void 0:s}register(e,r){var n;(n=this.persistence)==null||n.register(e,r);}register_once(e,r,n){var i;(i=this.persistence)==null||i.register_once(e,r,n);}register_for_session(e){var r;(r=this.sessionPersistence)==null||r.register(e);}unregister(e){var r;(r=this.persistence)==null||r.unregister(e);}unregister_for_session(e){var r;(r=this.sessionPersistence)==null||r.unregister(e);}xs(e,r){this.register({[e]:r});}getFeatureFlag(e,r){return this.featureFlags.getFeatureFlag(e,r)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,r){return this.featureFlags.getFeatureFlagResult(e,r)}isFeatureEnabled(e,r){return this.featureFlags.isFeatureEnabled(e,r)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags();}updateFlags(e,r,n){var i=n!=null&&n.merge?this.featureFlags.getFlagVariants():{},o=n!=null&&n.merge?this.featureFlags.getFlagPayloads():{},s=Y({},i,e),a=Y({},o,r),u={};for(var[l,c]of Object.entries(s)){var d=typeof c=="string";u[l]={key:l,enabled:!!d||!!c,variant:d?c:void 0,reason:void 0,metadata:K(a==null?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}};}this.featureFlags.receivedFeatureFlags({flags:u});}updateEarlyAccessFeatureEnrollment(e,r,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,r,n);}getEarlyAccessFeatures(e,r,n){return r===void 0&&(r=false),this.featureFlags.getEarlyAccessFeatures(e,r,n)}on(e,r){return this.mi.on(e,r)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var r,n;return (r=(n=this.sessionManager)==null?void 0:n.onSessionId(e))!==null&&r!==void 0?r:()=>{}}getSurveys(e,r){r===void 0&&(r=false),this.surveys.getSurveys(e,r);}getActiveMatchingSurveys(e,r){r===void 0&&(r=false),this.surveys.getActiveMatchingSurveys(e,r);}renderSurvey(e,r){this.surveys.renderSurvey(e,r);}displaySurvey(e,r){r===void 0&&(r=m0),this.surveys.displaySurvey(e,r);}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e);}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,r){return r===void 0&&(r=false),this.surveys.canRenderSurveyAsync(e,r)}identify(e,r,n){if(!this.__loaded||!this.persistence)return W.uninitializedWarning("posthog.identify");if(Br(e)&&(e=e.toString(),W.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))W.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
9ot a hardcoded string.');else if(e!==Ai){if(this.ws("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:true,$device_id:o},"");}e!==i&&e!==this.get_property(Ri)&&(this.unregister(Ri),this.register({distinct_id:e}));var s=(this.persistence.get_property(yr)||"anonymous")==="anonymous";e!==i&&s?(this.persistence.set_property(yr,"identified"),this.setPersonPropertiesForFlags(Y({},n||{},r||{}),false),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.Qr=Gp(e,r,n),this.featureFlags.setAnonymousDistinctId(i)):(r||n)&&this.setPersonProperties(r,n),e!==i&&(this.reloadFeatureFlags(),this.unregister(Cs));}}else W.critical('The string "'+Ai+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else W.error("Unique user id has not been set in posthog.identify");}setPersonProperties(e,r){if((e||r)&&this.ws("posthog.setPersonProperties")){var n=Gp(this.get_distinct_id(),e,r);this.Qr!==n?(this.setPersonPropertiesForFlags(Y({},r||{},e||{})),this.capture("$set",{$set:e||{},$set_once:r||{}}),this.Qr=n):W.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.");}}group(e,r,n){if(e&&r){var i=this.getGroups();i[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Y({},i,{[e]:r})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),i[e]===r||n||this.reloadFeatureFlags();}else W.error("posthog.group requires a group type and group key");}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags();}setPersonPropertiesForFlags(e,r){r===void 0&&(r=true),this.featureFlags.setPersonPropertiesForFlags(e,r);}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags();}setGroupPropertiesForFlags(e,r){r===void 0&&(r=true),this.ws("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,r);}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e);}reset(e){var r,n,i,o,s;if(W.info("reset"),!this.__loaded)return W.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(n=this.sessionPersistence)==null||n.clear(),this.surveys.reset(),(i=this.ps)==null||i.stop(),this.featureFlags.reset(),(o=this.persistence)==null||o.set_property(yr,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.Qr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ai,$device_id:null},"");else {var u=this.config.get_device_id(Yr());this.register_once({distinct_id:u,$device_id:e?u:a},"");}this.register({$last_posthog_reset:new Date().toISOString()},1);}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,r;return (e=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(true).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return "";var{sessionId:r,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(true),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r);if(e!=null&&e.withTimestamp&&n){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!n)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-s,0);}return i}alias(e,r){return e===this.get_property(Og)?(W.critical("Attempting to create alias for existing People user - aborting."),-2):this.ws("posthog.alias")?(K(r)&&(r=this.get_distinct_id()),e!==r?(this.xs(Ri,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(W.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r=Y({},this.config);if(et(e)){var n,i,o,s,a,u,l,c;Ve(this.config,ng(e));var d=this.rs();(n=this.persistence)==null||n.update_config(this.config,r,d),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new qi(Y({},this.config,{persistence:"sessionStorage"}),d);var h=this.Zr(this.config.debug);$r(h)&&(this.config.debug=h),$r(this.config.debug)&&(this.config.debug?(Dr.DEBUG=true,Ue.H()&&Ue.G("ph_debug","true"),W.info("set_config",{config:e,oldConfig:r,newConfig:Y({},this.config)})):(Dr.DEBUG=false,Ue.H()&&Ue.V("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(u=this.exceptionObserver)==null||u.startIfEnabledOrStop(),(l=this.deadClicksAutocapture)==null||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.$s(),(c=this.externalIntegrations)==null||c.startIfEnabledOrStop();}}startSessionRecording(e){var r=e===true,n={sampling:r||!(e==null||!e.sampling),linked_flag:r||!(e==null||!e.linked_flag),url_trigger:r||!(e==null||!e.url_trigger),event_trigger:r||!(e==null||!e.event_trigger)};if(Object.values(n).some(Boolean)){var i,o,s,a,u;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),n.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),n.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),n.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),n.event_trigger&&((u=this.sessionRecording)==null||u.overrideTrigger("event"));}this.set_config({disable_session_recording:false});}stopSessionRecording(){this.set_config({disable_session_recording:true});}sessionRecordingStarted(){var e;return !((e=this.sessionRecording)==null||!e.started)}captureException(e,r){var n=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:true,syntheticException:n});return this.exceptions.sendExceptionEvent(Y({},i,r))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e});}stopExceptionAutocapture(){this.set_config({capture_exceptions:false});}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var r;return (r=this.persistence)==null?void 0:r.props[e]}getSessionProperty(e){var r;return (r=this.sessionPersistence)==null?void 0:r.props[e]}toString(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:Hn;return r!==Hn&&(r=Hn+"."+r),r}_isIdentified(){var e,r;return ((e=this.persistence)==null?void 0:e.get_property(yr))==="identified"||((r=this.sessionPersistence)==null?void 0:r.get_property(yr))==="identified"}ys(){var e,r;return !(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Vn(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Ri])&&((r=this.persistence)==null||(r=r.props)==null||!r[Ps]))}_s(){return this.config.capture_pageleave===true||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===true||this.config.capture_pageview==="history_change")}createPersonProfile(){this.ys()||this.ws("posthog.createPersonProfile")&&this.setPersonProperties({},{});}setInternalOrTestUser(){this.ws("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:true});}ws(e){return this.config.person_profiles==="never"?(W.error(e+' was called, but process_person is set to "never". This call will be ignored.'),false):(this.xs(Ps,true),true)}rs(){if(this.config.cookieless_mode==="always")return  true;var e=this.consent.isOptedOut(),r=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!r}$s(){var e,r,n,i,o=this.rs();return ((e=this.persistence)==null?void 0:e.ki)!==o&&((n=this.persistence)==null||n.set_disabled(o)),((r=this.sessionPersistence)==null?void 0:r.ki)!==o&&((i=this.sessionPersistence)==null||i.set_disabled(o)),o}opt_in_capturing(e){var r;if(this.config.cookieless_mode!=="always"){var n,i,o;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(true),(n=this.sessionManager)==null||n.destroy(),(i=this.pageViewM
9anager)==null||i.destroy(),this.sessionManager=new $s(this),this.pageViewManager=new Ns(this),this.persistence&&(this.sessionPropsManager=new Fs(this,this.sessionManager,this.persistence)),this.sessionRecording=new Bs(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(true),this.$s(),this.cs(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(K(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((o=e==null?void 0:e.captureEventName)!==null&&o!==void 0?o:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:true}),this.config.capture_pageview&&this.fs();}else W.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored');}opt_out_capturing(){var e,r,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(true),this.consent.optInOut(false),this.$s(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Ai,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.fs())):W.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored');}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Ur.GRANTED?"granted":e===Ur.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$s();}_is_bot(){return It?df(It,this.config.custom_blocked_useragents):void 0}fs(){H&&(H.visibilityState==="visible"?this.Kr||(this.Kr=true,this.capture("$pageview",{title:H.title},{send_instantly:true}),this.Yr&&(H.removeEventListener("visibilitychange",this.Yr),this.Yr=null)):this.Yr||(this.Yr=this.fs.bind(this),We(H,"visibilitychange",this.Yr)));}debug(e){e===false?(x==null||x.console.log("You've disabled debug mode."),this.set_config({debug:false})):(x==null||x.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:true}));}M(){var e,r,n,i,o,s,a,u=this.ts||{};return "advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==false?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===true?(W.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),true):(n="advanced_disable_decide",i=false,o=W,s=(r="advanced_disable_flags")in(e=u)&&!de(e[r]),a=n in e&&!de(e[n]),s?e[r]:a?(o&&o.warn("Config field '"+n+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),e[n]):i)}bs(e){if(de(this.config.before_send))return e;var r=ve(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var i of r){if(n=i(n),de(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Vw(e.event)?W.warn(o+". This can cause unexpected behavior."):W.info(o),null}n.properties&&!Vn(n.properties)||W.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.");}return n}getPageViewId(){var e;return (e=this.pageViewManager.Kt)==null?void 0:e.pageViewId}captureTraceFeedback(e,r){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:r});}captureTraceMetric(e,r,n){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:r,$ai_metric_value:String(n)});}Zr(e){var r=$r(e)&&!e,n=Ue.H()&&Ue.q("ph_debug")==="true";return !r&&(!!n||e)}};(function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=mS(t.prototype[e[r]]);})(zs,["identify"]);var ig;((function(t){return t.SHOWN="product tour shown",t.DISMISSED="product tour dismissed",t.COMPLETED="product tour completed",t.STEP_SHOWN="product tour step shown",t.STEP_COMPLETED="product tour step completed",t.BUTTON_CLICKED="product tour button clicked",t.STEP_SELECTOR_FAILED="product tour step selector failed",t.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",t.BANNER_ACTION_CLICKED="product tour banner action clicked",t}))({});((function(t){return t.TOUR_ID="$product_tour_id",t.TOUR_NAME="$product_tour_name",t.TOUR_ITERATION="$product_tour_iteration",t.TOUR_RENDER_REASON="$product_tour_render_reason",t.TOUR_STEP_ID="$product_tour_step_id",t.TOUR_STEP_ORDER="$product_tour_step_order",t.TOUR_STEP_TYPE="$product_tour_step_type",t.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",t.TOUR_BUTTON_TEXT="$product_tour_button_text",t.TOUR_BUTTON_ACTION="$product_tour_button_action",t.TOUR_BUTTON_LINK="$product_tour_button_link",t.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",t.TOUR_STEPS_COUNT="$product_tour_steps_count",t.TOUR_STEP_SELECTOR="$product_tour_step_selector",t.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",t.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",t.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",t.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",t.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",t.TOUR_ERROR="$product_tour_error",t.TOUR_MATCHES_COUNT="$product_tour_matches_count",t.TOUR_FAILURE_PHASE="$product_tour_failure_phase",t.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",t.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",t.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",t.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",t.USE_MANUAL_SELECTOR="$use_manual_selector",t.INFERENCE_DATA_PRESENT="$inference_data_present",t}))({});var ro=(ig=Ki[Hn]=new zs,(function(){function t(){t.done||(t.done=true,hf=false,Ce(Ki,(function(e){e._dom_loaded();})));}H!=null&&H.addEventListener?H.readyState==="complete"?t():We(H,"DOMContentLoaded",t,{capture:false}):x&&W.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized");})(),ig);var pf=false,C0="https://eu.i.posthog.com",E0="2025-05-24";function P0(){var n,i,o,s;if(typeof window=="undefined"||pf||!bi("posthog"))return;let t=ao(),e=t.posthog;if(!(e!=null&&e.key))return;if(pf=true,ro.__loaded){window.posthog=ro;return}let{customerId:r}=cn();ro.init(e.key,Cr(be({api_host:(n=e.apiHost)!=null?n:C0},e.uiHost&&{ui_host:e.uiHost}),{defaults:(i=e.defaults)!=null?i:E0,autocapture:false,capture_pageview:false,capture_pageleave:false,capture_dead_clicks:false,disable_web_experiments:false,disable_session_recording:true,debug:(o=e.debug)!=null?o:false,loaded:a=>{r&&a.identify(r);}})),window.posthog=ro,(s=t.reporter)==null||s.addBreadcrumb({category:"tracking",message:"Initialize PostHog",level:"info"});}function no(t){for(let e of za())try{t(e);}catch(r){}}function I0(){var t,e;return {tech_platform:(e=(t=dt())==null?void 0:t.techPlatform)!=null?e:""}}
9function A0(){return typeof document=="undefined"?{}:{referrer:document.referrer}}async function Ic(){let t=await Lo();return be(be({title:typeof document!="undefined"?document.title:"",full_page_url:typeof window!="undefined"?window.location.href:"",currency:Te.get(Oo)||"",geolocation:Te.get(No)||"",session_id:t},I0()),A0())}var T0=Object.entries(Uo).reduce((t,[e,r])=>(t[r]=e,t),{});function ze(t,e={}){(async()=>{let r=be(be({},await Ic()),e);no(n=>{var i;return (i=n.trackEvent)==null?void 0:i.call(n,t,r)});})();}function k0(t,e,r={}){var i;let n=typeof e=="number"?(i=T0[e])!=null?i:"other":e;ze({name:t,kind:n},r);}function gf(t,e){var n;let r=(n=e==null?void 0:e.virtual_page_url)!=null?n:window.location.origin+t;(async()=>{var s,a,u;let i=typeof document!="undefined"?document.documentElement.lang:"",o=be(Cr(be({},await Ic()),{virtual_page_url:r,locale:(a=(s=e==null?void 0:e.locale)!=null?s:i)!=null?a:"",carrier:null}),e);(u=dt())!=null&&u.debug&&(console.groupCollapsed(`[PAGE VIEW] ${t}`),console.log(e),console.groupEnd()),no(l=>{var c;return (c=l.trackScreen)==null?void 0:c.call(l,t,o)});})();}function Zn(t){(async()=>{let e=be(be({},await Ic()),t.properties);no(r=>{var n;return (n=r.trackCommerce)==null?void 0:n.call(r,Cr(be({},t),{properties:e}))});})();}async function ff(t){await Promise.all(za().map(async e=>{var r;try{await((r=e.identify)==null?void 0:r.call(e,t));}catch(n){}}));}function mf(){no(t=>{var e;return (e=t.logout)==null?void 0:e.call(t)});}function x0(t){no(e=>{var r;return (r=e.setUserProperties)==null?void 0:r.call(e,t)});}var vf=(r=>(r.MtuCredits="MTU_CREDITS",r.MtuPlansBundles="MTU_PLANS_BUNDLES",r))(vf||{}),bf=(e=>(e.MtuPlansBundlesPlan="MTU_PLANS_BUNDLES_PLAN",e))(bf||{}),O0=t=>t.productCategory==="MTU_CREDITS",_f=t=>t.productCategory==="MTU_PLANS_BUNDLES"&&t.productSubCategory==="MTU_PLANS_BUNDLES_PLAN",yf=t=>t.productCategory==="MTU_PLANS_BUNDLES"&&t.productSubCategory!=="MTU_PLANS_BUNDLES_PLAN",Pn=t=>yf(t)||_f(t)?"Plans & Bundles":"Credits",In=t=>O0(t)?null:yf(t)?"Bundles":_f(t)?"Plan":"Nauta",io=t=>t.name==="Rebtel Credits"?"World Credits":"Subscription",oo=t=>t.name==="Rebtel Credits"?"Credits":t.name.toLowerCase().includes("unlimited")?"Unlimited":"Limited",Ac=(s=>(s.CALLING="Calling",s.FOOD="Food",s.INTERNATIONAL_NUMBER="International Number",s.MONEY_TRANSFER="Money Transfer",s.MTU="MTU",s.WIRELESS="Wireless",s))(Ac||{}),wf={CALLING:"Calling",FOOD:"Food",INTERNATIONAL_NUMBER:"International Number",MONEY_TRANSFER:"Money Transfer",MTU:"MTU",WIRELESS:"Wireless"};function so(t){return wf[t]}function qs(t){return t?wf[t]:void 0}function Sf(t){switch(t){case "EMAIL":return "email";case "MSISDN":return "phone";case "REBTEL_ACCOUNT":return "rebtel-account";default:return t}}function Ks(t){return t==="worldCredit"||t==="tafRedeem"?"World Credits":t==="callingDeal"||t==="calling"?"Subscription":""}function Gs(t){return t==="payg"?"Credits":t==="unlimited"?"Unlimited":t==="deal"?"Limited":""}var Cf={identify(t){return ff(t)},logout(){mf();},loginAttempt(t,e){ze(Be.LOGIN_ATTEMPT,{is_success:t,method:Sf(e)});},otpAttempt(t,e){ze(Be.OTP_ATTEMPT,{is_new_user:e,is_success:t});},smsOptOut(t){ze(Be.SMS_OPT_OUT,{user_id:t});}};var N0=()=>Te.get(Oo)||"",D0=()=>Te.get(No)||"";function Tc(){var t;try{let e=Te.get(Dd);if(!e)return null;let r=JSON.parse(e);return r&&r.legacy!==!0&&!("type"in r)&&(r.type="email"in r?"nauta":"mtu"),(r==null?void 0:r.type)==="mtu"?(t=r.origin)!=null?t:"organic":null}catch(e){return null}}var Ef={ecommerce(t,e){var i,o;let r=(i=t==null?void 0:t.items[0])==null?void 0:i.product;if(!t||!r)return;let n={kind:"checkout",currency:t.summary.netAmount.currency,products:[{name:r.title,id:r.id,price:r.price.amount,category:r.serviceCategory}],transaction:{id:t.id,revenue:t.summary.total.amount,tax:t.summary.vats[0].vatAmount.amount},properties:{service_category:so(r.serviceCategory),product_category:Pn(r)||"",product_sub_category:In(r)||"",destination_country:r.countryId||"",destination_currency:((o=r.value)==null?void 0:o.currency)||"",origination_country:D0(),origination_currency:N0(),is_new_paying_user:e}};Zn(n);},ecommerceLegacy(t){var e,r,n;try{let i=t.legacyOrderItem;Zn({kind:"checkout",currency:t.totalAmount.currencyId,products:[{name:i.name,id:(e=i.itemId)!=null?e:"",price:(n=(r=i.amount)==null?void 0:r.amount)!=null?n:0,category:i.type}],properties:{service_category:"Calling",product_category:io(i)||"",product_sub_category:oo(i)||"",origination_country:t.vatCountry||"",origination_currency:t.totalAmount.currencyId||""}});}catch(i){}},purchaseAttempt(t,e,r,n=false){var s;let i=(s=t==null?void 0:t.items[0])==null?void 0:s.product,o={legacy:false,saved_payment_method:r,payment_id:e,order_id:t.id,checkout_origin:Tc(),is_new_paying_user:n};i&&(o.product_id=i.id,o.service_category=qs(i.serviceCategory),o.product_category=Pn(i),o.product_sub_category=In(i),o.destination_country=i.countryId),ze(Be.PURCHASE_ATTEMPT,o);},purchaseAttemptLegacy(t,e,r){let n=t.legacyOrderItem,i={legacy:true,saved_payment_method:r,payment_id:e};
9n&&(i.product_id=n.itemId,i.service_category="Calling",i.product_category=Ks(t.orderType),i.product_sub_category=Gs(n.productType),i.destination_country=null),ze(Be.PURCHASE_ATTEMPT,i);},purchaseFailed(t,e){var a,u,l,c,d;let r=t==null?void 0:t.product,n=(t==null?void 0:t.details.__typename)==="OrderFailed"?t.details:void 0,i=((u=(a=n==null?void 0:n.payment)==null?void 0:a.details)==null?void 0:u.__typename)==="PaymentFailed"?n.payment.details:void 0,o=((l=n==null?void 0:n.error)==null?void 0:l.userMessage)||"Unknown error";i&&(o=(d=(c=i.error)==null?void 0:c.userMessage)!=null?d:o);let s={is_new_paying_user:e,order_state:i?"PAYMENT_FAILED":"FAILED",is_subscription:t.subscription!=null,checkout_origin:Tc(),failure_reason:o,order_id:t.id,product_id:t.productId};r&&(s.service_category=qs(r.serviceCategory),s.product_category=Pn(r),s.product_sub_category=In(r),s.destination_country=r.countryId),ze(Be.PURCHASE_FAILED,s);},purchaseFailedLegacy(t,e){let r=t.legacyOrderItem,n={is_new_paying_user:e,order_state:t.state,is_subscription:null};r&&(n.service_category="Calling",n.product_category=Ks(t.orderType),n.product_sub_category=Gs(r.productType),n.destination_country=null),ze(Be.PURCHASE_FAILED,n);},purchaseSucceeded(t,e){var r,n,i,o,s;try{let a=(r=t==null?void 0:t.items[0])==null?void 0:r.product;mi()||vi("purchaseSucceeded"),t&&a&&ze(Be.PURCHASE_SUCCEEDED,{order_id:t.id,product_id:(n=a.id)!=null?n:null,revenue:t.summary.total.amount,tax:t.summary.vats[0].vatAmount.amount,new_paying_user:e,is_new_paying_user:e,service_category:so(a.serviceCategory),product_category:Pn(a),product_sub_category:In(a),destination_country:(i=a.countryId)!=null?i:null,checkout_origin:Tc()}),a&&Zn({kind:"purchase",currency:t.summary.total.currency,transaction:{id:t.id,revenue:t.summary.total.amount,tax:t.summary.vats[0].vatAmount.amount},products:[{name:a.title,id:a.id,price:a.price.amount,category:a.serviceCategory}],properties:{service_category:so(a.serviceCategory),product_category:Pn(a),product_sub_category:In(a),destination_country:(o=a.countryId)!=null?o:null,is_new_paying_user:e,ltv:(s=a.ltv)!=null?s:null}});}catch(a){mi()||vi("purchaseSucceeded");}},purchaseSucceededLegacy(t,e=false){var r,n;try{let i=t.legacyOrderItem;mi()||vi("purchaseSucceeded"),ze(Be.PURCHASE_SUCCEEDED,{order_id:t.id,revenue:t.totalAmount.amount,tax:t.totalVatAmount?t.totalVatAmount.amount:0,new_paying_user:e,is_new_paying_user:e,service_category:"Calling",product_category:io(i),product_sub_category:oo(i),destination_country:null}),Zn({kind:"purchase",currency:t.totalAmount.currencyId,transaction:{id:t.id,revenue:t.totalAmount.amount,tax:t.totalVatAmount?t.totalVatAmount.amount:0},products:[{name:i.name,id:i.itemId,price:(n=(r=i.amount)==null?void 0:r.amount)!=null?n:0,category:i.type}],properties:{service_category:"Calling",product_category:io(i),product_sub_category:oo(i),destination_country:null,is_new_paying_user:e,ltv:null}});}catch(i){mi()||vi("purchaseSucceeded");}},addPaymentMethodAttempt(t){ze(Be.ADD_PAYMENT_METHOD_ATTEMPT,{payment_id:t,payment_method:"credit_card"});},addPaymentMethodSucceeded(t){ze(Be.ADD_PAYMENT_METHOD_SUCCEEDED,{payment_id:t,payment_method:"credit_card"});},addPaymentMethodFailed(t){ze(Be.ADD_PAYMENT_METHOD_FAILED,{payment_id:t,payment_method:"credit_card"});}};var Pf={pageView(t,e){gf(t,e);},linkClicked(t){ze(Be.LINK_CLICKED,t);},landingPageSubmit(t){ze(Be.LANDING_PAGE_SUBMIT,t);}};var If={selected(t){var e,r;ze(Be.PRODUCT_SELECTED,{product_id:t.id,product_name:t.title,destination_country:(e=t.countryId)!=null?e:void 0,product_category:t.productCategory,product_service_category:t.serviceCategory,product_sub_category:(r=t.productSubCategory)!=null?r:void 0});},subscriptionOptionViewed(t){ze(Be.SUBSCRIPTION_OPTION_VIEWED,t);},subscriptionOptionSelected(t){ze(Be.SUBSCRIPTION_OPTION_SELECTED,t);}};var Af=(i=>(i.Account="account",i.Checkout="checkout",i.Product="product",i.Other="other",i))(Af||{}),M0={account:Cf,checkout:Ef,product:If,other:Pf};/*! Bundled license information:
10
11@mparticle/web-facebook-kit/dist/FacebookEventForwarder.esm.js:
12  (*!
13   * isobject <https://github.com/jonschlinkert/isobject>
14   *
15   * Copyright (c) 2014-2017, Jon Schlinkert.
16   * Released under the MIT License.
17   *)
18
19js-cookie/dist/js.cookie.mjs:
20  (*! js-cookie v3.0.8 | MIT *)
21*/exports.EventKind=Ua;exports.ProductCategory=vf;exports.ProductSubCategory=bf;exports.ServiceCategoryForTracking=Ac;exports.TRACKING_EVENTS=Be;exports.TrackingCategory=Af;exports.events=M0;exports.getCallingCategoryString=io;exports.getCallingSubCategoryString=oo;exports.getMTUCategoryString=Pn;exports.getMTUSubCategoryString=In;exports.getProductCategoryForLegacy=Ks;exports.getProductSubCategoryForLegacy=Gs;exports.getServiceCategoryForTracking=qs;exports.getUserIdentityFromBrowserCookie=cn;exports.initMParticle=$w;exports.initPostHog=P0;exports.initTracking=Rf;exports.mapServiceCategoryForTracking=so;exports.resetTrackingConfig=Ff;exports.setUserProperties=x0;exports.trackCommerce=Zn;exports.trackCustomEvent=k0;return exports;})({});//# sourceMappingURL=rebtel-tracking.global.js.map
22//# sourceMappingURL=rebtel-tracking.global.js.map

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