{"version":3,"file":"tikTokS2S-nqkBzbE1.js","sources":["../../../app/javascript/modules/tikTokS2S.js"],"sourcesContent":["import { v4 as uuidv4 } from \"uuid\";\nimport api from \"../api\";\n\nwindow.tikTokServerSideAnalytics = {\n  // Look at the _segment partial in the layout\n  // to see the middleware that calls this method\n  track(eventName, properties) {\n    const eventId = uuidv4();\n    window.ttq.track(eventName, properties, { event_id: eventId });\n    const urlParams = new URLSearchParams(window.location.search);\n    const ttclid = urlParams.get(\"ttclid\");\n    api.post(\"/tik_tok_s2s/track\", {\n      event: eventName,\n      properties,\n      event_id: eventId,\n      ttclid\n    });\n  }\n};\n"],"names":["eventName","properties","eventId","uuidv4","ttclid","api"],"mappings":"6EAGA,OAAO,0BAA4B,CAGjC,MAAMA,EAAWC,EAAY,CAC3B,MAAMC,EAAUC,EAAQ,EACxB,OAAO,IAAI,MAAMH,EAAWC,EAAY,CAAE,SAAUC,EAAS,EAE7D,MAAME,EADY,IAAI,gBAAgB,OAAO,SAAS,MAAM,EACnC,IAAI,QAAQ,EACrCC,EAAI,KAAK,qBAAsB,CAC7B,MAAOL,EACP,WAAAC,EACA,SAAUC,EACV,OAAAE,CACN,CAAK,CACL,CACA"}