{"version":3,"file":"ExploreButton.j5TQU9sn.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/RhCDH73y34fXYURuxaFm/j45LX6uW1ytN8lgBslxp/ExploreButton.js"],"sourcesContent":["// Single button labeled \"EXPLORE ROLES\" with a separate downward arrow icon (↓) to the right.\n// White background, black monospace uppercase text, sharp rectangular corners (border-radius: 0).\n// Font family and padding are editable props, letter-spacing: 0.15em.\n// The text \"EXPLORE ROLES\" and the arrow icon are separate elements with justify-content: space-between layout.\n// Arrow is an icon component, not part of the text string.\n// Background color: white (#FFFFFF), text color: black (#000000).\n// On hover, only the text \"EXPLORE ROLES\" scrambles into random uppercase letters and numbers, each character randomizes independently, resolves back left to right over 400ms.\n// Arrow icon does not animate, stays in place. No color change during scramble. Background stays white.\n// On hover leave — text instantly snaps back to normal.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const CHARS=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function ExploreButton(props){const{font,paddingHorizontal,paddingVertical,backgroundColor,borderColor,borderWidth,textColor,width,label,iconSize,scrambleDuration,scrambleEasing,textTransform,link,arrowDirection,openInNewTab}=props;const[displayText,setDisplayText]=useState(label);const[isHovering,setIsHovering]=useState(false);const animationRef=useRef(null);const startTimeRef=useRef(0);useEffect(()=>{if(!isHovering){if(animationRef.current!==null){cancelAnimationFrame(animationRef.current);animationRef.current=null;}startTransition(()=>setDisplayText(label));return;}startTimeRef.current=Date.now();const applyEasing=t=>{switch(scrambleEasing){case\"linear\":return t;case\"ease-in\":return t*t;case\"ease-out\":return t*(2-t);case\"ease-in-out\":return t<.5?2*t*t:-1+(4-2*t)*t;default:return t;}};const animate=()=>{const elapsed=Date.now()-startTimeRef.current;const progress=Math.min(elapsed/scrambleDuration,1);const easedProgress=applyEasing(progress);const newText=label.split(\"\").map((char,index)=>{if(char===\" \")return\" \";const charProgress=Math.max(0,(easedProgress*label.length-index)/label.length);if(charProgress>=1){return char;}return CHARS[Math.floor(Math.random()*CHARS.length)];}).join(\"\");startTransition(()=>setDisplayText(newText));if(progress<1){animationRef.current=requestAnimationFrame(animate);}else{startTransition(()=>setDisplayText(label));}};animationRef.current=requestAnimationFrame(animate);return()=>{if(animationRef.current!==null){cancelAnimationFrame(animationRef.current);}};},[isHovering,label,scrambleDuration,scrambleEasing]);const handleMouseEnter=()=>{startTransition(()=>setIsHovering(true));};const handleMouseLeave=()=>{startTransition(()=>setIsHovering(false));};const arrowIcons={left:\"←\",right:\"→\",top:\"↑\",bottom:\"↓\"};return /*#__PURE__*/_jsxs(\"button\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:24,backgroundColor:backgroundColor,...font,paddingLeft:paddingHorizontal,paddingRight:paddingHorizontal,paddingTop:paddingVertical,paddingBottom:paddingVertical,borderRadius:0,border:`${borderWidth}px solid ${borderColor}`,cursor:\"pointer\",outline:\"none\",position:\"relative\",width:\"100%\",height:\"100%\"},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onClick:e=>{if(link){e.preventDefault();window.open(link,openInNewTab?\"_blank\":\"_self\");}},children:[/*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:\"nowrap\",color:textColor,textTransform:textTransform},children:displayText}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,fontSize:iconSize},children:arrowIcons[arrowDirection]})]});}addPropertyControls(ExploreButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"EXPLORE ROLES\"},link:{type:ControlType.Link,title:\"Link\"},openInNewTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\",hidden:({link})=>!link},arrowDirection:{type:ControlType.Enum,title:\"Arrow Direction\",options:[\"left\",\"right\",\"top\",\"bottom\"],optionTitles:[\"Left\",\"Right\",\"Top\",\"Bottom\"],defaultValue:\"bottom\",displaySegmentedControl:true},textTransform:{type:ControlType.Enum,title:\"Text Transform\",options:[\"uppercase\",\"lowercase\",\"capitalize\",\"none\"],optionTitles:[\"Uppercase\",\"Lowercase\",\"Capitalize\",\"None\"],defaultValue:\"none\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:300,min:100,max:800,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Regular\",letterSpacing:\"0.15em\",lineHeight:\"1.2em\"}},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:8,max:48,step:1,unit:\"px\"},scrambleDuration:{type:ControlType.Number,title:\"Scramble Duration\",defaultValue:400,min:100,max:2e3,step:50,unit:\"ms\"},scrambleEasing:{type:ControlType.Enum,title:\"Scramble Easing\",options:[\"linear\",\"ease-in\",\"ease-out\",\"ease-in-out\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\"],defaultValue:\"ease-out\"},paddingHorizontal:{type:ControlType.Number,title:\"Padding X\",defaultValue:32,min:0,max:100,step:1,unit:\"px\"},paddingVertical:{type:ControlType.Number,title:\"Padding Y\",defaultValue:16,min:0,max:100,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"transparent\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:0,min:0,max:10,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ExploreButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWid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