@justifi/webcomponents 6.7.0 → 6.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/cjs/{check-pkg-version-nSgWWvdw.js → check-pkg-version-cLAIX_H6.js} +1 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +2 -2
  4. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +7 -6
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  24. package/dist/cjs/{package-B8gOzTFM.js → package-C9E_BIbT.js} +1 -1
  25. package/dist/collection/api/services/google-pay.service.js +2 -1
  26. package/dist/collection/components/modular-checkout/sub-components/google-pay.js +3 -3
  27. package/dist/docs.json +1 -1
  28. package/dist/esm/{check-pkg-version-CmkUoEAo.js → check-pkg-version-o2X_8wJ4.js} +1 -1
  29. package/dist/esm/hidden-input_2.entry.js +1 -1
  30. package/dist/esm/internal-tokenize-payment-method_7.entry.js +2 -2
  31. package/dist/esm/justifi-apple-pay_8.entry.js +7 -6
  32. package/dist/esm/justifi-business-details.entry.js +2 -2
  33. package/dist/esm/justifi-business-form.entry.js +2 -2
  34. package/dist/esm/justifi-checkout.entry.js +2 -2
  35. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  36. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  37. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  38. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  39. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  40. package/dist/esm/justifi-payment-details.entry.js +2 -2
  41. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  42. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  43. package/dist/esm/justifi-payments-list.entry.js +2 -2
  44. package/dist/esm/justifi-payout-details.entry.js +2 -2
  45. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  46. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  47. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  48. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  49. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  50. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  51. package/dist/esm/{package-CsRppqXL.js → package-Dr8Z8wfP.js} +1 -1
  52. package/dist/module/google-pay.js +5 -4
  53. package/dist/module/package.js +1 -1
  54. package/dist/types/api/services/google-pay.service.d.ts +1 -1
  55. package/dist/webcomponents/{p-50400c5e.entry.js → p-062fcfd5.entry.js} +1 -1
  56. package/dist/webcomponents/{p-f5dd3fa4.entry.js → p-1df660a9.entry.js} +1 -1
  57. package/dist/webcomponents/{p-ff5981fb.entry.js → p-262e4b23.entry.js} +1 -1
  58. package/dist/webcomponents/{p-b5b49e86.entry.js → p-296bd0b6.entry.js} +1 -1
  59. package/dist/webcomponents/p-3fb1cf2b.entry.js +1 -0
  60. package/dist/webcomponents/{p-eada0422.entry.js → p-3fbe8ac3.entry.js} +1 -1
  61. package/dist/webcomponents/{p-c0bd4e9a.entry.js → p-4dc358aa.entry.js} +1 -1
  62. package/dist/webcomponents/p-5a7207c0.entry.js +1 -0
  63. package/dist/webcomponents/{p-74fea39c.entry.js → p-5e6f2128.entry.js} +1 -1
  64. package/dist/webcomponents/{p-095cedc5.entry.js → p-7bb7aaca.entry.js} +1 -1
  65. package/dist/webcomponents/{p-f23428da.entry.js → p-8884e000.entry.js} +1 -1
  66. package/dist/webcomponents/{p-DISrhs4v.js → p-BEu9YFnf.js} +1 -1
  67. package/dist/webcomponents/p-Dr8Z8wfP.js +1 -0
  68. package/dist/webcomponents/{p-87988b4d.entry.js → p-abcb4945.entry.js} +1 -1
  69. package/dist/webcomponents/{p-04ec17bb.entry.js → p-ad3a73af.entry.js} +1 -1
  70. package/dist/webcomponents/{p-fc8f55d7.entry.js → p-c8a5a2a9.entry.js} +1 -1
  71. package/dist/webcomponents/p-ca0d1c6c.entry.js +1 -0
  72. package/dist/webcomponents/{p-fe73b09b.entry.js → p-cbd52897.entry.js} +1 -1
  73. package/dist/webcomponents/p-cc0c722c.entry.js +1 -0
  74. package/dist/webcomponents/{p-d2981754.entry.js → p-cc2a1c7c.entry.js} +1 -1
  75. package/dist/webcomponents/{p-b2a0cbad.entry.js → p-cf644e46.entry.js} +1 -1
  76. package/dist/webcomponents/p-d5765545.entry.js +1 -0
  77. package/dist/webcomponents/{p-d9cdd873.entry.js → p-def84700.entry.js} +1 -1
  78. package/dist/webcomponents/{p-c4585b68.entry.js → p-e2d33311.entry.js} +1 -1
  79. package/dist/webcomponents/webcomponents.esm.js +1 -1
  80. package/package.json +1 -1
  81. package/dist/webcomponents/p-0e981c28.entry.js +0 -1
  82. package/dist/webcomponents/p-15ceeea7.entry.js +0 -1
  83. package/dist/webcomponents/p-9c1aa22d.entry.js +0 -1
  84. package/dist/webcomponents/p-CsRppqXL.js +0 -1
  85. package/dist/webcomponents/p-aa145996.entry.js +0 -1
  86. package/dist/webcomponents/p-ef04f334.entry.js +0 -1
@@ -3,7 +3,7 @@ import { E as ErrorState } from './utils-CgFsPVsv.js';
3
3
  import { B as BusinessService } from './business.service-BrUSam2T.js';
4
4
  import { m as makeGetBusiness } from './get-business-Xt7B5dSo.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-CmkUoEAo.js';
6
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
7
7
  import './parts-sA8HBfkI.js';
8
8
  import './Api-Dln8a6No.js';
9
9
  import './config-state-C2NXATwF.js';
@@ -16,7 +16,7 @@ import './index-DkoufM1t.js';
16
16
  import './Pagination-CLHwhyvu.js';
17
17
  import './Business-B5rtFhtR.js';
18
18
  import './utils-BeQLScSm.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
 
