@justifi/webcomponents 5.4.4 → 5.5.0

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 (838) hide show
  1. package/dist/cjs/Api-KMweahmp.js +74 -0
  2. package/dist/cjs/{Business-d88b77fd.js → Business-DyiDiIuO.js} +1 -1
  3. package/dist/cjs/{Checkout-5352009d.js → Checkout-RAGvjVPj.js} +1 -1
  4. package/dist/cjs/{ComponentError-233ac749.js → ComponentError-C4MdBBMe.js} +1 -0
  5. package/dist/cjs/{Payment-bccd8f7d.js → Payment-CQCmj3Ck.js} +2 -2
  6. package/dist/cjs/{SubAccount-2a302ead.js → Refund-DpKGhW3o.js} +25 -1
  7. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +10 -0
  8. package/dist/cjs/additional-questions-details_5.cjs.entry.js +5 -11
  9. package/dist/cjs/{badge-364e6311.js → badge-BXpCpcer.js} +2 -2
  10. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +25 -43
  11. package/dist/cjs/bank-account-form_9.cjs.entry.js +93 -97
  12. package/dist/cjs/{business-additional-questions-schema-8568cb79.js → business-additional-questions-schema-mzZ2gYHQ.js} +2 -2
  13. package/dist/cjs/business-details-core.cjs.entry.js +6 -10
  14. package/dist/cjs/{business-form-options-62e9c8ab.js → business-form-options-BCj0efiD.js} +1 -1
  15. package/dist/cjs/{business-identity-schema-518ab6eb.js → business-identity-schema-dt0zCW0R.js} +2 -2
  16. package/dist/cjs/{business.service-6e8a29a2.js → business.service-Crmkeulk.js} +23 -8
  17. package/dist/cjs/{button-4a9fd41e.js → button-KWTLx2LP.js} +2 -2
  18. package/dist/cjs/{check-pkg-version-e6dcbeb7.js → check-pkg-version-CLsX6cK5.js} +3 -3
  19. package/dist/cjs/{checkout.service-0a7835dc.js → checkout.service-r90INf2g.js} +13 -10
  20. package/dist/cjs/checkouts-list-core.cjs.entry.js +25 -31
  21. package/dist/cjs/{payments-list-params-state-442d9944.js → checkouts-list-params-state-Cmfy_CND.js} +1 -1
  22. package/dist/cjs/{checkouts-table-8a1b49ff.js → checkouts-table-5jU4JUcM.js} +4 -4
  23. package/dist/cjs/custom-popper_4.cjs.entry.js +27 -52
  24. package/dist/cjs/{dispute.service-6efc7d7f.js → dispute.service-CGgfmGU-.js} +20 -11
  25. package/dist/cjs/{event-types-5a6ce2b0.js → event-types-CJapDsYA.js} +3 -3
  26. package/dist/cjs/form-alert_5.cjs.entry.js +10 -19
  27. package/dist/cjs/form-control-checkbox.cjs.entry.js +9 -18
  28. package/dist/cjs/form-control-date.cjs.entry.js +9 -19
  29. package/dist/cjs/{form-control-error-text-3cff9b7b.js → form-control-error-text-D19AMaOO.js} +2 -2
  30. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +11 -30
  31. package/dist/cjs/{form-control-help-text-94ffed2c.js → form-control-help-text-CbrDvt9D.js} +2 -2
  32. package/dist/cjs/form-control-help-text.cjs.entry.js +1 -5
  33. package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +13 -22
  34. package/dist/cjs/form-control-monetary.cjs.entry.js +13 -22
  35. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +12 -25
  36. package/dist/cjs/form-control-number.cjs.entry.js +9 -18
  37. package/dist/cjs/form-control-radio.cjs.entry.js +7 -17
  38. package/dist/cjs/{get-business-d8f5db51.js → get-business-BBzGEPBG.js} +3 -3
  39. package/dist/cjs/get-payment-details-CKg1Lb3_.js +42 -0
  40. package/dist/cjs/{get-payout-csv-7607c71e.js → get-payout-csv-DD9C5yMw.js} +11 -11
  41. package/dist/cjs/{get-subaccounts-ae5b35a8.js → get-subaccounts-YlFT-fBr.js} +11 -10
  42. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +262 -270
  43. package/dist/cjs/{header-1-43b2b905.js → header-1-ZNnpq6yT.js} +2 -2
  44. package/dist/cjs/{header-3-eb250a04.js → header-3-D6LxdW_A.js} +2 -2
  45. package/dist/cjs/{helpers-602962eb.js → helpers-B5OCqlIM.js} +1 -1
  46. package/dist/cjs/{iframe-input-styles-state-d0de0b24.js → iframe-input-styles-state-CQL59u0d.js} +2 -2
  47. package/dist/cjs/iframe-input.cjs.entry.js +1640 -0
  48. package/dist/cjs/{index-750475a3.js → index-1MT3Z4XI.js} +1 -1
  49. package/dist/cjs/{index-d2d0b181.js → index-DhcqPIbT.js} +4 -5
  50. package/dist/cjs/{index-5b9a3b5f.js → index-DtkhH7sB.js} +460 -271
  51. package/dist/cjs/index.esm-CVuJLXJZ.js +11807 -0
  52. package/dist/cjs/{input-handlers-cff032bb.js → input-handlers-DYl_0IwC.js} +1 -1
  53. package/dist/cjs/{insurance-state-71f8b653.js → insurance-state-q5eNmjIK.js} +3 -3
  54. package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +64 -94
  55. package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +36 -86
  56. package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +36 -54
  57. package/dist/cjs/justifi-business-details.cjs.entry.js +16 -20
  58. package/dist/cjs/justifi-business-form.cjs.entry.js +34 -38
  59. package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +6 -11
  60. package/dist/cjs/justifi-checkout-core.cjs.entry.js +31 -34
  61. package/dist/cjs/justifi-checkout.cjs.entry.js +23 -29
  62. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +15 -18
  63. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +25 -30
  64. package/dist/cjs/justifi-details.cjs.entry.js +3 -6
  65. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +5 -11
  66. package/dist/cjs/justifi-dispute-management.cjs.entry.js +19 -23
  67. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +38 -52
  68. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +13 -16
  69. package/dist/cjs/justifi-order-terminals.cjs.entry.js +29 -37
  70. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +29 -52
  71. package/dist/cjs/justifi-payment-details.cjs.entry.js +24 -52
  72. package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +15 -23
  73. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +15 -16
  74. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +11 -17
  75. package/dist/cjs/justifi-payments-list.cjs.entry.js +25 -29
  76. package/dist/cjs/justifi-payout-details.cjs.entry.js +21 -26
  77. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +9 -12
  78. package/dist/cjs/justifi-payouts-list.cjs.entry.js +27 -33
  79. package/dist/cjs/justifi-refund-payment.cjs.entry.js +189 -69
  80. package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +10 -27
  81. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +24 -35
  82. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +24 -26
  83. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +29 -29
  84. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +21 -25
  85. package/dist/cjs/justifi-terminals-list.cjs.entry.js +26 -31
  86. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +24 -28
  87. package/dist/cjs/loader.cjs.js +3 -5
  88. package/dist/cjs/lodash-CvSCBJ_8.js +17216 -0
  89. package/dist/cjs/package-5B4P3NpD.js +9 -0
  90. package/dist/cjs/pagination-menu.cjs.entry.js +3 -5
  91. package/dist/cjs/{parts-5ca90f9a.js → parts-D_uKOPFe.js} +3 -1
  92. package/dist/cjs/payment-details-core.cjs.entry.js +19 -22
  93. package/dist/cjs/{payment-provisioning-actions-382ab48c.js → payment-provisioning-actions-BkWSDJQQ.js} +2 -2
  94. package/dist/cjs/payment.service-BrHUGHYs.js +23 -0
  95. package/dist/cjs/payments-list-core.cjs.entry.js +25 -30
  96. package/dist/cjs/{terminal-orders-list-params-state-c419078f.js → payments-list-params-state-Cmfy_CND.js} +1 -1
  97. package/dist/cjs/{payments-status-075aad0a.js → payments-status-DAzq_Z13.js} +2 -2
  98. package/dist/cjs/{payments-table-a076755a.js → payments-table-BEpL6oJQ.js} +4 -4
  99. package/dist/cjs/payout-details-core.cjs.entry.js +14 -18
  100. package/dist/cjs/payouts-list-core.cjs.entry.js +26 -33
  101. package/dist/cjs/{checkouts-list-params-state-644d3639.js → payouts-list-params-state-Cmfy_CND.js} +1 -1
  102. package/dist/cjs/{payouts-status-ced97c2b.js → payouts-status-CYrKPRld.js} +2 -2
  103. package/dist/cjs/{payouts-table-aedce326.js → payouts-table-Bbi23U5v.js} +4 -4
  104. package/dist/cjs/{schema-validations-a7cefbdf.js → schema-validations-p4OCdblz.js} +4 -4
  105. package/dist/cjs/{skeleton-e8aa41d0.js → skeleton-C59M0QK2.js} +2 -2
  106. package/dist/cjs/{spinner-580453f2.js → spinner-736baCoH.js} +2 -2
  107. package/dist/cjs/{styled-host-94309bab.js → styled-host-JifnTMIV.js} +2 -3
  108. package/dist/cjs/table-filters-menu.cjs.entry.js +4 -10
  109. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +24 -29
  110. package/dist/cjs/{payouts-list-params-state-033b76d6.js → terminal-orders-list-params-state-Cmfy_CND.js} +1 -1
  111. package/dist/cjs/{terminal-orders-table-3b247193.js → terminal-orders-table-w4Yaf83b.js} +35 -5
  112. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +6 -12
  113. package/dist/cjs/{terminal.service-ab62c344.js → terminal.service-BjSo5Cm4.js} +11 -11
  114. package/dist/cjs/terminals-list-core.cjs.entry.js +25 -31
  115. package/dist/cjs/terminals-list-params-state-Cmfy_CND.js +22 -0
  116. package/dist/cjs/{terminals-table-594643fd.js → terminals-table-F6pkR97i.js} +4 -4
  117. package/dist/cjs/{utils-f8714daa.js → utils-D3seTk2e.js} +2 -2
  118. package/dist/cjs/utils-DmZ8Dia3.js +23987 -0
  119. package/dist/cjs/{utils-7a478c37.js → utils-l0veqT9y.js} +1 -1
  120. package/dist/cjs/webcomponents.cjs.js +7 -7
  121. package/dist/collection/actions/payment/get-payment-details.js +5 -2
  122. package/dist/collection/actions/refund/refund-actions.js +31 -0
  123. package/dist/collection/api/Api.js +32 -13
  124. package/dist/collection/api/ComponentError.js +1 -0
  125. package/dist/collection/api/Refund.js +32 -0
  126. package/dist/collection/api/TerminalOrder.js +3 -0
  127. package/dist/collection/api/index.js +1 -0
  128. package/dist/collection/api/services/analytics.service.js +1 -1
  129. package/dist/collection/api/services/business.service.js +22 -7
  130. package/dist/collection/api/services/checkout.service.js +6 -3
  131. package/dist/collection/api/services/dispute.service.js +13 -4
  132. package/dist/collection/api/services/insurance.service.js +8 -2
  133. package/dist/collection/api/services/payment.service.js +3 -3
  134. package/dist/collection/api/services/payout.service.js +3 -3
  135. package/dist/collection/api/services/provision.service.js +4 -1
  136. package/dist/collection/api/services/refund.service.js +10 -0
  137. package/dist/collection/api/services/reports.service.js +1 -1
  138. package/dist/collection/api/services/subaccounts.service.js +1 -1
  139. package/dist/collection/api/services/terminal.service.js +4 -4
  140. package/dist/collection/api/services/terminal_orders.service.js +5 -1
  141. package/dist/collection/collection-manifest.json +3 -5
  142. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +4 -4
  143. package/dist/collection/components/business-details/business-details-core.js +4 -3
  144. package/dist/collection/components/business-details/business-details.js +6 -8
  145. package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +4 -4
  146. package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +4 -4
  147. package/dist/collection/components/business-details/owner-details/owner-details.js +4 -4
  148. package/dist/collection/components/business-details/representative-details/representative-details.js +4 -4
  149. package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +4 -2
  150. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +4 -2
  151. package/dist/collection/components/business-forms/business-form/business-form.js +20 -13
  152. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +6 -4
  153. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -3
  154. package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +11 -7
  155. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +34 -22
  156. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +10 -6
  157. package/dist/collection/components/business-forms/owner-form/owner-form.js +22 -19
  158. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +15 -11
  159. package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +9 -10
  160. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +11 -8
  161. package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +13 -10
  162. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step-core.js +23 -16
  163. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +9 -12
  164. package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-documents-on-file.js +6 -2
  165. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +17 -12
  166. package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +9 -10
  167. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +20 -14
  168. package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +9 -10
  169. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +10 -6
  170. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +14 -10
  171. package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +9 -10
  172. package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +31 -21
  173. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +14 -10
  174. package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +9 -10
  175. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +24 -16
  176. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +20 -14
  177. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +21 -12
  178. package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +12 -8
  179. package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +13 -13
  180. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +3 -2
  181. package/dist/collection/components/checkout/billing-form/billing-form-schema.js +21 -0
  182. package/dist/collection/components/checkout/billing-form/billing-form.js +203 -0
  183. package/dist/collection/components/checkout/card-form/card-form.js +5 -4
  184. package/dist/collection/components/checkout/checkout-core.js +88 -37
  185. package/dist/collection/components/checkout/checkout.js +70 -28
  186. package/dist/collection/components/checkout/new-payment-method.js +110 -30
  187. package/dist/collection/components/checkout/payment-method-options.js +91 -36
  188. package/dist/collection/components/checkout/saved-payment-method.js +7 -4
  189. package/dist/collection/components/checkout/sezzle-payment-method.js +19 -15
  190. package/dist/collection/components/checkouts-list/checkouts-list-core.js +17 -14
  191. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +7 -5
  192. package/dist/collection/components/checkouts-list/checkouts-list.js +16 -12
  193. package/dist/collection/components/dispute-management/dispute-management-core.js +11 -8
  194. package/dist/collection/components/dispute-management/dispute-management.js +12 -9
  195. package/dist/collection/components/dispute-management/dispute-notification.js +11 -9
  196. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +10 -9
  197. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +10 -8
  198. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +10 -8
  199. package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +21 -14
  200. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +16 -13
  201. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +10 -8
  202. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +10 -8
  203. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +10 -8
  204. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +10 -8
  205. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +10 -8
  206. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +5 -4
  207. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +7 -6
  208. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance-core.js +44 -30
  209. package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +40 -32
  210. package/dist/collection/components/order-terminals/order-terminals.js +19 -14
  211. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +19 -13
  212. package/dist/collection/components/payment-details/payment-details-core.js +13 -12
  213. package/dist/collection/components/payment-details/payment-details.js +29 -6
  214. package/dist/collection/components/payments-list/payments-list-core.js +12 -11
  215. package/dist/collection/components/payments-list/payments-list-filters.js +17 -12
  216. package/dist/collection/components/payments-list/payments-list.js +16 -11
  217. package/dist/collection/components/payout-details/payout-details-core.js +11 -8
  218. package/dist/collection/components/payout-details/payout-details.js +11 -9
  219. package/dist/collection/components/payouts-list/payouts-list-core.js +21 -16
  220. package/dist/collection/components/payouts-list/payouts-list-filters.js +8 -6
  221. package/dist/collection/components/payouts-list/payouts-list.js +16 -13
  222. package/dist/collection/components/refund-payment/refund-loading.js +6 -0
  223. package/dist/collection/components/refund-payment/refund-payment-schema.js +26 -11
  224. package/dist/collection/components/refund-payment/refund-payment.js +157 -57
  225. package/dist/collection/components/terminal-orders-list/terminal-order-status.js +15 -0
  226. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +12 -11
  227. package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +18 -11
  228. package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +16 -11
  229. package/dist/collection/components/terminal-orders-list/terminal-orders-table.js +11 -1
  230. package/dist/collection/components/terminals-list/terminals-list-core.js +17 -14
  231. package/dist/collection/components/terminals-list/terminals-list-filters.js +10 -7
  232. package/dist/collection/components/terminals-list/terminals-list.js +16 -12
  233. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +71 -19
  234. package/dist/collection/styles/parts.js +2 -1
  235. package/dist/collection/ui-components/custom-popper/custom-popper.js +19 -8
  236. package/dist/collection/ui-components/details/details.js +3 -4
  237. package/dist/collection/ui-components/filters/table-filters-menu.js +8 -7
  238. package/dist/collection/ui-components/form/form-control-checkbox.js +25 -17
  239. package/dist/collection/ui-components/form/form-control-date.js +32 -21
  240. package/dist/collection/ui-components/form/form-control-file-v2.js +23 -18
  241. package/dist/collection/ui-components/form/form-control-file.js +28 -21
  242. package/dist/collection/ui-components/form/form-control-monetary.js +35 -23
  243. package/dist/collection/ui-components/form/form-control-number-masked.js +28 -19
  244. package/dist/collection/ui-components/form/form-control-number.js +25 -17
  245. package/dist/collection/ui-components/form/form-control-radio.js +28 -19
  246. package/dist/collection/ui-components/form/form-control-select.js +29 -19
  247. package/dist/collection/ui-components/form/form-control-text.js +32 -21
  248. package/dist/collection/ui-components/form/form-control-textarea.js +32 -21
  249. package/dist/collection/ui-components/form/form-helpers/form-alert/form-alert.js +6 -6
  250. package/dist/collection/ui-components/form/form-helpers/form-control-help-text/form-control-help-text.js +6 -6
  251. package/dist/collection/ui-components/form/form-helpers/form-control-tooltip/form-control-tooltip.js +3 -6
  252. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  253. package/dist/collection/ui-components/form/iframe-input.js +14 -12
  254. package/dist/collection/ui-components/pagination-menu/pagination-menu.js +6 -0
  255. package/dist/collection/utils/utils.js +8 -0
  256. package/dist/docs.d.ts +8 -0
  257. package/dist/docs.json +1844 -905
  258. package/dist/esm/Api-C9CDE-UM.js +72 -0
  259. package/dist/esm/{Business-0855931c.js → Business-D6XNzizo.js} +2 -2
  260. package/dist/esm/{Checkout-18d8bf94.js → Checkout-Dfpql997.js} +1 -1
  261. package/dist/esm/{ComponentError-c61dce41.js → ComponentError-SdntD1xf.js} +2 -1
  262. package/dist/esm/{Document-1907c0d4.js → Document-Ct-uNz2r.js} +1 -1
  263. package/dist/esm/{Payment-806af354.js → Payment-BADkZFaz.js} +2 -2
  264. package/dist/esm/{SubAccount-7520271c.js → Refund-t_P1yy9d.js} +25 -2
  265. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +7 -0
  266. package/dist/esm/additional-questions-details_5.entry.js +5 -9
  267. package/dist/esm/{badge-1be14e8c.js → badge-C4TzL9CB.js} +3 -3
  268. package/dist/esm/bank-account-document-form-inputs_4.entry.js +25 -41
  269. package/dist/esm/bank-account-form_9.entry.js +91 -93
  270. package/dist/esm/{business-additional-questions-schema-56308a54.js → business-additional-questions-schema-W6okG5Xu.js} +2 -2
  271. package/dist/esm/business-details-core.entry.js +6 -8
  272. package/dist/esm/{business-form-options-86a13078.js → business-form-options-Bn05PRR4.js} +1 -1
  273. package/dist/esm/{business-identity-schema-24fcc4ef.js → business-identity-schema-lqdJS3MT.js} +2 -2
  274. package/dist/esm/{business.service-999196a4.js → business.service-B136meVo.js} +23 -8
  275. package/dist/esm/{button-fcee4da7.js → button-CI85Rqy5.js} +2 -2
  276. package/dist/esm/{check-pkg-version-47fc35a7.js → check-pkg-version-Wd4E_Njt.js} +3 -3
  277. package/dist/esm/{checkout.service-e38e477f.js → checkout.service-4tnXBKGq.js} +13 -10
  278. package/dist/esm/checkouts-list-core.entry.js +25 -29
  279. package/dist/esm/{checkouts-list-params-state-7bdf00bd.js → checkouts-list-params-state-Gbxdxjoi.js} +1 -1
  280. package/dist/esm/{checkouts-table-39a031a0.js → checkouts-table-CHM4YCCZ.js} +4 -4
  281. package/dist/esm/custom-popper_4.entry.js +27 -50
  282. package/dist/esm/{dispute.service-7ba6d5a4.js → dispute.service-Bwh8pBe9.js} +20 -11
  283. package/dist/esm/{event-types-1bc52f1f.js → event-types-CooIFpFI.js} +3 -3
  284. package/dist/esm/form-alert_5.entry.js +10 -17
  285. package/dist/esm/form-control-checkbox.entry.js +9 -16
  286. package/dist/esm/form-control-date.entry.js +9 -17
  287. package/dist/esm/{form-control-error-text-176d20d8.js → form-control-error-text-3q5yVuMQ.js} +2 -2
  288. package/dist/esm/form-control-file-v2_2.entry.js +11 -28
  289. package/dist/esm/{form-control-help-text-83764e14.js → form-control-help-text-BplkZkPF.js} +2 -2
  290. package/dist/esm/form-control-help-text.entry.js +1 -3
  291. package/dist/esm/form-control-monetary-provisioning.entry.js +13 -20
  292. package/dist/esm/form-control-monetary.entry.js +13 -20
  293. package/dist/esm/form-control-number-masked_2.entry.js +12 -23
  294. package/dist/esm/form-control-number.entry.js +9 -16
  295. package/dist/esm/form-control-radio.entry.js +7 -15
  296. package/dist/esm/{get-business-b7511690.js → get-business-B3c5gg1D.js} +3 -3
  297. package/dist/esm/get-payment-details-BbZmEGge.js +40 -0
  298. package/dist/esm/{get-payout-csv-fa34f40b.js → get-payout-csv-BKq22mOI.js} +11 -11
  299. package/dist/esm/{get-subaccounts-3c6b9e84.js → get-subaccounts-58LQOtEI.js} +10 -9
  300. package/dist/esm/gross-payment-chart-core.entry.js +262 -268
  301. package/dist/esm/{header-1-215a146f.js → header-1-BX6i3__G.js} +2 -2
  302. package/dist/esm/{header-3-afd16f23.js → header-3-D0Sy-7DJ.js} +2 -2
  303. package/dist/esm/{helpers-96ea3464.js → helpers-Mu7LQT-w.js} +2 -2
  304. package/dist/esm/{iframe-input-styles-state-ff730fe5.js → iframe-input-styles-state-DyXIZw1A.js} +3 -3
  305. package/dist/esm/iframe-input.entry.js +1638 -0
  306. package/dist/esm/{index-29fcfdf5.js → index-BUM1DfV9.js} +459 -250
  307. package/dist/esm/{index-d9a73ce3.js → index-Ce_F4E0f.js} +1 -1
  308. package/dist/esm/{index-a47fdc7f.js → index-Cuk6aIda.js} +4 -5
  309. package/dist/esm/index.esm-BCNUj0Dx.js +11801 -0
  310. package/dist/esm/{input-handlers-270ac806.js → input-handlers-CX6mSvOM.js} +1 -1
  311. package/dist/esm/{insurance-state-d2df8e88.js → insurance-state-BhklYgGK.js} +3 -3
  312. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +64 -92
  313. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +36 -84
  314. package/dist/esm/justifi-additional-statement_8.entry.js +36 -52
  315. package/dist/esm/justifi-business-details.entry.js +16 -18
  316. package/dist/esm/justifi-business-form.entry.js +34 -36
  317. package/dist/esm/justifi-business-representative-form-inputs.entry.js +6 -9
  318. package/dist/esm/justifi-checkout-core.entry.js +31 -32
  319. package/dist/esm/justifi-checkout.entry.js +23 -27
  320. package/dist/esm/justifi-checkouts-list-filters.entry.js +15 -16
  321. package/dist/esm/justifi-checkouts-list.entry.js +25 -28
  322. package/dist/esm/justifi-details.entry.js +3 -4
  323. package/dist/esm/justifi-dispute-management-core.entry.js +5 -9
  324. package/dist/esm/justifi-dispute-management.entry.js +19 -21
  325. package/dist/esm/justifi-dispute-notification_3.entry.js +38 -50
  326. package/dist/esm/justifi-gross-payment-chart.entry.js +13 -14
  327. package/dist/esm/justifi-order-terminals.entry.js +26 -32
  328. package/dist/esm/justifi-owner-form_3.entry.js +29 -50
  329. package/dist/esm/justifi-payment-details.entry.js +22 -48
  330. package/dist/esm/justifi-payment-provisioning-core.entry.js +15 -21
  331. package/dist/esm/justifi-payment-provisioning.entry.js +15 -14
  332. package/dist/esm/justifi-payments-list-filters.entry.js +11 -15
  333. package/dist/esm/justifi-payments-list.entry.js +25 -27
  334. package/dist/esm/justifi-payout-details.entry.js +20 -23
  335. package/dist/esm/justifi-payouts-list-filters.entry.js +9 -10
  336. package/dist/esm/justifi-payouts-list.entry.js +26 -30
  337. package/dist/esm/justifi-refund-payment.entry.js +189 -67
  338. package/dist/esm/justifi-season-interruption-insurance-core.entry.js +10 -25
  339. package/dist/esm/justifi-season-interruption-insurance.entry.js +24 -33
  340. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +19 -19
  341. package/dist/esm/justifi-terminal-orders-list.entry.js +28 -26
  342. package/dist/esm/justifi-terminals-list-filters.entry.js +17 -19
  343. package/dist/esm/justifi-terminals-list.entry.js +25 -28
  344. package/dist/esm/justifi-tokenize-payment-method.entry.js +24 -26
  345. package/dist/esm/loader.js +4 -4
  346. package/dist/esm/lodash-BqWxUrkh.js +17214 -0
  347. package/dist/esm/package-gAO-RwrF.js +7 -0
  348. package/dist/esm/pagination-menu.entry.js +3 -3
  349. package/dist/esm/{parts-fd740f54.js → parts-CB88j97I.js} +3 -2
  350. package/dist/esm/payment-details-core.entry.js +19 -20
  351. package/dist/esm/{payment-provisioning-actions-beadac34.js → payment-provisioning-actions-CZYFFdTf.js} +3 -3
  352. package/dist/esm/payment.service-Co_fPTvK.js +21 -0
  353. package/dist/esm/payments-list-core.entry.js +25 -28
  354. package/dist/esm/{payments-list-params-state-d05b24aa.js → payments-list-params-state-Gbxdxjoi.js} +1 -1
  355. package/dist/esm/{payments-status-74d22728.js → payments-status-BLhcMfnC.js} +2 -2
  356. package/dist/esm/{payments-table-8134f5e1.js → payments-table-VcaC77NC.js} +4 -4
  357. package/dist/esm/payout-details-core.entry.js +14 -16
  358. package/dist/esm/payouts-list-core.entry.js +26 -31
  359. package/dist/esm/{payouts-list-params-state-ebcee300.js → payouts-list-params-state-Gbxdxjoi.js} +1 -1
  360. package/dist/esm/{payouts-status-29d31099.js → payouts-status-B9SSljnL.js} +2 -2
  361. package/dist/esm/{payouts-table-c1ced46a.js → payouts-table-DWBaNPmV.js} +4 -4
  362. package/dist/esm/{schema-validations-5af4266a.js → schema-validations-BsbYeDDR.js} +5 -5
  363. package/dist/esm/{skeleton-ab3f676e.js → skeleton-B-oFGeeG.js} +2 -2
  364. package/dist/esm/{spinner-27479716.js → spinner-ptEcaLdc.js} +2 -2
  365. package/dist/esm/{styled-host-32228b45.js → styled-host-BHVh70Zk.js} +2 -3
  366. package/dist/esm/table-filters-menu.entry.js +4 -8
  367. package/dist/esm/terminal-orders-list-core.entry.js +24 -27
  368. package/dist/esm/{terminal-orders-list-params-state-8fec0a0b.js → terminal-orders-list-params-state-Gbxdxjoi.js} +1 -1
  369. package/dist/esm/{terminal-orders-table-93e84d25.js → terminal-orders-table-fuxIpfJ2.js} +35 -5
  370. package/dist/esm/terminal-quantity-selector.entry.js +6 -10
  371. package/dist/esm/{terminal.service-d173566d.js → terminal.service-BLOZ-ZlR.js} +11 -11
  372. package/dist/esm/terminals-list-core.entry.js +25 -29
  373. package/dist/esm/terminals-list-params-state-Gbxdxjoi.js +16 -0
  374. package/dist/esm/{terminals-table-ff24bf27.js → terminals-table-Dn71oQMb.js} +4 -4
  375. package/dist/esm/{utils-96d9c205.js → utils-B4pV3GWr.js} +2 -2
  376. package/dist/esm/utils-BWcTxbSg.js +23969 -0
  377. package/dist/esm/{utils-fd99b806.js → utils-Dccsn9BY.js} +2 -2
  378. package/dist/esm/webcomponents.js +6 -5
  379. package/dist/module/Api.js +32 -76
  380. package/dist/module/Business.js +2 -2
  381. package/dist/module/ComponentError.js +2 -1
  382. package/dist/module/Document.js +1 -1
  383. package/dist/module/{SubAccount.js → Refund.js} +24 -1
  384. package/dist/module/_commonjsHelpers.js +7 -0
  385. package/dist/module/additional-questions-details2.js +1 -2
  386. package/dist/module/additional-questions.js +2 -3
  387. package/dist/module/additional-statement.js +6 -9
  388. package/dist/module/badge.js +1 -1
  389. package/dist/module/bank-account-document-inputs.js +4 -6
  390. package/dist/module/bank-account-form-inputs2.js +1 -5
  391. package/dist/module/bank-account-form2.js +0 -1
  392. package/dist/module/billing-form.js +122 -4
  393. package/dist/module/business-additional-questions-form-step-core.js +7 -11
  394. package/dist/module/business-additional-questions-form-step.js +1 -6
  395. package/dist/module/business-additional-questions-schema.js +1 -1
  396. package/dist/module/business-address-schema.js +1 -1
  397. package/dist/module/business-bank-account-form-step-core.js +13 -18
  398. package/dist/module/business-bank-account-form-step.js +3 -9
  399. package/dist/module/business-core-info-form-step-core.js +6 -11
  400. package/dist/module/business-core-info-form-step.js +1 -6
  401. package/dist/module/business-core-info-schema.js +1 -1
  402. package/dist/module/business-core-info.js +2 -3
  403. package/dist/module/business-details-core2.js +1 -3
  404. package/dist/module/business-documents-on-file2.js +1 -1
  405. package/dist/module/business-form-options.js +1 -1
  406. package/dist/module/business-identity-schema.js +1 -1
  407. package/dist/module/business-owners-form-step-core.js +5 -11
  408. package/dist/module/business-owners-form-step.js +1 -6
  409. package/dist/module/business-representative-form-inputs.js +1 -4
  410. package/dist/module/business-representative-form-step-core.js +5 -9
  411. package/dist/module/business-representative-form-step.js +1 -6
  412. package/dist/module/business-representative.js +3 -4
  413. package/dist/module/business-terms-conditions-form-step.js +6 -12
  414. package/dist/module/business.service.js +22 -7
  415. package/dist/module/button.js +1 -1
  416. package/dist/module/cancellation-policy.js +6 -8
  417. package/dist/module/card-form2.js +2 -3
  418. package/dist/module/check-pkg-version.js +1 -1
  419. package/dist/module/checkout-core.js +57 -69
  420. package/dist/module/checkout.service.js +7 -4
  421. package/dist/module/checkouts-list-core2.js +12 -17
  422. package/dist/module/custom-popper2.js +13 -16
  423. package/dist/module/customer-details.js +6 -8
  424. package/dist/module/details.js +0 -1
  425. package/dist/module/dispute-management-core.js +4 -8
  426. package/dist/module/dispute-notification.js +3 -6
  427. package/dist/module/dispute-response-actions.js +16 -7
  428. package/dist/module/dispute-response-core.js +12 -16
  429. package/dist/module/dispute-response.js +6 -12
  430. package/dist/module/duplicate-charge.js +6 -8
  431. package/dist/module/electronic-evidence.js +5 -7
  432. package/dist/module/event-types2.js +21 -61
  433. package/dist/module/event-types3.js +61 -21
  434. package/dist/module/form-alert2.js +1 -3
  435. package/dist/module/form-control-checkbox2.js +6 -13
  436. package/dist/module/form-control-date2.js +6 -14
  437. package/dist/module/form-control-file-v22.js +2 -10
  438. package/dist/module/form-control-file2.js +5 -15
  439. package/dist/module/form-control-help-text.js +1 -1
  440. package/dist/module/form-control-help-text2.js +30 -9
  441. package/dist/module/form-control-help-text3.js +9 -32
  442. package/dist/module/form-control-monetary-provisioning2.js +8 -15
  443. package/dist/module/form-control-monetary2.js +9 -17
  444. package/dist/module/form-control-number-masked2.js +4 -12
  445. package/dist/module/form-control-number.js +6 -13
  446. package/dist/module/form-control-radio2.js +6 -14
  447. package/dist/module/form-control-select2.js +5 -13
  448. package/dist/module/form-control-text2.js +5 -14
  449. package/dist/module/form-control-textarea2.js +7 -16
  450. package/dist/module/form-control-tooltip2.js +0 -3
  451. package/dist/module/form.js +9773 -903
  452. package/dist/module/generic-info-details2.js +0 -1
  453. package/dist/module/get-business.js +2 -2
  454. package/dist/module/get-payment-details.js +40 -0
  455. package/dist/module/get-payout-csv.js +6 -6
  456. package/dist/module/get-subaccounts.js +5 -4
  457. package/dist/module/gross-payment-chart-core2.js +257 -264
  458. package/dist/module/helpers.js +1 -1
  459. package/dist/module/hidden-input2.js +3 -3
  460. package/dist/module/identity-address-form.js +2 -5
  461. package/dist/module/iframe-input-styles-state.js +2 -2
  462. package/dist/module/iframe-input2.js +1481 -1478
  463. package/dist/module/index2.js +3 -4
  464. package/dist/module/index3.js +1 -1
  465. package/dist/module/{billing-form.d.ts → justifi-billing-form.d.ts} +4 -4
  466. package/dist/module/justifi-billing-form.js +6 -0
  467. package/dist/module/justifi-business-details.js +1 -5
  468. package/dist/module/justifi-business-form.js +7 -10
  469. package/dist/module/justifi-checkout.js +47 -62
  470. package/dist/module/justifi-checkouts-list-filters.js +4 -5
  471. package/dist/module/justifi-checkouts-list.js +8 -11
  472. package/dist/module/justifi-dispute-management.js +6 -9
  473. package/dist/module/justifi-gross-payment-chart.js +4 -7
  474. package/dist/module/justifi-order-terminals.js +6 -13
  475. package/dist/module/justifi-payment-details.js +6 -38
  476. package/dist/module/justifi-payment-provisioning.js +5 -6
  477. package/dist/module/justifi-payments-list-filters.js +6 -11
  478. package/dist/module/justifi-payments-list.js +8 -10
  479. package/dist/module/justifi-payout-details.js +6 -9
  480. package/dist/module/justifi-payouts-list-filters.js +4 -6
  481. package/dist/module/justifi-payouts-list.js +8 -12
  482. package/dist/module/justifi-refund-payment.js +184 -61
  483. package/dist/module/justifi-season-interruption-insurance.js +13 -23
  484. package/dist/module/justifi-terminal-orders-list-filters.js +8 -9
  485. package/dist/module/justifi-terminal-orders-list.js +13 -11
  486. package/dist/module/justifi-terminals-list-filters.js +6 -8
  487. package/dist/module/justifi-terminals-list.js +8 -11
  488. package/dist/module/justifi-tokenize-payment-method.js +46 -58
  489. package/dist/module/legal-address-details2.js +1 -2
  490. package/dist/module/legal-address-form-step-core.js +6 -10
  491. package/dist/module/legal-address-form-step.js +1 -6
  492. package/dist/module/legal-address-form.js +1 -3
  493. package/dist/module/lodash.js +17201 -17191
  494. package/dist/module/new-payment-method.js +43 -55
  495. package/dist/module/owner-details2.js +0 -1
  496. package/dist/module/owner-form-core2.js +8 -18
  497. package/dist/module/owner-form-inputs2.js +1 -4
  498. package/dist/module/owner-form.js +1 -11
  499. package/dist/module/package.js +3 -77
  500. package/dist/module/pagination-menu2.js +1 -1
  501. package/dist/module/parts.js +3 -2
  502. package/dist/module/payment-details-core2.js +11 -13
  503. package/dist/module/payment-method-options.js +43 -61
  504. package/dist/module/payment-provisioning-actions.js +2 -2
  505. package/dist/module/payment-provisioning-core.js +8 -14
  506. package/dist/module/payment-provisioning-form-buttons.js +2 -8
  507. package/dist/module/payment-provisioning-form-steps.js +2 -7
  508. package/dist/module/payment.service.js +4 -4
  509. package/dist/module/payments-list-core2.js +10 -14
  510. package/dist/module/payout-details-core2.js +6 -9
  511. package/dist/module/payouts-list-core2.js +14 -20
  512. package/dist/module/product-or-service.js +5 -7
  513. package/dist/module/refund-policy.js +6 -8
  514. package/dist/module/representative-details2.js +0 -1
  515. package/dist/module/saved-payment-method.js +4 -6
  516. package/dist/module/schema-validations.js +2 -2
  517. package/dist/module/season-interruption-insurance-core.js +4 -20
  518. package/dist/module/sezzle-payment-method.js +3 -12
  519. package/dist/module/shipping-details.js +6 -8
  520. package/dist/module/spinner.js +1 -1
  521. package/dist/module/styled-host.js +1 -2
  522. package/dist/module/table-filters-menu2.js +3 -7
  523. package/dist/module/terminal-orders-list-core2.js +35 -15
  524. package/dist/module/terminal-quantity-selector2.js +4 -8
  525. package/dist/module/terminal.service.js +5 -5
  526. package/dist/module/terminals-list-core2.js +12 -17
  527. package/dist/module/utils.js +1 -1
  528. package/dist/module/utils2.js +23787 -3819
  529. package/dist/module/utils4.js +2 -2
  530. package/dist/types/actions/payment/get-payment-details.d.ts +4 -2
  531. package/dist/types/actions/refund/refund-actions.d.ts +12 -0
  532. package/dist/types/api/Api.d.ts +30 -5
  533. package/dist/types/api/ComponentError.d.ts +2 -1
  534. package/dist/types/api/Payment.d.ts +1 -11
  535. package/dist/types/api/Refund.d.ts +45 -0
  536. package/dist/types/api/TerminalOrder.d.ts +4 -1
  537. package/dist/types/api/index.d.ts +1 -0
  538. package/dist/types/api/services/payment.service.d.ts +2 -2
  539. package/dist/types/api/services/refund.service.d.ts +7 -0
  540. package/dist/types/components/business-forms/payment-provisioning/form-control-monetary-provisioning.d.ts +1 -1
  541. package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +3 -3
  542. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +1 -1
  543. package/dist/types/components/checkout/{billing-forms → billing-form}/billing-form-schema.d.ts +1 -11
  544. package/dist/types/components/checkout/{billing-forms/billing-form → billing-form}/billing-form.d.ts +8 -6
  545. package/dist/types/components/checkout/checkout-core.d.ts +6 -2
  546. package/dist/types/components/checkout/checkout.d.ts +6 -2
  547. package/dist/types/components/checkout/new-payment-method.d.ts +7 -3
  548. package/dist/types/components/checkout/payment-method-options.d.ts +6 -2
  549. package/dist/types/components/payment-details/payment-details.d.ts +1 -0
  550. package/dist/types/components/refund-payment/refund-loading.d.ts +1 -0
  551. package/dist/types/components/refund-payment/refund-payment-schema.d.ts +6 -6
  552. package/dist/types/components/refund-payment/refund-payment.d.ts +18 -12
  553. package/dist/types/components/terminal-orders-list/terminal-orders-list-filters.d.ts +1 -1
  554. package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +4 -0
  555. package/dist/types/components.d.ts +45 -74
  556. package/dist/types/stencil-public-runtime.d.ts +9 -0
  557. package/dist/types/styles/parts.d.ts +6 -5
  558. package/dist/types/ui-components/form/form-control-monetary.d.ts +1 -1
  559. package/dist/types/utils/utils.d.ts +1 -0
  560. package/dist/webcomponents/{p-701a13ca.js → p-01wziNa9.js} +1 -1
  561. package/dist/webcomponents/p-063dd981.entry.js +1 -0
  562. package/dist/webcomponents/p-08d5b491.entry.js +1 -0
  563. package/dist/webcomponents/{p-70be104e.js → p-0czqizJW.js} +1 -1
  564. package/dist/webcomponents/p-1049c0c5.entry.js +1 -0
  565. package/dist/webcomponents/p-1ydcg9ti.js +1 -0
  566. package/dist/webcomponents/p-2c2f6743.entry.js +1 -0
  567. package/dist/webcomponents/p-2d80f427.entry.js +1 -0
  568. package/dist/webcomponents/p-2f6c0a07.entry.js +1 -0
  569. package/dist/webcomponents/p-2fe9576b.entry.js +1 -0
  570. package/dist/webcomponents/p-307a0db6.entry.js +1 -0
  571. package/dist/webcomponents/p-3147bfe2.entry.js +1 -0
  572. package/dist/webcomponents/p-332ce001.entry.js +1 -0
  573. package/dist/webcomponents/p-34cfafed.entry.js +1 -0
  574. package/dist/webcomponents/p-3995c8b8.entry.js +1 -0
  575. package/dist/webcomponents/p-3e084a0e.entry.js +1 -0
  576. package/dist/webcomponents/p-43c1c278.entry.js +1 -0
  577. package/dist/webcomponents/p-456f8c0a.entry.js +1 -0
  578. package/dist/webcomponents/p-4addd069.entry.js +1 -0
  579. package/dist/webcomponents/p-4ee6482d.entry.js +1 -0
  580. package/dist/webcomponents/p-507f7a31.entry.js +1 -0
  581. package/dist/webcomponents/p-50aa4e4d.entry.js +1 -0
  582. package/dist/webcomponents/p-5a07a84c.entry.js +1 -0
  583. package/dist/webcomponents/p-5dc3a795.entry.js +1 -0
  584. package/dist/webcomponents/p-62bdcca1.entry.js +1 -0
  585. package/dist/webcomponents/p-65345bd4.entry.js +1 -0
  586. package/dist/webcomponents/p-6a54d69b.entry.js +1 -0
  587. package/dist/webcomponents/p-6c4927e7.entry.js +1 -0
  588. package/dist/webcomponents/p-6d2a48f5.entry.js +1 -0
  589. package/dist/webcomponents/p-7414b942.entry.js +1 -0
  590. package/dist/webcomponents/p-7ddd7122.entry.js +20 -0
  591. package/dist/webcomponents/p-80dca817.entry.js +1 -0
  592. package/dist/webcomponents/p-815937bb.entry.js +1 -0
  593. package/dist/webcomponents/p-86fdc0a1.entry.js +1 -0
  594. package/dist/webcomponents/p-98111d03.entry.js +1 -0
  595. package/dist/webcomponents/p-9a9bb294.entry.js +1 -0
  596. package/dist/webcomponents/p-9bbfde16.entry.js +1 -0
  597. package/dist/webcomponents/p-B7ErpLYA.js +1 -0
  598. package/dist/webcomponents/p-BBsCnePk.js +1 -0
  599. package/dist/webcomponents/p-BFTU3MAI.js +1 -0
  600. package/dist/webcomponents/p-BHHWVg32.js +1 -0
  601. package/dist/webcomponents/p-BHbsXXRt.js +1 -0
  602. package/dist/webcomponents/p-BM61p7vG.js +1 -0
  603. package/dist/webcomponents/p-BODr6HXb.js +1 -0
  604. package/dist/webcomponents/p-BUM1DfV9.js +2 -0
  605. package/dist/webcomponents/p-BVwkHwTc.js +1 -0
  606. package/dist/webcomponents/p-BWFriesi.js +1 -0
  607. package/dist/webcomponents/p-Bde7dY9t.js +9 -0
  608. package/dist/webcomponents/{p-1366a019.js → p-BjB_yKBJ.js} +1 -1
  609. package/dist/webcomponents/p-Bo92MHrs.js +1 -0
  610. package/dist/webcomponents/p-BoPxMyJA.js +1 -0
  611. package/dist/webcomponents/{p-5d1d2fd7.js → p-BrvbVMVq.js} +1 -1
  612. package/dist/webcomponents/{p-a5579f53.js → p-BuYnqWwT.js} +1 -1
  613. package/dist/webcomponents/p-BxPlB-C5.js +1 -0
  614. package/dist/webcomponents/{p-3f5e6602.js → p-Bxs6fi7a.js} +1 -1
  615. package/dist/webcomponents/{p-bfe9748b.js → p-C3nDCvFQ.js} +1 -1
  616. package/dist/webcomponents/{p-87f8c596.js → p-C5RuuShs.js} +1 -1
  617. package/dist/webcomponents/p-CB88j97I.js +1 -0
  618. package/dist/webcomponents/p-CGz3XHQc.js +1 -0
  619. package/dist/webcomponents/p-CLBRsaLx.js +1 -0
  620. package/dist/webcomponents/{p-4cc3c7f9.js → p-CTBH4Lj9.js} +1 -1
  621. package/dist/webcomponents/p-CYsU0lEI.js +1 -0
  622. package/dist/webcomponents/p-CjunQqer.js +1 -0
  623. package/dist/webcomponents/{p-12074378.js → p-CnyMKcfC.js} +1 -1
  624. package/dist/webcomponents/p-CpTwq2jw.js +1 -0
  625. package/dist/webcomponents/{p-61f0a2ce.js → p-Ct-uNz2r.js} +1 -1
  626. package/dist/webcomponents/p-CwHcfOV7.js +1 -0
  627. package/dist/webcomponents/p-Cy4aIACq.js +1 -0
  628. package/dist/webcomponents/p-D7s2671S.js +1 -0
  629. package/dist/webcomponents/{p-ca6cdfe6.js → p-D89x2FYg.js} +1 -1
  630. package/dist/webcomponents/p-D9t-X0IY.js +1 -0
  631. package/dist/webcomponents/p-DLpKiPxJ.js +1 -0
  632. package/dist/webcomponents/p-DVnVdicA.js +1 -0
  633. package/dist/webcomponents/p-DhEfW-kS.js +1 -0
  634. package/dist/webcomponents/p-DhQ2XlhY.js +1 -0
  635. package/dist/webcomponents/p-Dna7whFY.js +1 -0
  636. package/dist/webcomponents/p-DoH48u6u.js +1 -0
  637. package/dist/webcomponents/p-Dt-vy9Le.js +1 -0
  638. package/dist/webcomponents/p-DzPbgN8M.js +1 -0
  639. package/dist/webcomponents/{p-c9b78275.js → p-IA90llLO.js} +1 -1
  640. package/dist/webcomponents/p-JcczGkik.js +1 -0
  641. package/dist/webcomponents/p-QYQ4VLoz.js +1 -0
  642. package/dist/webcomponents/{p-9dd8685c.js → p-SdntD1xf.js} +1 -1
  643. package/dist/webcomponents/p-ZUQEru6m.js +1 -0
  644. package/dist/webcomponents/p-a22974fd.entry.js +1 -0
  645. package/dist/webcomponents/p-a2bf5919.entry.js +1 -0
  646. package/dist/webcomponents/p-a9eff0f2.entry.js +1 -0
  647. package/dist/webcomponents/p-ab99e4c6.entry.js +1 -0
  648. package/dist/webcomponents/p-b7053613.entry.js +1 -0
  649. package/dist/webcomponents/p-bb8f7062.entry.js +1 -0
  650. package/dist/webcomponents/p-be04a09c.entry.js +1 -0
  651. package/dist/webcomponents/p-bplwtwD3.js +1 -0
  652. package/dist/webcomponents/p-c38c742e.entry.js +1 -0
  653. package/dist/webcomponents/p-c558725e.entry.js +1 -0
  654. package/dist/webcomponents/p-c6534f5f.entry.js +1 -0
  655. package/dist/webcomponents/p-c6cf707c.entry.js +1 -0
  656. package/dist/webcomponents/p-c70dcec1.entry.js +1 -0
  657. package/dist/webcomponents/p-c8d608a1.entry.js +1 -0
  658. package/dist/webcomponents/p-ce20d709.entry.js +1 -0
  659. package/dist/webcomponents/p-cf8f69de.entry.js +1 -0
  660. package/dist/webcomponents/p-d5675bf5.entry.js +1 -0
  661. package/dist/webcomponents/p-def42fc7.entry.js +1 -0
  662. package/dist/webcomponents/p-dfcf19f2.entry.js +1 -0
  663. package/dist/webcomponents/p-e0896deb.entry.js +1 -0
  664. package/dist/webcomponents/p-e3962860.entry.js +1 -0
  665. package/dist/webcomponents/p-e3cd72ad.entry.js +1 -0
  666. package/dist/webcomponents/p-e52d5ead.entry.js +1 -0
  667. package/dist/webcomponents/p-eYaGyUvS.js +1 -0
  668. package/dist/webcomponents/p-eb31e5c7.entry.js +1 -0
  669. package/dist/webcomponents/p-eb677eb2.entry.js +1 -0
  670. package/dist/webcomponents/p-f0301d11.entry.js +1 -0
  671. package/dist/webcomponents/p-f51e4213.entry.js +1 -0
  672. package/dist/webcomponents/p-gAO-RwrF.js +1 -0
  673. package/dist/webcomponents/p-hkXaxw9l.js +1 -0
  674. package/dist/webcomponents/p-p7aAf5_m.js +1 -0
  675. package/dist/webcomponents/p-sXe3gn-5.js +1 -0
  676. package/dist/webcomponents/p-y-Ys7Rd-.js +1 -0
  677. package/dist/webcomponents/p-z1GJDdMW.js +1 -0
  678. package/dist/webcomponents/webcomponents.esm.js +1 -1
  679. package/package.json +6 -7
  680. package/dist/cjs/Api-83d93333.js +0 -118
  681. package/dist/cjs/billing-form_3.cjs.entry.js +0 -1733
  682. package/dist/cjs/index.esm-544c08fd.js +0 -2937
  683. package/dist/cjs/lodash-dbf6a6a4.js +0 -17206
  684. package/dist/cjs/package-5a9f02b2.js +0 -83
  685. package/dist/cjs/payment.service-537e049d.js +0 -23
  686. package/dist/cjs/terminals-list-params-state-236f06f6.js +0 -22
  687. package/dist/cjs/utils-4120664c.js +0 -4018
  688. package/dist/collection/components/checkout/billing-forms/billing-form/billing-form.js +0 -137
  689. package/dist/collection/components/checkout/billing-forms/billing-form-schema.js +0 -26
  690. package/dist/collection/components/checkout/billing-forms/billing-form-wrapper.js +0 -183
  691. package/dist/collection/components/checkout/billing-forms/postal-form/postal-form.js +0 -136
  692. package/dist/esm/Api-52242eb0.js +0 -116
  693. package/dist/esm/billing-form_3.entry.js +0 -1727
  694. package/dist/esm/index.esm-feedf26f.js +0 -2931
  695. package/dist/esm/lodash-faeb5a52.js +0 -17204
  696. package/dist/esm/package-c8466624.js +0 -81
  697. package/dist/esm/payment.service-af5bd8be.js +0 -21
  698. package/dist/esm/terminals-list-params-state-e4b2ec23.js +0 -16
  699. package/dist/esm/utils-ec50661e.js +0 -4001
  700. package/dist/loader/package.json +0 -11
  701. package/dist/module/billing-form-schema.js +0 -16
  702. package/dist/module/billing-form-wrapper.js +0 -114
  703. package/dist/module/billing-form2.js +0 -90
  704. package/dist/module/justifi-billing-form-wrapper.d.ts +0 -11
  705. package/dist/module/justifi-billing-form-wrapper.js +0 -6
  706. package/dist/module/postal-form.d.ts +0 -11
  707. package/dist/module/postal-form.js +0 -6
  708. package/dist/module/postal-form2.js +0 -83
  709. package/dist/types/components/checkout/billing-forms/billing-form-wrapper.d.ts +0 -19
  710. package/dist/types/components/checkout/billing-forms/postal-form/postal-form.d.ts +0 -20
  711. package/dist/webcomponents/p-01033194.js +0 -1
  712. package/dist/webcomponents/p-04d6b37e.entry.js +0 -1
  713. package/dist/webcomponents/p-092515e0.js +0 -1
  714. package/dist/webcomponents/p-0b61d4d3.entry.js +0 -1
  715. package/dist/webcomponents/p-0c7ec110.entry.js +0 -1
  716. package/dist/webcomponents/p-0f0020e1.entry.js +0 -1
  717. package/dist/webcomponents/p-0fa216eb.entry.js +0 -1
  718. package/dist/webcomponents/p-1361d8eb.entry.js +0 -1
  719. package/dist/webcomponents/p-13717638.entry.js +0 -1
  720. package/dist/webcomponents/p-142bfae3.js +0 -1
  721. package/dist/webcomponents/p-1cfa5df9.entry.js +0 -1
  722. package/dist/webcomponents/p-1ff8810b.js +0 -1
  723. package/dist/webcomponents/p-2123c150.js +0 -1
  724. package/dist/webcomponents/p-21def20b.entry.js +0 -1
  725. package/dist/webcomponents/p-23cd76af.entry.js +0 -1
  726. package/dist/webcomponents/p-25b82529.entry.js +0 -1
  727. package/dist/webcomponents/p-27546fa9.entry.js +0 -1
  728. package/dist/webcomponents/p-275c3dc9.js +0 -1
  729. package/dist/webcomponents/p-2783e363.js +0 -2
  730. package/dist/webcomponents/p-290fa30d.entry.js +0 -1
  731. package/dist/webcomponents/p-2a9d7f6b.js +0 -1
  732. package/dist/webcomponents/p-2aad7e3b.entry.js +0 -1
  733. package/dist/webcomponents/p-2b8aaa7d.entry.js +0 -1
  734. package/dist/webcomponents/p-3075b7e1.entry.js +0 -1
  735. package/dist/webcomponents/p-31dcaeaf.entry.js +0 -1
  736. package/dist/webcomponents/p-35c296fc.entry.js +0 -1
  737. package/dist/webcomponents/p-373a19fe.entry.js +0 -1
  738. package/dist/webcomponents/p-375657fe.entry.js +0 -1
  739. package/dist/webcomponents/p-3cc7527a.entry.js +0 -1
  740. package/dist/webcomponents/p-3cf317d3.entry.js +0 -1
  741. package/dist/webcomponents/p-407d6d29.entry.js +0 -1
  742. package/dist/webcomponents/p-4451de8d.entry.js +0 -1
  743. package/dist/webcomponents/p-4f7432c3.entry.js +0 -1
  744. package/dist/webcomponents/p-536497fe.entry.js +0 -1
  745. package/dist/webcomponents/p-536fb8e2.js +0 -1
  746. package/dist/webcomponents/p-537bce77.js +0 -1
  747. package/dist/webcomponents/p-54556fc6.js +0 -1
  748. package/dist/webcomponents/p-56c7fc8d.js +0 -1
  749. package/dist/webcomponents/p-58ee6ce9.js +0 -1
  750. package/dist/webcomponents/p-5a541d35.js +0 -1
  751. package/dist/webcomponents/p-5a9d7ca0.entry.js +0 -1
  752. package/dist/webcomponents/p-5b76dbe1.entry.js +0 -1
  753. package/dist/webcomponents/p-5f6b4bc9.js +0 -1
  754. package/dist/webcomponents/p-645db2cb.entry.js +0 -1
  755. package/dist/webcomponents/p-673c1bca.js +0 -1
  756. package/dist/webcomponents/p-753d983c.entry.js +0 -1
  757. package/dist/webcomponents/p-76549a24.js +0 -1
  758. package/dist/webcomponents/p-7d85af5c.js +0 -1
  759. package/dist/webcomponents/p-7e8732f7.entry.js +0 -1
  760. package/dist/webcomponents/p-81a6c3e2.entry.js +0 -1
  761. package/dist/webcomponents/p-829480e7.entry.js +0 -1
  762. package/dist/webcomponents/p-86605101.js +0 -1
  763. package/dist/webcomponents/p-87a4fb5b.js +0 -1
  764. package/dist/webcomponents/p-927cb6df.js +0 -1
  765. package/dist/webcomponents/p-94e4f1f1.entry.js +0 -1
  766. package/dist/webcomponents/p-96c23cda.entry.js +0 -1
  767. package/dist/webcomponents/p-9a9732e1.js +0 -1
  768. package/dist/webcomponents/p-9fecad5a.js +0 -1
  769. package/dist/webcomponents/p-a3cced75.entry.js +0 -1
  770. package/dist/webcomponents/p-a5f5cc2e.entry.js +0 -1
  771. package/dist/webcomponents/p-a8c69f51.entry.js +0 -1
  772. package/dist/webcomponents/p-ab45511e.js +0 -1
  773. package/dist/webcomponents/p-ad713ab6.entry.js +0 -1
  774. package/dist/webcomponents/p-adecb91a.entry.js +0 -1
  775. package/dist/webcomponents/p-ae7edce5.js +0 -1
  776. package/dist/webcomponents/p-ae891abb.entry.js +0 -1
  777. package/dist/webcomponents/p-af3315b5.entry.js +0 -1
  778. package/dist/webcomponents/p-b218af87.entry.js +0 -1
  779. package/dist/webcomponents/p-b50ca848.entry.js +0 -1
  780. package/dist/webcomponents/p-b84ee6d8.js +0 -1
  781. package/dist/webcomponents/p-b8664571.entry.js +0 -1
  782. package/dist/webcomponents/p-bb4b3f79.entry.js +0 -1
  783. package/dist/webcomponents/p-beec0b60.js +0 -1
  784. package/dist/webcomponents/p-bf12999f.js +0 -1
  785. package/dist/webcomponents/p-bf195b35.js +0 -1
  786. package/dist/webcomponents/p-bfc2d88a.js +0 -1
  787. package/dist/webcomponents/p-c6be72b0.js +0 -10
  788. package/dist/webcomponents/p-c8b78136.js +0 -1
  789. package/dist/webcomponents/p-cbad44b7.js +0 -1
  790. package/dist/webcomponents/p-cc2f75a3.entry.js +0 -1
  791. package/dist/webcomponents/p-ccb9ee53.js +0 -1
  792. package/dist/webcomponents/p-cd93c62b.entry.js +0 -19
  793. package/dist/webcomponents/p-d757fcf5.js +0 -1
  794. package/dist/webcomponents/p-dbc1a95b.js +0 -1
  795. package/dist/webcomponents/p-dd2938d3.entry.js +0 -1
  796. package/dist/webcomponents/p-de03d0f8.js +0 -1
  797. package/dist/webcomponents/p-dec18cc4.js +0 -1
  798. package/dist/webcomponents/p-e1ae5e80.entry.js +0 -1
  799. package/dist/webcomponents/p-e3855f51.entry.js +0 -1
  800. package/dist/webcomponents/p-e73be1b9.entry.js +0 -1
  801. package/dist/webcomponents/p-e9867f8b.entry.js +0 -1
  802. package/dist/webcomponents/p-ef1db3da.entry.js +0 -1
  803. package/dist/webcomponents/p-f13b2991.entry.js +0 -1
  804. package/dist/webcomponents/p-f20466f7.entry.js +0 -1
  805. package/dist/webcomponents/p-f20b6ce1.js +0 -1
  806. package/dist/webcomponents/p-f4739d31.js +0 -1
  807. package/dist/webcomponents/p-f4aeb100.js +0 -1
  808. package/dist/webcomponents/p-f8fccf44.js +0 -1
  809. package/dist/webcomponents/p-f930504f.entry.js +0 -1
  810. package/dist/webcomponents/p-faa35b47.entry.js +0 -1
  811. package/dist/webcomponents/p-fb2db8da.entry.js +0 -1
  812. package/dist/webcomponents/p-fca89e9b.entry.js +0 -1
  813. /package/dist/cjs/{Dispute-eb6bad54.js → Dispute-CruQTF6_.js} +0 -0
  814. /package/dist/cjs/{Document-0b828345.js → Document-rXGBUaOh.js} +0 -0
  815. /package/dist/cjs/{Pagination-0da8f095.js → Pagination-Dediz133.js} +0 -0
  816. /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
  817. /package/dist/cjs/{event-types-8edaabbb.js → event-types-BWQT2lwu.js} +0 -0
  818. /package/dist/cjs/{event-types-180a85a9.js → event-types-DNOUef41.js} +0 -0
  819. /package/dist/cjs/{form-input-masks-0879c139.js → form-input-masks-DgXd0f4V.js} +0 -0
  820. /package/dist/cjs/{state-options-4fbcb48a.js → state-options-CIT9xdTz.js} +0 -0
  821. /package/dist/cjs/{utils-bc03ca40.js → utils-DAyWinG2.js} +0 -0
  822. /package/dist/esm/{Dispute-5fd28ec9.js → Dispute-7MWRbTXI.js} +0 -0
  823. /package/dist/esm/{Pagination-afc8f96d.js → Pagination-CLHwhyvu.js} +0 -0
  824. /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  825. /package/dist/esm/{event-types-07cdb9a0.js → event-types-Bg2SZArf.js} +0 -0
  826. /package/dist/esm/{event-types-5c87de02.js → event-types-XYgDHrVL.js} +0 -0
  827. /package/dist/esm/{form-input-masks-0e18300f.js → form-input-masks-B-iV5cYd.js} +0 -0
  828. /package/dist/esm/{state-options-a356fb11.js → state-options-BX8GieXu.js} +0 -0
  829. /package/dist/esm/{utils-20cdf321.js → utils-BnjCmwMr.js} +0 -0
  830. /package/dist/webcomponents/{p-abdbcd8e.js → p-7MWRbTXI.js} +0 -0
  831. /package/dist/webcomponents/{p-525db3e8.js → p-B-iV5cYd.js} +0 -0
  832. /package/dist/webcomponents/{p-6078a370.js → p-BX8GieXu.js} +0 -0
  833. /package/dist/webcomponents/{p-667ebd79.js → p-Bg2SZArf.js} +0 -0
  834. /package/dist/webcomponents/{p-e3c22aa9.js → p-BnjCmwMr.js} +0 -0
  835. /package/dist/webcomponents/{p-56f6ce4c.js → p-CLHwhyvu.js} +0 -0
  836. /package/dist/webcomponents/{p-1ad5995e.js → p-Ce_F4E0f.js} +0 -0
  837. /package/dist/webcomponents/{p-e1255160.js → p-DQuL1Twl.js} +0 -0
  838. /package/dist/webcomponents/{p-73f9be7c.js → p-XYgDHrVL.js} +0 -0
