@solvimon/solvimon-web 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +80 -0
  2. package/dist/BillingInformation.entry.ce-1xVdsWlL.mjs +99 -0
  3. package/dist/BillingInformation.entry.ce-DkrfEvK_.js +1 -0
  4. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-B42EzZ97.mjs +56 -0
  5. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-VMlVPI4O.js +1 -0
  6. package/dist/BillingInformationForm.entry.ce-MPMirEsk.js +1 -0
  7. package/dist/BillingInformationForm.entry.ce-xfT0Jqps.mjs +579 -0
  8. package/dist/Checkout.entry.ce-Bif6vR1K.mjs +5185 -0
  9. package/dist/Checkout.entry.ce-CkQnLAn4.js +1 -0
  10. package/dist/ContentWithAsideLayout-BC-C5Gjt.mjs +42 -0
  11. package/dist/ContentWithAsideLayout-CIVSoqFr.js +1 -0
  12. package/dist/CustomerOverview.entry.ce-C__omsVl.js +1 -0
  13. package/dist/CustomerOverview.entry.ce-Ce_Yk8-i.mjs +231 -0
  14. package/dist/CustomerPaymentMethods.entry.ce-CZwy8Aqq.mjs +135 -0
  15. package/dist/CustomerPaymentMethods.entry.ce-DnjlRHPA.js +1 -0
  16. package/dist/Invoice.entry.ce-CdJ9TPZe.mjs +583 -0
  17. package/dist/Invoice.entry.ce-Cgr43ome.js +1 -0
  18. package/dist/InvoiceDetails.entry.ce-Cnpz8CLJ.mjs +130 -0
  19. package/dist/InvoiceDetails.entry.ce-jHDyWra2.js +1 -0
  20. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-5yBnSRap.mjs +85 -0
  21. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-t6E9_dWJ.js +1 -0
  22. package/dist/InvoicesList.entry.ce-38iOW5qh.js +1 -0
  23. package/dist/InvoicesList.entry.ce-BBaHEtAD.mjs +105 -0
  24. package/dist/PaymentHistory.entry.ce-DDeHMhK_.js +1 -0
  25. package/dist/PaymentHistory.entry.ce-Dw2NiP4l.mjs +134 -0
  26. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-8UxAr2hU.js +1 -0
  27. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-CknZKCmY.mjs +90 -0
  28. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs +6568 -0
  29. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js +1 -0
  30. package/dist/PaymentMethodForm.entry.ce-f4cFExKc.mjs +238 -0
  31. package/dist/PaymentMethodForm.entry.ce-zxeBXZW6.js +1 -0
  32. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-BFFJw-5h.mjs +62 -0
  33. package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CQqTurIt.js +1 -0
  34. package/dist/SubscriptionSchedules.entry.ce-B4T_yQC1.js +1 -0
  35. package/dist/SubscriptionSchedules.entry.ce-B4vQ7QLk.mjs +153 -0
  36. package/dist/SubscriptionsList.entry.ce-B5SJCQW0.js +1 -0
  37. package/dist/SubscriptionsList.entry.ce-cNYuQZZj.mjs +135 -0
  38. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs +373 -0
  39. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js +1 -0
  40. package/dist/_Uint8Array-DHE03FZr.mjs +507 -0
  41. package/dist/_Uint8Array-DxISR7XF.js +1 -0
  42. package/dist/auto-B_36W1Fc.js +6 -0
  43. package/dist/auto-BfMZdgp-.mjs +14207 -0
  44. package/dist/cloneDeep-Hs8Pp07F.js +1 -0
  45. package/dist/cloneDeep-sm9cY-u2.mjs +212 -0
  46. package/dist/component-BkmcE85U.mjs +58654 -0
  47. package/dist/component-Df5eNqYX.js +1 -0
  48. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +3 -0
  49. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -0
  50. package/dist/components/BillingInformation/BillingInformation.es.js +7 -0
  51. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +3 -0
  52. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -0
  53. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +7 -0
  54. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +3 -0
  55. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -0
  56. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +7 -0
  57. package/dist/components/Invoice/Invoice.ce.d.ts +3 -0
  58. package/dist/components/Invoice/Invoice.cjs.js +1 -0
  59. package/dist/components/Invoice/Invoice.es.js +7 -0
  60. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +3 -0
  61. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -0
  62. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +7 -0
  63. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +3 -0
  64. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -0
  65. package/dist/components/InvoicesList/InvoicesList.es.js +7 -0
  66. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +3 -0
  67. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -0
  68. package/dist/components/PaymentHistory/PaymentHistory.es.js +7 -0
  69. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +3 -0
  70. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -0
  71. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +7 -0
  72. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +3 -0
  73. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -0
  74. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +7 -0
  75. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +3 -0
  76. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -0
  77. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +7 -0
  78. package/dist/core/action-request.types.d.ts +58 -0
  79. package/dist/core/configuration.d.ts +2 -0
  80. package/dist/core/index.cjs.js +1 -0
  81. package/dist/core/index.d.ts +10 -0
  82. package/dist/core/index.es.js +6 -0
  83. package/dist/core/registry.ce.d.ts +2 -0
  84. package/dist/core/registry.d.ts +6 -0
  85. package/dist/core/types.d.ts +107 -0
  86. package/dist/index-2jo9BSPM.js +1 -0
  87. package/dist/index-BFZ0dPh9.mjs +179 -0
  88. package/dist/index-CWSXne1Q.js +1 -0
  89. package/dist/index-CzL1ZcGi.mjs +85 -0
  90. package/dist/index-D3v7hAtc.mjs +253 -0
  91. package/dist/index-DRdBmZ2-.js +1 -0
  92. package/dist/index.cjs.js +1 -0
  93. package/dist/index.d.ts +13 -0
  94. package/dist/index.es.js +39 -0
  95. package/dist/invoices-8M_3ur_U.js +1 -0
  96. package/dist/invoices-C31Wz1Bu.mjs +84 -0
  97. package/dist/paymentMethods-CrU4G_2Y.mjs +65 -0
  98. package/dist/paymentMethods-CzUqDlvc.js +1 -0
  99. package/dist/payments-C3LPk9k9.js +1 -0
  100. package/dist/payments-NtWI8KlU.mjs +47 -0
  101. package/dist/registry-By94DXE2.js +1 -0
  102. package/dist/registry-shRKDl3K.mjs +127 -0
  103. package/dist/screens/Checkout/Checkout.ce.d.ts +3 -0
  104. package/dist/screens/Checkout/Checkout.cjs.js +1 -0
  105. package/dist/screens/Checkout/Checkout.es.js +7 -0
  106. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +3 -0
  107. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -0
  108. package/dist/screens/CustomerOverview/CustomerOverview.es.js +7 -0
  109. package/dist/solvimon-web.css +1 -0
  110. package/dist/sprite-i5T7eZnk-C55G-dBo.js +1 -0
  111. package/dist/sprite-i5T7eZnk-i5T7eZnk.mjs +4 -0
  112. package/dist/subscriptions-3R7aMoky.mjs +74 -0
  113. package/dist/subscriptions-CqK7t-fF.js +1 -0
  114. package/dist/useActionDispatchProvider-CBo_Hwu5.mjs +12 -0
  115. package/dist/useActionDispatchProvider-DsIljrhi.js +1 -0
  116. package/dist/useCustomer-BRY0tuBH.mjs +45 -0
  117. package/dist/useCustomer-Dp8sGHI0.js +1 -0
  118. package/dist/useCustomerPaymentMethodOptions-DYpMDnJR.js +1 -0
  119. package/dist/useCustomerPaymentMethodOptions-Fe_dLxfv.mjs +168 -0
  120. package/dist/useIncrementalLoading-D8oKNxX7.js +1 -0
  121. package/dist/useIncrementalLoading-fHCizCSo.mjs +69 -0
  122. package/dist/useInvoiceData-DImEH1ca.js +1 -0
  123. package/dist/useInvoiceData-dyvoDwFF.mjs +51 -0
  124. package/dist/useInvoicesList-BZQ9Y0qN.js +1 -0
  125. package/dist/useInvoicesList-rDvRzMqe.mjs +294 -0
  126. package/dist/useLoadInitialData-BRg7IWqW.js +1 -0
  127. package/dist/useLoadInitialData-Dm48tlSO.mjs +13 -0
  128. package/dist/usePaymentMethods-Bq5fWl1Q.mjs +16 -0
  129. package/dist/usePaymentMethods-Dbimodf0.js +1 -0
  130. package/dist/useService-Dz13Nxbi.mjs +272 -0
  131. package/dist/useService-bNNi4GB8.js +1 -0
  132. package/package.json +174 -0
