@bunnyapp/components 1.6.0-beta.15 → 1.6.0-beta.16

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.
Files changed (47) hide show
  1. package/dist/cjs/index.js +290 -120
  2. package/dist/cjs/types/src/components/BunnyProvider.d.ts +0 -2
  3. package/dist/cjs/types/src/components/Subscriptions/Subscriptions.d.ts +0 -4
  4. package/dist/cjs/types/src/components/Subscriptions/SubscriptionsListContainer.d.ts +0 -4
  5. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +1 -5
  6. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +1 -4
  7. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +11 -6
  8. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/context/quoteIdContext.d.ts +5 -0
  9. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/fragments/{QuantityDrawerQuoteFragment.d.ts → QuantityDrawer_QuoteFragment.d.ts} +4 -0
  10. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -3
  11. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +2 -2
  12. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +1 -6
  13. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{QuantityInput.d.ts → quantityInput/QuantityInput.d.ts} +1 -8
  14. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/fragments/QuantityInput_QuoteFragment.d.ts +27 -0
  15. package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +2 -1
  16. package/dist/cjs/types/src/hooks/useAllErrorFormats.d.ts +1 -0
  17. package/dist/cjs/types/src/hooks/useCreateQueryClient.d.ts +2 -0
  18. package/dist/cjs/types/src/utils/createStateContext.d.ts +11 -0
  19. package/dist/cjs/types/src/utils/pricePickerUtils.d.ts +1 -1
  20. package/dist/esm/index.js +297 -127
  21. package/dist/esm/types/src/components/BunnyProvider.d.ts +0 -2
  22. package/dist/esm/types/src/components/Subscriptions/Subscriptions.d.ts +0 -4
  23. package/dist/esm/types/src/components/Subscriptions/SubscriptionsListContainer.d.ts +0 -4
  24. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityChangeGridRow.d.ts +1 -5
  25. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuantityDrawer.d.ts +1 -4
  26. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +11 -6
  27. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/context/quoteIdContext.d.ts +5 -0
  28. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/fragments/{QuantityDrawerQuoteFragment.d.ts → QuantityDrawer_QuoteFragment.d.ts} +4 -0
  29. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useQuoteQueryData.d.ts +3 -3
  30. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/hooks/useSetQuoteQueryData.d.ts +2 -2
  31. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +1 -6
  32. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{QuantityInput.d.ts → quantityInput/QuantityInput.d.ts} +1 -8
  33. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/quantityInput/fragments/QuantityInput_QuoteFragment.d.ts +27 -0
  34. package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/utils/utils.d.ts +2 -1
  35. package/dist/esm/types/src/hooks/useAllErrorFormats.d.ts +1 -0
  36. package/dist/esm/types/src/hooks/useCreateQueryClient.d.ts +2 -0
  37. package/dist/esm/types/src/utils/createStateContext.d.ts +11 -0
  38. package/dist/esm/types/src/utils/pricePickerUtils.d.ts +1 -1
  39. package/package.json +1 -1
  40. package/dist/cjs/types/src/utils/GraphQLClient.d.ts +0 -2
  41. package/dist/esm/types/src/utils/GraphQLClient.d.ts +0 -2
  42. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeCreate.d.ts +0 -0
  43. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeUpdate.d.ts +0 -0
  44. /package/dist/cjs/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteSubscriptionUpdate.d.ts +0 -0
  45. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeCreate.d.ts +0 -0
  46. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteChargeUpdate.d.ts +0 -0
  47. /package/dist/esm/types/src/components/Subscriptions/quantityChangeDrawer/{queries → mutations}/quoteSubscriptionUpdate.d.ts +0 -0
