@solvimon/solvimon-web 0.1.0-alpha.7 → 0.1.0-alpha.8

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 (202) hide show
  1. package/dist/ApiStatus-CyNDp_op.mjs +9 -0
  2. package/dist/ApiStatus-oqvUEWJx.js +1 -0
  3. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +1 -0
  4. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs} +2 -4
  5. package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-BTdixy3L.mjs} +2 -11
  6. package/dist/ContentWithAsideLayout-oAYVrLvL.js +1 -0
  7. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs} +2 -5
  8. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +1 -0
  9. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +1 -0
  10. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs} +1 -2
  11. package/dist/PaymentHistoryBlock-DHM-3fh-.js +1 -0
  12. package/dist/PaymentHistoryBlock-YzJ6bxKr.mjs +4 -0
  13. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs} +1 -5
  14. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +1 -0
  15. package/dist/PaymentIntegrationForm-Cl5ua8v8.js +1 -0
  16. package/dist/PaymentIntegrationForm-ID4QnvA3.mjs +4 -0
  17. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs} +32 -189
  18. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +1 -0
  19. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js +1 -0
  20. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs} +5 -31
  21. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs} +4 -7
  22. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +1 -0
  23. package/dist/adyenLoader-CEH4A2b2.js +1 -0
  24. package/dist/adyenLoader-gsbzSjYV.mjs +177 -0
  25. package/dist/component-C2Gc-wsE.js +1 -0
  26. package/dist/component-CM9g6tbD.mjs +804 -0
  27. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  28. package/dist/components/BillingInformation/BillingInformation.es.js +3 -7
  29. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  30. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +9 -17
  31. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  32. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -7
  33. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  34. package/dist/components/Invoice/Invoice.es.js +42 -2659
  35. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  36. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -7
  37. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  38. package/dist/components/InvoicesList/InvoicesList.es.js +2 -6
  39. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  40. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -7
  41. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  42. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -33
  43. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  44. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +8 -4824
  45. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  46. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -8
  47. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  48. package/dist/components/WalletBalances/WalletBalances.es.js +3 -7
  49. package/dist/core/index.cjs.js +1 -1
  50. package/dist/core/index.es.js +1 -1
  51. package/dist/core/types.d.ts +2 -0
  52. package/dist/{customer-CcQR-JIm.js → customer-C_Hz_npf.js} +1 -1
  53. package/dist/{customer-CJrpbGX4.mjs → customer-TIi7iZFw.mjs} +1 -1
  54. package/dist/en-US-CBoPxQwX.mjs +199 -0
  55. package/dist/en-US-DJq-9dD8.js +1 -0
  56. package/dist/index-CzL1ZcGi.mjs +85 -0
  57. package/dist/index-DRdBmZ2-.js +1 -0
  58. package/dist/index.cjs.js +1 -1
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.es.js +4 -1
  61. package/dist/{invoices-CNK1Ushv.mjs → invoices-BuVOuTOm.mjs} +2 -15
  62. package/dist/invoices-DbvwXAsm.js +1 -0
  63. package/dist/nl-NL-BB7KbK-h.mjs +181 -0
  64. package/dist/nl-NL-CtU1Lg2F.js +1 -0
  65. package/dist/paymentMethods-B4AYGf0K.js +1 -0
  66. package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-Di32oJ39.mjs} +2 -2
  67. package/dist/{payments-CE9U7aKK.mjs → payments-C5fD1PXB.mjs} +1 -1
  68. package/dist/{payments-CLt0SExf.js → payments-DeutKq9x.js} +1 -1
  69. package/dist/{registry-B99ZnfEn.mjs → registry-BLwMl1bK.mjs} +6 -4
  70. package/dist/registry-CMSmkLcy.js +1 -0
  71. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  72. package/dist/screens/Checkout/Checkout.es.js +420 -2388
  73. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  74. package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -14
  75. package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
  76. package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
  77. package/dist/screens/PayInvoice/PayInvoice.es.js +456 -0
  78. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  79. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +79 -61
  80. package/dist/solvimon-web.css +1 -1
  81. package/dist/source-DKDKBlUm.mjs +179 -0
  82. package/dist/source-dkMNFWDc.js +1 -0
  83. package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-mOgjjzUi.mjs} +2 -2
  84. package/dist/subscriptions-wdMADcQZ.js +1 -0
  85. package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-B4gszz0Q.mjs} +1 -1
  86. package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-DfS2P0bd.js} +1 -1
  87. package/dist/{useCustomer-PthyTFLl.js → useCustomer-DanZzn-l.js} +1 -1
  88. package/dist/{useCustomer--jycAz--.mjs → useCustomer-cbhDyWJL.mjs} +2 -2
  89. package/dist/useIncrementalLoading-DFe5Yh8M.js +1 -0
  90. package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-RRicokf1.mjs} +3 -8
  91. package/dist/useInvoiceData-CxxHa5R2.js +1 -0
  92. package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-fS6G_244.mjs} +6 -12
  93. package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-BQQxcPdz.mjs} +23 -260
  94. package/dist/useInvoicesList-CtJqmblZ.js +1 -0
  95. package/dist/usePaymentMethodOptions-2MloZ9bY.mjs +26 -0
  96. package/dist/usePaymentMethodOptions-D01YWW3G.js +1 -0
  97. package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-Cm9WdSW0.js} +1 -1
  98. package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-DZvfWSlx.mjs} +2 -2
  99. package/dist/usePayments-B13S_yai.js +1 -0
  100. package/dist/usePayments-D4uGKBsV.mjs +36 -0
  101. package/dist/usePortal-DJDJNLbo.mjs +12 -0
  102. package/dist/usePortal-DWJEVkTj.js +1 -0
  103. package/dist/useService-9fCKPTmu.js +1 -0
  104. package/dist/useService-BuWWE5ND.mjs +68 -0
  105. package/dist/useViewport-Bu0cyeSi.mjs +38 -0
  106. package/dist/useViewport-CKRY1CKR.js +1 -0
  107. package/dist/useWalletBalanceItems-B53Gkjro.mjs +106 -0
  108. package/dist/useWalletBalanceItems-BMaVT4TW.js +1 -0
  109. package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
  110. package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
  111. package/dist/vendor-ui-BwxuPDg8.mjs +28598 -0
  112. package/dist/vendor-ui-Ce_Yp7xA.js +1 -0
  113. package/package.json +17 -10
  114. package/dist/Alert.vue.es-DMPvSykx.js +0 -1
  115. package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
  116. package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
  117. package/dist/Amount.vue.es-h8wulbBG.js +0 -1
  118. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
  119. package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
  120. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
  121. package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
  122. package/dist/Button.vue.es-BC4_TItq.js +0 -1
  123. package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
  124. package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
  125. package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
  126. package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
  127. package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
  128. package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
  129. package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
  130. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
  131. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
  132. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
  133. package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
  134. package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
  135. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
  136. package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
  137. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
  138. package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
  139. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
  140. package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
  141. package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
  142. package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
  143. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
  144. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
  145. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
  146. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
  147. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
  148. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
  149. package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
  150. package/dist/Section.vue.es-BuzTXRLP.js +0 -1
  151. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
  152. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
  153. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
  154. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
  155. package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
  156. package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
  157. package/dist/_Uint8Array-DxISR7XF.js +0 -1
  158. package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
  159. package/dist/_flatRest.es-dFffnTpX.js +0 -1
  160. package/dist/api.es-B4qAAJKr.js +0 -1
  161. package/dist/api.es-UkfpLiLL.mjs +0 -83
  162. package/dist/cloneDeep-Hs8Pp07F.js +0 -1
  163. package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
  164. package/dist/cn.es-C7xoIs3C.js +0 -1
  165. package/dist/cn.es-tfxVlz02.mjs +0 -3191
  166. package/dist/component-ZRZIt3ZW.js +0 -1
  167. package/dist/component-dpA83LIN.mjs +0 -6569
  168. package/dist/countryData.es--zJAd6LA.mjs +0 -252
  169. package/dist/countryData.es-D3MFzU92.js +0 -1
  170. package/dist/customer.es-D42Md24r.js +0 -1
  171. package/dist/customer.es-LIW2YmLL.mjs +0 -30
  172. package/dist/formatting.es-9hM8aHSg.js +0 -1
  173. package/dist/formatting.es-D5H_ySFv.mjs +0 -68
  174. package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
  175. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
  176. package/dist/index-2jo9BSPM.js +0 -1
  177. package/dist/index-BFZ0dPh9.mjs +0 -179
  178. package/dist/index-CI71bVGE.mjs +0 -2521
  179. package/dist/index-CWSXne1Q.js +0 -1
  180. package/dist/index-D3v7hAtc.mjs +0 -253
  181. package/dist/index-WLSPwi90.js +0 -1
  182. package/dist/index.es-BBJF2O2l.js +0 -1
  183. package/dist/index.es-LCAKs4tH.mjs +0 -438
  184. package/dist/invoices-3kVHsAXr.js +0 -1
  185. package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
  186. package/dist/isEmpty.es-Dycf-CD_.js +0 -1
  187. package/dist/paymentMethods-DZRf0WRl.js +0 -1
  188. package/dist/pick.es-BgDAfhAl.js +0 -1
  189. package/dist/pick.es-DdVOyp0Q.mjs +0 -45
  190. package/dist/registry-ClZ43bQn.js +0 -1
  191. package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
  192. package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
  193. package/dist/subscriptions-CS8HTxzC.js +0 -1
  194. package/dist/typeGuards.es-C4nR5FkL.js +0 -1
  195. package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
  196. package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
  197. package/dist/useInvoiceData-DvQO_nKz.js +0 -1
  198. package/dist/useInvoicesList-CHkwSNO9.js +0 -1
  199. package/dist/useService-B67YWAcN.js +0 -1
  200. package/dist/useService-DG_zedHV.mjs +0 -282
  201. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
  202. package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
@@ -1,2625 +1,10 @@
1
- import { ref, defineComponent, useAttrs, computed, toRefs, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementVNode, normalizeClass, unref, renderSlot, createCommentVNode, mergeDefaults, createPropsRestProxy, createSlots, createElementBlock, createTextVNode, toDisplayString, Fragment, renderList, createVNode, withKeys, normalizeProps, guardReactiveProps, isRef } from "vue";
1
+ import { defineComponent, renderSlot, unref, computed, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createVNode, withCtx, createTextVNode, toDisplayString, withKeys, normalizeClass, createCommentVNode, createBlock, defineAsyncComponent, normalizeProps, guardReactiveProps } from "vue";
2
2
  import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
