{"version":3,"file":"SwipeButton_1.DsLWtVX4.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/9ev8gmJt03EKH0bGzeH1/8FUdLvDPCobFT5yLkcxI/SwipeButton_1.js"],"sourcesContent":["// Back To Top button — bordered, with full-height square icon block on the\n// right and a gray hover-fill that sweeps in from the right side.\n// Text and icon remain the same color on hover.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Back To Top Button (Square Icon Block, Right)\n *\n * @framerIntrinsicWidth 280\n * @framerIntrinsicHeight 64\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function BackToTopButton(props){const{font,color=\"#0A0A0A\",hoverTextColor=\"#0A0A0A\",buttonText=\"BACK TO TOP\",buttonColor=\"#D2D5DB\",backgroundColor=\"#FFFFFF\",hoverColor=\"#D2D5DB\",svgIcon=\"\",svgIconHover=\"\",iconSize=24,iconBackgroundColor=\"#D2D5DB\",borderRadius=0,paddingVertical=24,paddingHorizontal=32,scrollToTop=true}=props;const[isHovered,setIsHovered]=useState(false);const ease=\"cubic-bezier(0.4, 0, 0.2, 1)\";const handleClick=e=>{if(!scrollToTop)return;// Neutralize any Framer link on this layer or a parent wrapper so\n// the button's behavior is fully controlled by this code.\ne.preventDefault();e.stopPropagation();// If a Lenis instance is exposed, use its own API (cooperates with\n// the site's Smooth Scroll component instead of fighting it).\nconst lenis=window.lenis;if(lenis&&typeof lenis.scrollTo===\"function\"){lenis.scrollTo(0);return;}// Otherwise: drive the scroll ourselves with a per-frame animation.\n// Native `behavior: \"smooth\"` gets interrupted by smooth-scroll\n// libraries (Lenis) and long pages with sticky/snap sections; writing\n// an instant position every frame is authoritative and uninterruptible.\nconst startY=window.scrollY;if(startY<=0)return;const duration=Math.min(1100,400+startY*.12);const startT=performance.now();let cancelled=false;const cancel=()=>{cancelled=true;window.removeEventListener(\"wheel\",cancel);window.removeEventListener(\"touchstart\",cancel);};// Yield to the user if they take over mid-animation.\nwindow.addEventListener(\"wheel\",cancel,{passive:true});window.addEventListener(\"touchstart\",cancel,{passive:true});const easeOutCubic=t=>1-Math.pow(1-t,3);const step=now=>{if(cancelled)return;const t=Math.min(1,(now-startT)/duration);window.scrollTo(0,Math.round(startY*(1-easeOutCubic(t))));if(t<1){requestAnimationFrame(step);}else{cancel();}};requestAnimationFrame(step);};// --- Square block sizing -------------------------------------------------\n// The icon block's width must equal the button's inner height so it renders\n// as a perfect 1:1 square. Inner height = text line height + vertical\n// padding on both sides. We resolve the line height from the font prop.\nconst fontSizePx=typeof font?.fontSize===\"string\"?parseFloat(font.fontSize)||16:typeof font?.fontSize===\"number\"?font.fontSize:16;let lineHeightPx=fontSizePx// default: line-height 1\n;const lh=font?.lineHeight;if(typeof lh===\"number\"){lineHeightPx=fontSizePx*lh;}else if(typeof lh===\"string\"){const n=parseFloat(lh);if(!isNaN(n)){lineHeightPx=lh.endsWith(\"px\")?n:fontSizePx*n;}}const squareSize=Math.round(lineHeightPx+paddingVertical*2);// -------------------------------------------------------------------------\nreturn /*#__PURE__*/_jsxs(\"button\",{style:{...props.style,position:\"relative\",width:\"max-content\",minWidth:\"max-content\",cursor:\"pointer\",border:`2px solid ${buttonColor}`,borderRadius:`${borderRadius}px`,padding:0,backgroundColor:backgroundColor,overflow:\"hidden\",display:\"flex\",alignItems:\"stretch\"},onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>setIsHovered(false)),onClick:handleClick,\"aria-label\":buttonText,children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:hoverColor,transform:isHovered?\"scaleX(1)\":\"scaleX(0)\",transformOrigin:\"right\",transition:`transform 0.4s ${ease}`,zIndex:0}}),/*#__PURE__*/_jsx(\"span\",{style:{...font,color:isHovered?hoverTextColor:color,whiteSpace:\"pre\",fontVariantNumeric:\"tabular-nums\",position:\"relative\",zIndex:1,display:\"flex\",alignItems:\"center\",padding:`${paddingVertical}px ${paddingHorizontal}px`,transition:`color 0.4s ${ease}`},children:buttonText}),/*#__PURE__*/_jsx(\"div\",{style:{width:`${squareSize}px`,flexShrink:0,backgroundColor:iconBackgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\",zIndex:1},children:svgIcon||svgIconHover?/*#__PURE__*/_jsx(\"img\",{src:isHovered&&svgIconHover?svgIconHover:svgIcon,alt:\"\",style:{width:`${iconSize}px`,height:`${iconSize}px`,objectFit:\"contain\"}}):// Fallback chevron so the component works before any\n// icon file is uploaded in the properties panel.\n/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",width:iconSize,height:iconSize,fill:\"none\",stroke:isHovered?hoverTextColor:color,strokeWidth:3,strokeLinecap:\"square\",style:{transition:`stroke 0.4s ${ease}`},children:/*#__PURE__*/_jsx(\"path\",{d:\"M4 15 L12 7 L20 15\"})})})]});}addPropertyControls(BackToTopButton,{scrollToTop:{type:ControlType.Boolean,title:\"Scroll To Top\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"BACK TO TOP\"},svgIcon:{type:ControlType.File,title:\"SVG Icon\",allowedFileTypes:[\"svg\",\"png\",\"jpg\",\"jpeg\"]},svgIconHover:{type:ControlType.File,title:\"SVG Icon (Hover)\",allowedFileTypes:[\"svg\",\"png\",\"jpg\",\"jpeg\"]},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:24,min:12,max:64,step:1,unit:\"px\"},iconBackgroundColor:{type:ControlType.Color,title:\"Icon Background\",defaultValue:\"#D2D5DB\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#0A0A0A\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text Color\",defaultValue:\"#0A0A0A\"},buttonColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#D2D5DB\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},hoverColor:{type:ControlType.Color,title:\"Swipe Fill Color\",defaultValue:\"#D2D5DB\"},borderRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:0,min:0,max:50,step:1,unit:\"px\"},paddingVertical:{type:ControlType.Number,title:\"Vertical Padding\",defaultValue:24,min:0,max:100,step:1,unit:\"px\"},paddingHorizontal:{type:ControlType.Number,title:\"Horizontal Padding\",defaultValue:32,min:0,max:100,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Bold\",letterSpacing:\"0.05em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTopButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicWidth\":\"280\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"64\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SwipeButton_1.map"],"mappings":"sMAWG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,UAAU,iBAAe,UAAU,aAAW,cAAc,cAAY,UAAU,kBAAgB,UAAU,aAAW,UAAU,UAAQ,GAAG,eAAa,GAAG,WAAS,GAAG,sBAAoB,UAAU,eAAa,EAAE,kBAAgB,GAAG,oBAAkB,GAAG,cAAY,IAAM,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAK,+BAAqC,EAAY,GAAG,CAAC,GAAG,CAAC,EAAY,OAEtd,EAAE,eAAe,EAAE,EAAE,gBAAgB,EAErC,IAAM,EAAM,EAAO,MAAM,GAAG,GAAO,OAAO,EAAM,UAAW,WAAW,CAAC,EAAM,SAAS,CAAC,EAAE,MAAO,CAIhG,IAAM,EAAO,E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