@justifi/webcomponents 6.0.6-rc.2 → 6.0.6-rc.3

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 (426) hide show
  1. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.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-BXAxVT0S.js → check-pkg-version-D2O-HBMD.js} +1 -1
  5. package/dist/cjs/{checkout.store-CS7dpzYF.js → checkout.store-Bswr7kNY.js} +4 -0
  6. package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
  7. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  8. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  9. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  10. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  11. package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
  12. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +2 -2
  13. package/dist/cjs/form-control-number.cjs.entry.js +2 -2
  14. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  15. package/dist/cjs/form-control-select_2.cjs.entry.js +4 -4
  16. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
  17. package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
  18. package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +8 -8
  19. package/dist/cjs/{justifi-checkout-summary_7.cjs.entry.js → justifi-apple-pay_8.cjs.entry.js} +882 -15
  20. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +11 -11
  21. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  24. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
  25. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  26. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
  28. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +5 -5
  29. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  30. package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
  31. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  32. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
  34. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  36. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  37. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
  38. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  40. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  41. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
  42. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  43. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  44. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +2 -2
  45. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
  46. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
  47. package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
  48. package/dist/cjs/loader.cjs.js +1 -1
  49. package/dist/cjs/{package-D8-S3yHl.js → package-B8AreocB.js} +1 -1
  50. package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
  51. package/dist/cjs/payment-details-core.cjs.entry.js +8 -8
  52. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  53. package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
  54. package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
  55. package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
  56. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +1 -1
  58. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  59. package/dist/cjs/terminals-list-core.cjs.entry.js +1 -1
  60. package/dist/cjs/webcomponents.cjs.js +1 -1
  61. package/dist/collection/api/services/apple-pay.service.js +0 -3
  62. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
  63. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  64. package/dist/collection/components/checkout/checkout.js +1 -1
  65. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  66. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  67. package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
  68. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
  69. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  70. package/dist/collection/components/dispute-management/dispute-management-core.js +1 -1
  71. package/dist/collection/components/dispute-management/dispute-management.js +1 -1
  72. package/dist/collection/components/dispute-management/dispute-notification.js +1 -1
  73. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  74. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  75. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  76. package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +1 -1
  77. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
  78. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  79. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  80. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  81. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  82. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  83. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  84. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
  85. package/dist/collection/components/modular-checkout/modular-checkout.js +7 -6
  86. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +49 -2
  87. package/dist/collection/components/modular-checkout/sub-components/bank-account-billing-form-simple.js +1 -1
  88. package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
  89. package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -1
  90. package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
  91. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  92. package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
  93. package/dist/collection/components/order-terminals/order-terminals.js +1 -1
  94. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  95. package/dist/collection/components/payment-details/payment-details-core.js +8 -8
  96. package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
  97. package/dist/collection/components/payments-list/payments-list-core.js +1 -1
  98. package/dist/collection/components/payments-list/payments-list-filters.js +2 -2
  99. package/dist/collection/components/payments-list/payments-list.js +1 -1
  100. package/dist/collection/components/payout-details/payout-details-core.js +3 -3
  101. package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
  102. package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
  103. package/dist/collection/components/payouts-list/payouts-list-filters.js +2 -2
  104. package/dist/collection/components/payouts-list/payouts-list.js +1 -1
  105. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
  106. package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +2 -2
  107. package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
  108. package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
  109. package/dist/collection/components/terminals-list/terminals-list-filters.js +1 -1
  110. package/dist/collection/components/terminals-list/terminals-list.js +1 -1
  111. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +1 -1
  112. package/dist/collection/store/checkout.store.js +4 -0
  113. package/dist/collection/ui-components/apple-pay-button.js +4 -7
  114. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  115. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  116. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  117. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  118. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  119. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  120. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  121. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  122. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  123. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  124. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  125. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  126. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  127. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  128. package/dist/collection/ui-components/pagination-menu/pagination-menu.js +3 -3
  129. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  130. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  131. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  132. package/dist/docs.json +69 -3
  133. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  134. package/dist/esm/{badge-BYEj23zk.js → badge-CtdO-tEY.js} +1 -1
  135. package/dist/esm/bank-account-document-form-inputs_4.entry.js +5 -5
  136. package/dist/esm/bank-account-form.entry.js +4 -4
  137. package/dist/esm/business-details-core.entry.js +3 -3
  138. package/dist/esm/{button-BQetT-FB.js → button-DtTaQHMK.js} +1 -1
  139. package/dist/esm/card-form.entry.js +4 -4
  140. package/dist/esm/{check-pkg-version-DdZIl21c.js → check-pkg-version-f6satvrI.js} +1 -1
  141. package/dist/esm/{checkout.store-CWAkbFJL.js → checkout.store-4nUf2OuT.js} +4 -0
  142. package/dist/esm/checkouts-list-core.entry.js +6 -6
  143. package/dist/esm/{checkouts-table-D7-slfUE.js → checkouts-table-B6gGDtOr.js} +2 -2
  144. package/dist/esm/custom-popper_2.entry.js +3 -3
  145. package/dist/esm/form-alert_5.entry.js +1 -1
  146. package/dist/esm/form-control-checkbox.entry.js +5 -5
  147. package/dist/esm/form-control-date.entry.js +4 -4
  148. package/dist/esm/{form-control-error-text-DU4UNQlE.js → form-control-error-text-bprS-t9d.js} +1 -1
  149. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  150. package/dist/esm/{form-control-help-text-DDLwbCDl.js → form-control-help-text-Bvnp-IAG.js} +1 -1
  151. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  152. package/dist/esm/form-control-monetary.entry.js +5 -5
  153. package/dist/esm/form-control-number-masked_2.entry.js +4 -4
  154. package/dist/esm/form-control-number.entry.js +5 -5
  155. package/dist/esm/form-control-radio.entry.js +3 -3
  156. package/dist/esm/form-control-select_2.entry.js +6 -6
  157. package/dist/esm/gross-payment-chart-core.entry.js +4 -4
  158. package/dist/esm/{header-1-CIfsspQD.js → header-1-C1Hnxki8.js} +1 -1
  159. package/dist/esm/{header-3-0vgSYspf.js → header-3-Bq8fpjm-.js} +1 -1
  160. package/dist/esm/hidden-input_2.entry.js +7 -7
  161. package/dist/esm/{insurance-state-QGyiPZ_-.js → insurance-state-CVme82j7.js} +1 -1
  162. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
  163. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
  164. package/dist/esm/justifi-additional-statement_8.entry.js +9 -9
  165. package/dist/esm/{justifi-checkout-summary_7.entry.js → justifi-apple-pay_8.entry.js} +886 -20
  166. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +15 -15
  167. package/dist/esm/justifi-business-details.entry.js +4 -4
  168. package/dist/esm/justifi-business-form.entry.js +6 -6
  169. package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
  170. package/dist/esm/justifi-checkout.entry.js +5 -5
  171. package/dist/esm/justifi-checkouts-list-filters.entry.js +2 -2
  172. package/dist/esm/justifi-checkouts-list.entry.js +6 -6
  173. package/dist/esm/justifi-details.entry.js +2 -2
  174. package/dist/esm/justifi-dispute-management-core.entry.js +1 -1
  175. package/dist/esm/justifi-dispute-management.entry.js +3 -3
  176. package/dist/esm/justifi-dispute-notification_3.entry.js +8 -8
  177. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
  178. package/dist/esm/justifi-order-terminals.entry.js +5 -5
  179. package/dist/esm/justifi-owner-form_3.entry.js +2 -2
  180. package/dist/esm/justifi-payment-details.entry.js +4 -4
  181. package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
  182. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  183. package/dist/esm/justifi-payment-transactions-list.entry.js +6 -6
  184. package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
  185. package/dist/esm/justifi-payments-list.entry.js +7 -7
  186. package/dist/esm/justifi-payout-details.entry.js +4 -4
  187. package/dist/esm/justifi-payout-transactions-list.entry.js +6 -6
  188. package/dist/esm/justifi-payouts-list-filters.entry.js +3 -3
  189. package/dist/esm/justifi-payouts-list.entry.js +7 -7
  190. package/dist/esm/justifi-refund-payment.entry.js +5 -5
  191. package/dist/esm/justifi-saved-payment-method.entry.js +2 -2
  192. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  193. package/dist/esm/justifi-skeleton.entry.js +3 -3
  194. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
  195. package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
  196. package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
  197. package/dist/esm/justifi-terminals-list.entry.js +6 -6
  198. package/dist/esm/loader.js +1 -1
  199. package/dist/esm/{package-DlT1rYmL.js → package-DOrxxtCs.js} +1 -1
  200. package/dist/esm/pagination-menu.entry.js +4 -4
  201. package/dist/esm/{parts-DS3KdLWS.js → parts-xDbRW9xn.js} +1 -1
  202. package/dist/esm/payment-details-core.entry.js +13 -13
  203. package/dist/esm/payment-method-option.entry.js +2 -2
  204. package/dist/esm/payments-list-core.entry.js +7 -7
  205. package/dist/esm/{payments-status-DpKZIq0D.js → payments-status-cvtVmtY5.js} +1 -1
  206. package/dist/esm/{payments-table-BhUsDP9C.js → payments-table-D_BlyU1F.js} +2 -2
  207. package/dist/esm/payout-details-core.entry.js +9 -9
  208. package/dist/esm/payouts-list-core.entry.js +7 -7
  209. package/dist/esm/{payouts-status-CZxWiR6g.js → payouts-status-D-vjrqBb.js} +1 -1
  210. package/dist/esm/{payouts-table-C6bACVT_.js → payouts-table-Clj8YGLV.js} +2 -2
  211. package/dist/esm/{skeleton-CtxvPKqv.js → skeleton-B8EUwt4b.js} +1 -1
  212. package/dist/esm/{spinner-DSSWDOaz.js → spinner-CYXkn1fh.js} +1 -1
  213. package/dist/esm/{table-C7Sw1Lk-.js → table-Bj20uWfu.js} +2 -2
  214. package/dist/esm/table-filters-menu.entry.js +3 -3
  215. package/dist/esm/terminal-orders-list-core.entry.js +6 -6
  216. package/dist/esm/{terminal-orders-table-Cdv_O1iI.js → terminal-orders-table-DzBpIW8i.js} +2 -2
  217. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  218. package/dist/esm/terminals-list-core.entry.js +6 -6
  219. package/dist/esm/{terminals-table-BBUVz5oU.js → terminals-table-BMS5tazC.js} +2 -2
  220. package/dist/esm/{utils-DkhVjdbQ.js → utils-DRwofES0.js} +1 -1
  221. package/dist/esm/webcomponents.js +1 -1
  222. package/dist/module/additional-statement.js +1 -1
  223. package/dist/{esm/justifi-apple-pay.entry.js → module/apple-pay.js} +68 -33
  224. package/dist/module/bank-account-billing-form-simple.js +1 -1
  225. package/dist/module/bank-account-form.js +2 -2
  226. package/dist/module/bank-account.js +2 -2
  227. package/dist/module/cancellation-policy.js +1 -1
  228. package/dist/module/card-billing-form-simple.js +1 -1
  229. package/dist/module/card-form.js +2 -2
  230. package/dist/module/card-form2.js +2 -2
  231. package/dist/module/checkout.store.js +4 -0
  232. package/dist/module/checkouts-list-core2.js +1 -1
  233. package/dist/module/custom-popper2.js +2 -2
  234. package/dist/module/customer-details.js +1 -1
  235. package/dist/module/dispute-management-core.js +1 -1
  236. package/dist/module/dispute-notification.js +1 -1
  237. package/dist/module/dispute-response-core.js +1 -1
  238. package/dist/module/dispute-response.js +1 -1
  239. package/dist/module/duplicate-charge.js +1 -1
  240. package/dist/module/electronic-evidence.js +1 -1
  241. package/dist/module/form-control-checkbox2.js +2 -2
  242. package/dist/module/form-control-date2.js +2 -2
  243. package/dist/module/form-control-file-v22.js +1 -1
  244. package/dist/module/form-control-file2.js +2 -2
  245. package/dist/module/form-control-monetary2.js +2 -2
  246. package/dist/module/form-control-number-masked2.js +2 -2
  247. package/dist/module/form-control-number.js +2 -2
  248. package/dist/module/form-control-radio2.js +2 -2
  249. package/dist/module/form-control-select2.js +2 -2
  250. package/dist/module/form-control-text2.js +2 -2
  251. package/dist/module/form-control-textarea2.js +2 -2
  252. package/dist/module/gross-payment-chart-core2.js +1 -1
  253. package/dist/module/hidden-input2.js +1 -1
  254. package/dist/module/iframe-input2.js +3 -3
  255. package/dist/module/justifi-apple-pay.js +1 -907
  256. package/dist/module/justifi-button2.js +1 -1
  257. package/dist/module/justifi-checkout.js +25 -19
  258. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  259. package/dist/module/justifi-checkouts-list.js +1 -1
  260. package/dist/module/justifi-dispute-management.js +1 -1
  261. package/dist/module/justifi-header2.js +1 -1
  262. package/dist/module/justifi-order-terminals.js +1 -1
  263. package/dist/module/justifi-payment-transactions-list.js +1 -1
  264. package/dist/module/justifi-payments-list-filters.js +2 -2
  265. package/dist/module/justifi-payments-list.js +1 -1
  266. package/dist/module/justifi-payout-transactions-list.js +1 -1
  267. package/dist/module/justifi-payouts-list-filters.js +2 -2
  268. package/dist/module/justifi-payouts-list.js +1 -1
  269. package/dist/module/justifi-saved-payment-method.js +1 -1
  270. package/dist/module/justifi-skeleton.js +1 -1
  271. package/dist/module/justifi-terminal-orders-list-filters.js +2 -2
  272. package/dist/module/justifi-terminal-orders-list.js +1 -1
  273. package/dist/module/justifi-terminals-list-filters.js +1 -1
  274. package/dist/module/justifi-terminals-list.js +1 -1
  275. package/dist/module/modular-checkout.js +7 -6
  276. package/dist/module/package.js +1 -1
  277. package/dist/module/pagination-menu2.js +3 -3
  278. package/dist/module/payment-details-core2.js +8 -8
  279. package/dist/module/payment-method-option.js +1 -1
  280. package/dist/module/payments-list-core2.js +1 -1
  281. package/dist/module/payout-details-core2.js +3 -3
  282. package/dist/module/payouts-list-core2.js +1 -1
  283. package/dist/module/product-or-service.js +1 -1
  284. package/dist/module/refund-policy.js +1 -1
  285. package/dist/module/save-new-payment-method.js +1 -1
  286. package/dist/module/shipping-details.js +1 -1
  287. package/dist/module/summary.js +1 -1
  288. package/dist/module/table-filters-menu2.js +1 -1
  289. package/dist/module/terminal-orders-list-core2.js +1 -1
  290. package/dist/module/terminal-quantity-selector2.js +1 -1
  291. package/dist/module/terminals-list-core2.js +1 -1
  292. package/dist/module/tokenize-payment-method.js +1 -1
  293. package/dist/types/api/Checkout.d.ts +2 -0
  294. package/dist/types/components/modular-checkout/sub-components/apple-pay.d.ts +2 -0
  295. package/dist/types/components.d.ts +16 -0
  296. package/dist/types/store/checkout.store.d.ts +1 -0
  297. package/dist/webcomponents/{p-8696cf1e.entry.js → p-0217783c.entry.js} +3 -3
  298. package/dist/webcomponents/p-02fdd7f5.entry.js +1 -0
  299. package/dist/webcomponents/p-0af5269e.entry.js +1 -0
  300. package/dist/webcomponents/{p-b3517f18.entry.js → p-0cac8468.entry.js} +1 -1
  301. package/dist/webcomponents/{p-368aad3e.entry.js → p-0cf71cbd.entry.js} +1 -1
  302. package/dist/webcomponents/{p-8e6ae277.entry.js → p-0eb69f41.entry.js} +1 -1
  303. package/dist/webcomponents/{p-064578b9.entry.js → p-17abfc00.entry.js} +1 -1
  304. package/dist/webcomponents/{p-96cc471a.entry.js → p-24817d58.entry.js} +1 -1
  305. package/dist/webcomponents/p-28625e07.entry.js +1 -0
  306. package/dist/webcomponents/{p-f7977891.entry.js → p-293c4517.entry.js} +1 -1
  307. package/dist/webcomponents/p-2d300faa.entry.js +1 -0
  308. package/dist/webcomponents/p-2dfbbc7a.entry.js +1 -0
  309. package/dist/webcomponents/p-328117e4.entry.js +1 -0
  310. package/dist/webcomponents/{p-72e0698c.entry.js → p-32978110.entry.js} +1 -1
  311. package/dist/webcomponents/{p-2b1b815a.entry.js → p-37a93597.entry.js} +1 -1
  312. package/dist/webcomponents/{p-4941bcaf.entry.js → p-38668717.entry.js} +1 -1
  313. package/dist/webcomponents/{p-32b0593d.entry.js → p-3ff3bb90.entry.js} +1 -1
  314. package/dist/webcomponents/{p-188f921f.entry.js → p-447b55c0.entry.js} +1 -1
  315. package/dist/webcomponents/p-451c8e1b.entry.js +1 -0
  316. package/dist/webcomponents/p-47997bc2.entry.js +1 -0
  317. package/dist/webcomponents/{p-9f35781b.entry.js → p-50701f16.entry.js} +1 -1
  318. package/dist/webcomponents/{p-4633e577.entry.js → p-51ac9f40.entry.js} +1 -1
  319. package/dist/webcomponents/p-526b7442.entry.js +1 -0
  320. package/dist/webcomponents/p-5aae36f3.entry.js +1 -0
  321. package/dist/webcomponents/p-5bd3d86e.entry.js +1 -0
  322. package/dist/webcomponents/{p-25dffee2.entry.js → p-63ad8ebd.entry.js} +1 -1
  323. package/dist/webcomponents/p-6472b6db.entry.js +1 -0
  324. package/dist/webcomponents/p-6df72e0f.entry.js +1 -0
  325. package/dist/webcomponents/p-705dba52.entry.js +1 -0
  326. package/dist/webcomponents/{p-4c7b6e72.entry.js → p-78cb62a8.entry.js} +1 -1
  327. package/dist/webcomponents/{p-789e86ef.entry.js → p-7f018623.entry.js} +1 -1
  328. package/dist/webcomponents/{p-924a25d4.entry.js → p-80b2cdec.entry.js} +1 -1
  329. package/dist/webcomponents/p-88fcb530.entry.js +1 -0
  330. package/dist/webcomponents/{p-a871b38b.entry.js → p-8be7fbf6.entry.js} +1 -1
  331. package/dist/webcomponents/p-8ca21fab.entry.js +1 -0
  332. package/dist/webcomponents/{p-5ca7a03f.entry.js → p-8f84883e.entry.js} +1 -1
  333. package/dist/webcomponents/{p-6de344f8.entry.js → p-96694f7d.entry.js} +1 -1
  334. package/dist/webcomponents/p-9ad7d724.entry.js +1 -0
  335. package/dist/webcomponents/{p-1162b2fc.entry.js → p-9ed7b13f.entry.js} +1 -1
  336. package/dist/webcomponents/{p-B7TpAe2k.js → p-B6IWa9Ph.js} +1 -1
  337. package/dist/webcomponents/{p-BIKX2tSN.js → p-BBx_EQqR.js} +1 -1
  338. package/dist/webcomponents/p-BoQ6_4Ks.js +1 -0
  339. package/dist/webcomponents/{p-SWI5-Jo-.js → p-C0wTyoTh.js} +1 -1
  340. package/dist/webcomponents/{p-YXBIe5uT.js → p-C9EQ459H.js} +1 -1
  341. package/dist/webcomponents/{p-7663hWTF.js → p-CCmDcLao.js} +1 -1
  342. package/dist/webcomponents/{p-CqFjmIng.js → p-CH8Y3GSr.js} +1 -1
  343. package/dist/webcomponents/{p-BbbgFMaz.js → p-ClvhB3WW.js} +1 -1
  344. package/dist/webcomponents/{p-53MvfN19.js → p-CmBCj61h.js} +1 -1
  345. package/dist/webcomponents/{p-Cqe5a-d3.js → p-Cq_f4KEI.js} +1 -1
  346. package/dist/webcomponents/p-D0Peuz-m.js +1 -0
  347. package/dist/webcomponents/p-D6BImiVi.js +1 -0
  348. package/dist/webcomponents/p-DGsXKF67.js +1 -0
  349. package/dist/webcomponents/p-DOrxxtCs.js +1 -0
  350. package/dist/webcomponents/p-NAjz1Xfo.js +1 -0
  351. package/dist/webcomponents/p-RQzxYnz_.js +1 -0
  352. package/dist/webcomponents/p-T2yENPvU.js +1 -0
  353. package/dist/webcomponents/{p-2bb49747.entry.js → p-a09695c4.entry.js} +1 -1
  354. package/dist/webcomponents/p-a5fc94fe.entry.js +1 -0
  355. package/dist/webcomponents/p-abbe97eb.entry.js +1 -0
  356. package/dist/webcomponents/{p-f1915a72.entry.js → p-ae8ae5bb.entry.js} +1 -1
  357. package/dist/webcomponents/{p-b82b685d.entry.js → p-aeb22aa2.entry.js} +1 -1
  358. package/dist/webcomponents/p-au49QgoI.js +1 -0
  359. package/dist/webcomponents/{p-79a55ed5.entry.js → p-b608add9.entry.js} +1 -1
  360. package/dist/webcomponents/p-bb53e2e9.entry.js +1 -0
  361. package/dist/webcomponents/p-bc099dd0.entry.js +1 -0
  362. package/dist/webcomponents/{p-341eb162.entry.js → p-be5c5154.entry.js} +1 -1
  363. package/dist/webcomponents/{p-bcc7ebb5.entry.js → p-bf5593bb.entry.js} +1 -1
  364. package/dist/webcomponents/p-c12d0453.entry.js +1 -0
  365. package/dist/webcomponents/{p-9b14089f.entry.js → p-c644a9f1.entry.js} +1 -1
  366. package/dist/webcomponents/{p-fc5eeb40.entry.js → p-c9cfab30.entry.js} +1 -1
  367. package/dist/webcomponents/{p-22b3b0c2.entry.js → p-cc5c6425.entry.js} +1 -1
  368. package/dist/webcomponents/{p-507ab3f1.entry.js → p-cf26936c.entry.js} +1 -1
  369. package/dist/webcomponents/{p-263ee88e.entry.js → p-d0a2035f.entry.js} +1 -1
  370. package/dist/webcomponents/p-d1bceac6.entry.js +1 -0
  371. package/dist/webcomponents/p-d2b922cc.entry.js +1 -0
  372. package/dist/webcomponents/{p-4b1a3cf6.entry.js → p-d4476052.entry.js} +1 -1
  373. package/dist/webcomponents/{p-62fab960.entry.js → p-de95bf57.entry.js} +1 -1
  374. package/dist/webcomponents/p-e6be4e19.entry.js +1 -0
  375. package/dist/webcomponents/p-ec9514f8.entry.js +1 -0
  376. package/dist/webcomponents/p-edfeb034.entry.js +1 -0
  377. package/dist/webcomponents/{p-a4a57240.entry.js → p-f705fc49.entry.js} +1 -1
  378. package/dist/webcomponents/{p-7c7666ad.entry.js → p-fbc5fc6d.entry.js} +1 -1
  379. package/dist/webcomponents/p-ffefa09c.entry.js +1 -0
  380. package/dist/webcomponents/p-h5pyZngT.js +1 -0
  381. package/dist/webcomponents/{p-f6_r41aD.js → p-hbWSMN3O.js} +1 -1
  382. package/dist/webcomponents/p-wQgEEOq_.js +1 -0
  383. package/dist/webcomponents/{p-DS3KdLWS.js → p-xDbRW9xn.js} +1 -1
  384. package/dist/webcomponents/webcomponents.esm.js +1 -1
  385. package/package.json +1 -1
  386. package/dist/cjs/justifi-apple-pay.cjs.entry.js +0 -879
  387. package/dist/webcomponents/p-065999a7.entry.js +0 -1
  388. package/dist/webcomponents/p-145a2370.entry.js +0 -1
  389. package/dist/webcomponents/p-185550b1.entry.js +0 -1
  390. package/dist/webcomponents/p-20c42901.entry.js +0 -1
  391. package/dist/webcomponents/p-38f4b133.entry.js +0 -1
  392. package/dist/webcomponents/p-3cd7efc1.entry.js +0 -1
  393. package/dist/webcomponents/p-49998d80.entry.js +0 -1
  394. package/dist/webcomponents/p-59b4454a.entry.js +0 -1
  395. package/dist/webcomponents/p-6217eb14.entry.js +0 -1
  396. package/dist/webcomponents/p-7bdaf07c.entry.js +0 -1
  397. package/dist/webcomponents/p-7c4a3118.entry.js +0 -1
  398. package/dist/webcomponents/p-7fc37722.entry.js +0 -1
  399. package/dist/webcomponents/p-8948b298.entry.js +0 -1
  400. package/dist/webcomponents/p-97ea8a2a.entry.js +0 -1
  401. package/dist/webcomponents/p-98ae711c.entry.js +0 -1
  402. package/dist/webcomponents/p-BBzXThAT.js +0 -1
  403. package/dist/webcomponents/p-BCE-dTDp.js +0 -1
  404. package/dist/webcomponents/p-Baf5crBG.js +0 -1
  405. package/dist/webcomponents/p-C4AUlhx6.js +0 -1
  406. package/dist/webcomponents/p-D5KZeFMv.js +0 -1
  407. package/dist/webcomponents/p-DFEINx3E.js +0 -1
  408. package/dist/webcomponents/p-DlT1rYmL.js +0 -1
  409. package/dist/webcomponents/p-DrrHSa75.js +0 -1
  410. package/dist/webcomponents/p-DszoS3BO.js +0 -1
  411. package/dist/webcomponents/p-SPYUZxQ9.js +0 -1
  412. package/dist/webcomponents/p-a3a2f508.entry.js +0 -1
  413. package/dist/webcomponents/p-a44c1cae.entry.js +0 -1
  414. package/dist/webcomponents/p-a6008498.entry.js +0 -1
  415. package/dist/webcomponents/p-a9e7b25b.entry.js +0 -1
  416. package/dist/webcomponents/p-b2816bb2.entry.js +0 -1
  417. package/dist/webcomponents/p-b57ba0c7.entry.js +0 -1
  418. package/dist/webcomponents/p-b701fcf0.entry.js +0 -1
  419. package/dist/webcomponents/p-bcc22295.entry.js +0 -1
  420. package/dist/webcomponents/p-cf37b3bb.entry.js +0 -1
  421. package/dist/webcomponents/p-d55e5756.entry.js +0 -1
  422. package/dist/webcomponents/p-db03d37a.entry.js +0 -1
  423. package/dist/webcomponents/p-dce78317.entry.js +0 -1
  424. package/dist/webcomponents/p-e1e13e85.entry.js +0 -1
  425. package/dist/webcomponents/p-f605af1c.entry.js +0 -1
  426. package/dist/webcomponents/p-iT-AQTXJ.js +0 -1
