@bunnyapp/components 1.0.68-beta.9 → 1.0.68
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 +302 -444
- package/dist/cjs/src/components/Checkout/Checkout.d.ts +3 -1
- package/dist/cjs/src/components/Checkout/checkoutUtils.d.ts +1 -1
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- 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/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/contexts/PaymentContext.d.ts +1 -1
- 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 +3 -24
- package/dist/esm/index.js +287 -448
- package/dist/esm/src/components/Checkout/Checkout.d.ts +3 -1
- package/dist/esm/src/components/Checkout/checkoutUtils.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- 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/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/contexts/PaymentContext.d.ts +1 -1
- 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 +3 -24
- package/dist/index.d.ts +4 -3
- package/package.json +6 -4
- package/dist/cjs/src/components/Signup/CheckoutSummary.d.ts +0 -11
- package/dist/cjs/src/graphql/mutations/quoteChangeAddCoupon.d.ts +0 -8
- package/dist/cjs/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +0 -8
- package/dist/esm/src/components/Signup/CheckoutSummary.d.ts +0 -11
- package/dist/esm/src/graphql/mutations/quoteChangeAddCoupon.d.ts +0 -8
- package/dist/esm/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +0 -8
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-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.
|
|
177
|
+
var PACKAGE_VERSION = '1.0.67';
|
|
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
|
})];
|
|
@@ -389,19 +409,6 @@ function useToken() {
|
|
|
389
409
|
}
|
|
390
410
|
|
|
391
411
|
var LISENSE_KEY = 'eyJkYXRhIjoiZXlKMElqb2liM0puWVc1cGVtRjBhVzl1SWl3aVlYWjFJam94TnpneU5ETXhPVGs1TENKa2JTSTZJbUoxYm01NUxtTnZiU0lzSW00aU9pSmhOV1F5TWpKaFpXTTNOelF5TkdFNUlpd2laWGh3SWpveE56WTJORFEzT1RrNUxDSmtiWFFpT2lKM2FXeGtZMkZ5WkNKOSIsInNpZ25hdHVyZSI6ImdJWW5BYWp0WW1aSHV1b1RrTkZCZnRGYjEzUTJOZXZwQXlKRmszdy9STDNUa08rRXZYWlV0MDZxenBrZWdOK1A4TXlkbFY1aityemQvM1VpYlB5SW1VSzAweHZSVk5hS29EOXB0cVpkbjR5SWRRdE1pU1NjZ0J1K1RkM0NXM2FONVNrdlNJVDEyTGpBMnVVYll2RmJ6RFpMci9hODkwa05sT0NQZURoVjMyd0w3R0NrTnV2Z1MyZlk5Mis0L25FdUdvZXBZR0RPN0Ryb3NaOGVlbnJ6b1BsQ044T204eFlMNXJxdUkvS2xLVTVYaGN0allrdzBTR0FlL0pDR1dTN1dLTDAvYmFvbS9GS1ltNU91VmlzcmlDVlc2UXgvbzBnTGE4bUtXLytMb3pNaHdFemdtU2I2S0xERzZpTEVPL0czQ2pYN2p2dTU1NEc4OUx2aW1BaE5BQT09In0=';
|
|
392
|
-
// Custom zoom layout component that uses useZoomContext
|
|
393
|
-
var CustomZoomLayout = function () {
|
|
394
|
-
// Consume from the controller provider
|
|
395
|
-
var _a = react$1.useZoomContext(), currentZoom = _a.currentZoom, setZoomLevel = _a.setZoomLevel;
|
|
396
|
-
var mountTimeRef = react.useRef(Date.now());
|
|
397
|
-
// Set default zoom to 100% once the document is loaded
|
|
398
|
-
react.useEffect(function () {
|
|
399
|
-
if (currentZoom < 1 && Date.now() - mountTimeRef.current < 3000) {
|
|
400
|
-
setZoomLevel(100);
|
|
401
|
-
}
|
|
402
|
-
}, [currentZoom, setZoomLevel]);
|
|
403
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
404
|
-
};
|
|
405
412
|
var DocumentTemplatePreview = function (_a) {
|
|
406
413
|
var targetUrl = _a.targetUrl;
|
|
407
414
|
var _b = react.useState(null), pdfUrl = _b[0], setPdfUrl = _b[1];
|
|
@@ -449,13 +456,13 @@ var DocumentTemplatePreview = function (_a) {
|
|
|
449
456
|
if (!pdfUrl) {
|
|
450
457
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
451
458
|
}
|
|
452
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-rounded bunny-w-full bunny-overflow-hidden bunny-grow bunny-min-h-0" }, { children: jsxRuntime.jsx(react$1.RPConfig, __assign({ licenseKey: LISENSE_KEY }, { children: jsxRuntime.
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-rounded bunny-w-full bunny-overflow-hidden bunny-grow bunny-min-h-0" }, { children: jsxRuntime.jsx(react$1.RPConfig, __assign({ licenseKey: LISENSE_KEY }, { children: jsxRuntime.jsx(react$1.RPProvider, __assign({ src: pdfUrl }, { children: jsxRuntime.jsx(react$1.RPDefaultLayout, __assign({ style: {
|
|
460
|
+
width: '100%',
|
|
461
|
+
height: '100%',
|
|
462
|
+
}, slots: {
|
|
463
|
+
openFileTool: false,
|
|
464
|
+
downloadTool: false,
|
|
465
|
+
} }, { children: jsxRuntime.jsx(react$1.RPPages, {}) })) })) })) })));
|
|
459
466
|
};
|
|
460
467
|
|
|
461
468
|
var MarkupContainer = defaultStyled.div(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
|
|
@@ -524,41 +531,6 @@ function LegacyDocument(_a) {
|
|
|
524
531
|
}, title: "Invoice PDF", width: "100%" }));
|
|
525
532
|
}
|
|
526
533
|
|
|
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
534
|
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
535
|
var getPaymentMethods = function (_a) {
|
|
564
536
|
var apiHost = _a.apiHost, token = _a.token, accountId = _a.accountId;
|
|
@@ -598,15 +570,11 @@ var usePaymentMethod = function (_a) {
|
|
|
598
570
|
};
|
|
599
571
|
|
|
600
572
|
var filterPaymentPlugins = function (plugins) {
|
|
601
|
-
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) { var _a, _b; return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'payment' && ((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'valid'; });
|
|
602
|
-
};
|
|
603
|
-
var filterPaymentPluginsByEntity = function (plugins, selectedEntityId) {
|
|
604
573
|
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
605
|
-
var _a, _b;
|
|
606
|
-
return
|
|
607
|
-
|
|
608
|
-
((
|
|
609
|
-
((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
574
|
+
var _a, _b, _c, _d;
|
|
575
|
+
return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'payment' &&
|
|
576
|
+
((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'valid' &&
|
|
577
|
+
((_d = (_c = plugin.components) === null || _c === void 0 ? void 0 : _c.frontend) === null || _d === void 0 ? void 0 : _d.length);
|
|
610
578
|
});
|
|
611
579
|
};
|
|
612
580
|
var MUTATION$9 = "{\n paymentPlugins {\n enabled\n entities\n guid\n hidden\n id\n name\n status\n type\n webhookEnabled\n components\n }\n}";
|
|
@@ -635,18 +603,19 @@ var getPaymentPlugins = function (_a) {
|
|
|
635
603
|
});
|
|
636
604
|
};
|
|
637
605
|
var usePaymentPlugins = function (_a) {
|
|
638
|
-
var apiHost = _a.apiHost, token = _a.token
|
|
606
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
639
607
|
var _b = reactQuery.useQuery({
|
|
640
608
|
queryKey: ['paymentPlugins', token],
|
|
641
609
|
queryFn: function () { return getPaymentPlugins({ apiHost: apiHost, token: token }); },
|
|
642
610
|
staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
|
|
643
611
|
}), paymentPlugins = _b.data, isFetched = _b.isFetched;
|
|
644
612
|
var filteredPaymentPlugins = filterPaymentPlugins(paymentPlugins);
|
|
645
|
-
var
|
|
646
|
-
|
|
647
|
-
:
|
|
613
|
+
var paymentMethodAllowedPlugins = filteredPaymentPlugins === null || filteredPaymentPlugins === void 0 ? void 0 : filteredPaymentPlugins.filter(function (plugin) {
|
|
614
|
+
var _a, _b;
|
|
615
|
+
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'); });
|
|
616
|
+
});
|
|
648
617
|
return {
|
|
649
|
-
paymentPlugins:
|
|
618
|
+
paymentPlugins: paymentMethodAllowedPlugins,
|
|
650
619
|
isFetched: isFetched,
|
|
651
620
|
};
|
|
652
621
|
};
|
|
@@ -655,6 +624,41 @@ var getQuoteAmountDue = function (quote) {
|
|
|
655
624
|
return quote.amountDue || quote.amount;
|
|
656
625
|
};
|
|
657
626
|
|
|
627
|
+
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";
|
|
628
|
+
var checkout = function (_a) {
|
|
629
|
+
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
630
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
631
|
+
var mutationVars, response, errors;
|
|
632
|
+
return __generator(this, function (_b) {
|
|
633
|
+
switch (_b.label) {
|
|
634
|
+
case 0:
|
|
635
|
+
mutationVars = {
|
|
636
|
+
quoteId: quoteId,
|
|
637
|
+
invoiceId: invoiceId,
|
|
638
|
+
paymentMethodId: paymentMethodId,
|
|
639
|
+
};
|
|
640
|
+
if (paymentMethodData) {
|
|
641
|
+
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
642
|
+
}
|
|
643
|
+
return [4 /*yield*/, gqlRequest({
|
|
644
|
+
query: MUTATION$8,
|
|
645
|
+
token: token,
|
|
646
|
+
vars: mutationVars,
|
|
647
|
+
apiHost: apiHost,
|
|
648
|
+
})];
|
|
649
|
+
case 1:
|
|
650
|
+
response = _b.sent();
|
|
651
|
+
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
652
|
+
if (errors)
|
|
653
|
+
throw errors;
|
|
654
|
+
return [2 /*return*/, {
|
|
655
|
+
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
656
|
+
}];
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
};
|
|
661
|
+
|
|
658
662
|
function usePay$1(_a) {
|
|
659
663
|
var _this = this;
|
|
660
664
|
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice, storedPaymentMethod = _a.storedPaymentMethod, plugin = _a.plugin;
|
|
@@ -18755,7 +18759,7 @@ var DemoPayForm = function (_a) {
|
|
|
18755
18759
|
cvc: '',
|
|
18756
18760
|
}), cardDetails = _d[0], setCardDetails = _d[1];
|
|
18757
18761
|
var onSave = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
18758
|
-
var error_1
|
|
18762
|
+
var error_1;
|
|
18759
18763
|
return __generator(this, function (_a) {
|
|
18760
18764
|
switch (_a.label) {
|
|
18761
18765
|
case 0:
|
|
@@ -18771,12 +18775,7 @@ var DemoPayForm = function (_a) {
|
|
|
18771
18775
|
return [3 /*break*/, 3];
|
|
18772
18776
|
case 2:
|
|
18773
18777
|
error_1 = _a.sent();
|
|
18774
|
-
|
|
18775
|
-
response: {
|
|
18776
|
-
message: error_1.message,
|
|
18777
|
-
},
|
|
18778
|
-
};
|
|
18779
|
-
onFail(errorResponse);
|
|
18778
|
+
onFail(error_1);
|
|
18780
18779
|
return [3 /*break*/, 3];
|
|
18781
18780
|
case 3: return [2 /*return*/];
|
|
18782
18781
|
}
|
|
@@ -19089,7 +19088,7 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
|
|
|
19089
19088
|
var showErrorNotification$1 = common.useErrorNotification();
|
|
19090
19089
|
var PaymentForm = function (_a) {
|
|
19091
19090
|
var _b;
|
|
19092
|
-
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,
|
|
19091
|
+
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, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19093
19092
|
// Local state
|
|
19094
19093
|
var _c = react.useState(false), showPaymentMethodForm = _c[0], setShowPaymentMethodForm = _c[1];
|
|
19095
19094
|
// Simple hooks
|
|
@@ -19103,9 +19102,8 @@ var PaymentForm = function (_a) {
|
|
|
19103
19102
|
apiHost: apiHost,
|
|
19104
19103
|
}), storedPaymentMethods = _d.paymentMethods, defaultPaymentMethod = _d.defaultPaymentMethod, isPaymentMethodLoading = _d.isLoading;
|
|
19105
19104
|
// Complex hooks
|
|
19106
|
-
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost,
|
|
19105
|
+
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost, token: token }).paymentPlugins;
|
|
19107
19106
|
var selectedPaymentMethodPlugin = react.useMemo(function () {
|
|
19108
|
-
// TODO: consolate PluginData and PaymentPlugin into one type. Needs to be done on API side.
|
|
19109
19107
|
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
19108
|
}, [paymentPlugins, defaultPaymentMethod]);
|
|
19111
19109
|
// Derived state
|
|
@@ -19114,7 +19112,6 @@ var PaymentForm = function (_a) {
|
|
|
19114
19112
|
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
19115
19113
|
(invoice === null || invoice === void 0 ? void 0 : invoice.currencyId) ||
|
|
19116
19114
|
currencyIdFromProps)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
19117
|
-
var paymentRequired = quote ? getQuoteAmountDue(quote) > 0 : true;
|
|
19118
19115
|
// Custom hooks
|
|
19119
19116
|
var _e = useSetDefaultPaymentMethod(paymentPlugins || [], apiHost, token, accountId, function (message) {
|
|
19120
19117
|
showErrorNotification$1(message, 'Error setting default payment method');
|
|
@@ -19131,29 +19128,9 @@ var PaymentForm = function (_a) {
|
|
|
19131
19128
|
var _f = usePaymentMethodSelectorPlugin({
|
|
19132
19129
|
defaultPaymentMethod: defaultPaymentMethod,
|
|
19133
19130
|
defaultPaymentMethodPlugin: defaultPaymentMethodPlugin,
|
|
19134
|
-
paymentMethodAllowedPlugins: paymentPlugins
|
|
19131
|
+
paymentMethodAllowedPlugins: paymentPlugins,
|
|
19135
19132
|
}), selectorPaymentMethodPlugin = _f.selectorPaymentMethodPlugin, setSelectorPaymentMethodPlugin = _f.setSelectorPaymentMethodPlugin;
|
|
19136
19133
|
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
19134
|
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost, token, accountId, onRemovePaymentMethod, function (message) {
|
|
19158
19135
|
showErrorNotification$1(message, 'Error removing payment method');
|
|
19159
19136
|
});
|
|
@@ -19190,14 +19167,14 @@ var PaymentForm = function (_a) {
|
|
|
19190
19167
|
storedPaymentMethods: storedPaymentMethods,
|
|
19191
19168
|
defaultPaymentMethod: defaultPaymentMethod,
|
|
19192
19169
|
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
|
-
|
|
19170
|
+
} }, { 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: [
|
|
19171
|
+
{
|
|
19172
|
+
key: '1',
|
|
19173
|
+
showArrow: false,
|
|
19174
|
+
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,
|
|
19175
|
+
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 }) })))] }))),
|
|
19176
|
+
},
|
|
19177
|
+
] }), 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
19178
|
};
|
|
19202
19179
|
function StripeWrapper(_a) {
|
|
19203
19180
|
var children = _a.children, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost, currencyId = _a.currencyId, accountId = _a.accountId;
|
|
@@ -19205,15 +19182,6 @@ function StripeWrapper(_a) {
|
|
|
19205
19182
|
return (jsxRuntime.jsx(reactStripeJs.Elements, __assign({ options: options, stripe: stripe }, { children: children })));
|
|
19206
19183
|
}
|
|
19207
19184
|
|
|
19208
|
-
var useCurrentUserData = function () {
|
|
19209
|
-
var queryClient = reactQuery.useQueryClient();
|
|
19210
|
-
var token = useToken();
|
|
19211
|
-
var currentUser = queryClient.getQueryData(common.QueryKeyFactory.default.currentUserKey(token));
|
|
19212
|
-
if (!currentUser)
|
|
19213
|
-
return {};
|
|
19214
|
-
return currentUser;
|
|
19215
|
-
};
|
|
19216
|
-
|
|
19217
19185
|
function Invoice(_a) {
|
|
19218
19186
|
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? 'shadow-md' : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onInvoiceLoaded = _a.onInvoiceLoaded;
|
|
19219
19187
|
return (jsxRuntime.jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
@@ -19233,10 +19201,9 @@ function ActualInvoice() {
|
|
|
19233
19201
|
// Context
|
|
19234
19202
|
var queryClient = reactQuery.useQueryClient();
|
|
19235
19203
|
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;
|
|
19204
|
+
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired; _b.graphQLClient;
|
|
19237
19205
|
var _c = react.useContext(InvoiceQuoteContext), hideDownloadButton = _c.hideDownloadButton, onInvoiceLoaded = _c.onInvoiceLoaded;
|
|
19238
19206
|
var token = useToken();
|
|
19239
|
-
var entityId = useCurrentUserData().entityId;
|
|
19240
19207
|
// Hooks
|
|
19241
19208
|
var showSuccessNotification = common.useSuccessNotification();
|
|
19242
19209
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
@@ -19272,10 +19239,10 @@ function ActualInvoice() {
|
|
|
19272
19239
|
}, [formattedInvoice]);
|
|
19273
19240
|
if (!formattedInvoice)
|
|
19274
19241
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
19275
|
-
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, {
|
|
19242
|
+
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, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19276
19243
|
}
|
|
19277
19244
|
|
|
19278
|
-
var MUTATION$
|
|
19245
|
+
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
19246
|
var getFormattedQuote = function (_a) {
|
|
19280
19247
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
19281
19248
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -19283,7 +19250,7 @@ var getFormattedQuote = function (_a) {
|
|
|
19283
19250
|
return __generator(this, function (_b) {
|
|
19284
19251
|
switch (_b.label) {
|
|
19285
19252
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
19286
|
-
query: MUTATION$
|
|
19253
|
+
query: MUTATION$7(),
|
|
19287
19254
|
token: token,
|
|
19288
19255
|
apiHost: apiHost,
|
|
19289
19256
|
vars: { id: id },
|
|
@@ -19321,9 +19288,9 @@ var usePlugins = function (_a) {
|
|
|
19321
19288
|
return response;
|
|
19322
19289
|
};
|
|
19323
19290
|
var getPlugins = function (_a) {
|
|
19324
|
-
var token = _a.token, apiHost = _a.apiHost;
|
|
19291
|
+
var entityId = _a.entityId, token = _a.token, apiHost = _a.apiHost;
|
|
19325
19292
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19326
|
-
var response, plugins, error;
|
|
19293
|
+
var response, plugins, filteredPlugins, error;
|
|
19327
19294
|
return __generator(this, function (_b) {
|
|
19328
19295
|
switch (_b.label) {
|
|
19329
19296
|
case 0: return [4 /*yield*/, common.request({
|
|
@@ -19337,7 +19304,12 @@ var getPlugins = function (_a) {
|
|
|
19337
19304
|
return [4 /*yield*/, response.json()];
|
|
19338
19305
|
case 2:
|
|
19339
19306
|
plugins = _b.sent();
|
|
19340
|
-
|
|
19307
|
+
filteredPlugins = plugins.filter(function (plugin) {
|
|
19308
|
+
var _a, _b;
|
|
19309
|
+
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;
|
|
19310
|
+
return result;
|
|
19311
|
+
});
|
|
19312
|
+
return [2 /*return*/, filteredPlugins];
|
|
19341
19313
|
case 3: return [4 /*yield*/, response.json()];
|
|
19342
19314
|
case 4:
|
|
19343
19315
|
error = _b.sent();
|
|
@@ -19388,46 +19360,72 @@ var quoteAccept = function (_a) {
|
|
|
19388
19360
|
};
|
|
19389
19361
|
// export default quoteAccept;
|
|
19390
19362
|
var useSendAcceptQuote = function (_a) {
|
|
19391
|
-
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
19363
|
+
_a.onTokenExpired; var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
19392
19364
|
// Hooks
|
|
19393
19365
|
var graphQLMutation = common.useGraphQLmutation(function () {
|
|
19394
|
-
console.log(
|
|
19395
|
-
}, apiHost ||
|
|
19396
|
-
console.log(
|
|
19366
|
+
console.log("navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
19367
|
+
}, apiHost || "", function () {
|
|
19368
|
+
console.log("onError in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
19397
19369
|
});
|
|
19398
19370
|
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19399
19371
|
var queryClient = reactQuery.useQueryClient();
|
|
19400
|
-
var showInfoNotification = common.useInfoNotification();
|
|
19401
19372
|
// Local state
|
|
19402
19373
|
var _b = react.useState(false), acceptBoxVisible = _b[0], setAcceptBoxVisible = _b[1];
|
|
19403
19374
|
var _c = react.useState(false), isAccepting = _c[0], setIsAccepting = _c[1];
|
|
19404
19375
|
// Pandadoc polling modal state
|
|
19405
19376
|
var _d = react.useState(false), pandadocPollingModalVisible = _d[0], setPandadocPollingModalVisible = _d[1];
|
|
19406
19377
|
var redirectForSigning = function () {
|
|
19407
|
-
var mutation = "mutation quoteSigningUrlCreate($quoteId: ID) {\n quoteSigningUrlCreate(quoteId: $quoteId) {\n redirectUri\n pluginClientId\n pluginShortName\n
|
|
19378
|
+
var mutation = "mutation quoteSigningUrlCreate($quoteId: ID) {\n quoteSigningUrlCreate(quoteId: $quoteId) {\n redirectUri\n pluginClientId\n pluginShortName\n errors\n }\n }";
|
|
19408
19379
|
var variables = {
|
|
19409
19380
|
quoteId: quoteId,
|
|
19410
19381
|
};
|
|
19411
19382
|
graphQLMutation(mutation, variables, function (rsp) {
|
|
19412
19383
|
if (rsp.errors)
|
|
19413
|
-
console.log(
|
|
19384
|
+
console.log("rsp.errors", rsp.errors);
|
|
19414
19385
|
else {
|
|
19415
|
-
|
|
19416
|
-
|
|
19417
|
-
// If redirectUri exists, redirect the browser
|
|
19418
|
-
window.location.href = redirectUri;
|
|
19386
|
+
if (rsp.data.quoteSigningUrlCreate.pluginShortName === "dropbox_sign") {
|
|
19387
|
+
openDropboxSignModal(rsp.data.quoteSigningUrlCreate.pluginClientId, rsp.data.quoteSigningUrlCreate.redirectUri);
|
|
19419
19388
|
}
|
|
19420
|
-
else if (pluginShortName ===
|
|
19389
|
+
else if (rsp.data.quoteSigningUrlCreate.pluginShortName === "pandadoc") {
|
|
19421
19390
|
setPandadocPollingModalVisible(true);
|
|
19422
19391
|
}
|
|
19423
|
-
else
|
|
19424
|
-
|
|
19425
|
-
showInfoNotification(message, 'Signing Information');
|
|
19426
|
-
setIsAccepting(false);
|
|
19392
|
+
else {
|
|
19393
|
+
window.location.href = rsp.data.quoteSigningUrlCreate.redirectUri;
|
|
19427
19394
|
}
|
|
19428
19395
|
}
|
|
19429
19396
|
}, token);
|
|
19430
19397
|
};
|
|
19398
|
+
var openDropboxSignModal = function (clientId, url) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19399
|
+
var HelloSign, client;
|
|
19400
|
+
return __generator(this, function (_a) {
|
|
19401
|
+
switch (_a.label) {
|
|
19402
|
+
case 0:
|
|
19403
|
+
if (typeof window === "undefined") {
|
|
19404
|
+
return [2 /*return*/];
|
|
19405
|
+
}
|
|
19406
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('hellosign-embedded')); })];
|
|
19407
|
+
case 1:
|
|
19408
|
+
HelloSign = (_a.sent()).default;
|
|
19409
|
+
client = new HelloSign({
|
|
19410
|
+
clientId: clientId,
|
|
19411
|
+
});
|
|
19412
|
+
client.on("sign", function (data) {
|
|
19413
|
+
queryClient.refetchQueries({
|
|
19414
|
+
queryKey: common.QueryKeyFactory.default.createQuoteKey({
|
|
19415
|
+
id: quoteId,
|
|
19416
|
+
token: token,
|
|
19417
|
+
}),
|
|
19418
|
+
});
|
|
19419
|
+
});
|
|
19420
|
+
// Open the DropboxSign modal
|
|
19421
|
+
client.open(url, {
|
|
19422
|
+
clientId: clientId,
|
|
19423
|
+
skipDomainVerification: false, // Set true for development testing
|
|
19424
|
+
});
|
|
19425
|
+
return [2 /*return*/];
|
|
19426
|
+
}
|
|
19427
|
+
});
|
|
19428
|
+
}); };
|
|
19431
19429
|
var _e = reactQuery.useMutation({
|
|
19432
19430
|
mutationFn: function (changedFormItems) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19433
19431
|
return __generator(this, function (_a) {
|
|
@@ -19553,9 +19551,6 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19553
19551
|
var acceptBoxVisible = _a.acceptBoxVisible, formattedQuote = _a.formattedQuote, sendAccept = _a.sendAccept, setAcceptBoxVisible = _a.setAcceptBoxVisible, setIsAccepting = _a.setIsAccepting, isSendAcceptPending = _a.isSendAcceptPending;
|
|
19554
19552
|
// Refs
|
|
19555
19553
|
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
19554
|
// Hooks
|
|
19560
19555
|
var form = antd.Form.useForm()[0];
|
|
19561
19556
|
useFocusFirstInput({ firstInputRef: firstInputRef, isVisible: acceptBoxVisible });
|
|
@@ -19564,7 +19559,7 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19564
19559
|
var createRules = function (required, title) {
|
|
19565
19560
|
return required ? [{ required: true, message: "".concat(title, " is required") }] : [];
|
|
19566
19561
|
};
|
|
19567
|
-
return (jsxRuntime.jsx(StyledModal$1, __assign({ centered: true, okText: isSendAcceptPending ?
|
|
19562
|
+
return (jsxRuntime.jsx(StyledModal$1, __assign({ centered: true, okText: isSendAcceptPending ? "Accepting..." : "Accept", okButtonProps: {
|
|
19568
19563
|
loading: isSendAcceptPending,
|
|
19569
19564
|
disabled: isSendAcceptPending,
|
|
19570
19565
|
}, onCancel: function () {
|
|
@@ -19577,7 +19572,16 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19577
19572
|
sendAccept(changedFields);
|
|
19578
19573
|
})
|
|
19579
19574
|
.catch(function () { });
|
|
19580
|
-
}, open: acceptBoxVisible, title:
|
|
19575
|
+
}, 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, {}) })))] })) })));
|
|
19576
|
+
};
|
|
19577
|
+
|
|
19578
|
+
var useCurrentUserData = function () {
|
|
19579
|
+
var queryClient = reactQuery.useQueryClient();
|
|
19580
|
+
var token = useToken();
|
|
19581
|
+
var currentUser = queryClient.getQueryData(common.QueryKeyFactory.default.currentUserKey(token));
|
|
19582
|
+
if (!currentUser)
|
|
19583
|
+
return {};
|
|
19584
|
+
return currentUser;
|
|
19581
19585
|
};
|
|
19582
19586
|
|
|
19583
19587
|
var Title$2 = antd.Typography.Title;
|
|
@@ -19586,10 +19590,10 @@ var PaymentHoldModal = function (_a) {
|
|
|
19586
19590
|
var visible = _a.visible, setVisible = _a.setVisible, quote = _a.quote;
|
|
19587
19591
|
var queryClient = reactQuery.useQueryClient();
|
|
19588
19592
|
var token = useToken();
|
|
19589
|
-
var
|
|
19593
|
+
var account = useCurrentUserData().account;
|
|
19590
19594
|
return (jsxRuntime.jsxs(StyledModal$1, __assign({ centered: true, onCancel: function () {
|
|
19591
19595
|
setVisible(false);
|
|
19592
|
-
}, footer: null, open: visible, width: 600 }, { children: [jsxRuntime.jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsxRuntime.jsx("div", __assign({ className: "mb-4" }, { children: jsxRuntime.jsx(PaymentForm, {
|
|
19596
|
+
}, footer: null, open: visible, width: 600 }, { children: [jsxRuntime.jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsxRuntime.jsx("div", __assign({ className: "mb-4" }, { children: jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, quote: {
|
|
19593
19597
|
amount: quote.amount,
|
|
19594
19598
|
currencyId: quote.currency,
|
|
19595
19599
|
id: quote.quote.id,
|
|
@@ -19645,11 +19649,11 @@ function ActualQuote() {
|
|
|
19645
19649
|
var _this = this;
|
|
19646
19650
|
var _a, _b, _c, _d;
|
|
19647
19651
|
// Context
|
|
19648
|
-
var
|
|
19652
|
+
var _e = react.useContext(BunnyContext), apiHost = _e.apiHost, onTokenExpired = _e.onTokenExpired;
|
|
19649
19653
|
var token = useToken();
|
|
19650
|
-
var
|
|
19654
|
+
var _f = react.useContext(InvoiceQuoteContext), className = _f.className, id = _f.id, hideDownloadButton = _f.hideDownloadButton, onQuoteLoaded = _f.onQuoteLoaded;
|
|
19651
19655
|
// Queries
|
|
19652
|
-
var
|
|
19656
|
+
var _g = reactQuery.useQuery({
|
|
19653
19657
|
queryKey: common.QueryKeyFactory.default.createQuoteKey({ id: id, token: token }),
|
|
19654
19658
|
queryFn: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
19655
19659
|
var error_1;
|
|
@@ -19668,14 +19672,15 @@ function ActualQuote() {
|
|
|
19668
19672
|
});
|
|
19669
19673
|
}); },
|
|
19670
19674
|
placeholderData: reactQuery.keepPreviousData,
|
|
19671
|
-
}), data =
|
|
19675
|
+
}), data = _g.data, isLoading = _g.isLoading;
|
|
19672
19676
|
var formattedQuote = data;
|
|
19673
19677
|
// Hooks
|
|
19674
|
-
var
|
|
19678
|
+
var _h = useSendAcceptQuote({
|
|
19675
19679
|
token: token,
|
|
19680
|
+
onTokenExpired: onTokenExpired,
|
|
19676
19681
|
apiHost: apiHost,
|
|
19677
19682
|
quoteId: id,
|
|
19678
|
-
}), acceptBoxVisible =
|
|
19683
|
+
}), 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
19684
|
useSigningComplete({ data: formattedQuote, token: token });
|
|
19680
19685
|
var isMobile = common.useIsMobile();
|
|
19681
19686
|
var showErrorNotification = common.useErrorNotification();
|
|
@@ -19685,7 +19690,7 @@ function ActualQuote() {
|
|
|
19685
19690
|
}
|
|
19686
19691
|
}, [formattedQuote]);
|
|
19687
19692
|
// Payment hold stuff here
|
|
19688
|
-
var
|
|
19693
|
+
var _j = useQuotePaymentHold(formattedQuote), paymentHoldModalVisible = _j.paymentHoldModalVisible, setPaymentHoldModalVisible = _j.setPaymentHoldModalVisible, shouldDoPaymentHold = _j.shouldDoPaymentHold, paymentHoldCompleted = _j.paymentHoldCompleted, paymentHold = _j.paymentHold;
|
|
19689
19694
|
var handleClickAccept = function () {
|
|
19690
19695
|
if (shouldDoPaymentHold && !paymentHoldCompleted) {
|
|
19691
19696
|
setPaymentHoldModalVisible(true);
|
|
@@ -19717,14 +19722,9 @@ function QuoteButtons(_a) {
|
|
|
19717
19722
|
var entityBranding = react.useContext(BrandContext);
|
|
19718
19723
|
var downloadFile = useDownloadFile(id);
|
|
19719
19724
|
var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
|
|
19720
|
-
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19721
19725
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
19722
19726
|
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 }))] })))] })));
|
|
19727
|
+
} }, { 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
19728
|
}
|
|
19729
19729
|
function PaymentHoldDisplay(_a) {
|
|
19730
19730
|
var _b, _c, _d, _e;
|
|
@@ -20189,9 +20189,9 @@ function QuotesWrapper() {
|
|
|
20189
20189
|
return (jsxRuntime.jsx(TransactionsDisplay, { transactions: quotesAsTransactions, onSearchValueChanged: setSearch, search: search }));
|
|
20190
20190
|
}
|
|
20191
20191
|
|
|
20192
|
-
var MUTATION$
|
|
20192
|
+
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
20193
|
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;
|
|
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, entityId = _a.entityId;
|
|
20195
20195
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20196
20196
|
var vars, response, errors;
|
|
20197
20197
|
var _b;
|
|
@@ -20205,9 +20205,10 @@ var accountSignup = function (_a) {
|
|
|
20205
20205
|
pluginId: pluginId,
|
|
20206
20206
|
paymentMethodId: paymentMethodId,
|
|
20207
20207
|
priceListCode: priceListCode,
|
|
20208
|
+
entityId: entityId,
|
|
20208
20209
|
};
|
|
20209
20210
|
return [4 /*yield*/, gqlRequest({
|
|
20210
|
-
query: MUTATION$
|
|
20211
|
+
query: MUTATION$6(),
|
|
20211
20212
|
token: token,
|
|
20212
20213
|
vars: vars,
|
|
20213
20214
|
apiHost: apiHost,
|
|
@@ -20223,9 +20224,9 @@ var accountSignup = function (_a) {
|
|
|
20223
20224
|
});
|
|
20224
20225
|
};
|
|
20225
20226
|
|
|
20226
|
-
var MUTATION$
|
|
20227
|
+
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
20228
|
var quoteAccountSignup = function (_a) {
|
|
20228
|
-
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact,
|
|
20229
|
+
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact, entityId = _a.entityId;
|
|
20229
20230
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20230
20231
|
var vars, response, errors;
|
|
20231
20232
|
var _b;
|
|
@@ -20236,10 +20237,10 @@ var quoteAccountSignup = function (_a) {
|
|
|
20236
20237
|
priceListCode: priceListCode,
|
|
20237
20238
|
accountName: accountName,
|
|
20238
20239
|
billingContact: billingContact,
|
|
20239
|
-
|
|
20240
|
+
entityId: entityId,
|
|
20240
20241
|
};
|
|
20241
20242
|
return [4 /*yield*/, gqlRequest({
|
|
20242
|
-
query: MUTATION$
|
|
20243
|
+
query: MUTATION$5(),
|
|
20243
20244
|
token: token,
|
|
20244
20245
|
vars: vars,
|
|
20245
20246
|
apiHost: apiHost,
|
|
@@ -20255,44 +20256,17 @@ var quoteAccountSignup = function (_a) {
|
|
|
20255
20256
|
});
|
|
20256
20257
|
};
|
|
20257
20258
|
|
|
20258
|
-
var MUTATION$
|
|
20259
|
-
var
|
|
20260
|
-
var
|
|
20261
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
20262
|
-
var vars, response, errors;
|
|
20263
|
-
var _b;
|
|
20264
|
-
return __generator(this, function (_c) {
|
|
20265
|
-
switch (_c.label) {
|
|
20266
|
-
case 0:
|
|
20267
|
-
vars = { couponCode: couponCode, quoteChangeId: quoteChangeId };
|
|
20268
|
-
return [4 /*yield*/, common.gqlRequest({
|
|
20269
|
-
query: MUTATION$5,
|
|
20270
|
-
token: token,
|
|
20271
|
-
vars: vars,
|
|
20272
|
-
apiHost: apiHost,
|
|
20273
|
-
})];
|
|
20274
|
-
case 1:
|
|
20275
|
-
response = _c.sent();
|
|
20276
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteAddCoupon) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20277
|
-
if (errors)
|
|
20278
|
-
throw errors;
|
|
20279
|
-
return [2 /*return*/, response.quote];
|
|
20280
|
-
}
|
|
20281
|
-
});
|
|
20282
|
-
});
|
|
20283
|
-
};
|
|
20284
|
-
|
|
20285
|
-
var MUTATION$4 = "mutation quoteChangeRemoveCoupon($quoteChangeId: ID!, $couponCode: String!) {\n quoteChangeRemoveCoupon(quoteChangeId: $quoteChangeId, couponCode: $couponCode) {\n errors\n }\n}\n";
|
|
20286
|
-
var quoteChangeRemoveCoupon = function (_a) {
|
|
20287
|
-
var quoteChangeId = _a.quoteChangeId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20259
|
+
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}";
|
|
20260
|
+
var quoteAddCoupon = function (_a) {
|
|
20261
|
+
var quoteId = _a.quoteId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20288
20262
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20289
20263
|
var vars, response, errors;
|
|
20290
20264
|
var _b;
|
|
20291
20265
|
return __generator(this, function (_c) {
|
|
20292
20266
|
switch (_c.label) {
|
|
20293
20267
|
case 0:
|
|
20294
|
-
vars = {
|
|
20295
|
-
return [4 /*yield*/,
|
|
20268
|
+
vars = { quoteId: quoteId, couponCode: couponCode };
|
|
20269
|
+
return [4 /*yield*/, gqlRequest({
|
|
20296
20270
|
query: MUTATION$4,
|
|
20297
20271
|
token: token,
|
|
20298
20272
|
vars: vars,
|
|
@@ -20300,7 +20274,7 @@ var quoteChangeRemoveCoupon = function (_a) {
|
|
|
20300
20274
|
})];
|
|
20301
20275
|
case 1:
|
|
20302
20276
|
response = _c.sent();
|
|
20303
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.
|
|
20277
|
+
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteAddCoupon) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20304
20278
|
if (errors)
|
|
20305
20279
|
throw errors;
|
|
20306
20280
|
return [2 /*return*/, response.quote];
|
|
@@ -20309,33 +20283,6 @@ var quoteChangeRemoveCoupon = function (_a) {
|
|
|
20309
20283
|
});
|
|
20310
20284
|
};
|
|
20311
20285
|
|
|
20312
|
-
var QUOTE_RECALCULATE_TAXES = "\n mutation QuoteRecalculateTaxes($id: ID!) {\n quoteRecalculateTaxes(id: $id) {\n quote {\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 subtotal\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 coupon {\n couponCode\n }\n quantity\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n }\n }\n errors\n }\n }\n";
|
|
20313
|
-
var quoteRecalculateTaxes = function (_a) {
|
|
20314
|
-
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
20315
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
20316
|
-
var vars, response, errors;
|
|
20317
|
-
var _b, _c;
|
|
20318
|
-
return __generator(this, function (_d) {
|
|
20319
|
-
switch (_d.label) {
|
|
20320
|
-
case 0:
|
|
20321
|
-
vars = { id: quoteId };
|
|
20322
|
-
return [4 /*yield*/, common.gqlRequest({
|
|
20323
|
-
query: QUOTE_RECALCULATE_TAXES,
|
|
20324
|
-
token: token,
|
|
20325
|
-
vars: vars,
|
|
20326
|
-
apiHost: apiHost,
|
|
20327
|
-
})];
|
|
20328
|
-
case 1:
|
|
20329
|
-
response = _d.sent();
|
|
20330
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20331
|
-
if (errors)
|
|
20332
|
-
throw errors;
|
|
20333
|
-
return [2 /*return*/, (_c = response.quoteRecalculateTaxes) === null || _c === void 0 ? void 0 : _c.quote];
|
|
20334
|
-
}
|
|
20335
|
-
});
|
|
20336
|
-
});
|
|
20337
|
-
};
|
|
20338
|
-
|
|
20339
20286
|
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}"; };
|
|
20340
20287
|
var getPriceList = function (_a) {
|
|
20341
20288
|
var token = _a.token, code = _a.code, apiHost = _a.apiHost;
|
|
@@ -20357,7 +20304,7 @@ var getPriceList = function (_a) {
|
|
|
20357
20304
|
});
|
|
20358
20305
|
};
|
|
20359
20306
|
|
|
20360
|
-
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
|
|
20307
|
+
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 }"); };
|
|
20361
20308
|
var getQuote = function (_a) {
|
|
20362
20309
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
20363
20310
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -20399,89 +20346,43 @@ var StyedLink = styled__default["default"].a(templateObject_1$6 || (templateObje
|
|
|
20399
20346
|
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);
|
|
20400
20347
|
var templateObject_1$6, templateObject_2$1;
|
|
20401
20348
|
|
|
20402
|
-
function CouponEditor(_a) {
|
|
20403
|
-
var className = _a.className, onAddCoupon = _a.onAddCoupon, isAddingCoupon = _a.isAddingCoupon;
|
|
20404
|
-
// Local state
|
|
20405
|
-
var _b = react.useState(''), couponCode = _b[0], setCouponCode = _b[1];
|
|
20406
|
-
function handleAddCoupon() {
|
|
20407
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
20408
|
-
return __generator(this, function (_a) {
|
|
20409
|
-
onAddCoupon(couponCode);
|
|
20410
|
-
setCouponCode('');
|
|
20411
|
-
return [2 /*return*/];
|
|
20412
|
-
});
|
|
20413
|
-
});
|
|
20414
|
-
}
|
|
20415
|
-
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 }), jsxRuntime.jsx(antd.Button, __assign({ loading: isAddingCoupon, type: "primary", onClick: handleAddCoupon }, { children: "Apply" }))] })) })));
|
|
20416
|
-
}
|
|
20417
|
-
|
|
20418
|
-
var Text$f = antd.Typography.Text;
|
|
20419
|
-
function CheckoutSummary(_a) {
|
|
20420
|
-
var quote = _a.quote, className = _a.className, onAddCoupon = _a.onAddCoupon, onRemoveCoupon = _a.onRemoveCoupon, isRemovingCoupon = _a.isRemovingCoupon, priceListData = _a.priceListData, isAddingCoupon = _a.isAddingCoupon;
|
|
20421
|
-
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) {
|
|
20422
|
-
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20423
|
-
var _a;
|
|
20424
|
-
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20425
|
-
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 () {
|
|
20426
|
-
var _a, _b;
|
|
20427
|
-
if (isRemovingCoupon) {
|
|
20428
|
-
return;
|
|
20429
|
-
}
|
|
20430
|
-
if (!((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode)) {
|
|
20431
|
-
throw new Error('Coupon code not found');
|
|
20432
|
-
}
|
|
20433
|
-
onRemoveCoupon((_b = charge.coupon) === null || _b === void 0 ? void 0 : _b.couponCode);
|
|
20434
|
-
}, 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));
|
|
20435
|
-
});
|
|
20436
|
-
}) })), 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) })] }))] }), jsxRuntime.jsx(CouponEditor, { className: "bunny-w-full", quote: quote, onAddCoupon: onAddCoupon, isAddingCoupon: isAddingCoupon })] })));
|
|
20437
|
-
}
|
|
20438
|
-
var CheckoutSummaryDivider = function () {
|
|
20439
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20440
|
-
};
|
|
20441
|
-
|
|
20442
20349
|
var Title$1 = antd.Typography.Title;
|
|
20443
20350
|
function PaymentForms(_a) {
|
|
20444
20351
|
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;
|
|
20445
|
-
var
|
|
20446
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Payment" })), jsxRuntime.jsx(PaymentForm, {
|
|
20352
|
+
var account = useCurrentUserData().account;
|
|
20353
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Payment" })), jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction })] })) : null })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Signup" })), jsxRuntime.jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment })] })) }));
|
|
20447
20354
|
}
|
|
20448
20355
|
function InitialSignupForm(_a) {
|
|
20449
20356
|
var className = _a.className, onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
20450
20357
|
var form = antd.Form.useForm()[0];
|
|
20451
|
-
var isMobile = common.useIsMobile();
|
|
20452
20358
|
function handleSubmit() {
|
|
20453
20359
|
form.validateFields({ validateOnly: false }).then(function () {
|
|
20454
20360
|
onSubmit(form.getFieldsValue());
|
|
20455
20361
|
});
|
|
20456
20362
|
}
|
|
20457
|
-
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.
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
var _a, _b;
|
|
20462
|
-
return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '').toLowerCase().includes(input.toLowerCase()) ||
|
|
20463
|
-
((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : '').toLowerCase().includes(input.toLowerCase());
|
|
20464
|
-
} }) })) })) })), 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" })) })] })) })));
|
|
20363
|
+
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: [
|
|
20364
|
+
{ required: true, message: 'Email is required' },
|
|
20365
|
+
{ type: 'email', message: 'Please enter a valid email' },
|
|
20366
|
+
] }, { 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" })) })] })) })));
|
|
20465
20367
|
}
|
|
20466
20368
|
|
|
20467
|
-
var Title = antd.Typography.Title, Text$
|
|
20369
|
+
var Title = antd.Typography.Title, Text$f = antd.Typography.Text;
|
|
20468
20370
|
function PaymentSuccessDisplay(_a) {
|
|
20469
20371
|
var amountPaid = _a.amountPaid, className = _a.className, companyName = _a.companyName, returnUrl = _a.returnUrl, style = _a.style, currencyId = _a.currencyId;
|
|
20470
|
-
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$
|
|
20372
|
+
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] })))] })));
|
|
20471
20373
|
}
|
|
20472
20374
|
|
|
20473
|
-
var Text$
|
|
20375
|
+
var Text$e = antd.Typography.Text;
|
|
20474
20376
|
function PriceListDisplay(_a) {
|
|
20475
20377
|
var priceListData = _a.priceListData;
|
|
20476
20378
|
if (!priceListData)
|
|
20477
20379
|
return null;
|
|
20478
|
-
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$
|
|
20380
|
+
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] })));
|
|
20479
20381
|
}
|
|
20480
20382
|
|
|
20481
20383
|
var showErrorNotification = common.useErrorNotification();
|
|
20482
|
-
var showSuccessNotification = common.useSuccessNotification();
|
|
20483
20384
|
function Signup(_a) {
|
|
20484
|
-
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;
|
|
20385
|
+
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;
|
|
20485
20386
|
// Hooks
|
|
20486
20387
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20487
20388
|
var tokenFromContexts = useToken();
|
|
@@ -20491,7 +20392,8 @@ function Signup(_a) {
|
|
|
20491
20392
|
var _d = react.useState(undefined), accountId = _d[0], setAccountId = _d[1];
|
|
20492
20393
|
var _e = react.useState(undefined), portalSessionToken = _e[0], setPortalSessionToken = _e[1];
|
|
20493
20394
|
var token = portalSessionToken || tokenFromContexts;
|
|
20494
|
-
var _f = react.useState(false),
|
|
20395
|
+
var _f = react.useState(false), proceedingToPayment = _f[0], setProceedingToPayment = _f[1];
|
|
20396
|
+
var _g = react.useState(false), purchaseSucceeded = _g[0], setPurchaseSucceeded = _g[1];
|
|
20495
20397
|
var defaultCouponAppliedRef = react.useRef(undefined);
|
|
20496
20398
|
var defaultPaymentMethod = usePaymentMethod({
|
|
20497
20399
|
accountId: accountId,
|
|
@@ -20499,71 +20401,6 @@ function Signup(_a) {
|
|
|
20499
20401
|
apiHost: apiHost,
|
|
20500
20402
|
}).defaultPaymentMethod;
|
|
20501
20403
|
var queryClient = reactQuery.useQueryClient();
|
|
20502
|
-
var recalculateTaxes = reactQuery.useMutation({
|
|
20503
|
-
mutationFn: function () {
|
|
20504
|
-
if (!(quote === null || quote === void 0 ? void 0 : quote.id)) {
|
|
20505
|
-
throw new Error('Quote ID is required');
|
|
20506
|
-
}
|
|
20507
|
-
return quoteRecalculateTaxes({ token: token, apiHost: apiHost, quoteId: quote.id });
|
|
20508
|
-
},
|
|
20509
|
-
onError: function (error) {
|
|
20510
|
-
if (!error[0].message.includes('Ensure that you have a taxation plugin')) {
|
|
20511
|
-
showErrorNotification(error.message);
|
|
20512
|
-
}
|
|
20513
|
-
},
|
|
20514
|
-
onSuccess: function (quote) {
|
|
20515
|
-
queryClient.setQueryData(['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id], quote);
|
|
20516
|
-
queryClient.invalidateQueries({
|
|
20517
|
-
queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
|
|
20518
|
-
});
|
|
20519
|
-
},
|
|
20520
|
-
}).mutate;
|
|
20521
|
-
var _g = reactQuery.useMutation({
|
|
20522
|
-
mutationFn: function (formData) {
|
|
20523
|
-
return quoteAccountSignup({
|
|
20524
|
-
token: token,
|
|
20525
|
-
apiHost: apiHost,
|
|
20526
|
-
priceListCode: priceListCode,
|
|
20527
|
-
accountName: formData.accountName,
|
|
20528
|
-
billingContact: {
|
|
20529
|
-
firstName: formData.firstName,
|
|
20530
|
-
lastName: formData.lastName,
|
|
20531
|
-
email: formData.email,
|
|
20532
|
-
},
|
|
20533
|
-
billingDetails: {
|
|
20534
|
-
billingCountry: formData.billingCountry,
|
|
20535
|
-
// TODO: add these billing details back for Avalara and AFC taxation plugins.
|
|
20536
|
-
// billingState: formData.billingState,
|
|
20537
|
-
// billingCity: formData.billingCity,
|
|
20538
|
-
// billingZip: formData.billingZip,
|
|
20539
|
-
// billingStreet: formData.billingStreet,
|
|
20540
|
-
// taxNumber: formData.taxNumber,
|
|
20541
|
-
},
|
|
20542
|
-
});
|
|
20543
|
-
},
|
|
20544
|
-
onSuccess: function (data) {
|
|
20545
|
-
setAccountId(data.account.id);
|
|
20546
|
-
setPortalSessionToken(data.portalSessionToken);
|
|
20547
|
-
// We must invalidate the accountPaymentMethodKey query in order to clear payment methods from the provided api token,
|
|
20548
|
-
// to instead use paymentMethods from portalSessionToken.
|
|
20549
|
-
queryClient.invalidateQueries({
|
|
20550
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
20551
|
-
accountId: accountId,
|
|
20552
|
-
token: token,
|
|
20553
|
-
}),
|
|
20554
|
-
});
|
|
20555
|
-
setInitialQuote(data.quote);
|
|
20556
|
-
},
|
|
20557
|
-
onError: function (error) {
|
|
20558
|
-
var errorMessage = error.response.errors[0].message;
|
|
20559
|
-
if (errorMessage.includes("Address couldn't be validated")) {
|
|
20560
|
-
showErrorNotification('Please enter a valid billing address');
|
|
20561
|
-
}
|
|
20562
|
-
else {
|
|
20563
|
-
showErrorNotification(errorMessage);
|
|
20564
|
-
}
|
|
20565
|
-
},
|
|
20566
|
-
}), quoteAccountSignupMutate = _g.mutate, isSigningUp = _g.isPending;
|
|
20567
20404
|
// Queries
|
|
20568
20405
|
var _h = reactQuery.useQuery({
|
|
20569
20406
|
queryKey: ['priceList', priceListCode],
|
|
@@ -20582,63 +20419,30 @@ function Signup(_a) {
|
|
|
20582
20419
|
var quote = data || initialQuote;
|
|
20583
20420
|
var _k = reactQuery.useMutation({
|
|
20584
20421
|
mutationFn: function (couponCode) {
|
|
20585
|
-
var _a;
|
|
20586
20422
|
if (!quote) {
|
|
20587
20423
|
throw new Error('Quote is required');
|
|
20588
20424
|
}
|
|
20589
20425
|
if (!token) {
|
|
20590
20426
|
throw new Error('Token is required');
|
|
20591
20427
|
}
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
}
|
|
20595
|
-
return quoteChangeAddCoupon({
|
|
20596
|
-
quoteChangeId: quote.quoteChanges[0].id,
|
|
20428
|
+
return quoteAddCoupon({
|
|
20429
|
+
quoteId: quote.id,
|
|
20597
20430
|
couponCode: couponCode,
|
|
20598
20431
|
apiHost: apiHost,
|
|
20599
20432
|
token: token,
|
|
20600
20433
|
});
|
|
20601
20434
|
},
|
|
20602
20435
|
onSuccess: function () {
|
|
20603
|
-
queryClient.
|
|
20436
|
+
queryClient.refetchQueries({
|
|
20604
20437
|
queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
|
|
20605
20438
|
});
|
|
20606
20439
|
showSuccessNotification('Coupon applied');
|
|
20607
|
-
recalculateTaxes();
|
|
20608
20440
|
},
|
|
20609
20441
|
onError: function (error) {
|
|
20610
20442
|
var _a, _b;
|
|
20611
20443
|
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');
|
|
20612
20444
|
},
|
|
20613
20445
|
}), addCoupon = _k.mutate, isAddingCoupon = _k.isPending;
|
|
20614
|
-
var _l = reactQuery.useMutation({
|
|
20615
|
-
mutationFn: function (couponCode) {
|
|
20616
|
-
var _a;
|
|
20617
|
-
if (!quote) {
|
|
20618
|
-
throw new Error('Quote is required');
|
|
20619
|
-
}
|
|
20620
|
-
if (!((_a = quote.quoteChanges[0]) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
20621
|
-
throw new Error('Quote change ID is required');
|
|
20622
|
-
}
|
|
20623
|
-
return quoteChangeRemoveCoupon({
|
|
20624
|
-
quoteChangeId: quote.quoteChanges[0].id,
|
|
20625
|
-
couponCode: couponCode,
|
|
20626
|
-
apiHost: apiHost,
|
|
20627
|
-
token: token,
|
|
20628
|
-
});
|
|
20629
|
-
},
|
|
20630
|
-
onSuccess: function () {
|
|
20631
|
-
showSuccessNotification('Coupon removed');
|
|
20632
|
-
recalculateTaxes();
|
|
20633
|
-
queryClient.invalidateQueries({
|
|
20634
|
-
queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
|
|
20635
|
-
});
|
|
20636
|
-
},
|
|
20637
|
-
onError: function (error) {
|
|
20638
|
-
var _a, _b;
|
|
20639
|
-
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 removing coupon');
|
|
20640
|
-
},
|
|
20641
|
-
}), removeCoupon = _l.mutate, isRemovingCoupon = _l.isPending;
|
|
20642
20446
|
// Handle default coupon application
|
|
20643
20447
|
react.useEffect(function () {
|
|
20644
20448
|
if (couponCode && (quote === null || quote === void 0 ? void 0 : quote.id) && defaultCouponAppliedRef.current !== couponCode) {
|
|
@@ -20648,9 +20452,46 @@ function Signup(_a) {
|
|
|
20648
20452
|
}, [couponCode, quote === null || quote === void 0 ? void 0 : quote.id]);
|
|
20649
20453
|
function handleSubmit(formData) {
|
|
20650
20454
|
return __awaiter(this, void 0, void 0, function () {
|
|
20455
|
+
var data_1, error_1;
|
|
20651
20456
|
return __generator(this, function (_a) {
|
|
20652
|
-
|
|
20653
|
-
|
|
20457
|
+
switch (_a.label) {
|
|
20458
|
+
case 0:
|
|
20459
|
+
_a.trys.push([0, 2, , 3]);
|
|
20460
|
+
setProceedingToPayment(true);
|
|
20461
|
+
return [4 /*yield*/, quoteAccountSignup({
|
|
20462
|
+
token: token,
|
|
20463
|
+
apiHost: apiHost,
|
|
20464
|
+
priceListCode: priceListCode,
|
|
20465
|
+
accountName: formData.accountName,
|
|
20466
|
+
billingContact: {
|
|
20467
|
+
firstName: formData.firstName,
|
|
20468
|
+
lastName: formData.lastName,
|
|
20469
|
+
email: formData.email,
|
|
20470
|
+
},
|
|
20471
|
+
entityId: entityId,
|
|
20472
|
+
})];
|
|
20473
|
+
case 1:
|
|
20474
|
+
data_1 = _a.sent();
|
|
20475
|
+
setAccountId(data_1.account.id);
|
|
20476
|
+
setPortalSessionToken(data_1.portalSessionToken);
|
|
20477
|
+
// We must invalidate the accountPaymentMethodKey query in order to clear payment methods from the provided api token,
|
|
20478
|
+
// to instead use paymentMethods from portalSessionToken.
|
|
20479
|
+
queryClient.invalidateQueries({
|
|
20480
|
+
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
20481
|
+
accountId: accountId,
|
|
20482
|
+
token: token,
|
|
20483
|
+
}),
|
|
20484
|
+
});
|
|
20485
|
+
setProceedingToPayment(false);
|
|
20486
|
+
setInitialQuote(data_1.quote);
|
|
20487
|
+
return [3 /*break*/, 3];
|
|
20488
|
+
case 2:
|
|
20489
|
+
error_1 = _a.sent();
|
|
20490
|
+
setProceedingToPayment(false);
|
|
20491
|
+
showErrorNotification(error_1.response.message);
|
|
20492
|
+
return [3 /*break*/, 3];
|
|
20493
|
+
case 3: return [2 /*return*/];
|
|
20494
|
+
}
|
|
20654
20495
|
});
|
|
20655
20496
|
});
|
|
20656
20497
|
}
|
|
@@ -20687,6 +20528,7 @@ function Signup(_a) {
|
|
|
20687
20528
|
pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
|
|
20688
20529
|
priceListCode: priceListCode,
|
|
20689
20530
|
accountId: accountId,
|
|
20531
|
+
entityId: entityId,
|
|
20690
20532
|
})];
|
|
20691
20533
|
case 1: return [2 /*return*/, _a.sent()];
|
|
20692
20534
|
}
|
|
@@ -20694,20 +20536,28 @@ function Signup(_a) {
|
|
|
20694
20536
|
});
|
|
20695
20537
|
}
|
|
20696
20538
|
function handlePaymentFail(error) {
|
|
20697
|
-
|
|
20698
|
-
showErrorNotification((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.message);
|
|
20539
|
+
showErrorNotification(error.response.message);
|
|
20699
20540
|
}
|
|
20700
|
-
react.useEffect(function () {
|
|
20701
|
-
if (initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id) {
|
|
20702
|
-
recalculateTaxes();
|
|
20703
|
-
}
|
|
20704
|
-
}, [initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id]);
|
|
20705
20541
|
if (purchaseSucceeded) {
|
|
20706
20542
|
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" })) }));
|
|
20707
20543
|
}
|
|
20708
|
-
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,
|
|
20544
|
+
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: {
|
|
20709
20545
|
boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
|
|
20710
|
-
} }, { 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:
|
|
20546
|
+
} }, { 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 }) }))) }))] })));
|
|
20547
|
+
}
|
|
20548
|
+
var Text$d = antd.Typography.Text;
|
|
20549
|
+
var CheckoutSummaryDivider = function () {
|
|
20550
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20551
|
+
};
|
|
20552
|
+
var showSuccessNotification = common.useSuccessNotification();
|
|
20553
|
+
function CheckoutSummary(_a) {
|
|
20554
|
+
var quote = _a.quote, className = _a.className; _a.onAddCoupon; var priceListData = _a.priceListData; _a.isAddingCoupon;
|
|
20555
|
+
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) {
|
|
20556
|
+
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20557
|
+
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20558
|
+
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));
|
|
20559
|
+
});
|
|
20560
|
+
}) })), 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 ] })));
|
|
20711
20561
|
}
|
|
20712
20562
|
|
|
20713
20563
|
var useQuoteSubscriptionUpgrade = function () {
|
|
@@ -20796,6 +20646,35 @@ var pageWrapperClassName = function (isMobile) {
|
|
|
20796
20646
|
return "flex flex-col grow pt-4 ".concat(isMobile ? "pb-4 overflow-hidden" : "pb-8", " ").concat("content-container");
|
|
20797
20647
|
};
|
|
20798
20648
|
|
|
20649
|
+
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}";
|
|
20650
|
+
|
|
20651
|
+
var QUOTE_RECALCULATE_TAXES = "\n mutation QuoteRecalculateTaxes($id: ID!) {\n quoteRecalculateTaxes(id: $id) {\n ".concat(QUOTE_FIELDS, "\n errors\n }\n }\n");
|
|
20652
|
+
var quoteRecalculateTaxes = function (_a) {
|
|
20653
|
+
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
20654
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
20655
|
+
var vars, response, errors;
|
|
20656
|
+
var _b, _c;
|
|
20657
|
+
return __generator(this, function (_d) {
|
|
20658
|
+
switch (_d.label) {
|
|
20659
|
+
case 0:
|
|
20660
|
+
vars = { id: quoteId };
|
|
20661
|
+
return [4 /*yield*/, gqlRequest({
|
|
20662
|
+
query: QUOTE_RECALCULATE_TAXES,
|
|
20663
|
+
token: token,
|
|
20664
|
+
vars: vars,
|
|
20665
|
+
apiHost: apiHost,
|
|
20666
|
+
})];
|
|
20667
|
+
case 1:
|
|
20668
|
+
response = _d.sent();
|
|
20669
|
+
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20670
|
+
if (errors)
|
|
20671
|
+
throw errors;
|
|
20672
|
+
return [2 /*return*/, (_c = response.quoteRecalculateTaxes) === null || _c === void 0 ? void 0 : _c.quote];
|
|
20673
|
+
}
|
|
20674
|
+
});
|
|
20675
|
+
});
|
|
20676
|
+
};
|
|
20677
|
+
|
|
20799
20678
|
var MUTATION$2 = "{\n currentUser {\n taxationRequiredAccountFields\n }\n}";
|
|
20800
20679
|
var getTaxationRequiredAccountFields = function (_a) {
|
|
20801
20680
|
var apiHost = _a.apiHost, token = _a.token;
|
|
@@ -20907,7 +20786,6 @@ var QuoteCheckout = function (_a) {
|
|
|
20907
20786
|
var isMobile = common.useIsMobile();
|
|
20908
20787
|
var _b = react.useState(false), isSaving = _b[0], setIsSaving = _b[1];
|
|
20909
20788
|
var paymentRequired = getQuoteAmountDue(quote) > 0;
|
|
20910
|
-
var entityId = useCurrentUserData().entityId;
|
|
20911
20789
|
var checkoutMutation = reactQuery.useMutation({
|
|
20912
20790
|
mutationFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
20913
20791
|
return __generator(this, function (_a) {
|
|
@@ -20937,7 +20815,7 @@ var QuoteCheckout = function (_a) {
|
|
|
20937
20815
|
}
|
|
20938
20816
|
if (taxationRequiredAccountFields)
|
|
20939
20817
|
return (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
20940
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, {
|
|
20818
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, 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" }))] })) }))) }));
|
|
20941
20819
|
};
|
|
20942
20820
|
var PaymentFormWrapper = function (_a) {
|
|
20943
20821
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
@@ -20954,10 +20832,9 @@ var PaymentFormWrapper = function (_a) {
|
|
|
20954
20832
|
var queryKeyFactory = common.QueryKeyFactory.default;
|
|
20955
20833
|
var Checkout = function (_a) {
|
|
20956
20834
|
var _b, _c;
|
|
20957
|
-
var onCancel = _a.onCancel, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, open = _a.open, quote = _a.quote, selectedPriceList = _a.selectedPriceList;
|
|
20835
|
+
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;
|
|
20958
20836
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20959
20837
|
var isMobile = common.useIsMobile();
|
|
20960
|
-
var token = useToken();
|
|
20961
20838
|
var hasTaxPlugin = useHasTaxPlugin({
|
|
20962
20839
|
apiHost: apiHost,
|
|
20963
20840
|
token: token,
|
|
@@ -21405,11 +21282,11 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
21405
21282
|
return (jsxRuntime.jsx(CheckoutBarInput, { disabled: !chargeQuantity, charge: charge, quantity: chargeQuantity !== null && chargeQuantity !== void 0 ? chargeQuantity : 0, selectedPriceList: selectedPriceList, onQuantityChanged: function (quantity) {
|
|
21406
21283
|
onChangeQuantity(charge.id, quantity);
|
|
21407
21284
|
} }, index));
|
|
21408
|
-
}) })), 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 })] })));
|
|
21285
|
+
}) })), 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 })] })));
|
|
21409
21286
|
};
|
|
21410
21287
|
|
|
21411
21288
|
// WARNING: There is a preview button on APP that will need to be changed if this query is changed
|
|
21412
|
-
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
|
|
21289
|
+
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 }";
|
|
21413
21290
|
var getPriceListChangeOptions = function (_a) {
|
|
21414
21291
|
var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription;
|
|
21415
21292
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -21513,30 +21390,10 @@ var PriceListCardTitle = function (_a) {
|
|
|
21513
21390
|
: " " }))), 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 }))] })));
|
|
21514
21391
|
};
|
|
21515
21392
|
|
|
21516
|
-
var getPrice = function (priceList) {
|
|
21517
|
-
if (priceList.showPriceAsMonthly) {
|
|
21518
|
-
return priceList.monthlyBasePrice;
|
|
21519
|
-
}
|
|
21520
|
-
return priceList.basePrice;
|
|
21521
|
-
};
|
|
21522
|
-
var calculatePriceDecimals = function (priceList) {
|
|
21523
|
-
if (priceList.plan.pricingStyle === common.PricingStyle.PRICED) {
|
|
21524
|
-
var decimalPart = getPrice(priceList).toString().split('.')[1];
|
|
21525
|
-
if (!decimalPart)
|
|
21526
|
-
return 0;
|
|
21527
|
-
// If decimal part consists only of zeros, return 0
|
|
21528
|
-
if (parseInt(decimalPart) === 0) {
|
|
21529
|
-
return 0;
|
|
21530
|
-
}
|
|
21531
|
-
return undefined;
|
|
21532
|
-
}
|
|
21533
|
-
return 0;
|
|
21534
|
-
};
|
|
21535
21393
|
var PriceListCardPrice = function (_a) {
|
|
21536
21394
|
var priceList = _a.priceList;
|
|
21537
|
-
var priceDecimals = calculatePriceDecimals(priceList);
|
|
21538
21395
|
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
|
|
21539
|
-
? common.formatCurrency(
|
|
21396
|
+
? common.formatCurrency(priceList.monthlyBasePrice, priceList.currencyId, 0)
|
|
21540
21397
|
: priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US
|
|
21541
21398
|
? ''
|
|
21542
21399
|
: 'Free' })));
|
|
@@ -21545,7 +21402,10 @@ var PriceListCardPrice = function (_a) {
|
|
|
21545
21402
|
var Text$c = antd.Typography.Text;
|
|
21546
21403
|
var PriceListCardDescription = function (_a) {
|
|
21547
21404
|
var description = _a.description;
|
|
21548
|
-
|
|
21405
|
+
var htmlParsedDescription = parse__default["default"](description || '');
|
|
21406
|
+
if (!description)
|
|
21407
|
+
return null;
|
|
21408
|
+
return jsxRuntime.jsx(Text$c, __assign({ className: "bunny-text-center" }, { children: htmlParsedDescription }));
|
|
21549
21409
|
};
|
|
21550
21410
|
|
|
21551
21411
|
var BillingPeriodConverter;
|
|
@@ -21572,9 +21432,7 @@ var PriceListCardPriceDescription = function (_a) {
|
|
|
21572
21432
|
fontSize: isMobile ? '13px' : '12px',
|
|
21573
21433
|
} }, { 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
|
|
21574
21434
|
? "".concat(feature.unitName.toLowerCase(), " / ")
|
|
21575
|
-
: '').
|
|
21576
|
-
? 'month'
|
|
21577
|
-
: 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)]] })))] }));
|
|
21435
|
+
: '', "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)]] })))] }));
|
|
21578
21436
|
};
|
|
21579
21437
|
|
|
21580
21438
|
var CheckIcon = function (_a) {
|
|
@@ -21612,11 +21470,11 @@ var PriceListCardMobile = function (_a) {
|
|
|
21612
21470
|
if (!disableOnClick)
|
|
21613
21471
|
onClick(priceList);
|
|
21614
21472
|
}, style: {
|
|
21615
|
-
minWidth:
|
|
21473
|
+
minWidth: "220px",
|
|
21616
21474
|
borderColor: isSelected ? brandColor : common.SLATE_200,
|
|
21617
21475
|
} }, { children: [isSelected && (jsxRuntime.jsx("div", __assign({ className: "bunny-absolute", style: {
|
|
21618
|
-
top:
|
|
21619
|
-
right:
|
|
21476
|
+
top: "10px",
|
|
21477
|
+
right: "10px",
|
|
21620
21478
|
} }, { 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 })] }))] })));
|
|
21621
21479
|
};
|
|
21622
21480
|
|
|
@@ -22072,7 +21930,7 @@ var PlanManager = function (_a) {
|
|
|
22072
21930
|
var queryClient = reactQuery.useQueryClient();
|
|
22073
21931
|
var showSuccessNotification = common.useSuccessNotification();
|
|
22074
21932
|
var showInfoNotification = common.useInfoNotification();
|
|
22075
|
-
common.useIsMobile();
|
|
21933
|
+
var isMobile = common.useIsMobile();
|
|
22076
21934
|
var defaultPaymentMethod = usePaymentMethod({
|
|
22077
21935
|
token: token,
|
|
22078
21936
|
apiHost: apiHost,
|
|
@@ -22124,8 +21982,8 @@ var PlanManager = function (_a) {
|
|
|
22124
21982
|
}, []);
|
|
22125
21983
|
function handleSetEditingQuoteData(quoteId, isTrial) {
|
|
22126
21984
|
setEditingQuoteData({
|
|
22127
|
-
id: quoteId || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id)
|
|
22128
|
-
isTrial: isTrial || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
|
|
21985
|
+
id: quoteId || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
|
|
21986
|
+
isTrial: isTrial || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial),
|
|
22129
21987
|
});
|
|
22130
21988
|
}
|
|
22131
21989
|
// Handlers
|
|
@@ -22156,7 +22014,7 @@ var PlanManager = function (_a) {
|
|
|
22156
22014
|
return showInfoNotification('You are in preview mode');
|
|
22157
22015
|
setQuotePreviewData(undefined);
|
|
22158
22016
|
onChangePlanCancel();
|
|
22159
|
-
}, 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(); } }) }))] })));
|
|
22017
|
+
}, 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(); } }) }))] })));
|
|
22160
22018
|
};
|
|
22161
22019
|
|
|
22162
22020
|
var useCancelSubscription = function () {
|
|
@@ -23180,7 +23038,7 @@ var Subscriptions = function (_a) {
|
|
|
23180
23038
|
setIsChangingPlan(false);
|
|
23181
23039
|
}, handlePortalErrors: handlePortalErrors }));
|
|
23182
23040
|
}
|
|
23183
|
-
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 })] })));
|
|
23041
|
+
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 })] })));
|
|
23184
23042
|
};
|
|
23185
23043
|
var PageHeaderWithActions = function (_a) {
|
|
23186
23044
|
var children = _a.children, title = _a.title;
|
|
@@ -23435,8 +23293,8 @@ var PaymentFormSection = function (_a) {
|
|
|
23435
23293
|
var onTokenExpired = react.useContext(BunnyContext).onTokenExpired;
|
|
23436
23294
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
23437
23295
|
var showSuccessNotification = common.useSuccessNotification();
|
|
23438
|
-
|
|
23439
|
-
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4', " bunny-flex bunny-justify-center") }, { children: jsxRuntime.jsx(PaymentForm, {
|
|
23296
|
+
useCurrentUserData().account;
|
|
23297
|
+
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4', " bunny-flex bunny-justify-center") }, { children: jsxRuntime.jsx(PaymentForm, { onFail: function (error) {
|
|
23440
23298
|
handleAllErrorFormats(error);
|
|
23441
23299
|
}, onSavePaymentMethod: function () {
|
|
23442
23300
|
showSuccessNotification('Your payment method has been saved');
|