@justifi/webcomponents 6.12.3 → 6.13.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (608) hide show
  1. package/dist/cjs/{Analytics-DcqsdFaD.js → Analytics-Be2I_aiS.js} +2 -3
  2. package/dist/cjs/{Plaid-BlSGeGpn.js → Plaid-Aw35bhCX.js} +62 -6
  3. package/dist/cjs/additional-questions-form-step_14.cjs.entry.js +151 -19
  4. package/dist/cjs/{justifi-additional-statement_8.cjs.entry.js → additional-statement_8.cjs.entry.js} +24 -24
  5. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  6. package/dist/cjs/{business-identity-schema-DWWtSiUF.js → business-identity-schema-DI9XFbaD.js} +67 -0
  7. package/dist/cjs/{business.service-BheJs82v.js → business.service-CylI3Qrg.js} +1 -2
  8. package/dist/cjs/card-form.cjs.entry.js +2 -2
  9. package/dist/cjs/{check-pkg-version-DFTQGZz1.js → check-pkg-version-BLLLh6v-.js} +1 -1
  10. package/dist/cjs/checkout-actions-8-MUczKw.js +62 -0
  11. package/dist/cjs/{checkout.service-DZKdHQQq.js → checkout.service-BYpinbSR.js} +1 -2
  12. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  13. package/dist/cjs/{justifi-dispute-notification_3.cjs.entry.js → dispute-notification_2.cjs.entry.js} +67 -90
  14. package/dist/cjs/{event-types-BWQT2lwu.js → event-types-DptNnCEP.js} +30 -0
  15. package/dist/cjs/form-address-fields_3.cjs.entry.js +2 -2
  16. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  17. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  18. package/dist/cjs/form-control-file.cjs.entry.js +2 -2
  19. package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
  20. package/dist/cjs/form-control-number_2.cjs.entry.js +89 -0
  21. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  22. package/dist/cjs/form-control-select_2.cjs.entry.js +4 -4
  23. package/dist/cjs/{get-business-TFzhaBXn.js → get-business-D10Tmct1.js} +2 -2
  24. package/dist/cjs/{get-payment-details-DL5FmIyF.js → get-payment-details-BB5aa48u.js} +2 -3
  25. package/dist/cjs/{get-subaccounts-CVK4O7th.js → get-subaccounts-CSD2nAqD.js} +2 -3
  26. package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
  27. package/dist/cjs/internal-button.cjs.entry.js +1 -1
  28. package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +15 -70
  29. package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -6
  30. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -6
  31. package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
  32. package/dist/cjs/justifi-business-details.cjs.entry.js +7 -8
  33. package/dist/cjs/justifi-business-form.cjs.entry.js +10 -12
  34. package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
  35. package/dist/cjs/justifi-card-form.cjs.entry.js +5 -6
  36. package/dist/cjs/justifi-checkout-qr-code.cjs.entry.js +3141 -0
  37. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
  38. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +3 -4
  39. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +190 -27
  40. package/dist/cjs/justifi-dispute-management.cjs.entry.js +65 -18
  41. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +11071 -23
  42. package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -10
  43. package/dist/cjs/justifi-payment-details.cjs.entry.js +16 -17
  44. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +7 -8
  45. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -8
  46. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  47. package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -8
  48. package/dist/cjs/justifi-payout-details.cjs.entry.js +10 -11
  49. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -8
  50. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +3 -4
  51. package/dist/cjs/justifi-payouts-list.cjs.entry.js +9 -10
  52. package/dist/cjs/justifi-qr-terminal.cjs.entry.js +208 -0
  53. package/dist/cjs/justifi-refund-payment.cjs.entry.js +7 -8
  54. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -6
  55. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  56. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +4 -5
  57. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +178 -24
  58. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +2 -3
  59. package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -9
  60. package/dist/cjs/loader.cjs.js +1 -1
  61. package/dist/cjs/{package-bM0MyhTf.js → package-gx36QXN1.js} +1 -1
  62. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  63. package/dist/cjs/{payment-provisioning-actions-BO7dzIm1.js → payment-provisioning-actions-DimM0KGV.js} +2 -2
  64. package/dist/cjs/{payment.service-sZKlg2Jq.js → payment.service-fy5bXXmA.js} +1 -2
  65. package/dist/cjs/{payout.service-BcQVsMCS.js → payout.service-hp3PTXWI.js} +1 -2
  66. package/dist/cjs/{payouts-status-CwgOMz-S.js → payouts-status-CF1YT_RL.js} +2 -2
  67. package/dist/cjs/{plaid.service-BcgO2VXC.js → plaid.service-9PmS4X0g.js} +1 -2
  68. package/dist/cjs/radio-list-item.cjs.entry.js +1 -1
  69. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  70. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  71. package/dist/cjs/{terminal.service-CjMMWSh3.js → terminal.service-D5D76Cnn.js} +1 -2
  72. package/dist/cjs/{utils-DbTucCTO.js → utils-Dcde8Zpt.js} +1 -1
  73. package/dist/cjs/webcomponents.cjs.js +1 -1
  74. package/dist/collection/api/Terminal.js +1 -1
  75. package/dist/collection/collection-manifest.json +12 -16
  76. package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +2 -2
  77. package/dist/collection/components/business-forms/owner-form/owner-form.js +226 -12
  78. package/dist/collection/components/checkout-qr-code/justifi-checkout-qr-code.js +128 -0
  79. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +2 -2
  80. package/dist/collection/components/checkouts-list/justifi-checkouts-list.js +166 -16
  81. package/dist/collection/components/dispute-management/{justifi-dispute-notification.js → dispute-notification.js} +5 -6
  82. package/dist/collection/components/dispute-management/dispute-response/{justifi-additional-statement.js → additional-statement.js} +3 -3
  83. package/dist/collection/components/dispute-management/dispute-response/{justifi-cancellation-policy.js → cancellation-policy.js} +3 -3
  84. package/dist/collection/components/dispute-management/dispute-response/{justifi-customer-details.js → customer-details.js} +3 -3
  85. package/dist/collection/components/dispute-management/dispute-response/{dispute-response-core.js → dispute-response.js} +105 -77
  86. package/dist/collection/components/dispute-management/dispute-response/{justifi-duplicate-charge.js → duplicate-charge.js} +3 -3
  87. package/dist/collection/components/dispute-management/dispute-response/{justifi-electronic-evidence.js → electronic-evidence.js} +3 -3
  88. package/dist/collection/components/dispute-management/dispute-response/{justifi-product-or-service.js → product-or-service.js} +3 -3
  89. package/dist/collection/components/dispute-management/dispute-response/{justifi-refund-policy.js → refund-policy.js} +3 -3
  90. package/dist/collection/components/dispute-management/dispute-response/{justifi-shipping-details.js → shipping-details.js} +3 -3
  91. package/dist/collection/components/dispute-management/justifi-dispute-management.js +78 -11
  92. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  93. package/dist/collection/components/gross-payment-chart/justifi-gross-payment-chart.js +79 -15
  94. package/dist/collection/components/modular-checkout/justifi-modular-checkout.js +1 -1
  95. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-billing-form-simple.js +1 -1
  96. package/dist/collection/components/modular-checkout/sub-components/justifi-bank-account-form.js +1 -1
  97. package/dist/collection/components/modular-checkout/sub-components/justifi-billing-form-full.js +1 -1
  98. package/dist/collection/components/modular-checkout/sub-components/justifi-card-billing-form-simple.js +1 -1
  99. package/dist/collection/components/modular-checkout/sub-components/justifi-card-form.js +1 -1
  100. package/dist/collection/components/modular-checkout/sub-components/justifi-checkout-summary.js +1 -1
  101. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  102. package/dist/collection/components/order-terminals/justifi-order-terminals.js +1 -1
  103. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  104. package/dist/collection/components/payment-details/justifi-payment-details.js +8 -8
  105. package/dist/collection/components/payment-transactions-list/justifi-payment-transactions-list.js +1 -1
  106. package/dist/collection/components/payments-list/justifi-payments-list-filters.js +2 -2
  107. package/dist/collection/components/payments-list/justifi-payments-list.js +1 -1
  108. package/dist/collection/components/payout-details/justifi-payout-details.js +3 -3
  109. package/dist/collection/components/payout-transactions-list/justifi-payout-transactions-list.js +1 -1
  110. package/dist/collection/components/payouts-list/justifi-payouts-list-filters.js +2 -2
  111. package/dist/collection/components/payouts-list/justifi-payouts-list.js +1 -1
  112. package/dist/collection/components/qr-terminal/justifi-qr-terminal.js +349 -0
  113. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list-filters.js +3 -3
  114. package/dist/collection/components/terminal-orders-list/justifi-terminal-orders-list.js +134 -10
  115. package/dist/collection/components/terminals-list/justifi-terminals-list-filters.js +1 -1
  116. package/dist/collection/components/terminals-list/justifi-terminals-list.js +1 -1
  117. package/dist/collection/components/tokenize-payment-method/justifi-tokenize-payment-method.js +1 -1
  118. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  119. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  120. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  121. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  122. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  123. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  124. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  125. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  126. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  127. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  128. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  129. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  130. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  131. package/dist/collection/ui-components/internal-button.js +1 -1
  132. package/dist/collection/ui-components/radio-list-item.js +1 -1
  133. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  134. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  135. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  136. package/dist/docs.json +5878 -6778
  137. package/dist/esm/{Analytics-Cyc3ZLPx.js → Analytics-DZWGizAK.js} +2 -3
  138. package/dist/esm/{Plaid-BuKEVgbB.js → Plaid-fhlY0CIN.js} +58 -3
  139. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  140. package/dist/esm/additional-questions-form-step_14.entry.js +156 -24
  141. package/dist/esm/additional-questions_5.entry.js +2 -2
  142. package/dist/esm/{justifi-additional-statement_8.entry.js → additional-statement_8.entry.js} +19 -19
  143. package/dist/esm/{badge-B6dp1XGV.js → badge-Dlcl9qdm.js} +1 -1
  144. package/dist/esm/bank-account-billing-form-simple_4.entry.js +5 -5
  145. package/dist/esm/bank-account-form.entry.js +4 -4
  146. package/dist/esm/bank-account-read-only-value.entry.js +1 -1
  147. package/dist/esm/business-identity-schema-D-Nk9aGV.js +163 -0
  148. package/dist/esm/{business.service-BPbZ5fxQ.js → business.service-Crs-0Mdy.js} +1 -2
  149. package/dist/esm/{button-DRdaAudE.js → button-BvzOzV4l.js} +1 -1
  150. package/dist/esm/card-form.entry.js +4 -4
  151. package/dist/esm/{check-pkg-version-6iGDh82c.js → check-pkg-version-CVyuA8aH.js} +1 -1
  152. package/dist/esm/checkout-actions-BMnp3uHK.js +59 -0
  153. package/dist/esm/{checkout.service-CJMfFKyS.js → checkout.service-BMAQVmHa.js} +1 -2
  154. package/dist/esm/{country-config-P042rrI3.js → country-config-B_fuF6JU.js} +1 -1
  155. package/dist/esm/custom-popper_2.entry.js +3 -3
  156. package/dist/esm/{justifi-dispute-notification_3.entry.js → dispute-notification_2.entry.js} +68 -90
  157. package/dist/esm/{event-types-Bg2SZArf.js → event-types-CVVB5p_Q.js} +29 -1
  158. package/dist/esm/form-address-fields_3.entry.js +5 -5
  159. package/dist/esm/form-control-checkbox.entry.js +3 -3
  160. package/dist/esm/form-control-date.entry.js +4 -4
  161. package/dist/esm/{form-control-error-text-DVedKyhp.js → form-control-error-text-Di9QePY5.js} +1 -1
  162. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  163. package/dist/esm/form-control-file.entry.js +4 -4
  164. package/dist/esm/{form-control-help-text-D-349cNw.js → form-control-help-text-DGMpMuAm.js} +1 -1
  165. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  166. package/dist/esm/form-control-monetary.entry.js +5 -5
  167. package/dist/esm/form-control-number_2.entry.js +86 -0
  168. package/dist/esm/form-control-radio.entry.js +3 -3
  169. package/dist/esm/form-control-select_2.entry.js +6 -6
  170. package/dist/esm/{get-business-DIpEbczl.js → get-business-B9ZS1tVq.js} +2 -2
  171. package/dist/esm/{get-payment-details-DjBou5Fu.js → get-payment-details-CiR6FrkO.js} +2 -3
  172. package/dist/esm/{get-subaccounts-CgDWE_5o.js → get-subaccounts-VpDr7yN4.js} +2 -3
  173. package/dist/esm/{header-1-Bl7MHW0w.js → header-1-evYxFIGN.js} +1 -1
  174. package/dist/esm/{header-3-C7JJVnMG.js → header-3-BUDap2xY.js} +1 -1
  175. package/dist/esm/hidden-input_2.entry.js +7 -7
  176. package/dist/esm/{index.esm-BHdVU4hV.js → index.esm-CgNcFueq.js} +1 -1
  177. package/dist/esm/{insurance-state-qTdpe84i.js → insurance-state-CLGc1-_4.js} +1 -1
  178. package/dist/esm/internal-button.entry.js +3 -3
  179. package/dist/esm/justifi-apple-pay_11.entry.js +18 -73
  180. package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -6
  181. package/dist/esm/justifi-bank-account-form.entry.js +5 -6
  182. package/dist/esm/justifi-billing-form-full.entry.js +1 -1
  183. package/dist/esm/justifi-business-details.entry.js +10 -11
  184. package/dist/esm/justifi-business-form.entry.js +15 -17
  185. package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
  186. package/dist/esm/justifi-card-form.entry.js +5 -6
  187. package/dist/esm/justifi-checkout-qr-code.entry.js +3139 -0
  188. package/dist/esm/justifi-checkout.entry.js +5 -6
  189. package/dist/esm/justifi-checkouts-list-filters.entry.js +4 -5
  190. package/dist/esm/justifi-checkouts-list.entry.js +190 -27
  191. package/dist/esm/justifi-details.entry.js +2 -2
  192. package/dist/esm/justifi-dispute-management.entry.js +64 -17
  193. package/dist/esm/justifi-gross-payment-chart.entry.js +11071 -23
  194. package/dist/esm/justifi-order-terminals.entry.js +11 -12
  195. package/dist/esm/justifi-payment-details.entry.js +20 -21
  196. package/dist/esm/justifi-payment-provisioning.entry.js +11 -12
  197. package/dist/esm/justifi-payment-transactions-list.entry.js +10 -11
  198. package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
  199. package/dist/esm/justifi-payments-list.entry.js +12 -13
  200. package/dist/esm/justifi-payout-details.entry.js +15 -16
  201. package/dist/esm/justifi-payout-transactions-list.entry.js +10 -11
  202. package/dist/esm/justifi-payouts-list-filters.entry.js +4 -5
  203. package/dist/esm/justifi-payouts-list.entry.js +13 -14
  204. package/dist/esm/justifi-qr-terminal.entry.js +206 -0
  205. package/dist/esm/justifi-refund-payment.entry.js +11 -12
  206. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  207. package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -9
  208. package/dist/esm/justifi-skeleton.entry.js +3 -3
  209. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +5 -6
  210. package/dist/esm/justifi-terminal-orders-list.entry.js +175 -21
  211. package/dist/esm/justifi-terminals-list-filters.entry.js +3 -4
  212. package/dist/esm/justifi-terminals-list.entry.js +12 -13
  213. package/dist/esm/loader.js +1 -1
  214. package/dist/esm/{package-beXEDfB9.js → package-CZa-hHhJ.js} +1 -1
  215. package/dist/esm/pagination-menu.entry.js +1 -1
  216. package/dist/esm/{parts-DnrawQn3.js → parts-CPKMvyV_.js} +1 -1
  217. package/dist/esm/payment-method-option.entry.js +2 -2
  218. package/dist/esm/{payment-provisioning-actions-Dr0YIShV.js → payment-provisioning-actions-CcDadiRe.js} +2 -2
  219. package/dist/esm/payment-provisioning-form-buttons_2.entry.js +2 -2
  220. package/dist/esm/{payment-provisioning-loading-DI2wDkhm.js → payment-provisioning-loading-Dve2xQA4.js} +1 -1
  221. package/dist/esm/{payment.service-Ckbb7gXA.js → payment.service-BiKQPL4M.js} +1 -2
  222. package/dist/esm/{payments-status-BIDoGw-m.js → payments-status-BlVUt4C1.js} +1 -1
  223. package/dist/esm/{payout.service-BgFKxEoL.js → payout.service-B9_cyUiU.js} +1 -2
  224. package/dist/esm/{payouts-status-1T2NZBoE.js → payouts-status-xOa5tT66.js} +3 -3
  225. package/dist/esm/{plaid.service-BLguQHs_.js → plaid.service-bU3qIoKd.js} +1 -2
  226. package/dist/esm/radio-list-item.entry.js +2 -2
  227. package/dist/esm/{schema-validations-v6WGlZkq.js → schema-validations-u9_XnlUL.js} +2 -2
  228. package/dist/esm/{skeleton-CXGFVqDf.js → skeleton-BEHo2ypu.js} +1 -1
  229. package/dist/esm/{spinner-kSw6PcwU.js → spinner-DIiQZd6_.js} +1 -1
  230. package/dist/esm/{table-CcyuIutB.js → table-DqGfsdys.js} +3 -3
  231. package/dist/esm/table-filters-menu.entry.js +3 -3
  232. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  233. package/dist/esm/{terminal.service-0oISl5j-.js → terminal.service-BM6BvevW.js} +1 -2
  234. package/dist/esm/{utils-DcfpJGDZ.js → utils-BogmBHgt.js} +1 -1
  235. package/dist/esm/{utils-BxYS3WDw.js → utils-CX6puxwf.js} +1 -1
  236. package/dist/esm/webcomponents.js +1 -1
  237. package/dist/module/Plaid.js +2 -2
  238. package/dist/module/{justifi-refund-policy.d.ts → additional-statement.d.ts} +4 -4
  239. package/dist/module/additional-statement.js +6 -0
  240. package/dist/module/{justifi-additional-statement2.js → additional-statement2.js} +8 -8
  241. package/dist/module/badge.js +1 -1
  242. package/dist/module/bank-account-billing-form-simple2.js +1 -1
  243. package/dist/module/billing-form-full2.js +1 -1
  244. package/dist/module/business-owners-form-step2.js +20 -26
  245. package/dist/module/button.js +1 -1
  246. package/dist/module/cancellation-policy.d.ts +11 -0
  247. package/dist/module/cancellation-policy.js +6 -0
  248. package/dist/module/{justifi-cancellation-policy2.js → cancellation-policy2.js} +8 -8
  249. package/dist/module/card-billing-form-simple2.js +1 -1
  250. package/dist/module/checkout-actions.js +59 -0
  251. package/dist/module/custom-popper2.js +2 -2
  252. package/dist/module/customer-details.d.ts +11 -0
  253. package/dist/module/customer-details.js +6 -0
  254. package/dist/module/{justifi-customer-details2.js → customer-details2.js} +8 -8
  255. package/dist/module/dispute-notification.d.ts +11 -0
  256. package/dist/module/dispute-notification.js +6 -0
  257. package/dist/module/dispute-notification2.js +82 -0
  258. package/dist/module/dispute-response.d.ts +11 -0
  259. package/dist/module/dispute-response.js +6 -0
  260. package/dist/module/{dispute-response-core.js → dispute-response2.js} +105 -53
  261. package/dist/module/duplicate-charge.d.ts +11 -0
  262. package/dist/module/duplicate-charge.js +6 -0
  263. package/dist/module/{justifi-duplicate-charge2.js → duplicate-charge2.js} +8 -8
  264. package/dist/module/electronic-evidence.d.ts +11 -0
  265. package/dist/module/electronic-evidence.js +6 -0
  266. package/dist/module/{justifi-electronic-evidence2.js → electronic-evidence2.js} +8 -8
  267. package/dist/module/event-types3.js +119 -1
  268. package/dist/module/form-alert2.js +1 -1
  269. package/dist/module/form-control-date2.js +2 -2
  270. package/dist/module/form-control-file-v22.js +1 -1
  271. package/dist/module/form-control-file2.js +2 -2
  272. package/dist/module/form-control-monetary2.js +2 -2
  273. package/dist/module/form-control-number-masked2.js +2 -2
  274. package/dist/module/form-control-number2.js +3 -3
  275. package/dist/module/form-control-radio2.js +2 -2
  276. package/dist/module/form-control-select2.js +2 -2
  277. package/dist/module/form-control-text2.js +2 -2
  278. package/dist/module/form-control-textarea2.js +3 -3
  279. package/dist/module/hidden-input2.js +2 -2
  280. package/dist/module/iframe-input2.js +4 -4
  281. package/dist/module/internal-button2.js +1 -1
  282. package/dist/module/justifi-bank-account-billing-form-simple.js +1 -1
  283. package/dist/module/justifi-bank-account-form.js +1 -1
  284. package/dist/module/justifi-billing-form-full.js +1 -1
  285. package/dist/module/justifi-button2.js +1 -1
  286. package/dist/module/justifi-card-billing-form-simple.js +1 -1
  287. package/dist/module/justifi-card-form.js +1 -1
  288. package/dist/module/justifi-checkout-qr-code.d.ts +11 -0
  289. package/dist/module/justifi-checkout-qr-code.js +6 -0
  290. package/dist/module/justifi-checkout-qr-code2.js +3154 -0
  291. package/dist/module/justifi-checkout-summary2.js +1 -1
  292. package/dist/module/justifi-checkouts-list-filters.js +3 -3
  293. package/dist/module/justifi-checkouts-list.js +197 -28
  294. package/dist/module/justifi-dispute-management.js +103 -62
  295. package/dist/module/justifi-gross-payment-chart.js +11074 -24
  296. package/dist/module/justifi-header2.js +1 -1
  297. package/dist/module/justifi-modular-checkout2.js +3 -58
  298. package/dist/module/justifi-order-terminals.js +4 -4
  299. package/dist/module/justifi-payment-details.js +9 -9
  300. package/dist/module/justifi-payment-provisioning.js +53 -59
  301. package/dist/module/justifi-payment-transactions-list.js +1 -1
  302. package/dist/module/justifi-payments-list-filters.js +2 -2
  303. package/dist/module/justifi-payments-list.js +1 -1
  304. package/dist/module/justifi-payout-details.js +3 -3
  305. package/dist/module/justifi-payout-transactions-list.js +1 -1
  306. package/dist/module/justifi-payouts-list-filters.js +3 -3
  307. package/dist/module/justifi-payouts-list.js +1 -1
  308. package/dist/module/{checkouts-list-core.d.ts → justifi-qr-terminal.d.ts} +4 -4
  309. package/dist/module/justifi-qr-terminal.js +234 -0
  310. package/dist/module/justifi-refund-payment.js +1 -1
  311. package/dist/module/justifi-season-interruption-insurance.js +1 -1
  312. package/dist/module/justifi-skeleton.js +1 -1
  313. package/dist/module/justifi-terminal-orders-list-filters.js +3 -3
  314. package/dist/module/justifi-terminal-orders-list.js +184 -22
  315. package/dist/module/justifi-terminals-list-filters.js +1 -1
  316. package/dist/module/justifi-terminals-list.js +2 -2
  317. package/dist/module/justifi-tokenize-payment-method2.js +1 -1
  318. package/dist/module/owner-form-inputs2.js +2 -2
  319. package/dist/module/owner-form2.js +177 -33
  320. package/dist/module/package.js +1 -1
  321. package/dist/module/pagination-menu2.js +1 -1
  322. package/dist/module/parts.js +1 -1
  323. package/dist/module/payment-method-option.js +1 -1
  324. package/dist/module/payment-provisioning-form-steps2.js +52 -58
  325. package/dist/module/product-or-service.d.ts +11 -0
  326. package/dist/module/product-or-service.js +6 -0
  327. package/dist/module/{justifi-product-or-service2.js → product-or-service2.js} +8 -8
  328. package/dist/module/radio-list-item2.js +1 -1
  329. package/dist/module/{owner-form-core.d.ts → refund-policy.d.ts} +4 -4
  330. package/dist/module/refund-policy.js +6 -0
  331. package/dist/module/{justifi-refund-policy2.js → refund-policy2.js} +8 -8
  332. package/dist/module/shipping-details.d.ts +11 -0
  333. package/dist/module/shipping-details.js +6 -0
  334. package/dist/module/{justifi-shipping-details2.js → shipping-details2.js} +8 -8
  335. package/dist/module/spinner.js +1 -1
  336. package/dist/module/table-filters-menu2.js +1 -1
  337. package/dist/module/terminal-quantity-selector2.js +1 -1
  338. package/dist/module/utils2.js +1 -1
  339. package/dist/types/api/Checkout.d.ts +1 -2
  340. package/dist/types/api/Terminal.d.ts +1 -1
  341. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +69 -5
  342. package/dist/types/components/checkout-qr-code/justifi-checkout-qr-code.d.ts +18 -0
  343. package/dist/types/components/checkouts-list/justifi-checkouts-list.d.ts +28 -6
  344. package/dist/types/components/dispute-management/{justifi-dispute-notification.d.ts → dispute-notification.d.ts} +1 -1
  345. package/dist/types/components/dispute-management/dispute-response/{justifi-additional-statement.d.ts → additional-statement.d.ts} +1 -1
  346. package/dist/types/components/dispute-management/dispute-response/{justifi-cancellation-policy.d.ts → cancellation-policy.d.ts} +1 -1
  347. package/dist/types/components/dispute-management/dispute-response/{justifi-customer-details.d.ts → customer-details.d.ts} +1 -1
  348. package/dist/types/components/dispute-management/dispute-response/{dispute-response-core.d.ts → dispute-response.d.ts} +21 -10
  349. package/dist/types/components/dispute-management/dispute-response/{justifi-duplicate-charge.d.ts → duplicate-charge.d.ts} +1 -1
  350. package/dist/types/components/dispute-management/dispute-response/{justifi-electronic-evidence.d.ts → electronic-evidence.d.ts} +1 -1
  351. package/dist/types/components/dispute-management/dispute-response/{justifi-product-or-service.d.ts → product-or-service.d.ts} +1 -1
  352. package/dist/types/components/dispute-management/dispute-response/{justifi-refund-policy.d.ts → refund-policy.d.ts} +1 -1
  353. package/dist/types/components/dispute-management/dispute-response/{justifi-shipping-details.d.ts → shipping-details.d.ts} +1 -1
  354. package/dist/types/components/dispute-management/justifi-dispute-management.d.ts +10 -2
  355. package/dist/types/components/gross-payment-chart/justifi-gross-payment-chart.d.ts +13 -2
  356. package/dist/types/components/qr-terminal/justifi-qr-terminal.d.ts +42 -0
  357. package/dist/types/components/terminal-orders-list/justifi-terminal-orders-list.d.ts +21 -3
  358. package/dist/types/components.d.ts +388 -543
  359. package/dist/webcomponents/p-06e8df55.entry.js +1 -0
  360. package/dist/webcomponents/p-0708cb76.entry.js +1 -0
  361. package/dist/webcomponents/p-07f2f1bf.entry.js +1 -0
  362. package/dist/webcomponents/p-0fb8fb8c.entry.js +1 -0
  363. package/dist/webcomponents/p-10087a53.entry.js +1 -0
  364. package/dist/webcomponents/p-12ae030d.entry.js +1 -0
  365. package/dist/webcomponents/p-1d7b8c21.entry.js +1 -0
  366. package/dist/webcomponents/p-21c89e22.entry.js +1 -0
  367. package/dist/webcomponents/{p-256c5509.entry.js → p-22d19755.entry.js} +1 -1
  368. package/dist/webcomponents/{p-2425a375.entry.js → p-2dfdecbb.entry.js} +1 -1
  369. package/dist/webcomponents/p-2ec7cd88.entry.js +1 -0
  370. package/dist/webcomponents/p-2qotS5d_.js +1 -0
  371. package/dist/webcomponents/p-355a5c8d.entry.js +1 -0
  372. package/dist/webcomponents/p-37b95a11.entry.js +1 -0
  373. package/dist/webcomponents/p-37fd1862.entry.js +1 -0
  374. package/dist/webcomponents/{p-4d21df48.entry.js → p-383b8317.entry.js} +1 -1
  375. package/dist/webcomponents/p-392f0c1c.entry.js +1 -0
  376. package/dist/webcomponents/{p-1e877e0a.entry.js → p-3d6b9434.entry.js} +1 -1
  377. package/dist/webcomponents/p-44cf13ac.entry.js +1 -0
  378. package/dist/webcomponents/p-46477dfe.entry.js +1 -0
  379. package/dist/webcomponents/{p-befe01ef.entry.js → p-49c13952.entry.js} +1 -1
  380. package/dist/webcomponents/p-4ccf9cd7.entry.js +1 -0
  381. package/dist/webcomponents/p-55fdab4e.entry.js +1 -0
  382. package/dist/webcomponents/p-5ccb46ee.entry.js +1 -0
  383. package/dist/webcomponents/p-5f8dfa8d.entry.js +1 -0
  384. package/dist/webcomponents/{p-8253ef9f.entry.js → p-605bd107.entry.js} +1 -1
  385. package/dist/webcomponents/p-63b7abf3.entry.js +1 -0
  386. package/dist/webcomponents/p-6RTf1SXX.js +1 -0
  387. package/dist/webcomponents/p-70cd2808.entry.js +1 -0
  388. package/dist/webcomponents/{p-3c046adc.entry.js → p-70dcd833.entry.js} +1 -1
  389. package/dist/webcomponents/p-769d3d93.entry.js +1 -0
  390. package/dist/webcomponents/p-79bd744e.entry.js +1 -0
  391. package/dist/webcomponents/{p-31e74a5a.entry.js → p-7a4cd292.entry.js} +1 -1
  392. package/dist/webcomponents/p-89cd31f2.entry.js +1 -0
  393. package/dist/webcomponents/p-8d602e60.entry.js +1 -0
  394. package/dist/webcomponents/p-9153c121.entry.js +1 -0
  395. package/dist/webcomponents/p-94f14640.entry.js +1 -0
  396. package/dist/webcomponents/p-98f399ec.entry.js +1 -0
  397. package/dist/webcomponents/p-9b944aa4.entry.js +1 -0
  398. package/dist/webcomponents/{p-bc2af6b4.entry.js → p-9fc7714d.entry.js} +1 -1
  399. package/dist/webcomponents/p-9fca25fc.entry.js +1 -0
  400. package/dist/webcomponents/p-B5gBiARs.js +1 -0
  401. package/dist/webcomponents/p-BGvaX-lJ.js +1 -0
  402. package/dist/webcomponents/{p-bn_huKYG.js → p-BICxxa69.js} +1 -1
  403. package/dist/webcomponents/{p-2LVpxCS_.js → p-CHo7TfsM.js} +1 -1
  404. package/dist/webcomponents/p-CHw7tICr.js +1 -0
  405. package/dist/webcomponents/{p-DnrawQn3.js → p-CPKMvyV_.js} +1 -1
  406. package/dist/webcomponents/p-CSgcCWLS.js +1 -0
  407. package/dist/webcomponents/p-CZa-hHhJ.js +1 -0
  408. package/dist/webcomponents/p-Ce_W43gc.js +1 -0
  409. package/dist/webcomponents/p-Cg_3KsGO.js +1 -0
  410. package/dist/webcomponents/p-CqPcl9v7.js +1 -0
  411. package/dist/webcomponents/p-CqiVXthx.js +1 -0
  412. package/dist/webcomponents/{p-x9fFFf7F.js → p-Cu7hgXL1.js} +1 -1
  413. package/dist/webcomponents/p-CvgL8YaH.js +1 -0
  414. package/dist/webcomponents/p-D-zwk1J3.js +1 -0
  415. package/dist/webcomponents/{p-D1D2eC05.js → p-D1_eip6x.js} +1 -1
  416. package/dist/webcomponents/p-D4E9P7df.js +1 -0
  417. package/dist/webcomponents/p-DD-_8sbs.js +1 -0
  418. package/dist/webcomponents/{p-DgH-jcIo.js → p-DHFQtPCq.js} +1 -1
  419. package/dist/webcomponents/p-DMqJWUK2.js +1 -0
  420. package/dist/webcomponents/p-DSclFZ32.js +1 -0
  421. package/dist/webcomponents/p-DYHjzFnJ.js +1 -0
  422. package/dist/webcomponents/p-DZAMzLxa.js +1 -0
  423. package/dist/webcomponents/p-DbOUuBHs.js +1 -0
  424. package/dist/webcomponents/{p-CKiAlBsU.js → p-DwoT0UoX.js} +1 -1
  425. package/dist/webcomponents/{p-_-2E_vYf.js → p-DyucNSA4.js} +1 -1
  426. package/dist/webcomponents/p-Eb1f86_V.js +1 -0
  427. package/dist/webcomponents/p-KXLYEe1D.js +1 -0
  428. package/dist/webcomponents/p-XxG-t-Sl.js +1 -0
  429. package/dist/webcomponents/{p-10be75b8.entry.js → p-a80f69a9.entry.js} +1 -1
  430. package/dist/webcomponents/{p-9581d6a1.entry.js → p-a9695714.entry.js} +1 -1
  431. package/dist/webcomponents/p-aee2295b.entry.js +1 -0
  432. package/dist/webcomponents/p-b0b6083f.entry.js +1 -0
  433. package/dist/webcomponents/p-b20b8805.entry.js +1 -0
  434. package/dist/webcomponents/p-b341efd6.entry.js +1 -0
  435. package/dist/webcomponents/{p-e6e56dbb.entry.js → p-b62ff001.entry.js} +1 -1
  436. package/dist/webcomponents/p-bb5de874.entry.js +1 -0
  437. package/dist/webcomponents/p-bd678d4a.entry.js +1 -0
  438. package/dist/webcomponents/p-c1539656.entry.js +1 -0
  439. package/dist/webcomponents/p-c8ee1e4c.entry.js +1 -0
  440. package/dist/webcomponents/{p-09d2efad.entry.js → p-ca87c609.entry.js} +1 -1
  441. package/dist/webcomponents/p-ce1dde85.entry.js +1 -0
  442. package/dist/webcomponents/p-d620d4b4.entry.js +1 -0
  443. package/dist/webcomponents/{p-9db1444f.entry.js → p-db09f306.entry.js} +1 -1
  444. package/dist/webcomponents/{p-c9e1df15.entry.js → p-dcd600ca.entry.js} +1 -1
  445. package/dist/webcomponents/{p-354fb3c4.entry.js → p-e020f003.entry.js} +1 -1
  446. package/dist/webcomponents/p-e4cb7c21.entry.js +1 -0
  447. package/dist/webcomponents/p-e5c2215a.entry.js +1 -0
  448. package/dist/webcomponents/p-e6b9dfe1.entry.js +1 -0
  449. package/dist/webcomponents/p-eCeOsPHx.js +1 -0
  450. package/dist/webcomponents/p-eK8hZOMg.js +1 -0
  451. package/dist/webcomponents/p-f1b9cbf0.entry.js +1 -0
  452. package/dist/webcomponents/p-f9aafb21.entry.js +1 -0
  453. package/dist/webcomponents/p-ff5c5499.entry.js +20 -0
  454. package/dist/webcomponents/p-jIDKmNHy.js +1 -0
  455. package/dist/webcomponents/{p-Cej-1bD6.js → p-qju4tNG1.js} +1 -1
  456. package/dist/webcomponents/p-uZ5KAseb.js +1 -0
  457. package/dist/webcomponents/webcomponents.esm.js +1 -1
  458. package/package.json +16 -14
  459. package/LICENSE +0 -21
  460. package/dist/cjs/Dispute-CruQTF6_.js +0 -59
  461. package/dist/cjs/business-additional-questions-schema-CI80eZLJ.js +0 -73
  462. package/dist/cjs/checkouts-list-core.cjs.entry.js +0 -146
  463. package/dist/cjs/checkouts-table-CCxrsy0x.js +0 -55
  464. package/dist/cjs/dispute.service-BbtwY673.js +0 -32
  465. package/dist/cjs/form-control-number_3.cjs.entry.js +0 -249
  466. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +0 -11075
  467. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +0 -61
  468. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +0 -108
  469. package/dist/cjs/terminal-orders-table-Cz6qvzVE.js +0 -83
  470. package/dist/collection/components/business-forms/owner-form/owner-form-core.js +0 -523
  471. package/dist/collection/components/checkouts-list/checkouts-list-core.js +0 -262
  472. package/dist/collection/components/dispute-management/dispute-management-core.js +0 -169
  473. package/dist/collection/components/dispute-management/dispute-response/justifi-dispute-response.js +0 -190
  474. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +0 -139
  475. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +0 -199
  476. package/dist/esm/Dispute-BH0Xfn-F.js +0 -57
  477. package/dist/esm/business-additional-questions-schema-DKudYaoE.js +0 -69
  478. package/dist/esm/business-identity-schema-CFhSc0cA.js +0 -99
  479. package/dist/esm/checkouts-list-core.entry.js +0 -144
  480. package/dist/esm/checkouts-table-C8sPHeTm.js +0 -51
  481. package/dist/esm/dispute.service-vlYGy0nR.js +0 -30
  482. package/dist/esm/form-control-number_3.entry.js +0 -245
  483. package/dist/esm/gross-payment-chart-core.entry.js +0 -11073
  484. package/dist/esm/justifi-dispute-management-core.entry.js +0 -59
  485. package/dist/esm/terminal-orders-list-core.entry.js +0 -106
  486. package/dist/esm/terminal-orders-table-C7KOcRpq.js +0 -79
  487. package/dist/module/checkouts-list-core.js +0 -6
  488. package/dist/module/checkouts-list-core2.js +0 -227
  489. package/dist/module/dispute-management-core.js +0 -193
  490. package/dist/module/dispute-response-actions.js +0 -119
  491. package/dist/module/gross-payment-chart-core.d.ts +0 -11
  492. package/dist/module/gross-payment-chart-core.js +0 -6
  493. package/dist/module/gross-payment-chart-core2.js +0 -11096
  494. package/dist/module/justifi-additional-statement.d.ts +0 -11
  495. package/dist/module/justifi-additional-statement.js +0 -6
  496. package/dist/module/justifi-cancellation-policy.d.ts +0 -11
  497. package/dist/module/justifi-cancellation-policy.js +0 -6
  498. package/dist/module/justifi-customer-details.d.ts +0 -11
  499. package/dist/module/justifi-customer-details.js +0 -6
  500. package/dist/module/justifi-dispute-management-core.d.ts +0 -11
  501. package/dist/module/justifi-dispute-management-core.js +0 -6
  502. package/dist/module/justifi-dispute-notification.d.ts +0 -11
  503. package/dist/module/justifi-dispute-notification.js +0 -6
  504. package/dist/module/justifi-dispute-notification2.js +0 -85
  505. package/dist/module/justifi-dispute-response-core.d.ts +0 -11
  506. package/dist/module/justifi-dispute-response-core.js +0 -6
  507. package/dist/module/justifi-dispute-response.d.ts +0 -11
  508. package/dist/module/justifi-dispute-response.js +0 -6
  509. package/dist/module/justifi-dispute-response2.js +0 -198
  510. package/dist/module/justifi-duplicate-charge.d.ts +0 -11
  511. package/dist/module/justifi-duplicate-charge.js +0 -6
  512. package/dist/module/justifi-electronic-evidence.d.ts +0 -11
  513. package/dist/module/justifi-electronic-evidence.js +0 -6
  514. package/dist/module/justifi-product-or-service.d.ts +0 -11
  515. package/dist/module/justifi-product-or-service.js +0 -6
  516. package/dist/module/justifi-refund-policy.js +0 -6
  517. package/dist/module/justifi-shipping-details.d.ts +0 -11
  518. package/dist/module/justifi-shipping-details.js +0 -6
  519. package/dist/module/owner-form-core.js +0 -6
  520. package/dist/module/owner-form-core2.js +0 -262
  521. package/dist/module/terminal-orders-list-core.d.ts +0 -11
  522. package/dist/module/terminal-orders-list-core.js +0 -6
  523. package/dist/module/terminal-orders-list-core2.js +0 -209
  524. package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +0 -88
  525. package/dist/types/components/checkouts-list/checkouts-list-core.d.ts +0 -34
  526. package/dist/types/components/dispute-management/dispute-management-core.d.ts +0 -18
  527. package/dist/types/components/dispute-management/dispute-response/justifi-dispute-response.d.ts +0 -35
  528. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +0 -21
  529. package/dist/types/components/terminal-orders-list/terminal-orders-list-core.d.ts +0 -28
  530. package/dist/webcomponents/p--e0ff06z.js +0 -1
  531. package/dist/webcomponents/p-032b4553.entry.js +0 -1
  532. package/dist/webcomponents/p-042daaf8.entry.js +0 -1
  533. package/dist/webcomponents/p-0638f0bd.entry.js +0 -1
  534. package/dist/webcomponents/p-0b3f4f22.entry.js +0 -1
  535. package/dist/webcomponents/p-1c4f5f1d.entry.js +0 -1
  536. package/dist/webcomponents/p-1e8135f0.entry.js +0 -1
  537. package/dist/webcomponents/p-24935254.entry.js +0 -1
  538. package/dist/webcomponents/p-2a755daf.entry.js +0 -1
  539. package/dist/webcomponents/p-3488951f.entry.js +0 -1
  540. package/dist/webcomponents/p-437a99dc.entry.js +0 -1
  541. package/dist/webcomponents/p-49c0cd3a.entry.js +0 -1
  542. package/dist/webcomponents/p-50f5e313.entry.js +0 -1
  543. package/dist/webcomponents/p-52908814.entry.js +0 -1
  544. package/dist/webcomponents/p-587886f1.entry.js +0 -1
  545. package/dist/webcomponents/p-5ef355ce.entry.js +0 -1
  546. package/dist/webcomponents/p-5ef854e0.entry.js +0 -1
  547. package/dist/webcomponents/p-67498c25.entry.js +0 -1
  548. package/dist/webcomponents/p-6917aa3c.entry.js +0 -1
  549. package/dist/webcomponents/p-6d81822f.entry.js +0 -1
  550. package/dist/webcomponents/p-6f0c582a.entry.js +0 -1
  551. package/dist/webcomponents/p-80652cf8.entry.js +0 -1
  552. package/dist/webcomponents/p-82fe02e4.entry.js +0 -1
  553. package/dist/webcomponents/p-83147f23.entry.js +0 -1
  554. package/dist/webcomponents/p-8c2427ed.entry.js +0 -1
  555. package/dist/webcomponents/p-92de00d7.entry.js +0 -1
  556. package/dist/webcomponents/p-94306884.entry.js +0 -1
  557. package/dist/webcomponents/p-9937e2e7.entry.js +0 -1
  558. package/dist/webcomponents/p-9dca1331.entry.js +0 -1
  559. package/dist/webcomponents/p-9f74d7ea.entry.js +0 -1
  560. package/dist/webcomponents/p-B--N37zY.js +0 -1
  561. package/dist/webcomponents/p-B5vVjDc_.js +0 -1
  562. package/dist/webcomponents/p-BH0Xfn-F.js +0 -1
  563. package/dist/webcomponents/p-Bg2SZArf.js +0 -1
  564. package/dist/webcomponents/p-BovgIz83.js +0 -1
  565. package/dist/webcomponents/p-BsQy297i.js +0 -1
  566. package/dist/webcomponents/p-CDf5H0TB.js +0 -1
  567. package/dist/webcomponents/p-CR_-qIuN.js +0 -1
  568. package/dist/webcomponents/p-CUI41_5y.js +0 -1
  569. package/dist/webcomponents/p-CX36GHQP.js +0 -1
  570. package/dist/webcomponents/p-Cf6HoQKl.js +0 -1
  571. package/dist/webcomponents/p-CsdYMTrc.js +0 -1
  572. package/dist/webcomponents/p-D4OlsyTo.js +0 -1
  573. package/dist/webcomponents/p-D8EGHc_m.js +0 -1
  574. package/dist/webcomponents/p-DPmnGTmg.js +0 -1
  575. package/dist/webcomponents/p-DWevPe7C.js +0 -1
  576. package/dist/webcomponents/p-Dbg501Lu.js +0 -1
  577. package/dist/webcomponents/p-DcBvJu0k.js +0 -1
  578. package/dist/webcomponents/p-DkdzUTnl.js +0 -1
  579. package/dist/webcomponents/p-HT_4DkD0.js +0 -1
  580. package/dist/webcomponents/p-MDZuGvsl.js +0 -1
  581. package/dist/webcomponents/p-XrKLre8M.js +0 -1
  582. package/dist/webcomponents/p-a75d76ff.entry.js +0 -1
  583. package/dist/webcomponents/p-a7778957.entry.js +0 -1
  584. package/dist/webcomponents/p-a9d7cdae.entry.js +0 -1
  585. package/dist/webcomponents/p-b060a9c9.entry.js +0 -1
  586. package/dist/webcomponents/p-b06910b0.entry.js +0 -1
  587. package/dist/webcomponents/p-b483e71b.entry.js +0 -1
  588. package/dist/webcomponents/p-bdf21f71.entry.js +0 -1
  589. package/dist/webcomponents/p-be5d1005.entry.js +0 -1
  590. package/dist/webcomponents/p-beXEDfB9.js +0 -1
  591. package/dist/webcomponents/p-bfe2583d.entry.js +0 -1
  592. package/dist/webcomponents/p-c09fccd3.entry.js +0 -1
  593. package/dist/webcomponents/p-c827cbc9.entry.js +0 -1
  594. package/dist/webcomponents/p-cc5b7c27.entry.js +0 -1
  595. package/dist/webcomponents/p-d878df6c.entry.js +0 -1
  596. package/dist/webcomponents/p-ddf699e6.entry.js +0 -20
  597. package/dist/webcomponents/p-e0b3735f.entry.js +0 -1
  598. package/dist/webcomponents/p-ea30cf08.entry.js +0 -1
  599. package/dist/webcomponents/p-edf5a854.entry.js +0 -1
  600. package/dist/webcomponents/p-ef89824b.entry.js +0 -1
  601. package/dist/webcomponents/p-fc7ba195.entry.js +0 -1
  602. package/dist/webcomponents/p-hhdRync5.js +0 -1
  603. package/dist/webcomponents/p-niGr4RT2.js +0 -1
  604. package/dist/webcomponents/p-pL4dNfsl.js +0 -1
  605. package/dist/webcomponents/p-qcQTYcr3.js +0 -1
  606. package/dist/webcomponents/p-qrNmDp6K.js +0 -1
  607. package/dist/webcomponents/p-uCg79W3M.js +0 -1
  608. package/dist/webcomponents/p-zi3ljCdQ.js +0 -1
