{"version":3,"file":"js/7182-dd4418acdf174f07b87a.chunk.js","mappings":"mGACO,SAASA,EAAgBC,GAOA,OAA1BA,EAAUC,OAAOC,MAAkBF,EAAUC,OAAOC,KAAKC,WAAW,SACtEH,EAAUC,OAAOC,GAAG,KAExB,C,qDAGIE,OAAOJ,WACTI,OAAOJ,UAAUK,OAAM,IAAMN,EAAgBK,OAAOJ,Y","sources":["webpack://agra/./app/javascript/analytics/ensure-correct-segment-user-id.js"],"sourcesContent":["// we pass the global `analytics` in separately to assist us in stubbing easily with jest\nexport function ensureCslUserId(analytics) {\n // If the user_id saved in Segment's cookie/localStorage\n // doesn't match our member ID prefix, null the user ID so it is not\n // included with page or event tracking calls.\n\n // This can be wrong when Segment is also in use with a different identifier elsewhere\n // on the domain.\n if (analytics.user().id() !== null && !analytics.user().id().startsWith('csl-')) {\n analytics.user().id(null)\n }\n}\n\n// Wrap with analytics.ready() so that analytics.user() is available.\nif (window.analytics) {\n window.analytics.ready(() => ensureCslUserId(window.analytics))\n}\n"],"names":["ensureCslUserId","analytics","user","id","startsWith","window","ready"],"sourceRoot":""}