@justifi/webcomponents 6.12.1 → 6.12.2

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 (114) hide show
  1. package/dist/cjs/{Analytics-BhduX1FR.js → Analytics-C1Wd9OW4.js} +2 -2
  2. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  3. package/dist/cjs/card-form.cjs.entry.js +2 -2
  4. package/dist/cjs/{check-pkg-version-Bd2yxoh4.js → check-pkg-version-DMXmPDqZ.js} +1 -1
  5. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  6. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +74 -36
  7. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +3 -3
  8. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
  9. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
  10. package/dist/cjs/justifi-business-form.cjs.entry.js +3 -3
  11. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
  12. package/dist/cjs/justifi-checkout.cjs.entry.js +5 -6
  13. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  14. package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
  15. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +3 -3
  16. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
  17. package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
  18. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
  19. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -4
  20. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
  23. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
  24. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  25. package/dist/cjs/justifi-refund-payment.cjs.entry.js +3 -3
  26. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  27. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
  28. package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
  29. package/dist/cjs/{package-CjFkmEML.js → package-CRaVpb0w.js} +1 -1
  30. package/dist/collection/api/Analytics.js +1 -1
  31. package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +3 -1
  32. package/dist/collection/components/checkout/justifi-checkout.js +2 -3
  33. package/dist/collection/components/modular-checkout/sub-components/justifi-apple-pay.js +34 -14
  34. package/dist/collection/components/modular-checkout/sub-components/justifi-google-pay.js +4 -1
  35. package/dist/collection/components/modular-checkout/sub-components/justifi-plaid-payment-method.js +27 -14
  36. package/dist/collection/components/modular-checkout/sub-components/justifi-saved-payment-methods.js +7 -5
  37. package/dist/docs.json +1 -1
  38. package/dist/esm/{Analytics-4PEV3c9V.js → Analytics-qafLCOEU.js} +2 -2
  39. package/dist/esm/bank-account-form.entry.js +2 -2
  40. package/dist/esm/card-form.entry.js +2 -2
  41. package/dist/esm/{check-pkg-version-BmgaID9z.js → check-pkg-version-BJtCbzf9.js} +1 -1
  42. package/dist/esm/hidden-input_2.entry.js +1 -1
  43. package/dist/esm/justifi-apple-pay_11.entry.js +75 -37
  44. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +3 -3
  45. package/dist/esm/justifi-bank-account-form.entry.js +3 -3
  46. package/dist/esm/justifi-business-details.entry.js +3 -3
  47. package/dist/esm/justifi-business-form.entry.js +3 -3
  48. package/dist/esm/justifi-card-form.entry.js +3 -3
  49. package/dist/esm/justifi-checkout.entry.js +5 -6
  50. package/dist/esm/justifi-checkouts-list.entry.js +3 -3
  51. package/dist/esm/justifi-dispute-management.entry.js +3 -3
  52. package/dist/esm/justifi-dispute-notification_3.entry.js +3 -3
  53. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  54. package/dist/esm/justifi-order-terminals.entry.js +3 -3
  55. package/dist/esm/justifi-payment-details.entry.js +3 -3
  56. package/dist/esm/justifi-payment-provisioning.entry.js +6 -4
  57. package/dist/esm/justifi-payment-transactions-list.entry.js +3 -3
  58. package/dist/esm/justifi-payments-list.entry.js +3 -3
  59. package/dist/esm/justifi-payout-details.entry.js +3 -3
  60. package/dist/esm/justifi-payout-transactions-list.entry.js +3 -3
  61. package/dist/esm/justifi-payouts-list.entry.js +3 -3
  62. package/dist/esm/justifi-refund-payment.entry.js +3 -3
  63. package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
  64. package/dist/esm/justifi-terminal-orders-list.entry.js +3 -3
  65. package/dist/esm/justifi-terminals-list.entry.js +3 -3
  66. package/dist/esm/{package-CXKOe1m5.js → package-BCgsLInF.js} +1 -1
  67. package/dist/module/Analytics.js +1 -1
  68. package/dist/module/justifi-apple-pay2.js +34 -14
  69. package/dist/module/justifi-checkout.js +2 -3
  70. package/dist/module/justifi-google-pay2.js +4 -1
  71. package/dist/module/justifi-payment-provisioning.js +3 -1
  72. package/dist/module/justifi-plaid-payment-method2.js +27 -14
  73. package/dist/module/justifi-saved-payment-methods2.js +7 -5
  74. package/dist/module/package.js +1 -1
  75. package/dist/types/components/business-forms/payment-provisioning/justifi-payment-provisioning.d.ts +1 -1
  76. package/dist/types/components/modular-checkout/sub-components/justifi-apple-pay.d.ts +3 -0
  77. package/dist/types/components/modular-checkout/sub-components/justifi-plaid-payment-method.d.ts +2 -2
  78. package/dist/webcomponents/{p-017edf85.entry.js → p-06ecd4cb.entry.js} +1 -1
  79. package/dist/webcomponents/{p-b6d59ff4.entry.js → p-164f95ec.entry.js} +1 -1
  80. package/dist/webcomponents/p-174eb877.entry.js +1 -0
  81. package/dist/webcomponents/{p-9870fff0.entry.js → p-1e0be7b0.entry.js} +1 -1
  82. package/dist/webcomponents/p-39cc6928.entry.js +1 -0
  83. package/dist/webcomponents/p-4226eb4a.entry.js +1 -0
  84. package/dist/webcomponents/{p-b8c59954.entry.js → p-474ee3f8.entry.js} +1 -1
  85. package/dist/webcomponents/p-485b77ba.entry.js +1 -0
  86. package/dist/webcomponents/{p-0e9cb724.entry.js → p-581808f0.entry.js} +1 -1
  87. package/dist/webcomponents/{p-259ea5e0.entry.js → p-79713014.entry.js} +1 -1
  88. package/dist/webcomponents/{p-608a41d2.entry.js → p-798f4708.entry.js} +1 -1
  89. package/dist/webcomponents/{p-4f57368a.entry.js → p-7f0f72c6.entry.js} +1 -1
  90. package/dist/webcomponents/{p-1e080e95.entry.js → p-7f814609.entry.js} +1 -1
  91. package/dist/webcomponents/{p-61ebdd8b.entry.js → p-870fac9e.entry.js} +1 -1
  92. package/dist/webcomponents/{p-cd267d76.entry.js → p-956eca2e.entry.js} +1 -1
  93. package/dist/webcomponents/p-BCgsLInF.js +1 -0
  94. package/dist/webcomponents/{p-GP5gWjhc.js → p-BJ7GFTiW.js} +1 -1
  95. package/dist/webcomponents/{p-cXPhRFs-.js → p-BnaR7f2G.js} +1 -1
  96. package/dist/webcomponents/{p-b76b743e.entry.js → p-a80d958d.entry.js} +1 -1
  97. package/dist/webcomponents/{p-f4b390bc.entry.js → p-b2447726.entry.js} +1 -1
  98. package/dist/webcomponents/{p-f481695c.entry.js → p-c73631f0.entry.js} +1 -1
  99. package/dist/webcomponents/{p-d3829e18.entry.js → p-c8f7ebf6.entry.js} +1 -1
  100. package/dist/webcomponents/{p-1e66d430.entry.js → p-d7633e10.entry.js} +1 -1
  101. package/dist/webcomponents/{p-87a4b33f.entry.js → p-da882bd1.entry.js} +1 -1
  102. package/dist/webcomponents/{p-647668b6.entry.js → p-dd1cfb9e.entry.js} +1 -1
  103. package/dist/webcomponents/{p-06e88d51.entry.js → p-de836ec9.entry.js} +1 -1
  104. package/dist/webcomponents/{p-2b25c768.entry.js → p-f24563ab.entry.js} +1 -1
  105. package/dist/webcomponents/p-f4aeda71.entry.js +1 -0
  106. package/dist/webcomponents/{p-ed580b3c.entry.js → p-faa090a5.entry.js} +1 -1
  107. package/dist/webcomponents/webcomponents.esm.js +1 -1
  108. package/package.json +1 -1
  109. package/dist/webcomponents/p-11faee45.entry.js +0 -1
  110. package/dist/webcomponents/p-238163d8.entry.js +0 -1
  111. package/dist/webcomponents/p-CXKOe1m5.js +0 -1
  112. package/dist/webcomponents/p-cf31ccdd.entry.js +0 -1
  113. package/dist/webcomponents/p-d58a330d.entry.js +0 -1
  114. package/dist/webcomponents/p-f91c49a2.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { h, r as registerInstance, c as createEvent } from './index-CV0Pyo1O.js';
