@bunnyapp/components 1.0.45 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +289 -222
- package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +1 -2
- package/dist/cjs/src/components/BillingDetails/BillingDetailsForm.d.ts +1 -2
- package/dist/cjs/src/components/Checkout/Checkout.d.ts +1 -2
- package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +1 -2
- package/dist/cjs/src/components/CustomizedAntdComponents/Tag.d.ts +36 -0
- package/dist/cjs/src/components/Invoice/Invoice.d.ts +1 -1
- package/dist/cjs/src/components/Invoice/Invoice.stories.d.ts +0 -1
- package/dist/cjs/src/components/Invoice/InvoiceQuoteContext.d.ts +0 -1
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -2
- package/dist/cjs/src/components/PaymentForm/useRemovePaymentMethod.d.ts +1 -1
- package/dist/cjs/src/components/Quote/Quote.d.ts +1 -1
- package/dist/cjs/src/components/Quote/Quote.stories.d.ts +0 -10
- package/dist/cjs/src/components/Quotes/Quotes.d.ts +1 -2
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +1 -2
- package/dist/cjs/src/components/Signup/Signup.d.ts +1 -3
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -2
- package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +1 -2
- package/dist/cjs/src/components/Subscriptions/Subscriptions.stories.d.ts +2 -0
- package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +0 -1
- package/dist/cjs/src/components/Transactions/Transactions.d.ts +1 -3
- package/dist/cjs/src/components/Transactions/Transactions.stories.d.ts +0 -1
- package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +0 -1
- package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +1 -2
- package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +1 -2
- package/dist/cjs/src/graphql/mutations/quoteChargeCreate.d.ts +13 -0
- package/dist/cjs/src/graphql/queries/getSubscriptions.d.ts +1 -2
- package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
- package/dist/cjs/src/hooks/useHasTaxPlugin.d.ts +1 -2
- package/dist/cjs/src/hooks/usePaymentMethod.d.ts +1 -2
- package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +1 -2
- package/dist/cjs/src/hooks/usePlugins.d.ts +1 -2
- package/dist/cjs/src/hooks/useSigningPlugins.d.ts +1 -2
- package/dist/esm/index.js +290 -223
- package/dist/esm/src/components/BillingDetails/BillingDetails.d.ts +1 -2
- package/dist/esm/src/components/BillingDetails/BillingDetailsForm.d.ts +1 -2
- package/dist/esm/src/components/Checkout/Checkout.d.ts +1 -2
- package/dist/esm/src/components/Checkout/QuoteCheckout.d.ts +1 -2
- package/dist/esm/src/components/CustomizedAntdComponents/Tag.d.ts +36 -0
- package/dist/esm/src/components/Invoice/Invoice.d.ts +1 -1
- package/dist/esm/src/components/Invoice/Invoice.stories.d.ts +0 -1
- package/dist/esm/src/components/Invoice/InvoiceQuoteContext.d.ts +0 -1
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -2
- package/dist/esm/src/components/PaymentForm/useRemovePaymentMethod.d.ts +1 -1
- package/dist/esm/src/components/Quote/Quote.d.ts +1 -1
- package/dist/esm/src/components/Quote/Quote.stories.d.ts +0 -10
- package/dist/esm/src/components/Quotes/Quotes.d.ts +1 -2
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +1 -2
- package/dist/esm/src/components/Signup/Signup.d.ts +1 -3
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -2
- package/dist/esm/src/components/Subscriptions/Subscriptions.d.ts +1 -2
- package/dist/esm/src/components/Subscriptions/Subscriptions.stories.d.ts +2 -0
- package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +0 -1
- package/dist/esm/src/components/Transactions/Transactions.d.ts +1 -3
- package/dist/esm/src/components/Transactions/Transactions.stories.d.ts +0 -1
- package/dist/esm/src/components/Transactions/TransactionsListContext.d.ts +0 -1
- package/dist/esm/src/graphql/mutations/accountSignup.d.ts +1 -2
- package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +1 -2
- package/dist/esm/src/graphql/mutations/quoteChargeCreate.d.ts +13 -0
- package/dist/esm/src/graphql/queries/getSubscriptions.d.ts +1 -2
- package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
- package/dist/esm/src/hooks/useHasTaxPlugin.d.ts +1 -2
- package/dist/esm/src/hooks/usePaymentMethod.d.ts +1 -2
- package/dist/esm/src/hooks/usePaymentPlugins.d.ts +1 -2
- package/dist/esm/src/hooks/usePlugins.d.ts +1 -2
- package/dist/esm/src/hooks/useSigningPlugins.d.ts +1 -2
- package/dist/index.d.ts +9 -19
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { createContext, useEffect, useState, useContext, useMemo, useCallback, useRef } from 'react';
|
|
3
3
|
import { Markup } from 'interweave';
|
|
4
|
-
import { ConfigProvider, Button,
|
|
4
|
+
import { ConfigProvider, Button, Tag, Typography, Divider, Popconfirm, Input, Checkbox, Collapse, Skeleton, Modal, Form, Drawer, Card as Card$1, Image, Select, Tooltip, Radio, Space, Dropdown } from 'antd';
|
|
5
5
|
import { DownloadOutlined, CreditCardOutlined, BankOutlined, SearchOutlined, CloseOutlined, CheckCircleFilled, ArrowLeftOutlined } from '@ant-design/icons';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { DEFAULT_ACCENT_COLOR, DEFAULT_BRAND_COLOR, DEFAULT_SECONDARY_COLOR, DEFAULT_TOP_NAV_IMAGE_URL, gqlRequest, QueryKeyFactory, useIsMobile, isColorTooDark, MARK_PRO, INPUT_BORDER_COLOR, SLATE_50, SLATE_400, SLATE_200, getPlugins, useAllErrorFormats, formatCurrency, invokePlugin, GRAY_500, GRAY_200, useErrorNotification, useSuccessNotification, getFormattedInvoice, PAYABLE_INVOICE_STATES, BreakpointNumbers, useGraphQLmutation, formatDate, FrontendTransaction, SLATE_600, WHITE, TransactionKind, sortSubscriptionCharges, Lists, getAccount, SLATE_500, PRIMARY_COLOR, StringUtils, BillingPeriod, ChargeType, SubscriptionState as SubscriptionState$2, PERIOD_LABELS, PricingStyle, PricingModel, SLATE_100, useInfoNotification, MODAL_MAX_HEIGHT, DataInterval, TAG_COLORS, SubscriptionChargeKind } from '@bunnyapp/common';
|
|
@@ -44,7 +44,7 @@ function styleInject(css, ref) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
var css_248z = ".ant-divider-horizontal {\n margin: 0;\n}\n.ant-divider-horizontal {\n margin: 0;\n}\n.ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-link:disabled {\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n:root {\n --row-background: #ffffff;\n --row-background-alternate: rgba(100, 116, 139, 0.04);\n --row-background-dark: #121212;\n --row-background-alternate-dark: #1e1e1e;\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n.\\!container {\n width: 100% !important;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n .\\!container {\n max-width: 768px !important;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n .\\!container {\n max-width: 1024px !important;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n .\\!container {\n max-width: 1280px !important;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n .\\!container {\n max-width: 1536px !important;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.sticky {\n position: sticky;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.bottom-16 {\n bottom: 4rem;\n}\n.bottom-8 {\n bottom: 2rem;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.top-32 {\n top: 8rem;\n}\n.top-16 {\n top: 4rem;\n}\n.z-50 {\n z-index: 50;\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.col-span-full {\n grid-column: 1 / -1;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.mx-8 {\n margin-left: 2rem;\n margin-right: 2rem;\n}\n.mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.h-10 {\n height: 2.5rem;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.w-10 {\n width: 2.5rem;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.gap-4 {\n gap: 1rem;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.gap-8 {\n gap: 2rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-sm {\n border-radius: 0.125rem;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.bg-blue-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-16 {\n padding: 4rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.p-48 {\n padding: 12rem;\n}\n.p-44 {\n padding: 11rem;\n}\n.px-12 {\n padding-left: 3rem;\n padding-right: 3rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.px-16 {\n padding-left: 4rem;\n padding-right: 4rem;\n}\n.px-32 {\n padding-left: 8rem;\n padding-right: 8rem;\n}\n.px-48 {\n padding-left: 12rem;\n padding-right: 12rem;\n}\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.px-0 {\n padding-left: 0px;\n padding-right: 0px;\n}\n.px-10 {\n padding-left: 2.5rem;\n padding-right: 2.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pb-32 {\n padding-bottom: 8rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n.font-light {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-medium {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-bold {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
47
|
+
var css_248z = ".ant-divider-horizontal {\n margin: 0;\n}\n.ant-divider-horizontal {\n margin: 0;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-link:disabled {\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n:root {\n --row-background: #ffffff;\n --row-background-alternate: rgba(100, 116, 139, 0.04);\n --row-background-dark: #121212;\n --row-background-alternate-dark: #1e1e1e;\n --bunny-blue-500: #3b82f6;\n --bunny-blue-200: #bfdbfe;\n --bunny-green-600: #059669;\n --bunny-green-200: #a7f3d0;\n --bunny-red-500: #ef4444;\n --bunny-red-200: #fecaca;\n --bunny-orange-500: #f97316;\n --bunny-orange-200: #fed7aa;\n --bunny-yellow-500: #f59e0b;\n --bunny-yellow-200: #fde68a;\n --bunny-purple-500: #8b5cf6;\n --bunny-purple-200: #ddd6fe;\n --bunny-black: #000000;\n}\n* {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\n}\n.hidden {\n display: none;\n}\n.bunny-show-on-hover {\n opacity: 0;\n}\n.bunny-show-on-hover-container:hover .bunny-show-on-hover {\n opacity: 1;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n.bunny-icon-path {\n transition: fill 0.3s;\n}\n.bunny-shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.bunny-shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .bunny-shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .bunny-shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.sticky {\n position: sticky;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-50 {\n z-index: 50;\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.col-span-full {\n grid-column: 1 / -1;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.gap-4 {\n gap: 1rem;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.gap-8 {\n gap: 2rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-sm {\n border-radius: 0.125rem;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.font-light {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-medium {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-bold {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n.bunny-invoice-container {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
48
48
|
styleInject(css_248z);
|
|
49
49
|
|
|
50
50
|
/******************************************************************************
|
|
@@ -237,6 +237,7 @@ function ContextualWrapper(_a) {
|
|
|
237
237
|
colorLinkHover: entityBranding.brandColor,
|
|
238
238
|
fontFamily: MARK_PRO,
|
|
239
239
|
colorBorder: INPUT_BORDER_COLOR,
|
|
240
|
+
lineHeight: 1,
|
|
240
241
|
}, components: {
|
|
241
242
|
Button: {
|
|
242
243
|
defaultShadow: "none",
|
|
@@ -359,11 +360,11 @@ var InvoiceQuoteView = function (_a) {
|
|
|
359
360
|
var _b = useContext(InvoiceQuoteContext), shadow = _b.shadow, hideDownloadButton = _b.hideDownloadButton;
|
|
360
361
|
var isMobile = useIsMobile();
|
|
361
362
|
var buttonsVisible = formattedInvoice && (!hideDownloadButton || onBackButtonClick);
|
|
362
|
-
return (jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [buttonsVisible ? (jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "shadow-padding-x" : ""), id: "acceptance" }, { children: [jsx("div", { children: onBackButtonClick ? (jsx(Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
|
|
363
|
+
return (jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [buttonsVisible ? (jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "bunny-shadow-padding-x" : ""), id: "acceptance" }, { children: [jsx("div", { children: onBackButtonClick ? (jsx(Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
|
|
363
364
|
color: secondaryColor,
|
|
364
365
|
}, type: "link" }, { children: backButtonName || "Back" }))) : null }), !hideDownloadButton ? (jsx(Button, __assign({ icon: jsx(DownloadOutlined, {}), onClick: function () {
|
|
365
366
|
return downloadFile(apiHost + "/api/pdf/invoice/" + formattedInvoice.id, token);
|
|
366
|
-
} }, { children: "Download" }))) : null] }))) : null, isMobile ? (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full shadow-padding-xb overflow-auto" }, { children: [jsx(Markup, { content: html }), children] }))) : (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-4 w-full bg-white ".concat(shadow ? shadow : "shadow-md", " rounded-md"), style: {
|
|
367
|
+
} }, { children: "Download" }))) : null] }))) : null, isMobile ? (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full bunny-shadow-padding-xb overflow-auto" }, { children: [jsx(Markup, { content: html }), children] }))) : (jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-4 w-full bg-white ".concat(shadow ? shadow : "shadow-md", " rounded-md"), style: {
|
|
367
368
|
minWidth: "750px",
|
|
368
369
|
} }, { children: [jsx(Markup, { content: html }), children] })))] })));
|
|
369
370
|
};
|
|
@@ -422,9 +423,12 @@ function InvoicePDF(_a) {
|
|
|
422
423
|
|
|
423
424
|
var paymentMethodsQuery = "query paymentMethods ($filter: String, $first: Int, $sort: String) {\n paymentMethods (filter: $filter, first: $first, sort: $sort) {\n nodes {\n id\n disabled\n pluginId\n accountId\n expirationDate\n plugin {\n guid\n id\n }\n state\n metadata {\n issuer\n identifier\n kind\n description\n icon\n }\n }\n }\n}";
|
|
424
425
|
var usePaymentMethod = function (_a) {
|
|
425
|
-
var accountId = _a.accountId,
|
|
426
|
+
var accountId = _a.accountId, graphQLClient = _a.graphQLClient, token = _a.token;
|
|
426
427
|
var _b = useQuery({
|
|
427
|
-
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({
|
|
428
|
+
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({
|
|
429
|
+
token: token,
|
|
430
|
+
accountId: accountId,
|
|
431
|
+
}),
|
|
428
432
|
queryFn: function () {
|
|
429
433
|
return graphQLClient
|
|
430
434
|
.request(paymentMethodsQuery, {
|
|
@@ -443,7 +447,7 @@ var usePaymentMethod = function (_a) {
|
|
|
443
447
|
};
|
|
444
448
|
|
|
445
449
|
var usePlugins = function (_a) {
|
|
446
|
-
var
|
|
450
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
447
451
|
var response = useQuery({
|
|
448
452
|
queryKey: QueryKeyFactory.default.pluginsKey(token),
|
|
449
453
|
queryFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -451,7 +455,6 @@ var usePlugins = function (_a) {
|
|
|
451
455
|
return __generator(this, function (_a) {
|
|
452
456
|
switch (_a.label) {
|
|
453
457
|
case 0: return [4 /*yield*/, getPlugins({
|
|
454
|
-
entityId: entityId,
|
|
455
458
|
token: token,
|
|
456
459
|
apiHost: apiHost,
|
|
457
460
|
})];
|
|
@@ -461,7 +464,6 @@ var usePlugins = function (_a) {
|
|
|
461
464
|
}
|
|
462
465
|
});
|
|
463
466
|
}); },
|
|
464
|
-
enabled: Boolean(entityId),
|
|
465
467
|
});
|
|
466
468
|
return response;
|
|
467
469
|
};
|
|
@@ -475,9 +477,8 @@ var filterPaymentPlugins = function (plugins) {
|
|
|
475
477
|
});
|
|
476
478
|
};
|
|
477
479
|
var usePaymentPlugins = function (_a) {
|
|
478
|
-
var
|
|
480
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
479
481
|
var _b = usePlugins({
|
|
480
|
-
entityId: entityId,
|
|
481
482
|
apiHost: apiHost,
|
|
482
483
|
token: token,
|
|
483
484
|
}), plugins = _b.data, isFetched = _b.isFetched;
|
|
@@ -724,6 +725,34 @@ var Card = function (_a) {
|
|
|
724
725
|
: "var(--row-background)" }) }, { children: children })));
|
|
725
726
|
};
|
|
726
727
|
|
|
728
|
+
var tagStyleMap = {
|
|
729
|
+
blue: { color: "var(--bunny-blue-500)", background: "var(--bunny-blue-200)" },
|
|
730
|
+
green: {
|
|
731
|
+
color: "var(--bunny-green-600)",
|
|
732
|
+
background: "var(--bunny-green-200)",
|
|
733
|
+
},
|
|
734
|
+
red: { color: "var(--bunny-red-500)", background: "var(--bunny-red-200)" },
|
|
735
|
+
orange: {
|
|
736
|
+
color: "var(--bunny-orange-500)",
|
|
737
|
+
background: "var(--bunny-orange-200)",
|
|
738
|
+
},
|
|
739
|
+
yellow: {
|
|
740
|
+
color: "var(--bunny-yellow-500)",
|
|
741
|
+
background: "var(--bunny-yellow-200)",
|
|
742
|
+
},
|
|
743
|
+
purple: {
|
|
744
|
+
color: "var(--bunny-purple-500)",
|
|
745
|
+
background: "var(--bunny-purple-200)",
|
|
746
|
+
},
|
|
747
|
+
black: { color: "white", background: "var(--bunny-black)" },
|
|
748
|
+
};
|
|
749
|
+
// This component provides custom styling for antd Tag components without using antd overwrites.
|
|
750
|
+
// Please use this component instead of the antd Tag component directly to maintain consistent styling.
|
|
751
|
+
var CustomizedTag = function (_a) {
|
|
752
|
+
var children = _a.children, color = _a.color, className = _a.className;
|
|
753
|
+
return (jsx(Tag, __assign({ color: color, style: color ? tagStyleMap[color] : undefined, className: "m-0 font-medium rounded-full border-none whitespace-nowrap ".concat(className) }, { children: children })));
|
|
754
|
+
};
|
|
755
|
+
|
|
727
756
|
var LargeCardIcon = function () {
|
|
728
757
|
return (jsx("svg", __assign({ width: "72", height: "56", viewBox: "0 0 72 56", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: jsx("path", { d: "M8 0H64C68.375 0 72 3.625 72 8V12H0V8C0 3.625 3.5 0 8 0ZM72 24V48C72 52.5 68.375 56 64 56H8C3.5 56 0 52.5 0 48V24H72ZM14 40C12.875 40 12 41 12 42C12 43.125 12.875 44 14 44H22C23 44 24 43.125 24 42C24 41 23 40 22 40H14ZM28 42C28 43.125 28.875 44 30 44H46C47 44 48 43.125 48 42C48 41 47 40 46 40H30C28.875 40 28 41 28 42Z", fill: "#E2E8F0" }) })));
|
|
729
758
|
};
|
|
@@ -739,7 +768,7 @@ var CreditCard = function (_a) {
|
|
|
739
768
|
var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate, paymentMethodData = _a.paymentMethodData, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, _d = _a.cardEnabled, cardEnabled = _d === void 0 ? true : _d;
|
|
740
769
|
var isMobile = useIsMobile();
|
|
741
770
|
var Wrapper = cardEnabled ? Card : "div";
|
|
742
|
-
return (jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " m-0") }, { children: [jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsx(CardImage, { paymentMethodData: paymentMethodData }), jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsx(
|
|
771
|
+
return (jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " m-0") }, { children: [jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsx(CardImage, { paymentMethodData: paymentMethodData }), jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsx(CustomizedTag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxs(Fragment, { children: [jsx(Divider, {}), jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsx(CardAttribute, { title: "EXPIRATION", value: expirationDate(paymentMethodData) }), isMobile && (jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
|
|
743
772
|
};
|
|
744
773
|
var MiniCreditCard = function (_a) {
|
|
745
774
|
var _b;
|
|
@@ -751,7 +780,7 @@ var MiniCreditCard = function (_a) {
|
|
|
751
780
|
var backgroundColor = useMemo(function () {
|
|
752
781
|
return darkMode ? "var(--row-background-alternate)" : "bg-slate-50";
|
|
753
782
|
}, [darkMode]);
|
|
754
|
-
return (jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxs(Fragment, { children: [jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxs("div", __assign({ className: "flex items-center gap-4 space-between w-full" }, { children: [jsx(CardImage, { paymentMethodData: paymentMethodData }), jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier }), jsx(
|
|
783
|
+
return (jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxs(Fragment, { children: [jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxs("div", __assign({ className: "flex items-center gap-4 space-between w-full" }, { children: [jsx(CardImage, { paymentMethodData: paymentMethodData }), jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier }), jsx(CustomizedTag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })) })), !hideRemoveButton && (jsx(Popconfirm, __assign({ title: "Remove card?", onConfirm: onClickRemove }, { children: jsx(Button, __assign({ className: "font-normal p-0", type: "link" }, { children: "Remove" })) })))] })) : (jsxs("div", __assign({ className: "flex flex-row gap-2 items-center" }, { children: [jsx(CreditCardOutlined, {}), jsx(Text$p, __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: "No payment method selected" })), jsx(Button, { disabled: true, type: "link" })] }))) })));
|
|
755
784
|
};
|
|
756
785
|
var CardImage = function (_a) {
|
|
757
786
|
var _b, _c;
|
|
@@ -1279,7 +1308,7 @@ var PaymentOptionContainer = defaultStyled.div(templateObject_1$9 || (templateOb
|
|
|
1279
1308
|
});
|
|
1280
1309
|
var templateObject_1$9;
|
|
1281
1310
|
|
|
1282
|
-
function useRemovePaymentMethod(paymentPlugins, apiHost,
|
|
1311
|
+
function useRemovePaymentMethod(paymentPlugins, apiHost, token, accountId) {
|
|
1283
1312
|
var _this = this;
|
|
1284
1313
|
var queryClient = useQueryClient();
|
|
1285
1314
|
var showErrorNotification = useErrorNotification();
|
|
@@ -1303,7 +1332,10 @@ function useRemovePaymentMethod(paymentPlugins, apiHost, entityId, token, accoun
|
|
|
1303
1332
|
})
|
|
1304
1333
|
.then(function () {
|
|
1305
1334
|
showSuccessNotification("Payment method was removed", "Success");
|
|
1306
|
-
queryClient.setQueryData(QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1335
|
+
queryClient.setQueryData(QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1336
|
+
token: token,
|
|
1337
|
+
accountId: accountId,
|
|
1338
|
+
}), null);
|
|
1307
1339
|
})
|
|
1308
1340
|
.catch(function (error) {
|
|
1309
1341
|
showErrorNotification(error.message, "Error removing payment method");
|
|
@@ -1321,35 +1353,38 @@ function useRemovePaymentMethod(paymentPlugins, apiHost, entityId, token, accoun
|
|
|
1321
1353
|
var Panel = Collapse.Panel;
|
|
1322
1354
|
var PaymentForm = function (_a) {
|
|
1323
1355
|
var _b;
|
|
1324
|
-
var
|
|
1356
|
+
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, overrideToken = _a.overrideToken, graphQLClient = _a.graphQLClient, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, customPaymentForms = _a.customPaymentForms, _c = _a.useAllPaymentPlugins, useAllPaymentPlugins = _c === void 0 ? false : _c;
|
|
1325
1357
|
// Local state
|
|
1326
1358
|
var _d = useState(), selectedPaymentMethod = _d[0], setSelectedPaymentMethod = _d[1];
|
|
1327
1359
|
var _e = useState(false), showPaymentMethodForm = _e[0], setShowPaymentMethodForm = _e[1];
|
|
1328
1360
|
var paying = !!(quote || invoice);
|
|
1329
|
-
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
1361
|
+
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
1362
|
+
(invoice === null || invoice === void 0 ? void 0 : invoice.currencyId) ||
|
|
1363
|
+
currencyIdFromProps)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
1330
1364
|
// Hooks
|
|
1331
1365
|
var apiHost = useContext(BunnyContext).apiHost;
|
|
1332
1366
|
var tokenFromContexts = useToken();
|
|
1333
1367
|
var token = overrideToken || tokenFromContexts;
|
|
1334
1368
|
var _f = usePaymentMethod({
|
|
1335
1369
|
accountId: accountId,
|
|
1336
|
-
entityId: entityId,
|
|
1337
1370
|
graphQLClient: graphQLClient,
|
|
1338
1371
|
token: token,
|
|
1339
1372
|
}), storedPaymentMethod = _f.data, isPaymentMethodLoading = _f.isLoading;
|
|
1340
1373
|
var isPaymentMethodFetched = storedPaymentMethod !== undefined;
|
|
1341
|
-
var _g = usePaymentPlugins({
|
|
1374
|
+
var _g = usePaymentPlugins({ apiHost: apiHost, token: token }), allPaymentMethodAllowedPlugins = _g.paymentMethodAllowedPlugins, allPaymentPlugins = _g.paymentPlugins, arePluginsFetched = _g.isFetched;
|
|
1342
1375
|
var paymentMethodAllowedPlugins = useMemo(function () {
|
|
1343
1376
|
if (useAllPaymentPlugins) {
|
|
1344
1377
|
return allPaymentPlugins;
|
|
1345
1378
|
}
|
|
1346
1379
|
return allPaymentMethodAllowedPlugins;
|
|
1347
1380
|
}, [allPaymentMethodAllowedPlugins, allPaymentPlugins, useAllPaymentPlugins]);
|
|
1348
|
-
var onClickRemove = useRemovePaymentMethod(paymentMethodAllowedPlugins || [], apiHost,
|
|
1381
|
+
var onClickRemove = useRemovePaymentMethod(paymentMethodAllowedPlugins || [], apiHost, token, accountId);
|
|
1349
1382
|
var queryClient = useQueryClient();
|
|
1350
1383
|
// Set default plugin
|
|
1351
1384
|
useEffect(function () {
|
|
1352
|
-
if (!arePluginsFetched ||
|
|
1385
|
+
if (!arePluginsFetched ||
|
|
1386
|
+
!isPaymentMethodFetched ||
|
|
1387
|
+
selectedPaymentMethod) {
|
|
1353
1388
|
return;
|
|
1354
1389
|
}
|
|
1355
1390
|
var pluginPaymentMethod = paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.find(function (plugin) { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
|
|
@@ -1378,7 +1413,10 @@ var PaymentForm = function (_a) {
|
|
|
1378
1413
|
};
|
|
1379
1414
|
var handleSavePaymentMethod = function () {
|
|
1380
1415
|
queryClient.invalidateQueries({
|
|
1381
|
-
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1416
|
+
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1417
|
+
accountId: accountId,
|
|
1418
|
+
token: token,
|
|
1419
|
+
}),
|
|
1382
1420
|
});
|
|
1383
1421
|
onSavePaymentMethod === null || onSavePaymentMethod === void 0 ? void 0 : onSavePaymentMethod();
|
|
1384
1422
|
setShowPaymentMethodForm(false);
|
|
@@ -1405,7 +1443,7 @@ function StripeWrapper(_a) {
|
|
|
1405
1443
|
}
|
|
1406
1444
|
|
|
1407
1445
|
function Invoice(_a) {
|
|
1408
|
-
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess,
|
|
1446
|
+
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? "shadow-md" : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onInvoiceLoaded = _a.onInvoiceLoaded;
|
|
1409
1447
|
return (jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
1410
1448
|
id: id,
|
|
1411
1449
|
invoiceQuoteViewComponent: invoiceQuoteViewComponent,
|
|
@@ -1413,7 +1451,6 @@ function Invoice(_a) {
|
|
|
1413
1451
|
onBackButtonClick: onBackButtonClick,
|
|
1414
1452
|
onInvoiceDownloadError: onInvoiceDownloadError,
|
|
1415
1453
|
onPaymentSuccess: onPaymentSuccess,
|
|
1416
|
-
entityId: entityId,
|
|
1417
1454
|
shadow: shadow,
|
|
1418
1455
|
className: className,
|
|
1419
1456
|
hideDownloadButton: hideDownloadButton,
|
|
@@ -1423,7 +1460,7 @@ function Invoice(_a) {
|
|
|
1423
1460
|
function ActualInvoice() {
|
|
1424
1461
|
// Context
|
|
1425
1462
|
var queryClient = useQueryClient();
|
|
1426
|
-
var _a = useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick,
|
|
1463
|
+
var _a = useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onPaymentSuccess = _a.onPaymentSuccess, className = _a.className;
|
|
1427
1464
|
var _b = useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired, graphQLClient = _b.graphQLClient;
|
|
1428
1465
|
var _c = useContext(InvoiceQuoteContext), hideDownloadButton = _c.hideDownloadButton, onInvoiceLoaded = _c.onInvoiceLoaded;
|
|
1429
1466
|
var token = useToken();
|
|
@@ -1444,7 +1481,10 @@ function ActualInvoice() {
|
|
|
1444
1481
|
queryKey: QueryKeyFactory.default.transactionsKey({ token: token }),
|
|
1445
1482
|
});
|
|
1446
1483
|
queryClient.invalidateQueries({
|
|
1447
|
-
queryKey: QueryKeyFactory.default.createFormattedInvoiceKey({
|
|
1484
|
+
queryKey: QueryKeyFactory.default.createFormattedInvoiceKey({
|
|
1485
|
+
id: id,
|
|
1486
|
+
token: token,
|
|
1487
|
+
}),
|
|
1448
1488
|
});
|
|
1449
1489
|
showSuccessNotification("Your invoice has been paid", "Payment successful");
|
|
1450
1490
|
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess();
|
|
@@ -1459,7 +1499,9 @@ function ActualInvoice() {
|
|
|
1459
1499
|
}, [formattedInvoice]);
|
|
1460
1500
|
if (!formattedInvoice)
|
|
1461
1501
|
return jsx(Fragment, {});
|
|
1462
|
-
return (jsx(
|
|
1502
|
+
return (jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile
|
|
1503
|
+
? "flex-col w-full overflow-hidden"
|
|
1504
|
+
: "bunny-shadow-padding-xb", " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsx("div", __assign({ className: "flex justify-center w-full" }, { children: jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, apiHost: apiHost, token: token }) }))) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsx("div", __assign({ className: "w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? "" : "pt-12") }, { children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice, graphQLClient: graphQLClient }) })))] })) })));
|
|
1463
1505
|
}
|
|
1464
1506
|
|
|
1465
1507
|
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\n object { documents { id filename size date url } }\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n contactName\n currency\n customerBillingCity\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n discount\n discountValue\n duration\n endDate\n expiresAt\n html\n formattedLines {\n amount\n amountsByPeriod {\n quantity\n id\n name\n startDate\n endDate\n amount\n amountsByTier {\n id\n tier {\n starts\n ends\n price\n }\n quantity\n amount\n }\n prorationRate\n }\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n isRamp\n periods\n planName\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListId\n priceListName\n priceTiers {\n price\n starts\n }\n pricingModel\n productName\n prorationRate\n quantity\n showProductNameOnLineItem\n taxCode\n trialEndDate\n trialStartDate\n unitOfMeasure\n vatCode\n }\n netPaymentDays\n notes\n number\n poNumberRequired\n salesContactEmail\n sharedAt\n startDate\n state\n subtotal\n taxAmount\n taxNumberLabel\n taxNumberRequired\n vendorName\n }\n }"; };
|
|
@@ -1487,16 +1529,20 @@ var getFormattedQuote = function (_a) {
|
|
|
1487
1529
|
};
|
|
1488
1530
|
|
|
1489
1531
|
var filterSigningPlugins = function (plugins) {
|
|
1490
|
-
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
1532
|
+
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
1533
|
+
var _a, _b;
|
|
1534
|
+
return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "signing" &&
|
|
1535
|
+
((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "valid";
|
|
1536
|
+
});
|
|
1491
1537
|
};
|
|
1492
1538
|
var useSigningPlugins = function (_a) {
|
|
1493
|
-
var
|
|
1494
|
-
var plugins = usePlugins({
|
|
1539
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
1540
|
+
var plugins = usePlugins({ apiHost: apiHost, token: token });
|
|
1495
1541
|
return filterSigningPlugins(plugins.data);
|
|
1496
1542
|
};
|
|
1497
1543
|
|
|
1498
1544
|
var useSendAcceptQuote = function (_a) {
|
|
1499
|
-
var
|
|
1545
|
+
var onTokenExpired = _a.onTokenExpired, quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
1500
1546
|
// Hooks
|
|
1501
1547
|
var graphQLMutation = useGraphQLmutation(function () {
|
|
1502
1548
|
console.log("navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
@@ -1504,7 +1550,7 @@ var useSendAcceptQuote = function (_a) {
|
|
|
1504
1550
|
console.log("onError in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
1505
1551
|
});
|
|
1506
1552
|
var handleAllErrorFormats = useAllErrorFormats(onTokenExpired);
|
|
1507
|
-
var signingPlugins = useSigningPlugins({
|
|
1553
|
+
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
1508
1554
|
var queryClient = useQueryClient();
|
|
1509
1555
|
// Local state
|
|
1510
1556
|
var _b = useState(false), acceptBoxVisible = _b[0], setAcceptBoxVisible = _b[1];
|
|
@@ -1719,30 +1765,28 @@ var AcceptQuoteModal = function (_a) {
|
|
|
1719
1765
|
var Text$m = Typography.Text;
|
|
1720
1766
|
defaultStyled.div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
|
|
1721
1767
|
function Quote(_a) {
|
|
1722
|
-
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess,
|
|
1768
|
+
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? "shadow-md" : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onQuoteLoaded = _a.onQuoteLoaded;
|
|
1723
1769
|
return (jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
1724
1770
|
id: id,
|
|
1725
1771
|
invoiceQuoteViewComponent: invoiceQuoteViewComponent,
|
|
1726
1772
|
onInvoiceDownloadError: onInvoiceDownloadError,
|
|
1727
1773
|
onPaymentSuccess: onPaymentSuccess,
|
|
1728
|
-
entityId: entityId,
|
|
1729
1774
|
shadow: shadow,
|
|
1730
1775
|
className: className,
|
|
1731
1776
|
hideDownloadButton: hideDownloadButton,
|
|
1732
1777
|
onQuoteLoaded: onQuoteLoaded,
|
|
1733
|
-
} }, { children: jsx(ActualQuote, {
|
|
1778
|
+
} }, { children: jsx(ActualQuote, {}) })));
|
|
1734
1779
|
}
|
|
1735
|
-
function ActualQuote(
|
|
1780
|
+
function ActualQuote() {
|
|
1736
1781
|
var _this = this;
|
|
1737
|
-
var
|
|
1738
|
-
var entityId = _a.entityId;
|
|
1782
|
+
var _a, _b;
|
|
1739
1783
|
// Context
|
|
1740
|
-
var
|
|
1784
|
+
var _c = useContext(BunnyContext), apiHost = _c.apiHost, onTokenExpired = _c.onTokenExpired;
|
|
1741
1785
|
var token = useToken();
|
|
1742
1786
|
var entityBranding = useContext(BrandContext);
|
|
1743
|
-
var
|
|
1787
|
+
var _d = useContext(InvoiceQuoteContext), className = _d.className, id = _d.id, hideDownloadButton = _d.hideDownloadButton, onQuoteLoaded = _d.onQuoteLoaded;
|
|
1744
1788
|
// Queries
|
|
1745
|
-
var
|
|
1789
|
+
var _e = useQuery({
|
|
1746
1790
|
queryKey: QueryKeyFactory.default.createQuoteKey({ id: id, token: token }),
|
|
1747
1791
|
queryFn: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1748
1792
|
var error_1;
|
|
@@ -1761,18 +1805,17 @@ function ActualQuote(_a) {
|
|
|
1761
1805
|
});
|
|
1762
1806
|
}); },
|
|
1763
1807
|
placeholderData: keepPreviousData,
|
|
1764
|
-
}), data =
|
|
1808
|
+
}), data = _e.data, isLoading = _e.isLoading;
|
|
1765
1809
|
var formattedQuote = data;
|
|
1766
1810
|
// Hooks
|
|
1767
1811
|
var downloadFile = useDownloadFile(id);
|
|
1768
1812
|
var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
|
|
1769
|
-
var
|
|
1770
|
-
entityId: entityId,
|
|
1813
|
+
var _f = useSendAcceptQuote({
|
|
1771
1814
|
token: token,
|
|
1772
1815
|
onTokenExpired: onTokenExpired,
|
|
1773
1816
|
apiHost: apiHost,
|
|
1774
1817
|
quoteId: id,
|
|
1775
|
-
}), acceptBoxVisible =
|
|
1818
|
+
}), acceptBoxVisible = _f.acceptBoxVisible, isAccepting = _f.isAccepting, sendAccept = _f.sendAccept, setAcceptBoxVisible = _f.setAcceptBoxVisible, setIsAccepting = _f.setIsAccepting, startAcceptance = _f.startAcceptance, pandadocPollingModalVisible = _f.pandadocPollingModalVisible, setPandadocPollingModalVisible = _f.setPandadocPollingModalVisible;
|
|
1776
1819
|
useSigningComplete({ data: formattedQuote, token: token });
|
|
1777
1820
|
var isMobile = useIsMobile();
|
|
1778
1821
|
var showErrorNotification = useErrorNotification();
|
|
@@ -1786,67 +1829,18 @@ function ActualQuote(_a) {
|
|
|
1786
1829
|
}
|
|
1787
1830
|
// Derived state
|
|
1788
1831
|
var isAccepted = formattedQuote.state === "ACCEPTED";
|
|
1789
|
-
return (jsxs(Fragment, { children: [jsxs("div", __assign({ className: "flex flex-col gap-4 ".concat(isMobile ? "w-full overflow-hidden" : "shadow-padding-xb", " ").concat(className) }, { children: [jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
1832
|
+
return (jsxs(Fragment, { children: [jsxs("div", __assign({ className: "flex flex-col gap-4 ".concat(isMobile ? "w-full overflow-hidden" : "bunny-shadow-padding-xb", " ").concat(className) }, { children: [jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
1790
1833
|
color: entityBranding.secondaryColor,
|
|
1791
1834
|
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsx(Text$m, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxs("div", __assign({ className: isMobile
|
|
1792
1835
|
? "flex w-full justify-end gap-2"
|
|
1793
1836
|
: "flex items-center justify-end gap-2" }, { children: [!isMobile && !hideDownloadButton ? (jsx(Button, __assign({ icon: jsx(DownloadOutlined, {}), onClick: function () {
|
|
1794
1837
|
return downloadFile(apiHost + "/api/pdf/quote", token);
|
|
1795
|
-
} }, { children: "Download" }))) : null, !isAccepted ? (jsx(Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" }))) : null] })))] })), jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html }, { children: ((
|
|
1838
|
+
} }, { children: "Download" }))) : null, !isAccepted ? (jsx(Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" }))) : null] })))] })), jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html }, { children: ((_b = (_a = formattedQuote.object) === null || _a === void 0 ? void 0 : _a.documents) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (jsx("div", __assign({ className: "flex flex-col items-end" }, { children: formattedQuote.object.documents.map(function (doc, index) {
|
|
1796
1839
|
return (jsx(Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
|
|
1797
1840
|
}) }))) : null }))] })), jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept }), jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
|
|
1798
1841
|
}
|
|
1799
1842
|
var templateObject_1$7;
|
|
1800
1843
|
|
|
1801
|
-
var QUOTES_QUERY = function (filter) { return "\n query quotes {\n quotes ".concat(filter ? "(".concat(filter, ")") : "", " {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n nodes {\n id\n name\n account {\n name\n id\n }\n applicationDate\n state\n createdAt\n expiresAt\n currencyId\n amount\n number\n }\n }\n }"); };
|
|
1802
|
-
var getQuotes = function (_a) {
|
|
1803
|
-
var token = _a.token, apiHost = _a.apiHost, filter = _a.filter;
|
|
1804
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
1805
|
-
var response;
|
|
1806
|
-
return __generator(this, function (_b) {
|
|
1807
|
-
switch (_b.label) {
|
|
1808
|
-
case 0: return [4 /*yield*/, gqlRequest({
|
|
1809
|
-
query: QUOTES_QUERY(filter),
|
|
1810
|
-
token: token,
|
|
1811
|
-
vars: {},
|
|
1812
|
-
apiHost: apiHost,
|
|
1813
|
-
})];
|
|
1814
|
-
case 1:
|
|
1815
|
-
response = _b.sent();
|
|
1816
|
-
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.quotes];
|
|
1817
|
-
}
|
|
1818
|
-
});
|
|
1819
|
-
});
|
|
1820
|
-
};
|
|
1821
|
-
|
|
1822
|
-
var transactionMutation = function (filter) { return "\nquery transactions {\n transactions ".concat(filter ? "(".concat(filter, ")") : "", " {\n nodes {\n amount\n createdAt\n currencyId\n description\n id\n kind\n state\n transactionableId\n transactionable {\n ...on Payment { amount }\n ...on Invoice { amount number dueAt issuedAt isLegacy }\n ...on CreditNote { amount number issuedAt }\n }\n account {\n name\n id\n }\n }\n }\n}"); };
|
|
1823
|
-
var getTransactions = function (filter, apiHost, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1824
|
-
var response, _a, data, errors;
|
|
1825
|
-
return __generator(this, function (_b) {
|
|
1826
|
-
switch (_b.label) {
|
|
1827
|
-
case 0: return [4 /*yield*/, fetch(apiHost + "/graphql", {
|
|
1828
|
-
method: "POST",
|
|
1829
|
-
headers: {
|
|
1830
|
-
"Content-type": "application/json; charset=utf-8",
|
|
1831
|
-
Authorization: "Bearer ".concat(token),
|
|
1832
|
-
},
|
|
1833
|
-
body: JSON.stringify({
|
|
1834
|
-
query: transactionMutation(filter),
|
|
1835
|
-
}),
|
|
1836
|
-
})];
|
|
1837
|
-
case 1:
|
|
1838
|
-
response = _b.sent();
|
|
1839
|
-
return [4 /*yield*/, response.json()];
|
|
1840
|
-
case 2:
|
|
1841
|
-
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
1842
|
-
if (errors) {
|
|
1843
|
-
throw new Error(errors[0].message);
|
|
1844
|
-
}
|
|
1845
|
-
return [2 /*return*/, data === null || data === void 0 ? void 0 : data.transactions.nodes];
|
|
1846
|
-
}
|
|
1847
|
-
});
|
|
1848
|
-
}); };
|
|
1849
|
-
|
|
1850
1844
|
var lodash$1 = {exports: {}};
|
|
1851
1845
|
|
|
1852
1846
|
/**
|
|
@@ -19058,6 +19052,55 @@ function requireLodash () {
|
|
|
19058
19052
|
|
|
19059
19053
|
var lodashExports = requireLodash();
|
|
19060
19054
|
|
|
19055
|
+
var QUOTES_QUERY = function (filter) { return "\n query quotes {\n quotes ".concat(filter ? "(".concat(filter, ")") : "", " {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n nodes {\n id\n name\n account {\n name\n id\n }\n applicationDate\n state\n createdAt\n expiresAt\n currencyId\n amount\n number\n }\n }\n }"); };
|
|
19056
|
+
var getQuotes = function (_a) {
|
|
19057
|
+
var token = _a.token, apiHost = _a.apiHost, filter = _a.filter;
|
|
19058
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
19059
|
+
var response;
|
|
19060
|
+
return __generator(this, function (_b) {
|
|
19061
|
+
switch (_b.label) {
|
|
19062
|
+
case 0: return [4 /*yield*/, gqlRequest({
|
|
19063
|
+
query: QUOTES_QUERY(filter),
|
|
19064
|
+
token: token,
|
|
19065
|
+
vars: {},
|
|
19066
|
+
apiHost: apiHost,
|
|
19067
|
+
})];
|
|
19068
|
+
case 1:
|
|
19069
|
+
response = _b.sent();
|
|
19070
|
+
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.quotes];
|
|
19071
|
+
}
|
|
19072
|
+
});
|
|
19073
|
+
});
|
|
19074
|
+
};
|
|
19075
|
+
|
|
19076
|
+
var transactionMutation = function (filter) { return "\nquery transactions {\n transactions ".concat(filter ? "(".concat(filter, ")") : "", " {\n nodes {\n amount\n createdAt\n currencyId\n description\n id\n kind\n state\n transactionableId\n transactionable {\n ...on Payment { amount }\n ...on Invoice { amount number dueAt issuedAt isLegacy }\n ...on CreditNote { amount number issuedAt }\n }\n account {\n name\n id\n }\n }\n }\n}"); };
|
|
19077
|
+
var getTransactions = function (filter, apiHost, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19078
|
+
var response, _a, data, errors;
|
|
19079
|
+
return __generator(this, function (_b) {
|
|
19080
|
+
switch (_b.label) {
|
|
19081
|
+
case 0: return [4 /*yield*/, fetch(apiHost + "/graphql", {
|
|
19082
|
+
method: "POST",
|
|
19083
|
+
headers: {
|
|
19084
|
+
"Content-type": "application/json; charset=utf-8",
|
|
19085
|
+
Authorization: "Bearer ".concat(token),
|
|
19086
|
+
},
|
|
19087
|
+
body: JSON.stringify({
|
|
19088
|
+
query: transactionMutation(filter),
|
|
19089
|
+
}),
|
|
19090
|
+
})];
|
|
19091
|
+
case 1:
|
|
19092
|
+
response = _b.sent();
|
|
19093
|
+
return [4 /*yield*/, response.json()];
|
|
19094
|
+
case 2:
|
|
19095
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
19096
|
+
if (errors) {
|
|
19097
|
+
throw new Error(errors[0].message);
|
|
19098
|
+
}
|
|
19099
|
+
return [2 /*return*/, data === null || data === void 0 ? void 0 : data.transactions.nodes];
|
|
19100
|
+
}
|
|
19101
|
+
});
|
|
19102
|
+
}); };
|
|
19103
|
+
|
|
19061
19104
|
var TransactionsListContext = createContext({});
|
|
19062
19105
|
|
|
19063
19106
|
var StateTag = function (_a) {
|
|
@@ -19066,7 +19109,7 @@ var StateTag = function (_a) {
|
|
|
19066
19109
|
if (transactionStateRenderer) {
|
|
19067
19110
|
return jsx(Fragment, { children: transactionStateRenderer(state) });
|
|
19068
19111
|
}
|
|
19069
|
-
return jsx(
|
|
19112
|
+
return (jsx(CustomizedTag, __assign({ color: getColor(state) }, { children: lodashExports.capitalize(lodashExports.startCase(state)) })));
|
|
19070
19113
|
};
|
|
19071
19114
|
var getColor = function (state) {
|
|
19072
19115
|
switch (state) {
|
|
@@ -19120,7 +19163,7 @@ var TransactionDownload = function (_a) {
|
|
|
19120
19163
|
return (jsx("div", __assign({ onClick: function (e) {
|
|
19121
19164
|
e.stopPropagation();
|
|
19122
19165
|
downloadFile(downloadLink, token);
|
|
19123
|
-
} }, { children: jsx(ArrowDownToLine, { className: "".concat(isMobile ? "" : "show-on-hover"), color: darkMode ? WHITE : SLATE_600 }) })));
|
|
19166
|
+
} }, { children: jsx(ArrowDownToLine, { className: "".concat(isMobile ? "" : "bunny-show-on-hover"), color: darkMode ? WHITE : SLATE_600 }) })));
|
|
19124
19167
|
};
|
|
19125
19168
|
|
|
19126
19169
|
var TransactionGridCell = defaultStyled.div.withConfig({
|
|
@@ -19188,7 +19231,7 @@ var TransactionsListDesktop = function (_a) {
|
|
|
19188
19231
|
return (jsx(Fragment, { children: transactions === null || transactions === void 0 ? void 0 : transactions.map(function (transaction, index) {
|
|
19189
19232
|
var _a, _b;
|
|
19190
19233
|
var isClickable = onTransactionClick !== undefined;
|
|
19191
|
-
return (jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
|
|
19234
|
+
return (jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " bunny-show-on-hover-container"), onClick: function () {
|
|
19192
19235
|
onTransactionClick === null || onTransactionClick === void 0 ? void 0 : onTransactionClick(transaction);
|
|
19193
19236
|
}, style: {
|
|
19194
19237
|
backgroundColor: index % 2 === 0
|
|
@@ -19220,7 +19263,7 @@ var TransactionsListMobile = function (_a) {
|
|
|
19220
19263
|
return (jsx(Fragment, { children: transactions === null || transactions === void 0 ? void 0 : transactions.map(function (transaction, index) {
|
|
19221
19264
|
var _a;
|
|
19222
19265
|
var isClickable = transaction.kind === "INVOICE";
|
|
19223
|
-
return (jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
|
|
19266
|
+
return (jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " bunny-show-on-hover-container"), onClick: function () {
|
|
19224
19267
|
onTransactionClick(transaction);
|
|
19225
19268
|
}, style: {
|
|
19226
19269
|
backgroundColor: index % 2 === 0
|
|
@@ -19239,7 +19282,7 @@ function Transactions(_a) {
|
|
|
19239
19282
|
TransactionKind.PAYMENT,
|
|
19240
19283
|
TransactionKind.REFUND,
|
|
19241
19284
|
TransactionKind.WRITE_OFF,
|
|
19242
|
-
] : _j, style = _a.style, filter = _a.filter, noTransactionsMessage = _a.noTransactionsMessage,
|
|
19285
|
+
] : _j, style = _a.style, filter = _a.filter, noTransactionsMessage = _a.noTransactionsMessage, filterTransactions = _a.filterTransactions, _k = _a.sortTransactions, sortTransactions = _k === void 0 ? function (a, b) {
|
|
19243
19286
|
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
19244
19287
|
} : _k, _l = _a.transactionDateType, transactionDateType = _l === void 0 ? "createdAt" : _l;
|
|
19245
19288
|
var contextValues = {
|
|
@@ -19258,7 +19301,6 @@ function Transactions(_a) {
|
|
|
19258
19301
|
style: style,
|
|
19259
19302
|
filter: filter,
|
|
19260
19303
|
noTransactionsMessage: noTransactionsMessage,
|
|
19261
|
-
entityId: entityId,
|
|
19262
19304
|
filterTransactions: filterTransactions,
|
|
19263
19305
|
sortTransactions: sortTransactions,
|
|
19264
19306
|
transactionDateType: transactionDateType,
|
|
@@ -19280,7 +19322,7 @@ function Transactions(_a) {
|
|
|
19280
19322
|
function TransactionsDisplay(_a) {
|
|
19281
19323
|
var _b, _c;
|
|
19282
19324
|
var transactions = _a.transactions, onSearchValueChanged = _a.onSearchValueChanged, search = _a.search;
|
|
19283
|
-
var _d = useContext(TransactionsListContext), showSearchBar = _d.showSearchBar, showTitle = _d.showTitle, title = _d.title, transactionComponent = _d.transactionComponent, useModal = _d.useModal, suppressTransactionDisplay = _d.suppressTransactionDisplay, className = _d.className, shadow = _d.shadow, searchBarClassName = _d.searchBarClassName, style = _d.style, onTransactionClick = _d.onTransactionClick,
|
|
19325
|
+
var _d = useContext(TransactionsListContext), showSearchBar = _d.showSearchBar, showTitle = _d.showTitle, title = _d.title, transactionComponent = _d.transactionComponent, useModal = _d.useModal, suppressTransactionDisplay = _d.suppressTransactionDisplay, className = _d.className, shadow = _d.shadow, searchBarClassName = _d.searchBarClassName, style = _d.style, onTransactionClick = _d.onTransactionClick, onTransactionDisplayClose = _d.onTransactionDisplayClose, kindsToShow = _d.kindsToShow, filterTransactions = _d.filterTransactions, sortTransactions = _d.sortTransactions; _d.transactionDateType;
|
|
19284
19326
|
var columns = useContext(TransactionsListContext).columns;
|
|
19285
19327
|
var darkMode = useContext(BunnyContext).darkMode;
|
|
19286
19328
|
var secondaryColor = useContext(BrandContext).secondaryColor;
|
|
@@ -19345,7 +19387,7 @@ function TransactionsDisplay(_a) {
|
|
|
19345
19387
|
onTransactionDisplayClose === null || onTransactionDisplayClose === void 0 ? void 0 : onTransactionDisplayClose(selectedTransaction);
|
|
19346
19388
|
setDrawerOpen(false);
|
|
19347
19389
|
}
|
|
19348
|
-
return (jsxs("div", __assign({ style: style }, { children: [jsxs("div", __assign({ className: "flex flex-col w-full shadow-padding-xb gap-2 ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-1" : "flex-row items-center", " justify-between") }, { children: [showTitle ? (jsx(Text$h, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsx("div", {}) // Empty div so justify-between works
|
|
19390
|
+
return (jsxs("div", __assign({ style: style }, { children: [jsxs("div", __assign({ className: "flex flex-col w-full bunny-shadow-padding-xb gap-2 ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-1" : "flex-row items-center", " justify-between") }, { children: [showTitle ? (jsx(Text$h, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsx("div", {}) // Empty div so justify-between works
|
|
19349
19391
|
), showSearchBar && (jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "") }, { children: jsx(Input, { className: searchBarClassName
|
|
19350
19392
|
? searchBarClassName
|
|
19351
19393
|
: "border border-slate-200", onChange: function (e) {
|
|
@@ -19358,11 +19400,11 @@ function TransactionsDisplay(_a) {
|
|
|
19358
19400
|
}, value: search }) })))] }))) : null, jsx("div", __assign({ className: "grid w-full rounded-md overflow-auto ".concat(shadow), style: {
|
|
19359
19401
|
gridTemplateColumns: gridTemplateColumns(),
|
|
19360
19402
|
backgroundColor: "var(--row-background".concat(darkMode ? "-dark" : "", ")"),
|
|
19361
|
-
} }, { children: isMobile ? (jsx(TransactionsListMobile, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) : (jsx(TransactionsListDesktop, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) }))] })), useModal ? (jsx(Modal, __assign({ title: drawerTitle(), open: drawerOpen, onOk: handleDisplayClose, onCancel: handleDisplayClose, width: DISPLAY_WIDTH, footer: null }, { children: jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || ""
|
|
19403
|
+
} }, { children: isMobile ? (jsx(TransactionsListMobile, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) : (jsx(TransactionsListDesktop, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) }))] })), useModal ? (jsx(Modal, __assign({ title: drawerTitle(), open: drawerOpen, onOk: handleDisplayClose, onCancel: handleDisplayClose, width: DISPLAY_WIDTH, footer: null }, { children: jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || "" }) }))) : (jsx(Drawer, __assign({ title: drawerTitle(), onClose: handleDisplayClose, open: drawerOpen, width: DISPLAY_WIDTH }, { children: transactionComponent ? (transactionComponent) : (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind) === "INVOICE" ? (jsx(Invoice, { id: selectedTransaction.transactionableId })) : (jsxs(Card$1, __assign({ className: "shadow-md" }, { children: [jsx(Typography.Title, __assign({ level: 2, className: "mb-4" }, { children: "Transaction Details" })), jsxs(Typography.Paragraph, { children: [jsx("strong", { children: "Amount:" }), " ", jsx(Typography.Text, { children: formatCurrency((selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.amount) || 0, (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.currencyId) || "USD") })] }), jsxs(Typography.Paragraph, { children: [jsx("strong", { children: "Description:" }), " ", jsx(Typography.Text, { children: selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.description })] }), jsxs(Typography.Paragraph, { children: [jsx("strong", { children: "Kind:" }), " ", jsx(Typography.Text, { children: selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind })] }), jsxs(Typography.Paragraph, { children: [jsx("strong", { children: "State:" }), " ", jsx(Typography.Text, { children: selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.state })] })] }))) })))] })));
|
|
19362
19404
|
}
|
|
19363
19405
|
|
|
19364
19406
|
function Quotes(_a) {
|
|
19365
|
-
var className = _a.className, _b = _a.columns, columns = _b === void 0 ? ["date", "title", "amount", "download", "state"] : _b,
|
|
19407
|
+
var className = _a.className, _b = _a.columns, columns = _b === void 0 ? ["date", "title", "amount", "download", "state"] : _b, filter = _a.filter, filterQuotes = _a.filterQuotes, _c = _a.sort, sort = _c === void 0 ? function (a, b) {
|
|
19366
19408
|
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
19367
19409
|
} : _c, _d = _a.noQuotesMessage, noQuotesMessage = _d === void 0 ? "There are no quotes" : _d, onQuoteClick = _a.onQuoteClick, quoteComponent = _a.quoteComponent, searchBarClassName = _a.searchBarClassName, _e = _a.shadow, shadow = _e === void 0 ? "shadow-md" : _e, _f = _a.showSearchBar, showSearchBar = _f === void 0 ? true : _f, _g = _a.showTitle, showTitle = _g === void 0 ? true : _g, _h = _a.title, title = _h === void 0 ? "Past quotes" : _h, style = _a.style, _j = _a.suppressQuoteDisplay, suppressQuoteDisplay = _j === void 0 ? false : _j, _k = _a.useModal, useModal = _k === void 0 ? false : _k;
|
|
19368
19410
|
var apiHost = useContext(BunnyContext).apiHost;
|
|
@@ -19390,7 +19432,6 @@ function Quotes(_a) {
|
|
|
19390
19432
|
filterTransactions: filterQuotes,
|
|
19391
19433
|
sortTransactions: sort,
|
|
19392
19434
|
downloadTransactionLink: function (id) { return "".concat(apiHost, "/api/pdf/quote/").concat(id); },
|
|
19393
|
-
entityId: entityId,
|
|
19394
19435
|
transactionDateType: "createdAt", // Required for the transactions list, but doesn't affect quotes
|
|
19395
19436
|
};
|
|
19396
19437
|
function quoteStateRenderer(state) {
|
|
@@ -19411,7 +19452,7 @@ function Quotes(_a) {
|
|
|
19411
19452
|
return "blue";
|
|
19412
19453
|
}
|
|
19413
19454
|
};
|
|
19414
|
-
return jsx(
|
|
19455
|
+
return (jsx(CustomizedTag, __assign({ color: getColor(state) }, { children: lodashExports.capitalize(lodashExports.startCase(state)) })));
|
|
19415
19456
|
}
|
|
19416
19457
|
function handleQuoteClick(quote) {
|
|
19417
19458
|
onQuoteClick === null || onQuoteClick === void 0 ? void 0 : onQuoteClick(quote);
|
|
@@ -19419,7 +19460,7 @@ function Quotes(_a) {
|
|
|
19419
19460
|
setComponent(quoteComponent);
|
|
19420
19461
|
}
|
|
19421
19462
|
else {
|
|
19422
|
-
setComponent(jsx(Quote, {
|
|
19463
|
+
setComponent(jsx(Quote, { id: quote === null || quote === void 0 ? void 0 : quote.transactionableId }));
|
|
19423
19464
|
}
|
|
19424
19465
|
}
|
|
19425
19466
|
return (jsx(TransactionsListContext.Provider, __assign({ value: contextValues }, { children: jsx(QuotesWrapper, {}) })));
|
|
@@ -19499,7 +19540,7 @@ var DrawerHeader = function (_a) {
|
|
|
19499
19540
|
|
|
19500
19541
|
var PaymentMethod = function (_a) {
|
|
19501
19542
|
var _b;
|
|
19502
|
-
var
|
|
19543
|
+
var className = _a.className, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, _d = _a.cardEnabled, cardEnabled = _d === void 0 ? true : _d,
|
|
19503
19544
|
/** Whether to use a modal instead of a drawer for the payment method form */
|
|
19504
19545
|
_e = _a.useModal,
|
|
19505
19546
|
/** Whether to use a modal instead of a drawer for the payment method form */
|
|
@@ -19508,21 +19549,21 @@ var PaymentMethod = function (_a) {
|
|
|
19508
19549
|
var token = useToken();
|
|
19509
19550
|
// Hooks
|
|
19510
19551
|
var queryClient = useQueryClient();
|
|
19511
|
-
var paymentPlugins = usePaymentPlugins({
|
|
19552
|
+
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost, token: token }).paymentPlugins;
|
|
19512
19553
|
var showSuccessNotification = useSuccessNotification();
|
|
19513
19554
|
var handleAllErrorFormats = useAllErrorFormats(onTokenExpired);
|
|
19514
|
-
var data = usePaymentMethod({
|
|
19515
|
-
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost,
|
|
19555
|
+
var data = usePaymentMethod({ graphQLClient: graphQLClient, token: token }).data;
|
|
19556
|
+
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost, token);
|
|
19516
19557
|
// Queries
|
|
19517
19558
|
var billingDetails = useQuery({
|
|
19518
|
-
queryKey: QueryKeyFactory.default.billingDetailsKey({
|
|
19559
|
+
queryKey: QueryKeyFactory.default.billingDetailsKey({ token: token }),
|
|
19519
19560
|
queryFn: function () { return getBillingDetails({ token: token, apiHost: apiHost }); },
|
|
19520
19561
|
}).data;
|
|
19521
19562
|
// Local state
|
|
19522
19563
|
var _g = useState(false), showModal = _g[0], setShowModal = _g[1];
|
|
19523
19564
|
var onSuccess = function () {
|
|
19524
19565
|
queryClient.invalidateQueries({
|
|
19525
|
-
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({
|
|
19566
|
+
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({ token: token }),
|
|
19526
19567
|
});
|
|
19527
19568
|
setShowModal(false);
|
|
19528
19569
|
showSuccessNotification("Your payment method has been saved");
|
|
@@ -19538,7 +19579,7 @@ var PaymentMethod = function (_a) {
|
|
|
19538
19579
|
return [2 /*return*/];
|
|
19539
19580
|
}
|
|
19540
19581
|
});
|
|
19541
|
-
}); }, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data, shadow: shadow, cardEnabled: cardEnabled })) : (jsx(EmptyCard, { onClick: function () { return setShowModal(true); }, shadow: shadow, cardEnabled: cardEnabled })), jsx(PaymentMethodDisplay, __assign({ useModal: useModal, setShowModal: setShowModal, showModal: showModal }, { children: jsx(PaymentForm, {
|
|
19582
|
+
}); }, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data, shadow: shadow, cardEnabled: cardEnabled })) : (jsx(EmptyCard, { onClick: function () { return setShowModal(true); }, shadow: shadow, cardEnabled: cardEnabled })), jsx(PaymentMethodDisplay, __assign({ useModal: useModal, setShowModal: setShowModal, showModal: showModal }, { children: jsx(PaymentForm, { onFail: function (error) {
|
|
19542
19583
|
handleAllErrorFormats(error);
|
|
19543
19584
|
}, onPaymentSuccess: function () {
|
|
19544
19585
|
onSuccess();
|
|
@@ -19560,9 +19601,9 @@ var PaymentMethodDisplay = function (_a) {
|
|
|
19560
19601
|
}, title: jsx(DrawerHeader, { onClose: function () { return setShowModal(false); }, title: "New payment method", closeButtonClassName: "ant-drawer-close" }) }, { children: children })));
|
|
19561
19602
|
};
|
|
19562
19603
|
|
|
19563
|
-
var MUTATION$6 = function () { return "\nmutation AccountSignup (\n $
|
|
19604
|
+
var MUTATION$6 = function () { return "\nmutation AccountSignup (\n $pluginId: String!,\n $paymentMethodId: String,\n $priceListCode: String!,\n $accountId: ID!,\n $quoteId: ID!\n) {\n accountSignup(\n pluginId: $pluginId,\n paymentMethodId: $paymentMethodId,\n priceListCode: $priceListCode,\n accountId: $accountId,\n quoteId: $quoteId\n ) {\n errors\n quote {\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\n backdatedPeriods\n backdatedQuote\n billingDay\n contactId\n createdAt\n credits\n currencyId\n dealId\n discount\n discountValue\n endDate\n evergreen\n expiresAt\n id\n invoiceImmediately\n invoiceImmediatelyAvailable\n invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n number\n ownerId\n payableId\n periodAmount\n poNumber\n requiresApproval\n smallUnitAmountDue\n splitInvoice\n startDate\n state\n subtotal\n taxAmount\n taxCode\n updatedAt\n uuid\n }\n }\n}"; };
|
|
19564
19605
|
var accountSignup = function (_a) {
|
|
19565
|
-
var token = _a.token, apiHost = _a.apiHost,
|
|
19606
|
+
var token = _a.token, apiHost = _a.apiHost, accountId = _a.accountId, quoteId = _a.quoteId, paymentToken = _a.paymentToken, paymentMethodId = _a.paymentMethodId, pluginId = _a.pluginId, priceListCode = _a.priceListCode;
|
|
19566
19607
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19567
19608
|
var vars, response, errors;
|
|
19568
19609
|
var _b;
|
|
@@ -19570,7 +19611,6 @@ var accountSignup = function (_a) {
|
|
|
19570
19611
|
switch (_c.label) {
|
|
19571
19612
|
case 0:
|
|
19572
19613
|
vars = {
|
|
19573
|
-
entityId: entityId,
|
|
19574
19614
|
accountId: accountId,
|
|
19575
19615
|
quoteId: quoteId,
|
|
19576
19616
|
paymentToken: paymentToken,
|
|
@@ -19595,9 +19635,9 @@ var accountSignup = function (_a) {
|
|
|
19595
19635
|
});
|
|
19596
19636
|
};
|
|
19597
19637
|
|
|
19598
|
-
var MUTATION$5 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $
|
|
19638
|
+
var MUTATION$5 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $priceListCode: String!\n) {\n quoteAccountSignup(\n priceListCode: $priceListCode,\n accountName: $accountName,\n billingContact: $billingContact\n ) {\n account {\n id\n }\n quote {\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\n backdatedPeriods\n backdatedQuote\n billingDay\n contactId\n createdAt\n credits\n currencyId\n dealId\n discount\n discountValue\n endDate\n evergreen\n expiresAt\n id\n invoiceImmediately\n invoiceImmediatelyAvailable\n invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n number\n ownerId\n payableId\n periodAmount\n poNumber\n requiresApproval\n smallUnitAmountDue\n splitInvoice\n startDate\n state\n subtotal\n taxAmount\n taxCode\n updatedAt\n uuid\n }\n tenant {\n code\n }\n portalSessionToken\n errors\n }\n}"; };
|
|
19599
19639
|
var quoteAccountSignup = function (_a) {
|
|
19600
|
-
var token = _a.token, apiHost = _a.apiHost,
|
|
19640
|
+
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact;
|
|
19601
19641
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19602
19642
|
var vars, response, errors;
|
|
19603
19643
|
var _b;
|
|
@@ -19605,7 +19645,6 @@ var quoteAccountSignup = function (_a) {
|
|
|
19605
19645
|
switch (_c.label) {
|
|
19606
19646
|
case 0:
|
|
19607
19647
|
vars = {
|
|
19608
|
-
entityId: entityId,
|
|
19609
19648
|
priceListCode: priceListCode,
|
|
19610
19649
|
accountName: accountName,
|
|
19611
19650
|
billingContact: billingContact,
|
|
@@ -19649,9 +19688,9 @@ var getPriceList = function (_a) {
|
|
|
19649
19688
|
};
|
|
19650
19689
|
|
|
19651
19690
|
function PaymentForms(_a) {
|
|
19652
|
-
var quote = _a.quote, handlePaymentSuccess = _a.handlePaymentSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment,
|
|
19691
|
+
var quote = _a.quote, handlePaymentSuccess = _a.handlePaymentSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment, accountId = _a.accountId, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction;
|
|
19653
19692
|
var apiHost = useContext(BunnyContext).apiHost;
|
|
19654
|
-
return (jsx(Fragment, { children: quote ? (jsx(Fragment, { children: overrideToken ? (jsx(PaymentForm, {
|
|
19693
|
+
return (jsx(Fragment, { children: quote ? (jsx(Fragment, { children: overrideToken ? (jsx(PaymentForm, { onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, graphQLClient: createGraphQLClient(apiHost, overrideToken), customCheckoutFunction: customCheckoutFunction })) : null })) : (jsx(InitialSignupForm, { onSubmit: handleSubmit, submitting: proceedingToPayment })) }));
|
|
19655
19694
|
}
|
|
19656
19695
|
function InitialSignupForm(_a) {
|
|
19657
19696
|
var onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
@@ -19685,7 +19724,7 @@ function PriceListDisplay(_a) {
|
|
|
19685
19724
|
|
|
19686
19725
|
var showErrorNotification = useErrorNotification();
|
|
19687
19726
|
function Signup(_a) {
|
|
19688
|
-
var companyName = _a.companyName,
|
|
19727
|
+
var companyName = _a.companyName, priceListCode = _a.priceListCode, returnUrl = _a.returnUrl, _b = _a.isCardEnabled, isCardEnabled = _b === void 0 ? true : _b, className = _a.className, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, style = _a.style;
|
|
19689
19728
|
// Hooks
|
|
19690
19729
|
var _d = useContext(BunnyContext), apiHost = _d.apiHost, graphQLClient = _d.graphQLClient;
|
|
19691
19730
|
var tokenFromContexts = useToken();
|
|
@@ -19700,7 +19739,6 @@ function Signup(_a) {
|
|
|
19700
19739
|
var _k = useState(undefined), paymentMethodGraphQLClient = _k[0], setPaymentMethodGraphQLClient = _k[1];
|
|
19701
19740
|
var paymentMethod = usePaymentMethod({
|
|
19702
19741
|
accountId: accountId,
|
|
19703
|
-
entityId: entityId,
|
|
19704
19742
|
graphQLClient: paymentMethodGraphQLClient || graphQLClient,
|
|
19705
19743
|
token: token,
|
|
19706
19744
|
}).data;
|
|
@@ -19721,7 +19759,6 @@ function Signup(_a) {
|
|
|
19721
19759
|
return [4 /*yield*/, quoteAccountSignup({
|
|
19722
19760
|
token: token,
|
|
19723
19761
|
apiHost: apiHost,
|
|
19724
|
-
entityId: entityId,
|
|
19725
19762
|
priceListCode: priceListCode,
|
|
19726
19763
|
accountName: formData.accountName,
|
|
19727
19764
|
billingContact: {
|
|
@@ -19739,7 +19776,6 @@ function Signup(_a) {
|
|
|
19739
19776
|
// to instead use paymentMethods from portalSessionToken.
|
|
19740
19777
|
queryClient.invalidateQueries({
|
|
19741
19778
|
queryKey: QueryKeyFactory.default.accountPaymentMethodKey({
|
|
19742
|
-
entityId: entityId,
|
|
19743
19779
|
token: token,
|
|
19744
19780
|
}),
|
|
19745
19781
|
});
|
|
@@ -19784,7 +19820,6 @@ function Signup(_a) {
|
|
|
19784
19820
|
return [4 /*yield*/, accountSignup({
|
|
19785
19821
|
token: portalSessionToken,
|
|
19786
19822
|
apiHost: apiHost,
|
|
19787
|
-
entityId: entityId,
|
|
19788
19823
|
quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
19789
19824
|
paymentMethodId: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
|
|
19790
19825
|
pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
|
|
@@ -19805,7 +19840,7 @@ function Signup(_a) {
|
|
|
19805
19840
|
};
|
|
19806
19841
|
return (jsx(WrapperComponent, __assign({ className: "p-4 flex flex-col ".concat(shadow, " ").concat(className), style: style }, { children: purchaseSucceeded ? (jsx(Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "w-full", companyName: companyName, returnUrl: returnUrl, currencyId: quote === null || quote === void 0 ? void 0 : quote.currencyId })) : (jsx("div", { children: "No currency ID found from Quote" })) })) : (jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col" : "flex-row", " h-full w-full") }, { children: [jsx("div", __assign({ className: "flex flex-col ".concat(isMobile ? "items-center" : "w-1/2 items-center") }, { children: jsx(PriceListDisplay, { priceListData: priceListData, topNavImageUrl: topNavImageUrl }) })), jsx("div", __assign({ className: "".concat(isMobile ? "h-full" : "my-4") }, { children: jsx(Divider, { className: "h-full", type: isMobile ? undefined : "vertical" }) })), jsx("div", __assign({ className: "flex ".concat(isMobile
|
|
19807
19842
|
? "items-center justify-center my-12"
|
|
19808
|
-
: "w-1/2 items-center justify-center my-12") }, { children: jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "w-1/2") }, { children: jsx(PaymentForms, {
|
|
19843
|
+
: "w-1/2 items-center justify-center my-12") }, { children: jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "w-1/2") }, { children: jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction }) })) }))] }))) })));
|
|
19809
19844
|
}
|
|
19810
19845
|
|
|
19811
19846
|
var createRequestHeaders = function (token) {
|
|
@@ -19843,7 +19878,7 @@ var useCreateSubscriptionQuote = function () {
|
|
|
19843
19878
|
var data;
|
|
19844
19879
|
return __generator(this, function (_a) {
|
|
19845
19880
|
switch (_a.label) {
|
|
19846
|
-
case 0: return [4 /*yield*/, graphQLRequest("\n mutation quoteSubscriptionUpdate(\n $subscriptionIds: [ID!]!,\n ) {\n quoteSubscriptionUpdate(\n subscriptionIds: $subscriptionIds,\n ) {\n quote {\n id\n quoteChanges {\n id\n priceList {\n id\n }\n charges {\n
|
|
19881
|
+
case 0: return [4 /*yield*/, graphQLRequest("\n mutation quoteSubscriptionUpdate(\n $subscriptionIds: [ID!]!,\n ) {\n quoteSubscriptionUpdate(\n subscriptionIds: $subscriptionIds,\n ) {\n quote {\n id\n quoteChanges {\n id\n priceList {\n id\n }\n subscription {\n charges {\n startDate\n endDate\n id\n priceListCharge {\n id\n }\n }\n }\n }\n }\n }\n }\n ", token, apiHost, {
|
|
19847
19882
|
subscriptionIds: subscriptionIds,
|
|
19848
19883
|
})];
|
|
19849
19884
|
case 1:
|
|
@@ -19905,7 +19940,7 @@ var getQuote = function (_a) {
|
|
|
19905
19940
|
|
|
19906
19941
|
var SUBSCRIPTIONS_QUERY = "\nquery subscriptions {\n subscriptions {\n nodes {\n cancellationDate\n currencyId\n endDate\n evergreen\n id\n period\n plan { id name selfServiceBuy selfServiceCancel selfServiceRenew }\n priceList { id periodMonths }\n product { id name showProductNameOnLineItem }\n startDate\n state\n trialEndDate\n trialPeriod\n trialStartDate\n charges {\n priceListCharge {\n priceListChargeTiers {\n price\n starts\n }\n }\n amount\n billingPeriod\n chargeType\n discount\n discountedPrice\n endDate\n expired\n feature { name }\n id\n isAmendment\n isRamp\n kind\n name\n periodPrice\n price\n priceDecimals\n priceListChargeId\n priceTiers { starts price }\n pricingModel\n quantity\n selfServiceQuantity\n startDate\n trial\n }\n }\n }\n }";
|
|
19907
19942
|
var getSubscriptions = function (_a) {
|
|
19908
|
-
var apiHost = _a.apiHost,
|
|
19943
|
+
var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, token = _a.token;
|
|
19909
19944
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19910
19945
|
var response, combinedSubscriptions;
|
|
19911
19946
|
var _b, _c;
|
|
@@ -19915,7 +19950,6 @@ var getSubscriptions = function (_a) {
|
|
|
19915
19950
|
isInPreviewMode: isInPreviewMode,
|
|
19916
19951
|
query: SUBSCRIPTIONS_QUERY,
|
|
19917
19952
|
token: token,
|
|
19918
|
-
vars: { entityId: entityId },
|
|
19919
19953
|
apiHost: apiHost,
|
|
19920
19954
|
})];
|
|
19921
19955
|
case 1:
|
|
@@ -20010,9 +20044,8 @@ var getTaxationRequiredAccountFields = function (_a) {
|
|
|
20010
20044
|
};
|
|
20011
20045
|
|
|
20012
20046
|
var useHasTaxPlugin = function (_a) {
|
|
20013
|
-
var
|
|
20047
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
20014
20048
|
var plugins = usePlugins({
|
|
20015
|
-
entityId: entityId,
|
|
20016
20049
|
apiHost: apiHost,
|
|
20017
20050
|
token: token,
|
|
20018
20051
|
}).data;
|
|
@@ -20092,7 +20125,7 @@ var FormBillingState = function (_a) {
|
|
|
20092
20125
|
};
|
|
20093
20126
|
|
|
20094
20127
|
var QuoteCheckout = function (_a) {
|
|
20095
|
-
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields
|
|
20128
|
+
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields;
|
|
20096
20129
|
var _b = useContext(BunnyContext), apiHost = _b.apiHost, graphQLClient = _b.graphQLClient;
|
|
20097
20130
|
var token = useToken();
|
|
20098
20131
|
var isMobile = useIsMobile();
|
|
@@ -20127,12 +20160,12 @@ var QuoteCheckout = function (_a) {
|
|
|
20127
20160
|
}
|
|
20128
20161
|
if (taxationRequiredAccountFields)
|
|
20129
20162
|
return (jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
20130
|
-
return (jsx(Fragment, { children: paymentRequired ? (jsx(PaymentForm, {
|
|
20163
|
+
return (jsx(Fragment, { children: paymentRequired ? (jsx(PaymentForm, { onFail: onFail, onPaymentSuccess: onSuccess, quote: quote, graphQLClient: graphQLClient })) : (jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxs("div", __assign({ className: "flex flex-col gap-2 ".concat(isMobile ? "bunny-shadow-padding-x" : "") }, { children: [jsx(Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? "Processing..." : "Complete order" })), jsx("div", __assign({ className: "text-xs text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20131
20164
|
};
|
|
20132
20165
|
var PaymentFormWrapper = function (_a) {
|
|
20133
20166
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
20134
20167
|
var isMobile = useIsMobile();
|
|
20135
|
-
return (jsx("div", __assign({ className: "flex flex-col gap-6 shrink-0 ".concat(isMobile ? "w-full shadow-padding-xb" : "", " ").concat(className), style: __assign({}, (isMobile
|
|
20168
|
+
return (jsx("div", __assign({ className: "flex flex-col gap-6 shrink-0 ".concat(isMobile ? "w-full bunny-shadow-padding-xb" : "", " ").concat(className), style: __assign({}, (isMobile
|
|
20136
20169
|
? setMaxHeight
|
|
20137
20170
|
? { maxHeight: "60vh" }
|
|
20138
20171
|
: {}
|
|
@@ -20144,11 +20177,10 @@ var PaymentFormWrapper = function (_a) {
|
|
|
20144
20177
|
var queryKeyFactory = QueryKeyFactory.default;
|
|
20145
20178
|
var Checkout = function (_a) {
|
|
20146
20179
|
var _b, _c;
|
|
20147
|
-
var
|
|
20180
|
+
var onCancel = _a.onCancel, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, open = _a.open, quote = _a.quote, selectedPriceList = _a.selectedPriceList, token = _a.token, _d = _a.quantity, quantity = _d === void 0 ? 0 : _d;
|
|
20148
20181
|
var _e = useContext(BunnyContext), apiHost = _e.apiHost, graphQLClient = _e.graphQLClient;
|
|
20149
20182
|
var isMobile = useIsMobile();
|
|
20150
20183
|
var hasTaxPlugin = useHasTaxPlugin({
|
|
20151
|
-
entityId: entityId,
|
|
20152
20184
|
apiHost: apiHost,
|
|
20153
20185
|
token: token,
|
|
20154
20186
|
});
|
|
@@ -20217,9 +20249,9 @@ var Checkout = function (_a) {
|
|
|
20217
20249
|
return null;
|
|
20218
20250
|
return (jsx("div", __assign({ className: "flex flex-col fixed top-0 left-0 right-0 bottom-0 bg-slate-50 overflow-auto", style: {
|
|
20219
20251
|
zIndex: 1001,
|
|
20220
|
-
} }, { children: jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsx("div", __assign({ className: "flex justify-end w-full" }, { children: jsx(CloseOutlined, { className: "text-base shadow-padding-xb", onClick: onCancel }) })), jsxs("div", __assign({ className: "flex justify-end gap-6 pt-4 ".concat(isMobile ? "flex-col" : "shadow-padding-xb") }, { children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsx(InvoiceQuoteView, { html: invoice ? invoice.html : quote ? quote.formattedQuote.html : "" })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html)) && (jsx(Divider, { className: "h-full", type: "vertical" })), invoice ? (jsx("div", __assign({ className: "w-full pt-12" }, { children: jsx(PaymentForm, {
|
|
20252
|
+
} }, { children: jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsx("div", __assign({ className: "flex justify-end w-full" }, { children: jsx(CloseOutlined, { className: "text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxs("div", __assign({ className: "flex justify-end gap-6 pt-4 ".concat(isMobile ? "flex-col" : "bunny-shadow-padding-xb") }, { children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsx(InvoiceQuoteView, { html: invoice ? invoice.html : quote ? quote.formattedQuote.html : "" })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html)) && (jsx(Divider, { className: "h-full", type: "vertical" })), invoice ? (jsx("div", __assign({ className: "w-full pt-12" }, { children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice, graphQLClient: graphQLClient }) }))) : quote ? (jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
20221
20253
|
onFail(error);
|
|
20222
|
-
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsx(PaymentForm, {
|
|
20254
|
+
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsx(PaymentForm, { onFail: function (error) {
|
|
20223
20255
|
onFail(error);
|
|
20224
20256
|
}, onPaymentSuccess: onSuccess, graphQLClient: graphQLClient }))] }))] })) })));
|
|
20225
20257
|
};
|
|
@@ -20235,7 +20267,7 @@ var useCurrentUserData = function () {
|
|
|
20235
20267
|
|
|
20236
20268
|
var BunnyFooterIcon = function (_a) {
|
|
20237
20269
|
var color = _a.color;
|
|
20238
|
-
return (jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsx("path", { className: "icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsx("path", { className: "icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsx("path", { className: "icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsx("path", { className: "icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsx("path", { className: "icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsx("path", { className: "icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] })), jsx("defs", { children: jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
|
|
20270
|
+
return (jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsx("path", { className: "bunny-icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] })), jsx("defs", { children: jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
|
|
20239
20271
|
};
|
|
20240
20272
|
|
|
20241
20273
|
var SubscriptionsContext = createContext({});
|
|
@@ -20483,13 +20515,12 @@ var CheckoutPrice = function (_a) {
|
|
|
20483
20515
|
|
|
20484
20516
|
var CheckoutBarSummarySection = function (_a) {
|
|
20485
20517
|
var _b, _c;
|
|
20486
|
-
var open = _a.open, quantityLocal = _a.quantityLocal, quote = _a.quote, selectedPriceList = _a.selectedPriceList, onClickCheckout = _a.onClickCheckout,
|
|
20518
|
+
var open = _a.open, quantityLocal = _a.quantityLocal, quote = _a.quote, selectedPriceList = _a.selectedPriceList, onClickCheckout = _a.onClickCheckout, upgradingSubscription = _a.upgradingSubscription, quotePreviewData = _a.quotePreviewData;
|
|
20487
20519
|
// Context
|
|
20488
20520
|
var apiHost = useContext(BunnyContext).apiHost;
|
|
20489
20521
|
// Hooks
|
|
20490
20522
|
var token = useToken();
|
|
20491
20523
|
var paymentMethodAllowedPlugins = usePaymentPlugins({
|
|
20492
|
-
entityId: entityId,
|
|
20493
20524
|
apiHost: apiHost,
|
|
20494
20525
|
token: token,
|
|
20495
20526
|
}).paymentMethodAllowedPlugins;
|
|
@@ -20534,7 +20565,7 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
20534
20565
|
var selectedPriceList = _a.selectedPriceList, handlePortalErrors = _a.handlePortalErrors, onCheckoutSuccess = _a.onCheckoutSuccess;
|
|
20535
20566
|
// Context
|
|
20536
20567
|
var token = useToken();
|
|
20537
|
-
var _c = useContext(SubscriptionsContext),
|
|
20568
|
+
var _c = useContext(SubscriptionsContext), quotePreviewData = _c.quotePreviewData, upgradingSubscription = _c.upgradingSubscription, shadow = _c.shadow;
|
|
20538
20569
|
var _d = useContext(BunnyContext), apiHost = _d.apiHost, graphQLClient = _d.graphQLClient;
|
|
20539
20570
|
// Local state
|
|
20540
20571
|
var _e = useState(0), quantityLocal = _e[0], setQuantity = _e[1];
|
|
@@ -20609,7 +20640,6 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
20609
20640
|
var handleCheckoutSuccess = function () {
|
|
20610
20641
|
queryClient.invalidateQueries({
|
|
20611
20642
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
20612
|
-
filterString: "entityId=".concat(entityId),
|
|
20613
20643
|
pluralType: "subscriptions",
|
|
20614
20644
|
token: token,
|
|
20615
20645
|
}),
|
|
@@ -20652,7 +20682,7 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
20652
20682
|
}, [queryClient, selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id, quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.quantity, token]);
|
|
20653
20683
|
return (jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-4" : "flex-row", " my-2 p-4 justify-between bg-white rounded-md ").concat(shadow ? "shadow-".concat(shadow) : "") }, { children: [jsx("div", __assign({ className: "".concat(isMobile ? "flex flex-col" : "flex", " gap-4") }, { children: selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.charges.map(function (charge, index) {
|
|
20654
20684
|
return (jsx(CheckoutBarInput, { charge: charge, quantity: quantityLocal || 0, selectedPriceList: selectedPriceList, setQuantity: setQuantity }, index));
|
|
20655
|
-
}) })), jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quantityLocal: quantityLocal, quote: quote, selectedPriceList: selectedPriceList,
|
|
20685
|
+
}) })), jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quantityLocal: quantityLocal, quote: quote, selectedPriceList: selectedPriceList, upgradingSubscription: upgradingSubscription, quotePreviewData: quotePreviewData }), jsx(Checkout, { isMobile: isMobile, onCancel: function () { return setPayModalVisible(false); }, onFail: onCheckoutFail, onSuccess: handleCheckoutSuccess, open: payModalVisible, quantity: quantityLocal, quote: quote, selectedPriceList: selectedPriceList, storedPaymentMethod: storedPaymentMethod, token: token })] })));
|
|
20656
20686
|
};
|
|
20657
20687
|
|
|
20658
20688
|
// WARNING: There is a preview button on APP that will need to be changed if this query is changed
|
|
@@ -21088,13 +21118,13 @@ var PriceListGridMobile = function (_a) {
|
|
|
21088
21118
|
var prevPriceListIndex = availablePriceLists.findIndex(function (priceList) { return priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id); });
|
|
21089
21119
|
var prevPlanId = (_b = availablePriceLists[prevPriceListIndex - 1]) === null || _b === void 0 ? void 0 : _b.plan.id;
|
|
21090
21120
|
var prevPlan = (_c = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _c === void 0 ? void 0 : _c.find(function (plan) { return plan.id === prevPlanId; });
|
|
21091
|
-
return (jsxs(Fragment, { children: [jsx("div", __assign({ className: "flex gap-4 overflow-auto shadow-padding-xb", style: { flexShrink: 0 } }, { children: availablePriceLists.map(function (priceList, index) {
|
|
21121
|
+
return (jsxs(Fragment, { children: [jsx("div", __assign({ className: "flex gap-4 overflow-auto bunny-shadow-padding-xb", style: { flexShrink: 0 } }, { children: availablePriceLists.map(function (priceList, index) {
|
|
21092
21122
|
var _a;
|
|
21093
21123
|
var plan = (_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.find(function (plan) { return plan.id === priceList.plan.id; });
|
|
21094
21124
|
return (jsx(PriceListCard, { isSelected: priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id), onClick: onChangePriceList, plan: plan, priceList: priceList, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }, index));
|
|
21095
|
-
}) })), jsx(Text$8, __assign({ className: "text-slate-500 pt-5 pb-4 shadow-padding-x" }, { children: everythingInPlus && prevPlan
|
|
21125
|
+
}) })), jsx(Text$8, __assign({ className: "text-slate-500 pt-5 pb-4 bunny-shadow-padding-x" }, { children: everythingInPlus && prevPlan
|
|
21096
21126
|
? everythingInPlusString({ plan: prevPlan })
|
|
21097
|
-
: "Features" })), jsx("div", __assign({ className: "flex flex-col gap-4 overflow-auto shadow-padding-x" }, { children: (_d = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.features) === null || _d === void 0 ? void 0 : _d.map(function (feature, index) { return (jsx(PriceListCardFeature, { feature: feature, index: index }, index)); }) }))] }));
|
|
21127
|
+
: "Features" })), jsx("div", __assign({ className: "flex flex-col gap-4 overflow-auto bunny-shadow-padding-x" }, { children: (_d = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.features) === null || _d === void 0 ? void 0 : _d.map(function (feature, index) { return (jsx(PriceListCardFeature, { feature: feature, index: index }, index)); }) }))] }));
|
|
21098
21128
|
};
|
|
21099
21129
|
|
|
21100
21130
|
var PriceListGrid = function (_a) {
|
|
@@ -21259,21 +21289,17 @@ var PlanPicker = function () {
|
|
|
21259
21289
|
// Context
|
|
21260
21290
|
var token = useToken();
|
|
21261
21291
|
var apiHost = useContext(BunnyContext).apiHost;
|
|
21262
|
-
var _b = useContext(SubscriptionsContext),
|
|
21292
|
+
var _b = useContext(SubscriptionsContext), isInPreviewMode = _b.isInPreviewMode, productId = _b.productId, quotePreviewData = _b.quotePreviewData, setQuotePreviewData = _b.setQuotePreviewData, upgradingSubscription = _b.upgradingSubscription;
|
|
21263
21293
|
// Hooks
|
|
21264
21294
|
var queryClient = useQueryClient();
|
|
21265
21295
|
var showInfoNotification = useInfoNotification();
|
|
21266
21296
|
// Queries
|
|
21267
21297
|
var _c = useQuery({
|
|
21268
21298
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
21269
|
-
filterString: "entityId=".concat(entityId),
|
|
21270
21299
|
pluralType: "subscriptions",
|
|
21271
21300
|
token: token,
|
|
21272
21301
|
}),
|
|
21273
|
-
queryFn: function () {
|
|
21274
|
-
return getSubscriptions({ entityId: entityId, isInPreviewMode: isInPreviewMode, token: token, apiHost: apiHost });
|
|
21275
|
-
},
|
|
21276
|
-
enabled: Boolean(entityId),
|
|
21302
|
+
queryFn: function () { return getSubscriptions({ isInPreviewMode: isInPreviewMode, token: token, apiHost: apiHost }); },
|
|
21277
21303
|
}), subscriptions = _c.data, areSubscriptionsLoading = _c.isLoading;
|
|
21278
21304
|
var _d = useQuery({
|
|
21279
21305
|
queryKey: QueryKeyFactory.default.planChangeOptionsKey({
|
|
@@ -21342,7 +21368,7 @@ var PlanManager = function (_a) {
|
|
|
21342
21368
|
// Context
|
|
21343
21369
|
var token = useToken();
|
|
21344
21370
|
var _b = useContext(BunnyContext), apiHost = _b.apiHost, graphQLClient = _b.graphQLClient;
|
|
21345
|
-
var _c = useContext(SubscriptionsContext),
|
|
21371
|
+
var _c = useContext(SubscriptionsContext), isInPreviewMode = _c.isInPreviewMode, upgradingSubscription = _c.upgradingSubscription, setUpgradingSubscription = _c.setUpgradingSubscription, subscriptionUpgradeId = _c.subscriptionUpgradeId, setQuotePreviewData = _c.setQuotePreviewData, quotePreviewData = _c.quotePreviewData, className = _c.className;
|
|
21346
21372
|
// Local state
|
|
21347
21373
|
var _d = useState(), editingQuoteData = _d[0], setEditingQuoteData = _d[1];
|
|
21348
21374
|
var _e = useState(false), payModalVisible = _e[0], setPayModalVisible = _e[1];
|
|
@@ -21360,14 +21386,11 @@ var PlanManager = function (_a) {
|
|
|
21360
21386
|
// Queries
|
|
21361
21387
|
var _g = useQuery({
|
|
21362
21388
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
21363
|
-
filterString: "entityId=".concat(entityId),
|
|
21364
21389
|
pluralType: "subscriptions",
|
|
21365
21390
|
token: token,
|
|
21366
21391
|
}),
|
|
21367
|
-
queryFn: function () {
|
|
21368
|
-
|
|
21369
|
-
},
|
|
21370
|
-
enabled: Boolean(entityId),
|
|
21392
|
+
queryFn: function () { return getSubscriptions({ isInPreviewMode: isInPreviewMode, token: token, apiHost: apiHost }); },
|
|
21393
|
+
enabled: false,
|
|
21371
21394
|
}), subscriptions = _g.data, subscriptionsAreLoading = _g.isLoading;
|
|
21372
21395
|
var quote = useQuery({
|
|
21373
21396
|
queryKey: QueryKeyFactory.default.createObjectKey({
|
|
@@ -21422,7 +21445,6 @@ var PlanManager = function (_a) {
|
|
|
21422
21445
|
});
|
|
21423
21446
|
queryClient.invalidateQueries({
|
|
21424
21447
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
21425
|
-
filterString: "entityId=".concat(entityId),
|
|
21426
21448
|
pluralType: "subscriptions",
|
|
21427
21449
|
token: token,
|
|
21428
21450
|
}),
|
|
@@ -21438,12 +21460,12 @@ var PlanManager = function (_a) {
|
|
|
21438
21460
|
};
|
|
21439
21461
|
if (subscriptionsAreLoading && !isInPreviewMode)
|
|
21440
21462
|
return jsx(Fragment, {});
|
|
21441
|
-
return (jsxs("div", __assign({ className: "".concat(className
|
|
21463
|
+
return (jsxs("div", __assign({ className: "".concat(className) }, { children: [jsx(PreviewModeAdvisary, { isInPreviewMode: isInPreviewMode }), jsx(PageTitle, { onGoBack: function () {
|
|
21442
21464
|
if (isInPreviewMode)
|
|
21443
21465
|
return showInfoNotification("You are in preview mode");
|
|
21444
21466
|
setQuotePreviewData(undefined);
|
|
21445
21467
|
onChangePlanCancel();
|
|
21446
|
-
}, title: "Change plan" }), jsx(PlanPicker, {}), jsx(Checkout, {
|
|
21468
|
+
}, title: "Change plan" }), jsx(PlanPicker, {}), jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile, storedPaymentMethod: storedPaymentMethod, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList, quantity: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.quantity }), jsx("div", { ref: stickyRef }), jsx("div", __assign({ className: "sticky bottom-4 transition-[margin] duration-300 ".concat(isSticky ? "mx-4" : "mx-0") }, { children: jsx(PlanPickerCheckoutBarWrapper, { handlePortalErrors: handlePortalErrors, onCheckoutSuccess: function () { return onChangePlanCancel(); } }) })), jsx(Footer, {})] })));
|
|
21447
21469
|
};
|
|
21448
21470
|
|
|
21449
21471
|
var useCancelSubscription = function () {
|
|
@@ -21659,7 +21681,7 @@ var getSubscriptionStatusText = function (subscription) {
|
|
|
21659
21681
|
if (cancellationDate &&
|
|
21660
21682
|
(state === null || state === void 0 ? void 0 : state.toUpperCase()) !== SubscriptionState$2.CANCELED &&
|
|
21661
21683
|
(state === null || state === void 0 ? void 0 : state.toUpperCase()) !== SubscriptionState$2.EXPIRED) {
|
|
21662
|
-
return (jsxs(
|
|
21684
|
+
return (jsxs(CustomizedTag, __assign({ color: "red" }, { children: ["Canceled - ends on ", formatDate(cancellationDate)] })));
|
|
21663
21685
|
}
|
|
21664
21686
|
if (evergreen) {
|
|
21665
21687
|
return "Renews on ".concat(formatDate(endDate));
|
|
@@ -21682,7 +21704,7 @@ var SubscriptionCardHeader = function (_a) {
|
|
|
21682
21704
|
var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL;
|
|
21683
21705
|
return (jsxs("div", __assign({ className: "flex items-center justify-between", style: {
|
|
21684
21706
|
backgroundColor: darkMode ? "var(--row-background-dark)" : "",
|
|
21685
|
-
} }, { children: [jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsx(Text$6, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsx(Text$6, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxs(
|
|
21707
|
+
} }, { children: [jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsx(Text$6, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsx(Text$6, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxs(CustomizedTag, __assign({ color: TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsx(Text$6, __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile &&
|
|
21686
21708
|
planChangeOptions &&
|
|
21687
21709
|
onChangePlanClick &&
|
|
21688
21710
|
onCancelSubscriptionClick && (jsx(SubscriptionCardActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscription: subscription }))] }))] })));
|
|
@@ -21823,10 +21845,11 @@ var SubscriptionCardDesktopRow = function (_a) {
|
|
|
21823
21845
|
}).data;
|
|
21824
21846
|
var isRampFirstRow = isRamp && chargeIndex === 0;
|
|
21825
21847
|
var isTrial = charge.trial;
|
|
21848
|
+
var isDiscount = charge.kind === SubscriptionChargeKind.DISCOUNT;
|
|
21826
21849
|
var dontShowChargeName = (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) === charge.priceListChargeId &&
|
|
21850
|
+
!isDiscount &&
|
|
21827
21851
|
(!isTrial || prevCharge.trial) &&
|
|
21828
21852
|
(isTrial || !prevCharge.trial);
|
|
21829
|
-
var isDiscount = charge.kind === SubscriptionChargeKind.DISCOUNT;
|
|
21830
21853
|
return (jsxs("div", __assign({ className: "contents" }, { children: [(isRampFirstRow || !isRamp) && (jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ? "1/-1" : "1" }, { children: jsx("div", __assign({ className: "flex items-center gap-2 ".concat(isDiscount ? "pl-4" : "") }, { children: jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName) ? charge.name : "" }) })) }))), jsx(SubscriptionsListCell, __assign({ gridColumn: 2 }, { children: jsx("div", { children: chargePeriod }) })), jsx(SubscriptionsListCell, __assign({ right: true }, { children: charge.kind === SubscriptionChargeKind.DISCOUNT
|
|
21831
21854
|
? ""
|
|
21832
21855
|
: charge.chargeType === ChargeType.USAGE
|
|
@@ -21921,6 +21944,25 @@ var SubscriptionsListContainer = function (_a) {
|
|
|
21921
21944
|
return (jsx("div", __assign({ className: "flex flex-col gap-".concat(gap, " shrink overflow-auto") }, { children: (subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.length) > 0 ? (jsx(SubscriptionsList, { hideExpired: hideExpired, onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscriptions: subscriptions })) : (noSubscriptionsComponent || (jsx("div", __assign({ className: "flex flex-col items-center w-full" }, { children: jsx(ErrorView, { message: "You have no subscriptions with ".concat(companyName, " yet") }) })))) })));
|
|
21922
21945
|
};
|
|
21923
21946
|
|
|
21947
|
+
var QUOTE_CHARGE_CREATE = "\nmutation QuoteChargeCreate ($quoteChangeId: ID!, $startDate: ISO8601Date!, $endDate: ISO8601Date, $priceListChargeId: ID, $subscriptionChargeId: ID, $price: Float, $quantity: Int) {\n quoteChargeCreate(\n endDate: $endDate\n price: $price\n priceListChargeId: $priceListChargeId\n quantity: $quantity\n quoteChangeId: $quoteChangeId\n startDate: $startDate\n subscriptionChargeId: $subscriptionChargeId\n ) {\n quoteCharge {\n quoteChange {\n id\n quoteId\n }\n }\n }\n}\n\n";
|
|
21948
|
+
var quoteChargeCreate = function (_a) {
|
|
21949
|
+
var endDate = _a.endDate, price = _a.price, priceListChargeId = _a.priceListChargeId, quantity = _a.quantity, quoteChangeId = _a.quoteChangeId, startDate = _a.startDate, subscriptionChargeId = _a.subscriptionChargeId, token = _a.token, apiHost = _a.apiHost;
|
|
21950
|
+
return gqlRequest({
|
|
21951
|
+
query: QUOTE_CHARGE_CREATE,
|
|
21952
|
+
vars: {
|
|
21953
|
+
endDate: endDate,
|
|
21954
|
+
price: price,
|
|
21955
|
+
priceListChargeId: priceListChargeId,
|
|
21956
|
+
quantity: quantity,
|
|
21957
|
+
quoteChangeId: quoteChangeId,
|
|
21958
|
+
startDate: startDate,
|
|
21959
|
+
subscriptionChargeId: subscriptionChargeId,
|
|
21960
|
+
},
|
|
21961
|
+
apiHost: apiHost,
|
|
21962
|
+
token: token,
|
|
21963
|
+
});
|
|
21964
|
+
};
|
|
21965
|
+
|
|
21924
21966
|
var QuantityInput = function (_a) {
|
|
21925
21967
|
var charge = _a.charge, chargeIndex = _a.chargeIndex, editingQuote = _a.editingQuote, setEditingQuoteData = _a.setEditingQuoteData, subscription = _a.subscription, subscriptionIndex = _a.subscriptionIndex, subscriptions = _a.subscriptions;
|
|
21926
21968
|
// Context
|
|
@@ -21941,22 +21983,46 @@ var QuantityInput = function (_a) {
|
|
|
21941
21983
|
(updatingChargeQuantityId && updatingChargeQuantityId !== charge.id) ||
|
|
21942
21984
|
// If the subscription is not self-service, we disable the quantity input
|
|
21943
21985
|
!charge.selfServiceQuantity;
|
|
21944
|
-
var value = (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) === undefined
|
|
21945
|
-
? ""
|
|
21946
|
-
: editedSubscription.quantity;
|
|
21986
|
+
var value = (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) === undefined ? "" : editedSubscription.quantity;
|
|
21947
21987
|
// Mutations
|
|
21988
|
+
var createCharge = useMutation({
|
|
21989
|
+
mutationFn: quoteChargeCreate,
|
|
21990
|
+
onSuccess: function (response) {
|
|
21991
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
21992
|
+
if (!(editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.id)) {
|
|
21993
|
+
var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL;
|
|
21994
|
+
setEditingQuoteData({
|
|
21995
|
+
id: (_e = (_d = (_c = response.quoteChargeCreate) === null || _c === void 0 ? void 0 : _c.quoteCharge) === null || _d === void 0 ? void 0 : _d.quoteChange) === null || _e === void 0 ? void 0 : _e.quoteId,
|
|
21996
|
+
isTrial: isTrial,
|
|
21997
|
+
});
|
|
21998
|
+
}
|
|
21999
|
+
queryClient.invalidateQueries({
|
|
22000
|
+
queryKey: QueryKeyFactory.default.createObjectKey({
|
|
22001
|
+
id: (_h = (_g = (_f = response.quoteChargeCreate) === null || _f === void 0 ? void 0 : _f.quoteCharge) === null || _g === void 0 ? void 0 : _g.quoteChange) === null || _h === void 0 ? void 0 : _h.quoteId,
|
|
22002
|
+
objectName: "editingQuote",
|
|
22003
|
+
token: token,
|
|
22004
|
+
}),
|
|
22005
|
+
});
|
|
22006
|
+
},
|
|
22007
|
+
}).mutate;
|
|
21948
22008
|
var createQuote = useMutation({
|
|
21949
22009
|
mutationFn: function (subscriptionIds) {
|
|
21950
22010
|
return createSubscriptionQuote(subscriptionIds, token, apiHost);
|
|
21951
22011
|
},
|
|
21952
22012
|
onSuccess: function (subscriptionUpdateData) {
|
|
21953
|
-
var _a;
|
|
22013
|
+
var _a, _b;
|
|
21954
22014
|
var quote = (_a = subscriptionUpdateData === null || subscriptionUpdateData === void 0 ? void 0 : subscriptionUpdateData.quoteSubscriptionUpdate) === null || _a === void 0 ? void 0 : _a.quote;
|
|
21955
|
-
var
|
|
21956
|
-
|
|
21957
|
-
|
|
21958
|
-
|
|
21959
|
-
|
|
22015
|
+
var quoteChange = quote.quoteChanges.find(function (quoteChange) { return quoteChange.priceList.id === (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription.priceList.id); });
|
|
22016
|
+
var subscriptionCharge = (_b = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.subscription) === null || _b === void 0 ? void 0 : _b.charges.find(function (charge) { var _a; return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.chargeId); });
|
|
22017
|
+
if (subscriptionCharge && quoteChange) {
|
|
22018
|
+
createCharge({
|
|
22019
|
+
apiHost: apiHost,
|
|
22020
|
+
endDate: subscriptionCharge.endDate,
|
|
22021
|
+
quantity: 1,
|
|
22022
|
+
quoteChangeId: quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id,
|
|
22023
|
+
startDate: subscriptionCharge.startDate,
|
|
22024
|
+
subscriptionChargeId: subscriptionCharge.id,
|
|
22025
|
+
token: token,
|
|
21960
22026
|
});
|
|
21961
22027
|
}
|
|
21962
22028
|
},
|
|
@@ -21969,8 +22035,7 @@ var QuantityInput = function (_a) {
|
|
|
21969
22035
|
onSuccess: function (response) {
|
|
21970
22036
|
var _a, _b, _c, _d, _e, _f;
|
|
21971
22037
|
if (!(editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.id)) {
|
|
21972
|
-
var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) ===
|
|
21973
|
-
SubscriptionState$2.TRIAL;
|
|
22038
|
+
var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$2.TRIAL;
|
|
21974
22039
|
setEditingQuoteData({
|
|
21975
22040
|
id: (_d = (_c = response.quoteChangeUpdate) === null || _c === void 0 ? void 0 : _c.quoteChange) === null || _d === void 0 ? void 0 : _d.quoteId,
|
|
21976
22041
|
isTrial: isTrial,
|
|
@@ -21987,8 +22052,7 @@ var QuantityInput = function (_a) {
|
|
|
21987
22052
|
});
|
|
21988
22053
|
// Handlers
|
|
21989
22054
|
var isQuantityLowerThanOriginal = function (quantity) {
|
|
21990
|
-
return (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) !== undefined &&
|
|
21991
|
-
editedSubscription.quantity <= quantity;
|
|
22055
|
+
return (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) !== undefined && editedSubscription.quantity <= quantity;
|
|
21992
22056
|
};
|
|
21993
22057
|
var onChangeQuantity = function (chargeIndex, value, priceListChargeId, subscription, subscriptionIndex) {
|
|
21994
22058
|
var quantity = isNaN(parseInt(value)) ? 0 : parseInt(value);
|
|
@@ -22191,7 +22255,7 @@ var SubscriptionsNavigation = function (_a) {
|
|
|
22191
22255
|
|
|
22192
22256
|
var Text = Typography.Text;
|
|
22193
22257
|
var SubscriptionsWrapper = function (_a) {
|
|
22194
|
-
var handlePortalErrors = _a.handlePortalErrors,
|
|
22258
|
+
var handlePortalErrors = _a.handlePortalErrors, companyName = _a.companyName, _b = _a.isInPreviewMode, isInPreviewMode = _b === void 0 ? false : _b, productId = _a.productId, className = _a.className, _c = _a.styles, userStyles = _c === void 0 ? {} : _c, noSubscriptionsComponent = _a.noSubscriptionsComponent, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d;
|
|
22195
22259
|
var defaultStyles = {
|
|
22196
22260
|
gap: 4,
|
|
22197
22261
|
shadow: "sm",
|
|
@@ -22211,7 +22275,6 @@ var SubscriptionsWrapper = function (_a) {
|
|
|
22211
22275
|
className: className,
|
|
22212
22276
|
subscriptionProductNameStyle: styles.subscriptionProductNameStyle,
|
|
22213
22277
|
productId: productId,
|
|
22214
|
-
entityId: entityId,
|
|
22215
22278
|
isInPreviewMode: isInPreviewMode,
|
|
22216
22279
|
upgradingSubscription: upgradingSubscription,
|
|
22217
22280
|
setUpgradingSubscription: setUpgradingSubscription,
|
|
@@ -22228,7 +22291,7 @@ var Subscriptions = function (_a) {
|
|
|
22228
22291
|
// Context
|
|
22229
22292
|
var token = useToken();
|
|
22230
22293
|
var _b = useContext(BunnyContext), apiHost = _b.apiHost, graphQLClient = _b.graphQLClient;
|
|
22231
|
-
var _c = useContext(SubscriptionsContext),
|
|
22294
|
+
var _c = useContext(SubscriptionsContext), setUpgradingSubscription = _c.setUpgradingSubscription, updatingChargeQuantityId = _c.updatingChargeQuantityId, setUpdatingChargeQuantityId = _c.setUpdatingChargeQuantityId, setSubscriptionUpgradeId = _c.setSubscriptionUpgradeId, className = _c.className, isInPreviewMode = _c.isInPreviewMode;
|
|
22232
22295
|
// Local state
|
|
22233
22296
|
var _d = useState(), editingQuoteData = _d[0], setEditingQuoteData = _d[1];
|
|
22234
22297
|
var _e = useState(false), payModalVisible = _e[0], setPayModalVisible = _e[1];
|
|
@@ -22254,20 +22317,16 @@ var Subscriptions = function (_a) {
|
|
|
22254
22317
|
token: token,
|
|
22255
22318
|
}),
|
|
22256
22319
|
queryFn: function () {
|
|
22257
|
-
return (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id)
|
|
22258
|
-
? getQuote({ token: token, id: editingQuoteData.id, apiHost: apiHost })
|
|
22259
|
-
: undefined;
|
|
22320
|
+
return (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id) ? getQuote({ token: token, id: editingQuoteData.id, apiHost: apiHost }) : undefined;
|
|
22260
22321
|
},
|
|
22261
22322
|
enabled: Boolean(editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
|
|
22262
22323
|
}).data;
|
|
22263
22324
|
var _k = useQuery({
|
|
22264
22325
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
22265
|
-
filterString: "entityId=".concat(entityId),
|
|
22266
22326
|
pluralType: "subscriptions",
|
|
22267
22327
|
token: token,
|
|
22268
22328
|
}),
|
|
22269
|
-
queryFn: function () { return getSubscriptions({
|
|
22270
|
-
enabled: Boolean(entityId),
|
|
22329
|
+
queryFn: function () { return getSubscriptions({ token: token, apiHost: apiHost }); },
|
|
22271
22330
|
}), subscriptions = _k.data, subscriptionsAreLoading = _k.isLoading;
|
|
22272
22331
|
// Mutations
|
|
22273
22332
|
var subscriptionCancel = useMutation({
|
|
@@ -22277,7 +22336,6 @@ var Subscriptions = function (_a) {
|
|
|
22277
22336
|
onSuccess: function () {
|
|
22278
22337
|
queryClient.invalidateQueries({
|
|
22279
22338
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
22280
|
-
filterString: "entityId=".concat(entityId),
|
|
22281
22339
|
pluralType: "subscriptions",
|
|
22282
22340
|
token: token,
|
|
22283
22341
|
}),
|
|
@@ -22295,7 +22353,6 @@ var Subscriptions = function (_a) {
|
|
|
22295
22353
|
setSubscriptionUpgradeId(null);
|
|
22296
22354
|
setUpgradingSubscription(undefined);
|
|
22297
22355
|
}
|
|
22298
|
-
console.log("setIsChangingPlan true");
|
|
22299
22356
|
setIsChangingPlan(true);
|
|
22300
22357
|
};
|
|
22301
22358
|
var onCancelSubscriptionClick = function (subscription) {
|
|
@@ -22309,7 +22366,6 @@ var Subscriptions = function (_a) {
|
|
|
22309
22366
|
});
|
|
22310
22367
|
queryClient.invalidateQueries({
|
|
22311
22368
|
queryKey: QueryKeyFactory.default.createTableKey({
|
|
22312
|
-
filterString: "entityId=".concat(entityId),
|
|
22313
22369
|
pluralType: "subscriptions",
|
|
22314
22370
|
token: token,
|
|
22315
22371
|
}),
|
|
@@ -22352,16 +22408,12 @@ var Subscriptions = function (_a) {
|
|
|
22352
22408
|
if (hasExpiredOrCanceledSubscriptions && subscriptions.length > 0)
|
|
22353
22409
|
setExpiredSwitchVisible(true);
|
|
22354
22410
|
}, [hasExpiredOrCanceledSubscriptions, subscriptions]);
|
|
22355
|
-
useEffect(function () {
|
|
22356
|
-
console.log("isChangingPlan", isChangingPlan);
|
|
22357
|
-
}, [isChangingPlan]);
|
|
22358
22411
|
if (isChangingPlan || isInPreviewMode) {
|
|
22359
22412
|
return (jsx(PlanManager, { onChangePlanCancel: function () {
|
|
22360
|
-
console.log("setIsChangingPlan false");
|
|
22361
22413
|
setIsChangingPlan(false);
|
|
22362
22414
|
}, handlePortalErrors: handlePortalErrors }));
|
|
22363
22415
|
}
|
|
22364
|
-
return (jsxs("div", __assign({ className: "".concat(className
|
|
22416
|
+
return (jsxs("div", __assign({ className: "".concat(className) }, { children: [!hideTitle ? jsx(PageTitle, { title: "Subscriptions" }) : null, jsx(PageHeaderWithActions, __assign({ title: jsxs(Text, __assign({ className: "flex items-center justify-between", style: { minWidth: "137px" } }, { children: [hideExpired ? "Active subscriptions" : "All subscriptions", isMobile && (jsx(HideExpiredToggle, { hideExpired: hideExpired, setHideExpired: setHideExpired, visible: expiredSwitchVisible }))] })) }, { children: !isMobile && (jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpired, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) })), jsx(SubscriptionsListContainer, { companyName: companyName, hideExpired: hideExpired, onCancelSubscriptionClick: onCancelSubscriptionClick, onChangePlanClick: onChangePlanClick, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsx("div", __assign({ className: "pt-4 pb-2" }, { children: jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpired, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), jsx(Footer, {}), jsx(QuantityChangeDrawerDesktop, { editingQuote: quote, editingQuoteData: editingQuoteData, onClose: onClose, open: quantityDrawerOpen, openCheckout: function () { return setPayModalVisible(true); }, setEditingQuoteData: setEditingQuoteData, subscriptions: subscriptions }), jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile, storedPaymentMethod: storedPaymentMethod })] })));
|
|
22365
22417
|
};
|
|
22366
22418
|
var PageHeaderWithActions = function (_a) {
|
|
22367
22419
|
var children = _a.children, title = _a.title;
|
|
@@ -22403,7 +22455,7 @@ var billingDetailsUpdate = function (_a) {
|
|
|
22403
22455
|
|
|
22404
22456
|
function BillingDetailsSection(_a) {
|
|
22405
22457
|
var _this = this;
|
|
22406
|
-
var
|
|
22458
|
+
var hidePaymentMethodForm = _a.hidePaymentMethodForm, countryListFilter = _a.countryListFilter;
|
|
22407
22459
|
// State
|
|
22408
22460
|
var _b = useState(false), isFormEdited = _b[0], setIsFormEdited = _b[1];
|
|
22409
22461
|
var _c = useState(false), formIsValid = _c[0], setFormIsValid = _c[1];
|
|
@@ -22419,7 +22471,7 @@ function BillingDetailsSection(_a) {
|
|
|
22419
22471
|
var showSuccessNotification = useSuccessNotification();
|
|
22420
22472
|
// Queries
|
|
22421
22473
|
var _d = useQuery({
|
|
22422
|
-
queryKey: QueryKeyFactory.default.billingDetailsKey({
|
|
22474
|
+
queryKey: QueryKeyFactory.default.billingDetailsKey({ token: token }),
|
|
22423
22475
|
queryFn: function () { return getBillingDetails({ token: token, apiHost: apiHost }); },
|
|
22424
22476
|
}), billingDetails = _d.data, isLoadingBillingDetails = _d.isLoading;
|
|
22425
22477
|
var _e = useMutation({
|
|
@@ -22443,7 +22495,7 @@ function BillingDetailsSection(_a) {
|
|
|
22443
22495
|
})];
|
|
22444
22496
|
case 1:
|
|
22445
22497
|
updatedBillingDetails = _a.sent();
|
|
22446
|
-
queryClient.setQueryData(QueryKeyFactory.default.billingDetailsKey({
|
|
22498
|
+
queryClient.setQueryData(QueryKeyFactory.default.billingDetailsKey({ token: token }), function (old) {
|
|
22447
22499
|
return __assign(__assign({}, old), updatedBillingDetails.billingDetails);
|
|
22448
22500
|
});
|
|
22449
22501
|
return [2 /*return*/, updatedBillingDetails];
|
|
@@ -22453,7 +22505,9 @@ function BillingDetailsSection(_a) {
|
|
|
22453
22505
|
onSuccess: function () {
|
|
22454
22506
|
showSuccessNotification("Your account details have been saved");
|
|
22455
22507
|
queryClient.invalidateQueries({
|
|
22456
|
-
queryKey: QueryKeyFactory.default.taxationRequiredAccountFieldsKey({
|
|
22508
|
+
queryKey: QueryKeyFactory.default.taxationRequiredAccountFieldsKey({
|
|
22509
|
+
token: token,
|
|
22510
|
+
}),
|
|
22457
22511
|
});
|
|
22458
22512
|
},
|
|
22459
22513
|
}), updateBillingDetails = _e.mutate, isUpdatingBillingDetails = _e.isPending;
|
|
@@ -22500,6 +22554,11 @@ function BillingDetailsSection(_a) {
|
|
|
22500
22554
|
};
|
|
22501
22555
|
setIsFormEdited(isFormEdited());
|
|
22502
22556
|
}, [form, values, billingDetails]);
|
|
22557
|
+
// Validate form fields when isFormEdited changes
|
|
22558
|
+
useEffect(function () {
|
|
22559
|
+
var validateOnly = isFormEdited ? false : true;
|
|
22560
|
+
form.validateFields({ validateOnly: validateOnly });
|
|
22561
|
+
}, [isFormEdited]);
|
|
22503
22562
|
var saveBillingDetails = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
22504
22563
|
var _this = this;
|
|
22505
22564
|
return __generator(this, function (_a) {
|
|
@@ -22534,30 +22593,38 @@ function BillingDetailsSection(_a) {
|
|
|
22534
22593
|
});
|
|
22535
22594
|
}); };
|
|
22536
22595
|
var filteredCountryList = useMemo(function () {
|
|
22537
|
-
return countryListFilter
|
|
22596
|
+
return countryListFilter
|
|
22597
|
+
? Lists.COUNTRY_LIST.filter(countryListFilter)
|
|
22598
|
+
: Lists.COUNTRY_LIST;
|
|
22538
22599
|
}, [countryListFilter]);
|
|
22539
|
-
return (
|
|
22540
|
-
|
|
22541
|
-
|
|
22542
|
-
|
|
22543
|
-
|
|
22544
|
-
|
|
22545
|
-
|
|
22546
|
-
|
|
22547
|
-
|
|
22548
|
-
|
|
22549
|
-
|
|
22550
|
-
|
|
22551
|
-
|
|
22552
|
-
|
|
22553
|
-
|
|
22600
|
+
return (jsx("div", __assign({ className: "".concat(isMobile || hidePaymentMethodForm ? "w-full" : "w-1/2") }, { children: jsxs("div", __assign({ className: "px-4" }, { children: [jsx(Skeleton, __assign({ loading: isLoadingBillingDetails }, { children: jsxs(Form, __assign({ className: "flex flex-col gap-2", form: form, layout: "vertical", disabled: isUpdatingBillingDetails, autoComplete: "off" }, { children: [jsx(Form.Item, __assign({ label: "Account name", name: "name", rules: [{ required: true, message: "Account name is required" }] }, { children: jsx(Input, {}) })), jsx(Form.Item, __assign({ label: "Street address", name: "billingStreet", rules: [
|
|
22601
|
+
{ required: true, message: "Street address is required" },
|
|
22602
|
+
] }, { children: jsx(Input, {}) })), jsxs("div", __assign({ className: "flex gap-4" }, { children: [jsx(Form.Item, __assign({ label: "City", name: "billingCity", rules: [{ required: true, message: "City is required" }], className: "flex-1" }, { children: jsx(Input, {}) })), jsx(Form.Item, __assign({ label: "Zipcode", name: "billingZip", rules: [{ required: true, message: "Zipcode is required" }], className: "flex-1" }, { children: jsx(Input, {}) }))] })), jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col pb-2" : "flex-row", " gap-4") }, { children: [jsx(Form.Item, __assign({ label: "State", name: "billingState", className: "flex-1", rules: [
|
|
22603
|
+
{
|
|
22604
|
+
required: false,
|
|
22605
|
+
},
|
|
22606
|
+
] }, { children: jsx(Input, {}) })), jsx(Form.Item, __assign({ label: "Country", name: "billingCountry", className: "flex-1", rules: [{ required: true, message: "Country is required" }] }, { children: jsx(Select, { options: filteredCountryList, placeholder: "Select a country", showSearch: true, filterOption: function (input, option) {
|
|
22607
|
+
var _a, _b;
|
|
22608
|
+
return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : "")
|
|
22609
|
+
.toLowerCase()
|
|
22610
|
+
.includes(input.toLowerCase()) ||
|
|
22611
|
+
((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : "")
|
|
22612
|
+
.toLowerCase()
|
|
22613
|
+
.includes(input.toLowerCase());
|
|
22614
|
+
} }) }))] })), jsx(Form.Item, __assign({ label: "Email", name: "billingContactEmail", rules: [
|
|
22615
|
+
{
|
|
22616
|
+
required: true,
|
|
22617
|
+
message: "Email is required",
|
|
22618
|
+
type: "email",
|
|
22619
|
+
},
|
|
22620
|
+
] }, { children: jsx(Input, {}) })), jsx(Form.Item, __assign({ label: "Tax ID", name: "taxNumber", tooltip: "Tax ID will be printed on quotes and invoices below the account's address", rules: [{ required: false }] }, { children: jsx(Input, {}) }))] })) })), jsx(Button, __assign({ disabled: !isFormEdited || isUpdatingBillingDetails || !formIsValid, className: "w-full mt-4", type: "primary", onClick: saveBillingDetails }, { children: "Save" }))] })) })));
|
|
22554
22621
|
}
|
|
22555
22622
|
|
|
22556
22623
|
var BillingDetails = function (_a) {
|
|
22557
|
-
var
|
|
22624
|
+
var _b = _a.isCardEnabled, isCardEnabled = _b === void 0 ? true : _b, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, className = _a.className, _d = _a.hidePaymentMethodForm, hidePaymentMethodForm = _d === void 0 ? false : _d, _e = _a.hideBillingDetailsForm, hideBillingDetailsForm = _e === void 0 ? false : _e, countryListFilter = _a.countryListFilter;
|
|
22558
22625
|
// Hooks
|
|
22559
22626
|
var isMobile = useIsMobile();
|
|
22560
|
-
return (jsx(WrapperComponent, __assign({ isCardEnabled: isCardEnabled, shadow: shadow, className: className }, { children: jsxs("div", __assign({ className: "flex p-2 my-2 ".concat(isMobile ? "flex-col space-y-4" : "flex-row", " gap-4") }, { children: [!hideBillingDetailsForm ? (jsx(BillingDetailsSection, { hidePaymentMethodForm: hidePaymentMethodForm, countryListFilter: countryListFilter
|
|
22627
|
+
return (jsx(WrapperComponent, __assign({ isCardEnabled: isCardEnabled, shadow: shadow, className: className }, { children: jsxs("div", __assign({ className: "flex p-2 my-2 ".concat(isMobile ? "flex-col space-y-4" : "flex-row", " gap-4") }, { children: [!hideBillingDetailsForm ? (jsx(BillingDetailsSection, { hidePaymentMethodForm: hidePaymentMethodForm, countryListFilter: countryListFilter })) : null, !hideBillingDetailsForm && !hidePaymentMethodForm ? (jsx(ResponsiveDivider, {})) : null, !hidePaymentMethodForm ? (jsx(PaymentFormSection, { hideBillingDetailsForm: hideBillingDetailsForm })) : null] })) })));
|
|
22561
22628
|
};
|
|
22562
22629
|
var WrapperComponent = function (_a) {
|
|
22563
22630
|
var children = _a.children, isCardEnabled = _a.isCardEnabled, shadow = _a.shadow, className = _a.className;
|
|
@@ -22568,12 +22635,12 @@ var ResponsiveDivider = function () {
|
|
|
22568
22635
|
return isMobile ? (jsx("div", __assign({ className: "mx-4" }, { children: jsx(Divider, {}) }))) : (jsx("div", { children: jsx(Divider, { className: "h-full", type: "vertical" }) }));
|
|
22569
22636
|
};
|
|
22570
22637
|
var PaymentFormSection = function (_a) {
|
|
22571
|
-
var
|
|
22638
|
+
var hideBillingDetailsForm = _a.hideBillingDetailsForm;
|
|
22572
22639
|
var isMobile = useIsMobile();
|
|
22573
22640
|
var _b = useContext(BunnyContext), onTokenExpired = _b.onTokenExpired, graphQLClient = _b.graphQLClient;
|
|
22574
22641
|
var handleAllErrorFormats = useAllErrorFormats(onTokenExpired);
|
|
22575
22642
|
var showSuccessNotification = useSuccessNotification();
|
|
22576
|
-
return (jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? "w-full" : "w-1/2 pt-4", " flex justify-center") }, { children: jsx(PaymentForm, {
|
|
22643
|
+
return (jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? "w-full" : "w-1/2 pt-4", " flex justify-center") }, { children: jsx(PaymentForm, { onFail: function (error) {
|
|
22577
22644
|
handleAllErrorFormats(error);
|
|
22578
22645
|
}, onSavePaymentMethod: function () {
|
|
22579
22646
|
showSuccessNotification("Your payment method has been saved");
|