{"version":3,"file":"LinkWithQueryParam.BdbRoVzS.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/jMZzSc2nwRMT14xzskT1/81Op8XSmu2FXKZu7x2Z9/LinkWithQueryParam.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function toLink(Component){return props=>{const[query,setQuery]=useState();useEffect(()=>{if(document){setQuery(document.location.search);}},[]);return /*#__PURE__*/_jsx(Component,{...props,link:`${props.link}${query}`});};}export function withMyCardLink(Component){return props=>{const[myCard,setMyCard]=useState(null);useEffect(()=>{// Tenter window.location.search d'abord, puis le hash\nconst search=window.location.search||window.location.hash.split(\"?\")[1]||\"\";const params=new URLSearchParams(search);const myCard=params.get(\"my-card\");setMyCard(myCard);},[]);return /*#__PURE__*/_jsx(Component,{...props,link2:`${props.link2}/${myCard}`});};}/** \nexport function toHref(Component): ComponentType {\n    return (props) => {\n        const queryParams = document.location.search\n\n        return <Component {...props} href={`${props.href}${queryParams}`} />\n    }\n}\n*/\nexport const __FramerMetadata__ = {\"exports\":{\"toLink\":{\"type\":\"reactHoc\",\"name\":\"toLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMyCardLink\":{\"type\":\"reactHoc\",\"name\":\"withMyCardLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinkWithQueryParam.map"],"mappings":"uIAAiF,SAAgB,EAAO,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,GAAU,CAAuE,OAAtE,MAAc,CAAI,UAAU,EAAS,SAAS,SAAS,OAAO,EAAI,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,GAAG,EAAM,OAAO,IAAQ,CAAC,EAAI,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,KAAK,CACvO,OADwO,MAAc,CACta,IAAM,EAAO,EAAO,SAAS,QAAQ,EAAO,SAAS,KAAK,MAAM,IAAI,CAAC,IAAI,GAA+E,EAA/D,IAAI,gBAAgB,EAAO,CAAqB,IAAI,UAAU,CAAkB,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,GAAG,EAAM,MAAM,GAAG,IAAS,CAAC,uBADpN,IAAsC"}