{"version":3,"file":"TestimonialCarousel.-MCnFdNF.mjs","names":["useState","useCallback","useRef"],"sources":["https:/framerusercontent.com/modules/HEUB9SWYD3dUSblfGtW3/WiRSVDD439xacvzTZnF7/TestimonialCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useState,useCallback,useEffect,useRef}from\"react\";/**\n * Testimonial Carousel\n *\n * Shows one testimonial at a time with working Previous / Next controls that\n * loop (1 -> 2 -> 3 -> 1 and 1 -> 3 -> 2 -> 1). Every testimonial — quote,\n * name, meta line and star rating — is editable from the properties panel.\n *\n * Optionally advances on its own (\"Auto Play\"): it pauses while the visitor\n * hovers or keyboard-focuses the carousel, pauses when scrolled out of view,\n * respects the visitor's \"reduce motion\" setting, and the timer restarts\n * whenever someone clicks Previous / Next.\n *\n * @framerIntrinsicWidth 440\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TestimonialCarousel(props){const{quotes=[{quote:\"“Stonewell did an amazing job on our house and driveway. The difference is night and day! Professional, on time, and great communication throughout the entire process. Highly recommend!”\",name:\"— Michael R.\",meta:\"Virginia Beach\",rating:5},{quote:\"“The crew showed up on time, worked hard all day, and left the property spotless. Our siding and walkway look brand new. I've already passed their number to two neighbors.”\",name:\"— Sarah T.\",meta:\"Chesapeake\",rating:5},{quote:\"“From the first quote to the final walkthrough, everything was smooth and professional. Fair pricing and genuinely good people to deal with. We'll be a repeat customer for sure.”\",name:\"— David M.\",meta:\"Norfolk\",rating:5}],textColor=\"#FFFFFF\",mutedColor=\"rgb(167,182,194)\",starColor=\"#F2A93B\",accentColor=\"#7AB7E9\",quoteMaxWidth=450,fontFamily=\"Inter, sans-serif\",autoPlay=true,autoPlayInterval=6}=props;const isStatic=useIsStaticRenderer();const count=Math.max(1,quotes.length);const[index,setIndex]=useState(0);const safeIndex=index%count;const active=quotes[safeIndex]??quotes[0];// Advancing manually (Prev / Next) bumps this so the auto-play timer restarts.\nconst[manualNudge,setManualNudge]=useState(0);const go=useCallback(delta=>{if(isStatic)return;setIndex(i=>(i+delta+count)%count);setManualNudge(n=>n+1);},[isStatic,count]);// Pause while hovered or keyboard-focused.\nconst[paused,setPaused]=useState(false);// Pause while scrolled out of view.\nconst rootRef=useRef(null);const[inView,setInView]=useState(true);useEffect(()=>{if(isStatic)return;if(typeof IntersectionObserver===\"undefined\")return;const el=rootRef.current;if(!el)return;const observer=new IntersectionObserver(entries=>setInView(entries[0]?.isIntersecting??true),{threshold:.2});observer.observe(el);return()=>observer.disconnect();},[isStatic]);// Respect the visitor's reduce-motion preference.\nconst[reduceMotion,setReduceMotion]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const update=()=>setReduceMotion(mq.matches);update();mq.addEventListener?.(\"change\",update);return()=>mq.removeEventListener?.(\"change\",update);},[]);// Auto-play: advance once, `autoPlayInterval` seconds after the last change.\nuseEffect(()=>{if(isStatic)return;if(!autoPlay||paused||!inView||reduceMotion)return;if(count<2)return;const ms=Math.max(2,autoPlayInterval)*1e3;const timer=setTimeout(()=>{setIndex(i=>(i+1)%count);},ms);return()=>clearTimeout(timer);},[isStatic,autoPlay,autoPlayInterval,paused,inView,reduceMotion,count,index,manualNudge]);const quoteStyle={margin:0,maxWidth:quoteMaxWidth,fontFamily:\"inherit\",fontSize:15,fontWeight:400,lineHeight:\"1.6em\",color:textColor};const nameStyle={fontFamily:\"inherit\",fontSize:14,fontWeight:600,lineHeight:\"1em\",color:textColor,whiteSpace:\"nowrap\"};const metaStyle={fontFamily:\"inherit\",fontSize:13,fontWeight:400,lineHeight:\"1em\",color:mutedColor,whiteSpace:\"nowrap\"};const counterStyle={fontFamily:\"inherit\",fontSize:12,fontWeight:500,lineHeight:\"1em\",color:mutedColor};const arrowButton={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:40,height:40,marginLeft:-8,padding:0,border:\"none\",background:\"transparent\",cursor:\"pointer\",color:mutedColor,borderRadius:8};return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,onMouseEnter:()=>setPaused(true),onMouseLeave:()=>setPaused(false),onFocusCapture:()=>setPaused(true),onBlurCapture:()=>setPaused(false),style:{position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",gap:18,width:\"100%\",fontFamily,...props.style},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes stonewell-testi-fade {\n                    from { opacity: 0; transform: translateX(16px); }\n                    to { opacity: 1; transform: translateX(0); }\n                }\n                .sw-testi-arrow { transition: color 0.2s ease, background 0.2s ease; }\n                .sw-testi-arrow svg { transition: transform 0.2s cubic-bezier(0.44,0,0.56,1); }\n                .sw-testi-arrow:hover { color: ${accentColor}; background: color-mix(in srgb, var(--token-a90c32d9-124e-4cb9-8d97-08517e0a848a, rgb(46,124,194)) 14%, transparent); }\n                .sw-testi-arrow--prev:hover svg { transform: translateX(-2px); }\n                .sw-testi-arrow--next:hover svg { transform: translateX(2px); }\n                .sw-testi-arrow:focus-visible { outline: 2px solid ${accentColor}; outline-offset: 2px; }\n            `}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",gap:18,width:\"100%\",animation:isStatic||reduceMotion?\"none\":\"stonewell-testi-fade 0.4s ease\"},children:[/*#__PURE__*/_jsx(\"p\",{style:quoteStyle,children:active?.quote}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:14,flexWrap:\"wrap\"},children:[/*#__PURE__*/_jsx(\"span\",{style:nameStyle,children:active?.name}),/*#__PURE__*/_jsx(Stars,{count:active?.rating??5,color:starColor}),active?.meta?/*#__PURE__*/_jsx(\"span\",{style:metaStyle,children:active.meta}):null]})]},safeIndex),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:14,paddingTop:6},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Previous testimonial\",className:\"sw-testi-arrow sw-testi-arrow--prev\",onClick:()=>go(-1),style:arrowButton,children:/*#__PURE__*/_jsx(Chevron,{dir:\"left\"})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Next testimonial\",className:\"sw-testi-arrow sw-testi-arrow--next\",onClick:()=>go(1),style:arrowButton,children:/*#__PURE__*/_jsx(Chevron,{dir:\"right\"})}),/*#__PURE__*/_jsxs(\"span\",{style:counterStyle,children:[safeIndex+1,\" / \",count]})]})]});}function Stars(props){const total=Math.max(0,Math.min(5,Math.round(props.count)));return /*#__PURE__*/_jsx(\"span\",{style:{display:\"flex\",alignItems:\"center\",gap:3},children:Array.from({length:total}).map((_,i)=>/*#__PURE__*/_jsx(\"svg\",{width:15,height:15,viewBox:\"0 0 24 24\",fill:props.color,\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 2.25l2.955 5.988 6.61.961-4.783 4.662 1.129 6.585L12 17.75l-5.911 3.096 1.129-6.585L2.435 9.599l6.61-.961L12 2.25z\"})},i))});}function Chevron(props){const d=props.dir===\"left\"?\"M15 5l-7 7 7 7\":\"M9 5l7 7-7 7\";return /*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:d,stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})});}addPropertyControls(TestimonialCarousel,{quotes:{type:ControlType.Array,title:\"Testimonials\",control:{type:ControlType.Object,controls:{quote:{type:ControlType.String,title:\"Quote\",displayTextArea:true,defaultValue:\"“Great work, highly recommend!”\"},name:{type:ControlType.String,title:\"Name\",defaultValue:\"— First L.\"},meta:{type:ControlType.String,title:\"Location / Service\",defaultValue:\"\"},rating:{type:ControlType.Number,title:\"Stars\",defaultValue:5,min:0,max:5,step:1}}},defaultValue:[{quote:\"“Stonewell did an amazing job on our house and driveway. The difference is night and day! Professional, on time, and great communication throughout the entire process. Highly recommend!”\",name:\"— Michael R.\",meta:\"Virginia Beach\",rating:5},{quote:\"“The crew showed up on time, worked hard all day, and left the property spotless. Our siding and walkway look brand new. I've already passed their number to two neighbors.”\",name:\"— Sarah T.\",meta:\"Chesapeake\",rating:5},{quote:\"“From the first quote to the final walkthrough, everything was smooth and professional. Fair pricing and genuinely good people to deal with. We'll be a repeat customer for sure.”\",name:\"— David M.\",meta:\"Norfolk\",rating:5}]},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},mutedColor:{type:ControlType.Color,title:\"Muted\",defaultValue:\"rgb(167,182,194)\"},starColor:{type:ControlType.Color,title:\"Stars\",defaultValue:\"#F2A93B\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#7AB7E9\"},quoteMaxWidth:{type:ControlType.Number,title:\"Quote Width\",defaultValue:450,min:240,max:640,step:10,unit:\"px\"},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"Inter, sans-serif\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:true},autoPlayInterval:{type:ControlType.Number,title:\"Interval\",defaultValue:6,min:2,max:15,step:1,unit:\"s\",hidden:props=>!props.autoPlay}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TestimonialCarousel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"440\",\"framerIntrinsicHeight\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TestimonialCarousel.map"],"mappings":"4NAiBG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,CAAC,MAAM,6LAA6L,KAAK,eAAe,KAAK,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