{"version":3,"file":"Text_stagger.YIfClYOK.mjs","names":["useState","useRef","React","useMemo","_Fragment","l"],"sources":["https:/framerusercontent.com/modules/sPPEJJGDR4eUvdon1Bel/f3XESni8XlI3ypQ6Exdb/HbzxRJMyi.js","https:/framerusercontent.com/modules/dq5xBN8R92Qi8X9VIQnq/dTzpGzhIwaNgGBXTf2IO/Text_stagger.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 1.5 16.5 C 0.672 16.5 0 15.828 0 15 L 0 1.5 C 0 0.672 0.672 0 1.5 0 L 15 0 C 15.828 0 16.5 0.672 16.5 1.5 L 16.5 15 C 16.5 15.828 15.828 16.5 15 16.5 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"16.5px\" id=\"qUr6K2nJv\" transform=\"translate(3.75 3.75)\" width=\"16.5px\"/><path d=\"M 0 0 L 16.5 0\" fill=\"transparent\" height=\"1px\" id=\"MbfmAbWGf\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(3.75 12)\" width=\"16.5px\"/><path d=\"M 0 0 L 0 16.5\" fill=\"transparent\" height=\"16.5px\" id=\"mcA57vhod\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(12 3.75)\" width=\"1px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"465907804\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-ohg0r\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-ohg0r { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Plus\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-ohg0r\");Icon.displayName=\"Plus\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"true\",\"framerIntrinsicHeight\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVector\":\"{\\\"name\\\":\\\"Plus\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerImmutableVariables\":\"true\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Text stagger per line animation, editable text, BDO Grotesk font (simulated with sans-serif), variable setting\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useMemo,useState,startTransition,useRef,useLayoutEffect}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useAnimationControls,useInView}from\"framer-motion\";import React from\"react\";/**\n * Staggered text per line with editable text, BDO Grotesk (sans-serif), and variable toggle\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function TextStagger(props){const{text,delay,duration,font,color,variable,style,trigger=\"inView\",halfOpacity=false}=props;const[hasAnimated,setHasAnimated]=useState(false);const[clicked,setClicked]=useState(false);const isStatic=useIsStaticRenderer();const[wrappedLines,setWrappedLines]=useState([]);const measureRef=useRef(null);const controls=useAnimationControls();// Use useRef, not useState for a DOM ref\nconst containerRef=React.useRef(null);const inView=useInView(containerRef);// Measure actual rendered lines including auto-wrap\nuseLayoutEffect(()=>{if(!measureRef.current||typeof window===\"undefined\")return;const measureLines=()=>{const element=measureRef.current;if(!element)return;const range=document.createRange();const textNode=element.firstChild;if(!textNode||textNode.nodeType!==Node.TEXT_NODE)return;const lines=[];const fullText=text||\"\";let currentLine=\"\";let lastBottom=-1;// Measure character by character to detect line breaks\nfor(let i=0;i<fullText.length;i++){range.setStart(textNode,0);range.setEnd(textNode,i+1);const rect=range.getBoundingClientRect();if(lastBottom===-1){lastBottom=rect.bottom;}// New line detected\nif(rect.bottom>lastBottom+2){lines.push(currentLine);currentLine=fullText[i];lastBottom=rect.bottom;}else{currentLine+=fullText[i];}}// Push the last line\nif(currentLine){lines.push(currentLine);}setWrappedLines(lines.length>0?lines:[fullText]);};measureLines();window.addEventListener(\"resize\",measureLines);return()=>window.removeEventListener(\"resize\",measureLines);},[text,font,style]);// Determine whether to fire animation trigger\nconst shouldAnimate=useMemo(()=>{if(isStatic)return false;if(trigger===\"inView\")return inView;if(trigger===\"hover\")return hasAnimated;if(trigger===\"click\")return clicked;return false;},[isStatic,inView,hasAnimated,clicked,trigger]);useEffect(()=>{if(!isStatic&&shouldAnimate){if(!hasAnimated){controls.start(i=>({y:0,transition:{delay:i*delay,duration,ease:[.44,0,.34,.98]}}));setHasAnimated(true);}}},[controls,delay,duration,isStatic,hasAnimated,shouldAnimate]);// Simulate BDO Grotesk with sans-serif; for real, user must select it on font control if installed\nconst fontFamily=font&&font.fontFamily||\"'BDO Grotesk', 'Inter', 'Helvetica Neue', Arial, sans-serif\";// Event handlers for hover/click triggers\nconst handleMouseEnter=()=>{if(trigger===\"hover\"&&!hasAnimated)startTransition(()=>setHasAnimated(true));};const handleClick=()=>{if(trigger===\"click\"&&!clicked)startTransition(()=>setClicked(true));};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{ref:measureRef,style:{position:\"absolute\",visibility:\"hidden\",pointerEvents:\"none\",whiteSpace:\"pre-wrap\",...font,fontFamily,width:style?.width||\"100%\"},\"aria-hidden\":\"true\",children:text}),/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",color,...font,fontFamily},onMouseEnter:trigger===\"hover\"?handleMouseEnter:undefined,onClick:trigger===\"click\"?handleClick:undefined,children:wrappedLines.map((line,i)=>{// Calculate cumulative character count up to this line\nconst charCountBeforeLine=wrappedLines.slice(0,i).reduce((sum,l)=>sum+l.length,0);const totalChars=text.length;const halfPoint=totalChars/2;// Determine if this line is in the second half\nconst lineOpacity=halfOpacity&&charCountBeforeLine>=halfPoint?.5:1;return /*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",overflow:\"hidden\",width:\"100%\",marginBottom:0,lineHeight:font.lineHeight||1.2},children:/*#__PURE__*/_jsx(motion.span,{custom:i,initial:isStatic?{y:0}:{y:70},animate:isStatic?undefined:controls,style:{display:\"inline-block\",whiteSpace:\"pre-wrap\",...font,fontFamily,color,opacity:lineOpacity,fontVariationSettings:variable?'\"wght\" 700':'\"wght\" 500',fontWeight:variable?700:500,WebkitClipPath:\"inset(0 0 0 0)\",clipPath:\"inset(0 0 0 0)\",willChange:\"transform\",lineHeight:font.lineHeight||1.2},children:line||\" \"})},i);})})]});}addPropertyControls(TextStagger,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Editable\\nStaggered\\nText\",displayTextArea:true,placeholder:\"Type your text...\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:.08,min:.01,max:1,step:.01,unit:\"s\"},duration:{type:ControlType.Number,title:\"Dur. per line\",defaultValue:.5,min:.05,max:2,step:.01,unit:\"s\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:40,lineHeight:\"1em\",letterSpacing:\"-0.02em\",variant:\"Regular\",textAlign:\"left\"}},variable:{type:ControlType.Boolean,title:\"Variable Weight\",defaultValue:false,enabledTitle:\"Bold\",disabledTitle:\"Regular\"},trigger:{type:ControlType.Enum,title:\"Trigger\",options:[\"inView\",\"hover\",\"click\"],optionTitles:[\"When in view\",\"On hover\",\"On click\"],defaultValue:\"inView\",displaySegmentedControl:true},halfOpacity:{type:ControlType.Boolean,title:\"Half Opacity\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextStagger\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_stagger.map"],"mappings":"sXAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,m6BAAy6B,GAAU,CAAC,QAAM,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,U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