{"version":3,"file":"Result.BymdiO2b.mjs","names":["React.useRef","React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/n5KJrKBfGYubiXaswn8j/NGxEPF5tp3XOyusWT2gJ/Result.js"],"sourcesContent":["// MovingBenefitsBar.tsx\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,motion,useAnimation}from\"framer\";// --- Load Outfit font (Framer will inline this) ---\nconst outfit=document.createElement(\"style\");outfit.innerHTML=`\n@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600&display=swap');\n`;document.head.appendChild(outfit);const DefaultGradients=[// blue → teal (like the sample)\n{from:\"#294172\",to:\"#6AC7B4\"},// slate → mint\n{from:\"#415E61\",to:\"#9AC4BA\"},// olive → sage\n{from:\"#6C7C52\",to:\"#B4C29A\"},// denim → aqua\n{from:\"#4C7EAA\",to:\"#7ED0C3\"}];export default function MovingBenefitsBar(props){const{items,speed,fontSize,fontWeight,itemPaddingX,itemPaddingY,pillRadius,gap,arrowSize,arrowBg,arrowIcon,pauseOnHover,gradients,shadowOpacity}=props;const listRef=React.useRef(null);const controls=useAnimation();const[isPaused,setPaused]=React.useState(false);const gradientSet=gradients.length?gradients:DefaultGradients;// Build duplicated content for seamless loop\nconst content=[...items,...items];// Kick off linear infinite animation\nconst startLoop=React.useCallback(async()=>{if(!listRef.current)return;const width=listRef.current.scrollWidth/2// width of one sequence\n;await controls.start({x:[0,-width],transition:{duration:Math.max(10,speed),ease:\"linear\",repeat:Infinity}});},[controls,speed]);React.useEffect(()=>{if(!isPaused)startLoop();return()=>controls.stop();},[isPaused,startLoop,controls]);// Pause/resume helpers\nconst pause=()=>{setPaused(true);controls.stop();};const resume=()=>{setPaused(false);};// Manual nudge with arrow buttons\nconst nudge=async dir=>{if(!listRef.current)return;pause();const width=listRef.current.scrollWidth/2;// Nudge by 25% of one loop width\nconst step=width*.25*dir;// Get current x\n// @ts-ignore\nconst currentX=controls.get()?.x??0;await controls.start({x:currentX+step,transition:{duration:.45,ease:\"easeOut\"}});// Wrap x into [-width, 0] to preserve seamlessness\n// @ts-ignore\nconst wrapped=((currentX+step)%width+width)%width// 0..width\n;await controls.set({x:-wrapped});// Auto-resume after a short delay\nsetTimeout(()=>resume(),1200);};const pillShadow=`0 12px 24px rgba(0,0,0,${shadowOpacity})`;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",fontFamily:\"'Outfit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif\",display:\"flex\",alignItems:\"center\"},onMouseEnter:()=>pauseOnHover&&pause(),onMouseLeave:()=>pauseOnHover&&resume(),children:[/*#__PURE__*/_jsx(motion.div,{ref:listRef,animate:controls,style:{display:\"flex\",gap,whiteSpace:\"nowrap\",willChange:\"transform\",alignItems:\"center\"},children:content.map((label,i)=>{const g=gradientSet[i%gradientSet.length];return /*#__PURE__*/_jsx(\"div\",{style:{padding:`${itemPaddingY}px ${itemPaddingX}px`,borderRadius:pillRadius,backgroundImage:`linear-gradient(135deg, ${g.from}, ${g.to})`,color:\"white\",fontSize,fontWeight:Number(fontWeight),lineHeight:1.05,letterSpacing:-.5,boxShadow:pillShadow,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",whiteSpace:\"nowrap\"},children:label},`${label}-${i}`);})}),/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Previous\",onClick:()=>nudge(-1),style:circleBtnStyle(arrowSize,arrowBg,arrowIcon,\"left\"),children:/*#__PURE__*/_jsx(\"svg\",{width:\"40%\",height:\"40%\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 6l-6 6 6 6\",stroke:arrowIcon,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Next\",onClick:()=>nudge(1),style:circleBtnStyle(arrowSize,arrowBg,arrowIcon,\"right\"),children:/*#__PURE__*/_jsx(\"svg\",{width:\"40%\",height:\"40%\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 6l6 6-6 6\",stroke:arrowIcon,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]});}function circleBtnStyle(size,bg,icon,side){return{position:\"absolute\",top:\"50%\",transform:\"translateY(-50%)\",[side]:12,width:size,height:size,borderRadius:size,border:\"none\",background:bg,color:icon,display:\"grid\",placeItems:\"center\",cursor:\"pointer\",boxShadow:\"0 10px 20px rgba(0,0,0,0.25)\",backdropFilter:\"blur(4px)\"};}// ---------- Defaults ----------\nMovingBenefitsBar.defaultProps={items:[\"More Energy\",\"Lower Stress\",\"Greater Calm\",\"Better Sleep\",\"Better Recovery\",\"A Personalised Week-Ahead\"],speed:48,fontSize:44,fontWeight:\"500\",itemPaddingX:28,itemPaddingY:16,pillRadius:20,gap:16,arrowSize:56,arrowBg:\"rgba(17, 34, 51, 0.85)\",arrowIcon:\"#FFFFFF\",pauseOnHover:true,gradients:DefaultGradients,shadowOpacity:.12};// ---------- Property Controls ----------\naddPropertyControls(MovingBenefitsBar,{items:{type:ControlType.Array,title:\"Items\",propertyControl:{type:ControlType.String,placeholder:\"Text…\"}},speed:{type:ControlType.Number,title:\"Speed (s per loop)\",min:10,max:180,step:1,displayStepper:true},fontSize:{type:ControlType.Number,min:16,max:96,step:1,title:\"Font Size\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[\"400\",\"500\",\"600\"],optionTitles:[\"Regular\",\"Medium\",\"SemiBold\"]},itemPaddingX:{type:ControlType.Number,min:8,max:80,step:1,title:\"Pad X\"},itemPaddingY:{type:ControlType.Number,min:6,max:48,step:1,title:\"Pad Y\"},pillRadius:{type:ControlType.Number,min:0,max:64,step:1,title:\"Radius\"},gap:{type:ControlType.Number,min:0,max:48,step:1,title:\"Gap\"},arrowSize:{type:ControlType.Number,min:36,max:96,step:2,title:\"Arrow Size\"},arrowBg:{type:ControlType.Color,title:\"Arrow BG\"},arrowIcon:{type:ControlType.Color,title:\"Arrow Icon\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on Hover\"},shadowOpacity:{type:ControlType.Number,min:0,max:.4,step:.01,title:\"Shadow\"},gradients:{type:ControlType.Array,title:\"Gradients\",propertyControl:{type:ControlType.Object,controls:{from:{type:ControlType.Color,title:\"From\"},to:{type:ControlType.Color,title:\"To\"}}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MovingBenefitsBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Result.map"],"mappings":"kWAQ+B,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,WAAS,aAAW,eAAa,eAAa,aAAW,MAAI,YAAU,UAAQ,YAAU,eAAa,YAAU,iBAAe,EAAY,EAAQA,EAAa,KAAK,CAAO,EAAS,GAAc,CAAM,CAAC,EAAS,GAAWC,EAAe,GAAM,CAAO,EAAY,EAAU,OAAO,EAAU,EAC7X,EAAQ,CAAC,GAAG,EAAM,GAAG,EAAM,CAC3B,EAAUC,EAAkB,SAAS,CAAC,GAAG,CAAC,EAAQ,QAAQ,OAAO,IAAM,EAAM,EAAQ,QAAQ,YAAY,EAC9G,MAAM,EAAS,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAM,CAAC,WAAW,CAAC,SAAS,KAAK,IAAI,GAAG,EAAM,CAAC,KAAK,SAAS,OAAO,IAAS,CAAC,CAAC,EAAG,CAAC,EAAS,EAAM,CAAC,CAAC,OAAyB,GAAS,GAAW,KAAW,EAAS,MAAM,EAAG,CAAC,EAAS,EAAU,EAAS,CAAC,CACzO,IAAM,MAAU,CAAC,EAAU,GAAK,CAAC,EAAS,MAAM,EAAS,MAAW,CAAC,EAAU,GAAM,EAC/E,EAAM,KAAM,IAAK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