{"version":3,"file":"V4Form.DZBnNsLI.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/cdLy6qCguvhatM4kZrHI/3xbsSTC96eQpwzOKCoSH/V4Form.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{Frame,addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";const IS_EDITING=RenderTarget.current()===RenderTarget.canvas;addPropertyControls(EmbedeedForm,{formId:{title:\"Form ID\",type:ControlType.String,defaultValue:\"681914de6eee6b961a203601\"},defaultParams:{title:\"Parameters\",type:ControlType.Array,control:{type:ControlType.Object,controls:{key:{title:\"Key\",type:ControlType.String},value:{title:\"Value\",type:ControlType.String}}}},background:{title:\"Background\",type:ControlType.Object,controls:{minWidth:{title:\"Min width\",type:ControlType.Number,defaultValue:300},minHeight:{title:\"Min height\",type:ControlType.Number,defaultValue:400},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"transparent\"},radius:{title:\"Border radius\",type:ControlType.BorderRadius,defaultValue:\"10px\"},border:{title:\"Border\",type:ControlType.Border}}},field:{title:\"Field\",type:ControlType.Object,controls:{color:{title:\"Color\",type:ControlType.Color,defaultValue:\"white\"},radius:{title:\"Border radius\",type:ControlType.BorderRadius,defaultValue:\"10px\"},border:{title:\"Border\",type:ControlType.Border},count:{title:\"Count\",type:ControlType.Number,min:1,defaultValue:6}}},cta:{title:\"CTA\",type:ControlType.Object,controls:{text:{title:\"Content\",type:ControlType.String,defaultValue:\"RECEBER MAIS INFORMA\\xc7\\xd5ES\"},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#1bb015\"},radius:{title:\"Border radius\",type:ControlType.BorderRadius,defaultValue:\"10px\"}}}});EmbedeedForm.supports={size:true};export default function EmbedeedForm(props){const{formId,defaultParams,background,cta,field}=props;const params=defaultParams?.reduce((acc,curr)=>{if(!curr.key||!curr.value){return acc;}acc[curr.key]=curr.value;return acc;},{});const container=useRef(null);const[isLoaded,setIsLoaded]=useState(false);const[isReady,setIsReady]=useState(false);function injectBundle(){if(document.getElementById(\"builder.mkt.v4company\")){setIsLoaded(true);return;}const script=document.createElement(\"script\");script.id=\"builder.mkt.v4company\";script.src=\"https://builder.mkt.v4company.com/bundle.js\";script.defer=true;script.onload=()=>{setIsLoaded(true);};document.head.appendChild(script);}useEffect(()=>{if(!isLoaded){injectBundle();return;}if(container.current&&!isReady){window.initiateForm(formId,params);setIsReady(true);}},[isLoaded]);/*  if (IS_EDITING || !isLoaded) {\n        return <Skeleton background={background} cta={cta} field={field} />\n    } */return /*#__PURE__*/_jsx(Frame,{size:\"100%\",overflow:\"hidden\",backgroundColor:background.color,minWidth:background.minWidth,minHeight:background.minHeight,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:background.radius,border:background.border},children:/*#__PURE__*/_jsx(\"div\",{ref:container,style:{width:\"100%\",height:\"100%\"},id:formId,\"data-id\":formId,\"data-nocache\":\"true\",\"data-cta\":cta.text,\"dta-count\":field.count})});}function Skeleton({background,cta,field}){return /*#__PURE__*/_jsx(Frame,{size:\"100%\",overflow:\"hidden\",minWidth:background.minWidth,minHeight:background.minHeight,backgroundColor:background.color,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",border:background.border,borderRadius:background.radius},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",padding:\"35px 20px\",backgroundColor:\"transparent\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"1.25rem\"},children:[Array.from({length:field.count}).fill(true).map((_,index)=>/*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsx(PulseWrapper,{children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"56px\",backgroundColor:field.color,borderRadius:field.radius,border:field.border}})})},index)),/*#__PURE__*/_jsx(PulseWrapper,{children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"white\",width:\"100%\",height:\"54px\",backgroundColor:cta.color,borderRadius:cta.radius},children:/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:\"600\",fontSize:\"1.125rem\"},children:cta.text})})})]})})});}function PulseWrapper({children}){return /*#__PURE__*/_jsx(motion.div,{animate:{opacity:[1,.3,1]},transition:{duration:2,repeat:Infinity,ease:\"easeInOut\"},children:children});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmbedeedForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./V4Form.map"],"mappings":"yPAA2mD,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,SAAO,gBAAc,aAAW,MAAI,SAAO,EAAY,EAAO,GAAe,QAAQ,EAAI,KAAW,CAAC,EAAK,KAAK,CAAC,EAAK,QAAmB,EAAI,EAAK,KAAK,EAAK,OAAxB,GAA2C,CAAC,CAAC,EAAQ,EAAUA,EAAO,IAAI,EAAO,CAAC,EAAS,GAAaC,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAE,SAAS,GAAc,CAAC,GAAG,SAAS,eAAe,uBAAuB,EAAE,CAAC,EAAY,EAAI,EAAE,MAAO,CAAC,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,GAAG,wBAAwB,EAAO,IAAI,8CAA8C,EAAO,MAAM,GAAK,EAAO,WAAW,CAAC,EAAY,EAAI,CAAE,EAAE,SAAS,KAAK,YAAY,CAAM,CAAE,CAErwE,OAFswE,MAAc,CAAC,GAAG,CAAC,EAAS,CAAC,EAAa,EAAE,MAAO,CAAI,EAAU,SAAS,CAAC,IAAS,EAAO,aAAa,EAAO,CAAM,EAAE,EAAW,EAAI,EAAG,EAAE,CAAC,CAAQ,CAAC,EAEv4E,EAAK,EAAM,CAA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