{"version":3,"file":"InstantQuote.Cn5YVTAS.mjs","names":["React.useState","React.useRef","React.useCallback","React.useMemo"],"sources":["https:/framerusercontent.com/modules/dfqcvMRskaqys09EJJ3K/bTs3g3S769OwqhdJmDVZ/InstantQuote.js"],"sourcesContent":["// User request: Create a reusable \"InstantQuote\" Framer component for the Kreative3D site with a lime-green primary button that opens a professional SeekMake Instant Quote modal via portal, with shared modal behavior across instances, SSR-safe client-only mounting, script injection once, responsive sizing, accessibility, and animated open/close interactions.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,useIsStaticRenderer,useTracking}from\"framer\";import{AnimatePresence,motion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function InstantQuote(props){const{label,buttonBackground,buttonTextColor,fontFamily,cornerRadius,paddingX,paddingY,fontSize,modalBackground,backdropColor,modalMaxWidth}=props;const track=useTracking();const isStatic=useIsStaticRenderer();const[isOpen,setIsOpen]=React.useState(false);const[isMounted,setIsMounted]=React.useState(false);const[isHovered,setIsHovered]=React.useState(false);const[isSmallViewport,setIsSmallViewport]=React.useState(false);const previousOverflowRef=React.useRef(\"\");React.useEffect(()=>{if(typeof window!==\"undefined\"){React.startTransition(()=>setIsMounted(true));}else{React.startTransition(()=>setIsMounted(false));}},[]);React.useEffect(()=>{if(typeof window===\"undefined\")return;const updateViewportState=()=>{const small=window.innerWidth<=1024;React.startTransition(()=>setIsSmallViewport(small));};updateViewportState();window.addEventListener(\"resize\",updateViewportState);return()=>{window.removeEventListener(\"resize\",updateViewportState);};},[]);const closeModal=React.useCallback(()=>{React.startTransition(()=>setIsOpen(false));},[]);const openModal=React.useCallback(()=>{track(\"instant-quote\");if(typeof window!==\"undefined\"&&typeof window.gtag===\"function\"){window.gtag(\"event\",\"quote_start\",{event_category:\"lead\",event_label:\"instant-quote\"});}if(typeof document!==\"undefined\"&&document.getElementById(\"seekmake-iq-api\")===null){const script=document.createElement(\"script\");script.id=\"seekmake-iq-api\";script.src=\"https://seekmake.com/assets/public/iq-api-latest.js\";document.body.appendChild(script);}React.startTransition(()=>setIsOpen(true));},[track]);React.useEffect(()=>{if(!isOpen)return;if(typeof document===\"undefined\")return;const previousOverflow=document.body.style.overflow;previousOverflowRef.current=previousOverflow;document.body.style.overflow=\"hidden\";const onKeyDown=event=>{if(event.key===\"Escape\")closeModal();};document.addEventListener(\"keydown\",onKeyDown);return()=>{document.removeEventListener(\"keydown\",onKeyDown);document.body.style.overflow=previousOverflowRef.current;};},[isOpen,closeModal]);const buttonStyle=React.useMemo(()=>({position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",minWidth:\"max-content\",border:\"none\",outline:\"none\",cursor:\"pointer\",userSelect:\"none\",whiteSpace:\"nowrap\",background:buttonBackground,color:buttonTextColor,fontFamily,fontWeight:600,fontSize,lineHeight:1,padding:`${paddingY}px ${paddingX}px`,borderRadius:cornerRadius,opacity:isHovered?.92:1,transition:\"opacity 0.2s ease\"}),[buttonBackground,buttonTextColor,fontFamily,fontSize,paddingY,paddingX,cornerRadius,isHovered]);const backdropPadding=React.useMemo(()=>{return isSmallViewport?\"0px\":\"2.5vh 2.5vw\";},[isSmallViewport]);const modalNode=isMounted&&!isStatic&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen?/*#__PURE__*/_jsx(motion.div,{role:\"dialog\",\"aria-modal\":\"true\",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.28,ease:\"easeInOut\"},onClick:closeModal,style:{position:\"fixed\",inset:0,zIndex:2147483647,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:backdropColor,padding:backdropPadding},children:/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0,scale:.96,y:16},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:8},transition:{duration:.3,ease:[.22,1,.36,1]},onClick:event=>event.stopPropagation(),style:{position:\"relative\",width:\"100%\",height:\"100%\",maxWidth:`${modalMaxWidth}px`,maxHeight:\"100%\",borderRadius:16,background:modalBackground,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",\"aria-label\":\"Close\",onClick:closeModal,style:{position:\"absolute\",top:12,right:12,width:36,height:36,borderRadius:\"50%\",border:\"none\",cursor:\"pointer\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",background:\"rgba(255,255,255,0.16)\",color:\"#FFFFFF\",fontSize:24,lineHeight:1,zIndex:2},children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflowY:\"auto\",overflowX:\"hidden\",WebkitOverflowScrolling:\"touch\"},children:/*#__PURE__*/_jsx(\"iframe\",{sandbox:\"allow-downloads allow-scripts allow-same-origin allow-forms allow-popups\",id:\"seekmake-embed-iq\",className:\"seekmake-embed-iq\",src:\"https://seekmake.com/instant-quote/?isEmbed=true&manufacturer=6a75949a0ef412e1d740058a\",style:{width:\"100%\",height:\"100%\",minHeight:\"1600px\",border:0},scrolling:\"auto\",title:\"SeekMake Instant Quote\"})})]})}):null}),document.body):null;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"inline-block\",width:\"max-content\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",role:\"button\",onClick:openModal,onMouseEnter:()=>{React.startTransition(()=>setIsHovered(true));},onMouseLeave:()=>{React.startTransition(()=>setIsHovered(false));},style:buttonStyle,children:label}),modalNode]});}addPropertyControls(InstantQuote,{label:{type:ControlType.String,defaultValue:\"Get an Instant Quote\"},buttonBackground:{type:ControlType.Color,defaultValue:\"#DBFF49\"},buttonTextColor:{type:ControlType.Color,defaultValue:\"#0D0D0D\"},fontFamily:{type:ControlType.String,defaultValue:\"Poppins\"},cornerRadius:{type:ControlType.Number,defaultValue:0,min:0,max:64,step:1},paddingX:{type:ControlType.Number,defaultValue:24,min:0,max:80,step:1},paddingY:{type:ControlType.Number,defaultValue:16,min:0,max:60,step:1},fontSize:{type:ControlType.Number,defaultValue:16,min:10,max:40,step:1},modalBackground:{type:ControlType.Color,defaultValue:\"#121414\"},backdropColor:{type:ControlType.Color,defaultValue:\"rgba(0,0,0,0.8)\"},modalMaxWidth:{type:ControlType.Number,defaultValue:1600,min:320,max:2400,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InstantQuote\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./InstantQuote.map"],"mappings":"wTAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,mBAAiB,kBAAgB,aAAW,eAAa,WAAS,WAAS,WAAS,kBAAgB,gBAAc,iBAAe,EAAY,EAAM,EAAY,EAAQ,EAAS,EAAoB,EAAO,CAAC,EAAO,GAAWA,EAAe,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAe,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAe,EAAK,EAAO,CAAC,EAAgB,GAAoBA,EAAe,EAAK,EAAQ,EAAoBC,EAAa,EAAE,EAAE,MAAoB,CAAqF,EAA1E,IAAS,WAA2F,EAAa,EAAK,MAAtE,EAAa,EAAI,CAAsD,CAAG,EAAE,CAAC,CAAC,EAAE,MAAoB,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAwB,CAAC,IAAM,EAAM,EAAO,YAAY,KAAK,MAA0B,EAAmB,CAAK,CAAC,CAAE,EAA8E,OAA5E,EAAoB,EAAE,EAAO,iBAAiB,SAAS,CAAmB,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAmB,CAAE,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAWC,MAAsB,CAAC,MAA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