2
2
  import { i as Payout, C as ComponentErrorSeverity, e as ComponentErrorCodes } from './Plaid-BuKEVgbB.js';
3
- import { J as JustifiAnalytics } from './Analytics-4PEV3c9V.js';
4
- import { c as checkPkgVersion } from './check-pkg-version-BmgaID9z.js';
3
+ import { J as JustifiAnalytics } from './Analytics-qafLCOEU.js';
4
+ import { c as checkPkgVersion } from './check-pkg-version-BJtCbzf9.js';
5
5
  import { P as PayoutService } from './payout.service-BgFKxEoL.js';
6
6
  import './config-state-kKn89dp1.js';
7
7
  import './dinero-HXpYMWUU.js';
@@ -17,7 +17,7 @@ import { T as TableClickActions } from './event-types-CZfYo5-1.js';
17
17
  import { a as convertToLocal } from './utils-BTtxWI2r.js';
18
18
  import { a3 as tableHeadCell, a4 as getAlternateTableCellPart } from './parts-DnrawQn3.js';
19
19
  import { o as onQueryParamsChange, g as getRequestParams } from './payouts-list-params-state-CiGfmyWW.js';
20
- import './package-CXKOe1m5.js';
20
+ import './package-BCgsLInF.js';
21
21
  import './Api-DMd8hTI-.js';
22
22
  import './index-cDVGjRkU.js';
23
23
  import './badge-B6dp1XGV.js';
@@ -11,8 +11,8 @@ import { S as StyledHost } from './styled-host-D6byRazK.js';
11
11
  import './event-types-CZfYo5-1.js';
12
12
  import { P as PaymentService } from './payment.service-Ckbb7gXA.js';
13
13
  import { m as makeGetPaymentDetails } from './get-payment-details-DjBou5Fu.js';
14
- import { J as JustifiAnalytics } from './Analytics-4PEV3c9V.js';
15
- import { c as checkPkgVersion } from './check-pkg-version-BmgaID9z.js';
14
+ import { J as JustifiAnalytics } from './Analytics-qafLCOEU.js';
15
+ import { c as checkPkgVersion } from './check-pkg-version-BJtCbzf9.js';
16
16
  import { g as getErrorCode, a as getErrorMessage } from './utils-DcfpJGDZ.js';
17
17
  import { A as Api } from './Api-DMd8hTI-.js';
18
18
  import { S as Skeleton } from './skeleton-CXGFVqDf.js';
@@ -20,7 +20,7 @@ import './_commonjsHelpers-BFTU3MAI.js';
20
20
  import './dinero-HXpYMWUU.js';
21
21
  import './index-cDVGjRkU.js';
22
22
  import './parts-DnrawQn3.js';
23
- import './package-CXKOe1m5.js';
23
+ import './package-BCgsLInF.js';
24
24
 
