{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/vC11UKduWgDlJtO0BLUA/xHwV2ADYcKDklPgVjbka/FormSpark_Business.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useCallback}from\"react\";import{motion}from\"framer-motion\";export function StyledCategoryForm({formId,withName,withEmail,withMessage,namePlaceholder,emailPlaceholder,messagePlaceholder,useFourCategories,categoriesThree,categoriesFour,layout,inputs,button,font,padding,radius,gap,onSubmit}){const[name,setName]=useState(\"\");const[email,setEmail]=useState(\"\");const[message,setMessage]=useState(\"\");const[category,setCategory]=useState(\"\");const[isLoading,setLoading]=useState(false);const[isSuccess,setSuccess]=useState(false);const categories=useFourCategories?categoriesFour:categoriesThree;const handleSubmit=useCallback(async event=>{event.preventDefault();setLoading(true);const formData={name,email,message,category};try{const response=await fetch(`https://api.formspark.io/${formId}`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify(formData)});if(response.ok){setSuccess(true);setLoading(false);onSubmit===null||onSubmit===void 0?void 0:onSubmit();}else{setLoading(false);alert(\"Form submission failed.\");}}catch(error){console.error(\"Error submitting form:\",error);setLoading(false);}},[formId,name,email,message,category,onSubmit]);const formStyle={display:\"grid\",gridAutoFlow:layout===\"horizontal\"?\"column\":\"row\",gap:`${gap}px`,width:\"100%\"};const inputStyle={padding:`${padding}px`,borderRadius:`${radius}px`,fontFamily:font.family,fontSize:`${font.size}px`,fontWeight:font.weight,background:inputs.fill,color:inputs.color,border:`1px solid ${inputs.borderColor}`,boxShadow:\"none\",outline:\"none\"};return /*#__PURE__*/_jsx(motion.div,{style:{display:\"grid\",gap:`${gap}px`},children:isSuccess?/*#__PURE__*/_jsx(motion.div,{style:{height:\"60px\",width:\"60px\",background:button.fill,color:button.textColor,borderRadius:\"50%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",margin:\"0 auto\"},initial:{scale:0},animate:{scale:1},transition:{duration:.3},children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",width:\"28\",height:\"28\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M 2 14 L 10 22 L 26 6\",fill:\"transparent\",strokeWidth:\"4\",stroke:\"currentColor\",strokeLinecap:\"round\"})})}):/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:formStyle,children:[/*#__PURE__*/_jsxs(\"select\",{value:category,onChange:e=>setCategory(e.target.value),style:{...inputStyle,fontFamily:font.family,fontSize:`${font.size}px`},required:true,children:[/*#__PURE__*/_jsx(\"option\",{value:\"\",disabled:true,children:\"W\\xe4hle eine Kategorie\"}),categories.map((cat,index)=>/*#__PURE__*/_jsx(\"option\",{value:cat,children:cat},index))]}),withName&&/*#__PURE__*/_jsx(\"input\",{type:\"text\",placeholder:namePlaceholder,value:name,onChange:e=>setName(e.target.value),style:inputStyle}),withEmail&&/*#__PURE__*/_jsx(\"input\",{type:\"email\",placeholder:emailPlaceholder,value:email,onChange:e=>setEmail(e.target.value),style:inputStyle}),withMessage&&/*#__PURE__*/_jsx(\"textarea\",{placeholder:messagePlaceholder,value:message,onChange:e=>setMessage(e.target.value),style:{...inputStyle,resize:\"vertical\"}}),/*#__PURE__*/_jsx(motion.button,{type:\"submit\",style:{...inputStyle,fontWeight:button.fontWeight,background:button.fill,color:button.textColor,cursor:\"pointer\",textAlign:\"center\"},whileHover:{opacity:.8},disabled:isLoading,children:button.label})]})});}addPropertyControls(StyledCategoryForm,{formId:{title:\"Form ID\",type:ControlType.String,defaultValue:\"\"},withName:{title:\"Name Field\",type:ControlType.Boolean,defaultValue:true},namePlaceholder:{title:\"Name Placeholder\",type:ControlType.String,defaultValue:\"Benutzername\",hidden:props=>!props.withName},withEmail:{title:\"Email Field\",type:ControlType.Boolean,defaultValue:true},emailPlaceholder:{title:\"Email Placeholder\",type:ControlType.String,defaultValue:\"Email Adresse\",hidden:props=>!props.withEmail},withMessage:{title:\"Message Field\",type:ControlType.Boolean,defaultValue:true},messagePlaceholder:{title:\"Message Placeholder\",type:ControlType.String,defaultValue:\"Nachricht\",hidden:props=>!props.withMessage},useFourCategories:{title:\"Use 4 Categories\",type:ControlType.Boolean,defaultValue:false},categoriesThree:{title:\"3 Categories\",type:ControlType.Array,propertyControl:{type:ControlType.String},defaultValue:[\"Kategorie 1\",\"Kategorie 2\",\"Kategorie 3\"]},categoriesFour:{title:\"4 Categories\",type:ControlType.Array,propertyControl:{type:ControlType.String},defaultValue:[\"Kategorie 1\",\"Kategorie 2\",\"Kategorie 3\",\"Kategorie 4\"]},layout:{title:\"Layout\",type:ControlType.Enum,options:[\"horizontal\",\"vertical\"],defaultValue:\"vertical\"},inputs:{title:\"Input Styles\",type:ControlType.Object,controls:{fill:{title:\"Background\",type:ControlType.Color,defaultValue:\"#EBEBEB\"},color:{title:\"Text\",type:ControlType.Color,defaultValue:\"#000\"},borderColor:{title:\"Border\",type:ControlType.Color,defaultValue:\"#CCCCCC\"},placeholderColor:{title:\"Placeholder\",type:ControlType.Color,defaultValue:\"rgba(0, 0, 0, 0.5)\"},errorColor:{title:\"Error\",type:ControlType.Color,defaultValue:\"#EE4444\"}}},button:{title:\"Button Styles\",type:ControlType.Object,controls:{label:{title:\"Label\",type:ControlType.String,defaultValue:\"Senden\"},fontWeight:{title:\"Font Weight\",type:ControlType.Number,defaultValue:600},fill:{title:\"Background\",type:ControlType.Color,defaultValue:\"#007BFF\"},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#FFF\"}}},font:{title:\"Font Styles\",type:ControlType.Object,controls:{family:{title:\"Font Family\",type:ControlType.String,defaultValue:\"Arial\"},size:{title:\"Font Size\",type:ControlType.Number,defaultValue:16},weight:{title:\"Font Weight\",type:ControlType.String,defaultValue:\"400\"}}},padding:{title:\"Padding\",type:ControlType.Number,defaultValue:15},radius:{title:\"Border Radius\",type:ControlType.Number,defaultValue:4},gap:{title:\"Gap\",type:ControlType.Number,defaultValue:15}});\nexport const __FramerMetadata__ = {\"exports\":{\"StyledCategoryForm\":{\"type\":\"reactComponent\",\"name\":\"StyledCategoryForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormSpark_Business.map"],
  "mappings": "qHAA8L,SAASA,EAAmB,CAAC,OAAAC,EAAO,SAAAC,EAAS,UAAAC,EAAU,YAAAC,EAAY,gBAAAC,EAAgB,iBAAAC,EAAiB,mBAAAC,EAAmB,kBAAAC,EAAkB,gBAAAC,EAAgB,eAAAC,EAAe,OAAAC,EAAO,OAAAC,EAAO,OAAAC,EAAO,KAAAC,EAAK,QAAAC,EAAQ,OAAAC,EAAO,IAAAC,EAAI,SAAAC,CAAQ,EAAE,CAAC,GAAK,CAACC,EAAKC,CAAO,EAAEC,EAAS,EAAE,EAAO,CAACC,EAAMC,CAAQ,EAAEF,EAAS,EAAE,EAAO,CAACG,EAAQC,CAAU,EAAEJ,EAAS,EAAE,EAAO,CAACK,EAASC,CAAW,EAAEN,EAAS,EAAE,EAAO,CAACO,EAAUC,CAAU,EAAER,EAAS,EAAK,EAAO,CAACS,EAAUC,CAAU,EAAEV,EAAS,EAAK,EAAQW,EAAWxB,EAAkBE,EAAeD,EAAsBwB,EAAaC,EAAY,MAAMC,GAAO,CAACA,EAAM,eAAe,EAAEN,EAAW,EAAI,EAAE,IAAMO,EAAS,CAAC,KAAAjB,EAAK,MAAAG,EAAM,QAAAE,EAAQ,SAAAE,CAAQ,EAAE,GAAG,EAAgB,MAAM,MAAM,4BAA4BzB,CAAM,GAAG,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,kBAAkB,EAAE,KAAK,KAAK,UAAUmC,CAAQ,CAAC,CAAC,GAAc,IAAIL,EAAW,EAAI,EAAEF,EAAW,EAAK,EAA4CX,IAAS,IAAQW,EAAW,EAAK,EAAE,MAAM,yBAAyB,EAAG,OAAOQ,EAAM,CAAC,QAAQ,MAAM,yBAA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A,EAAY,OAAO,aAAa,GAAG,EAAE,KAAK,CAAC,MAAM,aAAa,KAAKA,EAAY,MAAM,aAAa,SAAS,EAAE,UAAU,CAAC,MAAM,aAAa,KAAKA,EAAY,MAAM,aAAa,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,SAAS,CAAC,OAAO,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,aAAa,OAAO,EAAE,KAAK,CAAC,MAAM,YAAY,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,OAAO,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,aAAa,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,UAAU,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,OAAO,CAAC,MAAM,gBAAgB,KAAKA,EAAY,OAAO,aAAa,CAAC,EAAE,IAAI,CAAC,MAAM,MAAM,KAAKA,EAAY,OAAO,aAAa,EAAE,CAAC,CAAC",
  "names": ["StyledCategoryForm", "formId", "withName", "withEmail", "withMessage", "namePlaceholder", "emailPlaceholder", "messagePlaceholder", "useFourCategories", "categoriesThree", "categoriesFour", "layout", "inputs", "button", "font", "padding", "radius", "gap", "onSubmit", "name", "setName", "ye", "email", "setEmail", "message", "setMessage", "category", "setCategory", "isLoading", "setLoading", "isSuccess", "setSuccess", "categories", "handleSubmit", "te", "event", "formData", "error", "formStyle", "inputStyle", "p", "motion", "u", "e", "cat", "index", "addPropertyControls", "ControlType", "props"]
}
