{"version":3,"file":"MonocoEmailCapture.TygoHdnn.mjs","names":["useState","err"],"sources":["https:/framerusercontent.com/modules/9Dt5oq1DW7MtejnHHmoO/45ncXq7aV1HNyKFdkQ9P/yR_bZvNBa.js","https:/framerusercontent.com/modules/Kop1GTQs6ZLBxiBaCstQ/65qrK5nfUbY01ld565zk/MonocoEmailCapture.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 12 0 L 0 12 M 0 0 L 12 12\" fill=\"transparent\" height=\"12px\" id=\"zTcUwufHc\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--1df8v9o, rgb(0,0,0))\" transform=\"translate(6 6)\" width=\"12px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,n2nHSaXfp:stroke??props.n2nHSaXfp??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,n2nHSaXfp,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-h7vLl\",className),layoutId:layoutId,ref:ref,style:{\"--1df8v9o\":n2nHSaXfp,...style}});});const css=[`.framer-h7vLl { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--1df8v9o); 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 {\"n2nHSaXfp\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Xmark\",\"color\":{\"type\":\"variable\",\"value\":\"1df8v9o\"},\"set\":{\"localId\":\"vectorSet/yXo17f3GZ\",\"id\":\"yXo17f3GZ\",\"moduleId\":\"eO37kitVCMcNEgHMGd3K\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-h7vLl\");Icon.displayName=\"Xmark\";export default Icon;addPropertyControls(Icon,{n2nHSaXfp:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Xmark\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1df8v9o\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/yXo17f3GZ\\\",\\\"id\\\":\\\"yXo17f3GZ\\\",\\\"moduleId\\\":\\\"eO37kitVCMcNEgHMGd3K\\\"}}\",\"framerVariables\":\"{\\\"n2nHSaXfp\\\":\\\"stroke\\\"}\",\"framerImmutableVariables\":\"true\",\"framerIntrinsicHeight\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";const KIT_API_KEY=\"dG7b_NpNEzEt-p1k0mt1VQ\";const KIT_FORM_ID=\"9408237\";export default function MonocoEmailCapture({apiKey=KIT_API_KEY,formId=KIT_FORM_ID}){const[firstName,setFirstName]=useState(\"\");const[email,setEmail]=useState(\"\");const[emailError,setEmailError]=useState(\"\");const[status,setStatus]=useState(\"idle\");const[errorMsg,setErrorMsg]=useState(\"\");const isDisabled=status===\"loading\";const inputStyle={width:\"100%\",height:40,background:\"rgba(59,59,59,0.75)\",border:\"1px solid #3B3B3B\",borderRadius:0,padding:\"0 12px\",color:\"#F5F5F5\",fontFamily:\"Inter, sans-serif\",fontSize:14,outline:\"none\",boxSizing:\"border-box\",transition:\"border-color 0.15s\"};const labelStyle={fontFamily:\"Inter, sans-serif\",fontWeight:500,fontSize:12,color:\"#ABABAB\",marginBottom:4,display:\"block\",letterSpacing:\"0.02em\"};const validateEmail=value=>{if(!value)return\"Email is required\";if(!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value))return\"Enter a valid email address\";return\"\";};const handleEmailBlur=()=>{setEmailError(validateEmail(email));};const handleSubmit=async()=>{const err=validateEmail(email);if(err){setEmailError(err);return;}setStatus(\"loading\");setErrorMsg(\"\");try{const res=await fetch(`https://api.convertkit.com/v3/forms/${formId}/subscribe`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({api_key:apiKey,email,first_name:firstName||undefined})});const data=await res.json();if(!res.ok||data.error){throw new Error(data.message||\"Subscription failed\");}setStatus(\"success\");}catch(err){setStatus(\"error\");setErrorMsg(err.message||\"Something went wrong\");}};// ── Success state ─────────────────────────────────────────────────────────\nif(status===\"success\"){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:8},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"'Bebas Neue', sans-serif\",fontSize:88,lineHeight:1,color:\"#F2B72E\",letterSpacing:\"0.01em\"},children:\"Done.\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:\"Inter, sans-serif\",fontSize:16,fontWeight:400,color:\"#ABABAB\",lineHeight:1.4},children:\"You'll hear from us.\"})]});}// ── Form state ────────────────────────────────────────────────────────────\nreturn /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:20,fontFamily:\"Inter, sans-serif\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\"},children:[/*#__PURE__*/_jsx(\"label\",{style:labelStyle,children:\"First Name\"}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",placeholder:\"Your Name\",value:firstName,onChange:e=>setFirstName(e.target.value),disabled:isDisabled,style:inputStyle,onFocus:e=>e.currentTarget.style.borderColor=\"rgba(245,245,245,0.35)\",onBlur:e=>e.currentTarget.style.borderColor=\"#3B3B3B\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\"},children:[/*#__PURE__*/_jsx(\"label\",{style:labelStyle,children:\"Email\"}),/*#__PURE__*/_jsx(\"input\",{type:\"email\",placeholder:\"your@name.com\",value:email,onChange:e=>{setEmail(e.target.value);if(emailError)setEmailError(\"\");},disabled:isDisabled,style:{...inputStyle,borderColor:emailError?\"#F2B72E\":\"#3B3B3B\"},onFocus:e=>e.currentTarget.style.borderColor=emailError?\"#F2B72E\":\"rgba(245,245,245,0.35)\",onBlur:e=>{handleEmailBlur();e.currentTarget.style.borderColor=emailError?\"#F2B72E\":\"#3B3B3B\";}}),emailError&&/*#__PURE__*/_jsx(\"div\",{style:{fontSize:11,color:\"#F2B72E\",fontFamily:\"Inter, sans-serif\",marginTop:5,letterSpacing:\"0.02em\"},children:emailError})]}),/*#__PURE__*/_jsx(\"button\",{onClick:handleSubmit,disabled:isDisabled||!email,style:{width:\"100%\",height:44,background:status===\"loading\"?\"#c49224\":!email?\"#8a6a1a\":\"#F2B72E\",color:\"#000000\",border:\"none\",borderRadius:0,fontFamily:\"Inter, sans-serif\",fontSize:14,fontWeight:600,cursor:isDisabled||!email?\"not-allowed\":\"pointer\",letterSpacing:\"0.02em\",transition:\"background 0.2s, color 0.2s\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8},onMouseEnter:e=>{if(status===\"idle\"&&email){e.currentTarget.style.background=\"#111111\";e.currentTarget.style.color=\"#F5F5F5\";}},onMouseLeave:e=>{e.currentTarget.style.background=status===\"loading\"?\"#c49224\":!email?\"#8a6a1a\":\"#F2B72E\";e.currentTarget.style.color=\"#000000\";},children:status===\"loading\"?/*#__PURE__*/_jsx(Spinner,{}):\"Join monoCO\"}),status===\"error\"&&/*#__PURE__*/_jsx(\"div\",{style:{fontSize:12,color:\"#F2B72E\",fontFamily:\"Inter, sans-serif\",marginTop:-8},children:errorMsg||\"Something went wrong. Please try again.\"})]});}function Spinner(){return /*#__PURE__*/_jsxs(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",style:{animation:\"monoco-spin 0.75s linear infinite\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes monoco-spin {\n                    from { transform: rotate(0deg); }\n                    to { transform: rotate(360deg); }\n                }\n            `}),/*#__PURE__*/_jsx(\"circle\",{cx:\"8\",cy:\"8\",r:\"6\",stroke:\"rgba(0,0,0,0.3)\",strokeWidth:\"2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M8 2a6 6 0 0 1 6 6\",stroke:\"#000\",strokeWidth:\"2\",strokeLinecap:\"round\"})]});}addPropertyControls(MonocoEmailCapture,{apiKey:{type:ControlType.String,title:\"Kit API Key\",defaultValue:KIT_API_KEY},formId:{type:ControlType.String,title:\"Kit Form ID\",defaultValue:KIT_FORM_ID}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MonocoEmailCapture\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MonocoEmailCapture.map"],"mappings":"uQAC2C,IAAsE,IAA4B,CAAoC,EAAK,ydAAie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