{"version":3,"file":"ScrollToTopButton.DDdGFSIk.mjs","names":["React.useState","React.useRef","React.useCallback"],"sources":["https:/framerusercontent.com/modules/PGVZqqBvwTM3Nk6o7Lex/Kp7eTMLpW9jNRuePrX6w/ScrollToTopButton.js"],"sourcesContent":["// Create a floating button with a soft drop shadow, adjustable z-index property, and uses Color 02 as the fill with #ffffff as the text and icon color.\n// The button text should use TT Hooves as the font, regular weight, at 18px.\n// This button needs to allow the user to smooth scroll back to the top of the page.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerIntrinsicWidth 140\n * @framerIntrinsicHeight 56\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ScrollToTopButton(props){const{label,showLabel,showIcon,zIndex,fillColor,contentColor,shadow,borderRadius,gap,font,ariaLabel,style}=props;const renderTarget=RenderTarget.current();const forceVisibleInCanvas=renderTarget===RenderTarget.canvas||renderTarget===RenderTarget.thumbnail;const[enabled,setEnabled]=React.useState(forceVisibleInCanvas);const[renderButton,setRenderButton]=React.useState(forceVisibleInCanvas);const hideTimeoutRef=React.useRef(null);React.useEffect(()=>{if(typeof window===\"undefined\")return;if(forceVisibleInCanvas)return;const target=document.getElementById(\"ff-solutions\");if(!target){React.startTransition(()=>setEnabled(true));return;}const observer=new IntersectionObserver(([entry])=>{const isIntersecting=Boolean(entry?.isIntersecting);const isPast=Boolean(entry&&entry.boundingClientRect&&entry.boundingClientRect.bottom<0);React.startTransition(()=>setEnabled(isIntersecting||isPast));},{root:null,threshold:.01});observer.observe(target);return()=>observer.disconnect();},[forceVisibleInCanvas]);React.useEffect(()=>{if(forceVisibleInCanvas){if(hideTimeoutRef.current)window.clearTimeout(hideTimeoutRef.current);React.startTransition(()=>setRenderButton(true));return;}if(enabled){if(hideTimeoutRef.current)window.clearTimeout(hideTimeoutRef.current);React.startTransition(()=>setRenderButton(true));return;}if(typeof window===\"undefined\"){React.startTransition(()=>setRenderButton(false));return;}if(hideTimeoutRef.current)window.clearTimeout(hideTimeoutRef.current);hideTimeoutRef.current=window.setTimeout(()=>{React.startTransition(()=>setRenderButton(false));},500);return()=>{if(hideTimeoutRef.current)window.clearTimeout(hideTimeoutRef.current);};},[enabled,forceVisibleInCanvas]);const handleClick=React.useCallback(()=>{if(typeof window===\"undefined\")return;// Always scroll to the absolute top of the page\ntry{window.scrollTo({top:0,left:0,behavior:\"smooth\"});}catch{window.scrollTo(0,0);}const el=document.scrollingElement||document.documentElement||document.body;try{el.scrollTo({top:0,left:0,behavior:\"smooth\"});}catch{el.scrollTop=0;}// Some environments update scroll position asynchronously (or use custom scroll managers).\n// Retry shortly, then force-set to true top after the smooth scroll has had time to complete.\nwindow.setTimeout(()=>{const scrollTop=window.pageYOffset||document.documentElement?.scrollTop||document.body?.scrollTop||0;if(scrollTop>1){try{window.scrollTo({top:0,left:0,behavior:\"smooth\"});}catch{window.scrollTo(0,0);}try{el.scrollTo({top:0,left:0,behavior:\"smooth\"});}catch{el.scrollTop=0;}}},50);window.setTimeout(()=>{// Final guarantee: make sure we end at absolute Y=0.\ntry{window.scrollTo(0,0);}catch{}if(document.documentElement)document.documentElement.scrollTop=0;if(document.body)document.body.scrollTop=0;if(el)el.scrollTop=0;},650);},[]);if(!renderButton&&!forceVisibleInCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:5,height:5,minWidth:5,minHeight:5,opacity:0,pointerEvents:\"none\"},\"aria-hidden\":\"true\"});}return /*#__PURE__*/_jsxs(motion.button,{type:\"button\",onClick:handleClick,disabled:!enabled&&!forceVisibleInCanvas,\"aria-disabled\":!enabled&&!forceVisibleInCanvas,\"aria-label\":ariaLabel||label||\"Back to top\",initial:{opacity:0},animate:{opacity:enabled||forceVisibleInCanvas?1:0},transition:{duration:.5},style:{...style,position:\"relative\",zIndex,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap,padding:\"12px 24px\",minWidth:5,minHeight:5,background:fillColor,color:contentColor,border:\"none\",borderRadius,boxShadow:shadow,cursor:\"pointer\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",outline:\"none\"},children:[showLabel&&/*#__PURE__*/_jsx(\"span\",{style:{...font,color:contentColor,whiteSpace:\"nowrap\",width:\"max-content\",minWidth:\"max-content\",lineHeight:font?.lineHeight??\"1em\"},children:label}),showIcon&&/*#__PURE__*/_jsx(\"svg\",{width:18,height:18,viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",style:{display:\"block\",flex:\"0 0 auto\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 14l6-6 6 6\",stroke:contentColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})]});}addPropertyControls(ScrollToTopButton,{label:{type:ControlType.String,title:\"Text\",defaultValue:\"Top\"},showLabel:{type:ControlType.Boolean,title:\"Show Text\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},ariaLabel:{type:ControlType.String,title:\"ARIA Label\",defaultValue:\"Back to top\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:10,min:0,max:24,step:1,unit:\"px\"},zIndex:{type:ControlType.Number,title:\"z-index\",defaultValue:1e3,min:-10,max:9999,step:1},fillColor:{type:ControlType.Color,title:\"Fill (Color 02)\",defaultValue:\"#F5F5F5\"},contentColor:{type:ControlType.Color,title:\"Text/Icon\",defaultValue:\"#FFFFFF\"},shadow:{type:ControlType.BoxShadow,title:\"Shadow\",defaultValue:\"0px 10px 25px rgba(0, 0, 0, 0.16)\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"999px\"},font:{type:ControlType.Font,title:\"Font (set to TT Hooves)\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTopButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"56\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"140\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopButton.map"],"mappings":"mRAQG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,SAAO,YAAU,eAAa,SAAO,eAAa,MAAI,OAAK,YAAU,SAAO,EAAY,EAAa,EAAa,QAAQ,EAAQ,EAAqB,IAAe,EAAa,QAAQ,IAAe,EAAa,UAAe,CAAC,EAAQ,GAAYA,EAAe,CAAoB,EAAO,CAAC,EAAa,GAAiBA,EAAe,CAAoB,EAAQ,EAAeC,EAAa,IAAI,EAAE,MAAoB,CAAuC,GAA5B,IAAS,QAAsB,EAAqB,OAAO,IAAM,EAAO,SAAS,eAAe,cAAc,EAAE,GAAG,CAAC,EAAO,CAAC,MAA0B,EAAW,EAAI,CAAC,EAAE,MAAO,CAAC,IAAM,EAAS,IAAI,sBAAsB,CAAC,KAAS,CAAC,IAAM,EAAe,EAAQ,GAAO,eAAsB,EAAO,GAAQ,GAAO,EAAM,oBAAoB,EAAM,mBAAmB,OAAO,GAAG,MAA0B,EAAW,GAAgB,CAAM,CAAC,CAAE,EAAE,CAAC,KAAK,KAAK,UAAU,GAAG,CAAC,EAA2B,OAAzB,EAAS,QAAQ,CAAM,MAAY,EAAS,WAAW,CAAE,EAAE,CAAC,CAAoB,CAAC,EAAE,MAAoB,CAAC,GAAG,EAAqB,CAAI,EAAe,SAAQ,EAAO,aAAa,EAAe,OAAO,EAAE,MAA0B,EAAgB,EAA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