@@ -1,8 +1,9 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
2
3
  import { F as FormControlErrorText } from './form-control-error-text.js';
3
4
  import { p as packageJson } from './package.js';
4
- import { i as iframeInputStyles } from './iframe-input-styles-state.js';
5
- import { k as inputInvalidAndFocused, b as inputInvalid, d as inputFocused, i as input, l as label } from './parts.js';
5
+ import { a as iframeInputStyles } from './iframe-input-styles-state.js';
6
+ import { Q as inputInvalidAndFocused, b as inputInvalid, d as inputFocused, i as input, l as label } from './parts.js';
6
7
 
7
8
  var iframeResizer = {exports: {}};
8
9
 
@@ -14,8 +15,13 @@ var iframeResizer = {exports: {}};
14
15
  * Author: David J. Bradshaw - info@iframe-resizer.com
15
16
  */
16
17
 
17
- (function (module) {
18
- console.info(`
18
+ var hasRequiredIframeResizer;
19
+
20
+ function requireIframeResizer () {
21
+ if (hasRequiredIframeResizer) return iframeResizer.exports;
22
+ hasRequiredIframeResizer = 1;
23
+ (function (module) {
24
+ console.info(`
19
25
  IFRAME-RESIZER
20
26
 
21
27
  Iframe-Resizer 5 is now available via the following two packages:
@@ -30,1473 +36,1474 @@ Version 5 of iframe-resizer has been extensively rewritten to use modern browser
30
36
  Please see https://iframe-resizer.com/upgrade for more details.
31
37
  `)
32
38
 
33
- // eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
34
- ;(function (undefined$1) {
35
- if (typeof window === 'undefined') return // don't run for server side render
36
-
37
- // var VERSION = '4.3.11'
38
-
39
- var count = 0,
40
- destroyObserver,
41
- logEnabled = false,
42
- hiddenCheckEnabled = false,
43
- msgHeader = 'message',
44
- msgHeaderLen = msgHeader.length,
45
- msgId = '[iFrameSizer]', // Must match iframe msg ID
46
- msgIdLen = msgId.length,
47
- pagePosition = null,
48
- requestAnimationFrame = window.requestAnimationFrame,
49
- resetRequiredMethods = Object.freeze({
50
- max: 1,
51
- scroll: 1,
52
- bodyScroll: 1,
53
- documentElementScroll: 1
54
- }),
55
- settings = {},
56
- timer = null,
57
- defaults = Object.freeze({
58
- autoResize: true,
59
- bodyBackground: null,
60
- bodyMargin: null,
61
- bodyMarginV1: 8,
62
- bodyPadding: null,
63
- checkOrigin: true,
64
- inPageLinks: false,
65
- enablePublicMethods: true,
66
- heightCalculationMethod: 'bodyOffset',
67
- id: 'iFrameResizer',
68
- interval: 32,
69
- license: '1jqr0si6pnt',
70
- log: false,
71
- maxHeight: Infinity,
72
- maxWidth: Infinity,
73
- minHeight: 0,
74
- minWidth: 0,
75
- mouseEvents: true,
76
- resizeFrom: 'parent',
77
- scrolling: false,
78
- sizeHeight: true,
79
- sizeWidth: false,
80
- warningTimeout: 5000,
81
- tolerance: 0,
82
- widthCalculationMethod: 'scroll',
83
- onClose: function () {
84
- return true
85
- },
86
- onClosed: function () {},
87
- onInit: function () {},
88
- onMessage: function () {
89
- warn('onMessage function not defined');
90
- },
91
- onMouseEnter: function () {},
92
- onMouseLeave: function () {},
93
- onResized: function () {},
94
- onScroll: function () {
95
- return true
96
- }
97
- });
98
-
99
- function getMutationObserver() {
100
- return (
101
- window.MutationObserver ||
102
- window.WebKitMutationObserver ||
103
- window.MozMutationObserver
104
- )
105
- }
106
-
107
- function addEventListener(el, evt, func) {
108
- el.addEventListener(evt, func, false);
109
- }
110
-
111
- function removeEventListener(el, evt, func) {
112
- el.removeEventListener(evt, func, false);
113
- }
114
-
115
- function setupRequestAnimationFrame() {
116
- var vendors = ['moz', 'webkit', 'o', 'ms'];
117
- var x;
118
-
119
- // Remove vendor prefixing if prefixed and break early if not
120
- for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
121
- requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
122
- }
123
-
124
- if (requestAnimationFrame) {
125
- // Firefox extension content-scripts have a globalThis object that is not the same as window.
126
- // Binding `requestAnimationFrame` to window allows the function to work and prevents errors
127
- // being thrown when run in that context, and should be a no-op in every other context.
128
- requestAnimationFrame = requestAnimationFrame.bind(window);
129
- } else {
130
- log('setup', 'RequestAnimationFrame not supported');
131
- }
132
- }
133
-
134
- function getMyID(iframeId) {
135
- var retStr = 'Host page: ' + iframeId;
136
-
137
- if (window.top !== window.self) {
138
- retStr =
139
- window.parentIFrame && window.parentIFrame.getId
140
- ? window.parentIFrame.getId() + ': ' + iframeId
141
- : 'Nested host page: ' + iframeId;
142
- }
143
-
144
- return retStr
145
- }
146
-
147
- function formatLogHeader(iframeId) {
148
- return msgId + '[' + getMyID(iframeId) + ']'
149
- }
150
-
151
- function isLogEnabled(iframeId) {
152
- return settings[iframeId] ? settings[iframeId].log : logEnabled
153
- }
154
-
155
- function log(iframeId, msg) {
156
- output('log', iframeId, msg, isLogEnabled(iframeId));
157
- }
158
-
159
- function info(iframeId, msg) {
160
- output('info', iframeId, msg, isLogEnabled(iframeId));
161
- }
162
-
163
- function warn(iframeId, msg) {
164
- output('warn', iframeId, msg, true);
165
- }
166
-
167
- function output(type, iframeId, msg, enabled) {
168
- if (true === enabled && 'object' === typeof window.console) {
169
- // eslint-disable-next-line no-console
170
- console[type](formatLogHeader(iframeId), msg);
171
- }
172
- }
173
-
174
- function iFrameListener(event) {
175
- function resizeIFrame() {
176
- function resize() {
177
- setSize(messageData);
178
- setPagePosition(iframeId);
179
- on('onResized', messageData);
180
- }
181
-
182
- ensureInRange('Height');
183
- ensureInRange('Width');
184
-
185
- syncResize(resize, messageData, 'init');
186
- }
187
-
188
- function processMsg() {
189
- var data = msg.slice(msgIdLen).split(':');
190
- var height = data[1] ? parseInt(data[1], 10) : 0;
191
- var iframe = settings[data[0]] && settings[data[0]].iframe;
192
- var compStyle = getComputedStyle(iframe);
193
-
194
- return {
195
- iframe: iframe,
196
- id: data[0],
197
- height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
198
- width: data[2],
199
- type: data[3]
200
- }
201
- }
202
-
203
- function getPaddingEnds(compStyle) {
204
- if (compStyle.boxSizing !== 'border-box') {
205
- return 0
206
- }
207
- var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
208
- var bot = compStyle.paddingBottom
209
- ? parseInt(compStyle.paddingBottom, 10)
210
- : 0;
211
- return top + bot
212
- }
213
-
214
- function getBorderEnds(compStyle) {
215
- if (compStyle.boxSizing !== 'border-box') {
216
- return 0
217
- }
218
- var top = compStyle.borderTopWidth
219
- ? parseInt(compStyle.borderTopWidth, 10)
220
- : 0;
221
- var bot = compStyle.borderBottomWidth
222
- ? parseInt(compStyle.borderBottomWidth, 10)
223
- : 0;
224
- return top + bot
225
- }
226
-
227
- function ensureInRange(Dimension) {
228
- var max = Number(settings[iframeId]['max' + Dimension]),
229
- min = Number(settings[iframeId]['min' + Dimension]),
230
- dimension = Dimension.toLowerCase(),
231
- size = Number(messageData[dimension]);
232
-
233
- log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
234
-
235
- if (size < min) {
236
- size = min;
237
- log(iframeId, 'Set ' + dimension + ' to min value');
238
- }
239
-
240
- if (size > max) {
241
- size = max;
242
- log(iframeId, 'Set ' + dimension + ' to max value');
243
- }
244
-
245
- messageData[dimension] = '' + size;
246
- }
247
-
248
- function isMessageFromIFrame() {
249
- function checkAllowedOrigin() {
250
- function checkList() {
251
- var i = 0,
252
- retCode = false;
253
-
254
- log(
255
- iframeId,
256
- 'Checking connection is from allowed list of origins: ' +
257
- checkOrigin
258
- );
259
-
260
- for (; i < checkOrigin.length; i++) {
261
- if (checkOrigin[i] === origin) {
262
- retCode = true;
263
- break
264
- }
265
- }
266
- return retCode
267
- }
268
-
269
- function checkSingle() {
270
- var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
271
- log(iframeId, 'Checking connection is from: ' + remoteHost);
272
- return origin === remoteHost
273
- }
274
-
275
- return checkOrigin.constructor === Array ? checkList() : checkSingle()
276
- }
277
-
278
- var origin = event.origin,
279
- checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
280
-
281
- if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
282
- throw new Error(
283
- 'Unexpected message received from: ' +
284
- origin +
285
- ' for ' +
286
- messageData.iframe.id +
287
- '. Message was: ' +
288
- event.data +
289
- '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
290
- )
291
- }
292
-
293
- return true
294
- }
295
-
296
- function isMessageForUs() {
297
- return (
298
- msgId === ('' + msg).slice(0, msgIdLen) &&
299
- msg.slice(msgIdLen).split(':')[0] in settings
300
- ) // ''+Protects against non-string msg
301
- }
302
-
303
- function isMessageFromMetaParent() {
304
- // Test if this message is from a parent above us. This is an ugly test, however, updating
305
- // the message format would break backwards compatibility.
306
- var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
307
-
308
- if (retCode) {
309
- log(iframeId, 'Ignoring init message from meta parent page');
310
- }
311
-
312
- return retCode
313
- }
314
-
315
- function getMsgBody(offset) {
316
- return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
317
- }
318
-
319
- function forwardMsgFromIFrame(msgBody) {
320
- log(
321
- iframeId,
322
- 'onMessage passed: {iframe: ' +
323
- messageData.iframe.id +
324
- ', message: ' +
325
- msgBody +
326
- '}'
327
- );
328
-
329
- on('onMessage', {
330
- iframe: messageData.iframe,
331
- message: JSON.parse(msgBody)
332
- });
333
-
334
- log(iframeId, '--');
335
- }
336
-
337
- function getPageInfo() {
338
- var bodyPosition = document.body.getBoundingClientRect(),
339
- iFramePosition = messageData.iframe.getBoundingClientRect();
340
-
341
- return JSON.stringify({
342
- iframeHeight: iFramePosition.height,
343
- iframeWidth: iFramePosition.width,
344
- clientHeight: Math.max(
345
- document.documentElement.clientHeight,
346
- window.innerHeight || 0
347
- ),
348
- clientWidth: Math.max(
349
- document.documentElement.clientWidth,
350
- window.innerWidth || 0
351
- ),
352
- offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
353
- offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
354
- scrollTop: window.pageYOffset,
355
- scrollLeft: window.pageXOffset,
356
- documentHeight: document.documentElement.clientHeight,
357
- documentWidth: document.documentElement.clientWidth,
358
- windowHeight: window.innerHeight,
359
- windowWidth: window.innerWidth
360
- })
361
- }
362
-
363
- function sendPageInfoToIframe(iframe, iframeId) {
364
- function debouncedTrigger() {
365
- trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
366
- }
367
- debounceFrameEvents(debouncedTrigger, 32, iframeId);
368
- }
369
-
370
- function startPageInfoMonitor() {
371
- function setListener(type, func) {
372
- function sendPageInfo() {
373
- if (settings[id]) {
374
- sendPageInfoToIframe(settings[id].iframe, id);
375
- } else {
376
- stop();
377
- }
378
- }
39
+ // eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
40
+ ;(function (undefined$1) {
41
+ if (typeof window === 'undefined') return // don't run for server side render
42
+
43
+ // var VERSION = '4.3.11'
44
+
45
+ var count = 0,
46
+ destroyObserver,
47
+ logEnabled = false,
48
+ hiddenCheckEnabled = false,
49
+ msgHeader = 'message',
50
+ msgHeaderLen = msgHeader.length,
51
+ msgId = '[iFrameSizer]', // Must match iframe msg ID
52
+ msgIdLen = msgId.length,
53
+ pagePosition = null,
54
+ requestAnimationFrame = window.requestAnimationFrame,
55
+ resetRequiredMethods = Object.freeze({
56
+ max: 1,
57
+ scroll: 1,
58
+ bodyScroll: 1,
59
+ documentElementScroll: 1
60
+ }),
61
+ settings = {},
62
+ timer = null,
63
+ defaults = Object.freeze({
64
+ autoResize: true,
65
+ bodyBackground: null,
66
+ bodyMargin: null,
67
+ bodyMarginV1: 8,
68
+ bodyPadding: null,
69
+ checkOrigin: true,
70
+ inPageLinks: false,
71
+ enablePublicMethods: true,
72
+ heightCalculationMethod: 'bodyOffset',
73
+ id: 'iFrameResizer',
74
+ interval: 32,
75
+ license: '1jqr0si6pnt',
76
+ log: false,
77
+ maxHeight: Infinity,
78
+ maxWidth: Infinity,
79
+ minHeight: 0,
80
+ minWidth: 0,
81
+ mouseEvents: true,
82
+ resizeFrom: 'parent',
83
+ scrolling: false,
84
+ sizeHeight: true,
85
+ sizeWidth: false,
86
+ warningTimeout: 5000,
87
+ tolerance: 0,
88
+ widthCalculationMethod: 'scroll',
89
+ onClose: function () {
90
+ return true
91
+ },
92
+ onClosed: function () {},
93
+ onInit: function () {},
94
+ onMessage: function () {
95
+ warn('onMessage function not defined');
96
+ },
97
+ onMouseEnter: function () {},
98
+ onMouseLeave: function () {},
99
+ onResized: function () {},
100
+ onScroll: function () {
101
+ return true
102
+ }
103
+ });
104
+
105
+ function getMutationObserver() {
106
+ return (
107
+ window.MutationObserver ||
108
+ window.WebKitMutationObserver ||
109
+ window.MozMutationObserver
110
+ )
111
+ }
112
+
113
+ function addEventListener(el, evt, func) {
114
+ el.addEventListener(evt, func, false);
115
+ }
116
+
117
+ function removeEventListener(el, evt, func) {
118
+ el.removeEventListener(evt, func, false);
119
+ }
120
+
121
+ function setupRequestAnimationFrame() {
122
+ var vendors = ['moz', 'webkit', 'o', 'ms'];
123
+ var x;
124
+
125
+ // Remove vendor prefixing if prefixed and break early if not
126
+ for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
127
+ requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
128
+ }
129
+
130
+ if (requestAnimationFrame) {
131
+ // Firefox extension content-scripts have a globalThis object that is not the same as window.
132
+ // Binding `requestAnimationFrame` to window allows the function to work and prevents errors
133
+ // being thrown when run in that context, and should be a no-op in every other context.
134
+ requestAnimationFrame = requestAnimationFrame.bind(window);
135
+ } else {
136
+ log('setup', 'RequestAnimationFrame not supported');
137
+ }
138
+ }
139
+
140
+ function getMyID(iframeId) {
141
+ var retStr = 'Host page: ' + iframeId;
142
+
143
+ if (window.top !== window.self) {
144
+ retStr =
145
+ window.parentIFrame && window.parentIFrame.getId
146
+ ? window.parentIFrame.getId() + ': ' + iframeId
147
+ : 'Nested host page: ' + iframeId;
148
+ }
149
+
150
+ return retStr
151
+ }
152
+
153
+ function formatLogHeader(iframeId) {
154
+ return msgId + '[' + getMyID(iframeId) + ']'
155
+ }
156
+
157
+ function isLogEnabled(iframeId) {
158
+ return settings[iframeId] ? settings[iframeId].log : logEnabled
159
+ }
160
+
161
+ function log(iframeId, msg) {
162
+ output('log', iframeId, msg, isLogEnabled(iframeId));
163
+ }
164
+
165
+ function info(iframeId, msg) {
166
+ output('info', iframeId, msg, isLogEnabled(iframeId));
167
+ }
168
+
169
+ function warn(iframeId, msg) {
170
+ output('warn', iframeId, msg, true);
171
+ }
172
+
173
+ function output(type, iframeId, msg, enabled) {
174
+ if (true === enabled && 'object' === typeof window.console) {
175
+ // eslint-disable-next-line no-console
176
+ console[type](formatLogHeader(iframeId), msg);
177
+ }
178
+ }
179
+
180
+ function iFrameListener(event) {
181
+ function resizeIFrame() {
182
+ function resize() {
183
+ setSize(messageData);
184
+ setPagePosition(iframeId);
185
+ on('onResized', messageData);
186
+ }
187
+
188
+ ensureInRange('Height');
189
+ ensureInRange('Width');
190
+
191
+ syncResize(resize, messageData, 'init');
192
+ }
193
+
194
+ function processMsg() {
195
+ var data = msg.slice(msgIdLen).split(':');
196
+ var height = data[1] ? parseInt(data[1], 10) : 0;
197
+ var iframe = settings[data[0]] && settings[data[0]].iframe;
198
+ var compStyle = getComputedStyle(iframe);
199
+
200
+ return {
201
+ iframe: iframe,
202
+ id: data[0],
203
+ height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
204
+ width: data[2],
205
+ type: data[3]
206
+ }
207
+ }
208
+
209
+ function getPaddingEnds(compStyle) {
210
+ if (compStyle.boxSizing !== 'border-box') {
211
+ return 0
212
+ }
213
+ var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
214
+ var bot = compStyle.paddingBottom
215
+ ? parseInt(compStyle.paddingBottom, 10)
216
+ : 0;
217
+ return top + bot
218
+ }
219
+
220
+ function getBorderEnds(compStyle) {
221
+ if (compStyle.boxSizing !== 'border-box') {
222
+ return 0
223
+ }
224
+ var top = compStyle.borderTopWidth
225
+ ? parseInt(compStyle.borderTopWidth, 10)
226
+ : 0;
227
+ var bot = compStyle.borderBottomWidth
228
+ ? parseInt(compStyle.borderBottomWidth, 10)
229
+ : 0;
230
+ return top + bot
231
+ }
232
+
233
+ function ensureInRange(Dimension) {
234
+ var max = Number(settings[iframeId]['max' + Dimension]),
235
+ min = Number(settings[iframeId]['min' + Dimension]),
236
+ dimension = Dimension.toLowerCase(),
237
+ size = Number(messageData[dimension]);
238
+
239
+ log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
240
+
241
+ if (size < min) {
242
+ size = min;
243
+ log(iframeId, 'Set ' + dimension + ' to min value');
244
+ }
245
+
246
+ if (size > max) {
247
+ size = max;
248
+ log(iframeId, 'Set ' + dimension + ' to max value');
249
+ }
250
+
251
+ messageData[dimension] = '' + size;
252
+ }
253
+
254
+ function isMessageFromIFrame() {
255
+ function checkAllowedOrigin() {
256
+ function checkList() {
257
+ var i = 0,
258
+ retCode = false;
259
+
260
+ log(
261
+ iframeId,
262
+ 'Checking connection is from allowed list of origins: ' +
263
+ checkOrigin
264
+ );
265
+
266
+ for (; i < checkOrigin.length; i++) {
267
+ if (checkOrigin[i] === origin) {
268
+ retCode = true;
269
+ break
270
+ }
271
+ }
272
+ return retCode
273
+ }
274
+
275
+ function checkSingle() {
276
+ var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
277
+ log(iframeId, 'Checking connection is from: ' + remoteHost);
278
+ return origin === remoteHost
279
+ }
280
+
281
+ return checkOrigin.constructor === Array ? checkList() : checkSingle()
282
+ }
283
+
284
+ var origin = event.origin,
285
+ checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
286
+
287
+ if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
288
+ throw new Error(
289
+ 'Unexpected message received from: ' +
290
+ origin +
291
+ ' for ' +
292
+ messageData.iframe.id +
293
+ '. Message was: ' +
294
+ event.data +
295
+ '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
296
+ )
297
+ }
298
+
299
+ return true
300
+ }
301
+
302
+ function isMessageForUs() {
303
+ return (
304
+ msgId === ('' + msg).slice(0, msgIdLen) &&
305
+ msg.slice(msgIdLen).split(':')[0] in settings
306
+ ) // ''+Protects against non-string msg
307
+ }
308
+
309
+ function isMessageFromMetaParent() {
310
+ // Test if this message is from a parent above us. This is an ugly test, however, updating
311
+ // the message format would break backwards compatibility.
312
+ var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
313
+
314
+ if (retCode) {
315
+ log(iframeId, 'Ignoring init message from meta parent page');
316
+ }
317
+
318
+ return retCode
319
+ }
320
+
321
+ function getMsgBody(offset) {
322
+ return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
323
+ }
324
+
325
+ function forwardMsgFromIFrame(msgBody) {
326
+ log(
327
+ iframeId,
328
+ 'onMessage passed: {iframe: ' +
329
+ messageData.iframe.id +
330
+ ', message: ' +
331
+ msgBody +
332
+ '}'
333
+ );
334
+
335
+ on('onMessage', {
336
+ iframe: messageData.iframe,
337
+ message: JSON.parse(msgBody)
338
+ });
339
+
340
+ log(iframeId, '--');
341
+ }
342
+
343
+ function getPageInfo() {
344
+ var bodyPosition = document.body.getBoundingClientRect(),
345
+ iFramePosition = messageData.iframe.getBoundingClientRect();
346
+
347
+ return JSON.stringify({
348
+ iframeHeight: iFramePosition.height,
349
+ iframeWidth: iFramePosition.width,
350
+ clientHeight: Math.max(
351
+ document.documentElement.clientHeight,
352
+ window.innerHeight || 0
353
+ ),
354
+ clientWidth: Math.max(
355
+ document.documentElement.clientWidth,
356
+ window.innerWidth || 0
357
+ ),
358
+ offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
359
+ offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
360
+ scrollTop: window.pageYOffset,
361
+ scrollLeft: window.pageXOffset,
362
+ documentHeight: document.documentElement.clientHeight,
363
+ documentWidth: document.documentElement.clientWidth,
364
+ windowHeight: window.innerHeight,
365
+ windowWidth: window.innerWidth
366
+ })
367
+ }
368
+
369
+ function sendPageInfoToIframe(iframe, iframeId) {
370
+ function debouncedTrigger() {
371
+ trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
372
+ }
373
+ debounceFrameEvents(debouncedTrigger, 32, iframeId);
374
+ }
375
+
376
+ function startPageInfoMonitor() {
377
+ function setListener(type, func) {
378
+ function sendPageInfo() {
379
+ if (settings[id]) {
380
+ sendPageInfoToIframe(settings[id].iframe, id);
381
+ } else {
382
+ stop();
383
+ }
384
+ }
379
385
  ['scroll', 'resize'].forEach(function (evt) {
380
- log(id, type + evt + ' listener for sendPageInfo');
381
- func(window, evt, sendPageInfo);
382
- });
383
- }
384
-
385
- function stop() {
386
- setListener('Remove ', removeEventListener);
387
- }
388
-
389
- function start() {
390
- setListener('Add ', addEventListener);
391
- }
392
-
393
- var id = iframeId; // Create locally scoped copy of iFrame ID
394
-
395
- start();
396
-
397
- if (settings[id]) {
398
- settings[id].stopPageInfo = stop;
399
- }
400
- }
401
-
402
- function stopPageInfoMonitor() {
403
- if (settings[iframeId] && settings[iframeId].stopPageInfo) {
404
- settings[iframeId].stopPageInfo();
405
- delete settings[iframeId].stopPageInfo;
406
- }
407
- }
408
-
409
- function checkIFrameExists() {
410
- var retBool = true;
411
-
412
- if (null === messageData.iframe) {
413
- warn(iframeId, 'IFrame (' + messageData.id + ') not found');
414
- retBool = false;
415
- }
416
- return retBool
417
- }
418
-
419
- function getElementPosition(target) {
420
- var iFramePosition = target.getBoundingClientRect();
421
-
422
- getPagePosition(iframeId);
423
-
424
- return {
425
- x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
426
- y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
427
- }
428
- }
429
-
430
- function scrollRequestFromChild(addOffset) {
431
- /* istanbul ignore next */ // Not testable in Karma
432
- function reposition() {
433
- pagePosition = newPosition;
434
- scrollTo();
435
- log(iframeId, '--');
436
- }
437
-
438
- function calcOffset() {
439
- return {
440
- x: Number(messageData.width) + offset.x,
441
- y: Number(messageData.height) + offset.y
442
- }
443
- }
444
-
445
- function scrollParent() {
446
- if (window.parentIFrame) {
447
- window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
448
- newPosition.x,
449
- newPosition.y
450
- );
451
- } else {
452
- warn(
453
- iframeId,
454
- 'Unable to scroll to requested position, window.parentIFrame not found'
455
- );
456
- }
457
- }
458
-
459
- var offset = addOffset
460
- ? getElementPosition(messageData.iframe)
461
- : { x: 0, y: 0 },
462
- newPosition = calcOffset();
463
-
464
- log(
465
- iframeId,
466
- 'Reposition requested from iFrame (offset x:' +
467
- offset.x +
468
- ' y:' +
469
- offset.y +
470
- ')'
471
- );
472
-
473
- if (window.top === window.self) {
474
- reposition();
475
- } else {
476
- scrollParent();
477
- }
478
- }
479
-
480
- function scrollTo() {
481
- if (false === on('onScroll', pagePosition)) {
482
- unsetPagePosition();
483
- } else {
484
- setPagePosition(iframeId);
485
- }
486
- }
487
-
488
- function findTarget(location) {
489
- function jumpToTarget() {
490
- var jumpPosition = getElementPosition(target);
491
-
492
- log(
493
- iframeId,
494
- 'Moving to in page link (#' +
495
- hash +
496
- ') at x: ' +
497
- jumpPosition.x +
498
- ' y: ' +
499
- jumpPosition.y
500
- );
501
- pagePosition = {
502
- x: jumpPosition.x,
503
- y: jumpPosition.y
504
- };
505
-
506
- scrollTo();
507
- log(iframeId, '--');
508
- }
509
-
510
- function jumpToParent() {
511
- if (window.parentIFrame) {
512
- window.parentIFrame.moveToAnchor(hash);
513
- } else {
514
- log(
515
- iframeId,
516
- 'In page link #' +
517
- hash +
518
- ' not found and window.parentIFrame not found'
519
- );
520
- }
521
- }
522
-
523
- var hash = location.split('#')[1] || '',
524
- hashData = decodeURIComponent(hash),
525
- target =
526
- document.getElementById(hashData) ||
527
- document.getElementsByName(hashData)[0];
528
-
529
- if (target) {
530
- jumpToTarget();
531
- } else if (window.top === window.self) {
532
- log(iframeId, 'In page link #' + hash + ' not found');
533
- } else {
534
- jumpToParent();
535
- }
536
- }
537
-
538
- function onMouse(event) {
539
- var mousePos = {};
540
-
541
- if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
542
- var data = getMsgBody(9).split(':');
543
- mousePos = {
544
- x: data[1],
545
- y: data[0]
546
- };
547
- } else {
548
- mousePos = {
549
- x: messageData.width,
550
- y: messageData.height
551
- };
552
- }
553
-
554
- on(event, {
555
- iframe: messageData.iframe,
556
- screenX: Number(mousePos.x),
557
- screenY: Number(mousePos.y),
558
- type: messageData.type
559
- });
560
- }
561
-
562
- function on(funcName, val) {
563
- return chkEvent(iframeId, funcName, val)
564
- }
565
-
566
- function actionMsg() {
567
- if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
568
-
569
- switch (messageData.type) {
570
- case 'close': {
571
- closeIFrame(messageData.iframe);
572
- break
573
- }
574
-
575
- case 'message': {
576
- forwardMsgFromIFrame(getMsgBody(6));
577
- break
578
- }
579
-
580
- case 'mouseenter': {
581
- onMouse('onMouseEnter');
582
- break
583
- }
584
-
585
- case 'mouseleave': {
586
- onMouse('onMouseLeave');
587
- break
588
- }
589
-
590
- case 'autoResize': {
591
- settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
592
- break
593
- }
594
-
595
- case 'scrollTo': {
596
- scrollRequestFromChild(false);
597
- break
598
- }
599
-
600
- case 'scrollToOffset': {
601
- scrollRequestFromChild(true);
602
- break
603
- }
604
-
605
- case 'pageInfo': {
606
- sendPageInfoToIframe(
607
- settings[iframeId] && settings[iframeId].iframe,
608
- iframeId
609
- );
610
- startPageInfoMonitor();
611
- break
612
- }
613
-
614
- case 'pageInfoStop': {
615
- stopPageInfoMonitor();
616
- break
617
- }
618
-
619
- case 'inPageLink': {
620
- findTarget(getMsgBody(9));
621
- break
622
- }
623
-
624
- case 'reset': {
625
- resetIFrame(messageData);
626
- break
627
- }
628
-
629
- case 'init': {
630
- resizeIFrame();
631
- on('onInit', messageData.iframe);
632
- break
633
- }
634
-
635
- default: {
636
- if (
637
- Number(messageData.width) === 0 &&
638
- Number(messageData.height) === 0
639
- ) {
640
- warn(
641
- 'Unsupported message received (' +
642
- messageData.type +
643
- '), this is likely due to the iframe containing a later ' +
644
- 'version of iframe-resizer than the parent page'
645
- );
646
- } else {
647
- resizeIFrame();
648
- }
649
- }
650
- }
651
- }
652
-
653
- function hasSettings(iframeId) {
654
- var retBool = true;
655
-
656
- if (!settings[iframeId]) {
657
- retBool = false;
658
- warn(
659
- messageData.type +
660
- ' No settings for ' +
661
- iframeId +
662
- '. Message was: ' +
663
- msg
664
- );
665
- }
666
-
667
- return retBool
668
- }
669
-
670
- function iFrameReadyMsgReceived() {
671
- // eslint-disable-next-line no-restricted-syntax, guard-for-in
672
- for (var iframeId in settings) {
673
- trigger(
674
- 'iFrame requested init',
675
- createOutgoingMsg(iframeId),
676
- settings[iframeId].iframe,
677
- iframeId
678
- );
679
- }
680
- }
681
-
682
- function firstRun() {
683
- if (settings[iframeId]) {
684
- settings[iframeId].firstRun = false;
685
- }
686
- }
687
-
688
- var msg = event.data,
689
- messageData = {},
690
- iframeId = null;
691
-
692
- if ('[iFrameResizerChild]Ready' === msg) {
693
- iFrameReadyMsgReceived();
694
- } else if (isMessageForUs()) {
695
- messageData = processMsg();
696
- iframeId = messageData.id;
697
- if (settings[iframeId]) {
698
- settings[iframeId].loaded = true;
699
- }
700
-
701
- if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
702
- log(iframeId, 'Received: ' + msg);
703
-
704
- if (checkIFrameExists() && isMessageFromIFrame()) {
705
- actionMsg();
706
- }
707
- }
708
- } else {
709
- info(iframeId, 'Ignored: ' + msg);
710
- }
711
- }
712
-
713
- function chkEvent(iframeId, funcName, val) {
714
- var func = null,
715
- retVal = null;
716
-
717
- if (settings[iframeId]) {
718
- func = settings[iframeId][funcName];
719
-
720
- if ('function' === typeof func) {
721
- retVal = func(val);
722
- } else {
723
- throw new TypeError(
724
- funcName + ' on iFrame[' + iframeId + '] is not a function'
725
- )
726
- }
727
- }
728
-
729
- return retVal
730
- }
731
-
732
- function removeIframeListeners(iframe) {
733
- var iframeId = iframe.id;
734
- delete settings[iframeId];
735
- }
736
-
737
- function closeIFrame(iframe) {
738
- var iframeId = iframe.id;
739
- if (chkEvent(iframeId, 'onClose', iframeId) === false) {
740
- log(iframeId, 'Close iframe cancelled by onClose event');
741
- return
742
- }
743
- log(iframeId, 'Removing iFrame: ' + iframeId);
744
-
745
- try {
746
- // Catch race condition error with React
747
- if (iframe.parentNode) {
748
- iframe.parentNode.removeChild(iframe);
749
- }
750
- } catch (error) {
751
- warn(error);
752
- }
753
-
754
- chkEvent(iframeId, 'onClosed', iframeId);
755
- log(iframeId, '--');
756
- removeIframeListeners(iframe);
757
- if (destroyObserver) {
758
- destroyObserver.disconnect();
759
- destroyObserver = null;
760
- }
761
- }
762
-
763
- function getPagePosition(iframeId) {
764
- if (null === pagePosition) {
765
- pagePosition = {
766
- x:
767
- window.pageXOffset === undefined$1
768
- ? document.documentElement.scrollLeft
769
- : window.pageXOffset,
770
- y:
771
- window.pageYOffset === undefined$1
772
- ? document.documentElement.scrollTop
773
- : window.pageYOffset
774
- };
775
- log(
776
- iframeId,
777
- 'Get page position: ' + pagePosition.x + ',' + pagePosition.y
778
- );
779
- }
780
- }
781
-
782
- function setPagePosition(iframeId) {
783
- if (null !== pagePosition) {
784
- window.scrollTo(pagePosition.x, pagePosition.y);
785
- log(
786
- iframeId,
787
- 'Set page position: ' + pagePosition.x + ',' + pagePosition.y
788
- );
789
- unsetPagePosition();
790
- }
791
- }
792
-
793
- function unsetPagePosition() {
794
- pagePosition = null;
795
- }
796
-
797
- function resetIFrame(messageData) {
798
- function reset() {
799
- setSize(messageData);
800
- trigger('reset', 'reset', messageData.iframe, messageData.id);
801
- }
802
-
803
- log(
804
- messageData.id,
805
- 'Size reset requested by ' +
806
- ('init' === messageData.type ? 'host page' : 'iFrame')
807
- );
808
- getPagePosition(messageData.id);
809
- syncResize(reset, messageData, 'reset');
810
- }
811
-
812
- function setSize(messageData) {
813
- function setDimension(dimension) {
814
- if (!messageData.id) {
815
- log('undefined', 'messageData id not set');
816
- return
817
- }
818
- messageData.iframe.style[dimension] = messageData[dimension] + 'px';
819
- log(
820
- messageData.id,
821
- 'IFrame (' +
822
- iframeId +
823
- ') ' +
824
- dimension +
825
- ' set to ' +
826
- messageData[dimension] +
827
- 'px'
828
- );
829
- }
830
-
831
- function chkZero(dimension) {
832
- // FireFox sets dimension of hidden iFrames to zero.
833
- // So if we detect that set up an event to check for
834
- // when iFrame becomes visible.
835
-
836
- /* istanbul ignore next */ // Not testable in PhantomJS
837
- if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
838
- hiddenCheckEnabled = true;
839
- log(iframeId, 'Hidden iFrame detected, creating visibility listener');
840
- fixHiddenIFrames();
841
- }
842
- }
843
-
844
- function processDimension(dimension) {
845
- setDimension(dimension);
846
- chkZero(dimension);
847
- }
848
-
849
- var iframeId = messageData.iframe.id;
850
-
851
- if (settings[iframeId]) {
852
- if (settings[iframeId].sizeHeight) {
853
- processDimension('height');
854
- }
855
- if (settings[iframeId].sizeWidth) {
856
- processDimension('width');
857
- }
858
- }
859
- }
860
-
861
- function syncResize(func, messageData, doNotSync) {
862
- /* istanbul ignore if */ // Not testable in PhantomJS
863
- if (
864
- doNotSync !== messageData.type &&
865
- requestAnimationFrame &&
866
- // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
867
- !window.jasmine
868
- ) {
869
- log(messageData.id, 'Requesting animation frame');
870
- requestAnimationFrame(func);
871
- } else {
872
- func();
873
- }
874
- }
875
-
876
- function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
877
- function postMessageToIFrame() {
878
- var target = settings[id] && settings[id].targetOrigin;
879
- log(
880
- id,
881
- '[' +
882
- calleeMsg +
883
- '] Sending msg to iframe[' +
884
- id +
885
- '] (' +
886
- msg +
887
- ') targetOrigin: ' +
888
- target
889
- );
890
- iframe.contentWindow.postMessage(msgId + msg, target);
891
- }
892
-
893
- function iFrameNotFound() {
894
- warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
895
- }
896
-
897
- function chkAndSend() {
898
- if (
899
- iframe &&
900
- 'contentWindow' in iframe &&
901
- null !== iframe.contentWindow
902
- ) {
903
- // Null test for PhantomJS
904
- postMessageToIFrame();
905
- } else {
906
- iFrameNotFound();
907
- }
908
- }
909
-
910
- function warnOnNoResponse() {
911
- function warning() {
912
- if (settings[id] && !settings[id].loaded && !errorShown) {
913
- errorShown = true;
914
- warn(
915
- id,
916
- 'IFrame has not responded within ' +
917
- settings[id].warningTimeout / 1000 +
918
- ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
919
- );
920
- }
921
- }
922
-
923
- if (
924
- !!noResponseWarning &&
925
- settings[id] &&
926
- !!settings[id].warningTimeout
927
- ) {
928
- settings[id].msgTimeout = setTimeout(
929
- warning,
930
- settings[id].warningTimeout
931
- );
932
- }
933
- }
934
-
935
- var errorShown = false;
936
-
937
- id = id || iframe.id;
938
-
939
- if (settings[id]) {
940
- chkAndSend();
941
- warnOnNoResponse();
942
- }
943
- }
944
-
945
- function createOutgoingMsg(iframeId) {
946
- return (
947
- iframeId +
948
- ':' +
949
- settings[iframeId].bodyMarginV1 +
950
- ':' +
951
- settings[iframeId].sizeWidth +
952
- ':' +
953
- settings[iframeId].log +
954
- ':' +
955
- settings[iframeId].interval +
956
- ':' +
957
- settings[iframeId].enablePublicMethods +
958
- ':' +
959
- settings[iframeId].autoResize +
960
- ':' +
961
- settings[iframeId].bodyMargin +
962
- ':' +
963
- settings[iframeId].heightCalculationMethod +
964
- ':' +
965
- settings[iframeId].bodyBackground +
966
- ':' +
967
- settings[iframeId].bodyPadding +
968
- ':' +
969
- settings[iframeId].tolerance +
970
- ':' +
971
- settings[iframeId].inPageLinks +
972
- ':' +
973
- settings[iframeId].resizeFrom +
974
- ':' +
975
- settings[iframeId].widthCalculationMethod +
976
- ':' +
977
- settings[iframeId].mouseEvents
978
- )
979
- }
980
-
981
- function isNumber(value) {
982
- return typeof value === 'number'
983
- }
984
-
985
- function setupIFrame(iframe, options) {
986
- function setLimits() {
987
- function addStyle(style) {
988
- var styleValue = settings[iframeId][style];
989
- if (Infinity !== styleValue && 0 !== styleValue) {
990
- iframe.style[style] = isNumber(styleValue)
991
- ? styleValue + 'px'
992
- : styleValue;
993
- log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
994
- }
995
- }
996
-
997
- function chkMinMax(dimension) {
998
- if (
999
- settings[iframeId]['min' + dimension] >
1000
- settings[iframeId]['max' + dimension]
1001
- ) {
1002
- throw new Error(
1003
- 'Value for min' +
1004
- dimension +
1005
- ' can not be greater than max' +
1006
- dimension
1007
- )
1008
- }
1009
- }
1010
-
1011
- chkMinMax('Height');
1012
- chkMinMax('Width');
1013
-
1014
- addStyle('maxHeight');
1015
- addStyle('minHeight');
1016
- addStyle('maxWidth');
1017
- addStyle('minWidth');
1018
- }
1019
-
1020
- function newId() {
1021
- var id = (options && options.id) || defaults.id + count++;
1022
- if (null !== document.getElementById(id)) {
1023
- id += count++;
1024
- }
1025
- return id
1026
- }
1027
-
1028
- function ensureHasId(iframeId) {
1029
- if (typeof iframeId !== 'string') {
1030
- throw new TypeError('Invaild id for iFrame. Expected String')
1031
- }
1032
-
1033
- if ('' === iframeId) {
1034
- // eslint-disable-next-line no-multi-assign
1035
- iframe.id = iframeId = newId();
1036
- logEnabled = (options || {}).log;
1037
- log(
1038
- iframeId,
1039
- 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
1040
- );
1041
- }
1042
-
1043
- return iframeId
1044
- }
1045
-
1046
- function setScrolling() {
1047
- log(
1048
- iframeId,
1049
- 'IFrame scrolling ' +
1050
- (settings[iframeId] && settings[iframeId].scrolling
1051
- ? 'enabled'
1052
- : 'disabled') +
1053
- ' for ' +
1054
- iframeId
1055
- );
1056
- iframe.style.overflow =
1057
- false === (settings[iframeId] && settings[iframeId].scrolling)
1058
- ? 'hidden'
1059
- : 'auto';
1060
- switch (settings[iframeId] && settings[iframeId].scrolling) {
1061
- case 'omit': {
1062
- break
1063
- }
1064
-
1065
- case true: {
1066
- iframe.scrolling = 'yes';
1067
- break
1068
- }
1069
-
1070
- case false: {
1071
- iframe.scrolling = 'no';
1072
- break
1073
- }
1074
-
1075
- default: {
1076
- iframe.scrolling = settings[iframeId]
1077
- ? settings[iframeId].scrolling
1078
- : 'no';
1079
- }
1080
- }
1081
- }
1082
-
1083
- // The V1 iFrame script expects an int, where as in V2 expects a CSS
1084
- // string value such as '1px 3em', so if we have an int for V2, set V1=V2
1085
- // and then convert V2 to a string PX value.
1086
- function setupBodyMarginValues() {
1087
- if (
1088
- 'number' ===
1089
- typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
1090
- '0' === (settings[iframeId] && settings[iframeId].bodyMargin)
1091
- ) {
1092
- settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
1093
- settings[iframeId].bodyMargin =
1094
- '' + settings[iframeId].bodyMargin + 'px';
1095
- }
1096
- }
1097
-
1098
- function checkReset() {
1099
- // Reduce scope of firstRun to function, because IE8's JS execution
1100
- // context stack is borked and this value gets externally
1101
- // changed midway through running this function!!!
1102
- var firstRun = settings[iframeId] && settings[iframeId].firstRun,
1103
- resetRequertMethod =
1104
- settings[iframeId] &&
1105
- settings[iframeId].heightCalculationMethod in resetRequiredMethods;
1106
-
1107
- if (!firstRun && resetRequertMethod) {
1108
- resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
1109
- }
1110
- }
1111
-
1112
- function setupIFrameObject() {
1113
- if (settings[iframeId]) {
1114
- settings[iframeId].iframe.iFrameResizer = {
1115
- close: closeIFrame.bind(null, settings[iframeId].iframe),
1116
-
1117
- removeListeners: removeIframeListeners.bind(
1118
- null,
1119
- settings[iframeId].iframe
1120
- ),
1121
-
1122
- resize: trigger.bind(
1123
- null,
1124
- 'Window resize',
1125
- 'resize',
1126
- settings[iframeId].iframe
1127
- ),
1128
-
1129
- moveToAnchor: function (anchor) {
1130
- trigger(
1131
- 'Move to anchor',
1132
- 'moveToAnchor:' + anchor,
1133
- settings[iframeId].iframe,
1134
- iframeId
1135
- );
1136
- },
1137
-
1138
- sendMessage: function (message) {
1139
- message = JSON.stringify(message);
1140
- trigger(
1141
- 'Send Message',
1142
- 'message:' + message,
1143
- settings[iframeId].iframe,
1144
- iframeId
1145
- );
1146
- }
1147
- };
1148
- }
1149
- }
1150
-
1151
- // We have to call trigger twice, as we can not be sure if all
1152
- // iframes have completed loading when this code runs. The
1153
- // event listener also catches the page changing in the iFrame.
1154
- function init(msg) {
1155
- function iFrameLoaded() {
1156
- trigger('iFrame.onload', msg, iframe, undefined$1, true);
1157
- checkReset();
1158
- }
1159
-
1160
- function createDestroyObserver(MutationObserver) {
1161
- if (!iframe.parentNode) {
1162
- return null
1163
- }
1164
-
1165
- var destroyObserver = new MutationObserver(function (mutations) {
1166
- mutations.forEach(function (mutation) {
1167
- var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
1168
- removedNodes.forEach(function (removedNode) {
1169
- if (removedNode === iframe) {
1170
- closeIFrame(iframe);
1171
- }
1172
- });
1173
- });
1174
- });
1175
- destroyObserver.observe(iframe.parentNode, {
1176
- childList: true
1177
- });
1178
- return destroyObserver
1179
- }
1180
-
1181
- var MutationObserver = getMutationObserver();
1182
- if (MutationObserver) {
1183
- destroyObserver = createDestroyObserver(MutationObserver);
1184
- }
1185
-
1186
- addEventListener(iframe, 'load', iFrameLoaded);
1187
- trigger('init', msg, iframe, undefined$1, true);
1188
- }
1189
-
1190
- function checkOptions(options) {
1191
- if ('object' !== typeof options) {
1192
- throw new TypeError('Options is not an object')
1193
- }
1194
- }
1195
-
1196
- function copyOptions(options) {
1197
- // eslint-disable-next-line no-restricted-syntax
1198
- for (var option in defaults) {
1199
- if (Object.prototype.hasOwnProperty.call(defaults, option)) {
1200
- settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
1201
- options,
1202
- option
1203
- )
1204
- ? options[option]
1205
- : defaults[option];
1206
- }
1207
- }
1208
- }
1209
-
1210
- function getTargetOrigin(remoteHost) {
1211
- return '' === remoteHost ||
1212
- null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
1213
- ? '*'
1214
- : remoteHost
1215
- }
1216
-
1217
- function depricate(key) {
1218
- var splitName = key.split('Callback');
1219
-
1220
- if (splitName.length === 2) {
1221
- var name =
1222
- 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
1223
- this[name] = this[key];
1224
- delete this[key];
1225
- warn(
1226
- iframeId,
1227
- "Deprecated: '" +
1228
- key +
1229
- "' has been renamed '" +
1230
- name +
1231
- "'. The old method will be removed in the next major version."
1232
- );
1233
- }
1234
- }
1235
-
1236
- function processOptions(options) {
1237
- options = options || {};
1238
-
1239
- settings[iframeId] = Object.create(null); // Protect against prototype attacks
1240
- settings[iframeId].iframe = iframe;
1241
- settings[iframeId].firstRun = true;
1242
- settings[iframeId].remoteHost =
1243
- iframe.src && iframe.src.split('/').slice(0, 3).join('/');
1244
-
1245
- checkOptions(options);
1246
- Object.keys(options).forEach(depricate, options);
1247
- copyOptions(options);
1248
-
1249
- if (settings[iframeId]) {
1250
- settings[iframeId].targetOrigin =
1251
- true === settings[iframeId].checkOrigin
1252
- ? getTargetOrigin(settings[iframeId].remoteHost)
1253
- : '*';
1254
- }
1255
- }
1256
-
1257
- function beenHere() {
1258
- return iframeId in settings && 'iFrameResizer' in iframe
1259
- }
1260
-
1261
- var iframeId = ensureHasId(iframe.id);
1262
-
1263
- if (beenHere()) {
1264
- warn(iframeId, 'Ignored iFrame, already setup.');
1265
- } else {
1266
- processOptions(options);
1267
- setScrolling();
1268
- setLimits();
1269
- setupBodyMarginValues();
1270
- init(createOutgoingMsg(iframeId));
1271
- setupIFrameObject();
1272
- }
1273
- }
1274
-
1275
- function debouce(fn, time) {
1276
- if (null === timer) {
1277
- timer = setTimeout(function () {
1278
- timer = null;
1279
- fn();
1280
- }, time);
1281
- }
1282
- }
1283
-
1284
- var frameTimer = {};
1285
- function debounceFrameEvents(fn, time, frameId) {
1286
- if (!frameTimer[frameId]) {
1287
- frameTimer[frameId] = setTimeout(function () {
1288
- frameTimer[frameId] = null;
1289
- fn();
1290
- }, time);
1291
- }
1292
- }
1293
-
1294
- // Not testable in PhantomJS
1295
- /* istanbul ignore next */
1296
-
1297
- function fixHiddenIFrames() {
1298
- function checkIFrames() {
1299
- function checkIFrame(settingId) {
1300
- function chkDimension(dimension) {
1301
- return (
1302
- '0px' ===
1303
- (settings[settingId] && settings[settingId].iframe.style[dimension])
1304
- )
1305
- }
1306
-
1307
- function isVisible(el) {
1308
- return null !== el.offsetParent
1309
- }
1310
-
1311
- if (
1312
- settings[settingId] &&
1313
- isVisible(settings[settingId].iframe) &&
1314
- (chkDimension('height') || chkDimension('width'))
1315
- ) {
1316
- trigger(
1317
- 'Visibility change',
1318
- 'resize',
1319
- settings[settingId].iframe,
1320
- settingId
1321
- );
1322
- }
1323
- }
1324
-
1325
- Object.keys(settings).forEach(function (key) {
1326
- checkIFrame(key);
1327
- });
1328
- }
1329
-
1330
- function mutationObserved(mutations) {
1331
- log(
1332
- 'window',
1333
- 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
1334
- );
1335
- debouce(checkIFrames, 16);
1336
- }
1337
-
1338
- function createMutationObserver() {
1339
- var target = document.querySelector('body'),
1340
- config = {
1341
- attributes: true,
1342
- attributeOldValue: false,
1343
- characterData: true,
1344
- characterDataOldValue: false,
1345
- childList: true,
1346
- subtree: true
1347
- },
1348
- observer = new MutationObserver(mutationObserved);
1349
-
1350
- observer.observe(target, config);
1351
- }
1352
-
1353
- var MutationObserver = getMutationObserver();
1354
- if (MutationObserver) {
1355
- createMutationObserver();
1356
- }
1357
- }
1358
-
1359
- function resizeIFrames(event) {
1360
- function resize() {
1361
- sendTriggerMsg('Window ' + event, 'resize');
1362
- }
1363
-
1364
- log('window', 'Trigger event: ' + event);
1365
- debouce(resize, 16);
1366
- }
1367
-
1368
- // Not testable in PhantomJS
1369
- /* istanbul ignore next */
1370
- function tabVisible() {
1371
- function resize() {
1372
- sendTriggerMsg('Tab Visible', 'resize');
1373
- }
1374
-
1375
- if ('hidden' !== document.visibilityState) {
1376
- log('document', 'Trigger event: Visibility change');
1377
- debouce(resize, 16);
1378
- }
1379
- }
1380
-
1381
- function sendTriggerMsg(eventName, event) {
1382
- function isIFrameResizeEnabled(iframeId) {
1383
- return (
1384
- settings[iframeId] &&
1385
- 'parent' === settings[iframeId].resizeFrom &&
1386
- settings[iframeId].autoResize &&
1387
- !settings[iframeId].firstRun
1388
- )
1389
- }
1390
-
1391
- Object.keys(settings).forEach(function (iframeId) {
1392
- if (isIFrameResizeEnabled(iframeId)) {
1393
- trigger(eventName, event, settings[iframeId].iframe, iframeId);
1394
- }
1395
- });
1396
- }
1397
-
1398
- function setupEventListeners() {
1399
- addEventListener(window, 'message', iFrameListener);
1400
-
1401
- addEventListener(window, 'resize', function () {
1402
- resizeIFrames('resize');
1403
- });
1404
-
1405
- addEventListener(document, 'visibilitychange', tabVisible);
1406
-
1407
- addEventListener(document, '-webkit-visibilitychange', tabVisible);
1408
- }
1409
-
1410
- function factory() {
1411
- function init(options, element) {
1412
- function chkType() {
1413
- if (!element.tagName) {
1414
- throw new TypeError('Object is not a valid DOM element')
1415
- } else if ('IFRAME' !== element.tagName.toUpperCase()) {
1416
- throw new TypeError(
1417
- 'Expected <IFRAME> tag, found <' + element.tagName + '>'
1418
- )
1419
- }
1420
- }
1421
-
1422
- if (element) {
1423
- chkType();
1424
- setupIFrame(element, options);
1425
- iFrames.push(element);
1426
- }
1427
- }
1428
-
1429
- function warnDeprecatedOptions(options) {
1430
- if (options && options.enablePublicMethods) {
1431
- warn(
1432
- 'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
1433
- );
1434
- }
1435
- }
1436
-
1437
- var iFrames;
1438
-
1439
- setupRequestAnimationFrame();
1440
- setupEventListeners();
1441
-
1442
- return function iFrameResizeF(options, target) {
1443
- iFrames = []; // Only return iFrames past in on this call
1444
-
1445
- warnDeprecatedOptions(options);
1446
-
1447
- switch (typeof target) {
1448
- case 'undefined':
1449
- case 'string': {
1450
- Array.prototype.forEach.call(
1451
- document.querySelectorAll(target || 'iframe'),
1452
- init.bind(undefined$1, options)
1453
- );
1454
- break
1455
- }
1456
-
1457
- case 'object': {
1458
- init(options, target);
1459
- break
1460
- }
1461
-
1462
- default: {
1463
- throw new TypeError('Unexpected data type (' + typeof target + ')')
1464
- }
1465
- }
1466
-
1467
- return iFrames
1468
- }
1469
- }
1470
-
1471
- function createJQueryPublicMethod($) {
1472
- if (!$.fn) {
1473
- info('', 'Unable to bind to jQuery, it is not fully loaded.');
1474
- } else if (!$.fn.iFrameResize) {
1475
- $.fn.iFrameResize = function $iFrameResizeF(options) {
1476
- function init(index, element) {
1477
- setupIFrame(element, options);
1478
- }
1479
-
1480
- return this.filter('iframe').each(init).end()
1481
- };
1482
- }
1483
- }
1484
-
1485
- if (window.jQuery !== undefined$1) {
1486
- createJQueryPublicMethod(window.jQuery);
1487
- }
1488
-
1489
- if (typeof undefined$1 === 'function' && undefined$1.amd) {
1490
- undefined$1([], factory);
1491
- } else {
1492
- // Node for browserfy
1493
- module.exports = factory();
1494
- }
1495
- window.iFrameResize = window.iFrameResize || factory();
1496
- })();
1497
- }(iframeResizer));
386
+ log(id, type + evt + ' listener for sendPageInfo');
387
+ func(window, evt, sendPageInfo);
388
+ });
389
+ }
390
+
391
+ function stop() {
392
+ setListener('Remove ', removeEventListener);
393
+ }
394
+
395
+ function start() {
396
+ setListener('Add ', addEventListener);
397
+ }
398
+
399
+ var id = iframeId; // Create locally scoped copy of iFrame ID
400
+
401
+ start();
402
+
403
+ if (settings[id]) {
404
+ settings[id].stopPageInfo = stop;
405
+ }
406
+ }
407
+
408
+ function stopPageInfoMonitor() {
409
+ if (settings[iframeId] && settings[iframeId].stopPageInfo) {
410
+ settings[iframeId].stopPageInfo();
411
+ delete settings[iframeId].stopPageInfo;
412
+ }
413
+ }
414
+
415
+ function checkIFrameExists() {
416
+ var retBool = true;
417
+
418
+ if (null === messageData.iframe) {
419
+ warn(iframeId, 'IFrame (' + messageData.id + ') not found');
420
+ retBool = false;
421
+ }
422
+ return retBool
423
+ }
424
+
425
+ function getElementPosition(target) {
426
+ var iFramePosition = target.getBoundingClientRect();
427
+
428
+ getPagePosition(iframeId);
429
+
430
+ return {
431
+ x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
432
+ y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
433
+ }
434
+ }
435
+
436
+ function scrollRequestFromChild(addOffset) {
437
+ /* istanbul ignore next */ // Not testable in Karma
438
+ function reposition() {
439
+ pagePosition = newPosition;
440
+ scrollTo();
441
+ log(iframeId, '--');
442
+ }
443
+
444
+ function calcOffset() {
445
+ return {
446
+ x: Number(messageData.width) + offset.x,
447
+ y: Number(messageData.height) + offset.y
448
+ }
449
+ }
450
+
451
+ function scrollParent() {
452
+ if (window.parentIFrame) {
453
+ window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
454
+ newPosition.x,
455
+ newPosition.y
456
+ );
457
+ } else {
458
+ warn(
459
+ iframeId,
460
+ 'Unable to scroll to requested position, window.parentIFrame not found'
461
+ );
462
+ }
463
+ }
464
+
465
+ var offset = addOffset
466
+ ? getElementPosition(messageData.iframe)
467
+ : { x: 0, y: 0 },
468
+ newPosition = calcOffset();
469
+
470
+ log(
471
+ iframeId,
472
+ 'Reposition requested from iFrame (offset x:' +
473
+ offset.x +
474
+ ' y:' +
475
+ offset.y +
476
+ ')'
477
+ );
478
+
479
+ if (window.top === window.self) {
480
+ reposition();
481
+ } else {
482
+ scrollParent();
483
+ }
484
+ }
485
+
486
+ function scrollTo() {
487
+ if (false === on('onScroll', pagePosition)) {
488
+ unsetPagePosition();
489
+ } else {
490
+ setPagePosition(iframeId);
491
+ }
492
+ }
493
+
494
+ function findTarget(location) {
495
+ function jumpToTarget() {
496
+ var jumpPosition = getElementPosition(target);
497
+
498
+ log(
499
+ iframeId,
500
+ 'Moving to in page link (#' +
501
+ hash +
502
+ ') at x: ' +
503
+ jumpPosition.x +
504
+ ' y: ' +
505
+ jumpPosition.y
506
+ );
507
+ pagePosition = {
508
+ x: jumpPosition.x,
509
+ y: jumpPosition.y
510
+ };
511
+
512
+ scrollTo();
513
+ log(iframeId, '--');
514
+ }
515
+
516
+ function jumpToParent() {
517
+ if (window.parentIFrame) {
518
+ window.parentIFrame.moveToAnchor(hash);
519
+ } else {
520
+ log(
521
+ iframeId,
522
+ 'In page link #' +
523
+ hash +
524
+ ' not found and window.parentIFrame not found'
525
+ );
526
+ }
527
+ }
528
+
529
+ var hash = location.split('#')[1] || '',
530
+ hashData = decodeURIComponent(hash),
531
+ target =
532
+ document.getElementById(hashData) ||
533
+ document.getElementsByName(hashData)[0];
534
+
535
+ if (target) {
536
+ jumpToTarget();
537
+ } else if (window.top === window.self) {
538
+ log(iframeId, 'In page link #' + hash + ' not found');
539
+ } else {
540
+ jumpToParent();
541
+ }
542
+ }
543
+
544
+ function onMouse(event) {
545
+ var mousePos = {};
546
+
547
+ if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
548
+ var data = getMsgBody(9).split(':');
549
+ mousePos = {
550
+ x: data[1],
551
+ y: data[0]
552
+ };
553
+ } else {
554
+ mousePos = {
555
+ x: messageData.width,
556
+ y: messageData.height
557
+ };
558
+ }
559
+
560
+ on(event, {
561
+ iframe: messageData.iframe,
562
+ screenX: Number(mousePos.x),
563
+ screenY: Number(mousePos.y),
564
+ type: messageData.type
565
+ });
566
+ }
567
+
568
+ function on(funcName, val) {
569
+ return chkEvent(iframeId, funcName, val)
570
+ }
571
+
572
+ function actionMsg() {
573
+ if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
574
+
575
+ switch (messageData.type) {
576
+ case 'close': {
577
+ closeIFrame(messageData.iframe);
578
+ break
579
+ }
580
+
581
+ case 'message': {
582
+ forwardMsgFromIFrame(getMsgBody(6));
583
+ break
584
+ }
585
+
586
+ case 'mouseenter': {
587
+ onMouse('onMouseEnter');
588
+ break
589
+ }
590
+
591
+ case 'mouseleave': {
592
+ onMouse('onMouseLeave');
593
+ break
594
+ }
595
+
596
+ case 'autoResize': {
597
+ settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
598
+ break
599
+ }
600
+
601
+ case 'scrollTo': {
602
+ scrollRequestFromChild(false);
603
+ break
604
+ }
605
+
606
+ case 'scrollToOffset': {
607
+ scrollRequestFromChild(true);
608
+ break
609
+ }
610
+
611
+ case 'pageInfo': {
612
+ sendPageInfoToIframe(
613
+ settings[iframeId] && settings[iframeId].iframe,
614
+ iframeId
615
+ );
616
+ startPageInfoMonitor();
617
+ break
618
+ }
619
+
620
+ case 'pageInfoStop': {
621
+ stopPageInfoMonitor();
622
+ break
623
+ }
624
+
625
+ case 'inPageLink': {
626
+ findTarget(getMsgBody(9));
627
+ break
628
+ }
629
+
630
+ case 'reset': {
631
+ resetIFrame(messageData);
632
+ break
633
+ }
634
+
635
+ case 'init': {
636
+ resizeIFrame();
637
+ on('onInit', messageData.iframe);
638
+ break
639
+ }
640
+
641
+ default: {
642
+ if (
643
+ Number(messageData.width) === 0 &&
644
+ Number(messageData.height) === 0
645
+ ) {
646
+ warn(
647
+ 'Unsupported message received (' +
648
+ messageData.type +
649
+ '), this is likely due to the iframe containing a later ' +
650
+ 'version of iframe-resizer than the parent page'
651
+ );
652
+ } else {
653
+ resizeIFrame();
654
+ }
655
+ }
656
+ }
657
+ }
658
+
659
+ function hasSettings(iframeId) {
660
+ var retBool = true;
661
+
662
+ if (!settings[iframeId]) {
663
+ retBool = false;
664
+ warn(
665
+ messageData.type +
666
+ ' No settings for ' +
667
+ iframeId +
668
+ '. Message was: ' +
669
+ msg
670
+ );
671
+ }
672
+
673
+ return retBool
674
+ }
675
+
676
+ function iFrameReadyMsgReceived() {
677
+ // eslint-disable-next-line no-restricted-syntax, guard-for-in
678
+ for (var iframeId in settings) {
679
+ trigger(
680
+ 'iFrame requested init',
681
+ createOutgoingMsg(iframeId),
682
+ settings[iframeId].iframe,
683
+ iframeId
684
+ );
685
+ }
686
+ }
687
+
688
+ function firstRun() {
689
+ if (settings[iframeId]) {
690
+ settings[iframeId].firstRun = false;
691
+ }
692
+ }
693
+
694
+ var msg = event.data,
695
+ messageData = {},
696
+ iframeId = null;
697
+
698
+ if ('[iFrameResizerChild]Ready' === msg) {
699
+ iFrameReadyMsgReceived();
700
+ } else if (isMessageForUs()) {
701
+ messageData = processMsg();
702
+ iframeId = messageData.id;
703
+ if (settings[iframeId]) {
704
+ settings[iframeId].loaded = true;
705
+ }
706
+
707
+ if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
708
+ log(iframeId, 'Received: ' + msg);
709
+
710
+ if (checkIFrameExists() && isMessageFromIFrame()) {
711
+ actionMsg();
712
+ }
713
+ }
714
+ } else {
715
+ info(iframeId, 'Ignored: ' + msg);
716
+ }
717
+ }
718
+
719
+ function chkEvent(iframeId, funcName, val) {
720
+ var func = null,
721
+ retVal = null;
722
+
723
+ if (settings[iframeId]) {
724
+ func = settings[iframeId][funcName];
725
+
726
+ if ('function' === typeof func) {
727
+ retVal = func(val);
728
+ } else {
729
+ throw new TypeError(
730
+ funcName + ' on iFrame[' + iframeId + '] is not a function'
731
+ )
732
+ }
733
+ }
734
+
735
+ return retVal
736
+ }
737
+
738
+ function removeIframeListeners(iframe) {
739
+ var iframeId = iframe.id;
740
+ delete settings[iframeId];
741
+ }
742
+
743
+ function closeIFrame(iframe) {
744
+ var iframeId = iframe.id;
745
+ if (chkEvent(iframeId, 'onClose', iframeId) === false) {
746
+ log(iframeId, 'Close iframe cancelled by onClose event');
747
+ return
748
+ }
749
+ log(iframeId, 'Removing iFrame: ' + iframeId);
750
+
751
+ try {
752
+ // Catch race condition error with React
753
+ if (iframe.parentNode) {
754
+ iframe.parentNode.removeChild(iframe);
755
+ }
756
+ } catch (error) {
757
+ warn(error);
758
+ }
759
+
760
+ chkEvent(iframeId, 'onClosed', iframeId);
761
+ log(iframeId, '--');
762
+ removeIframeListeners(iframe);
763
+ if (destroyObserver) {
764
+ destroyObserver.disconnect();
765
+ destroyObserver = null;
766
+ }
767
+ }
768
+
769
+ function getPagePosition(iframeId) {
770
+ if (null === pagePosition) {
771
+ pagePosition = {
772
+ x:
773
+ window.pageXOffset === undefined$1
774
+ ? document.documentElement.scrollLeft
775
+ : window.pageXOffset,
776
+ y:
777
+ window.pageYOffset === undefined$1
778
+ ? document.documentElement.scrollTop
779
+ : window.pageYOffset
780
+ };
781
+ log(
782
+ iframeId,
783
+ 'Get page position: ' + pagePosition.x + ',' + pagePosition.y
784
+ );
785
+ }
786
+ }
787
+
788
+ function setPagePosition(iframeId) {
789
+ if (null !== pagePosition) {
790
+ window.scrollTo(pagePosition.x, pagePosition.y);
791
+ log(
792
+ iframeId,
793
+ 'Set page position: ' + pagePosition.x + ',' + pagePosition.y
794
+ );
795
+ unsetPagePosition();
796
+ }
797
+ }
798
+
799
+ function unsetPagePosition() {
800
+ pagePosition = null;
801
+ }
802
+
803
+ function resetIFrame(messageData) {
804
+ function reset() {
805
+ setSize(messageData);
806
+ trigger('reset', 'reset', messageData.iframe, messageData.id);
807
+ }
808
+
809
+ log(
810
+ messageData.id,
811
+ 'Size reset requested by ' +
812
+ ('init' === messageData.type ? 'host page' : 'iFrame')
813
+ );
814
+ getPagePosition(messageData.id);
815
+ syncResize(reset, messageData, 'reset');
816
+ }
817
+
818
+ function setSize(messageData) {
819
+ function setDimension(dimension) {
820
+ if (!messageData.id) {
821
+ log('undefined', 'messageData id not set');
822
+ return
823
+ }
824
+ messageData.iframe.style[dimension] = messageData[dimension] + 'px';
825
+ log(
826
+ messageData.id,
827
+ 'IFrame (' +
828
+ iframeId +
829
+ ') ' +
830
+ dimension +
831
+ ' set to ' +
832
+ messageData[dimension] +
833
+ 'px'
834
+ );
835
+ }
836
+
837
+ function chkZero(dimension) {
838
+ // FireFox sets dimension of hidden iFrames to zero.
839
+ // So if we detect that set up an event to check for
840
+ // when iFrame becomes visible.
841
+
842
+ /* istanbul ignore next */ // Not testable in PhantomJS
843
+ if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
844
+ hiddenCheckEnabled = true;
845
+ log(iframeId, 'Hidden iFrame detected, creating visibility listener');
846
+ fixHiddenIFrames();
847
+ }
848
+ }
849
+
850
+ function processDimension(dimension) {
851
+ setDimension(dimension);
852
+ chkZero(dimension);
853
+ }
854
+
855
+ var iframeId = messageData.iframe.id;
856
+
857
+ if (settings[iframeId]) {
858
+ if (settings[iframeId].sizeHeight) {
859
+ processDimension('height');
860
+ }
861
+ if (settings[iframeId].sizeWidth) {
862
+ processDimension('width');
863
+ }
864
+ }
865
+ }
866
+
867
+ function syncResize(func, messageData, doNotSync) {
868
+ /* istanbul ignore if */ // Not testable in PhantomJS
869
+ if (
870
+ doNotSync !== messageData.type &&
871
+ requestAnimationFrame &&
872
+ // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
873
+ !window.jasmine
874
+ ) {
875
+ log(messageData.id, 'Requesting animation frame');
876
+ requestAnimationFrame(func);
877
+ } else {
878
+ func();
879
+ }
880
+ }
881
+
882
+ function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
883
+ function postMessageToIFrame() {
884
+ var target = settings[id] && settings[id].targetOrigin;
885
+ log(
886
+ id,
887
+ '[' +
888
+ calleeMsg +
889
+ '] Sending msg to iframe[' +
890
+ id +
891
+ '] (' +
892
+ msg +
893
+ ') targetOrigin: ' +
894
+ target
895
+ );
896
+ iframe.contentWindow.postMessage(msgId + msg, target);
897
+ }
898
+
899
+ function iFrameNotFound() {
900
+ warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
901
+ }
902
+
903
+ function chkAndSend() {
904
+ if (
905
+ iframe &&
906
+ 'contentWindow' in iframe &&
907
+ null !== iframe.contentWindow
908
+ ) {
909
+ // Null test for PhantomJS
910
+ postMessageToIFrame();
911
+ } else {
912
+ iFrameNotFound();
913
+ }
914
+ }
915
+
916
+ function warnOnNoResponse() {
917
+ function warning() {
918
+ if (settings[id] && !settings[id].loaded && !errorShown) {
919
+ errorShown = true;
920
+ warn(
921
+ id,
922
+ 'IFrame has not responded within ' +
923
+ settings[id].warningTimeout / 1000 +
924
+ ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
925
+ );
926
+ }
927
+ }
928
+
929
+ if (
930
+ !!noResponseWarning &&
931
+ settings[id] &&
932
+ !!settings[id].warningTimeout
933
+ ) {
934
+ settings[id].msgTimeout = setTimeout(
935
+ warning,
936
+ settings[id].warningTimeout
937
+ );
938
+ }
939
+ }
940
+
941
+ var errorShown = false;
942
+
943
+ id = id || iframe.id;
944
+
945
+ if (settings[id]) {
946
+ chkAndSend();
947
+ warnOnNoResponse();
948
+ }
949
+ }
950
+
951
+ function createOutgoingMsg(iframeId) {
952
+ return (
953
+ iframeId +
954
+ ':' +
955
+ settings[iframeId].bodyMarginV1 +
956
+ ':' +
957
+ settings[iframeId].sizeWidth +
958
+ ':' +
959
+ settings[iframeId].log +
960
+ ':' +
961
+ settings[iframeId].interval +
962
+ ':' +
963
+ settings[iframeId].enablePublicMethods +
964
+ ':' +
965
+ settings[iframeId].autoResize +
966
+ ':' +
967
+ settings[iframeId].bodyMargin +
968
+ ':' +
969
+ settings[iframeId].heightCalculationMethod +
970
+ ':' +
971
+ settings[iframeId].bodyBackground +
972
+ ':' +
973
+ settings[iframeId].bodyPadding +
974
+ ':' +
975
+ settings[iframeId].tolerance +
976
+ ':' +
977
+ settings[iframeId].inPageLinks +
978
+ ':' +
979
+ settings[iframeId].resizeFrom +
980
+ ':' +
981
+ settings[iframeId].widthCalculationMethod +
982
+ ':' +
983
+ settings[iframeId].mouseEvents
984
+ )
985
+ }
986
+
987
+ function isNumber(value) {
988
+ return typeof value === 'number'
989
+ }
990
+
991
+ function setupIFrame(iframe, options) {
992
+ function setLimits() {
993
+ function addStyle(style) {
994
+ var styleValue = settings[iframeId][style];
995
+ if (Infinity !== styleValue && 0 !== styleValue) {
996
+ iframe.style[style] = isNumber(styleValue)
997
+ ? styleValue + 'px'
998
+ : styleValue;
999
+ log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
1000
+ }
1001
+ }
1002
+
1003
+ function chkMinMax(dimension) {
1004
+ if (
1005
+ settings[iframeId]['min' + dimension] >
1006
+ settings[iframeId]['max' + dimension]
1007
+ ) {
1008
+ throw new Error(
1009
+ 'Value for min' +
1010
+ dimension +
1011
+ ' can not be greater than max' +
1012
+ dimension
1013
+ )
1014
+ }
1015
+ }
1016
+
1017
+ chkMinMax('Height');
1018
+ chkMinMax('Width');
1019
+
1020
+ addStyle('maxHeight');
1021
+ addStyle('minHeight');
1022
+ addStyle('maxWidth');
1023
+ addStyle('minWidth');
1024
+ }
1025
+
1026
+ function newId() {
1027
+ var id = (options && options.id) || defaults.id + count++;
1028
+ if (null !== document.getElementById(id)) {
1029
+ id += count++;
1030
+ }
1031
+ return id
1032
+ }
1033
+
1034
+ function ensureHasId(iframeId) {
1035
+ if (typeof iframeId !== 'string') {
1036
+ throw new TypeError('Invaild id for iFrame. Expected String')
1037
+ }
1038
+
1039
+ if ('' === iframeId) {
1040
+ // eslint-disable-next-line no-multi-assign
1041
+ iframe.id = iframeId = newId();
1042
+ logEnabled = (options || {}).log;
1043
+ log(
1044
+ iframeId,
1045
+ 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
1046
+ );
1047
+ }
1048
+
1049
+ return iframeId
1050
+ }
1051
+
1052
+ function setScrolling() {
1053
+ log(
1054
+ iframeId,
1055
+ 'IFrame scrolling ' +
1056
+ (settings[iframeId] && settings[iframeId].scrolling
1057
+ ? 'enabled'
1058
+ : 'disabled') +
1059
+ ' for ' +
1060
+ iframeId
1061
+ );
1062
+ iframe.style.overflow =
1063
+ false === (settings[iframeId] && settings[iframeId].scrolling)
1064
+ ? 'hidden'
1065
+ : 'auto';
1066
+ switch (settings[iframeId] && settings[iframeId].scrolling) {
1067
+ case 'omit': {
1068
+ break
1069
+ }
1070
+
1071
+ case true: {
1072
+ iframe.scrolling = 'yes';
1073
+ break
1074
+ }
1075
+
1076
+ case false: {
1077
+ iframe.scrolling = 'no';
1078
+ break
1079
+ }
1080
+
1081
+ default: {
1082
+ iframe.scrolling = settings[iframeId]
1083
+ ? settings[iframeId].scrolling
1084
+ : 'no';
1085
+ }
1086
+ }
1087
+ }
1088
+
1089
+ // The V1 iFrame script expects an int, where as in V2 expects a CSS
1090
+ // string value such as '1px 3em', so if we have an int for V2, set V1=V2
1091
+ // and then convert V2 to a string PX value.
1092
+ function setupBodyMarginValues() {
1093
+ if (
1094
+ 'number' ===
1095
+ typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
1096
+ '0' === (settings[iframeId] && settings[iframeId].bodyMargin)
1097
+ ) {
1098
+ settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
1099
+ settings[iframeId].bodyMargin =
1100
+ '' + settings[iframeId].bodyMargin + 'px';
1101
+ }
1102
+ }
1103
+
1104
+ function checkReset() {
1105
+ // Reduce scope of firstRun to function, because IE8's JS execution
1106
+ // context stack is borked and this value gets externally
1107
+ // changed midway through running this function!!!
1108
+ var firstRun = settings[iframeId] && settings[iframeId].firstRun,
1109
+ resetRequertMethod =
1110
+ settings[iframeId] &&
1111
+ settings[iframeId].heightCalculationMethod in resetRequiredMethods;
1112
+
1113
+ if (!firstRun && resetRequertMethod) {
1114
+ resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
1115
+ }
1116
+ }
1117
+
1118
+ function setupIFrameObject() {
1119
+ if (settings[iframeId]) {
1120
+ settings[iframeId].iframe.iFrameResizer = {
1121
+ close: closeIFrame.bind(null, settings[iframeId].iframe),
1122
+
1123
+ removeListeners: removeIframeListeners.bind(
1124
+ null,
1125
+ settings[iframeId].iframe
1126
+ ),
1127
+
1128
+ resize: trigger.bind(
1129
+ null,
1130
+ 'Window resize',
1131
+ 'resize',
1132
+ settings[iframeId].iframe
1133
+ ),
1134
+
1135
+ moveToAnchor: function (anchor) {
1136
+ trigger(
1137
+ 'Move to anchor',
1138
+ 'moveToAnchor:' + anchor,
1139
+ settings[iframeId].iframe,
1140
+ iframeId
1141
+ );
1142
+ },
1143
+
1144
+ sendMessage: function (message) {
1145
+ message = JSON.stringify(message);
1146
+ trigger(
1147
+ 'Send Message',
1148
+ 'message:' + message,
1149
+ settings[iframeId].iframe,
1150
+ iframeId
1151
+ );
1152
+ }
1153
+ };
1154
+ }
1155
+ }
1156
+
1157
+ // We have to call trigger twice, as we can not be sure if all
1158
+ // iframes have completed loading when this code runs. The
1159
+ // event listener also catches the page changing in the iFrame.
1160
+ function init(msg) {
1161
+ function iFrameLoaded() {
1162
+ trigger('iFrame.onload', msg, iframe, undefined$1, true);
1163
+ checkReset();
1164
+ }
1165
+
1166
+ function createDestroyObserver(MutationObserver) {
1167
+ if (!iframe.parentNode) {
1168
+ return null
1169
+ }
1170
+
1171
+ var destroyObserver = new MutationObserver(function (mutations) {
1172
+ mutations.forEach(function (mutation) {
1173
+ var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
1174
+ removedNodes.forEach(function (removedNode) {
1175
+ if (removedNode === iframe) {
1176
+ closeIFrame(iframe);
1177
+ }
1178
+ });
1179
+ });
1180
+ });
1181
+ destroyObserver.observe(iframe.parentNode, {
1182
+ childList: true
1183
+ });
1184
+ return destroyObserver
1185
+ }
1186
+
1187
+ var MutationObserver = getMutationObserver();
1188
+ if (MutationObserver) {
1189
+ destroyObserver = createDestroyObserver(MutationObserver);
1190
+ }
1191
+
1192
+ addEventListener(iframe, 'load', iFrameLoaded);
1193
+ trigger('init', msg, iframe, undefined$1, true);
1194
+ }
1195
+
1196
+ function checkOptions(options) {
1197
+ if ('object' !== typeof options) {
1198
+ throw new TypeError('Options is not an object')
1199
+ }
1200
+ }
1201
+
1202
+ function copyOptions(options) {
1203
+ // eslint-disable-next-line no-restricted-syntax
1204
+ for (var option in defaults) {
1205
+ if (Object.prototype.hasOwnProperty.call(defaults, option)) {
1206
+ settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
1207
+ options,
1208
+ option
1209
+ )
1210
+ ? options[option]
1211
+ : defaults[option];
1212
+ }
1213
+ }
1214
+ }
1215
+
1216
+ function getTargetOrigin(remoteHost) {
1217
+ return '' === remoteHost ||
1218
+ null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
1219
+ ? '*'
1220
+ : remoteHost
1221
+ }
1222
+
1223
+ function depricate(key) {
1224
+ var splitName = key.split('Callback');
1225
+
1226
+ if (splitName.length === 2) {
1227
+ var name =
1228
+ 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
1229
+ this[name] = this[key];
1230
+ delete this[key];
1231
+ warn(
1232
+ iframeId,
1233
+ "Deprecated: '" +
1234
+ key +
1235
+ "' has been renamed '" +
1236
+ name +
1237
+ "'. The old method will be removed in the next major version."
1238
+ );
1239
+ }
1240
+ }
1241
+
1242
+ function processOptions(options) {
1243
+ options = options || {};
1244
+
1245
+ settings[iframeId] = Object.create(null); // Protect against prototype attacks
1246
+ settings[iframeId].iframe = iframe;
1247
+ settings[iframeId].firstRun = true;
1248
+ settings[iframeId].remoteHost =
1249
+ iframe.src && iframe.src.split('/').slice(0, 3).join('/');
1250
+
1251
+ checkOptions(options);
1252
+ Object.keys(options).forEach(depricate, options);
1253
+ copyOptions(options);
1254
+
1255
+ if (settings[iframeId]) {
1256
+ settings[iframeId].targetOrigin =
1257
+ true === settings[iframeId].checkOrigin
1258
+ ? getTargetOrigin(settings[iframeId].remoteHost)
1259
+ : '*';
1260
+ }
1261
+ }
1262
+
1263
+ function beenHere() {
1264
+ return iframeId in settings && 'iFrameResizer' in iframe
1265
+ }
1266
+
1267
+ var iframeId = ensureHasId(iframe.id);
1268
+
1269
+ if (beenHere()) {
1270
+ warn(iframeId, 'Ignored iFrame, already setup.');
1271
+ } else {
1272
+ processOptions(options);
1273
+ setScrolling();
1274
+ setLimits();
1275
+ setupBodyMarginValues();
1276
+ init(createOutgoingMsg(iframeId));
1277
+ setupIFrameObject();
1278
+ }
1279
+ }
1280
+
1281
+ function debouce(fn, time) {
1282
+ if (null === timer) {
1283
+ timer = setTimeout(function () {
1284
+ timer = null;
1285
+ fn();
1286
+ }, time);
1287
+ }
1288
+ }
1289
+
1290
+ var frameTimer = {};
1291
+ function debounceFrameEvents(fn, time, frameId) {
1292
+ if (!frameTimer[frameId]) {
1293
+ frameTimer[frameId] = setTimeout(function () {
1294
+ frameTimer[frameId] = null;
1295
+ fn();
1296
+ }, time);
1297
+ }
1298
+ }
1299
+
1300
+ // Not testable in PhantomJS
1301
+ /* istanbul ignore next */
1302
+
1303
+ function fixHiddenIFrames() {
1304
+ function checkIFrames() {
1305
+ function checkIFrame(settingId) {
1306
+ function chkDimension(dimension) {
1307
+ return (
1308
+ '0px' ===
1309
+ (settings[settingId] && settings[settingId].iframe.style[dimension])
1310
+ )
1311
+ }
1312
+
1313
+ function isVisible(el) {
1314
+ return null !== el.offsetParent
1315
+ }
1316
+
1317
+ if (
1318
+ settings[settingId] &&
1319
+ isVisible(settings[settingId].iframe) &&
1320
+ (chkDimension('height') || chkDimension('width'))
1321
+ ) {
1322
+ trigger(
1323
+ 'Visibility change',
1324
+ 'resize',
1325
+ settings[settingId].iframe,
1326
+ settingId
1327
+ );
1328
+ }
1329
+ }
1330
+
1331
+ Object.keys(settings).forEach(function (key) {
1332
+ checkIFrame(key);
1333
+ });
1334
+ }
1335
+
1336
+ function mutationObserved(mutations) {
1337
+ log(
1338
+ 'window',
1339
+ 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
1340
+ );
1341
+ debouce(checkIFrames, 16);
1342
+ }
1343
+
1344
+ function createMutationObserver() {
1345
+ var target = document.querySelector('body'),
1346
+ config = {
1347
+ attributes: true,
1348
+ attributeOldValue: false,
1349
+ characterData: true,
1350
+ characterDataOldValue: false,
1351
+ childList: true,
1352
+ subtree: true
1353
+ },
1354
+ observer = new MutationObserver(mutationObserved);
1355
+
1356
+ observer.observe(target, config);
1357
+ }
1358
+
1359
+ var MutationObserver = getMutationObserver();
1360
+ if (MutationObserver) {
1361
+ createMutationObserver();
1362
+ }
1363
+ }
1364
+
1365
+ function resizeIFrames(event) {
1366
+ function resize() {
1367
+ sendTriggerMsg('Window ' + event, 'resize');
1368
+ }
1369
+
1370
+ log('window', 'Trigger event: ' + event);
1371
+ debouce(resize, 16);
1372
+ }
1373
+
1374
+ // Not testable in PhantomJS
1375
+ /* istanbul ignore next */
1376
+ function tabVisible() {
1377
+ function resize() {
1378
+ sendTriggerMsg('Tab Visible', 'resize');
1379
+ }
1380
+
1381
+ if ('hidden' !== document.visibilityState) {
1382
+ log('document', 'Trigger event: Visibility change');
1383
+ debouce(resize, 16);
1384
+ }
1385
+ }
1386
+
1387
+ function sendTriggerMsg(eventName, event) {
1388
+ function isIFrameResizeEnabled(iframeId) {
1389
+ return (
1390
+ settings[iframeId] &&
1391
+ 'parent' === settings[iframeId].resizeFrom &&
1392
+ settings[iframeId].autoResize &&
1393
+ !settings[iframeId].firstRun
1394
+ )
1395
+ }
1396
+
1397
+ Object.keys(settings).forEach(function (iframeId) {
1398
+ if (isIFrameResizeEnabled(iframeId)) {
1399
+ trigger(eventName, event, settings[iframeId].iframe, iframeId);
1400
+ }
1401
+ });
1402
+ }
1403
+
1404
+ function setupEventListeners() {
1405
+ addEventListener(window, 'message', iFrameListener);
1406
+
1407
+ addEventListener(window, 'resize', function () {
1408
+ resizeIFrames('resize');
1409
+ });
1410
+
1411
+ addEventListener(document, 'visibilitychange', tabVisible);
1412
+
1413
+ addEventListener(document, '-webkit-visibilitychange', tabVisible);
1414
+ }
1415
+
1416
+ function factory() {
1417
+ function init(options, element) {
1418
+ function chkType() {
1419
+ if (!element.tagName) {
1420
+ throw new TypeError('Object is not a valid DOM element')
1421
+ } else if ('IFRAME' !== element.tagName.toUpperCase()) {
1422
+ throw new TypeError(
1423
+ 'Expected <IFRAME> tag, found <' + element.tagName + '>'
1424
+ )
1425
+ }
1426
+ }
1427
+
1428
+ if (element) {
1429
+ chkType();
1430
+ setupIFrame(element, options);
1431
+ iFrames.push(element);
1432
+ }
1433
+ }
1434
+
1435
+ function warnDeprecatedOptions(options) {
1436
+ if (options && options.enablePublicMethods) {
1437
+ warn(
1438
+ 'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
1439
+ );
1440
+ }
1441
+ }
1442
+
1443
+ var iFrames;
1444
+
1445
+ setupRequestAnimationFrame();
1446
+ setupEventListeners();
1447
+
1448
+ return function iFrameResizeF(options, target) {
1449
+ iFrames = []; // Only return iFrames past in on this call
1450
+
1451
+ warnDeprecatedOptions(options);
1452
+
1453
+ switch (typeof target) {
1454
+ case 'undefined':
1455
+ case 'string': {
1456
+ Array.prototype.forEach.call(
1457
+ document.querySelectorAll(target || 'iframe'),
1458
+ init.bind(undefined$1, options)
1459
+ );
1460
+ break
1461
+ }
1462
+
1463
+ case 'object': {
1464
+ init(options, target);
1465
+ break
1466
+ }
1467
+
1468
+ default: {
1469
+ throw new TypeError('Unexpected data type (' + typeof target + ')')
1470
+ }
1471
+ }
1472
+
1473
+ return iFrames
1474
+ }
1475
+ }
1476
+
1477
+ function createJQueryPublicMethod($) {
1478
+ if (!$.fn) {
1479
+ info('', 'Unable to bind to jQuery, it is not fully loaded.');
1480
+ } else if (!$.fn.iFrameResize) {
1481
+ $.fn.iFrameResize = function $iFrameResizeF(options) {
1482
+ function init(index, element) {
1483
+ setupIFrame(element, options);
1484
+ }
1485
+
1486
+ return this.filter('iframe').each(init).end()
1487
+ };
1488
+ }
1489
+ }
1490
+
1491
+ if (window.jQuery !== undefined$1) {
1492
+ createJQueryPublicMethod(window.jQuery);
1493
+ }
1494
+
1495
+ {
1496
+ // Node for browserfy
1497
+ module.exports = factory();
1498
+ }
1499
+ window.iFrameResize = window.iFrameResize || factory();
1500
+ })();
1501
+ } (iframeResizer));
1502
+ return iframeResizer.exports;
1503
+ }
1498
1504
 
1499
- const iFrameResize = iframeResizer.exports;
1505
+ var iframeResizerExports = requireIframeResizer();
1506
+ var iFrameResize = /*@__PURE__*/getDefaultExportFromCjs(iframeResizerExports);
1500
1507
 
1501
1508
  /**
1502
1509
  * This approach decouples the communication logic from PaymentMethodForm component,
@@ -1541,6 +1548,8 @@ const IframeInput = /*@__PURE__*/ proxyCustomElement(class IframeInput extends H
1541
1548
  super();
1542
1549
  this.__registerHost();
1543
1550
  this.iframeLoaded = createEvent(this, "iframeLoaded", 7);
1551
+ this.isFocused = false;
1552
+ this.isValid = true;
1544
1553
  this.dispatchMessageEvent = (event) => {
1545
1554
  const { eventType, data } = event.data;
1546
1555
  if ((data === null || data === void 0 ? void 0 : data.id) !== this.inputId) {
@@ -1553,12 +1562,6 @@ const IframeInput = /*@__PURE__*/ proxyCustomElement(class IframeInput extends H
1553
1562
  this.isFocused = false;
1554
1563
  }
1555
1564
  };
1556
- this.isFocused = false;
1557
- this.isValid = true;
1558
- this.errorText = undefined;
1559
- this.inputId = undefined;
1560
- this.label = undefined;
1561
- this.iframeOrigin = undefined;
1562
1565
  }
1563
1566
  disconnectedCallback() {
1564
1567
  this.frameService.removeMessageListener(this.dispatchMessageEvent);
@@ -1614,10 +1617,10 @@ const IframeInput = /*@__PURE__*/ proxyCustomElement(class IframeInput extends H
1614
1617
  return params;
1615
1618
  }
1616
1619
  render() {
1617
- return (h(Host, { key: '0c7696f592d079436b8a91d33474f74de2922917', class: "form-group d-flex flex-column" }, h("div", { key: '947cd055eb77e78ec719da130fab97ca093e4954', style: {
1620
+ return (h(Host, { key: 'b3e863bb8ddced5c0f9493915c9fce9d80d8c567', class: "form-group d-flex flex-column" }, h("div", { key: '20f09bbfad447e157594beade6a081b2df7c19ba', style: {
1618
1621
  visibility: this.iframeLoaded ? 'visible' : 'hidden',
1619
1622
  height: this.iframeLoaded ? 'auto' : '0',
1620
- } }, h("label", { key: '59dfc89fb0ffb5163b9ea6c7eef12b1ff5bab5d2', class: "form-label", htmlFor: "", part: label }, this.label || ''), h("div", { key: 'cad88a50d0381285a1c125e1331c3e401327554d', class: `p-0 d-flex form-control ${this.isValid ? '' : 'is-invalid'}`, part: this.part, style: Object.assign(Object.assign({}, this.style), { overflow: 'hidden' }) }, h("iframe", { key: 'bf4af4cc965ddd4376b5780ea53824cb268c1952', id: this.inputId, name: this.inputId, src: `${this.iframeOrigin}?${this.urlParams}`, ref: el => {
1623
+ } }, h("label", { key: '9a85897b5ffd9ea350a59f33f08bd82fb94a2666', class: "form-label", htmlFor: "", part: label }, this.label || ''), h("div", { key: 'd2e01fc5b13b7a5a74eaf56a9825297545a7cd84', class: `p-0 d-flex form-control ${this.isValid ? '' : 'is-invalid'}`, part: this.part, style: Object.assign(Object.assign({}, this.style), { overflow: 'hidden' }) }, h("iframe", { key: '108f8164f00104f43e67f6b9c1cfcbc1a3ba077f', id: this.inputId, name: this.inputId, src: `${this.iframeOrigin}?${this.urlParams}`, ref: el => {
1621
1624
  this.iframeElement = el;
1622
1625
  this.initializeFrameCommunicationService();
1623
1626
  }, width: "100%", onLoad: () => {
@@ -1627,7 +1630,7 @@ const IframeInput = /*@__PURE__*/ proxyCustomElement(class IframeInput extends H
1627
1630
  this.iframeLoaded.emit();
1628
1631
  }
1629
1632
  }, this.iframeElement);
1630
- } })), h(FormControlErrorText, { key: '785e5ad09f32240299116d906f5a5dbf3f03ed5e', errorText: this.errorText, name: this.inputId }))));
1633
+ } })), h(FormControlErrorText, { key: 'a3e141a71221328cd341313be7ceb784846ef177', errorText: this.errorText, name: this.inputId }))));
1631
1634
  }
1632
1635
  get el() { return this; }
1633
1636
  }, [0, "iframe-input", {