@justifi/webcomponents 6.0.6-rc.4 → 6.0.6-rc.5
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/{check-pkg-version-DDYyouYC.js → check-pkg-version-CwFBpUfB.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +5 -2
- package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/{package-VjPC5nqK.js → package-COdZjwB3.js} +1 -1
- package/dist/collection/api/services/apple-pay.service.js +3 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{check-pkg-version-D0SJTGUq.js → check-pkg-version-BUjV-MqL.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-apple-pay_8.entry.js +5 -2
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-order-terminals.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-refund-payment.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +2 -2
- package/dist/esm/{package-NMTsmUsG.js → package-CaO1cY-g.js} +1 -1
- package/dist/module/apple-pay.js +3 -0
- package/dist/module/package.js +1 -1
- package/dist/webcomponents/{p-7b6027c4.entry.js → p-00ad5ac2.entry.js} +1 -1
- package/dist/webcomponents/p-0e69bc05.entry.js +1 -0
- package/dist/webcomponents/p-1de489c4.entry.js +1 -0
- package/dist/webcomponents/{p-adeff733.entry.js → p-22f40643.entry.js} +1 -1
- package/dist/webcomponents/p-3d9fecd6.entry.js +1 -0
- package/dist/webcomponents/{p-73ebd7e7.entry.js → p-4569b438.entry.js} +1 -1
- package/dist/webcomponents/p-4a54bc02.entry.js +1 -0
- package/dist/webcomponents/p-4c174b33.entry.js +1 -0
- package/dist/webcomponents/{p-336db71a.entry.js → p-62524de7.entry.js} +1 -1
- package/dist/webcomponents/{p-7f5df31e.entry.js → p-6671441a.entry.js} +1 -1
- package/dist/webcomponents/{p-ae7fb4f2.entry.js → p-887eb245.entry.js} +1 -1
- package/dist/webcomponents/{p-a849d9e2.entry.js → p-8e966a2d.entry.js} +1 -1
- package/dist/webcomponents/{p-125b8d74.entry.js → p-9f3607a6.entry.js} +1 -1
- package/dist/webcomponents/{p-BSyMsqda.js → p-BlOkWGxk.js} +1 -1
- package/dist/webcomponents/p-CaO1cY-g.js +1 -0
- package/dist/webcomponents/{p-6be4cdf0.entry.js → p-b2712e47.entry.js} +1 -1
- package/dist/webcomponents/{p-03e1d695.entry.js → p-c327bfce.entry.js} +1 -1
- package/dist/webcomponents/{p-f46fb2d9.entry.js → p-c3f1960b.entry.js} +1 -1
- package/dist/webcomponents/{p-c194d17a.entry.js → p-c8f33aea.entry.js} +1 -1
- package/dist/webcomponents/{p-5ccb728c.entry.js → p-d9e346c4.entry.js} +1 -1
- package/dist/webcomponents/{p-50b811f4.entry.js → p-da33c143.entry.js} +1 -1
- package/dist/webcomponents/p-e40406fd.entry.js +1 -0
- package/dist/webcomponents/{p-20c458f7.entry.js → p-ea4edb88.entry.js} +1 -1
- package/dist/webcomponents/{p-1d5f8765.entry.js → p-f6a5fa32.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-02c1d94b.entry.js +0 -1
- package/dist/webcomponents/p-2e82ff3a.entry.js +0 -1
- package/dist/webcomponents/p-69e5695c.entry.js +0 -1
- package/dist/webcomponents/p-702a1d50.entry.js +0 -1
- package/dist/webcomponents/p-7c20ec17.entry.js +0 -1
- package/dist/webcomponents/p-8590f629.entry.js +0 -1
- package/dist/webcomponents/p-NMTsmUsG.js +0 -1
|
@@ -7,7 +7,7 @@ import './Business-BCoP0TAV.js';
|
|
|
7
7
|
import './Dispute-BH0Xfn-F.js';
|
|
8
8
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
9
9
|
import { E as ErrorState } from './utils-DRwofES0.js';
|
|
10
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
10
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
11
11
|
import './config-state-DiHV-4QK.js';
|
|
12
12
|
import './index-DJ9G-4S-.js';
|
|
13
13
|
import './utils-BOijEGPV.js';
|
|
@@ -15,7 +15,7 @@ import './dinero-HXpYMWUU.js';
|
|
|
15
15
|
import './helpers-Mu7LQT-w.js';
|
|
16
16
|
import './state-options-BX8GieXu.js';
|
|
17
17
|
import './parts-xDbRW9xn.js';
|
|
18
|
-
import './package-
|
|
18
|
+
import './package-CaO1cY-g.js';
|
|
19
19
|
|
|
20
20
|
const api = Api();
|
|
21
21
|
class ReportsService {
|
|
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent } from './index-DOjVAAtq.js'
|
|
|
2
2
|
import { am as heading5, aj as heading4, af as buttonPrimary, D as text } from './parts-xDbRW9xn.js';
|
|
3
3
|
import { S as StyledHost } from './styled-host-OalOsPBp.js';
|
|
4
4
|
import './event-types-CZfYo5-1.js';
|
|
5
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
5
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
6
6
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
7
7
|
import { B as BusinessService } from './business.service-D55OVyco.js';
|
|
8
8
|
import { B as Business } from './Business-BCoP0TAV.js';
|
|
@@ -16,7 +16,7 @@ import './Dispute-BH0Xfn-F.js';
|
|
|
16
16
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
17
17
|
import { T as TerminalService } from './terminal.service-l6zTIPZ3.js';
|
|
18
18
|
import { l as formatPhoneNumber } from './utils-BOijEGPV.js';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-CaO1cY-g.js';
|
|
20
20
|
import './Api-DhiA2e_P.js';
|
|
21
21
|
import './helpers-Mu7LQT-w.js';
|
|
22
22
|
import './state-options-BX8GieXu.js';
|
|
@@ -3,7 +3,7 @@ import { P as PaymentService } from './payment.service-BoQ1MW1k.js';
|
|
|
3
3
|
import { m as makeGetPaymentDetails } from './get-payment-details-sGoWyAat.js';
|
|
4
4
|
import { E as ErrorState } from './utils-DRwofES0.js';
|
|
5
5
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
6
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
6
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
7
7
|
import './Api-DhiA2e_P.js';
|
|
8
8
|
import './config-state-DiHV-4QK.js';
|
|
9
9
|
import './index-DJ9G-4S-.js';
|
|
@@ -17,7 +17,7 @@ import './helpers-Mu7LQT-w.js';
|
|
|
17
17
|
import './state-options-BX8GieXu.js';
|
|
18
18
|
import './utils-BeQLScSm.js';
|
|
19
19
|
import './parts-xDbRW9xn.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-CaO1cY-g.js';
|
|
21
21
|
|
|
22
22
|
const PaymentDetails = class {
|
|
23
23
|
constructor(hostRef) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-DOjVAAtq.js';
|
|
2
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
2
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
3
3
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
4
4
|
import { m as makeGetBusiness, a as makePostProvisioning } from './payment-provisioning-actions-ONP8lDnV.js';
|
|
5
5
|
import { B as BusinessService } from './business.service-D55OVyco.js';
|
|
@@ -8,7 +8,7 @@ import './Refund-B-iOTRxz.js';
|
|
|
8
8
|
import './Pagination-CLHwhyvu.js';
|
|
9
9
|
import './Business-BCoP0TAV.js';
|
|
10
10
|
import './Dispute-BH0Xfn-F.js';
|
|
11
|
-
import './package-
|
|
11
|
+
import './package-CaO1cY-g.js';
|
|
12
12
|
import './utils-BeQLScSm.js';
|
|
13
13
|
import './config-state-DiHV-4QK.js';
|
|
14
14
|
import './index-DJ9G-4S-.js';
|
|
@@ -6,7 +6,7 @@ import { g as PaymentBalanceTransaction } from './Refund-B-iOTRxz.js';
|
|
|
6
6
|
import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
|
|
7
7
|
import './Business-BCoP0TAV.js';
|
|
8
8
|
import './Dispute-BH0Xfn-F.js';
|
|
9
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
9
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
11
|
import { P as PaymentService } from './payment.service-BoQ1MW1k.js';
|
|
12
12
|
import { T as Table, l as TableWrapper, a as TableComponent, b as TableHead, c as TableHeadRow, d as TableBody, e as TableLoadingState, f as TableEmptyState, g as TableErrorState, h as TableRow, i as TableFoot, j as TableFootRow, k as TableFootCell } from './table-Bj20uWfu.js';
|
|
@@ -17,7 +17,7 @@ import { S as tableHeadCell, T as getAlternateTableCellPart } from './parts-xDbR
|
|
|
17
17
|
import './index-DJ9G-4S-.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-CaO1cY-g.js';
|
|
21
21
|
import './Api-DhiA2e_P.js';
|
|
22
22
|
import './spinner-CYXkn1fh.js';
|
|
23
23
|
|
|
@@ -8,7 +8,7 @@ import './Pagination-CLHwhyvu.js';
|
|
|
8
8
|
import './Business-BCoP0TAV.js';
|
|
9
9
|
import './Dispute-BH0Xfn-F.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
11
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
12
12
|
import { S as StyledHost } from './styled-host-OalOsPBp.js';
|
|
13
13
|
import './event-types-CZfYo5-1.js';
|
|
14
14
|
import { d as defaultColumnsKeys } from './payments-table-D_BlyU1F.js';
|
|
@@ -17,7 +17,7 @@ import './utils-BOijEGPV.js';
|
|
|
17
17
|
import './index-DJ9G-4S-.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-CaO1cY-g.js';
|
|
21
21
|
import './payments-status-cvtVmtY5.js';
|
|
22
22
|
import './badge-CtdO-tEY.js';
|
|
23
23
|
import './parts-xDbRW9xn.js';
|
|
@@ -9,7 +9,7 @@ import './Business-BCoP0TAV.js';
|
|
|
9
9
|
import './Dispute-BH0Xfn-F.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
11
|
import { E as ErrorState } from './utils-DRwofES0.js';
|
|
12
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
12
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
13
13
|
import { m as makeGetPayoutCSV } from './get-payout-csv-D-Lnooki.js';
|
|
14
14
|
import './Api-DhiA2e_P.js';
|
|
15
15
|
import './utils-BOijEGPV.js';
|
|
@@ -17,7 +17,7 @@ import './index-DJ9G-4S-.js';
|
|
|
17
17
|
import './helpers-Mu7LQT-w.js';
|
|
18
18
|
import './state-options-BX8GieXu.js';
|
|
19
19
|
import './parts-xDbRW9xn.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-CaO1cY-g.js';
|
|
21
21
|
|
|
22
22
|
const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
23
23
|
var _a;
|
|
@@ -6,7 +6,7 @@ import { h as PayoutBalanceTransaction } from './Refund-B-iOTRxz.js';
|
|
|
6
6
|
import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
|
|
7
7
|
import './Business-BCoP0TAV.js';
|
|
8
8
|
import './Dispute-BH0Xfn-F.js';
|
|
9
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
9
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
11
|
import { P as PayoutService } from './payout.service-xcBdom3q.js';
|
|
12
12
|
import { T as Table, l as TableWrapper, a as TableComponent, b as TableHead, c as TableHeadRow, d as TableBody, e as TableLoadingState, f as TableEmptyState, g as TableErrorState, h as TableRow, i as TableFoot, j as TableFootRow, k as TableFootCell } from './table-Bj20uWfu.js';
|
|
@@ -17,7 +17,7 @@ import { S as tableHeadCell, T as getAlternateTableCellPart } from './parts-xDbR
|
|
|
17
17
|
import './index-DJ9G-4S-.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-CaO1cY-g.js';
|
|
21
21
|
import './Api-DhiA2e_P.js';
|
|
22
22
|
import './spinner-CYXkn1fh.js';
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-DOjVAAtq.js';
|
|
2
2
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
3
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
3
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
4
4
|
import { P as PayoutService } from './payout.service-xcBdom3q.js';
|
|
5
5
|
import './config-state-DiHV-4QK.js';
|
|
6
6
|
import './dinero-HXpYMWUU.js';
|
|
@@ -14,7 +14,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
|
|
|
14
14
|
import { S as StyledHost } from './styled-host-OalOsPBp.js';
|
|
15
15
|
import './event-types-CZfYo5-1.js';
|
|
16
16
|
import { d as defaultColumnsKeys } from './payouts-table-Clj8YGLV.js';
|
|
17
|
-
import './package-
|
|
17
|
+
import './package-CaO1cY-g.js';
|
|
18
18
|
import './Api-DhiA2e_P.js';
|
|
19
19
|
import './utils-BOijEGPV.js';
|
|
20
20
|
import './index-DJ9G-4S-.js';
|
|
@@ -12,7 +12,7 @@ import { S as StyledHost } from './styled-host-OalOsPBp.js';
|
|
|
12
12
|
import './event-types-CZfYo5-1.js';
|
|
13
13
|
import { P as PaymentService } from './payment.service-BoQ1MW1k.js';
|
|
14
14
|
import { m as makeGetPaymentDetails } from './get-payment-details-sGoWyAat.js';
|
|
15
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
15
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
16
16
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
17
17
|
import { A as Api } from './Api-DhiA2e_P.js';
|
|
18
18
|
import { S as Skeleton } from './skeleton-B8EUwt4b.js';
|
|
@@ -22,7 +22,7 @@ import './index-DJ9G-4S-.js';
|
|
|
22
22
|
import './helpers-Mu7LQT-w.js';
|
|
23
23
|
import './state-options-BX8GieXu.js';
|
|
24
24
|
import './parts-xDbRW9xn.js';
|
|
25
|
-
import './package-
|
|
25
|
+
import './package-CaO1cY-g.js';
|
|
26
26
|
|
|
27
27
|
const amountValidation = (maxAmount) => {
|
|
28
28
|
const max = +maxAmount;
|
|
@@ -6,7 +6,7 @@ import './Pagination-CLHwhyvu.js';
|
|
|
6
6
|
import './Business-BCoP0TAV.js';
|
|
7
7
|
import './Dispute-BH0Xfn-F.js';
|
|
8
8
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
9
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
9
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
10
10
|
import { c as checkoutStore } from './checkout.store-4nUf2OuT.js';
|
|
11
11
|
import { p as processHTML, f as formatCurrency, r as removeAttribute, j as addAttribute } from './utils-BOijEGPV.js';
|
|
12
12
|
import { v as validateInsuranceValues, i as insuranceValues, a as insuranceErrors, H as Header2 } from './insurance-state-CVme82j7.js';
|
|
@@ -18,7 +18,7 @@ import './config-state-DiHV-4QK.js';
|
|
|
18
18
|
import './index-DJ9G-4S-.js';
|
|
19
19
|
import './helpers-Mu7LQT-w.js';
|
|
20
20
|
import './state-options-BX8GieXu.js';
|
|
21
|
-
import './package-
|
|
21
|
+
import './package-CaO1cY-g.js';
|
|
22
22
|
import './index-DCIW8z1f.js';
|
|
23
23
|
import './dinero-HXpYMWUU.js';
|
|
24
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-DOjVAAtq.js';
|
|
2
2
|
import { S as StyledHost } from './styled-host-OalOsPBp.js';
|
|
3
3
|
import './event-types-CZfYo5-1.js';
|
|
4
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
4
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
5
5
|
import { d as defaultColumnsKeys } from './terminal-orders-table-DzBpIW8i.js';
|
|
6
6
|
import './config-state-DiHV-4QK.js';
|
|
7
7
|
import './dinero-HXpYMWUU.js';
|
|
@@ -12,7 +12,7 @@ import './Business-BCoP0TAV.js';
|
|
|
12
12
|
import './Dispute-BH0Xfn-F.js';
|
|
13
13
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
14
14
|
import { A as Api } from './Api-DhiA2e_P.js';
|
|
15
|
-
import './package-
|
|
15
|
+
import './package-CaO1cY-g.js';
|
|
16
16
|
import './parts-xDbRW9xn.js';
|
|
17
17
|
import './utils-BOijEGPV.js';
|
|
18
18
|
import './badge-CtdO-tEY.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-DOjVAAtq.js';
|
|
2
2
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
3
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
3
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-BUjV-MqL.js';
|
|
4
4
|
import { T as TerminalService } from './terminal.service-l6zTIPZ3.js';
|
|
5
5
|
import './config-state-DiHV-4QK.js';
|
|
6
6
|
import './dinero-HXpYMWUU.js';
|
|
@@ -13,7 +13,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
|
|
|
13
13
|
import { S as StyledHost } from './styled-host-OalOsPBp.js';
|
|
14
14
|
import './event-types-CZfYo5-1.js';
|
|
15
15
|
import { d as defaultColumnsKeys } from './terminals-table-BMS5tazC.js';
|
|
16
|
-
import './package-
|
|
16
|
+
import './package-CaO1cY-g.js';
|
|
17
17
|
import './Api-DhiA2e_P.js';
|
|
18
18
|
import './utils-BOijEGPV.js';
|
|
19
19
|
import './index-DJ9G-4S-.js';
|
package/dist/module/apple-pay.js
CHANGED
package/dist/module/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-DOjVAAtq.js";import{E as r}from"./p-CH8Y3GSr.js";import{B as o}from"./p-DQZ5VHTZ.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-DOjVAAtq.js";import{E as r}from"./p-CH8Y3GSr.js";import{B as o}from"./p-DQZ5VHTZ.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as n,J as h}from"./p-BlOkWGxk.js";import"./p-xDbRW9xn.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-CaO1cY-g.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){n(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-DOjVAAtq.js";import{c as r,F as e}from"./p-DiJD6Iqx.js";import{b as o,a}from"./p-C9iide2W.js";import{i as p,a as h}from"./p-tYuXMkCd.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import{B as m,b as c}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as d,J as j}from"./p-BlOkWGxk.js";import{B as u}from"./p-C9EQ459H.js";import{S as f}from"./p-BhCH9S0e.js";import{H as v}from"./p-RQzxYnz_.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-T2yENPvU.js";import{B as C}from"./p-XYgDHrVL.js";import{m as g,b as w}from"./p-5aA7gjr5.js";import{B as x}from"./p-DQZ5VHTZ.js";import"./p-BFTU3MAI.js";import"./p-PSJOKMWp.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-Dt-vy9Le.js";import"./p-CaO1cY-g.js";import"./p-DdZLLkQ5.js";import"./p-xDbRW9xn.js";import"./p-D2muobcE.js";const y=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),B=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),k=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(B,null),s(B,null),s(B,null)),D=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){d(),this.analytics=new j(this),this.formController=new e(y),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=g({authToken:this.authToken,businessId:this.businessId,service:new x}),this.patchBusiness=w({authToken:this.authToken,businessId:this.businessId,service:new x}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=c.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(k,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:C.submit}),isLoading:this.isSaving},"Submit")))))}};export{D as justifi_business_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-DOjVAAtq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as s,a as i}from"./p-Cjcsf8ku.js";import{g as n}from"./p-C98BC5W5.js";import{p as r}from"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as o,J as c}from"./p-BlOkWGxk.js";import{g as p,a as h}from"./p-D2muobcE.js";import{P as d}from"./p-BjNuRWXK.js";import{T as f,l,a as u,b as m,c as b,d as y,e as _,f as j,g,h as T,i as k,j as w,k as C}from"./p-C0wTyoTh.js";import{S as v}from"./p-BhCH9S0e.js";import{T as D}from"./p-CZfYo5-1.js";import{a as S}from"./p-Bgnhf5c9.js";import{S as x,T as R}from"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-CaO1cY-g.js";import"./p-DdZLLkQ5.js";import"./p-h5pyZngT.js";const B={created_at:()=>t("th",{part:x,scope:"col",title:"The date and time each transaction was made"},"Processed On"),type:()=>t("th",{part:x,scope:"col",title:"The type of each transaction"},"Type"),id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of each transaction"},"ID"),amount:()=>t("th",{part:x,scope:"col",title:"The dollar amount of each transaction",class:"text-end"},"Amount"),balance:()=>t("th",{part:x,scope:"col",title:"The running total amount of this payment that belongs to you",class:"text-end"},"Balance"),currency:()=>t("th",{part:x,scope:"col",title:"The currency of each transaction"},"Currency"),financial_transaction_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),payment_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the payment associated with the payment balance transaction"},"Payment ID"),payment_balance_txn_type:()=>t("th",{part:x,scope:"col",title:"The type of the payment balance transaction"},"Transaction Type"),source_id:()=>t("th",{part:x,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),source_type:()=>t("th",{part:x,scope:"col",title:"The type of the source object associated with the payment balance transaction"},"Source Type")},F={ach_return:"ACH Return",ach_return_fee:"ACH Return Fee",dispute:"Dispute",dispute_fee:"Dispute Fee",dispute_fee_refund:"Dispute Fee Refund",dispute_refund:"Dispute Refund",payment:"Payment",payment_fee:"Fee",refund:"Refund",fee_refund:"Fee Refund",application_fee_returned:"Application Fee Returned",refund_failure:"Refund Failure",void:"Void"},A={created_at:(e,a)=>t("td",{part:R(a)},t("div",{class:"fw-bold"},S(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},S(e.created_at,{showTime:!0}))),type:(e,a)=>t("td",{part:R(a)},F[e.payment_balance_txn_type]),id:(e,a)=>t("td",{part:R(a)},e.id),amount:(e,a)=>t("td",{part:R(a),class:"text-end"},e.formattedPaymentAmount(e.amount)),balance:(e,a)=>t("td",{part:R(a),class:"text-end"},e.formattedPaymentAmount(e.balance)),currency:(e,a)=>t("td",{part:R(a)},e.currency),financial_transaction_id:(e,a)=>t("td",{part:R(a)},e.financial_transaction_id),payment_id:(e,a)=>t("td",{part:R(a)},e.payment_id),payment_balance_txn_type:(e,a)=>t("td",{part:R(a)},e.payment_balance_txn_type),source_id:(e,a)=>t("td",{part:R(a)},e.source_id),source_type:(e,a)=>t("td",{part:R(a)},e.source_type)},I=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=r,this.pagingParams={},this.columns="created_at,type,id,amount,balance",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:D.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:D.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:D.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,B,A),o(),this.analytics=new c(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.paymentId&&this.authToken?(({id:t,authToken:e,service:a})=>async({params:i,onSuccess:r,onError:o,final:c})=>{var d;try{const c=await a.fetchPaymentTransactions(t,e,i);c.error?o({error:h(c.error),code:p(null===(d=c.error)||void 0===d?void 0:d.code),severity:s.ERROR}):r({balanceTransactions:c.data.map((t=>new n(t))),pagingInfo:Object.assign({},c.page_info)})}catch(t){const e=p(null==t?void 0:t.code);o({error:h(t),code:e,severity:s.ERROR})}finally{c()}})({id:this.paymentId,authToken:this.authToken,service:new d})({params:this.pagingParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payment-id and auth-token props are required",this.handleError(i.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}render(){return t(v,{key:"a00f8b0ba0e96bba423c6933fc9eebd19f5f61cd"},t(l,{key:"b1ad1863482835106c6ec1b5fe7c3f9bb294a316"},t(u,{key:"f20d05de3f0a4d60734bfb366ebaf11a5b9fa4d0"},t(m,{key:"d4aa85002f25923d79670687d80090422e4f09a3"},t(b,{key:"99dba50d00c0ab2ba4f140424ff534936fd15c9e"},this.transactionsTable.columnData.map((t=>t)))),t(y,{key:"5526e3cffc2d43f6f6cbd755afbcffd3d036ebe9"},t(_,{key:"a5cf0dcf867feba1a1a8c4419e5f6c868510eb82",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(j,{key:"62f38aa3ea3758f6a113b2370c17670fa38fd322",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(g,{key:"a86ba5ae455119f12fa01a56c6826cc3a08d7c3b",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"302041a89f00caa4e440bad8bd5148f9b51b405e"},t(w,{key:"c1071b23b4dc07c94674d0addabc8cdc7bc7ca3c"},t(C,{key:"2144fdc702e20c8c839b5d8c231bf1d3b16df234",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"71589bd15b0af2d1eb6bad533e294e480ba36ca3",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],paymentId:["propChanged"],authToken:["propChanged"]}}};export{I as justifi_payment_transactions_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{P as r}from"./p-BjNuRWXK.js";import{m as e}from"./p-DWn9BiNn.js";import{E as p}from"./p-CH8Y3GSr.js";import{C as o,a as n}from"./p-Cjcsf8ku.js";import{c as a,J as h}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{P as r}from"./p-BjNuRWXK.js";import{m as e}from"./p-DWn9BiNn.js";import{E as p}from"./p-CH8Y3GSr.js";import{C as o,a as n}from"./p-Cjcsf8ku.js";import{c as a,J as h}from"./p-BlOkWGxk.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-xDbRW9xn.js";import"./p-CaO1cY-g.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.recordClickEvent=s(this,"record-click-event"),this.errorMessage=null,this.paymentService=new r,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.handleRecordClickEvent=t=>{this.recordClickEvent.emit({id:t.detail.id,type:t.detail.type})}}componentWillLoad(){a(),this.analytics=new h(this),this.initializeGetPaymentDetails()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=e({id:this.paymentId,authToken:this.authToken,service:new r}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:n.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?p(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent,"onRecord-click-event":this.handleRecordClickEvent,"enable-record-click":"true"})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,c as s,h as t}from"./p-DOjVAAtq.js";import{S as i}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{c as e,J as o}from"./p-BlOkWGxk.js";import{d as a}from"./p-BBx_EQqR.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as n,a as p}from"./p-Cjcsf8ku.js";import{i as c}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as m,a as h}from"./p-D2muobcE.js";import{A as d}from"./p-DdZLLkQ5.js";import"./p-CaO1cY-g.js";import"./p-xDbRW9xn.js";import"./p-Bgnhf5c9.js";import"./p-hbWSMN3O.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const l=d();class f{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const j=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=a,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){e(),this.analytics=new o(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:e,onError:o,final:a})=>{var p,d;try{const a=await t.fetchTerminalOrders(r,s,i);if(a.error)return o({error:h(a.error),code:m(null===(d=a.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const r=Object.assign({},a.page_info);e({terminalOrders:(null===(p=a.data)||void 0===p?void 0:p.map((r=>new c(r))))||[],pagingInfo:r})}}catch(r){const s=m(null==r?void 0:r.code);return o({error:r.message||r,code:s,severity:n.ERROR})}finally{return a()}})({id:this.accountId,authToken:this.authToken,service:new f}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return t(i,{key:"2a1b18985b1775ef97f0ef03a122ecc42a66fe15"},t("terminal-orders-list-core",{key:"a5950f3c91a5bfb09202f2db5acd367635d7bd94",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{j as justifi_terminal_orders_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-DOjVAAtq.js";import{c as
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-DOjVAAtq.js";import{c as a,J as s}from"./p-BlOkWGxk.js";import{c as d}from"./p-DGsXKF67.js";import{d as c}from"./p-xDbRW9xn.js";import{S as o}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{P as h}from"./p-DCIW8z1f.js";import"./p-CaO1cY-g.js";import"./p-DdZLLkQ5.js";import"./p-a6tcNl_T.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-C98BC5W5.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const l=class{constructor(i){e(this,i),this.errorEvent=t(this,"error-event"),this.loadedEvent=t(this,"loaded"),this.submitEvent=t(this,"submit-event"),this.availablePaymentMethods=[],this.errorMessage="",this.insuranceToggled=!1,this.isSubmitting=!1,this.disableBankAccount=!1,this.disableBnpl=!1,this.disableCreditCard=!1,this.disablePaymentMethodGroup=!1,this.hideBankAccountBillingForm=!1,this.hideCardBillingForm=!1}propChanged(){this.updateStore()}connectedCallback(){this.authToken&&this.checkoutId&&this.updateStore()}componentWillLoad(){a(),this.analytics=new s(this)}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup()}checkoutComplete(e){this.isSubmitting=!1}checkoutError(e){this.isSubmitting=!1}checkoutChanged(e){this.availablePaymentMethods=this.disableBnpl?e.detail.availablePaymentMethodTypes.filter((e=>e!==h.SEZZLE)):e.detail.availablePaymentMethodTypes}async fillBillingForm(e){var t;d.billingFormFields=e,null===(t=this.tokenizePaymentMethodRef)||void 0===t||t.fillBillingForm(e)}async validate(){var e;return{isValid:await(null===(e=this.modularCheckoutRef)||void 0===e?void 0:e.validate())}}updateStore(){d.checkoutId=this.checkoutId,d.authToken=this.authToken,d.disableCreditCard=this.disableCreditCard,d.disableBankAccount=this.disableBankAccount,d.disablePaymentMethodGroup=this.disablePaymentMethodGroup}async submit(e){var t;this.isSubmitting=!0,null===(t=this.modularCheckoutRef)||void 0===t||t.submitCheckout(d.billingFormFields)}get showPaymentTypeHeader(){return!this.disableCreditCard&&!this.disableBankAccount}render(){var e,t;return i(o,{key:"468b97261a110d5779ac742de45248aadfbeeb6c"},i("justifi-modular-checkout",{key:"7ce8d2e147f0b91ad93996f7e044a3fe2a9bd604",ref:e=>{this.modularCheckoutRef=e},authToken:this.authToken,checkoutId:this.checkoutId},i("div",{key:"7ace65df988d338d0cc810a532f8914a046e7268",class:"row gy-3 jfi-checkout-core"},i("div",{key:"3c6223ef06c7a2b42bef97dd67f5f09f21bb248b",class:"col-12",part:c},i("justifi-header",{key:"622b2ef667ab222a3152134573e7191bf2fa6117",text:"Summary",level:"h2",class:"fs-5 fw-bold pb-3"}),i("section",{key:"036b447e7e92b1c6bfe33aff5d07a35bc2d9a915"},i("justifi-checkout-summary",{key:"292c0b09960046e78b902652e5b0902129715ef5"}))),i("div",{key:"5d27c5a5d3f026ad9f9da37833f8ecf808a89de9",class:"col-12 mt-4"},i("slot",{key:"1a583d890039b1c3a4493a0687ac5a9caa21d2b3",name:"insurance"})),i("div",{key:"0d7427acc37518888fceef97431f594fb4ea2359",class:"col-12 mt-4"},i("justifi-header",{key:"5543bc55d4be2de9064b4c4924ecd7d2f32da7d9",text:"Payment",level:"h2",class:"fs-5 fw-bold pb-3"}),this.showPaymentTypeHeader&&i("justifi-header",{key:"80a17876009d3c6e39017432053e3ab18b6d406e",text:"Select payment type",level:"h3",class:"fs-6 fw-bold lh-lg"}),i("div",{key:"eac0e3466d8cf74df53acd1252d11d0461d0a263",class:"d-flex flex-column"},i("section",{key:"1e27c56d333a44760d552549a716b39b1bcc538f"},i("div",{key:"65680e1ed1a3eccc84ec67797f468edafcb65a80"},i("justifi-saved-payment-methods",{key:"800e1e6312f8a38856341b5bc78c93a9fc18434e"}),this.availablePaymentMethods.includes(h.APPLE_PAY)&&i("div",{key:"0e5d9164a0066b88e7b9467bbb25167262614087",class:"mb-3"},i("justifi-apple-pay",{key:"81717e6193aa402eef18cf006b74798d02811a8d"})),this.availablePaymentMethods.includes(h.SEZZLE)&&i("justifi-radio-list-item",{key:"6405f56f8ee450d410801056c362580a6457325f",name:"paymentMethodType",value:h.SEZZLE,checked:(null===(e=null==d?void 0:d.selectedPaymentMethod)||void 0===e?void 0:e.type)===h.SEZZLE,label:i("justifi-sezzle-payment-method",{ref:e=>this.sezzlePaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.sezzlePaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),this.availablePaymentMethods.includes(h.PLAID)&&!this.disableBnpl&&i("justifi-radio-list-item",{key:"d2b920050db52162f5f1fee2ee46884f50f511e8",name:"paymentMethodType",value:h.PLAID,checked:(null===(t=null==d?void 0:d.selectedPaymentMethod)||void 0===t?void 0:t.type)===h.PLAID,label:i("justifi-plaid-payment-method",{ref:e=>this.plaidPaymentMethodRef=e}),"onRadio-click":()=>{var e;null===(e=this.plaidPaymentMethodRef)||void 0===e||e.handleSelectionClick()}}),i("justifi-tokenize-payment-method",{key:"c160cd5403029ce3e1cac142cf1e782c104e97f2",ref:e=>this.tokenizePaymentMethodRef=e,authToken:this.authToken,accountId:d.accountId,disableCreditCard:this.disableCreditCard,disableBankAccount:this.disableBankAccount,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,hideSubmitButton:!0,paymentMethodGroupId:d.paymentMethodGroupId}))))),i("div",{key:"6e03db84ccbfab811c72e4df5ffaf23c8822539b",class:"mt-4"},i("justifi-button",{key:"93bb084fdcce73aebed63ad887ced32c4d47ef7f",text:"Pay",type:"submit",variant:"primary",clickHandler:e=>this.submit(e),disabled:this.isSubmitting,isLoading:this.isSubmitting,customStyle:{width:"100%",textAlign:"center"}})))))}static get watchers(){return{authToken:["propChanged"],checkoutId:["propChanged"],disableCreditCard:["propChanged"],disableBankAccount:["propChanged"],disablePaymentMethodGroup:["propChanged"]}}};export{l as justifi_checkout}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,r as e,c as a}from"./p-DOjVAAtq.js";import{c as i}from"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as s,a as o}from"./p-Cjcsf8ku.js";import{h as r}from"./p-C98BC5W5.js";import{p as c}from"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as n,J as p}from"./p-BlOkWGxk.js";import{g as h,a as d}from"./p-D2muobcE.js";import{P as l}from"./p-8S_ROmnq.js";import{T as f,l as u,a as m,b,c as y,d as _,e as w,f as T,g as j,h as g,i as k,j as v,k as C}from"./p-C0wTyoTh.js";import{S as D}from"./p-BhCH9S0e.js";import{T as S}from"./p-CZfYo5-1.js";import{a as P}from"./p-Bgnhf5c9.js";import{S as I,T as O}from"./p-xDbRW9xn.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-CaO1cY-g.js";import"./p-DdZLLkQ5.js";import"./p-h5pyZngT.js";const q={id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of each transaction"},"ID"),account_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the account associated with each transaction"},"Account ID"),payout_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the payout associated with each transaction"},"Payout ID"),financial_transaction_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the financial transaction associated with the payment balance transaction"},"Financial Transaction ID"),amount:()=>t("th",{part:I,scope:"col",title:"The dollar amount of each transaction"},"Amount"),fee:()=>t("th",{part:I,scope:"col",title:"The fee associated with each transaction"},"Fee"),net:()=>t("th",{part:I,scope:"col",title:"The net amount of each transaction"},"Net"),currency:()=>t("th",{part:I,scope:"col",title:"The currency of each transaction"},"Currency"),description:()=>t("th",{part:I,scope:"col",title:"The description of each transaction"},"Description"),source_id:()=>t("th",{part:I,scope:"col",title:"The unique identifier of the source object associated with the payment balance transaction"},"Source ID"),txn_type:()=>t("th",{part:I,scope:"col",title:"The type of each transaction"},"Type"),created_at:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction was made"},"Processed On"),available_on:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction will be available"},"Available On"),updated_at:()=>t("th",{part:I,scope:"col",title:"The date and time each transaction was last updated"},"Updated On")},x={fee:"Fee",payment:"Payment",payout:"Payout",seller_payment_refund:"Seller Payment Refund",dispute_amount_collected:"Dispute Amount Collected",dispute_fee_collected:"Dispute Fee Collected",seller_payment:"Seller Payment",transfer:"Transfer",partner_platform_proceeds_credit:"Partner Platform Proceeds Credit"},A={id:e=>t("td",{part:O(e.id)},e.id),account_id:e=>t("td",{part:O(e.account_id)},e.account_id),payout_id:e=>t("td",{part:O(e.payout_id)},e.payout_id),financial_transaction_id:e=>t("td",{part:O(e.financial_transaction_id)},e.financial_transaction_id),amount:e=>t("td",{part:O(e.amount)},e.formattedPaymentAmount(e.amount)),fee:e=>t("td",{part:O(e.fee)},e.formattedPaymentAmount(e.fee)),net:e=>t("td",{part:O(e.net)},e.formattedPaymentAmount(e.net)),currency:e=>t("td",{part:O(e.currency)},e.currency),description:e=>t("td",{part:O(e.description)},e.description),source_id:e=>t("td",{part:O(e.source_id)},e.source_id),txn_type:e=>t("td",{part:O(e.txn_type)},x[e.txn_type]),created_at:e=>t("td",{part:O(e.created_at)},t("div",{class:"fw-bold"},P(e.created_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},P(e.created_at,{showTime:!0}))),available_on:e=>t("td",{part:O(e.available_on)},t("div",{class:"fw-bold"},P(e.available_on,{showDisplayDate:!0})),t("div",{class:"fw-bold"},P(e.available_on,{showTime:!0}))),updated_at:e=>t("td",{part:O(e.updated_at)},t("div",{class:"fw-bold"},P(e.updated_at,{showDisplayDate:!0})),t("div",{class:"fw-bold"},P(e.updated_at,{showTime:!0})))},B=class{constructor(t){e(this,t),this.clickEvent=a(this,"click-event"),this.errorEvent=a(this,"error-event"),this.balanceTransactions=[],this.isLoading=!0,this.errorMessage=null,this.paging=c,this.pagingParams={},this.columns="created_at,txn_type,description,amount,fee,net",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:S.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:S.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const a=this.balanceTransactions.find((t=>t.id===e));this.clickEvent.emit({name:S.row,data:a})}}componentWillLoad(){this.transactionsTable=new f(this.balanceTransactions,this.columns,q,A),n(),this.analytics=new p(this),this.initializeApi()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeApi()}handleError(t,e,a){this.isLoading=!1,this.errorEvent.emit({errorCode:t,message:e,severity:a})}initializeApi(){this.payoutId&&this.authToken?(({accountId:t,authToken:e,service:a})=>async({params:i,onSuccess:o,onError:c,final:n})=>{var p;try{const n=await a.fetchPayoutTransactions(t,e,i);n.error?c({error:d(n.error),code:h(null===(p=n.error)||void 0===p?void 0:p.code),severity:s.ERROR}):o({balanceTransactions:n.data.map((t=>new r(t))),pagingInfo:Object.assign({},n.page_info)})}catch(t){const e=h(null==t?void 0:t.code);c({error:d(t),code:e,severity:s.ERROR})}finally{n()}})({accountId:i.accountId,authToken:this.authToken,service:new l})({params:this.requestParams,onSuccess:({balanceTransactions:t,pagingInfo:e})=>{this.balanceTransactions=t,this.paging=e,this.transactionsTable.collectionData=this.balanceTransactions},onError:({error:t,code:e,severity:a})=>{this.errorMessage=t.message,this.handleError(t,e,a)},final:()=>{this.isLoading=!1}}):(this.errorMessage="payout-id and auth-token props are required",this.handleError(o.MISSING_PROPS,this.errorMessage,s.ERROR))}get entityId(){return this.balanceTransactions.map((t=>t.id))}get showEmptyState(){return!this.isLoading&&!this.errorMessage&&this.transactionsTable.rowData.length<1}get showErrorState(){return!this.isLoading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.isLoading}get requestParams(){return Object.assign({payout_id:this.payoutId,limit:"15"},this.pagingParams)}render(){return t(D,{key:"a0ff80867bc3c0bf198165229f693d7748ffc7a4"},t(u,{key:"779cc5602f6221e0f704484bf962b72b266d95f8"},t(m,{key:"7b4b56e9712533ba2b50a875d282ef4bd5efdcaf"},t(b,{key:"8ecd93d56bdbdb1417b260dd013315b21958f363"},t(y,{key:"9fa0fea238a9f76c71d5b8fc5443ca2c9e56b13b"},this.transactionsTable.columnData.map((t=>t)))),t(_,{key:"f7d94388eddaf848e4868005e985a1158577c70f"},t(w,{key:"c83742e9e3ecbcdaba29f2aa121ec4c101a55632",columnSpan:this.transactionsTable.columnKeys.length,isLoading:this.isLoading}),t(T,{key:"fa0404328357e11527cff2c3eb15536ee458557b",isEmpty:this.showEmptyState,columnSpan:this.transactionsTable.columnKeys.length}),t(j,{key:"71add0ef95310fd49e403d65c2a23ea8f73c71b6",columnSpan:this.transactionsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.transactionsTable.rowData.map(((e,a)=>t(g,{"data-test-id":"table-row","data-row-entity-id":this.entityId[a],onClick:this.rowClickHandler},e)))),this.paging&&t(k,{key:"073af8dce5dabb2db604ae50e6ace6a4ace18e6f"},t(v,{key:"3f3906a106b3c41311a0e1309aea779e865bf0f5"},t(C,{key:"85b46ef2a297aab3a450d49dd086ec6e7e1ab027",colSpan:this.transactionsTable.columnData.length},t("pagination-menu",{key:"548131521a5fcf1562b286097635f5f62414a28c",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["propChanged"],payoutId:["propChanged"],authToken:["propChanged"]}}};export{B as justifi_payout_transactions_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,r as t,c as i,H as s,g as n}from"./p-DOjVAAtq.js";import{A as o}from"./p-DdZLLkQ5.js";import{S as a}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{S as r}from"./p-T2yENPvU.js";import{c as l,o as c,g as h,a as d}from"./p-DGsXKF67.js";import{D as p,r as u}from"./p-xDbRW9xn.js";import{f as y}from"./p-Bgnhf5c9.js";import{H as m}from"./p-RQzxYnz_.js";import{H as v,b as M,h as f,i as b}from"./p-wQgEEOq_.js";import{H as g}from"./p-BoQ6_4Ks.js";import{J as k,c as A}from"./p-BlOkWGxk.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as w,a as P,b as j}from"./p-Cjcsf8ku.js";import{I as T}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as C,a as N}from"./p-D2muobcE.js";import{C as S}from"./p-CEk3bv0x.js";import{P as E,a as I,b as D}from"./p-DCIW8z1f.js";import{C as O}from"./p-ZpPDShvP.js";import"./p-DdMxswn1.js";import"./p-CaO1cY-g.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";var x,L,z,_,R;!function(e){e.STATUS_SUCCESS="STATUS_SUCCESS",e.STATUS_FAILURE="STATUS_FAILURE"}(x||(x={})),function(e){e.PLAIN="plain",e.BUY="buy",e.SET_UP="set-up",e.DONATE="donate",e.CHECK_OUT="check-out",e.BOOK="book",e.SUBSCRIBE="subscribe"}(L||(L={})),function(e){e.BLACK="black",e.WHITE="white",e.WHITE_OUTLINE="white-outline"}(z||(z={})),function(e){e.SUPPORTS_3DS="supports3DS",e.SUPPORTS_EMV="supportsEMV",e.SUPPORTS_CREDIT="supportsCredit",e.SUPPORTS_DEBIT="supportsDebit"}(_||(_={}));class B{constructor(e){this.merchantIdentifier=e.merchantIdentifier,this.displayName=e.displayName,this.initiative=e.initiative,this.initiativeContext=e.initiativeContext,this.buttonType=e.buttonType||L.PLAIN,this.buttonStyle=e.buttonStyle||z.BLACK,this.buttonLocale=e.buttonLocale||"en-US"}get isValid(){return!!(this.merchantIdentifier&&this.displayName&&this.initiative&&this.initiativeContext)}}class U{constructor(e){this.countryCode=e.countryCode,this.currencyCode=e.currencyCode,this.merchantCapabilities=e.merchantCapabilities,this.supportedNetworks=e.supportedNetworks,this.total=e.total,this.lineItems=e.lineItems,this.shippingMethods=e.shippingMethods,this.applicationData=e.applicationData,this.supportedCountries=e.supportedCountries}get isValid(){var e,t,i,s;return!!(this.countryCode&&this.currencyCode&&(null===(e=this.merchantCapabilities)||void 0===e?void 0:e.length)&&(null===(t=this.supportedNetworks)||void 0===t?void 0:t.length)&&(null===(i=this.total)||void 0===i?void 0:i.label)&&(null===(s=this.total)||void 0===s?void 0:s.amount))}}class Y{static isApplePaySupported(){var e;return"undefined"!=typeof window&&"ApplePaySession"in window&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.supportsVersion(3))}static canMakePayments(){var e;return this.isApplePaySupported()&&(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())||!1}static async canMakePaymentsWithActiveCard(e){var t;if(!this.isApplePaySupported())return!1;try{return await(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePaymentsWithActiveCard(e))||!1}catch(e){return console.error("Error checking Apple Pay active card:",e),!1}}static formatAmount(e){return(e/100).toFixed(2)}static parseAmount(e){return Math.round(100*parseFloat(e))}static createLineItem(e,t,i="final"){return{label:e,amount:this.formatAmount(t),type:i}}static getDefaultSupportedNetworks(){return["amex","discover","masterCard","visa"]}static getDefaultMerchantCapabilities(){return[_.SUPPORTS_3DS,_.SUPPORTS_EMV,_.SUPPORTS_CREDIT,_.SUPPORTS_DEBIT]}}!function(e){e.UNAVAILABLE="UNAVAILABLE",e.SESSION_ERROR="SESSION_ERROR",e.MERCHANT_VALIDATION_ERROR="MERCHANT_VALIDATION_ERROR",e.PAYMENT_PROCESSING_ERROR="PAYMENT_PROCESSING_ERROR",e.USER_CANCELLED="USER_CANCELLED"}(R||(R={}));class F{constructor(){this.api=o()}initialize(e){if(this.applePayConfig=new B(e),!this.applePayConfig.isValid)throw new Error("Invalid Apple Pay configuration provided")}async validateMerchant(e,t){try{return await this.api.post({endpoint:"apple_pay/merchant_session",authToken:e,headers:{"Sub-Account":t},body:{domain:window.location.host}})}catch(e){throw console.error("Backend validation failed:",e),new Error("Merchant validation failed")}}async processPayment(e,t,i){const s=await this.api.post({endpoint:"apple_pay/process_token",authToken:e,body:i,headers:{"Sub-Account":t}});return{success:s.id&&!!s.data.token,data:s}}isAvailable(){return Y.isApplePaySupported()&&Y.canMakePayments()}async canMakePaymentsWithActiveCard(){if(!this.applePayConfig)throw new Error("Apple Pay not initialized. Call initialize() first.");return await Y.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier)}async startPaymentSession(e,t,i){if(console.groupCollapsed("[ApplePayService] startPaymentSession called"),console.log("[ApplePayService] raw paymentRequest:",JSON.stringify(e,null,2)),console.log("[ApplePayService] has authToken:",Boolean(t)),console.log("[ApplePayService] accountId:",i),console.log("[ApplePayService] has config:",Boolean(this.applePayConfig)),!this.applePayConfig)throw console.error("[ApplePayService] Missing applePayConfig. Did you call initialize()?"),console.groupEnd(),new Error("Apple Pay not initialized. Call initialize() first.");const s=new U(e);if(console.log("[ApplePayService] created ApplePayPaymentRequest:",s),!s.isValid){const e=[];throw s.countryCode||e.push("countryCode"),s.currencyCode||e.push("currencyCode"),s.merchantCapabilities&&0!==s.merchantCapabilities.length||e.push("merchantCapabilities"),s.supportedNetworks&&0!==s.supportedNetworks.length||e.push("supportedNetworks"),s.total&&s.total.label&&s.total.amount||e.push("total"),console.error("[ApplePayService] Payment request is invalid. Missing/invalid:",e),console.groupEnd(),new Error("Invalid payment request provided")}return this.currentPaymentRequest=s,new Promise(((e,n)=>{try{if(console.log("[ApplePayService] About to instantiate ApplePaySession"),"undefined"==typeof window||!("ApplePaySession"in window))return console.error("[ApplePayService] ApplePaySession not available on window"),console.groupEnd(),n({success:!1,error:{code:R.UNAVAILABLE,message:"ApplePaySession API is not available in this environment"}});this.currentSession=new window.ApplePaySession(3,s),console.log("[ApplePayService] ApplePaySession instantiated:",this.currentSession),this.setupSessionEventHandlers(e,n,t,i),console.log("[ApplePayService] Event handlers set. Beginning session..."),this.currentSession.begin(),console.log("[ApplePayService] Session.begin() called"),console.groupEnd()}catch(e){console.error("[ApplePayService] Exception while starting session:",e),console.groupEnd(),n({success:!1,error:{code:R.SESSION_ERROR,message:e instanceof Error?e.message:"Failed to start Apple Pay session"}})}}))}abortPaymentSession(){this.currentSession&&(this.currentSession.abort(),this.currentSession=void 0,this.currentPaymentRequest=void 0)}setupSessionEventHandlers(e,t,i,s){this.currentSession&&this.applePayConfig&&this.currentPaymentRequest?(this.currentSession.onvalidatemerchant=async()=>{console.groupCollapsed("[ApplePayService] onvalidatemerchant");try{if(console.log("[ApplePayService] accountId:",s),!i)throw console.error("[ApplePayService] Missing authToken for merchant validation"),new Error("Authentication token not provided.");const e=await this.validateMerchant(i,s);console.log("[ApplePayService] merchantSession received");try{this.currentSession.completeMerchantValidation(e),console.log("[ApplePayService] completeMerchantValidation called")}catch(e){throw console.error("Error calling completeMerchantValidation:",e),e}}catch(e){console.error("=== MERCHANT VALIDATION ERROR ==="),console.error("Error during merchant validation:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.abort(),t({success:!1,error:{code:R.MERCHANT_VALIDATION_ERROR,message:e instanceof Error?e.message:"Merchant validation failed"}})}console.groupEnd()},this.currentSession.onpaymentauthorized=async n=>{var o;console.groupCollapsed("[ApplePayService] onpaymentauthorized");try{const a=n.payment;console.log("[ApplePayService] payment payload snapshot:",{hasToken:Boolean(null==a?void 0:a.token),tokenType:(null===(o=null==a?void 0:a.token)||void 0===o?void 0:o.paymentData)?"paymentData":"raw"});const r=Object.assign(Object.assign({},a.token),{product_details:{name:this.currentPaymentRequest.total.label,price:Y.parseAmount(this.currentPaymentRequest.total.amount),description:this.currentPaymentRequest.total.label}});console.log("[ApplePayService] paymentPayload prepared");const l=await this.processPayment(i,s,r);console.log("[ApplePayService] processPayment result:",l),l.success?(this.currentSession.completePayment({status:x.STATUS_SUCCESS}),console.log("[ApplePayService] Payment success; resolving"),e({success:!0,token:a.token,paymentMethodId:l.data.id})):(console.error("PSP reported payment failure:",l.data),this.currentSession.completePayment({status:x.STATUS_FAILURE}),t({success:!1,error:{code:R.PAYMENT_PROCESSING_ERROR,message:"Payment processing failed"}}))}catch(e){console.error("=== PAYMENT PROCESSING ERROR ==="),console.error("Error processing payment:",e),e&&e.stack&&console.error("Error stack:",e.stack),this.currentSession.completePayment({status:x.STATUS_FAILURE}),t({success:!1,error:{code:R.PAYMENT_PROCESSING_ERROR,message:e instanceof Error?e.message:"Payment processing failed"}})}finally{console.log("[ApplePayService] Cleaning up session state"),this.currentSession=void 0,this.currentPaymentRequest=void 0}console.groupEnd()},this.currentSession.onpaymentmethodselected=()=>{console.groupCollapsed("[ApplePayService] onpaymentmethodselected");const e={newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]};try{this.currentSession.completePaymentMethodSelection(e),console.log("[ApplePayService] completePaymentMethodSelection called")}catch(e){console.error("Error completing payment method selection:",e),this.currentSession.abort()}console.groupEnd()},this.currentSession.onshippingmethodselected=()=>{console.groupCollapsed("[ApplePayService] onshippingmethodselected"),this.currentSession.completeShippingMethodSelection({status:x.STATUS_SUCCESS,newTotal:this.currentPaymentRequest.total,newLineItems:this.currentPaymentRequest.lineItems||[]}),console.log("[ApplePayService] completeShippingMethodSelection called"),console.groupEnd()},this.currentSession.oncancel=e=>{if(console.groupCollapsed("[ApplePayService] oncancel"),e.sessionError)switch(console.error(e.sessionError),e.sessionError.code){case"unknown":console.error("Unknown error - likely merchant validation issue"),console.error("This usually means:"),console.error("1. Merchant certificate is invalid or expired"),console.error("2. Merchant identifier mismatch"),console.error("3. Backend validation endpoint issues");break;case"invalidMerchantSession":console.error("Invalid merchant session provided"),console.error("Check that the merchant session from backend is valid");break;case"userCancel":console.error("User cancelled the payment");break;default:console.error("Other error code:",e.sessionError.code)}this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:R.USER_CANCELLED,message:"User cancelled the Apple Pay session"}}),console.groupEnd()},"onerror"in this.currentSession&&(this.currentSession.onerror=e=>{console.groupCollapsed("[ApplePayService] onerror"),console.error("=== APPLE PAY SESSION ERROR ==="),console.error("Session error:",e),this.currentSession=void 0,this.currentPaymentRequest=void 0,t({success:!1,error:{code:R.SESSION_ERROR,message:"Apple Pay session error occurred"}}),console.groupEnd()})):console.error("[ApplePayService] setupSessionEventHandlers called without required state",{hasSession:Boolean(this.currentSession),hasConfig:Boolean(this.applePayConfig),hasPaymentRequest:Boolean(this.currentPaymentRequest)})}static createPaymentRequest(e,t,i="US",s="USD"){return{countryCode:i,currencyCode:s,merchantCapabilities:Y.getDefaultMerchantCapabilities(),supportedNetworks:Y.getDefaultSupportedNetworks(),total:Y.createLineItem(t,e)}}getApplePayConfig(){return this.applePayConfig}}const Q=t=>{const{isLoading:i}=t;return i?e("div",{class:"container-fluid p-0"},e("div",{class:"row mb-3"},e("div",{class:"col-12 align-content-center"},e(r,{height:"44px",width:"100%",styles:{borderRadius:"8px"}})))):null},V=t=>e("div",{class:"apple-pay-button-container"},e("button",Object.assign({class:(()=>{let e="apple-pay-button";switch(t.buttonStyle){case z.WHITE:e+=" apple-pay-button-white";break;case z.WHITE_OUTLINE:e+=" apple-pay-button-white-outline";break;default:e+=" apple-pay-button-black"}switch(t.buttonType){case L.BUY:e+=" apple-pay-button-type-buy";break;case L.DONATE:e+=" apple-pay-button-type-donate";break;default:e+=" apple-pay-button-type-plain"}return(t.disabled||t.isProcessing||!t.isAvailable)&&(e+=" disabled"),e})(),style:{width:t.width,height:t.height},onClick:()=>{!t.disabled&&!t.isProcessing&&t.isAvailable&&t.clickHandler&&t.clickHandler()},disabled:t.disabled||t.isProcessing||!t.isAvailable,"aria-label":"Pay with Apple Pay",type:"button"},t),t.isProcessing&&e("div",{class:"processing-overlay"},e("div",{class:"spinner"}),e("span",null,"Processing..."))),e("style",null,"\n .apple-pay-button-container {\n display: inline-block;\n position: relative;\n width: 100%;\n }\n\n /* Apple Pay CSS classes - these are the official Apple Pay button styles */\n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n -apple-pay-button-type: plain; /* default */\n -apple-pay-button-style: black; /* default */\n border-radius: 8px;\n cursor: pointer;\n border: none;\n outline: none;\n transition: opacity 0.2s ease;\n position: relative;\n }\n\n /* Button styles */\n .apple-pay-button.apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n\n .apple-pay-button.apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n\n .apple-pay-button.apple-pay-button-white-outline {\n -apple-pay-button-style: white-outline;\n }\n\n /* Button types */\n .apple-pay-button.apple-pay-button-type-plain {\n -apple-pay-button-type: plain;\n }\n\n .apple-pay-button.apple-pay-button-type-buy {\n -apple-pay-button-type: buy;\n }\n\n .apple-pay-button.apple-pay-button-type-donate {\n -apple-pay-button-type: donate;\n }\n\n /* Hover and disabled states */\n .apple-pay-button:hover:not(.disabled) {\n opacity: 0.9;\n }\n\n .apple-pay-button.disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Processing overlay */\n .processing-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 8px;\n font-size: 14px;\n font-weight: 500;\n }\n\n .spinner {\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top: 2px solid #fff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Responsive design */\n @media (max-width: 480px) {\n .apple-pay-button {\n width: 100% !important;\n min-width: 200px;\n }\n }\n ")),H=class{constructor(e){t(this,e),this.applePayStarted=i(this,"applePayStarted"),this.applePayCompleted=i(this,"applePayCompleted"),this.applePayCancelled=i(this,"applePayCancelled"),this.applePayError=i(this,"applePayError"),this.countryCode="US",this.merchantIdentifier="merchant.com.staging-justifi.checkout-dev",this.merchantDisplayName="JustiFi Checkout",this.initiativeContext="dev-checkout.justifi-staging.com",this.buttonType=L.PLAIN,this.buttonStyle=z.BLACK,this.disabled=!1,this.showSkeleton=!0,this.width="100%",this.height="48px",this.isLoading=!0,this.isProcessing=!1,this.isAvailable=!1,this.canMakePayments=!1,this.isConfigValid=!0,this.error=null,this.handleApplePayClick=async()=>{var e,t;if(!this.isProcessing&&!this.disabled&&this.isAvailable)try{this.isProcessing=!0,this.error=null,this.applePayStarted.emit(),console.groupCollapsed("[ApplePay Component] handleApplePayClick"),console.log("[ApplePay Component] click context:",{isProcessing:this.isProcessing,disabled:this.disabled,isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasService:Boolean(this.applePayService)});const i={countryCode:this.countryCode,currencyCode:l.paymentCurrency,merchantCapabilities:[_.SUPPORTS_3DS,_.SUPPORTS_CREDIT,_.SUPPORTS_DEBIT],supportedNetworks:Y.getDefaultSupportedNetworks(),total:Y.createLineItem(l.paymentDescription,l.paymentAmount)};console.log("[ApplePay Component] paymentRequest",i),console.log("[ApplePay Component] identifiers snapshot:",{authTokenLength:l.authToken?String(l.authToken).length:0,accountId:l.accountId});const s=await this.applePayService.startPaymentSession(i,l.authToken,l.accountId);console.log("[ApplePay Component] startPaymentSession result",s),s.success?this.applePayCompleted.emit({success:!0,token:s.token,paymentMethodId:s.paymentMethodId}):(this.applePayCompleted.emit({success:!1,error:s.error}),this.applePayError.emit({error:(null===(e=s.error)||void 0===e?void 0:e.message)||"Payment failed",code:(null===(t=s.error)||void 0===t?void 0:t.code)||H.ErrorCode.PAYMENT_FAILED}))}catch(e){const t=e instanceof Error?e.message:"Payment failed";this.error=t,this.applePayError.emit({error:t,code:H.ErrorCode.PAYMENT_FAILED}),this.applePayCompleted.emit({success:!1,error:t})}finally{this.isProcessing=!1,console.groupEnd()}}}async initializeApplePay(){try{if(this.isLoading=!0,this.error=null,this.isConfigValid=!0,console.groupCollapsed("[ApplePay Component] initializeApplePay"),console.log("[ApplePay Component] checkout state snapshot:",{paymentAmount:l.paymentAmount,paymentCurrency:l.paymentCurrency,hasAuthToken:Boolean(l.authToken),accountId:l.accountId}),!(Boolean(l.paymentAmount)&&Boolean(l.paymentCurrency)&&Boolean(l.authToken)))return this.error="Missing required Apple Pay configuration",this.isConfigValid=!1,console.error("Apple Pay config error: missing required values",{paymentAmount:l.paymentAmount,paymentCurrency:l.paymentCurrency,hasAuthToken:Boolean(l.authToken),accountId:l.accountId}),this.applePayError.emit({error:this.error,code:H.ErrorCode.CONFIG_ERROR}),this.isLoading=!1,void console.groupEnd();if(this.isAvailable=Y.isApplePaySupported(),this.canMakePayments=Y.canMakePayments(),console.log("[ApplePay Component] support check:",{isAvailable:this.isAvailable,canMakePayments:this.canMakePayments,hasApplePaySessionOnWindow:"undefined"!=typeof window&&"ApplePaySession"in window}),!this.isAvailable)return this.error="Apple Pay is not supported on this device",console.error(this.error),this.applePayError.emit({error:this.error,code:H.ErrorCode.NOT_SUPPORTED}),this.isLoading=!1,void console.groupEnd();if(!this.canMakePayments)return this.error="Apple Pay is not available",console.error(this.error),this.applePayError.emit({error:this.error,code:H.ErrorCode.NOT_AVAILABLE}),this.isLoading=!1,void console.groupEnd();const e={merchantIdentifier:this.merchantIdentifier,displayName:this.merchantDisplayName,initiative:"web",initiativeContext:this.initiativeContext,buttonType:this.buttonType,buttonStyle:this.buttonStyle};console.log("[ApplePay Component] initializing service with config:",e),this.applePayService=new F,this.applePayService.initialize(e),await this.applePayService.canMakePaymentsWithActiveCard()||console.warn("No Apple Pay cards available, but continuing...")}catch(e){console.error("Apple Pay initialization error:",e),this.error=e instanceof Error?e.message:"Failed to initialize Apple Pay",this.applePayError.emit({error:this.error,code:H.ErrorCode.INITIALIZATION_ERROR})}finally{this.isLoading=!1,console.groupEnd()}}async isSupported(){return this.isAvailable&&this.canMakePayments}async getPaymentMethods(){return this.isAvailable?Y.getDefaultSupportedNetworks():[]}async abort(){this.applePayService.abortPaymentSession(),this.isProcessing=!1,this.applePayCancelled.emit()}render(){if(!l.applePayEnabled)return console.log("[ApplePay Component] Apple Pay disabled in checkout settings; not rendering"),null;const t=!this.isLoading&&this.isAvailable&&this.canMakePayments&&this.isConfigValid;return e(a,null,l.checkoutLoaded&&e("script",{async:!0,src:"https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",onLoad:()=>{console.log("[ApplePay Component] Apple Pay SDK script loaded"),this.initializeApplePay()}}),e("div",{class:"apple-pay-container"},e(Q,{isLoading:this.isLoading}),t&&e(V,{buttonType:this.buttonType,buttonStyle:this.buttonStyle,disabled:this.disabled,isProcessing:this.isProcessing,isAvailable:this.isAvailable,clickHandler:this.handleApplePayClick,width:this.width,height:this.height})),e("style",null,"\n .apple-pay-container {\n width: 100%;\n }\n "))}};H.ErrorCode={CONFIG_ERROR:"CONFIG_ERROR",NOT_SUPPORTED:"NOT_SUPPORTED",NOT_AVAILABLE:"NOT_AVAILABLE",INITIALIZATION_ERROR:"INITIALIZATION_ERROR",PAYMENT_FAILED:"PAYMENT_FAILED"};const W=class{constructor(e){t(this,e)}render(){return e(a,{key:"abd92b499208321582b08a490c78c9167be2ebd4"},e("section",{key:"38e15cef5a19a43249d7ecf3d4eb4ea8e032f248"},e("div",{key:"747f811012ed9707265369e59dbde8cd7ad3bca6"},e("div",{key:"8575f50759664d5c64d235025699c81f055267ca",part:p},null==l?void 0:l.paymentDescription),e("div",{key:"af77776bbe21bce77586447bbf445e4c5d8c1165"},e("span",{key:"5cdaaec454118197b3e37a942d83907e72444342",part:p},"Total")," ",e("span",{key:"ccc35217ac9740d5a00b7abbcec4133848afcc28",part:p},y(+(null==l?void 0:l.totalAmount)))))))}},q=class{constructor(e){t(this,e),this.levels={h1:m,h2:v,h3:g},this.level="h1"}render(){return e(a,{key:"e1d39365c2ff2c291a42b53d6bcbe1d97d602778"},e(this.levels[this.level],{key:"0b8c8c3a42ff2151e3b293cafeeaeda72e94d767",text:this.text,class:this.class}))}},Z=o();class G{async getLinkToken(e,t,i,s){return Z.post({endpoint:`plaid/${t}/link`,body:{checkout_id:i},authToken:e,signal:s})}async tokenizeBankAccount(e,t,i,s,n,o){const a=`plaid/${t}/tokenize`,r={public_token:i};return s&&(r.link_token_id=s),n&&(r.payment_method_group_id=n),Z.post({endpoint:a,body:r,authToken:e,signal:o})}}const J=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.checkoutChangedEvent=i(this,"checkout-changed"),this.plaidService=new G,this.handleApplePayCompleted=e=>{const{success:t,token:i,paymentMethodId:s,error:n}=e.detail;t&&i?(l.paymentToken=s,l.selectedPaymentMethod={type:E.APPLE_PAY},this.submitCheckout()):(console.error("Apple Pay completed but failed:",n),this.errorEvent.emit({message:(null==n?void 0:n.message)||"Apple Pay payment failed",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR}))},this.handleApplePayError=e=>{const{error:t,code:i}=e.detail;console.error("Apple Pay error:",t),this.errorEvent.emit({message:t||"Apple Pay error occurred",errorCode:`APPLE_PAY_${i}`,severity:w.ERROR})},this.handleApplePayCancelled=()=>{l.paymentToken=void 0,l.selectedPaymentMethod=void 0}}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs(),this.setupApplePayListeners()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),l.checkoutId=this.checkoutId;const e={authToken:this.authToken,checkoutId:this.checkoutId,service:new S};this.getCheckout=(({authToken:e,checkoutId:t,service:i})=>async({onSuccess:s,onError:n})=>{var o;try{const a=await i.fetchCheckout(e,t);if(a.error)return n({error:N(a.error),code:C(null===(o=a.error)||void 0===o?void 0:o.code),severity:w.ERROR});s({checkout:a.data})}catch(e){const t=C(null==e?void 0:e.code);return n({error:e.message||e,code:t,severity:w.ERROR})}})(e),this.completeCheckout=(({authToken:e,checkoutId:t,service:i})=>async({payment:s,onSuccess:n,onError:o})=>{var a;try{const r=await i.complete(e,t,s);if(r.error)return o({error:N(r.error),code:C(null===(a=r.error)||void 0===a?void 0:a.code),severity:w.ERROR});n({checkout:r.data})}catch(e){const t=C(null==e?void 0:e.code);return o({error:e.message||e,code:t,severity:w.ERROR})}})(e),c((()=>{this.emitCheckoutChanged()}))}componentWillLoad(){this.analytics=new k(this),A(),l.authToken=this.authToken,this.fetchCheckout(),M("set",(e=>{const t=b[e];void 0!==t&&f(e,t)&&this.fetchCheckout()}))}componentDidLoad(){this.queryFormRefs(),this.setupApplePayListeners()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect(),this.removeApplePayListeners()}fetchCheckout(){this.authToken&&this.checkoutId?this.getCheckout&&this.getCheckout({onSuccess:({checkout:e})=>{this.updateStore(e),e.status!==T.completed?e.status!==T.expired||this.errorEvent.emit({message:j.CHECKOUT_EXPIRED,errorCode:P.CHECKOUT_EXPIRED,severity:w.ERROR}):this.errorEvent.emit({message:j.CHECKOUT_ALREADY_COMPLETED,errorCode:P.CHECKOUT_ALREADY_COMPLETED,severity:w.ERROR})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:e.code,severity:e.severity})}}):this.errorEvent.emit({message:j.NOT_AUTHENTICATED,errorCode:P.NOT_AUTHENTICATED,severity:w.ERROR})}updateStore(e){var t,i,s,n,o,a;l.accountId=e.account_id,l.checkoutLoaded=!0,l.paymentMethods=e.payment_methods.map((e=>new I(e))),l.paymentMethodGroupId=e.payment_method_group_id,l.paymentDescription=e.payment_description,l.totalAmount=e.total_amount,l.paymentAmount=e.payment_amount,l.bnplEnabled=e.payment_settings.bnpl_payments,l.insuranceEnabled=e.payment_settings.insurance_payments,l.bankAccountVerification=null===(t=e.payment_settings)||void 0===t?void 0:t.bank_account_verification,l.applePayEnabled=Boolean(null===(i=e.payment_settings)||void 0===i?void 0:i.apple_payments),l.bnplProviderClientId=null===(s=null==e?void 0:e.bnpl)||void 0===s?void 0:s.provider_client_id,l.bnplProviderMode=null===(n=null==e?void 0:e.bnpl)||void 0===n?void 0:n.provider_mode,l.bnplProviderApiVersion=null===(o=null==e?void 0:e.bnpl)||void 0===o?void 0:o.provider_api_version,l.bnplProviderCheckoutUrl=null===(a=null==e?void 0:e.bnpl)||void 0===a?void 0:a.provider_checkout_url}emitCheckoutChanged(){const e={availablePaymentMethodTypes:h(),selectedPaymentMethod:l.selectedPaymentMethod,savedPaymentMethods:l.paymentMethods};this.checkoutChangedEvent.emit(e)}queryFormRefs(){this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.applePayRef=this.hostEl.querySelector("justifi-apple-pay"),this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form, justifi-tokenize-payment-method"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance")}setupApplePayListeners(){this.applePayRef&&(this.applePayRef.addEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.addEventListener("applePayError",this.handleApplePayError),this.applePayRef.addEventListener("applePayCancelled",this.handleApplePayCancelled))}removeApplePayListeners(){this.applePayRef&&(this.applePayRef.removeEventListener("applePayCompleted",this.handleApplePayCompleted),this.applePayRef.removeEventListener("applePayError",this.handleApplePayError),this.applePayRef.removeEventListener("applePayCancelled",this.handleApplePayCancelled))}async tokenizePaymentMethod(e){var t,i,s;const n=null!==(i=await(null===(t=this.billingFormRef)||void 0===t?void 0:t.getValues()))&&void 0!==i?i:{},o=Object.assign(Object.assign({},e),n),a=Object.assign({accountId:l.accountId,payment_method_group_id:void 0},o);l.savePaymentMethod&&(a.payment_method_group_id=l.paymentMethodGroupId);const r=await(null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:a,account:l.accountId}));return r.error?r:(l.paymentToken=r.id,r.id)}async setSelectedPaymentMethod(e){l.selectedPaymentMethod=e,l.paymentToken=e.id||void 0}async validate(){var e,t;const i=[];l.insuranceEnabled&&this.insuranceFormRef&&i.push(this.insuranceFormRef.validate());const s=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===E.NEW_CARD,n=(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===E.NEW_BANK_ACCOUNT;if((s||n)&&(this.paymentMethodFormRef&&i.push(this.paymentMethodFormRef.validate()),this.billingFormRef&&i.push(this.billingFormRef.validate())),0===i.length)return!0;try{return!!(await Promise.all(i)).every((e=>"boolean"==typeof e?e:!1!==(null==e?void 0:e.isValid)))||(this.errorEvent.emit({message:"Validation error",errorCode:P.VALIDATION_ERROR,severity:w.ERROR}),!1)}catch(e){return!1}}async submitCheckout(e){var t,i,s,n,o;const a=await this.validate();if(!l.selectedPaymentMethod)return void this.errorEvent.emit({message:"No payment method selected.",errorCode:P.VALIDATION_ERROR,severity:w.ERROR});const r=(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)===E.NEW_CARD,c=(null===(i=l.selectedPaymentMethod)||void 0===i?void 0:i.type)===E.NEW_BANK_ACCOUNT,h=(null===(s=l.selectedPaymentMethod)||void 0===s?void 0:s.type)===E.PLAID;if(r||c){const t=await this.tokenizePaymentMethod(e);if(null==t?void 0:t.error)return void this.errorEvent.emit({message:t.error.message,errorCode:P.TOKENIZE_ERROR,severity:w.ERROR})}if(h&&!l.paymentToken){const e=l.plaidPublicToken,t=l.plaidLinkTokenId;if(!e)return void this.errorEvent.emit({message:"Missing Plaid public token. Please connect your bank.",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR});try{const i=await this.plaidService.tokenizeBankAccount(l.authToken,l.accountId,e,t||void 0,l.savePaymentMethod?l.paymentMethodGroupId:void 0);if(null==i?void 0:i.error)return void this.errorEvent.emit({message:"string"==typeof i.error?i.error:i.error.message||"Failed to tokenize bank account",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR});const s=null==i?void 0:i.data,o=(null===(n=null==s?void 0:s.bank_account)||void 0===n?void 0:n.token)||(null==s?void 0:s.token)||(null==s?void 0:s.id);l.paymentToken=o}catch(e){return void this.errorEvent.emit({message:(null==e?void 0:e.message)||"Plaid exchange error",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR})}}if(!a)return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:P.VALIDATION_ERROR,severity:w.ERROR});if(!l.paymentToken)return void this.errorEvent.emit({message:"Payment token not found.",errorCode:P.TOKENIZE_ERROR,severity:w.ERROR});let d;d={payment_mode:(e=>{switch(e){case E.NEW_CARD:case E.SAVED_CARD:case E.NEW_BANK_ACCOUNT:case E.SAVED_BANK_ACCOUNT:case E.PLAID:return D.ECOM;case E.SEZZLE:return D.BNPL;case E.APPLE_PAY:return D.APPLE_PAY;default:return}})(null===(o=l.selectedPaymentMethod)||void 0===o?void 0:o.type),payment_token:l.paymentToken},this.completeCheckout({payment:d,onSuccess:({checkout:e})=>{this.submitEvent.emit({checkout:e,message:"Checkout completed successfully"})},onError:e=>{this.errorEvent.emit({message:e.message,errorCode:P.COMPLETE_CHECKOUT_ERROR,severity:w.ERROR})}})}render(){return e(s,{key:"63acafa8f4819ac63e564807779976e352ccbdfb"})}get hostEl(){return n(this)}};var X;!function(e){e.PLAID_SDK_LOAD_FAILED="plaid-sdk-load-failed",e.PLAID_LINK_INIT_FAILED="plaid-link-init-failed",e.PLAID_LINK_TOKEN_FAILED="plaid-link-token-failed",e.PLAID_AUTHENTICATION_FAILED="plaid-authentication-failed",e.PLAID_BANK_NOT_SUPPORTED="plaid-bank-not-supported",e.PLAID_TOKEN_EXPIRED="plaid-token-expired",e.PLAID_NETWORK_ERROR="plaid-network-error",e.PLAID_USER_CANCELLED="plaid-user-cancelled",e.PLAID_TIMEOUT="plaid-timeout",e.PLAID_INVALID_CREDENTIALS="plaid-invalid-credentials",e.PLAID_ACCOUNT_LOCKED="plaid-account-locked",e.PLAID_MAINTENANCE="plaid-maintenance",e.PLAID_RATE_LIMITED="plaid-rate-limited"}(X||(X={}));const K={[X.PLAID_SDK_LOAD_FAILED]:"Unable to load Plaid. Please refresh the page and try again.",[X.PLAID_LINK_INIT_FAILED]:"Unable to initialize bank connection. Please try again.",[X.PLAID_LINK_TOKEN_FAILED]:"Unable to connect to bank service. Please try again.",[X.PLAID_AUTHENTICATION_FAILED]:"Bank authentication failed. Please try again.",[X.PLAID_BANK_NOT_SUPPORTED]:"Your bank is not currently supported. Please try a different payment method.",[X.PLAID_TOKEN_EXPIRED]:"Your bank session has expired. Please reconnect your account.",[X.PLAID_NETWORK_ERROR]:"Network connection issue. Please check your internet connection and try again.",[X.PLAID_USER_CANCELLED]:"Bank connection was cancelled. Click to try again.",[X.PLAID_TIMEOUT]:"Bank connection timed out. Please try again.",[X.PLAID_INVALID_CREDENTIALS]:"Invalid bank credentials. Please check your username and password.",[X.PLAID_ACCOUNT_LOCKED]:"Your bank account is temporarily locked. Please contact your bank.",[X.PLAID_MAINTENANCE]:"Bank service is temporarily unavailable. Please try again later.",[X.PLAID_RATE_LIMITED]:"Too many connection attempts. Please wait a moment and try again."},$={[X.PLAID_SDK_LOAD_FAILED]:w.ERROR,[X.PLAID_LINK_INIT_FAILED]:w.ERROR,[X.PLAID_LINK_TOKEN_FAILED]:w.ERROR,[X.PLAID_AUTHENTICATION_FAILED]:w.ERROR,[X.PLAID_BANK_NOT_SUPPORTED]:w.WARNING,[X.PLAID_TOKEN_EXPIRED]:w.WARNING,[X.PLAID_NETWORK_ERROR]:w.WARNING,[X.PLAID_USER_CANCELLED]:w.INFO,[X.PLAID_TIMEOUT]:w.WARNING,[X.PLAID_INVALID_CREDENTIALS]:w.ERROR,[X.PLAID_ACCOUNT_LOCKED]:w.ERROR,[X.PLAID_MAINTENANCE]:w.WARNING,[X.PLAID_RATE_LIMITED]:w.WARNING},ee=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.plaidError=i(this,"plaidError"),this.plaidErrorRecovered=i(this,"plaidErrorRecovered"),this.isAuthenticating=!1,this.publicToken=null,this.linkToken=null,this.linkTokenId=null,this.error=null,this.plaidLink=null,this.isSelected=!1,this.retryCount=0,this.isRetrying=!1,this.plaidService=new G,this.maxRetries=3,this.retryDelay=2e3,this.timeoutId=null,this.abortController=null,this.hasLoggedDisabledWarning=!1,this.waitForStoreAndInitialize=()=>{l.authToken&&l.accountId&&l.checkoutId?this.initializePlaidLink():setTimeout((()=>{this.waitForStoreAndInitialize()}),100)},this.initializePlaidLink=async()=>{try{if(void 0===window.Plaid)return void this.handleError({code:X.PLAID_SDK_LOAD_FAILED,message:K[X.PLAID_SDK_LOAD_FAILED],severity:$[X.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"});if(await this.getLinkToken(),!this.linkToken)return void this.handleError({code:X.PLAID_LINK_TOKEN_FAILED,message:K[X.PLAID_LINK_TOKEN_FAILED],severity:$[X.PLAID_LINK_TOKEN_FAILED],retryable:!0,userAction:"Click to try again"});const e=window.Plaid;this.plaidLink=e.create({token:this.linkToken,onSuccess:this.handlePlaidSuccess,onExit:this.handlePlaidExit,onEvent:this.handlePlaidEvent,onLoad:this.handlePlaidLoad})}catch(e){this.handleError({code:X.PLAID_LINK_INIT_FAILED,message:K[X.PLAID_LINK_INIT_FAILED],severity:$[X.PLAID_LINK_INIT_FAILED],originalError:e,retryable:!0,userAction:"Click to try again"})}},this.getLinkToken=async()=>{var e,t,i,s,n;try{if(!l.authToken||!l.accountId)return void this.handleError({code:X.PLAID_LINK_TOKEN_FAILED,message:"Missing authentication. Please refresh the page and try again.",severity:w.ERROR,retryable:!1,userAction:"Refresh the page"});this.abortController=new AbortController,this.timeoutId=setTimeout((()=>{var e;null===(e=this.abortController)||void 0===e||e.abort()}),3e4);const t=await this.plaidService.getLinkToken(l.authToken,l.accountId,l.checkoutId,this.abortController.signal);if(this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),t.error)throw new Error("string"==typeof t.error?t.error:t.error.message||"Failed to get link token");this.linkToken=t.data.link_token,this.linkTokenId=(null==t?void 0:t.id)||(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.id)||null,this.linkTokenId&&(l.plaidLinkTokenId=this.linkTokenId)}catch(e){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null);let o=X.PLAID_LINK_TOKEN_FAILED,a=K[o],r=!0;"AbortError"===e.name?(o=X.PLAID_TIMEOUT,a=K[o],r=!0):(null===(t=e.message)||void 0===t?void 0:t.includes("network"))||(null===(i=e.message)||void 0===i?void 0:i.includes("fetch"))?(o=X.PLAID_NETWORK_ERROR,a=K[o],r=!0):((null===(s=e.message)||void 0===s?void 0:s.includes("401"))||(null===(n=e.message)||void 0===n?void 0:n.includes("unauthorized")))&&(o=X.PLAID_INVALID_CREDENTIALS,a="Authentication failed. Please refresh the page and try again.",r=!1),this.handleError({code:o,message:a,severity:$[o],originalError:e,retryable:r,userAction:r?"Click to try again":"Refresh the page"})}},this.mapApiErrorToPlaidError=e=>{if("string"==typeof e){if(e.includes("rate_limit"))return X.PLAID_RATE_LIMITED;if(e.includes("maintenance"))return X.PLAID_MAINTENANCE;if(e.includes("not_authenticated"))return X.PLAID_INVALID_CREDENTIALS}if(null==e?void 0:e.code)switch(e.code){case"rate_limited":return X.PLAID_RATE_LIMITED;case"maintenance":return X.PLAID_MAINTENANCE;case"not_authenticated":return X.PLAID_INVALID_CREDENTIALS;default:return X.PLAID_LINK_TOKEN_FAILED}return X.PLAID_LINK_TOKEN_FAILED},this.openPlaidLink=()=>{this.plaidLink&&this.linkToken&&(this.isAuthenticating=!0,this.clearError(),this.plaidLink.open())},this.handlePlaidSuccess=e=>{this.publicToken=e,this.isAuthenticating=!1,this.clearError(),this.retryCount=0,this.isSelected||(this.isSelected=!0,l.selectedPaymentMethod={type:E.PLAID}),this.plaidErrorRecovered.emit({code:"plaid-success",message:"Bank account connected successfully",severity:w.INFO}),l.plaidPublicToken=e},this.handlePlaidExit=e=>{this.isAuthenticating=!1,e&&this.handlePlaidError(e)},this.handlePlaidEvent=(e,t)=>{switch(e){case"OPEN":this.isAuthenticating=!0;break;case"CLOSE":this.isAuthenticating=!1;break;case"ERROR":this.handlePlaidError(t)}},this.handlePlaidLoad=()=>{},this.handlePlaidError=e=>{let t=X.PLAID_AUTHENTICATION_FAILED,i=K[t],s=!0,n="Click to try again";if(e.error_code)switch(e.error_code){case"INVALID_CREDENTIALS":t=X.PLAID_INVALID_CREDENTIALS,i=K[t],s=!0;break;case"ITEM_LOGIN_REQUIRED":t=X.PLAID_INVALID_CREDENTIALS,i="Your bank requires re-authentication. Please try again.",s=!0;break;case"ITEM_LOCKED":t=X.PLAID_ACCOUNT_LOCKED,i=K[t],s=!1,n="Contact your bank";break;case"INSTITUTION_NOT_RESPONDING":t=X.PLAID_MAINTENANCE,i=K[t],s=!0;break;case"RATE_LIMIT_EXCEEDED":t=X.PLAID_RATE_LIMITED,i=K[t],s=!0;break;case"INVALID_REQUEST":t=X.PLAID_AUTHENTICATION_FAILED,i="Invalid request. Please try again.",s=!0;break;case"PLAID_ERROR":t=X.PLAID_AUTHENTICATION_FAILED,i=e.error_message||"Bank authentication failed. Please try again.",s=!0;break;default:e.error_message&&(i=e.error_message)}if(e.error_message){const o=e.error_message.toLowerCase();o.includes("not supported")||o.includes("unsupported")?(t=X.PLAID_BANK_NOT_SUPPORTED,i=K[t],s=!1,n="Try a different payment method"):(o.includes("expired")||o.includes("timeout"))&&(t=X.PLAID_TOKEN_EXPIRED,i=K[t],s=!0)}this.handleError({code:t,message:i,severity:$[t],originalError:e,retryable:s,userAction:n}),this.isAuthenticating=!1},this.handleError=e=>{this.error=e,this.plaidError.emit({code:e.code,message:e.message,severity:e.severity,data:{originalError:e.originalError,retryable:e.retryable,userAction:e.userAction,retryCount:this.retryCount}}),console.error("Plaid error:",e),e.retryable&&this.retryCount<this.maxRetries&&this.scheduleRetry()},this.scheduleRetry=()=>{this.isRetrying||(this.isRetrying=!0,this.retryCount++,setTimeout((()=>{this.isRetrying=!1,this.clearError(),this.waitForStoreAndInitialize()}),this.retryDelay*this.retryCount))},this.clearError=()=>{this.error&&(this.error=null,this.retryCount=0)},this.syncWithStore=()=>{var e;const t=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===E.PLAID;this.isSelected!==t&&(this.isSelected=t)}}onSelectionChange(e){var t;e&&(null===(t=l.selectedPaymentMethod)||void 0===t?void 0:t.type)!==E.PLAID&&(l.selectedPaymentMethod={type:E.PLAID}),!e||!this.plaidLink||this.publicToken||this.isAuthenticating||this.error||this.openPlaidLink()}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.waitForStoreAndInitialize()},this.scriptRef.onerror=()=>{this.handleError({code:X.PLAID_SDK_LOAD_FAILED,message:K[X.PLAID_SDK_LOAD_FAILED],severity:$[X.PLAID_SDK_LOAD_FAILED],retryable:!0,userAction:"Refresh the page and try again"})})}componentWillLoad(){var e;this.isSelected=(null===(e=l.selectedPaymentMethod)||void 0===e?void 0:e.type)===E.PLAID}async resolvePaymentMethod(){return this.publicToken?{token:this.publicToken,data:{type:"bank_account",plaid_public_token:this.publicToken}}:{validationError:!0}}async getPaymentToken(){return l.paymentToken}async handleSelectionClick(){if(this.isSelected=!0,l.selectedPaymentMethod={type:E.PLAID},this.error)return this.clearError(),void this.waitForStoreAndInitialize();!this.plaidLink||this.publicToken||this.isAuthenticating||this.openPlaidLink()}async setSelected(e){this.isSelected=e,e&&(l.selectedPaymentMethod={type:E.PLAID})}async isCurrentlySelected(){return this.isSelected}async deselect(){this.isSelected=!1}async reset(){this.publicToken=null,this.clearError(),this.isAuthenticating=!1,this.linkToken=null,this.plaidLink=null,this.retryCount=0,this.isRetrying=!1,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.abortController&&(this.abortController.abort(),this.abortController=null)}async isReadyForAuthentication(){return!(!this.plaidLink||!this.linkToken||this.isAuthenticating)}async retry(){this.error&&this.error.retryable&&(this.clearError(),this.waitForStoreAndInitialize())}async getErrorInfo(){return this.error}componentDidLoad(){const e=d("selectedPaymentMethod",this.syncWithStore);this.unsubscribeFromStore=e}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.timeoutId&&clearTimeout(this.timeoutId),this.abortController&&this.abortController.abort()}render(){if(!0!==l.bankAccountVerification)return this.hasLoggedDisabledWarning||(console.warn("[PlaidPaymentMethod] bank_account_verification is disabled. Component will not render."),this.hasLoggedDisabledWarning=!0),null;const t=e("img",{class:"plaid-logo-img",src:"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgMjggMjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgY2xhc3M9ImNzcy0xcmRhajhtIj48ZyBmaWxsPSIjMTExIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yNS43NjI5IDI2LjI2MjhMMjggMTcuNTMwOUwyNC45NjkxIDE0LjUwMDFMMjcuOTk5OSAxMS40NjkxTDI1Ljc2MjggMi43MzcwNkwxNy4wMzA5IDAuNUwxNC4wMDAxIDMuNTMxTDEwLjk2OSAwLjUwMDE0TDIuMjM3MDYgMi43MzczNEwwIDExLjQ2OTFMMy4wMzEyOCAxNC40OTk5TDAuMDAwMTQgMTcuNTMxTDIuMjM3MiAyNi4yNjI5TDEwLjk2OTEgMjguNUwxNC4wMDAxIDI1LjQ2OUwxNy4wMzEgMjguNDk5OUwyNS43NjI5IDI2LjI2MjhaTTE1LjczMjEgMjMuNzM3MUwxOC42MTg2IDIwLjg1MDVMMjIuMjkxMiAyNC41MjMzTDE3LjY5NTYgMjUuNzAwN0wxNS43MzIxIDIzLjczNzFaTTExLjExMzYgOS44ODE1NEwxNC4wMDAzIDYuOTk1MDJMMTYuODg2OCA5Ljg4MTRMMTQuMDAwMSAxMi43Njc5TDExLjExMzYgOS44ODE1NFpNMTIuMjY4MiAxNC41TDkuMzgxNTQgMTcuMzg2NUw2LjQ5NTAyIDE0LjVMOS4zODE1NCAxMS42MTM1TDEyLjI2ODIgMTQuNVpNMTguNjE4NyAxMS42MTMzTDIxLjUwNTMgMTQuNUwxOC42MTg2IDE3LjM4NjVMMTUuNzMyMSAxNC41TDE4LjYxODcgMTEuNjEzM1pNMTYuODg2NyAxOS4xMTg2TDE0LjAwMDEgMjIuMDA1MUwxMS4xMTM1IDE5LjExODVMMTQuMDAwMSAxNi4yMzE5TDE2Ljg4NjcgMTkuMTE4NlpNMTAuMzA0NCAyNS43MDA3TDUuNzA4NjQgMjQuNTIzM0w5LjM4MTU0IDIwLjg1MDRMMTIuMjY4MiAyMy43MzcxTDEwLjMwNDQgMjUuNzAwN1pNNC43NjMwOCAxNi4yMzE5TDcuNjQ5NiAxOS4xMTg1TDMuOTc2NyAyMi43OTE0TDIuNzk5MyAxOC4xOTU3TDQuNzYzMDggMTYuMjMxOVpNMy45NzY3IDYuMjA4MzZMNy42NDk3NCA5Ljg4MTRMNC43NjMwOCAxMi43NjgxTDIuNzk5MyAxMC44MDQxTDMuOTc2NyA2LjIwODM2Wk0xMi4yNjgzIDUuMjYyOTRMOS4zODE2OCA4LjE0OTZMNS43MDg5MiA0LjQ3NjdMMTAuMzA0NyAzLjI5OTNMMTIuMjY4MyA1LjI2Mjk0Wk0xNy42OTU5IDMuMjk5M0wyMi4yOTE1IDQuNDc2N0wxOC42MTg2IDguMTQ5NDZMMTUuNzMyMSA1LjI2Mjk0TDE3LjY5NTkgMy4yOTkzWk0yMy4yMzcyIDEyLjc2ODFMMjAuMzUwNSA5Ljg4MTRMMjQuMDIzMyA2LjIwODc4TDI1LjIwMDcgMTAuODA0NkwyMy4yMzcyIDEyLjc2ODFaTTI0LjAyMzMgMjIuNzkxNEwyMC4zNTA1IDE5LjExODZMMjMuMjM3MiAxNi4yMzIxTDI1LjIwMDcgMTguMTk1N0wyNC4wMjMzIDIyLjc5MTRaIj48L3BhdGg+PC9nPjwvc3ZnPgo=",alt:"Plaid",title:"Plaid",style:{display:"inline",width:"20px",height:"20px",marginLeft:"5px",marginTop:"-2px"}});return e(a,{class:"payment-method"},e("script",{src:"https://cdn.plaid.com/link/v2/stable/link-initialize.js",async:!0,ref:e=>this.scriptRef=e}),e("div",{title:"Pay with Plaid"},e("div",{onClick:e=>{e.preventDefault(),this.handleSelectionClick()}},"Pay with Bank Account ",t," "),(()=>this.error?e("div",{class:(this.error.severity===w.ERROR?"text-danger":this.error.severity===w.WARNING?"text-warning":"text-info")+" mt-2"},e("small",null,this.error.message),e("br",null),e("small",{class:"text-muted"},this.error.userAction,this.error.retryable&&this.retryCount<this.maxRetries&&e("span",null," • Auto-retry in progress..."))):null)(),(()=>this.error?null:this.isAuthenticating?e("div",{class:"text-info mt-2"},e("small",null,"Connecting to your bank...")):this.publicToken?e("div",{class:"text-success mt-2"},e("small",null,"✓ Bank account connected successfully")):!this.isSelected||this.publicToken||this.error||this.isAuthenticating?null:e("div",{class:"text-muted mt-2"},e("small",null,"Click to connect your bank account")))()))}static get watchers(){return{isSelected:["onSelectionChange"]}}},te=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=e=>t=>{t.preventDefault(),l.selectedPaymentMethod={id:e.id,type:e.type},l.paymentToken=e.id},this.isAllowedPaymentMethod=e=>!(e===E.SAVED_CARD&&l.disableCreditCard||e===E.SAVED_BANK_ACCOUNT&&l.disableBankAccount)}componentWillLoad(){l.paymentMethods.length||console.warn("No saved payment methods available."),l.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return l.disablePaymentMethodGroup?null:e(a,null,e("div",{class:"saved-payment-methods"},l.paymentMethods.length?l.paymentMethods.filter((e=>this.isAllowedPaymentMethod(e.type))).map((t=>e("div",{class:"radio-list-item p-3",part:u,onClick:this.onPaymentMethodOptionClick(t)},e("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:l.paymentToken===(null==t?void 0:t.id),label:`${O[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},ie=e("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),se=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.paymentMethodOptionId=E.SEZZLE,this.initializeSezzleCheckout=()=>{let e;this.sezzlePromise=new Promise((t=>{e=t}));const t=Number(l.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:l.bnplProviderClientId,apiMode:l.bnplProviderMode,apiVersion:l.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(e){e.preventDefault(),i.startCheckout({checkout_url:l.bnplProviderCheckoutUrl})},onComplete:t=>e({bnpl:t.data}),onCancel:t=>e({bnpl:t.data}),onFailure:t=>e({bnpl:t.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(t)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(e){return e.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}async handleSelectionClick(){l.selectedPaymentMethod={type:E.SEZZLE},this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)}render(){var t,i;return l.bnplEnabled?e(a,{class:"payment-method"},e("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:e=>this.scriptRef=e}),e("div",null,e("div",null,"Buy now, pay later with ",ie),this.installmentPlan&&e("small",null,e("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",e("span",null,this.installmentPlan.schedule," payments of")," ",e("span",{class:"fw-bold"},y(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))):(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null)}},ne={[E.NEW_BANK_ACCOUNT]:"New bank account",[E.NEW_CARD]:"New credit or debit card"},oe="Payment form not ready",ae="Validation error",re=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var e;null===(e=this.analytics)||void 0===e||e.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){A(),this.analytics=new k(this)}handleRadioClick(e){this.selectedPaymentMethod=e.detail,l.selectedPaymentMethod={type:e.detail}}async fillBillingForm(e){var t;null===(t=this.billingFormRef)||void 0===t||t.fill(e)}async tokenizePaymentMethod(e){null==e||e.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:P.TOKENIZE_ERROR,message:ae}),void(this.isLoading=!1);const e=await this.resolvePaymentMethod({isValid:!0});return e.error&&this.emitError({errorCode:e.error.code,message:e.error.message}),this.submitEvent.emit({response:e}),e}catch(e){const t=this.createErrorResponse(P.TOKENIZE_ERROR,e.message);return this.emitError({errorCode:P.TOKENIZE_ERROR,message:e.message}),this.submitEvent.emit({response:t}),t}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:oe}};const[e,t]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:e.isValid&&t.isValid,errors:Object.assign(Object.assign({},e.errors),t.errors)}}async tokenize(){try{const e=await this.billingFormRef.getValues(),t={clientId:this.authToken||l.authToken,account:this.accountId||l.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(e)};return await this.paymentMethodFormRef.tokenize(t)}catch(e){return e}}validateRequiredProps(){this.authToken||l.authToken||this.emitError({errorCode:P.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||l.accountId||this.emitError({errorCode:P.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=E.NEW_BANK_ACCOUNT,l.selectedPaymentMethod={type:E.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=E.NEW_CARD,l.selectedPaymentMethod={type:E.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const e=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=e}isSlottedWithinModularCheckout(){var e;let t=null===(e=this.host)||void 0===e?void 0:e.parentElement;for(;t;){if("JUSTIFI-MODULAR-CHECKOUT"===t.tagName)return!0;t=t.parentElement}return!1}get availablePaymentMethods(){const e=[];return this.disableCreditCard||e.push(E.NEW_CARD),this.disableBankAccount||e.push(E.NEW_BANK_ACCOUNT),e}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(e){this.errorEvent.emit(Object.assign(Object.assign({},e),{severity:w.ERROR}))}createErrorResponse(e,t){return{error:{code:e,message:t,decline_code:void 0}}}async resolvePaymentMethod(e){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",oe);try{const t=await this.validate();if(!t.isValid||!e.isValid){const e=Object.values(t.errors)[0]||ae;return{validationError:!0,error:{code:"validation_error",message:String(e),decline_code:void 0}}}return await this.performTokenization()}catch(e){return{error:e}}}async performTokenization(){var e,t;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(e=s.card)||void 0===e?void 0:e.token)||(null===(t=s.bank_account)||void 0===t?void 0:t.token),data:s}}buildPaymentMethodMetadata(e){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},e),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},e)}get paymentMethodGroupID(){return this.paymentMethodGroupId||l.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!l.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const i=this.selectedPaymentMethod===t&&void 0===l.selectedPaymentMethod.id;return e("div",{class:"payment-method"},e("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:i,label:ne[t],hidden:this.shouldHideRadioInput}),i&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return e("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),e("div",{class:"mt-4"},e("justifi-billing-form",{ref:e=>this.billingFormRef=e,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),e("div",{class:"mt-4"},e("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return e(t===E.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:e=>this.paymentMethodFormRef=e})}render(){return e(a,{key:"bf221d17739bf70c3f581f3b9791a725e76c3f35"},e("form",{key:"df117d42d4160f31df1fca5d6903967cc48ad573"},e("fieldset",{key:"550e670feffb405c669d44c44eb9073f535c6cb6"},e("div",{key:"8eff7d3ab19618da54161220b92641bf19bfa82d",class:"row gy-3"},e("div",{key:"bf9d19e92be74abf48ce65c97efb3f9df52d4c3c",class:"col-12"},this.availablePaymentMethods.map((e=>this.renderPaymentMethodOption(e)))),e("div",{key:"eef1f4e1e03c2263efb51ae94085c5a3d73a9166",class:"col-12"},e("justifi-button",{key:"f0e5697e658236610da45c34e64a8cbb3f0f9d95",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:e=>this.tokenizePaymentMethod(e),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return n(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{H as justifi_apple_pay,W as justifi_checkout_summary,q as justifi_header,J as justifi_modular_checkout,ee as justifi_plaid_payment_method,te as justifi_saved_payment_methods,se as justifi_sezzle_payment_method,re as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-BlOkWGxk.js";import{P as p}from"./p-8S_ROmnq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{d as n}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m}from"./p-DYGIC0QH.js";import{m as u,S as d}from"./p-DfV3dFDB.js";import{S as j}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{d as l}from"./p-D0Peuz-m.js";import"./p-CaO1cY-g.js";import"./p-DdZLLkQ5.js";import"./p-Bgnhf5c9.js";import"./p-DdMxswn1.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-au49QgoI.js";import"./p-hbWSMN3O.js";import"./p-xDbRW9xn.js";const f=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=l,this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializePayoutsServices(),this.initializeGetSubAccounts()}initializePayoutsServices(){if(this.accountId&&this.authToken){const t={id:this.accountId,authToken:this.authToken,service:new p};this.getPayouts=(({id:t,authToken:s,service:i})=>async({params:r,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchPayouts(t,s,r);if(u.error)return a({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:o.ERROR})}})(t),this.getPayoutCSV=m(t)}else this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR})}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new d}))}render(){return i(j,{key:"fb8e3e21a4e5a0aa971a91eed4ef0b603dbd1b23"},i("payouts-list-core",{key:"c9fb97bd0d77d1989f346285cd5124121ad4ac83",getPayouts:this.getPayouts,getPayoutCSV:this.getPayoutCSV,getSubAccounts:this.getSubAccounts,"onError-event":this.handleOnError,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{f as justifi_payouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a}from"./p-D2muobcE.js";import{c as p,J as n}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-DOjVAAtq.js";import"./p-a6tcNl_T.js";import"./p-HXpYMWUU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-C98BC5W5.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a}from"./p-D2muobcE.js";import{c as p,J as n}from"./p-BlOkWGxk.js";import{C as h}from"./p-CEk3bv0x.js";import{m,S as u}from"./p-DfV3dFDB.js";import{S as d}from"./p-BhCH9S0e.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-CmBCj61h.js";import"./p-DdMxswn1.js";import"./p-Bgnhf5c9.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-CaO1cY-g.js";import"./p-DdZLLkQ5.js";import"./p-hbWSMN3O.js";import"./p-xDbRW9xn.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){p(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i})=>async({params:r,onSuccess:p,onError:n})=>{var h,m;try{const u=await i.fetchCheckouts(t,s,r);if(u.error)return n({error:a(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);p({checkouts:(null===(h=u.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"b7e794982435af9a755c272767c017c57fa16b24"},i("checkouts-list-core",{key:"a8de52b59cbccd7cd97369663c074011b49b9499",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_checkouts_list}
|