{"version":3,"file":"TooltipText.CI90VAB8.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/lFkT5vkZopcapDycT4MJ/nZNWC51fjF3QN0fZJQvK/TooltipText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";// ─── Shared hook ──────────────────────────────────────────────────────────────\nfunction useTooltipState(){const[open,setOpen]=useState(false);const popupRef=useRef(null);const triggerRef=useRef(null);useEffect(()=>{if(!open)return;const onPointerDown=e=>{const target=e.target;if(!popupRef.current?.contains(target)&&!triggerRef.current?.contains(target)){setOpen(false);}};document.addEventListener(\"pointerdown\",onPointerDown);return()=>document.removeEventListener(\"pointerdown\",onPointerDown);},[open]);return{open,setOpen,popupRef,triggerRef};}// ─── Close button ─────────────────────────────────────────────────────────────\nfunction CloseButton({onClose,size,borderRadius}){return /*#__PURE__*/_jsx(\"button\",{onClick:onClose,\"aria-label\":\"Close tooltip\",style:{position:\"absolute\",top:8,right:8,background:\"transparent\",border:\"none\",cursor:\"pointer\",lineHeight:1,fontSize:22,width:size,height:size,display:\"grid\",placeItems:\"center\",borderRadius},children:\"\\xd7\"});}// ─── Unified component ────────────────────────────────────────────────────────\n/**\n * Single component for both breakpoints.\n *\n * Desktop (isMobile=false, default):\n *   - Opens on hover (mouseenter) and stays open\n *   - Closes on outside click or X\n *\n * Mobile (isMobile=true):\n *   - Opens on tap/click only\n *   - Tooltip anchors to bottom of screen at 96 vw\n */export function TooltipText({textBefore,triggerWord,textAfter,tooltipContent,textColor=\"#000000\",activeBg=\"#2563EB\",activeText=\"#FFFFFF\",fontSizeDesktop=32,fontSizeMobile=24,supFontSizeDesktop,supFontSizeMobile=12,fontWeight=\"normal\",lineHeight=1.4,paragraphStyle,desktopTooltipPosition,desktopTooltipMaxWidth=320,isMobile=false}){const{open,setOpen,popupRef,triggerRef}=useTooltipState();// ── Derived values ────────────────────────────────────────────────────────\nconst fontSize=isMobile?fontSizeMobile:fontSizeDesktop;const supFontSize=isMobile?supFontSizeMobile:supFontSizeDesktop??Math.round(fontSizeDesktop/2);// ── Trigger span style ────────────────────────────────────────────────────\nconst triggerStyle={cursor:\"pointer\",padding:\"2px 4px\",borderRadius:4,transition:\"all 0.2s ease\",textDecoration:\"underline\",textUnderlineOffset:3,textDecorationThickness:\"1px\",backgroundColor:open?activeBg:\"transparent\",color:open?activeText:textColor,...isMobile&&{WebkitTapHighlightColor:\"transparent\"}};// ── Tooltip popup style ───────────────────────────────────────────────────\nconst desktopPosition=desktopTooltipPosition??{bottom:\"5%\",left:\"2%\",right:\"5%\"};const tooltipStyle=isMobile?{left:\"2%\",right:\"2%\",bottom:\"5%\",width:\"96vw\",maxWidth:520,padding:\"16px 52px 16px 16px\",borderRadius:12,boxShadow:\"0px 10px 30px rgba(0,0,0,0.18)\"}:{...desktopPosition,maxWidth:desktopTooltipMaxWidth,padding:16,borderRadius:8,boxShadow:\"0px 10px 30px rgba(0,0,0,0.15)\"};// ── Animation variant ─────────────────────────────────────────────────────\nconst motionProps=isMobile?{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{duration:.18}}:{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.15}};// ── Close button size ─────────────────────────────────────────────────────\nconst closeSize=isMobile?36:32;const closeBorderRadius=isMobile?10:8;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"p\",{style:{fontFamily:\"Inter\",fontSize,color:textColor,lineHeight,textAlign:\"center\",fontWeight,margin:0,...paragraphStyle},children:[textBefore&&/*#__PURE__*/_jsxs(_Fragment,{children:[textBefore,\" \"]}),/*#__PURE__*/_jsxs(\"span\",{ref:triggerRef,onClick:()=>setOpen(true),...!isMobile&&{onMouseEnter:()=>setOpen(true),onFocus:()=>setOpen(true)},tabIndex:0,style:triggerStyle,children:[triggerWord,/*#__PURE__*/_jsx(\"sup\",{style:{fontSize:supFontSize,lineHeight:isMobile?1:lineHeight,verticalAlign:\"super\",color:open?activeText:textColor},children:\"1\"})]}),textAfter&&/*#__PURE__*/_jsxs(_Fragment,{children:[\" \",textAfter]})]}),/*#__PURE__*/_jsx(AnimatePresence,{children:open&&/*#__PURE__*/_jsxs(motion.div,{ref:popupRef,...motionProps,style:{position:\"fixed\",background:\"#FFFFFF\",color:\"#000000\",fontFamily:\"Inter\",fontSize:16,zIndex:1e3,textAlign:\"left\",...tooltipStyle},onPointerDown:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsx(CloseButton,{onClose:()=>setOpen(false),size:closeSize,borderRadius:closeBorderRadius}),/*#__PURE__*/_jsx(\"div\",{children:tooltipContent})]})})]});}// ─── Named breakpoint aliases (convenience re-exports) ────────────────────────\nexport function TooltipTextDesktop(props){return /*#__PURE__*/_jsx(TooltipText,{...props,isMobile:false});}export function TooltipTextMobile(props){return /*#__PURE__*/_jsx(TooltipText,{...props,isMobile:true});}const configHeroModal={textBefore:\"Raising money is hard. Sphere Ventures helps your team obtain\",triggerWord:\"EU funding grants\",textAfter:\"and close the co-financing gap, without taking equity.\",tooltipContent:/*#__PURE__*/_jsx(_Fragment,{children:\"You might qualify even if you're not expecting it. We'll verify you free of charge.\"}),// Dark background variant: white text, white active bg, blue active text\ntextColor:\"#FFFFFF\",activeBg:\"#FFFFFF\",activeText:\"#2563EB\",fontSizeDesktop:24,supFontSizeDesktop:12,fontSizeMobile:22,supFontSizeMobile:12,lineHeight:1.5,// Original had top: -95px, left: 62% for desktop tooltip\ndesktopTooltipPosition:{top:\"-95px\",left:\"62%\",transform:\"translate(-50%, -50%)\"}};export function HeroModalDesktop(){return /*#__PURE__*/_jsx(TooltipTextDesktop,{...configHeroModal});}export function HeroModalMobile(){return /*#__PURE__*/_jsx(TooltipTextMobile,{...configHeroModal});}const configSMEModal={textBefore:\"All\",triggerWord:\"SMEs\",textAfter:\"Welcome\",tooltipContent:/*#__PURE__*/_jsxs(_Fragment,{children:[\"99% of businesses are\",\" \",/*#__PURE__*/_jsx(\"a\",{target:\"_blank\",href:\"https://single-market-economy.ec.europa.eu/smes/sme-fundamentals/sme-definition_en#sme-definition\",children:\"small and medium-sized enterprises\"})]}),// Light background variant: black text, blue active bg, white active text\ntextColor:\"#000000\",activeBg:\"#2563EB\",activeText:\"#FFFFFF\",fontSizeDesktop:48,supFontSizeDesktop:24,fontSizeMobile:28,supFontSizeMobile:14,fontWeight:700,lineHeight:1.2};export function SMEModalDesktop(){return /*#__PURE__*/_jsx(TooltipTextDesktop,{...configSMEModal});}export function SMEModalMobile(){return /*#__PURE__*/_jsx(TooltipTextMobile,{...configSMEModal});}\nexport const __FramerMetadata__ = {\"exports\":{\"TooltipText\":{\"type\":\"reactComponent\",\"name\":\"TooltipText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"HeroModalDesktop\":{\"type\":\"reactComponent\",\"name\":\"HeroModalDesktop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"TooltipTextDesktop\":{\"type\":\"reactComponent\",\"name\":\"TooltipTextDesktop\",\"slots\":[\"tooltipContent\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"SMEModalMobile\":{\"type\":\"reactComponent\",\"name\":\"SMEModalMobile\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"HeroModalMobile\":{\"type\":\"reactComponent\",\"name\":\"HeroModalMobile\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"SMEModalDesktop\":{\"type\":\"reactComponent\",\"name\":\"SMEModalDesktop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"TooltipTextConfig\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TooltipTextMobile\":{\"type\":\"reactComponent\",\"name\":\"TooltipTextMobile\",\"slots\":[\"tooltipContent\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"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