{"version":3,"file":"BeforeAfterButtons.DPHjJB6D.mjs","names":["React","__legacyOverrideHOC_DataObserverContext","_jsx"],"sources":["https:/framerusercontent.com/modules/lHluOgmQBRq9Lut0pn6F/OWFqgARpwCZfbg3wHva4/BeforeAfterStore.js","https:/framerusercontent.com/modules/m1wt2oukZfk6WeXsit0F/nFfTLgmErm0opW54lahx/BeforeAfterButtons.js"],"sourcesContent":["export const beforeAfterStore={slider:50,listeners:new Set,animationFrame:0,// Smooth glide from current to target\nset(target,duration=500){cancelAnimationFrame(this.animationFrame);const start=this.slider;const diff=target-start;const startTime=performance.now();console.log(\"🎯 Animation starting:\",{from:start,to:target});const tick=now=>{const elapsed=now-startTime;const progress=Math.min(elapsed/duration,1);// easeInOutCubic\nconst eased=progress<.5?4*progress*progress*progress:1-Math.pow(-2*progress+2,3)/2;this.slider=start+diff*eased;for(const fn of this.listeners)fn();if(progress<1){this.animationFrame=requestAnimationFrame(tick);}else{console.log(\"✅ Animation complete. Final position:\",this.slider);}};this.animationFrame=requestAnimationFrame(tick);},// ✅ Hard reset used on page/editor reload\nhardReset(){console.log(\"🔄 Hard reset triggered\");cancelAnimationFrame(this.animationFrame);this.slider=50;for(const fn of this.listeners)fn();},subscribe(fn){this.listeners.add(fn);return()=>this.listeners.delete(fn);}};\nexport const __FramerMetadata__ = {\"exports\":{\"beforeAfterStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BeforeAfterStore.map","import{jsx as _jsx}from\"react/jsx-runtime\";import React from\"react\";import{beforeAfterStore}from\"https://framerusercontent.com/modules/lHluOgmQBRq9Lut0pn6F/OWFqgARpwCZfbg3wHva4/BeforeAfterStore.js\";const glideTo=target=>{requestAnimationFrame(()=>beforeAfterStore.set(target));};export function Before(){return{onTap(){glideTo(100);}};}export function WithPerceptis(){return{onTap(){glideTo(0);}};}export function ResetButton(){const[visible,setVisible]=React.useState(false);React.useEffect(()=>{const update=()=>{const isNotCentered=Math.abs(beforeAfterStore.slider-50)>.1;setVisible(isNotCentered);};update();const unsubscribe=beforeAfterStore.subscribe(update);return unsubscribe;},[]);return{style:{opacity:visible?1:0,pointerEvents:visible?\"auto\":\"none\",transition:\"opacity 0.3s ease\"},onTap(){glideTo(50);}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withBefore(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...Before(props)});};}withBefore.displayName=\"Before\";export function withWithPerceptis(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...WithPerceptis(props)});};}withWithPerceptis.displayName=\"WithPerceptis\";export function withResetButton(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...ResetButton(props)});};}withResetButton.displayName=\"ResetButton\";\nexport const __FramerMetadata__ = {\"exports\":{\"Before\":{\"type\":\"override\",\"name\":\"Before\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBefore\":{\"type\":\"reactHoc\",\"name\":\"withBefore\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"WithPerceptis\":{\"type\":\"override\",\"name\":\"WithPerceptis\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withResetButton\":{\"type\":\"reactHoc\",\"name\":\"withResetButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"ResetButton\":{\"type\":\"override\",\"name\":\"ResetButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withWithPerceptis\":{\"type\":\"reactHoc\",\"name\":\"withWithPerceptis\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BeforeAfterButtons.map"],"mappings":"2LAAa,EAAiB,CAAC,OAAO,GAAG,UAAU,IAAI,IAAI,eAAe,EA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