package/dist/cjs/index.js CHANGED
@@ -51,8 +51,99 @@ function styleInject(css, ref) {
51
51
  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-mx-auto {\n margin-left: auto;\n margin-right: auto;\n}\n.bunny-my-0 {\n margin-top: 0px;\n margin-bottom: 0px;\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-3 {\n margin-bottom: 0.75rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-ml-auto {\n margin-left: auto;\n}\n.bunny-mt-0 {\n margin-top: 0px;\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-mt-5 {\n margin-top: 1.25rem;\n}\n.bunny-box-border {\n box-sizing: border-box;\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-0\\.5 {\n height: 0.125rem;\n}\n.bunny-h-1\\/2 {\n height: 50%;\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-max-h-\\[calc\\(100vh-10rem\\)\\] {\n max-height: calc(100vh - 10rem);\n}\n.bunny-min-h-0 {\n min-height: 0px;\n}\n.bunny-w-0\\.5 {\n width: 0.125rem;\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-flex-wrap {\n flex-wrap: wrap;\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-y-auto {\n overflow-y: auto;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-text-nowrap {\n text-wrap: 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-gray-300 {\n --tw-bg-opacity: 1;\n background-color: rgb(209 213 219 / var(--tw-bg-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-transparent {\n background-color: transparent;\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-12 {\n padding-left: 3rem;\n padding-right: 3rem;\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-1 {\n padding-left: 0.25rem;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-1 {\n padding-top: 0.25rem;\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-\\[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-start {\n text-align: start;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-3xl {\n font-size: 1.875rem;\n line-height: 2.25rem;\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-sm\\/5 {\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-text-xs\\/3 {\n font-size: 0.75rem;\n line-height: 0.75rem;\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-400 {\n --tw-text-opacity: 1;\n color: rgb(156 163 175 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity, 1));\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-text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / 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, 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-components .ant-upload-select-picture-card {\n margin: 0 !important;\n}\n.bunny-components .ant-upload {\n border-radius: 0.5rem !important;\n}\n.bunny-components .ant-row {\n margin-bottom: 0px;\n}\n.bunny-components .ant-select-disabled .ant-select-selector .ant-select-selection-item {\n color: rgba(0, 0, 0, 0.25) !important;\n}\n.bunny-components .ant-input-number,\n.bunny-components .ant-input,\n.bunny-components .ant-picker,\n.bunny-components .ant-input-affix-wrapper,\n.bunny-components .ant-select-selector {\n font-size: 0.875rem !important;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n color: #232323 !important;\n}\n.bunny-components .ant-input-affix-wrapper {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n.bunny-components .ant-input-group-addon,\n.bunny-components .ant-input-number-group-addon {\n color: #475569 !important;\n}\n.bunny-components .ant-input-number-group-wrapper,\n.bunny-components .ant-input-number-affix-wrapper {\n width: 100%;\n}\n.bunny-components .ant-input-affix-wrapper input {\n border: none !important;\n}\n.bunny-components .ant-form-item {\n margin-bottom: 0;\n}\n.bunny-components .ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.bunny-components .ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.bunny-components .form .ant-form-item-label label {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n box-sizing: border-box;\n}\n.bunny-components .ant-form-item-explain,\n.bunny-components .ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.bunny-components .ant-timeline-item-content {\n font-size: smaller;\n}\n.bunny-components .ant-tree {\n font-size: 0.875rem;\n}\n.bunny-components .ant-tree-treenode {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-draggable-icon {\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-node-content-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-tree-switcher {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-page-header {\n padding-left: 0;\n padding-right: 0;\n padding-top: 0;\n}\n.bunny-components .ant-tag {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: 14px;\n font-weight: 500;\n white-space: nowrap;\n padding-inline-start: 0.625rem;\n padding-inline-end: 0.625rem;\n margin: 0;\n}\n.bunny-components .ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.bunny-components .ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.bunny-components .ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.bunny-components .ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.bunny-components .ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.bunny-components .ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.bunny-components .ant-tag-gray {\n color: #6b7280 !important;\n background: #e5e7eb !important;\n}\n.bunny-components .ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.bunny-components .ant-picker {\n width: 100%;\n}\n.bunny-components .ant-input,\n.bunny-components .ant-select,\n.bunny-components .ant-picker {\n height: 32px !important;\n}\n.bunny-components .ant-slider-dot {\n border: 2px solid #f0f0f0;\n}\n.bunny-components .ant-slider-dot-active {\n border-color: #ff5833;\n}\n.bunny-components .ant-slider-mark :last-child {\n transform: translateX(-75%) !important;\n}\n.bunny-components .ant-drawer-content {\n background: #f3f3f9ff;\n}\n.bunny-components .ant-drawer-body,\n.bunny-components .ant-layout {\n background: #f8fafc;\n}\n.bunny-components .vista-link {\n color: #1890ff;\n}\n.bunny-components .vista-link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\n.bunny-components .ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.bunny-components .ant-popconfirm-message-text {\n width: 100% !important;\n}\n.bunny-components .ant-popconfirm-title {\n padding: 0;\n text-align: center;\n font-size: 0.875rem !important;\n width: 100% !important;\n}\n.bunny-components .ant-popconfirm-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n}\n.bunny-components .ant-popconfirm-buttons button {\n margin-inline-start: 0 !important;\n}\n.bunny-components .ant-pagination-item {\n display: flex !important;\n align-items: center;\n justify-content: center;\n}\n.bunny-components .ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.bunny-components .ant-btn {\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-weight: normal;\n}\n.bunny-components .ant-btn-default .ant-btn-icon {\n color: #94a3b8;\n transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n.bunny-components .ant-btn-default:hover .ant-btn-icon {\n color: #ff7f5c;\n}\n.bunny-components .ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.bunny-components .ant-btn-primary:disabled {\n background-color: rgba(113, 125, 148, 0.1) !important;\n border-color: rgba(113, 125, 148, 0.1) !important;\n}\n.bunny-components .ant-btn-primary:hover:disabled,\n.bunny-components .ant-btn-primary:disabled {\n background-clip: padding-box;\n}\n.bunny-components .ant-select-selection-item-content {\n display: flex !important;\n align-items: center;\n}\n.bunny-components .ant-select-item {\n font-size: 0.875rem;\n}\n.bunny-components .ant-select-item-option-content {\n display: flex;\n align-items: center;\n white-space: nowrap !important;\n overflow: visible !important;\n text-overflow: default !important;\n font-size: 0.875rem;\n}\n.bunny-components .ant-select-arrow .anticon:not(.ant-select-suffix) {\n pointer-events: none;\n}\n.bunny-components .select-dropdown-blue-gray .ant-select-item-option {\n background-color: #fff !important;\n}\n.bunny-components .select-dropdown-blue-gray .ant-select-item-option-active {\n color: #ff5833;\n}\n.bunny-components .ant-dropdown-menu-items {\n padding-left: 0 !important;\n}\n.bunny-components .ant-dropdown-menu-item-active {\n background-color: transparent !important;\n}\n.bunny-components .ant-input-affix-wrapper.searchfield {\n background: white !important;\n}\n.bunny-components .ant-input-affix-wrapper.searchfield input {\n background: white !important;\n}\n.bunny-components .ant-input-affix-wrapper-focused {\n background: white !important;\n}\n.bunny-components .panel .ant-input-affix-wrapper.searchfield {\n background: #f8f8f8 !important;\n}\n.bunny-components .panel .ant-input-affix-wrapper.searchfield input {\n background: #f8f8f8 !important;\n}\n.bunny-components .ant-input-steps-hidden .ant-input-number-handler-wrap {\n display: none;\n}\n.bunny-components .ant-layout-header {\n height: 48px;\n}\n.bunny-components .ant-layout-sider-children {\n width: inherit;\n position: fixed;\n}\n.bunny-components .ant-menu-item-group-list {\n display: flex !important;\n flex-direction: column !important;\n align-items: flex-start !important;\n gap: 4px !important;\n}\n.bunny-components .group {\n display: flex;\n flex-direction: row;\n flex-flow: row wrap;\n box-sizing: border-box;\n}\n.bunny-components .select-datepicker {\n animation-duration: 0.35s !important;\n}\n.bunny-components .header-datepicker {\n top: 96px !important;\n animation-duration: 0s !important;\n}\n.bunny-components .ant-picker-header {\n border-bottom: none !important;\n}\n.bunny-components .ant-picker-content thead tr th {\n font-weight: 500;\n}\n.bunny-components .ant-picker-panel-container {\n border-radius: 0.375rem;\n}\n.bunny-components .ant-picker-cell-selected .custom-date-display {\n color: #ffffff;\n background-color: #ff5833;\n}\n.bunny-components .ant-picker-cell-today .custom-date-display {\n border: 1px solid #ff5833;\n}\n.bunny-components .ant-select:hover,\n.bunny-components * .cardElement:hover {\n border-color: #ff5833;\n}\n.bunny-components .ant-input-number {\n width: 100%;\n}\n.bunny-components .ant-input-number-focused {\n border-color: #ff5833 !important;\n background-color: #ffffff !important;\n}\n.bunny-components .ant-input-affix-wrapper-focused,\n.bunny-components .ant-input-number-focused,\n.bunny-components .ant-picker,\n.bunny-components .ant-input,\n.bunny-components .ant-select-focused .ant-select-selector,\n.bunny-components .ant-select-selector:focus,\n.bunny-components .ant-select-selector:active,\n.bunny-components .ant-select-open .ant-select-selector {\n box-shadow: none !important;\n}\n.bunny-components .ant-select-item-option-selected .ant-select-item-option-state {\n display: none !important;\n}\n.bunny-components .ant-form * input[type='text'].ant-input:not(:disabled),\n.bunny-components .ant-select-selection-item:not(:disabled) {\n color: #232323;\n}\n.bunny-components .ant-tabs-ink-bar {\n display: none !important;\n}\n.bunny-components .ant-tabs-tab.ant-tabs-tab-active {\n border-bottom: 2px solid #ff5833 !important;\n}\n.bunny-components .ant-tabs-tab {\n border-bottom: 2px solid transparent !important;\n padding-bottom: 14px !important;\n}\n.bunny-components .ant-upload-wrapper {\n display: flex;\n}\n.bunny-components .ant-form-item-label > label::after {\n display: none !important;\n}\n.bunny-components .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n border-radius: 8px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n font-size: 14px !important;\n overflow-wrap: break-word;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff5833 !important;\n font-weight: 500 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff5833;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-weight: 500 !important;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.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";
52
52
  styleInject(css_248z);
53
53
 
54
+ const IGNORE_ERRORS = ['Invalid or missing authorization', '["Not found"]'];
55
+ /**
56
+ * Extracts errors from nested data structure
57
+ * @param data - The response data object
58
+ * @param mutationName - The mutation/query name to look for
59
+ * @returns Array of error messages or null
60
+ */
61
+ const extractNestedErrors = (data, mutationName) => {
62
+ if (!data || !mutationName)
63
+ return null;
64
+ const mutationData = data[mutationName];
65
+ if (!mutationData)
66
+ return null;
67
+ const errors = mutationData.errors;
68
+ if (!errors)
69
+ return null;
70
+ // Handle stringified JSON array
71
+ if (typeof errors === 'string') {
72
+ try {
73
+ const parsedErrors = JSON.parse(errors);
74
+ return Array.isArray(parsedErrors) ? parsedErrors : [parsedErrors];
75
+ }
76
+ catch (_a) {
77
+ return [errors];
78
+ }
79
+ }
80
+ // Handle array of errors
81
+ if (Array.isArray(errors)) {
82
+ return errors;
83
+ }
84
+ return null;
85
+ };
86
+ const useAllErrorFormats = () => {
87
+ const showErrorNotification = common.useErrorNotification();
88
+ return (error, mutationName) => {
89
+ var _a, _b, _c, _d, _e, _f, _g;
90
+ // Fall back to existing error handling logic
91
+ const responseErrors = ((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors) || null;
92
+ if (IGNORE_ERRORS.includes((_d = (_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.message)) {
93
+ return error;
94
+ }
95
+ // For errors like this:
96
+ // {
97
+ // "data": {
98
+ // "accountReset": {
99
+ // "errors": "[\"Missing required permission: write, can't access mutation AccountReset\"]"
100
+ // }
101
+ // }
102
+ // }
103
+ if ((error === null || error === void 0 ? void 0 : error.data) && mutationName) {
104
+ const nestedErrors = extractNestedErrors(error.data, mutationName);
105
+ if (nestedErrors && nestedErrors.length > 0) {
106
+ // Check if we should ignore these errors
107
+ if (IGNORE_ERRORS.some(ignoreError => nestedErrors.includes(ignoreError))) {
108
+ return error;
109
+ }
110
+ // Show each nested error
111
+ for (const errorMessage of nestedErrors) {
112
+ showErrorNotification(errorMessage, null);
113
+ }
114
+ return error;
115
+ }
116
+ }
117
+ if (responseErrors) {
118
+ for (let index in responseErrors) {
119
+ const error = (_e = responseErrors[index]) === null || _e === void 0 ? void 0 : _e.message;
120
+ showErrorNotification(error, null);
121
+ }
122
+ }
123
+ else if ((_f = error === null || error === void 0 ? void 0 : error.response) === null || _f === void 0 ? void 0 : _f.error) {
124
+ showErrorNotification(error.response.exception, error.response.error);
125
+ }
126
+ else if ((error === null || error === void 0 ? void 0 : error.constructor) === Array) {
127
+ for (let index in error)
128
+ showErrorNotification(error[index].message, null);
129
+ }
130
+ else if ((_g = error === null || error === void 0 ? void 0 : error.response) === null || _g === void 0 ? void 0 : _g.message) {
131
+ showErrorNotification(error.response.message);
132
+ }
133
+ else if (error === null || error === void 0 ? void 0 : error.message) {
134
+ showErrorNotification(error.message);
135
+ }
136
+ else if (typeof error === 'string' || (error !== null && react.isValidElement(error))) {
137
+ showErrorNotification(error);
138
+ }
139
+ else {
140
+ showErrorNotification('Unknown error notification', null);
141
+ }
142
+ };
143
+ };
144
+
54
145
  // This will be replaced at build time by rollup-plugin-replace
55
- const PACKAGE_VERSION = '1.6.0-beta.14';
146
+ const PACKAGE_VERSION = '1.6.0-beta.15';
56
147
  const createRequestHeaders = (token) => {
57
148
  const headers = createClientDevHeaders({ token });
58
149
  // Add the components version header
@@ -71,15 +162,22 @@ const useGraphQLRequest = () => async (query, apiHost, token, variables) => {
71
162
  }
72
163
  };
73
164
  const gqlRequest = async ({ query, apiHost, token, vars, isInPreviewMode, }) => {
74
- return await common.gqlRequest({
75
- query,
76
- apiHost,
77
- token,
78
- vars,
79
- componentsVersion: PACKAGE_VERSION,
80
- isInPreviewMode,
81
- headers: createClientDevHeaders({ token }),
82
- });
165
+ const handleAllErrorFormats = useAllErrorFormats();
166
+ try {
167
+ const { graphqlEndpoint } = common.DEFAULT_CONFIG;
168
+ const baseHeaders = createClientDevHeaders({
169
+ token: isInPreviewMode ? undefined : token,
170
+ componentsVersion: PACKAGE_VERSION,
171
+ });
172
+ const requestHeaders = {
173
+ ...baseHeaders,
174
+ };
175
+ return await request(`${apiHost}${graphqlEndpoint}`, query, vars, requestHeaders);
176
+ }
177
+ catch (error) {
178
+ handleAllErrorFormats(error);
179
+ return null;
180
+ }
83
181
  };
84
182
  const createClientDevHeaders = ({ token, componentsVersion, }) => {
85
183
  return common.createClientDevHeaders({
@@ -168,22 +266,12 @@ const getBranding = async ({ token, apiHost }) => {
168
266
  return response === null || response === void 0 ? void 0 : response.entityBranding;
169
267
  };
170
268
 
171
- const createGraphQLClient = (apiHost, token) => new request.GraphQLClient(apiHost + "/graphql", {
172
- headers: token
173
- ? {
174
- Authorization: token,
175
- }
176
- : undefined,
177
- });
178
-
179
269
  const BunnyContext = react.createContext({});
180
270
  const extraQueryClient = new reactQuery.QueryClient();
181
271
  // Every component shares similar props and functionality, which this wrapper handles.
182
272
  function BunnyProvider({ children, darkMode = false, queryClient, apiHost, token, onTokenExpired, configProviderProps, }) {
183
- const graphQLClient = createGraphQLClient(apiHost || '', token);
184
273
  return (jsxRuntime.jsx(BunnyContext.Provider, { value: {
185
274
  darkMode,
186
- graphQLClient,
187
275
  apiHost,
188
276
  token,
189
277
  onTokenExpired,
@@ -20009,7 +20097,7 @@ function Transactions({ transactionComponent, showSearchBar = true, showTitle =
20009
20097
  const token = useToken();
20010
20098
  // Local state
20011
20099
  const [search, setSearch] = react.useState('');
20012
- const filterValue = filter || (search.length > 0 ? `filter: "transaction.transactionableId is ${search}"` : '');
20100
+ const filterValue = filter || (search.length > 0 ? `filter: "transaction.amount is ${Number(search)}"` : '');
20013
20101
  // Queries
20014
20102
  const { data } = reactQuery.useQuery({
20015
20103
  queryKey: ['transactions', token, filterValue],
@@ -20080,11 +20168,13 @@ function TransactionsDisplay({ transactions, onSearchValueChanged, search, }) {
20080
20168
  }
20081
20169
  return (jsxRuntime.jsxs("div", { style: style, children: [jsxRuntime.jsxs("div", { className: `bunny-flex bunny-flex-col bunny-w-full bunny-shadow-padding-xb bunny-gap-2 ${isMobile ? 'bunny-overflow-hidden' : ''} ${className}`, children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", { className: `bunny-flex ${isMobile ? 'bunny-flex-col bunny-gap-1' : 'bunny-flex-row bunny-items-center'} bunny-justify-between`, children: [showTitle ? (jsxRuntime.jsx(Text$q, { className: "bunny-shrink-0 bunny-font-medium", style: { color: darkMode ? undefined : secondaryColor }, children: title })) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
20082
20170
  ), showSearchBar && (jsxRuntime.jsx("div", { className: `${isMobile ? 'bunny-w-full' : ''}`, children: jsxRuntime.jsx(antd.Input, { className: searchBarClassName ? searchBarClassName : '', onChange: e => {
20083
- if (isNaN(Number(e.target.value))) {
20171
+ const value = e.target.value;
20172
+ // Allow empty string, numbers, and decimal point
20173
+ if (value !== '' && (isNaN(Number(value)) || !/^-?\d*\.?\d*$/.test(value))) {
20084
20174
  return;
20085
20175
  }
20086
- onSearchValueChanged(e.target.value);
20087
- }, prefix: jsxRuntime.jsx(icons.SearchOutlined, {}), placeholder: "Search by id #", style: {
20176
+ onSearchValueChanged(value);
20177
+ }, prefix: jsxRuntime.jsx(icons.SearchOutlined, {}), placeholder: "Search by amount", style: {
20088
20178
  minWidth: '300px',
20089
20179
  }, value: search }) }))] })) : null, jsxRuntime.jsx("div", { className: `bunny-grid bunny-w-full bunny-rounded-md bunny-overflow-auto ${shadow}`, style: {
20090
20180
  gridTemplateColumns: gridTemplateColumns(),
@@ -22463,18 +22553,57 @@ const DrawerHeader = ({ description, onClose, title, closeButtonClassName, }) =>
22463
22553
  return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-4", children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-items-center bunny-justify-between bunny-gap-2", children: [jsxRuntime.jsx(Text$j, { className: "bunny-text-xl bunny-font-normal", children: title }), onClose ? (jsxRuntime.jsx("button", { id: "closePayment", onClick: onClose, className: closeButtonClassName, children: jsxRuntime.jsx(icons.CloseOutlined, {}) })) : null] }), description && jsxRuntime.jsx("div", { className: "bunny-text-sm bunny-font-medium", children: description })] }));
22464
22554
  };
22465
22555
 
22466
- const QuantityDrawer_QuoteFragment = t(`
22467
- fragment QuantityDrawer_QuoteFragment on Quote {
22468
- id
22469
- ...Checkout_QuoteFragment
22470
- }
22471
- `, [Checkout_QuoteFragment]);
22556
+ /**
22557
+ * Creates a context and provider for a state value
22558
+ * @param useValue - A function that returns the state value
22559
+ * @returns A tuple containing the provider and the context value
22560
+ * @example take a look at how this is used in the quoteIdContext in the QuantityDrawer
22561
+ */
22562
+ const createStateContext = (useValue) => {
22563
+ const StateContext = react.createContext(null);
22564
+ const StateProvider = ({ initialValue, children, }) => jsxRuntime.jsxs(StateContext.Provider, { value: useValue(initialValue), children: [" ", children, " "] });
22565
+ const useContextState = () => {
22566
+ const value = react.useContext(StateContext);
22567
+ if (value === null) {
22568
+ throw new Error('Provider missing');
22569
+ }
22570
+ return value;
22571
+ };
22572
+ return [StateProvider, useContextState];
22573
+ };
22574
+
22575
+ const useQuoteIdState = (id) => react.useState(id);
22576
+ const [QuoteIdProvider, useQuoteId] = createStateContext(useQuoteIdState);
22577
+
22578
+ const useQuoteQueryData = (quoteId) => {
22579
+ const token = useToken();
22580
+ const { data } = reactQuery.useQuery({
22581
+ queryKey: common.QueryKeyFactory.default.createObjectKey({
22582
+ id: quoteId,
22583
+ objectName: 'editingQuote',
22584
+ token,
22585
+ }),
22586
+ queryFn: () => {
22587
+ // This queryFn should never be called if data is set via setQueryData
22588
+ // If called, it means data doesn't exist - return undefined
22589
+ // In practice, data should always be set via setQueryData before this hook is used
22590
+ return undefined;
22591
+ },
22592
+ enabled: false,
22593
+ staleTime: Infinity, // Never consider data stale, only use cache
22594
+ gcTime: Infinity, // Never garbage collect this data
22595
+ // Don't refetch if data exists in cache
22596
+ refetchOnMount: false,
22597
+ refetchOnWindowFocus: false,
22598
+ refetchOnReconnect: false,
22599
+ });
22600
+ return data;
22601
+ };
22472
22602
 
22473
22603
  const useSetQuoteQueryData = () => {
22474
22604
  const token = useToken();
22475
22605
  const queryClient = reactQuery.useQueryClient();
22476
- const setQuoteQueryData = (quoteId, maskedQuote) => {
22477
- const quote = readFragment(QuantityDrawer_QuoteFragment, maskedQuote);
22606
+ const setQuoteQueryData = (quoteId, quote) => {
22478
22607
  queryClient.setQueryData(common.QueryKeyFactory.default.createObjectKey({
22479
22608
  id: quoteId,
22480
22609
  objectName: 'editingQuote',
@@ -22484,6 +22613,58 @@ const useSetQuoteQueryData = () => {
22484
22613
  return { setQuoteQueryData };
22485
22614
  };
22486
22615
 
22616
+ const QuantityInput_QuoteFragment = t(`
22617
+ fragment QuantityInput_QuoteFragment on Quote {
22618
+ id
22619
+ quoteChanges {
22620
+ id
22621
+ priceList {
22622
+ id
22623
+ }
22624
+ charges {
22625
+ id
22626
+ priceListCharge {
22627
+ id
22628
+ }
22629
+ }
22630
+ subscription {
22631
+ charges {
22632
+ id
22633
+ priceListCharge {
22634
+ id
22635
+ }
22636
+ }
22637
+ }
22638
+ }
22639
+ }
22640
+ `, []);
22641
+
22642
+ const QuoteChangeSummarySection_QuoteFragment = t(`
22643
+ fragment QuoteChangeSummarySection_QuoteFragment on Quote {
22644
+ id
22645
+ amountDue
22646
+ amount
22647
+ currencyId
22648
+ }
22649
+ `, []);
22650
+ const QuoteChangeSummarySection = ({ openCheckout, errorUpdatingQuantity, }) => {
22651
+ const isMobile = common.useIsMobile();
22652
+ const [quoteId] = useQuoteId();
22653
+ const maskedQuote = useQuoteQueryData(quoteId);
22654
+ const quote = readFragment(QuoteChangeSummarySection_QuoteFragment, maskedQuote);
22655
+ const disabled = !quoteId || !quote || errorUpdatingQuantity;
22656
+ return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-end", children: [quote && !disabled && (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-mb-8", children: [jsxRuntime.jsx("div", { className: "bunny-text-slate-500 bunny-text-right bunny-text-xs bunny-mb-2", children: "TOTAL" }), jsxRuntime.jsx("div", { className: `bunny-text-right ${isMobile ? 'bunny-text-2xl' : 'bunny-text-xl'}`, children: common.formatCurrency(getQuoteAmountDue(quote), (quote === null || quote === void 0 ? void 0 : quote.currencyId) || '') })] })), jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-center bunny-justify-end ${isMobile ? 'bunny-w-full' : ''}`, children: jsxRuntime.jsx(antd.Button, { className: "bunny-w-full", onClick: openCheckout, disabled: disabled, size: isMobile ? 'large' : 'middle', type: "primary", children: "Proceed to checkout" }) })] }));
22657
+ };
22658
+
22659
+ const QuantityDrawer_QuoteFragment = t(`
22660
+ fragment QuantityDrawer_QuoteFragment on Quote {
22661
+ id
22662
+ ...Checkout_QuoteFragment
22663
+ ...QuantityInput_QuoteFragment
22664
+ ...QuoteChangeSummarySection_QuoteFragment
22665
+ }
22666
+ `, [Checkout_QuoteFragment, QuantityInput_QuoteFragment, QuoteChangeSummarySection_QuoteFragment]);
22667
+
22487
22668
  const mutation$4 = t(`
22488
22669
  mutation QuoteChargeCreate(
22489
22670
  $quoteChangeId: ID!
@@ -22518,12 +22699,9 @@ const mutation$4 = t(`
22518
22699
  }
22519
22700
  `, [QuantityDrawer_QuoteFragment]);
22520
22701
  const quoteChargeCreate$1 = async ({ price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }) => {
22521
- var _a, _b;
22702
+ var _a;
22522
22703
  const response = await execute(mutation$4, { apiHost, token }, { price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId });
22523
- if ((_a = response.quoteChargeCreate) === null || _a === void 0 ? void 0 : _a.errors) {
22524
- throw new Error(response.quoteChargeCreate.errors[0]);
22525
- }
22526
- return (_b = response.quoteChargeCreate) === null || _b === void 0 ? void 0 : _b.quoteCharge;
22704
+ return (_a = response.quoteChargeCreate) === null || _a === void 0 ? void 0 : _a.quoteCharge;
22527
22705
  };
22528
22706
 
22529
22707
  const mutation$3 = t(`
@@ -22600,6 +22778,7 @@ const CanShowQuantitiesInput_SubscriptionChargeFragment = t(`
22600
22778
  pricingModel
22601
22779
  expired
22602
22780
  selfServiceQuantity
22781
+ kind
22603
22782
  }
22604
22783
  `);
22605
22784
  const CanShowQuantitiesInput_SubscriptionFragment = t(`
@@ -22609,7 +22788,7 @@ const CanShowQuantitiesInput_SubscriptionFragment = t(`
22609
22788
  priceList {
22610
22789
  id
22611
22790
  }
22612
- chargeReport {
22791
+ currentCharges {
22613
22792
  ...CanShowQuantitiesInput_SubscriptionChargeFragment
22614
22793
  }
22615
22794
  }
@@ -22628,12 +22807,14 @@ const canShowQuantitiesInput = ({ charge: maskedCharge, subscription: maskedSubs
22628
22807
  const isPendingSubscription = (subscription === null || subscription === void 0 ? void 0 : subscription.state) === 'PENDING';
22629
22808
  const isTrialSubscription = (subscription === null || subscription === void 0 ? void 0 : subscription.state) === 'TRIAL';
22630
22809
  const isFlatPricing = (charge === null || charge === void 0 ? void 0 : charge.pricingModel) === 'FLAT';
22631
- const shouldProcessCharge = (isActiveSubscription || isPendingSubscription || isTrialSubscription) &&
22810
+ const isDiscount = (charge === null || charge === void 0 ? void 0 : charge.kind) === 'DISCOUNT' || (charge === null || charge === void 0 ? void 0 : charge.kind) === 'FREE_PERIOD_DISCOUNT';
22811
+ const quantityChangeAllowed = (isActiveSubscription || isPendingSubscription) &&
22812
+ !isDiscount &&
22813
+ !isTrialSubscription &&
22632
22814
  !isFlatPricing &&
22633
22815
  (charge === null || charge === void 0 ? void 0 : charge.selfServiceQuantity) &&
22634
22816
  !(charge === null || charge === void 0 ? void 0 : charge.expired);
22635
- // Now you can use the value of shouldProcessCharge to determine whether to process the charge.
22636
- return shouldProcessCharge;
22817
+ return quantityChangeAllowed;
22637
22818
  };
22638
22819
  const canShowChangeQuantities = ({ subscriptions, }) => {
22639
22820
  return subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.some(maskedSubscription => {
@@ -22641,7 +22822,7 @@ const canShowChangeQuantities = ({ subscriptions, }) => {
22641
22822
  if (!maskedSubscription)
22642
22823
  return false;
22643
22824
  const subscription = readFragment(CanShowQuantitiesInput_SubscriptionFragment, maskedSubscription);
22644
- return (_a = subscription === null || subscription === void 0 ? void 0 : subscription.chargeReport) === null || _a === void 0 ? void 0 : _a.some(charge => {
22825
+ return (_a = subscription === null || subscription === void 0 ? void 0 : subscription.currentCharges) === null || _a === void 0 ? void 0 : _a.some(charge => {
22645
22826
  return canShowQuantitiesInput({ charge, subscription: maskedSubscription });
22646
22827
  });
22647
22828
  });
@@ -22674,15 +22855,18 @@ const QuantityInput_SubscriptionFragment = t(`
22674
22855
  CanShowQuantitiesInput_SubscriptionFragment,
22675
22856
  ]);
22676
22857
  const DEBOUNCE_TIME$1 = 1000;
22677
- const QuantityInput = ({ charge: maskedCharge, editingQuote, editingQuoteId, setEditingQuoteData, subscription: maskedSubscription, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }) => {
22858
+ const QuantityInput = ({ charge: maskedCharge, subscription: maskedSubscription, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }) => {
22678
22859
  // Context
22679
22860
  const token = useToken();
22680
22861
  const { apiHost } = react.useContext(BunnyContext);
22862
+ const [quoteId, setQuoteId] = useQuoteId();
22863
+ const maskedQuote = useQuoteQueryData(quoteId);
22681
22864
  // Local state
22682
22865
  const [quantity, setQuantity] = react.useState();
22683
- // Derived state
22866
+ // Read fragments
22684
22867
  const charge = readFragment(QuantityInput_SubscriptionChargeFragment, maskedCharge);
22685
22868
  const subscription = readFragment(QuantityInput_SubscriptionFragment, maskedSubscription);
22869
+ const quote = readFragment(QuantityInput_QuoteFragment, maskedQuote);
22686
22870
  // Hooks
22687
22871
  const showErrorNotification = common.useErrorNotification();
22688
22872
  const { setQuoteQueryData } = useSetQuoteQueryData();
@@ -22702,9 +22886,15 @@ const QuantityInput = ({ charge: maskedCharge, editingQuote, editingQuoteId, set
22702
22886
  mutationFn: quoteChargeCreate$1,
22703
22887
  onSuccess: response => {
22704
22888
  var _a, _b;
22705
- if (!editingQuoteId)
22706
- throw new Error('editingQuoteId is required');
22707
- setQuoteQueryData(editingQuoteId, (_b = (_a = response === null || response === void 0 ? void 0 : response.quoteChange) === null || _a === void 0 ? void 0 : _a.quote) !== null && _b !== void 0 ? _b : null);
22889
+ if (!quoteId)
22890
+ throw new Error('quoteId is required');
22891
+ if ((_a = response === null || response === void 0 ? void 0 : response.quoteChange) === null || _a === void 0 ? void 0 : _a.quote) {
22892
+ setQuoteQueryData(quoteId, (_b = response === null || response === void 0 ? void 0 : response.quoteChange) === null || _b === void 0 ? void 0 : _b.quote);
22893
+ }
22894
+ setErrorUpdatingQuantity(false);
22895
+ },
22896
+ onError: () => {
22897
+ setErrorUpdatingQuantity(true);
22708
22898
  },
22709
22899
  });
22710
22900
  const createQuote = reactQuery.useMutation({
@@ -22713,16 +22903,15 @@ const QuantityInput = ({ charge: maskedCharge, editingQuote, editingQuoteId, set
22713
22903
  var _a, _b, _c;
22714
22904
  if (!(quote === null || quote === void 0 ? void 0 : quote.id))
22715
22905
  throw new Error('quote id is required');
22716
- setEditingQuoteData({
22717
- id: quote === null || quote === void 0 ? void 0 : quote.id,
22718
- isTrial: (subscription === null || subscription === void 0 ? void 0 : subscription.state) === 'TRIAL',
22719
- });
22906
+ setQuoteId(quote === null || quote === void 0 ? void 0 : quote.id);
22907
+ setQuoteQueryData(quote === null || quote === void 0 ? void 0 : quote.id, quote);
22720
22908
  const quoteChange = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a.find(quoteChange => { var _a, _b; return ((_a = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.priceList) === null || _a === void 0 ? void 0 : _a.id) === ((_b = subscription.priceList) === null || _b === void 0 ? void 0 : _b.id); });
22721
22909
  const subscriptionCharge = (_c = (_b = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.subscription) === null || _b === void 0 ? void 0 : _b.charges) === null || _c === void 0 ? void 0 : _c.find(subscriptionCharge => { var _a; return ((_a = subscriptionCharge === null || subscriptionCharge === void 0 ? void 0 : subscriptionCharge.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === charge.priceListChargeId; });
22722
22910
  if (!(quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id))
22723
22911
  throw new Error('quoteChange id is required');
22724
22912
  if (!(subscriptionCharge === null || subscriptionCharge === void 0 ? void 0 : subscriptionCharge.id))
22725
22913
  throw new Error('subscriptionCharge id is required');
22914
+ setErrorUpdatingQuantity(false);
22726
22915
  createCharge({
22727
22916
  apiHost,
22728
22917
  quantity,
@@ -22732,15 +22921,24 @@ const QuantityInput = ({ charge: maskedCharge, editingQuote, editingQuoteId, set
22732
22921
  token,
22733
22922
  });
22734
22923
  },
22924
+ onError: () => {
22925
+ setErrorUpdatingQuantity(true);
22926
+ },
22735
22927
  });
22736
22928
  const updateQuoteCharge = reactQuery.useMutation({
22737
- mutationFn: ({ quoteChargeId, quantity }) => quoteChargeUpdate(quoteChargeId, quantity, apiHost, token),
22929
+ mutationFn: ({ quoteChargeId, quantity, }) => {
22930
+ if (!quoteChargeId)
22931
+ throw new Error('quoteChargeId is required');
22932
+ return quoteChargeUpdate(quoteChargeId, quantity, apiHost, token);
22933
+ },
22738
22934
  onSuccess: response => {
22739
22935
  var _a;
22740
22936
  const quote = (_a = response === null || response === void 0 ? void 0 : response.quoteChange) === null || _a === void 0 ? void 0 : _a.quote;
22741
- if (!editingQuoteId)
22742
- throw new Error('editingQuoteId is required');
22743
- setQuoteQueryData(editingQuoteId, quote !== null && quote !== void 0 ? quote : null);
22937
+ if (!quoteId)
22938
+ throw new Error('quoteId is required');
22939
+ if (quote) {
22940
+ setQuoteQueryData(quoteId, quote);
22941
+ }
22744
22942
  setErrorUpdatingQuantity(false);
22745
22943
  },
22746
22944
  onError: () => {
@@ -22764,29 +22962,44 @@ const QuantityInput = ({ charge: maskedCharge, editingQuote, editingQuoteId, set
22764
22962
  setUpdatingChargeQuantityId(getUpdatingChargeQuantityId(charge.priceListChargeId, subscription.id));
22765
22963
  const quantityDelta = quantity - ((_a = charge.quantity) !== null && _a !== void 0 ? _a : 0);
22766
22964
  debouncedQuantityUpdate.cancel();
22767
- debouncedQuantityUpdate(charge.priceListChargeId, quantityDelta, subscription.id, editingQuote, // TODO: do not cast as Quote, use correct quote fragment type instead
22768
- editingQuoteId);
22965
+ debouncedQuantityUpdate(charge.priceListChargeId, quantityDelta, quantity, subscription.id, quote, quoteId);
22769
22966
  }
22770
22967
  };
22771
- const debouncedQuantityUpdate = react.useCallback(lodashExports.debounce((priceListChargeId, quantityDelta, subscriptionId, quote, editingQuoteId) => {
22968
+ const debouncedQuantityUpdate = react.useCallback(lodashExports.debounce((priceListChargeId, quantityDelta, quantity, subscriptionId, quote, quoteId) => {
22969
+ var _a, _b, _c;
22772
22970
  if (quantityDelta === 0) {
22773
22971
  setErrorUpdatingQuantity(true);
22774
22972
  showErrorNotification('New quantity cannot be the same as current');
22775
22973
  return;
22776
22974
  }
22777
22975
  // If we are not editing a quote, we create a new one
22778
- if (editingQuoteId === undefined) {
22976
+ if (quoteId === undefined) {
22779
22977
  createQuote.mutate(subscriptionId);
22780
22978
  }
22781
22979
  else {
22782
- const quoteChange = quote === null || quote === void 0 ? void 0 : quote.quoteChanges.find(quoteChange => { var _a; return quoteChange.priceList.id === ((_a = subscription.priceList) === null || _a === void 0 ? void 0 : _a.id); });
22783
- const quoteCharge = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.find(charge => charge.priceListCharge.id === priceListChargeId);
22980
+ const quoteChange = (_a = quote === null || quote === void 0 ? void 0 : quote.quoteChanges) === null || _a === void 0 ? void 0 : _a.find(quoteChange => { var _a, _b; return ((_a = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.priceList) === null || _a === void 0 ? void 0 : _a.id) === ((_b = subscription.priceList) === null || _b === void 0 ? void 0 : _b.id); });
22981
+ const quoteCharge = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.find(charge => { var _a; return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === priceListChargeId; });
22784
22982
  if (quoteCharge) {
22785
22983
  updateQuoteCharge.mutate({
22786
22984
  quoteChargeId: quoteCharge.id,
22787
22985
  quantity: quantityDelta,
22788
22986
  });
22789
22987
  }
22988
+ else {
22989
+ const subscriptionCharge = (_c = (_b = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.subscription) === null || _b === void 0 ? void 0 : _b.charges) === null || _c === void 0 ? void 0 : _c.find(subscriptionCharge => { var _a; return ((_a = subscriptionCharge === null || subscriptionCharge === void 0 ? void 0 : subscriptionCharge.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === priceListChargeId; });
22990
+ if (!(subscriptionCharge === null || subscriptionCharge === void 0 ? void 0 : subscriptionCharge.id))
22991
+ throw new Error('subscriptionCharge id is required');
22992
+ if (!(quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id))
22993
+ throw new Error('quoteChange id is required');
22994
+ createCharge({
22995
+ apiHost,
22996
+ quantity, // This is a new charge so use quantity instead of quantityDelta
22997
+ quoteChangeId: quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id,
22998
+ startDate: formatDateForApi(dayjs()),
22999
+ subscriptionChargeId: subscriptionCharge.id,
23000
+ token,
23001
+ });
23002
+ }
22790
23003
  }
22791
23004
  }, DEBOUNCE_TIME$1), []);
22792
23005
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(antd.Input, { className: "bunny-text-right", disabled: quantityDisabled, onChange: e => {
@@ -22826,37 +23039,19 @@ const QuantityChangeGridRow_SubscriptionFragment = t(`
22826
23039
  QuantityInput_SubscriptionFragment,
22827
23040
  ]);
22828
23041
  const { Text: Text$i } = antd.Typography;
22829
- const QuantityChangeGridRow = ({ editingQuote, editingQuoteId, setEditingQuoteData, subscription: maskedSubscription, subscriptionCharge: maskedSubscriptionCharge, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }) => {
23042
+ const QuantityChangeGridRow = ({ subscription: maskedSubscription, subscriptionCharge: maskedSubscriptionCharge, setUpdatingChargeQuantityId, updatingChargeQuantityId, setErrorUpdatingQuantity, }) => {
22830
23043
  var _a, _b;
22831
23044
  const subscription = readFragment(QuantityChangeGridRow_SubscriptionFragment, maskedSubscription);
22832
23045
  const charge = readFragment(QuantityChangeGridRow_SubscriptionChargeFragment, maskedSubscriptionCharge);
22833
23046
  if (!canShowQuantitiesInput({ charge, subscription }))
22834
23047
  return null;
22835
23048
  const { brandColor } = react.useContext(BrandContext);
22836
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx(Text$i, { className: "bunny-font-medium bunny-text-sm bunny-col-span-full", style: { color: brandColor }, children: (_a = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _a === void 0 ? void 0 : _a.name }), jsxRuntime.jsx(Text$i, { className: "bunny-text-sm", children: (_b = charge.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() })] }), jsxRuntime.jsx(Text$i, { className: "bunny-flex bunny-items-center bunny-justify-end bunny-font-medium bunny-text-sm bunny-text-gray-900", children: charge.quantity }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-justify-center bunny-items-end", children: [jsxRuntime.jsx(QuantityInput, { charge: charge, editingQuote: editingQuote, editingQuoteId: editingQuoteId, setEditingQuoteData: setEditingQuoteData, subscription: subscription, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }), jsxRuntime.jsx("div", {})] }), jsxRuntime.jsx(antd.Divider, { className: "bunny-col-span-full bunny-my-2" })] }));
23049
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-gap-1", children: [jsxRuntime.jsx(Text$i, { className: "bunny-font-medium bunny-text-sm bunny-col-span-full", style: { color: brandColor }, children: (_a = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _a === void 0 ? void 0 : _a.name }), jsxRuntime.jsx(Text$i, { className: "bunny-text-sm", children: (_b = charge.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() })] }), jsxRuntime.jsx(Text$i, { className: "bunny-flex bunny-items-center bunny-justify-end bunny-font-medium bunny-text-sm bunny-text-gray-900", children: charge.quantity }), jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-justify-center bunny-items-end", children: [jsxRuntime.jsx(QuantityInput, { charge: charge, subscription: subscription, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }), jsxRuntime.jsx("div", {})] }), jsxRuntime.jsx(antd.Divider, { className: "bunny-col-span-full bunny-my-2" })] }));
22837
23050
  };
22838
23051
 
22839
23052
  const { Text: Text$h } = antd.Typography;
22840
23053
  const QuantityChangeGridTitle = ({ children, right }) => (jsxRuntime.jsx(Text$h, { className: `bunny-font-medium bunny-text-sm bunny-text-slate-600 ${right ? 'bunny-text-right' : 'bunny-text-left'}`, children: children }));
22841
23054
 
22842
- const QuoteChangeSummarySection = ({ editingQuote, editingQuoteData, openCheckout, setEditingQuoteData, errorUpdatingQuantity, }) => {
22843
- const { apiHost } = react.useContext(BunnyContext);
22844
- const isMobile = common.useIsMobile();
22845
- const token = useToken();
22846
- const showSuccessNotification = common.useSuccessNotification();
22847
- const trialUpgradeMutation = reactQuery.useMutation({
22848
- mutationFn: (quoteId) => checkout({ quoteId, token, apiHost }),
22849
- onSuccess: () => {
22850
- setEditingQuoteData(undefined);
22851
- showSuccessNotification('Subscription updated successfully');
22852
- },
22853
- });
22854
- const disabled = !editingQuoteData || !editingQuote || errorUpdatingQuantity;
22855
- return (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-items-end", children: [editingQuote && !disabled && (jsxRuntime.jsxs("div", { className: "bunny-flex bunny-flex-col bunny-mb-8", children: [jsxRuntime.jsx("div", { className: "bunny-text-slate-500 bunny-text-right bunny-text-xs bunny-mb-2", children: "TOTAL" }), jsxRuntime.jsx("div", { className: `bunny-text-right ${isMobile ? 'bunny-text-2xl' : 'bunny-text-xl'}`, children: common.formatCurrency(getQuoteAmountDue(editingQuote), (editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.currencyId) || '') })] })), jsxRuntime.jsx("div", { className: `bunny-flex bunny-items-center bunny-justify-end ${isMobile ? 'bunny-w-full' : ''}`, children: jsxRuntime.jsx(antd.Button, { className: "bunny-w-full", onClick: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial)
22856
- ? () => trialUpgradeMutation.mutate(editingQuoteData.id)
22857
- : openCheckout, disabled: disabled, size: isMobile ? 'large' : 'middle', type: "primary", children: (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial) ? 'Activate Trial' : 'Proceed to checkout' }) })] }));
22858
- };
22859
-
22860
23055
  const QUANTITY_CHANGE_HEADER_TITLE = 'Update quantities';
22861
23056
  const QUANTITY_CHANGE_HEADER_DESCRIPTION = 'Adjust quantities below. The change will take effect immediately after checkout has been completed.';
22862
23057
  const QuantityDrawerDesktop_SubscriptionFragment = t(`
@@ -22868,7 +23063,7 @@ const QuantityDrawerDesktop_SubscriptionFragment = t(`
22868
23063
  ...QuantityChangeGridRow_SubscriptionFragment
22869
23064
  }
22870
23065
  `, [QuantityChangeGridRow_SubscriptionFragment, QuantityChangeGridRow_SubscriptionChargeFragment]);
22871
- const QuantityChangeDrawerDesktop = ({ editingQuote, editingQuoteData, onClose, open, openCheckout, setEditingQuoteData, subscriptions, setUpdatingChargeQuantityId, updatingChargeQuantityId, }) => {
23066
+ const QuantityChangeDrawerDesktop = ({ onClose, open, openCheckout, subscriptions, setUpdatingChargeQuantityId, updatingChargeQuantityId, }) => {
22872
23067
  const [openLocal, setOpenLocal] = react.useState(open);
22873
23068
  const [errorUpdatingQuantity, setErrorUpdatingQuantity] = react.useState(false);
22874
23069
  const isMobile = common.useIsMobile();
@@ -22910,9 +23105,9 @@ const QuantityChangeDrawerDesktop = ({ editingQuote, editingQuoteData, onClose,
22910
23105
  return (jsxRuntime.jsx("div", { className: "bunny-contents", children: (_a = subscription === null || subscription === void 0 ? void 0 : subscription.currentCharges) === null || _a === void 0 ? void 0 : _a.map((charge, chargeIndex) => {
22911
23106
  if (charge.chargeType === 'USAGE')
22912
23107
  return null;
22913
- return (jsxRuntime.jsx(QuantityChangeGridRow, { editingQuote: editingQuote, editingQuoteId: editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id, setEditingQuoteData: setEditingQuoteData, subscription: subscription, subscriptionCharge: charge, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }, chargeIndex));
23108
+ return (jsxRuntime.jsx(QuantityChangeGridRow, { subscription: subscription, subscriptionCharge: charge, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId, setErrorUpdatingQuantity: setErrorUpdatingQuantity }, chargeIndex));
22914
23109
  }) }, index));
22915
- })] }), jsxRuntime.jsx(QuoteChangeSummarySection, { editingQuote: editingQuote, editingQuoteData: editingQuoteData, openCheckout: openCheckout, setEditingQuoteData: setEditingQuoteData, errorUpdatingQuantity: errorUpdatingQuantity })] }));
23110
+ })] }), jsxRuntime.jsx(QuoteChangeSummarySection, { openCheckout: openCheckout, errorUpdatingQuantity: errorUpdatingQuantity })] }));
22916
23111
  };
22917
23112
 
22918
23113
  function invalidateSubscriptionsQueryKeys(queryClient, token) {
@@ -22936,45 +23131,19 @@ function invalidateSubscriptionsQueryKeys(queryClient, token) {
22936
23131
  });
22937
23132
  }
22938
23133
 
22939
- const useQuoteQueryData = (quoteId) => {
22940
- const token = useToken();
22941
- const { data } = reactQuery.useQuery({
22942
- queryKey: common.QueryKeyFactory.default.createObjectKey({
22943
- id: quoteId,
22944
- objectName: 'editingQuote',
22945
- token,
22946
- }),
22947
- queryFn: () => {
22948
- // This queryFn should never be called if data is set via setQueryData
22949
- // If called, it means data doesn't exist - return undefined
22950
- // In practice, data should always be set via setQueryData before this hook is used
22951
- return undefined;
22952
- },
22953
- enabled: false,
22954
- staleTime: Infinity, // Never consider data stale, only use cache
22955
- gcTime: Infinity, // Never garbage collect this data
22956
- // Don't refetch if data exists in cache
22957
- refetchOnMount: false,
22958
- refetchOnWindowFocus: false,
22959
- refetchOnReconnect: false,
22960
- });
22961
- return data;
22962
- };
22963
-
22964
- const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, setShowInactive, }) => {
23134
+ const QuantityDrawerContent = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, setShowInactive, }) => {
22965
23135
  const token = useToken();
22966
23136
  const queryClient = reactQuery.useQueryClient();
22967
23137
  const showSuccessNotification = common.useSuccessNotification();
22968
23138
  // State management
22969
- const [editingQuoteData, setEditingQuoteData] = react.useState();
23139
+ const [quoteId, setQuoteId] = useQuoteId();
22970
23140
  const [payModalVisible, setPayModalVisible] = react.useState(false);
22971
23141
  const [updatingChargeQuantityId, setUpdatingChargeQuantityId] = react.useState(undefined);
22972
- const maskedQuote = useQuoteQueryData(editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id);
22973
- const quote = readFragment(QuantityDrawer_QuoteFragment, maskedQuote);
23142
+ const quote = useQuoteQueryData(quoteId);
22974
23143
  // Handlers
22975
23144
  const onSuccess = () => {
22976
23145
  setQuantityDrawerOpen(false);
22977
- setEditingQuoteData(undefined);
23146
+ setQuoteId(undefined);
22978
23147
  queryClient.invalidateQueries({
22979
23148
  queryKey: common.QueryKeyFactory.default.transactionsKey({ token }),
22980
23149
  });
@@ -22993,14 +23162,17 @@ const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOp
22993
23162
  const handleDrawerClose = () => {
22994
23163
  if (updatingChargeQuantityId) {
22995
23164
  setUpdatingChargeQuantityId(undefined);
22996
- setEditingQuoteData(undefined);
23165
+ setQuoteId(undefined);
22997
23166
  }
22998
23167
  setQuantityDrawerOpen(false);
22999
23168
  };
23000
23169
  const handleOpenCheckout = () => {
23001
23170
  setPayModalVisible(true);
23002
23171
  };
23003
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(QuantityChangeDrawerDesktop, { editingQuote: quote, editingQuoteData: editingQuoteData, onClose: handleDrawerClose, open: quantityDrawerOpen, openCheckout: handleOpenCheckout, setEditingQuoteData: setEditingQuoteData, subscriptions: subscriptions, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId }), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isUpdatingQuote: false })] }));
23172
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(QuantityChangeDrawerDesktop, { onClose: handleDrawerClose, open: quantityDrawerOpen, openCheckout: handleOpenCheckout, subscriptions: subscriptions, setUpdatingChargeQuantityId: setUpdatingChargeQuantityId, updatingChargeQuantityId: updatingChargeQuantityId }), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isUpdatingQuote: false })] }));
23173
+ };
23174
+ const QuantityDrawer = ({ subscriptions, quantityDrawerOpen, setQuantityDrawerOpen, handlePortalErrors, setShowInactive, }) => {
23175
+ return (jsxRuntime.jsx(QuoteIdProvider, { children: jsxRuntime.jsx(QuantityDrawerContent, { subscriptions: subscriptions, quantityDrawerOpen: quantityDrawerOpen, setQuantityDrawerOpen: setQuantityDrawerOpen, handlePortalErrors: handlePortalErrors, setShowInactive: setShowInactive }) }));
23004
23176
  };
23005
23177
 
23006
23178
  const useCancelSubscription = () => {
@@ -24822,6 +24994,7 @@ mutation QuoteChargeCreate ($quoteChangeId: ID!, $startDate: ISO8601Date!, $endD
24822
24994
 
24823
24995
  `;
24824
24996
  const quoteChargeCreate = async ({ price, priceListChargeId, quantity, quoteChangeId, startDate, subscriptionChargeId, token, apiHost, }) => {
24997
+ var _a;
24825
24998
  const response = await gqlRequest({
24826
24999
  query: QUOTE_CHARGE_CREATE,
24827
25000
  vars: {
@@ -24835,10 +25008,7 @@ const quoteChargeCreate = async ({ price, priceListChargeId, quantity, quoteChan
24835
25008
  apiHost,
24836
25009
  token,
24837
25010
  });
24838
- if (response.errors) {
24839
- throw new Error(response.errors[0].message);
24840
- }
24841
- return response.quoteChargeCreate.quoteCharge;
25011
+ return (_a = response === null || response === void 0 ? void 0 : response.quoteChargeCreate) === null || _a === void 0 ? void 0 : _a.quoteCharge;
24842
25012
  };
24843
25013
 
24844
25014
  const mutation = t(`