{"version":3,"file":"HeroHeaderTheme.hpdZP6um.mjs","names":["forwardRef","useState","useRef","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/eHPY9CsaBZjcPmKqVdjG/KtonULLzxsHFyAK4LSTA/HeroHeaderTheme.js"],"sourcesContent":["// User request: Create a code override named withHeroHeaderTheme for existing canvas navigation that uses runtime hero geometry (id=\"hero\") to switch header variants by breakpoint/theme threshold, preserves native nav/menu behavior, is SSR/canvas safe, uses rAF-throttled passive listeners + ResizeObserver, and only updates variant when state changes.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";const DESKTOP_BREAKPOINT=1200;const HEADER_HEIGHT_DESKTOP=67;const HEADER_HEIGHT_COMPACT=64;const LIVE_INDICATOR_CLASS=\"framer-live-indicator-override\";const LIVE_INDICATOR_STYLE_ID=\"framer-live-indicator-override-style\";let liveIndicatorMountCount=0;const VARIANTS={desktop:{dark:\"wtOTk6Lmw\",light:\"cYp8MeHc5\"},compact:{dark:\"SYxGizA6A\",light:\"FrtQB_vRV\"},open:{dark:\"D_kPYcYWl\",light:\"tYkwckRPb\"}};export function withHeroHeaderTheme(Component){const Wrapped=/*#__PURE__*/forwardRef(function WithHeroHeaderTheme(props,ref){const[computedVariant,setComputedVariant]=useState(null);const[menuOpen,setMenuOpen]=useState(false);const[isDesktopViewport,setIsDesktopViewport]=useState(true);const lastComputedKeyRef=useRef(\"\");const lastViewportDesktopRef=useRef(true);const rafIdRef=useRef(null);const resizeObserverRef=useRef(null);const observedHeroesRef=useRef(new Set);const findVisibleHero=useCallback(()=>{if(typeof document===\"undefined\")return null;const candidates=Array.from(document.querySelectorAll(\"#hero\"));if(candidates.length===0)return null;for(const candidate of candidates){const hasRects=candidate.getClientRects().length>0;if(!hasRects)continue;const rect=candidate.getBoundingClientRect();if(rect.width>0&&rect.height>0)return candidate;}return null;},[]);const syncObservedHeroes=useCallback(()=>{const observer=resizeObserverRef.current;if(!observer||typeof document===\"undefined\")return;const currentHeroes=new Set(Array.from(document.querySelectorAll(\"#hero\")));for(const el of currentHeroes){if(!observedHeroesRef.current.has(el)){observer.observe(el);}}for(const el of observedHeroesRef.current){if(!currentHeroes.has(el)){observer.unobserve(el);}}observedHeroesRef.current=currentHeroes;},[]);const measureAndUpdateVariant=useCallback(()=>{if(typeof window===\"undefined\")return;syncObservedHeroes();const hero=findVisibleHero();const isDesktop=window.innerWidth>=DESKTOP_BREAKPOINT;const mode=isDesktop?\"desktop\":\"compact\";const headerHeight=isDesktop?HEADER_HEIGHT_DESKTOP:HEADER_HEIGHT_COMPACT;const heroBottom=hero?.getBoundingClientRect().bottom;const theme=heroBottom===undefined?\"light\":heroBottom<=headerHeight?\"light\":\"dark\";const nextVariant=VARIANTS[mode][theme];const nextKey=`${mode}:${theme}`;if(lastViewportDesktopRef.current!==isDesktop){lastViewportDesktopRef.current=isDesktop;startTransition(()=>{setIsDesktopViewport(isDesktop);});}if(lastComputedKeyRef.current!==nextKey){lastComputedKeyRef.current=nextKey;startTransition(()=>{setComputedVariant(nextVariant);});}},[findVisibleHero,syncObservedHeroes]);const scheduleMeasurement=useCallback(()=>{if(typeof window===\"undefined\")return;if(rafIdRef.current!==null)return;rafIdRef.current=window.requestAnimationFrame(()=>{rafIdRef.current=null;measureAndUpdateVariant();});},[measureAndUpdateVariant]);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\"){return;}if(typeof ResizeObserver===\"undefined\"){return;}resizeObserverRef.current=new ResizeObserver(()=>{scheduleMeasurement();});syncObservedHeroes();scheduleMeasurement();window.addEventListener(\"scroll\",scheduleMeasurement,{passive:true});window.addEventListener(\"resize\",scheduleMeasurement,{passive:true});window.addEventListener(\"orientationchange\",scheduleMeasurement,{passive:true});return()=>{window.removeEventListener(\"scroll\",scheduleMeasurement);window.removeEventListener(\"resize\",scheduleMeasurement);window.removeEventListener(\"orientationchange\",scheduleMeasurement);if(rafIdRef.current!==null){window.cancelAnimationFrame(rafIdRef.current);rafIdRef.current=null;}if(resizeObserverRef.current){resizeObserverRef.current.disconnect();resizeObserverRef.current=null;}observedHeroesRef.current.clear();};},[scheduleMeasurement,syncObservedHeroes]);useEffect(()=>{if(!isDesktopViewport)return;if(!menuOpen)return;startTransition(()=>{setMenuOpen(false);});},[isDesktopViewport,menuOpen]);useEffect(()=>{if(typeof window===\"undefined\")return;const onKeyDown=event=>{if(event.key!==\"Escape\")return;startTransition(()=>{setMenuOpen(false);});};window.addEventListener(\"keydown\",onKeyDown);return()=>{window.removeEventListener(\"keydown\",onKeyDown);};},[]);const onClickCapture=useCallback(event=>{if(typeof props.onClickCapture===\"function\"){props.onClickCapture(event);}if(isDesktopViewport)return;if(typeof window===\"undefined\")return;const target=event?.target;if(!target||typeof target.closest!==\"function\")return;const clickedAnchor=target.closest(\"a\");if(clickedAnchor){startTransition(()=>{setMenuOpen(false);});return;}const clickedButton=target.closest(\"button\");if(clickedButton){startTransition(()=>{setMenuOpen(prev=>!prev);});}},[isDesktopViewport,props]);const variantToApply=useMemo(()=>{const incomingVariant=props.variant;if(!computedVariant)return incomingVariant;const closedTheme=computedVariant===VARIANTS.desktop.light||computedVariant===VARIANTS.compact.light?\"light\":\"dark\";if(!isDesktopViewport&&menuOpen){return VARIANTS.open[closedTheme];}return computedVariant;},[computedVariant,isDesktopViewport,menuOpen,props.variant]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,variant:variantToApply,onClickCapture:onClickCapture});});return Wrapped;}export function withLiveIndicator(Component){const Wrapped=/*#__PURE__*/forwardRef(function WithLiveIndicator(props,ref){useEffect(()=>{if(typeof document===\"undefined\")return;liveIndicatorMountCount+=1;let styleEl=document.getElementById(LIVE_INDICATOR_STYLE_ID);if(!styleEl){styleEl=document.createElement(\"style\");styleEl.id=LIVE_INDICATOR_STYLE_ID;styleEl.textContent=`\n.${LIVE_INDICATOR_CLASS} {\n  position: relative;\n}\n.${LIVE_INDICATOR_CLASS}::before {\n  content: \"\";\n  position: absolute;\n  left: 0;\n  top: 50%;\n  width: 6px;\n  height: 6px;\n  border-radius: 999px;\n  transform: translateY(-50%);\n  background: #4ac06c;\n  pointer-events: none;\n}\n.${LIVE_INDICATOR_CLASS}::after {\n  content: \"\";\n  position: absolute;\n  left: 0;\n  top: 50%;\n  width: 6px;\n  height: 6px;\n  border-radius: 999px;\n  transform: translateY(-50%) scale(1);\n  background: rgba(74, 192, 108, 0.5);\n  animation: framer-live-indicator-ripple 1.8s ease-out infinite;\n  pointer-events: none;\n}\n@keyframes framer-live-indicator-ripple {\n  0% {\n    transform: translateY(-50%) scale(1);\n    opacity: 0.95;\n  }\n  75% {\n    transform: translateY(-50%) scale(3.5);\n    opacity: 0;\n  }\n  100% {\n    transform: translateY(-50%) scale(3.5);\n    opacity: 0;\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  .${LIVE_INDICATOR_CLASS}::after {\n    animation: none;\n    opacity: 0;\n  }\n}\n`;document.head.appendChild(styleEl);}return()=>{liveIndicatorMountCount=Math.max(0,liveIndicatorMountCount-1);if(liveIndicatorMountCount===0&&styleEl?.parentNode){styleEl.parentNode.removeChild(styleEl);}};},[]);const mergedClassName=useMemo(()=>{const existing=typeof props.className===\"string\"?props.className:\"\";return existing?`${existing} ${LIVE_INDICATOR_CLASS}`:LIVE_INDICATOR_CLASS;},[props.className]);const mergedStyle=useMemo(()=>{return{...props.style,position:\"relative\",paddingLeft:props.style?.paddingLeft!==undefined?props.style.paddingLeft:\"14px\",color:\"#4ac06c\"};},[props.style]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,className:mergedClassName,style:mergedStyle});});return Wrapped;}export function withHubSpotPaddingCompensation(Component){const Wrapped=/*#__PURE__*/forwardRef(function WithHubSpotPaddingCompensation(props,ref){const wrapperStyle=useMemo(()=>{return{...props.style,margin:\"-40px\",width:\"calc(100% + 80px)\",maxWidth:\"none\",minWidth:0,boxSizing:\"border-box\"};},[props.style]);const childStyle=useMemo(()=>{return{position:\"relative\",width:\"100%\",height:\"auto\",maxWidth:\"none\",margin:0,boxSizing:\"border-box\"};},[]);return /*#__PURE__*/_jsx(\"div\",{style:wrapperStyle,children:/*#__PURE__*/_jsx(Component,{ref:ref,...props,style:childStyle})});});return Wrapped;}\nexport const __FramerMetadata__ = {\"exports\":{\"withLiveIndicator\":{\"type\":\"reactHoc\",\"name\":\"withLiveIndicator\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHubSpotPaddingCompensation\":{\"type\":\"reactHoc\",\"name\":\"withHubSpotPaddingCompensation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeroHeaderTheme\":{\"type\":\"reactHoc\",\"name\":\"withHeroHeaderTheme\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeroHeaderTheme.map"],"mappings":"0KACuhB,SAAgB,EAAoB,EAAU,CAA6lJ,OAAjkJA,EAAW,SAA6B,EAAM,EAAI,CAAC,GAAK,CAAC,EAAgB,GAAoBC,EAAS,IAAI,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAO,CAAC,EAAkB,GAAsBA,EAAS,EAAI,EAAQ,EAAmBC,EAAO,EAAE,EAAQ,EAAuBA,EAAO,EAAI,EAAQ,EAASA,EAAO,IAAI,EAAQ,EAAkBA,EAAO,IAAI,EAAQ,EAAkBA,EAAO,IAAI,GAAG,EAAQ,EAAgBC,MAAgB,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,KAAK,IAAM,EAAW,MAAM,KAAK,SAAS,iBAAiB,OAAO,CAAC,EAAE,GAAG,EAAW,SAAS,EAAE,OAAO,KAAK,IAAI,IAAM,KAAa,EAAW,CAAoD,GAAG,EAAvC,EAAU,eAAe,CAAC,CAAC,OAAO,GAAe,SAAS,IAAM,EAAK,EAAU,sBAAsB,EAAE,GAAG,EAAK,MAAM,GAAG,EAAK,OAAO,EAAE,OAAO,CAAU,CAAC,OAAO,IAAK,EAAE,CAAC,CAAC,EAA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