{"version":3,"file":"ScrollToTop.DlNWde7Z.mjs","names":["useState","useRef","useCallback","useMemo","useState","useRef","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/2CRvE3MrVVz8D2yP8plo/WKeTa2ZMXUUZVP1SPdi1/BOCCAReadingProgress.js","https:/framerusercontent.com/modules/96j6pMyytcHLud55LVGK/1Rnb1ejntPI1OsroSH2c/ScrollToTop.js"],"sourcesContent":["// TASK 2 — Create BOCCAReadingProgress: a fixed full-width top reading-progress bar with top offset, configurable height/fill/track colors, rAF-throttled passive scroll handling, short-page suppression, pointer-events none, and static-render safety.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BOCCAReadingProgress(props){const{topOffset=0,barHeight=2,fillColor=\"rgb(230,0,35)\",trackColor=\"transparent\",minPageHeight=1600}=props;const isStatic=useIsStaticRenderer();const[progress,setProgress]=useState(0);const[shouldRender,setShouldRender]=useState(false);const rafRef=useRef(null);const calculate=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const doc=document.documentElement;const pageHeight=doc.scrollHeight;const viewportHeight=window.innerHeight;const scrollable=pageHeight-viewportHeight;const allowRender=pageHeight>=minPageHeight&&scrollable>0;startTransition(()=>setShouldRender(allowRender));if(!allowRender){startTransition(()=>setProgress(0));return;}const y=window.scrollY||window.pageYOffset||0;const ratio=Math.max(0,Math.min(1,y/scrollable));startTransition(()=>setProgress(ratio));},[minPageHeight]);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;const onScrollOrResize=()=>{if(rafRef.current!==null)return;rafRef.current=window.requestAnimationFrame(()=>{rafRef.current=null;calculate();});};window.addEventListener(\"scroll\",onScrollOrResize,{passive:true});window.addEventListener(\"resize\",onScrollOrResize);onScrollOrResize();return()=>{window.removeEventListener(\"scroll\",onScrollOrResize);window.removeEventListener(\"resize\",onScrollOrResize);if(rafRef.current!==null){window.cancelAnimationFrame(rafRef.current);rafRef.current=null;}};},[calculate,isStatic]);const wrapperStyle=useMemo(()=>({position:\"fixed\",top:topOffset,left:0,width:\"100%\",height:barHeight,zIndex:30,pointerEvents:\"none\",background:trackColor,overflow:\"hidden\"}),[barHeight,topOffset,trackColor]);const fillStyle=useMemo(()=>({width:\"100%\",height:\"100%\",background:fillColor,transformOrigin:\"0% 50%\",transform:`scaleX(${progress})`,transition:\"transform 0.14s ease-out\",willChange:\"transform\"}),[fillColor,progress]);if(isStatic||!shouldRender)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:wrapperStyle,children:/*#__PURE__*/_jsx(\"div\",{style:fillStyle})})});}addPropertyControls(BOCCAReadingProgress,{topOffset:{type:ControlType.Number,title:\"Top Offset\",defaultValue:0,min:0,max:240,step:1,unit:\"px\"},barHeight:{type:ControlType.Number,title:\"Bar Height\",defaultValue:2,min:1,max:16,step:1,unit:\"px\"},fillColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"rgb(230,0,35)\"},trackColor:{type:ControlType.Color,title:\"Track\",defaultValue:\"transparent\"},minPageHeight:{type:ControlType.Number,title:\"Min Height\",defaultValue:1600,min:0,max:12e3,step:100,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BOCCAReadingProgress\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BOCCAReadingProgress.map","// TASK 1 — Update Workshop/ScrollToTop.tsx into a premium floating Back To Top glass button with bottom-right offsets, scroll-threshold visibility, near-footer hide behavior, smooth scroll, and SSR/static safety.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerIntrinsicWidth 48\n * @framerIntrinsicHeight 48\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollToTop(props){const{showAfter=800,hideNearFooter=true,placement=\"bottom-right\",offsetBottom=24,offsetRight=24,top=96,left=40,surfaceColor=\"rgba(10,10,10,0.55)\",borderColor=\"rgba(237,223,196,0.16)\",chevronColor=\"rgb(230,0,35)\"}=props;const isStatic=useIsStaticRenderer();const[isVisible,setIsVisible]=useState(false);const rafRef=useRef(null);const updateVisibility=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const scrollTop=window.scrollY||window.pageYOffset||0;const viewport=window.innerHeight||0;const pageHeight=document.documentElement?.scrollHeight||0;const distanceToBottom=pageHeight-(scrollTop+viewport);const pastThreshold=scrollTop>showAfter;const footerAllowsVisibility=!hideNearFooter||distanceToBottom>200;const nextVisible=pastThreshold&&footerAllowsVisibility;startTransition(()=>setIsVisible(nextVisible));},[hideNearFooter,showAfter]);useEffect(()=>{if(isStatic)return;if(typeof window===\"undefined\")return;const onScroll=()=>{if(rafRef.current!==null)return;rafRef.current=window.requestAnimationFrame(()=>{rafRef.current=null;updateVisibility();});};window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);onScroll();return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);if(rafRef.current!==null){window.cancelAnimationFrame(rafRef.current);rafRef.current=null;}};},[isStatic,updateVisibility]);const scrollToTop=useCallback(()=>{if(typeof window===\"undefined\")return;window.scrollTo({top:0,behavior:\"smooth\"});},[]);const buttonStyle=useMemo(()=>{const placementStyle=placement===\"top-left\"?{top,left:`calc(${left}px + env(safe-area-inset-left, 0px))`}:placement===\"bottom-left\"?{left:`calc(${left}px + env(safe-area-inset-left, 0px))`,bottom:`calc(${offsetBottom}px + env(safe-area-inset-bottom, 0px))`}:{right:offsetRight,bottom:`calc(${offsetBottom}px + env(safe-area-inset-bottom, 0px))`};return{position:\"fixed\",...placementStyle,zIndex:40,width:48,height:48,borderRadius:999,border:`1px solid ${borderColor}`,background:surfaceColor,color:chevronColor,backdropFilter:\"blur(12px)\",WebkitBackdropFilter:\"blur(12px)\",boxShadow:\"0 8px 22px rgba(0,0,0,0.35)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",outline:\"none\"};},[borderColor,chevronColor,left,offsetBottom,offsetRight,placement,surfaceColor,top]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\"},children:/*#__PURE__*/_jsx(motion.button,{type:\"button\",role:\"button\",\"aria-label\":\"Back to top\",onClick:scrollToTop,initial:false,animate:{opacity:isVisible&&!isStatic?1:0,y:isVisible&&!isStatic?0:8},transition:{duration:.2,ease:\"easeOut\"},style:{...buttonStyle,pointerEvents:isVisible&&!isStatic?\"auto\":\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 14l6-6 6 6\"})})})});}addPropertyControls(ScrollToTop,{showAfter:{type:ControlType.Number,title:\"Show After\",defaultValue:800,min:0,max:4e3,step:25,unit:\"px\"},hideNearFooter:{type:ControlType.Boolean,title:\"Hide Footer\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},placement:{type:ControlType.Enum,title:\"Placement\",defaultValue:\"bottom-right\",options:[\"bottom-right\",\"top-left\",\"bottom-left\"],optionTitles:[\"Bottom Right\",\"Top Left\",\"Bottom Left\"]},offsetBottom:{type:ControlType.Number,title:\"Bottom\",defaultValue:24,min:0,max:200,step:1,unit:\"px\",hidden:props=>props.placement===\"top-left\"},offsetRight:{type:ControlType.Number,title:\"Right\",defaultValue:24,min:0,max:200,step:1,unit:\"px\",hidden:props=>props.placement!==\"bottom-right\"},top:{type:ControlType.Number,title:\"Top\",defaultValue:96,min:0,max:400,step:1,unit:\"px\",hidden:props=>props.placement!==\"top-left\"},left:{type:ControlType.Number,title:\"Left\",defaultValue:40,min:0,max:400,step:1,unit:\"px\",hidden:props=>props.placement===\"bottom-right\"},surfaceColor:{type:ControlType.Color,title:\"Surface\",defaultValue:\"rgba(10,10,10,0.55)\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(237,223,196,0.16)\"},chevronColor:{type:ControlType.Color,title:\"Chevron\",defaultValue:\"rgb(230,0,35)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"48\",\"framerIntrinsicHeight\":\"48\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTop.map"],"mappings":"oRAIG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,YAAU,EAAE,YAAU,EAAE,YAAU,gBAAgB,aAAW,cAAc,gBAAc,MAAM,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAS,GAAaA,EAAS,CAAC,EAAO,CAAC,EAAa,GAAiBA,EAAS,EAAK,EAAQ,EAAOC,EAAO,IAAI,EAAQ,EAAUC,MAAgB,CAAC,GAAU,IAAS,QAAa,OAAO,SAAW,IAAY,OAA0C,IAAM,EAA/B,SAAS,gBAAqC,aAA2D,EAAW,EAApC,EAAO,YAA6D,EAAY,GAAY,GAAe,EAAW,EAAoD,GAAlD,MAAoB,EAAgB,CAAW,CAAC,EAAK,CAAC,EAAY,CAAC,MAAoB,EAAY,CAAC,CAAC,EAA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