{"version":3,"file":"js/pageChunk34-2dd2026edd766a2c291f.chunk.js","mappings":"+HAEMA,EAAc,aAiBpB,UAfgB,WACd,IAAQC,EAAsBC,EAAAA,EAAAA,MAAfC,EAAeD,EAAAA,EAAAA,WAE9B,GAAKD,GAAUE,IAAcC,SAASC,eAAeL,GAArD,CAIA,IAAMM,EAAYF,SAASG,cAAc,UACzCD,EAAUE,GAAKR,EACfM,EAAUG,KAAO,kBACjBH,EAAUI,UAAS,sUAAAC,OAAyUV,EAAK,OAEjWG,SAASQ,KAAKC,YAAYP,EAP1B,CAQF,C,qBCjBA,IAkBMJ,EAlBS,WACb,IAAMA,EAAe,CAAC,EAChBY,EAAOV,SAASQ,KAAKG,SAAW,CAAC,EAavC,OAXAC,OAAOC,KAAKH,GAAMI,SAAQ,SAACC,GACzB,IAAMC,EAAMN,EAAKK,GACjB,GAAIC,EAAIC,OAAS,EACf,IACEnB,EAAaiB,GAAOG,KAAKC,MAAMH,EACjC,CAAE,MAAOI,GACPtB,EAAaiB,GAAOC,CACtB,CAEJ,IAEOlB,CACT,CAEqBuB,GAErB,K","sources":["webpack://Emeritus/./app/javascript/chunks/marketing/loadGtm.js","webpack://Emeritus/./app/javascript/modules/bootstrapper/index.js"],"sourcesContent":["import bootstrapper from '../../modules/bootstrapper';\n\nconst gtmScriptId = 'gtm-script';\n\nconst loadGtm = () => {\n const { gtmId, gtmEnabled } = bootstrapper;\n\n if (!gtmId || !gtmEnabled || document.getElementById(gtmScriptId)) {\n return;\n }\n\n const gtmScript = document.createElement('script');\n gtmScript.id = gtmScriptId;\n gtmScript.type = 'text/javascript';\n gtmScript.innerHTML = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${gtmId}');`;\n\n document.head.appendChild(gtmScript);\n};\n\nexport default loadGtm;\n","const create = () => {\n const bootstrapper = {};\n const data = document.head.dataset || {};\n\n Object.keys(data).forEach((key) => {\n const val = data[key];\n if (val.length > 0) {\n try {\n bootstrapper[key] = JSON.parse(val);\n } catch (_) {\n bootstrapper[key] = val;\n }\n }\n });\n\n return bootstrapper;\n};\n\nconst bootstrapper = create();\n\nexport default bootstrapper;\n"],"names":["gtmScriptId","gtmId","bootstrapper","gtmEnabled","document","getElementById","gtmScript","createElement","id","type","innerHTML","concat","head","appendChild","data","dataset","Object","keys","forEach","key","val","length","JSON","parse","_","create"],"sourceRoot":""}