{"version":3,"file":"TypewriterText.C6qlRLPe.mjs","names":["React.useRef","React.useState","React.useId"],"sources":["https:/framerusercontent.com/modules/hBTxv4Qx9dHgX1BmFSxX/P2NcoV5qXEGUCAEmGoj6/TypewriterText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView}from\"framer-motion\";/**\n * Typewriter text with Framer-native typography controls.\n *\n * @framerIntrinsicWidth 520\n * @framerIntrinsicHeight 96\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function TypewriterText(props){const{text=\"Ideas become real, one character at a time.\",font={fontFamily:\"Inter\",fontSize:48,fontWeight:600,lineHeight:\"1.05em\",letterSpacing:\"-0.035em\",textAlign:\"left\"},color=\"#111111\",loop=true,trigger=\"inView\",viewportAmount=50,playOnce=true,typingSpeed=70,deletingSpeed=38,startDelay=300,holdDuration=1200,showCursor=true,cursorStyle=\"bar\",cursorColor=\"#111111\",cursorBlink=true,blinkSpeed=700,wrap=true,style}=props;const rootRef=React.useRef(null);const isStatic=useIsStaticRenderer();const isInView=useInView(rootRef,{once:playOnce,amount:Math.max(.05,Math.min(1,viewportAmount/100))});const shouldPlay=trigger===\"load\"||isInView;const[displayedText,setDisplayedText]=React.useState(text);const id=React.useId().replace(/:/g,\"\");const blinkName=`typewriterBlink${id}`;React.useEffect(()=>{if(isStatic||typeof window===\"undefined\"){setDisplayedText(text);return;}if(!shouldPlay){setDisplayedText(\"\");return;}let timer;let cancelled=false;const safeTypingSpeed=Math.max(8,typingSpeed);const safeDeletingSpeed=Math.max(8,deletingSpeed);const schedule=(callback,delay)=>{timer=window.setTimeout(()=>{if(!cancelled)callback();},Math.max(0,delay));};const typeCharacter=index=>{React.startTransition(()=>setDisplayedText(text.slice(0,index)));if(index<text.length){schedule(()=>typeCharacter(index+1),safeTypingSpeed);return;}if(loop)schedule(()=>deleteCharacter(text.length),holdDuration);};const deleteCharacter=index=>{React.startTransition(()=>setDisplayedText(text.slice(0,index)));if(index>0){schedule(()=>deleteCharacter(index-1),safeDeletingSpeed);}else{schedule(()=>typeCharacter(1),startDelay);}};React.startTransition(()=>setDisplayedText(\"\"));schedule(()=>typeCharacter(1),startDelay);return()=>{cancelled=true;if(timer!==undefined)window.clearTimeout(timer);};},[text,loop,typingSpeed,deletingSpeed,startDelay,holdDuration,isStatic,shouldPlay]);const alignment=font.textAlign||\"left\";const justifyContent=alignment===\"center\"?\"center\":alignment===\"right\"?\"flex-end\":\"flex-start\";const cursorShape=cursorStyle===\"block\"?{width:\"0.58em\",height:\"1em\",background:cursorColor,opacity:.3}:cursorStyle===\"underscore\"?{width:\"0.58em\",height:\"0.075em\",marginTop:\"0.86em\",background:cursorColor}:{width:\"0.075em\",height:\"1em\",background:cursorColor};return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,role:\"text\",\"aria-label\":text,style:{...style,...font,position:\"relative\",width:\"100%\",height:\"100%\",minWidth:1,display:\"flex\",alignItems:\"center\",justifyContent,overflow:\"hidden\",color},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes ${blinkName} {\n                    0%, 46% { opacity: 1; }\n                    47%, 100% { opacity: 0; }\n                }\n            `}),/*#__PURE__*/_jsxs(\"span\",{\"aria-hidden\":\"true\",style:{display:\"inline-flex\",alignItems:\"baseline\",maxWidth:\"100%\",whiteSpace:wrap?\"pre-wrap\":\"pre\",overflowWrap:wrap?\"anywhere\":\"normal\"},children:[/*#__PURE__*/_jsx(\"span\",{children:displayedText}),showCursor&&/*#__PURE__*/_jsx(\"span\",{style:{...cursorShape,display:\"inline-block\",flex:\"0 0 auto\",marginLeft:\"0.08em\",animation:cursorBlink&&!isStatic?`${blinkName} ${Math.max(200,blinkSpeed)}ms steps(1, end) infinite`:\"none\"}})]})]});}addPropertyControls(TypewriterText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Ideas become real, one character at a time.\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true,defaultValue:{variant:\"Semibold\",fontSize:\"48px\",lineHeight:\"1.05em\",letterSpacing:\"-0.035em\",textAlign:\"left\"}},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#111111\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true},trigger:{type:ControlType.Enum,title:\"Animation Trigger\",defaultValue:\"inView\",options:[\"load\",\"inView\"],optionTitles:[\"Page Load\",\"Component In View\"],displaySegmentedControl:true},viewportAmount:{type:ControlType.Number,title:\"Visible Amount\",defaultValue:50,min:5,max:100,step:5,unit:\"%\",hidden:({trigger})=>trigger!==\"inView\"},playOnce:{type:ControlType.Boolean,title:\"Play Once\",defaultValue:true,hidden:({trigger})=>trigger!==\"inView\"},typingSpeed:{type:ControlType.Number,title:\"Type Speed\",defaultValue:70,min:8,max:500,step:1,unit:\"ms\"},deletingSpeed:{type:ControlType.Number,title:\"Delete Speed\",defaultValue:38,min:8,max:500,step:1,unit:\"ms\",hidden:({loop})=>!loop},startDelay:{type:ControlType.Number,title:\"Animation Delay\",defaultValue:300,min:0,max:5e3,step:50,unit:\"ms\"},holdDuration:{type:ControlType.Number,title:\"Hold Time\",defaultValue:1200,min:0,max:1e4,step:100,unit:\"ms\",hidden:({loop})=>!loop},wrap:{type:ControlType.Boolean,title:\"Text Wrap\",defaultValue:true},showCursor:{type:ControlType.Boolean,title:\"Cursor\",defaultValue:true},cursorStyle:{type:ControlType.Enum,title:\"Cursor Style\",defaultValue:\"bar\",options:[\"bar\",\"block\",\"underscore\"],optionTitles:[\"Bar\",\"Block\",\"Underscore\"],displaySegmentedControl:true,hidden:({showCursor})=>!showCursor},cursorColor:{type:ControlType.Color,title:\"Cursor Color\",defaultValue:\"#111111\",hidden:({showCursor})=>!showCursor},cursorBlink:{type:ControlType.Boolean,title:\"Blink\",defaultValue:true,hidden:({showCursor})=>!showCursor},blinkSpeed:{type:ControlType.Number,title:\"Blink Speed\",defaultValue:700,min:200,max:2e3,step:50,unit:\"ms\",hidden:({showCursor,cursorBlink})=>!showCursor||cursorBlink!==true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypewriterText\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"96\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"520\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypewriterText.map"],"mappings":"oRAOG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,OAAK,8CAA8C,OAAK,CAAC,WAAW,QAAQ,SAAS,GAAG,WAAW,IAAI,WAAW,SAAS,cAAc,WAAW,UAAU,MAAM,EAAE,QAAM,UAAU,OAAK,GAAK,UAAQ,SAAS,iBAAe,GAAG,WAAS,GAAK,cAAY,GAAG,gBAAc,GAAG,aAAW,IAAI,eAAa,KAAK,aAAW,GAAK,cAAY,MAAM,cAAY,UAAU,cAAY,GAAK,aAAW,IAAI,OAAK,GAAK,SAAO,EAAY,EAAQA,EAAa,IAAI,EAAQ,EAAS,EAAoB,EAAQ,EAAS,EAAU,EAAQ,CAAC,KAAK,EAAS,OAAO,KAAK,IAAI,IAAI,KAAK,IAAI,EAAE,EAAe,GAAG,CAAC,CAAC,CAAC,EAAQ,EAAW,IAAU,QAAQ,EAAc,CAAC,EAAc,GAAkBC,EAAe,CAAI,EAAgD,EAAU,kBAA/CC,EAAY,CAAC,CAAC,QAAQ,KAAK,EAAuC,IAAI,MAAoB,CAAC,GAAG,GAAiB,IAAS,OAAY,CAAC,EAAiB,CAAI,EAAE,MAAO,CAAC,GAAG,CAAC,EAAW,CAAC,EAAiB,EAAE,EAAE,MAAO,CAAC,IAAI,EAAU,EAAU,GAAY,EAAgB,KAA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