@@ -1,13 +1,15 @@
1
- import { r as registerInstance, h, c as createEvent, H as Host, g as getElement } from './index-DOjVAAtq.js';
2
- import { z as text, r as radioListItem } from './parts-DS3KdLWS.js';
3
- import { f as formatCurrency } from './utils-BOijEGPV.js';
4
- import { c as checkoutStore, o as onAnyChange, g as getAvailablePaymentMethodTypes, a as onChange } from './checkout.store-CWAkbFJL.js';
1
+ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-DOjVAAtq.js';
2
+ import { A as Api } from './Api-DhiA2e_P.js';
5
3
  import { S as StyledHost } from './styled-host-OalOsPBp.js';
6
4
  import './event-types-CZfYo5-1.js';
7
- import { H as Header1 } from './header-1-CIfsspQD.js';
8
- import { H as Header2, b as insuranceValuesOn, h as hasInsuranceValueChanged, i as insuranceValues } from './insurance-state-QGyiPZ_-.js';
9
- import { H as Header3 } from './header-3-0vgSYspf.js';
10
- import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-DdZIl21c.js';
5
+ import { S as Skeleton } from './skeleton-B8EUwt4b.js';
6
+ import { c as checkoutStore, o as onAnyChange, g as getAvailablePaymentMethodTypes, a as onChange } from './checkout.store-4nUf2OuT.js';
7
+ import { D as text, r as radioListItem } from './parts-xDbRW9xn.js';
8
+ import { f as formatCurrency } from './utils-BOijEGPV.js';
9
+ import { H as Header1 } from './header-1-C1Hnxki8.js';
10
+ import { H as Header2, b as insuranceValuesOn, h as hasInsuranceValueChanged, i as insuranceValues } from './insurance-state-CVme82j7.js';
11
+ import { H as Header3 } from './header-3-Bq8fpjm-.js';
12
+ import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-f6satvrI.js';
11
13
  import './config-state-DiHV-4QK.js';
