{"version":3,"file":"WebformButton.ZlbTocct.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/MbQ9UyvawXHSJN8mprfX/gn5Ogdeun6pkAVpdtbb2/WebformButton.js"],"sourcesContent":["// Rounded rectangle orange button that says 'Or click here to use our webform', scales up on hover, and can redirect to another part of the same page\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useInView}from\"framer-motion\";import{useRef,useState,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function WebformButton(props){const{label,backgroundColor,textColor,borderRadius,targetId,scaleAmount,font,padding,marginBottom,marginTop}=props;const ref=useRef(null);const isInView=useInView(ref,{once:true,amount:.3});const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"){const checkMobile=()=>{setIsMobile(window.innerWidth<=768);};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);}},[]);const handleClick=()=>{if(typeof window!==\"undefined\"&&targetId){const element=document.getElementById(targetId);if(element){element.scrollIntoView({behavior:\"smooth\",block:\"start\"});}}};return /*#__PURE__*/_jsx(motion.button,{ref:ref,style:{backgroundColor,color:textColor,borderRadius,padding,border:\"none\",cursor:\"pointer\",width:\"max-content\",marginBottom:`${marginBottom}px`,marginTop:isMobile?\"0px\":`${marginTop}px`,...font},initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.6,ease:\"easeOut\",scale:{duration:.2}},whileHover:{scale:scaleAmount},onClick:handleClick,children:label});}addPropertyControls(WebformButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Or click here to use our webform\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F59D18\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:100,step:1,unit:\"px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"11px 32px 11px 32px\"},marginTop:{type:ControlType.Number,title:\"Gap Above\",defaultValue:0,min:0,max:500,step:1,unit:\"px\"},marginBottom:{type:ControlType.Number,title:\"Gap Below\",defaultValue:100,min:0,max:500,step:1,unit:\"px\"},targetId:{type:ControlType.String,title:\"Target ID\",defaultValue:\"webform-section\",placeholder:\"Enter element ID\"},scaleAmount:{type:ControlType.Number,title:\"Hover Scale\",defaultValue:1.05,min:1,max:1.3,step:.01},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WebformButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WebformButton.map"],"mappings":"yPAIG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,kBAAgB,YAAU,eAAa,WAAS,cAAY,OAAK,UAAQ,eAAa,aAAW,EAAY,EAAIA,EAAO,KAAK,CAAgB,EAAU,EAAI,CAAC,KAAK,GAAK,OAAO,GAAG,CAAC,CAAC,GAAK,CAAC,EAAS,GAAaC,EAAS,GAAM,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,MAAgB,CAAC,EAAY,EAAO,YAAY,IAAI,EAA+D,OAA5D,GAAa,CAAC,EAAO,iBAAiB,SAAS,EAAY,KAAW,EAAO,oBAAoB,SAAS,EAAY,GAAI,EAAE,CAAC,CAAC,IAAM,MAAgB,CAAC,GAAU,IAAS,QAAa,EAAS,CAAC,IAAM,EAAQ,SAAS,eAAe,EAAS,CAAI,GAAS,EAAQ,eAAe,CAAC,SAAS,SAAS,MAAM,Q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