stripe-pwa-elements 2.1.0 → 3.0.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1468) hide show
  1. package/dist/cjs/{index-aec82bce.js → index-0cec7387.js} +616 -261
  2. package/dist/cjs/index-0cec7387.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/index.cjs.js.map +1 -0
  5. package/dist/cjs/ion-icon.cjs.entry.js +68 -43
  6. package/dist/cjs/ion-icon.cjs.entry.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +6 -3
  8. package/dist/cjs/loader.cjs.js.map +1 -0
  9. package/dist/cjs/stripe-elements.cjs.js +12 -3
  10. package/dist/cjs/stripe-elements.cjs.js.map +1 -0
  11. package/dist/cjs/stripe-payment-request-button.cjs.entry.js +26 -20
  12. package/dist/cjs/stripe-payment-request-button.cjs.entry.js.map +1 -0
  13. package/dist/cjs/stripe-payment-sheet.cjs.entry.js +11 -27
  14. package/dist/cjs/stripe-payment-sheet.cjs.entry.js.map +1 -0
  15. package/dist/cjs/stripe-payment_2.cjs.entry.js +753 -729
  16. package/dist/cjs/stripe-payment_2.cjs.entry.js.map +1 -0
  17. package/dist/cjs/{stripe.esm-648239f0.js → stripe.esm-603f3c17.js} +4 -2
  18. package/dist/cjs/stripe.esm-603f3c17.js.map +1 -0
  19. package/dist/collection/collection-manifest.json +2 -2
  20. package/dist/collection/components/stripe-element-modal/stripe-element-modal.js +115 -116
  21. package/dist/collection/components/stripe-element-modal/stripe-element-modal.js.map +1 -0
  22. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.e2e.js +10 -0
  23. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.e2e.js.map +1 -0
  24. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.spec.js +120 -0
  25. package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.spec.js.map +1 -0
  26. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +342 -328
  27. package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +1 -0
  28. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.e2e.js +10 -0
  29. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.e2e.js.map +1 -0
  30. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.spec.js +18 -0
  31. package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.spec.js.map +1 -0
  32. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +483 -539
  33. package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js.map +1 -0
  34. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.e2e.js +10 -0
  35. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.e2e.js.map +1 -0
  36. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.spec.js +111 -0
  37. package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.spec.js.map +1 -0
  38. package/dist/collection/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.js +393 -401
  39. package/dist/collection/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.js.map +1 -0
  40. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.e2e.js +10 -0
  41. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.e2e.js.map +1 -0
  42. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.spec.js +16 -0
  43. package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.spec.js.map +1 -0
  44. package/dist/collection/index.js +1 -0
  45. package/dist/collection/index.js.map +1 -0
  46. package/dist/collection/interfaces.js +1 -0
  47. package/dist/collection/interfaces.js.map +1 -0
  48. package/dist/collection/utils/i18n.js +1 -0
  49. package/dist/collection/utils/i18n.js.map +1 -0
  50. package/dist/collection/utils/platform.js +1 -0
  51. package/dist/collection/utils/platform.js.map +1 -0
  52. package/dist/collection/utils/utils.js +1 -0
  53. package/dist/collection/utils/utils.js.map +1 -0
  54. package/dist/components/icon.js +360 -0
  55. package/dist/components/icon.js.map +1 -0
  56. package/dist/components/index.d.ts +27 -0
  57. package/dist/components/index.js +3 -0
  58. package/dist/components/index.js.map +1 -0
  59. package/dist/components/ion-icon.js +8 -0
  60. package/dist/components/ion-icon.js.map +1 -0
  61. package/dist/components/stripe-element-modal.js +75 -0
  62. package/dist/components/stripe-element-modal.js.map +1 -0
  63. package/dist/components/stripe-payment-request-button.d.ts +11 -0
  64. package/dist/components/stripe-payment-request-button.js +8 -0
  65. package/dist/components/stripe-payment-request-button.js.map +1 -0
  66. package/dist/components/stripe-payment-request-button2.js +337 -0
  67. package/dist/components/stripe-payment-request-button2.js.map +1 -0
  68. package/dist/components/stripe-payment-sheet.d.ts +11 -0
  69. package/dist/components/stripe-payment-sheet.js +153 -0
  70. package/dist/components/stripe-payment-sheet.js.map +1 -0
  71. package/dist/{custom-elements/index.js → components/stripe-payment-sheet2.js} +798 -1607
  72. package/dist/components/stripe-payment-sheet2.js.map +1 -0
  73. package/dist/components/stripe-payment.d.ts +11 -0
  74. package/dist/components/stripe-payment.js +8 -0
  75. package/dist/components/stripe-payment.js.map +1 -0
  76. package/dist/components/stripe-sheet.d.ts +11 -0
  77. package/dist/components/stripe-sheet.js +8 -0
  78. package/dist/components/stripe-sheet.js.map +1 -0
  79. package/dist/components/utils.js +105 -0
  80. package/dist/components/utils.js.map +1 -0
  81. package/dist/esm/{index-a7e5d6fd.js → index-58f9666b.js} +616 -262
  82. package/dist/esm/index-58f9666b.js.map +1 -0
  83. package/dist/esm/index.js +2 -0
  84. package/dist/esm/index.js.map +1 -0
  85. package/dist/esm/ion-icon.entry.js +68 -43
  86. package/dist/esm/ion-icon.entry.js.map +1 -0
  87. package/dist/esm/loader.js +6 -3
  88. package/dist/esm/loader.js.map +1 -0
  89. package/dist/esm/polyfills/css-shim.js +1 -1
  90. package/dist/esm/stripe-elements.js +9 -3
  91. package/dist/esm/stripe-elements.js.map +1 -0
  92. package/dist/esm/stripe-payment-request-button.entry.js +26 -20
  93. package/dist/esm/stripe-payment-request-button.entry.js.map +1 -0
  94. package/dist/esm/stripe-payment-sheet.entry.js +11 -27
  95. package/dist/esm/stripe-payment-sheet.entry.js.map +1 -0
  96. package/dist/esm/stripe-payment_2.entry.js +753 -729
  97. package/dist/esm/stripe-payment_2.entry.js.map +1 -0
  98. package/dist/esm/{stripe.esm-ea56157a.js → stripe.esm-bad47977.js} +4 -2
  99. package/dist/esm/stripe.esm-bad47977.js.map +1 -0
  100. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +46 -4
  101. package/dist/stripe-elements/index.esm.js +2 -0
  102. package/dist/stripe-elements/index.esm.js.map +1 -0
  103. package/dist/stripe-elements/p-06c00b5c.entry.js +2 -0
  104. package/dist/stripe-elements/p-06c00b5c.entry.js.map +1 -0
  105. package/dist/stripe-elements/p-1b4515a4.js +3 -0
  106. package/dist/stripe-elements/p-1b4515a4.js.map +1 -0
  107. package/dist/stripe-elements/p-3458123a.entry.js +2 -0
  108. package/dist/stripe-elements/p-3458123a.entry.js.map +1 -0
  109. package/dist/stripe-elements/p-3a90ad5d.entry.js +2 -0
  110. package/dist/stripe-elements/p-3a90ad5d.entry.js.map +1 -0
  111. package/dist/stripe-elements/p-b10d8613.js +2 -0
  112. package/dist/stripe-elements/p-b10d8613.js.map +1 -0
  113. package/dist/stripe-elements/p-c5a2b2e8.entry.js +2 -0
  114. package/dist/stripe-elements/p-c5a2b2e8.entry.js.map +1 -0
  115. package/dist/stripe-elements/stripe-elements.esm.js +2 -1
  116. package/dist/stripe-elements/stripe-elements.esm.js.map +1 -0
  117. package/dist/stripe-elements/svg/accessibility-outline.svg +1 -1
  118. package/dist/stripe-elements/svg/accessibility-sharp.svg +1 -1
  119. package/dist/stripe-elements/svg/accessibility.svg +1 -1
  120. package/dist/stripe-elements/svg/add-circle-outline.svg +1 -1
  121. package/dist/stripe-elements/svg/add-circle-sharp.svg +1 -1
  122. package/dist/stripe-elements/svg/add-circle.svg +1 -1
  123. package/dist/stripe-elements/svg/add-outline.svg +1 -1
  124. package/dist/stripe-elements/svg/add-sharp.svg +1 -1
  125. package/dist/stripe-elements/svg/add.svg +1 -1
  126. package/dist/stripe-elements/svg/airplane-outline.svg +1 -1
  127. package/dist/stripe-elements/svg/airplane-sharp.svg +1 -1
  128. package/dist/stripe-elements/svg/airplane.svg +1 -1
  129. package/dist/stripe-elements/svg/alarm-outline.svg +1 -1
  130. package/dist/stripe-elements/svg/alarm-sharp.svg +1 -1
  131. package/dist/stripe-elements/svg/alarm.svg +1 -1
  132. package/dist/stripe-elements/svg/albums-outline.svg +1 -1
  133. package/dist/stripe-elements/svg/albums-sharp.svg +1 -1
  134. package/dist/stripe-elements/svg/albums.svg +1 -1
  135. package/dist/stripe-elements/svg/alert-circle-outline.svg +1 -1
  136. package/dist/stripe-elements/svg/alert-circle-sharp.svg +1 -1
  137. package/dist/stripe-elements/svg/alert-circle.svg +1 -1
  138. package/dist/stripe-elements/svg/alert-outline.svg +1 -1
  139. package/dist/stripe-elements/svg/alert-sharp.svg +1 -1
  140. package/dist/stripe-elements/svg/alert.svg +1 -1
  141. package/dist/stripe-elements/svg/american-football-outline.svg +1 -1
  142. package/dist/stripe-elements/svg/american-football-sharp.svg +1 -1
  143. package/dist/stripe-elements/svg/american-football.svg +1 -1
  144. package/dist/stripe-elements/svg/analytics-outline.svg +1 -1
  145. package/dist/stripe-elements/svg/analytics-sharp.svg +1 -1
  146. package/dist/stripe-elements/svg/analytics.svg +1 -1
  147. package/dist/stripe-elements/svg/aperture-outline.svg +1 -1
  148. package/dist/stripe-elements/svg/aperture-sharp.svg +1 -1
  149. package/dist/stripe-elements/svg/aperture.svg +1 -1
  150. package/dist/stripe-elements/svg/apps-outline.svg +1 -1
  151. package/dist/stripe-elements/svg/apps-sharp.svg +1 -1
  152. package/dist/stripe-elements/svg/apps.svg +1 -1
  153. package/dist/stripe-elements/svg/archive-outline.svg +1 -1
  154. package/dist/stripe-elements/svg/archive-sharp.svg +1 -1
  155. package/dist/stripe-elements/svg/archive.svg +1 -1
  156. package/dist/stripe-elements/svg/arrow-back-circle-outline.svg +1 -1
  157. package/dist/stripe-elements/svg/arrow-back-circle-sharp.svg +1 -1
  158. package/dist/stripe-elements/svg/arrow-back-circle.svg +1 -1
  159. package/dist/stripe-elements/svg/arrow-back-outline.svg +1 -1
  160. package/dist/stripe-elements/svg/arrow-back-sharp.svg +1 -1
  161. package/dist/stripe-elements/svg/arrow-back.svg +1 -1
  162. package/dist/stripe-elements/svg/arrow-down-circle-outline.svg +1 -1
  163. package/dist/stripe-elements/svg/arrow-down-circle-sharp.svg +1 -1
  164. package/dist/stripe-elements/svg/arrow-down-circle.svg +1 -1
  165. package/dist/stripe-elements/svg/arrow-down-outline.svg +1 -1
  166. package/dist/stripe-elements/svg/arrow-down-sharp.svg +1 -1
  167. package/dist/stripe-elements/svg/arrow-down.svg +1 -1
  168. package/dist/stripe-elements/svg/arrow-forward-circle-outline.svg +1 -1
  169. package/dist/stripe-elements/svg/arrow-forward-circle-sharp.svg +1 -1
  170. package/dist/stripe-elements/svg/arrow-forward-circle.svg +1 -1
  171. package/dist/stripe-elements/svg/arrow-forward-outline.svg +1 -1
  172. package/dist/stripe-elements/svg/arrow-forward-sharp.svg +1 -1
  173. package/dist/stripe-elements/svg/arrow-forward.svg +1 -1
  174. package/dist/stripe-elements/svg/arrow-redo-circle-outline.svg +1 -1
  175. package/dist/stripe-elements/svg/arrow-redo-circle-sharp.svg +1 -1
  176. package/dist/stripe-elements/svg/arrow-redo-circle.svg +1 -1
  177. package/dist/stripe-elements/svg/arrow-redo-outline.svg +1 -1
  178. package/dist/stripe-elements/svg/arrow-redo-sharp.svg +1 -1
  179. package/dist/stripe-elements/svg/arrow-redo.svg +1 -1
  180. package/dist/stripe-elements/svg/arrow-undo-circle-outline.svg +1 -1
  181. package/dist/stripe-elements/svg/arrow-undo-circle-sharp.svg +1 -1
  182. package/dist/stripe-elements/svg/arrow-undo-circle.svg +1 -1
  183. package/dist/stripe-elements/svg/arrow-undo-outline.svg +1 -1
  184. package/dist/stripe-elements/svg/arrow-undo-sharp.svg +1 -1
  185. package/dist/stripe-elements/svg/arrow-undo.svg +1 -1
  186. package/dist/stripe-elements/svg/arrow-up-circle-outline.svg +1 -1
  187. package/dist/stripe-elements/svg/arrow-up-circle-sharp.svg +1 -1
  188. package/dist/stripe-elements/svg/arrow-up-circle.svg +1 -1
  189. package/dist/stripe-elements/svg/arrow-up-outline.svg +1 -1
  190. package/dist/stripe-elements/svg/arrow-up-sharp.svg +1 -1
  191. package/dist/stripe-elements/svg/arrow-up.svg +1 -1
  192. package/dist/stripe-elements/svg/at-circle-outline.svg +1 -1
  193. package/dist/stripe-elements/svg/at-circle-sharp.svg +1 -1
  194. package/dist/stripe-elements/svg/at-circle.svg +1 -1
  195. package/dist/stripe-elements/svg/at-outline.svg +1 -1
  196. package/dist/stripe-elements/svg/at-sharp.svg +1 -1
  197. package/dist/stripe-elements/svg/at.svg +1 -1
  198. package/dist/stripe-elements/svg/attach-outline.svg +1 -1
  199. package/dist/stripe-elements/svg/attach-sharp.svg +1 -1
  200. package/dist/stripe-elements/svg/attach.svg +1 -1
  201. package/dist/stripe-elements/svg/backspace-outline.svg +1 -1
  202. package/dist/stripe-elements/svg/backspace-sharp.svg +1 -1
  203. package/dist/stripe-elements/svg/backspace.svg +1 -1
  204. package/dist/stripe-elements/svg/bag-add-outline.svg +1 -1
  205. package/dist/stripe-elements/svg/bag-add-sharp.svg +1 -1
  206. package/dist/stripe-elements/svg/bag-add.svg +1 -1
  207. package/dist/stripe-elements/svg/bag-check-outline.svg +1 -1
  208. package/dist/stripe-elements/svg/bag-check-sharp.svg +1 -1
  209. package/dist/stripe-elements/svg/bag-check.svg +1 -1
  210. package/dist/stripe-elements/svg/bag-handle-outline.svg +1 -1
  211. package/dist/stripe-elements/svg/bag-handle-sharp.svg +1 -1
  212. package/dist/stripe-elements/svg/bag-handle.svg +1 -1
  213. package/dist/stripe-elements/svg/bag-outline.svg +1 -1
  214. package/dist/stripe-elements/svg/bag-remove-outline.svg +1 -1
  215. package/dist/stripe-elements/svg/bag-remove-sharp.svg +1 -1
  216. package/dist/stripe-elements/svg/bag-remove.svg +1 -1
  217. package/dist/stripe-elements/svg/bag-sharp.svg +1 -1
  218. package/dist/stripe-elements/svg/bag.svg +1 -1
  219. package/dist/stripe-elements/svg/balloon-outline.svg +1 -1
  220. package/dist/stripe-elements/svg/balloon-sharp.svg +1 -1
  221. package/dist/stripe-elements/svg/balloon.svg +1 -1
  222. package/dist/stripe-elements/svg/ban-outline.svg +1 -1
  223. package/dist/stripe-elements/svg/ban-sharp.svg +1 -1
  224. package/dist/stripe-elements/svg/ban.svg +1 -1
  225. package/dist/stripe-elements/svg/bandage-outline.svg +1 -1
  226. package/dist/stripe-elements/svg/bandage-sharp.svg +1 -1
  227. package/dist/stripe-elements/svg/bandage.svg +1 -1
  228. package/dist/stripe-elements/svg/bar-chart-outline.svg +1 -1
  229. package/dist/stripe-elements/svg/bar-chart-sharp.svg +1 -1
  230. package/dist/stripe-elements/svg/bar-chart.svg +1 -1
  231. package/dist/stripe-elements/svg/barbell-outline.svg +1 -1
  232. package/dist/stripe-elements/svg/barbell-sharp.svg +1 -1
  233. package/dist/stripe-elements/svg/barbell.svg +1 -1
  234. package/dist/stripe-elements/svg/barcode-outline.svg +1 -1
  235. package/dist/stripe-elements/svg/barcode-sharp.svg +1 -1
  236. package/dist/stripe-elements/svg/barcode.svg +1 -1
  237. package/dist/stripe-elements/svg/baseball-outline.svg +1 -1
  238. package/dist/stripe-elements/svg/baseball-sharp.svg +1 -1
  239. package/dist/stripe-elements/svg/baseball.svg +1 -1
  240. package/dist/stripe-elements/svg/basket-outline.svg +1 -1
  241. package/dist/stripe-elements/svg/basket-sharp.svg +1 -1
  242. package/dist/stripe-elements/svg/basket.svg +1 -1
  243. package/dist/stripe-elements/svg/basketball-outline.svg +1 -1
  244. package/dist/stripe-elements/svg/basketball-sharp.svg +1 -1
  245. package/dist/stripe-elements/svg/basketball.svg +1 -1
  246. package/dist/stripe-elements/svg/battery-charging-outline.svg +1 -1
  247. package/dist/stripe-elements/svg/battery-charging-sharp.svg +1 -1
  248. package/dist/stripe-elements/svg/battery-charging.svg +1 -1
  249. package/dist/stripe-elements/svg/battery-dead-outline.svg +1 -1
  250. package/dist/stripe-elements/svg/battery-dead-sharp.svg +1 -1
  251. package/dist/stripe-elements/svg/battery-dead.svg +1 -1
  252. package/dist/stripe-elements/svg/battery-full-outline.svg +1 -1
  253. package/dist/stripe-elements/svg/battery-full-sharp.svg +1 -1
  254. package/dist/stripe-elements/svg/battery-full.svg +1 -1
  255. package/dist/stripe-elements/svg/battery-half-outline.svg +1 -1
  256. package/dist/stripe-elements/svg/battery-half-sharp.svg +1 -1
  257. package/dist/stripe-elements/svg/battery-half.svg +1 -1
  258. package/dist/stripe-elements/svg/beaker-outline.svg +1 -1
  259. package/dist/stripe-elements/svg/beaker-sharp.svg +1 -1
  260. package/dist/stripe-elements/svg/beaker.svg +1 -1
  261. package/dist/stripe-elements/svg/bed-outline.svg +1 -1
  262. package/dist/stripe-elements/svg/bed-sharp.svg +1 -1
  263. package/dist/stripe-elements/svg/bed.svg +1 -1
  264. package/dist/stripe-elements/svg/beer-outline.svg +1 -1
  265. package/dist/stripe-elements/svg/beer-sharp.svg +1 -1
  266. package/dist/stripe-elements/svg/beer.svg +1 -1
  267. package/dist/stripe-elements/svg/bicycle-outline.svg +1 -1
  268. package/dist/stripe-elements/svg/bicycle-sharp.svg +1 -1
  269. package/dist/stripe-elements/svg/bicycle.svg +1 -1
  270. package/dist/stripe-elements/svg/bluetooth-outline.svg +1 -1
  271. package/dist/stripe-elements/svg/bluetooth-sharp.svg +1 -1
  272. package/dist/stripe-elements/svg/bluetooth.svg +1 -1
  273. package/dist/stripe-elements/svg/boat-outline.svg +1 -1
  274. package/dist/stripe-elements/svg/boat-sharp.svg +1 -1
  275. package/dist/stripe-elements/svg/boat.svg +1 -1
  276. package/dist/stripe-elements/svg/body-outline.svg +1 -1
  277. package/dist/stripe-elements/svg/body-sharp.svg +1 -1
  278. package/dist/stripe-elements/svg/body.svg +1 -1
  279. package/dist/stripe-elements/svg/bonfire-outline.svg +1 -1
  280. package/dist/stripe-elements/svg/bonfire-sharp.svg +1 -1
  281. package/dist/stripe-elements/svg/bonfire.svg +1 -1
  282. package/dist/stripe-elements/svg/book-outline.svg +1 -1
  283. package/dist/stripe-elements/svg/book-sharp.svg +1 -1
  284. package/dist/stripe-elements/svg/book.svg +1 -1
  285. package/dist/stripe-elements/svg/bookmark-outline.svg +1 -1
  286. package/dist/stripe-elements/svg/bookmark-sharp.svg +1 -1
  287. package/dist/stripe-elements/svg/bookmark.svg +1 -1
  288. package/dist/stripe-elements/svg/bookmarks-outline.svg +1 -1
  289. package/dist/stripe-elements/svg/bookmarks-sharp.svg +1 -1
  290. package/dist/stripe-elements/svg/bookmarks.svg +1 -1
  291. package/dist/stripe-elements/svg/bowling-ball-outline.svg +1 -1
  292. package/dist/stripe-elements/svg/bowling-ball-sharp.svg +1 -1
  293. package/dist/stripe-elements/svg/bowling-ball.svg +1 -1
  294. package/dist/stripe-elements/svg/briefcase-outline.svg +1 -1
  295. package/dist/stripe-elements/svg/briefcase-sharp.svg +1 -1
  296. package/dist/stripe-elements/svg/briefcase.svg +1 -1
  297. package/dist/stripe-elements/svg/browsers-outline.svg +1 -1
  298. package/dist/stripe-elements/svg/browsers-sharp.svg +1 -1
  299. package/dist/stripe-elements/svg/browsers.svg +1 -1
  300. package/dist/stripe-elements/svg/brush-outline.svg +1 -1
  301. package/dist/stripe-elements/svg/brush-sharp.svg +1 -1
  302. package/dist/stripe-elements/svg/brush.svg +1 -1
  303. package/dist/stripe-elements/svg/bug-outline.svg +1 -1
  304. package/dist/stripe-elements/svg/bug-sharp.svg +1 -1
  305. package/dist/stripe-elements/svg/bug.svg +1 -1
  306. package/dist/stripe-elements/svg/build-outline.svg +1 -1
  307. package/dist/stripe-elements/svg/build-sharp.svg +1 -1
  308. package/dist/stripe-elements/svg/build.svg +1 -1
  309. package/dist/stripe-elements/svg/bulb-outline.svg +1 -1
  310. package/dist/stripe-elements/svg/bulb-sharp.svg +1 -1
  311. package/dist/stripe-elements/svg/bulb.svg +1 -1
  312. package/dist/stripe-elements/svg/bus-outline.svg +1 -1
  313. package/dist/stripe-elements/svg/bus-sharp.svg +1 -1
  314. package/dist/stripe-elements/svg/bus.svg +1 -1
  315. package/dist/stripe-elements/svg/business-outline.svg +1 -1
  316. package/dist/stripe-elements/svg/business-sharp.svg +1 -1
  317. package/dist/stripe-elements/svg/business.svg +1 -1
  318. package/dist/stripe-elements/svg/cafe-outline.svg +1 -1
  319. package/dist/stripe-elements/svg/cafe-sharp.svg +1 -1
  320. package/dist/stripe-elements/svg/cafe.svg +1 -1
  321. package/dist/stripe-elements/svg/calculator-outline.svg +1 -1
  322. package/dist/stripe-elements/svg/calculator-sharp.svg +1 -1
  323. package/dist/stripe-elements/svg/calculator.svg +1 -1
  324. package/dist/stripe-elements/svg/calendar-clear-outline.svg +1 -1
  325. package/dist/stripe-elements/svg/calendar-clear-sharp.svg +1 -1
  326. package/dist/stripe-elements/svg/calendar-clear.svg +1 -1
  327. package/dist/stripe-elements/svg/calendar-number-outline.svg +1 -1
  328. package/dist/stripe-elements/svg/calendar-number-sharp.svg +1 -1
  329. package/dist/stripe-elements/svg/calendar-number.svg +1 -1
  330. package/dist/stripe-elements/svg/calendar-outline.svg +1 -1
  331. package/dist/stripe-elements/svg/calendar-sharp.svg +1 -1
  332. package/dist/stripe-elements/svg/calendar.svg +1 -1
  333. package/dist/stripe-elements/svg/call-outline.svg +1 -1
  334. package/dist/stripe-elements/svg/call-sharp.svg +1 -1
  335. package/dist/stripe-elements/svg/call.svg +1 -1
  336. package/dist/stripe-elements/svg/camera-outline.svg +1 -1
  337. package/dist/stripe-elements/svg/camera-reverse-outline.svg +1 -1
  338. package/dist/stripe-elements/svg/camera-reverse-sharp.svg +1 -1
  339. package/dist/stripe-elements/svg/camera-reverse.svg +1 -1
  340. package/dist/stripe-elements/svg/camera-sharp.svg +1 -1
  341. package/dist/stripe-elements/svg/camera.svg +1 -1
  342. package/dist/stripe-elements/svg/car-outline.svg +1 -1
  343. package/dist/stripe-elements/svg/car-sharp.svg +1 -1
  344. package/dist/stripe-elements/svg/car-sport-outline.svg +1 -1
  345. package/dist/stripe-elements/svg/car-sport-sharp.svg +1 -1
  346. package/dist/stripe-elements/svg/car-sport.svg +1 -1
  347. package/dist/stripe-elements/svg/car.svg +1 -1
  348. package/dist/stripe-elements/svg/card-outline.svg +1 -1
  349. package/dist/stripe-elements/svg/card-sharp.svg +1 -1
  350. package/dist/stripe-elements/svg/card.svg +1 -1
  351. package/dist/stripe-elements/svg/caret-back-circle-outline.svg +1 -1
  352. package/dist/stripe-elements/svg/caret-back-circle-sharp.svg +1 -1
  353. package/dist/stripe-elements/svg/caret-back-circle.svg +1 -1
  354. package/dist/stripe-elements/svg/caret-back-outline.svg +1 -1
  355. package/dist/stripe-elements/svg/caret-back-sharp.svg +1 -1
  356. package/dist/stripe-elements/svg/caret-back.svg +1 -1
  357. package/dist/stripe-elements/svg/caret-down-circle-outline.svg +1 -1
  358. package/dist/stripe-elements/svg/caret-down-circle-sharp.svg +1 -1
  359. package/dist/stripe-elements/svg/caret-down-circle.svg +1 -1
  360. package/dist/stripe-elements/svg/caret-down-outline.svg +1 -1
  361. package/dist/stripe-elements/svg/caret-down-sharp.svg +1 -1
  362. package/dist/stripe-elements/svg/caret-down.svg +1 -1
  363. package/dist/stripe-elements/svg/caret-forward-circle-outline.svg +1 -1
  364. package/dist/stripe-elements/svg/caret-forward-circle-sharp.svg +1 -1
  365. package/dist/stripe-elements/svg/caret-forward-circle.svg +1 -1
  366. package/dist/stripe-elements/svg/caret-forward-outline.svg +1 -1
  367. package/dist/stripe-elements/svg/caret-forward-sharp.svg +1 -1
  368. package/dist/stripe-elements/svg/caret-forward.svg +1 -1
  369. package/dist/stripe-elements/svg/caret-up-circle-outline.svg +1 -1
  370. package/dist/stripe-elements/svg/caret-up-circle-sharp.svg +1 -1
  371. package/dist/stripe-elements/svg/caret-up-circle.svg +1 -1
  372. package/dist/stripe-elements/svg/caret-up-outline.svg +1 -1
  373. package/dist/stripe-elements/svg/caret-up-sharp.svg +1 -1
  374. package/dist/stripe-elements/svg/caret-up.svg +1 -1
  375. package/dist/stripe-elements/svg/cart-outline.svg +1 -1
  376. package/dist/stripe-elements/svg/cart-sharp.svg +1 -1
  377. package/dist/stripe-elements/svg/cart.svg +1 -1
  378. package/dist/stripe-elements/svg/cash-outline.svg +1 -1
  379. package/dist/stripe-elements/svg/cash-sharp.svg +1 -1
  380. package/dist/stripe-elements/svg/cash.svg +1 -1
  381. package/dist/stripe-elements/svg/cellular-outline.svg +1 -1
  382. package/dist/stripe-elements/svg/cellular-sharp.svg +1 -1
  383. package/dist/stripe-elements/svg/cellular.svg +1 -1
  384. package/dist/stripe-elements/svg/chatbox-ellipses-outline.svg +1 -1
  385. package/dist/stripe-elements/svg/chatbox-ellipses-sharp.svg +1 -1
  386. package/dist/stripe-elements/svg/chatbox-ellipses.svg +1 -1
  387. package/dist/stripe-elements/svg/chatbox-outline.svg +1 -1
  388. package/dist/stripe-elements/svg/chatbox-sharp.svg +1 -1
  389. package/dist/stripe-elements/svg/chatbox.svg +1 -1
  390. package/dist/stripe-elements/svg/chatbubble-ellipses-outline.svg +1 -1
  391. package/dist/stripe-elements/svg/chatbubble-ellipses-sharp.svg +1 -1
  392. package/dist/stripe-elements/svg/chatbubble-ellipses.svg +1 -1
  393. package/dist/stripe-elements/svg/chatbubble-outline.svg +1 -1
  394. package/dist/stripe-elements/svg/chatbubble-sharp.svg +1 -1
  395. package/dist/stripe-elements/svg/chatbubble.svg +1 -1
  396. package/dist/stripe-elements/svg/chatbubbles-outline.svg +1 -1
  397. package/dist/stripe-elements/svg/chatbubbles-sharp.svg +1 -1
  398. package/dist/stripe-elements/svg/chatbubbles.svg +1 -1
  399. package/dist/stripe-elements/svg/checkbox-outline.svg +1 -1
  400. package/dist/stripe-elements/svg/checkbox-sharp.svg +1 -1
  401. package/dist/stripe-elements/svg/checkbox.svg +1 -1
  402. package/dist/stripe-elements/svg/checkmark-circle-outline.svg +1 -1
  403. package/dist/stripe-elements/svg/checkmark-circle-sharp.svg +1 -1
  404. package/dist/stripe-elements/svg/checkmark-circle.svg +1 -1
  405. package/dist/stripe-elements/svg/checkmark-done-circle-outline.svg +1 -1
  406. package/dist/stripe-elements/svg/checkmark-done-circle-sharp.svg +1 -1
  407. package/dist/stripe-elements/svg/checkmark-done-circle.svg +1 -1
  408. package/dist/stripe-elements/svg/checkmark-done-outline.svg +1 -1
  409. package/dist/stripe-elements/svg/checkmark-done-sharp.svg +1 -1
  410. package/dist/stripe-elements/svg/checkmark-done.svg +1 -1
  411. package/dist/stripe-elements/svg/checkmark-outline.svg +1 -1
  412. package/dist/stripe-elements/svg/checkmark-sharp.svg +1 -1
  413. package/dist/stripe-elements/svg/checkmark.svg +1 -1
  414. package/dist/stripe-elements/svg/chevron-back-circle-outline.svg +1 -1
  415. package/dist/stripe-elements/svg/chevron-back-circle-sharp.svg +1 -1
  416. package/dist/stripe-elements/svg/chevron-back-circle.svg +1 -1
  417. package/dist/stripe-elements/svg/chevron-back-outline.svg +1 -1
  418. package/dist/stripe-elements/svg/chevron-back-sharp.svg +1 -1
  419. package/dist/stripe-elements/svg/chevron-back.svg +1 -1
  420. package/dist/stripe-elements/svg/chevron-collapse-outline.svg +1 -0
  421. package/dist/stripe-elements/svg/chevron-collapse-sharp.svg +1 -0
  422. package/dist/stripe-elements/svg/chevron-collapse.svg +1 -0
  423. package/dist/stripe-elements/svg/chevron-down-circle-outline.svg +1 -1
  424. package/dist/stripe-elements/svg/chevron-down-circle-sharp.svg +1 -1
  425. package/dist/stripe-elements/svg/chevron-down-circle.svg +1 -1
  426. package/dist/stripe-elements/svg/chevron-down-outline.svg +1 -1
  427. package/dist/stripe-elements/svg/chevron-down-sharp.svg +1 -1
  428. package/dist/stripe-elements/svg/chevron-down.svg +1 -1
  429. package/dist/stripe-elements/svg/chevron-expand-outline.svg +1 -0
  430. package/dist/stripe-elements/svg/chevron-expand-sharp.svg +1 -0
  431. package/dist/stripe-elements/svg/chevron-expand.svg +1 -0
  432. package/dist/stripe-elements/svg/chevron-forward-circle-outline.svg +1 -1
  433. package/dist/stripe-elements/svg/chevron-forward-circle-sharp.svg +1 -1
  434. package/dist/stripe-elements/svg/chevron-forward-circle.svg +1 -1
  435. package/dist/stripe-elements/svg/chevron-forward-outline.svg +1 -1
  436. package/dist/stripe-elements/svg/chevron-forward-sharp.svg +1 -1
  437. package/dist/stripe-elements/svg/chevron-forward.svg +1 -1
  438. package/dist/stripe-elements/svg/chevron-up-circle-outline.svg +1 -1
  439. package/dist/stripe-elements/svg/chevron-up-circle-sharp.svg +1 -1
  440. package/dist/stripe-elements/svg/chevron-up-circle.svg +1 -1
  441. package/dist/stripe-elements/svg/chevron-up-outline.svg +1 -1
  442. package/dist/stripe-elements/svg/chevron-up-sharp.svg +1 -1
  443. package/dist/stripe-elements/svg/chevron-up.svg +1 -1
  444. package/dist/stripe-elements/svg/clipboard-outline.svg +1 -1
  445. package/dist/stripe-elements/svg/clipboard-sharp.svg +1 -1
  446. package/dist/stripe-elements/svg/clipboard.svg +1 -1
  447. package/dist/stripe-elements/svg/close-circle-outline.svg +1 -1
  448. package/dist/stripe-elements/svg/close-circle-sharp.svg +1 -1
  449. package/dist/stripe-elements/svg/close-circle.svg +1 -1
  450. package/dist/stripe-elements/svg/close-outline.svg +1 -1
  451. package/dist/stripe-elements/svg/close-sharp.svg +1 -1
  452. package/dist/stripe-elements/svg/close.svg +1 -1
  453. package/dist/stripe-elements/svg/cloud-circle-outline.svg +1 -1
  454. package/dist/stripe-elements/svg/cloud-circle-sharp.svg +1 -1
  455. package/dist/stripe-elements/svg/cloud-circle.svg +1 -1
  456. package/dist/stripe-elements/svg/cloud-done-outline.svg +1 -1
  457. package/dist/stripe-elements/svg/cloud-done-sharp.svg +1 -1
  458. package/dist/stripe-elements/svg/cloud-done.svg +1 -1
  459. package/dist/stripe-elements/svg/cloud-download-outline.svg +1 -1
  460. package/dist/stripe-elements/svg/cloud-download-sharp.svg +1 -1
  461. package/dist/stripe-elements/svg/cloud-download.svg +1 -1
  462. package/dist/stripe-elements/svg/cloud-offline-outline.svg +1 -1
  463. package/dist/stripe-elements/svg/cloud-offline-sharp.svg +1 -1
  464. package/dist/stripe-elements/svg/cloud-offline.svg +1 -1
  465. package/dist/stripe-elements/svg/cloud-outline.svg +1 -1
  466. package/dist/stripe-elements/svg/cloud-sharp.svg +1 -1
  467. package/dist/stripe-elements/svg/cloud-upload-outline.svg +1 -1
  468. package/dist/stripe-elements/svg/cloud-upload-sharp.svg +1 -1
  469. package/dist/stripe-elements/svg/cloud-upload.svg +1 -1
  470. package/dist/stripe-elements/svg/cloud.svg +1 -1
  471. package/dist/stripe-elements/svg/cloudy-night-outline.svg +1 -1
  472. package/dist/stripe-elements/svg/cloudy-night-sharp.svg +1 -1
  473. package/dist/stripe-elements/svg/cloudy-night.svg +1 -1
  474. package/dist/stripe-elements/svg/cloudy-outline.svg +1 -1
  475. package/dist/stripe-elements/svg/cloudy-sharp.svg +1 -1
  476. package/dist/stripe-elements/svg/cloudy.svg +1 -1
  477. package/dist/stripe-elements/svg/code-download-outline.svg +1 -1
  478. package/dist/stripe-elements/svg/code-download-sharp.svg +1 -1
  479. package/dist/stripe-elements/svg/code-download.svg +1 -1
  480. package/dist/stripe-elements/svg/code-outline.svg +1 -1
  481. package/dist/stripe-elements/svg/code-sharp.svg +1 -1
  482. package/dist/stripe-elements/svg/code-slash-outline.svg +1 -1
  483. package/dist/stripe-elements/svg/code-slash-sharp.svg +1 -1
  484. package/dist/stripe-elements/svg/code-slash.svg +1 -1
  485. package/dist/stripe-elements/svg/code-working-outline.svg +1 -1
  486. package/dist/stripe-elements/svg/code-working-sharp.svg +1 -1
  487. package/dist/stripe-elements/svg/code-working.svg +1 -1
  488. package/dist/stripe-elements/svg/code.svg +1 -1
  489. package/dist/stripe-elements/svg/cog-outline.svg +1 -1
  490. package/dist/stripe-elements/svg/cog-sharp.svg +1 -1
  491. package/dist/stripe-elements/svg/cog.svg +1 -1
  492. package/dist/stripe-elements/svg/color-fill-outline.svg +1 -1
  493. package/dist/stripe-elements/svg/color-fill-sharp.svg +1 -1
  494. package/dist/stripe-elements/svg/color-fill.svg +1 -1
  495. package/dist/stripe-elements/svg/color-filter-outline.svg +1 -1
  496. package/dist/stripe-elements/svg/color-filter-sharp.svg +1 -1
  497. package/dist/stripe-elements/svg/color-filter.svg +1 -1
  498. package/dist/stripe-elements/svg/color-palette-outline.svg +1 -1
  499. package/dist/stripe-elements/svg/color-palette-sharp.svg +1 -1
  500. package/dist/stripe-elements/svg/color-palette.svg +1 -1
  501. package/dist/stripe-elements/svg/color-wand-outline.svg +1 -1
  502. package/dist/stripe-elements/svg/color-wand-sharp.svg +1 -1
  503. package/dist/stripe-elements/svg/color-wand.svg +1 -1
  504. package/dist/stripe-elements/svg/compass-outline.svg +1 -1
  505. package/dist/stripe-elements/svg/compass-sharp.svg +1 -1
  506. package/dist/stripe-elements/svg/compass.svg +1 -1
  507. package/dist/stripe-elements/svg/construct-outline.svg +1 -1
  508. package/dist/stripe-elements/svg/construct-sharp.svg +1 -1
  509. package/dist/stripe-elements/svg/construct.svg +1 -1
  510. package/dist/stripe-elements/svg/contract-outline.svg +1 -1
  511. package/dist/stripe-elements/svg/contract-sharp.svg +1 -1
  512. package/dist/stripe-elements/svg/contract.svg +1 -1
  513. package/dist/stripe-elements/svg/contrast-outline.svg +1 -1
  514. package/dist/stripe-elements/svg/contrast-sharp.svg +1 -1
  515. package/dist/stripe-elements/svg/contrast.svg +1 -1
  516. package/dist/stripe-elements/svg/copy-outline.svg +1 -1
  517. package/dist/stripe-elements/svg/copy-sharp.svg +1 -1
  518. package/dist/stripe-elements/svg/copy.svg +1 -1
  519. package/dist/stripe-elements/svg/create-outline.svg +1 -1
  520. package/dist/stripe-elements/svg/create-sharp.svg +1 -1
  521. package/dist/stripe-elements/svg/create.svg +1 -1
  522. package/dist/stripe-elements/svg/crop-outline.svg +1 -1
  523. package/dist/stripe-elements/svg/crop-sharp.svg +1 -1
  524. package/dist/stripe-elements/svg/crop.svg +1 -1
  525. package/dist/stripe-elements/svg/cube-outline.svg +1 -1
  526. package/dist/stripe-elements/svg/cube-sharp.svg +1 -1
  527. package/dist/stripe-elements/svg/cube.svg +1 -1
  528. package/dist/stripe-elements/svg/cut-outline.svg +1 -1
  529. package/dist/stripe-elements/svg/cut-sharp.svg +1 -1
  530. package/dist/stripe-elements/svg/cut.svg +1 -1
  531. package/dist/stripe-elements/svg/desktop-outline.svg +1 -1
  532. package/dist/stripe-elements/svg/desktop-sharp.svg +1 -1
  533. package/dist/stripe-elements/svg/desktop.svg +1 -1
  534. package/dist/stripe-elements/svg/diamond-outline.svg +1 -1
  535. package/dist/stripe-elements/svg/diamond-sharp.svg +1 -1
  536. package/dist/stripe-elements/svg/diamond.svg +1 -1
  537. package/dist/stripe-elements/svg/dice-outline.svg +1 -1
  538. package/dist/stripe-elements/svg/dice-sharp.svg +1 -1
  539. package/dist/stripe-elements/svg/dice.svg +1 -1
  540. package/dist/stripe-elements/svg/disc-outline.svg +1 -1
  541. package/dist/stripe-elements/svg/disc-sharp.svg +1 -1
  542. package/dist/stripe-elements/svg/disc.svg +1 -1
  543. package/dist/stripe-elements/svg/document-attach-outline.svg +1 -1
  544. package/dist/stripe-elements/svg/document-attach-sharp.svg +1 -1
  545. package/dist/stripe-elements/svg/document-attach.svg +1 -1
  546. package/dist/stripe-elements/svg/document-lock-outline.svg +1 -1
  547. package/dist/stripe-elements/svg/document-lock-sharp.svg +1 -1
  548. package/dist/stripe-elements/svg/document-lock.svg +1 -1
  549. package/dist/stripe-elements/svg/document-outline.svg +1 -1
  550. package/dist/stripe-elements/svg/document-sharp.svg +1 -1
  551. package/dist/stripe-elements/svg/document-text-outline.svg +1 -1
  552. package/dist/stripe-elements/svg/document-text-sharp.svg +1 -1
  553. package/dist/stripe-elements/svg/document-text.svg +1 -1
  554. package/dist/stripe-elements/svg/document.svg +1 -1
  555. package/dist/stripe-elements/svg/documents-outline.svg +1 -1
  556. package/dist/stripe-elements/svg/documents-sharp.svg +1 -1
  557. package/dist/stripe-elements/svg/documents.svg +1 -1
  558. package/dist/stripe-elements/svg/download-outline.svg +1 -1
  559. package/dist/stripe-elements/svg/download-sharp.svg +1 -1
  560. package/dist/stripe-elements/svg/download.svg +1 -1
  561. package/dist/stripe-elements/svg/duplicate-outline.svg +1 -1
  562. package/dist/stripe-elements/svg/duplicate-sharp.svg +1 -1
  563. package/dist/stripe-elements/svg/duplicate.svg +1 -1
  564. package/dist/stripe-elements/svg/ear-outline.svg +1 -1
  565. package/dist/stripe-elements/svg/ear-sharp.svg +1 -1
  566. package/dist/stripe-elements/svg/ear.svg +1 -1
  567. package/dist/stripe-elements/svg/earth-outline.svg +1 -1
  568. package/dist/stripe-elements/svg/earth-sharp.svg +1 -1
  569. package/dist/stripe-elements/svg/earth.svg +1 -1
  570. package/dist/stripe-elements/svg/easel-outline.svg +1 -1
  571. package/dist/stripe-elements/svg/easel-sharp.svg +1 -1
  572. package/dist/stripe-elements/svg/easel.svg +1 -1
  573. package/dist/stripe-elements/svg/egg-outline.svg +1 -1
  574. package/dist/stripe-elements/svg/egg-sharp.svg +1 -1
  575. package/dist/stripe-elements/svg/egg.svg +1 -1
  576. package/dist/stripe-elements/svg/ellipse-outline.svg +1 -1
  577. package/dist/stripe-elements/svg/ellipse-sharp.svg +1 -1
  578. package/dist/stripe-elements/svg/ellipse.svg +1 -1
  579. package/dist/stripe-elements/svg/ellipsis-horizontal-circle-outline.svg +1 -1
  580. package/dist/stripe-elements/svg/ellipsis-horizontal-circle-sharp.svg +1 -1
  581. package/dist/stripe-elements/svg/ellipsis-horizontal-circle.svg +1 -1
  582. package/dist/stripe-elements/svg/ellipsis-horizontal-outline.svg +1 -1
  583. package/dist/stripe-elements/svg/ellipsis-horizontal-sharp.svg +1 -1
  584. package/dist/stripe-elements/svg/ellipsis-horizontal.svg +1 -1
  585. package/dist/stripe-elements/svg/ellipsis-vertical-circle-outline.svg +1 -1
  586. package/dist/stripe-elements/svg/ellipsis-vertical-circle-sharp.svg +1 -1
  587. package/dist/stripe-elements/svg/ellipsis-vertical-circle.svg +1 -1
  588. package/dist/stripe-elements/svg/ellipsis-vertical-outline.svg +1 -1
  589. package/dist/stripe-elements/svg/ellipsis-vertical-sharp.svg +1 -1
  590. package/dist/stripe-elements/svg/ellipsis-vertical.svg +1 -1
  591. package/dist/stripe-elements/svg/enter-outline.svg +1 -1
  592. package/dist/stripe-elements/svg/enter-sharp.svg +1 -1
  593. package/dist/stripe-elements/svg/enter.svg +1 -1
  594. package/dist/stripe-elements/svg/exit-outline.svg +1 -1
  595. package/dist/stripe-elements/svg/exit-sharp.svg +1 -1
  596. package/dist/stripe-elements/svg/exit.svg +1 -1
  597. package/dist/stripe-elements/svg/expand-outline.svg +1 -1
  598. package/dist/stripe-elements/svg/expand-sharp.svg +1 -1
  599. package/dist/stripe-elements/svg/expand.svg +1 -1
  600. package/dist/stripe-elements/svg/extension-puzzle-outline.svg +1 -1
  601. package/dist/stripe-elements/svg/extension-puzzle-sharp.svg +1 -1
  602. package/dist/stripe-elements/svg/extension-puzzle.svg +1 -1
  603. package/dist/stripe-elements/svg/eye-off-outline.svg +1 -1
  604. package/dist/stripe-elements/svg/eye-off-sharp.svg +1 -1
  605. package/dist/stripe-elements/svg/eye-off.svg +1 -1
  606. package/dist/stripe-elements/svg/eye-outline.svg +1 -1
  607. package/dist/stripe-elements/svg/eye-sharp.svg +1 -1
  608. package/dist/stripe-elements/svg/eye.svg +1 -1
  609. package/dist/stripe-elements/svg/eyedrop-outline.svg +1 -1
  610. package/dist/stripe-elements/svg/eyedrop-sharp.svg +1 -1
  611. package/dist/stripe-elements/svg/eyedrop.svg +1 -1
  612. package/dist/stripe-elements/svg/fast-food-outline.svg +1 -1
  613. package/dist/stripe-elements/svg/fast-food-sharp.svg +1 -1
  614. package/dist/stripe-elements/svg/fast-food.svg +1 -1
  615. package/dist/stripe-elements/svg/female-outline.svg +1 -1
  616. package/dist/stripe-elements/svg/female-sharp.svg +1 -1
  617. package/dist/stripe-elements/svg/female.svg +1 -1
  618. package/dist/stripe-elements/svg/file-tray-full-outline.svg +1 -1
  619. package/dist/stripe-elements/svg/file-tray-full-sharp.svg +1 -1
  620. package/dist/stripe-elements/svg/file-tray-full.svg +1 -1
  621. package/dist/stripe-elements/svg/file-tray-outline.svg +1 -1
  622. package/dist/stripe-elements/svg/file-tray-sharp.svg +1 -1
  623. package/dist/stripe-elements/svg/file-tray-stacked-outline.svg +1 -1
  624. package/dist/stripe-elements/svg/file-tray-stacked-sharp.svg +1 -1
  625. package/dist/stripe-elements/svg/file-tray-stacked.svg +1 -1
  626. package/dist/stripe-elements/svg/file-tray.svg +1 -1
  627. package/dist/stripe-elements/svg/film-outline.svg +1 -1
  628. package/dist/stripe-elements/svg/film-sharp.svg +1 -1
  629. package/dist/stripe-elements/svg/film.svg +1 -1
  630. package/dist/stripe-elements/svg/filter-circle-outline.svg +1 -1
  631. package/dist/stripe-elements/svg/filter-circle-sharp.svg +1 -1
  632. package/dist/stripe-elements/svg/filter-circle.svg +1 -1
  633. package/dist/stripe-elements/svg/filter-outline.svg +1 -1
  634. package/dist/stripe-elements/svg/filter-sharp.svg +1 -1
  635. package/dist/stripe-elements/svg/filter.svg +1 -1
  636. package/dist/stripe-elements/svg/finger-print-outline.svg +1 -1
  637. package/dist/stripe-elements/svg/finger-print-sharp.svg +1 -1
  638. package/dist/stripe-elements/svg/finger-print.svg +1 -1
  639. package/dist/stripe-elements/svg/fish-outline.svg +1 -1
  640. package/dist/stripe-elements/svg/fish-sharp.svg +1 -1
  641. package/dist/stripe-elements/svg/fish.svg +1 -1
  642. package/dist/stripe-elements/svg/fitness-outline.svg +1 -1
  643. package/dist/stripe-elements/svg/fitness-sharp.svg +1 -1
  644. package/dist/stripe-elements/svg/fitness.svg +1 -1
  645. package/dist/stripe-elements/svg/flag-outline.svg +1 -1
  646. package/dist/stripe-elements/svg/flag-sharp.svg +1 -1
  647. package/dist/stripe-elements/svg/flag.svg +1 -1
  648. package/dist/stripe-elements/svg/flame-outline.svg +1 -1
  649. package/dist/stripe-elements/svg/flame-sharp.svg +1 -1
  650. package/dist/stripe-elements/svg/flame.svg +1 -1
  651. package/dist/stripe-elements/svg/flash-off-outline.svg +1 -1
  652. package/dist/stripe-elements/svg/flash-off-sharp.svg +1 -1
  653. package/dist/stripe-elements/svg/flash-off.svg +1 -1
  654. package/dist/stripe-elements/svg/flash-outline.svg +1 -1
  655. package/dist/stripe-elements/svg/flash-sharp.svg +1 -1
  656. package/dist/stripe-elements/svg/flash.svg +1 -1
  657. package/dist/stripe-elements/svg/flashlight-outline.svg +1 -1
  658. package/dist/stripe-elements/svg/flashlight-sharp.svg +1 -1
  659. package/dist/stripe-elements/svg/flashlight.svg +1 -1
  660. package/dist/stripe-elements/svg/flask-outline.svg +1 -1
  661. package/dist/stripe-elements/svg/flask-sharp.svg +1 -1
  662. package/dist/stripe-elements/svg/flask.svg +1 -1
  663. package/dist/stripe-elements/svg/flower-outline.svg +1 -1
  664. package/dist/stripe-elements/svg/flower-sharp.svg +1 -1
  665. package/dist/stripe-elements/svg/flower.svg +1 -1
  666. package/dist/stripe-elements/svg/folder-open-outline.svg +1 -1
  667. package/dist/stripe-elements/svg/folder-open-sharp.svg +1 -1
  668. package/dist/stripe-elements/svg/folder-open.svg +1 -1
  669. package/dist/stripe-elements/svg/folder-outline.svg +1 -1
  670. package/dist/stripe-elements/svg/folder-sharp.svg +1 -1
  671. package/dist/stripe-elements/svg/folder.svg +1 -1
  672. package/dist/stripe-elements/svg/football-outline.svg +1 -1
  673. package/dist/stripe-elements/svg/football-sharp.svg +1 -1
  674. package/dist/stripe-elements/svg/football.svg +1 -1
  675. package/dist/stripe-elements/svg/footsteps-outline.svg +1 -1
  676. package/dist/stripe-elements/svg/footsteps-sharp.svg +1 -1
  677. package/dist/stripe-elements/svg/footsteps.svg +1 -1
  678. package/dist/stripe-elements/svg/funnel-outline.svg +1 -1
  679. package/dist/stripe-elements/svg/funnel-sharp.svg +1 -1
  680. package/dist/stripe-elements/svg/funnel.svg +1 -1
  681. package/dist/stripe-elements/svg/game-controller-outline.svg +1 -1
  682. package/dist/stripe-elements/svg/game-controller-sharp.svg +1 -1
  683. package/dist/stripe-elements/svg/game-controller.svg +1 -1
  684. package/dist/stripe-elements/svg/gift-outline.svg +1 -1
  685. package/dist/stripe-elements/svg/gift-sharp.svg +1 -1
  686. package/dist/stripe-elements/svg/gift.svg +1 -1
  687. package/dist/stripe-elements/svg/git-branch-outline.svg +1 -1
  688. package/dist/stripe-elements/svg/git-branch-sharp.svg +1 -1
  689. package/dist/stripe-elements/svg/git-branch.svg +1 -1
  690. package/dist/stripe-elements/svg/git-commit-outline.svg +1 -1
  691. package/dist/stripe-elements/svg/git-commit-sharp.svg +1 -1
  692. package/dist/stripe-elements/svg/git-commit.svg +1 -1
  693. package/dist/stripe-elements/svg/git-compare-outline.svg +1 -1
  694. package/dist/stripe-elements/svg/git-compare-sharp.svg +1 -1
  695. package/dist/stripe-elements/svg/git-compare.svg +1 -1
  696. package/dist/stripe-elements/svg/git-merge-outline.svg +1 -1
  697. package/dist/stripe-elements/svg/git-merge-sharp.svg +1 -1
  698. package/dist/stripe-elements/svg/git-merge.svg +1 -1
  699. package/dist/stripe-elements/svg/git-network-outline.svg +1 -1
  700. package/dist/stripe-elements/svg/git-network-sharp.svg +1 -1
  701. package/dist/stripe-elements/svg/git-network.svg +1 -1
  702. package/dist/stripe-elements/svg/git-pull-request-outline.svg +1 -1
  703. package/dist/stripe-elements/svg/git-pull-request-sharp.svg +1 -1
  704. package/dist/stripe-elements/svg/git-pull-request.svg +1 -1
  705. package/dist/stripe-elements/svg/glasses-outline.svg +1 -1
  706. package/dist/stripe-elements/svg/glasses-sharp.svg +1 -1
  707. package/dist/stripe-elements/svg/glasses.svg +1 -1
  708. package/dist/stripe-elements/svg/globe-outline.svg +1 -1
  709. package/dist/stripe-elements/svg/globe-sharp.svg +1 -1
  710. package/dist/stripe-elements/svg/globe.svg +1 -1
  711. package/dist/stripe-elements/svg/golf-outline.svg +1 -1
  712. package/dist/stripe-elements/svg/golf-sharp.svg +1 -1
  713. package/dist/stripe-elements/svg/golf.svg +1 -1
  714. package/dist/stripe-elements/svg/grid-outline.svg +1 -1
  715. package/dist/stripe-elements/svg/grid-sharp.svg +1 -1
  716. package/dist/stripe-elements/svg/grid.svg +1 -1
  717. package/dist/stripe-elements/svg/hammer-outline.svg +1 -1
  718. package/dist/stripe-elements/svg/hammer-sharp.svg +1 -1
  719. package/dist/stripe-elements/svg/hammer.svg +1 -1
  720. package/dist/stripe-elements/svg/hand-left-outline.svg +1 -1
  721. package/dist/stripe-elements/svg/hand-left-sharp.svg +1 -1
  722. package/dist/stripe-elements/svg/hand-left.svg +1 -1
  723. package/dist/stripe-elements/svg/hand-right-outline.svg +1 -1
  724. package/dist/stripe-elements/svg/hand-right-sharp.svg +1 -1
  725. package/dist/stripe-elements/svg/hand-right.svg +1 -1
  726. package/dist/stripe-elements/svg/happy-outline.svg +1 -1
  727. package/dist/stripe-elements/svg/happy-sharp.svg +1 -1
  728. package/dist/stripe-elements/svg/happy.svg +1 -1
  729. package/dist/stripe-elements/svg/hardware-chip-outline.svg +1 -1
  730. package/dist/stripe-elements/svg/hardware-chip-sharp.svg +1 -1
  731. package/dist/stripe-elements/svg/hardware-chip.svg +1 -1
  732. package/dist/stripe-elements/svg/headset-outline.svg +1 -1
  733. package/dist/stripe-elements/svg/headset-sharp.svg +1 -1
  734. package/dist/stripe-elements/svg/headset.svg +1 -1
  735. package/dist/stripe-elements/svg/heart-circle-outline.svg +1 -1
  736. package/dist/stripe-elements/svg/heart-circle-sharp.svg +1 -1
  737. package/dist/stripe-elements/svg/heart-circle.svg +1 -1
  738. package/dist/stripe-elements/svg/heart-dislike-circle-outline.svg +1 -1
  739. package/dist/stripe-elements/svg/heart-dislike-circle-sharp.svg +1 -1
  740. package/dist/stripe-elements/svg/heart-dislike-circle.svg +1 -1
  741. package/dist/stripe-elements/svg/heart-dislike-outline.svg +1 -1
  742. package/dist/stripe-elements/svg/heart-dislike-sharp.svg +1 -1
  743. package/dist/stripe-elements/svg/heart-dislike.svg +1 -1
  744. package/dist/stripe-elements/svg/heart-half-outline.svg +1 -1
  745. package/dist/stripe-elements/svg/heart-half-sharp.svg +1 -1
  746. package/dist/stripe-elements/svg/heart-half.svg +1 -1
  747. package/dist/stripe-elements/svg/heart-outline.svg +1 -1
  748. package/dist/stripe-elements/svg/heart-sharp.svg +1 -1
  749. package/dist/stripe-elements/svg/heart.svg +1 -1
  750. package/dist/stripe-elements/svg/help-buoy-outline.svg +1 -1
  751. package/dist/stripe-elements/svg/help-buoy-sharp.svg +1 -1
  752. package/dist/stripe-elements/svg/help-buoy.svg +1 -1
  753. package/dist/stripe-elements/svg/help-circle-outline.svg +1 -1
  754. package/dist/stripe-elements/svg/help-circle-sharp.svg +1 -1
  755. package/dist/stripe-elements/svg/help-circle.svg +1 -1
  756. package/dist/stripe-elements/svg/help-outline.svg +1 -1
  757. package/dist/stripe-elements/svg/help-sharp.svg +1 -1
  758. package/dist/stripe-elements/svg/help.svg +1 -1
  759. package/dist/stripe-elements/svg/home-outline.svg +1 -1
  760. package/dist/stripe-elements/svg/home-sharp.svg +1 -1
  761. package/dist/stripe-elements/svg/home.svg +1 -1
  762. package/dist/stripe-elements/svg/hourglass-outline.svg +1 -1
  763. package/dist/stripe-elements/svg/hourglass-sharp.svg +1 -1
  764. package/dist/stripe-elements/svg/hourglass.svg +1 -1
  765. package/dist/stripe-elements/svg/ice-cream-outline.svg +1 -1
  766. package/dist/stripe-elements/svg/ice-cream-sharp.svg +1 -1
  767. package/dist/stripe-elements/svg/ice-cream.svg +1 -1
  768. package/dist/stripe-elements/svg/id-card-outline.svg +1 -1
  769. package/dist/stripe-elements/svg/id-card-sharp.svg +1 -1
  770. package/dist/stripe-elements/svg/id-card.svg +1 -1
  771. package/dist/stripe-elements/svg/image-outline.svg +1 -1
  772. package/dist/stripe-elements/svg/image-sharp.svg +1 -1
  773. package/dist/stripe-elements/svg/image.svg +1 -1
  774. package/dist/stripe-elements/svg/images-outline.svg +1 -1
  775. package/dist/stripe-elements/svg/images-sharp.svg +1 -1
  776. package/dist/stripe-elements/svg/images.svg +1 -1
  777. package/dist/stripe-elements/svg/infinite-outline.svg +1 -1
  778. package/dist/stripe-elements/svg/infinite-sharp.svg +1 -1
  779. package/dist/stripe-elements/svg/infinite.svg +1 -1
  780. package/dist/stripe-elements/svg/information-circle-outline.svg +1 -1
  781. package/dist/stripe-elements/svg/information-circle-sharp.svg +1 -1
  782. package/dist/stripe-elements/svg/information-circle.svg +1 -1
  783. package/dist/stripe-elements/svg/information-outline.svg +1 -1
  784. package/dist/stripe-elements/svg/information-sharp.svg +1 -1
  785. package/dist/stripe-elements/svg/information.svg +1 -1
  786. package/dist/stripe-elements/svg/invert-mode-outline.svg +1 -1
  787. package/dist/stripe-elements/svg/invert-mode-sharp.svg +1 -1
  788. package/dist/stripe-elements/svg/invert-mode.svg +1 -1
  789. package/dist/stripe-elements/svg/journal-outline.svg +1 -1
  790. package/dist/stripe-elements/svg/journal-sharp.svg +1 -1
  791. package/dist/stripe-elements/svg/journal.svg +1 -1
  792. package/dist/stripe-elements/svg/key-outline.svg +1 -1
  793. package/dist/stripe-elements/svg/key-sharp.svg +1 -1
  794. package/dist/stripe-elements/svg/key.svg +1 -1
  795. package/dist/stripe-elements/svg/keypad-outline.svg +1 -1
  796. package/dist/stripe-elements/svg/keypad-sharp.svg +1 -1
  797. package/dist/stripe-elements/svg/keypad.svg +1 -1
  798. package/dist/stripe-elements/svg/language-outline.svg +1 -1
  799. package/dist/stripe-elements/svg/language-sharp.svg +1 -1
  800. package/dist/stripe-elements/svg/language.svg +1 -1
  801. package/dist/stripe-elements/svg/laptop-outline.svg +1 -1
  802. package/dist/stripe-elements/svg/laptop-sharp.svg +1 -1
  803. package/dist/stripe-elements/svg/laptop.svg +1 -1
  804. package/dist/stripe-elements/svg/layers-outline.svg +1 -1
  805. package/dist/stripe-elements/svg/layers-sharp.svg +1 -1
  806. package/dist/stripe-elements/svg/layers.svg +1 -1
  807. package/dist/stripe-elements/svg/leaf-outline.svg +1 -1
  808. package/dist/stripe-elements/svg/leaf-sharp.svg +1 -1
  809. package/dist/stripe-elements/svg/leaf.svg +1 -1
  810. package/dist/stripe-elements/svg/library-outline.svg +1 -1
  811. package/dist/stripe-elements/svg/library-sharp.svg +1 -1
  812. package/dist/stripe-elements/svg/library.svg +1 -1
  813. package/dist/stripe-elements/svg/link-outline.svg +1 -1
  814. package/dist/stripe-elements/svg/link-sharp.svg +1 -1
  815. package/dist/stripe-elements/svg/link.svg +1 -1
  816. package/dist/stripe-elements/svg/list-circle-outline.svg +1 -1
  817. package/dist/stripe-elements/svg/list-circle-sharp.svg +1 -1
  818. package/dist/stripe-elements/svg/list-circle.svg +1 -1
  819. package/dist/stripe-elements/svg/list-outline.svg +1 -1
  820. package/dist/stripe-elements/svg/list-sharp.svg +1 -1
  821. package/dist/stripe-elements/svg/list.svg +1 -1
  822. package/dist/stripe-elements/svg/locate-outline.svg +1 -1
  823. package/dist/stripe-elements/svg/locate-sharp.svg +1 -1
  824. package/dist/stripe-elements/svg/locate.svg +1 -1
  825. package/dist/stripe-elements/svg/location-outline.svg +1 -1
  826. package/dist/stripe-elements/svg/location-sharp.svg +1 -1
  827. package/dist/stripe-elements/svg/location.svg +1 -1
  828. package/dist/stripe-elements/svg/lock-closed-outline.svg +1 -1
  829. package/dist/stripe-elements/svg/lock-closed-sharp.svg +1 -1
  830. package/dist/stripe-elements/svg/lock-closed.svg +1 -1
  831. package/dist/stripe-elements/svg/lock-open-outline.svg +1 -1
  832. package/dist/stripe-elements/svg/lock-open-sharp.svg +1 -1
  833. package/dist/stripe-elements/svg/lock-open.svg +1 -1
  834. package/dist/stripe-elements/svg/log-in-outline.svg +1 -1
  835. package/dist/stripe-elements/svg/log-in-sharp.svg +1 -1
  836. package/dist/stripe-elements/svg/log-in.svg +1 -1
  837. package/dist/stripe-elements/svg/log-out-outline.svg +1 -1
  838. package/dist/stripe-elements/svg/log-out-sharp.svg +1 -1
  839. package/dist/stripe-elements/svg/log-out.svg +1 -1
  840. package/dist/stripe-elements/svg/logo-alipay.svg +1 -1
  841. package/dist/stripe-elements/svg/logo-amazon.svg +1 -1
  842. package/dist/stripe-elements/svg/logo-amplify.svg +1 -1
  843. package/dist/stripe-elements/svg/logo-android.svg +1 -1
  844. package/dist/stripe-elements/svg/logo-angular.svg +1 -1
  845. package/dist/stripe-elements/svg/logo-apple-appstore.svg +1 -1
  846. package/dist/stripe-elements/svg/logo-apple-ar.svg +1 -1
  847. package/dist/stripe-elements/svg/logo-apple.svg +1 -1
  848. package/dist/stripe-elements/svg/logo-behance.svg +1 -1
  849. package/dist/stripe-elements/svg/logo-bitbucket.svg +1 -1
  850. package/dist/stripe-elements/svg/logo-bitcoin.svg +1 -1
  851. package/dist/stripe-elements/svg/logo-buffer.svg +1 -1
  852. package/dist/stripe-elements/svg/logo-capacitor.svg +1 -1
  853. package/dist/stripe-elements/svg/logo-chrome.svg +1 -1
  854. package/dist/stripe-elements/svg/logo-closed-captioning.svg +1 -1
  855. package/dist/stripe-elements/svg/logo-codepen.svg +1 -1
  856. package/dist/stripe-elements/svg/logo-css3.svg +1 -1
  857. package/dist/stripe-elements/svg/logo-designernews.svg +1 -1
  858. package/dist/stripe-elements/svg/logo-deviantart.svg +1 -1
  859. package/dist/stripe-elements/svg/logo-discord.svg +1 -1
  860. package/dist/stripe-elements/svg/logo-docker.svg +1 -1
  861. package/dist/stripe-elements/svg/logo-dribbble.svg +1 -1
  862. package/dist/stripe-elements/svg/logo-dropbox.svg +1 -1
  863. package/dist/stripe-elements/svg/logo-edge.svg +1 -1
  864. package/dist/stripe-elements/svg/logo-electron.svg +1 -1
  865. package/dist/stripe-elements/svg/logo-euro.svg +1 -1
  866. package/dist/stripe-elements/svg/logo-facebook.svg +1 -1
  867. package/dist/stripe-elements/svg/logo-figma.svg +1 -1
  868. package/dist/stripe-elements/svg/logo-firebase.svg +1 -1
  869. package/dist/stripe-elements/svg/logo-firefox.svg +1 -1
  870. package/dist/stripe-elements/svg/logo-flickr.svg +1 -1
  871. package/dist/stripe-elements/svg/logo-foursquare.svg +1 -1
  872. package/dist/stripe-elements/svg/logo-github.svg +1 -1
  873. package/dist/stripe-elements/svg/logo-gitlab.svg +1 -1
  874. package/dist/stripe-elements/svg/logo-google-playstore.svg +1 -1
  875. package/dist/stripe-elements/svg/logo-google.svg +1 -1
  876. package/dist/stripe-elements/svg/logo-hackernews.svg +1 -1
  877. package/dist/stripe-elements/svg/logo-html5.svg +1 -1
  878. package/dist/stripe-elements/svg/logo-instagram.svg +1 -1
  879. package/dist/stripe-elements/svg/logo-ionic.svg +1 -1
  880. package/dist/stripe-elements/svg/logo-ionitron.svg +1 -1
  881. package/dist/stripe-elements/svg/logo-javascript.svg +1 -1
  882. package/dist/stripe-elements/svg/logo-laravel.svg +1 -1
  883. package/dist/stripe-elements/svg/logo-linkedin.svg +1 -1
  884. package/dist/stripe-elements/svg/logo-markdown.svg +1 -1
  885. package/dist/stripe-elements/svg/logo-mastodon.svg +1 -1
  886. package/dist/stripe-elements/svg/logo-medium.svg +1 -1
  887. package/dist/stripe-elements/svg/logo-microsoft.svg +1 -1
  888. package/dist/stripe-elements/svg/logo-no-smoking.svg +1 -1
  889. package/dist/stripe-elements/svg/logo-nodejs.svg +1 -1
  890. package/dist/stripe-elements/svg/logo-npm.svg +1 -1
  891. package/dist/stripe-elements/svg/logo-octocat.svg +1 -1
  892. package/dist/stripe-elements/svg/logo-paypal.svg +1 -1
  893. package/dist/stripe-elements/svg/logo-pinterest.svg +1 -1
  894. package/dist/stripe-elements/svg/logo-playstation.svg +1 -1
  895. package/dist/stripe-elements/svg/logo-pwa.svg +1 -1
  896. package/dist/stripe-elements/svg/logo-python.svg +1 -1
  897. package/dist/stripe-elements/svg/logo-react.svg +1 -1
  898. package/dist/stripe-elements/svg/logo-reddit.svg +1 -1
  899. package/dist/stripe-elements/svg/logo-rss.svg +1 -1
  900. package/dist/stripe-elements/svg/logo-sass.svg +1 -1
  901. package/dist/stripe-elements/svg/logo-skype.svg +1 -1
  902. package/dist/stripe-elements/svg/logo-slack.svg +1 -1
  903. package/dist/stripe-elements/svg/logo-snapchat.svg +1 -1
  904. package/dist/stripe-elements/svg/logo-soundcloud.svg +1 -1
  905. package/dist/stripe-elements/svg/logo-stackoverflow.svg +1 -1
  906. package/dist/stripe-elements/svg/logo-steam.svg +1 -1
  907. package/dist/stripe-elements/svg/logo-stencil.svg +1 -1
  908. package/dist/stripe-elements/svg/logo-tableau.svg +1 -1
  909. package/dist/stripe-elements/svg/logo-tiktok.svg +1 -1
  910. package/dist/stripe-elements/svg/logo-tumblr.svg +1 -1
  911. package/dist/stripe-elements/svg/logo-tux.svg +1 -1
  912. package/dist/stripe-elements/svg/logo-twitch.svg +1 -1
  913. package/dist/stripe-elements/svg/logo-twitter.svg +1 -1
  914. package/dist/stripe-elements/svg/logo-usd.svg +1 -1
  915. package/dist/stripe-elements/svg/logo-venmo.svg +1 -1
  916. package/dist/stripe-elements/svg/logo-vercel.svg +1 -1
  917. package/dist/stripe-elements/svg/logo-vimeo.svg +1 -1
  918. package/dist/stripe-elements/svg/logo-vk.svg +1 -1
  919. package/dist/stripe-elements/svg/logo-vue.svg +1 -1
  920. package/dist/stripe-elements/svg/logo-web-component.svg +1 -1
  921. package/dist/stripe-elements/svg/logo-wechat.svg +1 -1
  922. package/dist/stripe-elements/svg/logo-whatsapp.svg +1 -1
  923. package/dist/stripe-elements/svg/logo-windows.svg +1 -1
  924. package/dist/stripe-elements/svg/logo-wordpress.svg +1 -1
  925. package/dist/stripe-elements/svg/logo-xbox.svg +1 -1
  926. package/dist/stripe-elements/svg/logo-xing.svg +1 -1
  927. package/dist/stripe-elements/svg/logo-yahoo.svg +1 -1
  928. package/dist/stripe-elements/svg/logo-yen.svg +1 -1
  929. package/dist/stripe-elements/svg/logo-youtube.svg +1 -1
  930. package/dist/stripe-elements/svg/magnet-outline.svg +1 -1
  931. package/dist/stripe-elements/svg/magnet-sharp.svg +1 -1
  932. package/dist/stripe-elements/svg/magnet.svg +1 -1
  933. package/dist/stripe-elements/svg/mail-open-outline.svg +1 -1
  934. package/dist/stripe-elements/svg/mail-open-sharp.svg +1 -1
  935. package/dist/stripe-elements/svg/mail-open.svg +1 -1
  936. package/dist/stripe-elements/svg/mail-outline.svg +1 -1
  937. package/dist/stripe-elements/svg/mail-sharp.svg +1 -1
  938. package/dist/stripe-elements/svg/mail-unread-outline.svg +1 -1
  939. package/dist/stripe-elements/svg/mail-unread-sharp.svg +1 -1
  940. package/dist/stripe-elements/svg/mail-unread.svg +1 -1
  941. package/dist/stripe-elements/svg/mail.svg +1 -1
  942. package/dist/stripe-elements/svg/male-female-outline.svg +1 -1
  943. package/dist/stripe-elements/svg/male-female-sharp.svg +1 -1
  944. package/dist/stripe-elements/svg/male-female.svg +1 -1
  945. package/dist/stripe-elements/svg/male-outline.svg +1 -1
  946. package/dist/stripe-elements/svg/male-sharp.svg +1 -1
  947. package/dist/stripe-elements/svg/male.svg +1 -1
  948. package/dist/stripe-elements/svg/man-outline.svg +1 -1
  949. package/dist/stripe-elements/svg/man-sharp.svg +1 -1
  950. package/dist/stripe-elements/svg/man.svg +1 -1
  951. package/dist/stripe-elements/svg/map-outline.svg +1 -1
  952. package/dist/stripe-elements/svg/map-sharp.svg +1 -1
  953. package/dist/stripe-elements/svg/map.svg +1 -1
  954. package/dist/stripe-elements/svg/medal-outline.svg +1 -1
  955. package/dist/stripe-elements/svg/medal-sharp.svg +1 -1
  956. package/dist/stripe-elements/svg/medal.svg +1 -1
  957. package/dist/stripe-elements/svg/medical-outline.svg +1 -1
  958. package/dist/stripe-elements/svg/medical-sharp.svg +1 -1
  959. package/dist/stripe-elements/svg/medical.svg +1 -1
  960. package/dist/stripe-elements/svg/medkit-outline.svg +1 -1
  961. package/dist/stripe-elements/svg/medkit-sharp.svg +1 -1
  962. package/dist/stripe-elements/svg/medkit.svg +1 -1
  963. package/dist/stripe-elements/svg/megaphone-outline.svg +1 -1
  964. package/dist/stripe-elements/svg/megaphone-sharp.svg +1 -1
  965. package/dist/stripe-elements/svg/megaphone.svg +1 -1
  966. package/dist/stripe-elements/svg/menu-outline.svg +1 -1
  967. package/dist/stripe-elements/svg/menu-sharp.svg +1 -1
  968. package/dist/stripe-elements/svg/menu.svg +1 -1
  969. package/dist/stripe-elements/svg/mic-circle-outline.svg +1 -1
  970. package/dist/stripe-elements/svg/mic-circle-sharp.svg +1 -1
  971. package/dist/stripe-elements/svg/mic-circle.svg +1 -1
  972. package/dist/stripe-elements/svg/mic-off-circle-outline.svg +1 -1
  973. package/dist/stripe-elements/svg/mic-off-circle-sharp.svg +1 -1
  974. package/dist/stripe-elements/svg/mic-off-circle.svg +1 -1
  975. package/dist/stripe-elements/svg/mic-off-outline.svg +1 -1
  976. package/dist/stripe-elements/svg/mic-off-sharp.svg +1 -1
  977. package/dist/stripe-elements/svg/mic-off.svg +1 -1
  978. package/dist/stripe-elements/svg/mic-outline.svg +1 -1
  979. package/dist/stripe-elements/svg/mic-sharp.svg +1 -1
  980. package/dist/stripe-elements/svg/mic.svg +1 -1
  981. package/dist/stripe-elements/svg/moon-outline.svg +1 -1
  982. package/dist/stripe-elements/svg/moon-sharp.svg +1 -1
  983. package/dist/stripe-elements/svg/moon.svg +1 -1
  984. package/dist/stripe-elements/svg/move-outline.svg +1 -1
  985. package/dist/stripe-elements/svg/move-sharp.svg +1 -1
  986. package/dist/stripe-elements/svg/move.svg +1 -1
  987. package/dist/stripe-elements/svg/musical-note-outline.svg +1 -1
  988. package/dist/stripe-elements/svg/musical-note-sharp.svg +1 -1
  989. package/dist/stripe-elements/svg/musical-note.svg +1 -1
  990. package/dist/stripe-elements/svg/musical-notes-outline.svg +1 -1
  991. package/dist/stripe-elements/svg/musical-notes-sharp.svg +1 -1
  992. package/dist/stripe-elements/svg/musical-notes.svg +1 -1
  993. package/dist/stripe-elements/svg/navigate-circle-outline.svg +1 -1
  994. package/dist/stripe-elements/svg/navigate-circle-sharp.svg +1 -1
  995. package/dist/stripe-elements/svg/navigate-circle.svg +1 -1
  996. package/dist/stripe-elements/svg/navigate-outline.svg +1 -1
  997. package/dist/stripe-elements/svg/navigate-sharp.svg +1 -1
  998. package/dist/stripe-elements/svg/navigate.svg +1 -1
  999. package/dist/stripe-elements/svg/newspaper-outline.svg +1 -1
  1000. package/dist/stripe-elements/svg/newspaper-sharp.svg +1 -1
  1001. package/dist/stripe-elements/svg/newspaper.svg +1 -1
  1002. package/dist/stripe-elements/svg/notifications-circle-outline.svg +1 -1
  1003. package/dist/stripe-elements/svg/notifications-circle-sharp.svg +1 -1
  1004. package/dist/stripe-elements/svg/notifications-circle.svg +1 -1
  1005. package/dist/stripe-elements/svg/notifications-off-circle-outline.svg +1 -1
  1006. package/dist/stripe-elements/svg/notifications-off-circle-sharp.svg +1 -1
  1007. package/dist/stripe-elements/svg/notifications-off-circle.svg +1 -1
  1008. package/dist/stripe-elements/svg/notifications-off-outline.svg +1 -1
  1009. package/dist/stripe-elements/svg/notifications-off-sharp.svg +1 -1
  1010. package/dist/stripe-elements/svg/notifications-off.svg +1 -1
  1011. package/dist/stripe-elements/svg/notifications-outline.svg +1 -1
  1012. package/dist/stripe-elements/svg/notifications-sharp.svg +1 -1
  1013. package/dist/stripe-elements/svg/notifications.svg +1 -1
  1014. package/dist/stripe-elements/svg/nuclear-outline.svg +1 -1
  1015. package/dist/stripe-elements/svg/nuclear-sharp.svg +1 -1
  1016. package/dist/stripe-elements/svg/nuclear.svg +1 -1
  1017. package/dist/stripe-elements/svg/nutrition-outline.svg +1 -1
  1018. package/dist/stripe-elements/svg/nutrition-sharp.svg +1 -1
  1019. package/dist/stripe-elements/svg/nutrition.svg +1 -1
  1020. package/dist/stripe-elements/svg/open-outline.svg +1 -1
  1021. package/dist/stripe-elements/svg/open-sharp.svg +1 -1
  1022. package/dist/stripe-elements/svg/open.svg +1 -1
  1023. package/dist/stripe-elements/svg/options-outline.svg +1 -1
  1024. package/dist/stripe-elements/svg/options-sharp.svg +1 -1
  1025. package/dist/stripe-elements/svg/options.svg +1 -1
  1026. package/dist/stripe-elements/svg/paper-plane-outline.svg +1 -1
  1027. package/dist/stripe-elements/svg/paper-plane-sharp.svg +1 -1
  1028. package/dist/stripe-elements/svg/paper-plane.svg +1 -1
  1029. package/dist/stripe-elements/svg/partly-sunny-outline.svg +1 -1
  1030. package/dist/stripe-elements/svg/partly-sunny-sharp.svg +1 -1
  1031. package/dist/stripe-elements/svg/partly-sunny.svg +1 -1
  1032. package/dist/stripe-elements/svg/pause-circle-outline.svg +1 -1
  1033. package/dist/stripe-elements/svg/pause-circle-sharp.svg +1 -1
  1034. package/dist/stripe-elements/svg/pause-circle.svg +1 -1
  1035. package/dist/stripe-elements/svg/pause-outline.svg +1 -1
  1036. package/dist/stripe-elements/svg/pause-sharp.svg +1 -1
  1037. package/dist/stripe-elements/svg/pause.svg +1 -1
  1038. package/dist/stripe-elements/svg/paw-outline.svg +1 -1
  1039. package/dist/stripe-elements/svg/paw-sharp.svg +1 -1
  1040. package/dist/stripe-elements/svg/paw.svg +1 -1
  1041. package/dist/stripe-elements/svg/pencil-outline.svg +1 -1
  1042. package/dist/stripe-elements/svg/pencil-sharp.svg +1 -1
  1043. package/dist/stripe-elements/svg/pencil.svg +1 -1
  1044. package/dist/stripe-elements/svg/people-circle-outline.svg +1 -1
  1045. package/dist/stripe-elements/svg/people-circle-sharp.svg +1 -1
  1046. package/dist/stripe-elements/svg/people-circle.svg +1 -1
  1047. package/dist/stripe-elements/svg/people-outline.svg +1 -1
  1048. package/dist/stripe-elements/svg/people-sharp.svg +1 -1
  1049. package/dist/stripe-elements/svg/people.svg +1 -1
  1050. package/dist/stripe-elements/svg/person-add-outline.svg +1 -1
  1051. package/dist/stripe-elements/svg/person-add-sharp.svg +1 -1
  1052. package/dist/stripe-elements/svg/person-add.svg +1 -1
  1053. package/dist/stripe-elements/svg/person-circle-outline.svg +1 -1
  1054. package/dist/stripe-elements/svg/person-circle-sharp.svg +1 -1
  1055. package/dist/stripe-elements/svg/person-circle.svg +1 -1
  1056. package/dist/stripe-elements/svg/person-outline.svg +1 -1
  1057. package/dist/stripe-elements/svg/person-remove-outline.svg +1 -1
  1058. package/dist/stripe-elements/svg/person-remove-sharp.svg +1 -1
  1059. package/dist/stripe-elements/svg/person-remove.svg +1 -1
  1060. package/dist/stripe-elements/svg/person-sharp.svg +1 -1
  1061. package/dist/stripe-elements/svg/person.svg +1 -1
  1062. package/dist/stripe-elements/svg/phone-landscape-outline.svg +1 -1
  1063. package/dist/stripe-elements/svg/phone-landscape-sharp.svg +1 -1
  1064. package/dist/stripe-elements/svg/phone-landscape.svg +1 -1
  1065. package/dist/stripe-elements/svg/phone-portrait-outline.svg +1 -1
  1066. package/dist/stripe-elements/svg/phone-portrait-sharp.svg +1 -1
  1067. package/dist/stripe-elements/svg/phone-portrait.svg +1 -1
  1068. package/dist/stripe-elements/svg/pie-chart-outline.svg +1 -1
  1069. package/dist/stripe-elements/svg/pie-chart-sharp.svg +1 -1
  1070. package/dist/stripe-elements/svg/pie-chart.svg +1 -1
  1071. package/dist/stripe-elements/svg/pin-outline.svg +1 -1
  1072. package/dist/stripe-elements/svg/pin-sharp.svg +1 -1
  1073. package/dist/stripe-elements/svg/pin.svg +1 -1
  1074. package/dist/stripe-elements/svg/pint-outline.svg +1 -1
  1075. package/dist/stripe-elements/svg/pint-sharp.svg +1 -1
  1076. package/dist/stripe-elements/svg/pint.svg +1 -1
  1077. package/dist/stripe-elements/svg/pizza-outline.svg +1 -1
  1078. package/dist/stripe-elements/svg/pizza-sharp.svg +1 -1
  1079. package/dist/stripe-elements/svg/pizza.svg +1 -1
  1080. package/dist/stripe-elements/svg/planet-outline.svg +1 -1
  1081. package/dist/stripe-elements/svg/planet-sharp.svg +1 -1
  1082. package/dist/stripe-elements/svg/planet.svg +1 -1
  1083. package/dist/stripe-elements/svg/play-back-circle-outline.svg +1 -1
  1084. package/dist/stripe-elements/svg/play-back-circle-sharp.svg +1 -1
  1085. package/dist/stripe-elements/svg/play-back-circle.svg +1 -1
  1086. package/dist/stripe-elements/svg/play-back-outline.svg +1 -1
  1087. package/dist/stripe-elements/svg/play-back-sharp.svg +1 -1
  1088. package/dist/stripe-elements/svg/play-back.svg +1 -1
  1089. package/dist/stripe-elements/svg/play-circle-outline.svg +1 -1
  1090. package/dist/stripe-elements/svg/play-circle-sharp.svg +1 -1
  1091. package/dist/stripe-elements/svg/play-circle.svg +1 -1
  1092. package/dist/stripe-elements/svg/play-forward-circle-outline.svg +1 -1
  1093. package/dist/stripe-elements/svg/play-forward-circle-sharp.svg +1 -1
  1094. package/dist/stripe-elements/svg/play-forward-circle.svg +1 -1
  1095. package/dist/stripe-elements/svg/play-forward-outline.svg +1 -1
  1096. package/dist/stripe-elements/svg/play-forward-sharp.svg +1 -1
  1097. package/dist/stripe-elements/svg/play-forward.svg +1 -1
  1098. package/dist/stripe-elements/svg/play-outline.svg +1 -1
  1099. package/dist/stripe-elements/svg/play-sharp.svg +1 -1
  1100. package/dist/stripe-elements/svg/play-skip-back-circle-outline.svg +1 -1
  1101. package/dist/stripe-elements/svg/play-skip-back-circle-sharp.svg +1 -1
  1102. package/dist/stripe-elements/svg/play-skip-back-circle.svg +1 -1
  1103. package/dist/stripe-elements/svg/play-skip-back-outline.svg +1 -1
  1104. package/dist/stripe-elements/svg/play-skip-back-sharp.svg +1 -1
  1105. package/dist/stripe-elements/svg/play-skip-back.svg +1 -1
  1106. package/dist/stripe-elements/svg/play-skip-forward-circle-outline.svg +1 -1
  1107. package/dist/stripe-elements/svg/play-skip-forward-circle-sharp.svg +1 -1
  1108. package/dist/stripe-elements/svg/play-skip-forward-circle.svg +1 -1
  1109. package/dist/stripe-elements/svg/play-skip-forward-outline.svg +1 -1
  1110. package/dist/stripe-elements/svg/play-skip-forward-sharp.svg +1 -1
  1111. package/dist/stripe-elements/svg/play-skip-forward.svg +1 -1
  1112. package/dist/stripe-elements/svg/play.svg +1 -1
  1113. package/dist/stripe-elements/svg/podium-outline.svg +1 -1
  1114. package/dist/stripe-elements/svg/podium-sharp.svg +1 -1
  1115. package/dist/stripe-elements/svg/podium.svg +1 -1
  1116. package/dist/stripe-elements/svg/power-outline.svg +1 -1
  1117. package/dist/stripe-elements/svg/power-sharp.svg +1 -1
  1118. package/dist/stripe-elements/svg/power.svg +1 -1
  1119. package/dist/stripe-elements/svg/pricetag-outline.svg +1 -1
  1120. package/dist/stripe-elements/svg/pricetag-sharp.svg +1 -1
  1121. package/dist/stripe-elements/svg/pricetag.svg +1 -1
  1122. package/dist/stripe-elements/svg/pricetags-outline.svg +1 -1
  1123. package/dist/stripe-elements/svg/pricetags-sharp.svg +1 -1
  1124. package/dist/stripe-elements/svg/pricetags.svg +1 -1
  1125. package/dist/stripe-elements/svg/print-outline.svg +1 -1
  1126. package/dist/stripe-elements/svg/print-sharp.svg +1 -1
  1127. package/dist/stripe-elements/svg/print.svg +1 -1
  1128. package/dist/stripe-elements/svg/prism-outline.svg +1 -1
  1129. package/dist/stripe-elements/svg/prism-sharp.svg +1 -1
  1130. package/dist/stripe-elements/svg/prism.svg +1 -1
  1131. package/dist/stripe-elements/svg/pulse-outline.svg +1 -1
  1132. package/dist/stripe-elements/svg/pulse-sharp.svg +1 -1
  1133. package/dist/stripe-elements/svg/pulse.svg +1 -1
  1134. package/dist/stripe-elements/svg/push-outline.svg +1 -1
  1135. package/dist/stripe-elements/svg/push-sharp.svg +1 -1
  1136. package/dist/stripe-elements/svg/push.svg +1 -1
  1137. package/dist/stripe-elements/svg/qr-code-outline.svg +1 -1
  1138. package/dist/stripe-elements/svg/qr-code-sharp.svg +1 -1
  1139. package/dist/stripe-elements/svg/qr-code.svg +1 -1
  1140. package/dist/stripe-elements/svg/radio-button-off-outline.svg +1 -1
  1141. package/dist/stripe-elements/svg/radio-button-off-sharp.svg +1 -1
  1142. package/dist/stripe-elements/svg/radio-button-off.svg +1 -1
  1143. package/dist/stripe-elements/svg/radio-button-on-outline.svg +1 -1
  1144. package/dist/stripe-elements/svg/radio-button-on-sharp.svg +1 -1
  1145. package/dist/stripe-elements/svg/radio-button-on.svg +1 -1
  1146. package/dist/stripe-elements/svg/radio-outline.svg +1 -1
  1147. package/dist/stripe-elements/svg/radio-sharp.svg +1 -1
  1148. package/dist/stripe-elements/svg/radio.svg +1 -1
  1149. package/dist/stripe-elements/svg/rainy-outline.svg +1 -1
  1150. package/dist/stripe-elements/svg/rainy-sharp.svg +1 -1
  1151. package/dist/stripe-elements/svg/rainy.svg +1 -1
  1152. package/dist/stripe-elements/svg/reader-outline.svg +1 -1
  1153. package/dist/stripe-elements/svg/reader-sharp.svg +1 -1
  1154. package/dist/stripe-elements/svg/reader.svg +1 -1
  1155. package/dist/stripe-elements/svg/receipt-outline.svg +1 -1
  1156. package/dist/stripe-elements/svg/receipt-sharp.svg +1 -1
  1157. package/dist/stripe-elements/svg/receipt.svg +1 -1
  1158. package/dist/stripe-elements/svg/recording-outline.svg +1 -1
  1159. package/dist/stripe-elements/svg/recording-sharp.svg +1 -1
  1160. package/dist/stripe-elements/svg/recording.svg +1 -1
  1161. package/dist/stripe-elements/svg/refresh-circle-outline.svg +1 -1
  1162. package/dist/stripe-elements/svg/refresh-circle-sharp.svg +1 -1
  1163. package/dist/stripe-elements/svg/refresh-circle.svg +1 -1
  1164. package/dist/stripe-elements/svg/refresh-outline.svg +1 -1
  1165. package/dist/stripe-elements/svg/refresh-sharp.svg +1 -1
  1166. package/dist/stripe-elements/svg/refresh.svg +1 -1
  1167. package/dist/stripe-elements/svg/reload-circle-outline.svg +1 -1
  1168. package/dist/stripe-elements/svg/reload-circle-sharp.svg +1 -1
  1169. package/dist/stripe-elements/svg/reload-circle.svg +1 -1
  1170. package/dist/stripe-elements/svg/reload-outline.svg +1 -1
  1171. package/dist/stripe-elements/svg/reload-sharp.svg +1 -1
  1172. package/dist/stripe-elements/svg/reload.svg +1 -1
  1173. package/dist/stripe-elements/svg/remove-circle-outline.svg +1 -1
  1174. package/dist/stripe-elements/svg/remove-circle-sharp.svg +1 -1
  1175. package/dist/stripe-elements/svg/remove-circle.svg +1 -1
  1176. package/dist/stripe-elements/svg/remove-outline.svg +1 -1
  1177. package/dist/stripe-elements/svg/remove-sharp.svg +1 -1
  1178. package/dist/stripe-elements/svg/remove.svg +1 -1
  1179. package/dist/stripe-elements/svg/reorder-four-outline.svg +1 -1
  1180. package/dist/stripe-elements/svg/reorder-four-sharp.svg +1 -1
  1181. package/dist/stripe-elements/svg/reorder-four.svg +1 -1
  1182. package/dist/stripe-elements/svg/reorder-three-outline.svg +1 -1
  1183. package/dist/stripe-elements/svg/reorder-three-sharp.svg +1 -1
  1184. package/dist/stripe-elements/svg/reorder-three.svg +1 -1
  1185. package/dist/stripe-elements/svg/reorder-two-outline.svg +1 -1
  1186. package/dist/stripe-elements/svg/reorder-two-sharp.svg +1 -1
  1187. package/dist/stripe-elements/svg/reorder-two.svg +1 -1
  1188. package/dist/stripe-elements/svg/repeat-outline.svg +1 -1
  1189. package/dist/stripe-elements/svg/repeat-sharp.svg +1 -1
  1190. package/dist/stripe-elements/svg/repeat.svg +1 -1
  1191. package/dist/stripe-elements/svg/resize-outline.svg +1 -1
  1192. package/dist/stripe-elements/svg/resize-sharp.svg +1 -1
  1193. package/dist/stripe-elements/svg/resize.svg +1 -1
  1194. package/dist/stripe-elements/svg/restaurant-outline.svg +1 -1
  1195. package/dist/stripe-elements/svg/restaurant-sharp.svg +1 -1
  1196. package/dist/stripe-elements/svg/restaurant.svg +1 -1
  1197. package/dist/stripe-elements/svg/return-down-back-outline.svg +1 -1
  1198. package/dist/stripe-elements/svg/return-down-back-sharp.svg +1 -1
  1199. package/dist/stripe-elements/svg/return-down-back.svg +1 -1
  1200. package/dist/stripe-elements/svg/return-down-forward-outline.svg +1 -1
  1201. package/dist/stripe-elements/svg/return-down-forward-sharp.svg +1 -1
  1202. package/dist/stripe-elements/svg/return-down-forward.svg +1 -1
  1203. package/dist/stripe-elements/svg/return-up-back-outline.svg +1 -1
  1204. package/dist/stripe-elements/svg/return-up-back-sharp.svg +1 -1
  1205. package/dist/stripe-elements/svg/return-up-back.svg +1 -1
  1206. package/dist/stripe-elements/svg/return-up-forward-outline.svg +1 -1
  1207. package/dist/stripe-elements/svg/return-up-forward-sharp.svg +1 -1
  1208. package/dist/stripe-elements/svg/return-up-forward.svg +1 -1
  1209. package/dist/stripe-elements/svg/ribbon-outline.svg +1 -1
  1210. package/dist/stripe-elements/svg/ribbon-sharp.svg +1 -1
  1211. package/dist/stripe-elements/svg/ribbon.svg +1 -1
  1212. package/dist/stripe-elements/svg/rocket-outline.svg +1 -1
  1213. package/dist/stripe-elements/svg/rocket-sharp.svg +1 -1
  1214. package/dist/stripe-elements/svg/rocket.svg +1 -1
  1215. package/dist/stripe-elements/svg/rose-outline.svg +1 -1
  1216. package/dist/stripe-elements/svg/rose-sharp.svg +1 -1
  1217. package/dist/stripe-elements/svg/rose.svg +1 -1
  1218. package/dist/stripe-elements/svg/sad-outline.svg +1 -1
  1219. package/dist/stripe-elements/svg/sad-sharp.svg +1 -1
  1220. package/dist/stripe-elements/svg/sad.svg +1 -1
  1221. package/dist/stripe-elements/svg/save-outline.svg +1 -1
  1222. package/dist/stripe-elements/svg/save-sharp.svg +1 -1
  1223. package/dist/stripe-elements/svg/save.svg +1 -1
  1224. package/dist/stripe-elements/svg/scale-outline.svg +1 -1
  1225. package/dist/stripe-elements/svg/scale-sharp.svg +1 -1
  1226. package/dist/stripe-elements/svg/scale.svg +1 -1
  1227. package/dist/stripe-elements/svg/scan-circle-outline.svg +1 -1
  1228. package/dist/stripe-elements/svg/scan-circle-sharp.svg +1 -1
  1229. package/dist/stripe-elements/svg/scan-circle.svg +1 -1
  1230. package/dist/stripe-elements/svg/scan-outline.svg +1 -1
  1231. package/dist/stripe-elements/svg/scan-sharp.svg +1 -1
  1232. package/dist/stripe-elements/svg/scan.svg +1 -1
  1233. package/dist/stripe-elements/svg/school-outline.svg +1 -1
  1234. package/dist/stripe-elements/svg/school-sharp.svg +1 -1
  1235. package/dist/stripe-elements/svg/school.svg +1 -1
  1236. package/dist/stripe-elements/svg/search-circle-outline.svg +1 -1
  1237. package/dist/stripe-elements/svg/search-circle-sharp.svg +1 -1
  1238. package/dist/stripe-elements/svg/search-circle.svg +1 -1
  1239. package/dist/stripe-elements/svg/search-outline.svg +1 -1
  1240. package/dist/stripe-elements/svg/search-sharp.svg +1 -1
  1241. package/dist/stripe-elements/svg/search.svg +1 -1
  1242. package/dist/stripe-elements/svg/send-outline.svg +1 -1
  1243. package/dist/stripe-elements/svg/send-sharp.svg +1 -1
  1244. package/dist/stripe-elements/svg/send.svg +1 -1
  1245. package/dist/stripe-elements/svg/server-outline.svg +1 -1
  1246. package/dist/stripe-elements/svg/server-sharp.svg +1 -1
  1247. package/dist/stripe-elements/svg/server.svg +1 -1
  1248. package/dist/stripe-elements/svg/settings-outline.svg +1 -1
  1249. package/dist/stripe-elements/svg/settings-sharp.svg +1 -1
  1250. package/dist/stripe-elements/svg/settings.svg +1 -1
  1251. package/dist/stripe-elements/svg/shapes-outline.svg +1 -1
  1252. package/dist/stripe-elements/svg/shapes-sharp.svg +1 -1
  1253. package/dist/stripe-elements/svg/shapes.svg +1 -1
  1254. package/dist/stripe-elements/svg/share-outline.svg +1 -1
  1255. package/dist/stripe-elements/svg/share-sharp.svg +1 -1
  1256. package/dist/stripe-elements/svg/share-social-outline.svg +1 -1
  1257. package/dist/stripe-elements/svg/share-social-sharp.svg +1 -1
  1258. package/dist/stripe-elements/svg/share-social.svg +1 -1
  1259. package/dist/stripe-elements/svg/share.svg +1 -1
  1260. package/dist/stripe-elements/svg/shield-checkmark-outline.svg +1 -1
  1261. package/dist/stripe-elements/svg/shield-checkmark-sharp.svg +1 -1
  1262. package/dist/stripe-elements/svg/shield-checkmark.svg +1 -1
  1263. package/dist/stripe-elements/svg/shield-half-outline.svg +1 -1
  1264. package/dist/stripe-elements/svg/shield-half-sharp.svg +1 -1
  1265. package/dist/stripe-elements/svg/shield-half.svg +1 -1
  1266. package/dist/stripe-elements/svg/shield-outline.svg +1 -1
  1267. package/dist/stripe-elements/svg/shield-sharp.svg +1 -1
  1268. package/dist/stripe-elements/svg/shield.svg +1 -1
  1269. package/dist/stripe-elements/svg/shirt-outline.svg +1 -1
  1270. package/dist/stripe-elements/svg/shirt-sharp.svg +1 -1
  1271. package/dist/stripe-elements/svg/shirt.svg +1 -1
  1272. package/dist/stripe-elements/svg/shuffle-outline.svg +1 -1
  1273. package/dist/stripe-elements/svg/shuffle-sharp.svg +1 -1
  1274. package/dist/stripe-elements/svg/shuffle.svg +1 -1
  1275. package/dist/stripe-elements/svg/skull-outline.svg +1 -1
  1276. package/dist/stripe-elements/svg/skull-sharp.svg +1 -1
  1277. package/dist/stripe-elements/svg/skull.svg +1 -1
  1278. package/dist/stripe-elements/svg/snow-outline.svg +1 -1
  1279. package/dist/stripe-elements/svg/snow-sharp.svg +1 -1
  1280. package/dist/stripe-elements/svg/snow.svg +1 -1
  1281. package/dist/stripe-elements/svg/sparkles-outline.svg +1 -1
  1282. package/dist/stripe-elements/svg/sparkles-sharp.svg +1 -1
  1283. package/dist/stripe-elements/svg/sparkles.svg +1 -1
  1284. package/dist/stripe-elements/svg/speedometer-outline.svg +1 -1
  1285. package/dist/stripe-elements/svg/speedometer-sharp.svg +1 -1
  1286. package/dist/stripe-elements/svg/speedometer.svg +1 -1
  1287. package/dist/stripe-elements/svg/square-outline.svg +1 -1
  1288. package/dist/stripe-elements/svg/square-sharp.svg +1 -1
  1289. package/dist/stripe-elements/svg/square.svg +1 -1
  1290. package/dist/stripe-elements/svg/star-half-outline.svg +1 -1
  1291. package/dist/stripe-elements/svg/star-half-sharp.svg +1 -1
  1292. package/dist/stripe-elements/svg/star-half.svg +1 -1
  1293. package/dist/stripe-elements/svg/star-outline.svg +1 -1
  1294. package/dist/stripe-elements/svg/star-sharp.svg +1 -1
  1295. package/dist/stripe-elements/svg/star.svg +1 -1
  1296. package/dist/stripe-elements/svg/stats-chart-outline.svg +1 -1
  1297. package/dist/stripe-elements/svg/stats-chart-sharp.svg +1 -1
  1298. package/dist/stripe-elements/svg/stats-chart.svg +1 -1
  1299. package/dist/stripe-elements/svg/stop-circle-outline.svg +1 -1
  1300. package/dist/stripe-elements/svg/stop-circle-sharp.svg +1 -1
  1301. package/dist/stripe-elements/svg/stop-circle.svg +1 -1
  1302. package/dist/stripe-elements/svg/stop-outline.svg +1 -1
  1303. package/dist/stripe-elements/svg/stop-sharp.svg +1 -1
  1304. package/dist/stripe-elements/svg/stop.svg +1 -1
  1305. package/dist/stripe-elements/svg/stopwatch-outline.svg +1 -1
  1306. package/dist/stripe-elements/svg/stopwatch-sharp.svg +1 -1
  1307. package/dist/stripe-elements/svg/stopwatch.svg +1 -1
  1308. package/dist/stripe-elements/svg/storefront-outline.svg +1 -1
  1309. package/dist/stripe-elements/svg/storefront-sharp.svg +1 -1
  1310. package/dist/stripe-elements/svg/storefront.svg +1 -1
  1311. package/dist/stripe-elements/svg/subway-outline.svg +1 -1
  1312. package/dist/stripe-elements/svg/subway-sharp.svg +1 -1
  1313. package/dist/stripe-elements/svg/subway.svg +1 -1
  1314. package/dist/stripe-elements/svg/sunny-outline.svg +1 -1
  1315. package/dist/stripe-elements/svg/sunny-sharp.svg +1 -1
  1316. package/dist/stripe-elements/svg/sunny.svg +1 -1
  1317. package/dist/stripe-elements/svg/swap-horizontal-outline.svg +1 -1
  1318. package/dist/stripe-elements/svg/swap-horizontal-sharp.svg +1 -1
  1319. package/dist/stripe-elements/svg/swap-horizontal.svg +1 -1
  1320. package/dist/stripe-elements/svg/swap-vertical-outline.svg +1 -1
  1321. package/dist/stripe-elements/svg/swap-vertical-sharp.svg +1 -1
  1322. package/dist/stripe-elements/svg/swap-vertical.svg +1 -1
  1323. package/dist/stripe-elements/svg/sync-circle-outline.svg +1 -1
  1324. package/dist/stripe-elements/svg/sync-circle-sharp.svg +1 -1
  1325. package/dist/stripe-elements/svg/sync-circle.svg +1 -1
  1326. package/dist/stripe-elements/svg/sync-outline.svg +1 -1
  1327. package/dist/stripe-elements/svg/sync-sharp.svg +1 -1
  1328. package/dist/stripe-elements/svg/sync.svg +1 -1
  1329. package/dist/stripe-elements/svg/tablet-landscape-outline.svg +1 -1
  1330. package/dist/stripe-elements/svg/tablet-landscape-sharp.svg +1 -1
  1331. package/dist/stripe-elements/svg/tablet-landscape.svg +1 -1
  1332. package/dist/stripe-elements/svg/tablet-portrait-outline.svg +1 -1
  1333. package/dist/stripe-elements/svg/tablet-portrait-sharp.svg +1 -1
  1334. package/dist/stripe-elements/svg/tablet-portrait.svg +1 -1
  1335. package/dist/stripe-elements/svg/telescope-outline.svg +1 -1
  1336. package/dist/stripe-elements/svg/telescope-sharp.svg +1 -1
  1337. package/dist/stripe-elements/svg/telescope.svg +1 -1
  1338. package/dist/stripe-elements/svg/tennisball-outline.svg +1 -1
  1339. package/dist/stripe-elements/svg/tennisball-sharp.svg +1 -1
  1340. package/dist/stripe-elements/svg/tennisball.svg +1 -1
  1341. package/dist/stripe-elements/svg/terminal-outline.svg +1 -1
  1342. package/dist/stripe-elements/svg/terminal-sharp.svg +1 -1
  1343. package/dist/stripe-elements/svg/terminal.svg +1 -1
  1344. package/dist/stripe-elements/svg/text-outline.svg +1 -1
  1345. package/dist/stripe-elements/svg/text-sharp.svg +1 -1
  1346. package/dist/stripe-elements/svg/text.svg +1 -1
  1347. package/dist/stripe-elements/svg/thermometer-outline.svg +1 -1
  1348. package/dist/stripe-elements/svg/thermometer-sharp.svg +1 -1
  1349. package/dist/stripe-elements/svg/thermometer.svg +1 -1
  1350. package/dist/stripe-elements/svg/thumbs-down-outline.svg +1 -1
  1351. package/dist/stripe-elements/svg/thumbs-down-sharp.svg +1 -1
  1352. package/dist/stripe-elements/svg/thumbs-down.svg +1 -1
  1353. package/dist/stripe-elements/svg/thumbs-up-outline.svg +1 -1
  1354. package/dist/stripe-elements/svg/thumbs-up-sharp.svg +1 -1
  1355. package/dist/stripe-elements/svg/thumbs-up.svg +1 -1
  1356. package/dist/stripe-elements/svg/thunderstorm-outline.svg +1 -1
  1357. package/dist/stripe-elements/svg/thunderstorm-sharp.svg +1 -1
  1358. package/dist/stripe-elements/svg/thunderstorm.svg +1 -1
  1359. package/dist/stripe-elements/svg/ticket-outline.svg +1 -1
  1360. package/dist/stripe-elements/svg/ticket-sharp.svg +1 -1
  1361. package/dist/stripe-elements/svg/ticket.svg +1 -1
  1362. package/dist/stripe-elements/svg/time-outline.svg +1 -1
  1363. package/dist/stripe-elements/svg/time-sharp.svg +1 -1
  1364. package/dist/stripe-elements/svg/time.svg +1 -1
  1365. package/dist/stripe-elements/svg/timer-outline.svg +1 -1
  1366. package/dist/stripe-elements/svg/timer-sharp.svg +1 -1
  1367. package/dist/stripe-elements/svg/timer.svg +1 -1
  1368. package/dist/stripe-elements/svg/today-outline.svg +1 -1
  1369. package/dist/stripe-elements/svg/today-sharp.svg +1 -1
  1370. package/dist/stripe-elements/svg/today.svg +1 -1
  1371. package/dist/stripe-elements/svg/toggle-outline.svg +1 -1
  1372. package/dist/stripe-elements/svg/toggle-sharp.svg +1 -1
  1373. package/dist/stripe-elements/svg/toggle.svg +1 -1
  1374. package/dist/stripe-elements/svg/trail-sign-outline.svg +1 -1
  1375. package/dist/stripe-elements/svg/trail-sign-sharp.svg +1 -1
  1376. package/dist/stripe-elements/svg/trail-sign.svg +1 -1
  1377. package/dist/stripe-elements/svg/train-outline.svg +1 -1
  1378. package/dist/stripe-elements/svg/train-sharp.svg +1 -1
  1379. package/dist/stripe-elements/svg/train.svg +1 -1
  1380. package/dist/stripe-elements/svg/transgender-outline.svg +1 -1
  1381. package/dist/stripe-elements/svg/transgender-sharp.svg +1 -1
  1382. package/dist/stripe-elements/svg/transgender.svg +1 -1
  1383. package/dist/stripe-elements/svg/trash-bin-outline.svg +1 -1
  1384. package/dist/stripe-elements/svg/trash-bin-sharp.svg +1 -1
  1385. package/dist/stripe-elements/svg/trash-bin.svg +1 -1
  1386. package/dist/stripe-elements/svg/trash-outline.svg +1 -1
  1387. package/dist/stripe-elements/svg/trash-sharp.svg +1 -1
  1388. package/dist/stripe-elements/svg/trash.svg +1 -1
  1389. package/dist/stripe-elements/svg/trending-down-outline.svg +1 -1
  1390. package/dist/stripe-elements/svg/trending-down-sharp.svg +1 -1
  1391. package/dist/stripe-elements/svg/trending-down.svg +1 -1
  1392. package/dist/stripe-elements/svg/trending-up-outline.svg +1 -1
  1393. package/dist/stripe-elements/svg/trending-up-sharp.svg +1 -1
  1394. package/dist/stripe-elements/svg/trending-up.svg +1 -1
  1395. package/dist/stripe-elements/svg/triangle-outline.svg +1 -1
  1396. package/dist/stripe-elements/svg/triangle-sharp.svg +1 -1
  1397. package/dist/stripe-elements/svg/triangle.svg +1 -1
  1398. package/dist/stripe-elements/svg/trophy-outline.svg +1 -1
  1399. package/dist/stripe-elements/svg/trophy-sharp.svg +1 -1
  1400. package/dist/stripe-elements/svg/trophy.svg +1 -1
  1401. package/dist/stripe-elements/svg/tv-outline.svg +1 -1
  1402. package/dist/stripe-elements/svg/tv-sharp.svg +1 -1
  1403. package/dist/stripe-elements/svg/tv.svg +1 -1
  1404. package/dist/stripe-elements/svg/umbrella-outline.svg +1 -1
  1405. package/dist/stripe-elements/svg/umbrella-sharp.svg +1 -1
  1406. package/dist/stripe-elements/svg/umbrella.svg +1 -1
  1407. package/dist/stripe-elements/svg/unlink-outline.svg +1 -1
  1408. package/dist/stripe-elements/svg/unlink-sharp.svg +1 -1
  1409. package/dist/stripe-elements/svg/unlink.svg +1 -1
  1410. package/dist/stripe-elements/svg/videocam-off-outline.svg +1 -1
  1411. package/dist/stripe-elements/svg/videocam-off-sharp.svg +1 -1
  1412. package/dist/stripe-elements/svg/videocam-off.svg +1 -1
  1413. package/dist/stripe-elements/svg/videocam-outline.svg +1 -1
  1414. package/dist/stripe-elements/svg/videocam-sharp.svg +1 -1
  1415. package/dist/stripe-elements/svg/videocam.svg +1 -1
  1416. package/dist/stripe-elements/svg/volume-high-outline.svg +1 -1
  1417. package/dist/stripe-elements/svg/volume-high-sharp.svg +1 -1
  1418. package/dist/stripe-elements/svg/volume-high.svg +1 -1
  1419. package/dist/stripe-elements/svg/volume-low-outline.svg +1 -1
  1420. package/dist/stripe-elements/svg/volume-low-sharp.svg +1 -1
  1421. package/dist/stripe-elements/svg/volume-low.svg +1 -1
  1422. package/dist/stripe-elements/svg/volume-medium-outline.svg +1 -1
  1423. package/dist/stripe-elements/svg/volume-medium-sharp.svg +1 -1
  1424. package/dist/stripe-elements/svg/volume-medium.svg +1 -1
  1425. package/dist/stripe-elements/svg/volume-mute-outline.svg +1 -1
  1426. package/dist/stripe-elements/svg/volume-mute-sharp.svg +1 -1
  1427. package/dist/stripe-elements/svg/volume-mute.svg +1 -1
  1428. package/dist/stripe-elements/svg/volume-off-outline.svg +1 -1
  1429. package/dist/stripe-elements/svg/volume-off-sharp.svg +1 -1
  1430. package/dist/stripe-elements/svg/volume-off.svg +1 -1
  1431. package/dist/stripe-elements/svg/walk-outline.svg +1 -1
  1432. package/dist/stripe-elements/svg/walk-sharp.svg +1 -1
  1433. package/dist/stripe-elements/svg/walk.svg +1 -1
  1434. package/dist/stripe-elements/svg/wallet-outline.svg +1 -1
  1435. package/dist/stripe-elements/svg/wallet-sharp.svg +1 -1
  1436. package/dist/stripe-elements/svg/wallet.svg +1 -1
  1437. package/dist/stripe-elements/svg/warning-outline.svg +1 -1
  1438. package/dist/stripe-elements/svg/warning-sharp.svg +1 -1
  1439. package/dist/stripe-elements/svg/warning.svg +1 -1
  1440. package/dist/stripe-elements/svg/watch-outline.svg +1 -1
  1441. package/dist/stripe-elements/svg/watch-sharp.svg +1 -1
  1442. package/dist/stripe-elements/svg/watch.svg +1 -1
  1443. package/dist/stripe-elements/svg/water-outline.svg +1 -1
  1444. package/dist/stripe-elements/svg/water-sharp.svg +1 -1
  1445. package/dist/stripe-elements/svg/water.svg +1 -1
  1446. package/dist/stripe-elements/svg/wifi-outline.svg +1 -1
  1447. package/dist/stripe-elements/svg/wifi-sharp.svg +1 -1
  1448. package/dist/stripe-elements/svg/wifi.svg +1 -1
  1449. package/dist/stripe-elements/svg/wine-outline.svg +1 -1
  1450. package/dist/stripe-elements/svg/wine-sharp.svg +1 -1
  1451. package/dist/stripe-elements/svg/wine.svg +1 -1
  1452. package/dist/stripe-elements/svg/woman-outline.svg +1 -1
  1453. package/dist/stripe-elements/svg/woman-sharp.svg +1 -1
  1454. package/dist/stripe-elements/svg/woman.svg +1 -1
  1455. package/dist/types/components.d.ts +3 -0
  1456. package/dist/types/interfaces.d.ts +12 -12
  1457. package/dist/types/stencil-public-runtime.d.ts +92 -19
  1458. package/dist/types/utils/platform.d.ts +1 -1
  1459. package/loader/index.d.ts +9 -0
  1460. package/loader/package.json +1 -0
  1461. package/package.json +24 -24
  1462. package/dist/custom-elements/index.d.ts +0 -63
  1463. package/dist/stripe-elements/p-3922cc8d.js +0 -2
  1464. package/dist/stripe-elements/p-50848f78.entry.js +0 -1
  1465. package/dist/stripe-elements/p-56a89bc1.js +0 -1
  1466. package/dist/stripe-elements/p-61d8b918.entry.js +0 -1
  1467. package/dist/stripe-elements/p-9232a32e.entry.js +0 -1
  1468. package/dist/stripe-elements/p-cdf60a81.entry.js +0 -1
