{"version":3,"names":["SetSessionValues","constructor","postUrl","this","setSessionValues","params","URLSearchParams","window","location","search","data","utmSource","get","utmMedium","push","Key","value","length","fetch","method","headers","body","JSON","stringify","catch","error","console"],"sources":["assets/feature/forms/utm/setSessionValues.js"],"sourcesContent":["class SetSessionValues {\r\n constructor(postUrl) {\r\n this.postUrl = postUrl;\r\n }\r\n\r\n setSessionValues() {\r\n const params = new URLSearchParams(window.location.search);\r\n const data = [];\r\n\r\n // Check if \"utm_source\" or \"utm_medium\" is present\r\n const utmSource = params.get(\"utm_source\");\r\n const utmMedium = params.get(\"utm_medium\");\r\n\r\n if (utmSource) {\r\n data.push({ Key: \"utm_source\", value: utmSource });\r\n }\r\n if (utmMedium) {\r\n data.push({ Key: \"utm_medium\", value: utmMedium });\r\n }\r\n\r\n // Return if no relevant parameters are present\r\n if (data.length === 0) {\r\n return;\r\n }\r\n\r\n // Post the data to the server\r\n fetch(this.postUrl, {\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json; charset=utf-8\"\r\n },\r\n body: JSON.stringify(data)\r\n }).catch(error => {\r\n console.error(error);\r\n });\r\n }\r\n}\r\n\r\nnew SetSessionValues(\"/api/forms/SetSessionValues\").setSessionValues();"],"mappings":"AAAA,MAAMA,iBACF,WAAAC,CAAYC,GACRC,KAAKD,QAAUA,CACnB,CAEA,gBAAAE,GACI,MAAMC,EAAS,IAAIC,gBAAgBC,OAAOC,SAASC,QAC7CC,EAAO,GAGPC,EAAYN,EAAOO,IAAI,cACvBC,EAAYR,EAAOO,IAAI,cAEzBD,GACAD,EAAKI,KAAK,CAAEC,IAAK,aAAcC,MAAOL,IAEtCE,GACAH,EAAKI,KAAK,CAAEC,IAAK,aAAcC,MAAOH,IAItB,IAAhBH,EAAKO,QAKTC,MAAMf,KAAKD,QAAS,CAChBiB,OAAQ,OACRC,QAAS,CACL,eAAgB,mCAEpBC,KAAMC,KAAKC,UAAUb,KACtBc,OAAMC,IACLC,QAAQD,MAAMA,EAAM,GAE5B,EAGJ,IAAIzB,iBAAiB,+BAA+BI","ignoreList":[]}