3
- import { c as createInvoicesService } from "../../invoices-CNK1Ushv.mjs";
4
- import { u as useService } from "../../useService-DG_zedHV.mjs";
5
- import { c as createPaymentsService } from "../../payments-CE9U7aKK.mjs";
6
- import { a as useIntl, _ as _sfc_main$A, f as formatTimezone, b as _sfc_main$G, d as defineCustomElement, g as getComponentName } from "../../component-dpA83LIN.mjs";
7
- import { _ as _sfc_main$F } from "../../CustomerBillingInformation.vue.es-DBMl01Es.mjs";
8
- import { _ as _sfc_main$u, u as useToggleList, a as _sfc_main$z } from "../../Comparators.vue.es-DdTKGB80.mjs";
9
- import { b as _export_sfc, _ as _sfc_main$w } from "../../Chip.vue.es-DcW2CjUA.mjs";
10
- import { u as useBreakpoints, b as breakpointsTailwind } from "../../index.es-LCAKs4tH.mjs";
11
- import { u as useButtonClasses, a as _sfc_main$r, b as buttonPropsDefault, _ as _sfc_main$s } from "../../Button.vue.es-6sBk5tBL.mjs";
12
- import { _ as _sfc_main$t } from "../../FormMessage.vue.es-DFQXxiSC.mjs";
13
- import { _ as _sfc_main$C } from "../../Section.vue.es-3-H1pUTB.mjs";
14
- import { _ as _sfc_main$v } from "../../Amount.vue.es-C6JE5rL8.mjs";
15
- import { g as getCustomerName } from "../../customer.es-LIW2YmLL.mjs";
16
- import { g as getComposedString } from "../../Avatar.vue.es-Ba8ZGfm4.mjs";
17
- import { a as formatAmount, f as formatEnum } from "../../formatting.es-D5H_ySFv.mjs";
18
- import { _ as _sfc_main$x, T as TooltipContent, a as _sfc_main$y } from "../../TooltipParagraph.vue.es-DVJLF9Kv.mjs";
19
- import { _ as _sfc_main$B } from "../../DividerText.vue.es-B7oa5Xpn.mjs";
20
- import { i as isEmpty } from "../../isEmpty.es-Bp1SbWFu.mjs";
21
- import { u as useWindowSize } from "../../index-D3v7hAtc.mjs";
22
- import { _ as _sfc_main$D } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs";
23
- import { _ as _sfc_main$E } from "../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs";
24
- const useSimpleToggleList = (initialToggledItems = []) => {
25
- const toggledItems = ref(initialToggledItems);
26
- const toggle = (index) => {
27
- const match = toggledItems.value.find((groupIndex) => groupIndex === index);
28
- if (typeof match === "number") {
29
- toggledItems.value = toggledItems.value.filter((groupIndex) => groupIndex !== index);
30
- } else {
31
- toggledItems.value = [...toggledItems.value, index];
32
- }
33
- };
34
- return [toggledItems, toggle];
35
- };
36
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
37
- __name: "Link",
38
- props: /* @__PURE__ */ mergeDefaults({
39
- external: { type: Boolean },
40
- showOnHover: { type: Boolean },
41
- button: { type: Boolean },
42
- to: {},
43
- target: {},
44
- custom: { type: Boolean },
45
- activeClass: {},
46
- exactActiveClass: {},
47
- ariaCurrentValue: {},
48
- viewTransition: { type: Boolean },
49
- replace: { type: Boolean },
50
- type: {},
51
- variant: {},
52
- color: {},
53
- size: {},
54
- pill: { type: Boolean },
55
- square: { type: Boolean },
56
- loading: { type: Boolean },
57
- disabled: { type: Boolean },
58
- iconPrefix: {},
59
- iconSuffix: {},
60
- tag: {}
61
- }, {
62
- external: false,
63
- showOnHover: false,
64
- button: false,
65
- //props for button styling
66
- ...buttonPropsDefault
67
- }),
68
- setup(__props) {
69
- const props = __props;
70
- const attrs = useAttrs();
71
- const isExternal = ref(!!attrs.href);
72
- const derivedTarget = computed(() => props.target === null ? "_self" : "_blank");
73
- const currentComponent = computed(() => {
74
- const customProps = isExternal.value ? {
75
- rel: "noopener noreferrer",
76
- target: derivedTarget.value
77
- } : { to: props.to, target: props.target || null };
78
- return {
79
- tag: isExternal.value ? "a" : "RouterLink",
80
- props: { ...attrs, ...customProps }
81
- };
82
- });
83
- const { wrapperClasses, spanClasses } = useButtonClasses(toRefs(props));
84
- const linkClass = computed(
85
- () => props.button ? `inline-flex text-center hover:no-underline ${wrapperClasses.value} text-sm` : `group hover:text-blue-600 hover:underline ${props.showOnHover ? "hover:text-blue-600" : "text-blue-600"}`
86
- );
87
- return (_ctx, _cache) => {
88
- return openBlock(), createBlock(resolveDynamicComponent(currentComponent.value.tag), mergeProps(currentComponent.value.props, { class: linkClass.value }), {
89
- default: withCtx(() => [
90
- createElementVNode("span", {
91
- class: normalizeClass({ [`${unref(spanClasses)} flex items-center grow`]: props.button })
92
- }, [
93
- renderSlot(_ctx.$slots, "default"),
94
- __props.external && !__props.button ? (openBlock(), createBlock(unref(_sfc_main$r), {
95
- key: 0,
96
- icon: "arrow_outward",
97
- size: "xs",
98
- class: normalizeClass(["ml-0.5", { "invisible group-hover:visible": props.showOnHover }])
99
- }, null, 8, ["class"])) : createCommentVNode("", true)
100
- ], 2)
101
- ]),
102
- _: 3
103
- }, 16, ["class"]);
104
- };
105
- }
106
- });
107
- const _hoisted_1$k = {
108
- key: 1,
109
- class: "flex flex-col items-end gap-1"
110
- };
111
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
112
- __name: "DownloadButton",
113
- props: {
114
- downloadService: { type: Function },
115
- mobileIconOnly: { type: Boolean, default: false },
116
- type: {},
117
- variant: { default: "outline" },
118
- color: { default: "gray" },
119
- size: { default: "md" },
120
- pill: { type: Boolean },
121
- square: { type: Boolean },
122
- loading: { type: Boolean },
123
- disabled: { type: Boolean },
124
- iconPrefix: {},
125
- iconSuffix: {},
126
- tag: {}
127
- },
128
- setup(__props) {
129
- const { $t } = useIntl();
130
- const buttonProps = createPropsRestProxy(__props, ["downloadService", "size", "color", "mobileIconOnly", "variant"]);
131
- const isFailed = ref(false);
132
- const isLoading = ref(false);
133
- const breakpoints = useBreakpoints(breakpointsTailwind);
134
- const isMobile = breakpoints.smaller("md");
135
- const isIconOnly = computed(() => __props.mobileIconOnly && isMobile.value);
136
- const handleDownload = async () => {
137
- isLoading.value = true;
138
- isFailed.value = false;
139
- try {
140
- await __props.downloadService();
141
- } catch {
142
- isFailed.value = true;
143
- } finally {
144
- isLoading.value = false;
145
- }
146
- };
147
- return (_ctx, _cache) => {
148
- return !isFailed.value ? (openBlock(), createBlock(unref(_sfc_main$s), mergeProps({ key: 0 }, { ...buttonProps, size: __props.size, color: __props.color }, {
149
- disabled: isLoading.value,
150
- loading: isLoading.value,
151
- variant: __props.variant,
152
- type: "button",
153
- "icon-prefix": "download",
154
- onClick: handleDownload
155
- }), createSlots({ _: 2 }, [
156
- _ctx.$slots.default && !isIconOnly.value ? {
157
- name: "default",
158
- fn: withCtx(() => [
159
- !!_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)
160
- ]),
161
- key: "0"
162
- } : void 0
163
- ]), 1040, ["disabled", "loading", "variant"])) : (openBlock(), createElementBlock("div", _hoisted_1$k, [
164
- !isFailed.value ? (openBlock(), createBlock(unref(_sfc_main$s), mergeProps({ key: 0 }, { ...buttonProps, size: __props.size, color: __props.color }, {
165
- disabled: isLoading.value,
166
- loading: isLoading.value,
167
- type: "button",
168
- "icon-prefix": "download",
169
- onClick: handleDownload
170
- }), createSlots({ _: 2 }, [
171
- _ctx.$slots.default && !isIconOnly.value ? {
172
- name: "default",
173
- fn: withCtx(() => [
174
- !!_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)
175
- ]),
176
- key: "0"
177
- } : void 0
178
- ]), 1040, ["disabled", "loading"])) : createCommentVNode("", true),
179
- isFailed.value ? (openBlock(), createBlock(unref(_sfc_main$t), { key: 1 }, {
180
- default: withCtx(() => [
181
- createTextVNode(toDisplayString(unref($t)({
182
- id: "download_button.download_failed_message",
183
- defaultMessage: "Download failed, please try again later",
184
- description: "Error message when a download fails"
185
- })), 1)
186
- ]),
187
- _: 1
188
- })) : createCommentVNode("", true)
189
- ]));
190
- };
191
- }
192
- });
193
- const _hoisted_1$j = { class: "flex items-start gap-2" };
194
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
195
- __name: "InfoBlock",
196
- props: {
197
- variant: { default: "default" },
198
- hasIcon: { type: Boolean }
199
- },
200
- setup(__props) {
201
- const iconMapping = {
202
- default: "info",
203
- warning: "error",
204
- danger: "error"
205
- };
206
- return (_ctx, _cache) => {
207
- return openBlock(), createElementBlock("div", {
208
- class: normalizeClass(["px-4 py-3 rounded border text-sm flex justify-between items-center gap-2", {
209
- "bg-blue-50 border-blue-100 text-blue-700": __props.variant === "default",
210
- "bg-red-50 border-red-100 text-red-700": __props.variant === "danger",
211
- "bg-yellow-50 border-yellow-100 text-yellow-700": __props.variant === "warning"
212
- }])
213
- }, [
214
- createElementVNode("div", _hoisted_1$j, [
215
- __props.hasIcon ? (openBlock(), createBlock(unref(_sfc_main$r), {
216
- key: 0,
217
- icon: iconMapping[__props.variant],
218
- size: "xs",
219
- class: "shrink-0"
220
- }, null, 8, ["icon"])) : createCommentVNode("", true),
221
- createElementVNode("div", null, [
222
- renderSlot(_ctx.$slots, "default")
223
- ])
224
- ]),
225
- createElementVNode("div", null, [
226
- renderSlot(_ctx.$slots, "cta")
227
- ])
228
- ], 2);
229
- };
230
- }
231
- });
232
- const _sfc_main$n = {};
233
- const _hoisted_1$i = { class: "w-full" };
234
- function _sfc_render(_ctx, _cache) {
235
- return openBlock(), createElementBlock("table", _hoisted_1$i, [
236
- renderSlot(_ctx.$slots, "default")
237
- ]);
238
- }
239
- const InvoiceTable = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render]]);
240
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
241
- __name: "InvoiceTableData",
242
- props: {
243
- number: { type: Boolean, default: false },
244
- hasPadding: { type: Boolean, default: true }
245
- },
246
- setup(__props) {
247
- return (_ctx, _cache) => {
248
- return openBlock(), createElementBlock("td", {
249
- class: normalizeClass({
250
- "text-right tabular-nums": __props.number,
251
- "py-2": __props.hasPadding
252
- })
253
- }, [
254
- renderSlot(_ctx.$slots, "default")
255
- ], 2);
256
- };
257
- }
258
- });
259
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
260
- __name: "InvoiceTableHeader",
261
- props: {
262
- left: { type: Boolean, default: false },
263
- right: { type: Boolean, default: false }
264
- },
265
- setup(__props) {
266
- return (_ctx, _cache) => {
267
- return openBlock(), createElementBlock("th", {
268
- class: normalizeClass(["py-1.5 font-bold border-b text-gray-400 text-xs uppercase", { "text-left": __props.left, "text-right": __props.right }])
269
- }, [
270
- renderSlot(_ctx.$slots, "default")
271
- ], 2);
272
- };
273
- }
274
- });
275
- const _hoisted_1$h = { class: "flex items-center" };
276
- const _hoisted_2$b = {
277
- key: 0,
278
- class: "text-xs text-gray-400"
279
- };
280
- const _hoisted_3$7 = { class: "flex items-center" };
281
- const _hoisted_4$7 = { key: 0 };
282
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
283
- __name: "InvoiceSubLineRow",
284
- props: {
285
- subLines: {},
286
- isOpen: { type: Boolean },
287
- lineOrder: {},
288
- periodOrder: {},
289
- groupOrder: {},
290
- processingOnlyCustomers: {}
291
- },
292
- setup(__props) {
293
- const { formatMessage } = useIntl();
294
- const props = __props;
295
- const getCustomerName$1 = (customerId) => {
296
- var _a;
297
- const childCustomer = (_a = props.processingOnlyCustomers) == null ? void 0 : _a.find(
298
- (childCustomer2) => childCustomer2.id === customerId
299
- );
300
- if (!childCustomer) {
301
- return formatMessage({
302
- id: "generic.not_available",
303
- defaultMessage: "N/A",
304
- description: "Used in scenarios where no data is available to be displayed"
305
- });
306
- }
307
- return getCustomerName(childCustomer);
308
- };
309
- const getSubLineConditions = (subLine) => {
310
- var _a;
311
- return ((_a = subLine.usage_based_conversion) == null ? void 0 : _a.conditions) ?? subLine.conditions;
312
- };
313
- return (_ctx, _cache) => {
314
- return __props.subLines && __props.isOpen ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
315
- !__props.processingOnlyCustomers ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.subLines, (subLine, subLineIndex) => {
316
- return openBlock(), createElementBlock("tr", {
317
- key: subLineIndex,
318
- class: normalizeClass(subLineIndex > 0 ? "border-t" : "")
319
- }, [
320
- createVNode(_sfc_main$m, { class: "w-1/3" }, {
321
- default: withCtx(() => {
322
- var _a, _b, _c, _d, _e, _f;
323
- return [
324
- createElementVNode("div", _hoisted_1$h, [
325
- renderSlot(_ctx.$slots, "invoice-line-prefix", {
326
- lineOrder: __props.lineOrder,
327
- periodOrder: __props.periodOrder,
328
- groupOrder: __props.groupOrder
329
- }),
330
- createElementVNode("div", null, [
331
- createElementVNode("div", null, [
332
- subLine.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
333
- createTextVNode(toDisplayString(subLine.description), 1)
334
- ], 64)) : subLine.details.description ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
335
- createTextVNode(toDisplayString(subLine.details.description), 1)
336
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
337
- createTextVNode(" N/A ")
338
- ], 64))
339
- ]),
340
- ((_a = getSubLineConditions(subLine)) == null ? void 0 : _a.name) || ((_b = getSubLineConditions(subLine)) == null ? void 0 : _b.meter_properties) ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
341
- ((_c = getSubLineConditions(subLine)) == null ? void 0 : _c.name) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
342
- createTextVNode(toDisplayString((_d = getSubLineConditions(subLine)) == null ? void 0 : _d.name), 1)
343
- ], 64)) : ((_e = getSubLineConditions(subLine)) == null ? void 0 : _e.meter_properties) ? (openBlock(), createBlock(unref(_sfc_main$u), {
344
- key: 1,
345
- comparators: (_f = getSubLineConditions(subLine)) == null ? void 0 : _f.meter_properties
346
- }, null, 8, ["comparators"])) : createCommentVNode("", true)
347
- ])) : createCommentVNode("", true)
348
- ])
349
- ])
350
- ];
351
- }),
352
- _: 2
353
- }, 1024),
354
- createVNode(_sfc_main$m, {
355
- number: "",
356
- class: "w-1/7 text-right tabular-nums"
357
- }, {
358
- default: withCtx(() => {
359
- var _a, _b;
360
- return [
361
- createTextVNode(toDisplayString(((_b = (_a = subLine.details.conversion) == null ? void 0 : _a.credits) == null ? void 0 : _b.quantity) ?? "N/A"), 1)
362
- ];
363
- }),
364
- _: 2
365
- }, 1024),
366
- createVNode(_sfc_main$m, { class: "w-1/7 text-right tabular-nums" }, {
367
- default: withCtx(() => {
368
- var _a, _b;
369
- return [
370
- ((_a = subLine.details.band) == null ? void 0 : _a.amount) ? (openBlock(), createBlock(_sfc_main$v, {
371
- key: 0,
372
- value: subLine.details.band.amount
373
- }, null, 8, ["value"])) : ((_b = subLine.details.band) == null ? void 0 : _b.percentage) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
374
- createTextVNode(toDisplayString(subLine.details.band.percentage) + "% ", 1)
375
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
376
- createTextVNode(" N/A ")
377
- ], 64))
378
- ];
379
- }),
380
- _: 2
381
- }, 1024),
382
- createVNode(_sfc_main$m, null, {
383
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
384
- createTextVNode(" ", -1)
385
- ])]),
386
- _: 1
387
- }),
388
- subLine.details.amount ? (openBlock(), createBlock(_sfc_main$m, {
389
- key: 0,
390
- class: "w-1/7 text-right tabular-nums"
391
- }, {
392
- default: withCtx(() => [
393
- createVNode(_sfc_main$v, {
394
- value: subLine.details.amount
395
- }, null, 8, ["value"])
396
- ]),
397
- _: 2
398
- }, 1024)) : createCommentVNode("", true)
399
- ], 2);
400
- }), 128)) : createCommentVNode("", true),
401
- __props.processingOnlyCustomers ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.subLines, (subLine, i) => {
402
- return openBlock(), createElementBlock("tr", {
403
- key: i,
404
- tabindex: void 0,
405
- class: normalizeClass(["group", { "border-t": i !== 0 }])
406
- }, [
407
- createVNode(_sfc_main$m, { class: "pl-4" }, {
408
- default: withCtx(() => [
409
- createElementVNode("div", _hoisted_3$7, [
410
- subLine.processing_only_customer_resource_id ? (openBlock(), createElementBlock("div", _hoisted_4$7, toDisplayString(getCustomerName$1(
411
- subLine.processing_only_customer_resource_id
412
- )), 1)) : createCommentVNode("", true)
413
- ])
414
- ]),
415
- _: 2
416
- }, 1024),
417
- renderSlot(_ctx.$slots, "subline-content", {
418
- details: subLine.details,
419
- hideTaxDetails: true
420
- })
421
- ], 2);
422
- }), 128)) : createCommentVNode("", true)
423
- ], 64)) : createCommentVNode("", true);
424
- };
425
- }
426
- });
427
- const _hoisted_1$g = ["tabindex", "onClick"];
428
- const _hoisted_2$a = { class: "flex items-center" };
429
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
430
- __name: "InvoiceCommitment",
431
- props: {
432
- commitments: {},
433
- groupOrder: {},
434
- invoicePeriodOrder: {}
435
- },
436
- setup(__props) {
437
- const intl = useIntl();
438
- const { getIsOpen, toggle } = useToggleList();
439
- const toggleLine = (groupOrder, invoiceLineOrder) => {
440
- toggle(formatIndex(groupOrder, invoiceLineOrder));
441
- };
442
- const formatIndex = (rootIndex, index) => `${rootIndex}-line-${index}`;
443
- return (_ctx, _cache) => {
444
- return openBlock(), createBlock(InvoiceTable, null, {
445
- default: withCtx(() => [
446
- createElementVNode("tr", null, [
447
- createVNode(_sfc_main$l, {
448
- left: "",
449
- colspan: "5"
450
- }, {
451
- default: withCtx(() => [
452
- createTextVNode(toDisplayString(unref(intl).$t({
453
- id: "invoice.table_header.unit",
454
- defaultMessage: "Unit",
455
- description: "Table header for the column containing the number of units of invoice groups"
456
- })), 1)
457
- ]),
458
- _: 1
459
- }),
460
- createVNode(_sfc_main$l, {
461
- right: "",
462
- class: "w-60"
463
- }, {
464
- default: withCtx(() => [
465
- createTextVNode(toDisplayString(unref(intl).$t({
466
- id: "invoice.table_header.sub_total",
467
- defaultMessage: "Subtotal",
468
- description: "Table header for the column containing the subtotal for invoices"
469
- })), 1)
470
- ]),
471
- _: 1
472
- })
473
- ]),
474
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.commitments, (line, lineIndex) => {
475
- return openBlock(), createElementBlock(Fragment, { key: lineIndex }, [
476
- createElementVNode("tr", {
477
- class: normalizeClass(["border-t", { "cursor-pointer": line.sub_lines }]),
478
- tabindex: line.sub_lines ? 0 : void 0,
479
- onClick: ($event) => toggleLine(__props.groupOrder, line["line_order"])
480
- }, [
481
- createVNode(_sfc_main$m, { colspan: "2" }, {
482
- default: withCtx(() => {
483
- var _a, _b;
484
- return [
485
- line.sub_lines ? (openBlock(), createBlock(_sfc_main$r, {
486
- key: 0,
487
- icon: "keyboard_arrow_down",
488
- size: "md",
489
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
490
- "-rotate-90": !unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"]))
491
- }])
492
- }, null, 8, ["class"])) : createCommentVNode("", true),
493
- createElementVNode("div", _hoisted_2$a, [
494
- renderSlot(_ctx.$slots, "invoice-line-prefix", {
495
- lineOrder: line.line_order,
496
- periodOrder: __props.invoicePeriodOrder,
497
- groupOrder: __props.groupOrder
498
- }),
499
- line.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
500
- createTextVNode(toDisplayString(line.description), 1)
501
- ], 64)) : ((_a = line.details) == null ? void 0 : _a.description) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
502
- createTextVNode(toDisplayString((_b = line.details) == null ? void 0 : _b.description), 1)
503
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
504
- createTextVNode(toDisplayString(unref(intl).$t({
505
- id: "generic.not_available",
506
- defaultMessage: "N/A",
507
- description: "Used in scenarios where no data is available to be displayed"
508
- })), 1)
509
- ], 64))
510
- ])
511
- ];
512
- }),
513
- _: 2
514
- }, 1024),
515
- createVNode(_sfc_main$m, { colspan: "3" }, {
516
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
517
- createTextVNode(" ", -1)
518
- ])]),
519
- _: 1
520
- }),
521
- createVNode(_sfc_main$m, { number: "" }, {
522
- default: withCtx(() => {
523
- var _a, _b;
524
- return [
525
- ((_a = line.details) == null ? void 0 : _a.amount) ? (openBlock(), createBlock(_sfc_main$v, {
526
- key: 0,
527
- value: (_b = line.details) == null ? void 0 : _b.amount
528
- }, null, 8, ["value"])) : createCommentVNode("", true)
529
- ];
530
- }),
531
- _: 2
532
- }, 1024)
533
- ], 10, _hoisted_1$g),
534
- createVNode(_sfc_main$k, {
535
- ref_for: true,
536
- ref: formatIndex(__props.groupOrder, line["line_order"]),
537
- "sub-lines": line.sub_lines ?? [],
538
- "line-order": line["line_order"],
539
- "period-order": __props.invoicePeriodOrder,
540
- "group-order": __props.groupOrder,
541
- "is-open": unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"]))
542
- }, null, 8, ["sub-lines", "line-order", "period-order", "group-order", "is-open"])
543
- ], 64);
544
- }), 128))
545
- ]),
546
- _: 3
547
- });
548
- };
549
- }
550
- });
551
- const _hoisted_1$f = ["tabindex", "onClick"];
552
- const _hoisted_2$9 = { class: "flex items-center" };
553
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
554
- __name: "InvoiceDiscountMarkup",
555
- props: {
556
- lines: {},
557
- type: {},
558
- handleToggleItems: { type: Function },
559
- formatIndex: { type: Function },
560
- expandedItems: {},
561
- isExpandable: { type: Boolean },
562
- invoicePeriodOrder: {},
563
- groupOrder: {}
564
- },
565
- setup(__props) {
566
- const intl = useIntl();
567
- const { getIsOpen, toggle } = useToggleList();
568
- const toggleLine = (groupOrder, invoiceLineOrder) => {
569
- toggle(formatIndex(groupOrder, invoiceLineOrder));
570
- };
571
- const formatIndex = (rootIndex, index) => `${rootIndex}-line-${index}`;
572
- return (_ctx, _cache) => {
573
- return openBlock(), createBlock(InvoiceTable, null, {
574
- default: withCtx(() => [
575
- createElementVNode("tr", null, [
576
- createVNode(_sfc_main$l, {
577
- left: "",
578
- class: "w-3/5"
579
- }, {
580
- default: withCtx(() => [
581
- createTextVNode(toDisplayString(unref(intl).$t({
582
- id: "invoice.table_header.quantity",
583
- defaultMessage: "Quantity",
584
- description: "Table header for quantity column"
585
- })), 1)
586
- ]),
587
- _: 1
588
- }),
589
- createVNode(_sfc_main$l, { colspan: "2" }, {
590
- default: withCtx(() => [..._cache[0] || (_cache[0] = [
591
- createTextVNode(" ", -1)
592
- ])]),
593
- _: 1
594
- }),
595
- createVNode(_sfc_main$l, {
596
- left: "",
597
- class: "w-1/5"
598
- }, {
599
- default: withCtx(() => [
600
- createTextVNode(toDisplayString(__props.type === "DISCOUNT" ? unref(intl).$t({
601
- id: "invoice.table_header.discount",
602
- defaultMessage: "Discount",
603
- description: "Table header for discount column"
604
- }) : unref(intl).$t({
605
- id: "invoice.table_header.markup",
606
- defaultMessage: "Markup",
607
- description: "Table header for markup column"
608
- })), 1)
609
- ]),
610
- _: 1
611
- }),
612
- createVNode(_sfc_main$l, {
613
- left: "",
614
- class: "w-1/5"
615
- }, {
616
- default: withCtx(() => [
617
- createTextVNode(toDisplayString(__props.type === "DISCOUNT" ? unref(intl).$t({
618
- id: "invoice.table_header.total",
619
- defaultMessage: "Total",
620
- description: "Table header for total column"
621
- }) : " "), 1)
622
- ]),
623
- _: 1
624
- }),
625
- createVNode(_sfc_main$l, {
626
- right: "",
627
- class: "w-1/5"
628
- }, {
629
- default: withCtx(() => [
630
- createTextVNode(toDisplayString(unref(intl).$t({
631
- id: "invoice.table_header.sub_total",
632
- defaultMessage: "Subtotal",
633
- description: "Table header for the column containing the subtotal for invoices"
634
- })), 1)
635
- ]),
636
- _: 1
637
- })
638
- ]),
639
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.lines, (line, lineIndex) => {
640
- return openBlock(), createElementBlock(Fragment, { key: lineIndex }, [
641
- createElementVNode("tr", {
642
- class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
643
- tabindex: __props.isExpandable ? 0 : void 0,
644
- onClick: ($event) => toggleLine(__props.groupOrder, line["line_order"])
645
- }, [
646
- createVNode(_sfc_main$m, { class: "w-3/5" }, {
647
- default: withCtx(() => {
648
- var _a, _b;
649
- return [
650
- line.sub_lines ? (openBlock(), createBlock(_sfc_main$r, {
651
- key: 0,
652
- icon: "keyboard_arrow_down",
653
- size: "md",
654
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
655
- "-rotate-90": !unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"]))
656
- }])
657
- }, null, 8, ["class"])) : createCommentVNode("", true),
658
- createElementVNode("div", _hoisted_2$9, [
659
- renderSlot(_ctx.$slots, "invoice-line-prefix", {
660
- lineOrder: line.line_order,
661
- periodOrder: __props.invoicePeriodOrder,
662
- groupOrder: __props.groupOrder
663
- }),
664
- line.description ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
665
- createTextVNode(toDisplayString(line.description), 1)
666
- ], 64)) : ((_a = line.details) == null ? void 0 : _a.description) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
667
- createTextVNode(toDisplayString((_b = line.details) == null ? void 0 : _b.description), 1)
668
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
669
- createTextVNode("N/A")
670
- ], 64))
671
- ])
672
- ];
673
- }),
674
- _: 2
675
- }, 1024),
676
- createVNode(_sfc_main$m, { colspan: "2" }, {
677
- default: withCtx(() => [..._cache[1] || (_cache[1] = [
678
- createTextVNode(" ", -1)
679
- ])]),
680
- _: 1
681
- }),
682
- createVNode(_sfc_main$m, { class: "tabular-nums w-1/5" }, {
683
- default: withCtx(() => {
684
- var _a, _b, _c;
685
- return [
686
- createTextVNode(toDisplayString(((_b = (_a = line.details) == null ? void 0 : _a.band) == null ? void 0 : _b.percentage) ? `${(_c = line.details) == null ? void 0 : _c.band.percentage}%` : " "), 1)
687
- ];
688
- }),
689
- _: 2
690
- }, 1024),
691
- createVNode(_sfc_main$m, { class: "w-1/5" }, {
692
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
693
- createTextVNode(" ", -1)
694
- ])]),
695
- _: 1
696
- }),
697
- createVNode(_sfc_main$m, {
698
- number: "",
699
- class: "w-1/5"
700
- }, {
701
- default: withCtx(() => {
702
- var _a;
703
- return [
704
- ((_a = line.details) == null ? void 0 : _a.amount) ? (openBlock(), createBlock(_sfc_main$v, {
705
- key: 0,
706
- value: line.details.amount
707
- }, null, 8, ["value"])) : createCommentVNode("", true)
708
- ];
709
- }),
710
- _: 2
711
- }, 1024)
712
- ], 10, _hoisted_1$f),
713
- createVNode(_sfc_main$k, {
714
- ref_for: true,
715
- ref: formatIndex(__props.groupOrder, line["line_order"]),
716
- "sub-lines": line.sub_lines ?? [],
717
- "line-order": line["line_order"],
718
- "is-open": unref(getIsOpen)(formatIndex(__props.groupOrder, line["line_order"])),
719
- "period-order": __props.invoicePeriodOrder,
720
- "group-order": __props.groupOrder
721
- }, null, 8, ["sub-lines", "line-order", "is-open", "period-order", "group-order"])
722
- ], 64);
723
- }), 128))
724
- ]),
725
- _: 3
726
- });
727
- };
728
- }
729
- });
730
- const _hoisted_1$e = ["tabindex"];
731
- const _hoisted_2$8 = { key: 0 };
732
- const _hoisted_3$6 = {
733
- colspan: "2",
734
- class: "p-0"
735
- };
736
- const _hoisted_4$6 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
737
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
738
- __name: "InvoiceGroupCommitment",
739
- props: {
740
- group: {},
741
- expandedItems: {},
742
- handleToggleItems: { type: Function },
743
- formatIndex: { type: Function },
744
- invoicePeriodOrder: {},
745
- groupOrder: {},
746
- isExpandable: { type: Boolean },
747
- amountType: {},
748
- processingOnlyCustomers: {}
749
- },
750
- setup(__props) {
751
- const intl = useIntl();
752
- return (_ctx, _cache) => {
753
- return openBlock(), createElementBlock(Fragment, null, [
754
- createElementVNode("tr", {
755
- class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
756
- tabindex: __props.isExpandable ? 0 : void 0,
757
- onClick: _cache[0] || (_cache[0] = ($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder))),
758
- onKeyup: [
759
- _cache[1] || (_cache[1] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["enter"])),
760
- _cache[2] || (_cache[2] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["space"]))
761
- ]
762
- }, [
763
- createVNode(_sfc_main$m, { class: "p-0" }, {
764
- default: withCtx(() => [
765
- __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
766
- key: 0,
767
- icon: "keyboard_arrow_down",
768
- size: "md",
769
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
770
- "-rotate-90": !__props.expandedItems.includes(
771
- __props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)
772
- )
773
- }])
774
- }, null, 8, ["class"])) : createCommentVNode("", true),
775
- createTextVNode(" " + toDisplayString(unref(intl).$t({
776
- id: "invoice.commitment_heading",
777
- defaultMessage: "Commitment",
778
- description: "Heading used for commitment in invoice tables"
779
- })), 1)
780
- ]),
781
- _: 1
782
- }),
783
- createVNode(_sfc_main$m, { number: "" }, {
784
- default: withCtx(() => [
785
- __props.amountType === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$v, {
786
- key: 0,
787
- value: __props.group.amount_including_tax
788
- }, null, 8, ["value"])) : (openBlock(), createBlock(_sfc_main$v, {
789
- key: 1,
790
- value: __props.group.amount_excluding_tax
791
- }, null, 8, ["value"]))
792
- ]),
793
- _: 1
794
- })
795
- ], 42, _hoisted_1$e),
796
- __props.expandedItems.includes(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)) && __props.group.lines ? (openBlock(), createElementBlock("tr", _hoisted_2$8, [
797
- createElementVNode("td", _hoisted_3$6, [
798
- createElementVNode("div", _hoisted_4$6, [
799
- createVNode(_sfc_main$j, {
800
- commitments: __props.group.lines,
801
- "format-index": __props.formatIndex,
802
- "handle-toggle-items": __props.handleToggleItems,
803
- "expanded-items": __props.expandedItems,
804
- "is-expandable": __props.isExpandable,
805
- "invoice-period-order": __props.invoicePeriodOrder,
806
- "group-order": __props.groupOrder
807
- }, {
808
- "invoice-line-prefix": withCtx((linePrefixProps) => [
809
- renderSlot(_ctx.$slots, "invoice-line-prefix", normalizeProps(guardReactiveProps(linePrefixProps)))
810
- ]),
811
- _: 3
812
- }, 8, ["commitments", "format-index", "handle-toggle-items", "expanded-items", "is-expandable", "invoice-period-order", "group-order"])
813
- ])
814
- ])
815
- ])) : createCommentVNode("", true)
816
- ], 64);
817
- };
818
- }
819
- });
820
- const _hoisted_1$d = ["tabindex"];
821
- const _hoisted_2$7 = { key: 0 };
822
- const _hoisted_3$5 = {
823
- colspan: "2",
824
- class: "p-0"
825
- };
826
- const _hoisted_4$5 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
827
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
828
- __name: "InvoiceGroupDiscountMarkup",
829
- props: {
830
- heading: {},
831
- group: {},
832
- expandedItems: {},
833
- handleToggleItems: { type: Function },
834
- formatIndex: { type: Function },
835
- invoicePeriodOrder: {},
836
- groupOrder: {},
837
- isExpandable: { type: Boolean },
838
- amountType: {},
839
- processingOnlyCustomers: {}
840
- },
841
- setup(__props) {
842
- return (_ctx, _cache) => {
843
- return openBlock(), createElementBlock(Fragment, null, [
844
- createElementVNode("tr", {
845
- class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
846
- tabindex: __props.isExpandable ? 0 : void 0,
847
- onClick: _cache[0] || (_cache[0] = ($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder))),
848
- onKeyup: [
849
- _cache[1] || (_cache[1] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["enter"])),
850
- _cache[2] || (_cache[2] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["space"]))
851
- ]
852
- }, [
853
- createVNode(_sfc_main$m, { class: "p-0" }, {
854
- default: withCtx(() => [
855
- __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
856
- key: 0,
857
- icon: "keyboard_arrow_down",
858
- size: "md",
859
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
860
- "-rotate-90": !__props.expandedItems.includes(
861
- __props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)
862
- )
863
- }])
864
- }, null, 8, ["class"])) : createCommentVNode("", true),
865
- createTextVNode(" " + toDisplayString(__props.heading), 1)
866
- ]),
867
- _: 1
868
- }),
869
- createVNode(_sfc_main$m, { number: "" }, {
870
- default: withCtx(() => [
871
- __props.amountType === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$v, {
872
- key: 0,
873
- value: __props.group.amount_including_tax
874
- }, null, 8, ["value"])) : (openBlock(), createBlock(_sfc_main$v, {
875
- key: 1,
876
- value: __props.group.amount_excluding_tax
877
- }, null, 8, ["value"]))
878
- ]),
879
- _: 1
880
- })
881
- ], 42, _hoisted_1$d),
882
- __props.expandedItems.includes(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)) && __props.group.lines ? (openBlock(), createElementBlock("tr", _hoisted_2$7, [
883
- createElementVNode("td", _hoisted_3$5, [
884
- createElementVNode("div", _hoisted_4$5, [
885
- createVNode(_sfc_main$i, {
886
- type: __props.group.type,
887
- lines: __props.group.lines,
888
- "format-index": __props.formatIndex,
889
- "handle-toggle-items": __props.handleToggleItems,
890
- "expanded-items": __props.expandedItems,
891
- "is-expandable": __props.isExpandable,
892
- "invoice-period-order": __props.invoicePeriodOrder,
893
- "group-order": __props.groupOrder
894
- }, {
895
- "invoice-line-prefix": withCtx((linePrefixProps) => [
896
- renderSlot(_ctx.$slots, "invoice-line-prefix", normalizeProps(guardReactiveProps(linePrefixProps)))
897
- ]),
898
- _: 3
899
- }, 8, ["type", "lines", "format-index", "handle-toggle-items", "expanded-items", "is-expandable", "invoice-period-order", "group-order"])
900
- ])
901
- ])
902
- ])) : createCommentVNode("", true)
903
- ], 64);
904
- };
905
- }
906
- });
907
- const _hoisted_1$c = { class: "flex gap-4" };
908
- const _hoisted_2$6 = { class: "flex gap-2 items-center" };
909
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
910
- __name: "PricingClauseChip",
911
- props: {
912
- iconName: {},
913
- chipColor: {}
914
- },
915
- setup(__props) {
916
- return (_ctx, _cache) => {
917
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
918
- createVNode(_sfc_main$w, { color: __props.chipColor }, {
919
- default: withCtx(() => [
920
- createElementVNode("div", _hoisted_2$6, [
921
- createVNode(_sfc_main$r, {
922
- icon: __props.iconName,
923
- size: "xs"
924
- }, null, 8, ["icon"]),
925
- createElementVNode("span", null, [
926
- renderSlot(_ctx.$slots, "chip-content")
927
- ])
928
- ])
929
- ]),
930
- _: 3
931
- }, 8, ["color"]),
932
- renderSlot(_ctx.$slots, "chip-postfix")
933
- ]);
934
- };
935
- }
936
- });
937
- const _hoisted_1$b = { class: "flex flex-col gap-2" };
938
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
939
- __name: "InvoicePricingClauseChip",
940
- props: {
941
- clauseType: {},
942
- priceDetailsBand: {},
943
- invoiceLineDescription: {}
944
- },
945
- setup(__props) {
946
- const intl = useIntl();
947
- return (_ctx, _cache) => {
948
- return openBlock(), createElementBlock("div", _hoisted_1$b, [
949
- createElementVNode("span", null, toDisplayString(__props.invoiceLineDescription), 1),
950
- __props.clauseType === "DISCOUNT" && __props.priceDetailsBand ? (openBlock(), createBlock(unref(_sfc_main$f), {
951
- key: 0,
952
- "icon-name": "south_east",
953
- "chip-color": "yellow"
954
- }, createSlots({ _: 2 }, [
955
- __props.priceDetailsBand.amount ? {
956
- name: "chip-content",
957
- fn: withCtx(() => [
958
- createTextVNode(toDisplayString(unref(intl).$t(
959
- {
960
- id: "invoice.amount_discount",
961
- defaultMessage: "{amount} discount",
962
- description: "Represents a certain amount of discount, where {amount} is replaced with the amount"
963
- },
964
- {
965
- amount: unref(formatAmount)(__props.priceDetailsBand.amount)
966
- }
967
- ).toUpperCase()), 1)
968
- ]),
969
- key: "0"
970
- } : __props.priceDetailsBand.percentage ? {
971
- name: "chip-content",
972
- fn: withCtx(() => [
973
- createTextVNode(toDisplayString(unref(intl).$t(
974
- {
975
- id: "invoice.percentage_discount",
976
- defaultMessage: "{percentage}% discount",
977
- description: "Represents a certain percentage of discount, where {percentage} is replaced with the percentage (number only)"
978
- },
979
- {
980
- percentage: __props.priceDetailsBand.percentage ?? "0"
981
- }
982
- ).toUpperCase()), 1)
983
- ]),
984
- key: "1"
985
- } : void 0
986
- ]), 1024)) : __props.clauseType === "ADJUSTMENT" ? (openBlock(), createBlock(unref(_sfc_main$f), {
987
- key: 1,
988
- "icon-name": "info",
989
- "chip-color": "yellow"
990
- }, {
991
- "chip-content": withCtx(() => [
992
- createTextVNode(toDisplayString(unref(intl).$t({
993
- id: "invoice.adjustment_chip_body",
994
- defaultMessage: "Adjustment",
995
- description: "Used on invoice lines to mark as adjusted"
996
- }).toUpperCase()), 1)
997
- ]),
998
- _: 1
999
- })) : __props.clauseType === "MARKUP" ? (openBlock(), createBlock(unref(_sfc_main$f), {
1000
- key: 2,
1001
- "icon-name": "north_east",
1002
- "chip-color": "teal-light"
1003
- }, {
1004
- "chip-content": withCtx(() => {
1005
- var _a;
1006
- return [
1007
- createTextVNode(toDisplayString(unref(intl).$t(
1008
- {
1009
- id: "invoice.markup_percentage",
1010
- defaultMessage: "{percentage}% markup",
1011
- description: "Markup percentage, where {percentage} is replaced with the percentage (number only)"
1012
- },
1013
- { percentage: ((_a = __props.priceDetailsBand) == null ? void 0 : _a.percentage) ?? "0" }
1014
- ).toUpperCase()), 1)
1015
- ];
1016
- }),
1017
- _: 1
1018
- })) : __props.clauseType === "COMMITMENT" ? (openBlock(), createBlock(unref(_sfc_main$f), {
1019
- key: 3,
1020
- "icon-name": "sell",
1021
- "chip-color": "orange"
1022
- }, {
1023
- "chip-content": withCtx(() => [
1024
- createTextVNode(toDisplayString(unref(intl).$t({
1025
- id: "invoice.commitment",
1026
- defaultMessage: "commitment",
1027
- description: "Used on invoice lines to mark as commitment"
1028
- }).toUpperCase()), 1)
1029
- ]),
1030
- _: 1
1031
- })) : createCommentVNode("", true)
1032
- ]);
1033
- };
1034
- }
1035
- });
1036
- const _hoisted_1$a = { class: "items-left flex flex-col gap-1 leading-none" };
1037
- const _hoisted_2$5 = { class: "flex items-center" };
1038
- const _hoisted_3$4 = {
1039
- key: 0,
1040
- class: "ml-1 text-xs text-gray-400"
1041
- };
1042
- const _hoisted_4$4 = { key: 0 };
1043
- const _hoisted_5$4 = {
1044
- key: 1,
1045
- class: "text-xs text-gray-400"
1046
- };
1047
- const _hoisted_6$3 = {
1048
- key: 2,
1049
- class: "text-xs text-gray-400"
1050
- };
1051
- const _hoisted_7$2 = { class: "text-[9pt] text-slate-600" };
1052
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
1053
- __name: "InvoiceLineRow",
1054
- props: {
1055
- data: {},
1056
- isLast: { type: Boolean },
1057
- periodOrder: {},
1058
- groupOrder: {},
1059
- groupType: {},
1060
- isExpanded: { type: Boolean }
1061
- },
1062
- setup(__props) {
1063
- const { $t } = useIntl();
1064
- const props = __props;
1065
- const formattedTier = (band) => {
1066
- var _a, _b;
1067
- if (!band) return "";
1068
- let lowerBound = "0";
1069
- let topBound = " +";
1070
- if (band.tier_lower_bound && "number" in band.tier_lower_bound) {
1071
- lowerBound = ((_a = band.tier_lower_bound) == null ? void 0 : _a.number) ?? "0";
1072
- } else if (band.tier_lower_bound && "amount" in band.tier_lower_bound) {
1073
- const { quantity, currency } = band.tier_lower_bound.amount;
1074
- lowerBound = `${currency} ${quantity ?? 0}`;
1075
- }
1076
- if (band.tier_top_bound && "number" in band.tier_top_bound) {
1077
- topBound = ` - ${(_b = band.tier_top_bound) == null ? void 0 : _b.number}`;
1078
- } else if (band.tier_top_bound && "amount" in band.tier_top_bound) {
1079
- const { quantity, currency } = band.tier_top_bound.amount;
1080
- topBound = ` - ${currency} ${quantity}`;
1081
- }
1082
- return lowerBound + topBound;
1083
- };
1084
- const includedVolumeDetails = computed(() => {
1085
- var _a;
1086
- return (_a = props.data.details) == null ? void 0 : _a.included_volume_details;
1087
- });
1088
- const invoiceLineName = computed(() => {
1089
- var _a, _b;
1090
- if ((_a = props.data) == null ? void 0 : _a.product_items) {
1091
- return getComposedString(props.data.product_items.map((item) => item.name));
1092
- }
1093
- return ((_b = props.data) == null ? void 0 : _b.description) ?? "N/A";
1094
- });
1095
- return (_ctx, _cache) => {
1096
- return openBlock(), createElementBlock(Fragment, null, [
1097
- createVNode(_sfc_main$m, { class: "align-top" }, {
1098
- default: withCtx(() => {
1099
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
1100
- return [
1101
- createElementVNode("div", _hoisted_1$a, [
1102
- createElementVNode("div", null, [
1103
- __props.data.sub_lines ? (openBlock(), createBlock(_sfc_main$r, {
1104
- key: 0,
1105
- icon: "keyboard_arrow_down",
1106
- size: "md",
1107
- class: normalizeClass(["absolute -translate-x-7 -translate-y-2 text-slate-400", {
1108
- "-rotate-90": !__props.isExpanded
1109
- }])
1110
- }, null, 8, ["class"])) : createCommentVNode("", true),
1111
- createElementVNode("div", _hoisted_2$5, [
1112
- renderSlot(_ctx.$slots, "invoice-line-prefix", {
1113
- lineOrder: __props.data.line_order,
1114
- periodOrder: __props.periodOrder,
1115
- groupOrder: __props.groupOrder
1116
- }),
1117
- ["PRICING", "REVENUE", "ONE_OFF"].includes(__props.data.type) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1118
- createTextVNode(toDisplayString(invoiceLineName.value) + " ", 1),
1119
- __props.data.type === "ONE_OFF" && __props.groupType !== "ONE_OFF" ? (openBlock(), createElementBlock("div", _hoisted_3$4, toDisplayString(unref(formatEnum)(__props.data.type)), 1)) : createCommentVNode("", true)
1120
- ], 64)) : (openBlock(), createBlock(_sfc_main$e, {
1121
- key: 1,
1122
- "invoice-line-description": invoiceLineName.value,
1123
- "clause-type": __props.data.type,
1124
- "price-details-band": (_a = __props.data.details) == null ? void 0 : _a.band
1125
- }, null, 8, ["invoice-line-description", "clause-type", "price-details-band"]))
1126
- ])
1127
- ]),
1128
- ["TIERED", "STAIR_STEP", "TOP_TIERED"].includes(__props.data.pricing_type) && !includedVolumeDetails.value && ((_b = __props.data.details) == null ? void 0 : _b.band) ? (openBlock(), createElementBlock("div", _hoisted_4$4, toDisplayString(formattedTier((_c = __props.data.details) == null ? void 0 : _c.band)), 1)) : createCommentVNode("", true),
1129
- ((_e = (_d = __props.data.details) == null ? void 0 : _d.split_pricing) == null ? void 0 : _e.meter_properties) ? (openBlock(), createElementBlock("span", _hoisted_5$4, [
1130
- (openBlock(true), createElementBlock(Fragment, null, renderList((_g = (_f = __props.data.details) == null ? void 0 : _f.split_pricing) == null ? void 0 : _g.meter_properties, (meterProperty, index) => {
1131
- return openBlock(), createElementBlock(Fragment, null, [
1132
- createTextVNode(toDisplayString(meterProperty.meter_property.name) + ": " + toDisplayString(meterProperty.value), 1),
1133
- index < __props.data.details.split_pricing.meter_properties.length - 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1134
- createTextVNode(toDisplayString(", "))
1135
- ], 64)) : createCommentVNode("", true)
1136
- ], 64);
1137
- }), 256))
1138
- ])) : createCommentVNode("", true),
1139
- ((_h = __props.data.conditions) == null ? void 0 : _h.name) || ((_i = __props.data.conditions) == null ? void 0 : _i.meter_properties) ? (openBlock(), createElementBlock("div", _hoisted_6$3, [
1140
- __props.data.conditions.name ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1141
- createTextVNode(toDisplayString(__props.data.conditions.name), 1)
1142
- ], 64)) : __props.data.conditions.meter_properties ? (openBlock(), createBlock(unref(_sfc_main$u), {
1143
- key: 1,
1144
- comparators: __props.data.conditions.meter_properties
1145
- }, null, 8, ["comparators"])) : createCommentVNode("", true)
1146
- ])) : createCommentVNode("", true)
1147
- ]),
1148
- createElementVNode("span", _hoisted_7$2, [
1149
- ((_j = __props.data.details) == null ? void 0 : _j.price_bound) === "BELOW_MINIMUM_AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1150
- createTextVNode(toDisplayString(unref($t)({
1151
- id: "invoice.line.band_minimum_amount",
1152
- defaultMessage: "Band minimum amount",
1153
- description: "Minimum amount specified in a band"
1154
- })) + " ", 1),
1155
- ((_k = __props.data.details.band) == null ? void 0 : _k.minimum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1156
- key: 0,
1157
- value: __props.data.details.band.minimum_amount
1158
- }, null, 8, ["value"])) : createCommentVNode("", true)
1159
- ], 64)) : ((_l = __props.data.details) == null ? void 0 : _l.price_bound) === "NOT_HIT" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1160
- createTextVNode(toDisplayString(unref($t)({
1161
- id: "invoice.line.price_bound_within_bounds",
1162
- defaultMessage: "Within bounds",
1163
- description: "Label used when min and max bounds are specified but reached"
1164
- })), 1)
1165
- ], 64)) : ((_m = __props.data.details) == null ? void 0 : _m.price_bound) === "ABOVE_MAXIMUM_AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1166
- createTextVNode(toDisplayString(unref($t)({
1167
- id: "invoice.line.price_bound_maximum_amount",
1168
- defaultMessage: "Maximum amount",
1169
- description: "Minimum amount specified in a band"
1170
- })) + " ", 1),
1171
- ((_n = __props.data.details.band) == null ? void 0 : _n.maximum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1172
- key: 0,
1173
- value: __props.data.details.band.maximum_amount
1174
- }, null, 8, ["value"])) : createCommentVNode("", true)
1175
- ], 64)) : ((_o = __props.data.details) == null ? void 0 : _o.price_bound) === "BELOW_MINIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1176
- createTextVNode(toDisplayString(unref($t)({
1177
- id: "invoice.line.band_minimum_number",
1178
- defaultMessage: "Minimum number",
1179
- description: "Minimum number of units specified in a band"
1180
- })) + " " + toDisplayString((_p = __props.data.details.band) == null ? void 0 : _p.minimum_number), 1)
1181
- ], 64)) : ((_q = __props.data.details) == null ? void 0 : _q.price_bound) === "ABOVE_MAXIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1182
- createTextVNode(toDisplayString(unref($t)({
1183
- id: "invoice.line.band_maximum_number",
1184
- defaultMessage: "Maximum number",
1185
- description: "Maximum number of units specified in a band"
1186
- })) + " " + toDisplayString((_r = __props.data.details.band) == null ? void 0 : _r.maximum_number), 1)
1187
- ], 64)) : createCommentVNode("", true)
1188
- ])
1189
- ];
1190
- }),
1191
- _: 3
1192
- }),
1193
- renderSlot(_ctx.$slots, "line-content", {
1194
- details: __props.data.details
1195
- })
1196
- ], 64);
1197
- };
1198
- }
1199
- });
1200
- const _hoisted_1$9 = {
1201
- key: 4,
1202
- class: "text-xs text-gray-400"
1203
- };
1204
- const _hoisted_2$4 = {
1205
- key: 1,
1206
- class: "tabular-nums"
1207
- };
1208
- const _hoisted_3$3 = { class: "text-2xs text-gray-500" };
1209
- const _hoisted_4$3 = {
1210
- key: 0,
1211
- class: "flex justify-end"
1212
- };
1213
- const _hoisted_5$3 = { class: "flex gap-1 items-center justify-end" };
1214
- const _hoisted_6$2 = {
1215
- key: 0,
1216
- class: "text-2xs text-gray-500 tabular-nums"
1217
- };
1218
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
1219
- __name: "InvoiceRowContent",
1220
- props: {
1221
- pricingType: {},
1222
- details: {},
1223
- taxCategories: {},
1224
- amountType: {},
1225
- hideTaxDetails: { type: Boolean }
1226
- },
1227
- setup(__props) {
1228
- const intl = useIntl();
1229
- const props = __props;
1230
- const includedVolumeDetails = computed(() => {
1231
- var _a;
1232
- return (_a = props.details) == null ? void 0 : _a.included_volume_details;
1233
- });
1234
- const availableIncludedVolume = computed(
1235
- () => {
1236
- var _a;
1237
- return (_a = includedVolumeDetails.value) == null ? void 0 : _a.available_included_volume;
1238
- }
1239
- );
1240
- return (_ctx, _cache) => {
1241
- return openBlock(), createElementBlock(Fragment, null, [
1242
- createVNode(_sfc_main$m, {
1243
- number: "",
1244
- class: "align-top"
1245
- }, {
1246
- default: withCtx(() => {
1247
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
1248
- return [
1249
- __props.pricingType !== "PASS_THROUGH" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1250
- ((_a = __props.details) == null ? void 0 : _a.price_bound) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1251
- ((_b = __props.details) == null ? void 0 : _b.price_bound) === "BELOW_MINIMUM_AMOUNT" || ((_c = __props.details) == null ? void 0 : _c.price_bound) === "ABOVE_MAXIMUM_AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1252
- createTextVNode(toDisplayString((_d = __props.details) == null ? void 0 : _d.meter_value.count), 1)
1253
- ], 64)) : ((_e = __props.details) == null ? void 0 : _e.price_bound) === "NOT_HIT" && "amount" in __props.details.meter_value && ((_g = (_f = __props.details) == null ? void 0 : _f.meter_value) == null ? void 0 : _g.amount) ? (openBlock(), createBlock(_sfc_main$v, {
1254
- key: 1,
1255
- value: (_i = (_h = __props.details) == null ? void 0 : _h.meter_value) == null ? void 0 : _i.amount
1256
- }, null, 8, ["value"])) : ((_j = __props.details) == null ? void 0 : _j.price_bound) === "NOT_HIT" && "number" in __props.details.meter_value && ((_l = (_k = __props.details) == null ? void 0 : _k.meter_value) == null ? void 0 : _l.number) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1257
- createTextVNode(toDisplayString((_n = (_m = __props.details) == null ? void 0 : _m.meter_value) == null ? void 0 : _n.number), 1)
1258
- ], 64)) : ((_o = __props.details) == null ? void 0 : _o.price_bound) === "RATIO" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1259
- createTextVNode(toDisplayString((_p = __props.details) == null ? void 0 : _p.meter_value.number), 1)
1260
- ], 64)) : ((_q = __props.details) == null ? void 0 : _q.price_bound) === "BELOW_MINIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1261
- createTextVNode(toDisplayString((_s = (_r = __props.details) == null ? void 0 : _r.band) == null ? void 0 : _s.minimum_number), 1)
1262
- ], 64)) : ((_t = __props.details) == null ? void 0 : _t.price_bound) === "ABOVE_MAXIMUM_NUMBER" ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [
1263
- createTextVNode(toDisplayString((_v = (_u = __props.details) == null ? void 0 : _u.band) == null ? void 0 : _v.maximum_number), 1)
1264
- ], 64)) : createCommentVNode("", true)
1265
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1266
- ((_w = __props.details) == null ? void 0 : _w.meter_value) && "number" in __props.details.meter_value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1267
- createTextVNode(toDisplayString(__props.details.meter_value.number), 1)
1268
- ], 64)) : ((_x = __props.details) == null ? void 0 : _x.price_bound) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1269
- createTextVNode(toDisplayString(__props.details.total_count), 1)
1270
- ], 64)) : ((_y = __props.details) == null ? void 0 : _y.meter_value) && "amount" in __props.details.meter_value ? (openBlock(), createBlock(_sfc_main$v, {
1271
- key: 2,
1272
- value: __props.details.meter_value.amount
1273
- }, null, 8, ["value"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
1274
- createTextVNode("1")
1275
- ], 64)),
1276
- availableIncludedVolume.value ? (openBlock(), createElementBlock("div", _hoisted_1$9, [
1277
- availableIncludedVolume.value.type === "AMOUNT" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1278
- createVNode(_sfc_main$v, {
1279
- value: availableIncludedVolume.value.amount
1280
- }, null, 8, ["value"]),
1281
- createTextVNode(" " + toDisplayString(unref(intl).$t({
1282
- id: "invoice.line.included",
1283
- defaultMessage: "included",
1284
- description: "Used to specify an included amount. Should be lowercase."
1285
- })), 1)
1286
- ], 64)) : availableIncludedVolume.value.type === "NUMBER" ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(availableIncludedVolume.value.number) + " " + toDisplayString(unref(intl).$t({
1287
- id: "invoice.line.units_included",
1288
- defaultMessage: "units included",
1289
- description: "Used to specify an included units. Should be lowercase."
1290
- })), 1)) : createCommentVNode("", true)
1291
- ])) : createCommentVNode("", true)
1292
- ], 64))
1293
- ], 64)) : createCommentVNode("", true)
1294
- ];
1295
- }),
1296
- _: 1
1297
- }),
1298
- __props.pricingType === "PASS_THROUGH" ? (openBlock(), createBlock(_sfc_main$m, {
1299
- key: 0,
1300
- class: "align-top text-right"
1301
- }, {
1302
- default: withCtx(() => [
1303
- createTextVNode(toDisplayString(unref(intl).$t({
1304
- id: "invoice.line.pass_through",
1305
- defaultMessage: "Pass through",
1306
- description: "Name of the pass through pricing type"
1307
- })), 1)
1308
- ]),
1309
- _: 1
1310
- })) : (openBlock(), createBlock(_sfc_main$m, {
1311
- key: 1,
1312
- number: "",
1313
- class: "align-top"
1314
- }, {
1315
- default: withCtx(() => {
1316
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1317
- return [
1318
- ((_a = __props.details) == null ? void 0 : _a.price_bound) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1319
- ((_b = __props.details) == null ? void 0 : _b.price_bound) === "BELOW_MINIMUM_AMOUNT" && ((_d = (_c = __props.details) == null ? void 0 : _c.band) == null ? void 0 : _d.minimum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1320
- key: 0,
1321
- value: __props.details.band.minimum_amount
1322
- }, null, 8, ["value"])) : ((_e = __props.details) == null ? void 0 : _e.price_bound) === "ABOVE_MAXIMUM_AMOUNT" && ((_g = (_f = __props.details) == null ? void 0 : _f.band) == null ? void 0 : _g.maximum_amount) ? (openBlock(), createBlock(_sfc_main$v, {
1323
- key: 1,
1324
- value: __props.details.band.maximum_amount
1325
- }, null, 8, ["value"])) : ["NOT_HIT", "RATIO", "BELOW_MINIMUM_NUMBER", "ABOVE_MAXIMUM_NUMBER"].includes(
1326
- (_h = __props.details) == null ? void 0 : _h.price_bound
1327
- ) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1328
- ((_i = __props.details) == null ? void 0 : _i.band) && __props.details.band.amount ? (openBlock(), createBlock(_sfc_main$v, {
1329
- key: 0,
1330
- value: __props.details.band.amount
1331
- }, null, 8, ["value"])) : createCommentVNode("", true),
1332
- ((_j = __props.details) == null ? void 0 : _j.band) && "percentage" in __props.details.band ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1333
- createTextVNode(toDisplayString(__props.details.band.percentage) + "% ", 1)
1334
- ], 64)) : createCommentVNode("", true)
1335
- ], 64)) : createCommentVNode("", true)
1336
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1337
- ((_k = __props.details) == null ? void 0 : _k.band) && __props.details.band.amount ? (openBlock(), createBlock(_sfc_main$v, {
1338
- key: 0,
1339
- value: __props.details.band.amount
1340
- }, null, 8, ["value"])) : createCommentVNode("", true),
1341
- ((_l = __props.details) == null ? void 0 : _l.band) && "percentage" in __props.details.band ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1342
- createTextVNode(toDisplayString(__props.details.band.percentage) + "% ", 1)
1343
- ], 64)) : createCommentVNode("", true)
1344
- ], 64))
1345
- ];
1346
- }),
1347
- _: 1
1348
- })),
1349
- createVNode(_sfc_main$m, {
1350
- number: "",
1351
- class: "align-top"
1352
- }, {
1353
- default: withCtx(() => [
1354
- !__props.hideTaxDetails ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.taxCategories, (taxCategory, taxCategoryIndex) => {
1355
- return openBlock(), createElementBlock("div", {
1356
- key: taxCategoryIndex,
1357
- class: "tabular-nums"
1358
- }, [
1359
- createElementVNode("div", null, toDisplayString(taxCategory.percentage) + "%", 1),
1360
- createElementVNode("div", _hoisted_3$3, [
1361
- createVNode(_sfc_main$v, {
1362
- value: taxCategory.tax_amount
1363
- }, null, 8, ["value"])
1364
- ])
1365
- ]);
1366
- }), 128)) : createCommentVNode("", true)
1367
- ]),
1368
- _: 1
1369
- }),
1370
- createVNode(_sfc_main$m, {
1371
- number: "",
1372
- class: "align-top"
1373
- }, {
1374
- default: withCtx(() => {
1375
- var _a, _b, _c, _d;
1376
- return [
1377
- ((_b = (_a = __props.details) == null ? void 0 : _a.amount) == null ? void 0 : _b.currency) && ((_d = (_c = __props.details) == null ? void 0 : _c.amount) == null ? void 0 : _d.quantity) ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
1378
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.taxCategories, (taxCategory, taxCategoryIndex) => {
1379
- var _a2;
1380
- return openBlock(), createElementBlock("div", {
1381
- key: taxCategoryIndex,
1382
- class: "inline-block"
1383
- }, [
1384
- createElementVNode("div", _hoisted_5$3, [
1385
- createVNode(_sfc_main$v, {
1386
- value: __props.details.amount
1387
- }, null, 8, ["value"]),
1388
- ((_a2 = __props.details) == null ? void 0 : _a2.pricing_amount.quantity) !== __props.details.amount.quantity ? (openBlock(), createBlock(_sfc_main$x, {
1389
- key: 0,
1390
- placement: "top-end"
1391
- }, {
1392
- tooltip: withCtx(() => [
1393
- createVNode(TooltipContent, null, {
1394
- default: withCtx(() => [
1395
- createVNode(_sfc_main$y, null, {
1396
- default: withCtx(() => [
1397
- createTextVNode(toDisplayString(unref(intl).$t({
1398
- id: "invoice.line.original_currency",
1399
- defaultMessage: "Original currency",
1400
- description: "Original currency"
1401
- })) + " ", 1),
1402
- createVNode(_sfc_main$v, {
1403
- value: __props.details.pricing_amount,
1404
- class: "font-semibold"
1405
- }, null, 8, ["value"])
1406
- ]),
1407
- _: 1
1408
- })
1409
- ]),
1410
- _: 1
1411
- })
1412
- ]),
1413
- default: withCtx(() => [
1414
- createVNode(_sfc_main$r, {
1415
- icon: "info",
1416
- size: "2xs"
1417
- })
1418
- ]),
1419
- _: 1
1420
- })) : createCommentVNode("", true)
1421
- ]),
1422
- !__props.hideTaxDetails ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
1423
- __props.amountType === "INCLUDING_TAX" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1424
- createTextVNode(toDisplayString(unref(intl).$t({
1425
- id: "invoice.line.excl.tax",
1426
- defaultMessage: "Excl. tax",
1427
- description: "Value excludes tax"
1428
- })) + " ", 1),
1429
- createVNode(_sfc_main$v, {
1430
- value: taxCategory.base_amount
1431
- }, null, 8, ["value"])
1432
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1433
- createTextVNode(toDisplayString(unref(intl).$t({
1434
- id: "invoice.line.incl.tax",
1435
- defaultMessage: "Incl. tax",
1436
- description: "Value includes tax"
1437
- })) + " ", 1),
1438
- createVNode(_sfc_main$v, {
1439
- value: taxCategory.total_amount
1440
- }, null, 8, ["value"])
1441
- ], 64))
1442
- ])) : createCommentVNode("", true)
1443
- ]);
1444
- }), 128)),
1445
- renderSlot(_ctx.$slots, "one-off-line-context-menu")
1446
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1447
- createTextVNode("-")
1448
- ], 64))
1449
- ];
1450
- }),
1451
- _: 3
1452
- })
1453
- ], 64);
1454
- };
1455
- }
1456
- });
1457
- const _hoisted_1$8 = ["tabindex", "onClick"];
1458
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
1459
- __name: "InvoiceLineGroup",
1460
- props: {
1461
- group: {},
1462
- startDate: {},
1463
- endDate: {},
1464
- total: {},
1465
- amountType: {},
1466
- invoicePeriodOrder: {},
1467
- processingOnlyCustomers: {}
1468
- },
1469
- setup(__props) {
1470
- const props = __props;
1471
- const sortedLines = computed(
1472
- () => {
1473
- var _a;
1474
- return (_a = [...props.group.lines ?? []]) == null ? void 0 : _a.sort((a, b) => a.line_order - b.line_order);
1475
- }
1476
- );
1477
- const intl = useIntl();
1478
- const { getIsOpen, toggle } = useToggleList();
1479
- const toggleLine = (groupOrder, invoiceLineOrder) => {
1480
- toggle(formatIndex(groupOrder, invoiceLineOrder));
1481
- };
1482
- const formatIndex = (rootIndex, index) => `${rootIndex}-line-${index}`;
1483
- return (_ctx, _cache) => {
1484
- return openBlock(), createElementBlock("div", null, [
1485
- createVNode(InvoiceTable, null, {
1486
- default: withCtx(() => [
1487
- createElementVNode("tr", null, [
1488
- createVNode(_sfc_main$l, {
1489
- left: "",
1490
- class: "text-gray-400 w-1/5"
1491
- }, {
1492
- default: withCtx(() => [
1493
- createTextVNode(toDisplayString(unref(intl).$t({
1494
- id: "invoice.table_header.unit",
1495
- defaultMessage: "Unit",
1496
- description: "Table header for the column containing the number of units of invoice groups"
1497
- })), 1)
1498
- ]),
1499
- _: 1
1500
- }),
1501
- createVNode(_sfc_main$l, {
1502
- right: "",
1503
- class: "text-gray-400 w-1/5"
1504
- }, {
1505
- default: withCtx(() => [
1506
- createTextVNode(toDisplayString(unref(intl).$t({
1507
- id: "invoice.table_header.quantity",
1508
- defaultMessage: "Quantity",
1509
- description: "Table header for quantity column"
1510
- })), 1)
1511
- ]),
1512
- _: 1
1513
- }),
1514
- createVNode(_sfc_main$l, {
1515
- right: "",
1516
- class: "text-gray-400 w-1/5"
1517
- }, {
1518
- default: withCtx(() => [
1519
- createTextVNode(toDisplayString(unref(intl).$t({
1520
- id: "invoice.table_header.price",
1521
- defaultMessage: "Price",
1522
- description: "Table header for the column containing the number of units of invoice groups"
1523
- })), 1)
1524
- ]),
1525
- _: 1
1526
- }),
1527
- createVNode(_sfc_main$l, {
1528
- right: "",
1529
- class: "text-gray-400 w-1/5"
1530
- }, {
1531
- default: withCtx(() => [
1532
- createTextVNode(toDisplayString(unref(intl).$t({
1533
- id: "invoice.table_header.tax_rate",
1534
- defaultMessage: "Tax rate",
1535
- description: "Table header for the column containing the tax percentage of invoice groups"
1536
- })), 1)
1537
- ]),
1538
- _: 1
1539
- }),
1540
- createVNode(_sfc_main$l, {
1541
- right: "",
1542
- class: "text-gray-400 w-1/5"
1543
- }, {
1544
- default: withCtx(() => [
1545
- createTextVNode(toDisplayString(unref(intl).$t({
1546
- id: "invoice.table_header.sub_total",
1547
- defaultMessage: "Subtotal",
1548
- description: "Table header for the column containing the subtotal for invoices"
1549
- })), 1)
1550
- ]),
1551
- _: 1
1552
- })
1553
- ]),
1554
- (openBlock(true), createElementBlock(Fragment, null, renderList(sortedLines.value, (line, i) => {
1555
- return openBlock(), createElementBlock(Fragment, { key: i }, [
1556
- createElementVNode("tr", {
1557
- tabindex: line.sub_lines ? 0 : void 0,
1558
- class: normalizeClass(["group", { "cursor-pointer": line.sub_lines, "border-t": i !== 0 }]),
1559
- onClick: ($event) => toggleLine(__props.group.group_order, line["line_order"])
1560
- }, [
1561
- (openBlock(), createBlock(_sfc_main$d, {
1562
- key: i,
1563
- data: line,
1564
- "is-first-in-group": i === 0,
1565
- "period-order": __props.invoicePeriodOrder,
1566
- "group-order": __props.group.group_order,
1567
- "is-last": i === sortedLines.value.length - 1,
1568
- "group-type": __props.group.type,
1569
- "is-expanded": unref(getIsOpen)(formatIndex(__props.group.group_order, line["line_order"]))
1570
- }, {
1571
- "invoice-line-prefix": withCtx((linePrefixProps) => [
1572
- renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
1573
- ]),
1574
- "line-content": withCtx((lineContentProps) => [
1575
- createVNode(_sfc_main$c, {
1576
- details: lineContentProps.details,
1577
- "pricing-type": line.pricing_type,
1578
- "tax-categories": line.tax_categories,
1579
- "amount-type": __props.amountType
1580
- }, createSlots({ _: 2 }, [
1581
- line.type === "ONE_OFF" ? {
1582
- name: "one-off-line-context-menu",
1583
- fn: withCtx((oneOffGroupProps) => [
1584
- renderSlot(_ctx.$slots, "one-off-line-context-menu", mergeProps({ ref_for: true }, oneOffGroupProps, {
1585
- lineOrder: line.line_order
1586
- }))
1587
- ]),
1588
- key: "0"
1589
- } : void 0
1590
- ]), 1032, ["details", "pricing-type", "tax-categories", "amount-type"])
1591
- ]),
1592
- _: 2
1593
- }, 1032, ["data", "is-first-in-group", "period-order", "group-order", "is-last", "group-type", "is-expanded"]))
1594
- ], 10, _hoisted_1$8),
1595
- createVNode(_sfc_main$k, {
1596
- ref_for: true,
1597
- ref: formatIndex(__props.group.group_order, line["line_order"]),
1598
- "sub-lines": line.sub_lines ?? [],
1599
- "processing-only-customers": __props.processingOnlyCustomers,
1600
- "line-order": line["line_order"],
1601
- "is-open": unref(getIsOpen)(formatIndex(__props.group.group_order, line["line_order"])),
1602
- "period-order": __props.invoicePeriodOrder,
1603
- "group-order": __props.group.group_order
1604
- }, {
1605
- "invoice-line-prefix": withCtx((linePrefixProps) => [
1606
- renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
1607
- ]),
1608
- "subline-content": withCtx((sublineContentProps) => [
1609
- createVNode(_sfc_main$c, {
1610
- details: sublineContentProps.details,
1611
- "hide-tax-details": sublineContentProps.hideTaxDetails,
1612
- "pricing-type": line.pricing_type,
1613
- "tax-categories": line.tax_categories,
1614
- "amount-type": __props.amountType
1615
- }, null, 8, ["details", "hide-tax-details", "pricing-type", "tax-categories", "amount-type"])
1616
- ]),
1617
- _: 2
1618
- }, 1032, ["sub-lines", "processing-only-customers", "line-order", "is-open", "period-order", "group-order"])
1619
- ], 64);
1620
- }), 128))
1621
- ]),
1622
- _: 3
1623
- })
1624
- ]);
1625
- };
1626
- }
1627
- });
1628
- const _hoisted_1$7 = ["tabindex"];
1629
- const _hoisted_2$3 = {
1630
- key: 2,
1631
- class: "inline-flex justify-center items-center w-3.5 h-3.5 rounded-full bg-blue-100 text-blue-600 text-2xs ml-1 font-bold"
1632
- };
1633
- const _hoisted_3$2 = { key: 0 };
1634
- const _hoisted_4$2 = {
1635
- colspan: "2",
1636
- class: "p-0"
1637
- };
1638
- const _hoisted_5$2 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
1639
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
1640
- __name: "InvoiceGroupRevenue",
1641
- props: {
1642
- group: {},
1643
- expandedItems: {},
1644
- handleToggleItems: { type: Function },
1645
- formatIndex: { type: Function },
1646
- invoicePeriodOrder: {},
1647
- groupOrder: {},
1648
- isExpandable: { type: Boolean },
1649
- amountType: {},
1650
- processingOnlyCustomers: {}
1651
- },
1652
- setup(__props) {
1653
- return (_ctx, _cache) => {
1654
- return openBlock(), createElementBlock(Fragment, null, [
1655
- createElementVNode("tr", {
1656
- class: normalizeClass(["border-t", { "cursor-pointer": __props.isExpandable }]),
1657
- tabindex: __props.isExpandable ? 0 : void 0,
1658
- onClick: _cache[0] || (_cache[0] = ($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder))),
1659
- onKeyup: [
1660
- _cache[1] || (_cache[1] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["enter"])),
1661
- _cache[2] || (_cache[2] = withKeys(($event) => __props.handleToggleItems(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)), ["space"]))
1662
- ]
1663
- }, [
1664
- createVNode(_sfc_main$m, { class: "p-0" }, {
1665
- default: withCtx(() => {
1666
- var _a, _b, _c, _d;
1667
- return [
1668
- __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
1669
- key: 0,
1670
- icon: "keyboard_arrow_down",
1671
- size: "md",
1672
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
1673
- "-rotate-90": !__props.expandedItems.includes(
1674
- __props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)
1675
- )
1676
- }])
1677
- }, null, 8, ["class"])) : createCommentVNode("", true),
1678
- ((_a = __props.group.pricing) == null ? void 0 : _a.name) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1679
- createTextVNode(toDisplayString(__props.group.pricing.name) + " ", 1),
1680
- ((_b = __props.group.products) == null ? void 0 : _b.length) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1681
- createTextVNode(" - ")
1682
- ], 64)) : createCommentVNode("", true)
1683
- ], 64)) : createCommentVNode("", true),
1684
- createTextVNode(" " + toDisplayString(unref(getComposedString)(((_c = __props.group.products) == null ? void 0 : _c.map((item) => item.name)) ?? [])) + " ", 1),
1685
- __props.isExpandable ? (openBlock(), createElementBlock("span", _hoisted_2$3, toDisplayString((_d = __props.group.lines) == null ? void 0 : _d.length), 1)) : createCommentVNode("", true)
1686
- ];
1687
- }),
1688
- _: 1
1689
- }),
1690
- createVNode(_sfc_main$m, { number: "" }, {
1691
- default: withCtx(() => [
1692
- __props.amountType === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$v, {
1693
- key: 0,
1694
- value: __props.group.amount_including_tax
1695
- }, null, 8, ["value"])) : (openBlock(), createBlock(_sfc_main$v, {
1696
- key: 1,
1697
- value: __props.group.amount_excluding_tax
1698
- }, null, 8, ["value"]))
1699
- ]),
1700
- _: 1
1701
- })
1702
- ], 42, _hoisted_1$7),
1703
- __props.expandedItems.includes(__props.formatIndex(__props.invoicePeriodOrder, __props.groupOrder)) ? (openBlock(), createElementBlock("tr", _hoisted_3$2, [
1704
- createElementVNode("td", _hoisted_4$2, [
1705
- createElementVNode("div", _hoisted_5$2, [
1706
- createVNode(_sfc_main$b, {
1707
- "invoice-period-order": __props.invoicePeriodOrder,
1708
- "start-date": __props.group.start_at,
1709
- "end-date": __props.group.end_at,
1710
- total: __props.group.amount_excluding_tax,
1711
- group: __props.group,
1712
- "amount-type": __props.amountType,
1713
- "processing-only-customers": __props.processingOnlyCustomers
1714
- }, {
1715
- "invoice-line-prefix": withCtx((linePrefixProps) => [
1716
- renderSlot(_ctx.$slots, "invoice-line-prefix", normalizeProps(guardReactiveProps(linePrefixProps)))
1717
- ]),
1718
- "one-off-line-context-menu": withCtx((oneOffGroupProps) => [
1719
- renderSlot(_ctx.$slots, "one-off-line-context-menu", mergeProps(oneOffGroupProps, { groupOrder: __props.groupOrder }))
1720
- ]),
1721
- _: 3
1722
- }, 8, ["invoice-period-order", "start-date", "end-date", "total", "group", "amount-type", "processing-only-customers"])
1723
- ])
1724
- ])
1725
- ])) : createCommentVNode("", true)
1726
- ], 64);
1727
- };
1728
- }
1729
- });
1730
- const _hoisted_1$6 = { class: "flex items-center justify-between md:py-2" };
1731
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1732
- __name: "InvoiceHeader",
1733
- props: {
1734
- invoice: {},
1735
- paymentAttempts: {},
1736
- downloadService: {},
1737
- showDownloadButton: { type: Boolean },
1738
- variant: { default: "internal" }
1739
- },
1740
- setup(__props) {
1741
- const props = __props;
1742
- const { $t, formatDate } = useIntl();
1743
- const lastAuthorizedPaymentAttempt = computed(
1744
- () => props.paymentAttempts.findLast((payment) => payment.result === "AUTHORIZED")
1745
- );
1746
- const dueDate = computed(
1747
- () => $t(
1748
- {
1749
- defaultMessage: "Due on {date}",
1750
- description: "Label for due date, where {date} gets replaced with the due date",
1751
- id: "invoice.due_on_label"
1752
- },
1753
- {
1754
- date: formatDate({
1755
- date: props.invoice.due_date,
1756
- format: "date",
1757
- offsetType: "offsetted",
1758
- timezone: props.invoice.customer.timezone
1759
- })
1760
- }
1761
- )
1762
- );
1763
- const invoiceDate = computed(
1764
- () => formatDate({
1765
- date: props.invoice.invoice_date,
1766
- format: "date",
1767
- offsetType: "offsetted",
1768
- timezone: props.invoice.customer.timezone
1769
- })
1770
- );
1771
- const title = computed(() => {
1772
- if (props.variant === "external") {
1773
- return invoiceDate.value;
1774
- }
1775
- return props.invoice.invoice_number || "N/A";
1776
- });
1777
- const paidOn = computed(() => {
1778
- if (!props.invoice.paid || !lastAuthorizedPaymentAttempt.value) {
1779
- return void 0;
1780
- }
1781
- return $t(
1782
- {
1783
- defaultMessage: "Paid on {date}",
1784
- description: "Label for payment date, where {date} gets replaced with the date",
1785
- id: "invoice.paid_on_label"
1786
- },
1787
- {
1788
- date: formatDate({
1789
- date: lastAuthorizedPaymentAttempt.value.created_at,
1790
- format: "date",
1791
- offsetType: "offsetted",
1792
- timezone: props.invoice.customer.timezone
1793
- })
1794
- }
1795
- );
1796
- });
1797
- const subTitle = computed(() => {
1798
- if (props.variant === "external") {
1799
- return [props.invoice.invoice_number, paidOn.value || dueDate.value].join(" - ");
1800
- }
1801
- return paidOn.value || dueDate.value;
1802
- });
1803
- return (_ctx, _cache) => {
1804
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
1805
- createVNode(_sfc_main$z, { title: title.value }, {
1806
- suffix: withCtx(() => [
1807
- __props.invoice.paid ? (openBlock(), createBlock(_sfc_main$w, {
1808
- key: 0,
1809
- color: "green",
1810
- class: "ml-2"
1811
- }, {
1812
- default: withCtx(() => [
1813
- createTextVNode(toDisplayString(unref($t)({
1814
- defaultMessage: "Paid",
1815
- description: "The paid chip label text for a paid invoice",
1816
- id: "invoice.paid_chip"
1817
- })), 1)
1818
- ]),
1819
- _: 1
1820
- })) : createCommentVNode("", true)
1821
- ]),
1822
- subTitle: withCtx(() => [
1823
- createVNode(_sfc_main$A, {
1824
- variant: "body-xs",
1825
- class: "flex gap-1"
1826
- }, {
1827
- default: withCtx(() => [
1828
- createTextVNode(toDisplayString(subTitle.value), 1)
1829
- ]),
1830
- _: 1
1831
- })
1832
- ]),
1833
- _: 1
1834
- }, 8, ["title"]),
1835
- __props.showDownloadButton ? (openBlock(), createBlock(_sfc_main$p, {
1836
- key: 0,
1837
- size: "lg",
1838
- variant: "outline",
1839
- "download-service": __props.downloadService,
1840
- "mobile-icon-only": ""
1841
- }, {
1842
- default: withCtx(() => [
1843
- createTextVNode(toDisplayString(unref($t)({
1844
- defaultMessage: "Download PDF",
1845
- description: "Title for button download pdf invoice",
1846
- id: "invoice.download_pdf_button"
1847
- })), 1)
1848
- ]),
1849
- _: 1
1850
- }, 8, ["download-service"])) : createCommentVNode("", true)
1851
- ]);
1852
- };
1853
- }
1854
- });
1855
- function toValue(r) {
1856
- return typeof r === "function" ? r() : unref(r);
1857
- }
1858
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
1859
- function useToggle(initialValue = false, options = {}) {
1860
- const {
1861
- truthyValue = true,
1862
- falsyValue = false
1863
- } = options;
1864
- const valueIsRef = isRef(initialValue);
1865
- const _value = ref(initialValue);
1866
- function toggle(value) {
1867
- if (arguments.length) {
1868
- _value.value = value;
1869
- return _value.value;
1870
- } else {
1871
- const truthy = toValue(truthyValue);
1872
- _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;
1873
- return _value.value;
1874
- }
1875
- }
1876
- if (valueIsRef)
1877
- return toggle;
1878
- else
1879
- return [_value, toggle];
1880
- }
1881
- const _hoisted_1$5 = {
1882
- key: 0,
1883
- totals: "",
1884
- class: "border-t"
1885
- };
1886
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1887
- __name: "InvoiceSummaryTotalExcludingTax",
1888
- props: {
1889
- baseAmount: {}
1890
- },
1891
- setup(__props) {
1892
- const intl = useIntl();
1893
- return (_ctx, _cache) => {
1894
- return __props.baseAmount ? (openBlock(), createElementBlock("tr", _hoisted_1$5, [
1895
- createVNode(_sfc_main$m, null, {
1896
- default: withCtx(() => [
1897
- createTextVNode(toDisplayString(unref(intl).$t({
1898
- id: "invoice.table_header.total_excluding_taxes",
1899
- defaultMessage: "Total excluding taxes",
1900
- description: "Table row header for the total excluding taxes column in the invoice table"
1901
- })), 1)
1902
- ]),
1903
- _: 1
1904
- }),
1905
- createVNode(_sfc_main$m, { number: "" }, {
1906
- default: withCtx(() => [
1907
- createVNode(_sfc_main$v, { value: __props.baseAmount }, null, 8, ["value"])
1908
- ]),
1909
- _: 1
1910
- })
1911
- ])) : createCommentVNode("", true);
1912
- };
1913
- }
1914
- });
1915
- const _hoisted_1$4 = {
1916
- key: 0,
1917
- class: "font-bold border-t"
1918
- };
1919
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1920
- __name: "InvoiceSummaryTotalIncludingTax",
1921
- props: {
1922
- totalAmount: {},
1923
- isCustomerFacing: { type: Boolean }
1924
- },
1925
- setup(__props) {
1926
- const intl = useIntl();
1927
- return (_ctx, _cache) => {
1928
- return __props.totalAmount ? (openBlock(), createElementBlock("tr", _hoisted_1$4, [
1929
- createVNode(_sfc_main$m, { class: "font-bold" }, {
1930
- default: withCtx(() => [
1931
- createTextVNode(toDisplayString(__props.isCustomerFacing ? unref(intl).$t({
1932
- id: "invoice.table_header.total_including_taxes_customer_facing",
1933
- defaultMessage: "Total due today",
1934
- description: "Table row header for the total including taxes column in the invoice table for a customer facing component"
1935
- }) : unref(intl).$t({
1936
- id: "invoice.table_header.total_including_taxes",
1937
- defaultMessage: "Total including taxes",
1938
- description: "Table row header for the total including taxes column in the invoice table"
1939
- })), 1)
1940
- ]),
1941
- _: 1
1942
- }),
1943
- createVNode(_sfc_main$m, { number: "" }, {
1944
- default: withCtx(() => [
1945
- createVNode(_sfc_main$v, { value: __props.totalAmount }, null, 8, ["value"])
1946
- ]),
1947
- _: 1
1948
- })
1949
- ])) : createCommentVNode("", true);
1950
- };
1951
- }
1952
- });
1953
- const _hoisted_1$3 = {
1954
- key: 0,
1955
- colspan: "4",
1956
- class: "p-0"
1957
- };
1958
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1959
- __name: "InvoiceTaxes",
1960
- props: {
1961
- taxCategories: {}
1962
- },
1963
- setup(__props) {
1964
- const intl = useIntl();
1965
- return (_ctx, _cache) => {
1966
- return openBlock(), createBlock(InvoiceTable, { class: "table-fixed" }, {
1967
- default: withCtx(() => [
1968
- createElementVNode("tr", null, [
1969
- createVNode(_sfc_main$l, { left: "" }, {
1970
- default: withCtx(() => [
1971
- createTextVNode(toDisplayString(unref(intl).$t({
1972
- id: "invoice.table_header.tax type",
1973
- defaultMessage: "Tax type",
1974
- description: "Table header for the column containing the tax type"
1975
- })), 1)
1976
- ]),
1977
- _: 1
1978
- }),
1979
- createVNode(_sfc_main$l, { right: "" }, {
1980
- default: withCtx(() => [
1981
- createTextVNode(toDisplayString(unref(intl).$t({
1982
- id: "invoice.table_header.base amount",
1983
- defaultMessage: "Base amount",
1984
- description: "Table header for the column containing the base amount"
1985
- })), 1)
1986
- ]),
1987
- _: 1
1988
- }),
1989
- createVNode(_sfc_main$l, { right: "" }, {
1990
- default: withCtx(() => [
1991
- createTextVNode(toDisplayString(unref(intl).$t({
1992
- id: "invoice.table_header.tax_percentage",
1993
- defaultMessage: "Percentage",
1994
- description: "Table header for the column containing the tax percentage"
1995
- })), 1)
1996
- ]),
1997
- _: 1
1998
- }),
1999
- createVNode(_sfc_main$l, { right: "" }, {
2000
- default: withCtx(() => [
2001
- createTextVNode(toDisplayString(unref(intl).$t({
2002
- id: "invoice.table_header.tax amount",
2003
- defaultMessage: "Tax amount",
2004
- description: "Table header for the column containing the tax amount"
2005
- })), 1)
2006
- ]),
2007
- _: 1
2008
- })
2009
- ]),
2010
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.taxCategories, (taxCategory, taxCategoryIndex) => {
2011
- return openBlock(), createElementBlock("tr", { key: taxCategoryIndex }, [
2012
- taxCategory.rates ? (openBlock(), createElementBlock("td", _hoisted_1$3, [
2013
- createVNode(InvoiceTable, { class: "table-fixed" }, {
2014
- default: withCtx(() => [
2015
- (openBlock(true), createElementBlock(Fragment, null, renderList(taxCategory.rates, (rate, rateIndex) => {
2016
- return openBlock(), createElementBlock("tr", { key: rateIndex }, [
2017
- createVNode(_sfc_main$m, null, {
2018
- default: withCtx(() => [
2019
- createTextVNode(toDisplayString(rate.name) + " (" + toDisplayString(taxCategory.category) + ") ", 1)
2020
- ]),
2021
- _: 2
2022
- }, 1024),
2023
- createVNode(_sfc_main$m, { number: "" }, {
2024
- default: withCtx(() => [
2025
- createVNode(_sfc_main$v, {
2026
- value: taxCategory.base_amount
2027
- }, null, 8, ["value"])
2028
- ]),
2029
- _: 2
2030
- }, 1024),
2031
- createVNode(_sfc_main$m, { number: "" }, {
2032
- default: withCtx(() => [
2033
- createTextVNode(toDisplayString(rate.percentage) + "%", 1)
2034
- ]),
2035
- _: 2
2036
- }, 1024),
2037
- createVNode(_sfc_main$m, { number: "" }, {
2038
- default: withCtx(() => [
2039
- createVNode(_sfc_main$v, {
2040
- value: rate.tax_amount
2041
- }, null, 8, ["value"])
2042
- ]),
2043
- _: 2
2044
- }, 1024)
2045
- ]);
2046
- }), 128))
2047
- ]),
2048
- _: 2
2049
- }, 1024)
2050
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2051
- createVNode(_sfc_main$m, null, {
2052
- default: withCtx(() => [
2053
- createTextVNode(toDisplayString(taxCategory.name) + " (" + toDisplayString(taxCategory.category) + ") ", 1)
2054
- ]),
2055
- _: 2
2056
- }, 1024),
2057
- createVNode(_sfc_main$m, { number: "" }, {
2058
- default: withCtx(() => [
2059
- createVNode(_sfc_main$v, {
2060
- value: taxCategory.base_amount
2061
- }, null, 8, ["value"])
2062
- ]),
2063
- _: 2
2064
- }, 1024),
2065
- createVNode(_sfc_main$m, { number: "" }, {
2066
- default: withCtx(() => [
2067
- createTextVNode(toDisplayString(taxCategory.percentage) + "%", 1)
2068
- ]),
2069
- _: 2
2070
- }, 1024),
2071
- createVNode(_sfc_main$m, { number: "" }, {
2072
- default: withCtx(() => [
2073
- createVNode(_sfc_main$v, {
2074
- value: taxCategory.tax_amount
2075
- }, null, 8, ["value"])
2076
- ]),
2077
- _: 2
2078
- }, 1024)
2079
- ], 64))
2080
- ]);
2081
- }), 128))
2082
- ]),
2083
- _: 1
2084
- });
2085
- };
2086
- }
2087
- });
2088
- const _hoisted_1$2 = { class: "flex justify-between items-start" };
2089
- const _hoisted_2$2 = {
2090
- key: 0,
2091
- class: "max-h-9"
2092
- };
2093
- const _hoisted_3$1 = { class: "flex flex-col gap-2" };
2094
- const _hoisted_4$1 = { key: 0 };
2095
- const _hoisted_5$1 = ["tabindex"];
2096
- const _hoisted_6$1 = {
2097
- key: 1,
2098
- class: "inline-flex justify-center items-center w-3.5 h-3.5 rounded-full bg-blue-100 text-blue-600 text-2xs ml-1 font-bold"
2099
- };
2100
- const _hoisted_7$1 = { key: 3 };
2101
- const _hoisted_8 = {
2102
- colspan: "2",
2103
- class: "p-0"
2104
- };
2105
- const _hoisted_9 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
2106
- const _hoisted_10 = ["tabindex", "onClick", "onKeyup"];
2107
- const _hoisted_11 = {
2108
- key: 1,
2109
- class: "inline-flex justify-center items-center w-3.5 h-3.5 rounded-full bg-blue-100 text-blue-600 text-2xs ml-1 font-bold"
2110
- };
2111
- const _hoisted_12 = { key: 0 };
2112
- const _hoisted_13 = {
2113
- colspan: "2",
2114
- class: "p-0"
2115
- };
2116
- const _hoisted_14 = { class: "px-9 py-3 -mx-9 bg-gray-50 text-xs" };
2117
- const _hoisted_15 = {
2118
- key: 0,
2119
- class: "font-bold border-t"
2120
- };
2121
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2122
- __name: "InvoiceSummary",
2123
- props: {
2124
- invoice: {},
2125
- isExpandable: { type: Boolean, default: false },
2126
- isInvoiceLineCreatable: { type: Boolean, default: false },
2127
- showRenderedServicesHeader: { type: Boolean, default: true },
2128
- isCustomerFacing: { type: Boolean }
2129
- },
2130
- setup(__props) {
2131
- const intl = useIntl();
2132
- const props = __props;
2133
- const [expandedItems, toggleItems] = useSimpleToggleList();
2134
- const [expandedDeductions, toggleDeductions] = useSimpleToggleList();
2135
- const [expandedTaxes, toggleTaxes] = useToggle();
2136
- const handleToggleItems = (...params) => {
2137
- if (!props.isExpandable) return;
2138
- toggleItems(...params);
2139
- };
2140
- const handleToggleDeductions = (index) => {
2141
- if (!props.isExpandable) return;
2142
- toggleDeductions(index);
2143
- };
2144
- const handleToggleTaxes = () => {
2145
- if (!props.invoice.tax_categories || !props.isExpandable) return;
2146
- toggleTaxes();
2147
- };
2148
- const formatIndex = (rootIndex, itemIndex) => +`${rootIndex}${itemIndex}`;
2149
- const getTitle = (invoicePeriod) => {
2150
- return intl.$t(
2151
- {
2152
- id: "invoice.service_period_heading",
2153
- defaultMessage: "Service period - {start_at} - {end_at}",
2154
- description: "Heading for rendered services where {start_at} is replaced for the start date and {end_at} for the end date in invoice summary"
2155
- },
2156
- {
2157
- start_at: intl.formatDate({
2158
- date: invoicePeriod.start_at,
2159
- format: "date",
2160
- timezone: formatTimezone(props.invoice.customer.timezone),
2161
- offsetType: "offsetted"
2162
- }),
2163
- end_at: intl.formatDate({
2164
- date: invoicePeriod.end_at,
2165
- format: "date",
2166
- timezone: formatTimezone(props.invoice.customer.timezone),
2167
- offsetType: "offsetted"
2168
- })
2169
- }
2170
- );
2171
- };
2172
- const getTableHeading = (invoiceGroupType) => {
2173
- switch (invoiceGroupType) {
2174
- case "PRICING":
2175
- case "REVENUE": {
2176
- return intl.$t({
2177
- id: "invoice.table_heading.products",
2178
- defaultMessage: "Products",
2179
- description: "Table heading for the column containing the products of the invoice"
2180
- });
2181
- }
2182
- case "COMMITMENT":
2183
- return intl.$t({
2184
- id: "invoice.table_heading.commitments",
2185
- defaultMessage: "Commitments",
2186
- description: "Table heading for the column containing the commitments of the invoice"
2187
- });
2188
- case "DISCOUNT":
2189
- return intl.$t({
2190
- id: "invoice.table_heading.discounts",
2191
- defaultMessage: "Discounts",
2192
- description: "Table heading for the column containing the discounts of the invoice"
2193
- });
2194
- case "MARKUP":
2195
- return intl.$t({
2196
- id: "invoice.table_heading.markups",
2197
- defaultMessage: "Markups",
2198
- description: "Table heading for the column containing the markups of the invoice"
2199
- });
2200
- case "ONE_OFF":
2201
- return intl.$t({
2202
- id: "invoice.table_heading.one_offs",
2203
- defaultMessage: "One-off's",
2204
- description: "Table heading for the column containing the one-offs of the invoice"
2205
- });
2206
- }
2207
- };
2208
- const getInvoiceGroupsByType = (invoicePeriod) => {
2209
- return invoicePeriod.groups.reduce(
2210
- (acc, invoiceGroup) => {
2211
- if (!(invoiceGroup.type in acc)) {
2212
- return { ...acc, [invoiceGroup.type]: [invoiceGroup] };
2213
- }
2214
- return {
2215
- ...acc,
2216
- [invoiceGroup.type]: [...acc[invoiceGroup.type], invoiceGroup]
2217
- };
2218
- },
2219
- {}
2220
- );
2221
- };
2222
- return (_ctx, _cache) => {
2223
- return openBlock(), createElementBlock("div", null, [
2224
- createElementVNode("div", _hoisted_1$2, [
2225
- _ctx.$slots.logo ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
2226
- renderSlot(_ctx.$slots, "logo")
2227
- ])) : (openBlock(), createBlock(_sfc_main$z, {
2228
- key: 1,
2229
- title: unref(intl).$t({
2230
- id: "invoice.title",
2231
- defaultMessage: "Details",
2232
- description: "Title for the invoice summary"
2233
- }),
2234
- variant: "neutral",
2235
- icon: "draft"
2236
- }, null, 8, ["title"])),
2237
- _ctx.$slots.intro ? renderSlot(_ctx.$slots, "intro", { key: 2 }) : createCommentVNode("", true),
2238
- createElementVNode("div", _hoisted_3$1, [
2239
- ["ONE_OFF", "STANDARD", "ONE_OFF_CREDIT"].includes(__props.invoice.type) && ["DRAFT", "OPEN"].includes(__props.invoice.status) && __props.isInvoiceLineCreatable ? (openBlock(), createBlock(_sfc_main$q, {
2240
- key: 0,
2241
- to: { name: "invoice-add-line", params: { id: __props.invoice.id } },
2242
- class: "text-sm font-semibold"
2243
- }, {
2244
- default: withCtx(() => [
2245
- createVNode(_sfc_main$r, {
2246
- icon: "add",
2247
- size: "md",
2248
- class: "mr-1"
2249
- }),
2250
- createElementVNode("span", null, toDisplayString(unref(intl).$t({
2251
- id: "invoice.add_invoice_line",
2252
- defaultMessage: "Add invoice line",
2253
- description: "Label for adding lines to an invoice"
2254
- })), 1)
2255
- ]),
2256
- _: 1
2257
- }, 8, ["to"])) : createCommentVNode("", true),
2258
- renderSlot(_ctx.$slots, "child-customers-selector")
2259
- ])
2260
- ]),
2261
- _ctx.$slots.total ? renderSlot(_ctx.$slots, "total", { key: 0 }) : createCommentVNode("", true),
2262
- renderSlot(_ctx.$slots, "notes"),
2263
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.invoice.periods, (invoicePeriod, invoicePeriodIndex) => {
2264
- return openBlock(), createElementBlock(Fragment, { key: invoicePeriodIndex }, [
2265
- __props.showRenderedServicesHeader ? (openBlock(), createBlock(_sfc_main$B, {
2266
- key: 0,
2267
- class: "mt-6"
2268
- }, {
2269
- default: withCtx(() => [
2270
- createVNode(_sfc_main$A, {
2271
- tag: "h2",
2272
- variant: "caps-heading"
2273
- }, {
2274
- default: withCtx(() => [
2275
- createTextVNode(toDisplayString(getTitle(invoicePeriod)), 1)
2276
- ]),
2277
- _: 2
2278
- }, 1024)
2279
- ]),
2280
- _: 2
2281
- }, 1024)) : createCommentVNode("", true),
2282
- invoicePeriod.groups ? (openBlock(), createBlock(InvoiceTable, {
2283
- key: 1,
2284
- class: normalizeClass({ "mt-3": __props.showRenderedServicesHeader })
2285
- }, {
2286
- default: withCtx(() => [
2287
- (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(
2288
- getInvoiceGroupsByType(invoicePeriod)
2289
- ), ([groupType, groups], index) => {
2290
- return openBlock(), createElementBlock(Fragment, { key: groupType }, [
2291
- index > 0 ? (openBlock(), createElementBlock("tr", _hoisted_4$1, [..._cache[0] || (_cache[0] = [
2292
- createElementVNode("td", null, [
2293
- createElementVNode("div", { class: "h-4" })
2294
- ], -1)
2295
- ])])) : createCommentVNode("", true),
2296
- createElementVNode("tr", null, [
2297
- createVNode(_sfc_main$l, {
2298
- left: "",
2299
- class: "text-gray-600"
2300
- }, {
2301
- default: withCtx(() => [
2302
- createTextVNode(toDisplayString(getTableHeading(groupType)), 1)
2303
- ]),
2304
- _: 2
2305
- }, 1024),
2306
- createVNode(_sfc_main$l, {
2307
- right: "",
2308
- class: "text-gray-600"
2309
- }, {
2310
- default: withCtx(() => [
2311
- createTextVNode(toDisplayString(unref(intl).$t({
2312
- id: "invoice.amount_table_heading",
2313
- defaultMessage: "Amount",
2314
- description: "Table heading for the amount column in the invoice table"
2315
- })), 1)
2316
- ]),
2317
- _: 1
2318
- })
2319
- ]),
2320
- (openBlock(true), createElementBlock(Fragment, null, renderList(groups, (group, groupIndex) => {
2321
- return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [
2322
- groupType === "REVENUE" || groupType === "PRICING" || groupType === "ONE_OFF" ? (openBlock(), createBlock(_sfc_main$a, {
2323
- key: 0,
2324
- group,
2325
- "expanded-items": unref(expandedItems),
2326
- "handle-toggle-items": handleToggleItems,
2327
- "is-expandable": __props.isExpandable,
2328
- "format-index": formatIndex,
2329
- "invoice-period-order": invoicePeriod.period_order,
2330
- "group-order": group.group_order,
2331
- "amount-type": __props.invoice.pricing_amount_type,
2332
- "processing-only-customers": __props.invoice.processing_only_customers
2333
- }, {
2334
- "invoice-line-prefix": withCtx((linePrefixProps) => [
2335
- renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
2336
- ]),
2337
- "one-off-line-context-menu": withCtx((oneOffGroupProps) => [
2338
- renderSlot(_ctx.$slots, "one-off-line-context-menu", mergeProps({ ref_for: true }, oneOffGroupProps, {
2339
- periodOrder: invoicePeriod.period_order
2340
- }))
2341
- ]),
2342
- _: 2
2343
- }, 1032, ["group", "expanded-items", "is-expandable", "invoice-period-order", "group-order", "amount-type", "processing-only-customers"])) : groupType === "DISCOUNT" || groupType === "MARKUP" ? (openBlock(), createBlock(_sfc_main$g, {
2344
- key: 1,
2345
- group,
2346
- "expanded-items": unref(expandedItems),
2347
- "handle-toggle-items": handleToggleItems,
2348
- "is-expandable": __props.isExpandable,
2349
- "format-index": formatIndex,
2350
- "invoice-period-order": invoicePeriod.period_order,
2351
- "group-order": group.group_order,
2352
- "amount-type": __props.invoice.pricing_amount_type,
2353
- heading: groupType === "DISCOUNT" ? unref(intl).$t({
2354
- id: "invoice.discounts_table_heading",
2355
- defaultMessage: "Discounts",
2356
- description: "Heading for discounts in the invoice table"
2357
- }) : unref(intl).$t({
2358
- id: "invoice.markups_table_heading",
2359
- defaultMessage: "Markups",
2360
- description: "Heading for markups in the invoice table"
2361
- })
2362
- }, {
2363
- "invoice-line-prefix": withCtx((linePrefixProps) => [
2364
- renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
2365
- ]),
2366
- _: 3
2367
- }, 8, ["group", "expanded-items", "is-expandable", "invoice-period-order", "group-order", "amount-type", "heading"])) : groupType === "COMMITMENT" ? (openBlock(), createBlock(_sfc_main$h, {
2368
- key: 2,
2369
- group,
2370
- "expanded-items": unref(expandedItems),
2371
- "handle-toggle-items": handleToggleItems,
2372
- "is-expandable": __props.isExpandable,
2373
- "format-index": formatIndex,
2374
- "invoice-period-order": invoicePeriod.period_order,
2375
- "group-order": group.group_order,
2376
- "amount-type": __props.invoice.pricing_amount_type
2377
- }, {
2378
- "invoice-line-prefix": withCtx((linePrefixProps) => [
2379
- renderSlot(_ctx.$slots, "invoice-line-prefix", mergeProps({ ref_for: true }, linePrefixProps))
2380
- ]),
2381
- _: 3
2382
- }, 8, ["group", "expanded-items", "is-expandable", "invoice-period-order", "group-order", "amount-type"])) : createCommentVNode("", true)
2383
- ], 64);
2384
- }), 128))
2385
- ], 64);
2386
- }), 128))
2387
- ]),
2388
- _: 2
2389
- }, 1032, ["class"])) : createCommentVNode("", true)
2390
- ], 64);
2391
- }), 128)),
2392
- __props.invoice.tax_summary ? (openBlock(), createBlock(InvoiceTable, {
2393
- key: 1,
2394
- class: "mt-6"
2395
- }, {
2396
- default: withCtx(() => [
2397
- createElementVNode("tr", null, [
2398
- createVNode(_sfc_main$l, {
2399
- left: "",
2400
- class: "text-gray-600"
2401
- }, {
2402
- default: withCtx(() => [
2403
- createTextVNode(toDisplayString(unref(intl).$t({
2404
- id: "invoice.totals_table_heading",
2405
- defaultMessage: "Totals",
2406
- description: "Table heading for the totals column in the invoice table"
2407
- })), 1)
2408
- ]),
2409
- _: 1
2410
- }),
2411
- createVNode(_sfc_main$l, {
2412
- right: "",
2413
- class: "text-gray-600"
2414
- }, {
2415
- default: withCtx(() => [
2416
- createTextVNode(toDisplayString(unref(intl).$t({
2417
- id: "invoice.amount_table_heading",
2418
- defaultMessage: "Amount",
2419
- description: "Table heading for the amount column in the invoice table"
2420
- })), 1)
2421
- ]),
2422
- _: 1
2423
- })
2424
- ]),
2425
- __props.invoice.pricing_amount_type === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$7, {
2426
- key: 0,
2427
- "total-amount": __props.invoice.tax_summary.total_amount,
2428
- "is-customer-facing": __props.isCustomerFacing
2429
- }, null, 8, ["total-amount", "is-customer-facing"])) : (openBlock(), createBlock(_sfc_main$8, {
2430
- key: 1,
2431
- "base-amount": __props.invoice.tax_summary.base_amount
2432
- }, null, 8, ["base-amount"])),
2433
- __props.invoice.tax_summary.tax_amount ? (openBlock(), createElementBlock("tr", {
2434
- key: 2,
2435
- class: normalizeClass([{ "cursor-pointer": __props.invoice.tax_categories && __props.isExpandable }, "border-t"]),
2436
- tabindex: __props.isExpandable ? 0 : void 0,
2437
- onClick: handleToggleTaxes,
2438
- onKeyup: [
2439
- withKeys(handleToggleTaxes, ["enter"]),
2440
- withKeys(handleToggleTaxes, ["space"])
2441
- ]
2442
- }, [
2443
- createVNode(_sfc_main$m, null, {
2444
- default: withCtx(() => [
2445
- __props.isExpandable && __props.invoice.tax_categories && __props.invoice.tax_categories.length ? (openBlock(), createBlock(_sfc_main$r, {
2446
- key: 0,
2447
- icon: "keyboard_arrow_down",
2448
- size: "md",
2449
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", { "-rotate-90": !unref(expandedTaxes) }])
2450
- }, null, 8, ["class"])) : createCommentVNode("", true),
2451
- createTextVNode(" " + toDisplayString(unref(intl).$t({
2452
- id: "invoice.taxes_table_heading",
2453
- defaultMessage: "Taxes",
2454
- description: "Table heading for the taxes column in the invoice table"
2455
- })) + " ", 1),
2456
- __props.isExpandable && __props.invoice.tax_categories ? (openBlock(), createElementBlock("span", _hoisted_6$1, toDisplayString(__props.invoice.tax_categories.length), 1)) : createCommentVNode("", true)
2457
- ]),
2458
- _: 1
2459
- }),
2460
- createVNode(_sfc_main$m, { number: "" }, {
2461
- default: withCtx(() => [
2462
- createVNode(_sfc_main$v, {
2463
- value: __props.invoice.tax_summary.tax_amount
2464
- }, null, 8, ["value"])
2465
- ]),
2466
- _: 1
2467
- })
2468
- ], 42, _hoisted_5$1)) : createCommentVNode("", true),
2469
- unref(expandedTaxes) && __props.invoice.tax_categories ? (openBlock(), createElementBlock("tr", _hoisted_7$1, [
2470
- createElementVNode("td", _hoisted_8, [
2471
- createElementVNode("div", _hoisted_9, [
2472
- createVNode(_sfc_main$6, {
2473
- "tax-categories": __props.invoice.tax_categories
2474
- }, null, 8, ["tax-categories"])
2475
- ])
2476
- ])
2477
- ])) : createCommentVNode("", true),
2478
- __props.invoice.pricing_amount_type === "INCLUDING_TAX" ? (openBlock(), createBlock(_sfc_main$8, {
2479
- key: 4,
2480
- "base-amount": __props.invoice.tax_summary.base_amount
2481
- }, null, 8, ["base-amount"])) : (openBlock(), createBlock(_sfc_main$7, {
2482
- key: 5,
2483
- "total-amount": __props.invoice.tax_summary.total_amount
2484
- }, null, 8, ["total-amount"]))
2485
- ]),
2486
- _: 1
2487
- })) : createCommentVNode("", true),
2488
- !unref(isEmpty)(__props.invoice.closed_periods) ? (openBlock(), createBlock(InvoiceTable, {
2489
- key: 2,
2490
- class: "mt-6"
2491
- }, {
2492
- default: withCtx(() => [
2493
- createElementVNode("tr", null, [
2494
- createVNode(_sfc_main$l, {
2495
- left: "",
2496
- class: "text-gray-600"
2497
- }, {
2498
- default: withCtx(() => [
2499
- createTextVNode(toDisplayString(unref(intl).$t({
2500
- id: "invoice.already_deducted_table_heading",
2501
- defaultMessage: "Already deducted",
2502
- description: "Table heading for the already deducted rows in the invoice table"
2503
- })), 1)
2504
- ]),
2505
- _: 1
2506
- })
2507
- ]),
2508
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.invoice.closed_periods, (rootGroup, rootGroupIndex) => {
2509
- return openBlock(), createElementBlock(Fragment, { key: rootGroupIndex }, [
2510
- (openBlock(true), createElementBlock(Fragment, null, renderList(rootGroup.groups, (group, groupIndex) => {
2511
- return openBlock(), createElementBlock(Fragment, { key: groupIndex }, [
2512
- createElementVNode("tr", {
2513
- class: normalizeClass(["border-t", { "pt-6": rootGroupIndex === 0, "cursor-pointer": __props.isExpandable }]),
2514
- tabindex: __props.isExpandable ? 0 : void 0,
2515
- onClick: ($event) => handleToggleDeductions(formatIndex(rootGroupIndex, groupIndex)),
2516
- onKeyup: [
2517
- withKeys(($event) => handleToggleDeductions(formatIndex(rootGroupIndex, groupIndex)), ["enter"]),
2518
- withKeys(($event) => handleToggleDeductions(formatIndex(rootGroupIndex, groupIndex)), ["space"])
2519
- ]
2520
- }, [
2521
- createVNode(_sfc_main$m, { class: "p-0" }, {
2522
- default: withCtx(() => {
2523
- var _a, _b;
2524
- return [
2525
- __props.isExpandable ? (openBlock(), createBlock(_sfc_main$r, {
2526
- key: 0,
2527
- icon: "keyboard_arrow_down",
2528
- size: "md",
2529
- class: normalizeClass(["-translate-x-7 absolute text-slate-400", {
2530
- "-rotate-90": !unref(expandedDeductions).includes(
2531
- formatIndex(rootGroupIndex, groupIndex)
2532
- )
2533
- }])
2534
- }, null, 8, ["class"])) : createCommentVNode("", true),
2535
- createTextVNode(" " + toDisplayString(unref(getComposedString)(((_a = group.products) == null ? void 0 : _a.map((item) => item.name)) ?? [])) + " ", 1),
2536
- __props.isExpandable ? (openBlock(), createElementBlock("span", _hoisted_11, toDisplayString((_b = group.lines) == null ? void 0 : _b.length), 1)) : createCommentVNode("", true)
2537
- ];
2538
- }),
2539
- _: 2
2540
- }, 1024),
2541
- createVNode(_sfc_main$m, { number: "" }, {
2542
- default: withCtx(() => [
2543
- createVNode(_sfc_main$v, {
2544
- value: group.amount_excluding_tax
2545
- }, null, 8, ["value"])
2546
- ]),
2547
- _: 2
2548
- }, 1024)
2549
- ], 42, _hoisted_10),
2550
- unref(expandedDeductions).includes(formatIndex(rootGroupIndex, groupIndex)) ? (openBlock(), createElementBlock("tr", _hoisted_12, [
2551
- createElementVNode("td", _hoisted_13, [
2552
- createElementVNode("div", _hoisted_14, [
2553
- createVNode(_sfc_main$b, {
2554
- "start-date": group.start_at,
2555
- "end-date": group.end_at,
2556
- total: group.amount_excluding_tax,
2557
- group,
2558
- "amount-type": __props.invoice.pricing_amount_type
2559
- }, null, 8, ["start-date", "end-date", "total", "group", "amount-type"])
2560
- ])
2561
- ])
2562
- ])) : createCommentVNode("", true)
2563
- ], 64);
2564
- }), 128))
2565
- ], 64);
2566
- }), 128)),
2567
- __props.invoice.open_invoice_amount && !__props.invoice.paid ? (openBlock(), createElementBlock("tr", _hoisted_15, [
2568
- createVNode(_sfc_main$m, { class: "font-bold" }, {
2569
- default: withCtx(() => [
2570
- createTextVNode(toDisplayString(unref(intl).$t({
2571
- id: "invoice.amount_due_table_heading",
2572
- defaultMessage: "Amount due",
2573
- description: "Table heading for the amount due row in the invoice table"
2574
- })), 1)
2575
- ]),
2576
- _: 1
2577
- }),
2578
- createVNode(_sfc_main$m, { number: "" }, {
2579
- default: withCtx(() => [
2580
- createVNode(_sfc_main$v, {
2581
- value: __props.invoice.open_invoice_amount
2582
- }, null, 8, ["value"])
2583
- ]),
2584
- _: 1
2585
- })
2586
- ])) : createCommentVNode("", true)
2587
- ]),
2588
- _: 1
2589
- })) : createCommentVNode("", true)
2590
- ]);
2591
- };
2592
- }
2593
- });
2594
- function useInvoice({ invoiceId }) {
2595
- const { getInvoice, getInvoicePdf: downloadInvoicePdf } = createInvoicesService();
2596
- const service = () => getInvoice(invoiceId);
2597
- const {
2598
- data,
2599
- execute: get,
2600
- apiStatus,
2601
- error,
2602
- isPending
2603
- } = useService({
2604
- service
2605
- });
2606
- return {
2607
- invoice: data,
2608
- downloadInvoicePdf,
2609
- apiStatus,
2610
- error,
2611
- get,
2612
- isPending
2613
- };
2614
- }
2615
- function usePayments() {
2616
- const { getPayments } = createPaymentsService();
2617
- const { data, execute: get, error, apiStatus, isPending } = useService({
2618
- service: getPayments,
2619
- isCollection: true
2620
- });
2621
- return { payments: data, get, error, apiStatus, isPending };
2622
- }
3
+ import { u as useInvoice, a as usePayments } from "../../usePayments-D4uGKBsV.mjs";
4
+ import { _ as _sfc_main$g, d as defineCustomElement, g as getComponentName } from "../../component-CM9g6tbD.mjs";
5
+ import { u as useIntl, C as useToggleList, D as _sfc_main$5, _ as _sfc_main$6, I as InvoiceTable, E as _sfc_main$7, F as _sfc_main$8, t as _sfc_main$9, b as _sfc_main$a, G as _sfc_main$b, x as _sfc_main$c, y as _sfc_main$d, c as _sfc_main$f } from "../../vendor-ui-BwxuPDg8.mjs";
6
+ import { u as useViewport } from "../../useViewport-Bu0cyeSi.mjs";
7
+ import { _ as _sfc_main$e } from "../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-Dt_Vb7Wz.mjs";
2623
8
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2624
9
  __name: "Invoice.entry.view",
