@fynd-design-engineering/fynd-one-v2 3.3.25 → 3.3.27

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.
@@ -1 +1 @@
1
- "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('[fynd-faq-element="wrapper"]').forEach(n=>{let t=n.querySelector('[fynd-faq-element="toggle"]'),e=n.querySelector('[fynd-faq-element="content"]'),o=n.querySelector('[fynd-faq-element="content-inner"]'),i=t?.querySelector('[fynd-faq-element="x-line"]')||null,a=t?.querySelector('[fynd-faq-element="y-line"]')||null;if(!t||!e||!o||!i||!a){console.warn("Required FAQ elements not found in wrapper");return}let s=n.closest("[fynd-faq-group]"),r=s?.getAttribute("fynd-faq-group")||null,c=s?.getAttribute("fynd-faq-type")||"one-at-a-time";n.getAttribute("fynd-faq-initialopen")==="true"?(gsap.set(e,{height:"auto",overflow:"hidden"}),gsap.set(o,{opacity:1}),gsap.set(i,{rotation:180}),gsap.set(a,{rotation:270}),t.setAttribute("data-state","open"),g(n,r),y(n,r),q(n,r)):(gsap.set(e,{height:0}),gsap.set(o,{opacity:0}),gsap.set(i,{rotation:0}),gsap.set(a,{rotation:0}),t.setAttribute("data-state","closed"));let u=!1;t.addEventListener("click",()=>{if(u)return;u=!0;let f=t.getAttribute("data-state")==="open";if(c==="one-at-a-time"&&s){let L=s.querySelectorAll('[fynd-faq-element="wrapper"] [data-state="open"]');if(f&&L.length===1){u=!1;return}}f?m(n,()=>{u=!1}):(c==="one-at-a-time"&&s&&E(s),p(n,r,()=>{u=!1}))})}),d()});window.addEventListener("resize",()=>{d()});function d(){document.querySelectorAll("[fynd-faq-image-target]").forEach(t=>{let e=t.parentElement;!e||e.getAttribute("ratio-height")!=="true"||(e.style.height="auto",requestAnimationFrame(()=>{let i=e.offsetHeight;e.style.height=`${i}px`}))}),document.querySelectorAll('[fynd-faq-tabgroup][ratio-height="true"]').forEach(t=>{t.style.height="auto",requestAnimationFrame(()=>{let e=t.offsetHeight;t.style.height=`${e}px`})})}function p(l,n,t){let e=l.querySelector('[fynd-faq-element="toggle"]'),o=l.querySelector('[fynd-faq-element="content"]'),i=l.querySelector('[fynd-faq-element="content-inner"]'),a=e?.querySelector('[fynd-faq-element="x-line"]')||null,s=e?.querySelector('[fynd-faq-element="y-line"]')||null;if(!e||!o||!i||!a||!s){console.warn("Required elements not found for opening accordion");return}o.gsapAnimation&&o.gsapAnimation.kill();let r=gsap.timeline({onComplete:()=>t&&t()});gsap.set(o,{height:"auto",visibility:"hidden",opacity:0});let c=o.offsetHeight;gsap.set(o,{height:0,visibility:"visible",opacity:1}),r.to(a,{rotation:180,duration:.4,ease:"power2.inOut"},0),r.to(s,{rotation:270,duration:.4,ease:"power2.inOut"},0),r.to(o,{height:c,duration:.5,ease:"power3.inOut",clearProps:"height",onComplete:()=>{o.style.height="auto"}},0),r.to(i,{opacity:1,duration:.4,ease:"power2.out"},"-=0.35"),o.gsapAnimation=r,e.setAttribute("data-state","open");let u=e.querySelector('[fynd-faq-element="chevron"]');u&&gsap.to(u,{rotation:180,duration:.4,ease:"back.out(1.7)"}),g(l,n),y(l,n),q(l,n)}function m(l,n){let t=l.querySelector('[fynd-faq-element="toggle"]'),e=l.querySelector('[fynd-faq-element="content"]'),o=l.querySelector('[fynd-faq-element="content-inner"]'),i=t?.querySelector('[fynd-faq-element="x-line"]')||null,a=t?.querySelector('[fynd-faq-element="y-line"]')||null;if(!t||!e||!o||!i||!a){console.warn("Required elements not found for closing accordion");return}e.gsapAnimation&&e.gsapAnimation.kill();let s=e.offsetHeight;e.style.height=`${s}px`;let r=gsap.timeline({onComplete:()=>n&&n()});r.to(i,{rotation:0,duration:.4,ease:"power2.inOut"},0),r.to(a,{rotation:0,duration:.4,ease:"power2.inOut"},0),r.to(o,{opacity:0,duration:.3,ease:"power2.in"},0),r.to(e,{height:0,duration:.4,ease:"power3.inOut"},"-=0.25"),e.gsapAnimation=r,t.setAttribute("data-state","closed");let c=t.querySelector('[fynd-faq-element="chevron"]');c&&gsap.to(c,{rotation:0,duration:.4,ease:"back.out(1.7)"})}function E(l){l.querySelectorAll('[fynd-faq-element="wrapper"] [data-state="open"]').forEach(t=>{let e=t.closest('[fynd-faq-element="wrapper"]');e&&m(e)})}function g(l,n){if(!n)return;let t=document.querySelector(`[fynd-faq-image-target="${n}"]`);if(!t)return;let e=l.querySelector("[fynd-faq-image-source]");if(!e)return;let o=e.getAttribute("src"),i=e.getAttribute("srcset");o&&t.setAttribute("src",o),i&&t.setAttribute("srcset","")}function y(l,n){if(!n)return;let t=document.querySelector(`[fynd-faq-text-target="${n}"]`);if(!t)return;let e=l.querySelector("[fynd-faq-text-source]");e&&(t.textContent=e.textContent)}function q(l,n){if(!n)return;let t=document.querySelector(`[fynd-faq-button-text-target="${n}"]`),e=document.querySelector(`[fynd-faq-button-link-target="${n}"]`),o=l.querySelector("[fynd-faq-link-source]");if(o&&(t&&(t.textContent=o.textContent),e))for(let i=0;i<o.attributes.length;i++){let a=o.attributes[i];e.setAttribute(a.name,a.value)}}})();
1
+ "use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('[fynd-faq-element="wrapper"]').forEach(n=>{let e=n.querySelector('[fynd-faq-element="toggle"]'),t=n.querySelector('[fynd-faq-element="content"]'),o=n.querySelector('[fynd-faq-element="content-inner"]'),l=e?.querySelector('[fynd-faq-element="x-line"]')||null,u=e?.querySelector('[fynd-faq-element="y-line"]')||null;if(!e||!t||!o||!l||!u){console.warn("Required FAQ elements not found in wrapper");return}let a=n.closest("[fynd-faq-group]"),r=a?.getAttribute("fynd-faq-group")||null,s=a?.getAttribute("fynd-faq-type")||"one-at-a-time";n.getAttribute("fynd-faq-initialopen")==="true"?(gsap.set(t,{height:"auto",overflow:"hidden"}),gsap.set(o,{opacity:1}),gsap.set(l,{rotation:180}),gsap.set(u,{rotation:270}),e.setAttribute("data-state","open"),y(n,r),g(n,r),q(n,r),p(n,r)):(gsap.set(t,{height:0}),gsap.set(o,{opacity:0}),gsap.set(l,{rotation:0}),gsap.set(u,{rotation:0}),e.setAttribute("data-state","closed"));let c=!1;e.addEventListener("click",()=>{if(c)return;c=!0;let d=e.getAttribute("data-state")==="open";if(s==="one-at-a-time"&&a){let L=a.querySelectorAll('[fynd-faq-element="wrapper"] [data-state="open"]');if(d&&L.length===1){c=!1;return}}d?m(n,()=>{c=!1}):(s==="one-at-a-time"&&a&&T(a),h(n,r,()=>{c=!1}))})}),f(),H(),setTimeout(A,500)});window.addEventListener("resize",()=>{f()});function f(){if(window.innerWidth<992)return;document.querySelectorAll("[fynd-faq-image-target]").forEach(e=>{let t=e.parentElement;!t||t.getAttribute("ratio-height")!=="true"||(t.style.height="auto",requestAnimationFrame(()=>{let l=t.offsetHeight;t.style.height=`${l}px`}))}),document.querySelectorAll('[fynd-faq-tabgroup][ratio-height="true"]').forEach(e=>{e.style.height="auto",requestAnimationFrame(()=>{let t=e.offsetHeight;e.style.height=`${t}px`})})}function h(i,n,e){let t=i.querySelector('[fynd-faq-element="toggle"]'),o=i.querySelector('[fynd-faq-element="content"]'),l=i.querySelector('[fynd-faq-element="content-inner"]'),u=t?.querySelector('[fynd-faq-element="x-line"]')||null,a=t?.querySelector('[fynd-faq-element="y-line"]')||null;if(!t||!o||!l||!u||!a){console.warn("Required elements not found for opening accordion");return}o.gsapAnimation&&o.gsapAnimation.kill();let r=gsap.timeline({onComplete:()=>e&&e()});gsap.set(o,{height:"auto",visibility:"hidden",opacity:0});let s=o.offsetHeight;gsap.set(o,{height:0,visibility:"visible",opacity:1}),r.to(u,{rotation:180,duration:.4,ease:"power2.inOut"},0),r.to(a,{rotation:270,duration:.4,ease:"power2.inOut"},0),r.to(o,{height:s,duration:.5,ease:"power3.inOut",clearProps:"height",onComplete:()=>{o.style.height="auto"}},0),r.to(l,{opacity:1,duration:.4,ease:"power2.out"},"-=0.35"),o.gsapAnimation=r,t.setAttribute("data-state","open");let c=t.querySelector('[fynd-faq-element="chevron"]');c&&gsap.to(c,{rotation:180,duration:.4,ease:"back.out(1.7)"}),y(i,n),g(i,n),q(i,n),p(i,n)}function m(i,n){let e=i.querySelector('[fynd-faq-element="toggle"]'),t=i.querySelector('[fynd-faq-element="content"]'),o=i.querySelector('[fynd-faq-element="content-inner"]'),l=e?.querySelector('[fynd-faq-element="x-line"]')||null,u=e?.querySelector('[fynd-faq-element="y-line"]')||null;if(!e||!t||!o||!l||!u){console.warn("Required elements not found for closing accordion");return}t.gsapAnimation&&t.gsapAnimation.kill();let a=t.offsetHeight;t.style.height=`${a}px`;let r=gsap.timeline({onComplete:()=>n&&n()});r.to(l,{rotation:0,duration:.4,ease:"power2.inOut"},0),r.to(u,{rotation:0,duration:.4,ease:"power2.inOut"},0),r.to(o,{opacity:0,duration:.3,ease:"power2.in"},0),r.to(t,{height:0,duration:.4,ease:"power3.inOut"},"-=0.25"),t.gsapAnimation=r,e.setAttribute("data-state","closed");let s=e.querySelector('[fynd-faq-element="chevron"]');s&&gsap.to(s,{rotation:0,duration:.4,ease:"back.out(1.7)"})}function T(i){i.querySelectorAll('[fynd-faq-element="wrapper"] [data-state="open"]').forEach(e=>{let t=e.closest('[fynd-faq-element="wrapper"]');t&&m(t)})}function y(i,n){if(!n)return;let e=document.querySelector(`[fynd-faq-image-target="${n}"]`);if(!e)return;let t=i.querySelector("[fynd-faq-image-source]");if(!t)return;let o=t.getAttribute("src"),l=t.getAttribute("srcset");o&&e.setAttribute("src",o),l&&e.setAttribute("srcset","")}function g(i,n){if(!n)return;let e=document.querySelector(`[fynd-faq-text-target="${n}"]`);if(!e)return;let t=i.querySelector("[fynd-faq-text-source]");t&&(e.textContent=t.textContent)}function q(i,n){if(!n)return;let e=document.querySelector(`[fynd-faq-button-text-target="${n}"]`),t=document.querySelector(`[fynd-faq-button-link-target="${n}"]`),o=i.querySelector("[fynd-faq-link-source]");if(o&&(e&&(e.textContent=o.textContent),t))for(let l=0;l<o.attributes.length;l++){let u=o.attributes[l];t.setAttribute(u.name,u.value)}}function p(i,n){if(!n)return;let e=document.querySelector(`[fynd-faq-video-target="${n}"]`);if(!e)return;let t=i.querySelector("[fynd-faq-video]");if(!t)return;let o=i.querySelector("[fynd-faq-image]");if(!o)return;let l=i.querySelector("[fynd-faq-video-source]");if(l)window.innerWidth<992&&(t.style.display="block",o.style.display="none");else{e.style.display="none",window.innerWidth<992&&(t.style.display="none",o.style.display="block");return}let u=l.querySelector("source"),a=u?.getAttribute("src")||null,r=u?.getAttribute("type")||null;if(a&&a.trim()!==""){let s=e.querySelector("source");s||(s=document.createElement("source"),e.appendChild(s)),s.setAttribute("src",a),s.setAttribute("type",r||"video/mp4"),e.setAttribute("loop",""),e.setAttribute("autoplay",""),e.setAttribute("muted",""),e.setAttribute("playsinline","");try{e.load()}catch{}E(e),e.style.display="block"}else{e.style.display="none";let s=e.querySelector("source");if(s){s.removeAttribute("src"),s.removeAttribute("type");try{e.load()}catch{}}}}function E(i){!i.isConnected||i.style.display==="none"||requestAnimationFrame(()=>{let n=i.play();n&&typeof n.catch=="function"&&n.catch(()=>{})})}function H(){let i=document.querySelectorAll("[fynd-faq-video-target]");if(!i.length)return;let n=new IntersectionObserver(e=>{e.forEach(t=>{let o=t.target;if(!(!o.querySelector("source[src]")||o.style.display==="none"))if(t.isIntersecting&&t.intersectionRatio>=.5)o.setAttribute("autoplay",""),o.setAttribute("muted",""),o.setAttribute("playsinline",""),o.setAttribute("loop",""),E(o);else try{o.pause()}catch{}})},{threshold:[0,.5,1]});i.forEach(e=>n.observe(e))}async function A(){let i=document.querySelectorAll("video[fynd-faq-video-target], video.fynd-faq-video-target, video[data-fynd-faq-video-target]");for(let n of i)if(n.src||n.querySelector("source[src]")!==null){n.muted||(n.muted=!0);try{let t=n.play();t!==void 0&&await t}catch(t){console.debug("Could not play video:",n,t)}}}})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../bin/live-reload.js", "../../src/accordians/index.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", "// Type definitions\ninterface GSAPElement extends HTMLElement {\n gsapAnimation?: { kill(): void };\n }\n \n\n \n document.addEventListener(\"DOMContentLoaded\", (): void => {\n const faqWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-element=\"wrapper\"]');\n \n faqWrappers.forEach((wrapper: HTMLElement): void => {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required FAQ elements not found in wrapper');\n return;\n }\n \n const groupContainer: HTMLElement | null = wrapper.closest(\"[fynd-faq-group]\");\n const groupName: string | null = groupContainer?.getAttribute(\"fynd-faq-group\") || null;\n \n // Get the FAQ type - either \"one-at-a-time\" or \"multiple-at-a-time\"\n const faqType: string = groupContainer?.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n \n if (wrapper.getAttribute(\"fynd-faq-initialopen\") === \"true\") {\n gsap.set(content, { height: \"auto\", overflow: \"hidden\" });\n gsap.set(contentInner, { opacity: 1 });\n gsap.set(xLine, { rotation: 180 });\n gsap.set(yLine, { rotation: 270 });\n toggle.setAttribute(\"data-state\", \"open\");\n \n updateFaqGroupImage(wrapper, groupName); // Update image on load for initial open FAQ\n updateFaqGroupText(wrapper, groupName); // Update text on load for initial open FAQ\n updateFaqGroupButton(wrapper, groupName); // Update button on load for initial open FAQ\n } else {\n gsap.set(content, { height: 0 });\n gsap.set(contentInner, { opacity: 0 });\n gsap.set(xLine, { rotation: 0 });\n gsap.set(yLine, { rotation: 0 });\n toggle.setAttribute(\"data-state\", \"closed\");\n }\n \n let isAnimating: boolean = false;\n toggle.addEventListener(\"click\", (): void => {\n if (isAnimating) return;\n isAnimating = true;\n const isOpen: boolean = toggle.getAttribute(\"data-state\") === \"open\";\n \n // For \"one-at-a-time\" type, check if this is the last open FAQ\n if (faqType === \"one-at-a-time\" && groupContainer) {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n \n if (isOpen && openFAQs.length === 1) {\n // Don't allow closing the last open FAQ in \"one-at-a-time\" mode\n isAnimating = false;\n return;\n }\n }\n \n // For \"multiple-at-a-time\" type, we can always toggle the current FAQ\n // For \"one-at-a-time\" type, we close all others when opening a new one\n \n if (isOpen) {\n // Always allow closing if it's open, regardless of mode\n closeAccordion(wrapper, (): void => {\n isAnimating = false;\n });\n } else {\n // If \"one-at-a-time\", close others before opening this one\n if (faqType === \"one-at-a-time\" && groupContainer) {\n closeOtherAccordions(groupContainer);\n }\n \n openAccordion(wrapper, groupName, (): void => {\n isAnimating = false;\n });\n }\n });\n });\n\n // Initialize ratio heights on page load\n handleRatioHeights();\n });\n\n // Handle window resize\n window.addEventListener(\"resize\", (): void => {\n handleRatioHeights();\n });\n\n // Function to handle ratio heights for FAQ image targets and tabgroups\n function handleRatioHeights(): void {\n // Find all FAQ image targets\n const imageTargets: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-image-target]');\n \n imageTargets.forEach((imageTarget: HTMLElement): void => {\n // Find the wrapper div for this image target\n const wrapper: HTMLElement | null = imageTarget.parentElement;\n if (!wrapper) return;\n \n // Check if wrapper has ratio-height attribute set to \"true\"\n const ratioHeight: string | null = wrapper.getAttribute(\"ratio-height\");\n if (ratioHeight !== \"true\") return;\n \n // Reset height to auto first to get natural dimensions\n wrapper.style.height = \"auto\";\n \n // Wait for next frame to ensure the auto height is applied\n requestAnimationFrame((): void => {\n // Get the current rendered height\n const renderedHeight: number = wrapper.offsetHeight;\n \n // Set the rendered height as inline style for wrapper\n wrapper.style.height = `${renderedHeight}px`;\n });\n });\n\n // Handle all tabgroups with ratio-height=\"true\" separately\n const tabGroups: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-tabgroup][ratio-height=\"true\"]');\n \n tabGroups.forEach((tabGroup: HTMLElement): void => {\n // Reset height to auto first to get natural dimensions\n tabGroup.style.height = \"auto\";\n \n // Wait for next frame to ensure the auto height is applied\n requestAnimationFrame((): void => {\n // Get the current rendered height\n const renderedHeight: number = tabGroup.offsetHeight;\n \n // Set the rendered height as inline style for tabgroup\n tabGroup.style.height = `${renderedHeight}px`;\n });\n });\n }\n \n function openAccordion(wrapper: HTMLElement, groupName: string | null, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for opening accordion');\n return;\n }\n \n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n \n const timeline = gsap.timeline({\n onComplete: (): void => callback && callback(),\n });\n \n gsap.set(content, { height: \"auto\", visibility: \"hidden\", opacity: 0 });\n const height: number = content.offsetHeight;\n gsap.set(content, { height: 0, visibility: \"visible\", opacity: 1 });\n \n timeline.to(xLine, { rotation: 180, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 270, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n content,\n {\n height: height,\n duration: 0.5,\n ease: \"power3.inOut\",\n clearProps: \"height\",\n onComplete: (): void => {\n (content as HTMLElement).style.height = \"auto\";\n },\n },\n 0\n );\n timeline.to(\n contentInner,\n { opacity: 1, duration: 0.4, ease: \"power2.out\" },\n \"-=0.35\"\n );\n \n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"open\");\n \n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) {\n gsap.to(icon, { rotation: 180, duration: 0.4, ease: \"back.out(1.7)\" });\n }\n \n // Update image for the group\n updateFaqGroupImage(wrapper, groupName);\n // Update text for the group\n updateFaqGroupText(wrapper, groupName);\n // Update button for the group\n updateFaqGroupButton(wrapper, groupName);\n }\n \n function closeAccordion(wrapper: HTMLElement, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for closing accordion');\n return;\n }\n \n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n \n const height: number = content.offsetHeight;\n (content as HTMLElement).style.height = `${height}px`;\n \n const timeline = gsap.timeline({\n onComplete: (): void => callback && callback(),\n });\n \n timeline.to(xLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n contentInner,\n { opacity: 0, duration: 0.3, ease: \"power2.in\" },\n 0\n );\n timeline.to(\n content,\n { height: 0, duration: 0.4, ease: \"power3.inOut\" },\n \"-=0.25\"\n );\n \n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"closed\");\n \n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) {\n gsap.to(icon, { rotation: 0, duration: 0.4, ease: \"back.out(1.7)\" });\n }\n }\n \n // Function to close all other accordions in the same group\n function closeOtherAccordions(groupContainer: HTMLElement): void {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n openFAQs.forEach((openToggle: HTMLElement): void => {\n const wrapper: HTMLElement | null = openToggle.closest('[fynd-faq-element=\"wrapper\"]');\n if (wrapper) {\n closeAccordion(wrapper);\n }\n });\n }\n \n // Function to update the group image\n function updateFaqGroupImage(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level image element\n const groupImage: HTMLImageElement | null = document.querySelector(\n `[fynd-faq-image-target=\"${groupName}\"]`\n );\n if (!groupImage) return;\n\n // Find the image source inside the opened accordion\n const imageSource: HTMLImageElement | null = wrapper.querySelector(\"[fynd-faq-image-source]\");\n if (!imageSource) return;\n\n // Update the group image with the new source\n const newSrc: string | null = imageSource.getAttribute(\"src\");\n const newSrcset: string | null = imageSource.getAttribute(\"srcset\");\n\n if (newSrc) groupImage.setAttribute(\"src\", newSrc);\n if (newSrcset) groupImage.setAttribute(\"srcset\", \"\");\n //removing srcset for now\n }\n\n // Function to update the group text\n function updateFaqGroupText(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level text element\n const groupText: HTMLElement | null = document.querySelector(\n `[fynd-faq-text-target=\"${groupName}\"]`\n );\n if (!groupText) return;\n\n // Find the text source inside the opened accordion\n const textSource: HTMLElement | null = wrapper.querySelector(\"[fynd-faq-text-source]\");\n if (!textSource) return;\n\n // Update the group text with the new content\n groupText.textContent = textSource.textContent;\n }\n\n // Function to update the group button\n function updateFaqGroupButton(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level button elements\n const buttonTextTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-text-target=\"${groupName}\"]`\n );\n const buttonLinkTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-link-target=\"${groupName}\"]`\n );\n\n // Find the link source inside the opened accordion\n const linkSource: HTMLAnchorElement | null = wrapper.querySelector(\"[fynd-faq-link-source]\");\n if (!linkSource) return;\n\n // Update the button text if target exists\n if (buttonTextTarget) {\n buttonTextTarget.textContent = linkSource.textContent;\n }\n\n // Update the button link if target exists\n if (buttonLinkTarget) {\n // Copy all attributes from linkSource to buttonLinkTarget\n for (let i = 0; i < linkSource.attributes.length; i++) {\n const attr = linkSource.attributes[i];\n buttonLinkTarget.setAttribute(attr.name, attr.value);\n }\n }\n }\n \n // Function to ensure at least one FAQ is open in \"one-at-a-time\" mode\n function ensureOneFaqOpen(groupContainer: HTMLElement | null): void {\n if (!groupContainer) return;\n \n const faqType: string = groupContainer.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n \n // Only apply this to \"one-at-a-time\" type\n if (faqType !== \"one-at-a-time\") return;\n \n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n \n // If no FAQs are open, open the first one\n if (openFAQs.length === 0) {\n const firstFaq: HTMLElement | null = groupContainer.querySelector(\n '[fynd-faq-element=\"wrapper\"]'\n );\n if (firstFaq) {\n const firstToggle: HTMLElement | null = firstFaq.querySelector('[fynd-faq-element=\"toggle\"]');\n if (firstToggle) {\n const groupName: string | null = groupContainer.getAttribute(\"fynd-faq-group\");\n openAccordion(firstFaq, groupName);\n }\n }\n }\n }"],
5
- "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,M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AA,MACpD,iCAAiC,SAAS;AAAA,IAC5C;AAGA,UAAM,aAAuC,QAAQ,cAAc,wBAAwB;AAC3F,QAAI,CAAC,WAAY;AAGjB,QAAI,kBAAkB;AACpB,uBAAiB,cAAc,WAAW;AAAA,IAC5C;AAGA,QAAI,kBAAkB;AAEpB,eAAS,IAAI,GAAG,IAAI,WAAW,WAAW,QAAQ,KAAK;AACrD,cAAM,OAAO,WAAW,WAAW,CAAC;AACpC,yBAAiB,aAAa,KAAK,MAAM,KAAK,KAAK;AAAA,MACrD;AAAA,IACF;AAAA,EACF;",
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", "import { isElementAccessExpression } from \"typescript\";\n\n// Type definitions\ninterface GSAPElement extends HTMLElement {\n gsapAnimation?: { kill(): void };\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", (): void => {\n const faqWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-element=\"wrapper\"]');\n\n faqWrappers.forEach((wrapper: HTMLElement): void => {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n\n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required FAQ elements not found in wrapper');\n return;\n }\n\n const groupContainer: HTMLElement | null = wrapper.closest(\"[fynd-faq-group]\");\n const groupName: string | null = groupContainer?.getAttribute(\"fynd-faq-group\") || null;\n\n // Get the FAQ type - either \"one-at-a-time\" or \"multiple-at-a-time\"\n const faqType: string = groupContainer?.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n\n if (wrapper.getAttribute(\"fynd-faq-initialopen\") === \"true\") {\n gsap.set(content, { height: \"auto\", overflow: \"hidden\" });\n gsap.set(contentInner, { opacity: 1 });\n gsap.set(xLine, { rotation: 180 });\n gsap.set(yLine, { rotation: 270 });\n toggle.setAttribute(\"data-state\", \"open\");\n\n updateFaqGroupImage(wrapper, groupName); // image\n updateFaqGroupText(wrapper, groupName); // text\n updateFaqGroupButton(wrapper, groupName); // button\n updateFaqGroupVideo(wrapper, groupName); // \u2705 video (sets loop+autoplay and tries to play)\n } else {\n gsap.set(content, { height: 0 });\n gsap.set(contentInner, { opacity: 0 });\n gsap.set(xLine, { rotation: 0 });\n gsap.set(yLine, { rotation: 0 });\n toggle.setAttribute(\"data-state\", \"closed\");\n }\n\n let isAnimating: boolean = false;\n toggle.addEventListener(\"click\", (): void => {\n if (isAnimating) return;\n isAnimating = true;\n const isOpen: boolean = toggle.getAttribute(\"data-state\") === \"open\";\n\n // For \"one-at-a-time\" type, check if this is the last open FAQ\n if (faqType === \"one-at-a-time\" && groupContainer) {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n\n if (isOpen && openFAQs.length === 1) {\n // Don't allow closing the last open FAQ in \"one-at-a-time\" mode\n isAnimating = false;\n return;\n }\n }\n\n if (isOpen) {\n closeAccordion(wrapper, (): void => {\n isAnimating = false;\n });\n } else {\n if (faqType === \"one-at-a-time\" && groupContainer) {\n closeOtherAccordions(groupContainer);\n }\n openAccordion(wrapper, groupName, (): void => {\n isAnimating = false;\n });\n }\n });\n });\n\n // Initialize ratio heights on page load\n handleRatioHeights();\n\n // \u2705 Set up viewport-based autoplay/pause for all video targets\n initFaqVideoAutoplayObserver();\n\n setTimeout(playAllFaqVideos, 500);\n});\n\n// Handle window resize\nwindow.addEventListener(\"resize\", (): void => {\n handleRatioHeights();\n});\n\n// Function to handle ratio heights for FAQ image targets and tabgroups\nfunction handleRatioHeights(): void {\n // Run only if viewport width is >= 992px\n if (window.innerWidth < 992) return;\n\n // Find all FAQ image targets\n const imageTargets: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-image-target]');\n \n imageTargets.forEach((imageTarget: HTMLElement): void => {\n const wrapper: HTMLElement | null = imageTarget.parentElement;\n if (!wrapper) return;\n const ratioHeight: string | null = wrapper.getAttribute(\"ratio-height\");\n if (ratioHeight !== \"true\") return;\n wrapper.style.height = \"auto\";\n requestAnimationFrame((): void => {\n const renderedHeight: number = wrapper.offsetHeight;\n wrapper.style.height = `${renderedHeight}px`;\n });\n });\n\n // Handle tab groups\n const tabGroups: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-tabgroup][ratio-height=\"true\"]');\n tabGroups.forEach((tabGroup: HTMLElement): void => {\n tabGroup.style.height = \"auto\";\n requestAnimationFrame((): void => {\n const renderedHeight: number = tabGroup.offsetHeight;\n tabGroup.style.height = `${renderedHeight}px`;\n });\n });\n}\n\nfunction openAccordion(wrapper: HTMLElement, groupName: string | null, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n\n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for opening accordion');\n return;\n }\n\n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n\n const timeline = gsap.timeline({ onComplete: (): void => callback && callback() });\n\n gsap.set(content, { height: \"auto\", visibility: \"hidden\", opacity: 0 });\n const height: number = content.offsetHeight;\n gsap.set(content, { height: 0, visibility: \"visible\", opacity: 1 });\n\n timeline.to(xLine, { rotation: 180, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 270, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n content,\n {\n height,\n duration: 0.5,\n ease: \"power3.inOut\",\n clearProps: \"height\",\n onComplete: (): void => {\n (content as HTMLElement).style.height = \"auto\";\n },\n },\n 0\n );\n timeline.to(contentInner, { opacity: 1, duration: 0.4, ease: \"power2.out\" }, \"-=0.35\");\n\n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"open\");\n\n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) gsap.to(icon, { rotation: 180, duration: 0.4, ease: \"back.out(1.7)\" });\n\n // Update group-level UIs\n updateFaqGroupImage(wrapper, groupName);\n updateFaqGroupText(wrapper, groupName);\n updateFaqGroupButton(wrapper, groupName);\n updateFaqGroupVideo(wrapper, groupName); // \u2705 ensures autoplay on change\n}\n\nfunction closeAccordion(wrapper: HTMLElement, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n\n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for closing accordion');\n return;\n }\n\n if (content.gsapAnimation) content.gsapAnimation.kill();\n\n const height: number = content.offsetHeight;\n (content as HTMLElement).style.height = `${height}px`;\n\n const timeline = gsap.timeline({ onComplete: (): void => callback && callback() });\n\n timeline.to(xLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(contentInner, { opacity: 0, duration: 0.3, ease: \"power2.in\" }, 0);\n timeline.to(content, { height: 0, duration: 0.4, ease: \"power3.inOut\" }, \"-=0.25\");\n\n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"closed\");\n\n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) gsap.to(icon, { rotation: 0, duration: 0.4, ease: \"back.out(1.7)\" });\n}\n\n// Function to close all other accordions in the same group\nfunction closeOtherAccordions(groupContainer: HTMLElement): void {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n openFAQs.forEach((openToggle: HTMLElement): void => {\n const wrapper: HTMLElement | null = openToggle.closest('[fynd-faq-element=\"wrapper\"]');\n if (wrapper) closeAccordion(wrapper);\n });\n}\n\n// Function to update the group image\nfunction updateFaqGroupImage(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n const groupImage: HTMLImageElement | null = document.querySelector(\n `[fynd-faq-image-target=\"${groupName}\"]`\n );\n if (!groupImage) return;\n\n const imageSource: HTMLImageElement | null = wrapper.querySelector(\"[fynd-faq-image-source]\");\n if (!imageSource) return;\n\n const newSrc: string | null = imageSource.getAttribute(\"src\");\n const newSrcset: string | null = imageSource.getAttribute(\"srcset\");\n\n if (newSrc) groupImage.setAttribute(\"src\", newSrc);\n if (newSrcset) groupImage.setAttribute(\"srcset\", \"\");\n // removing srcset for now\n}\n\n// Function to update the group text\nfunction updateFaqGroupText(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n const groupText: HTMLElement | null = document.querySelector(\n `[fynd-faq-text-target=\"${groupName}\"]`\n );\n if (!groupText) return;\n\n const textSource: HTMLElement | null = wrapper.querySelector(\"[fynd-faq-text-source]\");\n if (!textSource) return;\n\n groupText.textContent = textSource.textContent;\n}\n\n// Function to update the group button\nfunction updateFaqGroupButton(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n const buttonTextTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-text-target=\"${groupName}\"]`\n );\n const buttonLinkTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-link-target=\"${groupName}\"]`\n );\n\n const linkSource: HTMLAnchorElement | null = wrapper.querySelector(\"[fynd-faq-link-source]\");\n if (!linkSource) return;\n\n if (buttonTextTarget) buttonTextTarget.textContent = linkSource.textContent;\n\n if (buttonLinkTarget) {\n for (let i = 0; i < linkSource.attributes.length; i++) {\n const attr = linkSource.attributes[i];\n buttonLinkTarget.setAttribute(attr.name, attr.value);\n }\n }\n}\n\n// \u2705 Always-loop + autoplay video updater\nfunction updateFaqGroupVideo(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n const groupVideo: HTMLVideoElement | null = document.querySelector(\n `[fynd-faq-video-target=\"${groupName}\"]`\n );\n if (!groupVideo) return;\n const groupVideoWrapper: HTMLElement | null = wrapper.querySelector(`[fynd-faq-video]`);\n if (!groupVideoWrapper) return;\n const groupImageWrapper: HTMLElement | null = wrapper.querySelector(`[fynd-faq-image]`);\n if (!groupImageWrapper) return;\n\n const sourceVideo: HTMLVideoElement | null = wrapper.querySelector(\"[fynd-faq-video-source]\");\n if (!sourceVideo) {\n groupVideo.style.display = \"none\";\n if(window.innerWidth < 992){\n groupVideoWrapper.style.display = \"none\";\n groupImageWrapper.style.display = \"block\";\n }\n return;\n }\n else{\n // groupVideo.style.display = \"block\";\n if(window.innerWidth < 992){\n groupVideoWrapper.style.display = \"block\";\n groupImageWrapper.style.display = \"none\";\n }\n }\n\n const sourceEl: HTMLSourceElement | null = sourceVideo.querySelector(\"source\");\n const newSrc: string | null = sourceEl?.getAttribute(\"src\") || null;\n const newType: string | null = sourceEl?.getAttribute(\"type\") || null;\n\n if (newSrc && newSrc.trim() !== \"\") {\n let targetSourceEl: HTMLSourceElement | null = groupVideo.querySelector(\"source\");\n if (!targetSourceEl) {\n targetSourceEl = document.createElement(\"source\");\n groupVideo.appendChild(targetSourceEl);\n }\n\n targetSourceEl.setAttribute(\"src\", newSrc);\n targetSourceEl.setAttribute(\"type\", newType || \"video/mp4\");\n\n // \u2705 Force desired playback behavior\n groupVideo.setAttribute(\"loop\", \"\");\n groupVideo.setAttribute(\"autoplay\", \"\");\n groupVideo.setAttribute(\"muted\", \"\"); // required for autoplay on most browsers\n groupVideo.setAttribute(\"playsinline\", \"\"); // iOS inline autoplay\n\n // Apply new source\n try { groupVideo.load(); } catch (e) { /* no-op */ }\n\n // Try to autoplay immediately\n autoplayVideo(groupVideo);\n\n groupVideo.style.display = \"block\";\n } else {\n groupVideo.style.display = \"none\";\n const targetSourceEl: HTMLSourceElement | null = groupVideo.querySelector(\"source\");\n if (targetSourceEl) {\n targetSourceEl.removeAttribute(\"src\");\n targetSourceEl.removeAttribute(\"type\");\n try { groupVideo.load(); } catch (e) { /* no-op */ }\n }\n }\n}\n\n// \uD83D\uDD38 Robust autoplay helper (handles Promise and race conditions)\nfunction autoplayVideo(video: HTMLVideoElement): void {\n // If not in DOM or hidden, defer to IntersectionObserver\n if (!video.isConnected || video.style.display === \"none\") return;\n\n // Some browsers need a tiny delay after .load()\n requestAnimationFrame(() => {\n const playPromise = video.play();\n if (playPromise && typeof (playPromise as Promise<void>).catch === \"function\") {\n (playPromise as Promise<void>).catch(() => {\n // If autoplay fails (rare with muted+playsinline), we silently ignore.\n });\n }\n });\n}\n\n// \uD83D\uDD38 Observe visibility to autoplay on entering viewport (and pause when out)\nfunction initFaqVideoAutoplayObserver(): void {\n const videos: NodeListOf<HTMLVideoElement> = document.querySelectorAll('[fynd-faq-video-target]');\n if (!videos.length) return;\n\n const io = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n const video = entry.target as HTMLVideoElement;\n // Only act if video has a valid source set\n const hasSrc = !!video.querySelector('source[src]');\n if (!hasSrc || video.style.display === \"none\") return;\n\n if (entry.isIntersecting && entry.intersectionRatio >= 0.5) {\n // Ensure autoplay attributes are present (defensive)\n video.setAttribute(\"autoplay\", \"\");\n video.setAttribute(\"muted\", \"\");\n video.setAttribute(\"playsinline\", \"\");\n video.setAttribute(\"loop\", \"\");\n autoplayVideo(video);\n } else {\n // Pause when scrolled out to save resources\n try { video.pause(); } catch (e) { /* no-op */ }\n }\n });\n }, { threshold: [0, 0.5, 1] });\n\n videos.forEach((v) => io.observe(v));\n}\n\n// Function to ensure at least one FAQ is open in \"one-at-a-time\" mode\nfunction ensureOneFaqOpen(groupContainer: HTMLElement | null): void {\n if (!groupContainer) return;\n\n const faqType: string = groupContainer.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n if (faqType !== \"one-at-a-time\") return;\n\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n\n if (openFAQs.length === 0) {\n const firstFaq: HTMLElement | null = groupContainer.querySelector('[fynd-faq-element=\"wrapper\"]');\n if (firstFaq) {\n const firstToggle: HTMLElement | null = firstFaq.querySelector('[fynd-faq-element=\"toggle\"]');\n if (firstToggle) {\n const groupName: string | null = groupContainer.getAttribute(\"fynd-faq-group\");\n openAccordion(firstFaq, groupName);\n }\n }\n }\n}\n\nasync function playAllFaqVideos(): Promise<void> {\n const videos: NodeListOf<HTMLVideoElement> = document.querySelectorAll(\n 'video[fynd-faq-video-target], video.fynd-faq-video-target, video[data-fynd-faq-video-target]'\n );\n\n for (const v of videos) {\n const hasSrc = v.src || v.querySelector('source[src]') !== null;\n if (!hasSrc) continue;\n if (!v.muted) v.muted = true;\n try {\n const playPromise = v.play();\n if (playPromise !== undefined) {\n await playPromise;\n }\n } catch (err) {\n console.debug('Could not play video:', v, err);\n }\n }\n}"],
5
+ "mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY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aAAa,YAAY,EAAE;AACjC,gBAAM,aAAa,SAAS,EAAE;AAC9B,gBAAM,aAAa,eAAe,EAAE;AACpC,gBAAM,aAAa,QAAQ,EAAE;AAC7B,wBAAc,KAAK;AAAA,QACrB,OAAO;AAEL,cAAI;AAAE,kBAAM,MAAM;AAAA,UAAG,SAAS,GAAG;AAAA,UAAc;AAAA,QACjD;AAAA,MACF,CAAC;AAAA,IACH,GAAG,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;AAE7B,WAAO,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;AAAA,EACrC;AAyBA,iBAAe,mBAAkC;AAC/C,UAAM,SAAuC,SAAS;AAAA,MACpD;AAAA,IACF;AAEA,eAAW,KAAK,QAAQ;AACtB,YAAM,SAAS,EAAE,OAAO,EAAE,cAAc,aAAa,MAAM;AAC3D,UAAI,CAAC,OAAQ;AACb,UAAI,CAAC,EAAE,MAAO,GAAE,QAAQ;AACxB,UAAI;AACF,cAAM,cAAc,EAAE,KAAK;AAC3B,YAAI,gBAAgB,QAAW;AAC7B,gBAAM;AAAA,QACR;AAAA,MACF,SAAS,KAAK;AACZ,gBAAQ,MAAM,yBAAyB,GAAG,GAAG;AAAA,MAC/C;AAAA,IACF;AAAA,EACF;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- "use strict";(()=>{function m(){document.querySelectorAll('a[href="#footer-form"]').forEach(r=>{let t=r;t.href="/contact-us"})}document.addEventListener("DOMContentLoaded",m);document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m):m();document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("p > a > em").forEach(r=>{r.setAttribute("richtext-button","primary")})});document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{function n(){let t=new URLSearchParams(window.location.search);t.set("referrer_domain",window.location.hostname),t.set("referrer_page",window.location.pathname),document.querySelectorAll('[href*="console.fynd.com"]').forEach(i=>{let s=new URL(i.href);t.forEach((o,e)=>{s.searchParams.set(e,o)}),i.href=s.toString()})}n()},100)});function L(n={}){let r=n.scope??document,t=new URL(n.baseUrl??window.location.href),c=new URLSearchParams;for(let[o,e]of new URLSearchParams(t.search).entries())o.toLowerCase().startsWith("utm_")&&c.set(o,e);let i=Array.from(r.querySelectorAll("a[href]")),s={updated:0,details:[]};for(let o of i){let e;try{e=new URL(o.getAttribute("href"),t)}catch{continue}let h=e.protocol==="http:"||e.protocol==="https:",u=e.hostname===t.hostname;if(!h||!u)continue;let d=o.href,f=[];for(let a of e.searchParams.keys())a.toLowerCase().startsWith("utm_")&&f.push(a);if(f.forEach(a=>e.searchParams.delete(a)),[...c.keys()].length>0)for(let[a,p]of c.entries())e.searchParams.set(a,p);let l=e.toString();l!==d&&(o.href=l,s.updated+=1,s.details.push({element:o,before:d,after:l}))}return s}document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{L({log:!0})},200)});})();
1
+ "use strict";(()=>{function f(o,n){if(o){if(n==="image"){let e=new Image;e.src=o}else if(n==="video"){let e=document.createElement("video");e.preload="auto",e.src=o}}}function h(){document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll('img[fynd-image-preload="true"]').forEach(e=>{let r=e.getAttribute("src");r&&f(r,"image")}),document.querySelectorAll('video[fynd-video-preload="true"]').forEach(e=>{let r=e.getAttribute("src");r&&f(r,"video")})})}function l(){document.querySelectorAll('a[href="#footer-form"]').forEach(n=>{let e=n;e.href="/contact-us"})}document.addEventListener("DOMContentLoaded",l);document.readyState==="loading"?document.addEventListener("DOMContentLoaded",l):l();document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("p > a > em").forEach(n=>{n.setAttribute("richtext-button","primary")})});document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{function o(){let e=new URLSearchParams(window.location.search);e.set("referrer_domain",window.location.hostname),e.set("referrer_page",window.location.pathname),document.querySelectorAll('[href*="console.fynd.com"]').forEach(i=>{let s=new URL(i.href);e.forEach((a,t)=>{s.searchParams.set(t,a)}),i.href=s.toString()})}o()},100)});function y(o={}){let n=o.scope??document,e=new URL(o.baseUrl??window.location.href),r=new URLSearchParams;for(let[a,t]of new URLSearchParams(e.search).entries())a.toLowerCase().startsWith("utm_")&&r.set(a,t);let i=Array.from(n.querySelectorAll("a[href]")),s={updated:0,details:[]};for(let a of i){let t;try{t=new URL(a.getAttribute("href"),e)}catch{continue}let p=t.protocol==="http:"||t.protocol==="https:",L=t.hostname===e.hostname;if(!p||!L)continue;let m=a.href,u=[];for(let c of t.searchParams.keys())c.toLowerCase().startsWith("utm_")&&u.push(c);if(u.forEach(c=>t.searchParams.delete(c)),[...r.keys()].length>0)for(let[c,g]of r.entries())t.searchParams.set(c,g);let d=t.toString();d!==m&&(a.href=d,s.updated+=1,s.details.push({element:a,before:m,after:d}))}return s}document.addEventListener("DOMContentLoaded",()=>{setTimeout(()=>{y({log:!0})},200)});document.addEventListener("DOMContentLoaded",()=>{h()});})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../bin/live-reload.js", "../../src/global/miscellaneous.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", "\ntype ApplyUtmsResult = {\n updated: number;\n details: Array<{\n element: HTMLAnchorElement;\n before: string;\n after: string;\n }>;\n};\n\ntype ApplyUtmsOptions = {\n scope?: ParentNode;\n baseUrl?: string;\n log?: boolean;\n};\n\n// Replace footer form hash links\nfunction replaceFooterFormLinks(): void {\n const footerLinks = document.querySelectorAll('a[href=\"#footer-form\"]');\n \n footerLinks.forEach((link: Element) => {\n const anchorElement = link as HTMLAnchorElement;\n anchorElement.href = '/contact-us';\n });\n }\n \n document.addEventListener('DOMContentLoaded', replaceFooterFormLinks);\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', replaceFooterFormLinks);\n } else {\n replaceFooterFormLinks();\n }\n\n// Add richtext-button=\"primary\" to all em tags under p > a > em\ndocument.addEventListener('DOMContentLoaded', (): void => {\n const emTags: NodeListOf<HTMLElement> = document.querySelectorAll('p > a > em');\n emTags.forEach((em: HTMLElement) => {\n em.setAttribute('richtext-button', 'primary');\n });\n});\n\n// Add UTMs to all links with href containing console.fynd.com\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n setTimeout(() => {\n function updateLinks(): void {\n const getQueryParams = (): URLSearchParams => {\n return new URLSearchParams(window.location.search);\n };\n const utmParams: URLSearchParams = getQueryParams();\n utmParams.set(\"referrer_domain\", window.location.hostname);\n utmParams.set(\"referrer_page\", window.location.pathname);\n const links: NodeListOf<HTMLAnchorElement> = document.querySelectorAll('[href*=\"console.fynd.com\"]');\n links.forEach((link: HTMLAnchorElement) => {\n const url = new URL(link.href);\n utmParams.forEach((value: string, key: string) => {\n url.searchParams.set(key, value);\n });\n link.href = url.toString();\n });\n }\n updateLinks();\n }, 100);\n});\n\n\n\n\n/**\n * Removes UTM params from internal links and, if the current page URL has UTMs,\n * applies those page-level UTMs to those internal links.\n */\nexport function applyPageUtmsToInternalLinks(\n options: ApplyUtmsOptions = {}\n): ApplyUtmsResult {\n const scope = options.scope ?? document;\n const base = new URL(options.baseUrl ?? window.location.href);\n const pageUtmParams = new URLSearchParams();\n for (const [k, v] of new URLSearchParams(base.search).entries()) {\n if (k.toLowerCase().startsWith(\"utm_\")) pageUtmParams.set(k, v);\n }\n const anchors = Array.from(\n scope.querySelectorAll<HTMLAnchorElement>(\"a[href]\")\n );\n\n const result: ApplyUtmsResult = { updated: 0, details: [] };\n for (const a of anchors) {\n let url: URL;\n try {\n url = new URL(a.getAttribute(\"href\")!, base);\n } catch {\n continue;\n }\n\n const isHttp = url.protocol === \"http:\" || url.protocol === \"https:\";\n const isInternal = url.hostname === base.hostname;\n if (!isHttp || !isInternal) continue;\n\n const before = a.href;\n const keysToDelete: string[] = [];\n for (const key of url.searchParams.keys()) {\n if (key.toLowerCase().startsWith(\"utm_\")) keysToDelete.push(key);\n }\n keysToDelete.forEach((k) => url.searchParams.delete(k));\n if ([...pageUtmParams.keys()].length > 0) {\n for (const [k, v] of pageUtmParams.entries()) {\n url.searchParams.set(k, v);\n }\n }\n const after = url.toString();\n if (after !== before) {\n a.href = after;\n result.updated += 1;\n result.details.push({ element: a, before, after });\n }\n }\n // Logging removed for production\n\n return result;\n}\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n setTimeout(() => {\n applyPageUtmsToInternalLinks({ log: true });\n }, 200);\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;AAAA,EAEP;;;ACOA,WAAS,yBAA+B;AACpC,UAAM,cAAc,SAAS,iBAAiB,wBAAwB;AAEtE,gBAAY,QAAQ,CAAC,SAAkB;AACrC,YAAM,gBAAgB;AACtB,oBAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAEA,WAAS,iBAAiB,oBAAoB,sBAAsB;AAEpE,MAAI,SAAS,eAAe,WAAW;AACrC,aAAS,iBAAiB,oBAAoB,sBAAsB;AAAA,EACtE,OAAO;AACL,2BAAuB;AAAA,EACzB;AAGF,WAAS,iBAAiB,oBAAoB,MAAY;AACtD,UAAM,SAAkC,SAAS,iBAAiB,YAAY;AAC9E,WAAO,QAAQ,CAAC,OAAoB;AAChC,SAAG,aAAa,mBAAmB,SAAS;AAAA,IAChD,CAAC;AAAA,EACL,CAAC;AAGD,WAAS,iBAAiB,oBAAoB,MAAM;AAClD,eAAW,MAAM;AACf,eAAS,cAAoB;AAC3B,cAAM,iBAAiB,MAAuB;AAC5C,iBAAO,IAAI,gBAAgB,OAAO,SAAS,MA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,iBAAW,OAAO,IAAI,aAAa,KAAK,GAAG;AACzC,YAAI,IAAI,YAAY,EAAE,WAAW,MAAM,EAAG,cAAa,KAAK,GAAG;AAAA,MACjE;AACA,mBAAa,QAAQ,CAAC,MAAM,IAAI,aAAa,OAAO,CAAC,CAAC;AACtD,UAAI,CAAC,GAAG,cAAc,KAAK,CAAC,EAAE,SAAS,GAAG;AACxC,mBAAW,CAAC,GAAG,CAAC,KAAK,cAAc,QAAQ,GAAG;AAC5C,cAAI,aAAa,IAAI,GAAG,CAAC;AAAA,QAC3B;AAAA,MACF;AACA,YAAM,QAAQ,IAAI,SAAS;AAC3B,UAAI,UAAU,QAAQ;AACpB,UAAE,OAAO;AACT,eAAO,WAAW;AAClB,eAAO,QAAQ,KAAK,EAAE,SAAS,GAAG,QAAQ,MAAM,CAAC;AAAA,MACnD;AAAA,IACF;AAGA,WAAO;AAAA,EACT;AACA,WAAS,iBAAiB,oBAAoB,MAAM;AAClD,eAAW,MAAM;AACf,mCAA6B,EAAE,KAAK,KAAK,CAAC;AAAA,IAC5C,GAAG,GAAG;AAAA,EACR,CAAC;",
3
+ "sources": ["../../bin/live-reload.js", "../../src/global/preload-media.ts", "../../src/global/miscellaneous.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", "// Utility function to preload images and videos based on custom attributes\n\nfunction preloadSrc(src: string | null, type: \"image\" | \"video\"): void {\n if (!src) return;\n \n if (type === \"image\") {\n const img = new Image();\n img.src = src;\n } else if (type === \"video\") {\n const video = document.createElement(\"video\");\n video.preload = \"auto\";\n video.src = src;\n }\n }\n \n function addPreloadLink(src: string, asType: \"image\" | \"video\"): void {\n const link = document.createElement(\"link\");\n link.rel = \"preload\";\n link.as = asType;\n link.href = src;\n document.head.appendChild(link);\n }\n \n export function preloadFyndMedia(): void {\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Preload images with fynd-image-preload=\"true\"\n const images = document.querySelectorAll<HTMLImageElement>('img[fynd-image-preload=\"true\"]');\n images.forEach((img) => {\n const src = img.getAttribute(\"src\");\n if (src) {\n preloadSrc(src, \"image\");\n // Optionally add preload hint:\n // addPreloadLink(src, \"image\");\n }\n });\n \n // Preload videos with fynd-video-preload=\"true\"\n const videos = document.querySelectorAll<HTMLVideoElement>('video[fynd-video-preload=\"true\"]');\n videos.forEach((video) => {\n const src = video.getAttribute(\"src\");\n if (src) {\n preloadSrc(src, \"video\");\n // Optionally add preload hint:\n // addPreloadLink(src, \"video\");\n }\n });\n });\n }", "import { preloadFyndMedia } from \"./preload-media\";\n\ntype ApplyUtmsResult = {\n updated: number;\n details: Array<{\n element: HTMLAnchorElement;\n before: string;\n after: string;\n }>;\n};\n\ntype ApplyUtmsOptions = {\n scope?: ParentNode;\n baseUrl?: string;\n log?: boolean;\n};\n\n// Replace footer form hash links\nfunction replaceFooterFormLinks(): void {\n const footerLinks = document.querySelectorAll('a[href=\"#footer-form\"]');\n \n footerLinks.forEach((link: Element) => {\n const anchorElement = link as HTMLAnchorElement;\n anchorElement.href = '/contact-us';\n });\n }\n \n document.addEventListener('DOMContentLoaded', replaceFooterFormLinks);\n \n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', replaceFooterFormLinks);\n } else {\n replaceFooterFormLinks();\n }\n\n// Add richtext-button=\"primary\" to all em tags under p > a > em\ndocument.addEventListener('DOMContentLoaded', (): void => {\n const emTags: NodeListOf<HTMLElement> = document.querySelectorAll('p > a > em');\n emTags.forEach((em: HTMLElement) => {\n em.setAttribute('richtext-button', 'primary');\n });\n});\n\n// Add UTMs to all links with href containing console.fynd.com\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n setTimeout(() => {\n function updateLinks(): void {\n const getQueryParams = (): URLSearchParams => {\n return new URLSearchParams(window.location.search);\n };\n const utmParams: URLSearchParams = getQueryParams();\n utmParams.set(\"referrer_domain\", window.location.hostname);\n utmParams.set(\"referrer_page\", window.location.pathname);\n const links: NodeListOf<HTMLAnchorElement> = document.querySelectorAll('[href*=\"console.fynd.com\"]');\n links.forEach((link: HTMLAnchorElement) => {\n const url = new URL(link.href);\n utmParams.forEach((value: string, key: string) => {\n url.searchParams.set(key, value);\n });\n link.href = url.toString();\n });\n }\n updateLinks();\n }, 100);\n});\n\n\n\n\n/**\n * Removes UTM params from internal links and, if the current page URL has UTMs,\n * applies those page-level UTMs to those internal links.\n */\nexport function applyPageUtmsToInternalLinks(\n options: ApplyUtmsOptions = {}\n): ApplyUtmsResult {\n const scope = options.scope ?? document;\n const base = new URL(options.baseUrl ?? window.location.href);\n const pageUtmParams = new URLSearchParams();\n for (const [k, v] of new URLSearchParams(base.search).entries()) {\n if (k.toLowerCase().startsWith(\"utm_\")) pageUtmParams.set(k, v);\n }\n const anchors = Array.from(\n scope.querySelectorAll<HTMLAnchorElement>(\"a[href]\")\n );\n\n const result: ApplyUtmsResult = { updated: 0, details: [] };\n for (const a of anchors) {\n let url: URL;\n try {\n url = new URL(a.getAttribute(\"href\")!, base);\n } catch {\n continue;\n }\n\n const isHttp = url.protocol === \"http:\" || url.protocol === \"https:\";\n const isInternal = url.hostname === base.hostname;\n if (!isHttp || !isInternal) continue;\n\n const before = a.href;\n const keysToDelete: string[] = [];\n for (const key of url.searchParams.keys()) {\n if (key.toLowerCase().startsWith(\"utm_\")) keysToDelete.push(key);\n }\n keysToDelete.forEach((k) => url.searchParams.delete(k));\n if ([...pageUtmParams.keys()].length > 0) {\n for (const [k, v] of pageUtmParams.entries()) {\n url.searchParams.set(k, v);\n }\n }\n const after = url.toString();\n if (after !== before) {\n a.href = after;\n result.updated += 1;\n result.details.push({ element: a, before, after });\n }\n }\n // Logging removed for production\n\n return result;\n}\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n setTimeout(() => {\n applyPageUtmsToInternalLinks({ log: true });\n }, 200);\n});\n\n//calling preloadFyndMedia\ndocument.addEventListener(\"DOMContentLoaded\", () => {\npreloadFyndMedia();\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;AAAA,EAEP;;;ACRA,WAAS,WAAW,KAAoB,MAA+B;AACnE,QAAI,CAAC,IAAK;AAEV,QAAI,SAAS,SAAS;AACpB,YAAM,MAAM,IAAI,MAAM;AACtB,UAAI,MAAM;AAAA,IACZ,WAAW,SAAS,SAAS;AAC3B,YAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,YAAM,UAAU;AAChB,YAAM,MAAM;AAAA,IACd;AAAA,EACF;AAUO,WAAS,mBAAyB;AACvC,aAAS,iBAAiB,oBAAoB,MAAM;AAElD,YAAM,SAAS,SAAS,iBAAmC,gCAAgC;AAC3F,aAAO,QAAQ,CAAC,QAAQ;AACtB,cAAM,MAAM,IAAI,aAAa,KAAK;AAClC,YAAI,KAAK;AACP,qBAAW,KAAK,OAAO;AAAA,QAGzB;AAAA,MACF,CAAC;AAGD,YAAM,SAAS,SAAS,iBAAmC,kCAAkC;AAC7F,aAAO,QAAQ,CAAC,UAAU;AACxB,cAAM,MAAM,MAAM,aAAa,KAAK;AACpC,YAAI,KAAK;AACP,qBAAW,KAAK,OAAO;AAAA,QAGzB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAAA,EACH;;;AC7BF,WAAS,yBAA+B;AACpC,UAAM,cAAc,SAAS,iBAAiB,wBAAwB;AAEtE,gBAAY,QAAQ,CAAC,SAAkB;AACrC,YAAM,gBAAgB;AACtB,oBAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAEA,WAAS,iBAAiB,oBAAoB,sBAAsB;AAEpE,MAAI,SAAS,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
- "sources": ["../../bin/live-reload.js", "../../src/posthog-and-ga/adTracking.ts", "../../src/posthog-and-ga/meta-tracking.ts", "../../src/posthog-and-ga/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", "// adTracking.ts \u2014 Conditional ad events using existing tracking pipeline\n// Now supports optional UTM campaign gating per page slug.\n\nexport type AdConfig = {\n adPageSlug: string; // e.g. \"/solutions/transport-management-system\"\n adEventExtension: string; // e.g. \"tms\"\n adUTMCampaign?: string | string[]; // e.g. \"tms\" or [\"tms\",\"tms_search\"]\n /** Back-compat alias for earlier typo */\n adUTMCampagin?: string | string[];\n};\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n validationPassed?: boolean;\n __adsTrackingInitialized?: boolean;\n }\n}\n\nconst normalizePath = (p: string) => {\n const path = p.startsWith(\"/\") ? p : `/${p}`;\n return path !== \"/\" && path.endsWith(\"/\") ? path.slice(0, -1) : path;\n};\n\nconst getSearchParam = (name: string): string | null => {\n const v = new URLSearchParams(window.location.search).get(name);\n return v ? v.trim() : null;\n};\n\nconst matchesUtm = (cfg: AdConfig): boolean => {\n // If no UTM gating configured, allow.\n const configured = cfg.adUTMCampaign ?? cfg.adUTMCampagin;\n if (!configured) return true;\n\n const want = Array.isArray(configured)\n ? configured.map((s) => s.toLowerCase())\n : [configured.toLowerCase()];\n\n const got = getSearchParam(\"utm_campaign\")?.toLowerCase() ?? null;\n return !!got && want.includes(got);\n};\n\nconst getActiveAdConfig = (configs: AdConfig[]): AdConfig | null => {\n const current = normalizePath(window.location.pathname);\n for (const cfg of configs) {\n const slug = normalizePath(cfg.adPageSlug);\n const slugMatches = current === slug || current.startsWith(slug + \"/\");\n if (slugMatches && matchesUtm(cfg)) return cfg;\n }\n return null;\n};\n\nconst makeAdEvent = (ext: string, suffix: string) =>\n `fynd_website_ad_${ext}.${suffix}`;\n\n// local helper (kept here to avoid circular dependency with main.ts)\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n};\n\nexport const initAdsTracking = (configs: AdConfig[]) => {\n // prevent double wiring across SPA navigations / duplicate script loads\n if (window.__adsTrackingInitialized) return;\n\n const active = getActiveAdConfig(configs);\n if (!active) return; // not an ad page or UTM didn't match\n\n window.__adsTrackingInitialized = true;\n\n const emit = (suffix: string, props?: Record<string, any>) => {\n const name = makeAdEvent(active.adEventExtension, suffix);\n window.trackEvent?.(name, props);\n };\n\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Buttons\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]');\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]');\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]');\n\n signUpButtons.forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_up.clicked\"))\n );\n signInButtons.forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_in.clicked\"))\n );\n bookADemoButtons.forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"book_a_demo.clicked\"))\n );\n\n // Form started (first interaction per form)\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n\n const handleFormStarted = function (this: HTMLElement) {\n const formName = getParentFormName(this) || \"unknown-form\";\n if (!triggeredForms.has(formName)) {\n triggeredForms.add(formName);\n emit(\"form.started\");\n }\n };\n\n formFields.forEach((field) => {\n const tag = field.tagName.toLowerCase();\n const type = (field as HTMLInputElement).type?.toLowerCase();\n if (!(tag === \"button\" || (tag === \"input\" && type === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\n if (tag === \"button\" || (tag === \"input\" && type === \"submit\")) {\n field.addEventListener(\"click\", handleFormStarted);\n } else if (tag === \"select\") {\n field.addEventListener(\"change\", handleFormStarted);\n } else {\n field.addEventListener(\"input\", handleFormStarted);\n }\n });\n\n // Form submitted (after validation)\n const submitButtons = document.querySelectorAll('[type=\"submit\"]');\n submitButtons.forEach((button) => {\n button.addEventListener(\"click\", function (this: HTMLElement) {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n const props = formName ? { submitted_form: formName } : {};\n emit(\"form.submitted\", props);\n }\n }, 10);\n });\n });\n });\n};", "// meta-tracking.ts \u2014 Meta Pixel integration (standards-compliant) for Fynd website\n// - Initializes Meta Pixel (fbq) with Advanced Matching (when available)\n// - Mirrors your existing window.trackEvent() calls to Meta events\n// - Maps Fynd events -> Meta standard/custom events for better optimization\n// - Adds SPA PageView handling + eventID generation for future CAPI dedup\n// - Safe to import once anywhere in your app bootstrap\n\nimport { UserJourney } from \"../utils/types/user-journey\";\n\n// ---------- Config ----------\nconst META_PIXEL_ID = \"2741377816069290\";\n\ntype AdvancedUser = {\n email?: string;\n phone?: string;\n first_name?: string;\n last_name?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n external_id?: string;\n};\n\ntype InitOptions = {\n /**\n * If true, attempts to pull user info from window.getUserJourney/sessionStorage\n * and pass as Advanced Matching data (improves match rate for retargeting).\n */\n enableAdvancedMatching?: boolean;\n\n /**\n * If true, listens for SPA route changes and fires PageView on history changes.\n * Set true if you use a client-side router.\n */\n enableSpaPageViews?: boolean;\n\n /**\n * Optional predicate: return false to block Meta calls until consent is granted.\n * Example: () => window.__ad_consent === 'granted'\n */\n hasConsent?: () => boolean;\n};\n\n// ---------- fbq bootstrap ----------\ndeclare global {\n interface Window {\n fbq?: (...args: any[]) => void;\n _fbq?: any;\n trackEvent: (eventName: string, properties?: any) => void;\n getUserJourney: () => UserJourney | null;\n }\n}\n\nfunction loadMetaPixel(): void {\n if (typeof window === \"undefined\") return;\n if (window.fbq) return;\n\n (function (f: any, b: any, e: any, v: any, n?: any, t?: any, s?: any) {\n if (f.fbq) return;\n n = f.fbq = function () {\n (n as any).callMethod ? (n as any).callMethod.apply(n, arguments) : (n as any).queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n (n as any).push = (n as any);\n (n as any).loaded = true;\n (n as any).version = \"2.0\";\n (n as any).queue = [];\n t = b.createElement(e);\n t.async = true;\n t.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n s = b.getElementsByTagName(e)[0];\n s.parentNode!.insertBefore(t, s);\n })(window, document, \"script\", undefined);\n}\n\n// ---------- Advanced Matching helpers ----------\nfunction getAdvancedUserFromJourney(): AdvancedUser | null {\n try {\n let journey: any = null;\n if (typeof window.getUserJourney === \"function\") {\n journey = window.getUserJourney();\n }\n if (!journey) {\n const stored = sessionStorage.getItem(\"userJourney\");\n if (stored) journey = JSON.parse(stored);\n }\n\n const u: AdvancedUser = {};\n const fd = journey?.formDetails;\n if (fd?.email) u.email = fd.email;\n if (fd?.phone) u.phone = fd.phone;\n if (fd?.firstName) u.first_name = fd.firstName;\n if (fd?.lastName) u.last_name = fd.lastName;\n if (fd?.city) u.city = fd.city;\n if (fd?.state) u.state = fd.state;\n if (fd?.zip) u.zip = fd.zip;\n if (journey?.country) u.country = journey.country;\n if (journey?.userId) u.external_id = String(journey.userId);\n\n // Remove empties\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n } catch {\n return null;\n }\n}\n\nfunction getAdvancedUserFromProps(props?: any): AdvancedUser | null {\n if (!props) return null;\n const u: AdvancedUser = {};\n if (props[\"fynd_website.form_email\"]) u.email = props[\"fynd_website.form_email\"];\n if (props[\"fynd_website.form_phone\"]) u.phone = props[\"fynd_website.form_phone\"];\n if (props[\"fynd_website.form_first_name\"]) u.first_name = props[\"fynd_website.form_first_name\"];\n if (props[\"fynd_website.form_last_name\"]) u.last_name = props[\"fynd_website.form_last_name\"];\n if (props.city) u.city = props.city;\n if (props.state) u.state = props.state;\n if (props.zip) u.zip = props.zip;\n if (props.country) u.country = props.country;\n if (props.external_id) u.external_id = props.external_id;\n\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n}\n\n// ---------- Utility ----------\nfunction genEventId(prefix: string = \"evt\"): string {\n return `${prefix}_${Date.now()}_${Math.random().toString(36).slice(2)}`;\n}\n\nfunction safeFbq(...args: any[]): void {\n if (!window.fbq) return;\n window.fbq(...args);\n}\n\n// ---------- Core mapping (Fynd -> Meta) ----------\n/**\n * Maps your event names to Meta\u2019s recommended events.\n * Returns {name, params, options} ready for fbq('track'|'trackCustom', ...)\n */\nfunction mapFyndToMeta(eventName: string, properties?: any): {\n type: \"track\" | \"trackCustom\";\n name: string;\n params?: Record<string, any>;\n options?: { eventID?: string };\n userData?: AdvancedUser | null;\n} | null {\n const props = properties || {};\n // Try to extract user for Advanced Matching\n const userData = getAdvancedUserFromProps(props) || getAdvancedUserFromJourney();\n\n switch (eventName) {\n case \"fynd_website.form.submitted\": {\n // Choose 'Lead' as default (use CompleteRegistration for account creation flows)\n const eventID = props.event_id || genEventId(\"lead\");\n const formName = props.submitted_form || props[\"fynd_website.form_name\"] || \"unknown_form\";\n return {\n type: \"track\",\n name: \"Lead\",\n params: {\n form_id: props[\"fynd_website.form_id\"] || undefined,\n form_name: formName,\n value: 0,\n currency: \"INR\",\n },\n options: { eventID },\n userData,\n };\n }\n\n case \"fynd_website.sign_up.clicked\":\n return { type: \"trackCustom\", name: \"SignUpClick\", params: {}, userData };\n\n case \"fynd_website.sign_in.clicked\":\n return { type: \"trackCustom\", name: \"SignInClick\", params: {}, userData };\n\n case \"fynd_website.book_a_demo.clicked\":\n return {\n type: \"trackCustom\",\n name: \"BookDemoClick\",\n params: {\n source_page: props?.[\"fynd_website.source_page\"],\n },\n userData,\n };\n\n case \"fynd_website.form.started\":\n return {\n type: \"trackCustom\",\n name: \"FormStarted\",\n params: {\n form_id: props?.[\"fynd_website.form_id\"] || undefined,\n form_name: props?.[\"fynd_website.form_name\"] || undefined,\n },\n userData,\n };\n\n // Page lifecycle\n case \"fynd_website.page.loaded\":\n return { type: \"track\", name: \"PageView\", params: {}, userData };\n\n default:\n // Ignore other events by default; you can add more mappings here\n return null;\n }\n}\n\n// ---------- Public API ----------\n/**\n * Initialize Meta tracking and tee into window.trackEvent so existing code just works.\n */\nexport function initMetaTracking(options: InitOptions = {}): void {\n const { enableAdvancedMatching = true, enableSpaPageViews = true, hasConsent } = options;\n\n // 1) Load fbq\n loadMetaPixel();\n\n // 2) Init with/without Advanced Matching\n const initialUser = enableAdvancedMatching ? getAdvancedUserFromJourney() : null;\n if (hasConsent && !hasConsent()) {\n // Defer init until consent flips to true (lightweight poller)\n const iv = window.setInterval(() => {\n if (hasConsent()) {\n window.clearInterval(iv);\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n }, 250);\n } else {\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n\n // 3) Tee into window.trackEvent to mirror to Meta\n const originalTrackEvent = window.trackEvent;\n window.trackEvent = function (eventName: string, properties?: any): void {\n try {\n // First, call original (so PostHog/GA remain unchanged)\n if (typeof originalTrackEvent === \"function\") {\n originalTrackEvent.call(window, eventName, properties);\n }\n // Then forward to Meta (respect consent if provided)\n if (hasConsent && !hasConsent()) return;\n\n const mapped = mapFyndToMeta(eventName, properties);\n if (!mapped) return;\n\n // Pass Advanced Matching userData by re-calling init? No\u2014Meta supports user data on event via fbq 2nd arg in init or as 'init' options.\n // For events, best practice is to include user data via \"Advanced Matching\" settings or CAPI.\n // Here we rely on init advanced matching; optionally, you can include userData with custom calls via setUserProperties (not available on Pixel).\n if (mapped.type === \"track\") {\n if (mapped.options?.eventID) {\n safeFbq(\"track\", mapped.name, mapped.params || {}, { eventID: mapped.options.eventID });\n } else {\n safeFbq(\"track\", mapped.name, mapped.params || {});\n }\n } else {\n // trackCustom\n // We cannot pass user data as a separate arg here; advanced matching should be handled at init or via CAPI.\n safeFbq(\"trackCustom\", mapped.name, mapped.params || {});\n }\n } catch (e) {\n // swallow to avoid interrupting primary trackers\n // eslint-disable-next-line no-console\n console.warn(\"Meta tracking error:\", e);\n }\n };\n}\n\n/**\n * Manually send a CompleteRegistration when your \u201Cform submitted\u201D is actually an account creation.\n * Reuse the same eventID for later CAPI dedup if you mirror server-side.\n */\nexport function trackCompleteRegistration(registrationMethod: string = \"email\", eventID?: string, props?: any) {\n const options = eventID ? { eventID } : undefined;\n // Respect optional consent gate if your app uses one:\n // if (window.__ad_consent !== 'granted') return;\n safeFbq(\"track\", \"CompleteRegistration\", { registration_method: registrationMethod }, options);\n}\n\n/**\n * Optional helper if you want to send a Lead directly (outside of window.trackEvent).\n */\nexport function trackLead(formId?: string, formName?: string, valueINR: number = 0, eventID?: string) {\n const params: Record<string, any> = { value: valueINR, currency: \"INR\" };\n if (formId) params.form_id = formId;\n if (formName) params.form_name = formName;\n const options = { eventID: eventID || genEventId(\"lead\") };\n safeFbq(\"track\", \"Lead\", params, options);\n}\n\n// ---------- Internal: post init tasks ----------\nfunction postInit(enableSpaPageViews: boolean) {\n // Fire initial PageView (Meta does this automatically when you call fbq('track','PageView')\u2014we mimic GA's $pageview behavior)\n safeFbq(\"track\", \"PageView\");\n\n if (enableSpaPageViews) {\n // Hook into history API to catch virtual route changes\n const origPushState = history.pushState;\n const origReplaceState = history.replaceState;\n\n function onLocationChange() {\n // Delay slightly to allow DOM/router to settle\n setTimeout(() => safeFbq(\"track\", \"PageView\"), 0);\n }\n\n history.pushState = function (...args: any[]) {\n const ret = origPushState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n history.replaceState = function (...args: any[]) {\n const ret = origReplaceState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n window.addEventListener(\"popstate\", onLocationChange);\n }\n}\n\n// ---------- (Optional) noscript pixel for non-JS fallbacks ----------\n// In your HTML <noscript>, add:\n// <img height=\"1\" width=\"1\" style=\"display:none\"\n// src=\"https://www.facebook.com/tr?id=2741377816069290&ev=PageView&noscript=1\"/>", "// main.ts \u2014 Core tracking: PostHog + GA (GTM dataLayer) + optional ad tracking bootstrap\nimport { FormDetails, UserJourney } from \"../utils/types/user-journey\";\nimport { AdConfig, initAdsTracking } from \"./adTracking\";\nimport { initMetaTracking } from \"./meta-tracking\";\n\n// ---------- Types ----------\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;\n}\n\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 aidata_context?: string;\n aidata_platform?: string;\n aidata_type?: string;\n aidata_detection?: string;\n}\n\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 \"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 \"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;\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 \"fynd_website.aidata_context\"?: string;\n \"fynd_website.aidata_platform\"?: string;\n \"fynd_website.aidata_type\"?: string;\n \"fynd_website.aidata_detection\"?: string;\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any;\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 helpers ----------\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = sessionStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey?.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n if (formDetails.formId) gaProperties.form_id = formDetails.formId;\n if (formDetails.formName) gaProperties.form_name = formDetails.formName;\n if (formDetails.firstName) gaProperties.form_first_name = formDetails.firstName;\n if (formDetails.lastName) gaProperties.form_last_name = formDetails.lastName;\n if (formDetails.email) gaProperties.form_email = formDetails.email;\n if (formDetails.phone) gaProperties.form_phone = formDetails.phone;\n }\n\n if (journey?.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) gaProperties.aidata_context = aiData.context;\n if (aiData.platform) gaProperties.aidata_platform = aiData.platform;\n if (aiData.type) gaProperties.aidata_type = aiData.type;\n if (aiData.detectionMethod) gaProperties.aidata_detection = aiData.detectionMethod;\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for GA tracking:\", err);\n }\n return gaProperties;\n};\n\n// ---------- PostHog properties ----------\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n const base: TrackingProperties = {\n \"fynd_website.source_page\": pathname,\n \"fynd_website.product\": \"fynd.com website\",\n \"fynd_website.device_type\": \"Unknown\",\n \"fynd_website.utm_source\": new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n \"fynd_website.utm_medium\": new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n \"fynd_website.utm_campaign\": new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n \"fynd_website.referrer\": document.referrer,\n };\n\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = sessionStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey) {\n base[\"fynd_website.journey_touchpoints\"] = journey.userJourney || journey;\n\n if (journey.formDetails) {\n const f: FormDetails = journey.formDetails;\n if (f.formId) base[\"fynd_website.form_id\"] = f.formId;\n if (f.formName) base[\"fynd_website.form_name\"] = f.formName;\n if (f.firstName) base[\"fynd_website.form_first_name\"] = f.firstName;\n if (f.lastName) base[\"fynd_website.form_last_name\"] = f.lastName;\n if (f.email) base[\"fynd_website.form_email\"] = f.email;\n if (f.phone) base[\"fynd_website.form_phone\"] = f.phone;\n }\n\n if (journey.userJourney?.length > 0) {\n base[\"fynd_website.journey_total_pages\"] = journey.userJourney.length;\n base[\"fynd_website.journey_touchpoints_count\"] = journey.userJourney.length;\n base[\"fynd_website.journey_first_page\"] = journey.userJourney[0].page;\n base[\"fynd_website.journey_current_page\"] =\n journey.userJourney[journey.userJourney.length - 1].page;\n\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n base[\"fynd_website.journey_session_duration\"] = Math.floor(\n (lastVisit.getTime() - firstVisit.getTime()) / 1000\n );\n base[\"fynd_website.journey_entry_time\"] = journey.userJourney[0].time;\n base[\"fynd_website.journey_exit_time\"] = journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n if (journey.deviceCategory) base[\"fynd_website.device_type\"] = journey.deviceCategory;\n if (journey.browser) base[\"fynd_website.journey_browser\"] = journey.browser;\n if (journey.device) base[\"fynd_website.journey_device\"] = journey.device;\n if (journey.origin) base[\"fynd_website.journey_origin\"] = journey.origin;\n if (journey.utmPath) base[\"fynd_website.journey_utm_path\"] = journey.utmPath;\n if (journey.scrollDepth) base[\"fynd_website.journey_scroll_depth\"] = journey.scrollDepth;\n\n if (journey.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) base[\"fynd_website.aidata_context\"] = aiData.context;\n if (aiData.platform) base[\"fynd_website.aidata_platform\"] = aiData.platform;\n if (aiData.type) base[\"fynd_website.aidata_type\"] = aiData.type;\n if (aiData.detectionMethod) base[\"fynd_website.aidata_detection\"] = aiData.detectionMethod;\n }\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for tracking:\", err);\n }\n\n // Fallback device type\n if (base[\"fynd_website.device_type\"] === \"Unknown\") {\n const ua = navigator.userAgent;\n if (/iPad/.test(ua) || (/Android/.test(ua) && !/Mobile/.test(ua)) || /Tablet/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Tablet\";\n } else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Mobile\";\n } else {\n base[\"fynd_website.device_type\"] = \"Desktop\";\n }\n }\n return base;\n};\n\n// ---------- GA send ----------\nconst sendToGA = (eventName: string, gaProps: GATrackingProperties, additionalProps?: 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 ...gaProps,\n };\n if (additionalProps?.submitted_form) {\n eventData.submitted_form = additionalProps.submitted_form;\n }\n (window as any).dataLayer.push(eventData);\n } else {\n console.warn(\"dataLayer not available for GA tracking\");\n }\n};\n\n// ---------- Public trackEvent ----------\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n const baseProps = getPosthogTrackingProperties();\n const finalProps = properties ? { ...baseProps, ...properties } : baseProps;\n\n if ((window as any).posthog) {\n (window as any).posthog.capture(eventName, finalProps);\n }\n\n const gaProps = getGaTrackingProperties();\n const hasAIData =\n gaProps.aidata_context || gaProps.aidata_platform || gaProps.aidata_type || gaProps.aidata_detection;\n\n const isFormRelatedEvent =\n eventName.includes(\"form\") ||\n Object.keys(gaProps).length > 0 ||\n properties?.submitted_form ||\n !!hasAIData;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProps, properties);\n }\n } catch (error) {\n console.error(\"Error tracking event:\", error);\n }\n};\n\n// ---------- Shared helpers ----------\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n};\n\n// ---------- Page lifecycle ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const props = getPosthogTrackingProperties();\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", props);\n }\n});\n\nwindow.addEventListener(\"load\", () => {\n trackEvent(\"fynd_website.page.loaded\");\n});\n\n// ---------- Base site interactions ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]');\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]');\n const scrollToFormButtons = document.querySelectorAll('[href=\"#footer-form\"]');\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]');\n const submitButtons = document.querySelectorAll('[type=\"submit\"]');\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 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\", () => trackEvent(\"fynd_website.sign_up.clicked\"));\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.sign_in.clicked\"));\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.scroll_to_form.clicked\"));\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.book_a_demo.clicked\"));\n });\n\n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || \"unknown-form\";\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n trackEvent(\"fynd_website.form.started\");\n }\n };\n\n formFields.forEach((field) => {\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n\n if (!(tagName === \"button\" || (tagName === \"input\" && inputType === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\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// ---------- Expose globals ----------\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// ---------- Optional: bootstrap ad tracking here ----------\nconst AD_CONFIGS: AdConfig[] = [\n { adPageSlug: \"/solutions/transport-management-system\", adEventExtension: \"tms\", adUTMCampaign: \"tms\", },\n];\ninitAdsTracking(AD_CONFIGS);\n\ninitMetaTracking({\n enableAdvancedMatching: true, // pulls user data from your journey store when available\n enableSpaPageViews: true, // fires PageView on virtual navigations\n hasConsent: () => (window as any).__ad_consent === \"granted\" || true, // replace with your consent logic\n });\n\n// ---------- Exports ----------\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\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;AAAA,EAEP;;;ACSA,MAAM,gBAAgB,CAAC,MAAc;AACnC,UAAM,OAAO,EAAE,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC;AAC1C,WAAO,SAAS,OAAO,KAAK,SAAS,GAAG,IAAI,KAAK,MAAM,GAAG,EAAE,IAAI;AAAA,EAClE;AAEA,MAAM,iBAAiB,CAAC,SAAgC;AACtD,UAAM,IAAI,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,IAAI;AAC9D,WAAO,IAAI,EAAE,KAAK,IAAI;AAAA,EACxB;AAEA,MAAM,aAAa,CAAC,QAA2B;AAE7C,UAAM,aAAa,IAAI,iBAAiB,IAAI;AAC5C,QAAI,CAAC,WAAY,QAAO;AAExB,UAAM,OAAO,MAAM,QAAQ,UAAU,IACjC,WAAW,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,IACrC,CAAC,WAAW,YAAY,CAAC;AAE7B,UAAM,MAAM,eAAe,cAAc,GAAG,YAAY,KAAK;AAC7D,WAAO,CAAC,CAAC,OAAO,KAAK,SAAS,GAAG;AAAA,EACnC;AAEA,MAAM,oBAAoB,CAAC,YAAyC;AAClE,UAAM,UAAU,cAAc,OAAO,SAAS,QAAQ;AACtD,eAAW,OAAO,SAAS;AACzB,YAAM,OAAO,cAAc,I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iBAAiB,SAAS,MAAM,WAAW,kCAAkC,CAAC;AAAA,IACvF,CAAC;AAGD,UAAM,aAAa,SAAS,iBAA8B,iBAAiB;AAC3E,UAAM,iBAAiB,oBAAI,IAAY;AAEvC,UAAM,oBAAoB,WAAmC;AAC3D,YAAM,WAAWA,mBAAkB,IAAI;AACvC,YAAM,iBAAiB,YAAY;AACnC,UAAI,CAAC,eAAe,IAAI,cAAc,GAAG;AACvC,uBAAe,IAAI,cAAc;AACjC,mBAAW,2BAA2B;AAAA,MACxC;AAAA,IACF;AAEA,eAAW,QAAQ,CAAC,UAAU;AAC5B,YAAM,UAAU,MAAM,QAAQ,YAAY;AAC1C,YAAM,YAAa,MAA2B,MAAM,YAAY;AAEhE,UAAI,EAAE,YAAY,YAAa,YAAY,WAAW,cAAc,WAAY;AAC9E,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACnD;AACA,UAAI,YAAY,YAAa,YAAY,WAAW,cAAc,UAAW;AAC3E,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACnD,WAAW,YAAY,UAAU;AAC/B,cAAM,iBAAiB,UAAU,iBAAiB;AAAA,MACpD,OAAO;AACL,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACnD;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAGD,SAAO,+BAA+B;AACtC,SAAO,aAAa;AACpB,SAAO,0BAA0B;AAGjC,MAAM,aAAyB;AAAA,IAC7B,EAAE,YAAY,0CAA0C,kBAAkB,OAAO,eAAe,MAAO;AAAA,EACzG;AACA,kBAAgB,UAAU;AAE1B,mBAAiB;AAAA,IACb,wBAAwB;AAAA;AAAA,IACxB,oBAAoB;AAAA;AAAA,IACpB,YAAY,MAAO,OAAe,iBAAiB,aAAa;AAAA;AAAA,EAClE,CAAC;",
3
+ "sources": ["../../bin/live-reload.js", "../../src/posthog-and-ga/adtracking-general.ts", "../../src/posthog-and-ga/meta-tracking.ts", "../../src/posthog-and-ga/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", "// adTracking.general.ts \u2014 General ad events for paid traffic (utm_medium=cpc|ads)\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n validationPassed?: boolean;\n __adsTrackingInitializedGeneral?: boolean;\n }\n }\n \n const getSearchParam = (name: string): string | null => {\n const v = new URLSearchParams(window.location.search).get(name);\n return v ? v.trim() : null;\n };\n \n const isAdTraffic = (): boolean => {\n const medium = getSearchParam(\"utm_medium\")?.toLowerCase();\n return medium === \"cpc\" || medium === \"ads\";\n };\n \n const AD_EVENT_PREFIX = \"fynd_website_ad.\";\n const makeEvent = (suffix: string) => `${AD_EVENT_PREFIX}${suffix}`;\n \n // helper: find nearest form and get a friendly name\n const getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n };\n \n /**\n * Initialize general ads tracking.\n * Fires only when utm_medium is \"cpc\" or \"ads\".\n * Adds `fynd_website.current_page` = current page path.\n */\n export const initGeneralAdsTracking = () => {\n if (window.__adsTrackingInitializedGeneral) return;\n if (!isAdTraffic()) return;\n \n window.__adsTrackingInitializedGeneral = true;\n \n const baseProps: Record<string, any> = {\n \"fynd_website.current_page\": window.location.pathname,\n };\n \n const emit = (suffix: string, props?: Record<string, any>) => {\n const name = makeEvent(suffix);\n window.trackEvent?.(name, { ...baseProps, ...(props || {}) });\n };\n \n document.addEventListener(\"DOMContentLoaded\", () => {\n // Buttons\n document.querySelectorAll('[data-ph=\"sign-up\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_up.clicked\"))\n );\n document.querySelectorAll('[data-ph=\"sign-in\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_in.clicked\"))\n );\n document.querySelectorAll('[data-ph=\"book-a-demo\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"book_a_demo.clicked\"))\n );\n \n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n \n const handleFormStarted = function (this: HTMLElement) {\n const formName = getParentFormName(this) || \"unknown-form\";\n if (!triggeredForms.has(formName)) {\n triggeredForms.add(formName);\n emit(\"form.started\", { started_form: formName });\n }\n };\n \n formFields.forEach((field) => {\n const tag = field.tagName.toLowerCase();\n const type = (field as HTMLInputElement).type?.toLowerCase();\n \n if (!(tag === \"button\" || (tag === \"input\" && type === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\n if (tag === \"button\" || (tag === \"input\" && type === \"submit\")) {\n field.addEventListener(\"click\", handleFormStarted);\n } else if (tag === \"select\") {\n field.addEventListener(\"change\", handleFormStarted);\n } else {\n field.addEventListener(\"input\", handleFormStarted);\n }\n });\n \n // Form submitted\n document.querySelectorAll('[type=\"submit\"]').forEach((button) => {\n button.addEventListener(\"click\", function (this: HTMLElement) {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n const props = formName ? { submitted_form: formName } : {};\n emit(\"form.submitted\", props);\n }\n }, 10);\n });\n });\n });\n };", "// meta-tracking.ts \u2014 Meta Pixel integration (standards-compliant) for Fynd website\n// - Initializes Meta Pixel (fbq) with Advanced Matching (when available)\n// - Mirrors your existing window.trackEvent() calls to Meta events\n// - Maps Fynd events -> Meta standard/custom events for better optimization\n// - Adds SPA PageView handling + eventID generation for future CAPI dedup\n// - Safe to import once anywhere in your app bootstrap\n\nimport { UserJourney } from \"../utils/types/user-journey\";\n\n// ---------- Config ----------\nconst META_PIXEL_ID = \"2741377816069290\";\n\ntype AdvancedUser = {\n email?: string;\n phone?: string;\n first_name?: string;\n last_name?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n external_id?: string;\n};\n\ntype InitOptions = {\n /**\n * If true, attempts to pull user info from window.getUserJourney/sessionStorage\n * and pass as Advanced Matching data (improves match rate for retargeting).\n */\n enableAdvancedMatching?: boolean;\n\n /**\n * If true, listens for SPA route changes and fires PageView on history changes.\n * Set true if you use a client-side router.\n */\n enableSpaPageViews?: boolean;\n\n /**\n * Optional predicate: return false to block Meta calls until consent is granted.\n * Example: () => window.__ad_consent === 'granted'\n */\n hasConsent?: () => boolean;\n};\n\n// ---------- fbq bootstrap ----------\ndeclare global {\n interface Window {\n fbq?: (...args: any[]) => void;\n _fbq?: any;\n trackEvent: (eventName: string, properties?: any) => void;\n getUserJourney: () => UserJourney | null;\n }\n}\n\nfunction loadMetaPixel(): void {\n if (typeof window === \"undefined\") return;\n if (window.fbq) return;\n\n (function (f: any, b: any, e: any, v: any, n?: any, t?: any, s?: any) {\n if (f.fbq) return;\n n = f.fbq = function () {\n (n as any).callMethod ? (n as any).callMethod.apply(n, arguments) : (n as any).queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n (n as any).push = (n as any);\n (n as any).loaded = true;\n (n as any).version = \"2.0\";\n (n as any).queue = [];\n t = b.createElement(e);\n t.async = true;\n t.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n s = b.getElementsByTagName(e)[0];\n s.parentNode!.insertBefore(t, s);\n })(window, document, \"script\", undefined);\n}\n\n// ---------- Advanced Matching helpers ----------\nfunction getAdvancedUserFromJourney(): AdvancedUser | null {\n try {\n let journey: any = null;\n if (typeof window.getUserJourney === \"function\") {\n journey = window.getUserJourney();\n }\n if (!journey) {\n const stored = sessionStorage.getItem(\"userJourney\");\n if (stored) journey = JSON.parse(stored);\n }\n\n const u: AdvancedUser = {};\n const fd = journey?.formDetails;\n if (fd?.email) u.email = fd.email;\n if (fd?.phone) u.phone = fd.phone;\n if (fd?.firstName) u.first_name = fd.firstName;\n if (fd?.lastName) u.last_name = fd.lastName;\n if (fd?.city) u.city = fd.city;\n if (fd?.state) u.state = fd.state;\n if (fd?.zip) u.zip = fd.zip;\n if (journey?.country) u.country = journey.country;\n if (journey?.userId) u.external_id = String(journey.userId);\n\n // Remove empties\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n } catch {\n return null;\n }\n}\n\nfunction getAdvancedUserFromProps(props?: any): AdvancedUser | null {\n if (!props) return null;\n const u: AdvancedUser = {};\n if (props[\"fynd_website.form_email\"]) u.email = props[\"fynd_website.form_email\"];\n if (props[\"fynd_website.form_phone\"]) u.phone = props[\"fynd_website.form_phone\"];\n if (props[\"fynd_website.form_first_name\"]) u.first_name = props[\"fynd_website.form_first_name\"];\n if (props[\"fynd_website.form_last_name\"]) u.last_name = props[\"fynd_website.form_last_name\"];\n if (props.city) u.city = props.city;\n if (props.state) u.state = props.state;\n if (props.zip) u.zip = props.zip;\n if (props.country) u.country = props.country;\n if (props.external_id) u.external_id = props.external_id;\n\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n}\n\n// ---------- Utility ----------\nfunction genEventId(prefix: string = \"evt\"): string {\n return `${prefix}_${Date.now()}_${Math.random().toString(36).slice(2)}`;\n}\n\nfunction safeFbq(...args: any[]): void {\n if (!window.fbq) return;\n window.fbq(...args);\n}\n\n// ---------- Core mapping (Fynd -> Meta) ----------\n/**\n * Maps your event names to Meta\u2019s recommended events.\n * Returns {name, params, options} ready for fbq('track'|'trackCustom', ...)\n */\nfunction mapFyndToMeta(eventName: string, properties?: any): {\n type: \"track\" | \"trackCustom\";\n name: string;\n params?: Record<string, any>;\n options?: { eventID?: string };\n userData?: AdvancedUser | null;\n} | null {\n const props = properties || {};\n // Try to extract user for Advanced Matching\n const userData = getAdvancedUserFromProps(props) || getAdvancedUserFromJourney();\n\n switch (eventName) {\n case \"fynd_website.form.submitted\": {\n // Choose 'Lead' as default (use CompleteRegistration for account creation flows)\n const eventID = props.event_id || genEventId(\"lead\");\n const formName = props.submitted_form || props[\"fynd_website.form_name\"] || \"unknown_form\";\n return {\n type: \"track\",\n name: \"Lead\",\n params: {\n form_id: props[\"fynd_website.form_id\"] || undefined,\n form_name: formName,\n value: 0,\n currency: \"INR\",\n },\n options: { eventID },\n userData,\n };\n }\n\n case \"fynd_website.sign_up.clicked\":\n return { type: \"trackCustom\", name: \"SignUpClick\", params: {}, userData };\n\n case \"fynd_website.sign_in.clicked\":\n return { type: \"trackCustom\", name: \"SignInClick\", params: {}, userData };\n\n case \"fynd_website.book_a_demo.clicked\":\n return {\n type: \"trackCustom\",\n name: \"BookDemoClick\",\n params: {\n source_page: props?.[\"fynd_website.source_page\"],\n },\n userData,\n };\n\n case \"fynd_website.form.started\":\n return {\n type: \"trackCustom\",\n name: \"FormStarted\",\n params: {\n form_id: props?.[\"fynd_website.form_id\"] || undefined,\n form_name: props?.[\"fynd_website.form_name\"] || undefined,\n },\n userData,\n };\n\n // Page lifecycle\n case \"fynd_website.page.loaded\":\n return { type: \"track\", name: \"PageView\", params: {}, userData };\n\n default:\n // Ignore other events by default; you can add more mappings here\n return null;\n }\n}\n\n// ---------- Public API ----------\n/**\n * Initialize Meta tracking and tee into window.trackEvent so existing code just works.\n */\nexport function initMetaTracking(options: InitOptions = {}): void {\n const { enableAdvancedMatching = true, enableSpaPageViews = true, hasConsent } = options;\n\n // 1) Load fbq\n loadMetaPixel();\n\n // 2) Init with/without Advanced Matching\n const initialUser = enableAdvancedMatching ? getAdvancedUserFromJourney() : null;\n if (hasConsent && !hasConsent()) {\n // Defer init until consent flips to true (lightweight poller)\n const iv = window.setInterval(() => {\n if (hasConsent()) {\n window.clearInterval(iv);\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n }, 250);\n } else {\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n\n // 3) Tee into window.trackEvent to mirror to Meta\n const originalTrackEvent = window.trackEvent;\n window.trackEvent = function (eventName: string, properties?: any): void {\n try {\n // First, call original (so PostHog/GA remain unchanged)\n if (typeof originalTrackEvent === \"function\") {\n originalTrackEvent.call(window, eventName, properties);\n }\n // Then forward to Meta (respect consent if provided)\n if (hasConsent && !hasConsent()) return;\n\n const mapped = mapFyndToMeta(eventName, properties);\n if (!mapped) return;\n\n // Pass Advanced Matching userData by re-calling init? No\u2014Meta supports user data on event via fbq 2nd arg in init or as 'init' options.\n // For events, best practice is to include user data via \"Advanced Matching\" settings or CAPI.\n // Here we rely on init advanced matching; optionally, you can include userData with custom calls via setUserProperties (not available on Pixel).\n if (mapped.type === \"track\") {\n if (mapped.options?.eventID) {\n safeFbq(\"track\", mapped.name, mapped.params || {}, { eventID: mapped.options.eventID });\n } else {\n safeFbq(\"track\", mapped.name, mapped.params || {});\n }\n } else {\n // trackCustom\n // We cannot pass user data as a separate arg here; advanced matching should be handled at init or via CAPI.\n safeFbq(\"trackCustom\", mapped.name, mapped.params || {});\n }\n } catch (e) {\n // swallow to avoid interrupting primary trackers\n // eslint-disable-next-line no-console\n console.warn(\"Meta tracking error:\", e);\n }\n };\n}\n\n/**\n * Manually send a CompleteRegistration when your \u201Cform submitted\u201D is actually an account creation.\n * Reuse the same eventID for later CAPI dedup if you mirror server-side.\n */\nexport function trackCompleteRegistration(registrationMethod: string = \"email\", eventID?: string, props?: any) {\n const options = eventID ? { eventID } : undefined;\n // Respect optional consent gate if your app uses one:\n // if (window.__ad_consent !== 'granted') return;\n safeFbq(\"track\", \"CompleteRegistration\", { registration_method: registrationMethod }, options);\n}\n\n/**\n * Optional helper if you want to send a Lead directly (outside of window.trackEvent).\n */\nexport function trackLead(formId?: string, formName?: string, valueINR: number = 0, eventID?: string) {\n const params: Record<string, any> = { value: valueINR, currency: \"INR\" };\n if (formId) params.form_id = formId;\n if (formName) params.form_name = formName;\n const options = { eventID: eventID || genEventId(\"lead\") };\n safeFbq(\"track\", \"Lead\", params, options);\n}\n\n// ---------- Internal: post init tasks ----------\nfunction postInit(enableSpaPageViews: boolean) {\n // Fire initial PageView (Meta does this automatically when you call fbq('track','PageView')\u2014we mimic GA's $pageview behavior)\n safeFbq(\"track\", \"PageView\");\n\n if (enableSpaPageViews) {\n // Hook into history API to catch virtual route changes\n const origPushState = history.pushState;\n const origReplaceState = history.replaceState;\n\n function onLocationChange() {\n // Delay slightly to allow DOM/router to settle\n setTimeout(() => safeFbq(\"track\", \"PageView\"), 0);\n }\n\n history.pushState = function (...args: any[]) {\n const ret = origPushState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n history.replaceState = function (...args: any[]) {\n const ret = origReplaceState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n window.addEventListener(\"popstate\", onLocationChange);\n }\n}\n\n// ---------- (Optional) noscript pixel for non-JS fallbacks ----------\n// In your HTML <noscript>, add:\n// <img height=\"1\" width=\"1\" style=\"display:none\"\n// src=\"https://www.facebook.com/tr?id=2741377816069290&ev=PageView&noscript=1\"/>", "// main.ts \u2014 Core tracking: PostHog + GA (GTM dataLayer) + optional ad tracking bootstrap\nimport { FormDetails, UserJourney } from \"../utils/types/user-journey\";\nimport { AdConfig, initAdsTracking } from \"./adTracking\";\nimport { initGeneralAdsTracking } from \"./adtracking-general\";\nimport { initMetaTracking } from \"./meta-tracking\";\n\n// ---------- Types ----------\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;\n}\n\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 aidata_context?: string;\n aidata_platform?: string;\n aidata_type?: string;\n aidata_detection?: string;\n}\n\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 \"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 \"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;\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 \"fynd_website.aidata_context\"?: string;\n \"fynd_website.aidata_platform\"?: string;\n \"fynd_website.aidata_type\"?: string;\n \"fynd_website.aidata_detection\"?: string;\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any;\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 helpers ----------\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = sessionStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey?.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n if (formDetails.formId) gaProperties.form_id = formDetails.formId;\n if (formDetails.formName) gaProperties.form_name = formDetails.formName;\n if (formDetails.firstName) gaProperties.form_first_name = formDetails.firstName;\n if (formDetails.lastName) gaProperties.form_last_name = formDetails.lastName;\n if (formDetails.email) gaProperties.form_email = formDetails.email;\n if (formDetails.phone) gaProperties.form_phone = formDetails.phone;\n }\n\n if (journey?.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) gaProperties.aidata_context = aiData.context;\n if (aiData.platform) gaProperties.aidata_platform = aiData.platform;\n if (aiData.type) gaProperties.aidata_type = aiData.type;\n if (aiData.detectionMethod) gaProperties.aidata_detection = aiData.detectionMethod;\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for GA tracking:\", err);\n }\n return gaProperties;\n};\n\n// ---------- PostHog properties ----------\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n const base: TrackingProperties = {\n \"fynd_website.source_page\": pathname,\n \"fynd_website.product\": \"fynd.com website\",\n \"fynd_website.device_type\": \"Unknown\",\n \"fynd_website.utm_source\": new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n \"fynd_website.utm_medium\": new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n \"fynd_website.utm_campaign\": new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n \"fynd_website.referrer\": document.referrer,\n };\n\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = sessionStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey) {\n base[\"fynd_website.journey_touchpoints\"] = journey.userJourney || journey;\n\n if (journey.formDetails) {\n const f: FormDetails = journey.formDetails;\n if (f.formId) base[\"fynd_website.form_id\"] = f.formId;\n if (f.formName) base[\"fynd_website.form_name\"] = f.formName;\n if (f.firstName) base[\"fynd_website.form_first_name\"] = f.firstName;\n if (f.lastName) base[\"fynd_website.form_last_name\"] = f.lastName;\n if (f.email) base[\"fynd_website.form_email\"] = f.email;\n if (f.phone) base[\"fynd_website.form_phone\"] = f.phone;\n }\n\n if (journey.userJourney?.length > 0) {\n base[\"fynd_website.journey_total_pages\"] = journey.userJourney.length;\n base[\"fynd_website.journey_touchpoints_count\"] = journey.userJourney.length;\n base[\"fynd_website.journey_first_page\"] = journey.userJourney[0].page;\n base[\"fynd_website.journey_current_page\"] =\n journey.userJourney[journey.userJourney.length - 1].page;\n\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n base[\"fynd_website.journey_session_duration\"] = Math.floor(\n (lastVisit.getTime() - firstVisit.getTime()) / 1000\n );\n base[\"fynd_website.journey_entry_time\"] = journey.userJourney[0].time;\n base[\"fynd_website.journey_exit_time\"] = journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n if (journey.deviceCategory) base[\"fynd_website.device_type\"] = journey.deviceCategory;\n if (journey.browser) base[\"fynd_website.journey_browser\"] = journey.browser;\n if (journey.device) base[\"fynd_website.journey_device\"] = journey.device;\n if (journey.origin) base[\"fynd_website.journey_origin\"] = journey.origin;\n if (journey.utmPath) base[\"fynd_website.journey_utm_path\"] = journey.utmPath;\n if (journey.scrollDepth) base[\"fynd_website.journey_scroll_depth\"] = journey.scrollDepth;\n\n if (journey.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) base[\"fynd_website.aidata_context\"] = aiData.context;\n if (aiData.platform) base[\"fynd_website.aidata_platform\"] = aiData.platform;\n if (aiData.type) base[\"fynd_website.aidata_type\"] = aiData.type;\n if (aiData.detectionMethod) base[\"fynd_website.aidata_detection\"] = aiData.detectionMethod;\n }\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for tracking:\", err);\n }\n\n // Fallback device type\n if (base[\"fynd_website.device_type\"] === \"Unknown\") {\n const ua = navigator.userAgent;\n if (/iPad/.test(ua) || (/Android/.test(ua) && !/Mobile/.test(ua)) || /Tablet/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Tablet\";\n } else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Mobile\";\n } else {\n base[\"fynd_website.device_type\"] = \"Desktop\";\n }\n }\n return base;\n};\n\n// ---------- GA send ----------\nconst sendToGA = (eventName: string, gaProps: GATrackingProperties, additionalProps?: 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 ...gaProps,\n };\n if (additionalProps?.submitted_form) {\n eventData.submitted_form = additionalProps.submitted_form;\n }\n (window as any).dataLayer.push(eventData);\n } else {\n console.warn(\"dataLayer not available for GA tracking\");\n }\n};\n\n// ---------- Public trackEvent ----------\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n const baseProps = getPosthogTrackingProperties();\n const finalProps = properties ? { ...baseProps, ...properties } : baseProps;\n\n if ((window as any).posthog) {\n (window as any).posthog.capture(eventName, finalProps);\n }\n\n const gaProps = getGaTrackingProperties();\n const hasAIData =\n gaProps.aidata_context || gaProps.aidata_platform || gaProps.aidata_type || gaProps.aidata_detection;\n\n const isFormRelatedEvent =\n eventName.includes(\"form\") ||\n Object.keys(gaProps).length > 0 ||\n properties?.submitted_form ||\n !!hasAIData;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProps, properties);\n }\n } catch (error) {\n console.error(\"Error tracking event:\", error);\n }\n};\n\n// ---------- Shared helpers ----------\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n};\n\n// ---------- Page lifecycle ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const props = getPosthogTrackingProperties();\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", props);\n }\n});\n\nwindow.addEventListener(\"load\", () => {\n trackEvent(\"fynd_website.page.loaded\");\n});\n\n// ---------- Base site interactions ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]');\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]');\n const scrollToFormButtons = document.querySelectorAll('[href=\"#footer-form\"]');\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]');\n const submitButtons = document.querySelectorAll('[type=\"submit\"]');\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 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\", () => trackEvent(\"fynd_website.sign_up.clicked\"));\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.sign_in.clicked\"));\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.scroll_to_form.clicked\"));\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.book_a_demo.clicked\"));\n });\n\n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || \"unknown-form\";\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n trackEvent(\"fynd_website.form.started\");\n }\n };\n\n formFields.forEach((field) => {\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n\n if (!(tagName === \"button\" || (tagName === \"input\" && inputType === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\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// ---------- Expose globals ----------\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// ---------- Optional: bootstrap ad tracking here ----------\n// const AD_CONFIGS: AdConfig[] = [\n// { adPageSlug: \"/solutions/transport-management-system\", adEventExtension: \"tms\", adUTMCampaign: \"tms\", },\n// ];\n// initAdsTracking(AD_CONFIGS);\ninitGeneralAdsTracking();\n\ninitMetaTracking({\n enableAdvancedMatching: true, // pulls user data from your journey store when available\n enableSpaPageViews: true, // fires PageView on virtual navigations\n hasConsent: () => (window as any).__ad_consent === \"granted\" || true, // replace with your consent logic\n });\n\n// ---------- Exports ----------\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\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;AAAA,EAEP;;;ACAE,MAAM,iBAAiB,CAAC,SAAgC;AACtD,UAAM,IAAI,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,IAAI;AAC9D,WAAO,IAAI,EAAE,KAAK,IAAI;AAAA,EACxB;AAEA,MAAM,cAAc,MAAe;AACjC,UAAM,SAAS,eAAe,YAAY,GAAG,YAAY;AACzD,WAAO,WAAW,SAAS,WAAW;AAA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B,oBAAI,IAAY;AAEvC,UAAM,oBAAoB,WAAmC;AAC3D,YAAM,WAAWA,mBAAkB,IAAI;AACvC,YAAM,iBAAiB,YAAY;AACnC,UAAI,CAAC,eAAe,IAAI,cAAc,GAAG;AACvC,uBAAe,IAAI,cAAc;AACjC,mBAAW,2BAA2B;AAAA,MACxC;AAAA,IACF;AAEA,eAAW,QAAQ,CAAC,UAAU;AAC5B,YAAM,UAAU,MAAM,QAAQ,YAAY;AAC1C,YAAM,YAAa,MAA2B,MAAM,YAAY;AAEhE,UAAI,EAAE,YAAY,YAAa,YAAY,WAAW,cAAc,WAAY;AAC9E,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACnD;AACA,UAAI,YAAY,YAAa,YAAY,WAAW,cAAc,UAAW;AAC3E,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACnD,WAAW,YAAY,UAAU;AAC/B,cAAM,iBAAiB,UAAU,iBAAiB;AAAA,MACpD,OAAO;AACL,cAAM,iBAAiB,SAAS,iBAAiB;AAAA,MACnD;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAGD,SAAO,+BAA+B;AACtC,SAAO,aAAa;AACpB,SAAO,0BAA0B;AAOjC,yBAAuB;AAEvB,mBAAiB;AAAA,IACb,wBAAwB;AAAA;AAAA,IACxB,oBAAoB;AAAA;AAAA,IACpB,YAAY,MAAO,OAAe,iBAAiB,aAAa;AAAA;AAAA,EAClE,CAAC;",
6
6
  "names": ["onLocationChange", "getParentFormName"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fynd-design-engineering/fynd-one-v2",
3
- "version": "3.3.25",
3
+ "version": "3.3.27",
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",