{"version":3,"file":"Examples.BpZStBiZ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/tEY9fkP3YgM25vW95Tdu/abX5Ph5xveKp1hSC5wK1/Examples.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";/**\n * URL forwarding helpers for Framer components\n * Handles sessionId → client_reference_id mapping for Stripe payments\n */const STRIPE_LINK=\"https://buy.stripe.com/bJefZgfnfgmAavUg3IbfO00\";const STRIPE_LINK_PROMO=\"https://buy.stripe.com/dRm8wO4IBgmA1Zo8BgbfO02\";const STRIPE_LINK_STANDARD=\"https://buy.stripe.com/6oU00ifnfees9rQ4l0bfO08\";const PREMIUM_UPSELL_LINK=\"https://buy.stripe.com/28EcN42At5HW0Vk9FkbfO09\";const ANALIZA_LINK=\"https://online.analizakolorystyczna.app/t/wrSDPtKyvVus\";const MOBILE_SUBSCRIPTION_LINK=\"https://buy.stripe.com/4gMaEWgrj1rG9rQ3gWbfO06\";const fbq=(...args)=>{if(typeof window!==\"undefined\"&&window.fbq){window.fbq(...args);}};const BACKEND_URL=\"https://coloranalysis-production-784a.up.railway.app\";const trackPurchaseStarted=(sessionId,productType)=>{const url=new URL(window.location.href);fetch(`${BACKEND_URL}/api/queue/track-funnel-event`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({sessionId,eventType:\"purchase_started\",metadata:{productType,utm_source:url.searchParams.get(\"utm_source\"),utm_medium:url.searchParams.get(\"utm_medium\"),utm_campaign:url.searchParams.get(\"utm_campaign\")}})}).catch(()=>{});};const ALLOWED=new Set([\"prefilled_email\",\"locked_prefilled_email\",\"utm_source\",\"utm_medium\",\"utm_campaign\",\"utm_content\",\"utm_term\",\"client_reference_id\",\"prefilled_promo_code\"]);/**\n * Forward URL parameters to Stripe payment link\n * CRITICAL: Maps sessionId → client_reference_id for session-based payment matching\n */export function withForwardStripeUrlParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const buildUrl=()=>{const url=new URL(STRIPE_LINK);if(typeof window===\"undefined\")return url.toString();const incoming=new URLSearchParams(window.location.search);// CRITICAL: Extract sessionId and map to client_reference_id\nconst sessionId=incoming.get(\"sessionId\");// Forward allowed parameters\nfor(const[k,v]of incoming.entries()){if(!ALLOWED.has(k))continue;if(v==null||v===\"\")continue;url.searchParams.set(k,v);}// CRITICAL: Map sessionId to client_reference_id for Stripe webhook matching\nif(sessionId){url.searchParams.set(\"client_reference_id\",sessionId.trim());console.log(\"💳 Mapped sessionId to Stripe client_reference_id:\",sessionId);}else{console.warn(\"⚠️ No sessionId in URL - payment will use email fallback\");}return url.toString();};const onTap=e=>{props?.onTap?.(e);props?.onClick?.(e);if(e?.defaultPrevented)return;fbq(\"track\",\"InitiateCheckout\",{value:99,currency:\"PLN\",content_name:\"Standard Analysis\"});trackPurchaseStarted(new URLSearchParams(window.location.search).get(\"sessionId\"),\"standard\");const finalUrl=buildUrl();console.log(\"🔗 Redirecting to Stripe:\",finalUrl);window.location.assign(finalUrl);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:onTap});});}/**\n * Forward URL parameters to Stripe promo link\n * CRITICAL: Maps sessionId → client_reference_id for session-based payment matching\n */export function withForwardStripePromoUrlParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const buildUrl=()=>{const url=new URL(STRIPE_LINK);if(typeof window===\"undefined\")return url.toString();const incoming=new URLSearchParams(window.location.search);// CRITICAL: Extract sessionId and map to client_reference_id\nconst sessionId=incoming.get(\"sessionId\");// Forward allowed parameters\nfor(const[k,v]of incoming.entries()){if(!ALLOWED.has(k))continue;if(v==null||v===\"\")continue;url.searchParams.set(k,v);}// Add promo code\nurl.searchParams.set(\"prefilled_promo_code\",\"PROMO40UNIQUE\");// CRITICAL: Map sessionId to client_reference_id for Stripe webhook matching\nif(sessionId){url.searchParams.set(\"client_reference_id\",sessionId.trim());console.log(\"💳 Mapped sessionId to Stripe client_reference_id:\",sessionId);}else{console.warn(\"⚠️ No sessionId in URL - payment will use email fallback\");}return url.toString();};const onTap=e=>{props?.onTap?.(e);props?.onClick?.(e);if(e?.defaultPrevented)return;fbq(\"track\",\"InitiateCheckout\",{value:99,currency:\"PLN\",content_name:\"Standard Analysis Promo\"});trackPurchaseStarted(new URLSearchParams(window.location.search).get(\"sessionId\"),\"promo\");const finalUrl=buildUrl();console.log(\"🔗 Redirecting to Stripe:\",finalUrl);window.location.assign(finalUrl);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:onTap});});}/**\n * Forward all URL parameters to Fillout form\n * Used for form page navigation - forwards sessionId along with UTM params\n */export function withForwardFullAnalysisUrlParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const buildUrl=()=>{const url=new URL(ANALIZA_LINK);if(typeof window===\"undefined\")return url.toString();const incoming=new URLSearchParams(window.location.search);// Forward ALL parameters (including sessionId, UTM params, etc.)\nfor(const[k,v]of incoming.entries()){if(v==null||v===\"\")continue;url.searchParams.set(k,v);}return url.toString();};const onTap=e=>{props?.onTap?.(e);props?.onClick?.(e);if(e?.defaultPrevented)return;const finalUrl=buildUrl();window.location.assign(finalUrl);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:onTap});});}/**\n * Forward URL parameters to Stripe standard (basic) link\n * Maps sessionId → client_reference_id for session-based payment matching\n */export function withForwardFullAnalysisUrlParamsStandard(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const buildUrl=()=>{const url=new URL(STRIPE_LINK_STANDARD);if(typeof window===\"undefined\")return url.toString();const incoming=new URLSearchParams(window.location.search);// Forward ALL parameters (including sessionId, UTM params, etc.)\nfor(const[k,v]of incoming.entries()){if(v==null||v===\"\")continue;url.searchParams.set(k,v);}return url.toString();};const onTap=e=>{props?.onTap?.(e);props?.onClick?.(e);if(e?.defaultPrevented)return;fbq(\"track\",\"InitiateCheckout\",{value:29,currency:\"PLN\",content_name:\"Basic Analysis\"});trackPurchaseStarted(new URLSearchParams(window.location.search).get(\"sessionId\"),\"basic\");const finalUrl=buildUrl();window.location.assign(finalUrl);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:onTap});});}/**\n * Forward URL parameters to Stripe premium upsell link\n * Maps sessionId → client_reference_id for session-based payment matching\n */export function withForwardFullAnalysisUrlParamsPremium(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const buildUrl=()=>{const url=new URL(PREMIUM_UPSELL_LINK);if(typeof window===\"undefined\")return url.toString();const incoming=new URLSearchParams(window.location.search);// Forward ALL parameters (including sessionId, UTM params, etc.)\nfor(const[k,v]of incoming.entries()){if(v==null||v===\"\")continue;url.searchParams.set(k,v);}return url.toString();};const onTap=e=>{props?.onTap?.(e);props?.onClick?.(e);if(e?.defaultPrevented)return;fbq(\"track\",\"InitiateCheckout\",{value:99,currency:\"PLN\",content_name:\"Full Package A+B\"});trackPurchaseStarted(new URLSearchParams(window.location.search).get(\"sessionId\"),\"premium\");const finalUrl=buildUrl();window.location.assign(finalUrl);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:onTap});});}export function withForwardMobileSubscriptionUrlParams(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const buildUrl=()=>{const url=new URL(MOBILE_SUBSCRIPTION_LINK);if(typeof window===\"undefined\")return url.toString();const incoming=new URLSearchParams(window.location.search);for(const[k,v]of incoming.entries()){if(!ALLOWED.has(k))continue;if(v==null||v===\"\")continue;url.searchParams.set(k,v);}return url.toString();};const onTap=e=>{props?.onTap?.(e);props?.onClick?.(e);if(e?.defaultPrevented)return;fbq(\"track\",\"InitiateCheckout\",{value:19.99,currency:\"PLN\",content_name:\"Mobile App Subscription\"});trackPurchaseStarted(new URLSearchParams(window.location.search).get(\"sessionId\"),\"mobile_subscription\");const finalUrl=buildUrl();window.location.assign(finalUrl);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onTap:onTap});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withForwardMobileSubscriptionUrlParams\":{\"type\":\"reactHoc\",\"name\":\"withForwardMobileSubscriptionUrlParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withForwardStripeUrlParams\":{\"type\":\"reactHoc\",\"name\":\"withForwardStripeUrlParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withForwardStripePromoUrlParams\":{\"type\":\"reactHoc\",\"name\":\"withForwardStripePromoUrlParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withForwardFullAnalysisUrlParams\":{\"type\":\"reactHoc\",\"name\":\"withForwardFullAnalysisUrlParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withForwardFullAnalysisUrlParamsPremium\":{\"type\":\"reactHoc\",\"name\":\"withForwardFullAnalysisUrlParamsPremium\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withForwardFullAnalysisUrlParamsStandard\":{\"type\":\"reactHoc\",\"name\":\"withForwardFullAnalysisUrlParamsStandard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"2HAMG,SAAgB,EAA2B,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,MAAa,CAAC,IAAM,EAAI,IAAI,IAAI,EAAY,CAAC,GAAU,IAAS,OAAY,OAAO,EAAI,UAAU,CAAC,IAAM,EAAS,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAClQ,EAAU,EAAS,IAAI,YAAY,CACzC,IAAI,GAAK,CAAC,EAAE,KAAK,EAAS,SAAS,CAAM,EAAQ,IAAI,EAAE,GAAa,GAAG,MAAM,IAAI,IAAY,EAAI,aAAa,IAAI,EAAE,EAAE,EACiH,OAApO,GAAW,EAAI,aAAa,IAAI,sBAAsB,EAAU,MAAM,CAAC,CAAC,QAAQ,IAAI,qDAAqD,EAAU,EAAO,QAAQ,KAAK,2DAA2D,CAAS,EAAI,UAAU,EAAS,EAAM,GAAG,CAAuC,GAAtC,GAAO,QAAQ,EAAE,CAAC,GAAO,UAAU,EAAE,CAAI,GAAG,iBAAiB,OAAO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