{
  "version": 3,
  "sources": ["../../src/document/components/chrome/shared/utils/rotateElement.styles.ts", "../../src/document/components/chrome/shared/utils/rotateElement.ts", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/AcquireAddOnModalInner.tsx", "../../src/document/components/chrome/siteSettings/Plans/Stripe/components/PlansInfo.styles.ts", "../../src/document/components/chrome/siteSettings/Plans/Stripe/components/PlansInfo.tsx", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/AcquireAddOnModal.styles.ts", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/AddOnLineItems.tsx", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/AddOnLineItems.styles.ts", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/useAcquireAddon.ts", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/api/previewAddOn.ts", "../../src/document/components/chrome/siteSettings/Plans/Stripe/addOns/useAddonPurchaseInfo.ts"],
  "sourcesContent": ["import \"rotateElement.styles_1ld3m0z.wyw.css\"; export const rotateElement = \"rotateElement_rjo179g\";", "import * as styles from \"./rotateElement.styles.ts\"\n\nexport function rotateElement(el: Element) {\n\tif (el.classList.contains(styles.rotateElement)) {\n\t\tel.classList.remove(styles.rotateElement)\n\t\tel.getClientRects() // Force reflow so animation can restart\n\t}\n\tel.addEventListener(\"animationend\", function onAnimationEnd() {\n\t\tel.classList.remove(styles.rotateElement)\n\t\tel.removeEventListener(\"animationend\", onAnimationEnd)\n\t})\n\tel.classList.add(styles.rotateElement)\n}\n", "import { AddOnLicenseType, type ProjectSettings, getAddOnLicenseTypeName, openNewTab } from \"@framerjs/app-shared\"\nimport type { Usage } from \"@framerjs/app-shared/src/ProjectState.ts\"\nimport { Button, Spinner, Stack, Translatable as T } from \"@framerjs/fresco\"\nimport { assertNever, getLogger } from \"@framerjs/shared\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport type { CanvasTree } from \"document/models/CanvasTree/CanvasTree.ts\"\nimport { type ReactNode, useCallback, useEffect } from \"react\"\nimport { contactSupportURL } from \"utils/staticURLs.ts\"\nimport { useRecordEffect } from \"utils/useRecordEffect.ts\"\nimport { toast } from \"web/lib/toaster.ts\"\nimport { Pages, UIInteraction, record } from \"web/lib/tracker.ts\"\nimport { PollStatus, type PollProjectOptions, type PollResponse } from \"web/pages/project/lib/api/pollProject.ts\"\nimport { PlansInfo } from \"../../../../siteSettings/Plans/Stripe/components/PlansInfo.tsx\"\nimport { SettingSection } from \"../../../../siteSettings/SettingSection.tsx\"\nimport { getBillingPortalUrl } from \"../api/subscriptions.ts\"\nimport * as styles from \"./AcquireAddOnModal.styles.ts\"\nimport { AddOnLineItems } from \"./AddOnLineItems.tsx\"\nimport { AddOnStatus, useAcquireAddOn } from \"./useAcquireAddon.ts\"\nimport type { AddonPurchaseInfo } from \"./useAddonPurchaseInfo.ts\"\n\n/**\n * \uD83D\uDD34 This file is also used by Dashboard components. Please do not import the engine here.\n */\n\nconst log = getLogger(\"AcquireAddOnModal\")\nconst runImmediately = (callback: () => void) => callback()\n\nfunction BillingPortalButton({ teamId, page }: { teamId: string; page: Pages }): ReactNode {\n\treturn (\n\t\t<Button\n\t\t\tonClick={() => {\n\t\t\t\trecord(\"ui_interaction\", { page, id: UIInteraction.updateBilling })\n\t\t\t\topenNewTab(getBillingPortalUrl(teamId))\n\t\t\t}}\n\t\t>\n\t\t\t<T>Update Payment Method</T>\n\t\t</Button>\n\t)\n}\n\ninterface ErrorModalContentProps {\n\ttitle: string\n\tbody: ReactNode\n\terrorPage: Pages\n\tbillingPortalButton?: ReactNode\n\tshowSupportButton?: boolean\n\ttryAgainAction?: () => void\n\tonCancelOrDismiss: () => void\n}\n\nexport const trackingPages = {\n\tbase: Pages.acquireAddOnModal,\n\tsuccess: Pages.acquireAddOnModalSuccess,\n\terrorFailedToPreview: Pages.acquireAddOnModalFailedToPreviewError,\n\terrorUnauthorized: Pages.acquireAddOnModalErrorUnauthorized,\n\terrorPaymentDeclined: Pages.acquireAddOnModalErrorPaymentDeclined,\n\terrorActionsRequired: Pages.acquireAddOnModalErrorActionsRequired,\n\terrorUnhandled: Pages.acquireAddOnModalUnhandledError,\n\terrorSitePlanCancelled: Pages.acquireAddOnModalErrorSitePlanCancelled,\n}\n\nfunction ErrorModalContent(props: ErrorModalContentProps) {\n\tconst { title, body, errorPage, billingPortalButton, showSupportButton, tryAgainAction, onCancelOrDismiss } = props\n\n\tuseRecordEffect(\"ui_impression\", { page: errorPage }, [errorPage])\n\n\treturn (\n\t\t<PlansInfo\n\t\t\ticon=\"error\"\n\t\t\ttitle={title}\n\t\t\tbody={<div className={styles.errorBodyText}>{body}</div>}\n\t\t\tbutton={\n\t\t\t\t<Stack direction=\"row\" gap={10}>\n\t\t\t\t\t{tryAgainAction ? (\n\t\t\t\t\t\t<Button onClick={tryAgainAction}>\n\t\t\t\t\t\t\t<T>{Dictionary.TryAgain}</T>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) : undefined}\n\t\t\t\t\t{billingPortalButton}\n\t\t\t\t\t{showSupportButton && (\n\t\t\t\t\t\t<Button onClick={() => openNewTab(contactSupportURL)}>\n\t\t\t\t\t\t\t<T>Contact Us</T>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{tryAgainAction ? undefined : (\n\t\t\t\t\t\t<Button onClick={onCancelOrDismiss}>\n\t\t\t\t\t\t\t<T>Dismiss</T>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t}\n\t\t\tclassName={styles.plansInfoModal}\n\t\t\tcompact\n\t\t/>\n\t)\n}\n\ninterface AcquireAddOnModalInnerProps {\n\tonCancelOrDismiss: () => void\n\tonSuccess?: () => void\n\taddonPurchaseInfo: AddonPurchaseInfo\n\tisBillingV3: boolean\n\tdismissFn: () => void\n\trunAfterReady?: (callback: () => void) => void\n\tonSitePlanCancelled?: () => void\n\ttree: CanvasTree\n\tusageData?: Usage\n\tpollProject?: (options: PollProjectOptions) => Promise<PollResponse>\n}\n\nexport function AcquireAddOnModalInner({\n\tonCancelOrDismiss,\n\tonSuccess,\n\taddonPurchaseInfo,\n\tisBillingV3,\n\tdismissFn,\n\trunAfterReady = runImmediately,\n\tonSitePlanCancelled,\n\ttree,\n\tusageData,\n\tpollProject,\n}: AcquireAddOnModalInnerProps) {\n\tconst { teamId, period, addonLicenseType } = addonPurchaseInfo\n\tconst { state, previewAddOn, purchaseAddOn } = useAcquireAddOn(addonPurchaseInfo, isBillingV3, onSitePlanCancelled)\n\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: preview when opened for the first time only\n\tuseEffect(() => {\n\t\tif (state.status === AddOnStatus.Initial) {\n\t\t\tvoid previewAddOn(null)\n\t\t}\n\t}, [state.status])\n\n\tconst handleSuccess = useCallback(async () => {\n\t\tif (addonPurchaseInfo && pollProject) {\n\t\t\tconst pollResult = await pollProject({\n\t\t\t\tintervalMillis: 3000,\n\t\t\t\tattempts: 10,\n\t\t\t\tstopCondition: ({ settings }) => pollStopCondition(addonPurchaseInfo, settings),\n\t\t\t})\n\t\t\tswitch (pollResult.status) {\n\t\t\t\tcase PollStatus.TimeoutError:\n\t\t\t\tcase PollStatus.UnhandledError:\n\t\t\t\t\tlog.error(\"Failed to poll project license update when reactivating plan\", pollResult)\n\t\t\t\t\tbreak\n\t\t\t\tcase PollStatus.Success:\n\t\t\t\t\tbreak\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(pollResult)\n\t\t\t}\n\t\t}\n\t\tonSuccess?.()\n\t}, [addonPurchaseInfo, onSuccess, pollProject])\n\n\tasync function onSubmitOrder() {\n\t\trecord(\"ui_interaction\", {\n\t\t\tpage: trackingPages.base,\n\t\t\tid: UIInteraction.confirmAcquireAddOn,\n\t\t})\n\n\t\tconst isSuccessfulPurchase = await purchaseAddOn()\n\t\tif (!isSuccessfulPurchase) return\n\n\t\trecord(\"ui_impression\", { page: trackingPages.success })\n\t\tdismissFn()\n\n\t\ttoast({\n\t\t\ttype: \"add\",\n\t\t\tvariant: \"success\",\n\t\t\tprimaryText: `Purchased ${Dictionary.AddOn}`,\n\t\t\tsecondaryText: \"is now active on your project.\",\n\t\t\tkey: \"successful-add-on-purchase\",\n\t\t\ticon: \"success\",\n\t\t})\n\t\trunAfterReady(handleSuccess)\n\t}\n\n\tswitch (state.status) {\n\t\tcase AddOnStatus.Initial:\n\t\tcase AddOnStatus.Loading:\n\t\t\treturn <Spinner data-testid=\"preview-spinner\" />\n\t\tcase AddOnStatus.Preview:\n\t\tcase AddOnStatus.Submitting:\n\t\t\treturn (\n\t\t\t\t<SettingSection\n\t\t\t\t\ttitle={getAddOnLicenseTypeName(addonLicenseType)}\n\t\t\t\t\taction={\n\t\t\t\t\t\t<Button onClick={onCancelOrDismiss} bold>\n\t\t\t\t\t\t\t<T>Cancel</T>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t}\n\t\t\t\t\tcompact\n\t\t\t\t\tclassName={styles.settingSection}\n\t\t\t\t>\n\t\t\t\t\t<Stack gap={30} padding={30}>\n\t\t\t\t\t\t<AddOnLineItems addOnPreview={state.addOnPreview} period={period} tree={tree} usageData={usageData} />\n\t\t\t\t\t\t<Button variant=\"primary\" onClick={onSubmitOrder} bold enabled={state.status !== AddOnStatus.Submitting}>\n\t\t\t\t\t\t\t{state.status === AddOnStatus.Submitting ? <Spinner /> : <T>Confirm Purchase</T>}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t</SettingSection>\n\t\t\t)\n\t\tcase AddOnStatus.UnauthorizedError:\n\t\t\treturn (\n\t\t\t\t<ErrorModalContent\n\t\t\t\t\tonCancelOrDismiss={onCancelOrDismiss}\n\t\t\t\t\ttitle=\"Unauthorized\"\n\t\t\t\t\tbody=\"Only editors or admins in the workspace can authorize payments. Contact your workspace admin to upgrade your account and purchase add-ons.\"\n\t\t\t\t\terrorPage={trackingPages.errorUnauthorized}\n\t\t\t\t/>\n\t\t\t)\n\t\tcase AddOnStatus.FailedToPreviewError:\n\t\t\treturn (\n\t\t\t\t<ErrorModalContent\n\t\t\t\t\tonCancelOrDismiss={onCancelOrDismiss}\n\t\t\t\t\ttitle=\"Something Went Wrong\"\n\t\t\t\t\tbody=\"Failed to fetch details for preview. Please try again, or contact support.\"\n\t\t\t\t\terrorPage={trackingPages.errorFailedToPreview}\n\t\t\t\t\ttryAgainAction={state.tryAgainAction}\n\t\t\t\t\tshowSupportButton={true}\n\t\t\t\t/>\n\t\t\t)\n\t\tcase AddOnStatus.PaymentDeclinedError:\n\t\t\treturn (\n\t\t\t\t<ErrorModalContent\n\t\t\t\t\tonCancelOrDismiss={onCancelOrDismiss}\n\t\t\t\t\ttitle=\"Payment Declined\"\n\t\t\t\t\tbody={state.message}\n\t\t\t\t\terrorPage={trackingPages.errorPaymentDeclined}\n\t\t\t\t\tbillingPortalButton={<BillingPortalButton teamId={teamId} page={trackingPages.errorPaymentDeclined} />}\n\t\t\t\t\ttryAgainAction={state.tryAgainAction}\n\t\t\t\t/>\n\t\t\t)\n\t\tcase AddOnStatus.ActionRequiredError:\n\t\t\treturn (\n\t\t\t\t<ErrorModalContent\n\t\t\t\t\tonCancelOrDismiss={onCancelOrDismiss}\n\t\t\t\t\ttitle=\"Payment Failed\"\n\t\t\t\t\tbody=\"There was a problem verifying your payment through 3DS. Please try again.\"\n\t\t\t\t\terrorPage={trackingPages.errorActionsRequired}\n\t\t\t\t\tbillingPortalButton={<BillingPortalButton teamId={teamId} page={trackingPages.errorActionsRequired} />}\n\t\t\t\t\ttryAgainAction={state.tryAgainAction}\n\t\t\t\t/>\n\t\t\t)\n\t\tcase AddOnStatus.SitePlanCancelledError:\n\t\t\treturn (\n\t\t\t\t<ErrorModalContent\n\t\t\t\t\tonCancelOrDismiss={onCancelOrDismiss}\n\t\t\t\t\ttitle=\"Site Plan Cancelled\"\n\t\t\t\t\tbody=\"Your site plan has been cancelled. Please reactivate it before purchasing add-ons.\"\n\t\t\t\t\terrorPage={trackingPages.errorSitePlanCancelled}\n\t\t\t\t/>\n\t\t\t)\n\t\tcase AddOnStatus.UnhandledError:\n\t\t\treturn (\n\t\t\t\t<ErrorModalContent\n\t\t\t\t\tonCancelOrDismiss={onCancelOrDismiss}\n\t\t\t\t\ttitle=\"Something Went Wrong\"\n\t\t\t\t\tbody=\"We were unable to charge your card. Please try again, or contact support.\"\n\t\t\t\t\terrorPage={trackingPages.errorUnhandled}\n\t\t\t\t\ttryAgainAction={state.tryAgainAction}\n\t\t\t\t\tshowSupportButton={true}\n\t\t\t\t/>\n\t\t\t)\n\t\tdefault:\n\t\t\tassertNever(state)\n\t}\n}\n\nfunction pollStopCondition({ addonLicenseType, quantity }: AddonPurchaseInfo, settings: ProjectSettings): boolean {\n\tswitch (addonLicenseType) {\n\t\tcase AddOnLicenseType.Locale:\n\t\t\treturn settings.resourceLimits.locales === quantity\n\t\tcase AddOnLicenseType.AdvancedAnalytics: {\n\t\t\tconst currentLimit = settings.resourceLimits.trackingEventsLimit\n\t\t\t// Unlimited users shouldn't be purchasing tracking events\n\t\t\tif (currentLimit === null) return true\n\t\t\treturn currentLimit >= (quantity ?? 0)\n\t\t}\n\t\tcase AddOnLicenseType.CustomProxySetup:\n\t\t\treturn settings.featureFlags.canUseCustomCanonicalUrl === \"on\"\n\t\tcase AddOnLicenseType.Bandwidth: {\n\t\t\tconst currentLimit = settings.resourceLimits.bandwidthInGB\n\t\t\t// Unlimited bandwidth users shouldn't be purchasing bandwidth add-ons\n\t\t\tif (currentLimit === null) return true\n\t\t\treturn currentLimit >= (quantity ?? 0)\n\t\t}\n\t\tcase AddOnLicenseType.Pages: {\n\t\t\tconst currentLimit = settings.resourceLimits.pages\n\t\t\t// Unlimited pages users shouldn't be purchasing pages add-ons\n\t\t\tif (currentLimit === null) return true\n\t\t\treturn currentLimit >= (quantity ?? 0)\n\t\t}\n\t\tcase AddOnLicenseType.CmsCollections: {\n\t\t\tconst currentLimit = settings.resourceLimits.cmsCollections\n\t\t\t// Unlimited CMS collections users shouldn't be purchasing CMS collections add-ons\n\t\t\tif (currentLimit === null) return true\n\t\t\treturn currentLimit >= (quantity ?? 0)\n\t\t}\n\t\tcase AddOnLicenseType.CmsItems: {\n\t\t\tconst currentLimit = settings.resourceLimits.cmsItems\n\t\t\t// Unlimited CMS items users shouldn't be purchasing CMS items add-ons\n\t\t\tif (currentLimit === null) return true\n\t\t\treturn currentLimit >= (quantity ?? 0)\n\t\t}\n\t\tdefault:\n\t\t\tassertNever(addonLicenseType)\n\t}\n}\n", "import \"PlansInfo.styles_18cs4xq.wyw.css\"; export const infoSectionHeading = \"infoSectionHeading_i1cgup3f\";\nexport const infoSection = \"infoSection_il7vqp2\";\nexport const infoSectionError = \"infoSectionError_iesvci4\";\nexport const infoSectionSuccess = \"infoSectionSuccess_intr5im\";\nexport const infoSectionIcon = \"infoSectionIcon_i1f3gb63\";\nexport const infoSectionBody = \"infoSectionBody_i1jhir6c\";\nexport const plansInfoTransparent = \"plansInfoTransparent_p2p5blv\";\nexport const infoButtons = \"infoButtons_i1fcvjd1\";", "import { Stack, Translatable as T } from \"@framerjs/fresco\"\nimport { cx } from \"@linaria/core\"\nimport type React from \"react\"\nimport { SettingSection } from \"../../../SettingSection.tsx\"\nimport * as styles from \"./PlansInfo.styles.ts\"\n\nexport function SuccessIcon() {\n\treturn (\n\t\t<Stack\n\t\t\tjustifyContent=\"center\"\n\t\t\talignItems=\"center\"\n\t\t\tclassName={cx(styles.infoSectionIcon, styles.infoSectionSuccess)}\n\t\t>\n\t\t\t<svg width=\"18\" height=\"18\">\n\t\t\t\t<title>Success</title>\n\t\t\t\t<path\n\t\t\t\t\td=\"M 0 4 C 0 1.791 1.791 0 4 0 L 14 0 C 16.209 0 18 1.791 18 4 L 18 14 C 18 16.209 16.209 18 14 18 L 4 18 C 1.791 18 0 16.209 0 14 Z\"\n\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M 5 9 L 7.667 11.667 L 13 6.333\"\n\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\tstroke=\"rgba(255, 255, 255, 1.00)\"\n\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</Stack>\n\t)\n}\n\nexport function ErrorIcon() {\n\treturn (\n\t\t<Stack justifyContent=\"center\" alignItems=\"center\" className={cx(styles.infoSectionIcon, styles.infoSectionError)}>\n\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\">\n\t\t\t\t<title>Error</title>\n\t\t\t\t<path\n\t\t\t\t\td=\"M 0 4 C 0 1.791 1.791 0 4 0 L 14 0 C 16.209 0 18 1.791 18 4 L 18 14 C 18 16.209 16.209 18 14 18 L 4 18 C 1.791 18 0 16.209 0 14 Z\"\n\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M 5 13 L 13 5\"\n\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\tstroke=\"rgba(255, 255, 255, 1.00)\"\n\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M 13 13 L 5 5\"\n\t\t\t\t\tfill=\"transparent\"\n\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\tstroke=\"rgba(255, 255, 255, 1.00)\"\n\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</Stack>\n\t)\n}\n\nexport function PlansInfo({\n\ticon,\n\ttitle,\n\tbody,\n\tbutton,\n\tclassName,\n\tcompact = false,\n}: {\n\ticon: \"error\" | \"success\"\n\ttitle: string\n\tbody: React.ReactNode\n\tbutton?: React.ReactNode\n\tclassName?: string\n\tcompact?: boolean\n}) {\n\treturn (\n\t\t<SettingSection className={className} compact={compact}>\n\t\t\t<Stack gap={20} justifyContent=\"center\" alignItems=\"center\" className={styles.infoSection}>\n\t\t\t\t{icon === \"error\" && <ErrorIcon />}\n\t\t\t\t{icon === \"success\" && <SuccessIcon />}\n\t\t\t\t<span className={styles.infoSectionHeading}>\n\t\t\t\t\t<T>{title}</T>\n\t\t\t\t</span>\n\t\t\t\t<div className={styles.infoSectionBody}>{body}</div>\n\t\t\t\t{button}\n\t\t\t</Stack>\n\t\t</SettingSection>\n\t)\n}\n", "import \"AcquireAddOnModal.styles_1r6ixhm.wyw.css\"; export const modal = \"modal_mlg9civ\";\nexport const settingSection = \"settingSection_sfp0vyp\";\nexport const plansInfoModal = \"plansInfoModal_p1mm9zhk\";\nexport const errorBodyText = \"errorBodyText_ecje7p2\";", "import { AddOnLicenseType, ProjectLicensePeriod, getAddOnLicenseTypeName } from \"@framerjs/app-shared\"\nimport type { Usage } from \"@framerjs/app-shared/src/ProjectState.ts\"\nimport { IconCheckmark, Stack, Translatable as T } from \"@framerjs/fresco\"\nimport { cx } from \"@linaria/core\"\nimport { Dictionary } from \"app/dictionary.ts\"\nimport { format } from \"date-fns\"\nimport { formatNumberCommaSeparatorNotation } from \"document/components/chrome/analytics/utils/formatUtils.ts\"\nimport { getWebPageNodeCountWithout404 } from \"document/components/chrome/shared/UpsellModal/utils/publishMultiPageSiteUpsell.ts\"\nimport type { CanvasTree } from \"document/models/CanvasTree/CanvasTree.ts\"\nimport { assertNever } from \"library/utils/assert.ts\"\nimport { useMemo } from \"react\"\nimport { getCollectionCount, getTotalCollectionItemCount } from \"utils/collectionUtils.ts\"\nimport { Separator } from \"web/components/Separator.tsx\"\nimport { BYTES_PER_UNIT } from \"../../../Usage/constants.ts\"\nimport { formatPrice } from \"../../utils/formatPrice.ts\"\nimport * as styles from \"./AddOnLineItems.styles.ts\"\nimport type { AddOnPreview, AddOnPreviewItem } from \"./api/previewAddOn.ts\"\n\ninterface LineItemsProps {\n\taddOnPreview: AddOnPreview\n\tperiod: ProjectLicensePeriod\n\ttree: CanvasTree\n\tusageData?: Usage\n}\n\nfunction getTotalPriceBeforeProration(items: AddOnPreviewItem[]) {\n\treturn items.reduce((acc, item) => {\n\t\treturn acc + parseFloat(item.unitAmount) * item.quantity\n\t}, 0)\n}\n\nfunction getAddOnTitle(item: AddOnPreviewItem): string {\n\tconst addOnTitle = getAddOnLicenseTypeName(item.licenseType)\n\tconst { quantity, unitsPerQuantity } = item\n\n\tswitch (item.licenseType) {\n\t\tcase AddOnLicenseType.Bandwidth:\n\t\t\treturn `${quantity} \u2A09 Additional ${unitsPerQuantity ?? \"\"}GB bandwidth`\n\t\tcase AddOnLicenseType.Pages:\n\t\t\treturn `${quantity} \u2A09 Additional ${unitsPerQuantity ?? \"\"} pages`\n\t\tcase AddOnLicenseType.CmsCollections:\n\t\t\treturn `${quantity} \u2A09 Additional ${unitsPerQuantity ?? \"\"} CMS collections`\n\t\tcase AddOnLicenseType.CmsItems:\n\t\t\treturn `${quantity} \u2A09 Additional ${unitsPerQuantity ?? \"\"} CMS items`\n\t\tcase AddOnLicenseType.AdvancedAnalytics:\n\t\t\treturn `${quantity > 1 ? `${quantity} \u2715 ` : \"\"}${addOnTitle} ${Dictionary.AddOn}`\n\t\tcase AddOnLicenseType.CustomProxySetup:\n\t\tcase AddOnLicenseType.Locale:\n\t\t\treturn `${quantity > 1 ? `${quantity} \u2715 ` : \"\"}${addOnTitle}`\n\t\tdefault:\n\t\t\tassertNever(item.licenseType)\n\t}\n}\n\nfunction getAddOnUsage(licenseType: AddOnLicenseType, tree: CanvasTree, usageData?: Usage): number | null {\n\tswitch (licenseType) {\n\t\tcase AddOnLicenseType.AdvancedAnalytics:\n\t\t\treturn usageData?.advancedAnalytics?.previousMonth ?? null\n\t\tcase AddOnLicenseType.Bandwidth: {\n\t\t\tconst usage = Math.max(usageData?.bandwidth?.currentMonth ?? 0, usageData?.bandwidth?.previousMonth ?? 0)\n\t\t\treturn Math.ceil(usage / BYTES_PER_UNIT.GB)\n\t\t}\n\t\tcase AddOnLicenseType.Pages:\n\t\t\treturn getWebPageNodeCountWithout404(tree)\n\t\tcase AddOnLicenseType.CmsCollections:\n\t\t\treturn getCollectionCount(tree)\n\t\tcase AddOnLicenseType.CmsItems:\n\t\t\treturn getTotalCollectionItemCount(tree)\n\t\tcase AddOnLicenseType.CustomProxySetup:\n\t\tcase AddOnLicenseType.Locale:\n\t\t\treturn null\n\t\tdefault:\n\t\t\tassertNever(licenseType)\n\t}\n}\n\nfunction getAddOnDescription(\n\titem: AddOnPreviewItem,\n\tperiod: ProjectLicensePeriod,\n\tcurrency: string,\n\ttree: CanvasTree,\n\tusageData?: Usage,\n): string {\n\tconst pricePerMonth =\n\t\tperiod === ProjectLicensePeriod.Month\n\t\t\t? formatPrice(parseFloat(item.unitAmount), currency, true)\n\t\t\t: formatPrice(parseFloat(item.unitAmount) / 12, currency, true)\n\n\tconst billedYearly = period === ProjectLicensePeriod.Year ? \", billed yearly\" : \"\"\n\tconst usage = getAddOnUsage(item.licenseType, tree, usageData)\n\tconst formattedUsage = usage !== null ? formatNumberCommaSeparatorNotation(usage) : null\n\n\tswitch (item.licenseType) {\n\t\tcase AddOnLicenseType.AdvancedAnalytics:\n\t\t\treturn `Optimize your site with A/B tests, funnels, triggers, and more for ${pricePerMonth} per month${billedYearly}. Billing is per 500,000 events, and last month you had ${formattedUsage ?? 0} events.`\n\t\tcase AddOnLicenseType.Bandwidth:\n\t\t\treturn `${pricePerMonth} per month${billedYearly}, per additional ${item.unitsPerQuantity ?? \"\"}GB bandwidth. Currently, you're using ${formattedUsage ?? 0}GB.`\n\t\tcase AddOnLicenseType.Pages:\n\t\t\treturn `${pricePerMonth} per month${billedYearly}, per additional ${item.unitsPerQuantity ?? \"\"} pages. Currently, you're using ${formattedUsage ?? 0} pages.`\n\t\tcase AddOnLicenseType.CmsCollections:\n\t\t\treturn `${pricePerMonth} per month${billedYearly}, per additional ${item.unitsPerQuantity ?? \"\"} CMS collections. Currently, you're using ${formattedUsage ?? 0} collections.`\n\t\tcase AddOnLicenseType.CmsItems:\n\t\t\treturn `${pricePerMonth} per month${billedYearly}, per additional ${item.unitsPerQuantity ?? \"\"} CMS items. Currently, you're using ${formattedUsage ?? 0} items.`\n\t\tcase AddOnLicenseType.Locale: {\n\t\t\tconst quantityText = item.quantity > 1 ? \" per locale\" : \"\"\n\t\t\treturn `${pricePerMonth}${quantityText} per month${billedYearly}`\n\t\t}\n\t\tcase AddOnLicenseType.CustomProxySetup:\n\t\t\treturn `${pricePerMonth} per month${billedYearly}`\n\t\tdefault:\n\t\t\tassertNever(item.licenseType)\n\t}\n}\n\nfunction AddOnLineItem({\n\titem,\n\tperiod,\n\tcurrency,\n\ttree,\n\tusageData,\n}: {\n\titem: AddOnPreviewItem\n\tperiod: ProjectLicensePeriod\n\tcurrency: string\n\ttree: CanvasTree\n\tusageData?: Usage\n}) {\n\tconst title = useMemo(() => getAddOnTitle(item), [item])\n\tconst description = useMemo(\n\t\t() => getAddOnDescription(item, period, currency, tree, usageData),\n\t\t[item, period, currency, tree, usageData],\n\t)\n\tconst priceBeforeProration = parseFloat(item.unitAmount) * item.quantity\n\n\treturn (\n\t\t<>\n\t\t\t<LineItem title={title} description={description} price={formatPrice(priceBeforeProration, currency)} />\n\t\t\t<Separator height={1} />\n\t\t</>\n\t)\n}\n\nexport function AddOnLineItems({ addOnPreview, period, tree, usageData }: LineItemsProps) {\n\tconst { currency, total, subtotal, credit, totalWithCredit, tax, items, nextBillDate } = addOnPreview\n\n\tconst subscriptionRenew = format(new Date(nextBillDate), \"MMM do, yyyy\")\n\n\tconst orderTotal = parseFloat(total)\n\tconst orderSubtotal = parseFloat(subtotal)\n\tconst orderTax = tax ? parseFloat(tax) : 0\n\tconst orderCredit = parseFloat(credit)\n\tconst orderAppliedCredit = calculateAppliedCredit(orderCredit, orderTotal)\n\tconst orderTotalWithCredit = parseFloat(totalWithCredit)\n\tconst priceBeforeProration = getTotalPriceBeforeProration(items)\n\tconst orderProration = orderSubtotal - priceBeforeProration\n\n\tconst renewalSmallPrint = `Your plan will renew on ${subscriptionRenew}`\n\tconst smallPrintItems =\n\t\torderProration !== 0 ? [\"You will get charged pro-rata immediately\", renewalSmallPrint] : [renewalSmallPrint]\n\n\treturn (\n\t\t<>\n\t\t\t{items.map(item => (\n\t\t\t\t<AddOnLineItem\n\t\t\t\t\tkey={item.unitAmount}\n\t\t\t\t\titem={item}\n\t\t\t\t\tperiod={period}\n\t\t\t\t\tcurrency={currency}\n\t\t\t\t\ttree={tree}\n\t\t\t\t\tusageData={usageData}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{orderProration !== 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<LineItem\n\t\t\t\t\t\ttitle=\"Proration\"\n\t\t\t\t\t\tdescription=\"We deduct what you already paid for within the current plan, plus the unused period between the start of this billing cycle and now\"\n\t\t\t\t\t\tprice={formatPrice(orderProration, currency)}\n\t\t\t\t\t/>\n\t\t\t\t\t<Separator height={1} />\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<Stack>\n\t\t\t\t{orderTax !== 0 && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<LineItem title=\"Subtotal\" price={formatPrice(orderSubtotal, currency)} />\n\t\t\t\t\t\t<LineItem title=\"VAT\" price={formatPrice(orderTax, currency)} />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t<LineItem title=\"Total\" price={formatPrice(orderTotal, currency)} bold />\n\t\t\t\t{orderCredit < 0 && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<LineItem title=\"Applied Credit\" price={formatPrice(orderAppliedCredit, currency)} />\n\t\t\t\t\t\t<LineItem title=\"You Pay Now\" price={formatPrice(orderTotalWithCredit, currency)} bold />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t<Separator height={1} />\n\t\t\t<SmallPrint items={smallPrintItems} />\n\t\t</>\n\t)\n}\n\nfunction LineItem({\n\ttitle,\n\tdescription,\n\tprice,\n\tbold,\n}: {\n\ttitle: string\n\tdescription?: React.ReactNode\n\tprice: string\n\tbold?: boolean\n}) {\n\treturn (\n\t\t<Stack direction=\"row\" justifyContent=\"space-between\">\n\t\t\t<Stack gap={5}>\n\t\t\t\t<Stack direction=\"row\" gap={5}>\n\t\t\t\t\t<T className={cx(bold && styles.bold)}>{title}</T>\n\t\t\t\t</Stack>\n\t\t\t\t{description && <div className={styles.previewDescription}>{description}</div>}\n\t\t\t</Stack>\n\t\t\t<div className={cx(bold && styles.bold, styles.price)}>{price}</div>\n\t\t</Stack>\n\t)\n}\n\nfunction SmallPrint({ items }: { items: string[] }) {\n\treturn (\n\t\t<Stack gap={15}>\n\t\t\t{items.map(item => (\n\t\t\t\t<Stack key={item} direction=\"row\" alignItems=\"center\">\n\t\t\t\t\t<div className={styles.smallPrintIconContainer}>\n\t\t\t\t\t\t<IconCheckmark animate={false} className={styles.smallPrintCheckmark} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<T className={styles.smallPrintDescription}>{item}</T>\n\t\t\t\t</Stack>\n\t\t\t))}\n\t\t</Stack>\n\t)\n}\n\nfunction calculateAppliedCredit(credit: number, orderTotal: number): number {\n\t// If the credit is higher than the order total, max the applied credit to the same amount of the order\n\treturn orderTotal + credit < 0 ? 0 - orderTotal : credit\n}\n", "import \"AddOnLineItems.styles_bxess6.wyw.css\"; export const previewDescription = \"previewDescription_p11h8ns5\";\nexport const smallPrintIconContainer = \"smallPrintIconContainer_sjgkjmo\";\nexport const smallPrintCheckmark = \"smallPrintCheckmark_sgtdnb9\";\nexport const smallPrintDescription = \"smallPrintDescription_s1hw7ci3\";\nexport const bold = \"bold_b156xebj\";\nexport const price = \"price_p12xelsf\";", "import { assertNever } from \"@framerjs/shared\"\nimport { useCallback, useState } from \"react\"\nimport { PaymentErrorStatus } from \"../api/errors/paymentError.ts\"\nimport { getAddOnPlanId } from \"./api/getAddOnPlanId.ts\"\nimport type { AddOnPreview } from \"./api/previewAddOn.ts\"\nimport { PreviewAddOnStatus, postAddOnPreview } from \"./api/previewAddOn.ts\"\nimport { PutAddOnSubscriptionStatus, putAddOnSubscription } from \"./api/putAddOnSubscription.ts\"\nimport type { AddonPurchaseInfo } from \"./useAddonPurchaseInfo.ts\"\n\nexport enum AddOnStatus {\n\tInitial,\n\tLoading,\n\tPreview,\n\tSubmitting,\n\t// Errors\n\tUnauthorizedError,\n\tFailedToPreviewError,\n\tPaymentDeclinedError,\n\t/** 3DS verification error */\n\tActionRequiredError,\n\tSitePlanCancelledError,\n\tUnhandledError,\n}\n\ntype ModalState =\n\t| { status: AddOnStatus.Initial }\n\t| { status: AddOnStatus.Loading }\n\t| { status: AddOnStatus.Preview; addOnPreview: AddOnPreview; planToBuy: string }\n\t| { status: AddOnStatus.Submitting; addOnPreview: AddOnPreview; planToBuy: string }\n\t| { status: AddOnStatus.UnauthorizedError }\n\t| { status: AddOnStatus.FailedToPreviewError; tryAgainAction: () => void }\n\t| { status: AddOnStatus.PaymentDeclinedError; message: string; tryAgainAction: () => void }\n\t| { status: AddOnStatus.ActionRequiredError; tryAgainAction: () => void }\n\t| { status: AddOnStatus.UnhandledError; tryAgainAction: () => void }\n\t| { status: AddOnStatus.SitePlanCancelledError }\ninterface AddOnResult {\n\tstate: ModalState\n\t/**\n\t * Previews the add-on and returns the add-on order preview.\n\t * If the add-on planId is null, it will resolve the plan id from the server.\n\t */\n\tpreviewAddOn: (planId: string | null) => Promise<void>\n\t/**\n\t * Purchases the add-on. Resolves with `true` when the purchase was successful and `false` otherwise.\n\t */\n\tpurchaseAddOn: () => Promise<boolean>\n}\n\nexport function useAcquireAddOn(\n\tinfo: AddonPurchaseInfo,\n\tisBillingV3: boolean,\n\tonSitePlanCancelled?: () => void,\n): AddOnResult {\n\tconst { projectId, addonLicenseType, quantity, projectLicenseType, period } = info\n\tconst [state, setState] = useState<ModalState>({ status: AddOnStatus.Initial })\n\n\tconst previewAddOn = useCallback(\n\t\tasync (planId: string | null) => {\n\t\t\tsetState({ status: AddOnStatus.Loading })\n\n\t\t\tconst planToBuy = planId ?? (await getAddOnPlanId({ projectLicenseType, addonLicenseType, period, isBillingV3 }))\n\n\t\t\tif (!planToBuy) {\n\t\t\t\treturn setState({\n\t\t\t\t\tstatus: AddOnStatus.FailedToPreviewError,\n\t\t\t\t\ttryAgainAction: () => previewAddOn(null),\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst response = await postAddOnPreview(projectId, { plan: planToBuy, quantity }, isBillingV3)\n\t\t\tswitch (response.status) {\n\t\t\t\tcase PreviewAddOnStatus.Success:\n\t\t\t\t\treturn setState({\n\t\t\t\t\t\tstatus: AddOnStatus.Preview,\n\t\t\t\t\t\taddOnPreview: response.addOnPreview,\n\t\t\t\t\t\tplanToBuy,\n\t\t\t\t\t})\n\t\t\t\tcase PreviewAddOnStatus.SitePlanCancelled: {\n\t\t\t\t\treturn onSitePlanCancelled?.()\n\t\t\t\t}\n\t\t\t\tcase PreviewAddOnStatus.Unauthorized:\n\t\t\t\t\treturn setState({ status: AddOnStatus.UnauthorizedError })\n\t\t\t\tcase PreviewAddOnStatus.UnhandledError:\n\t\t\t\t\treturn setState({\n\t\t\t\t\t\tstatus: AddOnStatus.FailedToPreviewError,\n\t\t\t\t\t\ttryAgainAction: () => previewAddOn(planToBuy),\n\t\t\t\t\t})\n\t\t\t\tdefault:\n\t\t\t\t\tassertNever(response)\n\t\t\t}\n\t\t},\n\t\t[quantity, period, projectLicenseType, projectId, addonLicenseType, onSitePlanCancelled, isBillingV3],\n\t)\n\n\tconst purchaseAddOn = useCallback(async (): Promise<boolean> => {\n\t\tif (state.status !== AddOnStatus.Preview) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst { addOnPreview, planToBuy } = state\n\t\tsetState({ status: AddOnStatus.Submitting, addOnPreview, planToBuy })\n\n\t\tconst response = await putAddOnSubscription(projectId, { plan: planToBuy, quantity }, isBillingV3)\n\n\t\tfunction backToPreview() {\n\t\t\tsetState({ status: AddOnStatus.Preview, addOnPreview, planToBuy })\n\t\t}\n\n\t\tswitch (response.status) {\n\t\t\tcase PutAddOnSubscriptionStatus.PaymentError:\n\t\t\t\tswitch (response.error.status) {\n\t\t\t\t\tcase PaymentErrorStatus.PaymentDeclined:\n\t\t\t\t\t\tsetState({\n\t\t\t\t\t\t\tstatus: AddOnStatus.PaymentDeclinedError,\n\t\t\t\t\t\t\tmessage: response.error.message,\n\t\t\t\t\t\t\ttryAgainAction: backToPreview,\n\t\t\t\t\t\t})\n\t\t\t\t\t\treturn false\n\t\t\t\t\tcase PaymentErrorStatus.Unauthorized:\n\t\t\t\t\t\tsetState({ status: AddOnStatus.UnauthorizedError })\n\t\t\t\t\t\treturn false\n\t\t\t\t\tcase PaymentErrorStatus.ActionRequiredError:\n\t\t\t\t\t\tsetState({ status: AddOnStatus.ActionRequiredError, tryAgainAction: backToPreview })\n\t\t\t\t\t\treturn false\n\t\t\t\t\tcase PaymentErrorStatus.TaxLocationInvalid:\n\t\t\t\t\tcase PaymentErrorStatus.UnhandledError:\n\t\t\t\t\t\tsetState({ status: AddOnStatus.UnhandledError, tryAgainAction: backToPreview })\n\t\t\t\t\t\treturn false\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tassertNever(response.error)\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\tcase PutAddOnSubscriptionStatus.SitePlanCancelled:\n\t\t\t\tsetState({ status: AddOnStatus.SitePlanCancelledError })\n\t\t\t\treturn false\n\t\t\tcase PutAddOnSubscriptionStatus.Success:\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\tassertNever(response)\n\t\t}\n\t}, [quantity, projectId, state, isBillingV3])\n\n\treturn {\n\t\tstate,\n\t\tpreviewAddOn,\n\t\tpurchaseAddOn,\n\t}\n}\n", "import { type AddOnLicenseType, ApiError, HTTP_ERROR_CODES } from \"@framerjs/app-shared\"\nimport { getLogger } from \"@framerjs/shared\"\nimport { apiFetcher } from \"web/lib/apiFetcher.ts\"\n\nconst log = getLogger(\"previewAddOn\")\n\nexport enum PreviewAddOnStatus {\n\tSuccess,\n\tUnauthorized,\n\tUnhandledError,\n\tSitePlanCancelled,\n}\n\nexport interface AddOnPreviewItem {\n\tquantity: number\n\tamountWithoutProration: string\n\tunitAmount: string\n\tlicenseType: AddOnLicenseType\n\ttrialExpirationDate?: string\n\tunitsPerQuantity?: number\n}\n\nexport interface AddOnPreview {\n\ttotal: string\n\tsubtotal: string\n\ttax: string | null\n\tcredit: string // E.g. \"-18.15\"\n\ttotalWithCredit: string\n\titems: AddOnPreviewItem[]\n\tnextBillDate: Date\n\tcurrency: string\n}\n\ntype AddOnPreviewResponse =\n\t| {\n\t\t\tstatus: PreviewAddOnStatus.Success\n\t\t\taddOnPreview: AddOnPreview\n\t  }\n\t| {\n\t\t\tstatus: PreviewAddOnStatus.Unauthorized | PreviewAddOnStatus.UnhandledError | PreviewAddOnStatus.SitePlanCancelled\n\t  }\n\nexport async function postAddOnPreview(\n\tprojectId: string,\n\taddOnBody: { plan: string; quantity: number },\n\tisBillingV3: boolean,\n): Promise<AddOnPreviewResponse> {\n\ttry {\n\t\tconst url = isBillingV3\n\t\t\t? `/web/v4/projects/${projectId}/subscription/preview`\n\t\t\t: `/web/v2/projects/${projectId}/subscription/addons/preview`\n\t\tconst body = isBillingV3 ? { addOns: [addOnBody] } : addOnBody\n\t\tconst previewOrder = await apiFetcher.post(url, body)\n\t\treturn { status: PreviewAddOnStatus.Success, addOnPreview: previewOrder }\n\t} catch (error) {\n\t\tif (error instanceof ApiError) {\n\t\t\tif (error.status === HTTP_ERROR_CODES.Forbidden) {\n\t\t\t\treturn { status: PreviewAddOnStatus.Unauthorized }\n\t\t\t}\n\t\t\tif (error.status === HTTP_ERROR_CODES.Conflict && error.data.reason === \"site_plan_cancelled\") {\n\t\t\t\treturn { status: PreviewAddOnStatus.SitePlanCancelled }\n\t\t\t}\n\t\t}\n\n\t\tlog.reportError(error)\n\t\treturn { status: PreviewAddOnStatus.UnhandledError }\n\t}\n}\n", "import { AddOnLicenseType } from \"@framerjs/app-shared\"\nimport type { Project, ProjectLicensePeriod, ProjectLicenseType } from \"@framerjs/app-shared\"\nimport { assertNever } from \"@framerjs/shared\"\nimport { EngineChange } from \"document/EngineChanges.ts\"\nimport type { VekterEngine } from \"document/VekterEngine.ts\"\nimport { getLocalesCount } from \"document/components/chrome/shared/UpsellModal/utils/localizationUpsellModals.tsx\"\nimport type { CanvasTree } from \"document/models/CanvasTree/CanvasTree.ts\"\nimport { useEngineState } from \"document/useEngineState.ts\"\n\nexport type AddonInfo =\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.AdvancedAnalytics\n\t\t\tquantity: number\n\t  }\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.Locale\n\t  }\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.CustomProxySetup\n\t  }\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.Bandwidth\n\t\t\tquantity: number\n\t  }\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.Pages\n\t\t\tquantity: number\n\t  }\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.CmsCollections\n\t\t\tquantity: number\n\t  }\n\t| {\n\t\t\taddonLicenseType: AddOnLicenseType.CmsItems\n\t\t\tquantity: number\n\t  }\n\nexport interface AddonPurchaseInfo {\n\tteamId: string\n\tprojectId: string\n\tprojectLicenseType: ProjectLicenseType\n\tperiod: ProjectLicensePeriod\n\taddonLicenseType: AddOnLicenseType\n\tquantity: number\n}\n\nconst getQuantity = (addonInfo: AddonInfo, tree: CanvasTree) => {\n\tconst { addonLicenseType } = addonInfo\n\tswitch (addonLicenseType) {\n\t\tcase AddOnLicenseType.Locale: {\n\t\t\treturn getLocalesCount(tree, true)\n\t\t}\n\t\tcase AddOnLicenseType.CustomProxySetup: {\n\t\t\treturn 1\n\t\t}\n\t\tcase AddOnLicenseType.AdvancedAnalytics:\n\t\tcase AddOnLicenseType.Bandwidth:\n\t\tcase AddOnLicenseType.Pages:\n\t\tcase AddOnLicenseType.CmsCollections:\n\t\tcase AddOnLicenseType.CmsItems:\n\t\t\treturn addonInfo.quantity\n\t\tdefault:\n\t\t\tassertNever(addonLicenseType)\n\t}\n}\n\n/**\n *  Retrieves the project information needed to purchase an add-on.\n */\nexport function useAddonPurchaseInfo(addonInfo: AddonInfo, engine: VekterEngine): AddonPurchaseInfo | null {\n\treturn useEngineState(\n\t\t() => {\n\t\t\tconst project = engine.stores.projectStore.project\n\t\t\treturn project?.license.period && project.space.scope === \"organization\"\n\t\t\t\t? {\n\t\t\t\t\t\tteamId: project.space.ownerId,\n\t\t\t\t\t\tprojectId: project.id,\n\t\t\t\t\t\tprojectLicenseType: project.license.type,\n\t\t\t\t\t\taddonLicenseType: addonInfo.addonLicenseType,\n\t\t\t\t\t\tperiod: project.license.period,\n\t\t\t\t\t\tquantity: getQuantity(addonInfo, engine.tree),\n\t\t\t\t\t}\n\t\t\t\t: null\n\t\t},\n\t\t[],\n\t\t[EngineChange.Tree, engine.stores.projectStore],\n\t)\n}\n\nexport function getAddonPurchaseInfo(\n\taddonInfo: AddonInfo,\n\ttree: CanvasTree,\n\tproject: Project | null,\n): AddonPurchaseInfo | null {\n\treturn project?.license.period && project.team\n\t\t? {\n\t\t\t\tteamId: project.team?.id,\n\t\t\t\tprojectId: project.id,\n\t\t\t\tprojectLicenseType: project.license.type,\n\t\t\t\taddonLicenseType: addonInfo.addonLicenseType,\n\t\t\t\tperiod: project.license.period,\n\t\t\t\tquantity: getQuantity(addonInfo, tree),\n\t\t\t}\n\t\t: null\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAsD,IAAM,gBAAgB;;;ACErE,SAASA,eAAc,IAAa;AAC1C,MAAI,GAAG,UAAU,SAAgB,aAAa,GAAG;AAChD,OAAG,UAAU,OAAc,aAAa;AACxC,OAAG,eAAe;AAAA,EACnB;AACA,KAAG,iBAAiB,gBAAgB,SAAS,iBAAiB;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gDAAwC;AACvC,aAAO;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AACC,aAAO,UAAU;AAAA,IAClB;AACC,kBAAY,gBAAgB;AAAA,EAC9B;AACD;AAKO,SAAS,qBAAqB,WAAsB,QAAgD;AAC1G,SAAO;AAAA,IACN,MAAM;AACL,YAAM,UAAU,OAAO,OAAO,aAAa;AAC3C,aAAO,SAAS,QAAQ,UAAU,QAAQ,MAAM,UAAU,iBACvD;AAAA,QACA,QAAQ,QAAQ,MAAM;AAAA,QACtB,WAAW,QAAQ;AAAA,QACnB,oBAAoB,QAAQ,QAAQ;AAAA,QACpC,kBAAkB,UAAU;AAAA,QAC5B,QAAQ,QAAQ,QAAQ;AAAA,QACxB,UAAU,YAAY,WAAW,OAAO,IAAI;AAAA,MAC7C,IACC;AAAA,IACJ;AAAA,IACA,CAAC;AAAA,IACD,oBAAoB,OAAO,OAAO,YAAY;AAAA,EAC/C;AACD;AAEO,SAAS,qBACf,WACA,MACA,SAC2B;AAC3B,SAAO,SAAS,QAAQ,UAAU,QAAQ,OACvC;AAAA,IACA,QAAQ,QAAQ,MAAM;AAAA,IACtB,WAAW,QAAQ;AAAA,IACnB,oBAAoB,QAAQ,QAAQ;AAAA,IACpC,kBAAkB,UAAU;AAAA,IAC5B,QAAQ,QAAQ,QAAQ;AAAA,IACxB,UAAU,YAAY,WAAW,IAAI;AAAA,EACtC,IACC;AACJ;",
  "names": ["rotateElement", "import_react", "import_jsx_runtime", "assertNever", "price", "bold", "import_react", "import_jsx_runtime", "log"]
}