12
14
  import './dinero-HXpYMWUU.js';
13
15
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes, b as ComponentErrorMessages } from './ComponentError-Cjcsf8ku.js';
@@ -17,20 +19,883 @@ import './Business-BCoP0TAV.js';
17
19
  import './Dispute-BH0Xfn-F.js';
18
20
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
19
21
  import { C as CheckoutService } from './checkout.service-fwbqSq8g.js';
20
- import { A as Api } from './Api-DhiA2e_P.js';
21
22
  import { P as PAYMENT_METHODS, a as PaymentMethod, b as PAYMENT_MODE } from './index-DCIW8z1f.js';
22
23
  import { C as CardBrandLabels } from './payment-method-option-utils-lUHAQVFl.js';
23
24
  import './index-DJ9G-4S-.js';
24
- import './package-DlT1rYmL.js';
25
+ import './package-DOrxxtCs.js';
25
26
  import './helpers-Mu7LQT-w.js';
26
27
  import './state-options-BX8GieXu.js';
27
28
 
29
+ var ApplePaySessionStatus;
30
+ (function (ApplePaySessionStatus) {
31
+ ApplePaySessionStatus["STATUS_SUCCESS"] = "STATUS_SUCCESS";
32
+ ApplePaySessionStatus["STATUS_FAILURE"] = "STATUS_FAILURE";
33
+ })(ApplePaySessionStatus || (ApplePaySessionStatus = {}));
34
+ var ApplePayButtonType;
35
+ (function (ApplePayButtonType) {
36
+ ApplePayButtonType["PLAIN"] = "plain";
37
+ ApplePayButtonType["BUY"] = "buy";
38
+ ApplePayButtonType["SET_UP"] = "set-up";
39
+ ApplePayButtonType["DONATE"] = "donate";
40
+ ApplePayButtonType["CHECK_OUT"] = "check-out";
41
+ ApplePayButtonType["BOOK"] = "book";
42
+ ApplePayButtonType["SUBSCRIBE"] = "subscribe";
43
+ })(ApplePayButtonType || (ApplePayButtonType = {}));
44
+ var ApplePayButtonStyle;
45
+ (function (ApplePayButtonStyle) {
46
+ ApplePayButtonStyle["BLACK"] = "black";
47
+ ApplePayButtonStyle["WHITE"] = "white";
48
+ ApplePayButtonStyle["WHITE_OUTLINE"] = "white-outline";
49
+ })(ApplePayButtonStyle || (ApplePayButtonStyle = {}));
50
+ var ApplePayMerchantCapability;
51
+ (function (ApplePayMerchantCapability) {
52
+ ApplePayMerchantCapability["SUPPORTS_3DS"] = "supports3DS";
53
+ ApplePayMerchantCapability["SUPPORTS_EMV"] = "supportsEMV";
54
+ ApplePayMerchantCapability["SUPPORTS_CREDIT"] = "supportsCredit";
55
+ ApplePayMerchantCapability["SUPPORTS_DEBIT"] = "supportsDebit";
56
+ })(ApplePayMerchantCapability || (ApplePayMerchantCapability = {}));
57
+ class ApplePayConfig {
58
+ constructor(data) {
59
+ this.merchantIdentifier = data.merchantIdentifier;
60
+ this.displayName = data.displayName;
61
+ this.initiative = data.initiative;
62
+ this.initiativeContext = data.initiativeContext;
63
+ this.buttonType = data.buttonType || ApplePayButtonType.PLAIN;
64
+ this.buttonStyle = data.buttonStyle || ApplePayButtonStyle.BLACK;
65
+ this.buttonLocale = data.buttonLocale || 'en-US';
66
+ }
67
+ get isValid() {
68
+ return !!(this.merchantIdentifier &&
69
+ this.displayName &&
70
+ this.initiative &&
71
+ this.initiativeContext);
72
+ }
73
+ }
74
+ class ApplePayPaymentRequest {
75
+ constructor(data) {
76
+ this.countryCode = data.countryCode;
77
+ this.currencyCode = data.currencyCode;
78
+ this.merchantCapabilities = data.merchantCapabilities;
79
+ this.supportedNetworks = data.supportedNetworks;
80
+ this.total = data.total;
81
+ this.lineItems = data.lineItems;
82
+ this.shippingMethods = data.shippingMethods;
83
+ this.applicationData = data.applicationData;
84
+ this.supportedCountries = data.supportedCountries;
85
+ }
86
+ get isValid() {
87
+ var _a, _b, _c, _d;
88
+ return !!(this.countryCode &&
89
+ this.currencyCode &&
90
+ ((_a = this.merchantCapabilities) === null || _a === void 0 ? void 0 : _a.length) &&
91
+ ((_b = this.supportedNetworks) === null || _b === void 0 ? void 0 : _b.length) &&
92
+ ((_c = this.total) === null || _c === void 0 ? void 0 : _c.label) &&
93
+ ((_d = this.total) === null || _d === void 0 ? void 0 : _d.amount));
94
+ }
95
+ }
96
+ class ApplePayHelpers {
97
+ static isApplePaySupported() {
98
+ var _a;
99
+ return (typeof window !== 'undefined' &&
100
+ 'ApplePaySession' in window &&
101
+ ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.supportsVersion(3)));
102
+ }
103
+ static canMakePayments() {
104
+ var _a;
105
+ if (!this.isApplePaySupported()) {
106
+ return false;
107
+ }
108
+ return ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePayments()) || false;
109
+ }
110
+ static async canMakePaymentsWithActiveCard(merchantIdentifier) {
111
+ var _a;
112
+ if (!this.isApplePaySupported()) {
113
+ return false;
114
+ }
115
+ try {
116
+ return ((await ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePaymentsWithActiveCard(merchantIdentifier))) || false);
117
+ }
118
+ catch (error) {
119
+ console.error('Error checking Apple Pay active card:', error);
120
+ return false;
121
+ }
122
+ }
123
+ static formatAmount(amount) {
124
+ return (amount / 100).toFixed(2);
125
+ }
126
+ static parseAmount(amount) {
127
+ return Math.round(parseFloat(amount) * 100);
128
+ }
129
+ static createLineItem(label, amount, type = 'final') {
130
+ return {
131
+ label,
132
+ amount: this.formatAmount(amount),
133
+ type,
134
+ };
135
+ }
136
+ static getDefaultSupportedNetworks() {
137
+ return ['amex', 'discover', 'masterCard', 'visa'];
138
+ }
139
+ static getDefaultMerchantCapabilities() {
140
+ return [
141
+ ApplePayMerchantCapability.SUPPORTS_3DS,
142
+ ApplePayMerchantCapability.SUPPORTS_EMV,
143
+ ApplePayMerchantCapability.SUPPORTS_CREDIT,
144
+ ApplePayMerchantCapability.SUPPORTS_DEBIT,
145
+ ];
146
+ }
147
+ }
148
+
149
+ // Centralized error codes for Apple Pay service
150
+ var ApplePayServiceErrorCode;
151
+ (function (ApplePayServiceErrorCode) {
152
+ ApplePayServiceErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
153
+ ApplePayServiceErrorCode["SESSION_ERROR"] = "SESSION_ERROR";
154
+ ApplePayServiceErrorCode["MERCHANT_VALIDATION_ERROR"] = "MERCHANT_VALIDATION_ERROR";
155
+ ApplePayServiceErrorCode["PAYMENT_PROCESSING_ERROR"] = "PAYMENT_PROCESSING_ERROR";
156
+ ApplePayServiceErrorCode["USER_CANCELLED"] = "USER_CANCELLED";
157
+ })(ApplePayServiceErrorCode || (ApplePayServiceErrorCode = {}));
158
+ class ApplePayService {
159
+ constructor() {
160
+ this.api = Api();
161
+ }
162
+ /**
163
+ * Initialize Apple Pay configuration
164
+ */
165
+ initialize(applePayConfig) {
166
+ this.applePayConfig = new ApplePayConfig(applePayConfig);
167
+ if (!this.applePayConfig.isValid) {
168
+ throw new Error('Invalid Apple Pay configuration provided');
169
+ }
170
+ }
171
+ /**
172
+ * Validate merchant with Apple Pay servers via API
173
+ */
174
+ async validateMerchant(authToken, accountId) {
175
+ const endpoint = 'apple_pay/merchant_session';
176
+ try {
177
+ const response = await this.api.post({
178
+ endpoint,
179
+ authToken,
180
+ headers: {
181
+ 'Sub-Account': accountId,
182
+ },
183
+ });
184
+ return response;
185
+ }
186
+ catch (error) {
187
+ console.error('Backend validation failed:', error);
188
+ throw new Error('Merchant validation failed');
189
+ }
190
+ }
191
+ /**
192
+ * Process Apple Pay payment via API (fixed to match original logic)
193
+ */
194
+ async processPayment(authToken, accountId, payload) {
195
+ const endpoint = 'apple_pay/process_token';
196
+ const result = await this.api.post({
197
+ endpoint,
198
+ authToken,
199
+ body: payload,
200
+ headers: {
201
+ 'Sub-Account': accountId,
202
+ },
203
+ });
204
+ return {
205
+ success: result.id && !!result.data.token,
206
+ data: result,
207
+ };
208
+ }
209
+ /**
210
+ * Check if Apple Pay is available on this device/browser
211
+ */
212
+ isAvailable() {
213
+ return (ApplePayHelpers.isApplePaySupported() && ApplePayHelpers.canMakePayments());
214
+ }
215
+ /**
216
+ * Check if the user has an active card for the merchant
217
+ */
218
+ async canMakePaymentsWithActiveCard() {
219
+ if (!this.applePayConfig) {
220
+ throw new Error('Apple Pay not initialized. Call initialize() first.');
221
+ }
222
+ return await ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
223
+ }
224
+ /**
225
+ * Start Apple Pay session
226
+ */
227
+ async startPaymentSession(paymentRequest, authToken, accountId) {
228
+ // Begin verbose diagnostics for easier debugging in the field
229
+ console.groupCollapsed('[ApplePayService] startPaymentSession called');
230
+ console.log('[ApplePayService] raw paymentRequest:', JSON.stringify(paymentRequest, null, 2));
231
+ console.log('[ApplePayService] has authToken:', Boolean(authToken));
232
+ console.log('[ApplePayService] accountId:', accountId);
233
+ console.log('[ApplePayService] has config:', Boolean(this.applePayConfig));
234
+ if (!this.applePayConfig) {
235
+ console.error('[ApplePayService] Missing applePayConfig. Did you call initialize()?');
236
+ console.groupEnd();
237
+ throw new Error('Apple Pay not initialized. Call initialize() first.');
238
+ }
239
+ // if (!this.isAvailable()) {
240
+ // throw new Error('Apple Pay is not available on this device/browser');
241
+ // }
242
+ const request = new ApplePayPaymentRequest(paymentRequest);
243
+ console.log('[ApplePayService] created ApplePayPaymentRequest:', request);
244
+ if (!request.isValid) {
245
+ const missingFields = [];
246
+ if (!request.countryCode)
247
+ missingFields.push('countryCode');
248
+ if (!request.currencyCode)
249
+ missingFields.push('currencyCode');
250
+ if (!request.merchantCapabilities ||
251
+ request.merchantCapabilities.length === 0)
252
+ missingFields.push('merchantCapabilities');
253
+ if (!request.supportedNetworks || request.supportedNetworks.length === 0)
254
+ missingFields.push('supportedNetworks');
255
+ if (!request.total || !request.total.label || !request.total.amount)
256
+ missingFields.push('total');
257
+ console.error('[ApplePayService] Payment request is invalid. Missing/invalid:', missingFields);
258
+ console.groupEnd();
259
+ throw new Error('Invalid payment request provided');
260
+ }
261
+ this.currentPaymentRequest = request;
262
+ return new Promise((resolve, reject) => {
263
+ try {
264
+ console.log('[ApplePayService] About to instantiate ApplePaySession');
265
+ // Defensive checks for Apple Pay environment
266
+ if (typeof window === 'undefined' || !('ApplePaySession' in window)) {
267
+ console.error('[ApplePayService] ApplePaySession not available on window');
268
+ console.groupEnd();
269
+ return reject({
270
+ success: false,
271
+ error: {
272
+ code: ApplePayServiceErrorCode.UNAVAILABLE,
273
+ message: 'ApplePaySession API is not available in this environment',
274
+ },
275
+ });
276
+ }
277
+ this.currentSession = new window.ApplePaySession(3, request);
278
+ console.log('[ApplePayService] ApplePaySession instantiated:', this.currentSession);
279
+ this.setupSessionEventHandlers(resolve, reject, authToken, accountId);
280
+ console.log('[ApplePayService] Event handlers set. Beginning session...');
281
+ this.currentSession.begin();
282
+ console.log('[ApplePayService] Session.begin() called');
283
+ console.groupEnd();
284
+ }
285
+ catch (error) {
286
+ console.error('[ApplePayService] Exception while starting session:', error);
287
+ console.groupEnd();
288
+ reject({
289
+ success: false,
290
+ error: {
291
+ code: ApplePayServiceErrorCode.SESSION_ERROR,
292
+ message: error instanceof Error
293
+ ? error.message
294
+ : 'Failed to start Apple Pay session',
295
+ },
296
+ });
297
+ }
298
+ });
299
+ }
300
+ /**
301
+ * Abort current Apple Pay session
302
+ */
303
+ abortPaymentSession() {
304
+ if (this.currentSession) {
305
+ this.currentSession.abort();
306
+ this.currentSession = undefined;
307
+ this.currentPaymentRequest = undefined;
308
+ }
309
+ }
310
+ /**
311
+ * Setup Apple Pay session event handlers
312
+ */
313
+ setupSessionEventHandlers(resolve, reject, authToken, accountId) {
314
+ if (!this.currentSession ||
315
+ !this.applePayConfig ||
316
+ !this.currentPaymentRequest) {
317
+ console.error('[ApplePayService] setupSessionEventHandlers called without required state', {
318
+ hasSession: Boolean(this.currentSession),
319
+ hasConfig: Boolean(this.applePayConfig),
320
+ hasPaymentRequest: Boolean(this.currentPaymentRequest),
321
+ });
322
+ return;
323
+ }
324
+ this.currentSession.onvalidatemerchant = async () => {
325
+ console.groupCollapsed('[ApplePayService] onvalidatemerchant');
326
+ try {
327
+ console.log('[ApplePayService] accountId:', accountId);
328
+ if (!authToken) {
329
+ console.error('[ApplePayService] Missing authToken for merchant validation');
330
+ throw new Error('Authentication token not provided.');
331
+ }
332
+ const merchantSession = await this.validateMerchant(authToken, accountId);
333
+ console.log('[ApplePayService] merchantSession received');
334
+ try {
335
+ this.currentSession.completeMerchantValidation(merchantSession);
336
+ console.log('[ApplePayService] completeMerchantValidation called');
337
+ }
338
+ catch (completionError) {
339
+ console.error('Error calling completeMerchantValidation:', completionError);
340
+ throw completionError;
341
+ }
342
+ }
343
+ catch (error) {
344
+ console.error('=== MERCHANT VALIDATION ERROR ===');
345
+ console.error('Error during merchant validation:', error);
346
+ if (error && error.stack) {
347
+ console.error('Error stack:', error.stack);
348
+ }
349
+ this.currentSession.abort();
350
+ reject({
351
+ success: false,
352
+ error: {
353
+ code: ApplePayServiceErrorCode.MERCHANT_VALIDATION_ERROR,
354
+ message: error instanceof Error
355
+ ? error.message
356
+ : 'Merchant validation failed',
357
+ },
358
+ });
359
+ }
360
+ console.groupEnd();
361
+ };
362
+ this.currentSession.onpaymentauthorized = async (event) => {
363
+ var _a;
364
+ console.groupCollapsed('[ApplePayService] onpaymentauthorized');
365
+ try {
366
+ const payment = event.payment;
367
+ console.log('[ApplePayService] payment payload snapshot:', {
368
+ hasToken: Boolean(payment === null || payment === void 0 ? void 0 : payment.token),
369
+ tokenType: ((_a = payment === null || payment === void 0 ? void 0 : payment.token) === null || _a === void 0 ? void 0 : _a.paymentData) ? 'paymentData' : 'raw',
370
+ });
371
+ const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
372
+ name: this.currentPaymentRequest.total.label,
373
+ price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
374
+ description: this.currentPaymentRequest.total.label,
375
+ } });
376
+ console.log('[ApplePayService] paymentPayload prepared');
377
+ const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
378
+ console.log('[ApplePayService] processPayment result:', paymentResult);
379
+ if (paymentResult.success) {
380
+ this.currentSession.completePayment({
381
+ status: ApplePaySessionStatus.STATUS_SUCCESS,
382
+ });
383
+ console.log('[ApplePayService] Payment success; resolving');
384
+ resolve({
385
+ success: true,
386
+ token: payment.token,
387
+ paymentMethodId: paymentResult.data.id,
388
+ });
389
+ }
390
+ else {
391
+ console.error('PSP reported payment failure:', paymentResult.data);
392
+ this.currentSession.completePayment({
393
+ status: ApplePaySessionStatus.STATUS_FAILURE,
394
+ });
395
+ reject({
396
+ success: false,
397
+ error: {
398
+ code: ApplePayServiceErrorCode.PAYMENT_PROCESSING_ERROR,
399
+ message: 'Payment processing failed',
400
+ },
401
+ });
402
+ }
403
+ }
404
+ catch (error) {
405
+ console.error('=== PAYMENT PROCESSING ERROR ===');
406
+ console.error('Error processing payment:', error);
407
+ if (error && error.stack) {
408
+ console.error('Error stack:', error.stack);
409
+ }
410
+ this.currentSession.completePayment({
411
+ status: ApplePaySessionStatus.STATUS_FAILURE,
412
+ });
413
+ reject({
414
+ success: false,
415
+ error: {
416
+ code: ApplePayServiceErrorCode.PAYMENT_PROCESSING_ERROR,
417
+ message: error instanceof Error
418
+ ? error.message
419
+ : 'Payment processing failed',
420
+ },
421
+ });
422
+ }
423
+ finally {
424
+ console.log('[ApplePayService] Cleaning up session state');
425
+ this.currentSession = undefined;
426
+ this.currentPaymentRequest = undefined;
427
+ }
428
+ console.groupEnd();
429
+ };
430
+ this.currentSession.onpaymentmethodselected = () => {
431
+ console.groupCollapsed('[ApplePayService] onpaymentmethodselected');
432
+ const paymentUpdate = {
433
+ newTotal: this.currentPaymentRequest.total,
434
+ newLineItems: this.currentPaymentRequest.lineItems || [],
435
+ };
436
+ try {
437
+ this.currentSession.completePaymentMethodSelection(paymentUpdate);
438
+ console.log('[ApplePayService] completePaymentMethodSelection called');
439
+ }
440
+ catch (error) {
441
+ console.error('Error completing payment method selection:', error);
442
+ this.currentSession.abort();
443
+ }
444
+ console.groupEnd();
445
+ };
446
+ this.currentSession.onshippingmethodselected = () => {
447
+ console.groupCollapsed('[ApplePayService] onshippingmethodselected');
448
+ this.currentSession.completeShippingMethodSelection({
449
+ status: ApplePaySessionStatus.STATUS_SUCCESS,
450
+ newTotal: this.currentPaymentRequest.total,
451
+ newLineItems: this.currentPaymentRequest.lineItems || [],
452
+ });
453
+ console.log('[ApplePayService] completeShippingMethodSelection called');
454
+ console.groupEnd();
455
+ };
456
+ this.currentSession.oncancel = (event) => {
457
+ console.groupCollapsed('[ApplePayService] oncancel');
458
+ if (event.sessionError) {
459
+ console.error(event.sessionError);
460
+ switch (event.sessionError.code) {
461
+ case 'unknown':
462
+ console.error('Unknown error - likely merchant validation issue');
463
+ console.error('This usually means:');
464
+ console.error('1. Merchant certificate is invalid or expired');
465
+ console.error('2. Merchant identifier mismatch');
466
+ console.error('3. Backend validation endpoint issues');
467
+ break;
468
+ case 'invalidMerchantSession':
469
+ console.error('Invalid merchant session provided');
470
+ console.error('Check that the merchant session from backend is valid');
471
+ break;
472
+ case 'userCancel':
473
+ console.error('User cancelled the payment');
474
+ break;
475
+ default:
476
+ console.error('Other error code:', event.sessionError.code);
477
+ }
478
+ }
479
+ this.currentSession = undefined;
480
+ this.currentPaymentRequest = undefined;
481
+ reject({
482
+ success: false,
483
+ error: {
484
+ code: ApplePayServiceErrorCode.USER_CANCELLED,
485
+ message: 'User cancelled the Apple Pay session',
486
+ },
487
+ });
488
+ console.groupEnd();
489
+ };
490
+ if ('onerror' in this.currentSession) {
491
+ this.currentSession.onerror = (error) => {
492
+ console.groupCollapsed('[ApplePayService] onerror');
493
+ console.error('=== APPLE PAY SESSION ERROR ===');
494
+ console.error('Session error:', error);
495
+ this.currentSession = undefined;
496
+ this.currentPaymentRequest = undefined;
497
+ reject({
498
+ success: false,
499
+ error: {
500
+ code: ApplePayServiceErrorCode.SESSION_ERROR,
501
+ message: 'Apple Pay session error occurred',
502
+ },
503
+ });
504
+ console.groupEnd();
505
+ };
506
+ }
507
+ }
508
+ /**
509
+ * Create a basic payment request
510
+ */
511
+ static createPaymentRequest(amount, label, countryCode = 'US', currencyCode = 'USD') {
512
+ return {
513
+ countryCode,
514
+ currencyCode,
515
+ merchantCapabilities: ApplePayHelpers.getDefaultMerchantCapabilities(),
516
+ supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
517
+ total: ApplePayHelpers.createLineItem(label, amount),
518
+ };
519
+ }
520
+ /**
521
+ * Get current configuration
522
+ */
523
+ getApplePayConfig() {
524
+ return this.applePayConfig;
525
+ }
526
+ }
527
+
528
+ const ApplePaySkeleton = (props) => {
529
+ const { isLoading } = props;
530
+ if (!isLoading) {
531
+ return null;
532
+ }
533
+ return (h("div", { class: 'container-fluid p-0' }, h("div", { class: 'row mb-3' }, h("div", { class: 'col-12 align-content-center' }, h(Skeleton, { height: '44px', width: '100%', styles: { borderRadius: "8px" } })))));
534
+ };
535
+
536
+ const ProcessingSpinner = () => (h("div", { class: 'processing-overlay' }, h("div", { class: 'spinner' }), h("span", null, "Processing...")));
537
+ const ApplePayButton = (props) => {
538
+ const getApplePayButtonClass = () => {
539
+ let classes = "apple-pay-button";
540
+ switch (props.buttonStyle) {
541
+ case ApplePayButtonStyle.WHITE:
542
+ classes += " apple-pay-button-white";
543
+ break;
544
+ case ApplePayButtonStyle.WHITE_OUTLINE:
545
+ classes += " apple-pay-button-white-outline";
546
+ break;
547
+ case ApplePayButtonStyle.BLACK:
548
+ default:
549
+ classes += " apple-pay-button-black";
550
+ break;
551
+ }
552
+ switch (props.buttonType) {
553
+ case ApplePayButtonType.BUY:
554
+ classes += " apple-pay-button-type-buy";
555
+ break;
556
+ case ApplePayButtonType.DONATE:
557
+ classes += " apple-pay-button-type-donate";
558
+ break;
559
+ case ApplePayButtonType.PLAIN:
560
+ default:
561
+ classes += " apple-pay-button-type-plain";
562
+ break;
563
+ }
564
+ if (props.disabled || props.isProcessing || !props.isAvailable) {
565
+ classes += " disabled";
566
+ }
567
+ return classes;
568
+ };
569
+ const handleClick = () => {
570
+ if (!props.disabled &&
571
+ !props.isProcessing &&
572
+ props.isAvailable &&
573
+ props.clickHandler) {
574
+ props.clickHandler();
575
+ }
576
+ };
577
+ return (h("div", { class: 'apple-pay-button-container' }, h("button", Object.assign({ class: getApplePayButtonClass(), style: {
578
+ width: props.width,
579
+ height: props.height,
580
+ }, onClick: handleClick, disabled: props.disabled || props.isProcessing || !props.isAvailable, "aria-label": 'Pay with Apple Pay', type: 'button' }, props), props.isProcessing && ProcessingSpinner()), h("style", null, `
581
+ .apple-pay-button-container {
582
+ display: inline-block;
583
+ position: relative;
584
+ }
585
+
586
+ /* Apple Pay CSS classes - these are the official Apple Pay button styles */
587
+ .apple-pay-button {
588
+ display: inline-block;
589
+ -webkit-appearance: -apple-pay-button;
590
+ -apple-pay-button-type: plain; /* default */
591
+ -apple-pay-button-style: black; /* default */
592
+ border-radius: 8px;
593
+ cursor: pointer;
594
+ border: none;
595
+ outline: none;
596
+ transition: opacity 0.2s ease;
597
+ position: relative;
598
+ }
599
+
600
+ /* Button styles */
601
+ .apple-pay-button.apple-pay-button-black {
602
+ -apple-pay-button-style: black;
603
+ }
604
+
605
+ .apple-pay-button.apple-pay-button-white {
606
+ -apple-pay-button-style: white;
607
+ }
608
+
609
+ .apple-pay-button.apple-pay-button-white-outline {
610
+ -apple-pay-button-style: white-outline;
611
+ }
612
+
613
+ /* Button types */
614
+ .apple-pay-button.apple-pay-button-type-plain {
615
+ -apple-pay-button-type: plain;
616
+ }
617
+
618
+ .apple-pay-button.apple-pay-button-type-buy {
619
+ -apple-pay-button-type: buy;
620
+ }
621
+
622
+ .apple-pay-button.apple-pay-button-type-donate {
623
+ -apple-pay-button-type: donate;
624
+ }
625
+
626
+ /* Hover and disabled states */
627
+ .apple-pay-button:hover:not(.disabled) {
628
+ opacity: 0.9;
629
+ }
630
+
631
+ .apple-pay-button.disabled {
632
+ opacity: 0.5;
633
+ cursor: not-allowed;
634
+ }
635
+
636
+ /* Processing overlay */
637
+ .processing-overlay {
638
+ position: absolute;
639
+ top: 0;
640
+ left: 0;
641
+ right: 0;
642
+ bottom: 0;
643
+ display: flex;
644
+ align-items: center;
645
+ justify-content: center;
646
+ gap: 8px;
647
+ background: rgba(0, 0, 0, 0.8);
648
+ color: white;
649
+ border-radius: 8px;
650
+ font-size: 14px;
651
+ font-weight: 500;
652
+ }
653
+
654
+ .spinner {
655
+ width: 16px;
656
+ height: 16px;
657
+ border: 2px solid rgba(255, 255, 255, 0.3);
658
+ border-top: 2px solid #fff;
659
+ border-radius: 50%;
660
+ animation: spin 1s linear infinite;
661
+ }
662
+
663
+ @keyframes spin {
664
+ 0% { transform: rotate(0deg); }
665
+ 100% { transform: rotate(360deg); }
666
+ }
667
+
668
+ /* Responsive design */
669
+ @media (max-width: 480px) {
670
+ .apple-pay-button {
671
+ width: 100% !important;
672
+ min-width: 200px;
673
+ }
674
+ }
675
+ `)));
676
+ };
677
+
678
+ const ApplePay = class {
679
+ constructor(hostRef) {
680
+ registerInstance(this, hostRef);
681
+ this.applePayStarted = createEvent(this, "applePayStarted");
682
+ this.applePayCompleted = createEvent(this, "applePayCompleted");
683
+ this.applePayCancelled = createEvent(this, "applePayCancelled");
684
+ this.applePayError = createEvent(this, "applePayError");
685
+ this.countryCode = "US";
686
+ this.merchantIdentifier = "merchant.com.staging-justifi.checkout-dev";
687
+ this.merchantDisplayName = "JustiFi Checkout";
688
+ this.initiativeContext = "dev-checkout.justifi-staging.com";
689
+ this.buttonType = ApplePayButtonType.PLAIN;
690
+ this.buttonStyle = ApplePayButtonStyle.BLACK;
691
+ this.disabled = false;
692
+ this.showSkeleton = true;
693
+ this.width = "100%";
694
+ this.height = "48px";
695
+ this.isLoading = true;
696
+ this.isProcessing = false;
697
+ this.isAvailable = false;
698
+ this.canMakePayments = false;
699
+ this.isConfigValid = true;
700
+ this.error = null;
701
+ this.handleApplePayClick = async () => {
702
+ var _a, _b;
703
+ if (this.isProcessing || this.disabled || !this.isAvailable) {
704
+ return;
705
+ }
706
+ try {
707
+ this.isProcessing = true;
708
+ this.error = null;
709
+ this.applePayStarted.emit();
710
+ console.groupCollapsed('[ApplePay Component] handleApplePayClick');
711
+ console.log('[ApplePay Component] click context:', {
712
+ isProcessing: this.isProcessing,
713
+ disabled: this.disabled,
714
+ isAvailable: this.isAvailable,
715
+ canMakePayments: this.canMakePayments,
716
+ hasService: Boolean(this.applePayService),
717
+ });
718
+ const paymentRequest = {
719
+ countryCode: this.countryCode,
720
+ currencyCode: checkoutStore.paymentCurrency,
721
+ merchantCapabilities: [
722
+ ApplePayMerchantCapability.SUPPORTS_3DS,
723
+ ApplePayMerchantCapability.SUPPORTS_CREDIT,
724
+ ApplePayMerchantCapability.SUPPORTS_DEBIT,
725
+ ],
726
+ supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
727
+ total: ApplePayHelpers.createLineItem(checkoutStore.paymentDescription, checkoutStore.paymentAmount),
728
+ };
729
+ console.log("[ApplePay Component] paymentRequest", paymentRequest);
730
+ console.log('[ApplePay Component] identifiers snapshot:', {
731
+ authTokenLength: checkoutStore.authToken ? String(checkoutStore.authToken).length : 0,
732
+ accountId: checkoutStore.accountId,
733
+ });
734
+ const result = await this.applePayService.startPaymentSession(paymentRequest, checkoutStore.authToken, checkoutStore.accountId);
735
+ console.log("[ApplePay Component] startPaymentSession result", result);
736
+ if (result.success) {
737
+ this.applePayCompleted.emit({
738
+ success: true,
739
+ token: result.token,
740
+ paymentMethodId: result.paymentMethodId,
741
+ });
742
+ }
743
+ else {
744
+ this.applePayCompleted.emit({
745
+ success: false,
746
+ error: result.error,
747
+ });
748
+ this.applePayError.emit({
749
+ error: ((_a = result.error) === null || _a === void 0 ? void 0 : _a.message) || "Payment failed",
750
+ code: ((_b = result.error) === null || _b === void 0 ? void 0 : _b.code) || ApplePay.ErrorCode.PAYMENT_FAILED,
751
+ });
752
+ }
753
+ }
754
+ catch (error) {
755
+ const errorMessage = error instanceof Error ? error.message : "Payment failed";
756
+ this.error = errorMessage;
757
+ this.applePayError.emit({ error: errorMessage, code: ApplePay.ErrorCode.PAYMENT_FAILED });
758
+ this.applePayCompleted.emit({
759
+ success: false,
760
+ error: errorMessage,
761
+ });
762
+ }
763
+ finally {
764
+ this.isProcessing = false;
765
+ console.groupEnd();
766
+ }
767
+ };
768
+ }
769
+ async initializeApplePay() {
770
+ try {
771
+ this.isLoading = true;
772
+ this.error = null;
773
+ this.isConfigValid = true;
774
+ console.groupCollapsed('[ApplePay Component] initializeApplePay');
775
+ console.log('[ApplePay Component] checkout state snapshot:', {
776
+ paymentAmount: checkoutStore.paymentAmount,
777
+ paymentCurrency: checkoutStore.paymentCurrency,
778
+ hasAuthToken: Boolean(checkoutStore.authToken),
779
+ accountId: checkoutStore.accountId,
780
+ });
781
+ const hasRequiredConfig = Boolean(checkoutStore.paymentAmount) &&
782
+ Boolean(checkoutStore.paymentCurrency) &&
783
+ Boolean(checkoutStore.authToken);
784
+ if (!hasRequiredConfig) {
785
+ this.error = "Missing required Apple Pay configuration";
786
+ this.isConfigValid = false;
787
+ console.error("Apple Pay config error: missing required values", {
788
+ paymentAmount: checkoutStore.paymentAmount,
789
+ paymentCurrency: checkoutStore.paymentCurrency,
790
+ hasAuthToken: Boolean(checkoutStore.authToken),
791
+ accountId: checkoutStore.accountId,
792
+ });
793
+ this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.CONFIG_ERROR });
794
+ this.isLoading = false;
795
+ console.groupEnd();
796
+ return;
797
+ }
798
+ this.isAvailable = ApplePayHelpers.isApplePaySupported();
799
+ this.canMakePayments = ApplePayHelpers.canMakePayments();
800
+ console.log('[ApplePay Component] support check:', {
801
+ isAvailable: this.isAvailable,
802
+ canMakePayments: this.canMakePayments,
803
+ hasApplePaySessionOnWindow: typeof window !== 'undefined' && 'ApplePaySession' in window,
804
+ });
805
+ if (!this.isAvailable) {
806
+ this.error = "Apple Pay is not supported on this device";
807
+ console.error(this.error);
808
+ this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_SUPPORTED });
809
+ this.isLoading = false;
810
+ console.groupEnd();
811
+ return;
812
+ }
813
+ if (!this.canMakePayments) {
814
+ this.error = "Apple Pay is not available";
815
+ console.error(this.error);
816
+ this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_AVAILABLE });
817
+ this.isLoading = false;
818
+ console.groupEnd();
819
+ return;
820
+ }
821
+ const applePayConfig = {
822
+ merchantIdentifier: this.merchantIdentifier,
823
+ displayName: this.merchantDisplayName,
824
+ initiative: "web",
825
+ initiativeContext: this.initiativeContext,
826
+ buttonType: this.buttonType,
827
+ buttonStyle: this.buttonStyle,
828
+ };
829
+ console.log('[ApplePay Component] initializing service with config:', applePayConfig);
830
+ this.applePayService = new ApplePayService();
831
+ this.applePayService.initialize(applePayConfig);
832
+ const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
833
+ if (!hasActiveCard) {
834
+ console.warn("No Apple Pay cards available, but continuing...");
835
+ }
836
+ }
837
+ catch (error) {
838
+ console.error("Apple Pay initialization error:", error);
839
+ this.error =
840
+ error instanceof Error
841
+ ? error.message
842
+ : "Failed to initialize Apple Pay";
843
+ this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.INITIALIZATION_ERROR });
844
+ }
845
+ finally {
846
+ this.isLoading = false;
847
+ console.groupEnd();
848
+ }
849
+ }
850
+ async isSupported() {
851
+ return this.isAvailable && this.canMakePayments;
852
+ }
853
+ async getPaymentMethods() {
854
+ if (!this.isAvailable) {
855
+ return [];
856
+ }
857
+ return ApplePayHelpers.getDefaultSupportedNetworks();
858
+ }
859
+ async abort() {
860
+ this.applePayService.abortPaymentSession();
861
+ this.isProcessing = false;
862
+ this.applePayCancelled.emit();
863
+ }
864
+ render() {
865
+ if (!checkoutStore.applePayEnabled) {
866
+ // Render nothing when Apple Pay is disabled at the checkout settings level
867
+ console.log('[ApplePay Component] Apple Pay disabled in checkout settings; not rendering');
868
+ return null;
869
+ }
870
+ const isReady = !this.isLoading &&
871
+ this.isAvailable &&
872
+ this.canMakePayments &&
873
+ this.isConfigValid;
874
+ return (h(StyledHost, null, checkoutStore.checkoutLoaded && (h("script", { async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
875
+ console.log('[ApplePay Component] Apple Pay SDK script loaded');
876
+ this.initializeApplePay();
877
+ } })), 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, `
878
+ .apple-pay-container {
879
+ width: 100%;
880
+ }
881
+ `)));
882
+ }
883
+ };
884
+ // Centralized error codes for the Apple Pay component layer
885
+ ApplePay.ErrorCode = {
886
+ CONFIG_ERROR: 'CONFIG_ERROR',
887
+ NOT_SUPPORTED: 'NOT_SUPPORTED',
888
+ NOT_AVAILABLE: 'NOT_AVAILABLE',
889
+ INITIALIZATION_ERROR: 'INITIALIZATION_ERROR',
890
+ PAYMENT_FAILED: 'PAYMENT_FAILED',
891
+ };
892
+
28
893
  const Summary = class {
29
894
  constructor(hostRef) {
30
895
  registerInstance(this, hostRef);
31
896
  }
32
897
  render() {
33
- return (h(StyledHost, { key: '3161e6f6a196c79d684574cafbc90bcf741b2150' }, h("section", { key: '594b4485ed4fd9d7c1ee7f4556f071139f92ef0c' }, h("div", { key: '5c2d14677dda6fc7ddcb074d4887b839385dca3a' }, h("div", { key: 'fb850cd7e9c11741349710696dd4e6241c98e805', part: text }, checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.paymentDescription), h("div", { key: '959014d7fa2a9c97bae0c986313a604930c1e0f3' }, h("span", { key: '14ab0932a083568419b1c36c95f9072c73962b11', part: text }, "Total"), "\u00A0", h("span", { key: '08a9e00332253070ae984b77eb2a9bab88eb3472', part: text }, formatCurrency(+(checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.totalAmount))))))));
898
+ return (h(StyledHost, { key: 'abd92b499208321582b08a490c78c9167be2ebd4' }, h("section", { key: '38e15cef5a19a43249d7ecf3d4eb4ea8e032f248' }, h("div", { key: '747f811012ed9707265369e59dbde8cd7ad3bca6' }, h("div", { key: '8575f50759664d5c64d235025699c81f055267ca', part: text }, checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.paymentDescription), h("div", { key: 'af77776bbe21bce77586447bbf445e4c5d8c1165' }, h("span", { key: '5cdaaec454118197b3e37a942d83907e72444342', part: text }, "Total"), "\u00A0", h("span", { key: 'ccc35217ac9740d5a00b7abbcec4133848afcc28', part: text }, formatCurrency(+(checkoutStore === null || checkoutStore === void 0 ? void 0 : checkoutStore.totalAmount))))))));
34
899
  }
35
900
  };
