@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.
- package/dist/ApiStatus-CyNDp_op.mjs +9 -0
- package/dist/ApiStatus-oqvUEWJx.js +1 -0
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js +1 -0
- package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs} +2 -4
- package/dist/{ContentWithAsideLayout-Ct24RV-2.mjs → ContentWithAsideLayout-BTdixy3L.mjs} +2 -11
- package/dist/ContentWithAsideLayout-oAYVrLvL.js +1 -0
- package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs} +2 -5
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js +1 -0
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js +1 -0
- 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
- package/dist/PaymentHistoryBlock-DHM-3fh-.js +1 -0
- package/dist/PaymentHistoryBlock-YzJ6bxKr.mjs +4 -0
- package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-D6Cr2Uga.mjs} +1 -5
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-DFw8lrDv.js +1 -0
- package/dist/PaymentIntegrationForm-Cl5ua8v8.js +1 -0
- package/dist/PaymentIntegrationForm-ID4QnvA3.mjs +4 -0
- package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CVWPT3Ni.mjs} +32 -189
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-DifRn1ok.js +1 -0
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CKNMt-JH.js +1 -0
- package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-CzS32ZUt.mjs} +5 -31
- package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BIxGqr9U.mjs} +4 -7
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-CpEqDnO3.js +1 -0
- package/dist/adyenLoader-CEH4A2b2.js +1 -0
- package/dist/adyenLoader-gsbzSjYV.mjs +177 -0
- package/dist/component-C2Gc-wsE.js +1 -0
- package/dist/component-CM9g6tbD.mjs +804 -0
- package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
- package/dist/components/BillingInformation/BillingInformation.es.js +3 -7
- package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
- package/dist/components/BillingInformationForm/BillingInformationForm.es.js +9 -17
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
- package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -7
- package/dist/components/Invoice/Invoice.cjs.js +1 -1
- package/dist/components/Invoice/Invoice.es.js +42 -2659
- package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
- package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -7
- package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
- package/dist/components/InvoicesList/InvoicesList.es.js +2 -6
- package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
- package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -7
- package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
- package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -33
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
- package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +8 -4824
- package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
- package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -8
- package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
- package/dist/components/WalletBalances/WalletBalances.es.js +3 -7
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.es.js +1 -1
- package/dist/core/types.d.ts +2 -0
- package/dist/{customer-CcQR-JIm.js → customer-C_Hz_npf.js} +1 -1
- package/dist/{customer-CJrpbGX4.mjs → customer-TIi7iZFw.mjs} +1 -1
- package/dist/en-US-CBoPxQwX.mjs +199 -0
- package/dist/en-US-DJq-9dD8.js +1 -0
- package/dist/index-CzL1ZcGi.mjs +85 -0
- package/dist/index-DRdBmZ2-.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4 -1
- package/dist/{invoices-CNK1Ushv.mjs → invoices-BuVOuTOm.mjs} +2 -15
- package/dist/invoices-DbvwXAsm.js +1 -0
- package/dist/nl-NL-BB7KbK-h.mjs +181 -0
- package/dist/nl-NL-CtU1Lg2F.js +1 -0
- package/dist/paymentMethods-B4AYGf0K.js +1 -0
- package/dist/{paymentMethods-C-ApE-G4.mjs → paymentMethods-Di32oJ39.mjs} +2 -2
- package/dist/{payments-CE9U7aKK.mjs → payments-C5fD1PXB.mjs} +1 -1
- package/dist/{payments-CLt0SExf.js → payments-DeutKq9x.js} +1 -1
- package/dist/{registry-B99ZnfEn.mjs → registry-BLwMl1bK.mjs} +6 -4
- package/dist/registry-CMSmkLcy.js +1 -0
- package/dist/screens/Checkout/Checkout.cjs.js +1 -1
- package/dist/screens/Checkout/Checkout.es.js +420 -2388
- package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
- package/dist/screens/CustomerOverview/CustomerOverview.es.js +13 -14
- package/dist/screens/PayInvoice/PayInvoice.ce.d.ts +3 -0
- package/dist/screens/PayInvoice/PayInvoice.cjs.js +1 -0
- package/dist/screens/PayInvoice/PayInvoice.es.js +456 -0
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
- package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +79 -61
- package/dist/solvimon-web.css +1 -1
- package/dist/source-DKDKBlUm.mjs +179 -0
- package/dist/source-dkMNFWDc.js +1 -0
- package/dist/{subscriptions-CoeCrY1I.mjs → subscriptions-mOgjjzUi.mjs} +2 -2
- package/dist/subscriptions-wdMADcQZ.js +1 -0
- package/dist/{useActionDispatchProvider-eO2qFPGv.mjs → useActionDispatchProvider-B4gszz0Q.mjs} +1 -1
- package/dist/{useActionDispatchProvider-CWVV_xsi.js → useActionDispatchProvider-DfS2P0bd.js} +1 -1
- package/dist/{useCustomer-PthyTFLl.js → useCustomer-DanZzn-l.js} +1 -1
- package/dist/{useCustomer--jycAz--.mjs → useCustomer-cbhDyWJL.mjs} +2 -2
- package/dist/useIncrementalLoading-DFe5Yh8M.js +1 -0
- package/dist/{useIncrementalLoading-CcnL3flF.mjs → useIncrementalLoading-RRicokf1.mjs} +3 -8
- package/dist/useInvoiceData-CxxHa5R2.js +1 -0
- package/dist/{useInvoiceData-BiMMoVoW.mjs → useInvoiceData-fS6G_244.mjs} +6 -12
- package/dist/{useInvoicesList-DFhF_gp7.mjs → useInvoicesList-BQQxcPdz.mjs} +23 -260
- package/dist/useInvoicesList-CtJqmblZ.js +1 -0
- package/dist/usePaymentMethodOptions-2MloZ9bY.mjs +26 -0
- package/dist/usePaymentMethodOptions-D01YWW3G.js +1 -0
- package/dist/{usePaymentMethods-BRQ7-dUr.js → usePaymentMethods-Cm9WdSW0.js} +1 -1
- package/dist/{usePaymentMethods-BX2RnHZN.mjs → usePaymentMethods-DZvfWSlx.mjs} +2 -2
- package/dist/usePayments-B13S_yai.js +1 -0
- package/dist/usePayments-D4uGKBsV.mjs +36 -0
- package/dist/usePortal-DJDJNLbo.mjs +12 -0
- package/dist/usePortal-DWJEVkTj.js +1 -0
- package/dist/useService-9fCKPTmu.js +1 -0
- package/dist/useService-BuWWE5ND.mjs +68 -0
- package/dist/useViewport-Bu0cyeSi.mjs +38 -0
- package/dist/useViewport-CKRY1CKR.js +1 -0
- package/dist/useWalletBalanceItems-B53Gkjro.mjs +106 -0
- package/dist/useWalletBalanceItems-BMaVT4TW.js +1 -0
- package/dist/useWatchDebounced-2ZLnfgvG.js +1 -0
- package/dist/useWatchDebounced-D1xuIX6_.mjs +12 -0
- package/dist/vendor-ui-BwxuPDg8.mjs +28598 -0
- package/dist/vendor-ui-Ce_Yp7xA.js +1 -0
- package/package.json +17 -10
- package/dist/Alert.vue.es-DMPvSykx.js +0 -1
- package/dist/Alert.vue.es-DsJ1ckRU.mjs +0 -172
- package/dist/Amount.vue.es-C6JE5rL8.mjs +0 -23
- package/dist/Amount.vue.es-h8wulbBG.js +0 -1
- package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +0 -93
- package/dist/Avatar.vue.es-BbyE0AjW.js +0 -1
- package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +0 -1
- package/dist/Button.vue.es-6sBk5tBL.mjs +0 -408
- package/dist/Button.vue.es-BC4_TItq.js +0 -1
- package/dist/CardContent.vue.es-ChEMrFCc.mjs +0 -115
- package/dist/CardContent.vue.es-i9ivuGKG.js +0 -1
- package/dist/Chip.vue.es-D0fkSe8a.js +0 -1
- package/dist/Chip.vue.es-DcW2CjUA.mjs +0 -1576
- package/dist/Comparators.vue.es-BdxDqU8o.js +0 -1
- package/dist/Comparators.vue.es-DdTKGB80.mjs +0 -406
- package/dist/ContentWithAsideLayout-UHovpjZu.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +0 -1
- package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +0 -175
- package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +0 -1
- package/dist/Divider.vue.es-ClFG8QtG.js +0 -1
- package/dist/Divider.vue.es-wKkIVBgb.mjs +0 -24
- package/dist/DividerText.vue.es-B7oa5Xpn.mjs +0 -72
- package/dist/DividerText.vue.es-yiFdPQvo.js +0 -1
- package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +0 -30
- package/dist/ErrorNotification.vue.es-FpRyg0De.js +0 -1
- package/dist/FormMessage.vue.es-DFQXxiSC.mjs +0 -46
- package/dist/FormMessage.vue.es-LeWoj774.js +0 -1
- package/dist/IconButton.vue.es-DNCwwH_j.mjs +0 -825
- package/dist/IconButton.vue.es-DiSiGPWO.js +0 -1
- package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +0 -1
- package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +0 -1
- package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +0 -1
- package/dist/PaymentMethod.vue.es-DYlnmZh7.js +0 -1
- package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +0 -1255
- package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +0 -1
- package/dist/Section.vue.es-3-H1pUTB.mjs +0 -79
- package/dist/Section.vue.es-BuzTXRLP.js +0 -1
- package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +0 -1
- package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +0 -136
- package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +0 -1
- package/dist/TrialChip.vue.es-BHYbW8b6.mjs +0 -759
- package/dist/TrialChip.vue.es-C6Xg_5rR.js +0 -1
- package/dist/_Uint8Array-DHE03FZr.mjs +0 -507
- package/dist/_Uint8Array-DxISR7XF.js +0 -1
- package/dist/_flatRest.es-BHFPCqZh.mjs +0 -642
- package/dist/_flatRest.es-dFffnTpX.js +0 -1
- package/dist/api.es-B4qAAJKr.js +0 -1
- package/dist/api.es-UkfpLiLL.mjs +0 -83
- package/dist/cloneDeep-Hs8Pp07F.js +0 -1
- package/dist/cloneDeep-sm9cY-u2.mjs +0 -212
- package/dist/cn.es-C7xoIs3C.js +0 -1
- package/dist/cn.es-tfxVlz02.mjs +0 -3191
- package/dist/component-ZRZIt3ZW.js +0 -1
- package/dist/component-dpA83LIN.mjs +0 -6569
- package/dist/countryData.es--zJAd6LA.mjs +0 -252
- package/dist/countryData.es-D3MFzU92.js +0 -1
- package/dist/customer.es-D42Md24r.js +0 -1
- package/dist/customer.es-LIW2YmLL.mjs +0 -30
- package/dist/formatting.es-9hM8aHSg.js +0 -1
- package/dist/formatting.es-D5H_ySFv.mjs +0 -68
- package/dist/getCountryNameByCode.es-fP52nO_7.js +0 -1
- package/dist/getCountryNameByCode.es-ymC9R46j.mjs +0 -8
- package/dist/index-2jo9BSPM.js +0 -1
- package/dist/index-BFZ0dPh9.mjs +0 -179
- package/dist/index-CI71bVGE.mjs +0 -2521
- package/dist/index-CWSXne1Q.js +0 -1
- package/dist/index-D3v7hAtc.mjs +0 -253
- package/dist/index-WLSPwi90.js +0 -1
- package/dist/index.es-BBJF2O2l.js +0 -1
- package/dist/index.es-LCAKs4tH.mjs +0 -438
- package/dist/invoices-3kVHsAXr.js +0 -1
- package/dist/isEmpty.es-Bp1SbWFu.mjs +0 -131
- package/dist/isEmpty.es-Dycf-CD_.js +0 -1
- package/dist/paymentMethods-DZRf0WRl.js +0 -1
- package/dist/pick.es-BgDAfhAl.js +0 -1
- package/dist/pick.es-DdVOyp0Q.mjs +0 -45
- package/dist/registry-ClZ43bQn.js +0 -1
- package/dist/sprite.svg.es-CCc3Mz1x.js +0 -1
- package/dist/sprite.svg.es-DZD704h3.mjs +0 -4
- package/dist/subscriptions-CS8HTxzC.js +0 -1
- package/dist/typeGuards.es-C4nR5FkL.js +0 -1
- package/dist/typeGuards.es-fwUoeMCe.mjs +0 -12
- package/dist/useIncrementalLoading-CAdNW-Bf.js +0 -1
- package/dist/useInvoiceData-DvQO_nKz.js +0 -1
- package/dist/useInvoicesList-CHkwSNO9.js +0 -1
- package/dist/useService-B67YWAcN.js +0 -1
- package/dist/useService-DG_zedHV.mjs +0 -282
- package/dist/useWalletBalanceItems-B5FMmoU2.mjs +0 -308
- package/dist/useWalletBalanceItems-BY3gq0fc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../BillingInformation.vue_vue_type_script_setup_true_lang-C-C0i6i6.js"),o=require("../../useCustomer-DanZzn-l.js"),r=require("../../useLoadInitialData-BRg7IWqW.js"),n=require("../../component-C2Gc-wsE.js"),l=e.defineComponent({__name:"BillingInformation.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup(t){const n=t.portalObject.customer_id,l=o.useCustomer({customerId:n}),{isLoading:i}=r.useLoadInitialData(l.get.execute());return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(l),isLoading:e.unref(i)})}}),i=e.defineComponent({__name:"BillingInformation.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup:o=>(r,i)=>{var a,s,c,m;return e.openBlock(),e.createBlock(e.unref(n._sfc_main),{"custom-element-name":e.unref(p),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(a=o.branding)?void 0:a.colors)?void 0:s.primary,"secondary-color":null==(m=null==(c=o.branding)?void 0:c.colors)?void 0:m.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:i[0]||(i[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(l,e.normalizeProps(e.guardReactiveProps(r.$props)),{default:e.withCtx(({customer:o,isLoading:r})=>[e.createVNode(t._sfc_main,{"is-loading":r,customer:o.customer.value},null,8,["is-loading","customer"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),a=n.defineCustomElement(i),p=n.getComponentName("billing-information");exports.COMPONENT_NAME=p,exports.SolvimonBillingInformation=a,exports.defineSolvimonBillingInformation=()=>{customElements.get(p)||customElements.define(p,a)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, renderSlot, unref, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$3 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { u as useCustomer } from "../../useCustomer
|
|
2
|
+
import { _ as _sfc_main$3 } from "../../BillingInformation.vue_vue_type_script_setup_true_lang-CT0Tjsnw.mjs";
|
|
3
|
+
import { u as useCustomer } from "../../useCustomer-cbhDyWJL.mjs";
|
|
4
4
|
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { _ as _sfc_main$2, d as defineCustomElement, g as getComponentName } from "../../component-CM9g6tbD.mjs";
|
|
6
6
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "BillingInformation.entry.view",
|
|
8
8
|
props: {
|
|
@@ -10,7 +10,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10
10
|
locale: { type: String },
|
|
11
11
|
dateLocale: { type: String },
|
|
12
12
|
messages: { type: Object },
|
|
13
|
-
showTimezones: { type: Boolean },
|
|
14
13
|
primaryColor: { type: String },
|
|
15
14
|
secondaryColor: { type: String },
|
|
16
15
|
isShadowRoot: { type: Boolean },
|
|
@@ -19,7 +18,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
19
18
|
onLog: { type: Function },
|
|
20
19
|
allowedPortalTypes: { type: Array },
|
|
21
20
|
portalObject: { type: Object },
|
|
22
|
-
customElementName: { type: String },
|
|
23
21
|
branding: { type: Object },
|
|
24
22
|
configuration: { type: Object }
|
|
25
23
|
},
|
|
@@ -43,7 +41,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
43
41
|
locale: { type: String },
|
|
44
42
|
dateLocale: { type: String },
|
|
45
43
|
messages: { type: Object },
|
|
46
|
-
showTimezones: { type: Boolean },
|
|
47
44
|
primaryColor: { type: String },
|
|
48
45
|
secondaryColor: { type: String },
|
|
49
46
|
isShadowRoot: { type: Boolean },
|
|
@@ -52,7 +49,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
52
49
|
onLog: { type: Function },
|
|
53
50
|
allowedPortalTypes: { type: Array },
|
|
54
51
|
portalObject: { type: Object },
|
|
55
|
-
customElementName: { type: String },
|
|
56
52
|
branding: { type: Object },
|
|
57
53
|
configuration: { type: Object }
|
|
58
54
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../Button.vue.es-BC4_TItq.js"),a=require("../../index-WLSPwi90.js"),o=require("../../ErrorNotification.vue.es-FpRyg0De.js"),r=require("../../component-ZRZIt3ZW.js"),l=require("../../typeGuards.es-C4nR5FkL.js"),n=require("../../cloneDeep-Hs8Pp07F.js"),i=require("../../api.es-B4qAAJKr.js"),d=require("../../useCustomer-PthyTFLl.js"),s={type:"INDIVIDUAL",email:"",country:"",addressLine1:"",postalCode:"",city:"",state:""};function u({initialState:t={},onSubmit:o}){const{form:r,validation:i,changes:d,hasChanges:u,updateInitialState:p,initialState:f}=(({initialState:t,validationRules:o,nullifyEmptyValues:r=!1,mode:l="shallow"})=>{const i=e.shallowRef(n.cloneDeep(t)),d=e.shallowRef(n.cloneDeep(t)),s=a.useValidation(o??{},d),u=e.computed(()=>a.objectDiff({from:i.value,to:d.value,mode:l,nullifyEmptyValues:r})),c=e.computed(()=>Object.entries(u.value).length>0);return{form:d,validation:s,changes:u,hasChanges:c,reset:()=>{d.value=n.cloneDeep(t),s.value.$reset()},updateInitialState:e=>{d.value=n.cloneDeep(e),i.value=n.cloneDeep(e)},initialState:i}})({initialState:{...s,...t},validationRules:{email:{required:a.required,email:a.email}},nullifyEmptyValues:!0,mode:"deep"});return{form:r,isOrganization:l.isOrganization,validation:i,changes:d,hasChanges:u,updateInitialState:e=>{p(c(e))},submit:(e,t=r.value)=>o({customerId:e,payload:m(t)}),initialState:f}}const c=e=>{var t,a,o,r;if(l.isIndividual(e)){const o=e.individual.residential_address;return{type:"INDIVIDUAL",email:e.email??"",country:(null==o?void 0:o.country)??"",addressLine1:(null==o?void 0:o.line1)??"",addressLine2:(null==o?void 0:o.line2)??"",postalCode:(null==o?void 0:o.postal_code)??"",city:(null==o?void 0:o.city)??"",state:(null==o?void 0:o.state)??"",firstName:(null==(t=e.individual.name)?void 0:t.first_name)??"",lastName:(null==(a=e.individual.name)?void 0:a.last_name)??""}}const n=e.organization.registered_address;return{type:"ORGANIZATION",email:e.email??"",country:(null==n?void 0:n.country)??"",addressLine1:(null==n?void 0:n.line1)??"",addressLine2:(null==n?void 0:n.line2)??"",postalCode:(null==n?void 0:n.postal_code)??"",city:(null==n?void 0:n.city)??"",state:(null==n?void 0:n.state)??"",companyLegalName:e.organization.legal_name??"",companyVatNumber:(null==(r=null==(o=e.organization.tax_ids)?void 0:o[0])?void 0:r.id)??""}},m=e=>"ORGANIZATION"===e.type?{type:"ORGANIZATION",email:e.email,organization:{legal_name:e.companyLegalName??"",tax_ids:e.companyVatNumber?[{id:e.companyVatNumber,type:"GENERIC_TAX_ID"}]:void 0,registered_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}}:{type:"INDIVIDUAL",email:e.email,individual:{name:{first_name:e.firstName??"",last_name:e.lastName??""},residential_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}},p={class:"grid grid-cols-1 gap-4"},f={class:"flex grow flex-col"},h={class:"mt-6 flex items-center justify-between gap-4"},g={class:"flex flex-col gap-2"},y={key:0,class:"grid grid-cols-2 gap-2"},_={class:"grid grid-cols-3 gap-2"},v=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},isLoading:{type:Boolean},apiError:{type:null},updateCustomer:{type:Function}},setup(l){const n=l,{$t:i}=r.useIntl(),{validation:d,form:s,updateInitialState:c,submit:m,hasChanges:v}=u({onSubmit:({customerId:e,payload:t})=>n.updateCustomer({customerId:e,payload:t})}),b=e.ref(!1),V=e.computed(()=>"ORGANIZATION"===s.value.type),N=e.computed(()=>!b.value),k=e.computed({get:()=>V.value,set:e=>s.value.type=e?"ORGANIZATION":"INDIVIDUAL"}),C=async()=>{var e;await d.value.$validate();!d.value.$invalid&&(null==(e=n.customer)?void 0:e.id)&&await m(n.customer.id)};return e.watch(()=>n.customer,e=>{e&&!b.value&&(c(e),b.value=!0)},{immediate:!0}),(n,u)=>{var c,m,b,E,S,I,L,T,x,B,M,O,A;return e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(C,["prevent"])},[e.createVNode(e.unref(r._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})),1)]),_:1}),e.createElementVNode("div",p,[e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).email,"onUpdate:modelValue":u[0]||(u[0]=t=>e.unref(s).email=t),required:"",type:"email",label:e.unref(i)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(i)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"}),error:(null==(c=e.unref(d).email)?void 0:c.$errors)||(null==(m=l.apiError)?void 0:m.email)},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(a._sfc_main$1),{"single-model-value":e.unref(s).country,"onUpdate:singleModelValue":u[1]||(u[1]=t=>e.unref(s).country=t),label:e.unref(i)({defaultMessage:"Country",id:"checkout.country.label",description:"The country of the customer in the checkout form"}),error:null==(b=l.apiError)?void 0:b.country},null,8,["single-model-value","label","error"]),N.value?(e.openBlock(),e.createBlock(e.unref(a._sfc_main$2),{key:0,modelValue:k.value,"onUpdate:modelValue":u[2]||(u[2]=e=>k.value=e),"label-position":"before"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",f,[e.createVNode(e.unref(r._sfc_main),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(r._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).companyVatNumber,"onUpdate:modelValue":u[3]||(u[3]=t=>e.unref(s).companyVatNumber=t),name:"vat_number",label:e.unref(i)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(i)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:null==(E=l.apiError)?void 0:E.vat_number},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).companyLegalName,"onUpdate:modelValue":u[4]||(u[4]=t=>e.unref(s).companyLegalName=t),required:"",name:"legal_name",label:e.unref(i)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(i)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"}),error:null==(S=l.apiError)?void 0:S.legal_name},null,8,["modelValue","label","placeholder","error"])],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",h,[e.createVNode(e.unref(r._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Billing details",id:"checkout.billing_information_block.title",description:"The title of the billing information block in the checkout form"})),1)]),_:1})]),e.createElementVNode("div",g,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).firstName,"onUpdate:modelValue":u[5]||(u[5]=t=>e.unref(s).firstName=t),name:"first_name",label:e.unref(i)({defaultMessage:"First name",id:"checkout.first_name.label",description:"The first name of the customer in the checkout form"}),placeholder:e.unref(i)({defaultMessage:"First name...",id:"checkout.first_name.placeholder",description:"The first name of the customer in the checkout form"}),error:null==(I=l.apiError)?void 0:I.first_name},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).lastName,"onUpdate:modelValue":u[6]||(u[6]=t=>e.unref(s).lastName=t),name:"last_name",label:e.unref(i)({defaultMessage:"Last name",id:"checkout.last_name.label",description:"The last name of the customer in the checkout form"}),placeholder:e.unref(i)({defaultMessage:"Last name...",id:"checkout.last_name.placeholder",description:"The last name of the customer in the checkout form"}),error:null==(L=l.apiError)?void 0:L.last_name},null,8,["modelValue","label","placeholder","error"])])),e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).addressLine1,"onUpdate:modelValue":u[7]||(u[7]=t=>e.unref(s).addressLine1=t),name:"address_line_1",label:e.unref(i)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(i)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"}),error:null==(T=l.apiError)?void 0:T.address_line_1},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).addressLine2,"onUpdate:modelValue":u[8]||(u[8]=t=>e.unref(s).addressLine2=t),name:"address_line_2",placeholder:e.unref(i)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"}),error:null==(x=l.apiError)?void 0:x.address_line_2},null,8,["modelValue","placeholder","error"]),e.createElementVNode("div",_,[e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).postalCode,"onUpdate:modelValue":u[9]||(u[9]=t=>e.unref(s).postalCode=t),name:"postal_code",placeholder:e.unref(i)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"}),error:null==(B=l.apiError)?void 0:B.postal_code},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).city,"onUpdate:modelValue":u[10]||(u[10]=t=>e.unref(s).city=t),name:"city",placeholder:e.unref(i)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"}),error:null==(M=l.apiError)?void 0:M.city},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(a._sfc_main),{modelValue:e.unref(s).state,"onUpdate:modelValue":u[11]||(u[11]=t=>e.unref(s).state=t),name:"state",placeholder:e.unref(i)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"}),error:null==(O=l.apiError)?void 0:O.state},null,8,["modelValue","placeholder","error"])])]),(null==(A=l.apiError)?void 0:A._generic)?(e.openBlock(),e.createBlock(e.unref(o._sfc_main),{key:0,class:"mt-4",title:l.apiError._generic},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main),{type:"submit",color:"primary",disabled:!e.unref(v),loading:l.isLoading,class:"mt-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)({defaultMessage:"Save changes",id:"billing_information_form.submit_button.label",description:"The label for the submit button of the billing information form"})),1)]),_:1},8,["disabled","loading"])],32)}}}),b=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},apiError:{type:null},updateCustomer:{type:Function},isLoading:{type:Boolean}},setup:t=>(a,o)=>(e.openBlock(),e.createBlock(v,{customer:t.customer,"update-customer":t.updateCustomer,"is-loading":t.isLoading,"api-error":t.apiError},null,8,["customer","update-customer","is-loading","api-error"]))}),V=e.defineComponent({__name:"BillingInformationForm.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object}},setup(t){const a=t.portalObject.customer_id,{customer:o,get:r,update:l}=d.useCustomer({customerId:a});return e.onMounted(async()=>{await r.execute()}),(t,a)=>e.renderSlot(t.$slots,"default",{customer:e.unref(o),isLoading:e.unref(r).isPending.value||e.unref(l).isPending.value,updateCustomer:e.unref(l),apiError:e.unref(i.getApiError)(e.unref(l).error)})}}),N=e.defineComponent({__name:"BillingInformationForm.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object}},emits:["error"],setup:t=>(a,o)=>{var l,n,i,d;return e.openBlock(),e.createBlock(e.unref(r._sfc_main$1),{"custom-element-name":e.unref(C),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(l=t.branding)?void 0:l.colors)?void 0:n.primary,"secondary-color":null==(d=null==(i=t.branding)?void 0:i.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:o[0]||(o[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(V,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:t,updateCustomer:a,isLoading:o,apiError:r})=>[t?(e.openBlock(),e.createBlock(b,{key:0,customer:t,"is-loading":o,"update-customer":({payload:e})=>a.execute(e),"api-error":r},null,8,["customer","is-loading","update-customer","api-error"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),k=r.defineCustomElement(N),C=r.getComponentName("billing-information-form");exports.COMPONENT_NAME=C,exports.SolvimonBillingInformationForm=k,exports.defineSolvimonBillingInformationForm=()=>{customElements.get(C)||customElements.define(C,k)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../vendor-ui-Ce_Yp7xA.js"),a=require("../../index-DRdBmZ2-.js"),o=require("../../useCustomer-DanZzn-l.js"),r=require("../../component-C2Gc-wsE.js"),l={type:"INDIVIDUAL",email:"",country:"",addressLine1:"",postalCode:"",city:"",state:""};function n({initialState:o={},onSubmit:r}){const{form:n,validation:s,changes:u,hasChanges:c,updateInitialState:m,initialState:p}=(({initialState:a,validationRules:o,nullifyEmptyValues:r=!1,mode:l="shallow"})=>{const n=e.shallowRef(structuredClone(a)),i=e.shallowRef(structuredClone(a)),d=t.useValidation(o??{},i),s=e.computed(()=>t.objectDiff({from:n.value,to:i.value,mode:l,nullifyEmptyValues:r})),u=e.computed(()=>Object.entries(s.value).length>0);return{form:i,validation:d,changes:s,hasChanges:u,reset:()=>{i.value=structuredClone(a),d.value.$reset()},updateInitialState:e=>{i.value=structuredClone(e),n.value=structuredClone(e)},initialState:n}})({initialState:{...l,...o},validationRules:{email:{required:a.required,email:a.email}},nullifyEmptyValues:!0,mode:"deep"});return{form:n,isOrganization:t.isOrganization,validation:s,changes:u,hasChanges:c,updateInitialState:e=>{m(i(e))},submit:(e,t=n.value)=>r({customerId:e,payload:d(t)}),initialState:p}}const i=e=>{var a,o,r,l;if(t.isIndividual(e)){const t=e.individual.residential_address;return{type:"INDIVIDUAL",email:e.email??"",country:(null==t?void 0:t.country)??"",addressLine1:(null==t?void 0:t.line1)??"",addressLine2:(null==t?void 0:t.line2)??"",postalCode:(null==t?void 0:t.postal_code)??"",city:(null==t?void 0:t.city)??"",state:(null==t?void 0:t.state)??"",firstName:(null==(a=e.individual.name)?void 0:a.first_name)??"",lastName:(null==(o=e.individual.name)?void 0:o.last_name)??""}}const n=e.organization.registered_address;return{type:"ORGANIZATION",email:e.email??"",country:(null==n?void 0:n.country)??"",addressLine1:(null==n?void 0:n.line1)??"",addressLine2:(null==n?void 0:n.line2)??"",postalCode:(null==n?void 0:n.postal_code)??"",city:(null==n?void 0:n.city)??"",state:(null==n?void 0:n.state)??"",companyLegalName:e.organization.legal_name??"",companyVatNumber:(null==(l=null==(r=e.organization.tax_ids)?void 0:r[0])?void 0:l.id)??""}},d=e=>"ORGANIZATION"===e.type?{type:"ORGANIZATION",email:e.email,organization:{legal_name:e.companyLegalName??"",tax_ids:e.companyVatNumber?[{id:e.companyVatNumber,type:"GENERIC_TAX_ID"}]:void 0,registered_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}}:{type:"INDIVIDUAL",email:e.email,individual:{name:{first_name:e.firstName??"",last_name:e.lastName??""},residential_address:{line1:e.addressLine1,line2:e.addressLine2??"",postal_code:e.postalCode,city:e.city,country:e.country,state:e.state??""}}},s={class:"grid grid-cols-1 gap-4"},u={class:"flex grow flex-col"},c={class:"mt-6 flex items-center justify-between gap-4"},m={class:"flex flex-col gap-2"},p={key:0,class:"grid grid-cols-2 gap-2"},f={class:"grid grid-cols-3 gap-2"},h=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},isLoading:{type:Boolean},apiError:{type:null},updateCustomer:{type:Function}},setup(a){const o=a,{$t:r}=t.useIntl(),{validation:l,form:i,updateInitialState:d,submit:h,hasChanges:g}=n({onSubmit:({customerId:e,payload:t})=>o.updateCustomer({customerId:e,payload:t})}),y=e.ref(!1),_=e.computed(()=>"ORGANIZATION"===i.value.type),v=e.computed(()=>!y.value),b=e.computed({get:()=>_.value,set:e=>i.value.type=e?"ORGANIZATION":"INDIVIDUAL"}),V=async()=>{var e;await l.value.$validate();!l.value.$invalid&&(null==(e=o.customer)?void 0:e.id)&&await h(o.customer.id)};return e.watch(()=>o.customer,e=>{e&&!y.value&&(d(e),y.value=!0)},{immediate:!0}),(o,n)=>{var d,h,y,N,k,C,E,I,S,L,T,x,M;return e.openBlock(),e.createElementBlock("form",{onSubmit:e.withModifiers(V,["prevent"])},[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Customer information",id:"checkout.contact_information_block.title",description:"The title of the contact information block in the checkout form"})),1)]),_:1}),e.createElementVNode("div",s,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).email,"onUpdate:modelValue":n[0]||(n[0]=t=>e.unref(i).email=t),required:"",type:"email",label:e.unref(r)({defaultMessage:"Email address",id:"checkout.email_address.label",description:"The email address of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Email address...",id:"checkout.email_address.placeholder",description:"The email address of the customer in the checkout form"}),error:(null==(d=e.unref(l).email)?void 0:d.$errors)||(null==(h=a.apiError)?void 0:h.email)},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$22),{"single-model-value":e.unref(i).country,"onUpdate:singleModelValue":n[1]||(n[1]=t=>e.unref(i).country=t),label:e.unref(r)({defaultMessage:"Country",id:"checkout.country.label",description:"The country of the customer in the checkout form"}),error:null==(y=a.apiError)?void 0:y.country},null,8,["single-model-value","label","error"]),v.value?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$23),{key:0,modelValue:b.value,"onUpdate:modelValue":n[2]||(n[2]=e=>b.value=e),"label-position":"before"},{"inline-label":e.withCtx(()=>[e.createElementVNode("div",u,[e.createVNode(e.unref(t._sfc_main),{tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Company purchase",id:"checkout.company_purchase_toggle.title",description:"The title of the company purchase toggle in the checkout"})),1)]),_:1}),e.createVNode(e.unref(t._sfc_main),{tag:"span",variant:"body-xs",shade:"lighter"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"I am purchasing on behalf of a company",id:"checkout.company_purchase_toggle.sub_title",description:"The subtitle of the company purchase toggle in the checkout"})),1)]),_:1})])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).companyVatNumber,"onUpdate:modelValue":n[3]||(n[3]=t=>e.unref(i).companyVatNumber=t),name:"vat_number",label:e.unref(r)({defaultMessage:"VAT number",id:"checkout.vat_number.label",description:"The label for the vat number in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"VAT number...",id:"checkout.vat_number.placeholder",description:"The label for the vat number in the checkout form"}),error:null==(N=a.apiError)?void 0:N.vat_number},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).companyLegalName,"onUpdate:modelValue":n[4]||(n[4]=t=>e.unref(i).companyLegalName=t),required:"",name:"legal_name",label:e.unref(r)({defaultMessage:"Legal entity name",id:"checkout.legal_name.label",description:"The legal name of the organization customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Legal entity name...",id:"checkout.legal_name.placeholder",description:"The legal name of the organization customer in the checkout form"}),error:null==(k=a.apiError)?void 0:k.legal_name},null,8,["modelValue","label","placeholder","error"])],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",c,[e.createVNode(e.unref(t._sfc_main),{variant:"heading-3",tag:"h2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Billing details",id:"checkout.billing_information_block.title",description:"The title of the billing information block in the checkout form"})),1)]),_:1})]),e.createElementVNode("div",m,[_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).firstName,"onUpdate:modelValue":n[5]||(n[5]=t=>e.unref(i).firstName=t),name:"first_name",label:e.unref(r)({defaultMessage:"First name",id:"checkout.first_name.label",description:"The first name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"First name...",id:"checkout.first_name.placeholder",description:"The first name of the customer in the checkout form"}),error:null==(C=a.apiError)?void 0:C.first_name},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).lastName,"onUpdate:modelValue":n[6]||(n[6]=t=>e.unref(i).lastName=t),name:"last_name",label:e.unref(r)({defaultMessage:"Last name",id:"checkout.last_name.label",description:"The last name of the customer in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Last name...",id:"checkout.last_name.placeholder",description:"The last name of the customer in the checkout form"}),error:null==(E=a.apiError)?void 0:E.last_name},null,8,["modelValue","label","placeholder","error"])])),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).addressLine1,"onUpdate:modelValue":n[7]||(n[7]=t=>e.unref(i).addressLine1=t),name:"address_line_1",label:e.unref(r)({defaultMessage:"Billing address",id:"checkout.address.title",description:"Address line 1 of the customer address in the checkout form"}),placeholder:e.unref(r)({defaultMessage:"Address line 1...",id:"checkout.address.line1.placeholder",description:"Address line 1 of the customer address in the checkout form"}),error:null==(I=a.apiError)?void 0:I.address_line_1},null,8,["modelValue","label","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).addressLine2,"onUpdate:modelValue":n[8]||(n[8]=t=>e.unref(i).addressLine2=t),name:"address_line_2",placeholder:e.unref(r)({defaultMessage:"Address line 2...",id:"checkout.address.line2.placeholder",description:"Address line 2 of the customer address in the checkout form"}),error:null==(S=a.apiError)?void 0:S.address_line_2},null,8,["modelValue","placeholder","error"]),e.createElementVNode("div",f,[e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).postalCode,"onUpdate:modelValue":n[9]||(n[9]=t=>e.unref(i).postalCode=t),name:"postal_code",placeholder:e.unref(r)({defaultMessage:"Postal code...",id:"checkout.address.portal_code.placeholder",description:"Postal code of the customer address in the checkout form"}),error:null==(L=a.apiError)?void 0:L.postal_code},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).city,"onUpdate:modelValue":n[10]||(n[10]=t=>e.unref(i).city=t),name:"city",placeholder:e.unref(r)({defaultMessage:"City...",id:"checkout.address.city.placeholder",description:"City of the customer address in the checkout form"}),error:null==(T=a.apiError)?void 0:T.city},null,8,["modelValue","placeholder","error"]),e.createVNode(e.unref(t._sfc_main$21),{modelValue:e.unref(i).state,"onUpdate:modelValue":n[11]||(n[11]=t=>e.unref(i).state=t),name:"state",placeholder:e.unref(r)({defaultMessage:"State...",id:"checkout.address.state.placeholder",description:"State of the customer address in the checkout form"}),error:null==(x=a.apiError)?void 0:x.state},null,8,["modelValue","placeholder","error"])])]),(null==(M=a.apiError)?void 0:M._generic)?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$15),{key:0,class:"mt-4",title:a.apiError._generic},null,8,["title"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t._sfc_main$3),{type:"submit",color:"primary",disabled:!e.unref(g),loading:a.isLoading,class:"mt-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)({defaultMessage:"Save changes",id:"billing_information_form.submit_button.label",description:"The label for the submit button of the billing information form"})),1)]),_:1},8,["disabled","loading"])],32)}}}),g=e.defineComponent({__name:"BillingInformationForm",props:{customer:{type:Object},apiError:{type:null},updateCustomer:{type:Function},isLoading:{type:Boolean}},setup:t=>(a,o)=>(e.openBlock(),e.createBlock(h,{customer:t.customer,"update-customer":t.updateCustomer,"is-loading":t.isLoading,"api-error":t.apiError},null,8,["customer","update-customer","is-loading","api-error"]))}),y=e.defineComponent({__name:"BillingInformationForm.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object}},setup(a){const r=a.portalObject.customer_id,{customer:l,get:n,update:i}=o.useCustomer({customerId:r});return e.onMounted(async()=>{await n.execute()}),(a,o)=>e.renderSlot(a.$slots,"default",{customer:e.unref(l),isLoading:e.unref(n).isPending.value||e.unref(i).isPending.value,updateCustomer:e.unref(i),apiError:e.unref(t.getApiError)(e.unref(i).error)})}}),_=e.defineComponent({__name:"BillingInformationForm.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object}},emits:["error"],setup:t=>(a,o)=>{var l,n,i,d;return e.openBlock(),e.createBlock(e.unref(r._sfc_main),{"custom-element-name":e.unref(b),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(n=null==(l=t.branding)?void 0:l.colors)?void 0:n.primary,"secondary-color":null==(d=null==(i=t.branding)?void 0:i.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:o[0]||(o[0]=e=>a.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(y,e.normalizeProps(e.guardReactiveProps(a.$props)),{default:e.withCtx(({customer:t,updateCustomer:a,isLoading:o,apiError:r})=>[t?(e.openBlock(),e.createBlock(g,{key:0,customer:t,"is-loading":o,"update-customer":({payload:e})=>a.execute(e),"api-error":r},null,8,["customer","is-loading","update-customer","api-error"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),v=r.defineCustomElement(_),b=r.getComponentName("billing-information-form");exports.COMPONENT_NAME=b,exports.SolvimonBillingInformationForm=v,exports.defineSolvimonBillingInformationForm=()=>{customElements.get(b)||customElements.define(b,v)};
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import { shallowRef, computed, defineComponent, ref, watch, openBlock, createElementBlock, withModifiers, createVNode, unref, withCtx, createTextVNode, toDisplayString, createElementVNode, createBlock, createCommentVNode, Fragment, onMounted, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$9 } from "../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { a as isOrganization, i as isIndividual } from "../../typeGuards.es-fwUoeMCe.mjs";
|
|
7
|
-
import { c as cloneDeep } from "../../cloneDeep-sm9cY-u2.mjs";
|
|
8
|
-
import { b as getApiError } from "../../api.es-UkfpLiLL.mjs";
|
|
9
|
-
import { u as useCustomer } from "../../useCustomer--jycAz--.mjs";
|
|
2
|
+
import { H as useValidation, J as objectDiff, K as isOrganization, L as isIndividual, u as useIntl, _ as _sfc_main$4, M as _sfc_main$5, N as _sfc_main$6, O as _sfc_main$7, A as _sfc_main$8, e as _sfc_main$9, P as getApiError } from "../../vendor-ui-BwxuPDg8.mjs";
|
|
3
|
+
import { e as email, r as required } from "../../index-CzL1ZcGi.mjs";
|
|
4
|
+
import { u as useCustomer } from "../../useCustomer-cbhDyWJL.mjs";
|
|
5
|
+
import { _ as _sfc_main$a, d as defineCustomElement, g as getComponentName } from "../../component-CM9g6tbD.mjs";
|
|
10
6
|
const useForm = ({
|
|
11
7
|
initialState,
|
|
12
8
|
validationRules,
|
|
13
9
|
nullifyEmptyValues = false,
|
|
14
10
|
mode = "shallow"
|
|
15
11
|
}) => {
|
|
16
|
-
const initialFormState = shallowRef(
|
|
17
|
-
const form = shallowRef(
|
|
12
|
+
const initialFormState = shallowRef(structuredClone(initialState));
|
|
13
|
+
const form = shallowRef(structuredClone(initialState));
|
|
18
14
|
const validation = useValidation(validationRules ?? {}, form);
|
|
19
15
|
const changes = computed(
|
|
20
16
|
() => objectDiff({ from: initialFormState.value, to: form.value, mode, nullifyEmptyValues })
|
|
21
17
|
);
|
|
22
18
|
const hasChanges = computed(() => Object.entries(changes.value).length > 0);
|
|
23
19
|
const updateInitialState = (state) => {
|
|
24
|
-
form.value =
|
|
25
|
-
initialFormState.value =
|
|
20
|
+
form.value = structuredClone(state);
|
|
21
|
+
initialFormState.value = structuredClone(state);
|
|
26
22
|
};
|
|
27
23
|
const reset = () => {
|
|
28
|
-
form.value =
|
|
24
|
+
form.value = structuredClone(initialState);
|
|
29
25
|
validation.value.$reset();
|
|
30
26
|
};
|
|
31
27
|
return {
|
|
@@ -490,7 +486,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
490
486
|
locale: { type: String },
|
|
491
487
|
dateLocale: { type: String },
|
|
492
488
|
messages: { type: Object },
|
|
493
|
-
showTimezones: { type: Boolean },
|
|
494
489
|
primaryColor: { type: String },
|
|
495
490
|
secondaryColor: { type: String },
|
|
496
491
|
isShadowRoot: { type: Boolean },
|
|
@@ -499,7 +494,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
499
494
|
onLog: { type: Function },
|
|
500
495
|
allowedPortalTypes: { type: Array },
|
|
501
496
|
portalObject: { type: Object },
|
|
502
|
-
customElementName: { type: String },
|
|
503
497
|
branding: { type: Object }
|
|
504
498
|
},
|
|
505
499
|
setup(__props) {
|
|
@@ -526,7 +520,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
526
520
|
locale: { type: String },
|
|
527
521
|
dateLocale: { type: String },
|
|
528
522
|
messages: { type: Object },
|
|
529
|
-
showTimezones: { type: Boolean },
|
|
530
523
|
primaryColor: { type: String },
|
|
531
524
|
secondaryColor: { type: String },
|
|
532
525
|
isShadowRoot: { type: Boolean },
|
|
@@ -535,7 +528,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
535
528
|
onLog: { type: Function },
|
|
536
529
|
allowedPortalTypes: { type: Array },
|
|
537
530
|
portalObject: { type: Object },
|
|
538
|
-
customElementName: { type: String },
|
|
539
531
|
branding: { type: Object }
|
|
540
532
|
},
|
|
541
533
|
emits: ["error"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CLU7Yiyx.js"),t=require("../../component-C2Gc-wsE.js"),r=require("../../useLoadInitialData-BRg7IWqW.js"),n=require("../../usePaymentMethods-Cm9WdSW0.js"),l=e.defineComponent({__name:"CustomerPaymentMethods.entry.view",props:{portalObject:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},branding:{type:Object},configuration:{type:Object}},setup(o){var l;const a=o,i=a.portalObject.customer_id,p=n.usePaymentMethods({customerId:i,pageSize:(null==(l=a.configuration)?void 0:l.maxItems)||3}),{isLoading:m}=r.useLoadInitialData(p.fetchInitial());return(r,n)=>{var l,a,i,c;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(s),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(a=null==(l=o.branding)?void 0:l.colors)?void 0:a.primary,"secondary-color":null==(c=null==(i=o.branding)?void 0:i.colors)?void 0:c.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:n[0]||(n[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{paymentMethods:e.unref(p).items.value,isLoading:e.unref(m)})]),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),a=e.defineComponent({__name:"CustomerPaymentMethods.entry",props:{portalObject:{type:Object},environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},branding:{type:Object},configuration:{type:Object}},setup:r=>(n,a)=>{var i,p,m,c;return e.openBlock(),e.createBlock(e.unref(t._sfc_main),{"custom-element-name":e.unref(s),environment:r.environment,locale:r.locale,"portal-object":r.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(i=r.branding)?void 0:i.colors)?void 0:p.primary,"secondary-color":null==(c=null==(m=r.branding)?void 0:m.colors)?void 0:c.secondary,"experimental-features":r.experimentalFeatures,"log-level":r.logLevel,"on-log":r.onLog,onError:a[0]||(a[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(l,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({paymentMethods:t,isLoading:n})=>[e.createVNode(o._sfc_main,{configuration:r.configuration,"payment-methods":t,"is-loading":n},null,8,["configuration","payment-methods","is-loading"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),i=t.defineCustomElement(a),s=t.getComponentName("customer-payment-methods");exports.COMPONENT_NAME=s,exports.SolvimonCustomerPaymentMethods=i,exports.defineSolvimonCustomerPaymentMethods=()=>{customElements.get(s)||customElements.define(s,i)};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import {
|
|
2
|
+
import { _ as _sfc_main$3 } from "../../CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CK73bYUe.mjs";
|
|
3
|
+
import { _ as _sfc_main$2, d as defineCustomElement, g as getComponentName } from "../../component-CM9g6tbD.mjs";
|
|
4
4
|
import { u as useLoadInitialData } from "../../useLoadInitialData-Dm48tlSO.mjs";
|
|
5
|
-
import { u as usePaymentMethods } from "../../usePaymentMethods-
|
|
5
|
+
import { u as usePaymentMethods } from "../../usePaymentMethods-DZvfWSlx.mjs";
|
|
6
6
|
const DEFAULT_MAX_ITEMS = 3;
|
|
7
7
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "CustomerPaymentMethods.entry.view",
|
|
@@ -12,7 +12,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
12
12
|
locale: { type: String },
|
|
13
13
|
dateLocale: { type: String },
|
|
14
14
|
messages: { type: Object },
|
|
15
|
-
showTimezones: { type: Boolean },
|
|
16
15
|
primaryColor: { type: String },
|
|
17
16
|
secondaryColor: { type: String },
|
|
18
17
|
isShadowRoot: { type: Boolean },
|
|
@@ -20,7 +19,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
20
19
|
logLevel: { type: String },
|
|
21
20
|
onLog: { type: Function },
|
|
22
21
|
allowedPortalTypes: { type: Array },
|
|
23
|
-
customElementName: { type: String },
|
|
24
22
|
branding: { type: Object },
|
|
25
23
|
configuration: { type: Object }
|
|
26
24
|
},
|
|
@@ -67,7 +65,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
67
65
|
locale: { type: String },
|
|
68
66
|
dateLocale: { type: String },
|
|
69
67
|
messages: { type: Object },
|
|
70
|
-
showTimezones: { type: Boolean },
|
|
71
68
|
primaryColor: { type: String },
|
|
72
69
|
secondaryColor: { type: String },
|
|
73
70
|
isShadowRoot: { type: Boolean },
|
|
@@ -75,7 +72,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
72
|
logLevel: { type: String },
|
|
76
73
|
onLog: { type: Function },
|
|
77
74
|
allowedPortalTypes: { type: Array },
|
|
78
|
-
customElementName: { type: String },
|
|
79
75
|
branding: { type: Object },
|
|
80
76
|
configuration: { type: Object }
|
|
81
77
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-BRg7IWqW.js"),o=require("../../invoices-3kVHsAXr.js"),n=require("../../useService-B67YWAcN.js"),a=require("../../payments-CLt0SExf.js"),r=require("../../component-ZRZIt3ZW.js"),i=require("../../CustomerBillingInformation.vue.es-9rP7-RzN.js"),l=require("../../Comparators.vue.es-BdxDqU8o.js"),c=require("../../Chip.vue.es-D0fkSe8a.js"),d=require("../../index.es-BBJF2O2l.js"),s=require("../../Button.vue.es-BC4_TItq.js"),u=require("../../FormMessage.vue.es-LeWoj774.js"),p=require("../../Section.vue.es-BuzTXRLP.js"),m=require("../../Amount.vue.es-h8wulbBG.js"),g=require("../../customer.es-D42Md24r.js"),f=require("../../Avatar.vue.es-BbyE0AjW.js"),v=require("../../formatting.es-9hM8aHSg.js"),_=require("../../TooltipParagraph.vue.es-kTbRGoPF.js"),y=require("../../DividerText.vue.es-yiFdPQvo.js"),x=require("../../isEmpty.es-Dycf-CD_.js"),k=require("../../index-CWSXne1Q.js"),b=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js"),B=require("../../PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js"),h=(t=[])=>{const o=e.ref(t);return[o,e=>{const t=o.value.find(t=>t===e);o.value="number"==typeof t?o.value.filter(t=>t!==e):[...o.value,e]}]},N=e.defineComponent({__name:"Link",props:e.mergeDefaults({external:{type:Boolean},showOnHover:{type:Boolean},button:{type:Boolean},to:{},target:{},custom:{type:Boolean},activeClass:{},exactActiveClass:{},ariaCurrentValue:{},viewTransition:{type:Boolean},replace:{type:Boolean},type:{},variant:{},color:{},size:{},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{},iconSuffix:{},tag:{}},{external:!1,showOnHover:!1,button:!1,...s.buttonPropsDefault}),setup(t){const o=t,n=e.useAttrs(),a=e.ref(!!n.href),r=e.computed(()=>null===o.target?"_self":"_blank"),i=e.computed(()=>{const e=a.value?{rel:"noopener noreferrer",target:r.value}:{to:o.to,target:o.target||null};return{tag:a.value?"a":"RouterLink",props:{...n,...e}}}),{wrapperClasses:l,spanClasses:c}=s.useButtonClasses(e.toRefs(o)),d=e.computed(()=>o.button?`inline-flex text-center hover:no-underline ${l.value} text-sm`:"group hover:text-blue-600 hover:underline "+(o.showOnHover?"hover:text-blue-600":"text-blue-600"));return(n,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value.tag),e.mergeProps(i.value.props,{class:d.value}),{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({[`${e.unref(c)} flex items-center grow`]:o.button})},[e.renderSlot(n.$slots,"default"),t.external&&!t.button?(e.openBlock(),e.createBlock(e.unref(s._sfc_main$1),{key:0,icon:"arrow_outward",size:"xs",class:e.normalizeClass(["ml-0.5",{"invisible group-hover:visible":o.showOnHover}])},null,8,["class"])):e.createCommentVNode("",!0)],2)]),_:3},16,["class"]))}}),V={key:1,class:"flex flex-col items-end gap-1"},C=e.defineComponent({__name:"DownloadButton",props:{downloadService:{type:Function},mobileIconOnly:{type:Boolean,default:!1},type:{},variant:{default:"outline"},color:{default:"gray"},size:{default:"md"},pill:{type:Boolean},square:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},iconPrefix:{},iconSuffix:{},tag:{}},setup(t){const{$t:o}=r.useIntl(),n=e.createPropsRestProxy(t,["downloadService","size","color","mobileIconOnly","variant"]),a=e.ref(!1),i=e.ref(!1),l=d.useBreakpoints(d.breakpointsTailwind).smaller("md"),c=e.computed(()=>t.mobileIconOnly&&l.value),p=async()=>{i.value=!0,a.value=!1;try{await t.downloadService()}catch{a.value=!0}finally{i.value=!1}};return(r,l)=>a.value?(e.openBlock(),e.createElementBlock("div",V,[a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(s._sfc_main),e.mergeProps({key:0},{...n,size:t.size,color:t.color},{disabled:i.value,loading:i.value,type:"button","icon-prefix":"download",onClick:p}),e.createSlots({_:2},[r.$slots.default&&!c.value?{name:"default",fn:e.withCtx(()=>[r.$slots.default?e.renderSlot(r.$slots,"default",{key:0}):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040,["disabled","loading"])),a.value?(e.openBlock(),e.createBlock(e.unref(u._sfc_main),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({id:"download_button.download_failed_message",defaultMessage:"Download failed, please try again later",description:"Error message when a download fails"})),1)]),_:1})):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.unref(s._sfc_main),e.mergeProps({key:0},{...n,size:t.size,color:t.color},{disabled:i.value,loading:i.value,variant:t.variant,type:"button","icon-prefix":"download",onClick:p}),e.createSlots({_:2},[r.$slots.default&&!c.value?{name:"default",fn:e.withCtx(()=>[r.$slots.default?e.renderSlot(r.$slots,"default",{key:0}):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040,["disabled","loading","variant"]))}}),w={class:"flex items-start gap-2"},E=e.defineComponent({__name:"InfoBlock",props:{variant:{default:"default"},hasIcon:{type:Boolean}},setup(t){const o={default:"info",warning:"error",danger:"error"};return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["px-4 py-3 rounded border text-sm flex justify-between items-center gap-2",{"bg-blue-50 border-blue-100 text-blue-700":"default"===t.variant,"bg-red-50 border-red-100 text-red-700":"danger"===t.variant,"bg-yellow-50 border-yellow-100 text-yellow-700":"warning"===t.variant}])},[e.createElementVNode("div",w,[t.hasIcon?(e.openBlock(),e.createBlock(e.unref(s._sfc_main$1),{key:0,icon:o[t.variant],size:"xs",class:"shrink-0"},null,8,["icon"])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"default")])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"cta")])],2))}}),T={},S={class:"w-full"};const O=c._export_sfc(T,[["render",function(t,o){return e.openBlock(),e.createElementBlock("table",S,[e.renderSlot(t.$slots,"default")])}]]),D=e.defineComponent({__name:"InvoiceTableData",props:{number:{type:Boolean,default:!1},hasPadding:{type:Boolean,default:!0}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass({"text-right tabular-nums":t.number,"py-2":t.hasPadding})},[e.renderSlot(o.$slots,"default")],2))}),I=e.defineComponent({__name:"InvoiceTableHeader",props:{left:{type:Boolean,default:!1},right:{type:Boolean,default:!1}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock("th",{class:e.normalizeClass(["py-1.5 font-bold border-b text-gray-400 text-xs uppercase",{"text-left":t.left,"text-right":t.right}])},[e.renderSlot(o.$slots,"default")],2))}),M={class:"flex items-center"},$={key:0,class:"text-xs text-gray-400"},F={class:"flex items-center"},P={key:0},A=e.defineComponent({__name:"InvoiceSubLineRow",props:{subLines:{},isOpen:{type:Boolean},lineOrder:{},periodOrder:{},groupOrder:{},processingOnlyCustomers:{}},setup(t){const{formatMessage:o}=r.useIntl(),n=t,a=e=>{var t;const a=null==(t=n.processingOnlyCustomers)?void 0:t.find(t=>t.id===e);return a?g.getCustomerName(a):o({id:"generic.not_available",defaultMessage:"N/A",description:"Used in scenarios where no data is available to be displayed"})},i=e=>{var t;return(null==(t=e.usage_based_conversion)?void 0:t.conditions)??e.conditions};return(o,n)=>t.subLines&&t.isOpen?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.processingOnlyCustomers?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.subLines,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{key:r,class:e.normalizeClass(r>0?"border-t":"")},[e.createVNode(D,{class:"w-1/3"},{default:e.withCtx(()=>{var n,r,c,d,s,u;return[e.createElementVNode("div",M,[e.renderSlot(o.$slots,"invoice-line-prefix",{lineOrder:t.lineOrder,periodOrder:t.periodOrder,groupOrder:t.groupOrder}),e.createElementVNode("div",null,[e.createElementVNode("div",null,[a.description?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(a.description),1)],64)):a.details.description?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(a.details.description),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(" N/A ")],64))]),(null==(n=i(a))?void 0:n.name)||(null==(r=i(a))?void 0:r.meter_properties)?(e.openBlock(),e.createElementBlock("div",$,[(null==(c=i(a))?void 0:c.name)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(null==(d=i(a))?void 0:d.name),1)],64)):(null==(s=i(a))?void 0:s.meter_properties)?(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:1,comparators:null==(u=i(a))?void 0:u.meter_properties},null,8,["comparators"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])]}),_:2},1024),e.createVNode(D,{number:"",class:"w-1/7 text-right tabular-nums"},{default:e.withCtx(()=>{var t,o;return[e.createTextVNode(e.toDisplayString((null==(o=null==(t=a.details.conversion)?void 0:t.credits)?void 0:o.quantity)??"N/A"),1)]}),_:2},1024),e.createVNode(D,{class:"w-1/7 text-right tabular-nums"},{default:e.withCtx(()=>{var t,o;return[(null==(t=a.details.band)?void 0:t.amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:a.details.band.amount},null,8,["value"])):(null==(o=a.details.band)?void 0:o.percentage)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(a.details.band.percentage)+"% ",1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(" N/A ")],64))]}),_:2},1024),e.createVNode(D,null,{default:e.withCtx(()=>[...n[0]||(n[0]=[e.createTextVNode(" ",-1)])]),_:1}),a.details.amount?(e.openBlock(),e.createBlock(D,{key:0,class:"w-1/7 text-right tabular-nums"},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:a.details.amount},null,8,["value"])]),_:2},1024)):e.createCommentVNode("",!0)],2))),128)),t.processingOnlyCustomers?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.subLines,(t,n)=>(e.openBlock(),e.createElementBlock("tr",{key:n,tabindex:void 0,class:e.normalizeClass(["group",{"border-t":0!==n}])},[e.createVNode(D,{class:"pl-4"},{default:e.withCtx(()=>[e.createElementVNode("div",F,[t.processing_only_customer_resource_id?(e.openBlock(),e.createElementBlock("div",P,e.toDisplayString(a(t.processing_only_customer_resource_id)),1)):e.createCommentVNode("",!0)])]),_:2},1024),e.renderSlot(o.$slots,"subline-content",{details:t.details,hideTaxDetails:!0})],2))),128)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)}}),z=["tabindex","onClick"],L={class:"flex items-center"},U=e.defineComponent({__name:"InvoiceCommitment",props:{commitments:{},groupOrder:{},invoicePeriodOrder:{}},setup(t){const o=r.useIntl(),{getIsOpen:n,toggle:a}=l.useToggleList(),i=(e,t)=>`${e}-line-${t}`;return(r,l)=>(e.openBlock(),e.createBlock(O,null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(I,{left:"",colspan:"5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.unit",defaultMessage:"Unit",description:"Table header for the column containing the number of units of invoice groups"})),1)]),_:1}),e.createVNode(I,{right:"",class:"w-60"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.sub_total",defaultMessage:"Subtotal",description:"Table header for the column containing the subtotal for invoices"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.commitments,(c,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[e.createElementVNode("tr",{class:e.normalizeClass(["border-t",{"cursor-pointer":c.sub_lines}]),tabindex:c.sub_lines?0:void 0,onClick:e=>{return o=t.groupOrder,n=c.line_order,void a(i(o,n));var o,n}},[e.createVNode(D,{colspan:"2"},{default:e.withCtx(()=>{var a,l;return[c.sub_lines?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!e.unref(n)(i(t.groupOrder,c.line_order))}])},null,8,["class"])):e.createCommentVNode("",!0),e.createElementVNode("div",L,[e.renderSlot(r.$slots,"invoice-line-prefix",{lineOrder:c.line_order,periodOrder:t.invoicePeriodOrder,groupOrder:t.groupOrder}),c.description?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(c.description),1)],64)):(null==(a=c.details)?void 0:a.description)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(null==(l=c.details)?void 0:l.description),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"generic.not_available",defaultMessage:"N/A",description:"Used in scenarios where no data is available to be displayed"})),1)],64))])]}),_:2},1024),e.createVNode(D,{colspan:"3"},{default:e.withCtx(()=>[...l[0]||(l[0]=[e.createTextVNode(" ",-1)])]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>{var t,o;return[(null==(t=c.details)?void 0:t.amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:null==(o=c.details)?void 0:o.amount},null,8,["value"])):e.createCommentVNode("",!0)]}),_:2},1024)],10,z),e.createVNode(A,{ref_for:!0,ref:i(t.groupOrder,c.line_order),"sub-lines":c.sub_lines??[],"line-order":c.line_order,"period-order":t.invoicePeriodOrder,"group-order":t.groupOrder,"is-open":e.unref(n)(i(t.groupOrder,c.line_order))},null,8,["sub-lines","line-order","period-order","group-order","is-open"])],64))),128))]),_:3}))}}),j=["tabindex","onClick"],R={class:"flex items-center"},q=e.defineComponent({__name:"InvoiceDiscountMarkup",props:{lines:{},type:{},handleToggleItems:{type:Function},formatIndex:{type:Function},expandedItems:{},isExpandable:{type:Boolean},invoicePeriodOrder:{},groupOrder:{}},setup(t){const o=r.useIntl(),{getIsOpen:n,toggle:a}=l.useToggleList(),i=(e,t)=>`${e}-line-${t}`;return(r,l)=>(e.openBlock(),e.createBlock(O,null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(I,{left:"",class:"w-3/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.quantity",defaultMessage:"Quantity",description:"Table header for quantity column"})),1)]),_:1}),e.createVNode(I,{colspan:"2"},{default:e.withCtx(()=>[...l[0]||(l[0]=[e.createTextVNode(" ",-1)])]),_:1}),e.createVNode(I,{left:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString("DISCOUNT"===t.type?e.unref(o).$t({id:"invoice.table_header.discount",defaultMessage:"Discount",description:"Table header for discount column"}):e.unref(o).$t({id:"invoice.table_header.markup",defaultMessage:"Markup",description:"Table header for markup column"})),1)]),_:1}),e.createVNode(I,{left:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString("DISCOUNT"===t.type?e.unref(o).$t({id:"invoice.table_header.total",defaultMessage:"Total",description:"Table header for total column"}):" "),1)]),_:1}),e.createVNode(I,{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.sub_total",defaultMessage:"Subtotal",description:"Table header for the column containing the subtotal for invoices"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.lines,(o,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[e.createElementVNode("tr",{class:e.normalizeClass(["border-t",{"cursor-pointer":t.isExpandable}]),tabindex:t.isExpandable?0:void 0,onClick:e=>{return n=t.groupOrder,r=o.line_order,void a(i(n,r));var n,r}},[e.createVNode(D,{class:"w-3/5"},{default:e.withCtx(()=>{var a,l;return[o.sub_lines?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!e.unref(n)(i(t.groupOrder,o.line_order))}])},null,8,["class"])):e.createCommentVNode("",!0),e.createElementVNode("div",R,[e.renderSlot(r.$slots,"invoice-line-prefix",{lineOrder:o.line_order,periodOrder:t.invoicePeriodOrder,groupOrder:t.groupOrder}),o.description?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(o.description),1)],64)):(null==(a=o.details)?void 0:a.description)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(null==(l=o.details)?void 0:l.description),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode("N/A")],64))])]}),_:2},1024),e.createVNode(D,{colspan:"2"},{default:e.withCtx(()=>[...l[1]||(l[1]=[e.createTextVNode(" ",-1)])]),_:1}),e.createVNode(D,{class:"tabular-nums w-1/5"},{default:e.withCtx(()=>{var t,n,a;return[e.createTextVNode(e.toDisplayString((null==(n=null==(t=o.details)?void 0:t.band)?void 0:n.percentage)?`${null==(a=o.details)?void 0:a.band.percentage}%`:" "),1)]}),_:2},1024),e.createVNode(D,{class:"w-1/5"},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode(" ",-1)])]),_:1}),e.createVNode(D,{number:"",class:"w-1/5"},{default:e.withCtx(()=>{var t;return[(null==(t=o.details)?void 0:t.amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:o.details.amount},null,8,["value"])):e.createCommentVNode("",!0)]}),_:2},1024)],10,j),e.createVNode(A,{ref_for:!0,ref:i(t.groupOrder,o.line_order),"sub-lines":o.sub_lines??[],"line-order":o.line_order,"is-open":e.unref(n)(i(t.groupOrder,o.line_order)),"period-order":t.invoicePeriodOrder,"group-order":t.groupOrder},null,8,["sub-lines","line-order","is-open","period-order","group-order"])],64))),128))]),_:3}))}}),H=["tabindex"],K={key:0},G={colspan:"2",class:"p-0"},X={class:"px-9 py-3 -mx-9 bg-gray-50 text-xs"},W=e.defineComponent({__name:"InvoiceGroupCommitment",props:{group:{},expandedItems:{},handleToggleItems:{type:Function},formatIndex:{type:Function},invoicePeriodOrder:{},groupOrder:{},isExpandable:{type:Boolean},amountType:{},processingOnlyCustomers:{}},setup(t){const o=r.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("tr",{class:e.normalizeClass(["border-t",{"cursor-pointer":t.isExpandable}]),tabindex:t.isExpandable?0:void 0,onClick:a[0]||(a[0]=e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))),onKeyup:[a[1]||(a[1]=e.withKeys(e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder)),["enter"])),a[2]||(a[2]=e.withKeys(e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder)),["space"]))]},[e.createVNode(D,{class:"p-0"},{default:e.withCtx(()=>[t.isExpandable?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!t.expandedItems.includes(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))}])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(o).$t({id:"invoice.commitment_heading",defaultMessage:"Commitment",description:"Heading used for commitment in invoice tables"})),1)]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>["INCLUDING_TAX"===t.amountType?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.group.amount_including_tax},null,8,["value"])):(e.openBlock(),e.createBlock(m._sfc_main,{key:1,value:t.group.amount_excluding_tax},null,8,["value"]))]),_:1})],42,H),t.expandedItems.includes(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))&&t.group.lines?(e.openBlock(),e.createElementBlock("tr",K,[e.createElementVNode("td",G,[e.createElementVNode("div",X,[e.createVNode(U,{commitments:t.group.lines,"format-index":t.formatIndex,"handle-toggle-items":t.handleToggleItems,"expanded-items":t.expandedItems,"is-expandable":t.isExpandable,"invoice-period-order":t.invoicePeriodOrder,"group-order":t.groupOrder},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(n.$slots,"invoice-line-prefix",e.normalizeProps(e.guardReactiveProps(t)))]),_:3},8,["commitments","format-index","handle-toggle-items","expanded-items","is-expandable","invoice-period-order","group-order"])])])])):e.createCommentVNode("",!0)],64))}}),Q=["tabindex"],Y={key:0},J={colspan:"2",class:"p-0"},Z={class:"px-9 py-3 -mx-9 bg-gray-50 text-xs"},ee=e.defineComponent({__name:"InvoiceGroupDiscountMarkup",props:{heading:{},group:{},expandedItems:{},handleToggleItems:{type:Function},formatIndex:{type:Function},invoicePeriodOrder:{},groupOrder:{},isExpandable:{type:Boolean},amountType:{},processingOnlyCustomers:{}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("tr",{class:e.normalizeClass(["border-t",{"cursor-pointer":t.isExpandable}]),tabindex:t.isExpandable?0:void 0,onClick:n[0]||(n[0]=e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))),onKeyup:[n[1]||(n[1]=e.withKeys(e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder)),["enter"])),n[2]||(n[2]=e.withKeys(e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder)),["space"]))]},[e.createVNode(D,{class:"p-0"},{default:e.withCtx(()=>[t.isExpandable?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!t.expandedItems.includes(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))}])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.heading),1)]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>["INCLUDING_TAX"===t.amountType?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.group.amount_including_tax},null,8,["value"])):(e.openBlock(),e.createBlock(m._sfc_main,{key:1,value:t.group.amount_excluding_tax},null,8,["value"]))]),_:1})],42,Q),t.expandedItems.includes(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))&&t.group.lines?(e.openBlock(),e.createElementBlock("tr",Y,[e.createElementVNode("td",J,[e.createElementVNode("div",Z,[e.createVNode(q,{type:t.group.type,lines:t.group.lines,"format-index":t.formatIndex,"handle-toggle-items":t.handleToggleItems,"expanded-items":t.expandedItems,"is-expandable":t.isExpandable,"invoice-period-order":t.invoicePeriodOrder,"group-order":t.groupOrder},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(o.$slots,"invoice-line-prefix",e.normalizeProps(e.guardReactiveProps(t)))]),_:3},8,["type","lines","format-index","handle-toggle-items","expanded-items","is-expandable","invoice-period-order","group-order"])])])])):e.createCommentVNode("",!0)],64))}),te={class:"flex gap-4"},oe={class:"flex gap-2 items-center"},ne=e.defineComponent({__name:"PricingClauseChip",props:{iconName:{},chipColor:{}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(c._sfc_main,{color:t.chipColor},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(s._sfc_main$1,{icon:t.iconName,size:"xs"},null,8,["icon"]),e.createElementVNode("span",null,[e.renderSlot(o.$slots,"chip-content")])])]),_:3},8,["color"]),e.renderSlot(o.$slots,"chip-postfix")]))}),ae={class:"flex flex-col gap-2"},re=e.defineComponent({__name:"InvoicePricingClauseChip",props:{clauseType:{},priceDetailsBand:{},invoiceLineDescription:{}},setup(t){const o=r.useIntl();return(n,a)=>(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("span",null,e.toDisplayString(t.invoiceLineDescription),1),"DISCOUNT"===t.clauseType&&t.priceDetailsBand?(e.openBlock(),e.createBlock(e.unref(ne),{key:0,"icon-name":"south_east","chip-color":"yellow"},e.createSlots({_:2},[t.priceDetailsBand.amount?{name:"chip-content",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.amount_discount",defaultMessage:"{amount} discount",description:"Represents a certain amount of discount, where {amount} is replaced with the amount"},{amount:e.unref(v.formatAmount)(t.priceDetailsBand.amount)}).toUpperCase()),1)]),key:"0"}:t.priceDetailsBand.percentage?{name:"chip-content",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.percentage_discount",defaultMessage:"{percentage}% discount",description:"Represents a certain percentage of discount, where {percentage} is replaced with the percentage (number only)"},{percentage:t.priceDetailsBand.percentage??"0"}).toUpperCase()),1)]),key:"1"}:void 0]),1024)):"ADJUSTMENT"===t.clauseType?(e.openBlock(),e.createBlock(e.unref(ne),{key:1,"icon-name":"info","chip-color":"yellow"},{"chip-content":e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.adjustment_chip_body",defaultMessage:"Adjustment",description:"Used on invoice lines to mark as adjusted"}).toUpperCase()),1)]),_:1})):"MARKUP"===t.clauseType?(e.openBlock(),e.createBlock(e.unref(ne),{key:2,"icon-name":"north_east","chip-color":"teal-light"},{"chip-content":e.withCtx(()=>{var n;return[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.markup_percentage",defaultMessage:"{percentage}% markup",description:"Markup percentage, where {percentage} is replaced with the percentage (number only)"},{percentage:(null==(n=t.priceDetailsBand)?void 0:n.percentage)??"0"}).toUpperCase()),1)]}),_:1})):"COMMITMENT"===t.clauseType?(e.openBlock(),e.createBlock(e.unref(ne),{key:3,"icon-name":"sell","chip-color":"orange"},{"chip-content":e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.commitment",defaultMessage:"commitment",description:"Used on invoice lines to mark as commitment"}).toUpperCase()),1)]),_:1})):e.createCommentVNode("",!0)]))}}),ie={class:"items-left flex flex-col gap-1 leading-none"},le={class:"flex items-center"},ce={key:0,class:"ml-1 text-xs text-gray-400"},de={key:0},se={key:1,class:"text-xs text-gray-400"},ue={key:2,class:"text-xs text-gray-400"},pe={class:"text-[9pt] text-slate-600"},me=e.defineComponent({__name:"InvoiceLineRow",props:{data:{},isLast:{type:Boolean},periodOrder:{},groupOrder:{},groupType:{},isExpanded:{type:Boolean}},setup(t){const{$t:o}=r.useIntl(),n=t,a=e=>{var t,o;if(!e)return"";let n="0",a=" +";if(e.tier_lower_bound&&"number"in e.tier_lower_bound)n=(null==(t=e.tier_lower_bound)?void 0:t.number)??"0";else if(e.tier_lower_bound&&"amount"in e.tier_lower_bound){const{quantity:t,currency:o}=e.tier_lower_bound.amount;n=`${o} ${t??0}`}if(e.tier_top_bound&&"number"in e.tier_top_bound)a=` - ${null==(o=e.tier_top_bound)?void 0:o.number}`;else if(e.tier_top_bound&&"amount"in e.tier_top_bound){const{quantity:t,currency:o}=e.tier_top_bound.amount;a=` - ${o} ${t}`}return n+a},i=e.computed(()=>{var e;return null==(e=n.data.details)?void 0:e.included_volume_details}),c=e.computed(()=>{var e,t;return(null==(e=n.data)?void 0:e.product_items)?f.getComposedString(n.data.product_items.map(e=>e.name)):(null==(t=n.data)?void 0:t.description)??"N/A"});return(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(D,{class:"align-top"},{default:e.withCtx(()=>{var r,d,u,p,g,f,_,y,x,k,b,B,h,N,V,C,w,E;return[e.createElementVNode("div",ie,[e.createElementVNode("div",null,[t.data.sub_lines?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 -translate-y-2 text-slate-400",{"-rotate-90":!t.isExpanded}])},null,8,["class"])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.renderSlot(n.$slots,"invoice-line-prefix",{lineOrder:t.data.line_order,periodOrder:t.periodOrder,groupOrder:t.groupOrder}),["PRICING","REVENUE","ONE_OFF"].includes(t.data.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),"ONE_OFF"===t.data.type&&"ONE_OFF"!==t.groupType?(e.openBlock(),e.createElementBlock("div",ce,e.toDisplayString(e.unref(v.formatEnum)(t.data.type)),1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(re,{key:1,"invoice-line-description":c.value,"clause-type":t.data.type,"price-details-band":null==(r=t.data.details)?void 0:r.band},null,8,["invoice-line-description","clause-type","price-details-band"]))])]),["TIERED","STAIR_STEP","TOP_TIERED"].includes(t.data.pricing_type)&&!i.value&&(null==(d=t.data.details)?void 0:d.band)?(e.openBlock(),e.createElementBlock("div",de,e.toDisplayString(a(null==(u=t.data.details)?void 0:u.band)),1)):e.createCommentVNode("",!0),(null==(g=null==(p=t.data.details)?void 0:p.split_pricing)?void 0:g.meter_properties)?(e.openBlock(),e.createElementBlock("span",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(null==(_=null==(f=t.data.details)?void 0:f.split_pricing)?void 0:_.meter_properties,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createTextVNode(e.toDisplayString(o.meter_property.name)+": "+e.toDisplayString(o.value),1),n<t.data.details.split_pricing.meter_properties.length-1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(", "))],64)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),(null==(y=t.data.conditions)?void 0:y.name)||(null==(x=t.data.conditions)?void 0:x.meter_properties)?(e.openBlock(),e.createElementBlock("div",ue,[t.data.conditions.name?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.data.conditions.name),1)],64)):t.data.conditions.meter_properties?(e.openBlock(),e.createBlock(e.unref(l._sfc_main),{key:1,comparators:t.data.conditions.meter_properties},null,8,["comparators"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("span",pe,["BELOW_MINIMUM_AMOUNT"===(null==(k=t.data.details)?void 0:k.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(o)({id:"invoice.line.band_minimum_amount",defaultMessage:"Band minimum amount",description:"Minimum amount specified in a band"}))+" ",1),(null==(b=t.data.details.band)?void 0:b.minimum_amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.data.details.band.minimum_amount},null,8,["value"])):e.createCommentVNode("",!0)],64)):"NOT_HIT"===(null==(B=t.data.details)?void 0:B.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(o)({id:"invoice.line.price_bound_within_bounds",defaultMessage:"Within bounds",description:"Label used when min and max bounds are specified but reached"})),1)],64)):"ABOVE_MAXIMUM_AMOUNT"===(null==(h=t.data.details)?void 0:h.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(e.unref(o)({id:"invoice.line.price_bound_maximum_amount",defaultMessage:"Maximum amount",description:"Minimum amount specified in a band"}))+" ",1),(null==(N=t.data.details.band)?void 0:N.maximum_amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.data.details.band.maximum_amount},null,8,["value"])):e.createCommentVNode("",!0)],64)):"BELOW_MINIMUM_NUMBER"===(null==(V=t.data.details)?void 0:V.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(e.unref(o)({id:"invoice.line.band_minimum_number",defaultMessage:"Minimum number",description:"Minimum number of units specified in a band"}))+" "+e.toDisplayString(null==(C=t.data.details.band)?void 0:C.minimum_number),1)],64)):"ABOVE_MAXIMUM_NUMBER"===(null==(w=t.data.details)?void 0:w.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(e.unref(o)({id:"invoice.line.band_maximum_number",defaultMessage:"Maximum number",description:"Maximum number of units specified in a band"}))+" "+e.toDisplayString(null==(E=t.data.details.band)?void 0:E.maximum_number),1)],64)):e.createCommentVNode("",!0)])]}),_:3}),e.renderSlot(n.$slots,"line-content",{details:t.data.details})],64))}}),ge={key:4,class:"text-xs text-gray-400"},fe={key:1,class:"tabular-nums"},ve={class:"text-2xs text-gray-500"},_e={key:0,class:"flex justify-end"},ye={class:"flex gap-1 items-center justify-end"},xe={key:0,class:"text-2xs text-gray-500 tabular-nums"},ke=e.defineComponent({__name:"InvoiceRowContent",props:{pricingType:{},details:{},taxCategories:{},amountType:{},hideTaxDetails:{type:Boolean}},setup(t){const o=r.useIntl(),n=t,a=e.computed(()=>{var e;return null==(e=n.details)?void 0:e.included_volume_details}),i=e.computed(()=>{var e;return null==(e=a.value)?void 0:e.available_included_volume});return(n,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(D,{number:"",class:"align-top"},{default:e.withCtx(()=>{var n,a,r,l,c,d,s,u,p,g,f,v,_,y,x,k,b,B,h,N,V,C,w,E,T;return["PASS_THROUGH"!==t.pricingType?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(null==(n=t.details)?void 0:n.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},["BELOW_MINIMUM_AMOUNT"===(null==(a=t.details)?void 0:a.price_bound)||"ABOVE_MAXIMUM_AMOUNT"===(null==(r=t.details)?void 0:r.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(null==(l=t.details)?void 0:l.meter_value.count),1)],64)):"NOT_HIT"===(null==(c=t.details)?void 0:c.price_bound)&&"amount"in t.details.meter_value&&(null==(s=null==(d=t.details)?void 0:d.meter_value)?void 0:s.amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:1,value:null==(p=null==(u=t.details)?void 0:u.meter_value)?void 0:p.amount},null,8,["value"])):"NOT_HIT"===(null==(g=t.details)?void 0:g.price_bound)&&"number"in t.details.meter_value&&(null==(v=null==(f=t.details)?void 0:f.meter_value)?void 0:v.number)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(null==(y=null==(_=t.details)?void 0:_.meter_value)?void 0:y.number),1)],64)):"RATIO"===(null==(x=t.details)?void 0:x.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(null==(k=t.details)?void 0:k.meter_value.number),1)],64)):"BELOW_MINIMUM_NUMBER"===(null==(b=t.details)?void 0:b.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(null==(h=null==(B=t.details)?void 0:B.band)?void 0:h.minimum_number),1)],64)):"ABOVE_MAXIMUM_NUMBER"===(null==(N=t.details)?void 0:N.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createTextVNode(e.toDisplayString(null==(C=null==(V=t.details)?void 0:V.band)?void 0:C.maximum_number),1)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(null==(w=t.details)?void 0:w.meter_value)&&"number"in t.details.meter_value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.details.meter_value.number),1)],64)):(null==(E=t.details)?void 0:E.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.details.total_count),1)],64)):(null==(T=t.details)?void 0:T.meter_value)&&"amount"in t.details.meter_value?(e.openBlock(),e.createBlock(m._sfc_main,{key:2,value:t.details.meter_value.amount},null,8,["value"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode("1")],64)),i.value?(e.openBlock(),e.createElementBlock("div",ge,["AMOUNT"===i.value.type?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(m._sfc_main,{value:i.value.amount},null,8,["value"]),e.createTextVNode(" "+e.toDisplayString(e.unref(o).$t({id:"invoice.line.included",defaultMessage:"included",description:"Used to specify an included amount. Should be lowercase."})),1)],64)):"NUMBER"===i.value.type?(e.openBlock(),e.createElementBlock("span",fe,e.toDisplayString(i.value.number)+" "+e.toDisplayString(e.unref(o).$t({id:"invoice.line.units_included",defaultMessage:"units included",description:"Used to specify an included units. Should be lowercase."})),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))],64)):e.createCommentVNode("",!0)]}),_:1}),"PASS_THROUGH"===t.pricingType?(e.openBlock(),e.createBlock(D,{key:0,class:"align-top text-right"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.line.pass_through",defaultMessage:"Pass through",description:"Name of the pass through pricing type"})),1)]),_:1})):(e.openBlock(),e.createBlock(D,{key:1,number:"",class:"align-top"},{default:e.withCtx(()=>{var o,n,a,r,i,l,c,d,s,u,p,g;return[(null==(o=t.details)?void 0:o.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},["BELOW_MINIMUM_AMOUNT"===(null==(n=t.details)?void 0:n.price_bound)&&(null==(r=null==(a=t.details)?void 0:a.band)?void 0:r.minimum_amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.details.band.minimum_amount},null,8,["value"])):"ABOVE_MAXIMUM_AMOUNT"===(null==(i=t.details)?void 0:i.price_bound)&&(null==(c=null==(l=t.details)?void 0:l.band)?void 0:c.maximum_amount)?(e.openBlock(),e.createBlock(m._sfc_main,{key:1,value:t.details.band.maximum_amount},null,8,["value"])):["NOT_HIT","RATIO","BELOW_MINIMUM_NUMBER","ABOVE_MAXIMUM_NUMBER"].includes(null==(d=t.details)?void 0:d.price_bound)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(null==(s=t.details)?void 0:s.band)&&t.details.band.amount?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.details.band.amount},null,8,["value"])):e.createCommentVNode("",!0),(null==(u=t.details)?void 0:u.band)&&"percentage"in t.details.band?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.details.band.percentage)+"% ",1)],64)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[(null==(p=t.details)?void 0:p.band)&&t.details.band.amount?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.details.band.amount},null,8,["value"])):e.createCommentVNode("",!0),(null==(g=t.details)?void 0:g.band)&&"percentage"in t.details.band?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.details.band.percentage)+"% ",1)],64)):e.createCommentVNode("",!0)],64))]}),_:1})),e.createVNode(D,{number:"",class:"align-top"},{default:e.withCtx(()=>[t.hideTaxDetails?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.taxCategories,(t,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"tabular-nums"},[e.createElementVNode("div",null,e.toDisplayString(t.percentage)+"%",1),e.createElementVNode("div",ve,[e.createVNode(m._sfc_main,{value:t.tax_amount},null,8,["value"])])]))),128))]),_:1}),e.createVNode(D,{number:"",class:"align-top"},{default:e.withCtx(()=>{var a,r,i,l;return[(null==(r=null==(a=t.details)?void 0:a.amount)?void 0:r.currency)&&(null==(l=null==(i=t.details)?void 0:i.amount)?void 0:l.quantity)?(e.openBlock(),e.createElementBlock("div",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.taxCategories,(n,a)=>{var r;return e.openBlock(),e.createElementBlock("div",{key:a,class:"inline-block"},[e.createElementVNode("div",ye,[e.createVNode(m._sfc_main,{value:t.details.amount},null,8,["value"]),(null==(r=t.details)?void 0:r.pricing_amount.quantity)!==t.details.amount.quantity?(e.openBlock(),e.createBlock(_._sfc_main,{key:0,placement:"top-end"},{tooltip:e.withCtx(()=>[e.createVNode(_.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(_._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.line.original_currency",defaultMessage:"Original currency",description:"Original currency"}))+" ",1),e.createVNode(m._sfc_main,{value:t.details.pricing_amount,class:"font-semibold"},null,8,["value"])]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(s._sfc_main$1,{icon:"info",size:"2xs"})]),_:1})):e.createCommentVNode("",!0)]),t.hideTaxDetails?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xe,["INCLUDING_TAX"===t.amountType?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.line.excl.tax",defaultMessage:"Excl. tax",description:"Value excludes tax"}))+" ",1),e.createVNode(m._sfc_main,{value:n.base_amount},null,8,["value"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.line.incl.tax",defaultMessage:"Incl. tax",description:"Value includes tax"}))+" ",1),e.createVNode(m._sfc_main,{value:n.total_amount},null,8,["value"])],64))]))])}),128)),e.renderSlot(n.$slots,"one-off-line-context-menu")])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode("-")],64))]}),_:3})],64))}}),be=["tabindex","onClick"],Be=e.defineComponent({__name:"InvoiceLineGroup",props:{group:{},startDate:{},endDate:{},total:{},amountType:{},invoicePeriodOrder:{},processingOnlyCustomers:{}},setup(t){const o=t,n=e.computed(()=>{var e;return null==(e=[...o.group.lines??[]])?void 0:e.sort((e,t)=>e.line_order-t.line_order)}),a=r.useIntl(),{getIsOpen:i,toggle:c}=l.useToggleList(),d=(e,t)=>`${e}-line-${t}`;return(o,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(O,null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(I,{left:"",class:"text-gray-400 w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a).$t({id:"invoice.table_header.unit",defaultMessage:"Unit",description:"Table header for the column containing the number of units of invoice groups"})),1)]),_:1}),e.createVNode(I,{right:"",class:"text-gray-400 w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a).$t({id:"invoice.table_header.quantity",defaultMessage:"Quantity",description:"Table header for quantity column"})),1)]),_:1}),e.createVNode(I,{right:"",class:"text-gray-400 w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a).$t({id:"invoice.table_header.price",defaultMessage:"Price",description:"Table header for the column containing the number of units of invoice groups"})),1)]),_:1}),e.createVNode(I,{right:"",class:"text-gray-400 w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a).$t({id:"invoice.table_header.tax_rate",defaultMessage:"Tax rate",description:"Table header for the column containing the tax percentage of invoice groups"})),1)]),_:1}),e.createVNode(I,{right:"",class:"text-gray-400 w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a).$t({id:"invoice.table_header.sub_total",defaultMessage:"Subtotal",description:"Table header for the column containing the subtotal for invoices"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[e.createElementVNode("tr",{tabindex:a.sub_lines?0:void 0,class:e.normalizeClass(["group",{"cursor-pointer":a.sub_lines,"border-t":0!==r}]),onClick:e=>{return o=t.group.group_order,n=a.line_order,void c(d(o,n));var o,n}},[(e.openBlock(),e.createBlock(me,{key:r,data:a,"is-first-in-group":0===r,"period-order":t.invoicePeriodOrder,"group-order":t.group.group_order,"is-last":r===n.value.length-1,"group-type":t.group.type,"is-expanded":e.unref(i)(d(t.group.group_order,a.line_order))},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(o.$slots,"invoice-line-prefix",e.mergeProps({ref_for:!0},t))]),"line-content":e.withCtx(n=>[e.createVNode(ke,{details:n.details,"pricing-type":a.pricing_type,"tax-categories":a.tax_categories,"amount-type":t.amountType},e.createSlots({_:2},["ONE_OFF"===a.type?{name:"one-off-line-context-menu",fn:e.withCtx(t=>[e.renderSlot(o.$slots,"one-off-line-context-menu",e.mergeProps({ref_for:!0},t,{lineOrder:a.line_order}))]),key:"0"}:void 0]),1032,["details","pricing-type","tax-categories","amount-type"])]),_:2},1032,["data","is-first-in-group","period-order","group-order","is-last","group-type","is-expanded"]))],10,be),e.createVNode(A,{ref_for:!0,ref:d(t.group.group_order,a.line_order),"sub-lines":a.sub_lines??[],"processing-only-customers":t.processingOnlyCustomers,"line-order":a.line_order,"is-open":e.unref(i)(d(t.group.group_order,a.line_order)),"period-order":t.invoicePeriodOrder,"group-order":t.group.group_order},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(o.$slots,"invoice-line-prefix",e.mergeProps({ref_for:!0},t))]),"subline-content":e.withCtx(o=>[e.createVNode(ke,{details:o.details,"hide-tax-details":o.hideTaxDetails,"pricing-type":a.pricing_type,"tax-categories":a.tax_categories,"amount-type":t.amountType},null,8,["details","hide-tax-details","pricing-type","tax-categories","amount-type"])]),_:2},1032,["sub-lines","processing-only-customers","line-order","is-open","period-order","group-order"])],64))),128))]),_:3})]))}}),he=["tabindex"],Ne={key:2,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"},Ve={key:0},Ce={colspan:"2",class:"p-0"},we={class:"px-9 py-3 -mx-9 bg-gray-50 text-xs"},Ee=e.defineComponent({__name:"InvoiceGroupRevenue",props:{group:{},expandedItems:{},handleToggleItems:{type:Function},formatIndex:{type:Function},invoicePeriodOrder:{},groupOrder:{},isExpandable:{type:Boolean},amountType:{},processingOnlyCustomers:{}},setup:t=>(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("tr",{class:e.normalizeClass(["border-t",{"cursor-pointer":t.isExpandable}]),tabindex:t.isExpandable?0:void 0,onClick:n[0]||(n[0]=e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))),onKeyup:[n[1]||(n[1]=e.withKeys(e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder)),["enter"])),n[2]||(n[2]=e.withKeys(e=>t.handleToggleItems(t.formatIndex(t.invoicePeriodOrder,t.groupOrder)),["space"]))]},[e.createVNode(D,{class:"p-0"},{default:e.withCtx(()=>{var o,n,a,r;return[t.isExpandable?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!t.expandedItems.includes(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))}])},null,8,["class"])):e.createCommentVNode("",!0),(null==(o=t.group.pricing)?void 0:o.name)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.group.pricing.name)+" ",1),(null==(n=t.group.products)?void 0:n.length)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" - ")],64)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(f.getComposedString)((null==(a=t.group.products)?void 0:a.map(e=>e.name))??[]))+" ",1),t.isExpandable?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(null==(r=t.group.lines)?void 0:r.length),1)):e.createCommentVNode("",!0)]}),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>["INCLUDING_TAX"===t.amountType?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,value:t.group.amount_including_tax},null,8,["value"])):(e.openBlock(),e.createBlock(m._sfc_main,{key:1,value:t.group.amount_excluding_tax},null,8,["value"]))]),_:1})],42,he),t.expandedItems.includes(t.formatIndex(t.invoicePeriodOrder,t.groupOrder))?(e.openBlock(),e.createElementBlock("tr",Ve,[e.createElementVNode("td",Ce,[e.createElementVNode("div",we,[e.createVNode(Be,{"invoice-period-order":t.invoicePeriodOrder,"start-date":t.group.start_at,"end-date":t.group.end_at,total:t.group.amount_excluding_tax,group:t.group,"amount-type":t.amountType,"processing-only-customers":t.processingOnlyCustomers},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(o.$slots,"invoice-line-prefix",e.normalizeProps(e.guardReactiveProps(t)))]),"one-off-line-context-menu":e.withCtx(n=>[e.renderSlot(o.$slots,"one-off-line-context-menu",e.mergeProps(n,{groupOrder:t.groupOrder}))]),_:3},8,["invoice-period-order","start-date","end-date","total","group","amount-type","processing-only-customers"])])])])):e.createCommentVNode("",!0)],64))}),Te={class:"flex items-center justify-between md:py-2"},Se=e.defineComponent({__name:"InvoiceHeader",props:{invoice:{},paymentAttempts:{},downloadService:{},showDownloadButton:{type:Boolean},variant:{default:"internal"}},setup(t){const o=t,{$t:n,formatDate:a}=r.useIntl(),i=e.computed(()=>o.paymentAttempts.findLast(e=>"AUTHORIZED"===e.result)),d=e.computed(()=>n({defaultMessage:"Due on {date}",description:"Label for due date, where {date} gets replaced with the due date",id:"invoice.due_on_label"},{date:a({date:o.invoice.due_date,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})})),s=e.computed(()=>a({date:o.invoice.invoice_date,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})),u=e.computed(()=>"external"===o.variant?s.value:o.invoice.invoice_number||"N/A"),p=e.computed(()=>{if(o.invoice.paid&&i.value)return n({defaultMessage:"Paid on {date}",description:"Label for payment date, where {date} gets replaced with the date",id:"invoice.paid_on_label"},{date:a({date:i.value.created_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})})}),m=e.computed(()=>"external"===o.variant?[o.invoice.invoice_number,p.value||d.value].join(" - "):p.value||d.value);return(o,a)=>(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(l._sfc_main$1,{title:u.value},{suffix:e.withCtx(()=>[t.invoice.paid?(e.openBlock(),e.createBlock(c._sfc_main,{key:0,color:"green",class:"ml-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Paid",description:"The paid chip label text for a paid invoice",id:"invoice.paid_chip"})),1)]),_:1})):e.createCommentVNode("",!0)]),subTitle:e.withCtx(()=>[e.createVNode(r._sfc_main,{variant:"body-xs",class:"flex gap-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value),1)]),_:1})]),_:1},8,["title"]),t.showDownloadButton?(e.openBlock(),e.createBlock(C,{key:0,size:"lg",variant:"outline","download-service":t.downloadService,"mobile-icon-only":""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)({defaultMessage:"Download PDF",description:"Title for button download pdf invoice",id:"invoice.download_pdf_button"})),1)]),_:1},8,["download-service"])):e.createCommentVNode("",!0)]))}});function Oe(t){return"function"==typeof t?t():e.unref(t)}"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope);const De={key:0,totals:"",class:"border-t"},Ie=e.defineComponent({__name:"InvoiceSummaryTotalExcludingTax",props:{baseAmount:{}},setup(t){const o=r.useIntl();return(n,a)=>t.baseAmount?(e.openBlock(),e.createElementBlock("tr",De,[e.createVNode(D,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.total_excluding_taxes",defaultMessage:"Total excluding taxes",description:"Table row header for the total excluding taxes column in the invoice table"})),1)]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.baseAmount},null,8,["value"])]),_:1})])):e.createCommentVNode("",!0)}}),Me={key:0,class:"font-bold border-t"},$e=e.defineComponent({__name:"InvoiceSummaryTotalIncludingTax",props:{totalAmount:{},isCustomerFacing:{type:Boolean}},setup(t){const o=r.useIntl();return(n,a)=>t.totalAmount?(e.openBlock(),e.createElementBlock("tr",Me,[e.createVNode(D,{class:"font-bold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.isCustomerFacing?e.unref(o).$t({id:"invoice.table_header.total_including_taxes_customer_facing",defaultMessage:"Total due today",description:"Table row header for the total including taxes column in the invoice table for a customer facing component"}):e.unref(o).$t({id:"invoice.table_header.total_including_taxes",defaultMessage:"Total including taxes",description:"Table row header for the total including taxes column in the invoice table"})),1)]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.totalAmount},null,8,["value"])]),_:1})])):e.createCommentVNode("",!0)}}),Fe={key:0,colspan:"4",class:"p-0"},Pe=e.defineComponent({__name:"InvoiceTaxes",props:{taxCategories:{}},setup(t){const o=r.useIntl();return(n,a)=>(e.openBlock(),e.createBlock(O,{class:"table-fixed"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(I,{left:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.tax type",defaultMessage:"Tax type",description:"Table header for the column containing the tax type"})),1)]),_:1}),e.createVNode(I,{right:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.base amount",defaultMessage:"Base amount",description:"Table header for the column containing the base amount"})),1)]),_:1}),e.createVNode(I,{right:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.tax_percentage",defaultMessage:"Percentage",description:"Table header for the column containing the tax percentage"})),1)]),_:1}),e.createVNode(I,{right:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.table_header.tax amount",defaultMessage:"Tax amount",description:"Table header for the column containing the tax amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.taxCategories,(t,o)=>(e.openBlock(),e.createElementBlock("tr",{key:o},[t.rates?(e.openBlock(),e.createElementBlock("td",Fe,[e.createVNode(O,{class:"table-fixed"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rates,(o,n)=>(e.openBlock(),e.createElementBlock("tr",{key:n},[e.createVNode(D,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name)+" ("+e.toDisplayString(t.category)+") ",1)]),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.base_amount},null,8,["value"])]),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.percentage)+"%",1)]),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:o.tax_amount},null,8,["value"])]),_:2},1024)]))),128))]),_:2},1024)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(D,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.name)+" ("+e.toDisplayString(t.category)+") ",1)]),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.base_amount},null,8,["value"])]),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.percentage)+"%",1)]),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.tax_amount},null,8,["value"])]),_:2},1024)],64))]))),128))]),_:1}))}}),Ae={class:"flex justify-between items-start"},ze={key:0,class:"max-h-9"},Le={class:"flex flex-col gap-2"},Ue={key:0},je=["tabindex"],Re={key:1,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"},qe={key:3},He={colspan:"2",class:"p-0"},Ke={class:"px-9 py-3 -mx-9 bg-gray-50 text-xs"},Ge=["tabindex","onClick","onKeyup"],Xe={key:1,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"},We={key:0},Qe={colspan:"2",class:"p-0"},Ye={class:"px-9 py-3 -mx-9 bg-gray-50 text-xs"},Je={key:0,class:"font-bold border-t"},Ze=e.defineComponent({__name:"InvoiceSummary",props:{invoice:{},isExpandable:{type:Boolean,default:!1},isInvoiceLineCreatable:{type:Boolean,default:!1},showRenderedServicesHeader:{type:Boolean,default:!0},isCustomerFacing:{type:Boolean}},setup(t){const o=r.useIntl(),n=t,[a,i]=h(),[c,d]=h(),[u,p]=function(t=!1,o={}){const{truthyValue:n=!0,falsyValue:a=!1}=o,r=e.isRef(t),i=e.ref(t);function l(e){if(arguments.length)return i.value=e,i.value;{const e=Oe(n);return i.value=i.value===e?Oe(a):e,i.value}}return r?l:[i,l]}(),g=(...e)=>{n.isExpandable&&i(...e)},v=e=>{n.isExpandable&&d(e)},_=()=>{n.invoice.tax_categories&&n.isExpandable&&p()},k=(e,t)=>+`${e}${t}`,b=e=>o.$t({id:"invoice.service_period_heading",defaultMessage:"Service period - {start_at} - {end_at}",description:"Heading for rendered services where {start_at} is replaced for the start date and {end_at} for the end date in invoice summary"},{start_at:o.formatDate({date:e.start_at,format:"date",timezone:r.formatTimezone(n.invoice.customer.timezone),offsetType:"offsetted"}),end_at:o.formatDate({date:e.end_at,format:"date",timezone:r.formatTimezone(n.invoice.customer.timezone),offsetType:"offsetted"})}),B=e=>{switch(e){case"PRICING":case"REVENUE":return o.$t({id:"invoice.table_heading.products",defaultMessage:"Products",description:"Table heading for the column containing the products of the invoice"});case"COMMITMENT":return o.$t({id:"invoice.table_heading.commitments",defaultMessage:"Commitments",description:"Table heading for the column containing the commitments of the invoice"});case"DISCOUNT":return o.$t({id:"invoice.table_heading.discounts",defaultMessage:"Discounts",description:"Table heading for the column containing the discounts of the invoice"});case"MARKUP":return o.$t({id:"invoice.table_heading.markups",defaultMessage:"Markups",description:"Table heading for the column containing the markups of the invoice"});case"ONE_OFF":return o.$t({id:"invoice.table_heading.one_offs",defaultMessage:"One-off's",description:"Table heading for the column containing the one-offs of the invoice"})}},V=e=>e.groups.reduce((e,t)=>t.type in e?{...e,[t.type]:[...e[t.type],t]}:{...e,[t.type]:[t]},{});return(n,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",Ae,[n.$slots.logo?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(n.$slots,"logo")])):(e.openBlock(),e.createBlock(l._sfc_main$1,{key:1,title:e.unref(o).$t({id:"invoice.title",defaultMessage:"Details",description:"Title for the invoice summary"}),variant:"neutral",icon:"draft"},null,8,["title"])),n.$slots.intro?e.renderSlot(n.$slots,"intro",{key:2}):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[["ONE_OFF","STANDARD","ONE_OFF_CREDIT"].includes(t.invoice.type)&&["DRAFT","OPEN"].includes(t.invoice.status)&&t.isInvoiceLineCreatable?(e.openBlock(),e.createBlock(N,{key:0,to:{name:"invoice-add-line",params:{id:t.invoice.id}},class:"text-sm font-semibold"},{default:e.withCtx(()=>[e.createVNode(s._sfc_main$1,{icon:"add",size:"md",class:"mr-1"}),e.createElementVNode("span",null,e.toDisplayString(e.unref(o).$t({id:"invoice.add_invoice_line",defaultMessage:"Add invoice line",description:"Label for adding lines to an invoice"})),1)]),_:1},8,["to"])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"child-customers-selector")])]),n.$slots.total?e.renderSlot(n.$slots,"total",{key:0}):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"notes"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.periods,(l,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[t.showRenderedServicesHeader?(e.openBlock(),e.createBlock(y._sfc_main,{key:0,class:"mt-6"},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,{tag:"h2",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b(l)),1)]),_:2},1024)]),_:2},1024)):e.createCommentVNode("",!0),l.groups?(e.openBlock(),e.createBlock(O,{key:1,class:e.normalizeClass({"mt-3":t.showRenderedServicesHeader})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.entries(V(l)),([r,c],d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[d>0?(e.openBlock(),e.createElementBlock("tr",Ue,[...i[0]||(i[0]=[e.createElementVNode("td",null,[e.createElementVNode("div",{class:"h-4"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("tr",null,[e.createVNode(I,{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B(r)),1)]),_:2},1024),e.createVNode(I,{right:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.amount_table_heading",defaultMessage:"Amount",description:"Table heading for the amount column in the invoice table"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c,(i,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},["REVENUE"===r||"PRICING"===r||"ONE_OFF"===r?(e.openBlock(),e.createBlock(Ee,{key:0,group:i,"expanded-items":e.unref(a),"handle-toggle-items":g,"is-expandable":t.isExpandable,"format-index":k,"invoice-period-order":l.period_order,"group-order":i.group_order,"amount-type":t.invoice.pricing_amount_type,"processing-only-customers":t.invoice.processing_only_customers},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(n.$slots,"invoice-line-prefix",e.mergeProps({ref_for:!0},t))]),"one-off-line-context-menu":e.withCtx(t=>[e.renderSlot(n.$slots,"one-off-line-context-menu",e.mergeProps({ref_for:!0},t,{periodOrder:l.period_order}))]),_:2},1032,["group","expanded-items","is-expandable","invoice-period-order","group-order","amount-type","processing-only-customers"])):"DISCOUNT"===r||"MARKUP"===r?(e.openBlock(),e.createBlock(ee,{key:1,group:i,"expanded-items":e.unref(a),"handle-toggle-items":g,"is-expandable":t.isExpandable,"format-index":k,"invoice-period-order":l.period_order,"group-order":i.group_order,"amount-type":t.invoice.pricing_amount_type,heading:"DISCOUNT"===r?e.unref(o).$t({id:"invoice.discounts_table_heading",defaultMessage:"Discounts",description:"Heading for discounts in the invoice table"}):e.unref(o).$t({id:"invoice.markups_table_heading",defaultMessage:"Markups",description:"Heading for markups in the invoice table"})},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(n.$slots,"invoice-line-prefix",e.mergeProps({ref_for:!0},t))]),_:3},8,["group","expanded-items","is-expandable","invoice-period-order","group-order","amount-type","heading"])):"COMMITMENT"===r?(e.openBlock(),e.createBlock(W,{key:2,group:i,"expanded-items":e.unref(a),"handle-toggle-items":g,"is-expandable":t.isExpandable,"format-index":k,"invoice-period-order":l.period_order,"group-order":i.group_order,"amount-type":t.invoice.pricing_amount_type},{"invoice-line-prefix":e.withCtx(t=>[e.renderSlot(n.$slots,"invoice-line-prefix",e.mergeProps({ref_for:!0},t))]),_:3},8,["group","expanded-items","is-expandable","invoice-period-order","group-order","amount-type"])):e.createCommentVNode("",!0)],64))),128))],64))),128))]),_:2},1032,["class"])):e.createCommentVNode("",!0)],64))),128)),t.invoice.tax_summary?(e.openBlock(),e.createBlock(O,{key:1,class:"mt-6"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(I,{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.totals_table_heading",defaultMessage:"Totals",description:"Table heading for the totals column in the invoice table"})),1)]),_:1}),e.createVNode(I,{right:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.amount_table_heading",defaultMessage:"Amount",description:"Table heading for the amount column in the invoice table"})),1)]),_:1})]),"INCLUDING_TAX"===t.invoice.pricing_amount_type?(e.openBlock(),e.createBlock($e,{key:0,"total-amount":t.invoice.tax_summary.total_amount,"is-customer-facing":t.isCustomerFacing},null,8,["total-amount","is-customer-facing"])):(e.openBlock(),e.createBlock(Ie,{key:1,"base-amount":t.invoice.tax_summary.base_amount},null,8,["base-amount"])),t.invoice.tax_summary.tax_amount?(e.openBlock(),e.createElementBlock("tr",{key:2,class:e.normalizeClass([{"cursor-pointer":t.invoice.tax_categories&&t.isExpandable},"border-t"]),tabindex:t.isExpandable?0:void 0,onClick:_,onKeyup:[e.withKeys(_,["enter"]),e.withKeys(_,["space"])]},[e.createVNode(D,null,{default:e.withCtx(()=>[t.isExpandable&&t.invoice.tax_categories&&t.invoice.tax_categories.length?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!e.unref(u)}])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(o).$t({id:"invoice.taxes_table_heading",defaultMessage:"Taxes",description:"Table heading for the taxes column in the invoice table"}))+" ",1),t.isExpandable&&t.invoice.tax_categories?(e.openBlock(),e.createElementBlock("span",Re,e.toDisplayString(t.invoice.tax_categories.length),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.invoice.tax_summary.tax_amount},null,8,["value"])]),_:1})],42,je)):e.createCommentVNode("",!0),e.unref(u)&&t.invoice.tax_categories?(e.openBlock(),e.createElementBlock("tr",qe,[e.createElementVNode("td",He,[e.createElementVNode("div",Ke,[e.createVNode(Pe,{"tax-categories":t.invoice.tax_categories},null,8,["tax-categories"])])])])):e.createCommentVNode("",!0),"INCLUDING_TAX"===t.invoice.pricing_amount_type?(e.openBlock(),e.createBlock(Ie,{key:4,"base-amount":t.invoice.tax_summary.base_amount},null,8,["base-amount"])):(e.openBlock(),e.createBlock($e,{key:5,"total-amount":t.invoice.tax_summary.total_amount},null,8,["total-amount"]))]),_:1})):e.createCommentVNode("",!0),e.unref(x.isEmpty)(t.invoice.closed_periods)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(O,{key:2,class:"mt-6"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(I,{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.already_deducted_table_heading",defaultMessage:"Already deducted",description:"Table heading for the already deducted rows in the invoice table"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.invoice.closed_periods,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.groups,(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a},[e.createElementVNode("tr",{class:e.normalizeClass(["border-t",{"pt-6":0===n,"cursor-pointer":t.isExpandable}]),tabindex:t.isExpandable?0:void 0,onClick:e=>v(k(n,a)),onKeyup:[e.withKeys(e=>v(k(n,a)),["enter"]),e.withKeys(e=>v(k(n,a)),["space"])]},[e.createVNode(D,{class:"p-0"},{default:e.withCtx(()=>{var r,i;return[t.isExpandable?(e.openBlock(),e.createBlock(s._sfc_main$1,{key:0,icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["-translate-x-7 absolute text-slate-400",{"-rotate-90":!e.unref(c).includes(k(n,a))}])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(f.getComposedString)((null==(r=o.products)?void 0:r.map(e=>e.name))??[]))+" ",1),t.isExpandable?(e.openBlock(),e.createElementBlock("span",Xe,e.toDisplayString(null==(i=o.lines)?void 0:i.length),1)):e.createCommentVNode("",!0)]}),_:2},1024),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:o.amount_excluding_tax},null,8,["value"])]),_:2},1024)],42,Ge),e.unref(c).includes(k(n,a))?(e.openBlock(),e.createElementBlock("tr",We,[e.createElementVNode("td",Qe,[e.createElementVNode("div",Ye,[e.createVNode(Be,{"start-date":o.start_at,"end-date":o.end_at,total:o.amount_excluding_tax,group:o,"amount-type":t.invoice.pricing_amount_type},null,8,["start-date","end-date","total","group","amount-type"])])])])):e.createCommentVNode("",!0)],64))),128))],64))),128)),t.invoice.open_invoice_amount&&!t.invoice.paid?(e.openBlock(),e.createElementBlock("tr",Je,[e.createVNode(D,{class:"font-bold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o).$t({id:"invoice.amount_due_table_heading",defaultMessage:"Amount due",description:"Table heading for the amount due row in the invoice table"})),1)]),_:1}),e.createVNode(D,{number:""},{default:e.withCtx(()=>[e.createVNode(m._sfc_main,{value:t.invoice.open_invoice_amount},null,8,["value"])]),_:1})])):e.createCommentVNode("",!0)]),_:1}))]))}});const et=e.defineComponent({__name:"Invoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(r){const i=r,l=function({invoiceId:e}){const{getInvoice:t,getInvoicePdf:a}=o.createInvoicesService(),{data:r,execute:i,apiStatus:l,error:c,isPending:d}=n.useService({service:()=>t(e)});return{invoice:r,downloadInvoicePdf:a,apiStatus:l,error:c,get:i,isPending:d}}({invoiceId:i.configuration.invoiceId}),c=function(){const{getPayments:e}=a.createPaymentsService(),{data:t,execute:o,error:r,apiStatus:i,isPending:l}=n.useService({service:e,isCollection:!0});return{payments:t,get:o,error:r,apiStatus:i,isPending:l}}(),{isLoading:d}=t.useLoadInitialData(l.get(),c.get(i.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(l).invoice.value,invoiceDownloadService:e.unref(l).downloadInvoicePdf,payments:e.unref(c),isLoading:e.unref(d)})}}),tt={key:0,class:"mt-8"},ot={class:"flex flex-col gap-6"},nt=["onClick","onKeyup"],at={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},rt={key:0},it={class:"p-0"},lt={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},ct=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:a,formatMessage:i,formatNumber:c}=r.useIntl(),{getIsOpen:d,toggle:u}=l.useToggleList(),p=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),m=e=>i({defaultMessage:"Service period - {startAt} - {endAt}",id:"kFCxC4",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),g=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=p.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:i({defaultMessage:"Credits",id:"K2fM1n",description:"Fallback label for wallet balance credit types when no name is available"})},f=e=>e?c(Number(e)):i({defaultMessage:"-",id:"dHb0fN",description:"Placeholder shown when a wallet balance quantity is missing"}),v=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var a,r,i,l;const c=new Map,d=new Map;for(const t of e.groups??[])for(const s of t.lines??[]){const u=null==(a=null==s?void 0:s.details)?void 0:a.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),g={id:`${e.period_order}-${t.group_order}-${s.line_order}`,label:m,used:n(null==(r=u.used_wallet_credits)?void 0:r.quantity),left:n(null==(i=u.left_wallet_credits)?void 0:i.quantity),available:n(null==(l=u.available_wallet_credits)?void 0:l.quantity)},f=`${g.label}-${g.used}-${g.left}-${g.available}`,v=d.get(m)??new Set;if(v.has(f))continue;v.add(f),d.set(m,v);const _=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:g.available,rows:[]};_.rows.push(g),c.set(m,_)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:m,getCreditTypeLabel:g,formatQuantity:f}));return(t,o)=>v.value.length>0?(e.openBlock(),e.createElementBlock("section",tt,[e.createElementVNode("div",ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(y._sfc_main),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(r._sfc_main),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(O),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(I),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Wallet balance",id:"j2d7b2",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(u)(t.id),onKeyup:[e.withKeys(o=>e.unref(u)(t.id),["enter"]),e.withKeys(o=>e.unref(u)(t.id),["space"])]},[e.createVNode(e.unref(D),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(s._sfc_main$1),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(d)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",at,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,nt),e.unref(d)(t.id)?(e.openBlock(),e.createElementBlock("tr",rt,[e.createElementVNode("td",it,[e.createElementVNode("div",lt,[e.createVNode(e.unref(O),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(I),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Credit breakdown",id:"65I4e4",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(I),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Balance",id:"4UjRe6",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(I),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Used",id:"rUy4Lk",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(I),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Remaining",id:"C8F4/r",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(D),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(D),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(D),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(D),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),dt=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=r.useIntl(),{width:n}=k.useWindowSize(),a=e.computed(()=>n.value<=768);return(n,r)=>(e.openBlock(),e.createBlock(e.unref(p._sfc_main),{title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"}),class:"grow"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"p-6 pt-2":!a.value})},[a.value?(e.openBlock(),e.createBlock(e.unref(E),{key:0,variant:"default","has-icon":"",class:"justify-center bg-gray-50 border-gray-100 text-gray-800 font-semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(Ze),{invoice:t.invoice,"is-expandable":!a.value},{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(ct,{invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),st={class:"flex flex-col gap-3 lg:flex-row lg:gap-6"},ut={class:"flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},pt=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(t){const{$t:o}=r.useIntl();return(n,a)=>{var r,l;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(Se),{class:"mb-6","payment-attempts":t.payments??[],invoice:t.invoice,"download-service":()=>t.invoiceDownloadService(t.invoice.id),"show-download-button":t.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",st,[t.invoice?(e.openBlock(),e.createBlock(dt,{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",ut,[e.createVNode(b._sfc_main,{invoice:t.invoice},null,8,["invoice"]),(null==(r=t.configuration)?void 0:r.enablePaymentAttempts)&&(null==(l=t.payments)?void 0:l.length)?(e.openBlock(),e.createBlock(B._sfc_main,{key:0,"payment-attempts":t.payments,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.configuration.enableCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{key:1,customer:t.invoice.customer,title:e.unref(o)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])],64)}}}),mt=e.defineComponent({__name:"Invoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){var o;const n=t;if(!(null==(o=n.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const a=e.computed(()=>({...n,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...n.configuration}}));return(o,n)=>{var i,l,c,d;return e.openBlock(),e.createBlock(e.unref(r._sfc_main$1),{"custom-element-name":e.unref(ft),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(i=t.branding)?void 0:i.colors)?void 0:l.primary,"secondary-color":null==(d=null==(c=t.branding)?void 0:c.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:n[0]||(n[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(et,e.normalizeProps(e.guardReactiveProps(a.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:a,invoiceDownloadService:r})=>[o?(e.openBlock(),e.createBlock(pt,{key:0,"is-loading":a,invoice:o,"invoice-download-service":r,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),gt=r.defineCustomElement(mt),ft=r.getComponentName("invoice");exports.COMPONENT_NAME=ft,exports.SolvimonInvoice=gt,exports.defineSolvimonInvoice=()=>{customElements.get(ft)||customElements.define(ft,gt)};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../useLoadInitialData-BRg7IWqW.js"),o=require("../../usePayments-B13S_yai.js"),n=require("../../component-C2Gc-wsE.js"),i=require("../../vendor-ui-Ce_Yp7xA.js"),a=require("../../useViewport-CKRY1CKR.js"),l=require("../../InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-B_WLgBur.js"),r=e.defineComponent({__name:"Invoice.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup(n){const i=n,a=o.useInvoice({invoiceId:i.configuration.invoiceId}),l=o.usePayments(),{isLoading:r}=t.useLoadInitialData(a.get(),l.get(i.configuration.invoiceId));return(t,o)=>e.renderSlot(t.$slots,"default",{invoice:e.unref(a).invoice.value,invoiceDownloadService:e.unref(a).downloadInvoicePdf,payments:e.unref(l),isLoading:e.unref(r)})}}),c={key:0,class:"mt-8"},s={class:"flex flex-col gap-6"},d=["onClick","onKeyup"],u={class:"ml-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-blue-100 text-2xs font-bold text-blue-600"},p={key:0},m={class:"p-0"},f={class:"-mx-9 bg-gray-50 px-9 py-3 text-xs"},v=e.defineComponent({__name:"InvoiceCreditsBreakdown",props:{invoice:{type:Object}},setup(t){const o=t,{formatDate:n,$t:a,formatMessage:l,formatNumber:r}=i.useIntl(),{getIsOpen:v,toggle:g}=i.useToggleList(),y=e.computed(()=>Object.fromEntries((o.invoice.credit_types??[]).map(e=>[e.id,e]))),_=e=>l({defaultMessage:"Service period - {startAt} - {endAt}",id:"wallet_balance.service_period_heading",description:"Heading shown above wallet balance details for an invoice period"},{startAt:n({date:e.start_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone}),endAt:n({date:e.end_at,format:"date",offsetType:"offsetted",timezone:o.invoice.customer.timezone})}),b=e=>{var t;return(null==e?void 0:e.credit_type_id)?(null==(t=y.value[e.credit_type_id])?void 0:t.name)??e.credit_type_id:l({defaultMessage:"Credits",id:"wallet_balance.credit_type_fallback_label",description:"Fallback label for wallet balance credit types when no name is available"})},w=e=>e?r(Number(e)):l({defaultMessage:"-",id:"empty_value_placeholder",description:"Placeholder shown when a wallet balance quantity is missing"}),h=e.computed(()=>(({invoice:e,getPeriodTitle:t,getCreditTypeLabel:o,formatQuantity:n})=>[...e.periods??[],...e.closed_periods??[]].map(e=>{var i,a,l,r;const c=new Map,s=new Map;for(const t of e.groups??[])for(const d of t.lines??[]){const u=null==(i=null==d?void 0:d.details)?void 0:i.wallet_balance_details;if(!u)continue;const p=u.used_wallet_credits??u.left_wallet_credits??u.available_wallet_credits,m=o(p),f={id:`${e.period_order}-${t.group_order}-${d.line_order}`,label:m,used:n(null==(a=u.used_wallet_credits)?void 0:a.quantity),left:n(null==(l=u.left_wallet_credits)?void 0:l.quantity),available:n(null==(r=u.available_wallet_credits)?void 0:r.quantity)},v=`${f.label}-${f.used}-${f.left}-${f.available}`,g=s.get(m)??new Set;if(g.has(v))continue;g.add(v),s.set(m,g);const y=c.get(m)??{id:`${e.period_order}-${m}`,label:m,amount:f.available,rows:[]};y.rows.push(f),c.set(m,y)}return{id:`${e.period_order}-${e.start_at}`,title:t(e),rows:[...c.values()]}}).filter(e=>e.rows.length>0))({invoice:o.invoice,getPeriodTitle:_,getCreditTypeLabel:b,formatQuantity:w}));return(t,o)=>h.value.length>0?(e.openBlock(),e.createElementBlock("section",c,[e.createElementVNode("div",s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock("section",{key:t.id},[e.createVNode(e.unref(i._sfc_main$17),{class:"mt-4"},{default:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main),{tag:"h3",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:2},1024)]),_:2},1024),e.createVNode(e.unref(i.InvoiceTable),{class:"mt-3"},{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(i._sfc_main$18),{left:"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Wallet balance",id:"wallet_balance.details.header",description:"Section header for invoice wallet balance details"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.id},[e.createElementVNode("tr",{class:"cursor-pointer border-t",tabindex:"0",onClick:o=>e.unref(g)(t.id),onKeyup:[e.withKeys(o=>e.unref(g)(t.id),["enter"]),e.withKeys(o=>e.unref(g)(t.id),["space"])]},[e.createVNode(e.unref(i._sfc_main$19),{class:"p-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(i._sfc_main$11),{icon:"keyboard_arrow_down",size:"md",class:e.normalizeClass(["absolute -translate-x-7 text-slate-400",{"-rotate-90":!e.unref(v)(t.id)}])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",u,e.toDisplayString(t.rows.length),1)]),_:2},1024)],40,d),e.unref(v)(t.id)?(e.openBlock(),e.createElementBlock("tr",p,[e.createElementVNode("td",m,[e.createElementVNode("div",f,[e.createVNode(e.unref(i.InvoiceTable),null,{default:e.withCtx(()=>[e.createElementVNode("tr",null,[e.createVNode(e.unref(i._sfc_main$18),{left:"",class:"w-2/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Credit breakdown",id:"invoice_credits.credit_breakdown.table_header",description:"Column header for wallet balance credit type details"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$18),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Balance",id:"invoice_credits.balance.table_header",description:"Column header for the available wallet balance amount"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$18),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Used",id:"invoice_credits.used.table_header",description:"Column header for the used wallet credit amount"})),1)]),_:1}),e.createVNode(e.unref(i._sfc_main$18),{right:"",class:"w-1/5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)({defaultMessage:"Remaining",id:"invoice_credits.remaining.table_header",description:"Column header for the remaining wallet credit amount"})),1)]),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,t=>(e.openBlock(),e.createElementBlock("tr",{key:t.id,class:"border-t"},[e.createVNode(e.unref(i._sfc_main$19),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$19),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.available),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$19),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.used),1)]),_:2},1024),e.createVNode(e.unref(i._sfc_main$19),{number:""},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.left),1)]),_:2},1024)]))),128))]),_:2},1024)])])])):e.createCommentVNode("",!0)],64))),128))]),_:2},1024)]))),128))])])):e.createCommentVNode("",!0)}}),g=e.defineComponent({__name:"InvoiceBlock",props:{invoice:{type:Object}},setup(t){const{$t:o}=i.useIntl(),{isMobileViewport:n}=a.useViewport();return(a,l)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main$1),{title:e.unref(o)({defaultMessage:"Invoice",description:"Title for the invoice block on the invoice details page",id:"sdk.invoice_details.invoice.title"}),class:"grow"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass({"p-6 pt-2":!e.unref(n)})},[e.unref(n)?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$20),{key:0,variant:"default","has-icon":"",class:"justify-center border-gray-100 bg-gray-50 font-semibold text-gray-800"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)({defaultMessage:"Download the PDF for a full breakdown",description:"Download the PDF for a full breakdown",id:"sdk.invoice_details.invoice.download_pdf"})),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(i._sfc_main$12),{invoice:t.invoice,"is-expandable":!e.unref(n)},{logo:e.withCtx(()=>[e.renderSlot(a.$slots,"logo")]),_:3},8,["invoice","is-expandable"]),e.createVNode(v,{invoice:t.invoice},null,8,["invoice"])],2)]),_:3},8,["title"]))}}),y={class:"flex flex-col gap-3 lg:flex-row lg:gap-6"},_={class:"flex shrink-0 flex-col gap-8 lg:w-72 lg:gap-6"},b=e.defineComponent({__name:"Invoice",props:{isLoading:{type:Boolean},invoice:{type:Object},payments:{type:Array},invoiceDownloadService:{type:Function},configuration:{type:Object}},setup(t){const o=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../../PaymentHistoryBlock-DHM-3fh-.js"))),{$t:n}=i.useIntl();return(a,r)=>{var c,s;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(i._sfc_main$13),{class:"mb-6","payment-attempts":t.payments??[],invoice:t.invoice,"download-service":()=>t.invoiceDownloadService(t.invoice.id),"show-download-button":t.configuration.enableDownloadButton,variant:"external"},null,8,["payment-attempts","invoice","download-service","show-download-button"]),e.createElementVNode("div",y,[t.invoice?(e.openBlock(),e.createBlock(g,{key:0,invoice:t.invoice},null,8,["invoice"])):e.createCommentVNode("",!0),e.createElementVNode("div",_,[e.createVNode(l._sfc_main,{invoice:t.invoice},null,8,["invoice"]),(null==(c=t.configuration)?void 0:c.enablePaymentAttempts)&&(null==(s=t.payments)?void 0:s.length)?(e.openBlock(),e.createBlock(e.unref(o),{key:0,"payment-attempts":t.payments,customer:t.invoice.customer},null,8,["payment-attempts","customer"])):e.createCommentVNode("",!0),t.configuration.enableCustomerBillingInformation?(e.openBlock(),e.createBlock(e.unref(i._sfc_main$2),{key:1,customer:t.invoice.customer,title:e.unref(n)({defaultMessage:"Your billing information",description:"Title for the billing information on the detailed invoice view",id:"sdk.invoice_details.customer_billing_information.title"})},null,8,["customer","title"])):e.createCommentVNode("",!0)])])],64)}}}),w=e.defineComponent({__name:"Invoice.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},branding:{type:Object},configuration:{type:Object}},setup(t){var o;const i=t;if(!(null==(o=i.configuration)?void 0:o.invoiceId))throw new Error("Missing invoice id");const a=e.computed(()=>({...i,configuration:{enableCustomerBillingInformation:!0,enableDownloadButton:!0,enablePaymentAttempts:!0,...i.configuration}}));return(o,i)=>{var l,c,s,d;return e.openBlock(),e.createBlock(e.unref(n._sfc_main),{"custom-element-name":e.unref(x),environment:t.environment,locale:t.locale,"portal-object":t.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(c=null==(l=t.branding)?void 0:l.colors)?void 0:c.primary,"secondary-color":null==(d=null==(s=t.branding)?void 0:s.colors)?void 0:d.secondary,"experimental-features":t.experimentalFeatures,"log-level":t.logLevel,"on-log":t.onLog,onError:i[0]||(i[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(r,e.normalizeProps(e.guardReactiveProps(a.value)),{default:e.withCtx(({invoice:o,payments:n,isLoading:i,invoiceDownloadService:a})=>[o?(e.openBlock(),e.createBlock(b,{key:0,"is-loading":i,invoice:o,"invoice-download-service":a,payments:n.payments.value,configuration:t.configuration},null,8,["is-loading","invoice","invoice-download-service","payments","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),h=n.defineCustomElement(w),x=n.getComponentName("invoice");exports.COMPONENT_NAME=x,exports.SolvimonInvoice=h,exports.defineSolvimonInvoice=()=>{customElements.get(x)||customElements.define(x,h)};
|