{"version":3,"file":"Typewriter.DKxtDtAw.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/ys7nLrUA0mMg4Oj9VQTg/Fi1mBj83EPheAFJT4h1g/Typewriter.js"],"sourcesContent":["// Typewriter effect component that types out \"Health is data.\"\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Typewriter Effect\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Typewriter(props){const{text,speed,loop,showCursor,cursorColor,textColor,font,initialDelay,style}=props;const[displayText,setDisplayText]=useState(\"\");const[currentIndex,setCurrentIndex]=useState(0);const[isDeleting,setIsDeleting]=useState(false);const[hasStarted,setHasStarted]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"){startTransition(()=>setDisplayText(text));return;}const delayTimeout=window.setTimeout(()=>{startTransition(()=>setHasStarted(true));},initialDelay);return()=>{window.clearTimeout(delayTimeout);};},[initialDelay]);useEffect(()=>{if(typeof window===\"undefined\"){startTransition(()=>setDisplayText(text));return;}if(!hasStarted)return;let timeout;if(!isDeleting&&currentIndex<text.length){timeout=window.setTimeout(()=>{startTransition(()=>{setDisplayText(text.slice(0,currentIndex+1));setCurrentIndex(currentIndex+1);});},speed);}else if(isDeleting&&currentIndex>0){timeout=window.setTimeout(()=>{startTransition(()=>{setDisplayText(text.slice(0,currentIndex-1));setCurrentIndex(currentIndex-1);});},speed/2);}else if(!isDeleting&&currentIndex===text.length&&loop){timeout=window.setTimeout(()=>{startTransition(()=>setIsDeleting(true));},1e3);}else if(isDeleting&&currentIndex===0&&loop){startTransition(()=>setIsDeleting(false));}return()=>{if(timeout)window.clearTimeout(timeout);};},[currentIndex,isDeleting,text,speed,loop,hasStarted]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",width:\"max-content\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font},children:displayText}),showCursor&&/*#__PURE__*/_jsx(\"span\",{style:{marginLeft:\"2px\",color:cursorColor,animation:\"blink 1s step-end infinite\",...font},children:\"|\"}),/*#__PURE__*/_jsx(\"style\",{children:`\n                    @keyframes blink {\n                        0%, 100% { opacity: 1; }\n                        50% { opacity: 0; }\n                    }\n                `})]});}addPropertyControls(Typewriter,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Help Millions.\"},initialDelay:{type:ControlType.Number,title:\"Initial Delay\",defaultValue:1e3,min:0,max:5e3,step:100,unit:\"ms\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:100,min:10,max:500,step:10,unit:\"ms\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},showCursor:{type:ControlType.Boolean,title:\"Cursor\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},cursorColor:{type:ControlType.Color,title:\"Cursor Color\",defaultValue:\"#000000\",hidden:({showCursor})=>!showCursor},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Typewriter\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Typewriter.map"],"mappings":"6MASG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,OAAK,aAAW,cAAY,YAAU,OAAK,eAAa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