{"version":3,"file":"Client_reference_ID_passthrough.DSaaXMuu.mjs","names":[],"sources":["https:/framerusercontent.com/modules/Uvd2jh4OYUlsiZGmb8KO/ooozJycquNKTZjzhFzKE/Client_reference_ID_passthrough.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";function appendParam(url,key,value){if(!value)return url;const u=new URL(url);if(!u.searchParams.get(key))u.searchParams.set(key,value);return u.toString();}export function withStripeClientReferenceIdFromRef(Component){return props=>{const params=typeof window!==\"undefined\"?new URLSearchParams(window.location.search):new URLSearchParams;const ref=params.get(\"ref\")??\"\";if(!ref)return /*#__PURE__*/_jsx(Component,{...props});const nextProps={...props};// Update any prop that is a Stripe Payment Link URL\nfor(const key of Object.keys(nextProps)){const val=nextProps[key];if(typeof val===\"string\"&&val.startsWith(\"https://buy.stripe.com/\")){nextProps[key]=appendParam(val,\"client_reference_id\",ref);}}return /*#__PURE__*/_jsx(Component,{...nextProps});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withStripeClientReferenceIdFromRef\":{\"type\":\"reactHoc\",\"name\":\"withStripeClientReferenceIdFromRef\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Client_reference_ID_passthrough.map"],"mappings":"kHAA2C,SAAS,EAAY,EAAI,EAAI,EAAM,CAAC,GAAG,CAAC,EAAM,OAAO,EAAI,IAAM,EAAE,IAAI,IAAI,EAAI,CAA2D,OAAtD,EAAE,aAAa,IAAI,EAAI,EAAC,EAAE,aAAa,IAAI,EAAI,EAAM,CAAQ,EAAE,UAAU,CAAE,SAAgB,EAAmC,EAAU,CAAC,MAAO,IAAO,CAA0G,IAAM,GAA3F,IAAS,OAAwD,IAAI,gBAAhD,IAAI,gBAAgB,EAAO,SAAS,OAAO,EAAsC,IAAI,MAAM,EAAE,GAAG,GAAG,CAAC,EAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAC,IAAM,EAAU,CAAC,GAAG,EAAM,CAC/e,IAAI,IAAM,KAAO,OAAO,KAAK,EAAU,CAAC,CAAC,IAAM,EAAI,EAAU,GAAQ,OAAO,GAAM,UAAU,EAAI,WAAW,0BAA0B,GAAE,EAAU,GAAK,EAAY,EAAI,sBAAsB,EAAI,EAAG,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAU,CAAC,uBAD1M"}