{"version":3,"file":"GoRedirect.2PQQIsaZ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/3OAlQdairB3TP0Aqfl8p/opfde7HCsMFQQjVpAxiZ/GoRedirect.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\n// Base URL for the Goodfin app — change here if the destination ever moves\nconst APP_BASE_URL=\"https://app.goodfin.com\";const GO_PATH=\"/go\";// Redirects the suggestion pill to app.goodfin.com/go, passing the question as ?q=\n//\n// NOTE: we read the question from the rendered DOM (event.currentTarget.textContent)\n// rather than props.children. For CMS-bound text, props.children only carries the\n// static canvas/default text — the live CMS value exists only in the rendered DOM,\n// so reading children sent the same default question for every company.\n// Attach this override to EACH pill individually (a container would concatenate\n// all pills' text).\nexport function withGoRedirect(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const handleClick=event=>{// The rendered DOM has the LIVE, CMS-resolved text\nconst domText=(event?.currentTarget?.textContent??\"\").trim();// Fallback to the React-children text if the DOM read comes up empty\nconst question=domText||extractText(props.children);const url=`${APP_BASE_URL}${GO_PATH}?q=${encodeURIComponent(question)}`;window.location.href=url// same tab\n;// window.open(url, \"_blank\") // use this instead for a new tab\n};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick,style:{...props.style,cursor:\"pointer\"}});});}// Helper: safely pull plain text out of React children (fallback only)\nfunction extractText(children){if(typeof children===\"string\")return children;if(Array.isArray(children))return children.map(extractText).join(\"\");if(children?.props?.children)return extractText(children.props.children);return\"\";}\nexport const __FramerMetadata__ = {\"exports\":{\"withGoRedirect\":{\"type\":\"reactHoc\",\"name\":\"withGoRedirect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoRedirect.map"],"mappings":"gIAUA,SAAgB,EAAe,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAY,GAAO,CAEhH,IAAM,GADS,GAAO,eAAe,aAAa,IAAI,MAAM,EACpC,EAAY,EAAM,SAAS,CAAO,EAAI,GAAG,IAAe,EAAQ,KAAK,mBAAmB,EAAS,GAAG,EAAO,SAAS,KAAK,GAE/I,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,QAAQ,EAAY,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,UAAU,CAAC,CAAC,EAAG,CACvH,SAAS,EAAY,EAAS,CAA6L,OAAzL,OAAO,GAAW,SAAgB,EAAY,MAAM,QAAQ,EAAS,CAAQ,EAAS,IAAI,EAAY,CAAC,KAAK,GAAG,CAAI,GAAU,OAAO,SAAgB,EAAY,EAAS,MAAM,SAAS,CAAO,4BAftL,IAA8B,CAEnE,EAAa,0BAAgC,EAAQ"}