{"version":3,"file":"TypeformOverlay.Bjd5O2ok.mjs","names":["__legacyOverrideHOC_DataObserverContext","_jsx","React.useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/jzFGnJtwv6xminEORDPz/TMw0Ylc2pgsUYhb26Iuv/OpenTypeform.js","https:/framerusercontent.com/modules/7YFh0zbIsORwl9uxZ9mT/Jvuws19pzqskZsmunguN/TypeformOverlay.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export function openTypeform(props){const eventName=(props.eventName||\"open-typeform\").trim();const open=()=>{// Log útil no console do preview\nconsole.log(`[openTypeform] dispatch -> ${eventName}`);window.dispatchEvent(new Event(eventName));};return{onTap:open,onClick:open};}addPropertyControls(openTypeform,{eventName:{type:ControlType.String,title:\"Evento\",defaultValue:\"open-typeform\"}});import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withopenTypeform(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...openTypeform(props)});};}withopenTypeform.displayName=\"openTypeform\";\nexport const __FramerMetadata__ = {\"exports\":{\"withopenTypeform\":{\"type\":\"reactHoc\",\"name\":\"withopenTypeform\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"openTypeform\":{\"type\":\"override\",\"name\":\"openTypeform\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OpenTypeform.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";function TypeformOverlay({formIdOrUrl,eventName=\"open-typeform\",mobileFullscreen=true,mobileViewportPadding=12,mobileCornerRadius=16,maxWidth=920,height=640,radius=20,closeOnBackdrop=true,debugOpen=false,escToClose=true}){const[open,setOpen]=React.useState(debugOpen);const[vw,setVw]=React.useState(typeof window!==\"undefined\"?window.innerWidth:375);React.useEffect(()=>setOpen(debugOpen),[debugOpen]);React.useEffect(()=>{const onOpen=()=>setOpen(true);const onClose=()=>setOpen(false);const onKey=e=>escToClose&&e.key===\"Escape\"&&setOpen(false);window.addEventListener(eventName,onOpen);window.addEventListener(`${eventName}:close`,onClose);window.addEventListener(\"keydown\",onKey);const onResize=()=>setVw(window.innerWidth);window.addEventListener(\"resize\",onResize);return()=>{window.removeEventListener(eventName,onOpen);window.removeEventListener(`${eventName}:close`,onClose);window.removeEventListener(\"keydown\",onKey);window.removeEventListener(\"resize\",onResize);};},[eventName,escToClose]);// trava o scroll do body quando o modal estiver aberto\nReact.useEffect(()=>{if(!open)return;const prev=document.body.style.overflow;document.body.style.overflow=\"hidden\";return()=>{document.body.style.overflow=prev;};},[open]);const src=/^https?:\\/\\//.test(formIdOrUrl)?formIdOrUrl:`https://form.typeform.com/to/${formIdOrUrl}`;const isMobile=vw<=768;const useMobileFS=mobileFullscreen&&isMobile;// dimensões do “card” do modal\nconst vhUnit=\"100dvh\"// iOS Safari friendly\n;const padding=useMobileFS?mobileViewportPadding:24;const cardStyles=useMobileFS?{width:`calc(100vw - ${padding*2}px)`,height:`calc(${vhUnit} - ${padding*2}px)`,maxWidth:\"none\",borderRadius:mobileCornerRadius}:{width:\"100%\",height,maxWidth,borderRadius:radius};return /*#__PURE__*/_jsx(AnimatePresence,{children:open&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(motion.div,{onClick:closeOnBackdrop?()=>setOpen(false):undefined,initial:{opacity:0},animate:{opacity:.5},exit:{opacity:0},transition:{duration:.22,ease:[.22,1,.36,1]},style:{position:\"fixed\",inset:0,background:\"#0B0B0F\",zIndex:9998}},\"backdrop\"),/*#__PURE__*/_jsx(motion.div,{role:\"dialog\",\"aria-modal\":\"true\",initial:{opacity:0,y:12,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.98},transition:{duration:.28,ease:[.22,1,.36,1]},style:{position:\"fixed\",inset:0,display:\"grid\",placeItems:\"center\",zIndex:9999,padding},children:/*#__PURE__*/_jsxs(\"div\",{style:{...cardStyles,overflow:\"hidden\",background:\"#0F0F14\",border:\"1px solid rgba(255,255,255,.08)\",position:\"relative\",boxShadow:\"0 10px 30px rgba(0,0,0,.35)\"},children:[/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Fechar\",onClick:()=>setOpen(false),style:{position:\"absolute\",top:10,right:10,height:36,width:36,borderRadius:12,background:\"rgba(255,255,255,.06)\",border:\"1px solid rgba(255,255,255,.12)\",color:\"white\",cursor:\"pointer\",backdropFilter:\"blur(8px)\",zIndex:1},children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"iframe\",{title:\"Typeform\",src:src,style:{display:\"block\",width:\"100%\",height:\"100%\",border:0,background:\"#0F0F14\"},allow:\"microphone; camera; autoplay; encrypted-media; geolocation\"})]})},\"modal\")]})});}export default TypeformOverlay;// Property Controls\naddPropertyControls(TypeformOverlay,{formIdOrUrl:{type:ControlType.String,title:\"Form ID / URL\",defaultValue:\"01K5CREMCVA1Z0KNP9FM3Y96E7\"},eventName:{type:ControlType.String,title:\"Evento\",defaultValue:\"open-typeform\"},// Mobile\nmobileFullscreen:{type:ControlType.Boolean,title:\"Fullscreen mobile\",defaultValue:true},mobileViewportPadding:{type:ControlType.Number,title:\"Padding mobile\",min:0,max:32,step:2,defaultValue:12,unit:\"px\"},mobileCornerRadius:{type:ControlType.Number,title:\"Radius mobile\",min:0,max:32,step:1,defaultValue:16,unit:\"px\"},// Não-fullscreen (caso use em desktop depois)\nmaxWidth:{type:ControlType.Number,title:\"Largura m\\xe1x.\",defaultValue:920,min:300,max:1400,unit:\"px\"},height:{type:ControlType.Number,title:\"Altura\",defaultValue:640,min:300,max:2e3,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:20,min:0,max:60,unit:\"px\"},closeOnBackdrop:{type:ControlType.Boolean,title:\"Fechar no fundo\",defaultValue:true},debugOpen:{type:ControlType.Boolean,title:\"DEBUG: Abrir sempre\",defaultValue:false},escToClose:{type:ControlType.Boolean,title:\"Fechar com ESC\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypeformOverlay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypeformOverlay.map"],"mappings":"scAA+F,SAAgB,EAAa,EAAM,CAAC,IAAM,GAAW,EAAM,WAAW,iBAAiB,MAAM,CAAO,MAAS,CAC5M,QAAQ,IAAI,8BAA8B,IAAY,CAAC,EAAO,cAAc,IAAI,MAAM,EAAU,CAAC,EAAG,MAAM,CAAC,MAAM,EAAK,QAAQ,EAAK,CAAyQ,SAAgB,EAAiB,EAAE,CAAC,MAAO,KAAQ,EAA+BA,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAa,EAAM,CAAC,CAAC,uBAD5gB,IAAoD,IAC0N,CAApL,EAAoB,EAAa,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,SAAS,aAAa,gBAAgB,CAAC,CAAC,CAAmU,EAAiB,YAAY,kBCDvY,SAAS,EAAgB,CAAC,cAAY,YAAU,gBAAgB,mBAAiB,GAAK,wBAAsB,GAAG,qBAAmB,GAAG,WAAS,IAAI,SAAO,IAAI,SAAO,GAAG,kBAAgB,GAAK,YAAU,GAAM,aAAW,IAAM,CAAC,GAAK,CAAC,EAAK,GAASC,EAAe,EAAU,CAAM,CAAC,EAAG,GAAOA,EAAsB,IAAS,OAA8B,IAAlB,EAAO,WAAe,CAAC,MAAoB,EAAQ,EAAU,CAAC,CAAC,EAAU,CAAC,CAAC,MAAoB,CAAC,IAAM,MAAW,EAAQ,GAAK,CAAO,MAAY,EAAQ,GAAM,CAAO,EAAM,GAAG,GAAY,EAAE,MAAM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