36
901
 
@@ -46,7 +911,7 @@ const Header = class {
46
911
  }
47
912
  render() {
48
913
  const HeaderComponent = this.levels[this.level];
49
- return (h(StyledHost, { key: 'eb3651b698897193d34a6c6456cd57dd0bd0bc43' }, h(HeaderComponent, { key: '39caee687f93d3d4d90e62d9fbcae318eaa8022e', text: this.text, class: this.class })));
914
+ return (h(StyledHost, { key: 'e1d39365c2ff2c291a42b53d6bcbe1d97d602778' }, h(HeaderComponent, { key: '0b8c8c3a42ff2151e3b293cafeeaeda72e94d767', text: this.text, class: this.class })));
50
915
  }
51
916
  };
52
917
 
@@ -248,7 +1113,7 @@ const ModularCheckout = class {
248
1113
  }
249
1114
  }
250
1115
  updateStore(checkout) {
251
- var _a, _b, _c, _d, _e;
1116
+ var _a, _b, _c, _d, _e, _f;
252
1117
  checkoutStore.accountId = checkout.account_id;
253
1118
  checkoutStore.checkoutLoaded = true;
254
1119
  checkoutStore.paymentMethods = checkout.payment_methods.map((paymentMethod) => new PaymentMethod(paymentMethod));
@@ -259,11 +1124,12 @@ const ModularCheckout = class {
259
1124
  checkoutStore.bnplEnabled = checkout.payment_settings.bnpl_payments;
260
1125
  checkoutStore.insuranceEnabled = checkout.payment_settings.insurance_payments;
261
1126
  checkoutStore.bankAccountVerification = (_a = checkout.payment_settings) === null || _a === void 0 ? void 0 : _a.bank_account_verification;
262
- checkoutStore.bnplProviderClientId = (_b = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _b === void 0 ? void 0 : _b.provider_client_id;
263
- checkoutStore.bnplProviderMode = (_c = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _c === void 0 ? void 0 : _c.provider_mode;
264
- checkoutStore.bnplProviderApiVersion = (_d = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _d === void 0 ? void 0 : _d.provider_api_version;
1127
+ checkoutStore.applePayEnabled = Boolean((_b = checkout.payment_settings) === null || _b === void 0 ? void 0 : _b.apple_payments);
1128
+ checkoutStore.bnplProviderClientId = (_c = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _c === void 0 ? void 0 : _c.provider_client_id;
1129
+ checkoutStore.bnplProviderMode = (_d = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _d === void 0 ? void 0 : _d.provider_mode;
1130
+ checkoutStore.bnplProviderApiVersion = (_e = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _e === void 0 ? void 0 : _e.provider_api_version;
265
1131
  checkoutStore.bnplProviderCheckoutUrl =
266
- (_e = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _e === void 0 ? void 0 : _e.provider_checkout_url;
1132
+ (_f = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _f === void 0 ? void 0 : _f.provider_checkout_url;
267
1133
  }
268
1134
  emitCheckoutChanged() {
269
1135
  const detail = {
@@ -474,7 +1340,7 @@ const ModularCheckout = class {
474
1340
  });
475
1341
  }
476
1342
  render() {
477
- return h(Host, { key: 'dbe1fe78f8206fef2e3f4f51628d716786dea858' });
1343
+ return h(Host, { key: '63acafa8f4819ac63e564807779976e352ccbdfb' });
478
1344
  }
479
1345
  get hostEl() { return getElement(this); }
480
1346
  };
@@ -1415,7 +2281,7 @@ const TokenizePaymentMethod = class {
1415
2281
  return paymentMethodType === PAYMENT_METHODS.NEW_CARD ? (h("justifi-card-form", { ref: (el) => (this.paymentMethodFormRef = el) })) : (h("justifi-bank-account-form", { ref: (el) => (this.paymentMethodFormRef = el) }));
1416
2282
  }
1417
2283
  render() {
1418
- return (h(StyledHost, { key: '5fc5dad15215fe24b421f4d6c13355fb849b8a76' }, h("form", { key: '0e0330e5b11ee3ae0bef9e092fa2fb2a0a6af3e7' }, h("fieldset", { key: 'ee4c026ccda62a249e019a9e105e40ea465fc400' }, h("div", { key: '15a8a86fa5be8a545745260d76a8c3b2569d6a0e', class: "row gy-3" }, h("div", { key: 'bbbeed6ee96311394a876b4beb206e8e335184c2', class: "col-12" }, this.availablePaymentMethods.map((method) => this.renderPaymentMethodOption(method))), h("div", { key: 'da2a2009abe4348e25a5fc712557e81e9f6c4c1f', class: "col-12" }, h("justifi-button", { key: '050939c757999383226f281ee0eff1ec178be203', text: this.submitButtonText, variant: "primary", type: "submit", clickHandler: (e) => this.tokenizePaymentMethod(e), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.computedHideSubmitButton })))))));
2284
+ return (h(StyledHost, { key: 'bf221d17739bf70c3f581f3b9791a725e76c3f35' }, h("form", { key: 'df117d42d4160f31df1fca5d6903967cc48ad573' }, h("fieldset", { key: '550e670feffb405c669d44c44eb9073f535c6cb6' }, h("div", { key: '8eff7d3ab19618da54161220b92641bf19bfa82d', class: "row gy-3" }, h("div", { key: 'bf9d19e92be74abf48ce65c97efb3f9df52d4c3c', class: "col-12" }, this.availablePaymentMethods.map((method) => this.renderPaymentMethodOption(method))), h("div", { key: 'eef1f4e1e03c2263efb51ae94085c5a3d73a9166', class: "col-12" }, h("justifi-button", { key: 'f0e5697e658236610da45c34e64a8cbb3f0f9d95', text: this.submitButtonText, variant: "primary", type: "submit", clickHandler: (e) => this.tokenizePaymentMethod(e), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.computedHideSubmitButton })))))));
1419
2285
  }
1420
2286
  get host() { return getElement(this); }
1421
2287
  static get watchers() { return {
@@ -1424,4 +2290,4 @@ const TokenizePaymentMethod = class {
1424
2290
  }; }
1425
2291
  };
1426
2292
 
1427
- export { Summary as justifi_checkout_summary, Header as justifi_header, ModularCheckout as justifi_modular_checkout, PlaidPaymentMethod as justifi_plaid_payment_method, SavedPaymentMethods as justifi_saved_payment_methods, SezzlePaymentMethod as justifi_sezzle_payment_method, TokenizePaymentMethod as justifi_tokenize_payment_method };
2293
+ export { ApplePay as justifi_apple_pay, Summary as justifi_checkout_summary, Header as justifi_header, ModularCheckout as justifi_modular_checkout, PlaidPaymentMethod as justifi_plaid_payment_method, SavedPaymentMethods as justifi_saved_payment_methods, SezzlePaymentMethod as justifi_sezzle_payment_method, TokenizePaymentMethod as justifi_tokenize_payment_method };