25
25
  const amountValidation = (maxAmount) => {
26
26
  const max = +maxAmount;
@@ -5,8 +5,8 @@ import './Pagination-CLHwhyvu.js';
5
5
  import './Business-BcNb9bVO.js';
6
6
  import './Dispute-BH0Xfn-F.js';
7
7
  import { g as getErrorCode, a as getErrorMessage } from './utils-DcfpJGDZ.js';
8
- import { J as JustifiAnalytics } from './Analytics-4PEV3c9V.js';
9
- import { c as checkPkgVersion } from './check-pkg-version-BmgaID9z.js';
8
+ import { J as JustifiAnalytics } from './Analytics-qafLCOEU.js';
9
+ import { c as checkPkgVersion } from './check-pkg-version-BJtCbzf9.js';
10
10
  import { c as checkoutStore } from './checkout.store-DFnkcDZ8.js';
11
11
  import { p as processHTML, f as formatCurrency, r as removeAttribute, j as addAttribute } from './utils-BTtxWI2r.js';
12
12
  import { v as validateInsuranceValues, i as insuranceValues, a as insuranceErrors, H as Header2 } from './insurance-state-qTdpe84i.js';
@@ -16,7 +16,7 @@ import './event-types-CZfYo5-1.js';
16
16
  import { S as Skeleton } from './skeleton-CXGFVqDf.js';
17
17
  import './config-state-kKn89dp1.js';
18
18
  import './index-cDVGjRkU.js';
19
- import './package-CXKOe1m5.js';
19
+ import './package-BCgsLInF.js';
20
20
  import './index-DkoufM1t.js';
21
21
  import './dinero-HXpYMWUU.js';
22
22
 
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-CV0Pyo1O.js';
2
2
  import { S as StyledHost } from './styled-host-D6byRazK.js';
3
3
  import './event-types-CZfYo5-1.js';
4
- import { c as checkPkgVersion } from './check-pkg-version-BmgaID9z.js';
4
+ import { c as checkPkgVersion } from './check-pkg-version-BJtCbzf9.js';
5
5
  import { d as defaultColumnsKeys } from './terminal-orders-table-C7KOcRpq.js';
6
6
  import './config-state-kKn89dp1.js';
7
7
  import './dinero-HXpYMWUU.js';
@@ -11,8 +11,8 @@ import './Business-BcNb9bVO.js';
11
11
  import './Dispute-BH0Xfn-F.js';
12
12
  import { g as getErrorCode, a as getErrorMessage } from './utils-DcfpJGDZ.js';
13
13
  import { A as Api } from './Api-DMd8hTI-.js';
14
- import { J as JustifiAnalytics } from './Analytics-4PEV3c9V.js';
15
- import './package-CXKOe1m5.js';
14
+ import { J as JustifiAnalytics } from './Analytics-qafLCOEU.js';
15
+ import './package-BCgsLInF.js';
16
16
  import './parts-DnrawQn3.js';
17
17
  import './utils-BTtxWI2r.js';
18
18
  import './badge-B6dp1XGV.js';
@@ -1,7 +1,7 @@
1
1
  import { h, r as registerInstance, c as createEvent } from './index-CV0Pyo1O.js';
2
2
  import { l as Terminal, C as ComponentErrorSeverity, e as ComponentErrorCodes } from './Plaid-BuKEVgbB.js';
3
- import { J as JustifiAnalytics } from './Analytics-4PEV3c9V.js';
4
- import { c as checkPkgVersion } from './check-pkg-version-BmgaID9z.js';
3
+ import { J as JustifiAnalytics } from './Analytics-qafLCOEU.js';
4
+ import { c as checkPkgVersion } from './check-pkg-version-BJtCbzf9.js';
5
5
  import { T as TerminalService } from './terminal.service-0oISl5j-.js';
6
6
  import './config-state-kKn89dp1.js';
7
7
  import './dinero-HXpYMWUU.js';
@@ -17,7 +17,7 @@ import { B as BadgeVariant, a as Badge } from './badge-B6dp1XGV.js';
17
17
  import { a3 as tableHeadCell, a4 as getAlternateTableCellPart } from './parts-DnrawQn3.js';
18
18
  import { k as capitalFirstLetter } from './utils-BTtxWI2r.js';
19
19
  import { o as onQueryParamsChange, g as getRequestParams } from './terminals-list-params-state-CiGfmyWW.js';
20
- import './package-CXKOe1m5.js';
20
+ import './package-BCgsLInF.js';
21
21
  import './Api-DMd8hTI-.js';
22
22
  import './index-cDVGjRkU.js';
23
23
  import './spinner-kSw6PcwU.js';
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "6.12.1";
2
+ const version = "6.12.2";
3
3
  var packageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -63,7 +63,7 @@ class JustifiAnalytics {
63
63
  if (typeof this.componentInstance.addEventListener === 'function') {
64
64
  const boundHandler = (event) => this.handleCustomEvent({
65
65
  event_type: eventName,
66
- data: Object.assign(Object.assign({}, this.basicData), { error: event.detail }),
66
+ data: Object.assign(Object.assign({}, this.basicData), (eventName === 'error-event' && { error: event.detail })),
67
67
  });
68
68
  this.eventListeners.set(eventName, boundHandler);
69
69
  this.componentInstance.addEventListener(eventName, boundHandler);
@@ -6,7 +6,7 @@ import './justifi-details2.js';
6
6
  import './event-types.js';
7
7
  import './justifi-radio-list-item2.js';
8
8
  import { S as Skeleton } from './skeleton.js';
9
- import { c as checkoutStore } from './checkout.store.js';
9
+ import { c as checkoutStore, o as onChange } from './checkout.store.js';
10
10
 
11
11
  // Centralized error codes for Apple Pay service
12
12
  var ApplePayServiceErrorCode;
@@ -512,6 +512,7 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
512
512
  this.applePayCompleted = createEvent(this, "applePayCompleted", 7);
513
513
  this.applePayCancelled = createEvent(this, "applePayCancelled", 7);
514
514
  this.applePayError = createEvent(this, "applePayError", 7);
515
+ this.sdkLoaded = false;
515
516
  this.countryCode = "US";
516
517
  this.merchantIdentifier = "merchant.com.staging-justifi.checkout-dev";
517
518
  this.merchantDisplayName = "JustiFi Checkout";
@@ -586,6 +587,32 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
586
587
  }
587
588
  };
588
589
  }
