@bunnyapp/components 1.0.68-beta.12 → 1.0.68-beta.2
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 +339 -550
- package/dist/cjs/src/components/Checkout/Checkout.d.ts +3 -1
- package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +1 -2
- package/dist/cjs/src/components/Checkout/checkoutUtils.d.ts +1 -1
- package/dist/cjs/src/components/PaymentForm/CouponEditor.d.ts +1 -3
- package/dist/cjs/src/components/Quote/AcceptQuoteModal.d.ts +1 -1
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +0 -6
- package/dist/cjs/src/components/Signup/Signup.d.ts +3 -1
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanManager.d.ts +4 -0
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -2
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardDescription.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +1 -2
- package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +2 -1
- package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +2 -3
- package/dist/cjs/src/graphql/mutations/quoteAddCoupon.d.ts +8 -0
- package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +2 -1
- package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +2 -22
- package/dist/esm/index.js +322 -552
- package/dist/esm/src/components/Checkout/Checkout.d.ts +3 -1
- package/dist/esm/src/components/Checkout/QuoteCheckout.d.ts +1 -2
- package/dist/esm/src/components/Checkout/checkoutUtils.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/CouponEditor.d.ts +1 -3
- package/dist/esm/src/components/Quote/AcceptQuoteModal.d.ts +1 -1
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +0 -6
- package/dist/esm/src/components/Signup/Signup.d.ts +3 -1
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanManager.d.ts +4 -0
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -2
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardDescription.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +1 -2
- package/dist/esm/src/graphql/mutations/accountSignup.d.ts +2 -1
- package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +2 -3
- package/dist/esm/src/graphql/mutations/quoteAddCoupon.d.ts +8 -0
- package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +2 -1
- package/dist/esm/src/hooks/usePaymentPlugins.d.ts +2 -22
- package/dist/index.d.ts +3 -1
- package/package.json +6 -4
- package/dist/cjs/src/components/Signup/CheckoutSummary.d.ts +0 -14
- package/dist/cjs/src/graphql/mutations/quoteChangeAddCoupon.d.ts +0 -8
- package/dist/cjs/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +0 -8
- package/dist/cjs/src/graphql/queries/getCoupons.d.ts +0 -6
- package/dist/cjs/src/hooks/useUpdateCoupons.d.ts +0 -14
- package/dist/esm/src/components/Signup/CheckoutSummary.d.ts +0 -14
- package/dist/esm/src/graphql/mutations/quoteChangeAddCoupon.d.ts +0 -8
- package/dist/esm/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +0 -8
- package/dist/esm/src/graphql/queries/getCoupons.d.ts +0 -6
- package/dist/esm/src/hooks/useUpdateCoupons.d.ts +0 -14
package/dist/cjs/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var request = require('graphql-request');
|
|
|
16
16
|
var react$1 = require('@pdf-viewer/react');
|
|
17
17
|
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
18
18
|
var index_js = require('@stripe/stripe-js/pure/index.js');
|
|
19
|
+
var parse = require('html-react-parser');
|
|
19
20
|
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
20
21
|
var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
|
|
21
22
|
var recharts = require('recharts');
|
|
@@ -24,9 +25,28 @@ var pkg = require('pluralize');
|
|
|
24
25
|
|
|
25
26
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
27
|
|
|
28
|
+
function _interopNamespace(e) {
|
|
29
|
+
if (e && e.__esModule) return e;
|
|
30
|
+
var n = Object.create(null);
|
|
31
|
+
if (e) {
|
|
32
|
+
Object.keys(e).forEach(function (k) {
|
|
33
|
+
if (k !== 'default') {
|
|
34
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
35
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return e[k]; }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
n["default"] = e;
|
|
43
|
+
return Object.freeze(n);
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
28
47
|
var theme__default = /*#__PURE__*/_interopDefaultLegacy(theme);
|
|
29
48
|
var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
|
|
49
|
+
var parse__default = /*#__PURE__*/_interopDefaultLegacy(parse);
|
|
30
50
|
var pkg__default = /*#__PURE__*/_interopDefaultLegacy(pkg);
|
|
31
51
|
|
|
32
52
|
function styleInject(css, ref) {
|
|
@@ -56,7 +76,7 @@ function styleInject(css, ref) {
|
|
|
56
76
|
}
|
|
57
77
|
}
|
|
58
78
|
|
|
59
|
-
var css_248z = ":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.bunny-component-wrapper {\n box-sizing: border-box;\n}\n.bunny-component-wrapper * {\n box-sizing: border-box;\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.bunny-shadow,\n.bunny-shadow-md {\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.bunny-fixed {\n position: fixed;\n}\n.bunny-absolute {\n position: absolute;\n}\n.bunny-relative {\n position: relative;\n}\n.bunny-sticky {\n position: sticky;\n}\n.bunny-bottom-0 {\n bottom: 0px;\n}\n.bunny-bottom-4 {\n bottom: 1rem;\n}\n.bunny-left-0 {\n left: 0px;\n}\n.bunny-right-0 {\n right: 0px;\n}\n.bunny-top-0 {\n top: 0px;\n}\n.bunny-col-span-1 {\n grid-column: span 1 / span 1;\n}\n.bunny-col-span-full {\n grid-column: 1 / -1;\n}\n.bunny-m-0 {\n margin: 0px;\n}\n.bunny-mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.bunny-mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.bunny-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.bunny-my-24 {\n margin-top: 6rem;\n margin-bottom: 6rem;\n}\n.bunny-my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.bunny-mb-2 {\n margin-bottom: 0.5rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-mt-2 {\n margin-top: 0.5rem;\n}\n.bunny-mt-24 {\n margin-top: 6rem;\n}\n.bunny-mt-4 {\n margin-top: 1rem;\n}\n.bunny-flex {\n display: flex;\n}\n.bunny-grid {\n display: grid;\n}\n.bunny-contents {\n display: contents;\n}\n.bunny-h-1\\/2 {\n height: 50%;\n}\n.bunny-h-5 {\n height: 1.25rem;\n}\n.bunny-h-8 {\n height: 2rem;\n}\n.bunny-h-full {\n height: 100%;\n}\n.bunny-h-screen {\n height: 100vh;\n}\n.bunny-min-h-0 {\n min-height: 0px;\n}\n.bunny-w-1\\/2 {\n width: 50%;\n}\n.bunny-w-3\\/5 {\n width: 60%;\n}\n.bunny-w-full {\n width: 100%;\n}\n.bunny-w-screen {\n width: 100vw;\n}\n.bunny-flex-1 {\n flex: 1 1 0%;\n}\n.bunny-shrink {\n flex-shrink: 1;\n}\n.bunny-shrink-0 {\n flex-shrink: 0;\n}\n.bunny-grow {\n flex-grow: 1;\n}\n.bunny-cursor-pointer {\n cursor: pointer;\n}\n.bunny-grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.bunny-flex-row {\n flex-direction: row;\n}\n.bunny-flex-col {\n flex-direction: column;\n}\n.bunny-items-start {\n align-items: flex-start;\n}\n.bunny-items-end {\n align-items: flex-end;\n}\n.bunny-items-center {\n align-items: center;\n}\n.bunny-justify-end {\n justify-content: flex-end;\n}\n.bunny-justify-center {\n justify-content: center;\n}\n.bunny-justify-between {\n justify-content: space-between;\n}\n.bunny-gap-0 {\n gap: 0px;\n}\n.bunny-gap-1 {\n gap: 0.25rem;\n}\n.bunny-gap-2 {\n gap: 0.5rem;\n}\n.bunny-gap-3 {\n gap: 0.75rem;\n}\n.bunny-gap-4 {\n gap: 1rem;\n}\n.bunny-gap-6 {\n gap: 1.5rem;\n}\n.bunny-gap-8 {\n gap: 2rem;\n}\n.bunny-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.bunny-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.bunny-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.bunny-overflow-auto {\n overflow: auto;\n}\n.bunny-overflow-hidden {\n overflow: hidden;\n}\n.bunny-overflow-visible {\n overflow: visible;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-rounded {\n border-radius: 0.25rem;\n}\n.bunny-rounded-full {\n border-radius: 9999px;\n}\n.bunny-rounded-lg {\n border-radius: 0.5rem;\n}\n.bunny-rounded-md {\n border-radius: 0.375rem;\n}\n.bunny-border {\n border-width: 1px;\n}\n.bunny-border-2 {\n border-width: 2px;\n}\n.bunny-border-solid {\n border-style: solid;\n}\n.bunny-border-none {\n border-style: none;\n}\n.bunny-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.bunny-bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bunny-p-0 {\n padding: 0px;\n}\n.bunny-p-1 {\n padding: 0.25rem;\n}\n.bunny-p-2 {\n padding: 0.5rem;\n}\n.bunny-p-4 {\n padding: 1rem;\n}\n.bunny-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.bunny-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.bunny-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.bunny-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.bunny-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.bunny-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.bunny-pb-2 {\n padding-bottom: 0.5rem;\n}\n.bunny-pb-4 {\n padding-bottom: 1rem;\n}\n.bunny-pb-6 {\n padding-bottom: 1.5rem;\n}\n.bunny-pb-8 {\n padding-bottom: 2rem;\n}\n.bunny-pl-0 {\n padding-left: 0px;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-12 {\n padding-top: 3rem;\n}\n.bunny-pt-2 {\n padding-top: 0.5rem;\n}\n.bunny-pt-4 {\n padding-top: 1rem;\n}\n.bunny-pt-5 {\n padding-top: 1.25rem;\n}\n.bunny-pt-6 {\n padding-top: 1.5rem;\n}\n.bunny-pt-\\[25vh\\] {\n padding-top: 25vh;\n}\n.bunny-pt-1 {\n padding-top: 0.25rem;\n}\n.bunny-text-left {\n text-align: left;\n}\n.bunny-text-center {\n text-align: center;\n}\n.bunny-text-right {\n text-align: right;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.bunny-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.bunny-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.bunny-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.bunny-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.bunny-font-bold {\n font-weight: 700;\n}\n.bunny-font-medium {\n font-weight: 500;\n}\n.bunny-font-normal {\n font-weight: 400;\n}\n.bunny-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.bunny-underline {\n text-decoration-line: underline;\n}\n.bunny-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.bunny-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.bunny-transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.bunny-duration-300 {\n transition-duration: 300ms;\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.-top-0\\.5 {\n top: -0.125rem;\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-12 {\n width: 3rem;\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.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / 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.hover\\:bunny-text-orange-400:hover {\n --tw-text-opacity: 1;\n color: rgb(251 146 60 / var(--tw-text-opacity, 1));\n}\n.bunny-invoice-container {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\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";
|
|
79
|
+
var css_248z = ":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.bunny-component-wrapper {\n box-sizing: border-box;\n}\n.bunny-component-wrapper * {\n box-sizing: border-box;\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.bunny-shadow,\n.bunny-shadow-md {\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.bunny-fixed {\n position: fixed;\n}\n.bunny-absolute {\n position: absolute;\n}\n.bunny-relative {\n position: relative;\n}\n.bunny-sticky {\n position: sticky;\n}\n.bunny-bottom-0 {\n bottom: 0px;\n}\n.bunny-bottom-4 {\n bottom: 1rem;\n}\n.bunny-left-0 {\n left: 0px;\n}\n.bunny-right-0 {\n right: 0px;\n}\n.bunny-top-0 {\n top: 0px;\n}\n.bunny-col-span-full {\n grid-column: 1 / -1;\n}\n.bunny-m-0 {\n margin: 0px;\n}\n.bunny-mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.bunny-mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.bunny-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.bunny-my-24 {\n margin-top: 6rem;\n margin-bottom: 6rem;\n}\n.bunny-my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.bunny-mb-2 {\n margin-bottom: 0.5rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-mt-2 {\n margin-top: 0.5rem;\n}\n.bunny-mt-24 {\n margin-top: 6rem;\n}\n.bunny-mt-4 {\n margin-top: 1rem;\n}\n.bunny-flex {\n display: flex;\n}\n.bunny-grid {\n display: grid;\n}\n.bunny-contents {\n display: contents;\n}\n.bunny-h-1\\/2 {\n height: 50%;\n}\n.bunny-h-5 {\n height: 1.25rem;\n}\n.bunny-h-8 {\n height: 2rem;\n}\n.bunny-h-full {\n height: 100%;\n}\n.bunny-h-screen {\n height: 100vh;\n}\n.bunny-w-1\\/2 {\n width: 50%;\n}\n.bunny-w-3\\/5 {\n width: 60%;\n}\n.bunny-w-full {\n width: 100%;\n}\n.bunny-w-screen {\n width: 100vw;\n}\n.bunny-flex-1 {\n flex: 1 1 0%;\n}\n.bunny-shrink {\n flex-shrink: 1;\n}\n.bunny-shrink-0 {\n flex-shrink: 0;\n}\n.bunny-grow {\n flex-grow: 1;\n}\n.bunny-cursor-pointer {\n cursor: pointer;\n}\n.bunny-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.bunny-flex-row {\n flex-direction: row;\n}\n.bunny-flex-col {\n flex-direction: column;\n}\n.bunny-items-start {\n align-items: flex-start;\n}\n.bunny-items-end {\n align-items: flex-end;\n}\n.bunny-items-center {\n align-items: center;\n}\n.bunny-justify-end {\n justify-content: flex-end;\n}\n.bunny-justify-center {\n justify-content: center;\n}\n.bunny-justify-between {\n justify-content: space-between;\n}\n.bunny-gap-0 {\n gap: 0px;\n}\n.bunny-gap-1 {\n gap: 0.25rem;\n}\n.bunny-gap-2 {\n gap: 0.5rem;\n}\n.bunny-gap-3 {\n gap: 0.75rem;\n}\n.bunny-gap-4 {\n gap: 1rem;\n}\n.bunny-gap-6 {\n gap: 1.5rem;\n}\n.bunny-gap-8 {\n gap: 2rem;\n}\n.bunny-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.bunny-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.bunny-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.bunny-overflow-auto {\n overflow: auto;\n}\n.bunny-overflow-hidden {\n overflow: hidden;\n}\n.bunny-overflow-visible {\n overflow: visible;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-rounded {\n border-radius: 0.25rem;\n}\n.bunny-rounded-full {\n border-radius: 9999px;\n}\n.bunny-rounded-lg {\n border-radius: 0.5rem;\n}\n.bunny-rounded-md {\n border-radius: 0.375rem;\n}\n.bunny-border {\n border-width: 1px;\n}\n.bunny-border-2 {\n border-width: 2px;\n}\n.bunny-border-solid {\n border-style: solid;\n}\n.bunny-border-none {\n border-style: none;\n}\n.bunny-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.bunny-bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bunny-p-0 {\n padding: 0px;\n}\n.bunny-p-1 {\n padding: 0.25rem;\n}\n.bunny-p-2 {\n padding: 0.5rem;\n}\n.bunny-p-4 {\n padding: 1rem;\n}\n.bunny-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.bunny-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.bunny-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.bunny-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.bunny-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.bunny-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.bunny-pb-2 {\n padding-bottom: 0.5rem;\n}\n.bunny-pb-4 {\n padding-bottom: 1rem;\n}\n.bunny-pb-6 {\n padding-bottom: 1.5rem;\n}\n.bunny-pb-8 {\n padding-bottom: 2rem;\n}\n.bunny-pl-0 {\n padding-left: 0px;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-12 {\n padding-top: 3rem;\n}\n.bunny-pt-2 {\n padding-top: 0.5rem;\n}\n.bunny-pt-4 {\n padding-top: 1rem;\n}\n.bunny-pt-5 {\n padding-top: 1.25rem;\n}\n.bunny-pt-6 {\n padding-top: 1.5rem;\n}\n.bunny-pt-\\[25vh\\] {\n padding-top: 25vh;\n}\n.bunny-text-left {\n text-align: left;\n}\n.bunny-text-center {\n text-align: center;\n}\n.bunny-text-right {\n text-align: right;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.bunny-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.bunny-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.bunny-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.bunny-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.bunny-font-bold {\n font-weight: 700;\n}\n.bunny-font-medium {\n font-weight: 500;\n}\n.bunny-font-normal {\n font-weight: 400;\n}\n.bunny-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.bunny-underline {\n text-decoration-line: underline;\n}\n.bunny-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.bunny-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.bunny-transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.bunny-duration-300 {\n transition-duration: 300ms;\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.-top-0\\.5 {\n top: -0.125rem;\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-0 {\n margin-top: 0px;\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.mr-4 {\n margin-right: 1rem;\n}\n.mb-0 {\n margin-bottom: 0px;\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-12 {\n width: 3rem;\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.whitespace-pre-wrap {\n white-space: pre-wrap;\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.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-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-red-400 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 113 113 / 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-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / 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.duration-300 {\n transition-duration: 300ms;\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}\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";
|
|
60
80
|
styleInject(css_248z);
|
|
61
81
|
|
|
62
82
|
/******************************************************************************
|
|
@@ -154,7 +174,7 @@ var BrandContext = react.createContext({
|
|
|
154
174
|
});
|
|
155
175
|
|
|
156
176
|
// This will be replaced at build time by rollup-plugin-replace
|
|
157
|
-
var PACKAGE_VERSION = '1.0.68-beta.
|
|
177
|
+
var PACKAGE_VERSION = '1.0.68-beta.2';
|
|
158
178
|
var createRequestHeaders = function (token) {
|
|
159
179
|
var headers = common.createClientDevHeaders(token);
|
|
160
180
|
// Add the components version header
|
|
@@ -198,7 +218,7 @@ var gqlRequest = function (_a) {
|
|
|
198
218
|
});
|
|
199
219
|
};
|
|
200
220
|
|
|
201
|
-
var MUTATION$
|
|
221
|
+
var MUTATION$a = "\n query entityBranding {\n entityBranding {\n accentColor\n brandColor\n topNavImageUrl\n }\n }\n";
|
|
202
222
|
var getBranding = function (_a) {
|
|
203
223
|
var token = _a.token, apiHost = _a.apiHost;
|
|
204
224
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -206,7 +226,7 @@ var getBranding = function (_a) {
|
|
|
206
226
|
return __generator(this, function (_b) {
|
|
207
227
|
switch (_b.label) {
|
|
208
228
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
209
|
-
query: MUTATION$
|
|
229
|
+
query: MUTATION$a,
|
|
210
230
|
token: token,
|
|
211
231
|
apiHost: apiHost,
|
|
212
232
|
})];
|
|
@@ -524,41 +544,6 @@ function LegacyDocument(_a) {
|
|
|
524
544
|
}, title: "Invoice PDF", width: "100%" }));
|
|
525
545
|
}
|
|
526
546
|
|
|
527
|
-
var MUTATION$a = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
|
|
528
|
-
var checkout = function (_a) {
|
|
529
|
-
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
530
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
531
|
-
var mutationVars, response, errors;
|
|
532
|
-
return __generator(this, function (_b) {
|
|
533
|
-
switch (_b.label) {
|
|
534
|
-
case 0:
|
|
535
|
-
mutationVars = {
|
|
536
|
-
quoteId: quoteId,
|
|
537
|
-
invoiceId: invoiceId,
|
|
538
|
-
paymentMethodId: paymentMethodId,
|
|
539
|
-
};
|
|
540
|
-
if (paymentMethodData) {
|
|
541
|
-
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
542
|
-
}
|
|
543
|
-
return [4 /*yield*/, gqlRequest({
|
|
544
|
-
query: MUTATION$a,
|
|
545
|
-
token: token,
|
|
546
|
-
vars: mutationVars,
|
|
547
|
-
apiHost: apiHost,
|
|
548
|
-
})];
|
|
549
|
-
case 1:
|
|
550
|
-
response = _b.sent();
|
|
551
|
-
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
552
|
-
if (errors)
|
|
553
|
-
throw errors;
|
|
554
|
-
return [2 /*return*/, {
|
|
555
|
-
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
556
|
-
}];
|
|
557
|
-
}
|
|
558
|
-
});
|
|
559
|
-
});
|
|
560
|
-
};
|
|
561
|
-
|
|
562
547
|
var paymentMethodsQuery = function (filter) { return "query paymentMethods {\n paymentMethods ".concat(filter ? "(".concat(filter, ")") : '', " {\n nodes {\n id\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 type\n }\n isDefault\n }\n }\n}"); };
|
|
563
548
|
var getPaymentMethods = function (_a) {
|
|
564
549
|
var apiHost = _a.apiHost, token = _a.token, accountId = _a.accountId;
|
|
@@ -598,14 +583,19 @@ var usePaymentMethod = function (_a) {
|
|
|
598
583
|
};
|
|
599
584
|
|
|
600
585
|
var filterPaymentPlugins = function (plugins) {
|
|
601
|
-
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
586
|
+
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
587
|
+
var _a, _b, _c, _d;
|
|
588
|
+
return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'payment' &&
|
|
589
|
+
((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'valid' &&
|
|
590
|
+
((_d = (_c = plugin.components) === null || _c === void 0 ? void 0 : _c.frontend) === null || _d === void 0 ? void 0 : _d.length);
|
|
591
|
+
});
|
|
602
592
|
};
|
|
603
593
|
var filterPaymentPluginsByEntity = function (plugins, selectedEntityId) {
|
|
604
594
|
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
605
595
|
var _a, _b;
|
|
606
596
|
return selectedEntityId === undefined ||
|
|
607
597
|
selectedEntityId === null ||
|
|
608
|
-
((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(selectedEntityId)) ||
|
|
598
|
+
((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(Number(selectedEntityId))) ||
|
|
609
599
|
((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
610
600
|
});
|
|
611
601
|
};
|
|
@@ -642,9 +632,13 @@ var usePaymentPlugins = function (_a) {
|
|
|
642
632
|
staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
|
|
643
633
|
}), paymentPlugins = _b.data, isFetched = _b.isFetched;
|
|
644
634
|
var filteredPaymentPlugins = filterPaymentPlugins(paymentPlugins);
|
|
635
|
+
var paymentMethodAllowedPlugins = filteredPaymentPlugins === null || filteredPaymentPlugins === void 0 ? void 0 : filteredPaymentPlugins.filter(function (plugin) {
|
|
636
|
+
var _a, _b;
|
|
637
|
+
return (_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.some(function (component) { var _a; return (_a = component === null || component === void 0 ? void 0 : component.scenarios) === null || _a === void 0 ? void 0 : _a.includes('admin-payment_method'); });
|
|
638
|
+
});
|
|
645
639
|
var filteredPaymentPluginsByEntity = selectedEntityId
|
|
646
|
-
? filterPaymentPluginsByEntity(
|
|
647
|
-
:
|
|
640
|
+
? filterPaymentPluginsByEntity(paymentMethodAllowedPlugins, selectedEntityId)
|
|
641
|
+
: paymentMethodAllowedPlugins;
|
|
648
642
|
return {
|
|
649
643
|
paymentPlugins: filteredPaymentPluginsByEntity,
|
|
650
644
|
isFetched: isFetched,
|
|
@@ -655,6 +649,41 @@ var getQuoteAmountDue = function (quote) {
|
|
|
655
649
|
return quote.amountDue || quote.amount;
|
|
656
650
|
};
|
|
657
651
|
|
|
652
|
+
var MUTATION$8 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
|
|
653
|
+
var checkout = function (_a) {
|
|
654
|
+
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
655
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
656
|
+
var mutationVars, response, errors;
|
|
657
|
+
return __generator(this, function (_b) {
|
|
658
|
+
switch (_b.label) {
|
|
659
|
+
case 0:
|
|
660
|
+
mutationVars = {
|
|
661
|
+
quoteId: quoteId,
|
|
662
|
+
invoiceId: invoiceId,
|
|
663
|
+
paymentMethodId: paymentMethodId,
|
|
664
|
+
};
|
|
665
|
+
if (paymentMethodData) {
|
|
666
|
+
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
667
|
+
}
|
|
668
|
+
return [4 /*yield*/, gqlRequest({
|
|
669
|
+
query: MUTATION$8,
|
|
670
|
+
token: token,
|
|
671
|
+
vars: mutationVars,
|
|
672
|
+
apiHost: apiHost,
|
|
673
|
+
})];
|
|
674
|
+
case 1:
|
|
675
|
+
response = _b.sent();
|
|
676
|
+
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
677
|
+
if (errors)
|
|
678
|
+
throw errors;
|
|
679
|
+
return [2 /*return*/, {
|
|
680
|
+
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
681
|
+
}];
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
});
|
|
685
|
+
};
|
|
686
|
+
|
|
658
687
|
function usePay$1(_a) {
|
|
659
688
|
var _this = this;
|
|
660
689
|
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice, storedPaymentMethod = _a.storedPaymentMethod, plugin = _a.plugin;
|
|
@@ -951,7 +980,7 @@ function usePay(_a) {
|
|
|
951
980
|
}
|
|
952
981
|
|
|
953
982
|
var handleAllErrorFormats = common.useAllErrorFormats();
|
|
954
|
-
var showErrorNotification$
|
|
983
|
+
var showErrorNotification$2 = common.useErrorNotification();
|
|
955
984
|
var ActualCheckoutFooter = function (_a) {
|
|
956
985
|
var quote = _a.quote, invoice = _a.invoice, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, noPadding = _a.noPadding, plugin = _a.plugin, paymentHoldOptions = _a.paymentHoldOptions;
|
|
957
986
|
var isMobile = common.useIsMobile();
|
|
@@ -1040,7 +1069,7 @@ var ActualCheckoutFooter = function (_a) {
|
|
|
1040
1069
|
_f.sent();
|
|
1041
1070
|
return [3 /*break*/, 6];
|
|
1042
1071
|
case 5:
|
|
1043
|
-
showErrorNotification$
|
|
1072
|
+
showErrorNotification$2("Payment holds are not supported by ".concat((_e = (_d = plugin.components) === null || _d === void 0 ? void 0 : _d.frontend) === null || _e === void 0 ? void 0 : _e[0].name));
|
|
1044
1073
|
return [3 /*break*/, 6];
|
|
1045
1074
|
case 6: return [2 /*return*/];
|
|
1046
1075
|
}
|
|
@@ -18755,7 +18784,7 @@ var DemoPayForm = function (_a) {
|
|
|
18755
18784
|
cvc: '',
|
|
18756
18785
|
}), cardDetails = _d[0], setCardDetails = _d[1];
|
|
18757
18786
|
var onSave = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
18758
|
-
var error_1
|
|
18787
|
+
var error_1;
|
|
18759
18788
|
return __generator(this, function (_a) {
|
|
18760
18789
|
switch (_a.label) {
|
|
18761
18790
|
case 0:
|
|
@@ -18771,12 +18800,7 @@ var DemoPayForm = function (_a) {
|
|
|
18771
18800
|
return [3 /*break*/, 3];
|
|
18772
18801
|
case 2:
|
|
18773
18802
|
error_1 = _a.sent();
|
|
18774
|
-
|
|
18775
|
-
response: {
|
|
18776
|
-
message: error_1.message,
|
|
18777
|
-
},
|
|
18778
|
-
};
|
|
18779
|
-
onFail(errorResponse);
|
|
18803
|
+
onFail(error_1);
|
|
18780
18804
|
return [3 /*break*/, 3];
|
|
18781
18805
|
case 3: return [2 /*return*/];
|
|
18782
18806
|
}
|
|
@@ -19086,7 +19110,7 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
|
|
|
19086
19110
|
return { setDefaultPaymentMethod: setDefaultPaymentMethod, loading: loading };
|
|
19087
19111
|
}
|
|
19088
19112
|
|
|
19089
|
-
var showErrorNotification$
|
|
19113
|
+
var showErrorNotification$1 = common.useErrorNotification();
|
|
19090
19114
|
var PaymentForm = function (_a) {
|
|
19091
19115
|
var _b;
|
|
19092
19116
|
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, entityId = _a.entityId, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
@@ -19105,7 +19129,6 @@ var PaymentForm = function (_a) {
|
|
|
19105
19129
|
// Complex hooks
|
|
19106
19130
|
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost, selectedEntityId: entityId, token: token }).paymentPlugins;
|
|
19107
19131
|
var selectedPaymentMethodPlugin = react.useMemo(function () {
|
|
19108
|
-
// TODO: consolate PluginData and PaymentPlugin into one type. Needs to be done on API side.
|
|
19109
19132
|
return paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find(function (plugin) { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
|
|
19110
19133
|
}, [paymentPlugins, defaultPaymentMethod]);
|
|
19111
19134
|
// Derived state
|
|
@@ -19114,10 +19137,9 @@ var PaymentForm = function (_a) {
|
|
|
19114
19137
|
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
19115
19138
|
(invoice === null || invoice === void 0 ? void 0 : invoice.currencyId) ||
|
|
19116
19139
|
currencyIdFromProps)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
19117
|
-
var paymentRequired = quote ? getQuoteAmountDue(quote) > 0 : true;
|
|
19118
19140
|
// Custom hooks
|
|
19119
19141
|
var _e = useSetDefaultPaymentMethod(paymentPlugins || [], apiHost, token, accountId, function (message) {
|
|
19120
|
-
showErrorNotification$
|
|
19142
|
+
showErrorNotification$1(message, 'Error setting default payment method');
|
|
19121
19143
|
}, function () {
|
|
19122
19144
|
onSetDefaultPaymentMethod === null || onSetDefaultPaymentMethod === void 0 ? void 0 : onSetDefaultPaymentMethod();
|
|
19123
19145
|
}), handleSetDefault = _e.setDefaultPaymentMethod, setDefaultPaymentMethodLoading = _e.loading;
|
|
@@ -19131,31 +19153,11 @@ var PaymentForm = function (_a) {
|
|
|
19131
19153
|
var _f = usePaymentMethodSelectorPlugin({
|
|
19132
19154
|
defaultPaymentMethod: defaultPaymentMethod,
|
|
19133
19155
|
defaultPaymentMethodPlugin: defaultPaymentMethodPlugin,
|
|
19134
|
-
paymentMethodAllowedPlugins: paymentPlugins
|
|
19156
|
+
paymentMethodAllowedPlugins: paymentPlugins,
|
|
19135
19157
|
}), selectorPaymentMethodPlugin = _f.selectorPaymentMethodPlugin, setSelectorPaymentMethodPlugin = _f.setSelectorPaymentMethodPlugin;
|
|
19136
19158
|
var selectedPaymentPluginIsManualPayment = (selectorPaymentMethodPlugin === null || selectorPaymentMethodPlugin === void 0 ? void 0 : selectorPaymentMethodPlugin.name) === 'Manual Payment';
|
|
19137
|
-
// Mutations
|
|
19138
|
-
var _g = reactQuery.useMutation({
|
|
19139
|
-
mutationFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
19140
|
-
return __generator(this, function (_a) {
|
|
19141
|
-
switch (_a.label) {
|
|
19142
|
-
case 0:
|
|
19143
|
-
if (!quote)
|
|
19144
|
-
throw new Error('Quote is required');
|
|
19145
|
-
if (paymentRequired)
|
|
19146
|
-
throw new Error('Payment is required');
|
|
19147
|
-
return [4 /*yield*/, checkout({ quoteId: quote.id, token: token, apiHost: apiHost })];
|
|
19148
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
19149
|
-
}
|
|
19150
|
-
});
|
|
19151
|
-
}); },
|
|
19152
|
-
onSuccess: function () {
|
|
19153
|
-
handlePaymentSuccess();
|
|
19154
|
-
},
|
|
19155
|
-
onError: onFail,
|
|
19156
|
-
}), checkoutNoPayment = _g.mutate, isCheckingOutNoPayment = _g.isPending;
|
|
19157
19159
|
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost, token, accountId, onRemovePaymentMethod, function (message) {
|
|
19158
|
-
showErrorNotification$
|
|
19160
|
+
showErrorNotification$1(message, 'Error removing payment method');
|
|
19159
19161
|
});
|
|
19160
19162
|
var handlePaymentSuccess = function () {
|
|
19161
19163
|
// Hide payment method selector and form
|
|
@@ -19174,7 +19176,7 @@ var PaymentForm = function (_a) {
|
|
|
19174
19176
|
};
|
|
19175
19177
|
function handleClickAddPaymentMethod() {
|
|
19176
19178
|
if ((paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.length) === 0) {
|
|
19177
|
-
showErrorNotification$
|
|
19179
|
+
showErrorNotification$1('No payment plugins available', 'Error adding payment method');
|
|
19178
19180
|
}
|
|
19179
19181
|
else {
|
|
19180
19182
|
setShowPaymentMethodForm(true);
|
|
@@ -19190,14 +19192,14 @@ var PaymentForm = function (_a) {
|
|
|
19190
19192
|
storedPaymentMethods: storedPaymentMethods,
|
|
19191
19193
|
defaultPaymentMethod: defaultPaymentMethod,
|
|
19192
19194
|
customCheckoutFunction: customCheckoutFunction,
|
|
19193
|
-
} }, { children: jsxRuntime.jsx(StripeWrapper, __assign({ plugin: selectorPaymentMethodPlugin, token: token, apiHost: apiHost, currencyId: currencyId, accountId: accountId }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-0 bunny-w-full" }, { children: jsxRuntime.
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
|
|
19197
|
-
|
|
19198
|
-
|
|
19199
|
-
|
|
19200
|
-
|
|
19195
|
+
} }, { children: jsxRuntime.jsx(StripeWrapper, __assign({ plugin: selectorPaymentMethodPlugin, token: token, apiHost: apiHost, currencyId: currencyId, accountId: accountId }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-0 bunny-w-full" }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-px-4" }, { children: [storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.map(function (paymentMethod) { return (jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { return onClickRemove(paymentMethod); }, onClickSetDefault: function () { return handleSetDefault(paymentMethod); }, paymentMethodData: paymentMethod, id: "payment-method-".concat(paymentMethod.id) }, paymentMethod.id)); }), (storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.length) === 0 && (jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { }, onClickSetDefault: function () { } }))] })), jsxRuntime.jsx(antd.Collapse, { bordered: false, activeKey: showPaymentMethodForm ? '1' : undefined, ghost: true, collapsible: "disabled", destroyOnHidden: true, items: [
|
|
19196
|
+
{
|
|
19197
|
+
key: '1',
|
|
19198
|
+
showArrow: false,
|
|
19199
|
+
label: !showPaymentMethodForm ? (jsxRuntime.jsx("div", __assign({ className: "bunny-pt-2" }, { children: jsxRuntime.jsx(antd.Button, __assign({ onClick: handleClickAddPaymentMethod, type: "default", className: "bunny-w-full", id: "addPaymentMethod" }, { children: "Add payment method" })) }))) : null,
|
|
19200
|
+
children: (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2" }, { children: [jsxRuntime.jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins, value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: jsxRuntime.jsx(PaymentMethodDetails, { onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) })))] }))),
|
|
19201
|
+
},
|
|
19202
|
+
] }), paying && !selectedPaymentPluginIsManualPayment ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: defaultPaymentMethod && selectedPaymentMethodPlugin ? (jsxRuntime.jsx("div", __assign({ className: "bunny-px-4" }, { children: jsxRuntime.jsx(CheckoutFooter, { quote: quote, invoice: invoice, onPaymentSuccess: handlePaymentSuccess, onPaymentHoldSuccess: onPaymentHoldSuccess, plugin: selectedPaymentMethodPlugin, paymentHoldOptions: paymentHoldOptions }) }))) : null })) : null] }) })) })) })));
|
|
19201
19203
|
};
|
|
19202
19204
|
function StripeWrapper(_a) {
|
|
19203
19205
|
var children = _a.children, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost, currencyId = _a.currencyId, accountId = _a.accountId;
|
|
@@ -19233,7 +19235,7 @@ function ActualInvoice() {
|
|
|
19233
19235
|
// Context
|
|
19234
19236
|
var queryClient = reactQuery.useQueryClient();
|
|
19235
19237
|
var _a = react.useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onPaymentSuccess = _a.onPaymentSuccess, className = _a.className;
|
|
19236
|
-
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired;
|
|
19238
|
+
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired; _b.graphQLClient;
|
|
19237
19239
|
var _c = react.useContext(InvoiceQuoteContext), hideDownloadButton = _c.hideDownloadButton, onInvoiceLoaded = _c.onInvoiceLoaded;
|
|
19238
19240
|
var token = useToken();
|
|
19239
19241
|
var entityId = useCurrentUserData().entityId;
|
|
@@ -19275,7 +19277,7 @@ function ActualInvoice() {
|
|
|
19275
19277
|
return (jsxRuntime.jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsxRuntime.jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19276
19278
|
}
|
|
19277
19279
|
|
|
19278
|
-
var MUTATION$
|
|
19280
|
+
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n quote {\n documentTemplateId\n documents { id filename size date url }\n firstInvoice {\n id\n state\n }\n payableId\n id\n payToAccept\n currentPaymentHold {\n createdAt\n expiresAt\n id\n updatedAt\n paymentMethod {\n accountId\n createdAt\n expirationDate\n failureCode\n id\n isDefault\n lastSuccess\n paymentType\n pluginId\n state\n updatedAt\n metadata {\n description\n expiration\n icon\n identifier\n issuer\n kind\n }\n }\n }\n }\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\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 }"; };
|
|
19279
19281
|
var getFormattedQuote = function (_a) {
|
|
19280
19282
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
19281
19283
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -19283,7 +19285,7 @@ var getFormattedQuote = function (_a) {
|
|
|
19283
19285
|
return __generator(this, function (_b) {
|
|
19284
19286
|
switch (_b.label) {
|
|
19285
19287
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
19286
|
-
query: MUTATION$
|
|
19288
|
+
query: MUTATION$7(),
|
|
19287
19289
|
token: token,
|
|
19288
19290
|
apiHost: apiHost,
|
|
19289
19291
|
vars: { id: id },
|
|
@@ -19321,9 +19323,9 @@ var usePlugins = function (_a) {
|
|
|
19321
19323
|
return response;
|
|
19322
19324
|
};
|
|
19323
19325
|
var getPlugins = function (_a) {
|
|
19324
|
-
var token = _a.token, apiHost = _a.apiHost;
|
|
19326
|
+
var entityId = _a.entityId, token = _a.token, apiHost = _a.apiHost;
|
|
19325
19327
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19326
|
-
var response, plugins, error;
|
|
19328
|
+
var response, plugins, filteredPlugins, error;
|
|
19327
19329
|
return __generator(this, function (_b) {
|
|
19328
19330
|
switch (_b.label) {
|
|
19329
19331
|
case 0: return [4 /*yield*/, common.request({
|
|
@@ -19337,7 +19339,12 @@ var getPlugins = function (_a) {
|
|
|
19337
19339
|
return [4 /*yield*/, response.json()];
|
|
19338
19340
|
case 2:
|
|
19339
19341
|
plugins = _b.sent();
|
|
19340
|
-
|
|
19342
|
+
filteredPlugins = plugins.filter(function (plugin) {
|
|
19343
|
+
var _a, _b;
|
|
19344
|
+
var result = ((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(Number(entityId))) || ((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0 || !entityId;
|
|
19345
|
+
return result;
|
|
19346
|
+
});
|
|
19347
|
+
return [2 /*return*/, filteredPlugins];
|
|
19341
19348
|
case 3: return [4 /*yield*/, response.json()];
|
|
19342
19349
|
case 4:
|
|
19343
19350
|
error = _b.sent();
|
|
@@ -19388,46 +19395,72 @@ var quoteAccept = function (_a) {
|
|
|
19388
19395
|
};
|
|
19389
19396
|
// export default quoteAccept;
|
|
19390
19397
|
var useSendAcceptQuote = function (_a) {
|
|
19391
|
-
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
19398
|
+
_a.onTokenExpired; var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
19392
19399
|
// Hooks
|
|
19393
19400
|
var graphQLMutation = common.useGraphQLmutation(function () {
|
|
19394
|
-
console.log(
|
|
19395
|
-
}, apiHost ||
|
|
19396
|
-
console.log(
|
|
19401
|
+
console.log("navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
19402
|
+
}, apiHost || "", function () {
|
|
19403
|
+
console.log("onError in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
19397
19404
|
});
|
|
19398
19405
|
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19399
19406
|
var queryClient = reactQuery.useQueryClient();
|
|
19400
|
-
var showInfoNotification = common.useInfoNotification();
|
|
19401
19407
|
// Local state
|
|
19402
19408
|
var _b = react.useState(false), acceptBoxVisible = _b[0], setAcceptBoxVisible = _b[1];
|
|
19403
19409
|
var _c = react.useState(false), isAccepting = _c[0], setIsAccepting = _c[1];
|
|
19404
19410
|
// Pandadoc polling modal state
|
|
19405
19411
|
var _d = react.useState(false), pandadocPollingModalVisible = _d[0], setPandadocPollingModalVisible = _d[1];
|
|
19406
19412
|
var redirectForSigning = function () {
|
|
19407
|
-
var mutation = "mutation quoteSigningUrlCreate($quoteId: ID) {\n quoteSigningUrlCreate(quoteId: $quoteId) {\n redirectUri\n pluginClientId\n pluginShortName\n
|
|
19413
|
+
var mutation = "mutation quoteSigningUrlCreate($quoteId: ID) {\n quoteSigningUrlCreate(quoteId: $quoteId) {\n redirectUri\n pluginClientId\n pluginShortName\n errors\n }\n }";
|
|
19408
19414
|
var variables = {
|
|
19409
19415
|
quoteId: quoteId,
|
|
19410
19416
|
};
|
|
19411
19417
|
graphQLMutation(mutation, variables, function (rsp) {
|
|
19412
19418
|
if (rsp.errors)
|
|
19413
|
-
console.log(
|
|
19419
|
+
console.log("rsp.errors", rsp.errors);
|
|
19414
19420
|
else {
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
// If redirectUri exists, redirect the browser
|
|
19418
|
-
window.location.href = redirectUri;
|
|
19421
|
+
if (rsp.data.quoteSigningUrlCreate.pluginShortName === "dropbox_sign") {
|
|
19422
|
+
openDropboxSignModal(rsp.data.quoteSigningUrlCreate.pluginClientId, rsp.data.quoteSigningUrlCreate.redirectUri);
|
|
19419
19423
|
}
|
|
19420
|
-
else if (pluginShortName ===
|
|
19424
|
+
else if (rsp.data.quoteSigningUrlCreate.pluginShortName === "pandadoc") {
|
|
19421
19425
|
setPandadocPollingModalVisible(true);
|
|
19422
19426
|
}
|
|
19423
|
-
else
|
|
19424
|
-
|
|
19425
|
-
showInfoNotification(message, 'Signing Information');
|
|
19426
|
-
setIsAccepting(false);
|
|
19427
|
+
else {
|
|
19428
|
+
window.location.href = rsp.data.quoteSigningUrlCreate.redirectUri;
|
|
19427
19429
|
}
|
|
19428
19430
|
}
|
|
19429
19431
|
}, token);
|
|
19430
19432
|
};
|
|
19433
|
+
var openDropboxSignModal = function (clientId, url) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19434
|
+
var HelloSign, client;
|
|
19435
|
+
return __generator(this, function (_a) {
|
|
19436
|
+
switch (_a.label) {
|
|
19437
|
+
case 0:
|
|
19438
|
+
if (typeof window === "undefined") {
|
|
19439
|
+
return [2 /*return*/];
|
|
19440
|
+
}
|
|
19441
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('hellosign-embedded')); })];
|
|
19442
|
+
case 1:
|
|
19443
|
+
HelloSign = (_a.sent()).default;
|
|
19444
|
+
client = new HelloSign({
|
|
19445
|
+
clientId: clientId,
|
|
19446
|
+
});
|
|
19447
|
+
client.on("sign", function (data) {
|
|
19448
|
+
queryClient.refetchQueries({
|
|
19449
|
+
queryKey: common.QueryKeyFactory.default.createQuoteKey({
|
|
19450
|
+
id: quoteId,
|
|
19451
|
+
token: token,
|
|
19452
|
+
}),
|
|
19453
|
+
});
|
|
19454
|
+
});
|
|
19455
|
+
// Open the DropboxSign modal
|
|
19456
|
+
client.open(url, {
|
|
19457
|
+
clientId: clientId,
|
|
19458
|
+
skipDomainVerification: false, // Set true for development testing
|
|
19459
|
+
});
|
|
19460
|
+
return [2 /*return*/];
|
|
19461
|
+
}
|
|
19462
|
+
});
|
|
19463
|
+
}); };
|
|
19431
19464
|
var _e = reactQuery.useMutation({
|
|
19432
19465
|
mutationFn: function (changedFormItems) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19433
19466
|
return __generator(this, function (_a) {
|
|
@@ -19553,9 +19586,6 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19553
19586
|
var acceptBoxVisible = _a.acceptBoxVisible, formattedQuote = _a.formattedQuote, sendAccept = _a.sendAccept, setAcceptBoxVisible = _a.setAcceptBoxVisible, setIsAccepting = _a.setIsAccepting, isSendAcceptPending = _a.isSendAcceptPending;
|
|
19554
19587
|
// Refs
|
|
19555
19588
|
var firstInputRef = react.useRef(null);
|
|
19556
|
-
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
19557
|
-
var token = useToken();
|
|
19558
|
-
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19559
19589
|
// Hooks
|
|
19560
19590
|
var form = antd.Form.useForm()[0];
|
|
19561
19591
|
useFocusFirstInput({ firstInputRef: firstInputRef, isVisible: acceptBoxVisible });
|
|
@@ -19564,7 +19594,7 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19564
19594
|
var createRules = function (required, title) {
|
|
19565
19595
|
return required ? [{ required: true, message: "".concat(title, " is required") }] : [];
|
|
19566
19596
|
};
|
|
19567
|
-
return (jsxRuntime.jsx(StyledModal$1, __assign({ centered: true, okText: isSendAcceptPending ?
|
|
19597
|
+
return (jsxRuntime.jsx(StyledModal$1, __assign({ centered: true, okText: isSendAcceptPending ? "Accepting..." : "Accept", okButtonProps: {
|
|
19568
19598
|
loading: isSendAcceptPending,
|
|
19569
19599
|
disabled: isSendAcceptPending,
|
|
19570
19600
|
}, onCancel: function () {
|
|
@@ -19577,11 +19607,11 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19577
19607
|
sendAccept(changedFields);
|
|
19578
19608
|
})
|
|
19579
19609
|
.catch(function () { });
|
|
19580
|
-
}, open: acceptBoxVisible, title:
|
|
19610
|
+
}, open: acceptBoxVisible, title: "Accept quote", width: 400 }, { children: jsxRuntime.jsxs(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2", form: form, layout: "vertical" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your name", name: "name", rules: createRules(true, "Your name") }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: true, ref: firstInputRef }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your job title", name: "title", rules: createRules(true, "Your job title") }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Purchase order number", name: "poNumber", rules: createRules(poNumberRequired, "Purchase order number") }, { children: jsxRuntime.jsx(antd.Input, {}) })), taxNumberRequired && (jsxRuntime.jsx(antd.Form.Item, __assign({ name: "taxNumber", label: taxNumberLabel, rules: createRules(taxNumberRequired, taxNumberLabel) }, { children: jsxRuntime.jsx(antd.Input, {}) })))] })) })));
|
|
19581
19611
|
};
|
|
19582
19612
|
|
|
19583
19613
|
var Title$2 = antd.Typography.Title;
|
|
19584
|
-
var showSuccessNotification$
|
|
19614
|
+
var showSuccessNotification$1 = common.useSuccessNotification();
|
|
19585
19615
|
var PaymentHoldModal = function (_a) {
|
|
19586
19616
|
var visible = _a.visible, setVisible = _a.setVisible, quote = _a.quote;
|
|
19587
19617
|
var queryClient = reactQuery.useQueryClient();
|
|
@@ -19602,7 +19632,7 @@ var PaymentHoldModal = function (_a) {
|
|
|
19602
19632
|
setVisible(false);
|
|
19603
19633
|
}, onPaymentHoldSuccess: function () {
|
|
19604
19634
|
setVisible(false);
|
|
19605
|
-
showSuccessNotification$
|
|
19635
|
+
showSuccessNotification$1("Approved payment hold for ".concat(common.formatCurrency(quote.amount, quote.currency)));
|
|
19606
19636
|
queryClient.invalidateQueries({
|
|
19607
19637
|
queryKey: common.QueryKeyFactory.default.createQuoteKey({
|
|
19608
19638
|
id: quote.id,
|
|
@@ -19645,11 +19675,11 @@ function ActualQuote() {
|
|
|
19645
19675
|
var _this = this;
|
|
19646
19676
|
var _a, _b, _c, _d;
|
|
19647
19677
|
// Context
|
|
19648
|
-
var
|
|
19678
|
+
var _e = react.useContext(BunnyContext), apiHost = _e.apiHost, onTokenExpired = _e.onTokenExpired;
|
|
19649
19679
|
var token = useToken();
|
|
19650
|
-
var
|
|
19680
|
+
var _f = react.useContext(InvoiceQuoteContext), className = _f.className, id = _f.id, hideDownloadButton = _f.hideDownloadButton, onQuoteLoaded = _f.onQuoteLoaded;
|
|
19651
19681
|
// Queries
|
|
19652
|
-
var
|
|
19682
|
+
var _g = reactQuery.useQuery({
|
|
19653
19683
|
queryKey: common.QueryKeyFactory.default.createQuoteKey({ id: id, token: token }),
|
|
19654
19684
|
queryFn: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
19655
19685
|
var error_1;
|
|
@@ -19668,14 +19698,15 @@ function ActualQuote() {
|
|
|
19668
19698
|
});
|
|
19669
19699
|
}); },
|
|
19670
19700
|
placeholderData: reactQuery.keepPreviousData,
|
|
19671
|
-
}), data =
|
|
19701
|
+
}), data = _g.data, isLoading = _g.isLoading;
|
|
19672
19702
|
var formattedQuote = data;
|
|
19673
19703
|
// Hooks
|
|
19674
|
-
var
|
|
19704
|
+
var _h = useSendAcceptQuote({
|
|
19675
19705
|
token: token,
|
|
19706
|
+
onTokenExpired: onTokenExpired,
|
|
19676
19707
|
apiHost: apiHost,
|
|
19677
19708
|
quoteId: id,
|
|
19678
|
-
}), acceptBoxVisible =
|
|
19709
|
+
}), acceptBoxVisible = _h.acceptBoxVisible, isAccepting = _h.isAccepting, sendAccept = _h.sendAccept, setAcceptBoxVisible = _h.setAcceptBoxVisible, setIsAccepting = _h.setIsAccepting, startAcceptance = _h.startAcceptance, pandadocPollingModalVisible = _h.pandadocPollingModalVisible, setPandadocPollingModalVisible = _h.setPandadocPollingModalVisible, isSendAcceptPending = _h.isSendAcceptPending;
|
|
19679
19710
|
useSigningComplete({ data: formattedQuote, token: token });
|
|
19680
19711
|
var isMobile = common.useIsMobile();
|
|
19681
19712
|
var showErrorNotification = common.useErrorNotification();
|
|
@@ -19685,7 +19716,7 @@ function ActualQuote() {
|
|
|
19685
19716
|
}
|
|
19686
19717
|
}, [formattedQuote]);
|
|
19687
19718
|
// Payment hold stuff here
|
|
19688
|
-
var
|
|
19719
|
+
var _j = useQuotePaymentHold(formattedQuote), paymentHoldModalVisible = _j.paymentHoldModalVisible, setPaymentHoldModalVisible = _j.setPaymentHoldModalVisible, shouldDoPaymentHold = _j.shouldDoPaymentHold, paymentHoldCompleted = _j.paymentHoldCompleted, paymentHold = _j.paymentHold;
|
|
19689
19720
|
var handleClickAccept = function () {
|
|
19690
19721
|
if (shouldDoPaymentHold && !paymentHoldCompleted) {
|
|
19691
19722
|
setPaymentHoldModalVisible(true);
|
|
@@ -19717,14 +19748,9 @@ function QuoteButtons(_a) {
|
|
|
19717
19748
|
var entityBranding = react.useContext(BrandContext);
|
|
19718
19749
|
var downloadFile = useDownloadFile(id);
|
|
19719
19750
|
var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
|
|
19720
|
-
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19721
19751
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
19722
19752
|
color: entityBranding.secondaryColor,
|
|
19723
|
-
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$n, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2' }, { children: [paymentHold ? (jsxRuntime.jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () { return downloadFile(apiHost + '/api/pdf/quote', token); } }, { children: "Download" }))) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired, onClick: function () { return setPaymentHoldModalVisible(true); }, type: "primary" }, { children: "Pay to accept" }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isAccepted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary" }, { children: isExpired
|
|
19724
|
-
? 'Quote is expired'
|
|
19725
|
-
: (signingPlugins === null || signingPlugins === void 0 ? void 0 : signingPlugins.length)
|
|
19726
|
-
? 'Start signing'
|
|
19727
|
-
: 'Accept quote' }))) : null }))] })))] })));
|
|
19753
|
+
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$n, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2' }, { children: [paymentHold ? (jsxRuntime.jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () { return downloadFile(apiHost + '/api/pdf/quote', token); } }, { children: "Download" }))) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired, onClick: function () { return setPaymentHoldModalVisible(true); }, type: "primary" }, { children: "Pay to accept" }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isAccepted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary" }, { children: isExpired ? 'Quote is expired' : 'Accept quote' }))) : null }))] })))] })));
|
|
19728
19754
|
}
|
|
19729
19755
|
function PaymentHoldDisplay(_a) {
|
|
19730
19756
|
var _b, _c, _d, _e;
|
|
@@ -20189,9 +20215,9 @@ function QuotesWrapper() {
|
|
|
20189
20215
|
return (jsxRuntime.jsx(TransactionsDisplay, { transactions: quotesAsTransactions, onSearchValueChanged: setSearch, search: search }));
|
|
20190
20216
|
}
|
|
20191
20217
|
|
|
20192
|
-
var MUTATION$
|
|
20218
|
+
var MUTATION$6 = function () { return "\nmutation AccountSignup (\n $pluginId: String!,\n $paymentMethodId: String,\n $priceListCode: String!,\n $accountId: ID!,\n $quoteId: ID!,\n $entityId: ID!\n) {\n accountSignup(\n pluginId: $pluginId,\n paymentMethodId: $paymentMethodId,\n priceListCode: $priceListCode,\n accountId: $accountId,\n quoteId: $quoteId,\n entityId: $entityId\n ) {\n errors\n quote {\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}"; };
|
|
20193
20219
|
var accountSignup = function (_a) {
|
|
20194
|
-
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;
|
|
20220
|
+
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, entityId = _a.entityId;
|
|
20195
20221
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20196
20222
|
var vars, response, errors;
|
|
20197
20223
|
var _b;
|
|
@@ -20205,9 +20231,10 @@ var accountSignup = function (_a) {
|
|
|
20205
20231
|
pluginId: pluginId,
|
|
20206
20232
|
paymentMethodId: paymentMethodId,
|
|
20207
20233
|
priceListCode: priceListCode,
|
|
20234
|
+
entityId: entityId,
|
|
20208
20235
|
};
|
|
20209
20236
|
return [4 /*yield*/, gqlRequest({
|
|
20210
|
-
query: MUTATION$
|
|
20237
|
+
query: MUTATION$6(),
|
|
20211
20238
|
token: token,
|
|
20212
20239
|
vars: vars,
|
|
20213
20240
|
apiHost: apiHost,
|
|
@@ -20223,9 +20250,9 @@ var accountSignup = function (_a) {
|
|
|
20223
20250
|
});
|
|
20224
20251
|
};
|
|
20225
20252
|
|
|
20226
|
-
var MUTATION$
|
|
20253
|
+
var MUTATION$5 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $priceListCode: String!,\n $entityId: ID!\n) {\n quoteAccountSignup(\n priceListCode: $priceListCode,\n accountName: $accountName,\n billingContact: $billingContact,\n entityId: $entityId\n ) {\n account {\n id\n }\n quote {\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}"; };
|
|
20227
20254
|
var quoteAccountSignup = function (_a) {
|
|
20228
|
-
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact,
|
|
20255
|
+
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact, entityId = _a.entityId;
|
|
20229
20256
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20230
20257
|
var vars, response, errors;
|
|
20231
20258
|
var _b;
|
|
@@ -20236,10 +20263,10 @@ var quoteAccountSignup = function (_a) {
|
|
|
20236
20263
|
priceListCode: priceListCode,
|
|
20237
20264
|
accountName: accountName,
|
|
20238
20265
|
billingContact: billingContact,
|
|
20239
|
-
|
|
20266
|
+
entityId: entityId,
|
|
20240
20267
|
};
|
|
20241
20268
|
return [4 /*yield*/, gqlRequest({
|
|
20242
|
-
query: MUTATION$
|
|
20269
|
+
query: MUTATION$5(),
|
|
20243
20270
|
token: token,
|
|
20244
20271
|
vars: vars,
|
|
20245
20272
|
apiHost: apiHost,
|
|
@@ -20255,34 +20282,34 @@ var quoteAccountSignup = function (_a) {
|
|
|
20255
20282
|
});
|
|
20256
20283
|
};
|
|
20257
20284
|
|
|
20258
|
-
var
|
|
20259
|
-
var
|
|
20260
|
-
var quoteId = _a.quoteId,
|
|
20285
|
+
var MUTATION$4 = "mutation quoteAddCoupon($couponCode: String!, $quoteId: ID!) {\n quoteAddCoupon(couponCode: $couponCode, quoteId: $quoteId) {\n quote {\n id\n subtotal\n taxAmount\n amount\n quoteChanges {\n id\n charges {\n id\n amount\n couponId\n }\n }\n }\n }\n}";
|
|
20286
|
+
var quoteAddCoupon = function (_a) {
|
|
20287
|
+
var quoteId = _a.quoteId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20261
20288
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20262
20289
|
var vars, response, errors;
|
|
20263
|
-
var _b
|
|
20264
|
-
return __generator(this, function (
|
|
20265
|
-
switch (
|
|
20290
|
+
var _b;
|
|
20291
|
+
return __generator(this, function (_c) {
|
|
20292
|
+
switch (_c.label) {
|
|
20266
20293
|
case 0:
|
|
20267
|
-
vars = {
|
|
20268
|
-
return [4 /*yield*/,
|
|
20269
|
-
query:
|
|
20294
|
+
vars = { quoteId: quoteId, couponCode: couponCode };
|
|
20295
|
+
return [4 /*yield*/, gqlRequest({
|
|
20296
|
+
query: MUTATION$4,
|
|
20270
20297
|
token: token,
|
|
20271
20298
|
vars: vars,
|
|
20272
20299
|
apiHost: apiHost,
|
|
20273
20300
|
})];
|
|
20274
20301
|
case 1:
|
|
20275
|
-
response =
|
|
20276
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.
|
|
20302
|
+
response = _c.sent();
|
|
20303
|
+
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteAddCoupon) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20277
20304
|
if (errors)
|
|
20278
20305
|
throw errors;
|
|
20279
|
-
return [2 /*return*/,
|
|
20306
|
+
return [2 /*return*/, response.quote];
|
|
20280
20307
|
}
|
|
20281
20308
|
});
|
|
20282
20309
|
});
|
|
20283
20310
|
};
|
|
20284
20311
|
|
|
20285
|
-
var MUTATION$
|
|
20312
|
+
var MUTATION$3 = function () { return "\nquery PriceList($code: String!) {\n priceList (code: $code) {\n basePrice\n code\n createdAt\n currencyId\n id\n isVisible\n name\n periodMonths\n planId\n priceDescription\n productId\n product {\n name\n }\n sku\n trialAllowed\n trialLengthDays\n updatedAt\n }\n}"; };
|
|
20286
20313
|
var getPriceList = function (_a) {
|
|
20287
20314
|
var token = _a.token, code = _a.code, apiHost = _a.apiHost;
|
|
20288
20315
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -20290,7 +20317,7 @@ var getPriceList = function (_a) {
|
|
|
20290
20317
|
return __generator(this, function (_b) {
|
|
20291
20318
|
switch (_b.label) {
|
|
20292
20319
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
20293
|
-
query: MUTATION$
|
|
20320
|
+
query: MUTATION$3(),
|
|
20294
20321
|
token: token,
|
|
20295
20322
|
vars: { code: code },
|
|
20296
20323
|
apiHost: apiHost,
|
|
@@ -20303,7 +20330,7 @@ var getPriceList = function (_a) {
|
|
|
20303
20330
|
});
|
|
20304
20331
|
};
|
|
20305
20332
|
|
|
20306
|
-
var QUOTE_QUERY = function (id) { return "\n query quote {\n quote ".concat(id ? "(id: ".concat(id, ")") : '', " {\n accountId\n amount\n amountDue\n smallUnitAmountDue\n currencyId\n formattedQuote {\n html\n }\n id\n payableId\n periodAmount\n subtotal\n taxAmount\n amountsByPeriod {\n amount\n startDate\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n
|
|
20333
|
+
var QUOTE_QUERY = function (id) { return "\n query quote {\n quote ".concat(id ? "(id: ".concat(id, ")") : '', " {\n accountId\n amount\n amountDue\n smallUnitAmountDue\n currencyId\n formattedQuote {\n html\n }\n id\n payableId\n periodAmount\n subtotal\n taxAmount\n amountsByPeriod {\n amount\n startDate\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n currencyId\n feature {\n unitName\n }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n couponId\n quantity\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n\n }\n }\n }"); };
|
|
20307
20334
|
var getQuote = function (_a) {
|
|
20308
20335
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
20309
20336
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -20324,140 +20351,6 @@ var getQuote = function (_a) {
|
|
|
20324
20351
|
});
|
|
20325
20352
|
};
|
|
20326
20353
|
|
|
20327
|
-
var MUTATION$4 = "mutation quoteChangeAddCoupon($couponCode: String!, $quoteChangeId: ID!) {\n quoteChangeAddCoupon(couponCode: $couponCode, quoteChangeId: $quoteChangeId) {\n quoteChange {\n id\n charges {\n id\n amount\n couponId\n }\n }\n }\n}";
|
|
20328
|
-
var quoteChangeAddCoupon = function (_a) {
|
|
20329
|
-
var quoteChangeId = _a.quoteChangeId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20330
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
20331
|
-
var vars, response, errors;
|
|
20332
|
-
var _b;
|
|
20333
|
-
return __generator(this, function (_c) {
|
|
20334
|
-
switch (_c.label) {
|
|
20335
|
-
case 0:
|
|
20336
|
-
vars = { couponCode: couponCode, quoteChangeId: quoteChangeId };
|
|
20337
|
-
return [4 /*yield*/, common.gqlRequest({
|
|
20338
|
-
query: MUTATION$4,
|
|
20339
|
-
token: token,
|
|
20340
|
-
vars: vars,
|
|
20341
|
-
apiHost: apiHost,
|
|
20342
|
-
})];
|
|
20343
|
-
case 1:
|
|
20344
|
-
response = _c.sent();
|
|
20345
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteAddCoupon) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20346
|
-
if (errors)
|
|
20347
|
-
throw errors;
|
|
20348
|
-
return [2 /*return*/, response.quote];
|
|
20349
|
-
}
|
|
20350
|
-
});
|
|
20351
|
-
});
|
|
20352
|
-
};
|
|
20353
|
-
|
|
20354
|
-
var MUTATION$3 = "mutation quoteChangeRemoveCoupon($quoteChangeId: ID!, $couponCode: String!) {\n quoteChangeRemoveCoupon(quoteChangeId: $quoteChangeId, couponCode: $couponCode) {\n errors\n }\n}\n";
|
|
20355
|
-
var quoteChangeRemoveCoupon = function (_a) {
|
|
20356
|
-
var quoteChangeId = _a.quoteChangeId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20357
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
20358
|
-
var vars, response, errors;
|
|
20359
|
-
var _b;
|
|
20360
|
-
return __generator(this, function (_c) {
|
|
20361
|
-
switch (_c.label) {
|
|
20362
|
-
case 0:
|
|
20363
|
-
vars = { couponCode: couponCode, quoteChangeId: quoteChangeId };
|
|
20364
|
-
return [4 /*yield*/, common.gqlRequest({
|
|
20365
|
-
query: MUTATION$3,
|
|
20366
|
-
token: token,
|
|
20367
|
-
vars: vars,
|
|
20368
|
-
apiHost: apiHost,
|
|
20369
|
-
})];
|
|
20370
|
-
case 1:
|
|
20371
|
-
response = _c.sent();
|
|
20372
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteChangeRemoveCoupon) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20373
|
-
if (errors)
|
|
20374
|
-
throw errors;
|
|
20375
|
-
return [2 /*return*/, response.quote];
|
|
20376
|
-
}
|
|
20377
|
-
});
|
|
20378
|
-
});
|
|
20379
|
-
};
|
|
20380
|
-
|
|
20381
|
-
var COUPONS_QUERY = function (filter) { return "\n query Coupons {\n coupons(filter: ".concat(filter ? "\"".concat(filter, "\"") : 'null', ") {\n totalCount\n }\n }\n"); };
|
|
20382
|
-
var getCoupons = function (_a) {
|
|
20383
|
-
var token = _a.token, apiHost = _a.apiHost, filter = _a.filter;
|
|
20384
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
20385
|
-
var response;
|
|
20386
|
-
return __generator(this, function (_b) {
|
|
20387
|
-
switch (_b.label) {
|
|
20388
|
-
case 0: return [4 /*yield*/, gqlRequest({
|
|
20389
|
-
query: COUPONS_QUERY(filter),
|
|
20390
|
-
token: token,
|
|
20391
|
-
vars: {},
|
|
20392
|
-
apiHost: apiHost,
|
|
20393
|
-
})];
|
|
20394
|
-
case 1:
|
|
20395
|
-
response = _b.sent();
|
|
20396
|
-
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.coupons];
|
|
20397
|
-
}
|
|
20398
|
-
});
|
|
20399
|
-
});
|
|
20400
|
-
};
|
|
20401
|
-
|
|
20402
|
-
var showErrorNotification$1 = common.useErrorNotification();
|
|
20403
|
-
var useUpdateCoupons = function (_a) {
|
|
20404
|
-
var apiHost = _a.apiHost, token = _a.token, quoteChangeId = _a.quoteChangeId, onCouponAdded = _a.onCouponAdded, onCouponRemoved = _a.onCouponRemoved;
|
|
20405
|
-
var coupons = reactQuery.useQuery({
|
|
20406
|
-
queryKey: ['coupons', token],
|
|
20407
|
-
queryFn: function () { return getCoupons({ token: token, apiHost: apiHost, filter: 'coupon.active is true' }); },
|
|
20408
|
-
}).data;
|
|
20409
|
-
var _b = reactQuery.useMutation({
|
|
20410
|
-
mutationFn: function (couponCode) {
|
|
20411
|
-
if (!token) {
|
|
20412
|
-
throw new Error('Token is required');
|
|
20413
|
-
}
|
|
20414
|
-
if (!quoteChangeId) {
|
|
20415
|
-
throw new Error('Quote change ID is required');
|
|
20416
|
-
}
|
|
20417
|
-
return quoteChangeAddCoupon({
|
|
20418
|
-
quoteChangeId: quoteChangeId,
|
|
20419
|
-
couponCode: couponCode,
|
|
20420
|
-
apiHost: apiHost,
|
|
20421
|
-
token: token,
|
|
20422
|
-
});
|
|
20423
|
-
},
|
|
20424
|
-
onSuccess: function () {
|
|
20425
|
-
onCouponAdded === null || onCouponAdded === void 0 ? void 0 : onCouponAdded();
|
|
20426
|
-
},
|
|
20427
|
-
onError: function (error) {
|
|
20428
|
-
var _a, _b;
|
|
20429
|
-
showErrorNotification$1((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error adding coupon');
|
|
20430
|
-
},
|
|
20431
|
-
}), addCoupon = _b.mutate, isAddingCoupon = _b.isPending;
|
|
20432
|
-
var _c = reactQuery.useMutation({
|
|
20433
|
-
mutationFn: function (couponCode) {
|
|
20434
|
-
if (!quoteChangeId) {
|
|
20435
|
-
throw new Error('Quote change ID is required');
|
|
20436
|
-
}
|
|
20437
|
-
return quoteChangeRemoveCoupon({
|
|
20438
|
-
quoteChangeId: quoteChangeId,
|
|
20439
|
-
couponCode: couponCode,
|
|
20440
|
-
apiHost: apiHost,
|
|
20441
|
-
token: token,
|
|
20442
|
-
});
|
|
20443
|
-
},
|
|
20444
|
-
onSuccess: function () {
|
|
20445
|
-
onCouponRemoved === null || onCouponRemoved === void 0 ? void 0 : onCouponRemoved();
|
|
20446
|
-
},
|
|
20447
|
-
onError: function (error) {
|
|
20448
|
-
var _a, _b;
|
|
20449
|
-
showErrorNotification$1((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error removing coupon');
|
|
20450
|
-
},
|
|
20451
|
-
}), removeCoupon = _c.mutate, isRemovingCoupon = _c.isPending;
|
|
20452
|
-
return {
|
|
20453
|
-
addCoupon: addCoupon,
|
|
20454
|
-
removeCoupon: removeCoupon,
|
|
20455
|
-
isAddingCoupon: isAddingCoupon,
|
|
20456
|
-
isRemovingCoupon: isRemovingCoupon,
|
|
20457
|
-
activeCouponsExist: (coupons === null || coupons === void 0 ? void 0 : coupons.totalCount) > 0,
|
|
20458
|
-
};
|
|
20459
|
-
};
|
|
20460
|
-
|
|
20461
20354
|
var BunnyFooterIcon = function (_a) {
|
|
20462
20355
|
var color = _a.color;
|
|
20463
20356
|
return (jsxRuntime.jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsxRuntime.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 }), jsxRuntime.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 }), jsxRuntime.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 }), jsxRuntime.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 }), jsxRuntime.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 }), jsxRuntime.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 })] })), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsxRuntime.jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
|
|
@@ -20479,43 +20372,6 @@ var StyedLink = styled__default["default"].a(templateObject_1$6 || (templateObje
|
|
|
20479
20372
|
var StyledBunnyLink = styled__default["default"](StyedLink)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n &:hover {\n color: ", " !important;\n }\n"], ["\n &:hover {\n color: ", " !important;\n }\n"])), common.PRIMARY_COLOR);
|
|
20480
20373
|
var templateObject_1$6, templateObject_2$1;
|
|
20481
20374
|
|
|
20482
|
-
function CouponEditor(_a) {
|
|
20483
|
-
var className = _a.className, onAddCoupon = _a.onAddCoupon, isAddingCoupon = _a.isAddingCoupon, couponCode = _a.couponCode, setCouponCode = _a.setCouponCode;
|
|
20484
|
-
function handleAddCoupon() {
|
|
20485
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20486
|
-
return __generator(this, function (_a) {
|
|
20487
|
-
onAddCoupon(couponCode);
|
|
20488
|
-
return [2 /*return*/];
|
|
20489
|
-
});
|
|
20490
|
-
});
|
|
20491
|
-
}
|
|
20492
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(className) }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-row bunny-gap-2" }, { children: [jsxRuntime.jsx(antd.Input, { value: couponCode, onChange: function (e) { return setCouponCode(e.target.value); }, placeholder: "Coupon code", disabled: isAddingCoupon, size: "small" }), jsxRuntime.jsx(antd.Button, __assign({ loading: isAddingCoupon, type: "primary", onClick: handleAddCoupon, disabled: couponCode.length === 0 }, { children: "Apply" }))] })) })));
|
|
20493
|
-
}
|
|
20494
|
-
|
|
20495
|
-
var Text$f = antd.Typography.Text;
|
|
20496
|
-
function CheckoutSummary(_a) {
|
|
20497
|
-
var quote = _a.quote, className = _a.className, onAddCoupon = _a.onAddCoupon, onRemoveCoupon = _a.onRemoveCoupon, isRemovingCoupon = _a.isRemovingCoupon, priceListData = _a.priceListData, isAddingCoupon = _a.isAddingCoupon, couponCode = _a.couponCode, setCouponCode = _a.setCouponCode, activeCouponsExist = _a.activeCouponsExist;
|
|
20498
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className, " bunny-space-y-4") }, { children: [jsxRuntime.jsxs(Text$f, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-text-lg bunny-font-medium bunny-mb-4" }, { children: ["Checkout summary - ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.product.name, " ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.name] })), jsxRuntime.jsx("div", __assign({ className: "bunny-space-y-4" }, { children: quote === null || quote === void 0 ? void 0 : quote.quoteChanges.map(function (quoteChange) {
|
|
20499
|
-
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20500
|
-
var _a;
|
|
20501
|
-
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20502
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-grid bunny-grid-cols-3 bunny-gap-4 bunny-items-center" }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-col-span-1" }, { children: charge.name })), jsxRuntime.jsx("div", __assign({ className: "bunny-col-span-1 bunny-text-center" }, { children: ((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode) ? (jsxRuntime.jsx("div", __assign({ onClick: function () {
|
|
20503
|
-
var _a, _b;
|
|
20504
|
-
if (isRemovingCoupon) {
|
|
20505
|
-
return;
|
|
20506
|
-
}
|
|
20507
|
-
if (!((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode)) {
|
|
20508
|
-
throw new Error('Coupon code not found');
|
|
20509
|
-
}
|
|
20510
|
-
onRemoveCoupon((_b = charge.coupon) === null || _b === void 0 ? void 0 : _b.couponCode);
|
|
20511
|
-
}, className: "bunny-text-orange-500 hover:bunny-text-orange-400 bunny-cursor-pointer" }, { children: "Remove" }))) : (jsxRuntime.jsx("div", { children: charge.quantity })) })), jsxRuntime.jsx("div", __assign({ className: "bunny-col-span-1 bunny-text-right" }, { children: common.formatCurrency(multiplier * (charge.subtotal || 0), charge.currencyId) }))] }), charge.id));
|
|
20512
|
-
});
|
|
20513
|
-
}) })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-space-y-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Subtotal" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.subtotal, quote.currencyId) })] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Taxes" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.taxAmount, quote.currencyId) })] }))] })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Total" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue, quote.currencyId) })] }))] }), activeCouponsExist && (jsxRuntime.jsx(CouponEditor, { className: "bunny-w-full", quote: quote, onAddCoupon: onAddCoupon, isAddingCoupon: isAddingCoupon, couponCode: couponCode, setCouponCode: setCouponCode }))] })));
|
|
20514
|
-
}
|
|
20515
|
-
var CheckoutSummaryDivider = function () {
|
|
20516
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20517
|
-
};
|
|
20518
|
-
|
|
20519
20375
|
var Title$1 = antd.Typography.Title;
|
|
20520
20376
|
function PaymentForms(_a) {
|
|
20521
20377
|
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;
|
|
@@ -20525,130 +20381,58 @@ function PaymentForms(_a) {
|
|
|
20525
20381
|
function InitialSignupForm(_a) {
|
|
20526
20382
|
var className = _a.className, onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
20527
20383
|
var form = antd.Form.useForm()[0];
|
|
20528
|
-
var isMobile = common.useIsMobile();
|
|
20529
20384
|
function handleSubmit() {
|
|
20530
20385
|
form.validateFields({ validateOnly: false }).then(function () {
|
|
20531
20386
|
onSubmit(form.getFieldsValue());
|
|
20532
20387
|
});
|
|
20533
20388
|
}
|
|
20534
|
-
return (jsxRuntime.jsx(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-h-full bunny-w-full ".concat(className), form: form, layout: "vertical", autoComplete: "off" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-2" }, { children: [jsxRuntime.
|
|
20535
|
-
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
var _a, _b;
|
|
20539
|
-
return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '').toLowerCase().includes(input.toLowerCase()) ||
|
|
20540
|
-
((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : '').toLowerCase().includes(input.toLowerCase());
|
|
20541
|
-
} }) })) })) })), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, __assign({ type: "primary", onClick: handleSubmit, loading: submitting, className: "bunny-w-full" }, { children: "Proceed to payment" })) })] })) })));
|
|
20389
|
+
return (jsxRuntime.jsx(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-h-full bunny-w-full ".concat(className), form: form, layout: "vertical", autoComplete: "off" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-2" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ name: "firstName", rules: [{ required: true, message: 'First name is required' }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "First name" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "lastName", rules: [{ required: true, message: 'Last name is required' }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Last name" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "email", rules: [
|
|
20390
|
+
{ required: true, message: 'Email is required' },
|
|
20391
|
+
{ type: 'email', message: 'Please enter a valid email' },
|
|
20392
|
+
] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Email" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "accountName", rules: [{ required: true, message: 'Company name is required' }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) })), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, __assign({ type: "primary", onClick: handleSubmit, loading: submitting, className: "bunny-w-full" }, { children: "Proceed to payment" })) })] })) })));
|
|
20542
20393
|
}
|
|
20543
20394
|
|
|
20544
|
-
var Title = antd.Typography.Title, Text$
|
|
20395
|
+
var Title = antd.Typography.Title, Text$f = antd.Typography.Text;
|
|
20545
20396
|
function PaymentSuccessDisplay(_a) {
|
|
20546
20397
|
var amountPaid = _a.amountPaid, className = _a.className, companyName = _a.companyName, returnUrl = _a.returnUrl, style = _a.style, currencyId = _a.currencyId;
|
|
20547
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-justify-center bunny-h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "bunny-mt-2 bunny-m-0" }, { children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] })), returnUrl && (jsxRuntime.jsxs(Text$
|
|
20398
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-justify-center bunny-h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "bunny-mt-2 bunny-m-0" }, { children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] })), returnUrl && (jsxRuntime.jsxs(Text$f, __assign({ className: "bunny-text-slate-500 bunny-cursor-pointer bunny-underline", onClick: function () { return (window.location.href = returnUrl); } }, { children: ["Back to ", companyName] })))] })));
|
|
20548
20399
|
}
|
|
20549
20400
|
|
|
20550
|
-
var Text$
|
|
20401
|
+
var Text$e = antd.Typography.Text;
|
|
20551
20402
|
function PriceListDisplay(_a) {
|
|
20552
20403
|
var priceListData = _a.priceListData;
|
|
20553
20404
|
if (!priceListData)
|
|
20554
20405
|
return null;
|
|
20555
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-8" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [jsxRuntime.jsxs(Text$
|
|
20406
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-8" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [jsxRuntime.jsxs(Text$e, __assign({ className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg" }, { children: [priceListData.product.name, " ", priceListData.name] })), jsxRuntime.jsxs(Text$e, __assign({ className: "bunny-font-bold bunny-text-xl" }, { children: [common.formatCurrency(priceListData.basePrice, priceListData.currencyId), " / month"] }))] })), priceListData.trialAllowed ? (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: [jsxRuntime.jsxs(Text$e, __assign({ style: { fontSize: '16px' }, className: "bunny-text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsxRuntime.jsx(Text$e, __assign({ className: "bunny-text-slate-500", style: { fontSize: '12px' } }, { children: "You will not be charged until the last day of the trial." }))] }))) : null] })));
|
|
20556
20407
|
}
|
|
20557
20408
|
|
|
20558
20409
|
var showErrorNotification = common.useErrorNotification();
|
|
20559
|
-
var showSuccessNotification$1 = common.useSuccessNotification();
|
|
20560
20410
|
function Signup(_a) {
|
|
20561
|
-
var _b,
|
|
20562
|
-
var companyName = _a.companyName, priceListCode = _a.priceListCode, returnUrl = _a.returnUrl, couponCode = _a.couponCode, className = _a.className, _e = _a.shadow, shadow = _e === void 0 ? 'shadow-md' : _e, style = _a.style;
|
|
20411
|
+
var companyName = _a.companyName, priceListCode = _a.priceListCode, returnUrl = _a.returnUrl, couponCode = _a.couponCode, className = _a.className, _b = _a.shadow, shadow = _b === void 0 ? 'shadow-md' : _b, style = _a.style, entityId = _a.entityId;
|
|
20563
20412
|
// Hooks
|
|
20564
20413
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20565
20414
|
var tokenFromContexts = useToken();
|
|
20566
20415
|
var isMobile = common.useIsMobile();
|
|
20567
20416
|
var topNavImageUrl = react.useContext(BrandContext).topNavImageUrl;
|
|
20568
|
-
var
|
|
20569
|
-
var
|
|
20570
|
-
var
|
|
20417
|
+
var _c = react.useState(undefined), initialQuote = _c[0], setInitialQuote = _c[1];
|
|
20418
|
+
var _d = react.useState(undefined), accountId = _d[0], setAccountId = _d[1];
|
|
20419
|
+
var _e = react.useState(undefined), portalSessionToken = _e[0], setPortalSessionToken = _e[1];
|
|
20571
20420
|
var token = portalSessionToken || tokenFromContexts;
|
|
20572
|
-
var
|
|
20421
|
+
var _f = react.useState(false), proceedingToPayment = _f[0], setProceedingToPayment = _f[1];
|
|
20422
|
+
var _g = react.useState(false), purchaseSucceeded = _g[0], setPurchaseSucceeded = _g[1];
|
|
20573
20423
|
var defaultCouponAppliedRef = react.useRef(undefined);
|
|
20574
|
-
var _k = react.useState(''), couponEditorCouponCode = _k[0], setCouponEditorCouponCode = _k[1];
|
|
20575
20424
|
var defaultPaymentMethod = usePaymentMethod({
|
|
20576
20425
|
accountId: accountId,
|
|
20577
20426
|
token: token,
|
|
20578
20427
|
apiHost: apiHost,
|
|
20579
20428
|
}).defaultPaymentMethod;
|
|
20580
20429
|
var queryClient = reactQuery.useQueryClient();
|
|
20581
|
-
var recalculateTaxes = reactQuery.useMutation({
|
|
20582
|
-
mutationFn: function () {
|
|
20583
|
-
if (!(quote === null || quote === void 0 ? void 0 : quote.id)) {
|
|
20584
|
-
throw new Error('Quote ID is required');
|
|
20585
|
-
}
|
|
20586
|
-
return quoteRecalculateTaxes({ token: token, apiHost: apiHost, quoteId: quote.id });
|
|
20587
|
-
},
|
|
20588
|
-
onError: function (error) {
|
|
20589
|
-
if (!error[0].message.includes('Ensure that you have a taxation plugin')) {
|
|
20590
|
-
showErrorNotification(error.message);
|
|
20591
|
-
}
|
|
20592
|
-
},
|
|
20593
|
-
onSuccess: function (quote) {
|
|
20594
|
-
queryClient.setQueryData(['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id], quote);
|
|
20595
|
-
queryClient.invalidateQueries({
|
|
20596
|
-
queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
|
|
20597
|
-
});
|
|
20598
|
-
},
|
|
20599
|
-
}).mutate;
|
|
20600
|
-
var _l = reactQuery.useMutation({
|
|
20601
|
-
mutationFn: function (formData) {
|
|
20602
|
-
return quoteAccountSignup({
|
|
20603
|
-
token: token,
|
|
20604
|
-
apiHost: apiHost,
|
|
20605
|
-
priceListCode: priceListCode,
|
|
20606
|
-
accountName: formData.accountName,
|
|
20607
|
-
billingContact: {
|
|
20608
|
-
firstName: formData.firstName,
|
|
20609
|
-
lastName: formData.lastName,
|
|
20610
|
-
email: formData.email,
|
|
20611
|
-
},
|
|
20612
|
-
billingDetails: {
|
|
20613
|
-
billingCountry: formData.billingCountry,
|
|
20614
|
-
// TODO: add these billing details back for Avalara and AFC taxation plugins.
|
|
20615
|
-
// billingState: formData.billingState,
|
|
20616
|
-
// billingCity: formData.billingCity,
|
|
20617
|
-
// billingZip: formData.billingZip,
|
|
20618
|
-
// billingStreet: formData.billingStreet,
|
|
20619
|
-
// taxNumber: formData.taxNumber,
|
|
20620
|
-
},
|
|
20621
|
-
});
|
|
20622
|
-
},
|
|
20623
|
-
onSuccess: function (data) {
|
|
20624
|
-
setAccountId(data.account.id);
|
|
20625
|
-
setPortalSessionToken(data.portalSessionToken);
|
|
20626
|
-
// We must invalidate the accountPaymentMethodKey query in order to clear payment methods from the provided api token,
|
|
20627
|
-
// to instead use paymentMethods from portalSessionToken.
|
|
20628
|
-
queryClient.invalidateQueries({
|
|
20629
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
20630
|
-
accountId: accountId,
|
|
20631
|
-
token: token,
|
|
20632
|
-
}),
|
|
20633
|
-
});
|
|
20634
|
-
setInitialQuote(data.quote);
|
|
20635
|
-
},
|
|
20636
|
-
onError: function (error) {
|
|
20637
|
-
var errorMessage = error.response.errors[0].message;
|
|
20638
|
-
if (errorMessage.includes("Address couldn't be validated")) {
|
|
20639
|
-
showErrorNotification('Please enter a valid billing address');
|
|
20640
|
-
}
|
|
20641
|
-
else {
|
|
20642
|
-
showErrorNotification(errorMessage);
|
|
20643
|
-
}
|
|
20644
|
-
},
|
|
20645
|
-
}), quoteAccountSignupMutate = _l.mutate, isSigningUp = _l.isPending;
|
|
20646
20430
|
// Queries
|
|
20647
|
-
var
|
|
20431
|
+
var _h = reactQuery.useQuery({
|
|
20648
20432
|
queryKey: ['priceList', priceListCode],
|
|
20649
20433
|
queryFn: function () { return getPriceList({ token: token, apiHost: apiHost, code: priceListCode }); },
|
|
20650
|
-
}), priceListData =
|
|
20651
|
-
var
|
|
20434
|
+
}), priceListData = _h.data, isLoadingPriceList = _h.isLoading;
|
|
20435
|
+
var _j = reactQuery.useQuery({
|
|
20652
20436
|
queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
|
|
20653
20437
|
queryFn: function () {
|
|
20654
20438
|
if (!(initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id)) {
|
|
@@ -20657,27 +20441,34 @@ function Signup(_a) {
|
|
|
20657
20441
|
return getQuote({ token: token, apiHost: apiHost, id: initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id });
|
|
20658
20442
|
},
|
|
20659
20443
|
enabled: !!(initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id),
|
|
20660
|
-
}), data =
|
|
20444
|
+
}), data = _j.data, isLoadingQuote = _j.isLoading;
|
|
20661
20445
|
var quote = data || initialQuote;
|
|
20662
|
-
var
|
|
20663
|
-
|
|
20664
|
-
|
|
20665
|
-
|
|
20666
|
-
|
|
20667
|
-
|
|
20668
|
-
|
|
20446
|
+
var _k = reactQuery.useMutation({
|
|
20447
|
+
mutationFn: function (couponCode) {
|
|
20448
|
+
if (!quote) {
|
|
20449
|
+
throw new Error('Quote is required');
|
|
20450
|
+
}
|
|
20451
|
+
if (!token) {
|
|
20452
|
+
throw new Error('Token is required');
|
|
20453
|
+
}
|
|
20454
|
+
return quoteAddCoupon({
|
|
20455
|
+
quoteId: quote.id,
|
|
20456
|
+
couponCode: couponCode,
|
|
20457
|
+
apiHost: apiHost,
|
|
20458
|
+
token: token,
|
|
20669
20459
|
});
|
|
20670
|
-
showSuccessNotification$1('Coupon applied');
|
|
20671
|
-
recalculateTaxes();
|
|
20672
20460
|
},
|
|
20673
|
-
|
|
20674
|
-
queryClient.
|
|
20461
|
+
onSuccess: function () {
|
|
20462
|
+
queryClient.refetchQueries({
|
|
20675
20463
|
queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
|
|
20676
20464
|
});
|
|
20677
|
-
showSuccessNotification
|
|
20678
|
-
recalculateTaxes();
|
|
20465
|
+
showSuccessNotification('Coupon applied');
|
|
20679
20466
|
},
|
|
20680
|
-
|
|
20467
|
+
onError: function (error) {
|
|
20468
|
+
var _a, _b;
|
|
20469
|
+
showErrorNotification((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error adding coupon');
|
|
20470
|
+
},
|
|
20471
|
+
}), addCoupon = _k.mutate, isAddingCoupon = _k.isPending;
|
|
20681
20472
|
// Handle default coupon application
|
|
20682
20473
|
react.useEffect(function () {
|
|
20683
20474
|
if (couponCode && (quote === null || quote === void 0 ? void 0 : quote.id) && defaultCouponAppliedRef.current !== couponCode) {
|
|
@@ -20687,9 +20478,46 @@ function Signup(_a) {
|
|
|
20687
20478
|
}, [couponCode, quote === null || quote === void 0 ? void 0 : quote.id]);
|
|
20688
20479
|
function handleSubmit(formData) {
|
|
20689
20480
|
return __awaiter(this, void 0, void 0, function () {
|
|
20481
|
+
var data_1, error_1;
|
|
20690
20482
|
return __generator(this, function (_a) {
|
|
20691
|
-
|
|
20692
|
-
|
|
20483
|
+
switch (_a.label) {
|
|
20484
|
+
case 0:
|
|
20485
|
+
_a.trys.push([0, 2, , 3]);
|
|
20486
|
+
setProceedingToPayment(true);
|
|
20487
|
+
return [4 /*yield*/, quoteAccountSignup({
|
|
20488
|
+
token: token,
|
|
20489
|
+
apiHost: apiHost,
|
|
20490
|
+
priceListCode: priceListCode,
|
|
20491
|
+
accountName: formData.accountName,
|
|
20492
|
+
billingContact: {
|
|
20493
|
+
firstName: formData.firstName,
|
|
20494
|
+
lastName: formData.lastName,
|
|
20495
|
+
email: formData.email,
|
|
20496
|
+
},
|
|
20497
|
+
entityId: entityId,
|
|
20498
|
+
})];
|
|
20499
|
+
case 1:
|
|
20500
|
+
data_1 = _a.sent();
|
|
20501
|
+
setAccountId(data_1.account.id);
|
|
20502
|
+
setPortalSessionToken(data_1.portalSessionToken);
|
|
20503
|
+
// We must invalidate the accountPaymentMethodKey query in order to clear payment methods from the provided api token,
|
|
20504
|
+
// to instead use paymentMethods from portalSessionToken.
|
|
20505
|
+
queryClient.invalidateQueries({
|
|
20506
|
+
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
20507
|
+
accountId: accountId,
|
|
20508
|
+
token: token,
|
|
20509
|
+
}),
|
|
20510
|
+
});
|
|
20511
|
+
setProceedingToPayment(false);
|
|
20512
|
+
setInitialQuote(data_1.quote);
|
|
20513
|
+
return [3 /*break*/, 3];
|
|
20514
|
+
case 2:
|
|
20515
|
+
error_1 = _a.sent();
|
|
20516
|
+
setProceedingToPayment(false);
|
|
20517
|
+
showErrorNotification(error_1.response.message);
|
|
20518
|
+
return [3 /*break*/, 3];
|
|
20519
|
+
case 3: return [2 /*return*/];
|
|
20520
|
+
}
|
|
20693
20521
|
});
|
|
20694
20522
|
});
|
|
20695
20523
|
}
|
|
@@ -20726,6 +20554,7 @@ function Signup(_a) {
|
|
|
20726
20554
|
pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
|
|
20727
20555
|
priceListCode: priceListCode,
|
|
20728
20556
|
accountId: accountId,
|
|
20557
|
+
entityId: entityId,
|
|
20729
20558
|
})];
|
|
20730
20559
|
case 1: return [2 /*return*/, _a.sent()];
|
|
20731
20560
|
}
|
|
@@ -20733,20 +20562,28 @@ function Signup(_a) {
|
|
|
20733
20562
|
});
|
|
20734
20563
|
}
|
|
20735
20564
|
function handlePaymentFail(error) {
|
|
20736
|
-
|
|
20737
|
-
showErrorNotification((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.message);
|
|
20565
|
+
showErrorNotification(error.response.message);
|
|
20738
20566
|
}
|
|
20739
|
-
react.useEffect(function () {
|
|
20740
|
-
if (initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id) {
|
|
20741
|
-
recalculateTaxes();
|
|
20742
|
-
}
|
|
20743
|
-
}, [initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id]);
|
|
20744
20567
|
if (purchaseSucceeded) {
|
|
20745
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsxRuntime.jsx("div", __assign({ className: "bunny-w-screen bunny-
|
|
20568
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsxRuntime.jsx("div", __assign({ className: "bunny-w-screen bunny-flex bunny-items-start bunny-pt-[25vh]" }, { children: jsxRuntime.jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "bunny-w-full", companyName: companyName, returnUrl: returnUrl, currencyId: quote === null || quote === void 0 ? void 0 : quote.currencyId }) }))) : (jsxRuntime.jsx("div", { children: "No currency ID found from Quote" })) }));
|
|
20746
20569
|
}
|
|
20747
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex ".concat(isMobile ? 'bunny-flex-col' : 'bunny-flex-row', " bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ").concat(shadow, " ").concat(className), style: style }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full', " bunny-justify-center") }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24" }, { children: [jsxRuntime.jsx("div", { children: topNavImageUrl.length > 0 && (jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsxRuntime.jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon,
|
|
20570
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex ".concat(isMobile ? 'bunny-flex-col' : 'bunny-flex-row', " bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ").concat(shadow, " ").concat(className), style: style }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full', " bunny-justify-center") }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24" }, { children: [jsxRuntime.jsx("div", { children: topNavImageUrl.length > 0 && (jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsxRuntime.jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon, priceListData: priceListData, isAddingCoupon: isAddingCoupon })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-h-full" }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true })) : (jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData })) }))), jsxRuntime.jsx(Footer, {})] })) })), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2 bunny-overflow-auto' : 'bunny-w-1/2 bunny-h-full', " bunny-items-center"), style: {
|
|
20748
20571
|
boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
|
|
20749
|
-
} }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true, className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" }, { children: jsxRuntime.jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment:
|
|
20572
|
+
} }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true, className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" }, { children: jsxRuntime.jsx(PaymentForms, { quote: isLoadingQuote ? undefined : quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction }) }))) }))] })));
|
|
20573
|
+
}
|
|
20574
|
+
var Text$d = antd.Typography.Text;
|
|
20575
|
+
var CheckoutSummaryDivider = function () {
|
|
20576
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20577
|
+
};
|
|
20578
|
+
var showSuccessNotification = common.useSuccessNotification();
|
|
20579
|
+
function CheckoutSummary(_a) {
|
|
20580
|
+
var quote = _a.quote, className = _a.className; _a.onAddCoupon; var priceListData = _a.priceListData; _a.isAddingCoupon;
|
|
20581
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className, " bunny-space-y-4") }, { children: [jsxRuntime.jsxs(Text$d, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-text-lg bunny-font-medium bunny-mb-4" }, { children: ["Checkout summary - ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.product.name, " ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.name] })), jsxRuntime.jsx("div", __assign({ className: "bunny-space-y-4" }, { children: quote === null || quote === void 0 ? void 0 : quote.quoteChanges.map(function (quoteChange) {
|
|
20582
|
+
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20583
|
+
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20584
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: charge.name }), jsxRuntime.jsx("div", { children: charge.quantity }), jsxRuntime.jsx("div", { children: common.formatCurrency(multiplier * charge.amount, charge.currencyId) })] }), charge.id));
|
|
20585
|
+
});
|
|
20586
|
+
}) })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-space-y-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Subtotal" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue, quote.currencyId) })] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Taxes" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.taxAmount, quote.currencyId) })] }))] })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Total" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue + quote.taxAmount, quote.currencyId) })] }))] }), false ] })));
|
|
20750
20587
|
}
|
|
20751
20588
|
|
|
20752
20589
|
var useQuoteSubscriptionUpgrade = function () {
|
|
@@ -20832,7 +20669,36 @@ var getSubscriptions = function (_a) {
|
|
|
20832
20669
|
};
|
|
20833
20670
|
|
|
20834
20671
|
var pageWrapperClassName = function (isMobile) {
|
|
20835
|
-
return "flex flex-col grow pt-4 ".concat(isMobile ?
|
|
20672
|
+
return "flex flex-col grow pt-4 ".concat(isMobile ? "pb-4 overflow-hidden" : "pb-8", " ").concat("content-container");
|
|
20673
|
+
};
|
|
20674
|
+
|
|
20675
|
+
var QUOTE_FIELDS = "quote {\n formattedQuote {\n html\n }\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\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 invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n ownerId\n periodAmount\n poNumber\n requiresApproval\n startDate\n state\n subtotal\n taxAmount\n updatedAt\n uuid\n amountsByPeriod {\n amount\n id\n name\n }\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n billingPeriodAmounts { id amount prorationRate }\n chargeType\n couponId\n createdAt\n currencyId\n discount\n endDate\n feature { id name code isUnit unitName }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n couponId\n price\n priceDecimals\n priceTiers { starts price }\n pricingModel\n prorationRate\n quantity\n quantityMax\n quantityMin\n startDate\n tieredAveragePrice\n updatedAt\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n }\n}";
|
|
20676
|
+
|
|
20677
|
+
var QUOTE_RECALCULATE_TAXES = "\n mutation QuoteRecalculateTaxes($id: ID!) {\n quoteRecalculateTaxes(id: $id) {\n ".concat(QUOTE_FIELDS, "\n errors\n }\n }\n");
|
|
20678
|
+
var quoteRecalculateTaxes = function (_a) {
|
|
20679
|
+
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
20680
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
20681
|
+
var vars, response, errors;
|
|
20682
|
+
var _b, _c;
|
|
20683
|
+
return __generator(this, function (_d) {
|
|
20684
|
+
switch (_d.label) {
|
|
20685
|
+
case 0:
|
|
20686
|
+
vars = { id: quoteId };
|
|
20687
|
+
return [4 /*yield*/, gqlRequest({
|
|
20688
|
+
query: QUOTE_RECALCULATE_TAXES,
|
|
20689
|
+
token: token,
|
|
20690
|
+
vars: vars,
|
|
20691
|
+
apiHost: apiHost,
|
|
20692
|
+
})];
|
|
20693
|
+
case 1:
|
|
20694
|
+
response = _d.sent();
|
|
20695
|
+
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20696
|
+
if (errors)
|
|
20697
|
+
throw errors;
|
|
20698
|
+
return [2 /*return*/, (_c = response.quoteRecalculateTaxes) === null || _c === void 0 ? void 0 : _c.quote];
|
|
20699
|
+
}
|
|
20700
|
+
});
|
|
20701
|
+
});
|
|
20836
20702
|
};
|
|
20837
20703
|
|
|
20838
20704
|
var MUTATION$2 = "{\n currentUser {\n taxationRequiredAccountFields\n }\n}";
|
|
@@ -20939,47 +20805,14 @@ var FormBillingState = function (_a) {
|
|
|
20939
20805
|
return (jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Billing state", name: "billingState", rules: [{ required: billingStateRequired }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "State" }) })));
|
|
20940
20806
|
};
|
|
20941
20807
|
|
|
20942
|
-
var showSuccessNotification = common.useSuccessNotification();
|
|
20943
20808
|
var QuoteCheckout = function (_a) {
|
|
20944
|
-
var
|
|
20945
|
-
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields, onRecalculateTaxes = _a.onRecalculateTaxes;
|
|
20809
|
+
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields;
|
|
20946
20810
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20947
20811
|
var token = useToken();
|
|
20948
20812
|
var isMobile = common.useIsMobile();
|
|
20949
|
-
var
|
|
20813
|
+
var _b = react.useState(false), isSaving = _b[0], setIsSaving = _b[1];
|
|
20950
20814
|
var paymentRequired = getQuoteAmountDue(quote) > 0;
|
|
20951
20815
|
var entityId = useCurrentUserData().entityId;
|
|
20952
|
-
var queryClient = reactQuery.useQueryClient();
|
|
20953
|
-
var _e = react.useState(''), couponCode = _e[0], setCouponCode = _e[1];
|
|
20954
|
-
var _f = useUpdateCoupons({
|
|
20955
|
-
apiHost: apiHost,
|
|
20956
|
-
token: token,
|
|
20957
|
-
quoteChangeId: (_b = quote.quoteChanges[quote.quoteChanges.length - 1]) === null || _b === void 0 ? void 0 : _b.id,
|
|
20958
|
-
onCouponAdded: function () {
|
|
20959
|
-
queryClient.invalidateQueries({
|
|
20960
|
-
queryKey: common.QueryKeyFactory.default.createObjectKey({
|
|
20961
|
-
id: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
20962
|
-
objectName: 'editingQuote',
|
|
20963
|
-
token: token,
|
|
20964
|
-
}),
|
|
20965
|
-
});
|
|
20966
|
-
showSuccessNotification('Coupon applied');
|
|
20967
|
-
onRecalculateTaxes();
|
|
20968
|
-
setCouponCode('');
|
|
20969
|
-
},
|
|
20970
|
-
onCouponRemoved: function () {
|
|
20971
|
-
queryClient.invalidateQueries({
|
|
20972
|
-
queryKey: common.QueryKeyFactory.default.createObjectKey({
|
|
20973
|
-
id: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
20974
|
-
objectName: 'editingQuote',
|
|
20975
|
-
token: token,
|
|
20976
|
-
}),
|
|
20977
|
-
});
|
|
20978
|
-
showSuccessNotification('Coupon removed');
|
|
20979
|
-
onRecalculateTaxes();
|
|
20980
|
-
},
|
|
20981
|
-
}), addCoupon = _f.addCoupon, removeCoupon = _f.removeCoupon, isAddingCoupon = _f.isAddingCoupon, isRemovingCoupon = _f.isRemovingCoupon, activeCouponsExist = _f.activeCouponsExist;
|
|
20982
|
-
var couponsOnQuote = (_c = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _c === void 0 ? void 0 : _c.flatMap(function (quoteChange) { var _a; return (_a = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges) === null || _a === void 0 ? void 0 : _a.filter(function (charge) { return charge.kind === 'COUPON'; }); });
|
|
20983
20816
|
var checkoutMutation = reactQuery.useMutation({
|
|
20984
20817
|
mutationFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
20985
20818
|
return __generator(this, function (_a) {
|
|
@@ -21009,15 +20842,7 @@ var QuoteCheckout = function (_a) {
|
|
|
21009
20842
|
}
|
|
21010
20843
|
if (taxationRequiredAccountFields)
|
|
21011
20844
|
return (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
21012
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.
|
|
21013
|
-
couponsOnQuote === null || couponsOnQuote === void 0 ? void 0 : couponsOnQuote.forEach(function (couponCharge) {
|
|
21014
|
-
var _a;
|
|
21015
|
-
var couponCode = (_a = couponCharge === null || couponCharge === void 0 ? void 0 : couponCharge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode;
|
|
21016
|
-
if (couponCode) {
|
|
21017
|
-
removeCoupon(couponCode);
|
|
21018
|
-
}
|
|
21019
|
-
});
|
|
21020
|
-
} }, { children: "Remove coupon(s)" })))] }))) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(isMobile ? 'bunny-shadow-padding-x' : '') }, { children: [jsxRuntime.jsx(antd.Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? 'Processing...' : 'Complete order' })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20845
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(isMobile ? 'bunny-shadow-padding-x' : '') }, { children: [jsxRuntime.jsx(antd.Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? 'Processing...' : 'Complete order' })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
21021
20846
|
};
|
|
21022
20847
|
var PaymentFormWrapper = function (_a) {
|
|
21023
20848
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
@@ -21034,10 +20859,10 @@ var PaymentFormWrapper = function (_a) {
|
|
|
21034
20859
|
var queryKeyFactory = common.QueryKeyFactory.default;
|
|
21035
20860
|
var Checkout = function (_a) {
|
|
21036
20861
|
var _b, _c;
|
|
21037
|
-
var onCancel = _a.onCancel, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, open = _a.open, quote = _a.quote, selectedPriceList = _a.selectedPriceList;
|
|
20862
|
+
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;
|
|
21038
20863
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
21039
20864
|
var isMobile = common.useIsMobile();
|
|
21040
|
-
var
|
|
20865
|
+
var entityId = useCurrentUserData().entityId;
|
|
21041
20866
|
var hasTaxPlugin = useHasTaxPlugin({
|
|
21042
20867
|
apiHost: apiHost,
|
|
21043
20868
|
token: token,
|
|
@@ -21058,8 +20883,12 @@ var Checkout = function (_a) {
|
|
|
21058
20883
|
},
|
|
21059
20884
|
enabled: Boolean(quote === null || quote === void 0 ? void 0 : quote.accountId) && ((taxationRequiredAccountFields === null || taxationRequiredAccountFields === void 0 ? void 0 : taxationRequiredAccountFields.length) || 0) > 0,
|
|
21060
20885
|
}), account = _e.data, isLoadingAccount = _e.isLoading;
|
|
21061
|
-
|
|
21062
|
-
|
|
20886
|
+
reactQuery.useQuery({
|
|
20887
|
+
queryKey: queryKeyFactory.createQuoteTaxCalculateKey({
|
|
20888
|
+
id: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
20889
|
+
token: token,
|
|
20890
|
+
}),
|
|
20891
|
+
queryFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
21063
20892
|
var updatedQuote, quoteKey, calculatedPricesKey;
|
|
21064
20893
|
return __generator(this, function (_a) {
|
|
21065
20894
|
switch (_a.label) {
|
|
@@ -21083,7 +20912,6 @@ var Checkout = function (_a) {
|
|
|
21083
20912
|
priceListId: selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id,
|
|
21084
20913
|
token: token,
|
|
21085
20914
|
});
|
|
21086
|
-
console.log('recalculateTaxes - updatedQuote', updatedQuote);
|
|
21087
20915
|
queryClient.setQueryData(quoteKey, updatedQuote);
|
|
21088
20916
|
queryClient.setQueryData(calculatedPricesKey, updatedQuote);
|
|
21089
20917
|
}
|
|
@@ -21091,21 +20919,13 @@ var Checkout = function (_a) {
|
|
|
21091
20919
|
case 2: return [2 /*return*/, {}];
|
|
21092
20920
|
}
|
|
21093
20921
|
});
|
|
21094
|
-
});
|
|
21095
|
-
}
|
|
21096
|
-
var recalculateTaxesEnabled = Boolean(quote) &&
|
|
21097
|
-
open &&
|
|
21098
|
-
hasTaxPlugin &&
|
|
21099
|
-
!taxationRequiredAccountFields &&
|
|
21100
|
-
!isLoadingTaxationRequiredAccountFields;
|
|
21101
|
-
reactQuery.useQuery({
|
|
21102
|
-
queryKey: queryKeyFactory.createQuoteTaxCalculateKey({
|
|
21103
|
-
id: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
21104
|
-
token: token,
|
|
21105
|
-
}),
|
|
21106
|
-
queryFn: recalculateTaxes,
|
|
20922
|
+
}); },
|
|
21107
20923
|
// Recalculate taxes if the quote is open, has a tax plugin, and the taxation required account fields are not required
|
|
21108
|
-
enabled:
|
|
20924
|
+
enabled: Boolean(quote) &&
|
|
20925
|
+
open &&
|
|
20926
|
+
hasTaxPlugin &&
|
|
20927
|
+
!taxationRequiredAccountFields &&
|
|
20928
|
+
!isLoadingTaxationRequiredAccountFields,
|
|
21109
20929
|
staleTime: 0,
|
|
21110
20930
|
});
|
|
21111
20931
|
if (!open || isLoadingTaxationRequiredAccountFields || isLoadingAccount)
|
|
@@ -21114,19 +20934,7 @@ var Checkout = function (_a) {
|
|
|
21114
20934
|
zIndex: 1001,
|
|
21115
20935
|
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-end bunny-w-full" }, { children: jsxRuntime.jsx(icons.CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ".concat(isMobile ? 'bunny-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)) && (jsxRuntime.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)) && (jsxRuntime.jsx(antd.Divider, { className: "bunny-h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full bunny-pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice }) }))) : quote ? (jsxRuntime.jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
21116
20936
|
onFail(error);
|
|
21117
|
-
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token
|
|
21118
|
-
return __generator(this, function (_a) {
|
|
21119
|
-
switch (_a.label) {
|
|
21120
|
-
case 0:
|
|
21121
|
-
if (!recalculateTaxesEnabled) return [3 /*break*/, 2];
|
|
21122
|
-
return [4 /*yield*/, recalculateTaxes()];
|
|
21123
|
-
case 1:
|
|
21124
|
-
_a.sent();
|
|
21125
|
-
_a.label = 2;
|
|
21126
|
-
case 2: return [2 /*return*/];
|
|
21127
|
-
}
|
|
21128
|
-
});
|
|
21129
|
-
}); } })) : (jsxRuntime.jsx(PaymentForm, { onFail: function (error) {
|
|
20937
|
+
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: function (error) {
|
|
21130
20938
|
onFail(error);
|
|
21131
20939
|
}, onPaymentSuccess: onSuccess }))] })), jsxRuntime.jsx(Footer, {})] })) })));
|
|
21132
20940
|
};
|
|
@@ -21502,11 +21310,11 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
21502
21310
|
return (jsxRuntime.jsx(CheckoutBarInput, { disabled: !chargeQuantity, charge: charge, quantity: chargeQuantity !== null && chargeQuantity !== void 0 ? chargeQuantity : 0, selectedPriceList: selectedPriceList, onQuantityChanged: function (quantity) {
|
|
21503
21311
|
onChangeQuantity(charge.id, quantity);
|
|
21504
21312
|
} }, index));
|
|
21505
|
-
}) })), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, upgradingSubscription: upgradingSubscription, quotePreviewData: quotePreviewData }), jsxRuntime.jsx(Checkout, { onCancel: function () { return setPayModalVisible(false); }, onFail: onCheckoutFail, onSuccess: handleCheckoutSuccess, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, storedPaymentMethod: defaultPaymentMethod, token: token })] })));
|
|
21313
|
+
}) })), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, upgradingSubscription: upgradingSubscription, quotePreviewData: quotePreviewData }), jsxRuntime.jsx(Checkout, { isMobile: isMobile, onCancel: function () { return setPayModalVisible(false); }, onFail: onCheckoutFail, onSuccess: handleCheckoutSuccess, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, storedPaymentMethod: defaultPaymentMethod, token: token })] })));
|
|
21506
21314
|
};
|
|
21507
21315
|
|
|
21508
21316
|
// WARNING: There is a preview button on APP that will need to be changed if this query is changed
|
|
21509
|
-
var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n plansToDisplay\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n
|
|
21317
|
+
var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n plansToDisplay\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n basePrice\n currencyId\n id\n monthlyBasePrice\n periodMonths\n plan {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n }\n product {\n id\n }\n charges {\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n feature {\n name\n unitName\n }\n }\n }\n }\n }";
|
|
21510
21318
|
var getPriceListChangeOptions = function (_a) {
|
|
21511
21319
|
var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription;
|
|
21512
21320
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -21610,30 +21418,10 @@ var PriceListCardTitle = function (_a) {
|
|
|
21610
21418
|
: " " }))), jsxRuntime.jsx("div", __assign({ className: "bunny-font-medium bunny-text-center ".concat(isMobile ? "bunny-text-slate-500" : "bunny-text-orange-600"), style: { fontSize: "20px" } }, { children: priceList.plan.name }))] })));
|
|
21611
21419
|
};
|
|
21612
21420
|
|
|
21613
|
-
var getPrice = function (priceList) {
|
|
21614
|
-
if (priceList.showPriceAsMonthly) {
|
|
21615
|
-
return priceList.monthlyBasePrice;
|
|
21616
|
-
}
|
|
21617
|
-
return priceList.basePrice;
|
|
21618
|
-
};
|
|
21619
|
-
var calculatePriceDecimals = function (priceList) {
|
|
21620
|
-
if (priceList.plan.pricingStyle === common.PricingStyle.PRICED) {
|
|
21621
|
-
var decimalPart = getPrice(priceList).toString().split('.')[1];
|
|
21622
|
-
if (!decimalPart)
|
|
21623
|
-
return 0;
|
|
21624
|
-
// If decimal part consists only of zeros, return 0
|
|
21625
|
-
if (parseInt(decimalPart) === 0) {
|
|
21626
|
-
return 0;
|
|
21627
|
-
}
|
|
21628
|
-
return undefined;
|
|
21629
|
-
}
|
|
21630
|
-
return 0;
|
|
21631
|
-
};
|
|
21632
21421
|
var PriceListCardPrice = function (_a) {
|
|
21633
21422
|
var priceList = _a.priceList;
|
|
21634
|
-
var priceDecimals = calculatePriceDecimals(priceList);
|
|
21635
21423
|
return (jsxRuntime.jsx("div", __assign({ className: "bunny-font-medium bunny-text-center bunny-text-gray-900", style: { fontSize: '32px' } }, { children: !priceList.plan.pricingStyle || priceList.plan.pricingStyle === common.PricingStyle.PRICED
|
|
21636
|
-
? common.formatCurrency(
|
|
21424
|
+
? common.formatCurrency(priceList.monthlyBasePrice, priceList.currencyId, 0)
|
|
21637
21425
|
: priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US
|
|
21638
21426
|
? ''
|
|
21639
21427
|
: 'Free' })));
|
|
@@ -21642,7 +21430,10 @@ var PriceListCardPrice = function (_a) {
|
|
|
21642
21430
|
var Text$c = antd.Typography.Text;
|
|
21643
21431
|
var PriceListCardDescription = function (_a) {
|
|
21644
21432
|
var description = _a.description;
|
|
21645
|
-
|
|
21433
|
+
var htmlParsedDescription = parse__default["default"](description || '');
|
|
21434
|
+
if (!description)
|
|
21435
|
+
return null;
|
|
21436
|
+
return jsxRuntime.jsx(Text$c, __assign({ className: "bunny-text-center" }, { children: htmlParsedDescription }));
|
|
21646
21437
|
};
|
|
21647
21438
|
|
|
21648
21439
|
var BillingPeriodConverter;
|
|
@@ -21669,9 +21460,7 @@ var PriceListCardPriceDescription = function (_a) {
|
|
|
21669
21460
|
fontSize: isMobile ? '13px' : '12px',
|
|
21670
21461
|
} }, { children: priceList.plan.pricingDescription && !isEmptyHtml(priceList.plan.pricingDescription) ? (jsxRuntime.jsx(interweave.Markup, { content: priceList.plan.pricingDescription })) : ("per ".concat((feature === null || feature === void 0 ? void 0 : feature.unitName) && !doesPlanHaveFlatFeeCharges
|
|
21671
21462
|
? "".concat(feature.unitName.toLowerCase(), " / ")
|
|
21672
|
-
: '').
|
|
21673
|
-
? 'month'
|
|
21674
|
-
: common.PERIOD_LABELS[periodMonthsConverter(priceList.periodMonths)])) })), priceList.periodMonths > 1 && (jsxRuntime.jsxs(Text$b, __assign({ className: "bunny-text-center bunny-text-gray-900", style: { fontSize: isMobile ? '12px' : '11px' } }, { children: ["billed ", BillingPeriodConverter$1[periodMonthsConverter(priceList.periodMonths)]] })))] }));
|
|
21463
|
+
: '', "month")) })), priceList.periodMonths > 1 && (jsxRuntime.jsxs(Text$b, __assign({ className: "bunny-text-center bunny-text-gray-900", style: { fontSize: isMobile ? '12px' : '11px' } }, { children: ["billed ", BillingPeriodConverter$1[periodMonthsConverter(priceList.periodMonths)]] })))] }));
|
|
21675
21464
|
};
|
|
21676
21465
|
|
|
21677
21466
|
var CheckIcon = function (_a) {
|
|
@@ -21709,11 +21498,11 @@ var PriceListCardMobile = function (_a) {
|
|
|
21709
21498
|
if (!disableOnClick)
|
|
21710
21499
|
onClick(priceList);
|
|
21711
21500
|
}, style: {
|
|
21712
|
-
minWidth:
|
|
21501
|
+
minWidth: "220px",
|
|
21713
21502
|
borderColor: isSelected ? brandColor : common.SLATE_200,
|
|
21714
21503
|
} }, { children: [isSelected && (jsxRuntime.jsx("div", __assign({ className: "bunny-absolute", style: {
|
|
21715
|
-
top:
|
|
21716
|
-
right:
|
|
21504
|
+
top: "10px",
|
|
21505
|
+
right: "10px",
|
|
21717
21506
|
} }, { children: jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "20px" }) }))), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-grow bunny-gap-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, priceList: priceList, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(PriceListCardPrice, { priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, priceList: priceList })] })), jsxRuntime.jsx(PriceListCardButton, { disableOnClick: disableOnClick, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, subscriptionPlan: subscriptionPlan })] }))] })));
|
|
21718
21507
|
};
|
|
21719
21508
|
|
|
@@ -22169,7 +21958,7 @@ var PlanManager = function (_a) {
|
|
|
22169
21958
|
var queryClient = reactQuery.useQueryClient();
|
|
22170
21959
|
var showSuccessNotification = common.useSuccessNotification();
|
|
22171
21960
|
var showInfoNotification = common.useInfoNotification();
|
|
22172
|
-
common.useIsMobile();
|
|
21961
|
+
var isMobile = common.useIsMobile();
|
|
22173
21962
|
var defaultPaymentMethod = usePaymentMethod({
|
|
22174
21963
|
token: token,
|
|
22175
21964
|
apiHost: apiHost,
|
|
@@ -22221,8 +22010,8 @@ var PlanManager = function (_a) {
|
|
|
22221
22010
|
}, []);
|
|
22222
22011
|
function handleSetEditingQuoteData(quoteId, isTrial) {
|
|
22223
22012
|
setEditingQuoteData({
|
|
22224
|
-
id: quoteId || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id)
|
|
22225
|
-
isTrial: isTrial || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
|
|
22013
|
+
id: quoteId || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
|
|
22014
|
+
isTrial: isTrial || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial),
|
|
22226
22015
|
});
|
|
22227
22016
|
}
|
|
22228
22017
|
// Handlers
|
|
@@ -22253,7 +22042,7 @@ var PlanManager = function (_a) {
|
|
|
22253
22042
|
return showInfoNotification('You are in preview mode');
|
|
22254
22043
|
setQuotePreviewData(undefined);
|
|
22255
22044
|
onChangePlanCancel();
|
|
22256
|
-
}, title: "Change plan" }), jsxRuntime.jsx(PlanPicker, {}), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, storedPaymentMethod: defaultPaymentMethod, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList }), jsxRuntime.jsx("div", { ref: stickyRef }), jsxRuntime.jsx("div", __assign({ className: "bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ".concat(isSticky ? 'bunny-mx-4' : 'bunny-mx-0') }, { children: jsxRuntime.jsx(PlanPickerCheckoutBarWrapper, { editingQuote: editingQuoteData, setEditingQuoteData: handleSetEditingQuoteData, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: function () { return onChangePlanCancel(); } }) }))] })));
|
|
22045
|
+
}, title: "Change plan" }), jsxRuntime.jsx(PlanPicker, {}), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile, storedPaymentMethod: defaultPaymentMethod, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList }), jsxRuntime.jsx("div", { ref: stickyRef }), jsxRuntime.jsx("div", __assign({ className: "bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ".concat(isSticky ? 'bunny-mx-4' : 'bunny-mx-0') }, { children: jsxRuntime.jsx(PlanPickerCheckoutBarWrapper, { editingQuote: editingQuoteData, setEditingQuoteData: handleSetEditingQuoteData, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: function () { return onChangePlanCancel(); } }) }))] })));
|
|
22257
22046
|
};
|
|
22258
22047
|
|
|
22259
22048
|
var useCancelSubscription = function () {
|
|
@@ -23277,7 +23066,7 @@ var Subscriptions = function (_a) {
|
|
|
23277
23066
|
setIsChangingPlan(false);
|
|
23278
23067
|
}, handlePortalErrors: handlePortalErrors }));
|
|
23279
23068
|
}
|
|
23280
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className) }, { children: [!hideTitle ? jsxRuntime.jsx(PageTitle, { title: 'Subscriptions' }) : null, jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideExpiredToggle && (jsxRuntime.jsxs(Text$1, __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: { minWidth: '120px' } }, { children: [hideExpired ? 'Active subscriptions' : 'All subscriptions', isMobile && expiredSwitchVisible && (jsxRuntime.jsx(HideExpiredToggle, { hideExpired: hideExpired, setHideExpired: setHideExpiredState }))] }))) }) }, { children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: !hideExpiredToggle && expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) })), jsxRuntime.jsx(SubscriptionsListContainer, { companyName: companyName, hideExpired: hideExpired, onCancelSubscriptionClick: onCancelSubscriptionClick, onChangePlanClick: onChangePlanClick, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsxRuntime.jsx("div", __assign({ className: "bunny-pt-4 bunny-pb-2" }, { children: jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), jsxRuntime.jsx(QuantityChangeDrawerDesktop, { editingQuote: quote, editingQuoteData: editingQuoteData, onClose: onClose, open: quantityDrawerOpen, openCheckout: function () { return setPayModalVisible(true); }, setEditingQuoteData: setEditingQuoteData, subscriptions: subscriptions }), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, storedPaymentMethod: defaultPaymentMethod })] })));
|
|
23069
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className) }, { children: [!hideTitle ? jsxRuntime.jsx(PageTitle, { title: 'Subscriptions' }) : null, jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideExpiredToggle && (jsxRuntime.jsxs(Text$1, __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: { minWidth: '120px' } }, { children: [hideExpired ? 'Active subscriptions' : 'All subscriptions', isMobile && expiredSwitchVisible && (jsxRuntime.jsx(HideExpiredToggle, { hideExpired: hideExpired, setHideExpired: setHideExpiredState }))] }))) }) }, { children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: !hideExpiredToggle && expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) })), jsxRuntime.jsx(SubscriptionsListContainer, { companyName: companyName, hideExpired: hideExpired, onCancelSubscriptionClick: onCancelSubscriptionClick, onChangePlanClick: onChangePlanClick, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsxRuntime.jsx("div", __assign({ className: "bunny-pt-4 bunny-pb-2" }, { children: jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), jsxRuntime.jsx(QuantityChangeDrawerDesktop, { editingQuote: quote, editingQuoteData: editingQuoteData, onClose: onClose, open: quantityDrawerOpen, openCheckout: function () { return setPayModalVisible(true); }, setEditingQuoteData: setEditingQuoteData, subscriptions: subscriptions }), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile, storedPaymentMethod: defaultPaymentMethod })] })));
|
|
23281
23070
|
};
|
|
23282
23071
|
var PageHeaderWithActions = function (_a) {
|
|
23283
23072
|
var children = _a.children, title = _a.title;
|