{"version":3,"file":"TestimonialRotator.DXFE4TL9.mjs","names":["useRef","_Fragment","__esmMin","init_ssg_sandbox_shims","window","l","p","c","J","ce","init_npm_react_18_3_1","de","RenderTarget","init_framer_BpuvUAiZ","withTestimonialRotator","local","el","items","title","reduce","FADE_MS","activeIndex","fit","show","active","on","i","item","current","paused","onEnter","onLeave","timer","INTERVAL_MS","ro","setRef","node","ref","Component","props","withQuotationMarks","init_TestimonialRotator","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/kfvLeJCNodvMRiOUtNGp/cWNmbNqKWwJM69Ft5vbG/TestimonialRotator.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{RenderTarget}from\"framer\";const INTERVAL_MS=6e3;const FADE_MS=400;/**\n * Shows the items of a CMS Collection List one at a time and rotates them.\n * Pauses on hover and while the tab is hidden. On the Framer canvas all items stay visible.\n */export function withTestimonialRotator(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const local=useRef(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;const el=local.current;if(!el)return;const items=Array.from(el.children);// No testimonials: hide the list and the title right before it\nif(items.length===0){el.style.display=\"none\";const title=el.previousElementSibling;if(title)title.style.display=\"none\"// hide the title\n;return;}if(items.length<2)return;const reduce=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;el.style.display=\"grid\";// Fit the list's height to the testimonial on screen, so short quotes\n// don't leave the empty space of the longest one\nel.style.overflow=\"hidden\";el.style.transition=reduce?\"none\":`height ${FADE_MS}ms ease`;let activeIndex=0;const fit=()=>{el.style.height=`${items[activeIndex].offsetHeight}px`;};const show=active=>{activeIndex=active;fit();items.forEach((item,i)=>{const on=i===active;item.style.transitionDelay=on&&!reduce?`${FADE_MS}ms`:\"0ms\";item.style.opacity=on?\"1\":\"0\";item.style.pointerEvents=on?\"auto\":\"none\";item.setAttribute(\"aria-hidden\",on?\"false\":\"true\");});};items.forEach(item=>{item.style.gridArea=\"1 / 1\";item.style.alignSelf=\"start\";item.style.height=\"auto\";item.style.transition=reduce?\"none\":`opacity ${FADE_MS}ms ease`;});let current=0;let paused=false;show(current);const onEnter=()=>paused=true;const onLeave=()=>paused=false;el.addEventListener(\"mouseenter\",onEnter);el.addEventListener(\"mouseleave\",onLeave);const timer=window.setInterval(()=>{if(paused||document.hidden)return;current=(current+1)%items.length;show(current);},INTERVAL_MS);const ro=typeof ResizeObserver!==\"undefined\"?new ResizeObserver(fit):null;items.forEach(item=>ro?.observe(item));return()=>{ro?.disconnect();window.clearInterval(timer);el.removeEventListener(\"mouseenter\",onEnter);el.removeEventListener(\"mouseleave\",onLeave);};},[]);const setRef=node=>{local.current=node;if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;};return /*#__PURE__*/_jsx(Component,{...props,ref:setRef});});}/** Wraps a text layer's paragraphs in typographic quotation marks: “…” */export function withQuotationMarks(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`.lcf-quote p::before{content:\"\\\\201C\"}.lcf-quote p::after{content:\"\\\\201D\"}`}),/*#__PURE__*/_jsx(Component,{...props,ref:ref,className:`${props.className??\"\"} lcf-quote`})]}));}\nexport const __FramerMetadata__ = {\"exports\":{\"withQuotationMarks\":{\"type\":\"reactHoc\",\"name\":\"withQuotationMarks\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTestimonialRotator\":{\"type\":\"reactHoc\",\"name\":\"withTestimonialRotator\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TestimonialRotator.map"],"mappings":"A,yMAGG,SAAgBc,EAAuB,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,IAAMC,EAAMf,EAAO,IAAI,EAAES,MAAc,CAAC,GAAGG,EAAa,QAAQ,IAAIA,EAAa,OA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