@@ -1,540 +1,6 @@
1
- import { getAssetPath, HTMLElement, Build, h, Host, createEvent, proxyCustomElement } from '@stencil/core/internal/client';
2
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
3
-
4
- let CACHED_MAP;
5
- const getIconMap = () => {
6
- if (typeof window === 'undefined') {
7
- return new Map();
8
- }
9
- else {
10
- if (!CACHED_MAP) {
11
- const win = window;
12
- win.Ionicons = win.Ionicons || {};
13
- CACHED_MAP = win.Ionicons.map = win.Ionicons.map || new Map();
14
- }
15
- return CACHED_MAP;
16
- }
17
- };
18
- const getUrl = (i) => {
19
- let url = getSrc(i.src);
20
- if (url) {
21
- return url;
22
- }
23
- url = getName(i.name, i.icon, i.mode, i.ios, i.md);
24
- if (url) {
25
- return getNamedUrl(url);
26
- }
27
- if (i.icon) {
28
- url = getSrc(i.icon);
29
- if (url) {
30
- return url;
31
- }
32
- url = getSrc(i.icon[i.mode]);
33
- if (url) {
34
- return url;
35
- }
36
- }
37
- return null;
38
- };
39
- const getNamedUrl = (iconName) => {
40
- const url = getIconMap().get(iconName);
41
- if (url) {
42
- return url;
43
- }
44
- return getAssetPath(`svg/${iconName}.svg`);
45
- };
46
- const getName = (iconName, icon, mode, ios, md) => {
47
- // default to "md" if somehow the mode wasn't set
48
- mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
49
- // if an icon was passed in using the ios or md attributes
50
- // set the iconName to whatever was passed in
51
- if (ios && mode === 'ios') {
52
- iconName = toLower(ios);
53
- }
54
- else if (md && mode === 'md') {
55
- iconName = toLower(md);
56
- }
57
- else {
58
- if (!iconName && icon && !isSrc(icon)) {
59
- iconName = icon;
60
- }
61
- if (isStr(iconName)) {
62
- iconName = toLower(iconName);
63
- }
64
- }
65
- if (!isStr(iconName) || iconName.trim() === '') {
66
- return null;
67
- }
68
- // only allow alpha characters and dash
69
- const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
70
- if (invalidChars !== '') {
71
- return null;
72
- }
73
- return iconName;
74
- };
75
- const getSrc = (src) => {
76
- if (isStr(src)) {
77
- src = src.trim();
78
- if (isSrc(src)) {
79
- return src;
80
- }
81
- }
82
- return null;
83
- };
84
- const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
85
- const isStr = (val) => typeof val === 'string';
86
- const toLower = (val) => val.toLowerCase();
87
- /**
88
- * Elements inside of web components sometimes need to inherit global attributes
89
- * set on the host. For example, the inner input in `ion-input` should inherit
90
- * the `title` attribute that developers set directly on `ion-input`. This
91
- * helper function should be called in componentWillLoad and assigned to a variable
92
- * that is later used in the render function.
93
- *
94
- * This does not need to be reactive as changing attributes on the host element
95
- * does not trigger a re-render.
96
- */
97
- const inheritAttributes = (el, attributes = []) => {
98
- const attributeObject = {};
99
- attributes.forEach(attr => {
100
- if (el.hasAttribute(attr)) {
101
- const value = el.getAttribute(attr);
102
- if (value !== null) {
103
- attributeObject[attr] = el.getAttribute(attr);
104
- }
105
- el.removeAttribute(attr);
106
- }
107
- });
108
- return attributeObject;
109
- };
110
-
111
- const validateContent = (svgContent) => {
112
- const div = document.createElement('div');
113
- div.innerHTML = svgContent;
114
- // setup this way to ensure it works on our buddy IE
115
- for (let i = div.childNodes.length - 1; i >= 0; i--) {
116
- if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
117
- div.removeChild(div.childNodes[i]);
118
- }
119
- }
120
- // must only have 1 root element
121
- const svgElm = div.firstElementChild;
122
- if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
123
- const svgClass = svgElm.getAttribute('class') || '';
124
- svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
125
- // root element must be an svg
126
- // lets double check we've got valid elements
127
- // do not allow scripts
128
- if (isValid(svgElm)) {
129
- return div.innerHTML;
130
- }
131
- }
132
- return '';
133
- };
134
- const isValid = (elm) => {
135
- if (elm.nodeType === 1) {
136
- if (elm.nodeName.toLowerCase() === 'script') {
137
- return false;
138
- }
139
- for (let i = 0; i < elm.attributes.length; i++) {
140
- const val = elm.attributes[i].value;
141
- if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {
142
- return false;
143
- }
144
- }
145
- for (let i = 0; i < elm.childNodes.length; i++) {
146
- if (!isValid(elm.childNodes[i])) {
147
- return false;
148
- }
149
- }
150
- }
151
- return true;
152
- };
153
-
154
- const ioniconContent = new Map();
155
- const requests = new Map();
156
- const getSvgContent = (url, sanitize) => {
157
- // see if we already have a request for this url
158
- let req = requests.get(url);
159
- if (!req) {
160
- if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
161
- // we don't already have a request
162
- req = fetch(url).then((rsp) => {
163
- if (rsp.ok) {
164
- return rsp.text().then((svgContent) => {
165
- if (svgContent && sanitize !== false) {
166
- svgContent = validateContent(svgContent);
167
- }
168
- ioniconContent.set(url, svgContent || '');
169
- });
170
- }
171
- ioniconContent.set(url, '');
172
- });
173
- // cache for the same requests
174
- requests.set(url, req);
175
- }
176
- else {
177
- // set to empty for ssr scenarios and resolve promise
178
- ioniconContent.set(url, '');
179
- return Promise.resolve();
180
- }
181
- }
182
- return req;
183
- };
184
-
185
- const iconCss = ":host{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;box-sizing:content-box !important}:host .ionicon{stroke:currentColor}.ionicon-fill-none{fill:none}.ionicon-stroke-width{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}.icon-inner,.ionicon,svg{display:block;height:100%;width:100%}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host(.icon-small){font-size:18px !important}:host(.icon-large){font-size:32px !important}:host(.ion-color){color:var(--ion-color-base) !important}:host(.ion-color-primary){--ion-color-base:var(--ion-color-primary, #3880ff)}:host(.ion-color-secondary){--ion-color-base:var(--ion-color-secondary, #0cd1e8)}:host(.ion-color-tertiary){--ion-color-base:var(--ion-color-tertiary, #f4a942)}:host(.ion-color-success){--ion-color-base:var(--ion-color-success, #10dc60)}:host(.ion-color-warning){--ion-color-base:var(--ion-color-warning, #ffce00)}:host(.ion-color-danger){--ion-color-base:var(--ion-color-danger, #f14141)}:host(.ion-color-light){--ion-color-base:var(--ion-color-light, #f4f5f8)}:host(.ion-color-medium){--ion-color-base:var(--ion-color-medium, #989aa2)}:host(.ion-color-dark){--ion-color-base:var(--ion-color-dark, #222428)}";
186
-
187
- const Icon = class extends HTMLElement {
188
- constructor() {
189
- super();
190
- this.__registerHost();
191
- this.__attachShadow();
192
- this.iconName = null;
193
- this.inheritedAttributes = {};
194
- this.isVisible = false;
195
- /**
196
- * The mode determines which platform styles to use.
197
- */
198
- this.mode = getIonMode();
199
- /**
200
- * If enabled, ion-icon will be loaded lazily when it's visible in the viewport.
201
- * Default, `false`.
202
- */
203
- this.lazy = false;
204
- /**
205
- * When set to `false`, SVG content that is HTTP fetched will not be checked
206
- * if the response SVG content has any `<script>` elements, or any attributes
207
- * that start with `on`, such as `onclick`.
208
- * @default true
209
- */
210
- this.sanitize = true;
211
- this.hasAriaHidden = () => {
212
- const { el } = this;
213
- return el.hasAttribute('aria-hidden') && el.getAttribute('aria-hidden') === 'true';
214
- };
215
- }
216
- componentWillLoad() {
217
- this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
218
- }
219
- connectedCallback() {
220
- // purposely do not return the promise here because loading
221
- // the svg file should not hold up loading the app
222
- // only load the svg if it's visible
223
- this.waitUntilVisible(this.el, '50px', () => {
224
- this.isVisible = true;
225
- this.loadIcon();
226
- });
227
- }
228
- disconnectedCallback() {
229
- if (this.io) {
230
- this.io.disconnect();
231
- this.io = undefined;
232
- }
233
- }
234
- waitUntilVisible(el, rootMargin, cb) {
235
- if (Build.isBrowser && this.lazy && typeof window !== 'undefined' && window.IntersectionObserver) {
236
- const io = (this.io = new window.IntersectionObserver((data) => {
237
- if (data[0].isIntersecting) {
238
- io.disconnect();
239
- this.io = undefined;
240
- cb();
241
- }
242
- }, { rootMargin }));
243
- io.observe(el);
244
- }
245
- else {
246
- // browser doesn't support IntersectionObserver
247
- // so just fallback to always show it
248
- cb();
249
- }
250
- }
251
- loadIcon() {
252
- if (Build.isBrowser && this.isVisible) {
253
- const url = getUrl(this);
254
- if (url) {
255
- if (ioniconContent.has(url)) {
256
- // sync if it's already loaded
257
- this.svgContent = ioniconContent.get(url);
258
- }
259
- else {
260
- // async if it hasn't been loaded
261
- getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(url)));
262
- }
263
- }
264
- }
265
- const label = this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
266
- /**
267
- * Come up with a default label
268
- * in case user does not provide their own.
269
- */
270
- if (label) {
271
- this.ariaLabel = label.replace(/\-/g, ' ');
272
- }
273
- }
274
- render() {
275
- const { iconName, ariaLabel, inheritedAttributes } = this;
276
- const mode = this.mode || 'md';
277
- const flipRtl = this.flipRtl ||
278
- (iconName &&
279
- (iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) &&
280
- this.flipRtl !== false);
281
- /**
282
- * Only set the aria-label if a) we have generated
283
- * one for the icon and if aria-hidden is not set to "true".
284
- * If developer wants to set their own aria-label, then
285
- * inheritedAttributes down below will override whatever
286
- * default label we have set.
287
- */
288
- return (h(Host, Object.assign({ "aria-label": ariaLabel !== undefined && !this.hasAriaHidden() ? ariaLabel : null, role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': !!flipRtl && this.el.ownerDocument.dir === 'rtl' }) }, inheritedAttributes), Build.isBrowser && this.svgContent ? (h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (h("div", { class: "icon-inner" }))));
289
- }
290
- static get assetsDirs() { return ["svg"]; }
291
- get el() { return this; }
292
- static get watchers() { return {
293
- "name": ["loadIcon"],
294
- "src": ["loadIcon"],
295
- "icon": ["loadIcon"]
296
- }; }
297
- static get style() { return iconCss; }
298
- };
299
- const getIonMode = () => (Build.isBrowser && typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
300
- const createColorClasses = (color) => {
301
- return color
302
- ? {
303
- 'ion-color': true,
304
- [`ion-color-${color}`]: true,
305
- }
306
- : null;
307
- };
308
-
309
- var V3_URL = 'https://js.stripe.com/v3';
310
- var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
311
- var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
312
- var findScript = function findScript() {
313
- var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]"));
314
-
315
- for (var i = 0; i < scripts.length; i++) {
316
- var script = scripts[i];
317
-
318
- if (!V3_URL_REGEX.test(script.src)) {
319
- continue;
320
- }
321
-
322
- return script;
323
- }
324
-
325
- return null;
326
- };
327
-
328
- var injectScript = function injectScript(params) {
329
- var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
330
- var script = document.createElement('script');
331
- script.src = "".concat(V3_URL).concat(queryString);
332
- var headOrBody = document.head || document.body;
333
-
334
- if (!headOrBody) {
335
- throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
336
- }
337
-
338
- headOrBody.appendChild(script);
339
- return script;
340
- };
341
-
342
- var registerWrapper = function registerWrapper(stripe, startTime) {
343
- if (!stripe || !stripe._registerWrapper) {
344
- return;
345
- }
346
-
347
- stripe._registerWrapper({
348
- name: 'stripe-js',
349
- version: "1.31.0",
350
- startTime: startTime
351
- });
352
- };
353
-
354
- var stripePromise = null;
355
- var loadScript = function loadScript(params) {
356
- // Ensure that we only attempt to load Stripe.js at most once
357
- if (stripePromise !== null) {
358
- return stripePromise;
359
- }
360
-
361
- stripePromise = new Promise(function (resolve, reject) {
362
- if (typeof window === 'undefined') {
363
- // Resolve to null when imported server side. This makes the module
364
- // safe to import in an isomorphic code base.
365
- resolve(null);
366
- return;
367
- }
368
-
369
- if (window.Stripe && params) {
370
- console.warn(EXISTING_SCRIPT_MESSAGE);
371
- }
372
-
373
- if (window.Stripe) {
374
- resolve(window.Stripe);
375
- return;
376
- }
377
-
378
- try {
379
- var script = findScript();
380
-
381
- if (script && params) {
382
- console.warn(EXISTING_SCRIPT_MESSAGE);
383
- } else if (!script) {
384
- script = injectScript(params);
385
- }
386
-
387
- script.addEventListener('load', function () {
388
- if (window.Stripe) {
389
- resolve(window.Stripe);
390
- } else {
391
- reject(new Error('Stripe.js not available'));
392
- }
393
- });
394
- script.addEventListener('error', function () {
395
- reject(new Error('Failed to load Stripe.js'));
396
- });
397
- } catch (error) {
398
- reject(error);
399
- return;
400
- }
401
- });
402
- return stripePromise;
403
- };
404
- var initStripe = function initStripe(maybeStripe, args, startTime) {
405
- if (maybeStripe === null) {
406
- return null;
407
- }
408
-
409
- var stripe = maybeStripe.apply(undefined, args);
410
- registerWrapper(stripe, startTime);
411
- return stripe;
412
- }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
413
-
414
- // own script injection.
415
-
416
- var stripePromise$1 = Promise.resolve().then(function () {
417
- return loadScript(null);
418
- });
419
- var loadCalled = false;
420
- stripePromise$1["catch"](function (err) {
421
- if (!loadCalled) {
422
- console.warn(err);
423
- }
424
- });
425
- var loadStripe = function loadStripe() {
426
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
427
- args[_key] = arguments[_key];
428
- }
429
-
430
- loadCalled = true;
431
- var startTime = Date.now();
432
- return stripePromise$1.then(function (maybeStripe) {
433
- return initStripe(maybeStripe, args, startTime);
434
- });
435
- };
436
-
437
- const getPlatforms = (win) => setupPlatforms(win);
438
- const setupPlatforms = (win = window) => {
439
- if (typeof win === 'undefined') {
440
- return [];
441
- }
442
- win.Ionic = win.Ionic || {};
443
- let platforms = win.Ionic.platforms;
444
- if (platforms == null) {
445
- platforms = win.Ionic.platforms = detectPlatforms(win);
446
- platforms.forEach(p => win.document.documentElement.classList.add(`plt-${p}`));
447
- }
448
- return platforms;
449
- };
450
- const detectPlatforms = (win) => Object.keys(PLATFORMS_MAP).filter(p => PLATFORMS_MAP[p](win));
451
- const isMobileWeb = (win) => isMobile(win) && !isHybrid(win);
452
- const isIpad = (win) => {
453
- // iOS 12 and below
454
- if (testUserAgent(win, /iPad/i)) {
455
- return true;
456
- }
457
- // iOS 13+
458
- if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {
459
- return true;
460
- }
461
- return false;
462
- };
463
- const isIphone = (win) => testUserAgent(win, /iPhone/i);
464
- const isIOS = (win) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win);
465
- const isAndroid = (win) => testUserAgent(win, /android|sink/i);
466
- const isAndroidTablet = (win) => {
467
- return isAndroid(win) && !testUserAgent(win, /mobile/i);
468
- };
469
- const isPhablet = (win) => {
470
- const width = win.innerWidth;
471
- const height = win.innerHeight;
472
- const smallest = Math.min(width, height);
473
- const largest = Math.max(width, height);
474
- return smallest > 390 && smallest < 520 && largest > 620 && largest < 800;
475
- };
476
- const isTablet = (win) => {
477
- const width = win.innerWidth;
478
- const height = win.innerHeight;
479
- const smallest = Math.min(width, height);
480
- const largest = Math.max(width, height);
481
- return isIpad(win) || isAndroidTablet(win) || (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400);
482
- };
483
- const isMobile = (win) => matchMedia(win, '(any-pointer:coarse)');
484
- const isDesktop = (win) => !isMobile(win);
485
- const isHybrid = (win) => isCordova(win) || isCapacitorNative(win);
486
- const isCordova = (win) => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']);
487
- const isCapacitorNative = (win) => {
488
- const capacitor = win['Capacitor'];
489
- return !!(capacitor && capacitor.isNative);
490
- };
491
- const isElectron = (win) => testUserAgent(win, /electron/i);
492
- const isPWA = (win) => !!(win.matchMedia('(display-mode: standalone)').matches || win.navigator.standalone);
493
- const testUserAgent = (win, expr) => expr.test(win.navigator.userAgent);
494
- const matchMedia = (win, query) => win.matchMedia(query).matches;
495
- const PLATFORMS_MAP = {
496
- ipad: isIpad,
497
- iphone: isIphone,
498
- ios: isIOS,
499
- android: isAndroid,
500
- phablet: isPhablet,
501
- tablet: isTablet,
502
- cordova: isCordova,
503
- capacitor: isCapacitorNative,
504
- electron: isElectron,
505
- pwa: isPWA,
506
- mobile: isMobile,
507
- mobileweb: isMobileWeb,
508
- desktop: isDesktop,
509
- hybrid: isHybrid,
510
- };
511
-
512
- const checkPlatform = () => {
513
- const device = getPlatforms();
514
- if (device.includes('ios')) {
515
- return 'ios';
516
- }
517
- if (device.includes('android')) {
518
- return 'android';
519
- }
520
- };
521
- const waitForElm = (el, selector) => {
522
- return new Promise(resolve => {
523
- if (el.querySelector(selector)) {
524
- return resolve(el.querySelector(selector));
525
- }
526
- const observer = new MutationObserver(() => {
527
- if (el.querySelector(selector)) {
528
- resolve(el.querySelector(selector));
529
- observer.disconnect();
530
- }
531
- });
532
- observer.observe(el, {
533
- childList: true,
534
- subtree: true
535
- });
536
- });
537
- };
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { l as loadStripe, d as defineCustomElement$1 } from './stripe-payment-request-button2.js';
3
+ import { w as waitForElm, c as checkPlatform } from './utils.js';
538
4
 
539
5
  function _typeof(obj) {
540
6
  "@babel/helpers - typeof";
@@ -546,44 +12,26 @@ function _typeof(obj) {
546
12
  }, _typeof(obj);
547
13
  }
548
14
 
549
- function _defineProperty(obj, key, value) {
550
- if (key in obj) {
551
- Object.defineProperty(obj, key, {
552
- value: value,
553
- enumerable: true,
554
- configurable: true,
555
- writable: true
556
- });
557
- } else {
558
- obj[key] = value;
15
+ function _classCallCheck(instance, Constructor) {
16
+ if (!(instance instanceof Constructor)) {
17
+ throw new TypeError("Cannot call a class as a function");
559
18
  }
560
-
561
- return obj;
562
19
  }
563
20
 
564
- function _objectSpread(target) {
565
- for (var i = 1; i < arguments.length; i++) {
566
- var source = arguments[i] != null ? Object(arguments[i]) : {};
567
- var ownKeys = Object.keys(source);
568
-
569
- if (typeof Object.getOwnPropertySymbols === 'function') {
570
- ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function (sym) {
571
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
572
- }));
573
- }
574
-
575
- ownKeys.forEach(function (key) {
576
- _defineProperty(target, key, source[key]);
577
- });
21
+ function _toPrimitive(input, hint) {
22
+ if (_typeof(input) !== "object" || input === null) return input;
23
+ var prim = input[Symbol.toPrimitive];
24
+ if (prim !== undefined) {
25
+ var res = prim.call(input, hint || "default");
26
+ if (_typeof(res) !== "object") return res;
27
+ throw new TypeError("@@toPrimitive must return a primitive value.");
578
28
  }
579
-
580
- return target;
29
+ return (hint === "string" ? String : Number)(input);
581
30
  }
582
31
 
583
- function _classCallCheck(instance, Constructor) {
584
- if (!(instance instanceof Constructor)) {
585
- throw new TypeError("Cannot call a class as a function");
586
- }
32
+ function _toPropertyKey(arg) {
33
+ var key = _toPrimitive(arg, "string");
34
+ return _typeof(key) === "symbol" ? key : String(key);
587
35
  }
588
36
 
589
37
  function _defineProperties(target, props) {
@@ -592,10 +40,9 @@ function _defineProperties(target, props) {
592
40
  descriptor.enumerable = descriptor.enumerable || false;
593
41
  descriptor.configurable = true;
594
42
  if ("value" in descriptor) descriptor.writable = true;
595
- Object.defineProperty(target, descriptor.key, descriptor);
43
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
596
44
  }
597
45
  }
598
-
599
46
  function _createClass(Constructor, protoProps, staticProps) {
600
47
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
601
48
  if (staticProps) _defineProperties(Constructor, staticProps);
@@ -609,27 +56,9 @@ function _assertThisInitialized(self) {
609
56
  if (self === void 0) {
610
57
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
611
58
  }
612
-
613
59
  return self;
614
60
  }
615
61
 
616
- function _possibleConstructorReturn(self, call) {
617
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
618
- return call;
619
- } else if (call !== void 0) {
620
- throw new TypeError("Derived constructors may only return object or undefined");
621
- }
622
-
623
- return _assertThisInitialized(self);
624
- }
625
-
626
- function _getPrototypeOf(o) {
627
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
628
- return o.__proto__ || Object.getPrototypeOf(o);
629
- };
630
- return _getPrototypeOf(o);
631
- }
632
-
633
62
  function _setPrototypeOf(o, p) {
634
63
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
635
64
  o.__proto__ = p;
@@ -642,7 +71,6 @@ function _inherits(subClass, superClass) {
642
71
  if (typeof superClass !== "function" && superClass !== null) {
643
72
  throw new TypeError("Super expression must either be null or a function");
644
73
  }
645
-
646
74
  subClass.prototype = Object.create(superClass && superClass.prototype, {
647
75
  constructor: {
648
76
  value: subClass,
@@ -656,6 +84,70 @@ function _inherits(subClass, superClass) {
656
84
  if (superClass) _setPrototypeOf(subClass, superClass);
657
85
  }
658
86
 
87
+ function _possibleConstructorReturn(self, call) {
88
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
89
+ return call;
90
+ } else if (call !== void 0) {
91
+ throw new TypeError("Derived constructors may only return object or undefined");
92
+ }
93
+ return _assertThisInitialized(self);
94
+ }
95
+
96
+ function _getPrototypeOf(o) {
97
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
98
+ return o.__proto__ || Object.getPrototypeOf(o);
99
+ };
100
+ return _getPrototypeOf(o);
101
+ }
102
+
103
+ function _defineProperty(obj, key, value) {
104
+ key = _toPropertyKey(key);
105
+ if (key in obj) {
106
+ Object.defineProperty(obj, key, {
107
+ value: value,
108
+ enumerable: true,
109
+ configurable: true,
110
+ writable: true
111
+ });
112
+ } else {
113
+ obj[key] = value;
114
+ }
115
+ return obj;
116
+ }
117
+
118
+ function _arrayWithHoles(arr) {
119
+ if (Array.isArray(arr)) return arr;
120
+ }
121
+
122
+ function _iterableToArray(iter) {
123
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
124
+ }
125
+
126
+ function _arrayLikeToArray(arr, len) {
127
+ if (len == null || len > arr.length) len = arr.length;
128
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
129
+ return arr2;
130
+ }
131
+
132
+ function _unsupportedIterableToArray(o, minLen) {
133
+ if (!o) return;
134
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
135
+ var n = Object.prototype.toString.call(o).slice(8, -1);
136
+ if (n === "Object" && o.constructor) n = o.constructor.name;
137
+ if (n === "Map" || n === "Set") return Array.from(o);
138
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
139
+ }
140
+
141
+ function _nonIterableRest() {
142
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
143
+ }
144
+
145
+ function _toArray(arr) {
146
+ return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
147
+ }
148
+
149
+ function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
150
+ function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
659
151
  var consoleLogger = {
660
152
  type: 'logger',
661
153
  log: function log(args) {
@@ -671,16 +163,12 @@ var consoleLogger = {
671
163
  if (console && console[type]) console[type].apply(console, args);
672
164
  }
673
165
  };
674
-
675
166
  var Logger = function () {
676
167
  function Logger(concreteLogger) {
677
168
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
678
-
679
169
  _classCallCheck(this, Logger);
680
-
681
170
  this.init(concreteLogger, options);
682
171
  }
683
-
684
172
  _createClass(Logger, [{
685
173
  key: "init",
686
174
  value: function init(concreteLogger) {
@@ -701,7 +189,6 @@ var Logger = function () {
701
189
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
702
190
  args[_key] = arguments[_key];
703
191
  }
704
-
705
192
  return this.forward(args, 'log', '', true);
706
193
  }
707
194
  }, {
@@ -710,7 +197,6 @@ var Logger = function () {
710
197
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
711
198
  args[_key2] = arguments[_key2];
712
199
  }
713
-
714
200
  return this.forward(args, 'warn', '', true);
715
201
  }
716
202
  }, {
@@ -719,7 +205,6 @@ var Logger = function () {
719
205
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
720
206
  args[_key3] = arguments[_key3];
721
207
  }
722
-
723
208
  return this.forward(args, 'error', '');
724
209
  }
725
210
  }, {
@@ -728,7 +213,6 @@ var Logger = function () {
728
213
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
729
214
  args[_key4] = arguments[_key4];
730
215
  }
731
-
732
216
  return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
733
217
  }
734
218
  }, {
@@ -741,32 +225,33 @@ var Logger = function () {
741
225
  }, {
742
226
  key: "create",
743
227
  value: function create(moduleName) {
744
- return new Logger(this.logger, _objectSpread({}, {
228
+ return new Logger(this.logger, _objectSpread$6(_objectSpread$6({}, {
745
229
  prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
746
- }, this.options));
230
+ }), this.options));
231
+ }
232
+ }, {
233
+ key: "clone",
234
+ value: function clone(options) {
235
+ options = options || this.options;
236
+ options.prefix = options.prefix || this.prefix;
237
+ return new Logger(this.logger, options);
747
238
  }
748
239
  }]);
749
-
750
240
  return Logger;
751
241
  }();
752
-
753
242
  var baseLogger = new Logger();
754
243
 
755
244
  var EventEmitter = function () {
756
245
  function EventEmitter() {
757
246
  _classCallCheck(this, EventEmitter);
758
-
759
247
  this.observers = {};
760
248
  }
761
-
762
249
  _createClass(EventEmitter, [{
763
250
  key: "on",
764
251
  value: function on(events, listener) {
765
252
  var _this = this;
766
-
767
253
  events.split(' ').forEach(function (event) {
768
254
  _this.observers[event] = _this.observers[event] || [];
769
-
770
255
  _this.observers[event].push(listener);
771
256
  });
772
257
  return this;
@@ -775,12 +260,10 @@ var EventEmitter = function () {
775
260
  key: "off",
776
261
  value: function off(event, listener) {
777
262
  if (!this.observers[event]) return;
778
-
779
263
  if (!listener) {
780
264
  delete this.observers[event];
781
265
  return;
782
266
  }
783
-
784
267
  this.observers[event] = this.observers[event].filter(function (l) {
785
268
  return l !== listener;
786
269
  });
@@ -791,24 +274,20 @@ var EventEmitter = function () {
791
274
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
792
275
  args[_key - 1] = arguments[_key];
793
276
  }
794
-
795
277
  if (this.observers[event]) {
796
278
  var cloned = [].concat(this.observers[event]);
797
279
  cloned.forEach(function (observer) {
798
280
  observer.apply(void 0, args);
799
281
  });
800
282
  }
801
-
802
283
  if (this.observers['*']) {
803
284
  var _cloned = [].concat(this.observers['*']);
804
-
805
285
  _cloned.forEach(function (observer) {
806
286
  observer.apply(observer, [event].concat(args));
807
287
  });
808
288
  }
809
289
  }
810
290
  }]);
811
-
812
291
  return EventEmitter;
813
292
  }();
814
293
 
@@ -832,68 +311,56 @@ function copy(a, s, t) {
832
311
  if (s[m]) t[m] = s[m];
833
312
  });
834
313
  }
835
-
836
314
  function getLastOfPath(object, path, Empty) {
837
315
  function cleanKey(key) {
838
316
  return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;
839
317
  }
840
-
841
318
  function canNotTraverseDeeper() {
842
319
  return !object || typeof object === 'string';
843
320
  }
844
-
845
321
  var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');
846
-
847
322
  while (stack.length > 1) {
848
323
  if (canNotTraverseDeeper()) return {};
849
324
  var key = cleanKey(stack.shift());
850
325
  if (!object[key] && Empty) object[key] = new Empty();
851
-
852
326
  if (Object.prototype.hasOwnProperty.call(object, key)) {
853
327
  object = object[key];
854
328
  } else {
855
329
  object = {};
856
330
  }
857
331
  }
858
-
859
332
  if (canNotTraverseDeeper()) return {};
860
333
  return {
861
334
  obj: object,
862
335
  k: cleanKey(stack.shift())
863
336
  };
864
337
  }
865
-
866
338
  function setPath(object, path, newValue) {
867
339
  var _getLastOfPath = getLastOfPath(object, path, Object),
868
- obj = _getLastOfPath.obj,
869
- k = _getLastOfPath.k;
870
-
340
+ obj = _getLastOfPath.obj,
341
+ k = _getLastOfPath.k;
871
342
  obj[k] = newValue;
872
343
  }
873
344
  function pushPath(object, path, newValue, concat) {
874
345
  var _getLastOfPath2 = getLastOfPath(object, path, Object),
875
- obj = _getLastOfPath2.obj,
876
- k = _getLastOfPath2.k;
877
-
346
+ obj = _getLastOfPath2.obj,
347
+ k = _getLastOfPath2.k;
878
348
  obj[k] = obj[k] || [];
879
349
  if (concat) obj[k] = obj[k].concat(newValue);
880
350
  if (!concat) obj[k].push(newValue);
881
351
  }
882
352
  function getPath(object, path) {
883
353
  var _getLastOfPath3 = getLastOfPath(object, path),
884
- obj = _getLastOfPath3.obj,
885
- k = _getLastOfPath3.k;
886
-
354
+ obj = _getLastOfPath3.obj,
355
+ k = _getLastOfPath3.k;
887
356
  if (!obj) return undefined;
888
357
  return obj[k];
889
358
  }
890
359
  function getPathWithDefaults(data, defaultData, key) {
891
360
  var value = getPath(data, key);
892
-
893
361
  if (value !== undefined) {
894
362
  return value;
895
363
  }
896
-
897
364
  return getPath(defaultData, key);
898
365
  }
899
366
  function deepExtend(target, source, overwrite) {
@@ -910,7 +377,6 @@ function deepExtend(target, source, overwrite) {
910
377
  }
911
378
  }
912
379
  }
913
-
914
380
  return target;
915
381
  }
916
382
  function regexEscape(str) {
@@ -930,83 +396,92 @@ function escape(data) {
930
396
  return _entityMap[s];
931
397
  });
932
398
  }
933
-
934
399
  return data;
935
400
  }
936
- var isIE10 = typeof window !== 'undefined' && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;
937
-
401
+ var isIE10 = typeof window !== 'undefined' && window.navigator && typeof window.navigator.userAgentData === 'undefined' && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;
402
+ var chars = [' ', ',', '?', '!', ';'];
403
+ function looksLikeObjectPath(key, nsSeparator, keySeparator) {
404
+ nsSeparator = nsSeparator || '';
405
+ keySeparator = keySeparator || '';
406
+ var possibleChars = chars.filter(function (c) {
407
+ return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0;
408
+ });
409
+ if (possibleChars.length === 0) return true;
410
+ var r = new RegExp("(".concat(possibleChars.map(function (c) {
411
+ return c === '?' ? '\\?' : c;
412
+ }).join('|'), ")"));
413
+ var matched = !r.test(key);
414
+ if (!matched) {
415
+ var ki = key.indexOf(keySeparator);
416
+ if (ki > 0 && !r.test(key.substring(0, ki))) {
417
+ matched = true;
418
+ }
419
+ }
420
+ return matched;
421
+ }
938
422
  function deepFind(obj, path) {
939
423
  var keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
940
424
  if (!obj) return undefined;
941
425
  if (obj[path]) return obj[path];
942
426
  var paths = path.split(keySeparator);
943
427
  var current = obj;
944
-
945
428
  for (var i = 0; i < paths.length; ++i) {
946
429
  if (!current) return undefined;
947
-
948
430
  if (typeof current[paths[i]] === 'string' && i + 1 < paths.length) {
949
431
  return undefined;
950
432
  }
951
-
952
433
  if (current[paths[i]] === undefined) {
953
434
  var j = 2;
954
435
  var p = paths.slice(i, i + j).join(keySeparator);
955
436
  var mix = current[p];
956
-
957
437
  while (mix === undefined && paths.length > i + j) {
958
438
  j++;
959
439
  p = paths.slice(i, i + j).join(keySeparator);
960
440
  mix = current[p];
961
441
  }
962
-
963
442
  if (mix === undefined) return undefined;
964
- if (typeof mix === 'string') return mix;
965
- if (p && typeof mix[p] === 'string') return mix[p];
443
+ if (mix === null) return null;
444
+ if (path.endsWith(p)) {
445
+ if (typeof mix === 'string') return mix;
446
+ if (p && typeof mix[p] === 'string') return mix[p];
447
+ }
966
448
  var joinedPath = paths.slice(i + j).join(keySeparator);
967
449
  if (joinedPath) return deepFind(mix, joinedPath, keySeparator);
968
450
  return undefined;
969
451
  }
970
-
971
452
  current = current[paths[i]];
972
453
  }
973
-
974
454
  return current;
975
455
  }
976
456
 
457
+ function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
458
+ function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
459
+ function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
460
+ function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
977
461
  var ResourceStore = function (_EventEmitter) {
978
462
  _inherits(ResourceStore, _EventEmitter);
979
-
463
+ var _super = _createSuper$3(ResourceStore);
980
464
  function ResourceStore(data) {
981
465
  var _this;
982
-
983
466
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
984
467
  ns: ['translation'],
985
468
  defaultNS: 'translation'
986
469
  };
987
-
988
470
  _classCallCheck(this, ResourceStore);
989
-
990
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ResourceStore).call(this));
991
-
471
+ _this = _super.call(this);
992
472
  if (isIE10) {
993
473
  EventEmitter.call(_assertThisInitialized(_this));
994
474
  }
