module.exports = "(function(e,i,t){var a=t(4934),n=t(4810),r=t(9256),o=t(8131),g=t(7004),s=t(7152),d=t(4527).get(\"stores/rum\"),l=\"google_analytics_4\",c=\"gtag\",u=\"dataLayer\",_=\"optimizely_decision\",I=\"experience_impression\",m=function(e,i){var t=__GA4_CUSTOM_FIELD__;return o.pollFor((function(){return s.getGlobal(c)||null}),200,50).then((function(o){n.log(\"GA4 Integration: gtag finally exists, sending now.\"),(__PROFILE__||__RUM_VERBOSE__||d.getSampleRum())&&r.timeEnd(\"gtagReady\"),n.debug(\"GA4 Integration: calling ga4 with data: \"+a.stringify(e)),o(\"event\",I,e),t&&(n.debug(\"GA4 Integration: calling ga4 with custom event data: \"+a.stringify(i)),o(\"event\",_,i))}))};var p=function(e,i){var t=__GA4_CUSTOM_FIELD__,r=s.getGlobal(u);n.debug(\"GA4 Integration: found dataLayer object \"+r),r||(n.debug(\"GA4 Integration: dataLayer object \"+u+\" is empty, initializing it\"),s.setGlobal(u,[]),r=s.getGlobal(u)),n.log(\"GA4 Integration: attempting push to \"+u);try{var o=Object.assign({event:I},e);if(n.debug(\"GA4 Integration: pushing data to GTM: \"+a.stringify(o)),r.push(o),t){var g=Object.assign({event:_},i);n.debug(\"GA4 Integration: pushing custom data to GTM: \"+a.stringify(g)),r.push(g)}}catch(e){n.warn(\"GA4 Integration: Push to \"+u+\" failed: \"+e)}return Promise.resolve()},y={preRedirectPolicy:g.PreRedirectPolicies.PERSIST_BEFORE_REDIRECT,postRedirectPolicy:g.PostRedirectPolicies.TRACK_IMMEDIATELY,nonRedirectPolicy:g.NonRedirectPolicies.TRACK_IMMEDIATELY,trackLayerDecision:function(e){var i=e.integrationSettings;if(!i||!i[l])return n.debug(\"GA4 Integration: did not find vendor \"+l+\" in integration settings, exiting\"),void 0;if(!e.experimentId||!e.variationId)return n.debug(\"GA4 Integration: empty experiment or variation ID, exiting\"),void 0;var t=\"on\"===i[l].is_using_gtm;n.debug(\"GA4 Integration: is using GTM: \"+t);var a,r,o=\"equal_priority\"===e.layerPolicy;n.debug(\"GA4 Integration: is personalization campaign: \"+o),o?(a=\"OPT-\"+e.layerId+\"(\"+e.layerName+\")-\"+e.experimentId+\"(\"+e.experimentName+\")-\"+e.variationId+\"(\"+e.variationName+\")\",r={Campaign:e.layerName+\" (\"+e.layerId+\")\",Variation:e.variationName+\" (\"+e.variationId+\")\",Holdback:e.isLayerHoldback}):(a=\"OPT-\"+e.experimentId+\"(\"+e.experimentName+\")-\"+e.variationId+\"(\"+e.variationName+\")\",r={Experiment:e.experimentName+\" (\"+e.experimentId+\")\",Variation:e.variationName+\" (\"+e.variationId+\")\",Holdback:e.isLayerHoldback});var g={exp_variant_string:a,Holdback:e.isLayerHoldback};return t?p(g,r).catch((function(e){n.warn(\"Tracker for GTM \",l,\"failed:\",e)})):m(g,r).catch((function(e){n.warn(\"Tracker for \",l,\"failed:\",e)}))},serializeSettings:a.stringify,deserializeSettings:a.parse};e.exports=function(e){e.registerAnalyticsTracker(\"google_analytics_4\",y)}})";