21
21
  const BusinessDetails = class {
22
22
  constructor(hostRef) {
@@ -9,7 +9,7 @@ import './GooglePay-NNHE-OLJ.js';
9
9
  import './Pagination-CLHwhyvu.js';
10
10
  import { C as CountryCode, B as Business, b as BusinessFormServerErrors } from './Business-B5rtFhtR.js';
11
11
  import './Dispute-BH0Xfn-F.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
13
13
  import { B as Button } from './button-Bpf3VX8Q.js';
14
14
  import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
15
15
  import { H as Header1 } from './header-1-WwkF5F9y.js';
@@ -25,7 +25,7 @@ import './business-form-options-D6s5H4RI.js';
25
25
  import './index-B-fWxE5e.js';
26
26
  import './utils-CDaVtz_6.js';
27
27
  import './index-DkoufM1t.js';
28
- import './package-CsRppqXL.js';
28
+ import './package-Dr8Z8wfP.js';
29
29
  import './Api-Dln8a6No.js';
30
30
  import './parts-sA8HBfkI.js';
31
31
  import './utils-BeQLScSm.js';
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
3
3
  import { c as checkoutStore } from './GooglePay-NNHE-OLJ.js';
4
4
  import { d as checkoutSummary } from './parts-sA8HBfkI.js';
5
5
  import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
6
6
  import './event-types-CZfYo5-1.js';
7
7
  import { P as PAYMENT_METHODS } from './index-DkoufM1t.js';
8
- import './package-CsRppqXL.js';
8
+ import './package-Dr8Z8wfP.js';
9
9
  import './Api-Dln8a6No.js';
10
10
  import './config-state-C2NXATwF.js';
11
11
  import './index-B-fWxE5e.js';
@@ -7,7 +7,7 @@ import './Pagination-CLHwhyvu.js';
7
7
  import './Business-B5rtFhtR.js';
8
8
  import './Dispute-BH0Xfn-F.js';
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
11
11
  import { C as CheckoutService } from './checkout.service-Bxt1qPaY.js';
12
12
  import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccounts-CzGHjlUF.js';
13
13
  import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
@@ -16,7 +16,7 @@ import { d as defaultColumnsKeys } from './checkouts-table-CB4GdlcZ.js';
16
16
  import './index-B-fWxE5e.js';
17
17
  import './utils-CDaVtz_6.js';
18
18
  import './index-DkoufM1t.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
  import './Api-Dln8a6No.js';
21
21
  import './badge-DtrH25ss.js';
22
22
  import './parts-sA8HBfkI.js';
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.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-CmkUoEAo.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
4
4
  import { D as Dispute } from './Dispute-BH0Xfn-F.js';
5
5
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
6
6
  import { D as DisputeService } from './dispute.service-DYRYxxaT.js';
7
- import './package-CsRppqXL.js';
7
+ import './package-Dr8Z8wfP.js';
8
8
  import './Api-Dln8a6No.js';
9
9
  import './config-state-C2NXATwF.js';
10
10
  import './index-B-fWxE5e.js';
@@ -9,7 +9,7 @@ import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './Compone
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
10
  import { D as DisputeService } from './dispute.service-DYRYxxaT.js';
11
11
  import { D as DisputeManagementClickActions } from './event-types-Bg2SZArf.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
13
13
  import './dinero-HXpYMWUU.js';
14
14
  import './Api-Dln8a6No.js';
15
15
  import './config-state-C2NXATwF.js';
@@ -19,7 +19,7 @@ import './Dispute-BH0Xfn-F.js';
19
19
  import './index-DkoufM1t.js';
20
20
  import './Pagination-CLHwhyvu.js';
21
21
  import './Business-B5rtFhtR.js';
22
- import './package-CsRppqXL.js';
22
+ import './package-Dr8Z8wfP.js';
23
23
 
24
24
  const makeUpdateDisputeResponse = ({ authToken, disputeId, service }) => async ({ payload, onSuccess, onError, final = () => { } }) => {
25
25
  var _a;
@@ -7,14 +7,14 @@ import './Business-B5rtFhtR.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-CgFsPVsv.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
11
11
  import './config-state-C2NXATwF.js';
12
12
  import './index-B-fWxE5e.js';
13
13
  import './utils-CDaVtz_6.js';
14
14
  import './dinero-HXpYMWUU.js';
15
15
  import './index-DkoufM1t.js';
16
16
  import './parts-sA8HBfkI.js';
17
- import './package-CsRppqXL.js';
17
+ import './package-Dr8Z8wfP.js';
18
18
 
19
19
  const api = Api();
20
20
  class ReportsService {
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent } from './index-DwYM91AU.js'
2
2
  import { ao as heading5, am as heading4, ai as buttonPrimary, G as text } from './parts-sA8HBfkI.js';
3
3
  import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
4
4
  import './event-types-CZfYo5-1.js';
5
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
5
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
6
6
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
7
7
  import { B as BusinessService } from './business.service-BrUSam2T.js';
8
8
  import { B as Business } from './Business-B5rtFhtR.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-YKfi6Mr9.js';
18
18
  import { k as formatPhoneNumber } from './utils-CDaVtz_6.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
  import './Api-Dln8a6No.js';
21
21
  import './index-B-fWxE5e.js';
22
22
  import './index-DkoufM1t.js';
@@ -3,7 +3,7 @@ import { P as PaymentService } from './payment.service-BoGemgMw.js';
3
3
  import { m as makeGetPaymentDetails } from './get-payment-details-BJ1PLhJZ.js';
4
4
  import { E as ErrorState } from './utils-CgFsPVsv.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-CmkUoEAo.js';
6
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
7
7
  import './Api-Dln8a6No.js';
8
8
  import './config-state-C2NXATwF.js';
9
9
  import './index-B-fWxE5e.js';
@@ -16,7 +16,7 @@ import './Pagination-CLHwhyvu.js';
16
16
  import './Business-B5rtFhtR.js';
17
17
  import './utils-BeQLScSm.js';
18
18
  import './parts-sA8HBfkI.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
 
21
21
  const PaymentDetails = class {
22
22
  constructor(hostRef) {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.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-BrUSam2T.js';
@@ -8,7 +8,7 @@ import './GooglePay-NNHE-OLJ.js';
8
8
  import './Pagination-CLHwhyvu.js';
9
9
  import './Business-B5rtFhtR.js';
10
10
  import './Dispute-BH0Xfn-F.js';
11
- import './package-CsRppqXL.js';
11
+ import './package-Dr8Z8wfP.js';
12
12
  import './utils-BeQLScSm.js';
13
13
  import './config-state-C2NXATwF.js';
14
14
  import './index-B-fWxE5e.js';
@@ -6,7 +6,7 @@ import { h as PaymentBalanceTransaction } from './GooglePay-NNHE-OLJ.js';
6
6
  import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
7
7
  import './Business-B5rtFhtR.js';
8
8
  import './Dispute-BH0Xfn-F.js';
9
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
9
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
10
10
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
11
11
  import { P as PaymentService } from './payment.service-BoGemgMw.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-1hqe6s5m.js';
@@ -16,7 +16,7 @@ import { a as convertToLocal } from './utils-CDaVtz_6.js';
16
16
  import { V as tableHeadCell, W as getAlternateTableCellPart } from './parts-sA8HBfkI.js';
17
17
  import './index-B-fWxE5e.js';
18
18
  import './index-DkoufM1t.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
  import './Api-Dln8a6No.js';
21
21
  import './spinner-DikooWuI.js';
22
22
 
@@ -8,7 +8,7 @@ import './Pagination-CLHwhyvu.js';
8
8
  import './Business-B5rtFhtR.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-CmkUoEAo.js';
11
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
12
12
  import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
13
13
  import './event-types-CZfYo5-1.js';
14
14
  import { d as defaultColumnsKeys } from './payments-table-C6zHWwGO.js';
@@ -16,7 +16,7 @@ import './Api-Dln8a6No.js';
16
16
  import './utils-CDaVtz_6.js';
17
17
  import './index-B-fWxE5e.js';
18
18
  import './index-DkoufM1t.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
  import './payments-status-CADg1cD0.js';
21
21
  import './badge-DtrH25ss.js';
22
22
  import './parts-sA8HBfkI.js';
@@ -9,14 +9,14 @@ import './Business-B5rtFhtR.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-CgFsPVsv.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
13
13
  import { m as makeGetPayoutCSV } from './get-payout-csv-D-Lnooki.js';
14
14
  import './Api-Dln8a6No.js';
15
15
  import './utils-CDaVtz_6.js';
16
16
  import './index-B-fWxE5e.js';
17
17
  import './index-DkoufM1t.js';
18
18
  import './parts-sA8HBfkI.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
 
21
21
  const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
22
22
  var _a;
@@ -6,7 +6,7 @@ import { i as PayoutBalanceTransaction } from './GooglePay-NNHE-OLJ.js';
6
6
  import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
7
7
  import './Business-B5rtFhtR.js';
8
8
  import './Dispute-BH0Xfn-F.js';
9
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
9
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
10
10
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
11
11
  import { P as PayoutService } from './payout.service-BSG50wqN.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-1hqe6s5m.js';
@@ -16,7 +16,7 @@ import { a as convertToLocal } from './utils-CDaVtz_6.js';
16
16
  import { V as tableHeadCell, W as getAlternateTableCellPart } from './parts-sA8HBfkI.js';
17
17
  import './index-B-fWxE5e.js';
18
18
  import './index-DkoufM1t.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
  import './Api-Dln8a6No.js';
21
21
  import './spinner-DikooWuI.js';
22
22
 
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.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-CmkUoEAo.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
4
4
  import { P as PayoutService } from './payout.service-BSG50wqN.js';
5
5
  import './config-state-C2NXATwF.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-DhOcKWqZ.js';
15
15
  import './event-types-CZfYo5-1.js';
16
16
  import { d as defaultColumnsKeys } from './payouts-table-BU5XbzB9.js';
17
- import './package-CsRppqXL.js';
17
+ import './package-Dr8Z8wfP.js';
18
18
  import './Api-Dln8a6No.js';
19
19
  import './utils-CDaVtz_6.js';
20
20
  import './index-B-fWxE5e.js';
@@ -12,7 +12,7 @@ import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
12
12
  import './event-types-CZfYo5-1.js';
13
13
  import { P as PaymentService } from './payment.service-BoGemgMw.js';
14
14
  import { m as makeGetPaymentDetails } from './get-payment-details-BJ1PLhJZ.js';
15
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
15
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
16
16
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
17
17
  import { A as Api } from './Api-Dln8a6No.js';
18
18
  import { S as Skeleton } from './skeleton-Dtt56Fl3.js';
@@ -21,7 +21,7 @@ import './dinero-HXpYMWUU.js';
21
21
  import './index-B-fWxE5e.js';
22
22
  import './index-DkoufM1t.js';
23
23
  import './parts-sA8HBfkI.js';
24
- import './package-CsRppqXL.js';
24
+ import './package-Dr8Z8wfP.js';
25
25
 
26
26
  const amountValidation = (maxAmount) => {
27
27
  const max = +maxAmount;
@@ -6,7 +6,7 @@ import './Pagination-CLHwhyvu.js';
6
6
  import './Business-B5rtFhtR.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-CmkUoEAo.js';
9
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
10
10
  import { p as processHTML, f as formatCurrency, r as removeAttribute, j as addAttribute } from './utils-CDaVtz_6.js';
11
11
  import { v as validateInsuranceValues, i as insuranceValues, a as insuranceErrors, H as Header2 } from './insurance-state-C11WKZU6.js';
12
12
  import { G as text, H as textDanger } from './parts-sA8HBfkI.js';
@@ -16,7 +16,7 @@ import { S as Skeleton } from './skeleton-Dtt56Fl3.js';
16
16
  import './config-state-C2NXATwF.js';
17
17
  import './index-B-fWxE5e.js';
18
18
  import './index-DkoufM1t.js';
19
- import './package-CsRppqXL.js';
19
+ import './package-Dr8Z8wfP.js';
20
20
  import './dinero-HXpYMWUU.js';
21
21
 
22
22
  const api = Api();
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.js';
2
2
  import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
3
3
  import './event-types-CZfYo5-1.js';
4
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-CmkUoEAo.js';
4
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
5
5
  import { d as defaultColumnsKeys } from './terminal-orders-table-BsVBelxB.js';
6
6
  import './config-state-C2NXATwF.js';
7
7
  import './dinero-HXpYMWUU.js';
@@ -12,7 +12,7 @@ import './Business-B5rtFhtR.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-Dln8a6No.js';
15
- import './package-CsRppqXL.js';
15
+ import './package-Dr8Z8wfP.js';
16
16
  import './parts-sA8HBfkI.js';
17
17
  import './utils-CDaVtz_6.js';
18
18
  import './badge-DtrH25ss.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.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-CmkUoEAo.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-o2X_8wJ4.js';
4
4
  import { T as TerminalService } from './terminal.service-YKfi6Mr9.js';
5
5
  import './config-state-C2NXATwF.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-DhOcKWqZ.js';
14
14
  import './event-types-CZfYo5-1.js';
15
15
  import { d as defaultColumnsKeys } from './terminals-table-CXJTn-0I.js';
16
- import './package-CsRppqXL.js';
16
+ import './package-Dr8Z8wfP.js';
17
17
  import './Api-Dln8a6No.js';
18
18
  import './utils-CDaVtz_6.js';
19
19
  import './index-B-fWxE5e.js';
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "6.7.0";
2
+ const version = "6.7.1";
3
3
  var packageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -215,7 +215,7 @@ class GooglePayService {
215
215
  /**
216
216
  * Create a basic payment data request
217
217
  */
218
- static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName) {
218
+ static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName, merchantId) {
219
219
  const request = {
220
220
  apiVersion: 2,
221
221
  apiVersionMinor: 0,
@@ -229,6 +229,7 @@ class GooglePayService {
229
229
  },
230
230
  merchantInfo: {
231
231
  merchantName,
232
+ merchantId,
232
233
  },
233
234
  };
234
235
  // No debug logs
@@ -691,16 +692,16 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
691
692
  }
692
693
  }
693
694
  createPaymentDataRequest() {
694
- return GooglePayService.createPaymentDataRequest(checkoutStore.paymentAmount, checkoutStore.paymentDescription, this.countryCode, checkoutStore.paymentCurrency, this.merchantName);
695
+ return GooglePayService.createPaymentDataRequest(checkoutStore.paymentAmount, checkoutStore.paymentDescription, this.countryCode, checkoutStore.paymentCurrency, this.merchantName, this.merchantId);
695
696
  }
696
697
  render() {
697
698
  const showError = !this.isLoading && !!this.error;
698
699
  const showDeviceUnavailable = !this.isLoading && !this.error && !this.isAvailable;
699
700
  const showPaymentsUnavailable = !this.isLoading && !this.error && this.isAvailable && !this.canMakePayments;
700
701
  const showButton = !this.isLoading && !this.error && this.isAvailable && this.canMakePayments;
701
- return (h(StyledHost, { key: '1f0b34c9821cc3442d470ffe63abce283f81fa89' }, checkoutStore.checkoutLoaded && (h("script", { key: '0d5e5f405b50629e6dc80a545a06a4dafc341e64', async: true, src: 'https://pay.google.com/gp/p/js/pay.js', onLoad: () => {
702
+ return (h(StyledHost, { key: 'ee9d21e776e2a5c48d3fa2fb505290020707897d' }, checkoutStore.checkoutLoaded && (h("script", { key: '72bd5be9e6b80a42e219082cb248927aa6e1154b', async: true, src: 'https://pay.google.com/gp/p/js/pay.js', onLoad: () => {
702
703
  this.initializeGooglePay();
703
- } })), h("div", { key: '83a35cff20c0b1c4de521a845a6fb964c81dfcae', class: 'google-pay-container' }, h(GooglePaySkeleton, { key: '245833ba9f530d3e9e35373cd8b22dff00451561', isLoading: this.isLoading }), showError && (h("div", { key: 'e47b0aeffae5b749fe1da9b8bd00e2aafe9d6616', class: 'google-pay-error', role: 'alert', "data-testid": 'gp-error' }, h("span", { key: 'd1dd1d928868b0917be696deecac2db51a8b2356', class: 'error-icon' }, "\u26A0\uFE0F"), h("span", { key: '132c4a4fe9f635752f2c831f9fac46bf44f9414c', class: 'error-message' }, this.error))), showDeviceUnavailable && (h("div", { key: 'c376807e7b7d4eecf739ce2b7665c18cd36b7d6c', class: 'google-pay-unavailable', "data-testid": 'gp-device-unavailable' }, h("span", { key: '515f96d8a7edae2654ca900d4c6bdc31c0569dba', class: 'unavailable-message' }, "Google Pay is not available on this device"))), showPaymentsUnavailable && (h("div", { key: '917571ced603e504034d155f1066b8a47ad7db5b', class: 'google-pay-unavailable', "data-testid": 'gp-payments-unavailable' }, h("span", { key: 'd5a25481c52b9c781e7602014d41502a37ef41fb', class: 'unavailable-message' }, "Google Pay is not available for payments"))), showButton && (h(GooglePayButton, { key: 'ac9f2d4cef0f9f5bab2042e327182edba310d6c8', "data-testid": 'gp-button', buttonType: this.buttonType, buttonStyle: this.buttonStyle, buttonSizeMode: this.buttonSizeMode, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleGooglePayClick }))), h("style", { key: 'ead06da7b7b599bd68829a95d2725339ec40f44d' }, `
704
+ } })), h("div", { key: 'f0c2c019b80589e69c159e78b18e37fc5b1f5b21', class: 'google-pay-container' }, h(GooglePaySkeleton, { key: 'd2b1f727aec121ce5e71afcd4306df92a4b5dd3b', isLoading: this.isLoading }), showError && (h("div", { key: '257df18492bff1609b864b69e2fffbacfc751ead', class: 'google-pay-error', role: 'alert', "data-testid": 'gp-error' }, h("span", { key: 'f0ece1f1ceeb2fd957ab577f848741a377c7375d', class: 'error-icon' }, "\u26A0\uFE0F"), h("span", { key: '9139e3824de300b51b2f577fbfa77ab200b0afa5', class: 'error-message' }, this.error))), showDeviceUnavailable && (h("div", { key: 'f1bf0002a82aec202b168130729c16caeb254119', class: 'google-pay-unavailable', "data-testid": 'gp-device-unavailable' }, h("span", { key: 'de42cef5e7fd8df4f84c6b2d9429672b97e9e805', class: 'unavailable-message' }, "Google Pay is not available on this device"))), showPaymentsUnavailable && (h("div", { key: 'a4738f6c36240efee000560acc775e431b517588', class: 'google-pay-unavailable', "data-testid": 'gp-payments-unavailable' }, h("span", { key: '6987a5208a702c15081660b09bfc10360eeef922', class: 'unavailable-message' }, "Google Pay is not available for payments"))), showButton && (h(GooglePayButton, { key: 'de09f6693db4dc60ba6529e683dc213bec8492a5', "data-testid": 'gp-button', buttonType: this.buttonType, buttonStyle: this.buttonStyle, buttonSizeMode: this.buttonSizeMode, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleGooglePayClick }))), h("style", { key: 'ed3249a9b1f55720f6f4f29b3923ae2c6eda3431' }, `
704
705
  .google-pay-container {
705
706
  width: 100%;
706
707
  }
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "6.7.0";
2
+ const version = "6.7.1";
3
3
  var webcomponentsPackageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -48,7 +48,7 @@ export declare class GooglePayService implements IGooglePayService {
48
48
  /**
49
49
  * Create a basic payment data request
50
50
  */
51
- static createPaymentDataRequest(amount: number, label: string, countryCode: string, currencyCode: string, merchantName: string): IGooglePayPaymentDataRequest;
51
+ static createPaymentDataRequest(amount: number, label: string, countryCode: string, currencyCode: string, merchantName: string, merchantId: string): IGooglePayPaymentDataRequest;
52
52
  /**
53
53
  * Get current configuration
54
54
  */
@@ -1 +1 @@
1
- import{r as e,h as n,H as t,c as i,g as o}from"./p-DwYM91AU.js";import{c as r}from"./p-BYsgavgS.js";import{i as s,b as a,a as c,c as d,l as u}from"./p-sA8HBfkI.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-CZ3F1ZAT.js";import{p as h}from"./p-CsRppqXL.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"5ebb1ec479a87430d51fbdff53edcaace72e98c2"},n("input",{key:"48ace17d93b23f5da773412390fd8187c03cd59d",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){N(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=P(),window.iFrameResize=window.iFrameResize||P()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(W),T(H),l("onResized",W)}),W,"init")}function t(e){var n=Number(u[H]["max"+e]),t=Number(u[H]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(H,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(H,"Set "+i+" to min value")),o>n&&(o=n,p(H,"Set "+i+" to max value")),W[i]=""+o}function i(e){return N.slice(N.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;A("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(H),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(H,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(H,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(H,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(H)}function f(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};l(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function l(e,n){return S(H,e,n)}var m,b,y,x,I,F,N=e.data,W={},H=null;"[iFrameResizerChild]Ready"===N?function(){for(var e in u)A("iFrame requested init",E(e),u[e].iframe,e)}():s===(""+N).slice(0,13)&&N.slice(13).split(":")[0]in u?(x=(y=N.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,F=getComputedStyle(I),W={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(F)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(F),width:y[2],type:y[3]},u[H=W.id]&&(u[H].loaded=!0),(b=W.type in{true:1,false:1,undefined:1})&&p(H,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(W.type+" No settings for "+e+". Message was: "+N)),n}(H)&&(p(H,"Received: "+N),m=!0,null===W.iframe&&(k(H,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[H]&&u[H].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(H,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(H,"Checking connection is from: "+(n=u[H]&&u[H].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[H]&&u[H].firstRun&&u[H]&&(u[H].firstRun=!1),W.type){case"close":z(W.iframe);break;case"message":m=i(6),p(H,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(H,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[H].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[H]&&u[H].iframe,H),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=H;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[H]&&u[H].stopPageInfo&&(u[H].stopPageInfo(),delete u[H].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(H,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(H,"--")):window.top===window.self?p(H,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(H,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(W);break;case"init":n(),l("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?k("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(H,"Ignored: "+N)}function S(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function F(e){delete u[e.id]}function z(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}S(t,"onClosed",t),p(t,"--"),F(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),A("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&A("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function A(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function E(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function N(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=E(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&z(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){A("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),A("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:z.bind(null,u[f].iframe),removeListeners:F.bind(null,u[f].iframe),resize:A.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){A("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function W(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function H(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){L("Tab Visible","resize")}),16))}function L(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&A(e,n,u[t].iframe,t)}))}function P(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),N(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){L("Window resize","resize")}),16)})),w(document,"visibilitychange",H),w(document,"-webkit-visibilitychange",H),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded"),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"b7f549db9954e772632f144d0b8fab81aa00ac48",class:"form-group d-flex flex-column"},n("div",{key:"c073506d6835001d515839382d5140ea074cb1c8",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"a80095abc7580bf8f4704239a27d0d819df48800",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"d3c5647e79ae3f2fc68cd3b0395c18416ef848fe",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"66ad8a684dcc1397fe11ac2e1c7429ce88ec1166",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"bca0e095f13b229ad73a309e9c39b4a42104e303",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,I as iframe_input}
1
+ import{r as e,h as n,H as t,c as i,g as o}from"./p-DwYM91AU.js";import{c as r}from"./p-BYsgavgS.js";import{i as s,b as a,a as c,c as d,l as u}from"./p-sA8HBfkI.js";import{g as f}from"./p-BFTU3MAI.js";import{F as l}from"./p-CZ3F1ZAT.js";import{p as h}from"./p-Dr8Z8wfP.js";const m=r({focused:{boxShadow:"",border:""},focusedAndInvalid:{boxShadow:"",border:""},fontStyles:{fontFamily:"",fontSize:"",fontWeight:"",lineHeight:"",margin:"",padding:""}}),{state:w,set:g}=m,b=class{constructor(n){e(this,n),this.isFocused=!1,this.errorText=""}focusWithoutPageScroll(e){if(e)try{e.focus({preventScroll:!0})}catch(n){const{scrollX:t,scrollY:i}=window;e.focus(),window.scrollTo(t,i)}}async componentDidLoad(){const e=await this.getBaseFontStyles();g("fontStyles",e);const n=await this.getFocusedStyles();g("focused",n);const t=await this.getFocusedAndInvalidStyles();g("focusedAndInvalid",t)}async getBaseFontStyles(){return new Promise((e=>{setTimeout((()=>{const n=getComputedStyle(this.hiddenInput);e({fontFamily:n.fontFamily,fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,margin:n.margin,padding:n.padding,color:n.color})}),500)}))}async getFocusedStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),setTimeout((()=>{this.hiddenInput.blur();let n=getComputedStyle(this.hiddenInput);e({boxShadow:n.boxShadow,border:n.border})}),500)}))}async getFocusedAndInvalidStyles(){return new Promise((e=>{this.focusWithoutPageScroll(this.hiddenInput),this.errorText="Error",setTimeout((()=>{const n=getComputedStyle(this.hiddenInput),t={boxShadow:n.boxShadow,border:n.border};this.hiddenInput.blur(),e(t)}),500)}))}get part(){return this.isFocused&&this.errorText?s:this.errorText?a:this.isFocused?c:d}render(){return n(t,{key:"5ebb1ec479a87430d51fbdff53edcaace72e98c2"},n("input",{key:"48ace17d93b23f5da773412390fd8187c03cd59d",ref:e=>this.hiddenInput=e,type:"text",class:this.errorText?"form-control is-invalid":"form-control",onFocus:()=>this.isFocused=!0,onBlur:()=>this.isFocused=!1,part:this.part,tabindex:"-1",style:{height:"0",opacity:"0",pointerEvents:"none",animation:"none"}}))}};var p,y,v={exports:{}},k=f((p||(p=1,y=v,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var n,t,i=0,o=!1,r=!1,s="[iFrameSizer]",a=null,c=window.requestAnimationFrame,d=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},f=null,l=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){k("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),h={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(n,t){N(t,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),y.exports=L(),window.iFrameResize=window.iFrameResize||L()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,t){e.addEventListener(n,t,!1)}function g(e,n,t){e.removeEventListener(n,t,!1)}function b(e){return u[e]?u[e].log:o}function p(e,n){x("log",e,n,b(e))}function v(e,n){x("info",e,n,b(e))}function k(e,n){x("warn",e,n,!0)}function x(e,n,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var n="Host page: "+e;return window.top!==window.self&&(n=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),n}(e)+"]"}(n),t)}function I(e){function n(){t("Height"),t("Width"),C((function(){R(W),T(H),l("onResized",W)}),W,"init")}function t(e){var n=Number(u[H]["max"+e]),t=Number(u[H]["min"+e]),i=e.toLowerCase(),o=Number(W[i]);p(H,"Checking "+i+" is in range "+t+"-"+n),o<t&&(o=t,p(H,"Set "+i+" to min value")),o>n&&(o=n,p(H,"Set "+i+" to max value")),W[i]=""+o}function i(e){return N.slice(N.indexOf(":")+7+e)}function o(e,n){var t,i;t=function(){var t,i;A("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=W.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,n)},h[i=n]||(h[i]=setTimeout((function(){h[i]=null,t()}),32))}function r(e){var n=e.getBoundingClientRect();return M(H),{x:Math.floor(Number(n.left)+Number(a.x)),y:Math.floor(Number(n.top)+Number(a.y))}}function c(e){var n=e?r(W.iframe):{x:0,y:0},t={x:Number(W.width)+n.x,y:Number(W.height)+n.y};p(H,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top===window.self?(a=t,d(),p(H,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):k(H,"Unable to scroll to requested position, window.parentIFrame not found")}function d(){!1===l("onScroll",a)?j():T(H)}function f(e){var n={};if(0===Number(W.width)&&0===Number(W.height)){var t=i(9).split(":");n={x:t[1],y:t[0]}}else n={x:W.width,y:W.height};l(e,{iframe:W.iframe,screenX:Number(n.x),screenY:Number(n.y),type:W.type})}function l(e,n){return S(H,e,n)}var m,b,y,x,I,F,N=e.data,W={},H=null;"[iFrameResizerChild]Ready"===N?function(){for(var e in u)A("iFrame requested init",E(e),u[e].iframe,e)}():s===(""+N).slice(0,13)&&N.slice(13).split(":")[0]in u?(x=(y=N.slice(13).split(":"))[1]?parseInt(y[1],10):0,I=u[y[0]]&&u[y[0]].iframe,F=getComputedStyle(I),W={iframe:I,id:y[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(F)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(F),width:y[2],type:y[3]},u[H=W.id]&&(u[H].loaded=!0),(b=W.type in{true:1,false:1,undefined:1})&&p(H,"Ignoring init message from meta parent page"),!b&&function(e){var n=!0;return u[e]||(n=!1,k(W.type+" No settings for "+e+". Message was: "+N)),n}(H)&&(p(H,"Received: "+N),m=!0,null===W.iframe&&(k(H,"IFrame ("+W.id+") not found"),m=!1),m&&function(){var n,t=e.origin,i=u[H]&&u[H].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,n=!1;for(p(H,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){n=!0;break}return n}():(p(H,"Checking connection is from: "+(n=u[H]&&u[H].remoteHost)),t===n)))throw new Error("Unexpected message received from: "+t+" for "+W.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[H]&&u[H].firstRun&&u[H]&&(u[H].firstRun=!1),W.type){case"close":z(W.iframe);break;case"message":m=i(6),p(H,"onMessage passed: {iframe: "+W.iframe.id+", message: "+m+"}"),l("onMessage",{iframe:W.iframe,message:JSON.parse(m)}),p(H,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[H].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":o(u[H]&&u[H].iframe,H),function(){function e(e,i){function r(){u[t]?o(u[t].iframe,t):n()}["scroll","resize"].forEach((function(n){p(t,e+n+" listener for sendPageInfo"),i(window,n,r)}))}function n(){e("Remove ",g)}var t=H;e("Add ",w),u[t]&&(u[t].stopPageInfo=n)}();break;case"pageInfoStop":u[H]&&u[H].stopPageInfo&&(u[H].stopPageInfo(),delete u[H].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",s=decodeURIComponent(t),(h=document.getElementById(s)||document.getElementsByName(s)[0])?(e=r(h),p(H,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},d(),p(H,"--")):window.top===window.self?p(H,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):p(H,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":O(W);break;case"init":n(),l("onInit",W.iframe);break;default:0===Number(W.width)&&0===Number(W.height)?k("Unsupported message received ("+W.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):n()}var e,t,s,h,m}())):v(H,"Ignored: "+N)}function S(e,n,t){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=i(t)}return o}function F(e){delete u[e.id]}function z(e){var t=e.id;if(!1!==S(t,"onClose",t)){p(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){k(e)}S(t,"onClosed",t),p(t,"--"),F(e),n&&(n.disconnect(),n=null)}else p(t,"Close iframe cancelled by onClose event")}function M(n){null===a&&p(n,"Get page position: "+(a={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+a.y)}function T(e){null!==a&&(window.scrollTo(a.x,a.y),p(e,"Set page position: "+a.x+","+a.y),j())}function j(){a=null}function O(e){p(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),M(e.id),C((function(){R(e),A("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function n(n){r||"0"!==e[n]||(r=!0,p(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function n(n){return"0px"===(u[e]&&u[e].iframe.style[n])}u[e]&&null!==u[e].iframe.offsetParent&&(n("height")||n("width"))&&A("Visibility change","resize",u[e].iframe,e)}(e)}))}function n(n){p("window","Mutation observed: "+n[0].target+" "+n[0].type),W(e,16)}var t,i=m();i&&(t=document.querySelector("body"),new i(n).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(n){e.id?(e.iframe.style[n]=e[n]+"px",p(e.id,"IFrame ("+i+") "+n+" set to "+e[n]+"px")):p("undefined","messageData id not set")}(t),n(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function C(e,n,t){t!==n.type&&c&&!window.jasmine?(p(n.id,"Requesting animation frame"),c(e)):e()}function A(e,n,t,i,o){var r,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(p(i,"["+e+"] Sending msg to iframe["+i+"] ("+n+") targetOrigin: "+(r=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+n,r)):k(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,k(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function E(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function N(t,r){function s(e){var n=e.split("Callback");if(2===n.length){var t="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1);this[t]=this[e],delete this[e],k(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var a,c,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var n;return""===e&&(t.id=(n=r&&r.id||l.id+i++,null!==document.getElementById(n)&&(n+=i++),e=n),o=(r||{}).log,p(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?k(f,"Ignored iFrame, already setup."):(function(e){var n;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(s,e),function(e){for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(u[f][n]=Object.prototype.hasOwnProperty.call(e,n)?e[n]:l[n])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(n=u[f].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(r),function(){switch(p(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var n=u[f][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,p(f,"Set "+e+" = "+t.style[e]))}function n(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),a=E(f),(c=m())&&(n=function(e){if(!t.parentNode)return null;var n=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&z(t)}))}))}));return n.observe(t.parentNode,{childList:!0}),n}(c)),w(t,"load",(function(){A("iFrame.onload",a,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in d&&O({iframe:t,height:0,width:0,type:"init"})})),A("init",a,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:z.bind(null,u[f].iframe),removeListeners:F.bind(null,u[f].iframe),resize:A.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){A("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){A("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function W(e,n){null===f&&(f=setTimeout((function(){f=null,e()}),n))}function H(){"hidden"!==document.visibilityState&&(p("document","Trigger event: Visibility change"),W((function(){P("Tab Visible","resize")}),16))}function P(e,n){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&A(e,n,u[t].iframe,t)}))}function L(){function n(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),N(n,e),t.push(n))}var t;return function(){var e,n=["moz","webkit","o","ms"];for(e=0;e<n.length&&!c;e+=1)c=window[n[e]+"RequestAnimationFrame"];c?c=c.bind(window):p("setup","RequestAnimationFrame not supported")}(),w(window,"message",I),w(window,"resize",(function(){p("window","Trigger event: resize"),W((function(){P("Window resize","resize")}),16)})),w(document,"visibilitychange",H),w(document,"-webkit-visibilitychange",H),function(i,o){switch(t=[],function(e){e&&e.enablePublicMethods&&k("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),n.bind(e,i));break;case"object":n(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return t}}}()),v.exports));class x{constructor(e,n){this.iframe=e,this.iframeOrigin=n}postMessage(e,n){const t=Object.assign({eventType:e},n);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,n){return new Promise((t=>{const i=n=>{n.data.eventType===e&&(window.removeEventListener("message",i),t(n.data.data))};window.addEventListener("message",i),this.postMessage(e,n)}))}}const I=class{constructor(n){e(this,n),this.iframeLoaded=i(this,"iframeLoaded"),this.isFocused=!1,this.isValid=!0,this.dispatchMessageEvent=e=>{const{eventType:n,data:t}=e.data;(null==t?void 0:t.id)===this.inputId&&("focused"===n&&(this.isFocused=!0),"blurred"===n&&(this.isFocused=!1))}}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async validate(){const e=await this.frameService.postMessageWithResponseListener("validate");return this.isValid=e.isValid,this.errorText=e.error.message,e}async tokenize(e,n,t){return this.frameService.postMessageWithResponseListener("tokenize",{clientId:e,paymentMethodMetadata:n,account:t,componentVersion:h.version})}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}get part(){return this.isFocused&&!this.isValid?s:this.isValid?this.isFocused?c:d:a}get style(){return this.isFocused?this.isValid?w.focused:w.focusedAndInvalid:null}get urlParams(){const e=Object.fromEntries(Object.entries(w.fontStyles).map((([e,n])=>[e,btoa(String(n))])));return new URLSearchParams(e).toString()}render(){return n(t,{key:"b7f549db9954e772632f144d0b8fab81aa00ac48",class:"form-group d-flex flex-column"},n("div",{key:"c073506d6835001d515839382d5140ea074cb1c8",style:{visibility:this.iframeLoaded?"visible":"hidden",height:this.iframeLoaded?"auto":"0"}},n("label",{key:"a80095abc7580bf8f4704239a27d0d819df48800",class:"form-label",htmlFor:"",part:u},this.label||""),n("div",{key:"d3c5647e79ae3f2fc68cd3b0395c18416ef848fe",class:"p-0 d-flex form-control "+(this.isValid?"":"is-invalid"),part:this.part,style:Object.assign(Object.assign({},this.style),{overflow:"hidden"})},n("iframe",{key:"66ad8a684dcc1397fe11ac2e1c7429ce88ec1166",id:this.inputId,name:this.inputId,src:`${this.iframeOrigin}?${this.urlParams}`,ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},width:"100%",onLoad:()=>{k({log:!1,onResized:()=>{this.iframeLoaded.emit()}},this.iframeElement)}})),n(l,{key:"bca0e095f13b229ad73a309e9c39b4a42104e303",errorText:this.errorText,name:this.inputId})))}get el(){return o(this)}};export{b as hidden_input,I as iframe_input}
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,g as s,H as a}from"./p-DwYM91AU.js";import{S as r}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-DISrhs4v.js";import{w as o,c}from"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import{c as u}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{P as f}from"./p-DkoufM1t.js";import{S as m}from"./p-CsgUIrv8.js";import{B as b}from"./p-Ty7R7tsw.js";import{v as p}from"./p-sA8HBfkI.js";import"./p-CsRppqXL.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";const y=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:p,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},v={[f.NEW_BANK_ACCOUNT]:"New bank account",[f.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",k="Validation error",w=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,u.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:k}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||u.authToken,account:this.accountId||u.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||u.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||u.accountId||this.emitError({errorCode:h.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=f.NEW_BANK_ACCOUNT,u.selectedPaymentMethod={type:f.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=f.NEW_CARD,u.selectedPaymentMethod={type:f.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(f.NEW_CARD),this.disableBankAccount||t.push(f.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||k;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||u.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!u.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===u.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:v[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===f.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"8017b0fe2b0e3045a097e30aadf6a54ed2c32e62"},i("form",{key:"c7b0ac690a66cfb693d28e7d0eabc93817de4659"},i("fieldset",{key:"fb29e26a4100985595c420024d2a5ff48c79043b"},i("div",{key:"589f51297059afda2e385281dcfeafd67fbd2268",class:"row gy-3"},i("div",{key:"bf067015fb3ff24e08501899e370f92dda774c2e",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"28872ca9239e2f85cb83ad8e6f27dc10f84da151",class:"col-12"},i("justifi-button",{key:"1be3f46e34b42e69d065384dd195d7fdc09a0560",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},j=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(m,{height:"18px",width:"120px"}),i(m,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(m,{height:"18px",width:"110px"}),i(m,{height:"36px"}))))},C=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"0daa12da1ca699a05ca499425c4a37e4d913b2dd"},i(j,{key:"9d4ee0af94759d71d52130781401d322fcb5e397",isReady:this.isReady}),i("hidden-input",{key:"dc4ee0054cbc7acb214a1c410f8fd387677f92dc"}),i("div",{key:"b489311f205e0ffdaa4680621b706322bd3fc4ca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"2d1b00b9705d1a94364f691d4ad705c339abbbce",class:"row mb-3"},i("iframe-input",{key:"21a66eb7d87b77c1ff1a1171a4cb84a4759853dd",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"1ff36d49f7304e203cdefea46010100ed750ed68",class:"row"},i("iframe-input",{key:"2211a638c875e504e7e25e0704788d7a437b5806",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},M=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===f.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===f.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"7c8b76c4eaa412f2dc2ba59fd56cb7c28f46656c"},i(b,{key:"9440f90ebb380703b35b6c5d811e5d0780e80fd2",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},_=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(m,{height:"18px",width:"100px"}),i(m,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(m,{height:"18px",width:"80px"}),i(m,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(m,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(m,{height:"18px",width:"30px"}),i(m,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"b0b07a928be767102b59ec93ab0df6296b8418af"},i(_,{key:"03d37e42253a905ece1e6a9b1d654e84665470d6",isReady:this.isReady}),i("hidden-input",{key:"62f657a6c0a4d5b7a7bbf809abeb42eba0d22345"}),i("div",{key:"874cac5eac376c8c4e12d99f760cd3cd487a6521",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"dcada2d72eebe506fe4cab8ad6eb959c551e9e2d",class:"mb-3"},i("iframe-input",{key:"7e784726f8dd0c8b35832646bc99e0d2131c08f9",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"2384099f3aa18b7d6bbc346f47ba9ff06e5b7e86",class:"row"},i("div",{key:"5fb523cd3f398894e5c7ee3e8a58d34581492410",class:"col-4 align-content-end"},i("iframe-input",{key:"a3b4aa06a5c85162d24e25a5261a9a2cc64a6b82",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"3ccd6a19fce1c393a8c58534113239c518d51a4f",class:"col-4 align-content-end"},i("iframe-input",{key:"6d064b868c73b4431b476194602843b0f28729e0",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"26cd762bec43890e96ab5c6903943b0f4cfa9672",class:"col-4 align-content-end"},i("iframe-input",{key:"826dfe08347461bc5a94296b181826b70a7d1f6f",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},B=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,u.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"7cc086e518b2defcea924398cd5957b44a893d94"},i("form-control-checkbox",{key:"523dd82fe06f0c0a6d259a84f320c0a335261232",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{w as internal_tokenize_payment_method,C as justifi_bank_account_form,M as justifi_billing_form,x as justifi_button,P as justifi_card_form,y as justifi_radio_list_item,B as justifi_save_new_payment_method}
1
+ import{r as t,c as e,h as i,g as s,H as a}from"./p-DwYM91AU.js";import{S as r}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-BEu9YFnf.js";import{w as o,c}from"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import{c as u}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{P as f}from"./p-DkoufM1t.js";import{S as m}from"./p-CsgUIrv8.js";import{B as b}from"./p-Ty7R7tsw.js";import{v as p}from"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";const y=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:p,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},v={[f.NEW_BANK_ACCOUNT]:"New bank account",[f.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",k="Validation error",w=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,u.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:k}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||u.authToken,account:this.accountId||u.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||u.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||u.accountId||this.emitError({errorCode:h.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=f.NEW_BANK_ACCOUNT,u.selectedPaymentMethod={type:f.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=f.NEW_CARD,u.selectedPaymentMethod={type:f.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(f.NEW_CARD),this.disableBankAccount||t.push(f.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||k;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||u.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!u.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===u.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:v[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===f.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"8017b0fe2b0e3045a097e30aadf6a54ed2c32e62"},i("form",{key:"c7b0ac690a66cfb693d28e7d0eabc93817de4659"},i("fieldset",{key:"fb29e26a4100985595c420024d2a5ff48c79043b"},i("div",{key:"589f51297059afda2e385281dcfeafd67fbd2268",class:"row gy-3"},i("div",{key:"bf067015fb3ff24e08501899e370f92dda774c2e",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"28872ca9239e2f85cb83ad8e6f27dc10f84da151",class:"col-12"},i("justifi-button",{key:"1be3f46e34b42e69d065384dd195d7fdc09a0560",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},j=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(m,{height:"18px",width:"120px"}),i(m,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(m,{height:"18px",width:"110px"}),i(m,{height:"36px"}))))},C=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"0daa12da1ca699a05ca499425c4a37e4d913b2dd"},i(j,{key:"9d4ee0af94759d71d52130781401d322fcb5e397",isReady:this.isReady}),i("hidden-input",{key:"dc4ee0054cbc7acb214a1c410f8fd387677f92dc"}),i("div",{key:"b489311f205e0ffdaa4680621b706322bd3fc4ca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"2d1b00b9705d1a94364f691d4ad705c339abbbce",class:"row mb-3"},i("iframe-input",{key:"21a66eb7d87b77c1ff1a1171a4cb84a4759853dd",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"1ff36d49f7304e203cdefea46010100ed750ed68",class:"row"},i("iframe-input",{key:"2211a638c875e504e7e25e0704788d7a437b5806",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},M=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===f.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===f.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"7c8b76c4eaa412f2dc2ba59fd56cb7c28f46656c"},i(b,{key:"9440f90ebb380703b35b6c5d811e5d0780e80fd2",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},_=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(m,{height:"18px",width:"100px"}),i(m,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(m,{height:"18px",width:"80px"}),i(m,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(m,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(m,{height:"18px",width:"30px"}),i(m,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"b0b07a928be767102b59ec93ab0df6296b8418af"},i(_,{key:"03d37e42253a905ece1e6a9b1d654e84665470d6",isReady:this.isReady}),i("hidden-input",{key:"62f657a6c0a4d5b7a7bbf809abeb42eba0d22345"}),i("div",{key:"874cac5eac376c8c4e12d99f760cd3cd487a6521",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"dcada2d72eebe506fe4cab8ad6eb959c551e9e2d",class:"mb-3"},i("iframe-input",{key:"7e784726f8dd0c8b35832646bc99e0d2131c08f9",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"2384099f3aa18b7d6bbc346f47ba9ff06e5b7e86",class:"row"},i("div",{key:"5fb523cd3f398894e5c7ee3e8a58d34581492410",class:"col-4 align-content-end"},i("iframe-input",{key:"a3b4aa06a5c85162d24e25a5261a9a2cc64a6b82",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"3ccd6a19fce1c393a8c58534113239c518d51a4f",class:"col-4 align-content-end"},i("iframe-input",{key:"6d064b868c73b4431b476194602843b0f28729e0",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"26cd762bec43890e96ab5c6903943b0f4cfa9672",class:"col-4 align-content-end"},i("iframe-input",{key:"826dfe08347461bc5a94296b181826b70a7d1f6f",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},B=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,u.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"7cc086e518b2defcea924398cd5957b44a893d94"},i("form-control-checkbox",{key:"523dd82fe06f0c0a6d259a84f320c0a335261232",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{w as internal_tokenize_payment_method,C as justifi_bank_account_form,M as justifi_billing_form,x as justifi_button,P as justifi_card_form,y as justifi_radio_list_item,B as justifi_save_new_payment_method}