@justifi/webcomponents 4.19.1-rc-5 → 4.19.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.
- package/dist/cjs/{Analytics-8949ea18.js → Analytics-f870b3ee.js} +3 -2
- package/dist/cjs/{business-additional-questions-schema-cf545610.js → business-additional-questions-schema-11ce0005.js} +1 -1
- package/dist/cjs/{business-form-options-582467fe.js → business-form-options-26f9900c.js} +1 -1
- package/dist/cjs/{business.service-6bb7ac82.js → business.service-f63650f5.js} +6 -5
- package/dist/cjs/config-ff2dda66.js +15 -0
- package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
- package/dist/cjs/form-control-checkbox_9.cjs.entry.js +4 -4
- package/dist/cjs/{get-payout-csv-1391ff3e.js → get-payout-csv-f3aee6d0.js} +4 -3
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +10 -9
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +9 -8
- package/dist/cjs/justifi-card-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +5 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -3
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +9 -11
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -4
- package/dist/cjs/{package-a3cbc925.js → package-1321b070.js} +4 -2
- package/dist/cjs/{payload-parsers-1cbc3b57.js → payload-parsers-969ab9b6.js} +1 -1
- package/dist/cjs/{payment.service-dfcfa19b.js → payment.service-0a64f9cd.js} +3 -2
- package/dist/cjs/{schema-validations-2733de42.js → schema-validations-f3db892c.js} +1 -1
- package/dist/collection/api/services/analytics.service.js +2 -1
- package/dist/collection/api/services/business.service.js +6 -5
- package/dist/collection/api/services/checkout.service.js +3 -2
- package/dist/collection/api/services/insurance.service.js +3 -2
- package/dist/collection/api/services/payment.service.js +3 -2
- package/dist/collection/api/services/payout.service.js +4 -3
- package/dist/collection/api/services/provision.service.js +4 -2
- package/dist/collection/api/services/reports.service.js +2 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js +4 -3
- package/dist/collection/components/business-forms/business-form/business-form.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +3 -2
- package/dist/collection/components/business-forms/utils/business-form-options.js +1 -1
- package/dist/collection/components/card-form/card-form.js +4 -3
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/checkout/new-payment-method.js +4 -6
- package/dist/collection/components/checkout/payment-method-options.js +4 -3
- package/dist/collection/components/checkout/saved-payment-method.js +4 -3
- package/dist/collection/components/checkout/sezzle-payment-method.js +4 -3
- package/dist/collection/components/payment-form/payment-form.js +4 -3
- package/dist/collection/components/refund-form/refund-form.js +3 -2
- package/dist/config.js +11 -0
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-38d3bafb.js → Analytics-262cdde5.js} +3 -2
- package/dist/esm/{business-additional-questions-schema-956e3caf.js → business-additional-questions-schema-e39bc781.js} +1 -1
- package/dist/esm/{business-form-options-7a9a74fc.js → business-form-options-0b08e08c.js} +1 -1
- package/dist/esm/{business.service-f45decfc.js → business.service-74bd1212.js} +6 -5
- package/dist/esm/config-476c7241.js +13 -0
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox_9.entry.js +4 -4
- package/dist/esm/{get-payout-csv-e784a2ab.js → get-payout-csv-b494abfe.js} +4 -3
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +10 -9
- package/dist/esm/justifi-bank-account-form.entry.js +5 -4
- package/dist/esm/justifi-billing-form_2.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +4 -3
- package/dist/esm/justifi-business-form.entry.js +9 -8
- package/dist/esm/justifi-card-form.entry.js +5 -4
- package/dist/esm/justifi-checkout-core.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +5 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -3
- package/dist/esm/justifi-new-payment-method_4.entry.js +9 -11
- package/dist/esm/justifi-owner-form_3.entry.js +5 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -3
- package/dist/esm/justifi-payment-form.entry.js +6 -5
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +6 -5
- package/dist/esm/justifi-payments-list.entry.js +4 -3
- package/dist/esm/justifi-payout-details.entry.js +4 -3
- package/dist/esm/justifi-payouts-list.entry.js +4 -3
- package/dist/esm/justifi-refund-form.entry.js +3 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -4
- package/dist/esm/{package-89734008.js → package-d88677e9.js} +4 -2
- package/dist/esm/{payload-parsers-acb719d1.js → payload-parsers-62f443e1.js} +1 -1
- package/dist/esm/{payment.service-dad5153b.js → payment.service-3ca4a492.js} +3 -2
- package/dist/esm/{schema-validations-a83ff220.js → schema-validations-2f4fdebb.js} +1 -1
- package/dist/module/Analytics.js +2 -1
- package/dist/module/business-bank-account-form-step.js +3 -2
- package/dist/module/business-document-upload-form-step.js +3 -2
- package/dist/module/business-form-options.js +1 -1
- package/dist/module/business-terms-conditions-form-step.js +3 -2
- package/dist/module/business.service.js +6 -5
- package/dist/module/checkout-core.js +3 -3
- package/dist/module/config.js +13 -0
- package/dist/module/get-payout-csv.js +4 -3
- package/dist/module/justifi-bank-account-form.js +3 -2
- package/dist/module/justifi-business-form.js +3 -2
- package/dist/module/justifi-card-form.js +3 -2
- package/dist/module/justifi-checkout.js +3 -2
- package/dist/module/justifi-gross-payment-chart.js +2 -1
- package/dist/module/justifi-payment-form.js +4 -3
- package/dist/module/justifi-payment-provisioning.js +3 -2
- package/dist/module/justifi-refund-form.js +3 -2
- package/dist/module/justifi-season-interruption-insurance.js +3 -2
- package/dist/module/new-payment-method.js +3 -5
- package/dist/module/package.js +4 -2
- package/dist/module/payment-method-options.js +3 -2
- package/dist/module/payment.service.js +3 -2
- package/dist/module/saved-payment-method.js +3 -2
- package/dist/module/sezzle-payment-method.js +3 -2
- package/dist/types/components/checkout/new-payment-method.d.ts +0 -1
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +11 -0
- package/dist/webcomponents/index.esm.js +0 -1
- package/dist/webcomponents/p-04a0dbb6.js +1 -0
- package/dist/webcomponents/p-061dcb79.entry.js +1 -0
- package/dist/webcomponents/p-07109641.entry.js +1 -0
- package/dist/webcomponents/p-08b0fb31.js +1 -41
- package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
- package/dist/webcomponents/p-14c91ffd.js +1 -20
- package/dist/webcomponents/p-198994c0.entry.js +1 -0
- package/dist/webcomponents/p-1a43e355.entry.js +19 -0
- package/dist/webcomponents/p-1ad5995e.js +1 -3599
- package/dist/webcomponents/p-1f70fa27.entry.js +1 -0
- package/dist/webcomponents/p-1ff8810b.js +1 -29
- package/dist/webcomponents/p-2338affa.js +1 -213
- package/dist/webcomponents/p-241b0ed9.js +1 -0
- package/dist/webcomponents/p-2799383d.entry.js +1 -0
- package/dist/webcomponents/p-29c0b182.js +1 -114
- package/dist/webcomponents/p-2b6c9c4f.js +1 -7
- package/dist/webcomponents/p-2eab3c90.js +1 -3052
- package/dist/webcomponents/p-3affadfc.entry.js +1 -0
- package/dist/webcomponents/p-3d4d566d.entry.js +1 -0
- package/dist/webcomponents/p-3dd4c6c3.entry.js +1 -0
- package/dist/webcomponents/p-462dc522.entry.js +1 -0
- package/dist/webcomponents/p-46f679a9.js +1 -0
- package/dist/webcomponents/p-487b72a8.entry.js +1 -0
- package/dist/webcomponents/p-48ae16e0.entry.js +1 -0
- package/dist/webcomponents/p-4abc17f0.entry.js +1 -0
- package/dist/webcomponents/p-4bac636e.entry.js +1 -0
- package/dist/webcomponents/p-52021fa1.entry.js +1 -0
- package/dist/webcomponents/p-525db3e8.js +1 -22
- package/dist/webcomponents/p-53948ff8.entry.js +1 -0
- package/dist/webcomponents/p-53e64f15.entry.js +1 -0
- package/dist/webcomponents/p-554a3c18.js +1 -0
- package/dist/webcomponents/p-56f6ce4c.js +1 -10
- package/dist/webcomponents/p-5968ff8a.js +1 -178
- package/dist/webcomponents/p-6078a370.js +1 -244
- package/dist/webcomponents/p-60a370fc.entry.js +1 -0
- package/dist/webcomponents/p-62b32c4c.entry.js +1 -0
- package/dist/webcomponents/p-65b561da.entry.js +1 -0
- package/dist/webcomponents/p-72c9e6b3.entry.js +1 -0
- package/dist/webcomponents/p-75b4daef.js +1 -0
- package/dist/webcomponents/p-7d85af5c.js +1 -16
- package/dist/webcomponents/p-8115b2f4.js +1 -28
- package/dist/webcomponents/p-83125497.js +1 -4027
- package/dist/webcomponents/p-8603348a.js +1 -0
- package/dist/webcomponents/p-890b3254.entry.js +1 -0
- package/dist/webcomponents/p-8df7bde8.js +1 -27
- package/dist/webcomponents/p-92bb1e5f.entry.js +1 -0
- package/dist/webcomponents/p-9c9c7dac.js +1 -24
- package/dist/webcomponents/p-9ccfa1c9.entry.js +1 -0
- package/dist/webcomponents/p-9dc36f76.entry.js +1 -0
- package/dist/webcomponents/p-ad41c8c7.entry.js +1 -0
- package/dist/webcomponents/p-ae263544.js +1 -0
- package/dist/webcomponents/p-af244664.js +1 -126
- package/dist/webcomponents/p-b16dfd5d.entry.js +1 -0
- package/dist/webcomponents/p-ba4bae6f.js +1 -12
- package/dist/webcomponents/p-bbed6107.entry.js +1 -0
- package/dist/webcomponents/p-bc92235c.entry.js +1 -0
- package/dist/webcomponents/p-be39c802.entry.js +1 -0
- package/dist/webcomponents/p-c9f8f7ec.entry.js +1 -0
- package/dist/webcomponents/p-d101c5db.js +1 -0
- package/dist/webcomponents/p-d1c8d794.entry.js +1 -0
- package/dist/webcomponents/p-d25c2f12.js +1 -0
- package/dist/webcomponents/p-d2a5054f.entry.js +1 -0
- package/dist/webcomponents/p-d765d638.js +1 -0
- package/dist/webcomponents/p-d8355f91.entry.js +1 -0
- package/dist/webcomponents/p-d89bad72.js +1 -39
- package/dist/webcomponents/p-dce846bf.js +1 -27
- package/dist/webcomponents/p-df21aaad.js +1 -120
- package/dist/webcomponents/p-e1255160.js +1 -3
- package/dist/webcomponents/p-e2c88817.entry.js +1 -0
- package/dist/webcomponents/p-e31f0f3e.entry.js +1 -0
- package/dist/webcomponents/p-e333620e.js +1 -34
- package/dist/webcomponents/p-e3fab0e2.js +1 -43
- package/dist/webcomponents/p-f0866375.entry.js +1 -0
- package/dist/webcomponents/p-fad19d75.js +2 -1638
- package/dist/webcomponents/p-fb58feb5.entry.js +1 -0
- package/dist/webcomponents/p-fe33151d.entry.js +1 -0
- package/dist/webcomponents/webcomponents.css +4 -362
- package/dist/webcomponents/webcomponents.esm.js +1 -20
- package/package.json +4 -2
- package/dist/globals.d.ts +0 -2
- package/dist/webcomponents/p-0179fbb2.entry.js +0 -1684
- package/dist/webcomponents/p-01a404ca.entry.js +0 -44
- package/dist/webcomponents/p-03d35880.entry.js +0 -130
- package/dist/webcomponents/p-06ff0429.entry.js +0 -65
- package/dist/webcomponents/p-220fc2cc.entry.js +0 -98
- package/dist/webcomponents/p-258b1ee2.entry.js +0 -149
- package/dist/webcomponents/p-25d8cd65.entry.js +0 -102
- package/dist/webcomponents/p-2988ac56.js +0 -79
- package/dist/webcomponents/p-2e405359.entry.js +0 -73
- package/dist/webcomponents/p-3e9ef4a8.js +0 -28
- package/dist/webcomponents/p-3fd13ca3.js +0 -52
- package/dist/webcomponents/p-5482d030.entry.js +0 -21
- package/dist/webcomponents/p-576826b1.entry.js +0 -43
- package/dist/webcomponents/p-5cb3f0b2.entry.js +0 -261
- package/dist/webcomponents/p-5f835b89.entry.js +0 -606
- package/dist/webcomponents/p-6fed319e.entry.js +0 -99
- package/dist/webcomponents/p-70a2aa74.entry.js +0 -76
- package/dist/webcomponents/p-74d0d0e1.entry.js +0 -75
- package/dist/webcomponents/p-7582b554.entry.js +0 -18
- package/dist/webcomponents/p-79646550.entry.js +0 -61
- package/dist/webcomponents/p-7b0400cd.entry.js +0 -131
- package/dist/webcomponents/p-800d31fe.entry.js +0 -162
- package/dist/webcomponents/p-85fc69e5.js +0 -90
- package/dist/webcomponents/p-890088fc.entry.js +0 -298
- package/dist/webcomponents/p-89887332.js +0 -301
- package/dist/webcomponents/p-8eb774df.entry.js +0 -54
- package/dist/webcomponents/p-9f94bbb6.entry.js +0 -118
- package/dist/webcomponents/p-a2da97f2.entry.js +0 -145
- package/dist/webcomponents/p-a5a225d9.entry.js +0 -125
- package/dist/webcomponents/p-a5c5821e.entry.js +0 -101
- package/dist/webcomponents/p-a5fb51dc.entry.js +0 -131
- package/dist/webcomponents/p-a6d04afc.js +0 -44
- package/dist/webcomponents/p-ac086069.entry.js +0 -58
- package/dist/webcomponents/p-ad5cfa9d.js +0 -77
- package/dist/webcomponents/p-b82c146f.entry.js +0 -111
- package/dist/webcomponents/p-b9a41ec2.entry.js +0 -74
- package/dist/webcomponents/p-ba5fae28.js +0 -90
- package/dist/webcomponents/p-c636f563.entry.js +0 -791
- package/dist/webcomponents/p-c64abefc.entry.js +0 -117
- package/dist/webcomponents/p-cb26f708.js +0 -18
- package/dist/webcomponents/p-cbf2437a.entry.js +0 -80
- package/dist/webcomponents/p-d17aee2b.entry.js +0 -26
- package/dist/webcomponents/p-d894aed2.entry.js +0 -133
- package/dist/webcomponents/p-e356f280.entry.js +0 -29
- package/dist/webcomponents/p-e837a453.entry.js +0 -94
- package/dist/webcomponents/p-e84a2dcb.entry.js +0 -97
- package/dist/webcomponents/p-ec2bd24f.entry.js +0 -94
- package/dist/webcomponents/p-ec854a3e.entry.js +0 -11053
- package/dist/webcomponents/p-f02b75dc.entry.js +0 -96
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import { m as makeGetPayoutCSV, P as PayoutService } from './p-a6d04afc.js';
|
|
3
|
-
import './p-56f6ce4c.js';
|
|
4
|
-
import './p-df21aaad.js';
|
|
5
|
-
import { P as Payout } from './p-e3fab0e2.js';
|
|
6
|
-
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
7
|
-
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
8
|
-
import { E as ErrorState } from './p-dce846bf.js';
|
|
9
|
-
import { J as JustifiAnalytics } from './p-ad5cfa9d.js';
|
|
10
|
-
import './p-29c0b182.js';
|
|
11
|
-
import './p-2988ac56.js';
|
|
12
|
-
|
|
13
|
-
const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
14
|
-
var _a;
|
|
15
|
-
try {
|
|
16
|
-
const response = await service.fetchPayout(id, authToken);
|
|
17
|
-
if (!response.error) {
|
|
18
|
-
const payout = new Payout(response.data);
|
|
19
|
-
onSuccess(payout);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
const errorMessage = getErrorMessage(response.error);
|
|
23
|
-
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
24
|
-
onError({
|
|
25
|
-
error: errorMessage,
|
|
26
|
-
code,
|
|
27
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
const errorMessage = getErrorMessage(error);
|
|
33
|
-
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
34
|
-
onError({
|
|
35
|
-
error: errorMessage,
|
|
36
|
-
code,
|
|
37
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const PayoutDetails = class {
|
|
43
|
-
constructor(hostRef) {
|
|
44
|
-
registerInstance(this, hostRef);
|
|
45
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
46
|
-
this.handleErrorEvent = (event) => {
|
|
47
|
-
this.errorMessage = event.detail.message;
|
|
48
|
-
this.errorEvent.emit(event.detail);
|
|
49
|
-
};
|
|
50
|
-
this.payoutId = undefined;
|
|
51
|
-
this.authToken = undefined;
|
|
52
|
-
this.getPayout = undefined;
|
|
53
|
-
this.getPayoutCSV = undefined;
|
|
54
|
-
this.errorMessage = null;
|
|
55
|
-
}
|
|
56
|
-
componentWillLoad() {
|
|
57
|
-
this.analytics = new JustifiAnalytics(this);
|
|
58
|
-
this.initializeServices();
|
|
59
|
-
}
|
|
60
|
-
disconnectedCallback() {
|
|
61
|
-
this.analytics.cleanup();
|
|
62
|
-
}
|
|
63
|
-
propChanged() {
|
|
64
|
-
this.initializeServices();
|
|
65
|
-
}
|
|
66
|
-
initializeServices() {
|
|
67
|
-
if (this.payoutId && this.authToken) {
|
|
68
|
-
this.getPayout = makeGetPayoutDetails({
|
|
69
|
-
id: this.payoutId,
|
|
70
|
-
authToken: this.authToken,
|
|
71
|
-
service: new PayoutService()
|
|
72
|
-
});
|
|
73
|
-
this.getPayoutCSV = makeGetPayoutCSV({
|
|
74
|
-
authToken: this.authToken,
|
|
75
|
-
service: new PayoutService()
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
this.errorMessage = 'Failed to load payout details. payoutId or authToken is not provided.';
|
|
80
|
-
this.errorEvent.emit({
|
|
81
|
-
message: this.errorMessage,
|
|
82
|
-
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
83
|
-
severity: ComponentErrorSeverity.ERROR
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
render() {
|
|
88
|
-
if (this.errorMessage) {
|
|
89
|
-
return ErrorState(this.errorMessage);
|
|
90
|
-
}
|
|
91
|
-
return (h("payout-details-core", { getPayout: this.getPayout, getPayoutCSV: this.getPayoutCSV, "onError-event": this.handleErrorEvent }));
|
|
92
|
-
}
|
|
93
|
-
static get watchers() { return {
|
|
94
|
-
"payoutId": ["propChanged"],
|
|
95
|
-
"authToken": ["propChanged"]
|
|
96
|
-
}; }
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
export { PayoutDetails as justifi_payout_details };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, c as createEvent } from './p-fad19d75.js';
|
|
2
|
-
import { c as create$3, F as FormController } from './p-2eab3c90.js';
|
|
3
|
-
import { i as identityNameValidation, l as lineOneValidation, a as lineTwoValidation, c as cityValidation, s as stateValidation, p as postalValidation } from './p-89887332.js';
|
|
4
|
-
import { S as StateOptions } from './p-6078a370.js';
|
|
5
|
-
import { n as numberOnlyHandler } from './p-8df7bde8.js';
|
|
6
|
-
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
7
|
-
import './p-ba5fae28.js';
|
|
8
|
-
import './p-af244664.js';
|
|
9
|
-
import './p-1ff8810b.js';
|
|
10
|
-
|
|
11
|
-
const BillingFormSchema = create$3({
|
|
12
|
-
name: identityNameValidation.required('Enter full name'),
|
|
13
|
-
address_line1: lineOneValidation.required('Enter street address'),
|
|
14
|
-
address_line2: lineTwoValidation.nullable(),
|
|
15
|
-
address_city: cityValidation.required('Enter city'),
|
|
16
|
-
address_state: stateValidation.required('Select state'),
|
|
17
|
-
address_postal_code: postalValidation.required('Enter postal code'),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const billingFormCss = ":host{display:block}justifi-billing-form{margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}";
|
|
21
|
-
const JustifiBillingFormStyle0 = billingFormCss;
|
|
22
|
-
|
|
23
|
-
const BillingForm = class {
|
|
24
|
-
constructor(hostRef) {
|
|
25
|
-
registerInstance(this, hostRef);
|
|
26
|
-
this.inputHandler = (name, value) => {
|
|
27
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
28
|
-
};
|
|
29
|
-
this.legend = undefined;
|
|
30
|
-
this.formController = undefined;
|
|
31
|
-
this.billingInfo = undefined;
|
|
32
|
-
this.errors = {};
|
|
33
|
-
}
|
|
34
|
-
componentWillLoad() {
|
|
35
|
-
this.formController = new FormController(BillingFormSchema);
|
|
36
|
-
}
|
|
37
|
-
componentDidLoad() {
|
|
38
|
-
this.formController.values.subscribe(values => this.billingInfo = Object.assign({}, values));
|
|
39
|
-
this.formController.errors.subscribe(errors => {
|
|
40
|
-
this.errors = Object.assign({}, errors);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
async getValues() {
|
|
44
|
-
return this.formController.values.getValue();
|
|
45
|
-
}
|
|
46
|
-
async fill(fields) {
|
|
47
|
-
this.formController.setInitialValues(fields);
|
|
48
|
-
}
|
|
49
|
-
async validate() {
|
|
50
|
-
let isValid = await this.formController.validate();
|
|
51
|
-
return { isValid: isValid };
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
const billingFormDefaultValue = this.formController.getInitialValues();
|
|
55
|
-
return (h(StyledHost, { key: 'b08094d3c44d35cdb3c21b4bc360dbbee19d7d15', exportparts: "label,input,input-invalid" }, h("form", { key: '392538a781ffa2ac299cbc4203bab5efd10e77cc' }, h("fieldset", { key: 'f4b5a5ec9a91e9f50a3847c5eb16635c4f9d569a' }, this.legend && h("legend", { key: 'eb75e22f9df33c13e3851ece784d237b8973e2c5' }, this.legend), h("div", { key: 'd7ffdc1cfeda5568ad003a4d3bbe94765de04605', class: "row gy-3" }, h("div", { key: 'c22f9e7b2f33b5c298bb5f0a5c7bcaa709c231a0', class: "col-12" }, h("form-control-text", { key: 'd6eb4d2f4d1a2a709e0f29bf18b5d9700bd91a13', name: 'name', label: 'Full Name', defaultValue: billingFormDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: '8494ee3c14f8923d18d8708077e030c2f141a251', class: "col-12" }, h("form-control-text", { key: '63266eb0e2b2b006a3c914a68703ee1cdf848f83', name: 'address_line1', label: 'Street Address', defaultValue: billingFormDefaultValue.address_line1, errorText: this.errors.address_line1, inputHandler: this.inputHandler })), h("div", { key: '0a19fcf5c172d2539f23e147f39461d84dfd9d37', class: "col-12" }, h("form-control-text", { key: '0e5fae5d65d5ea195de0227d1e4f79cee7c7a0fb', name: 'address_line2', label: "Apartment, Suite, etc. (optional)", defaultValue: billingFormDefaultValue.address_line2, errorText: this.errors.address_line2, inputHandler: this.inputHandler })), h("div", { key: '13104554e8247cb0534c3dc9e6a16b2f44397795', class: "col-12" }, h("form-control-text", { key: '430e59713ec66ff7a6f735ca24640c27b05cbeee', name: 'address_city', label: "City", defaultValue: billingFormDefaultValue.address_city, errorText: this.errors.address_city, inputHandler: this.inputHandler })), h("div", { key: '5b81499717f67d5f499f4ebfc585056ef5bd3d56', class: "col-12" }, h("form-control-select", { key: '726c724eda5f25a92bad7e549ff7845ece7b41e1', name: 'address_state', label: 'State', options: StateOptions, defaultValue: billingFormDefaultValue.address_state, errorText: this.errors.address_state, inputHandler: this.inputHandler })), h("div", { key: '5d5a6e0949c5ad93da5bc1837dadf88c2128212d', class: "col-12" }, h("form-control-text", { key: 'ebb4e77126d86011d9a1ed5d118461198b399092', name: 'address_postal_code', label: "ZIP", defaultValue: billingFormDefaultValue.address_postal_code, errorText: this.errors.address_postal_code, inputHandler: this.inputHandler, maxLength: 5, keyDownHandler: numberOnlyHandler })))))));
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
BillingForm.style = JustifiBillingFormStyle0;
|
|
59
|
-
|
|
60
|
-
const SaveNewPaymentMethod = class {
|
|
61
|
-
constructor(hostRef) {
|
|
62
|
-
registerInstance(this, hostRef);
|
|
63
|
-
this.checkboxChanged = createEvent(this, "checkboxChanged", 7);
|
|
64
|
-
this.isChecked = false;
|
|
65
|
-
}
|
|
66
|
-
handleCheckboxChange(event) {
|
|
67
|
-
const target = event.target;
|
|
68
|
-
this.isChecked = target.checked;
|
|
69
|
-
this.checkboxChanged.emit(this.isChecked);
|
|
70
|
-
}
|
|
71
|
-
render() {
|
|
72
|
-
return (h("div", { key: 'f22a132a518a98786c8486e08c9a65050f3c5ea0', class: "mt-4 form-check" }, h("input", { key: '6f1392f9dd29a9761f5942b0a40e05a899858ada', type: "checkbox", checked: this.isChecked, onChange: (event) => this.handleCheckboxChange(event), class: "form-check-input" }), h("label", { key: 'e6e5908ba70ece8ea19370a04104d88d17237fc7', class: "form-check-label" }, "Save new payment method")));
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export { BillingForm as justifi_billing_form, SaveNewPaymentMethod as justifi_save_new_payment_method };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import { J as JustifiAnalytics } from './p-ad5cfa9d.js';
|
|
3
|
-
import './p-2988ac56.js';
|
|
4
|
-
import './p-29c0b182.js';
|
|
5
|
-
|
|
6
|
-
const CardForm = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
10
|
-
this.ready = createEvent(this, "ready", 7);
|
|
11
|
-
this.cardFormTokenized = createEvent(this, "cardFormTokenize", 7);
|
|
12
|
-
this.cardFormValidated = createEvent(this, "cardFormValidate", 7);
|
|
13
|
-
this.validationMode = undefined;
|
|
14
|
-
this.iframeOrigin = undefined;
|
|
15
|
-
this.singleLine = false;
|
|
16
|
-
this.internalStyleOverrides = undefined;
|
|
17
|
-
}
|
|
18
|
-
readyHandler(event) {
|
|
19
|
-
console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);
|
|
20
|
-
this.cardFormReady.emit(event);
|
|
21
|
-
this.ready.emit(event);
|
|
22
|
-
}
|
|
23
|
-
tokenizeHandler(event) {
|
|
24
|
-
console.warn(`The 'cardFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`);
|
|
25
|
-
this.cardFormTokenized.emit(event);
|
|
26
|
-
}
|
|
27
|
-
validateHandler(event) {
|
|
28
|
-
console.warn(`The 'cardFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`);
|
|
29
|
-
this.cardFormValidated.emit(event);
|
|
30
|
-
}
|
|
31
|
-
componentWillLoad() {
|
|
32
|
-
this.analytics = new JustifiAnalytics(this);
|
|
33
|
-
}
|
|
34
|
-
disconnectedCallback() {
|
|
35
|
-
this.analytics.cleanup();
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Makes a tokenization request to the iframe
|
|
39
|
-
*/
|
|
40
|
-
async tokenize(...args) {
|
|
41
|
-
if (!this.childRef) {
|
|
42
|
-
throw new Error('Cannot call tokenize');
|
|
43
|
-
}
|
|
44
|
-
return this.childRef.tokenize(...args);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Runs a validation on the form and shows errors if any
|
|
48
|
-
*/
|
|
49
|
-
async validate() {
|
|
50
|
-
if (!this.childRef) {
|
|
51
|
-
throw new Error('Cannot call validate');
|
|
52
|
-
}
|
|
53
|
-
return this.childRef.validate();
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Manually resizes the iframe to fit the contents of the iframe
|
|
57
|
-
* @deprecated This method will be removed in future releases.
|
|
58
|
-
*/
|
|
59
|
-
async resize() {
|
|
60
|
-
console.warn(`The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`);
|
|
61
|
-
if (!this.childRef) {
|
|
62
|
-
throw new Error('Cannot call validate');
|
|
63
|
-
}
|
|
64
|
-
return this.childRef.resize();
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return (h("justifi-payment-method-form", { key: 'cc0ad5d8a262ff5c8422d247caed469a8dea3488', ref: el => {
|
|
68
|
-
if (el) {
|
|
69
|
-
this.childRef = el;
|
|
70
|
-
}
|
|
71
|
-
}, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "card", "single-line": this.singleLine, "payment-method-form-ready": this.cardFormReady, "payment-method-form-validate": this.cardFormValidated, "payment-method-form-tokenize": this.cardFormTokenized, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export { CardForm as justifi_card_form };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './p-fad19d75.js';
|
|
2
|
-
import { E as ErrorState } from './p-dce846bf.js';
|
|
3
|
-
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
4
|
-
|
|
5
|
-
const Details = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.errorMessage = undefined;
|
|
9
|
-
}
|
|
10
|
-
render() {
|
|
11
|
-
return (h(StyledHost, { key: '00b10fc4e459688ae06147ef1535f03609ec35e4', exportParts: 'detail-empty-state, detail-metadata-title, detail-metadata, detail-section, detail-section-title, \n detail-section-item-title, detail-section-item-data, detail-head, detail-title, detail-head-info' }, this.errorMessage ?
|
|
12
|
-
ErrorState(this.errorMessage)
|
|
13
|
-
:
|
|
14
|
-
h("main", { class: "p-2" }, h("slot", { name: "head-info" }), h("slot", { name: 'detail-sections' }))));
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { Details as justifi_details };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './p-fad19d75.js';
|
|
2
|
-
import { I as IMask } from './p-1ad5995e.js';
|
|
3
|
-
import { C as CURRENCY_MASK } from './p-525db3e8.js';
|
|
4
|
-
|
|
5
|
-
const MonetaryInput = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.formControlInput = createEvent(this, "formControlInput", 7);
|
|
9
|
-
this.formControlBlur = createEvent(this, "formControlBlur", 7);
|
|
10
|
-
this.imask = null;
|
|
11
|
-
this.initializeIMask = () => {
|
|
12
|
-
if (!this.textInput)
|
|
13
|
-
return;
|
|
14
|
-
this.imask = IMask(this.textInput, this.maskOptions);
|
|
15
|
-
this.imask.on('accept', () => {
|
|
16
|
-
const rawValue = this.imask.unmaskedValue;
|
|
17
|
-
this.inputHandler(this.name, rawValue);
|
|
18
|
-
this.formControlInput.emit({ name: this.name, value: rawValue });
|
|
19
|
-
});
|
|
20
|
-
this.textInput.addEventListener('blur', () => this.formControlBlur.emit());
|
|
21
|
-
};
|
|
22
|
-
this.handleFormControlInput = (event) => {
|
|
23
|
-
const target = event.target;
|
|
24
|
-
const name = target.getAttribute('name');
|
|
25
|
-
const rawValue = this.imask.unmaskedValue;
|
|
26
|
-
this.formControlInput.emit({ name: name, value: rawValue });
|
|
27
|
-
};
|
|
28
|
-
this.updateInput = (newValue) => {
|
|
29
|
-
if (this.imask) {
|
|
30
|
-
this.imask.value = String(newValue);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
this.label = undefined;
|
|
34
|
-
this.name = undefined;
|
|
35
|
-
this.helpText = undefined;
|
|
36
|
-
this.errorText = undefined;
|
|
37
|
-
this.defaultValue = undefined;
|
|
38
|
-
this.inputHandler = undefined;
|
|
39
|
-
this.maskOptions = CURRENCY_MASK.DECIMAL;
|
|
40
|
-
this.disabled = undefined;
|
|
41
|
-
}
|
|
42
|
-
handleDefaultValueChange(newValue) {
|
|
43
|
-
this.updateInput(newValue);
|
|
44
|
-
}
|
|
45
|
-
componentDidLoad() {
|
|
46
|
-
this.initializeIMask();
|
|
47
|
-
this.updateInput(this.defaultValue);
|
|
48
|
-
}
|
|
49
|
-
disconnectedCallback() {
|
|
50
|
-
var _a;
|
|
51
|
-
(_a = this.imask) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
return (h(Host, { key: '8797b3aa5c6a30f472d51e2b9437b6158b0566fc', exportparts: "label,input,input-group-input,input-group-text,input-invalid" }, h("div", { key: '0d3e068cf104aec3f6250f5cd6c00a9342928fe8', class: "form-group d-flex flex-column" }, h("label", { key: '0e86db7c0d981bdae74c51dd75bf5579d07b4793', part: "label", class: "form-label", htmlFor: this.name }, this.label), h("div", { key: '8fc773de3995bb37e6fa00b34d8d9e2deaef4bbd', class: "input-group" }, h("span", { key: '83860eac764be9eeea31302d60525fb56af9dc1d', class: "input-group-text", part: "input-group-text" }, "$"), h("input", { key: 'b8c655c0b8eeb6ec328eeaed651773c293aa3100', ref: el => (this.textInput = el), id: this.name, name: this.name, onBlur: this.formControlBlur.emit, onInput: this.handleFormControlInput, part: `input input-group-input ${this.errorText && 'input-invalid'}`, class: this.errorText ? 'form-control monetary is-invalid' : 'form-control monetary', type: "text", disabled: this.disabled })), h("form-control-help-text", { key: 'b3f142b9c67a792a96b597bdaf91fd3abe1b7ce3', helpText: this.helpText, name: this.name }), h("form-control-error-text", { key: 'daefe97a15bde309c397a506de6cda9a0376323b', errorText: this.errorText, name: this.name }))));
|
|
55
|
-
}
|
|
56
|
-
static get watchers() { return {
|
|
57
|
-
"defaultValue": ["handleDefaultValueChange"]
|
|
58
|
-
}; }
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export { MonetaryInput as form_control_monetary };
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import { A as Api } from './p-29c0b182.js';
|
|
3
|
-
import './p-56f6ce4c.js';
|
|
4
|
-
import './p-df21aaad.js';
|
|
5
|
-
import './p-e3fab0e2.js';
|
|
6
|
-
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
7
|
-
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
8
|
-
import { J as JustifiAnalytics } from './p-ad5cfa9d.js';
|
|
9
|
-
import './p-2988ac56.js';
|
|
10
|
-
|
|
11
|
-
class InsuranceService {
|
|
12
|
-
async fetchQuote(authToken, payload) {
|
|
13
|
-
const endpoint = 'insurance/quotes';
|
|
14
|
-
return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
|
|
15
|
-
}
|
|
16
|
-
async toggleCoverage(authToken, quoteId, payload) {
|
|
17
|
-
const endpoint = `insurance/quotes/${quoteId}/toggle`;
|
|
18
|
-
return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const makeGetQuote = ({ authToken, service }) => async ({ payload, onSuccess, onError }) => {
|
|
23
|
-
var _a;
|
|
24
|
-
try {
|
|
25
|
-
const response = await service.fetchQuote(authToken, payload);
|
|
26
|
-
if (!response.error) {
|
|
27
|
-
const quote = response.data;
|
|
28
|
-
onSuccess({ quote });
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
const responseError = getErrorMessage(response.error);
|
|
32
|
-
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
33
|
-
return onError({
|
|
34
|
-
error: responseError,
|
|
35
|
-
code,
|
|
36
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
42
|
-
return onError({
|
|
43
|
-
error: error.message || error,
|
|
44
|
-
code,
|
|
45
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const makeToggleCoverage = ({ authToken, service }) => async ({ quoteId, payload, onSuccess, onError }) => {
|
|
50
|
-
var _a;
|
|
51
|
-
try {
|
|
52
|
-
const response = await service.toggleCoverage(authToken, quoteId, payload);
|
|
53
|
-
if (!response.error) {
|
|
54
|
-
const quote = response.data;
|
|
55
|
-
onSuccess({ quote });
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
const responseError = getErrorMessage(response.error);
|
|
59
|
-
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
60
|
-
return onError({
|
|
61
|
-
error: responseError,
|
|
62
|
-
code,
|
|
63
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
69
|
-
return onError({
|
|
70
|
-
error: error.message || error,
|
|
71
|
-
code,
|
|
72
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const SeasonInterruptionInsurance = class {
|
|
78
|
-
constructor(hostRef) {
|
|
79
|
-
registerInstance(this, hostRef);
|
|
80
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
81
|
-
this.authToken = undefined;
|
|
82
|
-
this.checkoutId = undefined;
|
|
83
|
-
this.primaryIdentityFirstName = undefined;
|
|
84
|
-
this.primaryIdentityLastName = undefined;
|
|
85
|
-
this.primaryIdentityState = undefined;
|
|
86
|
-
this.primaryIdentityPostalCode = undefined;
|
|
87
|
-
this.primaryIdentityCountry = undefined;
|
|
88
|
-
this.primaryIdentityEmailAddress = undefined;
|
|
89
|
-
this.policyAttributesInsurableAmount = undefined;
|
|
90
|
-
this.policyAttributesStartDate = undefined;
|
|
91
|
-
this.policyAttributesEndDate = undefined;
|
|
92
|
-
this.coveredIdentityFirstName = undefined;
|
|
93
|
-
this.coveredIdentityLastName = undefined;
|
|
94
|
-
this.getQuote = undefined;
|
|
95
|
-
this.toggleCoverage = undefined;
|
|
96
|
-
this.quote = undefined;
|
|
97
|
-
}
|
|
98
|
-
async validate() {
|
|
99
|
-
return this.seasonInterruptionCoreRef.validate();
|
|
100
|
-
}
|
|
101
|
-
componentWillLoad() {
|
|
102
|
-
this.analytics = new JustifiAnalytics(this);
|
|
103
|
-
this.initializeServiceMethods();
|
|
104
|
-
}
|
|
105
|
-
disconnectedCallback() {
|
|
106
|
-
this.analytics.cleanup();
|
|
107
|
-
}
|
|
108
|
-
initializeServiceMethods() {
|
|
109
|
-
if (!this.authToken) {
|
|
110
|
-
this.errorEvent.emit({
|
|
111
|
-
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
112
|
-
message: 'Missing authToken',
|
|
113
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
114
|
-
});
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
this.getQuote = makeGetQuote({
|
|
118
|
-
authToken: this.authToken,
|
|
119
|
-
service: new InsuranceService(),
|
|
120
|
-
});
|
|
121
|
-
this.toggleCoverage = makeToggleCoverage({
|
|
122
|
-
authToken: this.authToken,
|
|
123
|
-
service: new InsuranceService(),
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
render() {
|
|
127
|
-
return (h("justifi-season-interruption-insurance-core", { key: '256d45d39c5d297abb7f955229b0e0e9fbc9504a', ref: (el) => (this.seasonInterruptionCoreRef = el), "checkout-id": this.checkoutId, getQuote: this.getQuote, toggleCoverage: this.toggleCoverage, "primary-identity-first-name": this.primaryIdentityFirstName, "primary-identity-last-name": this.primaryIdentityLastName, "primary-identity-state": this.primaryIdentityState, "primary-identity-postal-code": this.primaryIdentityPostalCode, "primary-identity-country": this.primaryIdentityCountry, "primary-identity-email-address": this.primaryIdentityEmailAddress, "policy-attributes-insurable-amount": this.policyAttributesInsurableAmount, "policy-attributes-start-date": this.policyAttributesStartDate, "policy-attributes-end-date": this.policyAttributesEndDate, "covered-identity-first-name": this.coveredIdentityFirstName, "covered-identity-last-name": this.coveredIdentityLastName }));
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export { SeasonInterruptionInsurance as justifi_season_interruption_insurance };
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent } from './p-fad19d75.js';
|
|
2
|
-
import { p as pagingDefaults } from './p-56f6ce4c.js';
|
|
3
|
-
import './p-df21aaad.js';
|
|
4
|
-
import { a as PayoutStatuses, b as PayoutStatusesSafeNames } from './p-e3fab0e2.js';
|
|
5
|
-
import { b as formatDate, c as formatTime, f as formatCurrency } from './p-83125497.js';
|
|
6
|
-
import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './p-14c91ffd.js';
|
|
7
|
-
import { t as tableExportedParts } from './p-2b6c9c4f.js';
|
|
8
|
-
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
9
|
-
import { T as TableLoadingState, a as TableEmptyState, b as TableErrorState } from './p-e333620e.js';
|
|
10
|
-
|
|
11
|
-
const DownloadIcon = (props) => (h("svg", Object.assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24' }, props),
|
|
12
|
-
h("path", { d: 'M12 15.5l-5-5 1.41-1.41L12 12.67l3.59-3.58L17 10.5l-5 5z' }),
|
|
13
|
-
h("path", { d: 'M11 4h2v9h-2z' }),
|
|
14
|
-
h("path", { d: 'M5 18h14v2H5z' })));
|
|
15
|
-
|
|
16
|
-
const PayoutsListCore = class {
|
|
17
|
-
constructor(hostRef) {
|
|
18
|
-
registerInstance(this, hostRef);
|
|
19
|
-
this.rowClicked = createEvent(this, "payout-row-clicked", 7);
|
|
20
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
21
|
-
this.downloadCSV = (payoutId) => {
|
|
22
|
-
this.getPayoutCSV({
|
|
23
|
-
payoutId,
|
|
24
|
-
onError: () => {
|
|
25
|
-
this.errorEvent.emit({
|
|
26
|
-
errorCode: ComponentErrorCodes.FETCH_ERROR,
|
|
27
|
-
message: 'Failed to download CSV',
|
|
28
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
this.handleDateChange = (name, value) => {
|
|
34
|
-
this.params = Object.assign(Object.assign({}, this.params), { [name]: value });
|
|
35
|
-
};
|
|
36
|
-
this.handleClickPrevious = (beforeCursor) => {
|
|
37
|
-
const newParams = Object.assign({}, this.params);
|
|
38
|
-
delete newParams.after_cursor;
|
|
39
|
-
this.params = Object.assign(Object.assign({}, newParams), { before_cursor: beforeCursor });
|
|
40
|
-
};
|
|
41
|
-
this.handleClickNext = (afterCursor) => {
|
|
42
|
-
const newParams = Object.assign({}, this.params);
|
|
43
|
-
delete newParams.before_cursor;
|
|
44
|
-
this.params = Object.assign(Object.assign({}, newParams), { after_cursor: afterCursor });
|
|
45
|
-
};
|
|
46
|
-
this.mapStatusToBadge = (status) => {
|
|
47
|
-
switch (status) {
|
|
48
|
-
case PayoutStatuses.scheduled:
|
|
49
|
-
return `<span class="badge bg-primary" title='Batched and scheduled to be transferred'>${PayoutStatusesSafeNames[status]}</span>`;
|
|
50
|
-
case PayoutStatuses.in_transit:
|
|
51
|
-
return `<span class="badge bg-primary" title='Transfer to your bank account has been initiated'>${PayoutStatusesSafeNames[status]}</span>`;
|
|
52
|
-
case PayoutStatuses.failed:
|
|
53
|
-
return `<span class="badge bg-danger" title='Transfer to your bank account failed'>${PayoutStatusesSafeNames[status]}</span>`;
|
|
54
|
-
case PayoutStatuses.canceled:
|
|
55
|
-
return `<span class="badge bg-danger" title='Transfer to your bank account failed'>${PayoutStatusesSafeNames[status]}</span>`;
|
|
56
|
-
case PayoutStatuses.forwarded:
|
|
57
|
-
return `<span class="badge bg-secondary" title='The funds have been forwarded to your next successful payout'>${PayoutStatusesSafeNames[status]}</span>`;
|
|
58
|
-
case PayoutStatuses.paid:
|
|
59
|
-
return `<span class="badge bg-success" title='Successfully deposited into your bank account'>${PayoutStatusesSafeNames[status]}</span>`;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
this.rowClickHandler = (e) => {
|
|
63
|
-
const clickedPayoutID = e.target.closest('tr').dataset.rowEntityId;
|
|
64
|
-
if (!clickedPayoutID)
|
|
65
|
-
return;
|
|
66
|
-
this.rowClicked.emit(this.payouts.find((payout) => payout.id === clickedPayoutID));
|
|
67
|
-
};
|
|
68
|
-
this.getPayouts = undefined;
|
|
69
|
-
this.getPayoutCSV = undefined;
|
|
70
|
-
this.payouts = [];
|
|
71
|
-
this.loading = true;
|
|
72
|
-
this.errorMessage = undefined;
|
|
73
|
-
this.paging = pagingDefaults;
|
|
74
|
-
this.params = undefined;
|
|
75
|
-
}
|
|
76
|
-
updateOnPropChange() {
|
|
77
|
-
this.fetchData();
|
|
78
|
-
}
|
|
79
|
-
componentWillLoad() {
|
|
80
|
-
if (this.getPayouts) {
|
|
81
|
-
this.fetchData();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
fetchData() {
|
|
85
|
-
this.loading = true;
|
|
86
|
-
this.getPayouts({
|
|
87
|
-
params: this.params,
|
|
88
|
-
onSuccess: ({ payouts, pagingInfo }) => {
|
|
89
|
-
this.payouts = payouts;
|
|
90
|
-
this.paging = pagingInfo;
|
|
91
|
-
this.loading = false;
|
|
92
|
-
},
|
|
93
|
-
onError: ({ error, code, severity }) => {
|
|
94
|
-
this.errorMessage = error;
|
|
95
|
-
this.errorEvent.emit({
|
|
96
|
-
errorCode: code,
|
|
97
|
-
message: error,
|
|
98
|
-
severity,
|
|
99
|
-
});
|
|
100
|
-
this.loading = false;
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
get entityId() {
|
|
105
|
-
return this.payouts.map((payout) => payout.id);
|
|
106
|
-
}
|
|
107
|
-
get columnData() {
|
|
108
|
-
return [
|
|
109
|
-
['Paid Out On', 'The date each transaction occurred'],
|
|
110
|
-
['Type', 'The type of each transaction'],
|
|
111
|
-
['Account', 'The ID of the account associated with each payout'],
|
|
112
|
-
['Paid Out To', 'The bank account to which each payout was transferred'],
|
|
113
|
-
['Payments', 'Sum of payments in each payout'],
|
|
114
|
-
['Refunds', 'Sum of refunds in each payout'],
|
|
115
|
-
['Fees', 'Sum of fees in each payout'],
|
|
116
|
-
['Other', 'Sum of less common transactions in each payout'],
|
|
117
|
-
['Payout Amount', 'The net sum of all transactions in each payout'],
|
|
118
|
-
['Status', 'The real-time status of each payout'],
|
|
119
|
-
['Actions', ''],
|
|
120
|
-
];
|
|
121
|
-
}
|
|
122
|
-
get rowData() {
|
|
123
|
-
return this.payouts.map((payout) => [
|
|
124
|
-
{
|
|
125
|
-
type: 'head',
|
|
126
|
-
value: `
|
|
127
|
-
<div class='fw-bold'>${formatDate(payout.created_at)}</div>
|
|
128
|
-
<div class='fw-bold'>${formatTime(payout.created_at)}</div>
|
|
129
|
-
`,
|
|
130
|
-
},
|
|
131
|
-
payout.payout_type,
|
|
132
|
-
payout.account_id,
|
|
133
|
-
`${payout.bank_account.full_name} ${payout.bank_account.account_number_last4}`,
|
|
134
|
-
formatCurrency(payout.payments_total),
|
|
135
|
-
formatCurrency(payout.refunds_total),
|
|
136
|
-
formatCurrency(payout.fees_total),
|
|
137
|
-
formatCurrency(payout.other_total),
|
|
138
|
-
formatCurrency(payout.amount),
|
|
139
|
-
{ type: 'inner', value: this.mapStatusToBadge(payout.status) },
|
|
140
|
-
(h(DownloadIcon, { title: "Export CSV", onClick: () => this.downloadCSV(payout.id), style: { height: '24px', width: '24px', cursor: 'pointer' } })),
|
|
141
|
-
]);
|
|
142
|
-
}
|
|
143
|
-
get showEmptyState() {
|
|
144
|
-
return !this.loading && !this.errorMessage && this.rowData.length < 1;
|
|
145
|
-
}
|
|
146
|
-
get showErrorState() {
|
|
147
|
-
return !this.loading && !!this.errorMessage;
|
|
148
|
-
}
|
|
149
|
-
get showRowData() {
|
|
150
|
-
return !this.showEmptyState && !this.showErrorState;
|
|
151
|
-
}
|
|
152
|
-
render() {
|
|
153
|
-
return (h(StyledHost, { key: '594c52003f897f4c50f79935e42a7042fb5ec168', exportedparts: tableExportedParts }, h("div", { key: 'f2b1d971e1e7bc5596459c071c3aa931ba4cb4b9', class: "row gy-3 mb-4" }, h("div", { key: 'd98e3ed56421493a60bd0a285079aa99ae705506', class: "col-2" }, h("form-control-date", { key: 'c9c899884bcc6fa6d306b95473ef0a7354e57bd5', name: "created_after", label: "Date from:", inputHandler: this.handleDateChange })), h("div", { key: '0059a75bf2f478b107d59bd9d7cc29de10dffe57', class: "col-2" }, h("form-control-date", { key: 'ef9a31ac8a8e7336386664b70289ee34677152a4', name: "created_before", label: "Date to:", inputHandler: this.handleDateChange }))), h("div", { key: '65da1114a66ac4cdf8d6ec012a42b2f760af5c76', class: "table-wrapper" }, h("table", { key: 'd68d8f61835cc4dc5dc988ff61843e6254494ace', class: "table table-hover" }, h("thead", { key: 'aa691db8fbfbcdad59acbdc1ef38497b552928ab', class: "table-head sticky-top", part: "table-head" }, h("tr", { key: 'aa9f61cbf05b9420026861cb14e6a30a6c9e347e', class: "table-light text-nowrap", part: "table-head-row" }, this.columnData.map((column) => (h("th", { part: "table-head-cell", scope: "col", title: Array.isArray(column) ? column[1] : '' }, Array.isArray(column) ? column[0] : column))))), h("tbody", { key: 'cf0127f26e8bc5b7afbbfc4a36fab4de948d1727', class: "table-body", part: "table-body" }, h(TableLoadingState, { key: 'd6b832786c4959176974c7a343442c8d1c50b5c2', columnSpan: this.columnData.length, isLoading: this.loading }), h(TableEmptyState, { key: '398a20957f76ba14e1b0677fbd6fbfbacce61fbb', isEmpty: this.showEmptyState, columnSpan: this.columnData.length }), h(TableErrorState, { key: 'd9f755a07a6f8cd4967eac60beff92f36322dcdd', columnSpan: this.columnData.length, errorMessage: this.errorMessage }), this.showRowData &&
|
|
154
|
-
this.rowData.map((data, index) => (h("tr", { "data-test-id": "table-row", "data-row-entity-id": this.entityId[index], onClick: this.rowClickHandler, part: `table-row ${index % 2 ? 'table-row-even' : 'table-row-odd'}` }, data.map((dataEntry) => ((dataEntry === null || dataEntry === void 0 ? void 0 : dataEntry.type) ? (h("td", { part: "table-cell", innerHTML: dataEntry.value })) : (h("td", { part: "table-cell" }, dataEntry)))))))), this.paging && (h("tfoot", { key: '503fa3a3a7ffe5d52b614153b286dd0326c02091', class: "sticky-bottom" }, h("tr", { key: 'e3af74b96bfc1f5ac1f0f0655eaed096102d0e89', class: "table-light align-middle" }, h("td", { key: 'a53f9d37181ea29a9fcb6ab46b2daf7cc66509be', part: "pagination-bar", colSpan: this.columnData.length }, h("pagination-menu", { key: 'b0779289444747e0b18bb63e6a17cdc89bd390ca', paging: Object.assign(Object.assign({}, this.paging), { handleClickPrevious: this.handleClickPrevious, handleClickNext: this.handleClickNext }), params: this.params })))))))));
|
|
155
|
-
}
|
|
156
|
-
static get watchers() { return {
|
|
157
|
-
"params": ["updateOnPropChange"],
|
|
158
|
-
"getPayouts": ["updateOnPropChange"]
|
|
159
|
-
}; }
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export { PayoutsListCore as payouts_list_core };
|