2625
10
  props: {
@@ -2627,7 +12,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2627
12
  locale: { type: String },
2628
13
  dateLocale: { type: String },
2629
14
  messages: { type: Object },
2630
- showTimezones: { type: Boolean },
2631
15
  primaryColor: { type: String },
2632
16
  secondaryColor: { type: String },
2633
17
  isShadowRoot: { type: Boolean },
@@ -2636,7 +20,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2636
20
  onLog: { type: Function },
2637
21
  allowedPortalTypes: { type: Array },
2638
22
  portalObject: { type: Object },
2639
- customElementName: { type: String },
2640
23
  branding: { type: Object },
2641
24
  configuration: { type: Object }
2642
25
  },
@@ -2740,7 +123,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2740
123
  const getPeriodTitle = (period) => formatMessage(
2741
124
  {
2742
125
  defaultMessage: "Service period - {startAt} - {endAt}",
2743
- id: "kFCxC4",
126
+ id: "wallet_balance.service_period_heading",
2744
127
  description: "Heading shown above wallet balance details for an invoice period"
2745
128
  },
2746
129
  {
@@ -2763,7 +146,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2763
146
  if (!(credits == null ? void 0 : credits.credit_type_id)) {
2764
147
  return formatMessage({
2765
148
  defaultMessage: "Credits",
2766
- id: "K2fM1n",
149
+ id: "wallet_balance.credit_type_fallback_label",
2767
150
  description: "Fallback label for wallet balance credit types when no name is available"
2768
151
  });
2769
152
  }
@@ -2771,7 +154,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2771
154
  };
2772
155
  const formatQuantity = (quantity) => quantity ? formatNumber(Number(quantity)) : formatMessage({
2773
156
  defaultMessage: "-",
2774
- id: "dHb0fN",
157
+ id: "empty_value_placeholder",
2775
158
  description: "Placeholder shown when a wallet balance quantity is missing"
2776
159
  });
2777
160
  const periodsWithCredits = computed(
@@ -2789,9 +172,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2789
172
  return openBlock(), createElementBlock("section", {
2790
173
  key: period.id
2791
174
  }, [
2792
- createVNode(unref(_sfc_main$B), { class: "mt-4" }, {
175
+ createVNode(unref(_sfc_main$5), { class: "mt-4" }, {
2793
176
  default: withCtx(() => [
2794
- createVNode(unref(_sfc_main$A), {
177
+ createVNode(unref(_sfc_main$6), {
2795
178
  tag: "h3",
2796
179
  variant: "caps-heading"
2797
180
  }, {
@@ -2806,14 +189,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2806
189
  createVNode(unref(InvoiceTable), { class: "mt-3" }, {
2807
190
  default: withCtx(() => [
2808
191
  createElementVNode("tr", null, [
2809
- createVNode(unref(_sfc_main$l), {
192
+ createVNode(unref(_sfc_main$7), {
2810
193
  left: "",
2811
194
  class: "text-gray-600"
2812
195
  }, {
2813
196
  default: withCtx(() => [
2814
197
  createTextVNode(toDisplayString(unref($t)({
2815
198
  defaultMessage: "Wallet balance",
2816
- id: "j2d7b2",
199
+ id: "wallet_balance.details.header",
2817
200
  description: "Section header for invoice wallet balance details"
2818
201
  })), 1)
2819
202
  ]),
@@ -2833,9 +216,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2833
216
  withKeys(($event) => unref(toggle)(row.id), ["space"])
2834
217
  ]
2835
218
  }, [
2836
- createVNode(unref(_sfc_main$m), { class: "p-0" }, {
219
+ createVNode(unref(_sfc_main$8), { class: "p-0" }, {
2837
220
  default: withCtx(() => [
2838
- createVNode(unref(_sfc_main$r), {
221
+ createVNode(unref(_sfc_main$9), {
2839
222
  icon: "keyboard_arrow_down",
2840
223
  size: "md",
2841
224
  class: normalizeClass(["absolute -translate-x-7 text-slate-400", { "-rotate-90": !unref(getIsOpen)(row.id) }])
@@ -2852,53 +235,53 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2852
235
  createVNode(unref(InvoiceTable), null, {
2853
236
  default: withCtx(() => [
2854
237
  createElementVNode("tr", null, [
2855
- createVNode(unref(_sfc_main$l), {
238
+ createVNode(unref(_sfc_main$7), {
2856
239
  left: "",
2857
240
  class: "w-2/5"
2858
241
  }, {
2859
242
  default: withCtx(() => [
2860
243
  createTextVNode(toDisplayString(unref($t)({
2861
244
  defaultMessage: "Credit breakdown",
2862
- id: "65I4e4",
245
+ id: "invoice_credits.credit_breakdown.table_header",
2863
246
  description: "Column header for wallet balance credit type details"
2864
247
  })), 1)
2865
248
  ]),
2866
249
  _: 1
2867
250
  }),
2868
- createVNode(unref(_sfc_main$l), {
251
+ createVNode(unref(_sfc_main$7), {
2869
252
  right: "",
2870
253
  class: "w-1/5"
2871
254
  }, {
2872
255
  default: withCtx(() => [
2873
256
  createTextVNode(toDisplayString(unref($t)({
2874
257
  defaultMessage: "Balance",
2875
- id: "4UjRe6",
258
+ id: "invoice_credits.balance.table_header",
2876
259
  description: "Column header for the available wallet balance amount"
2877
260
  })), 1)
2878
261
  ]),
2879
262
  _: 1
2880
263
  }),
2881
- createVNode(unref(_sfc_main$l), {
264
+ createVNode(unref(_sfc_main$7), {
2882
265
  right: "",
2883
266
  class: "w-1/5"
2884
267
  }, {
2885
268
  default: withCtx(() => [
2886
269
  createTextVNode(toDisplayString(unref($t)({
2887
270
  defaultMessage: "Used",
2888
- id: "rUy4Lk",
271
+ id: "invoice_credits.used.table_header",
2889
272
  description: "Column header for the used wallet credit amount"
2890
273
  })), 1)
2891
274
  ]),
2892
275
  _: 1
2893
276
  }),
2894
- createVNode(unref(_sfc_main$l), {
277
+ createVNode(unref(_sfc_main$7), {
2895
278
  right: "",
2896
279
  class: "w-1/5"
2897
280
  }, {
2898
281
  default: withCtx(() => [
2899
282
  createTextVNode(toDisplayString(unref($t)({
2900
283
  defaultMessage: "Remaining",
2901
- id: "C8F4/r",
284
+ id: "invoice_credits.remaining.table_header",
2902
285
  description: "Column header for the remaining wallet credit amount"
2903
286
  })), 1)
2904
287
  ]),
@@ -2910,25 +293,25 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2910
293
  key: breakdownRow.id,
2911
294
  class: "border-t"
2912
295
  }, [
2913
- createVNode(unref(_sfc_main$m), null, {
296
+ createVNode(unref(_sfc_main$8), null, {
2914
297
  default: withCtx(() => [
2915
298
  createTextVNode(toDisplayString(breakdownRow.label), 1)
2916
299
  ]),
2917
300
  _: 2
2918
301
  }, 1024),
2919
- createVNode(unref(_sfc_main$m), { number: "" }, {
302
+ createVNode(unref(_sfc_main$8), { number: "" }, {
2920
303
  default: withCtx(() => [
2921
304
  createTextVNode(toDisplayString(breakdownRow.available), 1)
2922
305
  ]),
2923
306
  _: 2
2924
307
  }, 1024),
2925
- createVNode(unref(_sfc_main$m), { number: "" }, {
308
+ createVNode(unref(_sfc_main$8), { number: "" }, {
2926
309
  default: withCtx(() => [
2927
310
  createTextVNode(toDisplayString(breakdownRow.used), 1)
2928
311
  ]),
2929
312
  _: 2
2930
313
  }, 1024),
2931
- createVNode(unref(_sfc_main$m), { number: "" }, {
314
+ createVNode(unref(_sfc_main$8), { number: "" }, {
2932
315
  default: withCtx(() => [
2933
316
  createTextVNode(toDisplayString(breakdownRow.left), 1)
2934
317
  ]),
@@ -2961,10 +344,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2961
344
  },
2962
345
  setup(__props) {
2963
346
  const { $t } = useIntl();
2964
- const { width } = useWindowSize();
2965
- const isSmallScreen = computed(() => width.value <= 768);
347
+ const { isMobileViewport: isSmallScreen } = useViewport();
2966
348
  return (_ctx, _cache) => {
2967
- return openBlock(), createBlock(unref(_sfc_main$C), {
349
+ return openBlock(), createBlock(unref(_sfc_main$a), {
2968
350
  title: unref($t)({
2969
351
  defaultMessage: "Invoice",
2970
352
  description: "Title for the invoice block on the invoice details page",
@@ -2974,13 +356,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2974
356
  }, {
2975
357
  default: withCtx(() => [
2976
358
  createElementVNode("div", {
2977
- class: normalizeClass({ "p-6 pt-2": !isSmallScreen.value })
359
+ class: normalizeClass({ "p-6 pt-2": !unref(isSmallScreen) })
2978
360
  }, [
2979
- isSmallScreen.value ? (openBlock(), createBlock(unref(_sfc_main$o), {
361
+ unref(isSmallScreen) ? (openBlock(), createBlock(unref(_sfc_main$b), {
2980
362
  key: 0,
2981
363
  variant: "default",
2982
364
  "has-icon": "",
2983
- class: "justify-center bg-gray-50 border-gray-100 text-gray-800 font-semibold"
365
+ class: "justify-center border-gray-100 bg-gray-50 font-semibold text-gray-800"
2984
366
  }, {
2985
367
  default: withCtx(() => [
2986
368
  createTextVNode(toDisplayString(unref($t)({
@@ -2991,9 +373,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2991
373
  ]),
2992
374
  _: 1
2993
375
  })) : createCommentVNode("", true),
2994
- createVNode(unref(_sfc_main$5), {
376
+ createVNode(unref(_sfc_main$c), {
2995
377
  invoice: __props.invoice,
2996
- "is-expandable": !isSmallScreen.value
378
+ "is-expandable": !unref(isSmallScreen)
2997
379
  }, {
2998
380
  logo: withCtx(() => [
2999
381
  renderSlot(_ctx.$slots, "logo")
@@ -3020,11 +402,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3020
402
  configuration: { type: Object }
3021
403
  },
3022
404
  setup(__props) {
405
+ const PaymentHistoryBlock = defineAsyncComponent(
406
+ () => import("../../PaymentHistoryBlock-YzJ6bxKr.mjs")
407
+ );
3023
408
  const { $t } = useIntl();
3024
409
  return (_ctx, _cache) => {
3025
410
  var _a, _b;
3026
411
  return openBlock(), createElementBlock(Fragment, null, [
3027
- createVNode(unref(_sfc_main$9), {
412
+ createVNode(unref(_sfc_main$d), {
3028
413
  class: "mb-6",
3029
414
  "payment-attempts": __props.payments ?? [],
3030
415
  invoice: __props.invoice,
@@ -3038,13 +423,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3038
423
  invoice: __props.invoice
3039
424
  }, null, 8, ["invoice"])) : createCommentVNode("", true),
3040
425
  createElementVNode("div", _hoisted_2, [
3041
- createVNode(_sfc_main$D, { invoice: __props.invoice }, null, 8, ["invoice"]),
3042
- ((_a = __props.configuration) == null ? void 0 : _a.enablePaymentAttempts) && ((_b = __props.payments) == null ? void 0 : _b.length) ? (openBlock(), createBlock(_sfc_main$E, {
426
+ createVNode(_sfc_main$e, { invoice: __props.invoice }, null, 8, ["invoice"]),
427
+ ((_a = __props.configuration) == null ? void 0 : _a.enablePaymentAttempts) && ((_b = __props.payments) == null ? void 0 : _b.length) ? (openBlock(), createBlock(unref(PaymentHistoryBlock), {
3043
428
  key: 0,
3044
429
  "payment-attempts": __props.payments,
3045
430
  customer: __props.invoice.customer
3046
431
  }, null, 8, ["payment-attempts", "customer"])) : createCommentVNode("", true),
3047
- __props.configuration.enableCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$F), {
432
+ __props.configuration.enableCustomerBillingInformation ? (openBlock(), createBlock(unref(_sfc_main$f), {
3048
433
  key: 1,
3049
434
  customer: __props.invoice.customer,
3050
435
  title: unref($t)({
@@ -3066,7 +451,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3066
451
  locale: { type: String },
3067
452
  dateLocale: { type: String },
3068
453
  messages: { type: Object },
3069
- showTimezones: { type: Boolean },
3070
454
  primaryColor: { type: String },
3071
455
  secondaryColor: { type: String },
3072
456
  isShadowRoot: { type: Boolean },
@@ -3075,7 +459,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3075
459
  onLog: { type: Function },
3076
460
  allowedPortalTypes: { type: Array },
3077
461
  portalObject: { type: Object },
3078
- customElementName: { type: String },
3079
462
  branding: { type: Object },
3080
463
  configuration: { type: Object }
3081
464
  },
@@ -3096,7 +479,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3096
479
  }));
3097
480
  return (_ctx, _cache) => {
3098
481
  var _a2, _b, _c, _d;
3099
- return openBlock(), createBlock(unref(_sfc_main$G), {
482
+ return openBlock(), createBlock(unref(_sfc_main$g), {
3100
483
  "custom-element-name": unref(COMPONENT_NAME),
3101
484
  environment: __props.environment,
3102
485
  locale: __props.locale,