{"version":3,"file":"feeOverlay.B03ESDP7.mjs","names":["feeProps","useState","p"],"sources":["https:/framerusercontent.com/modules/lPCTW8u1BKX5uhiZJT6Z/hjLdppLzFkDUDjHOF2Q3/formatting.js","https:/framerusercontent.com/modules/HAV1vezswUAwtd3Xh130/IZL6iFPJ3i4oRaHsP0tp/variants.js","https:/framerusercontent.com/modules/jBkS4urrCR69rgNBiOct/PEOifs36WeqGpUpj0SPR/fees.js","https:/framerusercontent.com/modules/BJbA73krcNdUoTubJpVH/vw0W5YMGz3W0ML8X8U30/overlay.js","https:/framerusercontent.com/modules/gUNoCXhkjf3FEVDEfPsG/dRjQjQUhBSBZca9o49jj/feeOverlay.js"],"sourcesContent":["// Centralised helpers for fee/percentage formatting\n/**\n * Returns the localised suffix for scheme/interchange fees.\n * This was previously inlined in the main file. Behaviour unchanged.\n */export function getSchemeAndInterchangeSuffix(countryCode){const map={GB:\" + Scheme and Interchange Fees\",CZ:\" + Poplatky za sch\\xe9ma a mezibankovn\\xed poplatky\",ES:\" + Tasas de esquema e intercambio\",HR:\" + Naknade za shemu i razmjenu\",HU:\" + Rendszer- \\xe9s bankk\\xf6zi d\\xedjak\",IS:\" + Kerfis- og millibankagj\\xf6ld\",IT:\" + Commissioni di circuito e di interscambio\",PT:\" + Taxas de esquema e interc\\xe2mbio\",SK:\" + Poplatky za sch\\xe9mu a medzibankov\\xe9 poplatky\"};return map[countryCode]??\" + Scheme and Interchange Fees\";}/**\n * Formats a percentage value according to locale rules.\n * The existing behaviour uses a comma for several EU locales.\n */export function formatPercentageForCountry(countryCode,value){if(!value&&value!==0)return\"\";const asNumber=typeof value===\"number\"?value.toFixed(2):parseFloat(value).toFixed(2);const useComma=[\"CZ\",\"HR\",\"HU\",\"IS\",\"IT\",\"PT\",\"SK\",\"ES\"];return useComma.includes(countryCode)?asNumber.replace(\".\",\",\")+\"%\":asNumber+\"%\";}/**\n * Formats the headline fee string shown in plan cards.\n * Behaviour matches the existing inline implementation:\n * - splits numeric part + suffix\n * - prevents double \"%\" symbols\n * - keeps pricing text exactly as before\n */export function formatHeadlineFee(raw,countryCode){if(!raw)return\"\";const match=String(raw).match(/([\\d.,]+)(.*)/);if(!match)return raw;const numericPart=parseFloat(match[1].replace(\",\",\".\"));const suffix=match[2]||\"\";// Re-use the percentage formatter but remove the \"%\"\nconst formattedNumber=formatPercentageForCountry(countryCode,numericPart).replace(\"%\",\"\");const hasPercent=suffix.includes(\"%\");return`${formattedNumber}${hasPercent?\"\":\"%\"}${suffix}`;}\nexport const __FramerMetadata__ = {\"exports\":{\"getSchemeAndInterchangeSuffix\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"formatPercentageForCountry\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"formatHeadlineFee\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./formatting.map","// Centralised helpers for choosing Framer variants for cards, machines and fee overlays\n/**\n * Returns the variant used by plan cards (Card / Card Mobile /\n * Bespoke Card / Bespoke Card Mobile).\n */export function getPlanCardVariant(subtype,type,width=window.innerWidth){const isBespoke=subtype===\"BESPOKE\"||type===\"BESPOKE\";const isMobile=width<=1199;if(isBespoke){return isMobile?\"Bespoke Card Mobile\":\"Bespoke Card\";}return isMobile?\"Card Mobile\":\"Card\";}/**\n * Returns the variant used by machine cards.\n * TAP is treated differently — the name alone decides it.\n */export function getMachineCardVariant(name,isTap,width=window.innerWidth){const isMobile=width<=1199;if(isTap){return isMobile?\"Tap Mobile\":\"Tap\";}const upper=name.toUpperCase();if(upper.includes(\"GO\")){return isMobile?\"Go Mobile\":\"Go\";}if(upper.includes(\"ESSENTIAL\")){return isMobile?\"Essential Mobile\":\"Essential\";}if(upper.includes(\"PRO\")){return isMobile?\"Pro Mobile\":\"Pro\";}return undefined;}/**\n * Maps a plan subtype to the correct fee-overlay variant.\n * Behaviour matches the original switch.\n */export function getFeeOverlayVariant(subtype){switch(subtype){case\"BOOST\":return\"Boost Fee Overlay\";case\"THRIVE\":return\"Thrive Fee Overlay\";case\"HOLIDAY_SPECIAL\":return\"Holiday Special Fee Overlay\";case\"BESPOKE\":return\"Bespoke Fee Overlay\";default:return\"Start Fee Overlay\";}}\nexport const __FramerMetadata__ = {\"exports\":{\"getFeeOverlayVariant\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getPlanCardVariant\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getMachineCardVariant\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./variants.map","import{formatPercentageForCountry}from\"https://framerusercontent.com/modules/lPCTW8u1BKX5uhiZJT6Z/hjLdppLzFkDUDjHOF2Q3/formatting.js\";import{getSchemeAndInterchangeSuffix}from\"https://framerusercontent.com/modules/lPCTW8u1BKX5uhiZJT6Z/hjLdppLzFkDUDjHOF2Q3/formatting.js\";export function isICPP(plan){return Boolean(plan?.isICPP);}export function isBlended(plan){return plan?.offerType===\"BLENDED\";}/**\n * Builds all formatted fee props for overlays.\n * Handles IC++, blended, unblended, AMEX, chargeback.\n */export function buildFeeProps(plan,countryCode){if(!plan)return{};const suffix=getSchemeAndInterchangeSuffix(countryCode);const fees=plan.fees||{};// Interchange++\nif(isICPP(plan)){const feeProps={transactionFee:`${formatPercentageForCountry(countryCode,fees.transaction??\"\")}${suffix}`};if(fees.amex){feeProps.feeAmex=formatPercentageForCountry(countryCode,fees.amex);}if(fees.chargeback){feeProps.chargebackFee=fees.chargeback;}return feeProps;}// Blended\nif(isBlended(plan)){const feeProps={blendedTransactionFee:formatPercentageForCountry(countryCode,fees.transaction??\"\")};if(fees.amex){feeProps.feeAmex=formatPercentageForCountry(countryCode,fees.amex);}if(fees.chargeback){feeProps.chargebackFee=fees.chargeback;}return feeProps;}// Unblended\nconst feeProps={feeDebit:formatPercentageForCountry(countryCode,fees.debit??\"\"),feeCredit:formatPercentageForCountry(countryCode,fees.credit??\"\"),feeBusiness:formatPercentageForCountry(countryCode,fees.business??\"\")};// AMEX is always percentage\nif(fees.amex){feeProps.feeAmex=formatPercentageForCountry(countryCode,fees.amex);}// Chargeback is currency (no formatting)\nif(fees.chargeback){feeProps.chargebackFee=fees.chargeback;}return feeProps;}\nexport const __FramerMetadata__ = {\"exports\":{\"isBlended\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isICPP\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"buildFeeProps\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./fees.map","// Small publish-subscribe for the overlay comparison state.\nlet currentOverlayType=\"START\";let listeners=[];/**\n * Returns the current overlay plan type.\n */export function getOverlay(){return currentOverlayType;}/**\n * Sets the overlay type and notifies all listeners.\n */export function setOverlay(type){currentOverlayType=type;listeners.forEach(cb=>cb(type));}/**\n * Subscribes a listener that fires whenever the overlay type changes.\n * Returns an unsubscribe function.\n */export function subscribeOverlay(cb){listeners.push(cb);return()=>{listeners=listeners.filter(l=>l!==cb);};}\nexport const __FramerMetadata__ = {\"exports\":{\"getOverlay\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setOverlay\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"subscribeOverlay\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./overlay.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useState}from\"react\";import{usePricingData}from\"https://framerusercontent.com/modules/Z0Bhc0D6PskV0ZIHIkgR/DGk1tqkKXH9SwZtirnZw/plansStore.js\";import{getFeeOverlayVariant}from\"https://framerusercontent.com/modules/HAV1vezswUAwtd3Xh130/IZL6iFPJ3i4oRaHsP0tp/variants.js\";import{getCountryCodeFromUrl}from\"https://framerusercontent.com/modules/RRKeJWRObO6zvJYvvGR6/zKEzNyBZRUbMhkuSdoOC/Helpers.js\";import{buildFeeProps}from\"https://framerusercontent.com/modules/jBkS4urrCR69rgNBiOct/PEOifs36WeqGpUpj0SPR/fees.js\";import{setOverlay,subscribeOverlay}from\"https://framerusercontent.com/modules/BJbA73krcNdUoTubJpVH/vw0W5YMGz3W0ML8X8U30/overlay.js\";export function SetFeeOverlayVariables(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store]=usePricingData();const selected=store.selectedPlan?.subType??\"START\";const[subType,setSubType]=useState(selected);useEffect(()=>{setOverlay(selected);setSubType(selected);},[selected]);useEffect(()=>subscribeOverlay(setSubType),[]);const plan=store.plans?.find(p=>p.subType===subType)||store.selectedPlan;if(!plan)return /*#__PURE__*/_jsx(Component,{ref:ref,...props});const variant=getFeeOverlayVariant(plan.subType);const countryCode=getCountryCodeFromUrl().toUpperCase();const feeProps=buildFeeProps(plan,countryCode);const originalOnClick=props.onClick;const handleClick=event=>{if(event?.isTrusted){// Bubble the event upward to the plan card override\nconst evt=new CustomEvent(\"all_fees_clicked\",{bubbles:true});event.target.dispatchEvent(evt);}originalOnClick?.(event);};return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:handleClick,variant:variant,highlightedText:plan.highlightedText,...feeProps});});}\nexport const __FramerMetadata__ = {\"exports\":{\"SetFeeOverlayVariables\":{\"type\":\"reactHoc\",\"name\":\"SetFeeOverlayVariables\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"iNAIG,SAAgB,EAA8B,EAAY,CAA6Z,MAAlZ,CAAC,GAAG,iCAAiC,GAAG,gDAAsD,GAAG,oCAAoC,GAAG,iCAAiC,GAAG,iCAA0C,GAAG,gCAAmC,GAAG,+CAA+C,GAAG,oCAAuC,GAAG,gDAAsD,C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