{"version":3,"file":"ReviewCarousel.DB21iKAS.mjs","names":["useState","useRef","startTransition","useCallback","__esmMin","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","te","_e","p","init_jsx_runtime","ce","de","init_framer_DKgW_P28","ControlType","addPropertyControls","ReviewCarousel","props","items","reviews","DEFAULT_REVIEWS","count","active","setActive","viewportWidth","setViewportWidth","reduced","setReduced","viewportRef","uid","touchX","wheelLock","mq","apply","el","ro","w","entries","prev","go","clamped","next","onKeyDown","onWheel","onTouchStart","onTouchEnd","dx","share","gap","slideWidth","offset","quoteSize","progressWidth","ease","chevron","disabled","dir","ink","style","label","isActive","i","cardBackground","SERIF","item","SANS","muted","trackColor","accent","init_ReviewCarousel"],"sources":["https:/framerusercontent.com/modules/FuCNEjLg6q9qSlTxz0B6/tuFrELTT5dzUdvqY1Twe/ReviewCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useCallback,useEffect,useRef,useState,startTransition}from\"react\";const SERIF='\"Fraunces Variable\", \"Fraunces Variable Placeholder\", serif';const SANS='\"Inter Variable\", \"Inter Variable Placeholder\", sans-serif';const DEFAULT_REVIEWS=[{quote:\"Fantastic cleaners! We have two labradors and they manage to make our condo look like new every time. Great communications and value. I couldn’t more highly recommend\",name:\"Brian J.\"},{quote:\"H Property Services has been performing maintenance and cleaning for our properties throughout the valley…\",name:\"Ben V.\"},{quote:\"H Property Service has been great to work with at St. Thomas Church. Their cleaning team does a really thorough job and keeps the space looking clean and welcoming every time…\",name:\"Stefanie O.\"},{quote:\"We have loved working with H Property services over the past 3 years. They take care of our cabin in Stanley and our home in Hailey…\",name:\"Dianne D.\"},{quote:\"As the director of facilities at the Argyros performing arts center, I can testify to the professionalism and work ethic of H Property Services…\",name:\"Remington N.\"},{quote:\"Their cleaning services are amazing! I went out of town and didn’t have time to clean before I left…\",name:\"Cynthia M.\"}];/**\n * Centered \"peek\" carousel for Google reviews: one large active slide with the\n * previous and next cards peeking at the container edges, clipped by it.\n * Chevrons and a segmented progress track sit below. Arrow keys work when focus\n * is inside, touch swipe and horizontal trackpad scrolling advance the slides,\n * and prefers-reduced-motion turns the slide into an instant swap.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ReviewCarousel(props){const{reviews,label=\"Google reviews\",cardBackground=\"#FAF8F5\",ink=\"#22252A\",muted=\"#5B5F66\",accent=\"#387A3D\",trackColor=\"#DDD8D0\",style}=props;const items=reviews&&reviews.length?reviews:DEFAULT_REVIEWS;const count=items.length;const[active,setActive]=useState(0);const[viewportWidth,setViewportWidth]=useState(0);const[reduced,setReduced]=useState(false);const viewportRef=useRef(null);const uid=useRef(\"rc\"+Math.random().toString(36).slice(2,8)).current;const touchX=useRef(null);const wheelLock=useRef(false);useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const apply=()=>startTransition(()=>setReduced(mq.matches));apply();mq.addEventListener(\"change\",apply);return()=>mq.removeEventListener(\"change\",apply);},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const el=viewportRef.current;if(!el||typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(entries=>{const w=entries[0].contentRect.width;startTransition(()=>setViewportWidth(prev=>Math.abs(prev-w)<1?prev:w));});ro.observe(el);return()=>ro.disconnect();},[]);const go=useCallback(next=>{const clamped=Math.max(0,Math.min(count-1,next));startTransition(()=>setActive(clamped));},[count]);const onKeyDown=e=>{if(e.key===\"ArrowRight\"){e.preventDefault();go(active+1);}else if(e.key===\"ArrowLeft\"){e.preventDefault();go(active-1);}else if(e.key===\"Home\"){e.preventDefault();go(0);}else if(e.key===\"End\"){e.preventDefault();go(count-1);}};const onWheel=e=>{if(Math.abs(e.deltaX)<=Math.abs(e.deltaY))return;if(wheelLock.current)return;if(Math.abs(e.deltaX)<12)return;wheelLock.current=true;go(active+(e.deltaX>0?1:-1));window.setTimeout(()=>{wheelLock.current=false;},450);};const onTouchStart=e=>{touchX.current=e.touches[0].clientX;};const onTouchEnd=e=>{if(touchX.current===null)return;const dx=e.changedTouches[0].clientX-touchX.current;touchX.current=null;if(Math.abs(dx)>40)go(active+(dx<0?1:-1));};// Sizing: active slide takes a share of the container, neighbours peek at the edges.\nconst share=viewportWidth>=900?.6:viewportWidth>=600?.8:.84;const gap=viewportWidth>=600?24:8;const slideWidth=viewportWidth?Math.round(viewportWidth*share):0;const offset=viewportWidth?viewportWidth/2-slideWidth/2-active*(slideWidth+gap):0;const quoteSize=viewportWidth>=900?26:viewportWidth>=600?23:20;const progressWidth=viewportWidth>=600?240:160;const ease=reduced?\"none\":\"transform 400ms ease, opacity 400ms ease\";const chevron=dir=>{const disabled=dir===\"prev\"?active===0:active===count-1;return /*#__PURE__*/_jsx(\"button\",{type:\"button\",className:`${uid}-chev`,\"aria-label\":dir===\"prev\"?\"Previous review\":\"Next review\",disabled:disabled,onClick:()=>go(active+(dir===\"prev\"?-1:1)),style:{width:44,height:44,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",border:\"none\",background:\"transparent\",padding:0,cursor:disabled?\"default\":\"pointer\",opacity:disabled?.3:1,color:ink},children:/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:dir===\"prev\"?\"M15 18L9 12l6-6\":\"M9 18l6-6-6-6\"})})});};return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\"},role:\"region\",\"aria-roledescription\":\"carousel\",\"aria-label\":label,onKeyDown:onKeyDown,children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .${uid}-chev:focus-visible{outline:3px solid ${ink};outline-offset:2px;border-radius:6px}\n                .${uid}-vp:focus-visible{outline:3px solid ${ink};outline-offset:4px;border-radius:16px}\n                .${uid}-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}\n            `}),/*#__PURE__*/_jsx(\"div\",{ref:viewportRef,className:`${uid}-vp`,tabIndex:0,onWheel:onWheel,onTouchStart:onTouchStart,onTouchEnd:onTouchEnd,style:{width:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap,alignItems:\"center\",width:\"max-content\",transform:`translateX(${offset}px)`,transition:ease,willChange:\"transform\"},children:items.map((item,i)=>{const isActive=i===active;return /*#__PURE__*/_jsxs(\"div\",{role:\"group\",\"aria-roledescription\":\"slide\",\"aria-label\":`${i+1} of ${count}`,\"aria-hidden\":!isActive,onClick:()=>!isActive&&go(i),style:{flex:\"0 0 auto\",width:slideWidth||\"60%\",boxSizing:\"border-box\",background:cardBackground,borderRadius:16,padding:viewportWidth>=600?\"48px 44px\":\"32px 24px\",opacity:isActive?1:.65,transform:isActive?\"scale(1)\":\"scale(0.85)\",transition:ease,cursor:isActive?\"default\":\"pointer\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontFamily:SERIF,fontVariationSettings:'\"opsz\" 48, \"wght\" 400, \"SOFT\" 30, \"WONK\" 0',fontWeight:400,fontSize:quoteSize,letterSpacing:\"-0.4px\",lineHeight:\"1.4em\",color:ink},children:item.quote}),/*#__PURE__*/_jsxs(\"p\",{style:{margin:\"20px 0 0\",fontFamily:SANS,fontVariationSettings:'\"opsz\" 14, \"wght\" 400',fontSize:14,letterSpacing:\"-0.02em\",lineHeight:\"1.5em\",color:isActive?muted:ink},children:[item.name,\" \\xb7 Google review\"]})]},i);})})}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:20,marginTop:28},children:[chevron(\"prev\"),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:progressWidth,height:2,background:trackColor,position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,width:progressWidth/count,background:accent,transform:`translateX(${active*(progressWidth/count)}px)`,transition:reduced?\"none\":\"transform 400ms ease\"}})}),chevron(\"next\")]}),/*#__PURE__*/_jsx(\"span\",{className:`${uid}-sr`,\"aria-live\":\"polite\",children:`Review ${active+1} of ${count}`})]});}addPropertyControls(ReviewCarousel,{reviews:{type:ControlType.Array,title:\"Reviews\",control:{type:ControlType.Object,controls:{quote:{type:ControlType.String,title:\"Quote\",displayTextArea:true,defaultValue:\"\"},name:{type:ControlType.String,title:\"Name\",defaultValue:\"\"}}},defaultValue:DEFAULT_REVIEWS},label:{type:ControlType.String,title:\"Region label\",defaultValue:\"Google reviews\"},cardBackground:{type:ControlType.Color,title:\"Card\",defaultValue:\"#FAF8F5\"},ink:{type:ControlType.Color,title:\"Text\",defaultValue:\"#22252A\"},muted:{type:ControlType.Color,title:\"Muted\",defaultValue:\"#5B5F66\"},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#387A3D\"},trackColor:{type:ControlType.Color,title:\"Track\",defaultValue:\"#DDD8D0\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReviewCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ReviewCarousel.map"],"mappings":"A,2NASG,SAAwBkB,EAAe,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,iBAAiB,iBAAe,UAAU,MAAI,UAAU,QAAM,UAAU,SAAO,UAAU,aAAW,UAAU,SAAOC,EAAYC,EAAMC,GAASA,EAAQ,OAAOA,EAAQC,EAAsBC,EAAMH,EAAM,OAAY,CAACI,EAAOC,GAAWzB,EAAS,CAAC,EAAO,CAAC0B,EAAcC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