@@ -0,0 +1,3141 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-p7cvUYAE.js');
4
+ var _commonjsHelpers = require('./_commonjsHelpers-BJu3ubxk.js');
5
+ var Plaid = require('./Plaid-Aw35bhCX.js');
6
+ var Analytics = require('./Analytics-Be2I_aiS.js');
7
+ var checkPkgVersion = require('./check-pkg-version-BLLLh6v-.js');
8
+ require('./utils-BHi4j5rB.js');
9
+ require('./dinero-BwNN_k7x.js');
10
+ require('./package-gx36QXN1.js');
11
+ require('./Api-Bukk55YZ.js');
12
+ require('./config-state-BIgGhhe9.js');
13
+ require('./index-W-zoNiyM.js');
14
+ require('./Pagination-Dediz133.js');
15
+ require('./Business-oBifyXkW.js');
16
+
17
+ var browser = {};
18
+
19
+ var canPromise;
20
+ var hasRequiredCanPromise;
21
+
22
+ function requireCanPromise () {
23
+ if (hasRequiredCanPromise) return canPromise;
24
+ hasRequiredCanPromise = 1;
25
+ // can-promise has a crash in some versions of react native that dont have
26
+ // standard global objects
27
+ // https://github.com/soldair/node-qrcode/issues/157
28
+
29
+ canPromise = function () {
30
+ return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then
31
+ };
32
+ return canPromise;
33
+ }
34
+
35
+ var qrcode = {};
36
+
37
+ var utils$1 = {};
38
+
39
+ var hasRequiredUtils$1;
40
+
41
+ function requireUtils$1 () {
42
+ if (hasRequiredUtils$1) return utils$1;
43
+ hasRequiredUtils$1 = 1;
44
+ let toSJISFunction;
45
+ const CODEWORDS_COUNT = [
46
+ 0, // Not used
47
+ 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,
48
+ 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,
49
+ 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,
50
+ 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706
51
+ ];
52
+
53
+ /**
54
+ * Returns the QR Code size for the specified version
55
+ *
56
+ * @param {Number} version QR Code version
57
+ * @return {Number} size of QR code
58
+ */
59
+ utils$1.getSymbolSize = function getSymbolSize (version) {
60
+ if (!version) throw new Error('"version" cannot be null or undefined')
61
+ if (version < 1 || version > 40) throw new Error('"version" should be in range from 1 to 40')
62
+ return version * 4 + 17
63
+ };
64
+
65
+ /**
66
+ * Returns the total number of codewords used to store data and EC information.
67
+ *
68
+ * @param {Number} version QR Code version
69
+ * @return {Number} Data length in bits
70
+ */
71
+ utils$1.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {
72
+ return CODEWORDS_COUNT[version]
73
+ };
74
+
75
+ /**
76
+ * Encode data with Bose-Chaudhuri-Hocquenghem
77
+ *
78
+ * @param {Number} data Value to encode
79
+ * @return {Number} Encoded value
80
+ */
81
+ utils$1.getBCHDigit = function (data) {
82
+ let digit = 0;
83
+
84
+ while (data !== 0) {
85
+ digit++;
86
+ data >>>= 1;
87
+ }
88
+
89
+ return digit
90
+ };
91
+
92
+ utils$1.setToSJISFunction = function setToSJISFunction (f) {
93
+ if (typeof f !== 'function') {
94
+ throw new Error('"toSJISFunc" is not a valid function.')
95
+ }
96
+
97
+ toSJISFunction = f;
98
+ };
99
+
100
+ utils$1.isKanjiModeEnabled = function () {
101
+ return typeof toSJISFunction !== 'undefined'
102
+ };
103
+
104
+ utils$1.toSJIS = function toSJIS (kanji) {
105
+ return toSJISFunction(kanji)
106
+ };
107
+ return utils$1;
108
+ }
109
+
110
+ var errorCorrectionLevel = {};
111
+
112
+ var hasRequiredErrorCorrectionLevel;
113
+
114
+ function requireErrorCorrectionLevel () {
115
+ if (hasRequiredErrorCorrectionLevel) return errorCorrectionLevel;
116
+ hasRequiredErrorCorrectionLevel = 1;
117
+ (function (exports) {
118
+ exports.L = { bit: 1 };
119
+ exports.M = { bit: 0 };
120
+ exports.Q = { bit: 3 };
121
+ exports.H = { bit: 2 };
122
+
123
+ function fromString (string) {
124
+ if (typeof string !== 'string') {
125
+ throw new Error('Param is not a string')
126
+ }
127
+
128
+ const lcStr = string.toLowerCase();
129
+
130
+ switch (lcStr) {
131
+ case 'l':
132
+ case 'low':
133
+ return exports.L
134
+
135
+ case 'm':
136
+ case 'medium':
137
+ return exports.M
138
+
139
+ case 'q':
140
+ case 'quartile':
141
+ return exports.Q
142
+
143
+ case 'h':
144
+ case 'high':
145
+ return exports.H
146
+
147
+ default:
148
+ throw new Error('Unknown EC Level: ' + string)
149
+ }
150
+ }
151
+
152
+ exports.isValid = function isValid (level) {
153
+ return level && typeof level.bit !== 'undefined' &&
154
+ level.bit >= 0 && level.bit < 4
155
+ };
156
+
157
+ exports.from = function from (value, defaultValue) {
158
+ if (exports.isValid(value)) {
159
+ return value
160
+ }
161
+
162
+ try {
163
+ return fromString(value)
164
+ } catch (e) {
165
+ return defaultValue
166
+ }
167
+ };
168
+ } (errorCorrectionLevel));
169
+ return errorCorrectionLevel;
170
+ }
171
+
172
+ var bitBuffer;
173
+ var hasRequiredBitBuffer;
174
+
175
+ function requireBitBuffer () {
176
+ if (hasRequiredBitBuffer) return bitBuffer;
177
+ hasRequiredBitBuffer = 1;
178
+ function BitBuffer () {
179
+ this.buffer = [];
180
+ this.length = 0;
181
+ }
182
+
183
+ BitBuffer.prototype = {
184
+
185
+ get: function (index) {
186
+ const bufIndex = Math.floor(index / 8);
187
+ return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1
188
+ },
189
+
190
+ put: function (num, length) {
191
+ for (let i = 0; i < length; i++) {
192
+ this.putBit(((num >>> (length - i - 1)) & 1) === 1);
193
+ }
194
+ },
195
+
196
+ getLengthInBits: function () {
197
+ return this.length
198
+ },
199
+
200
+ putBit: function (bit) {
201
+ const bufIndex = Math.floor(this.length / 8);
202
+ if (this.buffer.length <= bufIndex) {
203
+ this.buffer.push(0);
204
+ }
205
+
206
+ if (bit) {
207
+ this.buffer[bufIndex] |= (0x80 >>> (this.length % 8));
208
+ }
209
+
210
+ this.length++;
211
+ }
212
+ };
213
+
214
+ bitBuffer = BitBuffer;
215
+ return bitBuffer;
216
+ }
217
+
218
+ /**
219
+ * Helper class to handle QR Code symbol modules
220
+ *
221
+ * @param {Number} size Symbol size
222
+ */
223
+
224
+ var bitMatrix;
225
+ var hasRequiredBitMatrix;
226
+
227
+ function requireBitMatrix () {
228
+ if (hasRequiredBitMatrix) return bitMatrix;
229
+ hasRequiredBitMatrix = 1;
230
+ function BitMatrix (size) {
231
+ if (!size || size < 1) {
232
+ throw new Error('BitMatrix size must be defined and greater than 0')
233
+ }
234
+
235
+ this.size = size;
236
+ this.data = new Uint8Array(size * size);
237
+ this.reservedBit = new Uint8Array(size * size);
238
+ }
239
+
240
+ /**
241
+ * Set bit value at specified location
242
+ * If reserved flag is set, this bit will be ignored during masking process
243
+ *
244
+ * @param {Number} row
245
+ * @param {Number} col
246
+ * @param {Boolean} value
247
+ * @param {Boolean} reserved
248
+ */
249
+ BitMatrix.prototype.set = function (row, col, value, reserved) {
250
+ const index = row * this.size + col;
251
+ this.data[index] = value;
252
+ if (reserved) this.reservedBit[index] = true;
253
+ };
254
+
255
+ /**
256
+ * Returns bit value at specified location
257
+ *
258
+ * @param {Number} row
259
+ * @param {Number} col
260
+ * @return {Boolean}
261
+ */
262
+ BitMatrix.prototype.get = function (row, col) {
263
+ return this.data[row * this.size + col]
264
+ };
265
+
266
+ /**
267
+ * Applies xor operator at specified location
268
+ * (used during masking process)
269
+ *
270
+ * @param {Number} row
271
+ * @param {Number} col
272
+ * @param {Boolean} value
273
+ */
274
+ BitMatrix.prototype.xor = function (row, col, value) {
275
+ this.data[row * this.size + col] ^= value;
276
+ };
277
+
278
+ /**
279
+ * Check if bit at specified location is reserved
280
+ *
281
+ * @param {Number} row
282
+ * @param {Number} col
283
+ * @return {Boolean}
284
+ */
285
+ BitMatrix.prototype.isReserved = function (row, col) {
286
+ return this.reservedBit[row * this.size + col]
287
+ };
288
+
289
+ bitMatrix = BitMatrix;
290
+ return bitMatrix;
291
+ }
292
+
293
+ var alignmentPattern = {};
294
+
295
+ /**
296
+ * Alignment pattern are fixed reference pattern in defined positions
297
+ * in a matrix symbology, which enables the decode software to re-synchronise
298
+ * the coordinate mapping of the image modules in the event of moderate amounts
299
+ * of distortion of the image.
300
+ *
301
+ * Alignment patterns are present only in QR Code symbols of version 2 or larger
302
+ * and their number depends on the symbol version.
303
+ */
304
+
305
+ var hasRequiredAlignmentPattern;
306
+
307
+ function requireAlignmentPattern () {
308
+ if (hasRequiredAlignmentPattern) return alignmentPattern;
309
+ hasRequiredAlignmentPattern = 1;
310
+ (function (exports) {
311
+ const getSymbolSize = requireUtils$1().getSymbolSize;
312
+
313
+ /**
314
+ * Calculate the row/column coordinates of the center module of each alignment pattern
315
+ * for the specified QR Code version.
316
+ *
317
+ * The alignment patterns are positioned symmetrically on either side of the diagonal
318
+ * running from the top left corner of the symbol to the bottom right corner.
319
+ *
320
+ * Since positions are simmetrical only half of the coordinates are returned.
321
+ * Each item of the array will represent in turn the x and y coordinate.
322
+ * @see {@link getPositions}
323
+ *
324
+ * @param {Number} version QR Code version
325
+ * @return {Array} Array of coordinate
326
+ */
327
+ exports.getRowColCoords = function getRowColCoords (version) {
328
+ if (version === 1) return []
329
+
330
+ const posCount = Math.floor(version / 7) + 2;
331
+ const size = getSymbolSize(version);
332
+ const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2;
333
+ const positions = [size - 7]; // Last coord is always (size - 7)
334
+
335
+ for (let i = 1; i < posCount - 1; i++) {
336
+ positions[i] = positions[i - 1] - intervals;
337
+ }
338
+
339
+ positions.push(6); // First coord is always 6
340
+
341
+ return positions.reverse()
342
+ };
343
+
344
+ /**
345
+ * Returns an array containing the positions of each alignment pattern.
346
+ * Each array's element represent the center point of the pattern as (x, y) coordinates
347
+ *
348
+ * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}
349
+ * and filtering out the items that overlaps with finder pattern
350
+ *
351
+ * @example
352
+ * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.
353
+ * The alignment patterns, therefore, are to be centered on (row, column)
354
+ * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).
355
+ * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns
356
+ * and are not therefore used for alignment patterns.
357
+ *
358
+ * let pos = getPositions(7)
359
+ * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]
360
+ *
361
+ * @param {Number} version QR Code version
362
+ * @return {Array} Array of coordinates
363
+ */
364
+ exports.getPositions = function getPositions (version) {
365
+ const coords = [];
366
+ const pos = exports.getRowColCoords(version);
367
+ const posLength = pos.length;
368
+
369
+ for (let i = 0; i < posLength; i++) {
370
+ for (let j = 0; j < posLength; j++) {
371
+ // Skip if position is occupied by finder patterns
372
+ if ((i === 0 && j === 0) || // top-left
373
+ (i === 0 && j === posLength - 1) || // bottom-left
374
+ (i === posLength - 1 && j === 0)) { // top-right
375
+ continue
376
+ }
377
+
378
+ coords.push([pos[i], pos[j]]);
379
+ }
380
+ }
381
+
382
+ return coords
383
+ };
384
+ } (alignmentPattern));
385
+ return alignmentPattern;
386
+ }
387
+
388
+ var finderPattern = {};
389
+
390
+ var hasRequiredFinderPattern;
391
+
392
+ function requireFinderPattern () {
393
+ if (hasRequiredFinderPattern) return finderPattern;
394
+ hasRequiredFinderPattern = 1;
395
+ const getSymbolSize = requireUtils$1().getSymbolSize;
396
+ const FINDER_PATTERN_SIZE = 7;
397
+
398
+ /**
399
+ * Returns an array containing the positions of each finder pattern.
400
+ * Each array's element represent the top-left point of the pattern as (x, y) coordinates
401
+ *
402
+ * @param {Number} version QR Code version
403
+ * @return {Array} Array of coordinates
404
+ */
405
+ finderPattern.getPositions = function getPositions (version) {
406
+ const size = getSymbolSize(version);
407
+
408
+ return [
409
+ // top-left
410
+ [0, 0],
411
+ // top-right
412
+ [size - FINDER_PATTERN_SIZE, 0],
413
+ // bottom-left
414
+ [0, size - FINDER_PATTERN_SIZE]
415
+ ]
416
+ };
417
+ return finderPattern;
418
+ }
419
+
420
+ var maskPattern = {};
421
+
422
+ /**
423
+ * Data mask pattern reference
424
+ * @type {Object}
425
+ */
426
+
427
+ var hasRequiredMaskPattern;
428
+
429
+ function requireMaskPattern () {
430
+ if (hasRequiredMaskPattern) return maskPattern;
431
+ hasRequiredMaskPattern = 1;
432
+ (function (exports) {
433
+ exports.Patterns = {
434
+ PATTERN000: 0,
435
+ PATTERN001: 1,
436
+ PATTERN010: 2,
437
+ PATTERN011: 3,
438
+ PATTERN100: 4,
439
+ PATTERN101: 5,
440
+ PATTERN110: 6,
441
+ PATTERN111: 7
442
+ };
443
+
444
+ /**
445
+ * Weighted penalty scores for the undesirable features
446
+ * @type {Object}
447
+ */
448
+ const PenaltyScores = {
449
+ N1: 3,
450
+ N2: 3,
451
+ N3: 40,
452
+ N4: 10
453
+ };
454
+
455
+ /**
456
+ * Check if mask pattern value is valid
457
+ *
458
+ * @param {Number} mask Mask pattern
459
+ * @return {Boolean} true if valid, false otherwise
460
+ */
461
+ exports.isValid = function isValid (mask) {
462
+ return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7
463
+ };
464
+
465
+ /**
466
+ * Returns mask pattern from a value.
467
+ * If value is not valid, returns undefined
468
+ *
469
+ * @param {Number|String} value Mask pattern value
470
+ * @return {Number} Valid mask pattern or undefined
471
+ */
472
+ exports.from = function from (value) {
473
+ return exports.isValid(value) ? parseInt(value, 10) : undefined
474
+ };
475
+
476
+ /**
477
+ * Find adjacent modules in row/column with the same color
478
+ * and assign a penalty value.
479
+ *
480
+ * Points: N1 + i
481
+ * i is the amount by which the number of adjacent modules of the same color exceeds 5
482
+ */
483
+ exports.getPenaltyN1 = function getPenaltyN1 (data) {
484
+ const size = data.size;
485
+ let points = 0;
486
+ let sameCountCol = 0;
487
+ let sameCountRow = 0;
488
+ let lastCol = null;
489
+ let lastRow = null;
490
+
491
+ for (let row = 0; row < size; row++) {
492
+ sameCountCol = sameCountRow = 0;
493
+ lastCol = lastRow = null;
494
+
495
+ for (let col = 0; col < size; col++) {
496
+ let module = data.get(row, col);
497
+ if (module === lastCol) {
498
+ sameCountCol++;
499
+ } else {
500
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
501
+ lastCol = module;
502
+ sameCountCol = 1;
503
+ }
504
+
505
+ module = data.get(col, row);
506
+ if (module === lastRow) {
507
+ sameCountRow++;
508
+ } else {
509
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
510
+ lastRow = module;
511
+ sameCountRow = 1;
512
+ }
513
+ }
514
+
515
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5);
516
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5);
517
+ }
518
+
519
+ return points
520
+ };
521
+
522
+ /**
523
+ * Find 2x2 blocks with the same color and assign a penalty value
524
+ *
525
+ * Points: N2 * (m - 1) * (n - 1)
526
+ */
527
+ exports.getPenaltyN2 = function getPenaltyN2 (data) {
528
+ const size = data.size;
529
+ let points = 0;
530
+
531
+ for (let row = 0; row < size - 1; row++) {
532
+ for (let col = 0; col < size - 1; col++) {
533
+ const last = data.get(row, col) +
534
+ data.get(row, col + 1) +
535
+ data.get(row + 1, col) +
536
+ data.get(row + 1, col + 1);
537
+
538
+ if (last === 4 || last === 0) points++;
539
+ }
540
+ }
541
+
542
+ return points * PenaltyScores.N2
543
+ };
544
+
545
+ /**
546
+ * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,
547
+ * preceded or followed by light area 4 modules wide
548
+ *
549
+ * Points: N3 * number of pattern found
550
+ */
551
+ exports.getPenaltyN3 = function getPenaltyN3 (data) {
552
+ const size = data.size;
553
+ let points = 0;
554
+ let bitsCol = 0;
555
+ let bitsRow = 0;
556
+
557
+ for (let row = 0; row < size; row++) {
558
+ bitsCol = bitsRow = 0;
559
+ for (let col = 0; col < size; col++) {
560
+ bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col);
561
+ if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++;
562
+
563
+ bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row);
564
+ if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++;
565
+ }
566
+ }
567
+
568
+ return points * PenaltyScores.N3
569
+ };
570
+
571
+ /**
572
+ * Calculate proportion of dark modules in entire symbol
573
+ *
574
+ * Points: N4 * k
575
+ *
576
+ * k is the rating of the deviation of the proportion of dark modules
577
+ * in the symbol from 50% in steps of 5%
578
+ */
579
+ exports.getPenaltyN4 = function getPenaltyN4 (data) {
580
+ let darkCount = 0;
581
+ const modulesCount = data.data.length;
582
+
583
+ for (let i = 0; i < modulesCount; i++) darkCount += data.data[i];
584
+
585
+ const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10);
586
+
587
+ return k * PenaltyScores.N4
588
+ };
589
+
590
+ /**
591
+ * Return mask value at given position
592
+ *
593
+ * @param {Number} maskPattern Pattern reference value
594
+ * @param {Number} i Row
595
+ * @param {Number} j Column
596
+ * @return {Boolean} Mask value
597
+ */
598
+ function getMaskAt (maskPattern, i, j) {
599
+ switch (maskPattern) {
600
+ case exports.Patterns.PATTERN000: return (i + j) % 2 === 0
601
+ case exports.Patterns.PATTERN001: return i % 2 === 0
602
+ case exports.Patterns.PATTERN010: return j % 3 === 0
603
+ case exports.Patterns.PATTERN011: return (i + j) % 3 === 0
604
+ case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0
605
+ case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0
606
+ case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0
607
+ case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0
608
+
609
+ default: throw new Error('bad maskPattern:' + maskPattern)
610
+ }
611
+ }
612
+
613
+ /**
614
+ * Apply a mask pattern to a BitMatrix
615
+ *
616
+ * @param {Number} pattern Pattern reference number
617
+ * @param {BitMatrix} data BitMatrix data
618
+ */
619
+ exports.applyMask = function applyMask (pattern, data) {
620
+ const size = data.size;
621
+
622
+ for (let col = 0; col < size; col++) {
623
+ for (let row = 0; row < size; row++) {
624
+ if (data.isReserved(row, col)) continue
625
+ data.xor(row, col, getMaskAt(pattern, row, col));
626
+ }
627
+ }
628
+ };
629
+
630
+ /**
631
+ * Returns the best mask pattern for data
632
+ *
633
+ * @param {BitMatrix} data
634
+ * @return {Number} Mask pattern reference number
635
+ */
636
+ exports.getBestMask = function getBestMask (data, setupFormatFunc) {
637
+ const numPatterns = Object.keys(exports.Patterns).length;
638
+ let bestPattern = 0;
639
+ let lowerPenalty = Infinity;
640
+
641
+ for (let p = 0; p < numPatterns; p++) {
642
+ setupFormatFunc(p);
643
+ exports.applyMask(p, data);
644
+
645
+ // Calculate penalty
646
+ const penalty =
647
+ exports.getPenaltyN1(data) +
648
+ exports.getPenaltyN2(data) +
649
+ exports.getPenaltyN3(data) +
650
+ exports.getPenaltyN4(data);
651
+
652
+ // Undo previously applied mask
653
+ exports.applyMask(p, data);
654
+
655
+ if (penalty < lowerPenalty) {
656
+ lowerPenalty = penalty;
657
+ bestPattern = p;
658
+ }
659
+ }
660
+
661
+ return bestPattern
662
+ };
663
+ } (maskPattern));
664
+ return maskPattern;
665
+ }
666
+
667
+ var errorCorrectionCode = {};
668
+
669
+ var hasRequiredErrorCorrectionCode;
670
+
671
+ function requireErrorCorrectionCode () {
672
+ if (hasRequiredErrorCorrectionCode) return errorCorrectionCode;
673
+ hasRequiredErrorCorrectionCode = 1;
674
+ const ECLevel = requireErrorCorrectionLevel();
675
+
676
+ const EC_BLOCKS_TABLE = [
677
+ // L M Q H
678
+ 1, 1, 1, 1,
679
+ 1, 1, 1, 1,
680
+ 1, 1, 2, 2,
681
+ 1, 2, 2, 4,
682
+ 1, 2, 4, 4,
683
+ 2, 4, 4, 4,
684
+ 2, 4, 6, 5,
685
+ 2, 4, 6, 6,
686
+ 2, 5, 8, 8,
687
+ 4, 5, 8, 8,
688
+ 4, 5, 8, 11,
689
+ 4, 8, 10, 11,
690
+ 4, 9, 12, 16,
691
+ 4, 9, 16, 16,
692
+ 6, 10, 12, 18,
693
+ 6, 10, 17, 16,
694
+ 6, 11, 16, 19,
695
+ 6, 13, 18, 21,
696
+ 7, 14, 21, 25,
697
+ 8, 16, 20, 25,
698
+ 8, 17, 23, 25,
699
+ 9, 17, 23, 34,
700
+ 9, 18, 25, 30,
701
+ 10, 20, 27, 32,
702
+ 12, 21, 29, 35,
703
+ 12, 23, 34, 37,
704
+ 12, 25, 34, 40,
705
+ 13, 26, 35, 42,
706
+ 14, 28, 38, 45,
707
+ 15, 29, 40, 48,
708
+ 16, 31, 43, 51,
709
+ 17, 33, 45, 54,
710
+ 18, 35, 48, 57,
711
+ 19, 37, 51, 60,
712
+ 19, 38, 53, 63,
713
+ 20, 40, 56, 66,
714
+ 21, 43, 59, 70,
715
+ 22, 45, 62, 74,
716
+ 24, 47, 65, 77,
717
+ 25, 49, 68, 81
718
+ ];
719
+
720
+ const EC_CODEWORDS_TABLE = [
721
+ // L M Q H
722
+ 7, 10, 13, 17,
723
+ 10, 16, 22, 28,
724
+ 15, 26, 36, 44,
725
+ 20, 36, 52, 64,
726
+ 26, 48, 72, 88,
727
+ 36, 64, 96, 112,
728
+ 40, 72, 108, 130,
729
+ 48, 88, 132, 156,
730
+ 60, 110, 160, 192,
731
+ 72, 130, 192, 224,
732
+ 80, 150, 224, 264,
733
+ 96, 176, 260, 308,
734
+ 104, 198, 288, 352,
735
+ 120, 216, 320, 384,
736
+ 132, 240, 360, 432,
737
+ 144, 280, 408, 480,
738
+ 168, 308, 448, 532,
739
+ 180, 338, 504, 588,
740
+ 196, 364, 546, 650,
741
+ 224, 416, 600, 700,
742
+ 224, 442, 644, 750,
743
+ 252, 476, 690, 816,
744
+ 270, 504, 750, 900,
745
+ 300, 560, 810, 960,
746
+ 312, 588, 870, 1050,
747
+ 336, 644, 952, 1110,
748
+ 360, 700, 1020, 1200,
749
+ 390, 728, 1050, 1260,
750
+ 420, 784, 1140, 1350,
751
+ 450, 812, 1200, 1440,
752
+ 480, 868, 1290, 1530,
753
+ 510, 924, 1350, 1620,
754
+ 540, 980, 1440, 1710,
755
+ 570, 1036, 1530, 1800,
756
+ 570, 1064, 1590, 1890,
757
+ 600, 1120, 1680, 1980,
758
+ 630, 1204, 1770, 2100,
759
+ 660, 1260, 1860, 2220,
760
+ 720, 1316, 1950, 2310,
761
+ 750, 1372, 2040, 2430
762
+ ];
763
+
764
+ /**
765
+ * Returns the number of error correction block that the QR Code should contain
766
+ * for the specified version and error correction level.
767
+ *
768
+ * @param {Number} version QR Code version
769
+ * @param {Number} errorCorrectionLevel Error correction level
770
+ * @return {Number} Number of error correction blocks
771
+ */
772
+ errorCorrectionCode.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {
773
+ switch (errorCorrectionLevel) {
774
+ case ECLevel.L:
775
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]
776
+ case ECLevel.M:
777
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]
778
+ case ECLevel.Q:
779
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]
780
+ case ECLevel.H:
781
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]
782
+ default:
783
+ return undefined
784
+ }
785
+ };
786
+
787
+ /**
788
+ * Returns the number of error correction codewords to use for the specified
789
+ * version and error correction level.
790
+ *
791
+ * @param {Number} version QR Code version
792
+ * @param {Number} errorCorrectionLevel Error correction level
793
+ * @return {Number} Number of error correction codewords
794
+ */
795
+ errorCorrectionCode.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {
796
+ switch (errorCorrectionLevel) {
797
+ case ECLevel.L:
798
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]
799
+ case ECLevel.M:
800
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]
801
+ case ECLevel.Q:
802
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]
803
+ case ECLevel.H:
804
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]
805
+ default:
806
+ return undefined
807
+ }
808
+ };
809
+ return errorCorrectionCode;
810
+ }
811
+
812
+ var polynomial = {};
813
+
814
+ var galoisField = {};
815
+
816
+ var hasRequiredGaloisField;
817
+
818
+ function requireGaloisField () {
819
+ if (hasRequiredGaloisField) return galoisField;
820
+ hasRequiredGaloisField = 1;
821
+ const EXP_TABLE = new Uint8Array(512);
822
+ const LOG_TABLE = new Uint8Array(256)
823
+ /**
824
+ * Precompute the log and anti-log tables for faster computation later
825
+ *
826
+ * For each possible value in the galois field 2^8, we will pre-compute
827
+ * the logarithm and anti-logarithm (exponential) of this value
828
+ *
829
+ * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}
830
+ */
831
+ ;(function initTables () {
832
+ let x = 1;
833
+ for (let i = 0; i < 255; i++) {
834
+ EXP_TABLE[i] = x;
835
+ LOG_TABLE[x] = i;
836
+
837
+ x <<= 1; // multiply by 2
838
+
839
+ // The QR code specification says to use byte-wise modulo 100011101 arithmetic.
840
+ // This means that when a number is 256 or larger, it should be XORed with 0x11D.
841
+ if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)
842
+ x ^= 0x11D;
843
+ }
844
+ }
845
+
846
+ // Optimization: double the size of the anti-log table so that we don't need to mod 255 to
847
+ // stay inside the bounds (because we will mainly use this table for the multiplication of
848
+ // two GF numbers, no more).
849
+ // @see {@link mul}
850
+ for (let i = 255; i < 512; i++) {
851
+ EXP_TABLE[i] = EXP_TABLE[i - 255];
852
+ }
853
+ }());
854
+
855
+ /**
856
+ * Returns log value of n inside Galois Field
857
+ *
858
+ * @param {Number} n
859
+ * @return {Number}
860
+ */
861
+ galoisField.log = function log (n) {
862
+ if (n < 1) throw new Error('log(' + n + ')')
863
+ return LOG_TABLE[n]
864
+ };
865
+
866
+ /**
867
+ * Returns anti-log value of n inside Galois Field
868
+ *
869
+ * @param {Number} n
870
+ * @return {Number}
871
+ */
872
+ galoisField.exp = function exp (n) {
873
+ return EXP_TABLE[n]
874
+ };
875
+
876
+ /**
877
+ * Multiplies two number inside Galois Field
878
+ *
879
+ * @param {Number} x
880
+ * @param {Number} y
881
+ * @return {Number}
882
+ */
883
+ galoisField.mul = function mul (x, y) {
884
+ if (x === 0 || y === 0) return 0
885
+
886
+ // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized
887
+ // @see {@link initTables}
888
+ return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]
889
+ };
890
+ return galoisField;
891
+ }
892
+
893
+ var hasRequiredPolynomial;
894
+
895
+ function requirePolynomial () {
896
+ if (hasRequiredPolynomial) return polynomial;
897
+ hasRequiredPolynomial = 1;
898
+ (function (exports) {
899
+ const GF = requireGaloisField();
900
+
901
+ /**
902
+ * Multiplies two polynomials inside Galois Field
903
+ *
904
+ * @param {Uint8Array} p1 Polynomial
905
+ * @param {Uint8Array} p2 Polynomial
906
+ * @return {Uint8Array} Product of p1 and p2
907
+ */
908
+ exports.mul = function mul (p1, p2) {
909
+ const coeff = new Uint8Array(p1.length + p2.length - 1);
910
+
911
+ for (let i = 0; i < p1.length; i++) {
912
+ for (let j = 0; j < p2.length; j++) {
913
+ coeff[i + j] ^= GF.mul(p1[i], p2[j]);
914
+ }
915
+ }
916
+
917
+ return coeff
918
+ };
919
+
920
+ /**
921
+ * Calculate the remainder of polynomials division
922
+ *
923
+ * @param {Uint8Array} divident Polynomial
924
+ * @param {Uint8Array} divisor Polynomial
925
+ * @return {Uint8Array} Remainder
926
+ */
927
+ exports.mod = function mod (divident, divisor) {
928
+ let result = new Uint8Array(divident);
929
+
930
+ while ((result.length - divisor.length) >= 0) {
931
+ const coeff = result[0];
932
+
933
+ for (let i = 0; i < divisor.length; i++) {
934
+ result[i] ^= GF.mul(divisor[i], coeff);
935
+ }
936
+
937
+ // remove all zeros from buffer head
938
+ let offset = 0;
939
+ while (offset < result.length && result[offset] === 0) offset++;
940
+ result = result.slice(offset);
941
+ }
942
+
943
+ return result
944
+ };
945
+
946
+ /**
947
+ * Generate an irreducible generator polynomial of specified degree
948
+ * (used by Reed-Solomon encoder)
949
+ *
950
+ * @param {Number} degree Degree of the generator polynomial
951
+ * @return {Uint8Array} Buffer containing polynomial coefficients
952
+ */
953
+ exports.generateECPolynomial = function generateECPolynomial (degree) {
954
+ let poly = new Uint8Array([1]);
955
+ for (let i = 0; i < degree; i++) {
956
+ poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]));
957
+ }
958
+
959
+ return poly
960
+ };
961
+ } (polynomial));
962
+ return polynomial;
963
+ }
964
+
965
+ var reedSolomonEncoder;
966
+ var hasRequiredReedSolomonEncoder;
967
+
968
+ function requireReedSolomonEncoder () {
969
+ if (hasRequiredReedSolomonEncoder) return reedSolomonEncoder;
970
+ hasRequiredReedSolomonEncoder = 1;
971
+ const Polynomial = requirePolynomial();
972
+
973
+ function ReedSolomonEncoder (degree) {
974
+ this.genPoly = undefined;
975
+ this.degree = degree;
976
+
977
+ if (this.degree) this.initialize(this.degree);
978
+ }
979
+
980
+ /**
981
+ * Initialize the encoder.
982
+ * The input param should correspond to the number of error correction codewords.
983
+ *
984
+ * @param {Number} degree
985
+ */
986
+ ReedSolomonEncoder.prototype.initialize = function initialize (degree) {
987
+ // create an irreducible generator polynomial
988
+ this.degree = degree;
989
+ this.genPoly = Polynomial.generateECPolynomial(this.degree);
990
+ };
991
+
992
+ /**
993
+ * Encodes a chunk of data
994
+ *
995
+ * @param {Uint8Array} data Buffer containing input data
996
+ * @return {Uint8Array} Buffer containing encoded data
997
+ */
998
+ ReedSolomonEncoder.prototype.encode = function encode (data) {
999
+ if (!this.genPoly) {
1000
+ throw new Error('Encoder not initialized')
1001
+ }
1002
+
1003
+ // Calculate EC for this data block
1004
+ // extends data size to data+genPoly size
1005
+ const paddedData = new Uint8Array(data.length + this.degree);
1006
+ paddedData.set(data);
1007
+
1008
+ // The error correction codewords are the remainder after dividing the data codewords
1009
+ // by a generator polynomial
1010
+ const remainder = Polynomial.mod(paddedData, this.genPoly);
1011
+
1012
+ // return EC data blocks (last n byte, where n is the degree of genPoly)
1013
+ // If coefficients number in remainder are less than genPoly degree,
1014
+ // pad with 0s to the left to reach the needed number of coefficients
1015
+ const start = this.degree - remainder.length;
1016
+ if (start > 0) {
1017
+ const buff = new Uint8Array(this.degree);
1018
+ buff.set(remainder, start);
1019
+
1020
+ return buff
1021
+ }
1022
+
1023
+ return remainder
1024
+ };
1025
+
1026
+ reedSolomonEncoder = ReedSolomonEncoder;
1027
+ return reedSolomonEncoder;
1028
+ }
1029
+
1030
+ var version = {};
1031
+
1032
+ var mode = {};
1033
+
1034
+ var versionCheck = {};
1035
+
1036
+ /**
1037
+ * Check if QR Code version is valid
1038
+ *
1039
+ * @param {Number} version QR Code version
1040
+ * @return {Boolean} true if valid version, false otherwise
1041
+ */
1042
+
1043
+ var hasRequiredVersionCheck;
1044
+
1045
+ function requireVersionCheck () {
1046
+ if (hasRequiredVersionCheck) return versionCheck;
1047
+ hasRequiredVersionCheck = 1;
1048
+ versionCheck.isValid = function isValid (version) {
1049
+ return !isNaN(version) && version >= 1 && version <= 40
1050
+ };
1051
+ return versionCheck;
1052
+ }
1053
+
1054
+ var regex = {};
1055
+
1056
+ var hasRequiredRegex;
1057
+
1058
+ function requireRegex () {
1059
+ if (hasRequiredRegex) return regex;
1060
+ hasRequiredRegex = 1;
1061
+ const numeric = '[0-9]+';
1062
+ const alphanumeric = '[A-Z $%*+\\-./:]+';
1063
+ let kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +
1064
+ '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +
1065
+ '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +
1066
+ '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+';
1067
+ kanji = kanji.replace(/u/g, '\\u');
1068
+
1069
+ const byte = '(?:(?![A-Z0-9 $%*+\\-./:]|' + kanji + ')(?:.|[\r\n]))+';
1070
+
1071
+ regex.KANJI = new RegExp(kanji, 'g');
1072
+ regex.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\-./:]+', 'g');
1073
+ regex.BYTE = new RegExp(byte, 'g');
1074
+ regex.NUMERIC = new RegExp(numeric, 'g');
1075
+ regex.ALPHANUMERIC = new RegExp(alphanumeric, 'g');
1076
+
1077
+ const TEST_KANJI = new RegExp('^' + kanji + '$');
1078
+ const TEST_NUMERIC = new RegExp('^' + numeric + '$');
1079
+ const TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\-./:]+$');
1080
+
1081
+ regex.testKanji = function testKanji (str) {
1082
+ return TEST_KANJI.test(str)
1083
+ };
1084
+
1085
+ regex.testNumeric = function testNumeric (str) {
1086
+ return TEST_NUMERIC.test(str)
1087
+ };
1088
+
1089
+ regex.testAlphanumeric = function testAlphanumeric (str) {
1090
+ return TEST_ALPHANUMERIC.test(str)
1091
+ };
1092
+ return regex;
1093
+ }
1094
+
1095
+ var hasRequiredMode;
1096
+
1097
+ function requireMode () {
1098
+ if (hasRequiredMode) return mode;
1099
+ hasRequiredMode = 1;
1100
+ (function (exports) {
1101
+ const VersionCheck = requireVersionCheck();
1102
+ const Regex = requireRegex();
1103
+
1104
+ /**
1105
+ * Numeric mode encodes data from the decimal digit set (0 - 9)
1106
+ * (byte values 30HEX to 39HEX).
1107
+ * Normally, 3 data characters are represented by 10 bits.
1108
+ *
1109
+ * @type {Object}
1110
+ */
1111
+ exports.NUMERIC = {
1112
+ id: 'Numeric',
1113
+ bit: 1 << 0,
1114
+ ccBits: [10, 12, 14]
1115
+ };
1116
+
1117
+ /**
1118
+ * Alphanumeric mode encodes data from a set of 45 characters,
1119
+ * i.e. 10 numeric digits (0 - 9),
1120
+ * 26 alphabetic characters (A - Z),
1121
+ * and 9 symbols (SP, $, %, *, +, -, ., /, :).
1122
+ * Normally, two input characters are represented by 11 bits.
1123
+ *
1124
+ * @type {Object}
1125
+ */
1126
+ exports.ALPHANUMERIC = {
1127
+ id: 'Alphanumeric',
1128
+ bit: 1 << 1,
1129
+ ccBits: [9, 11, 13]
1130
+ };
1131
+
1132
+ /**
1133
+ * In byte mode, data is encoded at 8 bits per character.
1134
+ *
1135
+ * @type {Object}
1136
+ */
1137
+ exports.BYTE = {
1138
+ id: 'Byte',
1139
+ bit: 1 << 2,
1140
+ ccBits: [8, 16, 16]
1141
+ };
1142
+
1143
+ /**
1144
+ * The Kanji mode efficiently encodes Kanji characters in accordance with
1145
+ * the Shift JIS system based on JIS X 0208.
1146
+ * The Shift JIS values are shifted from the JIS X 0208 values.
1147
+ * JIS X 0208 gives details of the shift coded representation.
1148
+ * Each two-byte character value is compacted to a 13-bit binary codeword.
1149
+ *
1150
+ * @type {Object}
1151
+ */
1152
+ exports.KANJI = {
1153
+ id: 'Kanji',
1154
+ bit: 1 << 3,
1155
+ ccBits: [8, 10, 12]
1156
+ };
1157
+
1158
+ /**
1159
+ * Mixed mode will contain a sequences of data in a combination of any of
1160
+ * the modes described above
1161
+ *
1162
+ * @type {Object}
1163
+ */
1164
+ exports.MIXED = {
1165
+ bit: -1
1166
+ };
1167
+
1168
+ /**
1169
+ * Returns the number of bits needed to store the data length
1170
+ * according to QR Code specifications.
1171
+ *
1172
+ * @param {Mode} mode Data mode
1173
+ * @param {Number} version QR Code version
1174
+ * @return {Number} Number of bits
1175
+ */
1176
+ exports.getCharCountIndicator = function getCharCountIndicator (mode, version) {
1177
+ if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)
1178
+
1179
+ if (!VersionCheck.isValid(version)) {
1180
+ throw new Error('Invalid version: ' + version)
1181
+ }
1182
+
1183
+ if (version >= 1 && version < 10) return mode.ccBits[0]
1184
+ else if (version < 27) return mode.ccBits[1]
1185
+ return mode.ccBits[2]
1186
+ };
1187
+
1188
+ /**
1189
+ * Returns the most efficient mode to store the specified data
1190
+ *
1191
+ * @param {String} dataStr Input data string
1192
+ * @return {Mode} Best mode
1193
+ */
1194
+ exports.getBestModeForData = function getBestModeForData (dataStr) {
1195
+ if (Regex.testNumeric(dataStr)) return exports.NUMERIC
1196
+ else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC
1197
+ else if (Regex.testKanji(dataStr)) return exports.KANJI
1198
+ else return exports.BYTE
1199
+ };
1200
+
1201
+ /**
1202
+ * Return mode name as string
1203
+ *
1204
+ * @param {Mode} mode Mode object
1205
+ * @returns {String} Mode name
1206
+ */
1207
+ exports.toString = function toString (mode) {
1208
+ if (mode && mode.id) return mode.id
1209
+ throw new Error('Invalid mode')
1210
+ };
1211
+
1212
+ /**
1213
+ * Check if input param is a valid mode object
1214
+ *
1215
+ * @param {Mode} mode Mode object
1216
+ * @returns {Boolean} True if valid mode, false otherwise
1217
+ */
1218
+ exports.isValid = function isValid (mode) {
1219
+ return mode && mode.bit && mode.ccBits
1220
+ };
1221
+
1222
+ /**
1223
+ * Get mode object from its name
1224
+ *
1225
+ * @param {String} string Mode name
1226
+ * @returns {Mode} Mode object
1227
+ */
1228
+ function fromString (string) {
1229
+ if (typeof string !== 'string') {
1230
+ throw new Error('Param is not a string')
1231
+ }
1232
+
1233
+ const lcStr = string.toLowerCase();
1234
+
1235
+ switch (lcStr) {
1236
+ case 'numeric':
1237
+ return exports.NUMERIC
1238
+ case 'alphanumeric':
1239
+ return exports.ALPHANUMERIC
1240
+ case 'kanji':
1241
+ return exports.KANJI
1242
+ case 'byte':
1243
+ return exports.BYTE
1244
+ default:
1245
+ throw new Error('Unknown mode: ' + string)
1246
+ }
1247
+ }
1248
+
1249
+ /**
1250
+ * Returns mode from a value.
1251
+ * If value is not a valid mode, returns defaultValue
1252
+ *
1253
+ * @param {Mode|String} value Encoding mode
1254
+ * @param {Mode} defaultValue Fallback value
1255
+ * @return {Mode} Encoding mode
1256
+ */
1257
+ exports.from = function from (value, defaultValue) {
1258
+ if (exports.isValid(value)) {
1259
+ return value
1260
+ }
1261
+
1262
+ try {
1263
+ return fromString(value)
1264
+ } catch (e) {
1265
+ return defaultValue
1266
+ }
1267
+ };
1268
+ } (mode));
1269
+ return mode;
1270
+ }
1271
+
1272
+ var hasRequiredVersion;
1273
+
1274
+ function requireVersion () {
1275
+ if (hasRequiredVersion) return version;
1276
+ hasRequiredVersion = 1;
1277
+ (function (exports) {
1278
+ const Utils = requireUtils$1();
1279
+ const ECCode = requireErrorCorrectionCode();
1280
+ const ECLevel = requireErrorCorrectionLevel();
1281
+ const Mode = requireMode();
1282
+ const VersionCheck = requireVersionCheck();
1283
+
1284
+ // Generator polynomial used to encode version information
1285
+ const G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
1286
+ const G18_BCH = Utils.getBCHDigit(G18);
1287
+
1288
+ function getBestVersionForDataLength (mode, length, errorCorrectionLevel) {
1289
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
1290
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
1291
+ return currentVersion
1292
+ }
1293
+ }
1294
+
1295
+ return undefined
1296
+ }
1297
+
1298
+ function getReservedBitsCount (mode, version) {
1299
+ // Character count indicator + mode indicator bits
1300
+ return Mode.getCharCountIndicator(mode, version) + 4
1301
+ }
1302
+
1303
+ function getTotalBitsFromDataArray (segments, version) {
1304
+ let totalBits = 0;
1305
+
1306
+ segments.forEach(function (data) {
1307
+ const reservedBits = getReservedBitsCount(data.mode, version);
1308
+ totalBits += reservedBits + data.getBitsLength();
1309
+ });
1310
+
1311
+ return totalBits
1312
+ }
1313
+
1314
+ function getBestVersionForMixedData (segments, errorCorrectionLevel) {
1315
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
1316
+ const length = getTotalBitsFromDataArray(segments, currentVersion);
1317
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
1318
+ return currentVersion
1319
+ }
1320
+ }
1321
+
1322
+ return undefined
1323
+ }
1324
+
1325
+ /**
1326
+ * Returns version number from a value.
1327
+ * If value is not a valid version, returns defaultValue
1328
+ *
1329
+ * @param {Number|String} value QR Code version
1330
+ * @param {Number} defaultValue Fallback value
1331
+ * @return {Number} QR Code version number
1332
+ */
1333
+ exports.from = function from (value, defaultValue) {
1334
+ if (VersionCheck.isValid(value)) {
1335
+ return parseInt(value, 10)
1336
+ }
1337
+
1338
+ return defaultValue
1339
+ };
1340
+
1341
+ /**
1342
+ * Returns how much data can be stored with the specified QR code version
1343
+ * and error correction level
1344
+ *
1345
+ * @param {Number} version QR Code version (1-40)
1346
+ * @param {Number} errorCorrectionLevel Error correction level
1347
+ * @param {Mode} mode Data mode
1348
+ * @return {Number} Quantity of storable data
1349
+ */
1350
+ exports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {
1351
+ if (!VersionCheck.isValid(version)) {
1352
+ throw new Error('Invalid QR Code version')
1353
+ }
1354
+
1355
+ // Use Byte mode as default
1356
+ if (typeof mode === 'undefined') mode = Mode.BYTE;
1357
+
1358
+ // Total codewords for this QR code version (Data + Error correction)
1359
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
1360
+
1361
+ // Total number of error correction codewords
1362
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
1363
+
1364
+ // Total number of data codewords
1365
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
1366
+
1367
+ if (mode === Mode.MIXED) return dataTotalCodewordsBits
1368
+
1369
+ const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version);
1370
+
1371
+ // Return max number of storable codewords
1372
+ switch (mode) {
1373
+ case Mode.NUMERIC:
1374
+ return Math.floor((usableBits / 10) * 3)
1375
+
1376
+ case Mode.ALPHANUMERIC:
1377
+ return Math.floor((usableBits / 11) * 2)
1378
+
1379
+ case Mode.KANJI:
1380
+ return Math.floor(usableBits / 13)
1381
+
1382
+ case Mode.BYTE:
1383
+ default:
1384
+ return Math.floor(usableBits / 8)
1385
+ }
1386
+ };
1387
+
1388
+ /**
1389
+ * Returns the minimum version needed to contain the amount of data
1390
+ *
1391
+ * @param {Segment} data Segment of data
1392
+ * @param {Number} [errorCorrectionLevel=H] Error correction level
1393
+ * @param {Mode} mode Data mode
1394
+ * @return {Number} QR Code version
1395
+ */
1396
+ exports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {
1397
+ let seg;
1398
+
1399
+ const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M);
1400
+
1401
+ if (Array.isArray(data)) {
1402
+ if (data.length > 1) {
1403
+ return getBestVersionForMixedData(data, ecl)
1404
+ }
1405
+
1406
+ if (data.length === 0) {
1407
+ return 1
1408
+ }
1409
+
1410
+ seg = data[0];
1411
+ } else {
1412
+ seg = data;
1413
+ }
1414
+
1415
+ return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)
1416
+ };
1417
+
1418
+ /**
1419
+ * Returns version information with relative error correction bits
1420
+ *
1421
+ * The version information is included in QR Code symbols of version 7 or larger.
1422
+ * It consists of an 18-bit sequence containing 6 data bits,
1423
+ * with 12 error correction bits calculated using the (18, 6) Golay code.
1424
+ *
1425
+ * @param {Number} version QR Code version
1426
+ * @return {Number} Encoded version info bits
1427
+ */
1428
+ exports.getEncodedBits = function getEncodedBits (version) {
1429
+ if (!VersionCheck.isValid(version) || version < 7) {
1430
+ throw new Error('Invalid QR Code version')
1431
+ }
1432
+
1433
+ let d = version << 12;
1434
+
1435
+ while (Utils.getBCHDigit(d) - G18_BCH >= 0) {
1436
+ d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH));
1437
+ }
1438
+
1439
+ return (version << 12) | d
1440
+ };
1441
+ } (version));
1442
+ return version;
1443
+ }
1444
+
1445
+ var formatInfo = {};
1446
+
1447
+ var hasRequiredFormatInfo;
1448
+
1449
+ function requireFormatInfo () {
1450
+ if (hasRequiredFormatInfo) return formatInfo;
1451
+ hasRequiredFormatInfo = 1;
1452
+ const Utils = requireUtils$1();
1453
+
1454
+ const G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
1455
+ const G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1);
1456
+ const G15_BCH = Utils.getBCHDigit(G15);
1457
+
1458
+ /**
1459
+ * Returns format information with relative error correction bits
1460
+ *
1461
+ * The format information is a 15-bit sequence containing 5 data bits,
1462
+ * with 10 error correction bits calculated using the (15, 5) BCH code.
1463
+ *
1464
+ * @param {Number} errorCorrectionLevel Error correction level
1465
+ * @param {Number} mask Mask pattern
1466
+ * @return {Number} Encoded format information bits
1467
+ */
1468
+ formatInfo.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {
1469
+ const data = ((errorCorrectionLevel.bit << 3) | mask);
1470
+ let d = data << 10;
1471
+
1472
+ while (Utils.getBCHDigit(d) - G15_BCH >= 0) {
1473
+ d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH));
1474
+ }
1475
+
1476
+ // xor final data with mask pattern in order to ensure that
1477
+ // no combination of Error Correction Level and data mask pattern
1478
+ // will result in an all-zero data string
1479
+ return ((data << 10) | d) ^ G15_MASK
1480
+ };
1481
+ return formatInfo;
1482
+ }
1483
+
1484
+ var segments = {};
1485
+
1486
+ var numericData;
1487
+ var hasRequiredNumericData;
1488
+
1489
+ function requireNumericData () {
1490
+ if (hasRequiredNumericData) return numericData;
1491
+ hasRequiredNumericData = 1;
1492
+ const Mode = requireMode();
1493
+
1494
+ function NumericData (data) {
1495
+ this.mode = Mode.NUMERIC;
1496
+ this.data = data.toString();
1497
+ }
1498
+
1499
+ NumericData.getBitsLength = function getBitsLength (length) {
1500
+ return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)
1501
+ };
1502
+
1503
+ NumericData.prototype.getLength = function getLength () {
1504
+ return this.data.length
1505
+ };
1506
+
1507
+ NumericData.prototype.getBitsLength = function getBitsLength () {
1508
+ return NumericData.getBitsLength(this.data.length)
1509
+ };
1510
+
1511
+ NumericData.prototype.write = function write (bitBuffer) {
1512
+ let i, group, value;
1513
+
1514
+ // The input data string is divided into groups of three digits,
1515
+ // and each group is converted to its 10-bit binary equivalent.
1516
+ for (i = 0; i + 3 <= this.data.length; i += 3) {
1517
+ group = this.data.substr(i, 3);
1518
+ value = parseInt(group, 10);
1519
+
1520
+ bitBuffer.put(value, 10);
1521
+ }
1522
+
1523
+ // If the number of input digits is not an exact multiple of three,
1524
+ // the final one or two digits are converted to 4 or 7 bits respectively.
1525
+ const remainingNum = this.data.length - i;
1526
+ if (remainingNum > 0) {
1527
+ group = this.data.substr(i);
1528
+ value = parseInt(group, 10);
1529
+
1530
+ bitBuffer.put(value, remainingNum * 3 + 1);
1531
+ }
1532
+ };
1533
+
1534
+ numericData = NumericData;
1535
+ return numericData;
1536
+ }
1537
+
1538
+ var alphanumericData;
1539
+ var hasRequiredAlphanumericData;
1540
+
1541
+ function requireAlphanumericData () {
1542
+ if (hasRequiredAlphanumericData) return alphanumericData;
1543
+ hasRequiredAlphanumericData = 1;
1544
+ const Mode = requireMode();
1545
+
1546
+ /**
1547
+ * Array of characters available in alphanumeric mode
1548
+ *
1549
+ * As per QR Code specification, to each character
1550
+ * is assigned a value from 0 to 44 which in this case coincides
1551
+ * with the array index
1552
+ *
1553
+ * @type {Array}
1554
+ */
1555
+ const ALPHA_NUM_CHARS = [
1556
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
1557
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
1558
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
1559
+ ' ', '$', '%', '*', '+', '-', '.', '/', ':'
1560
+ ];
1561
+
1562
+ function AlphanumericData (data) {
1563
+ this.mode = Mode.ALPHANUMERIC;
1564
+ this.data = data;
1565
+ }
1566
+
1567
+ AlphanumericData.getBitsLength = function getBitsLength (length) {
1568
+ return 11 * Math.floor(length / 2) + 6 * (length % 2)
1569
+ };
1570
+
1571
+ AlphanumericData.prototype.getLength = function getLength () {
1572
+ return this.data.length
1573
+ };
1574
+
1575
+ AlphanumericData.prototype.getBitsLength = function getBitsLength () {
1576
+ return AlphanumericData.getBitsLength(this.data.length)
1577
+ };
1578
+
1579
+ AlphanumericData.prototype.write = function write (bitBuffer) {
1580
+ let i;
1581
+
1582
+ // Input data characters are divided into groups of two characters
1583
+ // and encoded as 11-bit binary codes.
1584
+ for (i = 0; i + 2 <= this.data.length; i += 2) {
1585
+ // The character value of the first character is multiplied by 45
1586
+ let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45;
1587
+
1588
+ // The character value of the second digit is added to the product
1589
+ value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1]);
1590
+
1591
+ // The sum is then stored as 11-bit binary number
1592
+ bitBuffer.put(value, 11);
1593
+ }
1594
+
1595
+ // If the number of input data characters is not a multiple of two,
1596
+ // the character value of the final character is encoded as a 6-bit binary number.
1597
+ if (this.data.length % 2) {
1598
+ bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6);
1599
+ }
1600
+ };
1601
+
1602
+ alphanumericData = AlphanumericData;
1603
+ return alphanumericData;
1604
+ }
1605
+
1606
+ var byteData;
1607
+ var hasRequiredByteData;
1608
+
1609
+ function requireByteData () {
1610
+ if (hasRequiredByteData) return byteData;
1611
+ hasRequiredByteData = 1;
1612
+ const Mode = requireMode();
1613
+
1614
+ function ByteData (data) {
1615
+ this.mode = Mode.BYTE;
1616
+ if (typeof (data) === 'string') {
1617
+ this.data = new TextEncoder().encode(data);
1618
+ } else {
1619
+ this.data = new Uint8Array(data);
1620
+ }
1621
+ }
1622
+
1623
+ ByteData.getBitsLength = function getBitsLength (length) {
1624
+ return length * 8
1625
+ };
1626
+
1627
+ ByteData.prototype.getLength = function getLength () {
1628
+ return this.data.length
1629
+ };
1630
+
1631
+ ByteData.prototype.getBitsLength = function getBitsLength () {
1632
+ return ByteData.getBitsLength(this.data.length)
1633
+ };
1634
+
1635
+ ByteData.prototype.write = function (bitBuffer) {
1636
+ for (let i = 0, l = this.data.length; i < l; i++) {
1637
+ bitBuffer.put(this.data[i], 8);
1638
+ }
1639
+ };
1640
+
1641
+ byteData = ByteData;
1642
+ return byteData;
1643
+ }
1644
+
1645
+ var kanjiData;
1646
+ var hasRequiredKanjiData;
1647
+
1648
+ function requireKanjiData () {
1649
+ if (hasRequiredKanjiData) return kanjiData;
1650
+ hasRequiredKanjiData = 1;
1651
+ const Mode = requireMode();
1652
+ const Utils = requireUtils$1();
1653
+
1654
+ function KanjiData (data) {
1655
+ this.mode = Mode.KANJI;
1656
+ this.data = data;
1657
+ }
1658
+
1659
+ KanjiData.getBitsLength = function getBitsLength (length) {
1660
+ return length * 13
1661
+ };
1662
+
1663
+ KanjiData.prototype.getLength = function getLength () {
1664
+ return this.data.length
1665
+ };
1666
+
1667
+ KanjiData.prototype.getBitsLength = function getBitsLength () {
1668
+ return KanjiData.getBitsLength(this.data.length)
1669
+ };
1670
+
1671
+ KanjiData.prototype.write = function (bitBuffer) {
1672
+ let i;
1673
+
1674
+ // In the Shift JIS system, Kanji characters are represented by a two byte combination.
1675
+ // These byte values are shifted from the JIS X 0208 values.
1676
+ // JIS X 0208 gives details of the shift coded representation.
1677
+ for (i = 0; i < this.data.length; i++) {
1678
+ let value = Utils.toSJIS(this.data[i]);
1679
+
1680
+ // For characters with Shift JIS values from 0x8140 to 0x9FFC:
1681
+ if (value >= 0x8140 && value <= 0x9FFC) {
1682
+ // Subtract 0x8140 from Shift JIS value
1683
+ value -= 0x8140;
1684
+
1685
+ // For characters with Shift JIS values from 0xE040 to 0xEBBF
1686
+ } else if (value >= 0xE040 && value <= 0xEBBF) {
1687
+ // Subtract 0xC140 from Shift JIS value
1688
+ value -= 0xC140;
1689
+ } else {
1690
+ throw new Error(
1691
+ 'Invalid SJIS character: ' + this.data[i] + '\n' +
1692
+ 'Make sure your charset is UTF-8')
1693
+ }
1694
+
1695
+ // Multiply most significant byte of result by 0xC0
1696
+ // and add least significant byte to product
1697
+ value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff);
1698
+
1699
+ // Convert result to a 13-bit binary string
1700
+ bitBuffer.put(value, 13);
1701
+ }
1702
+ };
1703
+
1704
+ kanjiData = KanjiData;
1705
+ return kanjiData;
1706
+ }
1707
+
1708
+ var dijkstra = {exports: {}};
1709
+
1710
+ var hasRequiredDijkstra;
1711
+
1712
+ function requireDijkstra () {
1713
+ if (hasRequiredDijkstra) return dijkstra.exports;
1714
+ hasRequiredDijkstra = 1;
1715
+ (function (module) {
1716
+
1717
+ /******************************************************************************
1718
+ * Created 2008-08-19.
1719
+ *
1720
+ * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.
1721
+ *
1722
+ * Copyright (C) 2008
1723
+ * Wyatt Baldwin <self@wyattbaldwin.com>
1724
+ * All rights reserved
1725
+ *
1726
+ * Licensed under the MIT license.
1727
+ *
1728
+ * http://www.opensource.org/licenses/mit-license.php
1729
+ *
1730
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1731
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1732
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1733
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1734
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1735
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1736
+ * THE SOFTWARE.
1737
+ *****************************************************************************/
1738
+ var dijkstra = {
1739
+ single_source_shortest_paths: function(graph, s, d) {
1740
+ // Predecessor map for each node that has been encountered.
1741
+ // node ID => predecessor node ID
1742
+ var predecessors = {};
1743
+
1744
+ // Costs of shortest paths from s to all nodes encountered.
1745
+ // node ID => cost
1746
+ var costs = {};
1747
+ costs[s] = 0;
1748
+
1749
+ // Costs of shortest paths from s to all nodes encountered; differs from
1750
+ // `costs` in that it provides easy access to the node that currently has
1751
+ // the known shortest path from s.
1752
+ // XXX: Do we actually need both `costs` and `open`?
1753
+ var open = dijkstra.PriorityQueue.make();
1754
+ open.push(s, 0);
1755
+
1756
+ var closest,
1757
+ u, v,
1758
+ cost_of_s_to_u,
1759
+ adjacent_nodes,
1760
+ cost_of_e,
1761
+ cost_of_s_to_u_plus_cost_of_e,
1762
+ cost_of_s_to_v,
1763
+ first_visit;
1764
+ while (!open.empty()) {
1765
+ // In the nodes remaining in graph that have a known cost from s,
1766
+ // find the node, u, that currently has the shortest path from s.
1767
+ closest = open.pop();
1768
+ u = closest.value;
1769
+ cost_of_s_to_u = closest.cost;
1770
+
1771
+ // Get nodes adjacent to u...
1772
+ adjacent_nodes = graph[u] || {};
1773
+
1774
+ // ...and explore the edges that connect u to those nodes, updating
1775
+ // the cost of the shortest paths to any or all of those nodes as
1776
+ // necessary. v is the node across the current edge from u.
1777
+ for (v in adjacent_nodes) {
1778
+ if (adjacent_nodes.hasOwnProperty(v)) {
1779
+ // Get the cost of the edge running from u to v.
1780
+ cost_of_e = adjacent_nodes[v];
1781
+
1782
+ // Cost of s to u plus the cost of u to v across e--this is *a*
1783
+ // cost from s to v that may or may not be less than the current
1784
+ // known cost to v.
1785
+ cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
1786
+
1787
+ // If we haven't visited v yet OR if the current known cost from s to
1788
+ // v is greater than the new cost we just found (cost of s to u plus
1789
+ // cost of u to v across e), update v's cost in the cost list and
1790
+ // update v's predecessor in the predecessor list (it's now u).
1791
+ cost_of_s_to_v = costs[v];
1792
+ first_visit = (typeof costs[v] === 'undefined');
1793
+ if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
1794
+ costs[v] = cost_of_s_to_u_plus_cost_of_e;
1795
+ open.push(v, cost_of_s_to_u_plus_cost_of_e);
1796
+ predecessors[v] = u;
1797
+ }
1798
+ }
1799
+ }
1800
+ }
1801
+
1802
+ if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {
1803
+ var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');
1804
+ throw new Error(msg);
1805
+ }
1806
+
1807
+ return predecessors;
1808
+ },
1809
+
1810
+ extract_shortest_path_from_predecessor_list: function(predecessors, d) {
1811
+ var nodes = [];
1812
+ var u = d;
1813
+ while (u) {
1814
+ nodes.push(u);
1815
+ u = predecessors[u];
1816
+ }
1817
+ nodes.reverse();
1818
+ return nodes;
1819
+ },
1820
+
1821
+ find_path: function(graph, s, d) {
1822
+ var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);
1823
+ return dijkstra.extract_shortest_path_from_predecessor_list(
1824
+ predecessors, d);
1825
+ },
1826
+
1827
+ /**
1828
+ * A very naive priority queue implementation.
1829
+ */
1830
+ PriorityQueue: {
1831
+ make: function (opts) {
1832
+ var T = dijkstra.PriorityQueue,
1833
+ t = {},
1834
+ key;
1835
+ opts = opts || {};
1836
+ for (key in T) {
1837
+ if (T.hasOwnProperty(key)) {
1838
+ t[key] = T[key];
1839
+ }
1840
+ }
1841
+ t.queue = [];
1842
+ t.sorter = opts.sorter || T.default_sorter;
1843
+ return t;
1844
+ },
1845
+
1846
+ default_sorter: function (a, b) {
1847
+ return a.cost - b.cost;
1848
+ },
1849
+
1850
+ /**
1851
+ * Add a new item to the queue and ensure the highest priority element
1852
+ * is at the front of the queue.
1853
+ */
1854
+ push: function (value, cost) {
1855
+ var item = {value: value, cost: cost};
1856
+ this.queue.push(item);
1857
+ this.queue.sort(this.sorter);
1858
+ },
1859
+
1860
+ /**
1861
+ * Return the highest priority element in the queue.
1862
+ */
1863
+ pop: function () {
1864
+ return this.queue.shift();
1865
+ },
1866
+
1867
+ empty: function () {
1868
+ return this.queue.length === 0;
1869
+ }
1870
+ }
1871
+ };
1872
+
1873
+
1874
+ // node.js module exports
1875
+ {
1876
+ module.exports = dijkstra;
1877
+ }
1878
+ } (dijkstra));
1879
+ return dijkstra.exports;
1880
+ }
1881
+
1882
+ var hasRequiredSegments;
1883
+
1884
+ function requireSegments () {
1885
+ if (hasRequiredSegments) return segments;
1886
+ hasRequiredSegments = 1;
1887
+ (function (exports) {
1888
+ const Mode = requireMode();
1889
+ const NumericData = requireNumericData();
1890
+ const AlphanumericData = requireAlphanumericData();
1891
+ const ByteData = requireByteData();
1892
+ const KanjiData = requireKanjiData();
1893
+ const Regex = requireRegex();
1894
+ const Utils = requireUtils$1();
1895
+ const dijkstra = requireDijkstra();
1896
+
1897
+ /**
1898
+ * Returns UTF8 byte length
1899
+ *
1900
+ * @param {String} str Input string
1901
+ * @return {Number} Number of byte
1902
+ */
1903
+ function getStringByteLength (str) {
1904
+ return unescape(encodeURIComponent(str)).length
1905
+ }
1906
+
1907
+ /**
1908
+ * Get a list of segments of the specified mode
1909
+ * from a string
1910
+ *
1911
+ * @param {Mode} mode Segment mode
1912
+ * @param {String} str String to process
1913
+ * @return {Array} Array of object with segments data
1914
+ */
1915
+ function getSegments (regex, mode, str) {
1916
+ const segments = [];
1917
+ let result;
1918
+
1919
+ while ((result = regex.exec(str)) !== null) {
1920
+ segments.push({
1921
+ data: result[0],
1922
+ index: result.index,
1923
+ mode: mode,
1924
+ length: result[0].length
1925
+ });
1926
+ }
1927
+
1928
+ return segments
1929
+ }
1930
+
1931
+ /**
1932
+ * Extracts a series of segments with the appropriate
1933
+ * modes from a string
1934
+ *
1935
+ * @param {String} dataStr Input string
1936
+ * @return {Array} Array of object with segments data
1937
+ */
1938
+ function getSegmentsFromString (dataStr) {
1939
+ const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr);
1940
+ const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr);
1941
+ let byteSegs;
1942
+ let kanjiSegs;
1943
+
1944
+ if (Utils.isKanjiModeEnabled()) {
1945
+ byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr);
1946
+ kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr);
1947
+ } else {
1948
+ byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr);
1949
+ kanjiSegs = [];
1950
+ }
1951
+
1952
+ const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs);
1953
+
1954
+ return segs
1955
+ .sort(function (s1, s2) {
1956
+ return s1.index - s2.index
1957
+ })
1958
+ .map(function (obj) {
1959
+ return {
1960
+ data: obj.data,
1961
+ mode: obj.mode,
1962
+ length: obj.length
1963
+ }
1964
+ })
1965
+ }
1966
+
1967
+ /**
1968
+ * Returns how many bits are needed to encode a string of
1969
+ * specified length with the specified mode
1970
+ *
1971
+ * @param {Number} length String length
1972
+ * @param {Mode} mode Segment mode
1973
+ * @return {Number} Bit length
1974
+ */
1975
+ function getSegmentBitsLength (length, mode) {
1976
+ switch (mode) {
1977
+ case Mode.NUMERIC:
1978
+ return NumericData.getBitsLength(length)
1979
+ case Mode.ALPHANUMERIC:
1980
+ return AlphanumericData.getBitsLength(length)
1981
+ case Mode.KANJI:
1982
+ return KanjiData.getBitsLength(length)
1983
+ case Mode.BYTE:
1984
+ return ByteData.getBitsLength(length)
1985
+ }
1986
+ }
1987
+
1988
+ /**
1989
+ * Merges adjacent segments which have the same mode
1990
+ *
1991
+ * @param {Array} segs Array of object with segments data
1992
+ * @return {Array} Array of object with segments data
1993
+ */
1994
+ function mergeSegments (segs) {
1995
+ return segs.reduce(function (acc, curr) {
1996
+ const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null;
1997
+ if (prevSeg && prevSeg.mode === curr.mode) {
1998
+ acc[acc.length - 1].data += curr.data;
1999
+ return acc
2000
+ }
2001
+
2002
+ acc.push(curr);
2003
+ return acc
2004
+ }, [])
2005
+ }
2006
+
2007
+ /**
2008
+ * Generates a list of all possible nodes combination which
2009
+ * will be used to build a segments graph.
2010
+ *
2011
+ * Nodes are divided by groups. Each group will contain a list of all the modes
2012
+ * in which is possible to encode the given text.
2013
+ *
2014
+ * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.
2015
+ * The group for '12345' will contain then 3 objects, one for each
2016
+ * possible encoding mode.
2017
+ *
2018
+ * Each node represents a possible segment.
2019
+ *
2020
+ * @param {Array} segs Array of object with segments data
2021
+ * @return {Array} Array of object with segments data
2022
+ */
2023
+ function buildNodes (segs) {
2024
+ const nodes = [];
2025
+ for (let i = 0; i < segs.length; i++) {
2026
+ const seg = segs[i];
2027
+
2028
+ switch (seg.mode) {
2029
+ case Mode.NUMERIC:
2030
+ nodes.push([seg,
2031
+ { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },
2032
+ { data: seg.data, mode: Mode.BYTE, length: seg.length }
2033
+ ]);
2034
+ break
2035
+ case Mode.ALPHANUMERIC:
2036
+ nodes.push([seg,
2037
+ { data: seg.data, mode: Mode.BYTE, length: seg.length }
2038
+ ]);
2039
+ break
2040
+ case Mode.KANJI:
2041
+ nodes.push([seg,
2042
+ { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
2043
+ ]);
2044
+ break
2045
+ case Mode.BYTE:
2046
+ nodes.push([
2047
+ { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
2048
+ ]);
2049
+ }
2050
+ }
2051
+
2052
+ return nodes
2053
+ }
2054
+
2055
+ /**
2056
+ * Builds a graph from a list of nodes.
2057
+ * All segments in each node group will be connected with all the segments of
2058
+ * the next group and so on.
2059
+ *
2060
+ * At each connection will be assigned a weight depending on the
2061
+ * segment's byte length.
2062
+ *
2063
+ * @param {Array} nodes Array of object with segments data
2064
+ * @param {Number} version QR Code version
2065
+ * @return {Object} Graph of all possible segments
2066
+ */
2067
+ function buildGraph (nodes, version) {
2068
+ const table = {};
2069
+ const graph = { start: {} };
2070
+ let prevNodeIds = ['start'];
2071
+
2072
+ for (let i = 0; i < nodes.length; i++) {
2073
+ const nodeGroup = nodes[i];
2074
+ const currentNodeIds = [];
2075
+
2076
+ for (let j = 0; j < nodeGroup.length; j++) {
2077
+ const node = nodeGroup[j];
2078
+ const key = '' + i + j;
2079
+
2080
+ currentNodeIds.push(key);
2081
+ table[key] = { node: node, lastCount: 0 };
2082
+ graph[key] = {};
2083
+
2084
+ for (let n = 0; n < prevNodeIds.length; n++) {
2085
+ const prevNodeId = prevNodeIds[n];
2086
+
2087
+ if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
2088
+ graph[prevNodeId][key] =
2089
+ getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -
2090
+ getSegmentBitsLength(table[prevNodeId].lastCount, node.mode);
2091
+
2092
+ table[prevNodeId].lastCount += node.length;
2093
+ } else {
2094
+ if (table[prevNodeId]) table[prevNodeId].lastCount = node.length;
2095
+
2096
+ graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +
2097
+ 4 + Mode.getCharCountIndicator(node.mode, version); // switch cost
2098
+ }
2099
+ }
2100
+ }
2101
+
2102
+ prevNodeIds = currentNodeIds;
2103
+ }
2104
+
2105
+ for (let n = 0; n < prevNodeIds.length; n++) {
2106
+ graph[prevNodeIds[n]].end = 0;
2107
+ }
2108
+
2109
+ return { map: graph, table: table }
2110
+ }
2111
+
2112
+ /**
2113
+ * Builds a segment from a specified data and mode.
2114
+ * If a mode is not specified, the more suitable will be used.
2115
+ *
2116
+ * @param {String} data Input data
2117
+ * @param {Mode | String} modesHint Data mode
2118
+ * @return {Segment} Segment
2119
+ */
2120
+ function buildSingleSegment (data, modesHint) {
2121
+ let mode;
2122
+ const bestMode = Mode.getBestModeForData(data);
2123
+
2124
+ mode = Mode.from(modesHint, bestMode);
2125
+
2126
+ // Make sure data can be encoded
2127
+ if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {
2128
+ throw new Error('"' + data + '"' +
2129
+ ' cannot be encoded with mode ' + Mode.toString(mode) +
2130
+ '.\n Suggested mode is: ' + Mode.toString(bestMode))
2131
+ }
2132
+
2133
+ // Use Mode.BYTE if Kanji support is disabled
2134
+ if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {
2135
+ mode = Mode.BYTE;
2136
+ }
2137
+
2138
+ switch (mode) {
2139
+ case Mode.NUMERIC:
2140
+ return new NumericData(data)
2141
+
2142
+ case Mode.ALPHANUMERIC:
2143
+ return new AlphanumericData(data)
2144
+
2145
+ case Mode.KANJI:
2146
+ return new KanjiData(data)
2147
+
2148
+ case Mode.BYTE:
2149
+ return new ByteData(data)
2150
+ }
2151
+ }
2152
+
2153
+ /**
2154
+ * Builds a list of segments from an array.
2155
+ * Array can contain Strings or Objects with segment's info.
2156
+ *
2157
+ * For each item which is a string, will be generated a segment with the given
2158
+ * string and the more appropriate encoding mode.
2159
+ *
2160
+ * For each item which is an object, will be generated a segment with the given
2161
+ * data and mode.
2162
+ * Objects must contain at least the property "data".
2163
+ * If property "mode" is not present, the more suitable mode will be used.
2164
+ *
2165
+ * @param {Array} array Array of objects with segments data
2166
+ * @return {Array} Array of Segments
2167
+ */
2168
+ exports.fromArray = function fromArray (array) {
2169
+ return array.reduce(function (acc, seg) {
2170
+ if (typeof seg === 'string') {
2171
+ acc.push(buildSingleSegment(seg, null));
2172
+ } else if (seg.data) {
2173
+ acc.push(buildSingleSegment(seg.data, seg.mode));
2174
+ }
2175
+
2176
+ return acc
2177
+ }, [])
2178
+ };
2179
+
2180
+ /**
2181
+ * Builds an optimized sequence of segments from a string,
2182
+ * which will produce the shortest possible bitstream.
2183
+ *
2184
+ * @param {String} data Input string
2185
+ * @param {Number} version QR Code version
2186
+ * @return {Array} Array of segments
2187
+ */
2188
+ exports.fromString = function fromString (data, version) {
2189
+ const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
2190
+
2191
+ const nodes = buildNodes(segs);
2192
+ const graph = buildGraph(nodes, version);
2193
+ const path = dijkstra.find_path(graph.map, 'start', 'end');
2194
+
2195
+ const optimizedSegs = [];
2196
+ for (let i = 1; i < path.length - 1; i++) {
2197
+ optimizedSegs.push(graph.table[path[i]].node);
2198
+ }
2199
+
2200
+ return exports.fromArray(mergeSegments(optimizedSegs))
2201
+ };
2202
+
2203
+ /**
2204
+ * Splits a string in various segments with the modes which
2205
+ * best represent their content.
2206
+ * The produced segments are far from being optimized.
2207
+ * The output of this function is only used to estimate a QR Code version
2208
+ * which may contain the data.
2209
+ *
2210
+ * @param {string} data Input string
2211
+ * @return {Array} Array of segments
2212
+ */
2213
+ exports.rawSplit = function rawSplit (data) {
2214
+ return exports.fromArray(
2215
+ getSegmentsFromString(data, Utils.isKanjiModeEnabled())
2216
+ )
2217
+ };
2218
+ } (segments));
2219
+ return segments;
2220
+ }
2221
+
2222
+ var hasRequiredQrcode;
2223
+
2224
+ function requireQrcode () {
2225
+ if (hasRequiredQrcode) return qrcode;
2226
+ hasRequiredQrcode = 1;
2227
+ const Utils = requireUtils$1();
2228
+ const ECLevel = requireErrorCorrectionLevel();
2229
+ const BitBuffer = requireBitBuffer();
2230
+ const BitMatrix = requireBitMatrix();
2231
+ const AlignmentPattern = requireAlignmentPattern();
2232
+ const FinderPattern = requireFinderPattern();
2233
+ const MaskPattern = requireMaskPattern();
2234
+ const ECCode = requireErrorCorrectionCode();
2235
+ const ReedSolomonEncoder = requireReedSolomonEncoder();
2236
+ const Version = requireVersion();
2237
+ const FormatInfo = requireFormatInfo();
2238
+ const Mode = requireMode();
2239
+ const Segments = requireSegments();
2240
+
2241
+ /**
2242
+ * QRCode for JavaScript
2243
+ *
2244
+ * modified by Ryan Day for nodejs support
2245
+ * Copyright (c) 2011 Ryan Day
2246
+ *
2247
+ * Licensed under the MIT license:
2248
+ * http://www.opensource.org/licenses/mit-license.php
2249
+ *
2250
+ //---------------------------------------------------------------------
2251
+ // QRCode for JavaScript
2252
+ //
2253
+ // Copyright (c) 2009 Kazuhiko Arase
2254
+ //
2255
+ // URL: http://www.d-project.com/
2256
+ //
2257
+ // Licensed under the MIT license:
2258
+ // http://www.opensource.org/licenses/mit-license.php
2259
+ //
2260
+ // The word "QR Code" is registered trademark of
2261
+ // DENSO WAVE INCORPORATED
2262
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
2263
+ //
2264
+ //---------------------------------------------------------------------
2265
+ */
2266
+
2267
+ /**
2268
+ * Add finder patterns bits to matrix
2269
+ *
2270
+ * @param {BitMatrix} matrix Modules matrix
2271
+ * @param {Number} version QR Code version
2272
+ */
2273
+ function setupFinderPattern (matrix, version) {
2274
+ const size = matrix.size;
2275
+ const pos = FinderPattern.getPositions(version);
2276
+
2277
+ for (let i = 0; i < pos.length; i++) {
2278
+ const row = pos[i][0];
2279
+ const col = pos[i][1];
2280
+
2281
+ for (let r = -1; r <= 7; r++) {
2282
+ if (row + r <= -1 || size <= row + r) continue
2283
+
2284
+ for (let c = -1; c <= 7; c++) {
2285
+ if (col + c <= -1 || size <= col + c) continue
2286
+
2287
+ if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||
2288
+ (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||
2289
+ (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {
2290
+ matrix.set(row + r, col + c, true, true);
2291
+ } else {
2292
+ matrix.set(row + r, col + c, false, true);
2293
+ }
2294
+ }
2295
+ }
2296
+ }
2297
+ }
2298
+
2299
+ /**
2300
+ * Add timing pattern bits to matrix
2301
+ *
2302
+ * Note: this function must be called before {@link setupAlignmentPattern}
2303
+ *
2304
+ * @param {BitMatrix} matrix Modules matrix
2305
+ */
2306
+ function setupTimingPattern (matrix) {
2307
+ const size = matrix.size;
2308
+
2309
+ for (let r = 8; r < size - 8; r++) {
2310
+ const value = r % 2 === 0;
2311
+ matrix.set(r, 6, value, true);
2312
+ matrix.set(6, r, value, true);
2313
+ }
2314
+ }
2315
+
2316
+ /**
2317
+ * Add alignment patterns bits to matrix
2318
+ *
2319
+ * Note: this function must be called after {@link setupTimingPattern}
2320
+ *
2321
+ * @param {BitMatrix} matrix Modules matrix
2322
+ * @param {Number} version QR Code version
2323
+ */
2324
+ function setupAlignmentPattern (matrix, version) {
2325
+ const pos = AlignmentPattern.getPositions(version);
2326
+
2327
+ for (let i = 0; i < pos.length; i++) {
2328
+ const row = pos[i][0];
2329
+ const col = pos[i][1];
2330
+
2331
+ for (let r = -2; r <= 2; r++) {
2332
+ for (let c = -2; c <= 2; c++) {
2333
+ if (r === -2 || r === 2 || c === -2 || c === 2 ||
2334
+ (r === 0 && c === 0)) {
2335
+ matrix.set(row + r, col + c, true, true);
2336
+ } else {
2337
+ matrix.set(row + r, col + c, false, true);
2338
+ }
2339
+ }
2340
+ }
2341
+ }
2342
+ }
2343
+
2344
+ /**
2345
+ * Add version info bits to matrix
2346
+ *
2347
+ * @param {BitMatrix} matrix Modules matrix
2348
+ * @param {Number} version QR Code version
2349
+ */
2350
+ function setupVersionInfo (matrix, version) {
2351
+ const size = matrix.size;
2352
+ const bits = Version.getEncodedBits(version);
2353
+ let row, col, mod;
2354
+
2355
+ for (let i = 0; i < 18; i++) {
2356
+ row = Math.floor(i / 3);
2357
+ col = i % 3 + size - 8 - 3;
2358
+ mod = ((bits >> i) & 1) === 1;
2359
+
2360
+ matrix.set(row, col, mod, true);
2361
+ matrix.set(col, row, mod, true);
2362
+ }
2363
+ }
2364
+
2365
+ /**
2366
+ * Add format info bits to matrix
2367
+ *
2368
+ * @param {BitMatrix} matrix Modules matrix
2369
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
2370
+ * @param {Number} maskPattern Mask pattern reference value
2371
+ */
2372
+ function setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {
2373
+ const size = matrix.size;
2374
+ const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern);
2375
+ let i, mod;
2376
+
2377
+ for (i = 0; i < 15; i++) {
2378
+ mod = ((bits >> i) & 1) === 1;
2379
+
2380
+ // vertical
2381
+ if (i < 6) {
2382
+ matrix.set(i, 8, mod, true);
2383
+ } else if (i < 8) {
2384
+ matrix.set(i + 1, 8, mod, true);
2385
+ } else {
2386
+ matrix.set(size - 15 + i, 8, mod, true);
2387
+ }
2388
+
2389
+ // horizontal
2390
+ if (i < 8) {
2391
+ matrix.set(8, size - i - 1, mod, true);
2392
+ } else if (i < 9) {
2393
+ matrix.set(8, 15 - i - 1 + 1, mod, true);
2394
+ } else {
2395
+ matrix.set(8, 15 - i - 1, mod, true);
2396
+ }
2397
+ }
2398
+
2399
+ // fixed module
2400
+ matrix.set(size - 8, 8, 1, true);
2401
+ }
2402
+
2403
+ /**
2404
+ * Add encoded data bits to matrix
2405
+ *
2406
+ * @param {BitMatrix} matrix Modules matrix
2407
+ * @param {Uint8Array} data Data codewords
2408
+ */
2409
+ function setupData (matrix, data) {
2410
+ const size = matrix.size;
2411
+ let inc = -1;
2412
+ let row = size - 1;
2413
+ let bitIndex = 7;
2414
+ let byteIndex = 0;
2415
+
2416
+ for (let col = size - 1; col > 0; col -= 2) {
2417
+ if (col === 6) col--;
2418
+
2419
+ while (true) {
2420
+ for (let c = 0; c < 2; c++) {
2421
+ if (!matrix.isReserved(row, col - c)) {
2422
+ let dark = false;
2423
+
2424
+ if (byteIndex < data.length) {
2425
+ dark = (((data[byteIndex] >>> bitIndex) & 1) === 1);
2426
+ }
2427
+
2428
+ matrix.set(row, col - c, dark);
2429
+ bitIndex--;
2430
+
2431
+ if (bitIndex === -1) {
2432
+ byteIndex++;
2433
+ bitIndex = 7;
2434
+ }
2435
+ }
2436
+ }
2437
+
2438
+ row += inc;
2439
+
2440
+ if (row < 0 || size <= row) {
2441
+ row -= inc;
2442
+ inc = -inc;
2443
+ break
2444
+ }
2445
+ }
2446
+ }
2447
+ }
2448
+
2449
+ /**
2450
+ * Create encoded codewords from data input
2451
+ *
2452
+ * @param {Number} version QR Code version
2453
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
2454
+ * @param {ByteData} data Data input
2455
+ * @return {Uint8Array} Buffer containing encoded codewords
2456
+ */
2457
+ function createData (version, errorCorrectionLevel, segments) {
2458
+ // Prepare data buffer
2459
+ const buffer = new BitBuffer();
2460
+
2461
+ segments.forEach(function (data) {
2462
+ // prefix data with mode indicator (4 bits)
2463
+ buffer.put(data.mode.bit, 4);
2464
+
2465
+ // Prefix data with character count indicator.
2466
+ // The character count indicator is a string of bits that represents the
2467
+ // number of characters that are being encoded.
2468
+ // The character count indicator must be placed after the mode indicator
2469
+ // and must be a certain number of bits long, depending on the QR version
2470
+ // and data mode
2471
+ // @see {@link Mode.getCharCountIndicator}.
2472
+ buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version));
2473
+
2474
+ // add binary data sequence to buffer
2475
+ data.write(buffer);
2476
+ });
2477
+
2478
+ // Calculate required number of bits
2479
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
2480
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
2481
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8;
2482
+
2483
+ // Add a terminator.
2484
+ // If the bit string is shorter than the total number of required bits,
2485
+ // a terminator of up to four 0s must be added to the right side of the string.
2486
+ // If the bit string is more than four bits shorter than the required number of bits,
2487
+ // add four 0s to the end.
2488
+ if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {
2489
+ buffer.put(0, 4);
2490
+ }
2491
+
2492
+ // If the bit string is fewer than four bits shorter, add only the number of 0s that
2493
+ // are needed to reach the required number of bits.
2494
+
2495
+ // After adding the terminator, if the number of bits in the string is not a multiple of 8,
2496
+ // pad the string on the right with 0s to make the string's length a multiple of 8.
2497
+ while (buffer.getLengthInBits() % 8 !== 0) {
2498
+ buffer.putBit(0);
2499
+ }
2500
+
2501
+ // Add pad bytes if the string is still shorter than the total number of required bits.
2502
+ // Extend the buffer to fill the data capacity of the symbol corresponding to
2503
+ // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)
2504
+ // and 00010001 (0x11) alternately.
2505
+ const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8;
2506
+ for (let i = 0; i < remainingByte; i++) {
2507
+ buffer.put(i % 2 ? 0x11 : 0xEC, 8);
2508
+ }
2509
+
2510
+ return createCodewords(buffer, version, errorCorrectionLevel)
2511
+ }
2512
+
2513
+ /**
2514
+ * Encode input data with Reed-Solomon and return codewords with
2515
+ * relative error correction bits
2516
+ *
2517
+ * @param {BitBuffer} bitBuffer Data to encode
2518
+ * @param {Number} version QR Code version
2519
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
2520
+ * @return {Uint8Array} Buffer containing encoded codewords
2521
+ */
2522
+ function createCodewords (bitBuffer, version, errorCorrectionLevel) {
2523
+ // Total codewords for this QR code version (Data + Error correction)
2524
+ const totalCodewords = Utils.getSymbolTotalCodewords(version);
2525
+
2526
+ // Total number of error correction codewords
2527
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel);
2528
+
2529
+ // Total number of data codewords
2530
+ const dataTotalCodewords = totalCodewords - ecTotalCodewords;
2531
+
2532
+ // Total number of blocks
2533
+ const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel);
2534
+
2535
+ // Calculate how many blocks each group should contain
2536
+ const blocksInGroup2 = totalCodewords % ecTotalBlocks;
2537
+ const blocksInGroup1 = ecTotalBlocks - blocksInGroup2;
2538
+
2539
+ const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks);
2540
+
2541
+ const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks);
2542
+ const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1;
2543
+
2544
+ // Number of EC codewords is the same for both groups
2545
+ const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1;
2546
+
2547
+ // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount
2548
+ const rs = new ReedSolomonEncoder(ecCount);
2549
+
2550
+ let offset = 0;
2551
+ const dcData = new Array(ecTotalBlocks);
2552
+ const ecData = new Array(ecTotalBlocks);
2553
+ let maxDataSize = 0;
2554
+ const buffer = new Uint8Array(bitBuffer.buffer);
2555
+
2556
+ // Divide the buffer into the required number of blocks
2557
+ for (let b = 0; b < ecTotalBlocks; b++) {
2558
+ const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2;
2559
+
2560
+ // extract a block of data from buffer
2561
+ dcData[b] = buffer.slice(offset, offset + dataSize);
2562
+
2563
+ // Calculate EC codewords for this data block
2564
+ ecData[b] = rs.encode(dcData[b]);
2565
+
2566
+ offset += dataSize;
2567
+ maxDataSize = Math.max(maxDataSize, dataSize);
2568
+ }
2569
+
2570
+ // Create final data
2571
+ // Interleave the data and error correction codewords from each block
2572
+ const data = new Uint8Array(totalCodewords);
2573
+ let index = 0;
2574
+ let i, r;
2575
+
2576
+ // Add data codewords
2577
+ for (i = 0; i < maxDataSize; i++) {
2578
+ for (r = 0; r < ecTotalBlocks; r++) {
2579
+ if (i < dcData[r].length) {
2580
+ data[index++] = dcData[r][i];
2581
+ }
2582
+ }
2583
+ }
2584
+
2585
+ // Apped EC codewords
2586
+ for (i = 0; i < ecCount; i++) {
2587
+ for (r = 0; r < ecTotalBlocks; r++) {
2588
+ data[index++] = ecData[r][i];
2589
+ }
2590
+ }
2591
+
2592
+ return data
2593
+ }
2594
+
2595
+ /**
2596
+ * Build QR Code symbol
2597
+ *
2598
+ * @param {String} data Input string
2599
+ * @param {Number} version QR Code version
2600
+ * @param {ErrorCorretionLevel} errorCorrectionLevel Error level
2601
+ * @param {MaskPattern} maskPattern Mask pattern
2602
+ * @return {Object} Object containing symbol data
2603
+ */
2604
+ function createSymbol (data, version, errorCorrectionLevel, maskPattern) {
2605
+ let segments;
2606
+
2607
+ if (Array.isArray(data)) {
2608
+ segments = Segments.fromArray(data);
2609
+ } else if (typeof data === 'string') {
2610
+ let estimatedVersion = version;
2611
+
2612
+ if (!estimatedVersion) {
2613
+ const rawSegments = Segments.rawSplit(data);
2614
+
2615
+ // Estimate best version that can contain raw splitted segments
2616
+ estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel);
2617
+ }
2618
+
2619
+ // Build optimized segments
2620
+ // If estimated version is undefined, try with the highest version
2621
+ segments = Segments.fromString(data, estimatedVersion || 40);
2622
+ } else {
2623
+ throw new Error('Invalid data')
2624
+ }
2625
+
2626
+ // Get the min version that can contain data
2627
+ const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel);
2628
+
2629
+ // If no version is found, data cannot be stored
2630
+ if (!bestVersion) {
2631
+ throw new Error('The amount of data is too big to be stored in a QR Code')
2632
+ }
2633
+
2634
+ // If not specified, use min version as default
2635
+ if (!version) {
2636
+ version = bestVersion;
2637
+
2638
+ // Check if the specified version can contain the data
2639
+ } else if (version < bestVersion) {
2640
+ throw new Error('\n' +
2641
+ 'The chosen QR Code version cannot contain this amount of data.\n' +
2642
+ 'Minimum version required to store current data is: ' + bestVersion + '.\n'
2643
+ )
2644
+ }
2645
+
2646
+ const dataBits = createData(version, errorCorrectionLevel, segments);
2647
+
2648
+ // Allocate matrix buffer
2649
+ const moduleCount = Utils.getSymbolSize(version);
2650
+ const modules = new BitMatrix(moduleCount);
2651
+
2652
+ // Add function modules
2653
+ setupFinderPattern(modules, version);
2654
+ setupTimingPattern(modules);
2655
+ setupAlignmentPattern(modules, version);
2656
+
2657
+ // Add temporary dummy bits for format info just to set them as reserved.
2658
+ // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}
2659
+ // since the masking operation must be performed only on the encoding region.
2660
+ // These blocks will be replaced with correct values later in code.
2661
+ setupFormatInfo(modules, errorCorrectionLevel, 0);
2662
+
2663
+ if (version >= 7) {
2664
+ setupVersionInfo(modules, version);
2665
+ }
2666
+
2667
+ // Add data codewords
2668
+ setupData(modules, dataBits);
2669
+
2670
+ if (isNaN(maskPattern)) {
2671
+ // Find best mask pattern
2672
+ maskPattern = MaskPattern.getBestMask(modules,
2673
+ setupFormatInfo.bind(null, modules, errorCorrectionLevel));
2674
+ }
2675
+
2676
+ // Apply mask pattern
2677
+ MaskPattern.applyMask(maskPattern, modules);
2678
+
2679
+ // Replace format info bits with correct values
2680
+ setupFormatInfo(modules, errorCorrectionLevel, maskPattern);
2681
+
2682
+ return {
2683
+ modules: modules,
2684
+ version: version,
2685
+ errorCorrectionLevel: errorCorrectionLevel,
2686
+ maskPattern: maskPattern,
2687
+ segments: segments
2688
+ }
2689
+ }
2690
+
2691
+ /**
2692
+ * QR Code
2693
+ *
2694
+ * @param {String | Array} data Input data
2695
+ * @param {Object} options Optional configurations
2696
+ * @param {Number} options.version QR Code version
2697
+ * @param {String} options.errorCorrectionLevel Error correction level
2698
+ * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis
2699
+ */
2700
+ qrcode.create = function create (data, options) {
2701
+ if (typeof data === 'undefined' || data === '') {
2702
+ throw new Error('No input text')
2703
+ }
2704
+
2705
+ let errorCorrectionLevel = ECLevel.M;
2706
+ let version;
2707
+ let mask;
2708
+
2709
+ if (typeof options !== 'undefined') {
2710
+ // Use higher error correction level as default
2711
+ errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M);
2712
+ version = Version.from(options.version);
2713
+ mask = MaskPattern.from(options.maskPattern);
2714
+
2715
+ if (options.toSJISFunc) {
2716
+ Utils.setToSJISFunction(options.toSJISFunc);
2717
+ }
2718
+ }
2719
+
2720
+ return createSymbol(data, version, errorCorrectionLevel, mask)
2721
+ };
2722
+ return qrcode;
2723
+ }
2724
+
2725
+ var canvas = {};
2726
+
2727
+ var utils = {};
2728
+
2729
+ var hasRequiredUtils;
2730
+
2731
+ function requireUtils () {
2732
+ if (hasRequiredUtils) return utils;
2733
+ hasRequiredUtils = 1;
2734
+ (function (exports) {
2735
+ function hex2rgba (hex) {
2736
+ if (typeof hex === 'number') {
2737
+ hex = hex.toString();
2738
+ }
2739
+
2740
+ if (typeof hex !== 'string') {
2741
+ throw new Error('Color should be defined as hex string')
2742
+ }
2743
+
2744
+ let hexCode = hex.slice().replace('#', '').split('');
2745
+ if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
2746
+ throw new Error('Invalid hex color: ' + hex)
2747
+ }
2748
+
2749
+ // Convert from short to long form (fff -> ffffff)
2750
+ if (hexCode.length === 3 || hexCode.length === 4) {
2751
+ hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {
2752
+ return [c, c]
2753
+ }));
2754
+ }
2755
+
2756
+ // Add default alpha value
2757
+ if (hexCode.length === 6) hexCode.push('F', 'F');
2758
+
2759
+ const hexValue = parseInt(hexCode.join(''), 16);
2760
+
2761
+ return {
2762
+ r: (hexValue >> 24) & 255,
2763
+ g: (hexValue >> 16) & 255,
2764
+ b: (hexValue >> 8) & 255,
2765
+ a: hexValue & 255,
2766
+ hex: '#' + hexCode.slice(0, 6).join('')
2767
+ }
2768
+ }
2769
+
2770
+ exports.getOptions = function getOptions (options) {
2771
+ if (!options) options = {};
2772
+ if (!options.color) options.color = {};
2773
+
2774
+ const margin = typeof options.margin === 'undefined' ||
2775
+ options.margin === null ||
2776
+ options.margin < 0
2777
+ ? 4
2778
+ : options.margin;
2779
+
2780
+ const width = options.width && options.width >= 21 ? options.width : undefined;
2781
+ const scale = options.scale || 4;
2782
+
2783
+ return {
2784
+ width: width,
2785
+ scale: width ? 4 : scale,
2786
+ margin: margin,
2787
+ color: {
2788
+ dark: hex2rgba(options.color.dark || '#000000ff'),
2789
+ light: hex2rgba(options.color.light || '#ffffffff')
2790
+ },
2791
+ type: options.type,
2792
+ rendererOpts: options.rendererOpts || {}
2793
+ }
2794
+ };
2795
+
2796
+ exports.getScale = function getScale (qrSize, opts) {
2797
+ return opts.width && opts.width >= qrSize + opts.margin * 2
2798
+ ? opts.width / (qrSize + opts.margin * 2)
2799
+ : opts.scale
2800
+ };
2801
+
2802
+ exports.getImageWidth = function getImageWidth (qrSize, opts) {
2803
+ const scale = exports.getScale(qrSize, opts);
2804
+ return Math.floor((qrSize + opts.margin * 2) * scale)
2805
+ };
2806
+
2807
+ exports.qrToImageData = function qrToImageData (imgData, qr, opts) {
2808
+ const size = qr.modules.size;
2809
+ const data = qr.modules.data;
2810
+ const scale = exports.getScale(size, opts);
2811
+ const symbolSize = Math.floor((size + opts.margin * 2) * scale);
2812
+ const scaledMargin = opts.margin * scale;
2813
+ const palette = [opts.color.light, opts.color.dark];
2814
+
2815
+ for (let i = 0; i < symbolSize; i++) {
2816
+ for (let j = 0; j < symbolSize; j++) {
2817
+ let posDst = (i * symbolSize + j) * 4;
2818
+ let pxColor = opts.color.light;
2819
+
2820
+ if (i >= scaledMargin && j >= scaledMargin &&
2821
+ i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
2822
+ const iSrc = Math.floor((i - scaledMargin) / scale);
2823
+ const jSrc = Math.floor((j - scaledMargin) / scale);
2824
+ pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0];
2825
+ }
2826
+
2827
+ imgData[posDst++] = pxColor.r;
2828
+ imgData[posDst++] = pxColor.g;
2829
+ imgData[posDst++] = pxColor.b;
2830
+ imgData[posDst] = pxColor.a;
2831
+ }
2832
+ }
2833
+ };
2834
+ } (utils));
2835
+ return utils;
2836
+ }
2837
+
2838
+ var hasRequiredCanvas;
2839
+
2840
+ function requireCanvas () {
2841
+ if (hasRequiredCanvas) return canvas;
2842
+ hasRequiredCanvas = 1;
2843
+ (function (exports) {
2844
+ const Utils = requireUtils();
2845
+
2846
+ function clearCanvas (ctx, canvas, size) {
2847
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
2848
+
2849
+ if (!canvas.style) canvas.style = {};
2850
+ canvas.height = size;
2851
+ canvas.width = size;
2852
+ canvas.style.height = size + 'px';
2853
+ canvas.style.width = size + 'px';
2854
+ }
2855
+
2856
+ function getCanvasElement () {
2857
+ try {
2858
+ return document.createElement('canvas')
2859
+ } catch (e) {
2860
+ throw new Error('You need to specify a canvas element')
2861
+ }
2862
+ }
2863
+
2864
+ exports.render = function render (qrData, canvas, options) {
2865
+ let opts = options;
2866
+ let canvasEl = canvas;
2867
+
2868
+ if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
2869
+ opts = canvas;
2870
+ canvas = undefined;
2871
+ }
2872
+
2873
+ if (!canvas) {
2874
+ canvasEl = getCanvasElement();
2875
+ }
2876
+
2877
+ opts = Utils.getOptions(opts);
2878
+ const size = Utils.getImageWidth(qrData.modules.size, opts);
2879
+
2880
+ const ctx = canvasEl.getContext('2d');
2881
+ const image = ctx.createImageData(size, size);
2882
+ Utils.qrToImageData(image.data, qrData, opts);
2883
+
2884
+ clearCanvas(ctx, canvasEl, size);
2885
+ ctx.putImageData(image, 0, 0);
2886
+
2887
+ return canvasEl
2888
+ };
2889
+
2890
+ exports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {
2891
+ let opts = options;
2892
+
2893
+ if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
2894
+ opts = canvas;
2895
+ canvas = undefined;
2896
+ }
2897
+
2898
+ if (!opts) opts = {};
2899
+
2900
+ const canvasEl = exports.render(qrData, canvas, opts);
2901
+
2902
+ const type = opts.type || 'image/png';
2903
+ const rendererOpts = opts.rendererOpts || {};
2904
+
2905
+ return canvasEl.toDataURL(type, rendererOpts.quality)
2906
+ };
2907
+ } (canvas));
2908
+ return canvas;
2909
+ }
2910
+
2911
+ var svgTag = {};
2912
+
2913
+ var hasRequiredSvgTag;
2914
+
2915
+ function requireSvgTag () {
2916
+ if (hasRequiredSvgTag) return svgTag;
2917
+ hasRequiredSvgTag = 1;
2918
+ const Utils = requireUtils();
2919
+
2920
+ function getColorAttrib (color, attrib) {
2921
+ const alpha = color.a / 255;
2922
+ const str = attrib + '="' + color.hex + '"';
2923
+
2924
+ return alpha < 1
2925
+ ? str + ' ' + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"'
2926
+ : str
2927
+ }
2928
+
2929
+ function svgCmd (cmd, x, y) {
2930
+ let str = cmd + x;
2931
+ if (typeof y !== 'undefined') str += ' ' + y;
2932
+
2933
+ return str
2934
+ }
2935
+
2936
+ function qrToPath (data, size, margin) {
2937
+ let path = '';
2938
+ let moveBy = 0;
2939
+ let newRow = false;
2940
+ let lineLength = 0;
2941
+
2942
+ for (let i = 0; i < data.length; i++) {
2943
+ const col = Math.floor(i % size);
2944
+ const row = Math.floor(i / size);
2945
+
2946
+ if (!col && !newRow) newRow = true;
2947
+
2948
+ if (data[i]) {
2949
+ lineLength++;
2950
+
2951
+ if (!(i > 0 && col > 0 && data[i - 1])) {
2952
+ path += newRow
2953
+ ? svgCmd('M', col + margin, 0.5 + row + margin)
2954
+ : svgCmd('m', moveBy, 0);
2955
+
2956
+ moveBy = 0;
2957
+ newRow = false;
2958
+ }
2959
+
2960
+ if (!(col + 1 < size && data[i + 1])) {
2961
+ path += svgCmd('h', lineLength);
2962
+ lineLength = 0;
2963
+ }
2964
+ } else {
2965
+ moveBy++;
2966
+ }
2967
+ }
2968
+
2969
+ return path
2970
+ }
2971
+
2972
+ svgTag.render = function render (qrData, options, cb) {
2973
+ const opts = Utils.getOptions(options);
2974
+ const size = qrData.modules.size;
2975
+ const data = qrData.modules.data;
2976
+ const qrcodesize = size + opts.margin * 2;
2977
+
2978
+ const bg = !opts.color.light.a
2979
+ ? ''
2980
+ : '<path ' + getColorAttrib(opts.color.light, 'fill') +
2981
+ ' d="M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z"/>';
2982
+
2983
+ const path =
2984
+ '<path ' + getColorAttrib(opts.color.dark, 'stroke') +
2985
+ ' d="' + qrToPath(data, size, opts.margin) + '"/>';
2986
+
2987
+ const viewBox = 'viewBox="' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '"';
2988
+
2989
+ const width = !opts.width ? '' : 'width="' + opts.width + '" height="' + opts.width + '" ';
2990
+
2991
+ const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + '</svg>\n';
2992
+
2993
+ if (typeof cb === 'function') {
2994
+ cb(null, svgTag);
2995
+ }
2996
+
2997
+ return svgTag
2998
+ };
2999
+ return svgTag;
3000
+ }
3001
+
3002
+ var hasRequiredBrowser;
3003
+
3004
+ function requireBrowser () {
3005
+ if (hasRequiredBrowser) return browser;
3006
+ hasRequiredBrowser = 1;
3007
+ const canPromise = requireCanPromise();
3008
+
3009
+ const QRCode = requireQrcode();
3010
+ const CanvasRenderer = requireCanvas();
3011
+ const SvgRenderer = requireSvgTag();
3012
+
3013
+ function renderCanvas (renderFunc, canvas, text, opts, cb) {
3014
+ const args = [].slice.call(arguments, 1);
3015
+ const argsNum = args.length;
3016
+ const isLastArgCb = typeof args[argsNum - 1] === 'function';
3017
+
3018
+ if (!isLastArgCb && !canPromise()) {
3019
+ throw new Error('Callback required as last argument')
3020
+ }
3021
+
3022
+ if (isLastArgCb) {
3023
+ if (argsNum < 2) {
3024
+ throw new Error('Too few arguments provided')
3025
+ }
3026
+
3027
+ if (argsNum === 2) {
3028
+ cb = text;
3029
+ text = canvas;
3030
+ canvas = opts = undefined;
3031
+ } else if (argsNum === 3) {
3032
+ if (canvas.getContext && typeof cb === 'undefined') {
3033
+ cb = opts;
3034
+ opts = undefined;
3035
+ } else {
3036
+ cb = opts;
3037
+ opts = text;
3038
+ text = canvas;
3039
+ canvas = undefined;
3040
+ }
3041
+ }
3042
+ } else {
3043
+ if (argsNum < 1) {
3044
+ throw new Error('Too few arguments provided')
3045
+ }
3046
+
3047
+ if (argsNum === 1) {
3048
+ text = canvas;
3049
+ canvas = opts = undefined;
3050
+ } else if (argsNum === 2 && !canvas.getContext) {
3051
+ opts = text;
3052
+ text = canvas;
3053
+ canvas = undefined;
3054
+ }
3055
+
3056
+ return new Promise(function (resolve, reject) {
3057
+ try {
3058
+ const data = QRCode.create(text, opts);
3059
+ resolve(renderFunc(data, canvas, opts));
3060
+ } catch (e) {
3061
+ reject(e);
3062
+ }
3063
+ })
3064
+ }
3065
+
3066
+ try {
3067
+ const data = QRCode.create(text, opts);
3068
+ cb(null, renderFunc(data, canvas, opts));
3069
+ } catch (e) {
3070
+ cb(e);
3071
+ }
3072
+ }
3073
+
3074
+ browser.create = QRCode.create;
3075
+ browser.toCanvas = renderCanvas.bind(null, CanvasRenderer.render);
3076
+ browser.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL);
3077
+
3078
+ // only svg for now.
3079
+ browser.toString = renderCanvas.bind(null, function (data, _, opts) {
3080
+ return SvgRenderer.render(data, opts)
3081
+ });
3082
+ return browser;
3083
+ }
3084
+
3085
+ var browserExports = requireBrowser();
3086
+ var QRCode = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(browserExports);
3087
+
3088
+ const JustifiCheckoutQrCode = class {
3089
+ constructor(hostRef) {
3090
+ index.registerInstance(this, hostRef);
3091
+ this.errorEvent = index.createEvent(this, "error-event", 7);
3092
+ this.size = 256;
3093
+ }
3094
+ componentWillLoad() {
3095
+ checkPkgVersion.checkPkgVersion();
3096
+ this.analytics = new Analytics.JustifiAnalytics(this);
3097
+ }
3098
+ componentDidLoad() {
3099
+ this.renderQrCode();
3100
+ }
3101
+ disconnectedCallback() {
3102
+ var _a;
3103
+ (_a = this.analytics) === null || _a === void 0 ? void 0 : _a.cleanup();
3104
+ }
3105
+ propChanged() {
3106
+ this.renderQrCode();
3107
+ }
3108
+ get checkoutUrl() {
3109
+ return `https://components.justifi.ai/hosted-checkout/${this.checkoutId}`;
3110
+ }
3111
+ async renderQrCode() {
3112
+ if (!this.checkoutId) {
3113
+ this.errorEvent.emit({
3114
+ message: 'checkoutId is required',
3115
+ errorCode: Plaid.ComponentErrorCodes.MISSING_PROPS,
3116
+ severity: Plaid.ComponentErrorSeverity.ERROR,
3117
+ });
3118
+ return;
3119
+ }
3120
+ if (!this.qrContainerEl)
3121
+ return;
3122
+ const svg = await QRCode.toString(this.checkoutUrl, {
3123
+ type: 'svg',
3124
+ width: this.size,
3125
+ errorCorrectionLevel: 'M',
3126
+ });
3127
+ this.qrContainerEl.innerHTML = svg;
3128
+ }
3129
+ render() {
3130
+ if (!this.checkoutId)
3131
+ return null;
3132
+ return (index.h("div", { ref: (el) => (this.qrContainerEl = el) }));
3133
+ }
3134
+ get el() { return index.getElement(this); }
3135
+ static get watchers() { return {
3136
+ "checkoutId": ["propChanged"],
3137
+ "size": ["propChanged"]
3138
+ }; }
3139
+ };
3140
+
3141
+ exports.justifi_checkout_qr_code = JustifiCheckoutQrCode;