{"version":3,"file":"B20Scroll.DHM0iBxp.mjs","names":["React.useState","React.useRef","React.useCallback","React.startTransition"],"sources":["https:/framerusercontent.com/modules/4rF8hAafY3q2rWTZabOv/p8t2xDbuSSHKiaPPE7wx/B20Scroll.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function B20ScrollToTopSafe(props){const{size=56,bottom=28,right=28,showAfter=500,strokeWidth=2,background=\"rgba(12,12,16,0.72)\",borderColor=\"rgba(255,255,255,0.14)\",trackColor=\"rgba(255,255,255,0.12)\",progressColor=\"#D94DFF\",iconColor=\"#FFFFFF\",glowColor=\"rgba(217,77,255,0.22)\",blur=16,center=\"arrow\",zIndex=999}=props;const[mounted,setMounted]=React.useState(false);const[visible,setVisible]=React.useState(false);const[progress,setProgress]=React.useState(0);const[hovered,setHovered]=React.useState(false);const[focusVisible,setFocusVisible]=React.useState(false);const frameRef=React.useRef(null);const visibleRef=React.useRef(false);const progressRef=React.useRef(0);React.useEffect(()=>{React.startTransition(()=>setMounted(true));if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const update=()=>{const doc=document.documentElement;const scrollTop=window.scrollY||doc.scrollTop||0;const maxScroll=Math.max(doc.scrollHeight-window.innerHeight,1);const nextVisible=scrollTop>=showAfter;const nextProgress=Math.min(Math.max(scrollTop/maxScroll,0),1);if(nextVisible!==visibleRef.current){visibleRef.current=nextVisible;React.startTransition(()=>setVisible(nextVisible));}if(Math.abs(nextProgress-progressRef.current)>.002){progressRef.current=nextProgress;React.startTransition(()=>setProgress(nextProgress));}};const scheduleUpdate=()=>{if(frameRef.current!==null)return;frameRef.current=window.requestAnimationFrame(()=>{frameRef.current=null;update();});};update();window.addEventListener(\"scroll\",scheduleUpdate,{passive:true});window.addEventListener(\"resize\",scheduleUpdate);return()=>{window.removeEventListener(\"scroll\",scheduleUpdate);window.removeEventListener(\"resize\",scheduleUpdate);if(frameRef.current!==null){window.cancelAnimationFrame(frameRef.current);}};},[showAfter]);const goTop=React.useCallback(()=>{const reduceMotion=typeof window!==\"undefined\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;window.scrollTo({top:0,behavior:reduceMotion?\"auto\":\"smooth\"});},[]);const radius=Math.max((size-strokeWidth*2)/2,1);const circumference=2*Math.PI*radius;const offset=circumference*(1-progress);// Toujours rendre un conteneur minuscule et neutre :\n// cela évite que le composant Code modifie le layout Framer.\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,overflow:\"visible\",pointerEvents:\"none\"},children:mounted&&/*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-label\":\"Revenir en haut de la page\",onClick:goTop,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),onFocus:()=>React.startTransition(()=>setFocusVisible(true)),onBlur:()=>React.startTransition(()=>setFocusVisible(false)),style:{position:\"fixed\",right,bottom,width:size,height:size,padding:0,margin:0,border:`1px solid ${borderColor}`,borderRadius:\"50%\",background,WebkitBackdropFilter:`blur(${blur}px)`,backdropFilter:`blur(${blur}px)`,display:\"grid\",placeItems:\"center\",cursor:visible?\"pointer\":\"default\",pointerEvents:visible?\"auto\":\"none\",opacity:visible?1:0,transform:visible?hovered?\"translateY(-2px) scale(1.06)\":\"translateY(0) scale(1)\":\"translateY(10px) scale(0.9)\",transition:\"opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease\",boxShadow:hovered?`0 0 28px ${glowColor}`:`0 0 16px ${glowColor}`,zIndex,overflow:\"hidden\",appearance:\"none\",WebkitAppearance:\"none\",outline:focusVisible?`2px solid ${progressColor}`:\"none\",outlineOffset:2},children:[/*#__PURE__*/_jsxs(\"svg\",{\"aria-hidden\":\"true\",width:size,height:size,viewBox:`0 0 ${size} ${size}`,style:{position:\"absolute\",inset:0,transform:\"rotate(-90deg)\",pointerEvents:\"none\"},children:[/*#__PURE__*/_jsx(\"circle\",{cx:size/2,cy:size/2,r:radius,fill:\"none\",stroke:trackColor,strokeWidth:strokeWidth}),/*#__PURE__*/_jsx(\"circle\",{cx:size/2,cy:size/2,r:radius,fill:\"none\",stroke:progressColor,strokeWidth:strokeWidth,strokeLinecap:\"round\",strokeDasharray:circumference,strokeDashoffset:offset,style:{transition:\"stroke-dashoffset 80ms linear\"}})]}),center===\"b20\"?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"relative\",color:iconColor,fontSize:size*.21,fontWeight:700,lineHeight:1,letterSpacing:\"-0.05em\",pointerEvents:\"none\"},children:\"b20\"}):/*#__PURE__*/_jsxs(\"svg\",{\"aria-hidden\":\"true\",width:size*.34,height:size*.34,viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeWidth:\"1.8\",strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{position:\"relative\",transform:hovered?\"translateY(-2px)\":\"translateY(0)\",transition:\"transform 180ms ease\",pointerEvents:\"none\"},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M12 19V5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M5.5 11.5 12 5l6.5 6.5\"})]})]})});}B20ScrollToTopSafe.defaultProps={width:1,height:1,size:56,bottom:28,right:28,showAfter:500,strokeWidth:2,background:\"rgba(12,12,16,0.72)\",borderColor:\"rgba(255,255,255,0.14)\",trackColor:\"rgba(255,255,255,0.12)\",progressColor:\"#D94DFF\",iconColor:\"#FFFFFF\",glowColor:\"rgba(217,77,255,0.22)\",blur:16,center:\"arrow\",zIndex:999};addPropertyControls(B20ScrollToTopSafe,{size:{type:ControlType.Number,title:\"Taille\",min:42,max:84,step:1},bottom:{type:ControlType.Number,title:\"Bas\",min:8,max:120,step:1},right:{type:ControlType.Number,title:\"Droite\",min:8,max:120,step:1},showAfter:{type:ControlType.Number,title:\"Appara\\xeet apr\\xe8s\",min:100,max:2e3,step:50},strokeWidth:{type:ControlType.Number,title:\"Anneau\",min:1,max:5,step:.5},background:{type:ControlType.Color,title:\"Fond\"},borderColor:{type:ControlType.Color,title:\"Contour\"},trackColor:{type:ControlType.Color,title:\"Piste\"},progressColor:{type:ControlType.Color,title:\"Progression\"},iconColor:{type:ControlType.Color,title:\"Ic\\xf4ne\"},glowColor:{type:ControlType.Color,title:\"Glow\"},blur:{type:ControlType.Number,title:\"Blur\",min:0,max:30,step:1},center:{type:ControlType.Enum,title:\"Centre\",options:[\"arrow\",\"b20\"],optionTitles:[\"Fl\\xe8che\",\"B20\"]},zIndex:{type:ControlType.Number,title:\"Z-index\",min:1,max:9999,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"B20ScrollToTopSafe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./B20Scroll.map"],"mappings":"2NAAyI,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,GAAG,SAAO,GAAG,QAAM,GAAG,YAAU,IAAI,cAAY,EAAE,aAAW,sBAAsB,cAAY,yBAAyB,aAAW,yBAAyB,gBAAc,UAAU,YAAU,UAAU,YAAU,wBAAwB,OAAK,GAAG,SAAO,QAAQ,SAAO,KAAK,EAAW,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAS,GAAaA,EAAe,CAAC,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAa,GAAiBA,EAAe,EAAK,EAAQ,EAASC,EAAa,IAAI,EAAQ,EAAWA,EAAa,EAAK,EAAQ,EAAYA,EAAa,CAAC,EAAE,MAAoB,CAA6C,GAA5C,MAA0B,EAAW,EAAI,CAAC,EAAY,IAAS,QAAa,OAAO,SAAW,IAAY,OAAO,IAAM,MAAW,CAAC,IAAM,EAAI,SAAS,gBAAsB,EAAU,EAAO,SAAS,EAAI,WAAW,EAAQ,EAAU,KAAK,IAAI,EAAI,aAAa,EAAO,YAAY,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