{"version":3,"file":"Counter_SSR.umLSDDa2.mjs","names":["useState","useRef","useId","__esmMin","navigator","init_npm_react_18_3_1","ie","window","ce","init_jsx_runtime","p","_e","de","init_ssg_sandbox_shims","motion","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_BisrWwwE","ControlType","skipAnimation","reduce","crawler","Counter","count","setCount","end","inView","setInView","running","setRunning","started","ref","cls","el","io","entry","start","startOnViewport","restartOnViewport","step","incrementType","id","c","speed","gapSize","textSize","SITE_FONT","textColor","textSizeSmall","prefixText","prefixFont","prefixColor","decimalSeparatorType","n","suffixText","suffixFont","suffixColor","init_Counter_SSR"],"sources":["https:/framerusercontent.com/modules/d1SF7VPvGT8xKDNmgla7/q8r95bnzXM1i84WZKijq/Counter_SSR.js"],"sourcesContent":["// Counter_SSR — drop-in replacement for the Framer marketplace \"Counter\"\n// (used by the Results › Statistics section on ~18 pages). In Framer this is\n// the code file `Counter_SSR.tsx`; the old marketplace instances point here.\n//\n// SEO/AEO fix: the original did `useState(start)`, so Framer's server-rendered\n// HTML always shipped the placeholder (e.g. \"0+ Hours Saved\", \"0% Answer\n// Accuracy\"). Crawlers and AI engines read that HTML, not the animation.\n// State now starts at `end`, so the real value is in the HTML; the count-up\n// from `start` only runs in a real browser, and is skipped for bots/headless\n// renderers and prefers-reduced-motion. Props and controls are unchanged.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useId,useRef,useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const SITE_FONT={fontFamily:'\"Figtree\", \"Figtree Placeholder\", sans-serif',fontWeight:600};function skipAnimation(){if(typeof window===\"undefined\")return true;const reduce=window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;const crawler=navigator.webdriver||/bot|crawl|spider|slurp|headless|lighthouse|chatgpt|perplexity/i.test(navigator.userAgent);return reduce||crawler;}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Counter({start=0,end=100,speed=100,gapSize=4,prefixText=\"\",suffixText=\"\",prefixFont,suffixFont,prefixColor,suffixColor,loop=false,decimalSeparatorType=\"comma\",textSize=36,// Replaces the old per-breakpoint Font Size overrides (tablet/phone): one\n// instance, one set of props, so Framer renders it once instead of once per\n// breakpoint (which duplicated the numbers in the HTML).\ntextSizeSmall=0,textColor=\"#D3D3D3\",startOnViewport=false,restartOnViewport=false,incrementType=\"integer\"}){// Real value first: this is what lands in the server-rendered HTML.\nconst[count,setCount]=useState(end);const[inView,setInView]=useState(false);const[running,setRunning]=useState(false);const started=useRef(false);const ref=useRef(null);const cls=\"cssr-\"+useId().replace(/[^a-zA-Z0-9_-]/g,\"\");useEffect(()=>{const el=ref.current;if(!el||typeof IntersectionObserver===\"undefined\")return;const io=new IntersectionObserver(([entry])=>setInView(entry.isIntersecting));io.observe(el);return()=>io.disconnect();},[]);// Kick off a run. Without startOnViewport it runs on mount (original\n// behavior); with it, it waits until the counter is on screen.\nuseEffect(()=>{if(started.current||skipAnimation()||start===end)return;if(startOnViewport&&!inView)return;started.current=true;setCount(start);setRunning(true);},[inView,startOnViewport,start,end]);// Replay: re-entering the viewport restarts from `start`.\nuseEffect(()=>{if(!restartOnViewport||!inView||skipAnimation()||start===end)return;setCount(start);setRunning(true);},[inView,restartOnViewport,start,end]);useEffect(()=>{if(!running)return;const step=incrementType===\"integer\"?1:.1;const id=setInterval(()=>{setCount(c=>c+step>=end?end:parseFloat((c+step).toFixed(2)));},speed);return()=>clearInterval(id);},[running,end,speed,incrementType]);useEffect(()=>{if(running&&count>=end)setRunning(false);},[running,count,end]);const format=n=>decimalSeparatorType===\"comma\"?n.toLocaleString(\"en-US\"):decimalSeparatorType===\"period\"?n.toLocaleString(\"en-US\").replace(/,/g,\".\"):n.toFixed(incrementType===\"integer\"?0:1);return /*#__PURE__*/_jsxs(motion.div,{ref:ref,className:cls,style:{display:\"flex\",gap:`${gapSize}px`,alignItems:\"center\",fontSize:`${textSize}px`,// Always the site font (Figtree 600), as every original instance\n// used. A Font control default cannot be set through the Framer\n// MCP XML, so replacement instances would fall back to Inter.\nfontFamily:SITE_FONT.fontFamily,fontWeight:SITE_FONT.fontWeight,color:textColor,letterSpacing:\"-0.07em\"},children:[textSizeSmall>0&&/*#__PURE__*/_jsx(\"style\",{children:`@media (max-width: 1199.98px) { .${cls} { font-size: ${textSizeSmall}px !important; } }`}),prefixText&&/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:prefixFont?.fontFamily,fontWeight:prefixFont?.fontWeight,color:prefixColor},children:prefixText}),/*#__PURE__*/_jsx(\"span\",{children:format(count)}),suffixText&&/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:suffixFont?.fontFamily,fontWeight:suffixFont?.fontWeight,color:suffixColor},children:suffixText})]});}addPropertyControls(Counter,{startOnViewport:{type:ControlType.Boolean,title:\"Viewport\",defaultValue:false},restartOnViewport:{type:ControlType.Boolean,title:\"Replay\",defaultValue:false},textSize:{title:\"Font Size\",type:ControlType.Number,min:8,max:240,step:1},textSizeSmall:{title:\"Font Size < 1200px\",type:ControlType.Number,min:0,max:240,step:1,defaultValue:0,description:\"0 = same as Font Size\"},textColor:{type:ControlType.Color,title:\"Font Color\"},start:{type:ControlType.Number,title:\"Start Number\",defaultValue:0},end:{type:ControlType.Number,title:\"End Number\",defaultValue:10},decimalSeparatorType:{type:ControlType.Enum,title:\"Separator\",defaultValue:\"comma\",options:[\"comma\",\"period\",\"none\"]},incrementType:{type:ControlType.Enum,title:\"Increment Type\",defaultValue:\"integer\",options:[\"integer\",\"decimal\"]},prefixText:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},prefixFont:{title:\"Prefix Font\",type:ControlType.Font},prefixColor:{type:ControlType.Color,title:\"Prefix Color\"},suffixText:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},suffixFont:{title:\"Suffix Font\",type:ControlType.Font},suffixColor:{type:ControlType.Color,title:\"Suffix Color\"},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:4,min:0,max:100},speed:{type:ControlType.Number,title:\"Speed (ms)\",defaultValue:100,min:0,max:2e3},loop:{type:ControlType.Boolean,title:\"Loop Animation\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter_SSR.map"],"mappings":"A,uQAU6R,SAASmB,GAAe,CAAC,GAAUZ,IAAS,OAAY,MAAO,GAAK,IAAMa,EAAOb,EAAO,YAAYA,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAcc,EAAQjB,EAAU,WAAW,iEAAiE,KAAKA,EAAU,SAAS,EAAE,OAAOgB,GAAQC,CAAQ,CAGjlB,SAAwBC,EAAQ,CAAC,QAAM,EAAE,MAAI,IAAI,QAAM,IAAI,UAAQ,EAAE,aAAW,GAAG,aAAW,GAAG,aAAW,aAAW,cAAY,cAAY,OAAK,GAAM,uBAAqB,QAAQ,WAAS,GAGnM,gBAAc,EAAE,YAAU,UAAU,kBAAgB,GAAM,oBAAkB,GAAM,gBAAc,WAAW,CAC3G,GAAK,CAACC,EAAMC,GAAUxB,EAASyB,CAAG,EAAO,CAACC,EAAOC,GAAW3B,EAAS,EAAK,EAAO,CAAC4B,EAAQC,GAAY7B,EAAS,EAAK,EAAQ8B,EAAQ7B,EAAO,EAAK,EAAQ8B,EAAI9B,EAAO,IAAI,EAAQ+B,EAAI,QAAQ9B,EAAM,CAAC,CAAC,QAAQ,kBAAkB,EAAE,EAGub,OAHrbM,MAAc,CAAC,IAAMyB,EAAGF,EAAI,QAAQ,GAAG,CAACE,GAAI,OAAO,qBAAuB,IAAY,OAAO,IAAMC,EAAG,IAAI,sBAAsB,CAACC,KAASR,EAAUQ,EAAM,cAAc,CAAC,EAAiB,OA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