{"version":3,"file":"TestimonialRotator.CyukPiKh.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_CN96F41L","withTestimonialRotator","local","el","items","title","reduce","show","on","i","active","FADE_MS","item","current","paused","onEnter","onLeave","timer","INTERVAL_MS","setRef","node","ref","Component","props","withQuotationMarks","init_TestimonialRotator","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/kfvLeJCNodvMRiOUtNGp/Vq1aEPYD6MX47UgXHRPO/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\";const show=active=>{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=\"stretch\";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);return()=>{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,OAAO,OAAO,IAAMI,EAAGD,EAAM,QAAQ,GAAG,CAACC,EAAG,OAAO,IAAMC,EAAM,MAAM,KAAKD,EAAG,QAAQ,EACxQ,GAAGC,EAAM,SAAS,EAAE,CAAC,EAAG,MAAM,QAAQ,OAAO,IAAMC,EAAMF,EAAG,uBAA0BE,IAAM,EAAM,MAAM,QAAQ,QAC/G,MAAO,CAAC,GAAGD,EAAM,OAAO,EAAE,OAA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