{"version":3,"file":"ScrollVariantOverride.Koq4WCC2.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/TdE39MgzDp3GBDasjseZ/3vEQNzF9Vvn2itDO3gqm/ScrollVariantOverride.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{forwardRef,useEffect,useState}from\"react\";const DEFAULTS={threshold:50,mobileBreakpoint:1279,scrolledVariant:\"Desktop - White\",mobileScrolledVariant:\"Phone - White\"};function resolveVariant(Component,name){const control=Component?.propertyControls?.variant;const titles=control?.optionTitles;const options=control?.options;if(!Array.isArray(titles)||!Array.isArray(options)){return name;}const index=titles.indexOf(name);return index>=0&&typeof options[index]===\"string\"?options[index]:name;}export function withScrollVariant(Component){return /*#__PURE__*/forwardRef(function ScrollVariant(props,ref){const{threshold=DEFAULTS.threshold,mobileBreakpoint=DEFAULTS.mobileBreakpoint,scrolledVariant=DEFAULTS.scrolledVariant,mobileScrolledVariant=DEFAULTS.mobileScrolledVariant,...rest}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[viewport,setViewport]=useState({isScrolled:false,isMobile:false});useEffect(()=>{if(isCanvas||typeof window===\"undefined\")return;let frameId=0;const update=()=>{const next={isScrolled:window.scrollY>threshold,isMobile:window.innerWidth<=mobileBreakpoint};setViewport(previous=>previous.isScrolled===next.isScrolled&&previous.isMobile===next.isMobile?previous:next);};const scheduleUpdate=()=>{cancelAnimationFrame(frameId);frameId=requestAnimationFrame(update);};update();// Frissítéskor a böngésző később is\n// visszaállíthatja a scrollpozíciót.\nconst timers=[100,500,1500].map(delay=>window.setTimeout(update,delay));window.addEventListener(\"scroll\",scheduleUpdate,{passive:true});window.addEventListener(\"resize\",scheduleUpdate);window.addEventListener(\"pageshow\",update);window.addEventListener(\"load\",update);return()=>{window.removeEventListener(\"scroll\",scheduleUpdate);window.removeEventListener(\"resize\",scheduleUpdate);window.removeEventListener(\"pageshow\",update);window.removeEventListener(\"load\",update);cancelAnimationFrame(frameId);timers.forEach(timer=>clearTimeout(timer));};},[isCanvas,threshold,mobileBreakpoint]);if(isCanvas||!viewport.isScrolled){return /*#__PURE__*/_jsx(Component,{ref:ref,...rest});}const variantName=viewport.isMobile?mobileScrolledVariant.trim()||scrolledVariant:scrolledVariant;return /*#__PURE__*/_jsx(Component,{ref:ref,...rest,variant:resolveVariant(Component,variantName)});});}export function withHighLCPPriority(Component){return /*#__PURE__*/forwardRef(function HighLCPPriority(props,ref){const lcpLoadingHints={fetchPriority:\"high\",preload:\"auto\",loading:\"eager\"};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,...lcpLoadingHints});});}addPropertyControls(withScrollVariant,{threshold:{type:ControlType.Number,title:\"Threshold\",defaultValue:DEFAULTS.threshold,min:0,unit:\"px\"},mobileBreakpoint:{type:ControlType.Number,title:\"Mobile Breakpoint\",defaultValue:DEFAULTS.mobileBreakpoint,min:0,unit:\"px\"},scrolledVariant:{type:ControlType.String,title:\"Scrolled Variant\",defaultValue:DEFAULTS.scrolledVariant},mobileScrolledVariant:{type:ControlType.String,title:\"Mobile Scrolled Variant\",defaultValue:DEFAULTS.mobileScrolledVariant}});\nexport const __FramerMetadata__ = {\"exports\":{\"withHighLCPPriority\":{\"type\":\"reactHoc\",\"name\":\"withHighLCPPriority\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollVariant\":{\"type\":\"reactHoc\",\"name\":\"withScrollVariant\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollVariantOverride.map"],"mappings":"wMAAyR,SAAS,EAAe,EAAU,EAAK,CAAC,IAAM,EAAQ,GAAW,kBAAkB,QAAc,EAAO,GAAS,aAAmB,EAAQ,GAAS,QAAQ,GAAG,CAAC,MAAM,QAAQ,CAAM,GAAG,CAAC,MAAM,QAAQ,CAAO,EAAG,OAAO,EAAM,IAAM,EAAM,EAAO,QAAQ,CAAI,EAAE,O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