995
-
996
475
  _this.data = data || {};
997
476
  _this.options = options;
998
-
999
477
  if (_this.options.keySeparator === undefined) {
1000
478
  _this.options.keySeparator = '.';
1001
479
  }
1002
-
1003
480
  if (_this.options.ignoreJSONStructure === undefined) {
1004
481
  _this.options.ignoreJSONStructure = true;
1005
482
  }
1006
-
1007
483
  return _this;
1008
484
  }
1009
-
1010
485
  _createClass(ResourceStore, [{
1011
486
  key: "addNamespaces",
1012
487
  value: function addNamespaces(ns) {
@@ -1018,7 +493,6 @@ var ResourceStore = function (_EventEmitter) {
1018
493
  key: "removeNamespaces",
1019
494
  value: function removeNamespaces(ns) {
1020
495
  var index = this.options.ns.indexOf(ns);
1021
-
1022
496
  if (index > -1) {
1023
497
  this.options.ns.splice(index, 1);
1024
498
  }
@@ -1032,11 +506,9 @@ var ResourceStore = function (_EventEmitter) {
1032
506
  var path = [lng, ns];
1033
507
  if (key && typeof key !== 'string') path = path.concat(key);
1034
508
  if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);
1035
-
1036
509
  if (lng.indexOf('.') > -1) {
1037
510
  path = lng.split('.');
1038
511
  }
1039
-
1040
512
  var result = getPath(this.data, path);
1041
513
  if (result || !ignoreJSONStructure || typeof key !== 'string') return result;
1042
514
  return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
@@ -1047,17 +519,14 @@ var ResourceStore = function (_EventEmitter) {
1047
519
  var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
1048
520
  silent: false
1049
521
  };
1050
- var keySeparator = this.options.keySeparator;
1051
- if (keySeparator === undefined) keySeparator = '.';
522
+ var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
1052
523
  var path = [lng, ns];
1053
524
  if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
1054
-
1055
525
  if (lng.indexOf('.') > -1) {
1056
526
  path = lng.split('.');
1057
527
  value = ns;
1058
528
  ns = path[1];
1059
529
  }
1060
-
1061
530
  this.addNamespaces(ns);
1062
531
  setPath(this.data, path, value);
1063
532
  if (!options.silent) this.emit('added', lng, ns, key, value);
@@ -1068,13 +537,11 @@ var ResourceStore = function (_EventEmitter) {
1068
537
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
1069
538
  silent: false
1070
539
  };
1071
-
1072
540
  for (var m in resources) {
1073
541
  if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {
1074
542
  silent: true
1075
543
  });
1076
544
  }
1077
-
1078
545
  if (!options.silent) this.emit('added', lng, ns, resources);
1079
546
  }
1080
547
  }, {
@@ -1084,23 +551,19 @@ var ResourceStore = function (_EventEmitter) {
1084
551
  silent: false
1085
552
  };
1086
553
  var path = [lng, ns];
1087
-
1088
554
  if (lng.indexOf('.') > -1) {
1089
555
  path = lng.split('.');
1090
556
  deep = resources;
1091
557
  resources = ns;
1092
558
  ns = path[1];
1093
559
  }
1094
-
1095
560
  this.addNamespaces(ns);
1096
561
  var pack = getPath(this.data, path) || {};
1097
-
1098
562
  if (deep) {
1099
563
  deepExtend(pack, resources, overwrite);
1100
564
  } else {
1101
- pack = _objectSpread({}, pack, resources);
565
+ pack = _objectSpread$5(_objectSpread$5({}, pack), resources);
1102
566
  }
1103
-
1104
567
  setPath(this.data, path, pack);
1105
568
  if (!options.silent) this.emit('added', lng, ns, resources);
1106
569
  }
@@ -1110,7 +573,6 @@ var ResourceStore = function (_EventEmitter) {
1110
573
  if (this.hasResourceBundle(lng, ns)) {
1111
574
  delete this.data[lng][ns];
1112
575
  }
1113
-
1114
576
  this.removeNamespaces(ns);
1115
577
  this.emit('removed', lng, ns);
1116
578
  }
@@ -1123,7 +585,7 @@ var ResourceStore = function (_EventEmitter) {
1123
585
  key: "getResourceBundle",
1124
586
  value: function getResourceBundle(lng, ns) {
1125
587
  if (!ns) ns = this.options.defaultNS;
1126
- if (this.options.compatibilityAPI === 'v1') return _objectSpread({}, {}, this.getResource(lng, ns));
588
+ if (this.options.compatibilityAPI === 'v1') return _objectSpread$5(_objectSpread$5({}, {}), this.getResource(lng, ns));
1127
589
  return this.getResource(lng, ns);
1128
590
  }
1129
591
  }, {
@@ -1131,13 +593,21 @@ var ResourceStore = function (_EventEmitter) {
1131
593
  value: function getDataByLanguage(lng) {
1132
594
  return this.data[lng];
1133
595
  }
596
+ }, {
597
+ key: "hasLanguageSomeTranslations",
598
+ value: function hasLanguageSomeTranslations(lng) {
599
+ var data = this.getDataByLanguage(lng);
600
+ var n = data && Object.keys(data) || [];
601
+ return !!n.find(function (v) {
602
+ return data[v] && Object.keys(data[v]).length > 0;
603
+ });
604
+ }
1134
605
  }, {
1135
606
  key: "toJSON",
1136
607
  value: function toJSON() {
1137
608
  return this.data;
1138
609
  }
1139
610
  }]);
1140
-
1141
611
  return ResourceStore;
1142
612
  }(EventEmitter);
1143
613
 
@@ -1148,7 +618,6 @@ var postProcessor = {
1148
618
  },
1149
619
  handle: function handle(processors, value, key, options, translator) {
1150
620
  var _this = this;
1151
-
1152
621
  processors.forEach(function (processor) {
1153
622
  if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);
1154
623
  });
@@ -1156,35 +625,30 @@ var postProcessor = {
1156
625
  }
1157
626
  };
