@fynd-design-engineering/fynd-one-v2 3.1.4 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(()=>{window.validationPassed=!1;function u(n="#phone-number",e="#country-code"){let t=typeof n=="string"?document.querySelector(n):n,o=document.querySelector(e);if(!t)return console.error("Phone input not found"),"91";if(!o)return console.error("Country code input not found"),"91";try{if(t.iti&&typeof t.iti.getSelectedCountryData=="function"){let i=t.iti.getSelectedCountryData();return o.value="+"+i.dialCode,i.dialCode}else if(window.intlTelInputGlobals&&typeof window.intlTelInputGlobals.getInstance=="function"){let i=window.intlTelInputGlobals.getInstance(t);if(i){let r=i.getSelectedCountryData();return o.value="+"+r.dialCode,r.dialCode}}return o.value="+91","91"}catch(i){return console.error("Error retrieving country code:",i),o.value="+91","91"}}function c(){let n=document.getElementById("product"),e=document.getElementById("page-url");e&&(e.value=window.location.href),n&&(n.value=document.title)}function m(){if(!window.redirectionOptions||!window.redirectionOptions.newTab)return console.error("window.redirectionOptions not found or missing newTab property"),null;let n=window.redirectionOptions.newTab,e=document.getElementById("first-name"),t=document.getElementById("last-name"),o=document.getElementById("work-email");if(!e||!e.value.trim()||!t||!t.value.trim()||!o||!o.value.trim())return console.error("Required fields missing or empty"),null;let i=`${e.value} ${t.value}`.trim(),r=o.value;return`${n}?email=${encodeURIComponent(r)}&name=${encodeURIComponent(i)}`}function w(){if(!window.redirectionOptions||!window.redirectionOptions.newTab)return console.error("window.redirectionOptions not found or missing newTab property"),null;let n=window.redirectionOptions.newTab,e=document.getElementById("first-name"),t=document.getElementById("last-name"),o=document.getElementById("work-email"),i=document.getElementById("message");if(!e||!e.value.trim()||!t||!t.value.trim()||!o||!o.value.trim())return console.error("Required fields missing or empty"),null;try{let r=new URL(n);return["email","firstname","lastname","message","Email","FirstName","LastName","Message"].forEach(d=>r.searchParams.delete(d)),r.searchParams.set("email",o.value.trim()),r.searchParams.set("firstname",e.value.trim()),r.searchParams.set("lastname",t.value.trim()),i&&i.value.trim()&&r.searchParams.set("message",i.value.trim()),r.toString()}catch(r){return console.error("Invalid URL:",r),null}}function l(){try{typeof a=="function"?a():window.location.href="/thank-you"}catch(n){console.error("Error during form submission:",n)}}function a(){if(!window.redirectionOptions||!window.redirectionOptions.type){console.error("window.redirectionOptions not found or missing type property");return}switch(window.redirectionOptions.type){case"calendly":p();break;case"hubspot":f();break;case"webflow":v();break;default:console.error("Invalid redirection type:",window.redirectionOptions.type);return}}function p(){let n=m(),e=window.redirectionOptions?.currentTab;n&&window.open(n,"_blank"),e&&(window.location.href=e)}function f(){let n=w(),e=window.redirectionOptions?.currentTab;n&&window.open(n,"_blank"),e&&(window.location.href=e)}function v(){let n=window.redirectionOptions?.newTab,e=window.redirectionOptions?.currentTab;n&&window.open(n,"_blank"),e&&(window.location.href=e)}function y(){document.querySelectorAll("select").forEach(e=>{let t=e.querySelector("option:first-child");t&&(t.setAttribute("value",""),t.setAttribute("disabled","disabled"),t.setAttribute("selected","selected"),e.selectedIndex=0,e.classList.add("placeholder-active"),e.value===""&&(e.style.color="#999999"),e.addEventListener("change",()=>{e.value?(e.style.color="",e.classList.remove("placeholder-active")):(e.style.color="#999999",e.classList.add("placeholder-active"))}))}),console.log("Select placeholders initialized")}function b(){let n=document.querySelector("[data-form-handler]"),e=document.querySelector("#phone-number");if(!n||!e){console.error("Form or phone field not found");return}e.addEventListener("invalid",t=>{if(window.validatePhone){let o=window.validatePhone("phone-number",e.value);o.isValid||e.setCustomValidity(o.message||"Please enter a valid phone number")}}),e.addEventListener("input",()=>{e.setCustomValidity("")}),e.addEventListener("blur",()=>{if(window.validatePhone){let t=window.validatePhone("phone-number",e.value);!t.isValid&&e.value.trim()!==""?e.setCustomValidity(t.message||"Please enter a valid phone number"):e.setCustomValidity("")}}),n.addEventListener("submit",t=>{let o;if(typeof window.validatePhoneCustom=="function")o=window.validatePhoneCustom("phone-number",e.value);else if(typeof window.validatePhone=="function")o=window.validatePhone("phone-number",e.value);else return console.error("No phone validation function available"),t.preventDefault(),!1;return o.isValid?(e.setCustomValidity(""),console.log("Validation passed, allowing form submission"),window.validationPassed=!0,window._formSubmissionTime=Date.now(),setTimeout(()=>{console.log("Executing delayed redirection"),l()},3e3),!0):(e.setCustomValidity(o.message||"Please enter a valid phone number"),t.preventDefault(),e.focus(),!1)},!0),(window.jQuery||window.$)&&(window.jQuery||window.$)(document).on("webflow-form-success",o=>{o.target===n&&(console.log("Webflow success event detected"),window.posthog&&window.getTrackingPropertiesWithForm&&window.posthog.capture("form_success",window.getTrackingPropertiesWithForm(window.interactedForm||"unknown_form")),l())}),console.log("Form validation and redirection setup complete")}document.addEventListener("DOMContentLoaded",()=>{let n=document.querySelector("#phone-number");n&&n.addEventListener("blur",()=>{if(typeof window.validatePhone=="function"){let e=window.validatePhone("phone-number",n.value);!e.isValid&&n.value.trim()!==""?n.setCustomValidity(e.message||"Please enter a valid phone number"):n.setCustomValidity("")}}),y(),u(),c(),b()});})();
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../bin/live-reload.js", "../../src/form/handler.ts"],
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "/**\n * Form Validation and Submission Script for Webflow\n * Handles phone validation, form submission prevention, and redirection logic\n * conververted version of https://cdn.jsdelivr.net/gh/Fynd-Design-Engineering/fynd-one@4.0.1/form/handler.min.js\n */\n\n// Type definitions\ninterface CountryData {\n dialCode: string;\n iso2: string;\n name: string;\n }\n \n interface IntlTelInputInstance {\n getSelectedCountryData(): CountryData;\n }\n \n interface PhoneInputElement extends HTMLInputElement {\n iti?: IntlTelInputInstance;\n }\n \n interface ValidationResult {\n isValid: boolean;\n message?: string;\n }\n \n interface RedirectionOptions {\n type: 'calendly' | 'hubspot' | 'webflow';\n newTab?: string;\n currentTab?: string;\n }\n \n // Extending Window interface for global variables\n declare global {\n interface Window {\n validationPassed?: boolean;\n _formSubmissionTime?: number;\n redirectionOptions?: RedirectionOptions;\n intlTelInputGlobals?: {\n getInstance(element: HTMLElement): IntlTelInputInstance | null;\n };\n validatePhone?: (selector: string, value: string) => ValidationResult;\n validatePhoneCustom?: (selector: string, value: string) => ValidationResult;\n jQuery?: any;\n $?: any;\n }\n }\n \n window.validationPassed = false; // Global flag to track validation status\n \n /**\n * Updates a hidden input with the country code from an initialized intl-tel-input element\n *\n * @param phoneInputSelector - Phone input element or its selector\n * @param countryCodeInputId - ID of the hidden input to update with country code\n */\n function updateCountryCode(\n phoneInputSelector: string | HTMLElement = \"#phone-number\",\n countryCodeInputId: string = \"#country-code\"\n ): string {\n const phoneInput: PhoneInputElement | null = \n typeof phoneInputSelector === \"string\"\n ? document.querySelector<PhoneInputElement>(phoneInputSelector)\n : phoneInputSelector as PhoneInputElement;\n \n const countryCodeInput = document.querySelector<HTMLInputElement>(countryCodeInputId);\n \n if (!phoneInput) {\n console.error(\"Phone input not found\");\n return \"91\";\n }\n \n if (!countryCodeInput) {\n console.error(\"Country code input not found\");\n return \"91\";\n }\n \n try {\n // Try to get country data directly - this will fail gracefully if not possible\n if (\n phoneInput.iti &&\n typeof phoneInput.iti.getSelectedCountryData === \"function\"\n ) {\n const countryData = phoneInput.iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n } else if (\n window.intlTelInputGlobals &&\n typeof window.intlTelInputGlobals.getInstance === \"function\"\n ) {\n // Try using the global instance\n const iti = window.intlTelInputGlobals.getInstance(phoneInput);\n if (iti) {\n const countryData = iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n }\n }\n \n // Default to India's country code (+91)\n countryCodeInput.value = \"+91\";\n return \"91\";\n } catch (error) {\n console.error(\"Error retrieving country code:\", error);\n // Default to India in case of error\n countryCodeInput.value = \"+91\";\n return \"91\";\n }\n }\n \n /**\n * Updates hidden inputs with page data like URL and page title\n */\n function updatePageData(): void {\n const productInput = document.getElementById(\"product\") as HTMLInputElement | null;\n const pageUrlInput = document.getElementById(\"page-url\") as HTMLInputElement | null;\n \n if (pageUrlInput) {\n pageUrlInput.value = window.location.href;\n }\n \n if (productInput) {\n productInput.value = document.title;\n }\n }\n \n /**\n * Generates a Calendly URL with user's information\n * @returns The Calendly URL or null if required fields are missing\n */\n function generateCalendlyURL(): string | null {\n if (!window.redirectionOptions || !window.redirectionOptions.newTab) {\n console.error(\n \"window.redirectionOptions not found or missing newTab property\"\n );\n return null;\n }\n \n const baseURL = window.redirectionOptions.newTab;\n const nameField = document.getElementById(\"first-name\") as HTMLInputElement | null;\n const lastNameField = document.getElementById(\"last-name\") as HTMLInputElement | null;\n const emailField = document.getElementById(\"work-email\") as HTMLInputElement | null;\n \n if (\n !nameField ||\n !nameField.value.trim() ||\n !lastNameField ||\n !lastNameField.value.trim() ||\n !emailField ||\n !emailField.value.trim()\n ) {\n console.error(\"Required fields missing or empty\");\n return null;\n }\n \n const fullName = `${nameField.value} ${lastNameField.value}`.trim();\n const email = emailField.value;\n const updatedURL = `${baseURL}?email=${encodeURIComponent(\n email\n )}&name=${encodeURIComponent(fullName)}`;\n return updatedURL;\n }\n \n /**\n * Generates a Hubspot URL with user's information\n * @returns The Hubspot URL or null if required fields are missing\n */\n function generateHubspotURL(): string | null {\n if (!window.redirectionOptions || !window.redirectionOptions.newTab) {\n console.error(\n \"window.redirectionOptions not found or missing newTab property\"\n );\n return null;\n }\n \n const baseURL = window.redirectionOptions.newTab;\n const nameField = document.getElementById(\"first-name\") as HTMLInputElement | null;\n const lastNameField = document.getElementById(\"last-name\") as HTMLInputElement | null;\n const emailField = document.getElementById(\"work-email\") as HTMLInputElement | null;\n const messageField = document.getElementById(\"message\") as HTMLTextAreaElement | null; // Optional field\n \n // Check only REQUIRED fields\n if (\n !nameField ||\n !nameField.value.trim() ||\n !lastNameField ||\n !lastNameField.value.trim() ||\n !emailField ||\n !emailField.value.trim()\n ) {\n console.error(\"Required fields missing or empty\");\n return null;\n }\n \n try {\n const url = new URL(baseURL);\n \n // Remove any existing params to avoid conflicts\n const paramsToRemove = [\n 'email', 'firstname', 'lastname', 'message',\n 'Email', 'FirstName', 'LastName', 'Message'\n ];\n \n paramsToRemove.forEach(param => url.searchParams.delete(param));\n \n // Add required parameters\n url.searchParams.set(\"email\", emailField.value.trim());\n url.searchParams.set(\"firstname\", nameField.value.trim());\n url.searchParams.set(\"lastname\", lastNameField.value.trim());\n \n // Add company parameter ONLY if field exists and has value\n if (messageField && messageField.value.trim()) {\n url.searchParams.set(\"message\", messageField.value.trim());\n }\n \n return url.toString();\n } catch (error) {\n console.error(\"Invalid URL:\", error);\n return null;\n }\n }\n \n\n \n /**\n * Handles the form submission process and redirection\n */\n function handleFormSubmission(): void {\n try {\n if (typeof handleRedirection === \"function\") {\n handleRedirection();\n } else {\n window.location.href = \"/thank-you\";\n }\n } catch (error) {\n console.error(\"Error during form submission:\", error);\n }\n }\n \n /**\n * Determines which type of redirection to perform\n */\n function handleRedirection(): void {\n if (!window.redirectionOptions || !window.redirectionOptions.type) {\n console.error(\n \"window.redirectionOptions not found or missing type property\"\n );\n return;\n }\n \n switch (window.redirectionOptions.type) {\n case \"calendly\":\n handleCalendlyRedirection();\n break;\n case \"hubspot\":\n handleHubspotRedirection();\n break;\n case \"webflow\":\n handleWebflowRedirection();\n break;\n default:\n console.error(\n \"Invalid redirection type:\",\n window.redirectionOptions.type\n );\n return;\n }\n }\n \n /**\n * Handles Calendly-specific redirection\n */\n function handleCalendlyRedirection(): void {\n const newTabUrl = generateCalendlyURL();\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Handles HubSpot-specific redirection\n */\n function handleHubspotRedirection(): void {\n const newTabUrl = generateHubspotURL();\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Handles Webflow-specific redirection\n */\n function handleWebflowRedirection(): void {\n const newTabUrl = window.redirectionOptions?.newTab;\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Converts the first option in select fields to actual placeholders with styling\n */\n function setupSelectPlaceholders(): void {\n // Find all select elements\n const selectFields = document.querySelectorAll<HTMLSelectElement>(\"select\");\n \n selectFields.forEach((select: HTMLSelectElement) => {\n // Get the first option\n const firstOption = select.querySelector<HTMLOptionElement>(\"option:first-child\");\n \n if (firstOption) {\n // Make it a true placeholder by adding these attributes\n firstOption.setAttribute(\"value\", \"\");\n firstOption.setAttribute(\"disabled\", \"disabled\");\n firstOption.setAttribute(\"selected\", \"selected\");\n \n // Set the select's initial selectedIndex to 0 (the placeholder)\n select.selectedIndex = 0;\n \n // Add a class to the select element to style it when showing placeholder\n select.classList.add(\"placeholder-active\");\n \n // Style the select element when showing the placeholder\n if (select.value === \"\") {\n select.style.color = \"#999999\"; // Placeholder color (gray)\n }\n \n // Change color when user selects a real option\n select.addEventListener(\"change\", () => {\n if (select.value) {\n select.style.color = \"\"; // Reset to default text color\n select.classList.remove(\"placeholder-active\");\n } else {\n select.style.color = \"#999999\"; // Back to placeholder color\n select.classList.add(\"placeholder-active\");\n }\n });\n }\n });\n \n console.log(\"Select placeholders initialized\");\n }\n \n /**\n * Override Webflow's form submission functionality\n */\n function overrideWebflowFormSubmission(): void {\n const form = document.querySelector<HTMLFormElement>(\"[data-form-handler]\");\n const phoneField = document.querySelector<HTMLInputElement>(\"#phone-number\");\n \n if (!form || !phoneField) {\n console.error(\"Form or phone field not found\");\n return;\n }\n \n // Add validation using setCustomValidity\n phoneField.addEventListener(\"invalid\", (event: Event) => {\n if (window.validatePhone) {\n const validation = window.validatePhone(\"phone-number\", phoneField.value);\n if (!validation.isValid) {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n }\n }\n });\n \n phoneField.addEventListener(\"input\", () => {\n phoneField.setCustomValidity(\"\");\n });\n \n phoneField.addEventListener(\"blur\", () => {\n if (window.validatePhone) {\n const validation = window.validatePhone(\"phone-number\", phoneField.value);\n if (!validation.isValid && phoneField.value.trim() !== \"\") {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n } else {\n phoneField.setCustomValidity(\"\");\n }\n }\n });\n \n // Handle form submission with redirection\n form.addEventListener(\n \"submit\",\n (event: Event) => {\n // Use validatePhoneCustom as primary method (more reliable)\n let validation: ValidationResult;\n if (typeof window.validatePhoneCustom === \"function\") {\n validation = window.validatePhoneCustom(\n \"phone-number\",\n phoneField.value\n );\n } else if (typeof window.validatePhone === \"function\") {\n validation = window.validatePhone(\"phone-number\", phoneField.value);\n } else {\n console.error(\"No phone validation function available\");\n event.preventDefault();\n return false;\n }\n \n if (!validation.isValid) {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n event.preventDefault();\n phoneField.focus();\n return false;\n } else {\n phoneField.setCustomValidity(\"\");\n \n console.log(\"Validation passed, allowing form submission\");\n window.validationPassed = true;\n window._formSubmissionTime = Date.now();\n \n // Set up a delayed redirection that gives Webflow time to process\n setTimeout(() => {\n console.log(\"Executing delayed redirection\");\n handleFormSubmission();\n }, 3000);\n \n // Let the form submit normally\n return true;\n }\n },\n true\n );\n \n // Additional Webflow success detection\n if (window.jQuery || window.$) {\n const $ = window.jQuery || window.$;\n \n // Listen for Webflow's success event\n $(document).on(\"webflow-form-success\", (e: any) => {\n if (e.target === form) {\n console.log(\"Webflow success event detected\");\n if (window.posthog && window.getTrackingPropertiesWithForm) {\n window.posthog.capture(\n \"form_success\",\n window.getTrackingPropertiesWithForm(\n window.interactedForm || \"unknown_form\"\n )\n );\n }\n \n handleFormSubmission();\n } else {\n // event for error in future\n }\n });\n }\n \n console.log(\"Form validation and redirection setup complete\");\n }\n \n /**\n * Initialize everything when the DOM is ready\n */\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Detect phone input\n const phoneField = document.querySelector<HTMLInputElement>(\"#phone-number\");\n if (phoneField) {\n // Add validation on blur - using only browser validation\n phoneField.addEventListener(\"blur\", () => {\n if (typeof window.validatePhone === \"function\") {\n const validation = window.validatePhone(\n \"phone-number\",\n phoneField.value\n );\n if (!validation.isValid && phoneField.value.trim() !== \"\") {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n } else {\n phoneField.setCustomValidity(\"\");\n }\n }\n });\n }\n \n // Select placeholders\n setupSelectPlaceholders();\n \n // Initialize country code and page data\n updateCountryCode();\n updatePageData();\n \n // Override Webflow form submission\n overrideWebflowFormSubmission();\n });\n\n// Export to make this file a module (fixes TypeScript global augmentation error)\nexport {};"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACsCE,SAAO,mBAAmB;AAQ1B,WAAS,kBACP,qBAA2C,iBAC3C,qBAA6B,iBACrB;AACR,UAAM,aACJ,OAAO,uBAAuB,WAC1B,SAAS,cAAiC,kBAAkB,IAC5D;AAEN,UAAM,mBAAmB,SAAS,cAAgC,kBAAkB;AAEpF,QAAI,CAAC,YAAY;AACf,cAAQ,MAAM,uBAAuB;AACrC,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,kBAAkB;AACrB,cA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D,YAAI,EAAE,WAAW,MAAM;AACrB,kBAAQ,IAAI,gCAAgC;AAC5C,cAAI,OAAO,WAAW,OAAO,+BAA+B;AAC1D,mBAAO,QAAQ;AAAA,cACb;AAAA,cACA,OAAO;AAAA,gBACL,OAAO,kBAAkB;AAAA,cAC3B;AAAA,YACF;AAAA,UACF;AAEA,+BAAqB;AAAA,QACvB,OAAO;AAAA,QAEP;AAAA,MACF,CAAC;AAAA,IACH;AAEA,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;AAKA,WAAS,iBAAiB,oBAAoB,MAAM;AAElD,UAAM,aAAa,SAAS,cAAgC,eAAe;AAC3E,QAAI,YAAY;AAEd,iBAAW,iBAAiB,QAAQ,MAAM;AACxC,YAAI,OAAO,OAAO,kBAAkB,YAAY;AAC9C,gBAAM,aAAa,OAAO;AAAA,YACxB;AAAA,YACA,WAAW;AAAA,UACb;AACA,cAAI,CAAC,WAAW,WAAW,WAAW,MAAM,KAAK,MAAM,IAAI;AACzD,uBAAW;AAAA,cACT,WAAW,WAAW;AAAA,YACxB;AAAA,UACF,OAAO;AACL,uBAAW,kBAAkB,EAAE;AAAA,UACjC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAGA,4BAAwB;AAGxB,sBAAkB;AAClB,mBAAe;AAGf,kCAA8B;AAAA,EAChC,CAAC;",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- "use strict";(()=>{var u=()=>{let r={};try{let t=null;if(typeof window.getUserJourney=="function"&&(t=window.getUserJourney()),!t){let e=sessionStorage.getItem("userJourney");e&&(t=JSON.parse(e))}if(t&&t.formDetails){let e=t.formDetails;e.formId&&(r.form_id=e.formId),e.formName&&(r.form_name=e.formName),e.firstName&&(r.form_first_name=e.firstName),e.lastName&&(r.form_last_name=e.lastName),e.email&&(r.form_email=e.email),e.phone&&(r.form_phone=e.phone)}}catch(t){console.warn("Error getting user journey data for GA tracking:",t)}return r},f=()=>{let t={"fynd_website.source_page":window.location.pathname,"fynd_website.product":"fynd.com website","fynd_website.device_type":"Unknown","fynd_website.utm_source":new URLSearchParams(window.location.search).get("utm_source")||"","fynd_website.utm_medium":new URLSearchParams(window.location.search).get("utm_medium")||"","fynd_website.utm_campaign":new URLSearchParams(window.location.search).get("utm_campaign")||"","fynd_website.referrer":document.referrer};try{let e=null;if(typeof window.getUserJourney=="function"&&(e=window.getUserJourney()),!e){let n=sessionStorage.getItem("userJourney");n&&(e=JSON.parse(n))}if(e){if(t["fynd_website.journey_touchpoints"]=e.userJourney||e,e.formDetails){let n=e.formDetails;n.formId&&(t["fynd_website.form_id"]=n.formId),n.formName&&(t["fynd_website.form_name"]=n.formName),n.firstName&&(t["fynd_website.form_first_name"]=n.firstName),n.lastName&&(t["fynd_website.form_last_name"]=n.lastName),n.email&&(t["fynd_website.form_email"]=n.email),n.phone&&(t["fynd_website.form_phone"]=n.phone)}if(e.userJourney&&e.userJourney.length>0){t["fynd_website.journey_total_pages"]=e.userJourney.length,t["fynd_website.journey_touchpoints_count"]=e.userJourney.length,t["fynd_website.journey_first_page"]=e.userJourney[0].page,t["fynd_website.journey_current_page"]=e.userJourney[e.userJourney.length-1].page;let n=new Date(e.userJourney[0].time),s=new Date(e.userJourney[e.userJourney.length-1].time);t["fynd_website.journey_session_duration"]=Math.floor((s.getTime()-n.getTime())/1e3),t["fynd_website.journey_entry_time"]=e.userJourney[0].time,t["fynd_website.journey_exit_time"]=e.userJourney[e.userJourney.length-1].time}e.deviceCategory&&(t["fynd_website.device_type"]=e.deviceCategory),e.browser&&(t["fynd_website.journey_browser"]=e.browser),e.device&&(t["fynd_website.journey_device"]=e.device),e.origin&&(t["fynd_website.journey_origin"]=e.origin),e.utmPath&&(t["fynd_website.journey_utm_path"]=e.utmPath),e.scrollDepth&&(t["fynd_website.journey_scroll_depth"]=e.scrollDepth)}}catch(e){console.warn("Error getting user journey data for tracking:",e)}if(t["fynd_website.device_type"]==="Unknown"){let e=navigator.userAgent;/iPad/.test(e)||/Android/.test(e)&&!/Mobile/.test(e)||/Tablet/.test(e)?t["fynd_website.device_type"]="Tablet":/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(e)?t["fynd_website.device_type"]="Mobile":t["fynd_website.device_type"]="Desktop"}return t},g=(r,t,e)=>{if(window.dataLayer){let n={event:r,event_category:"form_interaction",event_label:r,...t};e?.submitted_form&&(n.submitted_form=e.submitted_form),window.dataLayer.push(n),console.log("Event sent to GA:",n)}else console.log("dataLayer not available for GA tracking")},o=(r,t)=>{try{let e=f(),n=t?{...e,...t}:e;window.posthog&&window.posthog.capture(r,n);let s=u();(r.includes("form")||Object.keys(s).length>0||t?.submitted_form)&&g(r,s,t)}catch(e){console.error("Error tracking event:",e)}},_=r=>{let t=r.closest("form");return t&&(t.getAttribute("data-name")||t.getAttribute("name")||t.id)||null};document.addEventListener("DOMContentLoaded",function(){let r=f();window.posthog&&window.posthog.capture("$pageview",r)});window.addEventListener("load",function(){let r=f();console.log("Tracking Properties on Page Load:",r),o("fynd_website.page.loaded"),l()});function l(){if(window.location.pathname==="/thank-you"){let t=performance.getEntriesByType("navigation");t.length>0&&(t[0].type==="reload"||document.referrer&&new URL(document.referrer).origin===window.location.origin)&&setTimeout(()=>{o("fynd_website.form.success")},200)}}document.addEventListener("DOMContentLoaded",function(){let r=document.querySelectorAll('[data-ph="sign-up"]'),t=document.querySelectorAll('[data-ph="sign-in"]'),e=document.querySelectorAll('[href="#footer-form"]'),n=document.querySelectorAll('[data-ph="book-a-demo"]');document.querySelectorAll('[type="submit"]').forEach(i=>{i.addEventListener("click",function(){let a=_(this);setTimeout(()=>{window.validationPassed===!0&&o("fynd_website.form.submitted",a?{submitted_form:a}:{})},100)})}),r.forEach(i=>{i.addEventListener("click",function(){o("fynd_website.sign_up.clicked")})}),t.forEach(i=>{i.addEventListener("click",function(){o("fynd_website.sign_in.clicked")})}),e.forEach(i=>{i.addEventListener("click",function(){o("fynd_website.scroll_to_form.clicked")})}),n.forEach(i=>{i.addEventListener("click",function(){o("fynd_website.book_a_demo.clicked")})});let d=document.querySelectorAll("[ph-form-field]"),m=new Set;d.forEach(i=>{let a=i.tagName.toLowerCase()==="select"?"change":"input";i.addEventListener(a,function(){let c=_(this)||"unknown-form";m.has(c)||(m.add(c),o("fynd_website.form.started"))})})});window.getPosthogTrackingProperties=f;window.trackEvent=o;window.getGaTrackingProperties=u;})();
1
+ "use strict";(()=>{var g=()=>{let r={};try{let t=null;if(typeof window.getUserJourney=="function"&&(t=window.getUserJourney()),!t){let e=sessionStorage.getItem("userJourney");e&&(t=JSON.parse(e))}if(t&&t.formDetails){let e=t.formDetails;e.formId&&(r.form_id=e.formId),e.formName&&(r.form_name=e.formName),e.firstName&&(r.form_first_name=e.firstName),e.lastName&&(r.form_last_name=e.lastName),e.email&&(r.form_email=e.email),e.phone&&(r.form_phone=e.phone)}}catch(t){console.warn("Error getting user journey data for GA tracking:",t)}return r},f=()=>{let t={"fynd_website.source_page":window.location.pathname,"fynd_website.product":"fynd.com website","fynd_website.device_type":"Unknown","fynd_website.utm_source":new URLSearchParams(window.location.search).get("utm_source")||"","fynd_website.utm_medium":new URLSearchParams(window.location.search).get("utm_medium")||"","fynd_website.utm_campaign":new URLSearchParams(window.location.search).get("utm_campaign")||"","fynd_website.referrer":document.referrer};try{let e=null;if(typeof window.getUserJourney=="function"&&(e=window.getUserJourney()),!e){let n=sessionStorage.getItem("userJourney");n&&(e=JSON.parse(n))}if(e){if(t["fynd_website.journey_touchpoints"]=e.userJourney||e,e.formDetails){let n=e.formDetails;n.formId&&(t["fynd_website.form_id"]=n.formId),n.formName&&(t["fynd_website.form_name"]=n.formName),n.firstName&&(t["fynd_website.form_first_name"]=n.firstName),n.lastName&&(t["fynd_website.form_last_name"]=n.lastName),n.email&&(t["fynd_website.form_email"]=n.email),n.phone&&(t["fynd_website.form_phone"]=n.phone)}if(e.userJourney&&e.userJourney.length>0){t["fynd_website.journey_total_pages"]=e.userJourney.length,t["fynd_website.journey_touchpoints_count"]=e.userJourney.length,t["fynd_website.journey_first_page"]=e.userJourney[0].page,t["fynd_website.journey_current_page"]=e.userJourney[e.userJourney.length-1].page;let n=new Date(e.userJourney[0].time),a=new Date(e.userJourney[e.userJourney.length-1].time);t["fynd_website.journey_session_duration"]=Math.floor((a.getTime()-n.getTime())/1e3),t["fynd_website.journey_entry_time"]=e.userJourney[0].time,t["fynd_website.journey_exit_time"]=e.userJourney[e.userJourney.length-1].time}e.deviceCategory&&(t["fynd_website.device_type"]=e.deviceCategory),e.browser&&(t["fynd_website.journey_browser"]=e.browser),e.device&&(t["fynd_website.journey_device"]=e.device),e.origin&&(t["fynd_website.journey_origin"]=e.origin),e.utmPath&&(t["fynd_website.journey_utm_path"]=e.utmPath),e.scrollDepth&&(t["fynd_website.journey_scroll_depth"]=e.scrollDepth)}}catch(e){console.warn("Error getting user journey data for tracking:",e)}if(t["fynd_website.device_type"]==="Unknown"){let e=navigator.userAgent;/iPad/.test(e)||/Android/.test(e)&&!/Mobile/.test(e)||/Tablet/.test(e)?t["fynd_website.device_type"]="Tablet":/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(e)?t["fynd_website.device_type"]="Mobile":t["fynd_website.device_type"]="Desktop"}return t},l=(r,t,e)=>{if(window.dataLayer){let n={event:r,event_category:"form_interaction",event_label:r,...t};e?.submitted_form&&(n.submitted_form=e.submitted_form),window.dataLayer.push(n),console.log("Event sent to GA:",n)}else console.log("dataLayer not available for GA tracking")},i=(r,t)=>{try{let e=f(),n=t?{...e,...t}:e;window.posthog&&(window.posthog.capture(r,n),console.log("Event sent to PostHog:",{event:r,properties:n}));let a=g();(r.includes("form")||Object.keys(a).length>0||t?.submitted_form)&&l(r,a,t)}catch(e){console.error("Error tracking event:",e)}},y=r=>{let t=r.closest("form");return t&&(t.getAttribute("data-name")||t.getAttribute("name")||t.id)||null};document.addEventListener("DOMContentLoaded",function(){let r=f();window.posthog&&window.posthog.capture("$pageview",r)});window.addEventListener("load",function(){let r=f();console.log("Tracking Properties on Page Load:",r),i("fynd_website.page.loaded"),w()});function w(){if(window.location.pathname==="/thank-you"){let t=performance.getEntriesByType("navigation");t.length>0&&(t[0].type==="reload"||document.referrer&&new URL(document.referrer).origin===window.location.origin)&&setTimeout(()=>{i("fynd_website.form.success")},200)}}document.addEventListener("DOMContentLoaded",function(){let r=document.querySelectorAll('[data-ph="sign-up"]'),t=document.querySelectorAll('[data-ph="sign-in"]'),e=document.querySelectorAll('[href="#footer-form"]'),n=document.querySelectorAll('[data-ph="book-a-demo"]');document.querySelectorAll('[type="submit"]').forEach(o=>{o.addEventListener("click",function(){let s=y(this);setTimeout(()=>{window.validationPassed===!0&&i("fynd_website.form.submitted",s?{submitted_form:s}:{})},10)})}),r.forEach(o=>{o.addEventListener("click",function(){i("fynd_website.sign_up.clicked")})}),t.forEach(o=>{o.addEventListener("click",function(){i("fynd_website.sign_in.clicked")})}),e.forEach(o=>{o.addEventListener("click",function(){i("fynd_website.scroll_to_form.clicked")})}),n.forEach(o=>{o.addEventListener("click",function(){i("fynd_website.book_a_demo.clicked")})});let c=document.querySelectorAll("[ph-form-field]"),u=new Set;c.forEach(o=>{let s=o.tagName.toLowerCase(),m=o.type?.toLowerCase(),d=function(){let _=y(this)||"unknown-form";u.has(_)||(u.add(_),i("fynd_website.form.started"))};s==="button"||s==="input"&&m==="submit"||o.addEventListener("focus",d),s==="button"||s==="input"&&m==="submit"?o.addEventListener("click",d):s==="select"?o.addEventListener("change",d):o.addEventListener("input",d)})});window.getPosthogTrackingProperties=f;window.trackEvent=i;window.getGaTrackingProperties=g;})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/posthog/main.ts"],
4
- "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// trackingIntegration.ts - PostHog tracking with user journey integration\nimport { FormDetails, UserJourney } from '../utils/types/user-journey';\n\n// TypeScript interface for GTM dataLayer events\ninterface GTMEvent {\n event: string;\n event_category: string;\n event_label: string;\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n [key: string]: any; // Allow additional properties\n}\n\n// GA tracking properties interface (form-related only)\ninterface GATrackingProperties {\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n}\n\n// Define tracking properties interface\ninterface TrackingProperties {\n 'fynd_website.source_page': string;\n 'fynd_website.product': string;\n 'fynd_website.device_type': string;\n 'fynd_website.utm_source': string;\n 'fynd_website.utm_medium': string;\n 'fynd_website.utm_campaign': string;\n 'fynd_website.referrer': string;\n // Form details from user journey\n 'fynd_website.form_id'?: string;\n 'fynd_website.form_name'?: string;\n 'fynd_website.form_first_name'?: string;\n 'fynd_website.form_last_name'?: string;\n 'fynd_website.form_email'?: string;\n 'fynd_website.form_phone'?: string;\n // User journey details\n 'fynd_website.journey_total_pages'?: number;\n 'fynd_website.journey_session_duration'?: number;\n 'fynd_website.journey_first_page'?: string;\n 'fynd_website.journey_current_page'?: string;\n 'fynd_website.journey_device'?: string;\n 'fynd_website.journey_browser'?: string;\n 'fynd_website.journey_device_name'?: string;\n 'fynd_website.journey_origin'?: string;\n 'fynd_website.journey_touchpoints'?: any; // Array of touchpoints from userJourney field\n 'fynd_website.journey_touchpoints_count'?: number;\n 'fynd_website.journey_utm_path'?: string;\n 'fynd_website.journey_entry_time'?: string;\n 'fynd_website.journey_exit_time'?: string;\n 'fynd_website.journey_scroll_depth'?: number;\n // Additional event-specific properties\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any; // Allow additional properties\n}\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n getPosthogTrackingProperties: () => TrackingProperties;\n getGaTrackingProperties: () => GATrackingProperties;\n validationPassed?: boolean;\n getUserJourney: () => UserJourney | null;\n dataLayer?: GTMEvent[];\n }\n}\n\n// GA tracking properties function (form-related data only)\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey && journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n gaProperties.form_id = formDetails.formId;\n }\n if (formDetails.formName) {\n gaProperties.form_name = formDetails.formName;\n }\n if (formDetails.firstName) {\n gaProperties.form_first_name = formDetails.firstName;\n }\n if (formDetails.lastName) {\n gaProperties.form_last_name = formDetails.lastName;\n }\n if (formDetails.email) {\n gaProperties.form_email = formDetails.email;\n }\n if (formDetails.phone) {\n gaProperties.form_phone = formDetails.phone;\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for GA tracking:', error);\n }\n\n return gaProperties;\n};\n\n// Enhanced tracking properties function\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n // Base tracking properties\n const baseProperties: TrackingProperties = {\n 'fynd_website.source_page': pathname,\n 'fynd_website.product': \"fynd.com website\",\n 'fynd_website.device_type': \"Unknown\", // Will be updated from user journey\n 'fynd_website.utm_source':\n new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n 'fynd_website.utm_medium':\n new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n 'fynd_website.utm_campaign':\n new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n 'fynd_website.referrer': document.referrer,\n };\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey) {\n // Add the complete user journey object as touchpoints\n baseProperties['fynd_website.journey_touchpoints'] = journey.userJourney || journey;\n\n // Add form details if available\n if (journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n baseProperties['fynd_website.form_id'] = formDetails.formId;\n }\n if (formDetails.formName) {\n baseProperties['fynd_website.form_name'] = formDetails.formName;\n }\n if (formDetails.firstName) {\n baseProperties['fynd_website.form_first_name'] = formDetails.firstName;\n }\n if (formDetails.lastName) {\n baseProperties['fynd_website.form_last_name'] = formDetails.lastName;\n }\n if (formDetails.email) {\n baseProperties['fynd_website.form_email'] = formDetails.email;\n }\n if (formDetails.phone) {\n baseProperties['fynd_website.form_phone'] = formDetails.phone;\n }\n }\n\n // Add journey metadata\n if (journey.userJourney && journey.userJourney.length > 0) {\n baseProperties['fynd_website.journey_total_pages'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_touchpoints_count'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_first_page'] = journey.userJourney[0].page;\n baseProperties['fynd_website.journey_current_page'] = journey.userJourney[journey.userJourney.length - 1].page;\n\n // Calculate session duration\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n baseProperties['fynd_website.journey_session_duration'] = Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n \n // Add entry and exit times\n baseProperties['fynd_website.journey_entry_time'] = journey.userJourney[0].time;\n baseProperties['fynd_website.journey_exit_time'] = journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n // Add device and browser info from journey\n if (journey.deviceCategory) {\n // Device category is already capitalized from user journey\n baseProperties['fynd_website.device_type'] = journey.deviceCategory;\n }\n if (journey.browser) {\n baseProperties['fynd_website.journey_browser'] = journey.browser;\n }\n if (journey.device) {\n baseProperties['fynd_website.journey_device'] = journey.device;\n }\n if (journey.origin) {\n baseProperties['fynd_website.journey_origin'] = journey.origin;\n }\n \n // Add UTM path if available\n if (journey.utmPath) {\n baseProperties['fynd_website.journey_utm_path'] = journey.utmPath;\n }\n \n // Add scroll depth if available\n if (journey.scrollDepth) {\n baseProperties['fynd_website.journey_scroll_depth'] = journey.scrollDepth;\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for tracking:', error);\n }\n\n // Fallback device type calculation if user journey isn't available\n if (baseProperties['fynd_website.device_type'] === \"Unknown\") {\n const userAgent = navigator.userAgent;\n \n // Check for tablets first\n if (/iPad/.test(userAgent) || \n (/Android/.test(userAgent) && !/Mobile/.test(userAgent)) ||\n /Tablet/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Tablet\";\n }\n // Check for mobile devices\n else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Mobile\";\n }\n // Default to desktop\n else {\n baseProperties['fynd_website.device_type'] = \"Desktop\";\n }\n }\n\n return baseProperties;\n};\n\n// Function to send event to GA via dataLayer\nconst sendToGA = (eventName: string, gaProperties: GATrackingProperties, additionalProperties?: any): void => {\n if ((window as any).dataLayer) {\n const eventData: GTMEvent = {\n event: eventName,\n event_category: 'form_interaction',\n event_label: eventName,\n ...gaProperties\n };\n\n // Add submitted_form from additional properties if available\n if (additionalProperties?.submitted_form) {\n eventData.submitted_form = additionalProperties.submitted_form;\n }\n\n (window as any).dataLayer.push(eventData);\n console.log('Event sent to GA:', eventData);\n } else {\n console.log('dataLayer not available for GA tracking');\n }\n};\n\n// Track event function\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n // Get PostHog tracking properties (all data)\n const trackingProps = getPosthogTrackingProperties();\n\n // Merge with additional properties if provided\n const finalProperties = properties ? { ...trackingProps, ...properties } : trackingProps;\n\n // Track with PostHog if available\n if ((window as any).posthog) {\n (window as any).posthog.capture(eventName, finalProperties);\n }\n\n // Get GA tracking properties (form-related data only)\n const gaProperties = getGaTrackingProperties();\n\n // Only send to GA if there's form-related data or it's a form-related event\n const isFormRelatedEvent = eventName.includes('form') || \n Object.keys(gaProperties).length > 0 || \n properties?.submitted_form;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProperties, properties);\n }\n\n // Optional: Console log for debugging (remove in production)\n // console.log('Tracked event:', eventName, finalProperties);\n } catch (error) {\n console.error('Error tracking event:', error);\n }\n};\n\n// Helper function to get parent form name\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (parentForm) {\n return parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null;\n }\n return null;\n};\n\n// Initialize PostHog pageview\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n\n // PostHog pageview\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", trackingProps);\n }\n});\n\n// Track page load event\nwindow.addEventListener(\"load\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n console.log(\"Tracking Properties on Page Load:\", trackingProps);\n \n trackEvent(\"fynd_website.page.loaded\");\n\n // Check if this is the thank you page and trigger form success event\n checkThankYouPageEvent();\n});\n\n// Function to check and trigger thank you page event\nfunction checkThankYouPageEvent(): void {\n const currentPath = window.location.pathname;\n\n // Check if current page is thank you page\n if (currentPath === '/thank-you') {\n // Check if this is a page reload (not initial navigation)\n const navigationEntries = performance.getEntriesByType('navigation');\n if (navigationEntries.length > 0) {\n const navEntry = navigationEntries[0] as PerformanceNavigationTiming;\n\n // Check if it's a reload (type === 'reload') or if there's a referrer from the same origin\n const isReload = navEntry.type === 'reload' ||\n (document.referrer && new URL(document.referrer).origin === window.location.origin);\n\n if (isReload) {\n // Trigger event after 200ms delay\n setTimeout(() => {\n trackEvent(\"fynd_website.form.success\");\n }, 200);\n }\n }\n }\n}\n\n// Button click tracking for sign up, sign in, scroll to form and book a demo buttons\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]') as NodeListOf<Element>;\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]') as NodeListOf<Element>;\n const scrollToFormButtons = document.querySelectorAll(\n '[href=\"#footer-form\"]'\n ) as NodeListOf<Element>;\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]') as NodeListOf<Element>;\n const submitButtons = document.querySelectorAll('[type=\"submit\"]') as NodeListOf<Element>;\n\n submitButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n // If validation passed, track the submit event\n // Additional properties can be added here if needed\n const additionalProps = formName ? { submitted_form: formName } : {};\n trackEvent(\"fynd_website.form.submitted\", additionalProps);\n }\n }, 100);\n });\n });\n\n signUpButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_up.clicked\");\n });\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_in.clicked\");\n });\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.scroll_to_form.clicked\");\n });\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.book_a_demo.clicked\");\n });\n });\n\n // Form field change tracking for fynd_form_started event\n const formFields = document.querySelectorAll('[ph-form-field]') as NodeListOf<HTMLElement>;\n \n // Set to track which forms have already triggered the event\n const triggeredForms = new Set<string>();\n\n formFields.forEach((field: HTMLElement) => {\n // Handle different input types\n const eventType = field.tagName.toLowerCase() === 'select' ? 'change' : 'input';\n \n field.addEventListener(eventType, function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || 'unknown-form';\n \n // Only trigger once per form to avoid duplicate events\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n \n trackEvent(\"fynd_website.form.started\");\n }\n });\n });\n});\n\n// Make functions globally accessible\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// Export for module usage\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\n sendToGA,\n getParentFormName,\n type TrackingProperties,\n type GATrackingProperties,\n type GTMEvent\n};"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AACL,YAAQ,IAAI,gDAAgD;AAAA,EAC9D;;;ACqEA,MAAM,0BAA0B,MAA4B;AACxD,UAAM,eAAqC,CAAC;AAG5C,QAAI;AAEA,UAAI,UAAU;AACd,UAAI,OAAQ,OAAe,mBAAmB,YAAY;AACtD,kBAAW,OAAe,eAAe;AAAA,MAC7C;AAGA,UAAI,CAAC,SAAS;AACV,cAAM,aAAa,eAAe,QAAQ,aAAa;AACvD,YAAI,YAAY;AACZ,oBAAU,KAAK,MAAM,UAAU;AAAA,QACnC;AAAA,MACJ;AAEA,UAAI,WAAW,QAAQ,aAAa;AAChC,cAAM,cAA2B,QAAQ;AAGzC,YAAI,YAAY,QAAQ;AACpB,uBAAa,UAAU,YAAY;AAAA,QACvC;AACA,YAAI,YAAY,UAAU;AACtB,uBAAa,YAAY,YAAY;AAAA,QACzC;AACA,YAAI,YAAY,WAAW;AACvB,uBAAa,kBAAk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AAM,iBAAiB,YAAY;AAGnC,YAAI,CAAC,eAAe,IAAI,cAAc,GAAG;AACrC,yBAAe,IAAI,cAAc;AAEjC,qBAAW,2BAA2B;AAAA,QAC1C;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AAAA,EACL,CAAC;AAGD,SAAO,+BAA+B;AACtC,SAAO,aAAa;AACpB,SAAO,0BAA0B;",
4
+ "sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// trackingIntegration.ts - PostHog tracking with user journey integration\nimport { FormDetails, UserJourney } from '../utils/types/user-journey';\n\n// TypeScript interface for GTM dataLayer events\ninterface GTMEvent {\n event: string;\n event_category: string;\n event_label: string;\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n [key: string]: any; // Allow additional properties\n}\n\n// GA tracking properties interface (form-related only)\ninterface GATrackingProperties {\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n}\n\n// Define tracking properties interface\ninterface TrackingProperties {\n 'fynd_website.source_page': string;\n 'fynd_website.product': string;\n 'fynd_website.device_type': string;\n 'fynd_website.utm_source': string;\n 'fynd_website.utm_medium': string;\n 'fynd_website.utm_campaign': string;\n 'fynd_website.referrer': string;\n // Form details from user journey\n 'fynd_website.form_id'?: string;\n 'fynd_website.form_name'?: string;\n 'fynd_website.form_first_name'?: string;\n 'fynd_website.form_last_name'?: string;\n 'fynd_website.form_email'?: string;\n 'fynd_website.form_phone'?: string;\n // User journey details\n 'fynd_website.journey_total_pages'?: number;\n 'fynd_website.journey_session_duration'?: number;\n 'fynd_website.journey_first_page'?: string;\n 'fynd_website.journey_current_page'?: string;\n 'fynd_website.journey_device'?: string;\n 'fynd_website.journey_browser'?: string;\n 'fynd_website.journey_device_name'?: string;\n 'fynd_website.journey_origin'?: string;\n 'fynd_website.journey_touchpoints'?: any; // Array of touchpoints from userJourney field\n 'fynd_website.journey_touchpoints_count'?: number;\n 'fynd_website.journey_utm_path'?: string;\n 'fynd_website.journey_entry_time'?: string;\n 'fynd_website.journey_exit_time'?: string;\n 'fynd_website.journey_scroll_depth'?: number;\n // Additional event-specific properties\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any; // Allow additional properties\n}\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n getPosthogTrackingProperties: () => TrackingProperties;\n getGaTrackingProperties: () => GATrackingProperties;\n validationPassed?: boolean;\n getUserJourney: () => UserJourney | null;\n dataLayer?: GTMEvent[];\n }\n}\n\n// GA tracking properties function (form-related data only)\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey && journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n gaProperties.form_id = formDetails.formId;\n }\n if (formDetails.formName) {\n gaProperties.form_name = formDetails.formName;\n }\n if (formDetails.firstName) {\n gaProperties.form_first_name = formDetails.firstName;\n }\n if (formDetails.lastName) {\n gaProperties.form_last_name = formDetails.lastName;\n }\n if (formDetails.email) {\n gaProperties.form_email = formDetails.email;\n }\n if (formDetails.phone) {\n gaProperties.form_phone = formDetails.phone;\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for GA tracking:', error);\n }\n\n return gaProperties;\n};\n\n// Enhanced tracking properties function\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n // Base tracking properties\n const baseProperties: TrackingProperties = {\n 'fynd_website.source_page': pathname,\n 'fynd_website.product': \"fynd.com website\",\n 'fynd_website.device_type': \"Unknown\", // Will be updated from user journey\n 'fynd_website.utm_source':\n new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n 'fynd_website.utm_medium':\n new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n 'fynd_website.utm_campaign':\n new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n 'fynd_website.referrer': document.referrer,\n };\n\n // Get user journey data if available\n try {\n // Try to get from getUserJourney function first\n let journey = null;\n if (typeof (window as any).getUserJourney === 'function') {\n journey = (window as any).getUserJourney();\n }\n\n // If not available from function, try to get directly from sessionStorage\n if (!journey) {\n const storedData = sessionStorage.getItem('userJourney');\n if (storedData) {\n journey = JSON.parse(storedData);\n }\n }\n\n if (journey) {\n // Add the complete user journey object as touchpoints\n baseProperties['fynd_website.journey_touchpoints'] = journey.userJourney || journey;\n\n // Add form details if available\n if (journey.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n\n // Only add form properties if they have values\n if (formDetails.formId) {\n baseProperties['fynd_website.form_id'] = formDetails.formId;\n }\n if (formDetails.formName) {\n baseProperties['fynd_website.form_name'] = formDetails.formName;\n }\n if (formDetails.firstName) {\n baseProperties['fynd_website.form_first_name'] = formDetails.firstName;\n }\n if (formDetails.lastName) {\n baseProperties['fynd_website.form_last_name'] = formDetails.lastName;\n }\n if (formDetails.email) {\n baseProperties['fynd_website.form_email'] = formDetails.email;\n }\n if (formDetails.phone) {\n baseProperties['fynd_website.form_phone'] = formDetails.phone;\n }\n }\n\n // Add journey metadata\n if (journey.userJourney && journey.userJourney.length > 0) {\n baseProperties['fynd_website.journey_total_pages'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_touchpoints_count'] = journey.userJourney.length;\n baseProperties['fynd_website.journey_first_page'] = journey.userJourney[0].page;\n baseProperties['fynd_website.journey_current_page'] = journey.userJourney[journey.userJourney.length - 1].page;\n\n // Calculate session duration\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n baseProperties['fynd_website.journey_session_duration'] = Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n \n // Add entry and exit times\n baseProperties['fynd_website.journey_entry_time'] = journey.userJourney[0].time;\n baseProperties['fynd_website.journey_exit_time'] = journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n // Add device and browser info from journey\n if (journey.deviceCategory) {\n // Device category is already capitalized from user journey\n baseProperties['fynd_website.device_type'] = journey.deviceCategory;\n }\n if (journey.browser) {\n baseProperties['fynd_website.journey_browser'] = journey.browser;\n }\n if (journey.device) {\n baseProperties['fynd_website.journey_device'] = journey.device;\n }\n if (journey.origin) {\n baseProperties['fynd_website.journey_origin'] = journey.origin;\n }\n \n // Add UTM path if available\n if (journey.utmPath) {\n baseProperties['fynd_website.journey_utm_path'] = journey.utmPath;\n }\n \n // Add scroll depth if available\n if (journey.scrollDepth) {\n baseProperties['fynd_website.journey_scroll_depth'] = journey.scrollDepth;\n }\n }\n } catch (error) {\n console.warn('Error getting user journey data for tracking:', error);\n }\n\n // Fallback device type calculation if user journey isn't available\n if (baseProperties['fynd_website.device_type'] === \"Unknown\") {\n const userAgent = navigator.userAgent;\n \n // Check for tablets first\n if (/iPad/.test(userAgent) || \n (/Android/.test(userAgent) && !/Mobile/.test(userAgent)) ||\n /Tablet/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Tablet\";\n }\n // Check for mobile devices\n else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(userAgent)) {\n baseProperties['fynd_website.device_type'] = \"Mobile\";\n }\n // Default to desktop\n else {\n baseProperties['fynd_website.device_type'] = \"Desktop\";\n }\n }\n\n return baseProperties;\n};\n\n// Function to send event to GA via dataLayer\nconst sendToGA = (eventName: string, gaProperties: GATrackingProperties, additionalProperties?: any): void => {\n if ((window as any).dataLayer) {\n const eventData: GTMEvent = {\n event: eventName,\n event_category: 'form_interaction',\n event_label: eventName,\n ...gaProperties\n };\n\n // Add submitted_form from additional properties if available\n if (additionalProperties?.submitted_form) {\n eventData.submitted_form = additionalProperties.submitted_form;\n }\n\n (window as any).dataLayer.push(eventData);\n console.log('Event sent to GA:', eventData);\n } else {\n console.log('dataLayer not available for GA tracking');\n }\n};\n\n// Track event function\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n // Get PostHog tracking properties (all data)\n const trackingProps = getPosthogTrackingProperties();\n\n // Merge with additional properties if provided\n const finalProperties = properties ? { ...trackingProps, ...properties } : trackingProps;\n\n // Track with PostHog if available\n if ((window as any).posthog) {\n (window as any).posthog.capture(eventName, finalProperties);\n console.log('Event sent to PostHog:', { event: eventName, properties: finalProperties });\n }\n\n // Get GA tracking properties (form-related data only)\n const gaProperties = getGaTrackingProperties();\n\n // Only send to GA if there's form-related data or it's a form-related event\n const isFormRelatedEvent = eventName.includes('form') || \n Object.keys(gaProperties).length > 0 || \n properties?.submitted_form;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProperties, properties);\n }\n\n // Optional: Console log for debugging (remove in production)\n // console.log('Tracked event:', eventName, finalProperties);\n } catch (error) {\n console.error('Error tracking event:', error);\n }\n};\n\n// Helper function to get parent form name\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (parentForm) {\n return parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null;\n }\n return null;\n};\n\n// Initialize PostHog pageview\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n\n // PostHog pageview\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", trackingProps);\n }\n});\n\n// Track page load event\nwindow.addEventListener(\"load\", function (): void {\n const trackingProps = getPosthogTrackingProperties();\n console.log(\"Tracking Properties on Page Load:\", trackingProps);\n \n trackEvent(\"fynd_website.page.loaded\");\n\n // Check if this is the thank you page and trigger form success event\n checkThankYouPageEvent();\n});\n\n// Function to check and trigger thank you page event\nfunction checkThankYouPageEvent(): void {\n const currentPath = window.location.pathname;\n\n // Check if current page is thank you page\n if (currentPath === '/thank-you') {\n // Check if this is a page reload (not initial navigation)\n const navigationEntries = performance.getEntriesByType('navigation');\n if (navigationEntries.length > 0) {\n const navEntry = navigationEntries[0] as PerformanceNavigationTiming;\n\n // Check if it's a reload (type === 'reload') or if there's a referrer from the same origin\n const isReload = navEntry.type === 'reload' ||\n (document.referrer && new URL(document.referrer).origin === window.location.origin);\n\n if (isReload) {\n // Trigger event after 200ms delay\n setTimeout(() => {\n trackEvent(\"fynd_website.form.success\");\n }, 200);\n }\n }\n }\n}\n\n// Button click tracking for sign up, sign in, scroll to form and book a demo buttons\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]') as NodeListOf<Element>;\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]') as NodeListOf<Element>;\n const scrollToFormButtons = document.querySelectorAll(\n '[href=\"#footer-form\"]'\n ) as NodeListOf<Element>;\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]') as NodeListOf<Element>;\n const submitButtons = document.querySelectorAll('[type=\"submit\"]') as NodeListOf<Element>;\n\n submitButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n // If validation passed, track the submit event\n const additionalProps = formName ? { submitted_form: formName } : {};\n trackEvent(\"fynd_website.form.submitted\", additionalProps);\n }\n }, 10);\n });\n });\n\n signUpButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_up.clicked\");\n });\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.sign_in.clicked\");\n });\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.scroll_to_form.clicked\");\n });\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (): void {\n trackEvent(\"fynd_website.book_a_demo.clicked\");\n });\n });\n\n // Form field change tracking for fynd_form_started event\n const formFields = document.querySelectorAll('[ph-form-field]') as NodeListOf<HTMLElement>;\n \n // Set to track which forms have already triggered the event\n const triggeredForms = new Set<string>();\n\n formFields.forEach((field: HTMLElement) => {\n // Handle different element types\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n \n // Function to handle form started event\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || 'unknown-form';\n \n // Only trigger once per form to avoid duplicate events\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n \n trackEvent(\"fynd_website.form.started\");\n }\n };\n \n // Add focus event for all interactive form fields (except buttons)\n if (!(tagName === 'button' || (tagName === 'input' && inputType === 'submit'))) {\n field.addEventListener('focus', handleFormStarted);\n }\n \n // Add specific interaction events as before\n if (tagName === 'button' || (tagName === 'input' && inputType === 'submit')) {\n field.addEventListener('click', handleFormStarted);\n } else if (tagName === 'select') {\n field.addEventListener('change', handleFormStarted);\n } else {\n field.addEventListener('input', handleFormStarted);\n }\n });\n});\n\n// Make functions globally accessible\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// Export for module usage\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\n sendToGA,\n getParentFormName,\n type TrackingProperties,\n type GATrackingProperties,\n type GTMEvent\n};"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS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AAiB;AAAA,MACrD;AAAA,IACJ,CAAC;AAAA,EACL,CAAC;AAGD,SAAO,+BAA+B;AACtC,SAAO,aAAa;AACpB,SAAO,0BAA0B;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fynd-design-engineering/fynd-one-v2",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Updated CDN for fynd.com",
5
5
  "homepage": "https://github.com/Fynd-Design-Engineering/Fynd-Utils/blob/main/README.md",
6
6
  "license": "ISC",