@@ -0,0 +1,238 @@
1
+ import { defineComponent, renderSlot, unref, computed, openBlock, createBlock, withCtx, createVNode, normalizeProps, guardReactiveProps, createCommentVNode } from "vue";
2
+ import { C as getCustomerCountry, b as useIntl, k as _sfc_main$14, d as _sfc_main$1g, o as _sfc_main$4, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
3
+ import { u as useLoadInitialData } from "./useLoadInitialData-Dm48tlSO.mjs";
4
+ import { u as useCustomer } from "./useCustomer-BRY0tuBH.mjs";
5
+ import { u as useService } from "./useService-Dz13Nxbi.mjs";
6
+ import { c as createPaymentMethodsService } from "./paymentMethods-CrU4G_2Y.mjs";
7
+ import { _ as _sfc_main$3 } from "./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BCdv5DbH.mjs";
8
+ function hasCustomerId(payload) {
9
+ return payload.customerId !== void 0;
10
+ }
11
+ function usePaymentMethodOptions() {
12
+ const { getPaymentMethodOptions } = createPaymentMethodsService();
13
+ const service = (payload) => hasCustomerId(payload) ? getPaymentMethodOptions({
14
+ customerId: payload.customerId,
15
+ amount: payload.amount,
16
+ country: payload.country
17
+ }) : getPaymentMethodOptions({
18
+ subscriptionId: payload.subscriptionId,
19
+ amount: payload.amount,
20
+ country: payload.country
21
+ });
22
+ const { data, execute: get, apiStatus, error, isPending } = useService({
23
+ initialValue: [],
24
+ service
25
+ });
26
+ return { paymentMethodOptions: data, get, apiStatus, error, isPending };
27
+ }
28
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
29
+ __name: "PaymentMethodForm.entry.view",
30
+ props: {
31
+ environment: { type: String },
32
+ locale: { type: String },
33
+ dateLocale: { type: String },
34
+ messages: { type: Object },
35
+ showTimezones: { type: Boolean },
36
+ primaryColor: { type: String },
37
+ secondaryColor: { type: String },
38
+ isShadowRoot: { type: Boolean },
39
+ experimentalFeatures: { type: Array },
40
+ logLevel: { type: String },
41
+ onLog: { type: Function },
42
+ allowedPortalTypes: { type: Array },
43
+ portalObject: { type: Object },
44
+ customElementName: { type: String },
45
+ branding: { type: Object },
46
+ configuration: { type: Object },
47
+ countryCode: { type: String }
48
+ },
49
+ setup(__props) {
50
+ const props = __props;
51
+ const customer = useCustomer({ customerId: props.portalObject.customer_id });
52
+ const paymentMethodOptions = usePaymentMethodOptions();
53
+ const initialLoad = async () => {
54
+ var _a;
55
+ const customerResponse = await customer.get.execute();
56
+ const country = getCustomerCountry(customerResponse);
57
+ await paymentMethodOptions.get({
58
+ customerId: customerResponse.id,
59
+ country,
60
+ amount: (_a = props.configuration) == null ? void 0 : _a.amount
61
+ });
62
+ };
63
+ const { isLoading } = useLoadInitialData(initialLoad());
64
+ return (_ctx, _cache) => {
65
+ return renderSlot(_ctx.$slots, "default", {
66
+ customer: unref(customer).customer.value,
67
+ paymentMethodOptions: unref(paymentMethodOptions),
68
+ isLoading: unref(isLoading)
69
+ });
70
+ };
71
+ }
72
+ });
73
+ const FALLBACK_COUNTRY_CODE = "NL";
74
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
75
+ __name: "PaymentMethodForm",
76
+ props: {
77
+ customer: { type: Object },
78
+ paymentMethodOptions: { type: Array },
79
+ configuration: { type: Object },
80
+ isLoading: { type: Boolean, default: false },
81
+ countryCode: { type: String }
82
+ },
83
+ setup(__props) {
84
+ const DEFAULT_AMOUNT = {
85
+ currency: "EUR",
86
+ quantity: "0"
87
+ };
88
+ const props = __props;
89
+ const { $t } = useIntl();
90
+ const resolveConfiguration = (configuration2) => {
91
+ if ((configuration2 == null ? void 0 : configuration2.variant) === "AUTHORIZE") {
92
+ return configuration2;
93
+ }
94
+ return {
95
+ ...configuration2,
96
+ variant: "TOKENIZE"
97
+ };
98
+ };
99
+ const configuration = computed(
100
+ () => resolveConfiguration(props.configuration)
101
+ );
102
+ const countryCode = computed(() => {
103
+ let result = FALLBACK_COUNTRY_CODE;
104
+ if (props.countryCode) {
105
+ result = props.countryCode;
106
+ return result;
107
+ }
108
+ if (props.customer) {
109
+ const country = getCustomerCountry(props.customer);
110
+ if (country) {
111
+ result = country;
112
+ return result;
113
+ }
114
+ }
115
+ return FALLBACK_COUNTRY_CODE;
116
+ });
117
+ const paymentIntegrationProps = computed(() => {
118
+ if (configuration.value.variant === "AUTHORIZE") {
119
+ return {
120
+ paymentMethodOptions: props.paymentMethodOptions,
121
+ countryCode: countryCode.value,
122
+ variant: "AUTHORIZE",
123
+ amount: configuration.value.amount,
124
+ context: configuration.value.context,
125
+ invoiceId: configuration.value.invoiceId,
126
+ successRedirectUrl: configuration.value.successRedirectUrl,
127
+ selectedOption: configuration.value.selectedOption,
128
+ validateOnSubmit: configuration.value.validateOnSubmit,
129
+ forceStorePaymentMethod: configuration.value.forceStorePaymentMethod
130
+ };
131
+ }
132
+ return {
133
+ paymentMethodOptions: props.paymentMethodOptions,
134
+ customerId: props.customer.id,
135
+ countryCode: countryCode.value,
136
+ variant: "TOKENIZE",
137
+ amount: configuration.value.amount ?? DEFAULT_AMOUNT,
138
+ invoiceId: configuration.value.invoiceId,
139
+ successRedirectUrl: configuration.value.successRedirectUrl,
140
+ selectedOption: configuration.value.selectedOption,
141
+ validateOnSubmit: configuration.value.validateOnSubmit,
142
+ forceStorePaymentMethod: configuration.value.forceStorePaymentMethod
143
+ };
144
+ });
145
+ return (_ctx, _cache) => {
146
+ return __props.isLoading ? (openBlock(), createBlock(unref(_sfc_main$14), {
147
+ key: 0,
148
+ variant: "section",
149
+ class: "min-h-[180px]"
150
+ })) : (openBlock(), createBlock(unref(_sfc_main$1g), {
151
+ key: 1,
152
+ "no-border": "",
153
+ "no-spacing": "",
154
+ "content-background": "none",
155
+ title: unref($t)({
156
+ defaultMessage: "Available payment methods",
157
+ description: "Title of the available payment methods form",
158
+ id: "components.payment_method_form.section_title"
159
+ })
160
+ }, {
161
+ default: withCtx(() => [
162
+ createVNode(_sfc_main$3, normalizeProps(guardReactiveProps(paymentIntegrationProps.value)), null, 16)
163
+ ]),
164
+ _: 1
165
+ }, 8, ["title"]));
166
+ };
167
+ }
168
+ });
169
+ const _sfc_main = /* @__PURE__ */ defineComponent({
170
+ __name: "PaymentMethodForm.entry",
171
+ props: {
172
+ environment: { type: String },
173
+ locale: { type: String },
174
+ dateLocale: { type: String },
175
+ messages: { type: Object },
176
+ showTimezones: { type: Boolean },
177
+ primaryColor: { type: String },
178
+ secondaryColor: { type: String },
179
+ isShadowRoot: { type: Boolean },
180
+ experimentalFeatures: { type: Array },
181
+ logLevel: { type: String },
182
+ onLog: { type: Function },
183
+ allowedPortalTypes: { type: Array },
184
+ portalObject: { type: Object },
185
+ customElementName: { type: String },
186
+ branding: { type: Object },
187
+ configuration: { type: Object },
188
+ countryCode: { type: String }
189
+ },
190
+ setup(__props) {
191
+ const props = __props;
192
+ return (_ctx, _cache) => {
193
+ var _a, _b, _c, _d;
194
+ return openBlock(), createBlock(unref(_sfc_main$4), {
195
+ "custom-element-name": unref(COMPONENT_NAME),
196
+ environment: __props.environment,
197
+ locale: __props.locale,
198
+ "portal-object": __props.portalObject,
199
+ "allowed-portal-types": ["CUSTOMER"],
200
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
201
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
202
+ "experimental-features": __props.experimentalFeatures,
203
+ "log-level": __props.logLevel,
204
+ "on-log": __props.onLog,
205
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
206
+ }, {
207
+ default: withCtx(() => [
208
+ createVNode(_sfc_main$2, normalizeProps(guardReactiveProps(props)), {
209
+ default: withCtx(({ customer, paymentMethodOptions, isLoading }) => [
210
+ customer ? (openBlock(), createBlock(_sfc_main$1, {
211
+ key: 0,
212
+ customer,
213
+ "payment-method-options": paymentMethodOptions.paymentMethodOptions.value,
214
+ configuration: __props.configuration,
215
+ "is-loading": isLoading
216
+ }, null, 8, ["customer", "payment-method-options", "configuration", "is-loading"])) : createCommentVNode("", true)
217
+ ]),
218
+ _: 1
219
+ }, 16)
220
+ ]),
221
+ _: 1
222
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
223
+ };
224
+ }
225
+ });
226
+ const SolvimonPaymentMethodForm = defineCustomElement(_sfc_main);
227
+ const COMPONENT_NAME = getComponentName("payment-method-form");
228
+ const defineSolvimonPaymentMethodForm = () => {
229
+ if (!customElements.get(COMPONENT_NAME)) {
230
+ customElements.define(COMPONENT_NAME, SolvimonPaymentMethodForm);
231
+ }
232
+ };
233
+ export {
234
+ COMPONENT_NAME as C,
235
+ SolvimonPaymentMethodForm as S,
236
+ _sfc_main as _,
237
+ defineSolvimonPaymentMethodForm as d
238
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./component-Df5eNqYX.js"),o=require("./useLoadInitialData-BRg7IWqW.js"),n=require("./useCustomer-Dp8sGHI0.js"),r=require("./useService-bNNi4GB8.js"),a=require("./paymentMethods-CzUqDlvc.js"),i=require("./PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-xJ8kJbRo.js");const u=e.defineComponent({__name:"PaymentMethodForm.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},countryCode:{type:String}},setup(i){const u=i,c=n.useCustomer({customerId:u.portalObject.customer_id}),s=function(){const{getPaymentMethodOptions:e}=a.createPaymentMethodsService(),{data:t,execute:o,apiStatus:n,error:i,isPending:u}=r.useService({initialValue:[],service:t=>function(e){return void 0!==e.customerId}(t)?e({customerId:t.customerId,amount:t.amount,country:t.country}):e({subscriptionId:t.subscriptionId,amount:t.amount,country:t.country})});return{paymentMethodOptions:t,get:o,apiStatus:n,error:i,isPending:u}}(),{isLoading:l}=o.useLoadInitialData((async()=>{var e;const o=await c.get.execute(),n=t.getCustomerCountry(o);await s.get({customerId:o.id,country:n,amount:null==(e=u.configuration)?void 0:e.amount})})());return(t,o)=>e.renderSlot(t.$slots,"default",{customer:e.unref(c).customer.value,paymentMethodOptions:e.unref(s),isLoading:e.unref(l)})}}),c=e.defineComponent({__name:"PaymentMethodForm",props:{customer:{type:Object},paymentMethodOptions:{type:Array},configuration:{type:Object},isLoading:{type:Boolean,default:!1},countryCode:{type:String}},setup(o){const n={currency:"EUR",quantity:"0"},r=o,{$t:a}=t.useIntl(),u=e.computed(()=>{return"AUTHORIZE"===(null==(e=r.configuration)?void 0:e.variant)?e:{...e,variant:"TOKENIZE"};var e}),c=e.computed(()=>{let e="NL";if(r.countryCode)return e=r.countryCode,e;if(r.customer){const o=t.getCustomerCountry(r.customer);if(o)return e=o,e}return"NL"}),s=e.computed(()=>"AUTHORIZE"===u.value.variant?{paymentMethodOptions:r.paymentMethodOptions,countryCode:c.value,variant:"AUTHORIZE",amount:u.value.amount,context:u.value.context,invoiceId:u.value.invoiceId,successRedirectUrl:u.value.successRedirectUrl,selectedOption:u.value.selectedOption,validateOnSubmit:u.value.validateOnSubmit,forceStorePaymentMethod:u.value.forceStorePaymentMethod}:{paymentMethodOptions:r.paymentMethodOptions,customerId:r.customer.id,countryCode:c.value,variant:"TOKENIZE",amount:u.value.amount??n,invoiceId:u.value.invoiceId,successRedirectUrl:u.value.successRedirectUrl,selectedOption:u.value.selectedOption,validateOnSubmit:u.value.validateOnSubmit,forceStorePaymentMethod:u.value.forceStorePaymentMethod});return(n,r)=>o.isLoading?(e.openBlock(),e.createBlock(e.unref(t._sfc_main$14),{key:0,variant:"section",class:"min-h-[180px]"})):(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{key:1,"no-border":"","no-spacing":"","content-background":"none",title:e.unref(a)({defaultMessage:"Available payment methods",description:"Title of the available payment methods form",id:"components.payment_method_form.section_title"})},{default:e.withCtx(()=>[e.createVNode(i._sfc_main,e.normalizeProps(e.guardReactiveProps(s.value)),null,16)]),_:1},8,["title"]))}}),s=e.defineComponent({__name:"PaymentMethodForm.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},countryCode:{type:String}},setup(o){const n=o;return(r,a)=>{var i,s,l,p;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(m),environment:o.environment,locale:o.locale,"portal-object":o.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(i=o.branding)?void 0:i.colors)?void 0:s.primary,"secondary-color":null==(p=null==(l=o.branding)?void 0:l.colors)?void 0:p.secondary,"experimental-features":o.experimentalFeatures,"log-level":o.logLevel,"on-log":o.onLog,onError:a[0]||(a[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(u,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(({customer:t,paymentMethodOptions:n,isLoading:r})=>[t?(e.openBlock(),e.createBlock(c,{key:0,customer:t,"payment-method-options":n.paymentMethodOptions.value,configuration:o.configuration,"is-loading":r},null,8,["customer","payment-method-options","configuration","is-loading"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),l=t.defineCustomElement(s),m=t.getComponentName("payment-method-form");exports.COMPONENT_NAME=m,exports.SolvimonPaymentMethodForm=l,exports._sfc_main=s,exports.defineSolvimonPaymentMethodForm=()=>{customElements.get(m)||customElements.define(m,l)};
@@ -0,0 +1,62 @@
1
+ import { defineComponent, useSlots, computed, renderSlot, openBlock, createElementBlock, Fragment, mergeProps, normalizeProps, createElementVNode, normalizeClass, Comment, Text } from "vue";
2
+ const _sfc_main = /* @__PURE__ */ defineComponent({
3
+ __name: "Skeleton",
4
+ props: {
5
+ variant: { type: String },
6
+ class: { type: String }
7
+ },
8
+ setup(__props) {
9
+ const slots = useSlots();
10
+ const isVnodeEmpty = (node) => {
11
+ if (node == null || node === false) return true;
12
+ if (typeof node === "string" || typeof node === "number") {
13
+ return String(node).trim().length === 0;
14
+ }
15
+ if (Array.isArray(node)) {
16
+ return node.every(isVnodeEmpty);
17
+ }
18
+ const vnode = node;
19
+ if (vnode.type === Comment) {
20
+ return true;
21
+ }
22
+ if (vnode.type === Text) {
23
+ if (typeof vnode.children === "string") {
24
+ return !vnode.children.trim();
25
+ }
26
+ return true;
27
+ }
28
+ if (vnode.type === Fragment) {
29
+ if (vnode.children == null) return true;
30
+ if (Array.isArray(vnode.children)) {
31
+ return vnode.children.every(isVnodeEmpty);
32
+ }
33
+ return false;
34
+ }
35
+ return false;
36
+ };
37
+ const hasSlotContent = computed(() => {
38
+ if (!slots.default) return false;
39
+ const vnodes = slots.default({});
40
+ if (!vnodes || vnodes.length === 0) return false;
41
+ return !vnodes.every(isVnodeEmpty);
42
+ });
43
+ return (_ctx, _cache) => {
44
+ return hasSlotContent.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
45
+ __props.variant === "title" ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, _ctx.$attrs, { class: "rounded border border-gray-50 bg-gray-50/50 h-6 w-40" }), null, 16)) : __props.variant === "divider-text" ? (openBlock(), createElementBlock("div", mergeProps({ key: 1 }, _ctx.$attrs, { class: "rounded border border-gray-50 bg-gray-50/50 h-4 w-12 mx-auto" }), null, 16)) : __props.variant === "section" ? (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 2 }, _ctx.$attrs)), [
46
+ _cache[0] || (_cache[0] = createElementVNode("div", { class: "rounded border border-gray-50 bg-gray-50/50 h-6 w-40" }, null, -1)),
47
+ createElementVNode("div", {
48
+ class: normalizeClass([
49
+ "rounded border border-gray-50 bg-gray-50/50 mt-1 md:mt-2",
50
+ _ctx.$props.class
51
+ ])
52
+ }, null, 2)
53
+ ], 16)) : (openBlock(), createElementBlock("div", mergeProps({ key: 3 }, _ctx.$attrs, {
54
+ class: ["rounded border border-gray-50 bg-gray-50/50", _ctx.$props.class]
55
+ }), null, 16))
56
+ ], 64));
57
+ };
58
+ }
59
+ });
60
+ export {
61
+ _sfc_main as _
62
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),r=e.defineComponent({__name:"Skeleton",props:{variant:{type:String},class:{type:String}},setup(r){const t=e.useSlots(),n=r=>{if(null==r||!1===r)return!0;if("string"==typeof r||"number"==typeof r)return 0===String(r).trim().length;if(Array.isArray(r))return r.every(n);const t=r;return t.type===e.Comment||(t.type===e.Text?"string"!=typeof t.children||!t.children.trim():t.type===e.Fragment&&(null==t.children||!!Array.isArray(t.children)&&t.children.every(n)))},o=e.computed(()=>{if(!t.default)return!1;const e=t.default({});return!(!e||0===e.length)&&!e.every(n)});return(t,n)=>o.value?e.renderSlot(t.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["title"===r.variant?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0},t.$attrs,{class:"rounded border border-gray-50 bg-gray-50/50 h-6 w-40"}),null,16)):"divider-text"===r.variant?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1},t.$attrs,{class:"rounded border border-gray-50 bg-gray-50/50 h-4 w-12 mx-auto"}),null,16)):"section"===r.variant?(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.mergeProps({key:2},t.$attrs)),[n[0]||(n[0]=e.createElementVNode("div",{class:"rounded border border-gray-50 bg-gray-50/50 h-6 w-40"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["rounded border border-gray-50 bg-gray-50/50 mt-1 md:mt-2",t.$props.class])},null,2)],16)):(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:3},t.$attrs,{class:["rounded border border-gray-50 bg-gray-50/50",t.$props.class]}),null,16))],64))}});exports._sfc_main=r;
@@ -0,0 +1 @@
1
+ const e=require("vue"),t=require("./component-Df5eNqYX.js"),n=require("./useService-bNNi4GB8.js"),o=require("./subscriptions-CqK7t-fF.js"),r=require("./useLoadInitialData-BRg7IWqW.js"),i=e.defineComponent({__name:"SubscriptionSchedules",props:{schedulesData:{type:Array},configuration:{type:Object},isLoading:{type:Boolean}},setup(n){const{$t:o}=t.useIntl();return(r,i)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-border":"",spacing:"none","content-background":"none",title:e.unref(o)({defaultMessage:"Schedules",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$E),{schedules:n.schedulesData},null,8,["schedules"])]),_:1},8,["title"]))}});const s=e.defineComponent({__name:"SubscriptionSchedules.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(t){const i=t,{subscription:s,withPlanData:a,get:l}=function({subscriptionId:e}){const{getSubscription:t}=o.createSubscriptionsService(),{data:r,execute:i,apiStatus:s,error:a,isPending:l}=n.useService({service:()=>t({id:e,expanded:!0})});return{subscription:r,withPlanData:e=>e.pricing_plan_schedule_infos.map(e=>({schedule:e.pricing_plan_schedule,selectedPricingPlan:e.pricing_plan_version.pricing_plan,selectedPricingPlanVersion:e.pricing_plan_version})),apiStatus:s,error:a,get:i,isPending:l}}({subscriptionId:i.configuration.subscriptionId}),{isLoading:c}=r.useLoadInitialData(l());return(t,n)=>e.renderSlot(t.$slots,"default",{schedulesData:e.unref(s)?e.unref(a)(e.unref(s)):void 0,isLoading:e.unref(c)})}}),a=e.defineComponent({__name:"SubscriptionSchedules.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(n){const o=n;return(r,a)=>{var l,p,u,d;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(c),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(l=n.branding)?void 0:l.colors)?void 0:p.primary,"secondary-color":null==(d=null==(u=n.branding)?void 0:u.colors)?void 0:d.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:a[0]||(a[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(s,e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(({schedulesData:t,isLoading:o})=>[t?(e.openBlock(),e.createBlock(i,{key:0,"schedules-data":t,"is-loading":o,configuration:n.configuration},null,8,["schedules-data","is-loading","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"])}}}),l=t.defineCustomElement(a),c=t.getComponentName("subscription-schedules");exports.COMPONENT_NAME=c,exports.SolvimonSubscriptionSchedules=l,exports._sfc_main=a,exports.defineSolvimonSubscriptionSchedules=()=>{customElements.get(c)||customElements.define(c,l)};
@@ -0,0 +1,153 @@
1
+ import { defineComponent, openBlock, createBlock, unref, withCtx, createVNode, renderSlot, normalizeProps, guardReactiveProps, createCommentVNode } from "vue";
2
+ import { b as useIntl, d as _sfc_main$1g, B as _sfc_main$E, o as _sfc_main$3, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
3
+ import { u as useService } from "./useService-Dz13Nxbi.mjs";
4
+ import { c as createSubscriptionsService } from "./subscriptions-3R7aMoky.mjs";
5
+ import { u as useLoadInitialData } from "./useLoadInitialData-Dm48tlSO.mjs";
6
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7
+ __name: "SubscriptionSchedules",
8
+ props: {
9
+ schedulesData: { type: Array },
10
+ configuration: { type: Object },
11
+ isLoading: { type: Boolean }
12
+ },
13
+ setup(__props) {
14
+ const { $t } = useIntl();
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createBlock(unref(_sfc_main$1g), {
17
+ "no-border": "",
18
+ spacing: "none",
19
+ "content-background": "none",
20
+ title: unref($t)({
21
+ defaultMessage: "Schedules",
22
+ description: "Invoices list title",
23
+ id: "invoices_list.title"
24
+ })
25
+ }, {
26
+ default: withCtx(() => [
27
+ createVNode(unref(_sfc_main$E), { schedules: __props.schedulesData }, null, 8, ["schedules"])
28
+ ]),
29
+ _: 1
30
+ }, 8, ["title"]);
31
+ };
32
+ }
33
+ });
34
+ function useSubscription({
35
+ subscriptionId
36
+ }) {
37
+ const { getSubscription } = createSubscriptionsService();
38
+ const { data, execute: get, apiStatus, error, isPending } = useService({
39
+ service: () => getSubscription({ id: subscriptionId, expanded: true })
40
+ });
41
+ const withPlanData = (subscription) => {
42
+ return subscription.pricing_plan_schedule_infos.map((schedule) => {
43
+ return {
44
+ schedule: schedule.pricing_plan_schedule,
45
+ selectedPricingPlan: schedule.pricing_plan_version.pricing_plan,
46
+ selectedPricingPlanVersion: schedule.pricing_plan_version
47
+ };
48
+ });
49
+ };
50
+ return { subscription: data, withPlanData, apiStatus, error, get, isPending };
51
+ }
52
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
53
+ __name: "SubscriptionSchedules.entry.view",
54
+ props: {
55
+ environment: { type: String },
56
+ locale: { type: String },
57
+ dateLocale: { type: String },
58
+ messages: { type: Object },
59
+ showTimezones: { type: Boolean },
60
+ primaryColor: { type: String },
61
+ secondaryColor: { type: String },
62
+ isShadowRoot: { type: Boolean },
63
+ experimentalFeatures: { type: Array },
64
+ logLevel: { type: String },
65
+ onLog: { type: Function },
66
+ allowedPortalTypes: { type: Array },
67
+ portalObject: { type: Object },
68
+ customElementName: { type: String },
69
+ branding: { type: Object },
70
+ configuration: { type: Object }
71
+ },
72
+ setup(__props) {
73
+ const props = __props;
74
+ const { subscription, withPlanData, get } = useSubscription({
75
+ subscriptionId: props.configuration.subscriptionId
76
+ });
77
+ const { isLoading } = useLoadInitialData(get());
78
+ return (_ctx, _cache) => {
79
+ return renderSlot(_ctx.$slots, "default", {
80
+ schedulesData: unref(subscription) ? unref(withPlanData)(unref(subscription)) : void 0,
81
+ isLoading: unref(isLoading)
82
+ });
83
+ };
84
+ }
85
+ });
86
+ const _sfc_main = /* @__PURE__ */ defineComponent({
87
+ __name: "SubscriptionSchedules.entry",
88
+ props: {
89
+ environment: { type: String },
90
+ locale: { type: String },
91
+ dateLocale: { type: String },
92
+ messages: { type: Object },
93
+ showTimezones: { type: Boolean },
94
+ primaryColor: { type: String },
95
+ secondaryColor: { type: String },
96
+ isShadowRoot: { type: Boolean },
97
+ experimentalFeatures: { type: Array },
98
+ logLevel: { type: String },
99
+ onLog: { type: Function },
100
+ allowedPortalTypes: { type: Array },
101
+ portalObject: { type: Object },
102
+ customElementName: { type: String },
103
+ branding: { type: Object },
104
+ configuration: { type: Object }
105
+ },
106
+ setup(__props) {
107
+ const props = __props;
108
+ return (_ctx, _cache) => {
109
+ var _a, _b, _c, _d;
110
+ return openBlock(), createBlock(unref(_sfc_main$3), {
111
+ "custom-element-name": unref(COMPONENT_NAME),
112
+ environment: __props.environment,
113
+ locale: __props.locale,
114
+ "portal-object": __props.portalObject,
115
+ "allowed-portal-types": ["CUSTOMER"],
116
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
117
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
118
+ "experimental-features": __props.experimentalFeatures,
119
+ "log-level": __props.logLevel,
120
+ "on-log": __props.onLog,
121
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
122
+ }, {
123
+ default: withCtx(() => [
124
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(props)), {
125
+ default: withCtx(({ schedulesData, isLoading }) => [
126
+ schedulesData ? (openBlock(), createBlock(_sfc_main$2, {
127
+ key: 0,
128
+ "schedules-data": schedulesData,
129
+ "is-loading": isLoading,
130
+ configuration: __props.configuration
131
+ }, null, 8, ["schedules-data", "is-loading", "configuration"])) : createCommentVNode("", true)
132
+ ]),
133
+ _: 1
134
+ }, 16)
135
+ ]),
136
+ _: 1
137
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
138
+ };
139
+ }
140
+ });
141
+ const SolvimonSubscriptionSchedules = defineCustomElement(_sfc_main);
142
+ const COMPONENT_NAME = getComponentName("subscription-schedules");
143
+ const defineSolvimonSubscriptionSchedules = () => {
144
+ if (!customElements.get(COMPONENT_NAME)) {
145
+ customElements.define(COMPONENT_NAME, SolvimonSubscriptionSchedules);
146
+ }
147
+ };
148
+ export {
149
+ COMPONENT_NAME as C,
150
+ SolvimonSubscriptionSchedules as S,
151
+ _sfc_main as _,
152
+ defineSolvimonSubscriptionSchedules as d
153
+ };
@@ -0,0 +1 @@
1
+ const e=require("vue"),o=require("./SubscriptionsList.vue_vue_type_script_setup_true_lang-DqZLFDCv.js"),t=require("./component-Df5eNqYX.js"),r=require("./useCustomer-Dp8sGHI0.js"),n=require("./useLoadInitialData-BRg7IWqW.js"),l=require("./usePaymentMethods-Dbimodf0.js"),i=e.defineComponent({__name:"SubscriptionsList.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(i){const a=i.portalObject.customer_id,s=r.useCustomer({customerId:a}),p=o.useSubscriptionsList({customerId:a}),u=l.usePaymentMethods({customerId:a}),{isLoading:m}=n.useLoadInitialData(s.get.execute(),p.fetchInitial(),u.fetchAll());return(o,r)=>{var n,l,a,y;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(c),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(l=null==(n=i.branding)?void 0:n.colors)?void 0:l.primary,"secondary-color":null==(y=null==(a=i.branding)?void 0:a.colors)?void 0:y.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,onError:r[0]||(r[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{customer:e.unref(s),subscriptions:e.unref(p).items,paymentMethods:e.unref(u).items,isLoading:e.unref(m),loadMore:e.unref(p).fetchMore})]),_:3},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),a=e.defineComponent({__name:"SubscriptionsList.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:r=>(n,l)=>{var a,s,p,u;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(c),environment:r.environment,locale:r.locale,"portal-object":r.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(s=null==(a=r.branding)?void 0:a.colors)?void 0:s.primary,"secondary-color":null==(u=null==(p=r.branding)?void 0:p.colors)?void 0:u.secondary,"experimental-features":r.experimentalFeatures,"log-level":r.logLevel,"on-log":r.onLog,onError:l[0]||(l[0]=e=>n.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(i,e.normalizeProps(e.guardReactiveProps(n.$props)),{default:e.withCtx(({customer:t,subscriptions:n,paymentMethods:l,isLoading:i,loadMore:a})=>[e.createVNode(o._sfc_main,{configuration:r.configuration,customer:t.customer.value,subscriptions:n.value,"payment-methods":l.value,"is-loading":i,onLoadMore:a},null,8,["configuration","customer","subscriptions","payment-methods","is-loading","onLoadMore"])]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}),s=t.defineCustomElement(a),c=t.getComponentName("subscriptions-list");exports.COMPONENT_NAME=c,exports.SolvimonSubscriptionsList=s,exports._sfc_main=a,exports.defineSolvimonSubscriptionsList=()=>{customElements.get(c)||customElements.define(c,s)};
@@ -0,0 +1,135 @@
1
+ import { defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, normalizeProps, guardReactiveProps } from "vue";
2
+ import { u as useSubscriptionsList, _ as _sfc_main$3 } from "./SubscriptionsList.vue_vue_type_script_setup_true_lang-DfB5BqiH.mjs";
3
+ import { o as _sfc_main$2, p as defineCustomElement, n as getComponentName } from "./component-BkmcE85U.mjs";
4
+ import { u as useCustomer } from "./useCustomer-BRY0tuBH.mjs";
5
+ import { u as useLoadInitialData } from "./useLoadInitialData-Dm48tlSO.mjs";
6
+ import { u as usePaymentMethods } from "./usePaymentMethods-Bq5fWl1Q.mjs";
7
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
8
+ __name: "SubscriptionsList.entry.view",
9
+ props: {
10
+ environment: { type: String },
11
+ locale: { type: String },
12
+ dateLocale: { type: String },
13
+ messages: { type: Object },
14
+ showTimezones: { type: Boolean },
15
+ primaryColor: { type: String },
16
+ secondaryColor: { type: String },
17
+ isShadowRoot: { type: Boolean },
18
+ experimentalFeatures: { type: Array },
19
+ logLevel: { type: String },
20
+ onLog: { type: Function },
21
+ allowedPortalTypes: { type: Array },
22
+ portalObject: { type: Object },
23
+ customElementName: { type: String },
24
+ branding: { type: Object },
25
+ configuration: { type: Object }
26
+ },
27
+ setup(__props) {
28
+ const props = __props;
29
+ const customerId = props.portalObject.customer_id;
30
+ const customer = useCustomer({ customerId });
31
+ const subscriptions = useSubscriptionsList({ customerId });
32
+ const paymentMethods = usePaymentMethods({ customerId });
33
+ const { isLoading } = useLoadInitialData(
34
+ customer.get.execute(),
35
+ subscriptions.fetchInitial(),
36
+ paymentMethods.fetchAll()
37
+ );
38
+ return (_ctx, _cache) => {
39
+ var _a, _b, _c, _d;
40
+ return openBlock(), createBlock(unref(_sfc_main$2), {
41
+ "custom-element-name": unref(COMPONENT_NAME),
42
+ environment: __props.environment,
43
+ locale: __props.locale,
44
+ "portal-object": __props.portalObject,
45
+ "allowed-portal-types": ["CUSTOMER"],
46
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
47
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
48
+ "experimental-features": __props.experimentalFeatures,
49
+ "log-level": __props.logLevel,
50
+ "on-log": __props.onLog,
51
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
52
+ }, {
53
+ default: withCtx(() => [
54
+ renderSlot(_ctx.$slots, "default", {
55
+ customer: unref(customer),
56
+ subscriptions: unref(subscriptions).items,
57
+ paymentMethods: unref(paymentMethods).items,
58
+ isLoading: unref(isLoading),
59
+ loadMore: unref(subscriptions).fetchMore
60
+ })
61
+ ]),
62
+ _: 3
63
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
64
+ };
65
+ }
66
+ });
67
+ const _sfc_main = /* @__PURE__ */ defineComponent({
68
+ __name: "SubscriptionsList.entry",
69
+ props: {
70
+ environment: { type: String },
71
+ locale: { type: String },
72
+ dateLocale: { type: String },
73
+ messages: { type: Object },
74
+ showTimezones: { type: Boolean },
75
+ primaryColor: { type: String },
76
+ secondaryColor: { type: String },
77
+ isShadowRoot: { type: Boolean },
78
+ experimentalFeatures: { type: Array },
79
+ logLevel: { type: String },
80
+ onLog: { type: Function },
81
+ allowedPortalTypes: { type: Array },
82
+ portalObject: { type: Object },
83
+ customElementName: { type: String },
84
+ branding: { type: Object },
85
+ configuration: { type: Object }
86
+ },
87
+ setup(__props) {
88
+ return (_ctx, _cache) => {
89
+ var _a, _b, _c, _d;
90
+ return openBlock(), createBlock(unref(_sfc_main$2), {
91
+ "custom-element-name": unref(COMPONENT_NAME),
92
+ environment: __props.environment,
93
+ locale: __props.locale,
94
+ "portal-object": __props.portalObject,
95
+ "allowed-portal-types": ["CUSTOMER"],
96
+ "primary-color": (_b = (_a = __props.branding) == null ? void 0 : _a.colors) == null ? void 0 : _b.primary,
97
+ "secondary-color": (_d = (_c = __props.branding) == null ? void 0 : _c.colors) == null ? void 0 : _d.secondary,
98
+ "experimental-features": __props.experimentalFeatures,
99
+ "log-level": __props.logLevel,
100
+ "on-log": __props.onLog,
101
+ onError: _cache[0] || (_cache[0] = (error) => _ctx.$emit("error", error))
102
+ }, {
103
+ default: withCtx(() => [
104
+ createVNode(_sfc_main$1, normalizeProps(guardReactiveProps(_ctx.$props)), {
105
+ default: withCtx(({ customer, subscriptions, paymentMethods, isLoading, loadMore }) => [
106
+ createVNode(_sfc_main$3, {
107
+ configuration: __props.configuration,
108
+ customer: customer.customer.value,
109
+ subscriptions: subscriptions.value,
110
+ "payment-methods": paymentMethods.value,
111
+ "is-loading": isLoading,
112
+ onLoadMore: loadMore
113
+ }, null, 8, ["configuration", "customer", "subscriptions", "payment-methods", "is-loading", "onLoadMore"])
114
+ ]),
115
+ _: 1
116
+ }, 16)
117
+ ]),
118
+ _: 1
119
+ }, 8, ["custom-element-name", "environment", "locale", "portal-object", "primary-color", "secondary-color", "experimental-features", "log-level", "on-log"]);
120
+ };
121
+ }
122
+ });
123
+ const SolvimonSubscriptionsList = defineCustomElement(_sfc_main);
124
+ const COMPONENT_NAME = getComponentName("subscriptions-list");
125
+ const defineSolvimonSubscriptionsList = () => {
126
+ if (!customElements.get(COMPONENT_NAME)) {
127
+ customElements.define(COMPONENT_NAME, SolvimonSubscriptionsList);
128
+ }
129
+ };
130
+ export {
131
+ COMPONENT_NAME as C,
132
+ SolvimonSubscriptionsList as S,
133
+ _sfc_main as _,
134
+ defineSolvimonSubscriptionsList as d
135
+ };