{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/3WzpOjkWQD1zQ5VgFiI9/c7ss9MJwkYZ9RAiOcRVh/formatPrice.js", "ssg:https://framerusercontent.com/modules/jnnCLGtZYuPkmvLMBNFM/4xYRdkkneHn6UrY2ueuQ/siteAPI.js", "ssg:https://framerusercontent.com/modules/avVU2TMYNmGrmUI4jLF1/NBESLFGQUjmfto0ZuG4C/Pricing.js"],
  "sourcesContent": ["export function formatPrice(amount,currency,round=true){const priceFormatter=new Intl.NumberFormat(\"en-US\",{style:\"currency\",currency,minimumFractionDigits:round?0:2,maximumFractionDigits:round?0:2});return priceFormatter.format(amount);}\nexport const __FramerMetadata__ = {\"exports\":{\"formatPrice\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./formatPrice.map", "const api=\"https://api.framer.com/site\";export async function getLocalPrices(){const res=await fetch(`${api}/prices`);const data=await res.json();return data;}\nexport const __FramerMetadata__ = {\"exports\":{\"PlanSiteTier\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PlanTeamTier\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PlanName\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLocalPrices\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PlanPeriod\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Plans\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TeamOrSitePlanName\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Plan\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./siteAPI.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{formatPrice}from\"https://framerusercontent.com/modules/3WzpOjkWQD1zQ5VgFiI9/c7ss9MJwkYZ9RAiOcRVh/formatPrice.js\";import{getLocalPrices}from\"https://framerusercontent.com/modules/jnnCLGtZYuPkmvLMBNFM/4xYRdkkneHn6UrY2ueuQ/siteAPI.js\";const fallbackPrices={mini_site_yearly:{price:60,currency:\"USD\"},mini_site_monthly:{price:10,currency:\"USD\"},basic_site_yearly:{price:180,currency:\"USD\"},basic_site_monthly:{price:20,currency:\"USD\"},pro_site_yearly:{price:300,currency:\"USD\"},pro_site_monthly:{price:30,currency:\"USD\"},basic_team_yearly:{price:240,currency:\"USD\"},basic_team_monthly:{price:25,currency:\"USD\"},pro_team_yearly:{price:445,currency:\"USD\"},pro_team_monthly:{price:45,currency:\"USD\"}};const useStore=createStore({period:\"yearly\",hasLocalPrices:false,prices:fallbackPrices});// ======\n// PERIOD\n// ======\nexport function withPeriodToggle(Component){return props=>{const[store,setStore]=useStore();function handleToggle(){if(store.period===\"yearly\"){setStore({period:\"monthly\"});}if(store.period===\"monthly\"){setStore({period:\"yearly\"});}}return /*#__PURE__*/_jsx(Component,{...props,variant:store.period===\"yearly\"?\"On\":\"Off\",onToggle:handleToggle});};}// ======\n// PRICES\n// ======\nconst toMonthlyNotation=plan=>`${formatPrice(plan.price,plan.currency)}/mo`;export const useLocalPrice=(plan,monthly=true)=>{const[{prices,hasLocalPrices,period},setStore]=useStore();const{price,currency}=prices[`${plan}_${period}`];const priceForPeriod=period===\"yearly\"?price/12:price;const formattedPrice=formatPrice(priceForPeriod,currency);return{price:priceForPeriod,currency,formatted:monthly?`${formattedPrice}/mo`:formattedPrice,show:hasLocalPrices};};export function withLocalPricesFetcher(Component){return props=>{const[_,setStore]=useStore();const fetchLocalPrices=async()=>{try{const localPrices=await getLocalPrices();setStore({prices:localPrices,hasLocalPrices:true});}catch(error){setStore({hasLocalPrices:true});}};useEffect(()=>{fetchLocalPrices();},[]);return /*#__PURE__*/_jsx(Component,{...props});};}function createPriceComponent(plan,Component){return props=>{const isFree=plan===\"free\";const{formatted,currency,show}=useLocalPrice(isFree?\"basic_site\":plan,false);const text=isFree?formatPrice(0,currency):formatted;return /*#__PURE__*/_jsx(Component,{...props,text:text,initial:{opacity:1},// animate={{ opacity: show ? 1 : 0 }}\ntransition:{duration:.2}});};}export function withPriceFree(Component){return createPriceComponent(\"free\",Component);}export function withPriceMini(Component){return createPriceComponent(\"mini_site\",Component);}export function withPriceBasic(Component){return createPriceComponent(\"basic_site\",Component);}export function withPricePro(Component){return createPriceComponent(\"pro_site\",Component);}export function withPriceTeamBasic(Component){return createPriceComponent(\"basic_team\",Component);}export function withPriceTeamPro(Component){return createPriceComponent(\"pro_team\",Component);}// ==========\n// CALCULATOR\n// ==========\nconst useCalculator=createStore({mini_site:0,basic_site:1,pro_site:0,basic_team:1});const usePlanCalculator=(plan,min=0,max=10)=>{const[calculator,setCalculator]=useCalculator();const{price,currency,show}=useLocalPrice(plan);const amount=calculator[plan];let total=amount*price;function handlePlus(){if(amount<max){setCalculator({[plan]:amount+1});}}function handleMinus(){if(amount>min){setCalculator({[plan]:amount-1});}}// First editor is free\nif(plan===\"basic_team\"&&amount<2){total=0;}return{handleMinus,handlePlus,amount,total,formatted:toMonthlyNotation({price:total,currency}),price,currency,show};};export function withCalculatorSumTotal(Component){return props=>{const mini=usePlanCalculator(\"mini_site\");const basic=usePlanCalculator(\"basic_site\");const pro=usePlanCalculator(\"pro_site\");const team=usePlanCalculator(\"basic_team\",1);const total=mini.total+basic.total+pro.total+team.total;const getBusinessPlan=team.amount===10;const[{hasLocalPrices}]=useStore();return /*#__PURE__*/_jsx(Component,{...props,text:formatPrice(total,basic.currency),initial:{opacity:1},// animate={{ opacity: hasLocalPrices ? 1 : 0 }}\ntransition:{duration:.2}});};}function createCalculatorTotalComponent(plan,Component){return props=>{const{formatted,show}=usePlanCalculator(plan);return /*#__PURE__*/_jsx(Component,{...props,text:formatted,initial:{opacity:1},// animate={{ opacity: show ? 1 : 0 }}\ntransition:{duration:.2}});};}export function withCalculatorMiniTotal(Component){return createCalculatorTotalComponent(\"mini_site\",Component);}export function withCalculatorBasicTotal(Component){return createCalculatorTotalComponent(\"basic_site\",Component);}export function withCalculatorProTotal(Component){return createCalculatorTotalComponent(\"pro_site\",Component);}export function withCalculatorTeamBasicTotal(Component){return createCalculatorTotalComponent(\"basic_team\",Component);}function createCalculatorAmountComponent(plan,Component){return props=>{const{handleMinus,handlePlus,amount}=usePlanCalculator(plan,plan===\"basic_team\"?1:0);return /*#__PURE__*/_jsx(Component,{...props,amount:`${amount}`,plus:handlePlus,minus:handleMinus});};}export function withAmountMini(Component){return createCalculatorAmountComponent(\"mini_site\",Component);}export function withAmountBasic(Component){return createCalculatorAmountComponent(\"basic_site\",Component);}export function withAmountPro(Component){return createCalculatorAmountComponent(\"pro_site\",Component);}export function withAmountTeamBasic(Component){return createCalculatorAmountComponent(\"basic_team\",Component);}function createMonthlyPrice(plan,Component){return props=>{const isFree=plan===\"free\";const{formatted,currency,show}=useLocalPrice(isFree?\"basic_site\":plan,false);const text=isFree?formatPrice(0,currency):formatted;return /*#__PURE__*/_jsx(Component,{...props,text:`${text}/mo`});};}export function withMonthlyPriceFree(Component){return createMonthlyPrice(\"free\",Component);}export function withMonthlyPriceMini(Component){return createMonthlyPrice(\"mini_site\",Component);}export function withMonthlyPriceBasic(Component){return createMonthlyPrice(\"basic_site\",Component);}export function withMonthlyPricePro(Component){return createMonthlyPrice(\"pro_site\",Component);}\nexport const __FramerMetadata__ = {\"exports\":{\"withAmountMini\":{\"type\":\"reactHoc\",\"name\":\"withAmountMini\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalculatorMiniTotal\":{\"type\":\"reactHoc\",\"name\":\"withCalculatorMiniTotal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPriceMini\":{\"type\":\"reactHoc\",\"name\":\"withPriceMini\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalculatorBasicTotal\":{\"type\":\"reactHoc\",\"name\":\"withCalculatorBasicTotal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLocalPricesFetcher\":{\"type\":\"reactHoc\",\"name\":\"withLocalPricesFetcher\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMonthlyPriceFree\":{\"type\":\"reactHoc\",\"name\":\"withMonthlyPriceFree\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalculatorSumTotal\":{\"type\":\"reactHoc\",\"name\":\"withCalculatorSumTotal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAmountTeamBasic\":{\"type\":\"reactHoc\",\"name\":\"withAmountTeamBasic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMonthlyPriceMini\":{\"type\":\"reactHoc\",\"name\":\"withMonthlyPriceMini\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPriceFree\":{\"type\":\"reactHoc\",\"name\":\"withPriceFree\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMonthlyPricePro\":{\"type\":\"reactHoc\",\"name\":\"withMonthlyPricePro\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useLocalPrice\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPriceTeamPro\":{\"type\":\"reactHoc\",\"name\":\"withPriceTeamPro\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPricePro\":{\"type\":\"reactHoc\",\"name\":\"withPricePro\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAmountBasic\":{\"type\":\"reactHoc\",\"name\":\"withAmountBasic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMonthlyPriceBasic\":{\"type\":\"reactHoc\",\"name\":\"withMonthlyPriceBasic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalculatorProTotal\":{\"type\":\"reactHoc\",\"name\":\"withCalculatorProTotal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCalculatorTeamBasicTotal\":{\"type\":\"reactHoc\",\"name\":\"withCalculatorTeamBasicTotal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPriceBasic\":{\"type\":\"reactHoc\",\"name\":\"withPriceBasic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPeriodToggle\":{\"type\":\"reactHoc\",\"name\":\"withPeriodToggle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAmountPro\":{\"type\":\"reactHoc\",\"name\":\"withAmountPro\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPriceTeamBasic\":{\"type\":\"reactHoc\",\"name\":\"withPriceTeamBasic\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Pricing.map"],
  "mappings": "yFAAO,SAASA,EAAYC,EAAOC,EAASC,EAAM,GAAK,CAAiJ,OAA3H,IAAI,KAAK,aAAa,QAAQ,CAAC,MAAM,WAAW,SAAAD,EAAS,sBAAsBC,EAAM,EAAE,EAAE,sBAAsBA,EAAM,EAAE,CAAC,CAAC,EAAwB,OAAOF,CAAM,CAAE,CCA7O,IAAMG,EAAI,8BAA8B,eAAsBC,GAAgB,CAAoE,OAAjB,MAAxC,MAAM,MAAM,GAAGD,UAAY,GAAuB,KAAK,CAAc,CCA8N,IAAME,EAAe,CAAC,iBAAiB,CAAC,MAAM,GAAG,SAAS,KAAK,EAAE,kBAAkB,CAAC,MAAM,GAAG,SAAS,KAAK,EAAE,kBAAkB,CAAC,MAAM,IAAI,SAAS,KAAK,EAAE,mBAAmB,CAAC,MAAM,GAAG,SAAS,KAAK,EAAE,gBAAgB,CAAC,MAAM,IAAI,SAAS,KAAK,EAAE,iBAAiB,CAAC,MAAM,GAAG,SAAS,KAAK,EAAE,kBAAkB,CAAC,MAAM,IAAI,SAAS,KAAK,EAAE,mBAAmB,CAAC,MAAM,GAAG,SAAS,KAAK,EAAE,gBAAgB,CAAC,MAAM,IAAI,SAAS,KAAK,EAAE,iBAA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,CAAC,SAASO,EAAqBrB,EAAKa,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMQ,EAAOtB,IAAO,OAAY,CAAC,UAAAuB,EAAU,SAAAf,EAAS,KAAAgB,CAAI,EAAEzB,EAAcuB,EAAO,aAAatB,EAAK,EAAK,EAAQyB,EAAKH,EAAOX,EAAY,EAAEH,CAAQ,EAAEe,EAAU,OAAoBH,EAAKP,EAAU,CAAC,GAAGC,EAAM,KAAKW,EAAK,QAAQ,CAAC,QAAQ,CAAC,EACzlC,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,CAAE,CAAE,CAAQ,SAASC,EAAcb,EAAU,CAAC,OAAOQ,EAAqB,OAAOR,CAAS,CAAE,CAAQ,SAASc,EAAcd,EAAU,CAAC,OAAOQ,EAAqB,YAAYR,CAAS,CAAE,CAAQ,SAASe,EAAef,EAAU,CAAC,OAAOQ,EAAqB,aAAaR,CAAS,CAAE,CAAQ,SAASgB,EAAahB,EAAU,CAAC,OAAOQ,EAAqB,WAAWR,CAAS,CAAE,CAAQ,SAASiB,EAAmBjB,EAAU,CAAC,OAAOQ,EAAqB,aAAaR,CAAS,CAAE,CAAQ,SAASkB,EAAiBlB,EAAU,CAAC,OAAOQ,EAAqB,WAAWR,CAAS,CAAE,CAG9kB,IAAMmB,EAAcC,EAAY,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC",
  "names": ["formatPrice", "amount", "currency", "round", "api", "getLocalPrices", "fallbackPrices", "useStore", "createStore", "withPeriodToggle", "Component", "props", "store", "setStore", "handleToggle", "p", "useLocalPrice", "plan", "monthly", "prices", "hasLocalPrices", "period", "setStore", "useStore", "price", "currency", "priceForPeriod", "formattedPrice", "formatPrice", "withLocalPricesFetcher", "Component", "props", "_", "fetchLocalPrices", "localPrices", "getLocalPrices", "ue", "p", "createPriceComponent", "isFree", "formatted", "show", "text", "withPriceFree", "withPriceMini", "withPriceBasic", "withPricePro", "withPriceTeamBasic", "withPriceTeamPro", "useCalculator", "createStore"]
}