590
+ componentWillLoad() {
591
+ this.isAvailable = ApplePayHelpers.isApplePaySupported();
592
+ if (!this.isAvailable) {
593
+ this.isLoading = false;
594
+ return;
595
+ }
596
+ if (checkoutStore.checkoutLoaded) {
597
+ this.loadApplePaySDK();
598
+ }
599
+ else {
600
+ onChange('checkoutLoaded', (loaded) => {
601
+ if (loaded)
602
+ this.loadApplePaySDK();
603
+ });
604
+ }
605
+ }
606
+ loadApplePaySDK() {
607
+ if (this.sdkLoaded)
608
+ return;
609
+ this.sdkLoaded = true;
610
+ const script = document.createElement('script');
611
+ script.src = 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js';
612
+ script.async = true;
613
+ script.onload = () => this.initializeApplePay();
614
+ document.head.appendChild(script);
615
+ }
589
616
  async initializeApplePay() {
590
617
  try {
591
618
  this.isLoading = true;
@@ -597,12 +624,6 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
597
624
  if (!hasRequiredConfig) {
598
625
  this.error = "Missing required Apple Pay configuration";
599
626
  this.isConfigValid = false;
600
- console.error("Apple Pay config error: missing required values", {
601
- paymentAmount: checkoutStore.paymentAmount,
602
- paymentCurrency: checkoutStore.paymentCurrency,
603
- hasAuthToken: Boolean(checkoutStore.authToken),
604
- accountId: checkoutStore.accountId,
605
- });
606
627
  this.applePayError.emit({ error: this.error, code: JustifiApplePay.ErrorCode.CONFIG_ERROR });
607
628
  this.isLoading = false;
608
629
  return;
@@ -611,14 +632,12 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
611
632
  this.canMakePayments = ApplePayHelpers.canMakePayments();
612
633
  if (!this.isAvailable) {
613
634
  this.error = "Apple Pay is not supported on this device";
614
- console.error(this.error);
615
635
  this.applePayError.emit({ error: this.error, code: JustifiApplePay.ErrorCode.NOT_SUPPORTED });
616
636
  this.isLoading = false;
617
637
  return;
618
638
  }
619
639
  if (!this.canMakePayments) {
620
640
  this.error = "Apple Pay is not available";
621
- console.error(this.error);
622
641
  this.applePayError.emit({ error: this.error, code: JustifiApplePay.ErrorCode.NOT_AVAILABLE });
623
642
  this.isLoading = false;
624
643
  return;
@@ -639,7 +658,6 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
639
658
  }
640
659
  }
641
660
  catch (error) {
642
- console.error("Apple Pay initialization error:", error);
643
661
  this.error =
644
662
  error instanceof Error
645
663
  ? error.message
@@ -660,7 +678,8 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
660
678
  return ApplePayHelpers.getDefaultSupportedNetworks();
661
679
  }
662
680
  async abort() {
663
- this.applePayService.abortPaymentSession();
681
+ var _a;
682
+ (_a = this.applePayService) === null || _a === void 0 ? void 0 : _a.abortPaymentSession();
664
683
  this.isProcessing = false;
665
684
  this.applePayCancelled.emit();
666
685
  }
@@ -669,13 +688,14 @@ const JustifiApplePay = /*@__PURE__*/ proxyCustomElement(class JustifiApplePay e
669
688
  // Render nothing when Apple Pay is disabled at the checkout settings level
670
689
  return null;
671
690
  }
691
+ if (!this.isAvailable) {
692
+ return null;
693
+ }
672
694
  const isReady = !this.isLoading &&
673
695
  this.isAvailable &&
674
696
  this.canMakePayments &&
675
697
  this.isConfigValid;
676
- return (h(StyledHost, null, checkoutStore.checkoutLoaded && (h("script", { async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
677
- this.initializeApplePay();
678
- } })), h("div", { class: 'apple-pay-container' }, h(ApplePaySkeleton, { isLoading: this.isLoading }), isReady && (h(ApplePayButton, { buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick, width: this.width, height: this.height }))), h("style", null, `
698
+ return (h(StyledHost, null, h("div", { class: 'apple-pay-container' }, h(ApplePaySkeleton, { isLoading: this.isLoading }), isReady && (h(ApplePayButton, { buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick, width: this.width, height: this.height }))), h("style", null, `
679
699
  .apple-pay-container {
680
700
  width: 100%;
681
701
  }
@@ -76,7 +76,6 @@ const JustifiCheckout$1 = /*@__PURE__*/ proxyCustomElement(class JustifiCheckout
76
76
  checkoutStore.isSubmitting = false;
77
77
  }
78
78
  checkoutError(_event) {
79
- console.error('[justifi-checkout] error-event received', _event === null || _event === void 0 ? void 0 : _event.detail);
80
79
  checkoutStore.isSubmitting = false;
81
80
  }
82
81
  checkoutChanged(event) {
@@ -111,9 +110,9 @@ const JustifiCheckout$1 = /*@__PURE__*/ proxyCustomElement(class JustifiCheckout
111
110
  }
112
111
  render() {
113
112
  var _a, _b;
114
- return (h(StyledHost, { key: '3d9d149e2fe85c02aae2ca21a1dc655eda9e4af8' }, h("justifi-modular-checkout", { key: 'f1af5a7f23e895338500cb81e0f618b1bc911a84', ref: (el) => {
113
+ return (h(StyledHost, { key: 'ffd2abaacc7edae588a9abe3a4ff96807b34fcff' }, h("justifi-modular-checkout", { key: '9196c278e24353aeb1ac02c85253d629f683522b', ref: (el) => {
115
114
  this.modularCheckoutRef = el;
116
- }, authToken: this.authToken, checkoutId: this.checkoutId, preCompleteHook: this.preCompleteHook }, h("div", { key: '9ccf111654a251e0836c75ec9c696459dc20173f', class: "row gy-3 jfi-checkout-core" }, h("div", { key: 'b89f34eb2441b4ccf1b62de860440aef1aaa29e0', class: "col-12", part: checkoutSummary }, h("justifi-header", { key: '04cb13fa1980b6b762ab920b1200173f004d84e2', text: "Summary", level: "h2", class: "fs-5 fw-bold pb-3" }), h("section", { key: '15e13cb04cd7d402ff06a252dcee9e57ad33aa54' }, h("justifi-checkout-summary", { key: 'dd03dfa689be11328f2a9a955582bb144f765649' }))), h("div", { key: '2cbf3b6cd39027a5af4338e8dddf96d82b06e317', class: "col-12 mt-4" }, h("slot", { key: 'cc22673d5d7a6abed5dec41fb426b411bcb40bd9', name: "insurance" })), h("div", { key: '36793dae298583ecf989dcd0d875ca256899026f', class: "col-12 mt-4" }, h("justifi-header", { key: 'd343214c1b13f18d8c12a2734df74392b4eeeda6', text: "Payment", level: "h2", class: "fs-5 fw-bold pb-3" }), this.showPaymentTypeHeader && (h("justifi-header", { key: '4c301118984abf62e283244270d283211052ea35', text: "Select payment type", level: "h3", class: "fs-6 fw-bold lh-lg" })), h("div", { key: 'd94d75d2c4966aa3a5b1971c278d549cab084373', class: "d-flex flex-column" }, h("section", { key: '034d710eeb6a034e2e5ab4a9f035097ca090d95f' }, h("div", { key: '085a5cf1f48dda17aecb94cd3571c209b26cada9' }, this.availablePaymentMethods.includes(PAYMENT_METHODS.APPLE_PAY) && (h("div", { key: '866d933df84c42a656a25c4efb8e8248a66c83fa', class: "mb-3" }, h("justifi-apple-pay", { key: 'b1779224cb632c0be71f1656f0741240393c9305' }))), this.availablePaymentMethods.includes(PAYMENT_METHODS.GOOGLE_PAY) && (h("div", { key: '6d0ccb9db6ae00463c619306d288234da77522bd', class: "mb-3" }, h("justifi-google-pay", { key: '10b8ef6bf5e8113be078e481ba966d554c4cb8de', ref: (el) => (this.googlePayRef = el) }))), h("justifi-saved-payment-methods", { key: '3018b688d7f59501d444c0129e492e6b04c656f8' }), this.availablePaymentMethods.includes(PAYMENT_METHODS.SEZZLE) && (h("justifi-radio-list-item", { key: 'a61ee95ee25e5ec034c7cc4f4ab0f2f081acf6f6', name: "paymentMethodType", value: PAYMENT_METHODS.SEZZLE, checked: ((_a = checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === PAYMENT_METHODS.SEZZLE, label: h("justifi-sezzle-payment-method", { ref: (el) => (this.sezzlePaymentMethodRef = el) }), "onRadio-click": () => { var _a; (_a = this.sezzlePaymentMethodRef) === null || _a === void 0 ? void 0 : _a.handleSelectionClick(); } })), this.availablePaymentMethods.includes(PAYMENT_METHODS.PLAID) && !this.disableBnpl && (h("justifi-radio-list-item", { key: '99236535da0076054f9314ae188c7262651874cd', name: "paymentMethodType", value: PAYMENT_METHODS.PLAID, checked: ((_b = checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.selectedPaymentMethod) === null || _b === void 0 ? void 0 : _b.type) === PAYMENT_METHODS.PLAID, label: h("justifi-plaid-payment-method", { ref: (el) => (this.plaidPaymentMethodRef = el) }), "onRadio-click": () => { var _a; (_a = this.plaidPaymentMethodRef) === null || _a === void 0 ? void 0 : _a.handleSelectionClick(); } })), h("justifi-tokenize-payment-method", { key: 'd72193f53af86d07313e68fcffab022749c708ee', ref: (el) => (this.tokenizePaymentMethodRef = el), authToken: this.authToken, accountId: checkoutStore.accountId, disableCreditCard: this.disableCreditCard, disableBankAccount: this.disableBankAccount, hideCardBillingForm: this.hideCardBillingForm, hideBankAccountBillingForm: this.hideBankAccountBillingForm, hideSubmitButton: true, paymentMethodGroupId: checkoutStore.paymentMethodGroupId }))))), h("div", { key: '2cbfec00fbd62b19aae94f8cb4d9a29dd9c3ac70', class: "mt-4" }, h("justifi-button", { key: '92120dc18d5244fe867e03e03cebe110681a1975', text: "Pay", type: "submit", variant: "primary", clickHandler: (e) => this.submit(e), disabled: checkoutStore.isSubmitting || checkoutStore.isWalletProcessing, isLoading: checkoutStore.isSubmitting || checkoutStore.isWalletProcessing, customStyle: { width: '100%', textAlign: "center" } }))))));
115
+ }, authToken: this.authToken, checkoutId: this.checkoutId, preCompleteHook: this.preCompleteHook }, h("div", { key: '895298286bc0aa6acbda896a4f148dd4f8d7e7d2', class: "row gy-3 jfi-checkout-core" }, h("div", { key: 'dd186ed2f0fd479cd60024423b6d55625b962e55', class: "col-12", part: checkoutSummary }, h("justifi-header", { key: '920d4eca26846aa1cbc16693fa45a9d8054d95a7', text: "Summary", level: "h2", class: "fs-5 fw-bold pb-3" }), h("section", { key: '560f8c3757a7cf53fd0aa898fd243b16a2f8e8d5' }, h("justifi-checkout-summary", { key: '31faa6ca984aa22985927a1f80273c86a67c7025' }))), h("div", { key: '3128ae40a739573da32598213a289d8751503fb0', class: "col-12 mt-4" }, h("slot", { key: '4a310881bbc4017734082d5c4f6b41d3d5f2a424', name: "insurance" })), h("div", { key: '8047c4da62e2fd67bd0b3f8654c6a19c0cacc255', class: "col-12 mt-4" }, h("justifi-header", { key: '631ff14201f6246906e3e1572515de21a7977773', text: "Payment", level: "h2", class: "fs-5 fw-bold pb-3" }), this.showPaymentTypeHeader && (h("justifi-header", { key: '7fdc560ef42a5c2e8571f332e3c4ce8ff460d235', text: "Select payment type", level: "h3", class: "fs-6 fw-bold lh-lg" })), h("div", { key: '81dcb52c051044adb4dbd92ac73ee3096edc592b', class: "d-flex flex-column" }, h("section", { key: '4359903b195009a2e8fb997a1f77880cba40dea4' }, h("div", { key: '21728867e6288c3fb7d5e5a6ee3d15974568b866' }, this.availablePaymentMethods.includes(PAYMENT_METHODS.APPLE_PAY) && (h("div", { key: 'bdaa6b6c6d09cba294b2e46b85270241c86d2251', class: "mb-3" }, h("justifi-apple-pay", { key: '150d707bff7b79a1d19141f21a9c47e00e54418a' }))), this.availablePaymentMethods.includes(PAYMENT_METHODS.GOOGLE_PAY) && (h("div", { key: 'ce2be06b20a1e7d0159fde68a1c5c349c2d11998', class: "mb-3" }, h("justifi-google-pay", { key: '0fc867ce77467eb1f1fd198a62e88bd2795f4914', ref: (el) => (this.googlePayRef = el) }))), h("justifi-saved-payment-methods", { key: '0bb1999c093b3837bfdb879134dc54f66c90e164' }), this.availablePaymentMethods.includes(PAYMENT_METHODS.SEZZLE) && (h("justifi-radio-list-item", { key: '1599be9bcea7569d822a204c805f08f18a4e00a4', name: "paymentMethodType", value: PAYMENT_METHODS.SEZZLE, checked: ((_a = checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === PAYMENT_METHODS.SEZZLE, label: h("justifi-sezzle-payment-method", { ref: (el) => (this.sezzlePaymentMethodRef = el) }), "onRadio-click": () => { var _a; (_a = this.sezzlePaymentMethodRef) === null || _a === void 0 ? void 0 : _a.handleSelectionClick(); } })), this.availablePaymentMethods.includes(PAYMENT_METHODS.PLAID) && !this.disableBnpl && (h("justifi-radio-list-item", { key: 'c1de230257d290efa05f7a7166c2f069451c71a3', name: "paymentMethodType", value: PAYMENT_METHODS.PLAID, checked: ((_b = checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.selectedPaymentMethod) === null || _b === void 0 ? void 0 : _b.type) === PAYMENT_METHODS.PLAID, label: h("justifi-plaid-payment-method", { ref: (el) => (this.plaidPaymentMethodRef = el) }), "onRadio-click": () => { var _a; (_a = this.plaidPaymentMethodRef) === null || _a === void 0 ? void 0 : _a.handleSelectionClick(); } })), h("justifi-tokenize-payment-method", { key: '44bca4ee57857afd4eee213cef98db2d4bd42490', ref: (el) => (this.tokenizePaymentMethodRef = el), authToken: this.authToken, accountId: checkoutStore.accountId, disableCreditCard: this.disableCreditCard, disableBankAccount: this.disableBankAccount, hideCardBillingForm: this.hideCardBillingForm, hideBankAccountBillingForm: this.hideBankAccountBillingForm, hideSubmitButton: true, paymentMethodGroupId: checkoutStore.paymentMethodGroupId }))))), h("div", { key: 'e5b6b4ac6b0fcec20380082f1b4cc5ba73bb88aa', class: "mt-4" }, h("justifi-button", { key: '188a8f46fd37b5f4f2d9b3ba7ff179d44d4a6656', text: "Pay", type: "submit", variant: "primary", clickHandler: (e) => this.submit(e), disabled: checkoutStore.isSubmitting || checkoutStore.isWalletProcessing, isLoading: checkoutStore.isSubmitting || checkoutStore.isWalletProcessing, customStyle: { width: '100%', textAlign: "center" } }))))));
117
116
  }
118
117
  static get watchers() { return {
119
118
  "authToken": ["propChanged"],
@@ -126,11 +126,14 @@ const JustifiGooglePay = /*@__PURE__*/ proxyCustomElement(class JustifiGooglePay
126
126
  }, this.iframeOrigin);
127
127
  }
128
128
  render() {
129
+ if (!checkoutStore.checkoutLoaded) {
130
+ return null;
131
+ }
129
132
  if (!checkoutStore.googlePayEnabled) {
130
133
  console.warn("Google Pay is not enabled for this checkout");
131
134
  return null;
132
135
  }
133
- return (h(Host, null, h(GooglePaySkeleton, { isLoading: !this.isReadyToPay }), h("iframe", { ref: (el) => (this.iframeElement = el), src: `${this.iframeOrigin}/v2/googlePay`, style: {
136
+ return (h(Host, null, h(GooglePaySkeleton, { isLoading: !this.isReadyToPay }), h("iframe", { ref: (el) => (this.iframeElement = el), src: `${this.iframeOrigin}/v2/googlePay`, allow: "payment", style: {
134
137
  border: "none",
135
138
  width: "100%",
136
139
  height: "48px",
@@ -139,7 +139,9 @@ const JustifiPaymentProvisioning$1 = /*@__PURE__*/ proxyCustomElement(class Just
139
139
  }
140
140
  };
141
141
  this.decrementSteps = () => {
142
- return this.currentStep--;
142
+ if (this.currentStep > 0) {
143
+ this.currentStep -= 1;
144
+ }
143
145
  };
144
146
  this.previousStepButtonOnClick = () => {
145
147
  this.clickEvent.emit({ name: BusinessFormClickActions.previousStep });
@@ -29,6 +29,7 @@ const JustifiPlaidPaymentMethod = /*@__PURE__*/ proxyCustomElement(class Justifi
29
29
  this.isSelected = false;
30
30
  this.retryCount = 0;
31
31
  this.isRetrying = false;
32
+ this.sdkLoaded = false;
32
33
  this.plaidService = new PlaidService();
33
34
  this.maxRetries = 3;
34
35
  this.retryDelay = 2000; // 2 seconds
@@ -375,15 +376,31 @@ const JustifiPlaidPaymentMethod = /*@__PURE__*/ proxyCustomElement(class Justifi
375
376
  this.openPlaidLink();
376
377
  }
377
378
  }
378
- componentDidRender() {
379
- if (!this.scriptRef)
379
+ componentWillLoad() {
380
+ var _a;
381
+ this.isSelected = ((_a = checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === PAYMENT_METHODS.PLAID;
382
+ if (checkoutStore.bankAccountVerification !== true)
380
383
  return;
381
- this.scriptRef.onload = () => {
382
- // Wait for store to be populated before initializing
383
- this.waitForStoreAndInitialize();
384
- };
385
- // Add error handler for script loading failures
386
- this.scriptRef.onerror = () => {
384
+ if (checkoutStore.checkoutLoaded) {
385
+ this.loadPlaidSDK();
386
+ }
387
+ else {
388
+ onChange('checkoutLoaded', (loaded) => {
389
+ if (loaded && checkoutStore.bankAccountVerification === true) {
390
+ this.loadPlaidSDK();
391
+ }
392
+ });
393
+ }
394
+ }
395
+ loadPlaidSDK() {
396
+ if (this.sdkLoaded)
397
+ return;
398
+ this.sdkLoaded = true;
399
+ const script = document.createElement('script');
400
+ script.src = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';
401
+ script.async = true;
402
+ script.onload = () => this.initializePlaidLink();
403
+ script.onerror = () => {
387
404
  this.handleError({
388
405
  code: PlaidErrorCodes.PLAID_SDK_LOAD_FAILED,
389
406
  message: PLAID_ERROR_MESSAGES[PlaidErrorCodes.PLAID_SDK_LOAD_FAILED],
@@ -392,11 +409,7 @@ const JustifiPlaidPaymentMethod = /*@__PURE__*/ proxyCustomElement(class Justifi
392
409
  userAction: 'Refresh the page and try again'
393
410
  });
394
411
  };
395
- }
396
- componentWillLoad() {
397
- var _a;
398
- // Initialize selection state based on store
399
- this.isSelected = ((_a = checkoutStore.selectedPaymentMethod) === null || _a === void 0 ? void 0 : _a.type) === PAYMENT_METHODS.PLAID;
412
+ document.head.appendChild(script);
400
413
  }
401
414
  async resolvePaymentMethod() {
402
415
  if (!this.publicToken) {
@@ -542,7 +555,7 @@ const JustifiPlaidPaymentMethod = /*@__PURE__*/ proxyCustomElement(class Justifi
542
555
  }
543
556
  return null;
544
557
  };
545
- return (h(StyledHost, { class: "payment-method" }, h("script", { src: "https://cdn.plaid.com/link/v2/stable/link-initialize.js", async: true, ref: (el) => (this.scriptRef = el) }), h("div", { title: "Pay with Plaid" }, h("div", { onClick: (event) => { event.preventDefault(); this.handleSelectionClick(); } }, "Pay with Bank Account ", plaidLogo, " "), renderErrorState(), renderStatusState())));
558
+ return (h(StyledHost, { class: "payment-method" }, h("div", { title: "Pay with Plaid" }, h("div", { onClick: (event) => { event.preventDefault(); this.handleSelectionClick(); } }, "Pay with Bank Account ", plaidLogo, " "), renderErrorState(), renderStatusState())));
546
559
  }
547
560
  static get watchers() { return {
548
561
  "isSelected": ["onSelectionChange"]
@@ -35,11 +35,13 @@ const JustifiSavedPaymentMethods = /*@__PURE__*/ proxyCustomElement(class Justif
35
35
  };
36
36
  }
37
37
  componentWillLoad() {
38
- if (!checkoutStore.paymentMethods.length) {
39
- console.warn('No saved payment methods available.');
40
- }
41
- if (checkoutStore.disablePaymentMethodGroup) {
42
- console.warn('Payment method group is disabled.');
38
+ if (checkoutStore.checkoutLoaded) {
39
+ if (!checkoutStore.paymentMethods.length) {
40
+ console.warn('No saved payment methods available.');
41
+ }
42
+ if (checkoutStore.disablePaymentMethodGroup) {
43
+ console.warn('Payment method group is disabled.');
44
+ }
43
45
  }
44
46
  }
45
47
  render() {
@@ -1,5 +1,5 @@
1
1
  const name = "@justifi/webcomponents";
2
- const version = "6.12.1";
2
+ const version = "6.12.2";
3
3
  var webcomponentsPackageJson = {
4
4
  name: name,
5
5
  version: version};
@@ -33,7 +33,7 @@ export declare class JustifiPaymentProvisioning {
33
33
  get totalSteps(): number;
34
34
  get stepCounter(): string;
35
35
  incrementSteps: () => number;
36
- decrementSteps: () => number;
36
+ decrementSteps: () => void;
37
37
  previousStepButtonOnClick: () => void;
38
38
  nextStepButtonOnClick: (e: any, clickEventName: any) => void;
39
39
  render(): any;
@@ -2,6 +2,7 @@ import { EventEmitter } from "../../../stencil-public-runtime";
2
2
  import { ApplePayButtonType, ApplePayButtonStyle, IApplePayToken } from "../../../api/ApplePay";
3
3
  export declare class JustifiApplePay {
4
4
  private applePayService;
5
+ private sdkLoaded;
5
6
  countryCode: string;
6
7
  merchantIdentifier: string;
7
8
  merchantDisplayName: string;
@@ -37,6 +38,8 @@ export declare class JustifiApplePay {
37
38
  readonly INITIALIZATION_ERROR: "INITIALIZATION_ERROR";
38
39
  readonly PAYMENT_FAILED: "PAYMENT_FAILED";
39
40
  };
41
+ componentWillLoad(): void;
42
+ private loadApplePaySDK;
40
43
  private initializeApplePay;
41
44
  private handleApplePayClick;
42
45
  isSupported(): Promise<boolean>;
@@ -11,7 +11,7 @@ export declare class JustifiPlaidPaymentMethod {
11
11
  isSelected: boolean;
12
12
  retryCount: number;
13
13
  isRetrying: boolean;
14
- private scriptRef;
14
+ private sdkLoaded;
15
15
  private plaidService;
16
16
  private unsubscribeFromStore;
17
17
  private maxRetries;
@@ -23,8 +23,8 @@ export declare class JustifiPlaidPaymentMethod {
23
23
  plaidError: EventEmitter;
24
24
  plaidErrorRecovered: EventEmitter;
25
25
  onSelectionChange(newValue: boolean): void;
26
- componentDidRender(): void;
27
26
  componentWillLoad(): void;
27
+ private loadPlaidSDK;
28
28
  waitForStoreAndInitialize: () => void;
29
29
  resolvePaymentMethod(): Promise<PaymentMethodPayload>;
30
30
  getPaymentToken(): Promise<string | undefined>;
@@ -1 +1 @@
1
- import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{l as s,C as a,e as r}from"./p-CUI41_5y.js";import{J as n}from"./p-cXPhRFs-.js";import{c as o}from"./p-GP5gWjhc.js";import{T as c}from"./p--e0ff06z.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as d,a as p}from"./p-B5vVjDc_.js";import{m,S as l}from"./p-qcQTYcr3.js";import{S as u}from"./p-BqNNwq6C.js";import{T as f,l as b,a as v,b as g,c as j,d as k,e as y,f as _,g as w,h as T,i as C,j as S,k as D}from"./p-bn_huKYG.js";import{T as O}from"./p-CZfYo5-1.js";import{B as P,a as I}from"./p-pL4dNfsl.js";import{a3 as A,a4 as B}from"./p-DnrawQn3.js";import{k as N}from"./p-BRnBHsdq.js";import{o as x,g as E}from"./p-Dw63wyhO.js";import"./p-CXKOe1m5.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";import"./p-CDf5H0TB.js";const G={nickname:()=>t("th",{part:A,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:A,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:A,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:A,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:A,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:A,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:A,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:A,scope:"col",title:"The current status of each terminal"},"Status")},q={nickname:(e,i)=>t("td",{part:B(i)},e.nickname),model_name:(e,i)=>t("td",{part:B(i)},e.model_name),id:(e,i)=>t("td",{part:B(i)},e.id),provider:(e,i)=>t("td",{part:B(i)},N(e.provider)),provider_serial_number:(e,i)=>t("td",{part:B(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:B(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:B(i)},e.sub_account_name),status:(e,i)=>t("td",{part:B(i)},t(I,Object.assign({},{connected:{variant:P.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:P.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:P.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:P.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:P.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},H=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:O.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:O.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:O.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,G,q),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),x("set",(()=>{this.pagingParams={}})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=E();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(u,{key:"3429d0dc6534dda4e9dc6417924040a53fd5a032"},t(b,{key:"00c6172e8bb77ed0824381785b17fdd556c942a1"},t(v,{key:"d0119d84743bb06d1e0562eee3124197d46f3b13"},t(g,{key:"9721788579474c7db31587f57ff1aa4159cae7c3"},t(j,{key:"e689b5546ad32ad75bcbedb0cf184b4a6adf1bf3"},this.terminalsTable.columnData.map((t=>t)))),t(k,{key:"220a3f509f17333888640b0034da30d9375c4100"},t(y,{key:"d444e883ddd69ef5b05754476e6ea66c598a2c5f",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(_,{key:"a6ee22d5138114688ff2c8525e8b5ce8fb00a853",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(w,{key:"e151dba5915e622eb7a63ce7912fabe6924df7dd",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(T,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(C,{key:"91c0903d8c81817f82e7a8864a4188fac602af87"},t(S,{key:"322abe78babc127fccb9309c14c91b30a5d86700"},t(D,{key:"e9843c61dd4eb031f514ff35f3354998dfaec59e",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"d6b0bdaa7459afb8cd164c540843e7a4d8376f53",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{H as justifi_terminals_list}
1
+ import{h as t,r as e,c as i}from"./p-CV0Pyo1O.js";import{l as s,C as a,e as r}from"./p-CUI41_5y.js";import{J as n}from"./p-BnaR7f2G.js";import{c as o}from"./p-BJ7GFTiW.js";import{T as c}from"./p--e0ff06z.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{p as h}from"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as d,a as p}from"./p-B5vVjDc_.js";import{m,S as l}from"./p-qcQTYcr3.js";import{S as u}from"./p-BqNNwq6C.js";import{T as f,l as b,a as v,b as g,c as k,d as y,e as j,f as T,g as _,h as w,i as C,j as S,k as D}from"./p-bn_huKYG.js";import{T as O}from"./p-CZfYo5-1.js";import{B as I,a as P}from"./p-pL4dNfsl.js";import{a3 as B,a4 as A}from"./p-DnrawQn3.js";import{k as N}from"./p-BRnBHsdq.js";import{o as x,g as G}from"./p-Dw63wyhO.js";import"./p-BCgsLInF.js";import"./p-CYQvLgSs.js";import"./p-D8GTwl9v.js";import"./p-CDf5H0TB.js";const E={nickname:()=>t("th",{part:B,scope:"col",title:"The nickname associated with the terminal"},"Nickname"),model_name:()=>t("th",{part:B,scope:"col",title:"The model name of the terminal"},"Model Name"),id:()=>t("th",{part:B,scope:"col",title:"The ID of the terminal"},"ID"),provider:()=>t("th",{part:B,scope:"col",title:"The provider of the terminal"},"Provider"),provider_serial_number:()=>t("th",{part:B,scope:"col",title:"The serial number of the terminal"},"Serial Number"),device_id:()=>t("th",{part:B,scope:"col",title:"The device/provider ID of the terminal"},"Device ID"),sub_account_name:()=>t("th",{part:B,scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>t("th",{part:B,scope:"col",title:"The current status of each terminal"},"Status")},L={nickname:(e,i)=>t("td",{part:A(i)},e.nickname),model_name:(e,i)=>t("td",{part:A(i)},e.model_name),id:(e,i)=>t("td",{part:A(i)},e.id),provider:(e,i)=>t("td",{part:A(i)},N(e.provider)),provider_serial_number:(e,i)=>t("td",{part:A(i)},e.provider_serial_number),device_id:(e,i)=>t("td",{part:A(i)},e.provider_id),sub_account_name:(e,i)=>t("td",{part:A(i)},e.sub_account_name),status:(e,i)=>t("td",{part:A(i)},t(P,Object.assign({},{connected:{variant:I.SUCCESS,title:"This terminal is connected",text:"Connected"},disconnected:{variant:I.DANGER,title:"This terminal is disconnected",text:"Disconnected"},unknown:{variant:I.SECONDARY,title:"The status of this terminal is unknown",text:"Unknown"},pending_configuration:{variant:I.WARNING,title:"This terminal is pending configuration",text:"Pending configuration"},archived:{variant:I.SECONDARY,title:"This terminal is archived",text:"Archived"}}[e.status])))},q=class{constructor(t){e(this,t),this.clickEvent=i(this,"click-event",7),this.errorEvent=i(this,"error-event",7),this.terminals=[],this.subAccounts=[],this.loading=!0,this.paging=h,this.pagingParams={},this.columns="nickname,provider_serial_number,status",this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:O.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:O.next})},this.rowClickHandler=t=>{const e=t.target.closest("tr").dataset.rowEntityId;if(!e)return;const i=this.terminals.find((t=>t.id===e));this.clickEvent.emit({name:O.row,data:i})}}componentWillLoad(){o(),this.analytics=new n(this),this.terminalsTable=new f(this.terminals,this.columns,E,L),this.initializeGetData(),this.getTerminals&&this.getSubAccounts&&this.fetchData(),x("set",(()=>{this.pagingParams={}})),x("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}updateOnPropChange(){this.fetchData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:e,service:i})=>async({params:r,onSuccess:n,onError:o})=>{var c,h;try{const m=await i.fetchTerminals(t,e,r);if(m.error)return o({error:p(m.error),code:d(null===(h=m.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const t=Object.assign({},m.page_info);n({terminals:(null===(c=m.data)||void 0===c?void 0:c.map((t=>new s(t))))||[],pagingInfo:t})}}catch(t){const e=d(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:a.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new c}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({primaryAccountId:this.accountId,authToken:this.authToken,service:new l}))}fetchData(){this.loading=!0,this.getTerminals({params:this.terminalParams,onSuccess:async({terminals:t,pagingInfo:e})=>{this.terminals=t,this.paging=e,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var e;return t.sub_account_name=null===(e=this.subAccounts.find((e=>e.id===t.account_id)))||void 0===e?void 0:e.name,t})),this.loading=!1},onError:({error:t,code:e,severity:i})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:e,message:t,severity:i}),this.loading=!1}})}get terminalParams(){const t=G();return Object.assign(Object.assign({},t),this.pagingParams)}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return t(u,{key:"3429d0dc6534dda4e9dc6417924040a53fd5a032"},t(b,{key:"00c6172e8bb77ed0824381785b17fdd556c942a1"},t(v,{key:"d0119d84743bb06d1e0562eee3124197d46f3b13"},t(g,{key:"9721788579474c7db31587f57ff1aa4159cae7c3"},t(k,{key:"e689b5546ad32ad75bcbedb0cf184b4a6adf1bf3"},this.terminalsTable.columnData.map((t=>t)))),t(y,{key:"220a3f509f17333888640b0034da30d9375c4100"},t(j,{key:"d444e883ddd69ef5b05754476e6ea66c598a2c5f",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),t(T,{key:"a6ee22d5138114688ff2c8525e8b5ce8fb00a853",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),t(_,{key:"e151dba5915e622eb7a63ce7912fabe6924df7dd",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((e,i)=>t(w,{"data-test-id":"table-row","data-row-entity-id":this.entityId[i],onClick:this.rowClickHandler},e)))),this.paging&&t(C,{key:"91c0903d8c81817f82e7a8864a4188fac602af87"},t(S,{key:"322abe78babc127fccb9309c14c91b30a5d86700"},t(D,{key:"e9843c61dd4eb031f514ff35f3354998dfaec59e",colSpan:this.terminalsTable.columnData.length},t("pagination-menu",{key:"d6b0bdaa7459afb8cd164c540843e7a4d8376f53",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"],pagingParams:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{q as justifi_terminals_list}
@@ -1 +1 @@
1
- import{r,c as s,h as t}from"./p-CV0Pyo1O.js";import{S as e}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as i}from"./p-GP5gWjhc.js";import{d as o}from"./p-niGr4RT2.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as n,C as a,e as p}from"./p-CUI41_5y.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a as m}from"./p-B5vVjDc_.js";import{A as h}from"./p-CYQvLgSs.js";import{J as d}from"./p-cXPhRFs-.js";import"./p-CXKOe1m5.js";import"./p-DnrawQn3.js";import"./p-BRnBHsdq.js";import"./p-pL4dNfsl.js";import"./p-D8GTwl9v.js";const l=h();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const u=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=o,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){i(),this.analytics=new d(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:e,onSuccess:i,onError:o,final:p})=>{var h,d;try{const p=await t.fetchTerminalOrders(r,s,e);if(p.error)return o({error:m(p.error),code:c(null===(d=p.error)||void 0===d?void 0:d.code),severity:a.ERROR});{const r=Object.assign({},p.page_info);i({terminalOrders:(null===(h=p.data)||void 0===h?void 0:h.map((r=>new n(r))))||[],pagingInfo:r})}}catch(r){const s=c(null==r?void 0:r.code);return o({error:r.message||r,code:s,severity:a.ERROR})}finally{return p()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}render(){return t(e,{key:"65330929a53f4e5e07177541460ccce864edd3ec"},t("terminal-orders-list-core",{key:"79d4bc028395ede9b9f2e2c12729cc20532ef251",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{u as justifi_terminal_orders_list}
1
+ import{r,c as s,h as t}from"./p-CV0Pyo1O.js";import{S as i}from"./p-BqNNwq6C.js";import"./p-CZfYo5-1.js";import{c as e}from"./p-BJ7GFTiW.js";import{d as o}from"./p-niGr4RT2.js";import"./p-DVJaoI_m.js";import"./p-HXpYMWUU.js";import{k as n,C as a,e as p}from"./p-CUI41_5y.js";import"./p-CLHwhyvu.js";import"./p-BcNb9bVO.js";import"./p-BH0Xfn-F.js";import{g as c,a as m}from"./p-B5vVjDc_.js";import{A as d}from"./p-CYQvLgSs.js";import{J as h}from"./p-BnaR7f2G.js";import"./p-BCgsLInF.js";import"./p-DnrawQn3.js";import"./p-BRnBHsdq.js";import"./p-pL4dNfsl.js";import"./p-D8GTwl9v.js";const l=d();class j{async fetchTerminalOrders(r,s,t){return l.get({endpoint:"terminals/orders",params:t,headers:{account:r},authToken:s})}}const u=class{constructor(t){r(this,t),this.errorEvent=s(this,"error-event",7),this.errorMessage=null,this.columns=o,this.handleErrorEvent=r=>{this.errorMessage=r.detail.message,this.errorEvent.emit(r.detail)}}componentWillLoad(){e(),this.analytics=new h(this),this.initializeGetData()}disconnectedCallback(){var r;null===(r=this.analytics)||void 0===r||r.cleanup()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:r,authToken:s,service:t})=>async({params:i,onSuccess:e,onError:o,final:p})=>{var d,h;try{const p=await t.fetchTerminalOrders(r,s,i);if(p.error)return o({error:m(p.error),code:c(null===(h=p.error)||void 0===h?void 0:h.code),severity:a.ERROR});{const r=Object.assign({},p.page_info);e({terminalOrders:(null===(d=p.data)||void 0===d?void 0:d.map((r=>new n(r))))||[],pagingInfo:r})}}catch(r){const s=c(null==r?void 0:r.code);return o({error:r.message||r,code:s,severity:a.ERROR})}finally{return p()}})({id:this.accountId,authToken:this.authToken,service:new j}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:this.errorMessage,severity:a.ERROR}))}render(){return t(i,{key:"65330929a53f4e5e07177541460ccce864edd3ec"},t("terminal-orders-list-core",{key:"79d4bc028395ede9b9f2e2c12729cc20532ef251",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{u as justifi_terminal_orders_list}