{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/useIsomorphicLayoutEffect.js@^0.2.0", "ssg:https://framer.com/m/framer/useMeasuredSize.js", "ssg:https://framer.com/m/FormWrapper-xRlv.js@Egff2nkJy0gHhx65xaZy", "ssg:https://framer.com/m/FormRadioGroup-z17m.js@eXd0diQ1giT7d5i4tqek", "ssg:https://framer.com/m/FormRadioButton-2rWe.js@mY7wJkxXw663LwAL7u16"],
  "sourcesContent": ["import{useLayoutEffect,useEffect}from\"react\";/**\n * Swaps `useLayoutEffect` for `useEffect` on the server to avoid React warnings.\n * NOTE! The effect won't run on the server.\n */ export const useIsomorphicLayoutEffect=typeof document!==\"undefined\"?useLayoutEffect:useEffect;\nexport const __FramerMetadata__ = {\"exports\":{\"useIsomorphicLayoutEffect\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useIsomorphicLayoutEffect.map", "import*as React from\"react\";import{useIsomorphicLayoutEffect}from\"https://framer.com/m/framer/useIsomorphicLayoutEffect.js@^0.2.0\";let safeResizeObserver=undefined;try{if(typeof window!==undefined){safeResizeObserver=window.ResizeObserver;}}catch(e){// happy linting!\n}class SharedObserver{//@ts-ignore\nupdateResizedElements(entries){for(const entry of entries){const callbackForElement=this.callbacks.get(entry.target);if(callbackForElement)callbackForElement(entry.contentRect);}}observeElementWithCallback(element,callback){if(!this.sharedResizeObserver)return;this.sharedResizeObserver.observe(element);this.callbacks.set(element,callback);}unobserve(element){if(!this.sharedResizeObserver)return;this.sharedResizeObserver.unobserve(element);this.callbacks.delete(element);}constructor(){this.callbacks=new WeakMap();const ResizeObserver1=safeResizeObserver;if(!ResizeObserver1)return;this.sharedResizeObserver=new ResizeObserver1(this.updateResizedElements.bind(this));}}const sharedResizeObserver=new SharedObserver();/**\n * Uses a globally shared resize observer, and returns an updated\n * size object when the element's size changes. This is the recommended way to\n * use a Resize Observer: https://github.com/WICG/resize-observer/issues/59.\n */ export function useMeasuredSize(ref,callback){const[size,setSize]=React.useState(null);function updateSize(newSize){if(!size||newSize.height!==size.height||newSize.width!==size.width){if(callback)callback(newSize);setSize({width:newSize.width,height:newSize.height});}}// On mount, immediately measure and set a size. This will defer paint until\n// no more updates are scheduled. Additionally add our element to the shared\n// ResizeObserver with a callback to perform when the element resizes.\n// Finally, remove the element from the observer when the component is unmounted.\nuseIsomorphicLayoutEffect(()=>{if(!ref.current)return;const{offsetWidth,offsetHeight}=ref.current;// Defer paint until initial size is added.\nupdateSize({width:offsetWidth,height:offsetHeight});// Resize observer will race to add the initial size, but since the size\n// is set above, it won't trigger a render on mount since it should\n// match the measured size. Future executions of the callback will\n// trigger renders if the size changes.\nsharedResizeObserver.observeElementWithCallback(ref.current,updateSize);return()=>{if(!ref.current)return;sharedResizeObserver.unobserve(ref.current);};},[]);return size;}export function useSizeChange(ref,callback){const size=React.useRef(null);const updateSize=React.useCallback(newSize=>{if(!size.current||newSize.height!==size.current.height||newSize.width!==size.current.width){size.current={width:newSize.width,height:newSize.height};if(callback)callback(size.current);}},[callback]);// On mount, immediately measure and set a size. This will defer paint until\n// no more updates are scheduled. Additionally add our element to the shared\n// ResizeObserver with a callback to perform when the element resizes.\n// Finally, remove the element from the observer when the component is unmounted.\nuseIsomorphicLayoutEffect(()=>{if(!ref.current)return;const{offsetWidth,offsetHeight}=ref.current;// Defer paint until initial size is added.\nupdateSize({width:offsetWidth,height:offsetHeight});// Resize observer will race to add the initial size, but since the size\n// is set above, it won't trigger a render on mount since it should\n// match the measured size. Future executions of the callback will\n// trigger renders if the size changes.\nsharedResizeObserver.observeElementWithCallback(ref.current,updateSize);return()=>{if(!ref.current)return;sharedResizeObserver.unobserve(ref.current);};},[callback]);return null;}\nexport const __FramerMetadata__ = {\"exports\":{\"useSizeChange\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useMeasuredSize\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./useMeasuredSize.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import React,{useState,useRef,useImperativeHandle}from\"react\";import Joi from\"joi\";const FormWrapper=/*#__PURE__*/ React.forwardRef((props,ref1)=>{const{FormSparkID,style,children:children1,messages,schema}=props;const[formData,setFormData]=useState({});const[errors,setErrors]=useState({});const formRef=useRef(null);useImperativeHandle(ref1,()=>({validateForm:validateForm,formRef}));const validateForm=event=>{event.preventDefault();const result=schema.validate(formData,{messages,dateFormat:\"date\"});const{error}=result;if(!error){return formRef.current.submit();}const errorData={};for(let item of error.details){const name=item.path[0];errorData[name]=messages[item.type];}setErrors(errorData);return errorData;};const handleChange=event=>{const{name,value}=event.target;let errorData={...errors};const errorMessage=validateProperty(event);setFormData({...formData,[name]:value});setErrors(errorData);if(errorMessage){errorData[name]=errorMessage;return;}delete errorData[name];};const validateProperty=event=>{const{name,value}=event.target;const propertyToValidate={[name]:value};const schemaOfProperty=Joi.object({[name]:schema.extract(name)});const{error}=schemaOfProperty.validate(propertyToValidate,{messages,dateFormat:\"date\"});return error?error.details.map(detail=>detail.message).join(\", \"):null;};const components1=Array.isArray(children1)?children1:[children1];const modifyComponents=components=>{return components.map(child=>{var ref3;if(typeof child!==\"object\"){return child;}let children=child===null||child===void 0?void 0:(ref3=child.props)===null||ref3===void 0?void 0:ref3.children;if(children){children=modifyComponents(Array.isArray(children)?children:[children]);}return(/*#__PURE__*/ React.cloneElement(child,{onChange:event=>{var ref,ref2;handleChange(event);if(child===null||child===void 0?void 0:(ref=child.props)===null||ref===void 0?void 0:ref.onChange)child===null||child===void 0?void 0:(ref2=child.props)===null||ref2===void 0?void 0:ref2.onChange(event);},errors},children));});};const modifiedChildren=modifyComponents(components1);return(/*#__PURE__*/ _jsx(\"form\",{ref:formRef,action:`https://submit-form.com/${FormSparkID}`,method:\"POST\",children:modifiedChildren}));});FormWrapper.defaultProps={FormSparkID:\"\",messages:[],children:[],style:\"\",schema:{}};export default FormWrapper;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormWrapper.map", "import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import React from\"react\";import styled from\"styled-components\";const ErrorMessage=styled.p`\n    color: red\n`;export default function FormRadioGroup(props){const{name,children:children1,errors,className,onChange,style}=props;const components1=Array.isArray(children1)?children1:[children1];const modifyComponents=components=>{return components.map(child=>{var ref2;if(typeof child!==\"object\"){return child;}let children=child===null||child===void 0?void 0:(ref2=child.props)===null||ref2===void 0?void 0:ref2.children;if(children){children=modifyComponents(Array.isArray(children)?children:[children]);}return(/*#__PURE__*/ React.cloneElement(child,{name,onChange:event=>{var ref,ref1;onChange(event);if(child===null||child===void 0?void 0:(ref=child.props)===null||ref===void 0?void 0:ref.onChange)child===null||child===void 0?void 0:(ref1=child.props)===null||ref1===void 0?void 0:ref1.onChange(event);}},children));});};const modifiedChildren=modifyComponents(components1);return(/*#__PURE__*/ _jsxs(\"div\",{className:className+\" radio-group\",children:[/*#__PURE__*/ _jsx(\"div\",{className:\"radio-buttons\",children:modifiedChildren}),errors[name]&&/*#__PURE__*/ _jsx(ErrorMessage,{children:errors[name]})]}));};FormRadioGroup.defaultProps={name:\"\",errors:{}};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormRadioGroup\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormRadioGroup.map", "import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef}from\"react\";import styled from\"styled-components\";const ErrorMessage=styled.p`\n    color: red\n`;export default function FormRadioButton(props){const{name,value,onChange,errors,className,style,label}=props;const[fromValue,setFormValue]=useState(value);const checkboxRef=useRef(null);const handleChange=event=>{setFormValue(event.target.value);onChange(event);};const handleKeypress=event=>{if(event.key===\"Enter\"){checkboxRef.current.checked=!checkboxRef.current.checked;}};return(/*#__PURE__*/ _jsx(\"div\",{className:className,children:/*#__PURE__*/ _jsxs(\"label\",{tabIndex:\"0\",onKeyUp:handleKeypress,children:[/*#__PURE__*/ _jsx(\"span\",{className:\"label\",children:label}),/*#__PURE__*/ _jsx(Input,{ref:checkboxRef,id:name,type:\"radio\",name:name,value:fromValue,onChange:handleChange,style:style}),/*#__PURE__*/ _jsx(\"span\",{className:\"indicator\"})]})}));};const Input=styled.input``;FormRadioButton.defaultProps={name:\"\",label:\"\",value:\"\",errors:{},onChange:()=>{}};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormRadioButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormRadioButton.map"],
  "mappings": "uPAGW,IAAMA,EAA0B,OAAO,SAAW,IAAYC,EAAgBC,ECH0C,IAAIC,EAA6B,GAAG,CAAI,OAAOC,IAAS,SAAWD,EAAmBC,EAAO,eAAgB,MAAC,CACjP,CAAC,IAAMC,EAAN,KAAoB,CACrB,sBAAsBC,EAAQ,CAAC,QAAUC,KAASD,EAAQ,CAAC,IAAME,EAAmB,KAAK,UAAU,IAAID,EAAM,MAAM,EAAKC,GAAmBA,EAAmBD,EAAM,WAAW,EAAG,CAAC,2BAA2BE,EAAQC,EAAS,CAAK,KAAK,uBAA4B,KAAK,qBAAqB,QAAQD,CAAO,EAAE,KAAK,UAAU,IAAIA,EAAQC,CAAQ,EAAE,CAAC,UAAUD,EAAQ,CAAK,KAAK,uBAA4B,KAAK,qBAAqB,UAAUA,CAAO,EAAE,KAAK,UAAU,OAAOA,CAAO,EAAE,CAAC,aAAa,CAAC,KAAK,UAAU,IAAI,QAAU,IAAME,EAAgBR,EAAuBQ,IAAuB,KAAK,qBAAqB,IAAIA,EAAgB,KAAK,sBAAsB,KAAK,IAAI,CAAC,EAA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M,GAAG,OAAO,CAAC,EAAE,SAAS,IAAI,CAAC,CAAC",
  "names": ["useIsomorphicLayoutEffect", "fe", "ue", "safeResizeObserver", "window", "SharedObserver", "entries", "entry", "callbackForElement", "element", "callback", "ResizeObserver1", "sharedResizeObserver", "useMeasuredSize", "ref", "size", "setSize", "ye", "updateSize", "newSize", "useIsomorphicLayoutEffect", "offsetWidth", "offsetHeight", "FormWrapper", "e", "props", "ref1", "FormSparkID", "style", "children1", "messages", "schema", "formData", "setFormData", "ye", "errors", "setErrors", "formRef", "pe", "ce", "validateForm", "event", "result", "error", "errorData", "item", "name", "handleChange", "value", "errorMessage", "validateProperty", "propertyToValidate", "schemaOfProperty", "o", "detail", "components1", "modifyComponents", "components", "child", "ref3", "children", "ref", "ref2", "modifiedChildren", "p", "FormWrapper_xRlv_default", "ErrorMessage", "He", "FormRadioGroup", "props", "name", "children1", "errors", "className", "onChange", "style", "components1", "modifyComponents", "components", "child", "ref2", "children", "e", "event", "ref", "ref1", "modifiedChildren", "u", "p", "ErrorMessage", "He", "FormRadioButton", "props", "name", "value", "onChange", "errors", "className", "style", "label", "fromValue", "setFormValue", "ye", "checkboxRef", "pe", "p", "u", "event", "Input"]
}