1158
627
 
628
+ function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
629
+ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
630
+ function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
631
+ function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1159
632
  var checkedLoadedFor = {};
1160
-
1161
633
  var Translator = function (_EventEmitter) {
1162
634
  _inherits(Translator, _EventEmitter);
1163
-
635
+ var _super = _createSuper$2(Translator);
1164
636
  function Translator(services) {
1165
637
  var _this;
1166
-
1167
638
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1168
-
1169
639
  _classCallCheck(this, Translator);
1170
-
1171
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Translator).call(this));
1172
-
640
+ _this = _super.call(this);
1173
641
  if (isIE10) {
1174
642
  EventEmitter.call(_assertThisInitialized(_this));
1175
643
  }
1176
-
1177
644
  copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));
1178
645
  _this.options = options;
1179
-
1180
646
  if (_this.options.keySeparator === undefined) {
1181
647
  _this.options.keySeparator = '.';
1182
648
  }
1183
-
1184
649
  _this.logger = baseLogger.create('translator');
1185
650
  return _this;
1186
651
  }
1187
-
1188
652
  _createClass(Translator, [{
1189
653
  key: "changeLanguage",
1190
654
  value: function changeLanguage(lng) {
@@ -1196,11 +660,9 @@ var Translator = function (_EventEmitter) {
1196
660
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1197
661
  interpolation: {}
1198
662
  };
1199
-
1200
663
  if (key === undefined || key === null) {
1201
664
  return false;
1202
665
  }
1203
-
1204
666
  var resolved = this.resolve(key, options);
1205
667
  return resolved && resolved.res !== undefined;
1206
668
  }
@@ -1210,23 +672,21 @@ var Translator = function (_EventEmitter) {
1210
672
  var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
1211
673
  if (nsSeparator === undefined) nsSeparator = ':';
1212
674
  var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
1213
- var namespaces = options.ns || this.options.defaultNS;
1214
-
1215
- if (nsSeparator && key.indexOf(nsSeparator) > -1) {
675
+ var namespaces = options.ns || this.options.defaultNS || [];
676
+ var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
677
+ var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
678
+ if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
1216
679
  var m = key.match(this.interpolator.nestingRegexp);
1217
-
1218
680
  if (m && m.length > 0) {
1219
681
  return {
1220
682
  key: key,
1221
683
  namespaces: namespaces
1222
684
  };
1223
685
  }
1224
-
1225
686
  var parts = key.split(nsSeparator);
1226
687
  if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
1227
688
  key = parts.join(keySeparator);
1228
689
  }
1229
-
1230
690
  if (typeof namespaces === 'string') namespaces = [namespaces];
1231
691
  return {
1232
692
  key: key,
@@ -1237,33 +697,46 @@ var Translator = function (_EventEmitter) {
1237
697
  key: "translate",
1238
698
  value: function translate(keys, options, lastKey) {
1239
699
  var _this2 = this;
1240
-
1241
700
  if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
1242
701
  options = this.options.overloadTranslationOptionHandler(arguments);
1243
702
  }
1244
-
703
+ if (_typeof(options) === 'object') options = _objectSpread$4({}, options);
1245
704
  if (!options) options = {};
1246
705
  if (keys === undefined || keys === null) return '';
1247
706
  if (!Array.isArray(keys)) keys = [String(keys)];
707
+ var returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;
1248
708
  var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
1249
-
1250
709
  var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),
1251
- key = _this$extractFromKey.key,
1252
- namespaces = _this$extractFromKey.namespaces;
1253
-
710
+ key = _this$extractFromKey.key,
711
+ namespaces = _this$extractFromKey.namespaces;
1254
712
  var namespace = namespaces[namespaces.length - 1];
1255
713
  var lng = options.lng || this.language;
1256
714
  var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
1257
-
1258
715
  if (lng && lng.toLowerCase() === 'cimode') {
1259
716
  if (appendNamespaceToCIMode) {
1260
717
  var nsSeparator = options.nsSeparator || this.options.nsSeparator;
1261
- return namespace + nsSeparator + key;
718
+ if (returnDetails) {
719
+ return {
720
+ res: "".concat(namespace).concat(nsSeparator).concat(key),
721
+ usedKey: key,
722
+ exactUsedKey: key,
723
+ usedLng: lng,
724
+ usedNS: namespace
725
+ };
726
+ }
727
+ return "".concat(namespace).concat(nsSeparator).concat(key);
728
+ }
729
+ if (returnDetails) {
730
+ return {
731
+ res: key,
732
+ usedKey: key,
733
+ exactUsedKey: key,
734
+ usedLng: lng,
735
+ usedNS: namespace
736
+ };
1262
737
  }
1263
-
1264
738
  return key;
1265
739
  }
1266
-
1267
740
  var resolved = this.resolve(keys, options);
1268
741
  var res = resolved && resolved.res;
1269
742
  var resUsedKey = resolved && resolved.usedKey || key;
@@ -1273,34 +746,34 @@ var Translator = function (_EventEmitter) {
1273
746
  var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
1274
747
  var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
1275
748
  var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';
1276
-
1277
749
  if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {
1278
750
  if (!options.returnObjects && !this.options.returnObjects) {
1279
751
  if (!this.options.returnedObjectHandler) {
1280
752
  this.logger.warn('accessing an object - but returnObjects options is not enabled!');
1281
753
  }
1282
-
1283
- return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread({}, options, {
754
+ var r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$4(_objectSpread$4({}, options), {}, {
1284
755
  ns: namespaces
1285
756
  })) : "key '".concat(key, " (").concat(this.language, ")' returned an object instead of string.");
757
+ if (returnDetails) {
758
+ resolved.res = r;
759
+ return resolved;
760
+ }
761
+ return r;
1286
762
  }
1287
-
1288
763
  if (keySeparator) {
1289
764
  var resTypeIsArray = resType === '[object Array]';
1290
765
  var copy = resTypeIsArray ? [] : {};
1291
766
  var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
1292
-
1293
767
  for (var m in res) {
1294
768
  if (Object.prototype.hasOwnProperty.call(res, m)) {
1295
769
  var deepKey = "".concat(newKeyToUse).concat(keySeparator).concat(m);
1296
- copy[m] = this.translate(deepKey, _objectSpread({}, options, {
770
+ copy[m] = this.translate(deepKey, _objectSpread$4(_objectSpread$4({}, options), {
1297
771
  joinArrays: false,
1298
772
  ns: namespaces
1299
773
  }));
1300
774
  if (copy[m] === deepKey) copy[m] = res[m];
1301
775
  }
1302
776
  }
1303
-
1304
777
  res = copy;
1305
778
  }
1306
779
  } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {
@@ -1311,36 +784,29 @@ var Translator = function (_EventEmitter) {
1311
784
  var usedKey = false;
1312
785
  var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
1313
786
  var hasDefaultValue = Translator.hasDefaultValue(options);
1314
- var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count) : '';
787
+ var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';
1315
788
  var defaultValue = options["defaultValue".concat(defaultValueSuffix)] || options.defaultValue;
1316
-
1317
789
  if (!this.isValidLookup(res) && hasDefaultValue) {
1318
790
  usedDefault = true;
1319
791
  res = defaultValue;
1320
792
  }
1321
-
1322
793
  if (!this.isValidLookup(res)) {
1323
794
  usedKey = true;
1324
795
  res = key;
1325
796
  }
1326
-
1327
797
  var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
1328
798
  var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
1329
799
  var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
1330
-
1331
800
  if (usedKey || usedDefault || updateMissing) {
1332
801
  this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
1333
-
1334
802
  if (keySeparator) {
1335
- var fk = this.resolve(key, _objectSpread({}, options, {
803
+ var fk = this.resolve(key, _objectSpread$4(_objectSpread$4({}, options), {}, {
1336
804
  keySeparator: false
1337
805
  }));
1338
806
  if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
1339
807
  }
1340
-
1341
808
  var lngs = [];
1342
809
  var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);
1343
-
1344
810
  if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
1345
811
  for (var i = 0; i < fallbackLngs.length; i++) {
1346
812
  lngs.push(fallbackLngs[i]);
@@ -1350,21 +816,19 @@ var Translator = function (_EventEmitter) {
1350
816
  } else {
1351
817
  lngs.push(options.lng || this.language);
1352
818
  }
1353
-
1354
- var send = function send(l, k, fallbackValue) {
819
+ var send = function send(l, k, specificDefaultValue) {
820
+ var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
1355
821
  if (_this2.options.missingKeyHandler) {
1356
- _this2.options.missingKeyHandler(l, namespace, k, updateMissing ? fallbackValue : resForMissing, updateMissing, options);
822
+ _this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
1357
823
  } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {
1358
- _this2.backendConnector.saveMissing(l, namespace, k, updateMissing ? fallbackValue : resForMissing, updateMissing, options);
824
+ _this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
1359
825
  }
1360
-
1361
826
  _this2.emit('missingKey', l, namespace, k, res);
1362
827
  };
1363
-
1364
828
  if (this.options.saveMissing) {
1365
829
  if (this.options.saveMissingPlurals && needsPluralHandling) {
1366
830
  lngs.forEach(function (language) {
1367
- _this2.pluralResolver.getSuffixes(language).forEach(function (suffix) {
831
+ _this2.pluralResolver.getSuffixes(language, options).forEach(function (suffix) {
1368
832
  send([language], key + suffix, options["defaultValue".concat(suffix)] || defaultValue);
1369
833
  });
1370
834
  });
@@ -1373,77 +837,74 @@ var Translator = function (_EventEmitter) {
1373
837
  }
1374
838
  }
1375
839
  }
1376
-
1377
840
  res = this.extendTranslation(res, keys, options, resolved, lastKey);
1378
841
  if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = "".concat(namespace, ":").concat(key);
1379
- if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res);
842
+ if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
843
+ if (this.options.compatibilityAPI !== 'v1') {
844
+ res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(namespace, ":").concat(key) : key, usedDefault ? res : undefined);
845
+ } else {
846
+ res = this.options.parseMissingKeyHandler(res);
847
+ }
848
+ }
849
+ }
850
+ if (returnDetails) {
851
+ resolved.res = res;
852
+ return resolved;
1380
853
  }
1381
-
1382
854
  return res;
1383
855
  }
1384
856
  }, {
1385
857
  key: "extendTranslation",
1386
858
  value: function extendTranslation(res, key, options, resolved, lastKey) {
1387
859
  var _this3 = this;
1388
-
1389
860
  if (this.i18nFormat && this.i18nFormat.parse) {
1390
- res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, {
861
+ res = this.i18nFormat.parse(res, _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), options), resolved.usedLng, resolved.usedNS, resolved.usedKey, {
1391
862
  resolved: resolved
1392
863
  });
1393
864
  } else if (!options.skipInterpolation) {
1394
- if (options.interpolation) this.interpolator.init(_objectSpread({}, options, {
1395
- interpolation: _objectSpread({}, this.options.interpolation, options.interpolation)
865
+ if (options.interpolation) this.interpolator.init(_objectSpread$4(_objectSpread$4({}, options), {
866
+ interpolation: _objectSpread$4(_objectSpread$4({}, this.options.interpolation), options.interpolation)
1396
867
  }));
1397
- var skipOnVariables = options.interpolation && options.interpolation.skipOnVariables || this.options.interpolation.skipOnVariables;
868
+ var skipOnVariables = typeof res === 'string' && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
1398
869
  var nestBef;
1399
-
1400
870
  if (skipOnVariables) {
1401
871
  var nb = res.match(this.interpolator.nestingRegexp);
1402
872
  nestBef = nb && nb.length;
1403
873
  }
1404
-
1405
874
  var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;
1406
- if (this.options.interpolation.defaultVariables) data = _objectSpread({}, this.options.interpolation.defaultVariables, data);
875
+ if (this.options.interpolation.defaultVariables) data = _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), data);
1407
876
  res = this.interpolator.interpolate(res, data, options.lng || this.language, options);
1408
-
1409
877
  if (skipOnVariables) {
1410
878
  var na = res.match(this.interpolator.nestingRegexp);
1411
879
  var nestAft = na && na.length;
1412
880
  if (nestBef < nestAft) options.nest = false;
1413
881
  }
1414
-
882
+ if (!options.lng && this.options.compatibilityAPI !== 'v1' && resolved && resolved.res) options.lng = resolved.usedLng;
1415
883
  if (options.nest !== false) res = this.interpolator.nest(res, function () {
1416
884
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1417
885
  args[_key] = arguments[_key];
1418
886
  }
1419
-
1420
887
  if (lastKey && lastKey[0] === args[0] && !options.context) {
1421
888
  _this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
1422
-
1423
889
  return null;
1424
890
  }
1425
-
1426
891
  return _this3.translate.apply(_this3, args.concat([key]));
1427
892
  }, options);
1428
893
  if (options.interpolation) this.interpolator.reset();
1429
894
  }
1430
-
1431
895
  var postProcess = options.postProcess || this.options.postProcess;
1432
896
  var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;
1433
-
1434
897
  if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
1435
- res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread({
898
+ res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread$4({
1436
899
  i18nResolved: resolved
1437
900
  }, options) : options, this);
1438
901
  }
1439
-
1440
902
  return res;
1441
903
  }
1442
904
  }, {
1443
905
  key: "resolve",
1444
906
  value: function resolve(keys) {
1445
907
  var _this4 = this;
1446
-
1447
908
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1448
909
  var found;
1449
910
  var usedKey;
@@ -1453,44 +914,50 @@ var Translator = function (_EventEmitter) {
1453
914
  if (typeof keys === 'string') keys = [keys];
1454
915
  keys.forEach(function (k) {
1455
916
  if (_this4.isValidLookup(found)) return;
1456
-
1457
917
  var extracted = _this4.extractFromKey(k, options);
1458
-
1459
918
  var key = extracted.key;
1460
919
  usedKey = key;
1461
920
  var namespaces = extracted.namespaces;
1462
921
  if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);
1463
922
  var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
923
+ var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi();
1464
924
  var needsContextHandling = options.context !== undefined && (typeof options.context === 'string' || typeof options.context === 'number') && options.context !== '';
1465
925
  var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);
1466
926
  namespaces.forEach(function (ns) {
1467
927
  if (_this4.isValidLookup(found)) return;
1468
928
  usedNS = ns;
1469
-
1470
929
  if (!checkedLoadedFor["".concat(codes[0], "-").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {
1471
930
  checkedLoadedFor["".concat(codes[0], "-").concat(ns)] = true;
1472
-
1473
931
  _this4.logger.warn("key \"".concat(usedKey, "\" for languages \"").concat(codes.join(', '), "\" won't get resolved as namespace \"").concat(usedNS, "\" was not yet loaded"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
1474
932
  }
1475
-
1476
933
  codes.forEach(function (code) {
1477
934
  if (_this4.isValidLookup(found)) return;
1478
935
  usedLng = code;
1479
- var finalKey = key;
1480
- var finalKeys = [finalKey];
1481
-
936
+ var finalKeys = [key];
1482
937
  if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {
1483
938
  _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
1484
939
  } else {
1485
940
  var pluralSuffix;
1486
- if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count);
1487
- if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix);
1488
- if (needsContextHandling) finalKeys.push(finalKey += "".concat(_this4.options.contextSeparator).concat(options.context));
1489
- if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix);
941
+ if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options);
942
+ var zeroSuffix = "".concat(_this4.options.pluralSeparator, "zero");
943
+ if (needsPluralHandling) {
944
+ finalKeys.push(key + pluralSuffix);
945
+ if (needsZeroSuffixLookup) {
946
+ finalKeys.push(key + zeroSuffix);
947
+ }
948
+ }
949
+ if (needsContextHandling) {
950
+ var contextKey = "".concat(key).concat(_this4.options.contextSeparator).concat(options.context);
951
+ finalKeys.push(contextKey);
952
+ if (needsPluralHandling) {
953
+ finalKeys.push(contextKey + pluralSuffix);
954
+ if (needsZeroSuffixLookup) {
955
+ finalKeys.push(contextKey + zeroSuffix);
956
+ }
957
+ }
958
+ }
1490
959
  }
1491
-
1492
960
  var possibleKey;
1493
-
1494
961
  while (possibleKey = finalKeys.pop()) {
1495
962
  if (!_this4.isValidLookup(found)) {
1496
963
  exactUsedKey = possibleKey;
@@ -1524,34 +991,27 @@ var Translator = function (_EventEmitter) {
1524
991
  key: "hasDefaultValue",
1525
992
  value: function hasDefaultValue(options) {
1526
993
  var prefix = 'defaultValue';
1527
-
1528
994
  for (var option in options) {
1529
995
  if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
1530
996
  return true;
1531
997
  }
1532
998
  }
1533
-
1534
999
  return false;
1535
1000
  }
1536
1001
  }]);
1537
-
1538
1002
  return Translator;
1539
1003
  }(EventEmitter);
1540
1004
 
1541
1005
  function capitalize(string) {
1542
1006
  return string.charAt(0).toUpperCase() + string.slice(1);
1543
1007
  }
1544
-
1545
1008
  var LanguageUtil = function () {
1546
1009
  function LanguageUtil(options) {
1547
1010
  _classCallCheck(this, LanguageUtil);
1548
-
1549
1011
  this.options = options;
1550
- this.whitelist = this.options.supportedLngs || false;
1551
1012
  this.supportedLngs = this.options.supportedLngs || false;
1552
1013
  this.logger = baseLogger.create('languageUtils');
1553
1014
  }
1554
-
1555
1015
  _createClass(LanguageUtil, [{
1556
1016
  key: "getScriptPartFromCode",
1557
1017
  value: function getScriptPartFromCode(code) {
@@ -1575,7 +1035,6 @@ var LanguageUtil = function () {
1575
1035
  if (typeof code === 'string' && code.indexOf('-') > -1) {
1576
1036
  var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];
1577
1037
  var p = code.split('-');
1578
-
1579
1038
  if (this.options.lowerCaseLng) {
1580
1039
  p = p.map(function (part) {
1581
1040
  return part.toLowerCase();
@@ -1591,55 +1050,41 @@ var LanguageUtil = function () {
1591
1050
  if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
1592
1051
  if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
1593
1052
  }
1594
-
1595
1053
  return p.join('-');
1596
1054
  }
1597
-
1598
1055
  return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
1599
1056
  }
1600
- }, {
1601
- key: "isWhitelisted",
1602
- value: function isWhitelisted(code) {
1603
- this.logger.deprecate('languageUtils.isWhitelisted', 'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.');
1604
- return this.isSupportedCode(code);
1605
- }
1606
1057
  }, {
1607
1058
  key: "isSupportedCode",
1608
1059
  value: function isSupportedCode(code) {
1609
1060
  if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
1610
1061
  code = this.getLanguagePartFromCode(code);
1611
1062
  }
1612
-
1613
1063
  return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
1614
1064
  }
1615
1065
  }, {
1616
1066
  key: "getBestMatchFromCodes",
1617
1067
  value: function getBestMatchFromCodes(codes) {
1618
1068
  var _this = this;
1619
-
1620
1069
  if (!codes) return null;
1621
1070
  var found;
1622
1071
  codes.forEach(function (code) {
1623
1072
  if (found) return;
1624
-
1625
1073
  var cleanedLng = _this.formatLanguageCode(code);
1626
-
1627
1074
  if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;
1628
1075
  });
1629
-
1630
1076
  if (!found && this.options.supportedLngs) {
1631
1077
  codes.forEach(function (code) {
1632
1078
  if (found) return;
1633
-
1634
1079
  var lngOnly = _this.getLanguagePartFromCode(code);
1635
-
1636
1080
  if (_this.isSupportedCode(lngOnly)) return found = lngOnly;
1637
1081
  found = _this.options.supportedLngs.find(function (supportedLng) {
1082
+ if (supportedLng === lngOnly) return supportedLng;
1083
+ if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
1638
1084
  if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;
1639
1085
  });
1640
1086
  });
1641
1087
  }
1642
-
1643
1088
  if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
1644
1089
  return found;
1645
1090
  }
@@ -1662,20 +1107,16 @@ var LanguageUtil = function () {
1662
1107
  key: "toResolveHierarchy",
1663
1108
  value: function toResolveHierarchy(code, fallbackCode) {
1664
1109
  var _this2 = this;
1665
-
1666
1110
  var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
1667
1111
  var codes = [];
1668
-
1669
1112
  var addCode = function addCode(c) {
1670
1113
  if (!c) return;
1671
-
1672
1114
  if (_this2.isSupportedCode(c)) {
1673
1115
  codes.push(c);
1674
1116
  } else {
1675
1117
  _this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c));
1676
1118
  }
1677
1119
  };
1678
-
1679
1120
  if (typeof code === 'string' && code.indexOf('-') > -1) {
1680
1121
  if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
1681
1122
  if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
@@ -1683,14 +1124,12 @@ var LanguageUtil = function () {
1683
1124
  } else if (typeof code === 'string') {
1684
1125
  addCode(this.formatLanguageCode(code));
1685
1126
  }
1686
-
1687
1127
  fallbackCodes.forEach(function (fc) {
1688
1128
  if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));
1689
1129
  });
1690
1130
  return codes;
1691
1131
  }
1692
1132
  }]);
1693
-
1694
1133
  return LanguageUtil;
1695
1134
  }();
1696
1135
 
@@ -1855,7 +1294,15 @@ var _rulesPluralsTypes = {
1855
1294
  return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);
1856
1295
  }
1857
1296
  };
1858
-
1297
+ var deprecatedJsonVersions = ['v1', 'v2', 'v3'];
1298
+ var suffixesOrder = {
1299
+ zero: 0,
1300
+ one: 1,
1301
+ two: 2,
1302
+ few: 3,
1303
+ many: 4,
1304
+ other: 5
1305
+ };
1859
1306
  function createRules() {
1860
1307
  var rules = {};
1861
1308
  sets.forEach(function (set) {
@@ -1868,19 +1315,19 @@ function createRules() {
1868
1315
  });
1869
1316
  return rules;
1870
1317
  }
1871
-
1872
1318
  var PluralResolver = function () {
1873
1319
  function PluralResolver(languageUtils) {
1874
1320
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1875
-
1876
1321
  _classCallCheck(this, PluralResolver);
1877
-
1878
1322
  this.languageUtils = languageUtils;
1879
1323
  this.options = options;
1880
1324
  this.logger = baseLogger.create('pluralResolver');
1325
+ if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === 'v4') && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
1326
+ this.options.compatibilityJSON = 'v3';
1327
+ this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');
1328
+ }
1881
1329
  this.rules = createRules();
1882
1330
  }
1883
-
1884
1331
  _createClass(PluralResolver, [{
1885
1332
  key: "addRule",
1886
1333
  value: function addRule(lng, obj) {
@@ -1889,96 +1336,129 @@ var PluralResolver = function () {
1889
1336
  }, {
1890
1337
  key: "getRule",
1891
1338
  value: function getRule(code) {
1339
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1340
+ if (this.shouldUseIntlApi()) {
1341
+ try {
1342
+ return new Intl.PluralRules(code, {
1343
+ type: options.ordinal ? 'ordinal' : 'cardinal'
1344
+ });
1345
+ } catch (_unused) {
1346
+ return;
1347
+ }
1348
+ }
1892
1349
  return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
1893
1350
  }
1894
1351
  }, {
1895
1352
  key: "needsPlural",
1896
1353
  value: function needsPlural(code) {
1897
- var rule = this.getRule(code);
1354
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1355
+ var rule = this.getRule(code, options);
1356
+ if (this.shouldUseIntlApi()) {
1357
+ return rule && rule.resolvedOptions().pluralCategories.length > 1;
1358
+ }
1898
1359
  return rule && rule.numbers.length > 1;
1899
1360
  }
1900
1361
  }, {
1901
1362
  key: "getPluralFormsOfKey",
1902
1363
  value: function getPluralFormsOfKey(code, key) {
1903
- return this.getSuffixes(code).map(function (suffix) {
1904
- return key + suffix;
1364
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1365
+ return this.getSuffixes(code, options).map(function (suffix) {
1366
+ return "".concat(key).concat(suffix);
1905
1367
  });
1906
1368
  }
1907
1369
  }, {
1908
1370
  key: "getSuffixes",
1909
1371
  value: function getSuffixes(code) {
1910
1372
  var _this = this;
1911
-
1912
- var rule = this.getRule(code);
1913
-
1373
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1374
+ var rule = this.getRule(code, options);
1914
1375
  if (!rule) {
1915
1376
  return [];
1916
1377
  }
1917
-
1378
+ if (this.shouldUseIntlApi()) {
1379
+ return rule.resolvedOptions().pluralCategories.sort(function (pluralCategory1, pluralCategory2) {
1380
+ return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];
1381
+ }).map(function (pluralCategory) {
1382
+ return "".concat(_this.options.prepend).concat(pluralCategory);
1383
+ });
1384
+ }
1918
1385
  return rule.numbers.map(function (number) {
1919
- return _this.getSuffix(code, number);
1386
+ return _this.getSuffix(code, number, options);
1920
1387
  });
1921
1388
  }
1922
1389
  }, {
1923
1390
  key: "getSuffix",
1924
1391
  value: function getSuffix(code, count) {
1925
- var _this2 = this;
1926
-
1927
- var rule = this.getRule(code);
1928
-
1392
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1393
+ var rule = this.getRule(code, options);
1929
1394
  if (rule) {
1930
- var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
1931
- var suffix = rule.numbers[idx];
1932
-
1933
- if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
1934
- if (suffix === 2) {
1935
- suffix = 'plural';
1936
- } else if (suffix === 1) {
1937
- suffix = '';
1938
- }
1939
- }
1940
-
1941
- var returnSuffix = function returnSuffix() {
1942
- return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();
1943
- };
1944
-
1945
- if (this.options.compatibilityJSON === 'v1') {
1946
- if (suffix === 1) return '';
1947
- if (typeof suffix === 'number') return "_plural_".concat(suffix.toString());
1948
- return returnSuffix();
1949
- } else if (this.options.compatibilityJSON === 'v2') {
1950
- return returnSuffix();
1951
- } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
1952
- return returnSuffix();
1395
+ if (this.shouldUseIntlApi()) {
1396
+ return "".concat(this.options.prepend).concat(rule.select(count));
1953
1397
  }
1954
-
1955
- return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
1398
+ return this.getSuffixRetroCompatible(rule, count);
1956
1399
  }
1957
-
1958
1400
  this.logger.warn("no plural rule found for: ".concat(code));
1959
1401
  return '';
1960
1402
  }
1403
+ }, {
1404
+ key: "getSuffixRetroCompatible",
1405
+ value: function getSuffixRetroCompatible(rule, count) {
1406
+ var _this2 = this;
1407
+ var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
1408
+ var suffix = rule.numbers[idx];
1409
+ if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
1410
+ if (suffix === 2) {
1411
+ suffix = 'plural';
1412
+ } else if (suffix === 1) {
1413
+ suffix = '';
1414
+ }
1415
+ }
1416
+ var returnSuffix = function returnSuffix() {
1417
+ return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();
1418
+ };
1419
+ if (this.options.compatibilityJSON === 'v1') {
1420
+ if (suffix === 1) return '';
1421
+ if (typeof suffix === 'number') return "_plural_".concat(suffix.toString());
1422
+ return returnSuffix();
1423
+ } else if (this.options.compatibilityJSON === 'v2') {
1424
+ return returnSuffix();
1425
+ } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
1426
+ return returnSuffix();
1427
+ }
1428
+ return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
1429
+ }
1430
+ }, {
1431
+ key: "shouldUseIntlApi",
1432
+ value: function shouldUseIntlApi() {
1433
+ return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);
1434
+ }
1961
1435
  }]);
1962
-
1963
1436
  return PluralResolver;
1964
1437
  }();
1965
1438
 
1439
+ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1440
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1441
+ function deepFindWithDefaults(data, defaultData, key) {
1442
+ var keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
1443
+ var ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
1444
+ var path = getPathWithDefaults(data, defaultData, key);
1445
+ if (!path && ignoreJSONStructure && typeof key === 'string') {
1446
+ path = deepFind(data, key, keySeparator);
1447
+ if (path === undefined) path = deepFind(defaultData, key, keySeparator);
1448
+ }
1449
+ return path;
1450
+ }
1966
1451
  var Interpolator = function () {
1967
1452
  function Interpolator() {
1968
1453
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1969
-
1970
1454
  _classCallCheck(this, Interpolator);
1971
-
1972
1455
  this.logger = baseLogger.create('interpolator');
1973
1456
  this.options = options;
1974
-
1975
1457
  this.format = options.interpolation && options.interpolation.format || function (value) {
1976
1458
  return value;
1977
1459
  };
1978
-
1979
1460
  this.init(options);
1980
1461
  }
1981
-
1982
1462
  _createClass(Interpolator, [{
1983
1463
  key: "init",
1984
1464
  value: function init() {
@@ -2021,35 +1501,30 @@ var Interpolator = function () {
2021
1501
  key: "interpolate",
2022
1502
  value: function interpolate(str, data, lng, options) {
2023
1503
  var _this = this;
2024
-
2025
1504
  var match;
2026
1505
  var value;
2027
1506
  var replaces;
2028
1507
  var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
2029
-
2030
1508
  function regexSafe(val) {
2031
1509
  return val.replace(/\$/g, '$$$$');
2032
1510
  }
2033
-
2034
1511
  var handleFormat = function handleFormat(key) {
2035
1512
  if (key.indexOf(_this.formatSeparator) < 0) {
2036
- var path = getPathWithDefaults(data, defaultData, key);
2037
- return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread({}, options, data, {
1513
+ var path = deepFindWithDefaults(data, defaultData, key, _this.options.keySeparator, _this.options.ignoreJSONStructure);
1514
+ return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {
2038
1515
  interpolationkey: key
2039
1516
  })) : path;
2040
1517
  }
2041
-
2042
1518
  var p = key.split(_this.formatSeparator);
2043
1519
  var k = p.shift().trim();
2044
1520
  var f = p.join(_this.formatSeparator).trim();
2045
- return _this.format(getPathWithDefaults(data, defaultData, k), f, lng, _objectSpread({}, options, data, {
1521
+ return _this.format(deepFindWithDefaults(data, defaultData, k, _this.options.keySeparator, _this.options.ignoreJSONStructure), f, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {
2046
1522
  interpolationkey: k
2047
1523
  }));
2048
1524
  };
2049
-
2050
1525
  this.resetRegExp();
2051
1526
  var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
2052
- var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables || this.options.interpolation.skipOnVariables;
1527
+ var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
2053
1528
  var todos = [{
2054
1529
  regex: this.regexpUnescape,
2055
1530
  safeValue: function safeValue(val) {
@@ -2063,38 +1538,34 @@ var Interpolator = function () {
2063
1538
  }];
2064
1539
  todos.forEach(function (todo) {
2065
1540
  replaces = 0;
2066
-
2067
1541
  while (match = todo.regex.exec(str)) {
2068
- value = handleFormat(match[1].trim());
2069
-
1542
+ var matchedVar = match[1].trim();
1543
+ value = handleFormat(matchedVar);
2070
1544
  if (value === undefined) {
2071
1545
  if (typeof missingInterpolationHandler === 'function') {
2072
1546
  var temp = missingInterpolationHandler(str, match, options);
2073
1547
  value = typeof temp === 'string' ? temp : '';
1548
+ } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
1549
+ value = '';
2074
1550
  } else if (skipOnVariables) {
2075
1551
  value = match[0];
2076
1552
  continue;
2077
1553
  } else {
2078
- _this.logger.warn("missed to pass in variable ".concat(match[1], " for interpolating ").concat(str));
2079
-
1554
+ _this.logger.warn("missed to pass in variable ".concat(matchedVar, " for interpolating ").concat(str));
2080
1555
  value = '';
2081
1556
  }
2082
1557
  } else if (typeof value !== 'string' && !_this.useRawValueToEscape) {
2083
1558
  value = makeString(value);
2084
1559
  }
2085
-
2086
1560
  var safeValue = todo.safeValue(value);
2087
1561
  str = str.replace(match[0], safeValue);
2088
-
2089
1562
  if (skipOnVariables) {
2090
- todo.regex.lastIndex += safeValue.length;
1563
+ todo.regex.lastIndex += value.length;
2091
1564
  todo.regex.lastIndex -= match[0].length;
2092
1565
  } else {
2093
1566
  todo.regex.lastIndex = 0;
2094
1567
  }
2095
-
2096
1568
  replaces++;
2097
-
2098
1569
  if (replaces >= _this.maxReplaces) {
2099
1570
  break;
2100
1571
  }
@@ -2106,16 +1577,10 @@ var Interpolator = function () {
2106
1577
  key: "nest",
2107
1578
  value: function nest(str, fc) {
2108
1579
  var _this2 = this;
2109
-
2110
1580
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2111
1581
  var match;
2112
1582
  var value;
2113
-
2114
- var clonedOptions = _objectSpread({}, options);
2115
-
2116
- clonedOptions.applyPostProcessor = false;
2117
- delete clonedOptions.defaultValue;
2118
-
1583
+ var clonedOptions;
2119
1584
  function handleHasOptions(key, inheritedOptions) {
2120
1585
  var sep = this.nestingOptionsSeparator;
2121
1586
  if (key.indexOf(sep) < 0) return key;
@@ -2123,24 +1588,28 @@ var Interpolator = function () {
2123
1588
  var optionsString = "{".concat(c[1]);
2124
1589
  key = c[0];
2125
1590
  optionsString = this.interpolate(optionsString, clonedOptions);
2126
- optionsString = optionsString.replace(/'/g, '"');
2127
-
1591
+ var matchedSingleQuotes = optionsString.match(/'/g);
1592
+ var matchedDoubleQuotes = optionsString.match(/"/g);
1593
+ if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
1594
+ optionsString = optionsString.replace(/'/g, '"');
1595
+ }
2128
1596
  try {
2129
1597
  clonedOptions = JSON.parse(optionsString);
2130
- if (inheritedOptions) clonedOptions = _objectSpread({}, inheritedOptions, clonedOptions);
1598
+ if (inheritedOptions) clonedOptions = _objectSpread$3(_objectSpread$3({}, inheritedOptions), clonedOptions);
2131
1599
  } catch (e) {
2132
1600
  this.logger.warn("failed parsing options string in nesting for key ".concat(key), e);
2133
1601
  return "".concat(key).concat(sep).concat(optionsString);
2134
1602
  }
2135
-
2136
1603
  delete clonedOptions.defaultValue;
2137
1604
  return key;
2138
1605
  }
2139
-
2140
1606
  while (match = this.nestingRegexp.exec(str)) {
2141
1607
  var formatters = [];
1608
+ clonedOptions = _objectSpread$3({}, options);
1609
+ clonedOptions = clonedOptions.replace && typeof clonedOptions.replace !== 'string' ? clonedOptions.replace : clonedOptions;
1610
+ clonedOptions.applyPostProcessor = false;
1611
+ delete clonedOptions.defaultValue;
2142
1612
  var doReduce = false;
2143
-
2144
1613
  if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {
2145
1614
  var r = match[1].split(this.formatSeparator).map(function (elem) {
2146
1615
  return elem.trim();
@@ -2149,119 +1618,246 @@ var Interpolator = function () {
2149
1618
  formatters = r;
2150
1619
  doReduce = true;
2151
1620
  }
2152
-
2153
1621
  value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
2154
1622
  if (value && match[0] === str && typeof value !== 'string') return value;
2155
1623
  if (typeof value !== 'string') value = makeString(value);
2156
-
2157
1624
  if (!value) {
2158
1625
  this.logger.warn("missed to resolve ".concat(match[1], " for nesting ").concat(str));
2159
1626
  value = '';
2160
1627
  }
2161
-
2162
1628
  if (doReduce) {
2163
1629
  value = formatters.reduce(function (v, f) {
2164
- return _this2.format(v, f, options.lng, _objectSpread({}, options, {
1630
+ return _this2.format(v, f, options.lng, _objectSpread$3(_objectSpread$3({}, options), {}, {
2165
1631
  interpolationkey: match[1].trim()
2166
1632
  }));
2167
1633
  }, value.trim());
2168
1634
  }
2169
-
2170
- str = str.replace(match[0], value);
2171
- this.regexp.lastIndex = 0;
2172
- }
2173
-
2174
- return str;
1635
+ str = str.replace(match[0], value);
1636
+ this.regexp.lastIndex = 0;
1637
+ }
1638
+ return str;
1639
+ }
1640
+ }]);
1641
+ return Interpolator;
1642
+ }();
1643
+
1644
+ function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1645
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1646
+ function parseFormatStr(formatStr) {
1647
+ var formatName = formatStr.toLowerCase().trim();
1648
+ var formatOptions = {};
1649
+ if (formatStr.indexOf('(') > -1) {
1650
+ var p = formatStr.split('(');
1651
+ formatName = p[0].toLowerCase().trim();
1652
+ var optStr = p[1].substring(0, p[1].length - 1);
1653
+ if (formatName === 'currency' && optStr.indexOf(':') < 0) {
1654
+ if (!formatOptions.currency) formatOptions.currency = optStr.trim();
1655
+ } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
1656
+ if (!formatOptions.range) formatOptions.range = optStr.trim();
1657
+ } else {
1658
+ var opts = optStr.split(';');
1659
+ opts.forEach(function (opt) {
1660
+ if (!opt) return;
1661
+ var _opt$split = opt.split(':'),
1662
+ _opt$split2 = _toArray(_opt$split),
1663
+ key = _opt$split2[0],
1664
+ rest = _opt$split2.slice(1);
1665
+ var val = rest.join(':').trim().replace(/^'+|'+$/g, '');
1666
+ if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val;
1667
+ if (val === 'false') formatOptions[key.trim()] = false;
1668
+ if (val === 'true') formatOptions[key.trim()] = true;
1669
+ if (!isNaN(val)) formatOptions[key.trim()] = parseInt(val, 10);
1670
+ });
1671
+ }
1672
+ }
1673
+ return {
1674
+ formatName: formatName,
1675
+ formatOptions: formatOptions
1676
+ };
1677
+ }
1678
+ function createCachedFormatter(fn) {
1679
+ var cache = {};
1680
+ return function invokeFormatter(val, lng, options) {
1681
+ var key = lng + JSON.stringify(options);
1682
+ var formatter = cache[key];
1683
+ if (!formatter) {
1684
+ formatter = fn(lng, options);
1685
+ cache[key] = formatter;
1686
+ }
1687
+ return formatter(val);
1688
+ };
1689
+ }
1690
+ var Formatter = function () {
1691
+ function Formatter() {
1692
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1693
+ _classCallCheck(this, Formatter);
1694
+ this.logger = baseLogger.create('formatter');
1695
+ this.options = options;
1696
+ this.formats = {
1697
+ number: createCachedFormatter(function (lng, opt) {
1698
+ var formatter = new Intl.NumberFormat(lng, _objectSpread$2({}, opt));
1699
+ return function (val) {
1700
+ return formatter.format(val);
1701
+ };
1702
+ }),
1703
+ currency: createCachedFormatter(function (lng, opt) {
1704
+ var formatter = new Intl.NumberFormat(lng, _objectSpread$2(_objectSpread$2({}, opt), {}, {
1705
+ style: 'currency'
1706
+ }));
1707
+ return function (val) {
1708
+ return formatter.format(val);
1709
+ };
1710
+ }),
1711
+ datetime: createCachedFormatter(function (lng, opt) {
1712
+ var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2({}, opt));
1713
+ return function (val) {
1714
+ return formatter.format(val);
1715
+ };
1716
+ }),
1717
+ relativetime: createCachedFormatter(function (lng, opt) {
1718
+ var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2({}, opt));
1719
+ return function (val) {
1720
+ return formatter.format(val, opt.range || 'day');
1721
+ };
1722
+ }),
1723
+ list: createCachedFormatter(function (lng, opt) {
1724
+ var formatter = new Intl.ListFormat(lng, _objectSpread$2({}, opt));
1725
+ return function (val) {
1726
+ return formatter.format(val);
1727
+ };
1728
+ })
1729
+ };
1730
+ this.init(options);
1731
+ }
1732
+ _createClass(Formatter, [{
1733
+ key: "init",
1734
+ value: function init(services) {
1735
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
1736
+ interpolation: {}
1737
+ };
1738
+ var iOpts = options.interpolation;
1739
+ this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';
1740
+ }
1741
+ }, {
1742
+ key: "add",
1743
+ value: function add(name, fc) {
1744
+ this.formats[name.toLowerCase().trim()] = fc;
1745
+ }
1746
+ }, {
1747
+ key: "addCached",
1748
+ value: function addCached(name, fc) {
1749
+ this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
1750
+ }
1751
+ }, {
1752
+ key: "format",
1753
+ value: function format(value, _format, lng) {
1754
+ var _this = this;
1755
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
1756
+ var formats = _format.split(this.formatSeparator);
1757
+ var result = formats.reduce(function (mem, f) {
1758
+ var _parseFormatStr = parseFormatStr(f),
1759
+ formatName = _parseFormatStr.formatName,
1760
+ formatOptions = _parseFormatStr.formatOptions;
1761
+ if (_this.formats[formatName]) {
1762
+ var formatted = mem;
1763
+ try {
1764
+ var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
1765
+ var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
1766
+ formatted = _this.formats[formatName](mem, l, _objectSpread$2(_objectSpread$2(_objectSpread$2({}, formatOptions), options), valOptions));
1767
+ } catch (error) {
1768
+ _this.logger.warn(error);
1769
+ }
1770
+ return formatted;
1771
+ } else {
1772
+ _this.logger.warn("there was no format function for ".concat(formatName));
1773
+ }
1774
+ return mem;
1775
+ }, value);
1776
+ return result;
2175
1777
  }
2176
1778
  }]);
2177
-
2178
- return Interpolator;
1779
+ return Formatter;
2179
1780
  }();
2180
1781
 
2181
- function remove(arr, what) {
2182
- var found = arr.indexOf(what);
2183
-
2184
- while (found !== -1) {
2185
- arr.splice(found, 1);
2186
- found = arr.indexOf(what);
1782
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1783
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1784
+ function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
1785
+ function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1786
+ function removePending(q, name) {
1787
+ if (q.pending[name] !== undefined) {
1788
+ delete q.pending[name];
1789
+ q.pendingCount--;
2187
1790
  }
2188
1791
  }
2189
-
2190
1792
  var Connector = function (_EventEmitter) {
2191
1793
  _inherits(Connector, _EventEmitter);
2192
-
1794
+ var _super = _createSuper$1(Connector);
2193
1795
  function Connector(backend, store, services) {
2194
1796
  var _this;
2195
-
2196
1797
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2197
-
2198
1798
  _classCallCheck(this, Connector);
2199
-
2200
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this));
2201
-
1799
+ _this = _super.call(this);
2202
1800
  if (isIE10) {
2203
1801
  EventEmitter.call(_assertThisInitialized(_this));
2204
1802
  }
2205
-
2206
1803
  _this.backend = backend;
2207
1804
  _this.store = store;
2208
1805
  _this.services = services;
2209
1806
  _this.languageUtils = services.languageUtils;
2210
1807
  _this.options = options;
2211
1808
  _this.logger = baseLogger.create('backendConnector');
1809
+ _this.waitingReads = [];
1810
+ _this.maxParallelReads = options.maxParallelReads || 10;
1811
+ _this.readingCalls = 0;
1812
+ _this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
1813
+ _this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
2212
1814
  _this.state = {};
2213
1815
  _this.queue = [];
2214
-
2215
1816
  if (_this.backend && _this.backend.init) {
2216
1817
  _this.backend.init(services, options.backend, options);
2217
1818
  }
2218
-
2219
1819
  return _this;
2220
1820
  }
2221
-
2222
1821
  _createClass(Connector, [{
2223
1822
  key: "queueLoad",
2224
1823
  value: function queueLoad(languages, namespaces, options, callback) {
2225
1824
  var _this2 = this;
2226
-
2227
- var toLoad = [];
2228
- var pending = [];
2229
- var toLoadLanguages = [];
2230
- var toLoadNamespaces = [];
1825
+ var toLoad = {};
1826
+ var pending = {};
1827
+ var toLoadLanguages = {};
1828
+ var toLoadNamespaces = {};
2231
1829
  languages.forEach(function (lng) {
2232
1830
  var hasAllNamespaces = true;
2233
1831
  namespaces.forEach(function (ns) {
2234
1832
  var name = "".concat(lng, "|").concat(ns);
2235
-
2236
1833
  if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {
2237
1834
  _this2.state[name] = 2;
2238
1835
  } else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {
2239
- if (pending.indexOf(name) < 0) pending.push(name);
1836
+ if (pending[name] === undefined) pending[name] = true;
2240
1837
  } else {
2241
1838
  _this2.state[name] = 1;
2242
1839
  hasAllNamespaces = false;
2243
- if (pending.indexOf(name) < 0) pending.push(name);
2244
- if (toLoad.indexOf(name) < 0) toLoad.push(name);
2245
- if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns);
1840
+ if (pending[name] === undefined) pending[name] = true;
1841
+ if (toLoad[name] === undefined) toLoad[name] = true;
1842
+ if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
2246
1843
  }
2247
1844
  });
2248
- if (!hasAllNamespaces) toLoadLanguages.push(lng);
1845
+ if (!hasAllNamespaces) toLoadLanguages[lng] = true;
2249
1846
  });
2250
-
2251
- if (toLoad.length || pending.length) {
1847
+ if (Object.keys(toLoad).length || Object.keys(pending).length) {
2252
1848
  this.queue.push({
2253
1849
  pending: pending,
1850
+ pendingCount: Object.keys(pending).length,
2254
1851
  loaded: {},
2255
1852
  errors: [],
2256
1853
  callback: callback
2257
1854
  });
2258
1855
  }
2259
-
2260
1856
  return {
2261
- toLoad: toLoad,
2262
- pending: pending,
2263
- toLoadLanguages: toLoadLanguages,
2264
- toLoadNamespaces: toLoadNamespaces
1857
+ toLoad: Object.keys(toLoad),
1858
+ pending: Object.keys(pending),
1859
+ toLoadLanguages: Object.keys(toLoadLanguages),
1860
+ toLoadNamespaces: Object.keys(toLoadNamespaces)
2265
1861
  };
2266
1862
  }
2267
1863
  }, {
@@ -2271,30 +1867,26 @@ var Connector = function (_EventEmitter) {
2271
1867
  var lng = s[0];
2272
1868
  var ns = s[1];
2273
1869
  if (err) this.emit('failedLoading', lng, ns, err);
2274
-
2275
1870
  if (data) {
2276
1871
  this.store.addResourceBundle(lng, ns, data);
2277
1872
  }
2278
-
2279
1873
  this.state[name] = err ? -1 : 2;
2280
1874
  var loaded = {};
2281
1875
  this.queue.forEach(function (q) {
2282
1876
  pushPath(q.loaded, [lng], ns);
2283
- remove(q.pending, name);
1877
+ removePending(q, name);
2284
1878
  if (err) q.errors.push(err);
2285
-
2286
- if (q.pending.length === 0 && !q.done) {
1879
+ if (q.pendingCount === 0 && !q.done) {
2287
1880
  Object.keys(q.loaded).forEach(function (l) {
2288
- if (!loaded[l]) loaded[l] = [];
2289
-
2290
- if (q.loaded[l].length) {
2291
- q.loaded[l].forEach(function (ns) {
2292
- if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns);
1881
+ if (!loaded[l]) loaded[l] = {};
1882
+ var loadedKeys = q.loaded[l];
1883
+ if (loadedKeys.length) {
1884
+ loadedKeys.forEach(function (n) {
1885
+ if (loaded[l][n] === undefined) loaded[l][n] = true;
2293
1886
  });
2294
1887
  }
2295
1888
  });
2296
1889
  q.done = true;
2297
-
2298
1890
  if (q.errors.length) {
2299
1891
  q.callback(q.errors);
2300
1892
  } else {
@@ -2311,44 +1903,71 @@ var Connector = function (_EventEmitter) {
2311
1903
  key: "read",
2312
1904
  value: function read(lng, ns, fcName) {
2313
1905
  var _this3 = this;
2314
-
2315
1906
  var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
2316
- var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 350;
1907
+ var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;
2317
1908
  var callback = arguments.length > 5 ? arguments[5] : undefined;
2318
1909
  if (!lng.length) return callback(null, {});
2319
- return this.backend[fcName](lng, ns, function (err, data) {
2320
- if (err && data && tried < 5) {
1910
+ if (this.readingCalls >= this.maxParallelReads) {
1911
+ this.waitingReads.push({
1912
+ lng: lng,
1913
+ ns: ns,
1914
+ fcName: fcName,
1915
+ tried: tried,
1916
+ wait: wait,
1917
+ callback: callback
1918
+ });
1919
+ return;
1920
+ }
1921
+ this.readingCalls++;
1922
+ var resolver = function resolver(err, data) {
1923
+ _this3.readingCalls--;
1924
+ if (_this3.waitingReads.length > 0) {
1925
+ var next = _this3.waitingReads.shift();
1926
+ _this3.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
1927
+ }
1928
+ if (err && data && tried < _this3.maxRetries) {
2321
1929
  setTimeout(function () {
2322
1930
  _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);
2323
1931
  }, wait);
2324
1932
  return;
2325
1933
  }
2326
-
2327
1934
  callback(err, data);
2328
- });
1935
+ };
1936
+ var fc = this.backend[fcName].bind(this.backend);
1937
+ if (fc.length === 2) {
1938
+ try {
1939
+ var r = fc(lng, ns);
1940
+ if (r && typeof r.then === 'function') {
1941
+ r.then(function (data) {
1942
+ return resolver(null, data);
1943
+ })["catch"](resolver);
1944
+ } else {
1945
+ resolver(null, r);
1946
+ }
1947
+ } catch (err) {
1948
+ resolver(err);
1949
+ }
1950
+ return;
1951
+ }
1952
+ return fc(lng, ns, resolver);
2329
1953
  }
2330
1954
  }, {
2331
1955
  key: "prepareLoading",
2332
1956
  value: function prepareLoading(languages, namespaces) {
2333
1957
  var _this4 = this;
2334
-
2335
1958
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2336
1959
  var callback = arguments.length > 3 ? arguments[3] : undefined;
2337
-
2338
1960
  if (!this.backend) {
2339
1961
  this.logger.warn('No backend was added via i18next.use. Will not load resources.');
2340
1962
  return callback && callback();
2341
1963
  }
2342
-
2343
1964
  if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);
2344
1965
  if (typeof namespaces === 'string') namespaces = [namespaces];
2345
1966
  var toLoad = this.queueLoad(languages, namespaces, options, callback);
2346
-
2347
1967
  if (!toLoad.toLoad.length) {
2348
1968
  if (!toLoad.pending.length) callback();
2349
1969
  return null;
2350
1970
  }
2351
-
2352
1971
  toLoad.toLoad.forEach(function (name) {
2353
1972
  _this4.loadOne(name);
2354
1973
  });
@@ -2369,7 +1988,6 @@ var Connector = function (_EventEmitter) {
2369
1988
  key: "loadOne",
2370
1989
  value: function loadOne(name) {
2371
1990
  var _this5 = this;
2372
-
2373
1991
  var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
2374
1992
  var s = name.split('|');
2375
1993
  var lng = s[0];
@@ -2377,7 +1995,6 @@ var Connector = function (_EventEmitter) {
2377
1995
  this.read(lng, ns, 'read', undefined, undefined, function (err, data) {
2378
1996
  if (err) _this5.logger.warn("".concat(prefix, "loading namespace ").concat(ns, " for language ").concat(lng, " failed"), err);
2379
1997
  if (!err && data) _this5.logger.log("".concat(prefix, "loaded namespace ").concat(ns, " for language ").concat(lng), data);
2380
-
2381
1998
  _this5.loaded(name, err, data);
2382
1999
  });
2383
2000
  }
@@ -2385,25 +2002,43 @@ var Connector = function (_EventEmitter) {
2385
2002
  key: "saveMissing",
2386
2003
  value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
2387
2004
  var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
2388
-
2005
+ var clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : function () {};
2389
2006
  if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
2390
2007
  this.logger.warn("did not save key \"".concat(key, "\" as the namespace \"").concat(namespace, "\" was not yet loaded"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
2391
2008
  return;
2392
2009
  }
2393
-
2394
2010
  if (key === undefined || key === null || key === '') return;
2395
-
2396
2011
  if (this.backend && this.backend.create) {
2397
- this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread({}, options, {
2012
+ var opts = _objectSpread$1(_objectSpread$1({}, options), {}, {
2398
2013
  isUpdate: isUpdate
2399
- }));
2014
+ });
2015
+ var fc = this.backend.create.bind(this.backend);
2016
+ if (fc.length < 6) {
2017
+ try {
2018
+ var r;
2019
+ if (fc.length === 5) {
2020
+ r = fc(languages, namespace, key, fallbackValue, opts);
2021
+ } else {
2022
+ r = fc(languages, namespace, key, fallbackValue);
2023
+ }
2024
+ if (r && typeof r.then === 'function') {
2025
+ r.then(function (data) {
2026
+ return clb(null, data);
2027
+ })["catch"](clb);
2028
+ } else {
2029
+ clb(null, r);
2030
+ }
2031
+ } catch (err) {
2032
+ clb(err);
2033
+ }
2034
+ } else {
2035
+ fc(languages, namespace, key, fallbackValue, clb, opts);
2036
+ }
2400
2037
  }
2401
-
2402
2038
  if (!languages || !languages[0]) return;
2403
2039
  this.store.addResource(languages[0], namespace, key, fallbackValue);
2404
2040
  }
2405
2041
  }]);
2406
-
2407
2042
  return Connector;
2408
2043
  }(EventEmitter);
2409
2044
 
@@ -2415,8 +2050,6 @@ function get() {
2415
2050
  defaultNS: ['translation'],
2416
2051
  fallbackLng: ['dev'],
2417
2052
  fallbackNS: false,
2418
- whitelist: false,
2419
- nonExplicitWhitelist: false,
2420
2053
  supportedLngs: false,
2421
2054
  nonExplicitSupportedLngs: false,
2422
2055
  load: 'all',
@@ -2448,14 +2081,12 @@ function get() {
2448
2081
  if (_typeof(args[1]) === 'object') ret = args[1];
2449
2082
  if (typeof args[1] === 'string') ret.defaultValue = args[1];
2450
2083
  if (typeof args[2] === 'string') ret.tDescription = args[2];
2451
-
2452
2084
  if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {
2453
2085
  var options = args[3] || args[2];
2454
2086
  Object.keys(options).forEach(function (key) {
2455
2087
  ret[key] = options[key];
2456
2088
  });
2457
2089
  }
2458
-
2459
2090
  return ret;
2460
2091
  },
2461
2092
  interpolation: {
@@ -2471,7 +2102,7 @@ function get() {
2471
2102
  nestingSuffix: ')',
2472
2103
  nestingOptionsSeparator: ',',
2473
2104
  maxReplaces: 1000,
2474
- skipOnVariables: false
2105
+ skipOnVariables: true
2475
2106
  }
2476
2107
  };
2477
2108
  }
@@ -2479,105 +2110,100 @@ function transformOptions(options) {
2479
2110
  if (typeof options.ns === 'string') options.ns = [options.ns];
2480
2111
  if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];
2481
2112
  if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];
2482
-
2483
- if (options.whitelist) {
2484
- if (options.whitelist && options.whitelist.indexOf('cimode') < 0) {
2485
- options.whitelist = options.whitelist.concat(['cimode']);
2486
- }
2487
-
2488
- options.supportedLngs = options.whitelist;
2489
- }
2490
-
2491
- if (options.nonExplicitWhitelist) {
2492
- options.nonExplicitSupportedLngs = options.nonExplicitWhitelist;
2493
- }
2494
-
2495
2113
  if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {
2496
2114
  options.supportedLngs = options.supportedLngs.concat(['cimode']);
2497
2115
  }
2498
-
2499
2116
  return options;
2500
2117
  }
2501
2118
 
2119
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2120
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2121
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2122
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2502
2123
  function noop() {}
2503
-
2124
+ function bindMemberFunctions(inst) {
2125
+ var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
2126
+ mems.forEach(function (mem) {
2127
+ if (typeof inst[mem] === 'function') {
2128
+ inst[mem] = inst[mem].bind(inst);
2129
+ }
2130
+ });
2131
+ }
2504
2132
  var I18n = function (_EventEmitter) {
2505
2133
  _inherits(I18n, _EventEmitter);
2506
-
2134
+ var _super = _createSuper(I18n);
2507
2135
  function I18n() {
2508
2136
  var _this;
2509
-
2510
2137
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2511
2138
  var callback = arguments.length > 1 ? arguments[1] : undefined;
2512
-
2513
2139
  _classCallCheck(this, I18n);
2514
-
2515
- _this = _possibleConstructorReturn(this, _getPrototypeOf(I18n).call(this));
2516
-
2140
+ _this = _super.call(this);
2517
2141
  if (isIE10) {
2518
2142
  EventEmitter.call(_assertThisInitialized(_this));
2519
2143
  }
2520
-
2521
2144
  _this.options = transformOptions(options);
2522
2145
  _this.services = {};
2523
2146
  _this.logger = baseLogger;
2524
2147
  _this.modules = {
2525
2148
  external: []
2526
2149
  };
2527
-
2150
+ bindMemberFunctions(_assertThisInitialized(_this));
2528
2151
  if (callback && !_this.isInitialized && !options.isClone) {
2529
2152
  if (!_this.options.initImmediate) {
2530
2153
  _this.init(options, callback);
2531
-
2532
2154
  return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
2533
2155
  }
2534
-
2535
2156
  setTimeout(function () {
2536
2157
  _this.init(options, callback);
2537
2158
  }, 0);
2538
2159
  }
2539
-
2540
2160
  return _this;
2541
2161
  }
2542
-
2543
2162
  _createClass(I18n, [{
2544
2163
  key: "init",
2545
2164
  value: function init() {
2546
2165
  var _this2 = this;
2547
-
2548
2166
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2549
2167
  var callback = arguments.length > 1 ? arguments[1] : undefined;
2550
-
2551
2168
  if (typeof options === 'function') {
2552
2169
  callback = options;
2553
2170
  options = {};
2554
2171
  }
2555
-
2556
- if (options.whitelist && !options.supportedLngs) {
2557
- this.logger.deprecate('whitelist', 'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.');
2172
+ if (!options.defaultNS && options.defaultNS !== false && options.ns) {
2173
+ if (typeof options.ns === 'string') {
2174
+ options.defaultNS = options.ns;
2175
+ } else if (options.ns.indexOf('translation') < 0) {
2176
+ options.defaultNS = options.ns[0];
2177
+ }
2558
2178
  }
2559
-
2560
- if (options.nonExplicitWhitelist && !options.nonExplicitSupportedLngs) {
2561
- this.logger.deprecate('whitelist', 'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.');
2179
+ var defOpts = get();
2180
+ this.options = _objectSpread(_objectSpread(_objectSpread({}, defOpts), this.options), transformOptions(options));
2181
+ if (this.options.compatibilityAPI !== 'v1') {
2182
+ this.options.interpolation = _objectSpread(_objectSpread({}, defOpts.interpolation), this.options.interpolation);
2183
+ }
2184
+ if (options.keySeparator !== undefined) {
2185
+ this.options.userDefinedKeySeparator = options.keySeparator;
2186
+ }
2187
+ if (options.nsSeparator !== undefined) {
2188
+ this.options.userDefinedNsSeparator = options.nsSeparator;
2562
2189
  }
2563
-
2564
- this.options = _objectSpread({}, get(), this.options, transformOptions(options));
2565
- this.format = this.options.interpolation.format;
2566
- if (!callback) callback = noop;
2567
-
2568
2190
  function createClassOnDemand(ClassOrObject) {
2569
2191
  if (!ClassOrObject) return null;
2570
2192
  if (typeof ClassOrObject === 'function') return new ClassOrObject();
2571
2193
  return ClassOrObject;
2572
2194
  }
2573
-
2574
2195
  if (!this.options.isClone) {
2575
2196
  if (this.modules.logger) {
2576
2197
  baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
2577
2198
  } else {
2578
2199
  baseLogger.init(null, this.options);
2579
2200
  }
2580
-
2201
+ var formatter;
2202
+ if (this.modules.formatter) {
2203
+ formatter = this.modules.formatter;
2204
+ } else if (typeof Intl !== 'undefined') {
2205
+ formatter = Formatter;
2206
+ }
2581
2207
  var lu = new LanguageUtil(this.options);
2582
2208
  this.store = new ResourceStore(this.options.resources, this.options);
2583
2209
  var s = this.services;
@@ -2589,6 +2215,11 @@ var I18n = function (_EventEmitter) {
2589
2215
  compatibilityJSON: this.options.compatibilityJSON,
2590
2216
  simplifyPluralSuffix: this.options.simplifyPluralSuffix
2591
2217
  });
2218
+ if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
2219
+ s.formatter = createClassOnDemand(formatter);
2220
+ s.formatter.init(s, this.options);
2221
+ this.options.interpolation.format = s.formatter.format.bind(s.formatter);
2222
+ }
2592
2223
  s.interpolator = new Interpolator(this.options);
2593
2224
  s.utils = {
2594
2225
  hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
@@ -2598,47 +2229,40 @@ var I18n = function (_EventEmitter) {
2598
2229
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2599
2230
  args[_key - 1] = arguments[_key];
2600
2231
  }
2601
-
2602
2232
  _this2.emit.apply(_this2, [event].concat(args));
2603
2233
  });
2604
-
2605
2234
  if (this.modules.languageDetector) {
2606
2235
  s.languageDetector = createClassOnDemand(this.modules.languageDetector);
2607
- s.languageDetector.init(s, this.options.detection, this.options);
2236
+ if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
2608
2237
  }
2609
-
2610
2238
  if (this.modules.i18nFormat) {
2611
2239
  s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
2612
2240
  if (s.i18nFormat.init) s.i18nFormat.init(this);
2613
2241
  }
2614
-
2615
2242
  this.translator = new Translator(this.services, this.options);
2616
2243
  this.translator.on('*', function (event) {
2617
2244
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2618
2245
  args[_key2 - 1] = arguments[_key2];
2619
2246
  }
2620
-
2621
2247
  _this2.emit.apply(_this2, [event].concat(args));
2622
2248
  });
2623
2249
  this.modules.external.forEach(function (m) {
2624
2250
  if (m.init) m.init(_this2);
2625
2251
  });
2626
2252
  }
2627
-
2253
+ this.format = this.options.interpolation.format;
2254
+ if (!callback) callback = noop;
2628
2255
  if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
2629
2256
  var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
2630
2257
  if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
2631
2258
  }
2632
-
2633
2259
  if (!this.services.languageDetector && !this.options.lng) {
2634
2260
  this.logger.warn('init: no languageDetector is used and no lng is defined');
2635
2261
  }
2636
-
2637
2262
  var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
2638
2263
  storeApi.forEach(function (fcName) {
2639
2264
  _this2[fcName] = function () {
2640
2265
  var _this2$store;
2641
-
2642
2266
  return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
2643
2267
  };
2644
2268
  });
@@ -2646,63 +2270,48 @@ var I18n = function (_EventEmitter) {
2646
2270
  storeApiChained.forEach(function (fcName) {
2647
2271
  _this2[fcName] = function () {
2648
2272
  var _this2$store2;
2649
-
2650
2273
  (_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
2651
-
2652
2274
  return _this2;
2653
2275
  };
2654
2276
  });
2655
2277
  var deferred = defer();
2656
-
2657
2278
  var load = function load() {
2658
2279
  var finish = function finish(err, t) {
2659
2280
  if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');
2660
2281
  _this2.isInitialized = true;
2661
2282
  if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
2662
-
2663
2283
  _this2.emit('initialized', _this2.options);
2664
-
2665
2284
  deferred.resolve(t);
2666
2285
  callback(err, t);
2667
2286
  };
2668
-
2669
2287
  if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));
2670
-
2671
2288
  _this2.changeLanguage(_this2.options.lng, finish);
2672
2289
  };
2673
-
2674
2290
  if (this.options.resources || !this.options.initImmediate) {
2675
2291
  load();
2676
2292
  } else {
2677
2293
  setTimeout(load, 0);
2678
2294
  }
2679
-
2680
2295
  return deferred;
2681
2296
  }
2682
2297
  }, {
2683
2298
  key: "loadResources",
2684
2299
  value: function loadResources(language) {
2685
2300
  var _this3 = this;
2686
-
2687
2301
  var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
2688
2302
  var usedCallback = callback;
2689
2303
  var usedLng = typeof language === 'string' ? language : this.language;
2690
2304
  if (typeof language === 'function') usedCallback = language;
2691
-
2692
2305
  if (!this.options.resources || this.options.partialBundledLanguages) {
2693
2306
  if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();
2694
2307
  var toLoad = [];
2695
-
2696
2308
  var append = function append(lng) {
2697
2309
  if (!lng) return;
2698
-
2699
2310
  var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);
2700
-
2701
2311
  lngs.forEach(function (l) {
2702
2312
  if (toLoad.indexOf(l) < 0) toLoad.push(l);
2703
2313
  });
2704
2314
  };
2705
-
2706
2315
  if (!usedLng) {
2707
2316
  var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
2708
2317
  fallbacks.forEach(function (l) {
@@ -2711,14 +2320,15 @@ var I18n = function (_EventEmitter) {
2711
2320
  } else {
2712
2321
  append(usedLng);
2713
2322
  }
2714
-
2715
2323
  if (this.options.preload) {
2716
2324
  this.options.preload.forEach(function (l) {
2717
2325
  return append(l);
2718
2326
  });
2719
2327
  }
2720
-
2721
- this.services.backendConnector.load(toLoad, this.options.ns, usedCallback);
2328
+ this.services.backendConnector.load(toLoad, this.options.ns, function (e) {
2329
+ if (!e && !_this3.resolvedLanguage && _this3.language) _this3.setResolvedLanguage(_this3.language);
2330
+ usedCallback(e);
2331
+ });
2722
2332
  } else {
2723
2333
  usedCallback(null);
2724
2334
  }
@@ -2741,58 +2351,66 @@ var I18n = function (_EventEmitter) {
2741
2351
  value: function use(module) {
2742
2352
  if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
2743
2353
  if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
2744
-
2745
2354
  if (module.type === 'backend') {
2746
2355
  this.modules.backend = module;
2747
2356
  }
2748
-
2749
2357
  if (module.type === 'logger' || module.log && module.warn && module.error) {
2750
2358
  this.modules.logger = module;
2751
2359
  }
2752
-
2753
2360
  if (module.type === 'languageDetector') {
2754
2361
  this.modules.languageDetector = module;
2755
2362
  }
2756
-
2757
2363
  if (module.type === 'i18nFormat') {
2758
2364
  this.modules.i18nFormat = module;
2759
2365
  }
2760
-
2761
2366
  if (module.type === 'postProcessor') {
2762
2367
  postProcessor.addPostProcessor(module);
2763
2368
  }
2764
-
2369
+ if (module.type === 'formatter') {
2370
+ this.modules.formatter = module;
2371
+ }
2765
2372
  if (module.type === '3rdParty') {
2766
2373
  this.modules.external.push(module);
2767
2374
  }
2768
-
2769
2375
  return this;
2770
2376
  }
2377
+ }, {
2378
+ key: "setResolvedLanguage",
2379
+ value: function setResolvedLanguage(l) {
2380
+ if (!l || !this.languages) return;
2381
+ if (['cimode', 'dev'].indexOf(l) > -1) return;
2382
+ for (var li = 0; li < this.languages.length; li++) {
2383
+ var lngInLngs = this.languages[li];
2384
+ if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
2385
+ if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
2386
+ this.resolvedLanguage = lngInLngs;
2387
+ break;
2388
+ }
2389
+ }
2390
+ }
2771
2391
  }, {
2772
2392
  key: "changeLanguage",
2773
2393
  value: function changeLanguage(lng, callback) {
2774
2394
  var _this4 = this;
2775
-
2776
2395
  this.isLanguageChangingTo = lng;
2777
2396
  var deferred = defer();
2778
2397
  this.emit('languageChanging', lng);
2779
-
2398
+ var setLngProps = function setLngProps(l) {
2399
+ _this4.language = l;
2400
+ _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
2401
+ _this4.resolvedLanguage = undefined;
2402
+ _this4.setResolvedLanguage(l);
2403
+ };
2780
2404
  var done = function done(err, l) {
2781
2405
  if (l) {
2782
- _this4.language = l;
2783
- _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
2784
-
2406
+ setLngProps(l);
2785
2407
  _this4.translator.changeLanguage(l);
2786
-
2787
2408
  _this4.isLanguageChangingTo = undefined;
2788
-
2789
2409
  _this4.emit('languageChanged', l);
2790
-
2791
2410
  _this4.logger.log('languageChanged', l);
2792
2411
  } else {
2793
2412
  _this4.isLanguageChangingTo = undefined;
2794
2413
  }
2795
-
2796
2414
  deferred.resolve(function () {
2797
2415
  return _this4.t.apply(_this4, arguments);
2798
2416
  });
@@ -2800,68 +2418,67 @@ var I18n = function (_EventEmitter) {
2800
2418
  return _this4.t.apply(_this4, arguments);
2801
2419
  });
2802
2420
  };
2803
-
2804
2421
  var setLng = function setLng(lngs) {
2805
2422
  if (!lng && !lngs && _this4.services.languageDetector) lngs = [];
2806
2423
  var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);
2807
-
2808
2424
  if (l) {
2809
2425
  if (!_this4.language) {
2810
- _this4.language = l;
2811
- _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
2426
+ setLngProps(l);
2812
2427
  }
2813
-
2814
2428
  if (!_this4.translator.language) _this4.translator.changeLanguage(l);
2815
- if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);
2429
+ if (_this4.services.languageDetector && _this4.services.languageDetector.cacheUserLanguage) _this4.services.languageDetector.cacheUserLanguage(l);
2816
2430
  }
2817
-
2818
2431
  _this4.loadResources(l, function (err) {
2819
2432
  done(err, l);
2820
2433
  });
2821
2434
  };
2822
-
2823
2435
  if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
2824
2436
  setLng(this.services.languageDetector.detect());
2825
2437
  } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
2826
- this.services.languageDetector.detect(setLng);
2438
+ if (this.services.languageDetector.detect.length === 0) {
2439
+ this.services.languageDetector.detect().then(setLng);
2440
+ } else {
2441
+ this.services.languageDetector.detect(setLng);
2442
+ }
2827
2443
  } else {
2828
2444
  setLng(lng);
2829
2445
  }
2830
-
2831
2446
  return deferred;
2832
2447
  }
2833
2448
  }, {
2834
2449
  key: "getFixedT",
2835
2450
  value: function getFixedT(lng, ns, keyPrefix) {
2836
2451
  var _this5 = this;
2837
-
2838
2452
  var fixedT = function fixedT(key, opts) {
2839
2453
  var options;
2840
-
2841
2454
  if (_typeof(opts) !== 'object') {
2842
2455
  for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
2843
2456
  rest[_key3 - 2] = arguments[_key3];
2844
2457
  }
2845
-
2846
2458
  options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));
2847
2459
  } else {
2848
2460
  options = _objectSpread({}, opts);
2849
2461
  }
2850
-
2851
2462
  options.lng = options.lng || fixedT.lng;
2852
2463
  options.lngs = options.lngs || fixedT.lngs;
2853
2464
  options.ns = options.ns || fixedT.ns;
2465
+ options.keyPrefix = options.keyPrefix || keyPrefix || fixedT.keyPrefix;
2854
2466
  var keySeparator = _this5.options.keySeparator || '.';
2855
- var resultKey = keyPrefix ? "".concat(keyPrefix).concat(keySeparator).concat(key) : key;
2467
+ var resultKey;
2468
+ if (options.keyPrefix && Array.isArray(key)) {
2469
+ resultKey = key.map(function (k) {
2470
+ return "".concat(options.keyPrefix).concat(keySeparator).concat(k);
2471
+ });
2472
+ } else {
2473
+ resultKey = options.keyPrefix ? "".concat(options.keyPrefix).concat(keySeparator).concat(key) : key;
2474
+ }
2856
2475
  return _this5.t(resultKey, options);
2857
2476
  };
2858
-
2859
2477
  if (typeof lng === 'string') {
2860
2478
  fixedT.lng = lng;
2861
2479
  } else {
2862
2480
  fixedT.lngs = lng;
2863
2481
  }
2864
-
2865
2482
  fixedT.ns = ns;
2866
2483
  fixedT.keyPrefix = keyPrefix;
2867
2484
  return fixedT;
@@ -2870,14 +2487,12 @@ var I18n = function (_EventEmitter) {
2870
2487
  key: "t",
2871
2488
  value: function t() {
2872
2489
  var _this$translator;
2873
-
2874
2490
  return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);
2875
2491
  }
2876
2492
  }, {
2877
2493
  key: "exists",
2878
2494
  value: function exists() {
2879
2495
  var _this$translator2;
2880
-
2881
2496
  return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);
2882
2497
  }
2883
2498
  }, {
@@ -2889,37 +2504,29 @@ var I18n = function (_EventEmitter) {
2889
2504
  key: "hasLoadedNamespace",
2890
2505
  value: function hasLoadedNamespace(ns) {
2891
2506
  var _this6 = this;
2892
-
2893
2507
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2894
-
2895
2508
  if (!this.isInitialized) {
2896
2509
  this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
2897
2510
  return false;
2898
2511
  }
2899
-
2900
2512
  if (!this.languages || !this.languages.length) {
2901
2513
  this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
2902
2514
  return false;
2903
2515
  }
2904
-
2905
- var lng = this.languages[0];
2516
+ var lng = options.lng || this.resolvedLanguage || this.languages[0];
2906
2517
  var fallbackLng = this.options ? this.options.fallbackLng : false;
2907
2518
  var lastLng = this.languages[this.languages.length - 1];
2908
2519
  if (lng.toLowerCase() === 'cimode') return true;
2909
-
2910
2520
  var loadNotPending = function loadNotPending(l, n) {
2911
2521
  var loadState = _this6.services.backendConnector.state["".concat(l, "|").concat(n)];
2912
-
2913
2522
  return loadState === -1 || loadState === 2;
2914
2523
  };
2915
-
2916
2524
  if (options.precheck) {
2917
2525
  var preResult = options.precheck(this, loadNotPending);
2918
2526
  if (preResult !== undefined) return preResult;
2919
2527
  }
2920
-
2921
2528
  if (this.hasResourceBundle(lng, ns)) return true;
2922
- if (!this.services.backendConnector.backend) return true;
2529
+ if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
2923
2530
  if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
2924
2531
  return false;
2925
2532
  }
@@ -2927,14 +2534,11 @@ var I18n = function (_EventEmitter) {
2927
2534
  key: "loadNamespaces",
2928
2535
  value: function loadNamespaces(ns, callback) {
2929
2536
  var _this7 = this;
2930
-
2931
2537
  var deferred = defer();
2932
-
2933
2538
  if (!this.options.ns) {
2934
- callback && callback();
2539
+ if (callback) callback();
2935
2540
  return Promise.resolve();
2936
2541
  }
2937
-
2938
2542
  if (typeof ns === 'string') ns = [ns];
2939
2543
  ns.forEach(function (n) {
2940
2544
  if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);
@@ -2954,12 +2558,10 @@ var I18n = function (_EventEmitter) {
2954
2558
  var newLngs = lngs.filter(function (lng) {
2955
2559
  return preloaded.indexOf(lng) < 0;
2956
2560
  });
2957
-
2958
2561
  if (!newLngs.length) {
2959
2562
  if (callback) callback();
2960
2563
  return Promise.resolve();
2961
2564
  }
2962
-
2963
2565
  this.options.preload = preloaded.concat(newLngs);
2964
2566
  this.loadResources(function (err) {
2965
2567
  deferred.resolve();
@@ -2970,31 +2572,25 @@ var I18n = function (_EventEmitter) {
2970
2572
  }, {
2971
2573
  key: "dir",
2972
2574
  value: function dir(lng) {
2973
- if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language;
2575
+ if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
2974
2576
  if (!lng) return 'rtl';
2975
- var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam'];
2976
- return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) >= 0 ? 'rtl' : 'ltr';
2977
- }
2978
- }, {
2979
- key: "createInstance",
2980
- value: function createInstance() {
2981
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2982
- var callback = arguments.length > 1 ? arguments[1] : undefined;
2983
- return new I18n(options, callback);
2577
+ var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
2578
+ var languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());
2579
+ return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
2984
2580
  }
2985
2581
  }, {
2986
2582
  key: "cloneInstance",
2987
2583
  value: function cloneInstance() {
2988
2584
  var _this8 = this;
2989
-
2990
2585
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2991
2586
  var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
2992
-
2993
- var mergedOptions = _objectSpread({}, this.options, options, {
2587
+ var mergedOptions = _objectSpread(_objectSpread(_objectSpread({}, this.options), options), {
2994
2588
  isClone: true
2995
2589
  });
2996
-
2997
2590
  var clone = new I18n(mergedOptions);
2591
+ if (options.debug !== undefined || options.prefix !== undefined) {
2592
+ clone.logger = clone.logger.clone(options);
2593
+ }
2998
2594
  var membersToCopy = ['store', 'services', 'language'];
2999
2595
  membersToCopy.forEach(function (m) {
3000
2596
  clone[m] = _this8[m];
@@ -3008,7 +2604,6 @@ var I18n = function (_EventEmitter) {
3008
2604
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
3009
2605
  args[_key4 - 1] = arguments[_key4];
3010
2606
  }
3011
-
3012
2607
  clone.emit.apply(clone, [event].concat(args));
3013
2608
  });
3014
2609
  clone.init(mergedOptions, callback);
@@ -3025,15 +2620,20 @@ var I18n = function (_EventEmitter) {
3025
2620
  options: this.options,
3026
2621
  store: this.store,
3027
2622
  language: this.language,
3028
- languages: this.languages
2623
+ languages: this.languages,
2624
+ resolvedLanguage: this.resolvedLanguage
3029
2625
  };
3030
2626
  }
3031
2627
  }]);
3032
-
3033
2628
  return I18n;
3034
2629
  }(EventEmitter);
3035
-
3036
- var i18next = new I18n();
2630
+ _defineProperty(I18n, "createInstance", function () {
2631
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2632
+ var callback = arguments.length > 1 ? arguments[1] : undefined;
2633
+ return new I18n(options, callback);
2634
+ });
2635
+ var instance = I18n.createInstance();
2636
+ instance.createInstance = I18n.createInstance;
3037
2637
 
3038
2638
  var arr = [];
3039
2639
  var each = arr.forEach;
@@ -3051,103 +2651,80 @@ function defaults(obj) {
3051
2651
 
3052
2652
  // eslint-disable-next-line no-control-regex
3053
2653
  var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
3054
-
3055
2654
  var serializeCookie = function serializeCookie(name, val, options) {
3056
2655
  var opt = options || {};
3057
2656
  opt.path = opt.path || '/';
3058
2657
  var value = encodeURIComponent(val);
3059
- var str = name + '=' + value;
3060
-
2658
+ var str = "".concat(name, "=").concat(value);
3061
2659
  if (opt.maxAge > 0) {
3062
2660
  var maxAge = opt.maxAge - 0;
3063
- if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
3064
- str += '; Max-Age=' + Math.floor(maxAge);
2661
+ if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
2662
+ str += "; Max-Age=".concat(Math.floor(maxAge));
3065
2663
  }
3066
-
3067
2664
  if (opt.domain) {
3068
2665
  if (!fieldContentRegExp.test(opt.domain)) {
3069
2666
  throw new TypeError('option domain is invalid');
3070
2667
  }
3071
-
3072
- str += '; Domain=' + opt.domain;
2668
+ str += "; Domain=".concat(opt.domain);
3073
2669
  }
3074
-
3075
2670
  if (opt.path) {
3076
2671
  if (!fieldContentRegExp.test(opt.path)) {
3077
2672
  throw new TypeError('option path is invalid');
3078
2673
  }
3079
-
3080
- str += '; Path=' + opt.path;
2674
+ str += "; Path=".concat(opt.path);
3081
2675
  }
3082
-
3083
2676
  if (opt.expires) {
3084
2677
  if (typeof opt.expires.toUTCString !== 'function') {
3085
2678
  throw new TypeError('option expires is invalid');
3086
2679
  }
3087
-
3088
- str += '; Expires=' + opt.expires.toUTCString();
2680
+ str += "; Expires=".concat(opt.expires.toUTCString());
3089
2681
  }
3090
-
3091
2682
  if (opt.httpOnly) str += '; HttpOnly';
3092
2683
  if (opt.secure) str += '; Secure';
3093
-
3094
2684
  if (opt.sameSite) {
3095
2685
  var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
3096
-
3097
2686
  switch (sameSite) {
3098
2687
  case true:
3099
2688
  str += '; SameSite=Strict';
3100
2689
  break;
3101
-
3102
2690
  case 'lax':
3103
2691
  str += '; SameSite=Lax';
3104
2692
  break;
3105
-
3106
2693
  case 'strict':
3107
2694
  str += '; SameSite=Strict';
3108
2695
  break;
3109
-
3110
2696
  case 'none':
3111
2697
  str += '; SameSite=None';
3112
2698
  break;
3113
-
3114
2699
  default:
3115
2700
  throw new TypeError('option sameSite is invalid');
3116
2701
  }
3117
2702
  }
3118
-
3119
2703
  return str;
3120
2704
  };
3121
-
3122
2705
  var cookie = {
3123
2706
  create: function create(name, value, minutes, domain) {
3124
2707
  var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
3125
2708
  path: '/',
3126
2709
  sameSite: 'strict'
3127
2710
  };
3128
-
3129
2711
  if (minutes) {
3130
2712
  cookieOptions.expires = new Date();
3131
2713
  cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);
3132
2714
  }
3133
-
3134
2715
  if (domain) cookieOptions.domain = domain;
3135
2716
  document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);
3136
2717
  },
3137
2718
  read: function read(name) {
3138
- var nameEQ = name + '=';
2719
+ var nameEQ = "".concat(name, "=");
3139
2720
  var ca = document.cookie.split(';');
3140
-
3141
2721
  for (var i = 0; i < ca.length; i++) {
3142
2722
  var c = ca[i];
3143
-
3144
2723
  while (c.charAt(0) === ' ') {
3145
2724
  c = c.substring(1, c.length);
3146
2725
  }
3147
-
3148
2726
  if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
3149
2727
  }
3150
-
3151
2728
  return null;
3152
2729
  },
3153
2730
  remove: function remove(name) {
@@ -3158,12 +2735,10 @@ var cookie$1 = {
3158
2735
  name: 'cookie',
3159
2736
  lookup: function lookup(options) {
3160
2737
  var found;
3161
-
3162
2738
  if (options.lookupCookie && typeof document !== 'undefined') {
3163
2739
  var c = cookie.read(options.lookupCookie);
3164
2740
  if (c) found = c;
3165
2741
  }
3166
-
3167
2742
  return found;
3168
2743
  },
3169
2744
  cacheUserLanguage: function cacheUserLanguage(lng, options) {
@@ -3177,39 +2752,30 @@ var querystring = {
3177
2752
  name: 'querystring',
3178
2753
  lookup: function lookup(options) {
3179
2754
  var found;
3180
-
3181
2755
  if (typeof window !== 'undefined') {
3182
2756
  var search = window.location.search;
3183
-
3184
2757
  if (!window.location.search && window.location.hash && window.location.hash.indexOf('?') > -1) {
3185
2758
  search = window.location.hash.substring(window.location.hash.indexOf('?'));
3186
2759
  }
3187
-
3188
2760
  var query = search.substring(1);
3189
2761
  var params = query.split('&');
3190
-
3191
2762
  for (var i = 0; i < params.length; i++) {
3192
2763
  var pos = params[i].indexOf('=');
3193
-
3194
2764
  if (pos > 0) {
3195
2765
  var key = params[i].substring(0, pos);
3196
-
3197
2766
  if (key === options.lookupQuerystring) {
3198
2767
  found = params[i].substring(pos + 1);
3199
2768
  }
3200
2769
  }
3201
2770
  }
3202
2771
  }
3203
-
3204
2772
  return found;
3205
2773
  }
3206
2774
  };
3207
2775
 
3208
2776
  var hasLocalStorageSupport = null;
3209
-
3210
2777
  var localStorageAvailable = function localStorageAvailable() {
3211
2778
  if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
3212
-
3213
2779
  try {
3214
2780
  hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
3215
2781
  var testKey = 'i18next.translate.boo';
@@ -3218,20 +2784,16 @@ var localStorageAvailable = function localStorageAvailable() {
3218
2784
  } catch (e) {
3219
2785
  hasLocalStorageSupport = false;
3220
2786
  }
3221
-
3222
2787
  return hasLocalStorageSupport;
3223
2788
  };
3224
-
3225
2789
  var localStorage = {
3226
2790
  name: 'localStorage',
3227
2791
  lookup: function lookup(options) {
3228
2792
  var found;
3229
-
3230
2793
  if (options.lookupLocalStorage && localStorageAvailable()) {
3231
2794
  var lng = window.localStorage.getItem(options.lookupLocalStorage);
3232
2795
  if (lng) found = lng;
3233
2796
  }
3234
-
3235
2797
  return found;
3236
2798
  },
3237
2799
  cacheUserLanguage: function cacheUserLanguage(lng, options) {
@@ -3242,10 +2804,8 @@ var localStorage = {
3242
2804
  };
3243
2805
 
3244
2806
  var hasSessionStorageSupport = null;
3245
-
3246
2807
  var sessionStorageAvailable = function sessionStorageAvailable() {
3247
2808
  if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
3248
-
3249
2809
  try {
3250
2810
  hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;
3251
2811
  var testKey = 'i18next.translate.boo';
@@ -3254,20 +2814,16 @@ var sessionStorageAvailable = function sessionStorageAvailable() {
3254
2814
  } catch (e) {
3255
2815
  hasSessionStorageSupport = false;
3256
2816
  }
3257
-
3258
2817
  return hasSessionStorageSupport;
3259
2818
  };
3260
-
3261
2819
  var sessionStorage = {
3262
2820
  name: 'sessionStorage',
3263
2821
  lookup: function lookup(options) {
3264
2822
  var found;
3265
-
3266
2823
  if (options.lookupSessionStorage && sessionStorageAvailable()) {
3267
2824
  var lng = window.sessionStorage.getItem(options.lookupSessionStorage);
3268
2825
  if (lng) found = lng;
3269
2826
  }
3270
-
3271
2827
  return found;
3272
2828
  },
3273
2829
  cacheUserLanguage: function cacheUserLanguage(lng, options) {
@@ -3281,7 +2837,6 @@ var navigator$1 = {
3281
2837
  name: 'navigator',
3282
2838
  lookup: function lookup(options) {
3283
2839
  var found = [];
3284
-
3285
2840
  if (typeof navigator !== 'undefined') {
3286
2841
  if (navigator.languages) {
3287
2842
  // chrome only; not an array, so can't use .push.apply instead of iterating
@@ -3289,16 +2844,13 @@ var navigator$1 = {
3289
2844
  found.push(navigator.languages[i]);
3290
2845
  }
3291
2846
  }
3292
-
3293
2847
  if (navigator.userLanguage) {
3294
2848
  found.push(navigator.userLanguage);
3295
2849
  }
3296
-
3297
2850
  if (navigator.language) {
3298
2851
  found.push(navigator.language);
3299
2852
  }
3300
2853
  }
3301
-
3302
2854
  return found.length > 0 ? found : undefined;
3303
2855
  }
3304
2856
  };
@@ -3308,11 +2860,9 @@ var htmlTag = {
3308
2860
  lookup: function lookup(options) {
3309
2861
  var found;
3310
2862
  var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
3311
-
3312
2863
  if (htmlTag && typeof htmlTag.getAttribute === 'function') {
3313
2864
  found = htmlTag.getAttribute('lang');
3314
2865
  }
3315
-
3316
2866
  return found;
3317
2867
  }
3318
2868
  };
@@ -3321,23 +2871,19 @@ var path = {
3321
2871
  name: 'path',
3322
2872
  lookup: function lookup(options) {
3323
2873
  var found;
3324
-
3325
2874
  if (typeof window !== 'undefined') {
3326
2875
  var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
3327
-
3328
2876
  if (language instanceof Array) {
3329
2877
  if (typeof options.lookupFromPathIndex === 'number') {
3330
2878
  if (typeof language[options.lookupFromPathIndex] !== 'string') {
3331
2879
  return undefined;
3332
2880
  }
3333
-
3334
2881
  found = language[options.lookupFromPathIndex].replace('/', '');
3335
2882
  } else {
3336
2883
  found = language[0].replace('/', '');
3337
2884
  }
3338
2885
  }
3339
2886
  }
3340
-
3341
2887
  return found;
3342
2888
  }
3343
2889
  };
@@ -3345,21 +2891,17 @@ var path = {
3345
2891
  var subdomain = {
3346
2892
  name: 'subdomain',
3347
2893
  lookup: function lookup(options) {
3348
- var found;
3349
-
3350
- if (typeof window !== 'undefined') {
3351
- var language = window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);
3352
-
3353
- if (language instanceof Array) {
3354
- if (typeof options.lookupFromSubdomainIndex === 'number') {
3355
- found = language[options.lookupFromSubdomainIndex].replace('http://', '').replace('https://', '').replace('.', '');
3356
- } else {
3357
- found = language[0].replace('http://', '').replace('https://', '').replace('.', '');
3358
- }
3359
- }
3360
- }
3361
-
3362
- return found;
2894
+ // If given get the subdomain index else 1
2895
+ var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;
2896
+ // get all matches if window.location. is existing
2897
+ // first item of match is the match itself and the second is the first group macht which sould be the first subdomain match
2898
+ // is the hostname no public domain get the or option of localhost
2899
+ var language = typeof window !== 'undefined' && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
2900
+
2901
+ // if there is no match (null) return undefined
2902
+ if (!language) return undefined;
2903
+ // return the given group match
2904
+ return language[lookupFromSubdomainIndex];
3363
2905
  }
3364
2906
  };
3365
2907
 
@@ -3372,31 +2914,30 @@ function getDefaults() {
3372
2914
  lookupSessionStorage: 'i18nextLng',
3373
2915
  // cache user language
3374
2916
  caches: ['localStorage'],
3375
- excludeCacheFor: ['cimode'] //cookieMinutes: 10,
3376
- //cookieDomain: 'myDomain'
3377
-
2917
+ excludeCacheFor: ['cimode']
2918
+ // cookieMinutes: 10,
2919
+ // cookieDomain: 'myDomain'
3378
2920
  };
3379
2921
  }
3380
-
3381
2922
  var Browser = /*#__PURE__*/function () {
3382
2923
  function Browser(services) {
3383
2924
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3384
-
3385
2925
  _classCallCheck(this, Browser);
3386
-
3387
2926
  this.type = 'languageDetector';
3388
2927
  this.detectors = {};
3389
2928
  this.init(services, options);
3390
2929
  }
3391
-
3392
2930
  _createClass(Browser, [{
3393
2931
  key: "init",
3394
2932
  value: function init(services) {
3395
2933
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3396
2934
  var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3397
- this.services = services;
3398
- this.options = defaults(options, this.options || {}, getDefaults()); // backwards compatibility
2935
+ this.services = services || {
2936
+ languageUtils: {}
2937
+ }; // this way the language detector can be used without i18next
2938
+ this.options = defaults(options, this.options || {}, getDefaults());
3399
2939
 
2940
+ // backwards compatibility
3400
2941
  if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
3401
2942
  this.i18nOptions = i18nOptions;
3402
2943
  this.addDetector(cookie$1);
@@ -3417,26 +2958,22 @@ var Browser = /*#__PURE__*/function () {
3417
2958
  key: "detect",
3418
2959
  value: function detect(detectionOrder) {
3419
2960
  var _this = this;
3420
-
3421
2961
  if (!detectionOrder) detectionOrder = this.options.order;
3422
2962
  var detected = [];
3423
2963
  detectionOrder.forEach(function (detectorName) {
3424
2964
  if (_this.detectors[detectorName]) {
3425
2965
  var lookup = _this.detectors[detectorName].lookup(_this.options);
3426
-
3427
2966
  if (lookup && typeof lookup === 'string') lookup = [lookup];
3428
2967
  if (lookup) detected = detected.concat(lookup);
3429
2968
  }
3430
2969
  });
3431
2970
  if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0
3432
-
3433
2971
  return detected.length > 0 ? detected[0] : null; // a little backward compatibility
3434
2972
  }
3435
2973
  }, {
3436
2974
  key: "cacheUserLanguage",
3437
2975
  value: function cacheUserLanguage(lng, caches) {
3438
2976
  var _this2 = this;
3439
-
3440
2977
  if (!caches) caches = this.options.caches;
3441
2978
  if (!caches) return;
3442
2979
  if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
@@ -3445,13 +2982,11 @@ var Browser = /*#__PURE__*/function () {
3445
2982
  });
3446
2983
  }
3447
2984
  }]);
3448
-
3449
2985
  return Browser;
3450
2986
  }();
3451
-
3452
2987
  Browser.type = 'languageDetector';
3453
2988
 
3454
- i18next.use(Browser).init({
2989
+ instance.use(Browser).init({
3455
2990
  fallbackLng: 'en',
3456
2991
  debug: false,
3457
2992
  resources: {
@@ -3492,85 +3027,11 @@ i18next.use(Browser).init({
3492
3027
  },
3493
3028
  },
3494
3029
  });
3495
- const i18n = i18next;
3030
+ const i18n = instance;
3496
3031
 
3497
3032
  const stripePaymentSheetCss = ":root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-payment-sheet-wrap{display:block;width:100%;background:#fff;padding:32px 16px}.stripe-payment-sheet-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\", sans-serif;box-sizing:border-box}.stripe-payment-sheet-wrap button{cursor:pointer}.stripe-payment-sheet-wrap .StripeElement{padding:8px 16px;min-height:64px;border-bottom:1px solid var(--color-input-border);border-radius:4px;display:flex;justify-content:center;align-items:center}.stripe-payment-sheet-wrap .StripeElement>.__PrivateStripeElement{width:100%}.stripe-payment-sheet-wrap .stripe-input-box{background-color:#fff;border-radius:2px;filter:drop-shadow(0 0 1px var(--color-input-border))}.stripe-payment-sheet-wrap .stripe-input-column .StripeElement{border-right:1px solid var(--color-input-border)}.stripe-payment-sheet-wrap .stripe-input-column .StripeElement:last-child{border-right:none}.stripe-payment-sheet-wrap .stripe-heading{font-size:24px;font-weight:bold;color:var(--color-heading-text);margin-bottom:24px}.stripe-payment-sheet-wrap .stripe-section-title{font-size:14px;font-weight:bold;color:var(--color-label);margin-bottom:8px}.stripe-payment-sheet-wrap .payment-info label{color:var(--color-label)}.stripe-payment-sheet-wrap .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}.stripe-payment-sheet-wrap button{display:block;color:var(--color-button-text);background-color:var(--color-primary);width:100%;text-align:center;padding:16px 16px;font-size:18px;border-radius:8px;min-height:42px}.stripe-payment-sheet-wrap button:disabled{color:var(--color-button-text-disabled)}";
3498
3033
 
3499
- const StripePayment$1 = class extends HTMLElement {
3500
- constructor() {
3501
- super();
3502
- this.__registerHost();
3503
- this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
3504
- this.formSubmit = createEvent(this, "formSubmit", 7);
3505
- this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult", 7);
3506
- /**
3507
- * Status of the Stripe client initilizing process
3508
- */
3509
- this.loadStripeStatus = '';
3510
- /**
3511
- * Default submit handle type.
3512
- * If you want to use `setupIntent`, should update this attribute.
3513
- */
3514
- this.intentType = 'payment';
3515
- /**
3516
- * If true, show zip code field
3517
- */
3518
- this.zip = true;
3519
- /**
3520
- * Payment sheet title
3521
- * By default we recommended to use these string
3522
- * - 'Add your payment information' -> PaymentSheet / PaymentFlow(Android)
3523
- * - 'Add a card' -> PaymentFlow(iOS)
3524
- * These strings will translated automatically by this library.
3525
- */
3526
- this.sheetTitle = 'Add your payment information';
3527
- /**
3528
- * Submit button label
3529
- * By default we recommended to use these string
3530
- * - 'Pay' -> PaymentSheet
3531
- * - 'Add' -> PaymentFlow(Android)
3532
- * - 'Add card' -> PaymentFlow(iOS)
3533
- * - 'Add a card' -> PaymentFlow(iOS)
3534
- * These strings will translated automatically by this library.
3535
- *
3536
- */
3537
- this.buttonLabel = 'Pay';
3538
- /**
3539
- * The progress status of the checkout process
3540
- */
3541
- this.progress = '';
3542
- /**
3543
- * Error message
3544
- */
3545
- this.errorMessage = '';
3546
- /**
3547
- * zip code
3548
- */
3549
- this.zipCode = '';
3550
- /**
3551
- * Overwrite the application name that registered
3552
- * For wrapper library (like Capacitor)
3553
- */
3554
- this.applicationName = 'stripe-pwa-elements';
3555
- /**
3556
- * Show the form label
3557
- */
3558
- this.showLabel = false;
3559
- /**
3560
- * The component will provide a function to call the `stripe.confirmCardPayment`API.
3561
- * If you want to customize the behavior, should set false.
3562
- * And listen the 'formSubmit' event on the element
3563
- */
3564
- this.shouldUseDefaultFormSubmitAction = true;
3565
- if (this.publishableKey) {
3566
- this.initStripe(this.publishableKey, {
3567
- stripeAccount: this.stripeAccount,
3568
- });
3569
- }
3570
- else {
3571
- this.loadStripeStatus = 'failure';
3572
- }
3573
- }
3034
+ const StripePayment = /*@__PURE__*/ proxyCustomElement(class StripePayment extends HTMLElement {
3574
3035
  /**
3575
3036
  * Get Stripe.js, and initialize elements
3576
3037
  * @param publishableKey
@@ -3745,6 +3206,40 @@ const StripePayment$1 = class extends HTMLElement {
3745
3206
  throw e;
3746
3207
  }
3747
3208
  }
3209
+ constructor() {
3210
+ super();
3211
+ this.__registerHost();
3212
+ this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
3213
+ this.formSubmit = createEvent(this, "formSubmit", 7);
3214
+ this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult", 7);
3215
+ this.loadStripeStatus = '';
3216
+ this.stripe = undefined;
3217
+ this.intentType = 'payment';
3218
+ this.zip = true;
3219
+ this.sheetTitle = 'Add your payment information';
3220
+ this.buttonLabel = 'Pay';
3221
+ this.progress = '';
3222
+ this.errorMessage = '';
3223
+ this.zipCode = '';
3224
+ this.publishableKey = undefined;
3225
+ this.stripeAccount = undefined;
3226
+ this.applicationName = 'stripe-pwa-elements';
3227
+ this.showLabel = false;
3228
+ this.intentClientSecret = undefined;
3229
+ this.shouldUseDefaultFormSubmitAction = true;
3230
+ this.showPaymentRequestButton = undefined;
3231
+ this.paymentRequestOption = undefined;
3232
+ this.handleSubmit = undefined;
3233
+ this.stripeDidLoaded = undefined;
3234
+ if (this.publishableKey) {
3235
+ this.initStripe(this.publishableKey, {
3236
+ stripeAccount: this.stripeAccount,
3237
+ });
3238
+ }
3239
+ else {
3240
+ this.loadStripeStatus = 'failure';
3241
+ }
3242
+ }
3748
3243
  /**
3749
3244
  * Initialize Component using Stripe Element
3750
3245
  */
@@ -3860,354 +3355,50 @@ const StripePayment$1 = class extends HTMLElement {
3860
3355
  }
3861
3356
  get el() { return this; }
3862
3357
  static get style() { return stripePaymentSheetCss; }
3863
- };
3864
-
3865
- const stripePaymentRequestButtonCss = ":host{display:block}";
3866
-
3867
- const StripePaymentRequestButton$1 = class extends HTMLElement {
3868
- constructor() {
3869
- super();
3870
- this.__registerHost();
3871
- this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
3872
- this.loadStripeStatus = '';
3873
- /**
3874
- * Overwrite the application name that registered
3875
- * For wrapper library (like Capacitor)
3876
- */
3877
- this.applicationName = 'stripe-pwa-elements';
3878
- if (this.publishableKey !== undefined && this.paymentRequestOption !== undefined) {
3879
- this.initStripe(this.publishableKey, {
3880
- stripeAccount: this.stripeAccount,
3881
- });
3882
- }
3883
- else {
3884
- this.loadStripeStatus = 'failure';
3885
- }
3886
- }
3887
- /**
3888
- * Check isAvailable ApplePay or GooglePay.
3889
- * If you run this method, you should run before initStripe.
3890
- */
3891
- async isAvailable(type) {
3892
- if (this.publishableKey === undefined) {
3893
- throw 'You should run this method run, after set publishableKey.';
3894
- }
3895
- const stripe = await loadStripe(this.publishableKey, {
3896
- stripeAccount: this.stripeAccount,
3897
- });
3898
- const paymentRequest = stripe.paymentRequest({
3899
- country: 'US',
3900
- currency: 'usd',
3901
- total: {
3902
- label: 'Demo total',
3903
- amount: 1099,
3904
- },
3905
- disableWallets: ['applePay', 'googlePay', 'browserCard'].filter(method => method !== type),
3906
- });
3907
- const paymentRequestSupport = await paymentRequest.canMakePayment();
3908
- if (!paymentRequestSupport || (type === 'applePay' && !paymentRequestSupport[type]) || (type === 'googlePay' && !paymentRequestSupport[type])) {
3909
- throw 'This device can not use.';
3910
- }
3911
- }
3912
- /**
3913
- * Register event handler for `paymentRequest.on('paymentmethod'` event.
3914
- */
3915
- async setPaymentMethodEventHandler(handler) {
3916
- this.paymentMethodEventHandler = handler;
3917
- }
3918
- /**
3919
- * Register event handler for `paymentRequest.on('shippingoptionchange'` event.
3920
- */
3921
- async setPaymentRequestShippingOptionEventHandler(handler) {
3922
- this.shippingOptionEventHandler = handler;
3923
- }
3924
- /**
3925
- * Register event handler for `paymentRequest.on('shippingaddresschange'` event.
3926
- */
3927
- async setPaymentRequestShippingAddressEventHandler(handler) {
3928
- this.shippingAddressEventHandler = handler;
3929
- }
3930
- stripeLoadedEventHandler() {
3931
- const event = {
3932
- stripe: this.stripe,
3933
- };
3934
- if (this.stripeDidLoaded) {
3935
- this.stripeDidLoaded(event);
3936
- }
3937
- this.stripeLoaded.emit(event);
3938
- }
3939
- /**
3940
- * @param option
3941
- * @private
3942
- */
3943
- async setPaymentRequestOption(option) {
3944
- this.paymentRequestOption = option;
3945
- return this;
3358
+ }, [0, "stripe-payment", {
3359
+ "intentType": [1, "intent-type"],
3360
+ "zip": [4],
3361
+ "sheetTitle": [1, "sheet-title"],
3362
+ "buttonLabel": [1, "button-label"],
3363
+ "publishableKey": [1, "publishable-key"],
3364
+ "stripeAccount": [1, "stripe-account"],
3365
+ "applicationName": [1, "application-name"],
3366
+ "showLabel": [4, "show-label"],
3367
+ "intentClientSecret": [1, "intent-client-secret"],
3368
+ "shouldUseDefaultFormSubmitAction": [4, "should-use-default-form-submit-action"],
3369
+ "showPaymentRequestButton": [4, "show-payment-request-button"],
3370
+ "handleSubmit": [1040],
3371
+ "stripeDidLoaded": [1040],
3372
+ "loadStripeStatus": [32],
3373
+ "stripe": [32],
3374
+ "progress": [32],
3375
+ "errorMessage": [32],
3376
+ "zipCode": [32],
3377
+ "paymentRequestOption": [32],
3378
+ "initStripe": [64],
3379
+ "updateProgress": [64],
3380
+ "setErrorMessage": [64],
3381
+ "setPaymentRequestOption": [64]
3382
+ }]);
3383
+ function defineCustomElement() {
3384
+ if (typeof customElements === "undefined") {
3385
+ return;
3946
3386
  }
3947
- /**
3948
- * Get Stripe.js, and initialize elements
3949
- * @param publishableKey
3950
- * @param options
3951
- */
3952
- async initStripe(publishableKey, options = undefined) {
3953
- this.loadStripeStatus = 'loading';
3954
- loadStripe(publishableKey, {
3955
- stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
3956
- })
3957
- .then(stripe => {
3958
- this.loadStripeStatus = 'success';
3959
- stripe.registerAppInfo({
3960
- name: this.applicationName,
3961
- });
3962
- this.stripe = stripe;
3963
- return;
3964
- })
3965
- .catch(e => {
3966
- console.log(e);
3967
- this.loadStripeStatus = 'failure';
3968
- return;
3969
- })
3970
- .then(() => {
3971
- if (!this.stripe) {
3972
- return;
3387
+ const components = ["stripe-payment", "stripe-payment-request-button"];
3388
+ components.forEach(tagName => { switch (tagName) {
3389
+ case "stripe-payment":
3390
+ if (!customElements.get(tagName)) {
3391
+ customElements.define(tagName, StripePayment);
3973
3392
  }
3974
- // 後方互換のため、明確にfalseにしていないものはtrue扱い
3975
- return this.initElement(!(options === null || options === void 0 ? void 0 : options.showButton) === false);
3976
- })
3977
- .then(() => {
3978
- if (!this.stripe) {
3979
- return;
3393
+ break;
3394
+ case "stripe-payment-request-button":
3395
+ if (!customElements.get(tagName)) {
3396
+ defineCustomElement$1();
3980
3397
  }
3981
- this.stripeLoadedEventHandler();
3982
- });
3983
- }
3984
- /**
3985
- * Initialize Component using Stripe Element
3986
- */
3987
- async initElement(showButton = true) {
3988
- const paymentRequest = this.stripe.paymentRequest(this.paymentRequestOption);
3989
- // Check if the Payment Request is available (or Apple Pay on the Web).
3990
- const paymentRequestSupport = await paymentRequest.canMakePayment();
3991
- if (!paymentRequestSupport) {
3992
- throw 'paymentRequest is not support.';
3993
- }
3994
- if (this.paymentMethodEventHandler) {
3995
- paymentRequest.on('paymentmethod', event => {
3996
- this.paymentMethodEventHandler(event, this.stripe);
3997
- });
3998
- }
3999
- if (this.shippingOptionEventHandler) {
4000
- paymentRequest.on('shippingoptionchange', event => {
4001
- this.shippingOptionEventHandler(event, this.stripe);
4002
- });
4003
- }
4004
- if (this.shippingAddressEventHandler) {
4005
- paymentRequest.on('shippingaddresschange', event => {
4006
- this.shippingAddressEventHandler(event, this.stripe);
4007
- });
4008
- }
4009
- if (showButton) {
4010
- // Display the Pay button by mounting the Element in the DOM.
4011
- const elements = this.stripe.elements();
4012
- const paymentRequestButton = elements.create('paymentRequestButton', {
4013
- paymentRequest,
4014
- });
4015
- const paymentRequestButtonElement = this.el.querySelector('#payment-request-button');
4016
- paymentRequestButton.mount(paymentRequestButtonElement);
4017
- // Show the payment request section.
4018
- this.el.querySelector('#payment-request').classList.add('visible');
4019
- }
4020
- else {
4021
- /**
4022
- * This method must be called as the result of a user interaction (for example, in a click handler).
4023
- * https://stripe.com/docs/js/payment_request/show
4024
- */
4025
- paymentRequest.show();
4026
- }
4027
- }
4028
- render() {
4029
- return (h(Host, null, h("div", { id: "payment-request" }, h("div", { id: "payment-request-button" })), h("slot", null)));
4030
- }
4031
- get el() { return this; }
4032
- static get style() { return stripePaymentRequestButtonCss; }
4033
- };
4034
-
4035
- const stripePaymentSheetModalCss = ":host{display:block}";
4036
-
4037
- const StripePaymentSheet$1 = class extends HTMLElement {
4038
- constructor() {
4039
- super();
4040
- this.__registerHost();
4041
- this.closed = createEvent(this, "closed", 7);
4042
- /**
4043
- * Show the form label
4044
- */
4045
- this.showLabel = false;
4046
- /**
4047
- * The component will provide a function to call the `stripe.confirmCardPayment`API.
4048
- * If you want to customize the behavior, should set false.
4049
- * And listen the 'formSubmit' event on the element
4050
- */
4051
- this.shouldUseDefaultFormSubmitAction = true;
4052
- /**
4053
- * Default submit handle type.
4054
- * If you want to use `setupIntent`, should update this attribute.
4055
- * @example
4056
- * ```
4057
- * <stripe-payment-sheet intent-type="setup" />
4058
- * ```
4059
- */
4060
- this.intentType = 'payment';
4061
- /**
4062
- * If true, the modal display close button
4063
- */
4064
- this.showCloseButton = true;
4065
- /**
4066
- * If true, show zip code field
4067
- */
4068
- this.zip = true;
4069
- /**
4070
- * Modal state.
4071
- * If true, the modal will open
4072
- */
4073
- this.open = false;
4074
- }
4075
- componentDidLoad() {
4076
- const modal = this.el.querySelector('stripe-sheet');
4077
- modal.addEventListener('close', () => {
4078
- this.closed.emit();
4079
- });
4080
- }
4081
- /**
4082
- * Get the inner component
4083
- */
4084
- async getStripePaymentSheetElement() {
4085
- return this.el.querySelector('stripe-payment');
4086
- }
4087
- /**
4088
- * open modal
4089
- */
4090
- async present() {
4091
- this.open = true;
4092
- return new Promise((resolve, reject) => {
4093
- const paymentSheet = this.el.querySelector('stripe-payment');
4094
- paymentSheet.addEventListener('formSubmit', async (props) => {
4095
- resolve(props);
4096
- });
4097
- this.el.addEventListener('closed', () => reject());
4098
- });
4099
- }
4100
- /**
4101
- * Update Stripe client loading process
4102
- */
4103
- async updateProgress(progress) {
4104
- const paymentSheet = this.el.querySelector('stripe-payment');
4105
- return paymentSheet.updateProgress(progress);
4106
- }
4107
- /**
4108
- * Remove the modal
4109
- */
4110
- async destroy() {
4111
- const paymentSheet = this.el.querySelector('stripe-payment');
4112
- paymentSheet.remove();
4113
- this.el.remove();
4114
- }
4115
- /**
4116
- *
4117
- * Add payment request button
4118
- */
4119
- async setPaymentRequestButton(options) {
4120
- const elements = this.el.getElementsByTagName('stripe-payment');
4121
- if (elements.length < 1) {
4122
- return;
4123
- }
4124
- const paymentSheetElement = elements[0];
4125
- if (!paymentSheetElement) {
4126
- return;
4127
- }
4128
- paymentSheetElement.setAttribute('show-payment-request-button', 'true');
4129
- if (this.applicationName) {
4130
- paymentSheetElement.setAttribute('application-name', this.applicationName);
4131
- }
4132
- paymentSheetElement.setPaymentRequestOption(options);
4133
- }
4134
- render() {
4135
- return (h("stripe-sheet", { open: this.open, showCloseButton: this.showCloseButton }, h("stripe-payment", { showLabel: this.showLabel, publishableKey: this.publishableKey, intentClientSecret: this.intentClientSecret, shouldUseDefaultFormSubmitAction: this.shouldUseDefaultFormSubmitAction, handleSubmit: this.handleSubmit, stripeDidLoaded: this.stripeDidLoaded, intentType: this.intentType, zip: this.zip, buttonLabel: this.buttonLabel, sheetTitle: this.sheetTitle, applicationName: this.applicationName })));
4136
- }
4137
- get el() { return this; }
4138
- static get style() { return stripePaymentSheetModalCss; }
4139
- };
4140
-
4141
- const stripeElementModalCss = "*:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\", sans-serif;box-sizing:border-box}button{cursor:pointer}:root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{display:block}.modal-row{display:none}.modal-row.open{position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-child{padding:1.5rem;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{width:32px;display:block;fill:var(--color-label);cursor:pointer}";
4142
-
4143
- const StripeSheet$1 = class extends HTMLElement {
4144
- constructor() {
4145
- super();
4146
- this.__registerHost();
4147
- this.__attachShadow();
4148
- this.close = createEvent(this, "close", 7);
4149
- /**
4150
- * If true, the modal display close button
4151
- */
4152
- this.showCloseButton = true;
4153
- /**
4154
- * Modal state.
4155
- * If true, the modal will open
4156
- */
4157
- this.open = false;
4158
- }
4159
- /**
4160
- * Toggle modal state
4161
- */
4162
- async toggleModal() {
4163
- this.open = !this.open;
4164
- if (this.open === false) {
4165
- this.close.emit();
4166
- }
4167
- }
4168
- /**
4169
- * Open the modal
4170
- */
4171
- async openModal() {
4172
- this.open = true;
4173
- }
4174
- /**
4175
- * Close the modal
4176
- */
4177
- async closeModal() {
4178
- this.open = false;
4179
- this.close.emit();
4180
- }
4181
- componentDidLoad() {
4182
- this.el.classList.add(checkPlatform());
4183
- }
4184
- render() {
4185
- const { open, showCloseButton } = this;
4186
- return (h(Host, null, h("div", { class: `modal-row${open ? ' open' : ''}`, onClick: () => this.closeModal() }, h("div", { class: "modal-child", onClick: e => e.stopPropagation() }, showCloseButton ? (h("div", { class: "modal-close-button-wrap" }, h("ion-icon", { name: "close", size: "large", class: "modal-close-button", onClick: () => this.closeModal() }))) : null, h("slot", null)))));
4187
- }
4188
- get el() { return this; }
4189
- static get style() { return stripeElementModalCss; }
4190
- };
3398
+ break;
3399
+ } });
3400
+ }
4191
3401
 
4192
- const IonIcon = /*@__PURE__*/proxyCustomElement(Icon, [1,"ion-icon",{"mode":[1025],"color":[1],"ios":[1],"md":[1],"flipRtl":[4,"flip-rtl"],"name":[513],"src":[1],"icon":[8],"size":[1],"lazy":[4],"sanitize":[4],"svgContent":[32],"isVisible":[32],"ariaLabel":[32]}]);
4193
- const StripePayment = /*@__PURE__*/proxyCustomElement(StripePayment$1, [0,"stripe-payment",{"intentType":[1,"intent-type"],"zip":[4],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"showPaymentRequestButton":[4,"show-payment-request-button"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"progress":[32],"errorMessage":[32],"zipCode":[32],"paymentRequestOption":[32]}]);
4194
- const StripePaymentRequestButton = /*@__PURE__*/proxyCustomElement(StripePaymentRequestButton$1, [4,"stripe-payment-request-button",{"paymentMethodEventHandler":[16],"shippingOptionEventHandler":[16],"shippingAddressEventHandler":[16],"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"stripeDidLoaded":[1040],"loadStripeStatus":[32],"stripe":[32],"paymentRequestOption":[32]}]);
4195
- const StripePaymentSheet = /*@__PURE__*/proxyCustomElement(StripePaymentSheet$1, [0,"stripe-payment-sheet",{"publishableKey":[1,"publishable-key"],"stripeAccount":[1,"stripe-account"],"applicationName":[1,"application-name"],"showLabel":[4,"show-label"],"sheetTitle":[1,"sheet-title"],"buttonLabel":[1,"button-label"],"intentClientSecret":[1,"intent-client-secret"],"shouldUseDefaultFormSubmitAction":[4,"should-use-default-form-submit-action"],"intentType":[1,"intent-type"],"handleSubmit":[1040],"stripeDidLoaded":[1040],"showCloseButton":[4,"show-close-button"],"zip":[4],"open":[4]}]);
4196
- const StripeSheet = /*@__PURE__*/proxyCustomElement(StripeSheet$1, [1,"stripe-sheet",{"showCloseButton":[4,"show-close-button"],"open":[4]}]);
4197
- const defineCustomElements = (opts) => {
4198
- if (typeof customElements !== 'undefined') {
4199
- [
4200
- IonIcon,
4201
- StripePayment,
4202
- StripePaymentRequestButton,
4203
- StripePaymentSheet,
4204
- StripeSheet
4205
- ].forEach(cmp => {
4206
- if (!customElements.get(cmp.is)) {
4207
- customElements.define(cmp.is, cmp, opts);
4208
- }
4209
- });
4210
- }
4211
- };
3402
+ export { StripePayment as S, defineCustomElement as d };
4212
3403
 
4213
- export { IonIcon, StripePayment, StripePaymentRequestButton, StripePaymentSheet, StripeSheet, defineCustomElements };
3404
+ //# sourceMappingURL=stripe-payment-sheet2.js.map