stripe-pwa-elements 2.0.2 → 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.
- package/dist/cjs/{index-aec82bce.js → index-0cec7387.js} +616 -261
- package/dist/cjs/index-0cec7387.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/ion-icon.cjs.entry.js +68 -43
- package/dist/cjs/ion-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/stripe-elements.cjs.js +12 -3
- package/dist/cjs/stripe-elements.cjs.js.map +1 -0
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +26 -20
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js.map +1 -0
- package/dist/cjs/stripe-payment-sheet.cjs.entry.js +11 -27
- package/dist/cjs/stripe-payment-sheet.cjs.entry.js.map +1 -0
- package/dist/cjs/stripe-payment_2.cjs.entry.js +768 -728
- package/dist/cjs/stripe-payment_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{stripe.esm-648239f0.js → stripe.esm-603f3c17.js} +4 -2
- package/dist/cjs/stripe.esm-603f3c17.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/stripe-element-modal/stripe-element-modal.css +1 -1
- package/dist/collection/components/stripe-element-modal/stripe-element-modal.js +115 -116
- package/dist/collection/components/stripe-element-modal/stripe-element-modal.js.map +1 -0
- package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.e2e.js +10 -0
- package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.e2e.js.map +1 -0
- package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.spec.js +120 -0
- package/dist/collection/components/stripe-element-modal/test/stripe-element-modal.spec.js.map +1 -0
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +342 -328
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +1 -0
- package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.e2e.js +10 -0
- package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.e2e.js.map +1 -0
- package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.spec.js +18 -0
- package/dist/collection/components/stripe-payment-request-button/test/stripe-payment-request-button.spec.js.map +1 -0
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.css +1 -1
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js +483 -539
- package/dist/collection/components/stripe-payment-sheet/stripe-payment-sheet.js.map +1 -0
- package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.e2e.js +10 -0
- package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.e2e.js.map +1 -0
- package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.spec.js +111 -0
- package/dist/collection/components/stripe-payment-sheet/test/stripe-payment-sheet.spec.js.map +1 -0
- package/dist/collection/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.js +393 -401
- package/dist/collection/components/stripe-payment-sheet-modal/stripe-payment-sheet-modal.js.map +1 -0
- package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.e2e.js +10 -0
- package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.e2e.js.map +1 -0
- package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.spec.js +16 -0
- package/dist/collection/components/stripe-payment-sheet-modal/test/stripe-payment-sheet-modal.spec.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/interfaces.js +1 -0
- package/dist/collection/interfaces.js.map +1 -0
- package/dist/collection/utils/i18n.js +17 -0
- package/dist/collection/utils/i18n.js.map +1 -0
- package/dist/collection/utils/platform.js +1 -0
- package/dist/collection/utils/platform.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/icon.js +360 -0
- package/dist/components/icon.js.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/ion-icon.js +8 -0
- package/dist/components/ion-icon.js.map +1 -0
- package/dist/components/stripe-element-modal.js +75 -0
- package/dist/components/stripe-element-modal.js.map +1 -0
- package/dist/components/stripe-payment-request-button.d.ts +11 -0
- package/dist/components/stripe-payment-request-button.js +8 -0
- package/dist/components/stripe-payment-request-button.js.map +1 -0
- package/dist/components/stripe-payment-request-button2.js +337 -0
- package/dist/components/stripe-payment-request-button2.js.map +1 -0
- package/dist/components/stripe-payment-sheet.d.ts +11 -0
- package/dist/components/stripe-payment-sheet.js +153 -0
- package/dist/components/stripe-payment-sheet.js.map +1 -0
- package/dist/{custom-elements/index.js → components/stripe-payment-sheet2.js} +815 -1608
- package/dist/components/stripe-payment-sheet2.js.map +1 -0
- package/dist/components/stripe-payment.d.ts +11 -0
- package/dist/components/stripe-payment.js +8 -0
- package/dist/components/stripe-payment.js.map +1 -0
- package/dist/components/stripe-sheet.d.ts +11 -0
- package/dist/components/stripe-sheet.js +8 -0
- package/dist/components/stripe-sheet.js.map +1 -0
- package/dist/components/utils.js +105 -0
- package/dist/components/utils.js.map +1 -0
- package/dist/esm/{index-a7e5d6fd.js → index-58f9666b.js} +616 -262
- package/dist/esm/index-58f9666b.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/ion-icon.entry.js +68 -43
- package/dist/esm/ion-icon.entry.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/stripe-elements.js +9 -3
- package/dist/esm/stripe-elements.js.map +1 -0
- package/dist/esm/stripe-payment-request-button.entry.js +26 -20
- package/dist/esm/stripe-payment-request-button.entry.js.map +1 -0
- package/dist/esm/stripe-payment-sheet.entry.js +11 -27
- package/dist/esm/stripe-payment-sheet.entry.js.map +1 -0
- package/dist/esm/stripe-payment_2.entry.js +768 -728
- package/dist/esm/stripe-payment_2.entry.js.map +1 -0
- package/dist/esm/{stripe.esm-ea56157a.js → stripe.esm-bad47977.js} +4 -2
- package/dist/esm/stripe.esm-bad47977.js.map +1 -0
- package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +46 -4
- package/dist/stripe-elements/index.esm.js +2 -0
- package/dist/stripe-elements/index.esm.js.map +1 -0
- package/dist/stripe-elements/p-06c00b5c.entry.js +2 -0
- package/dist/stripe-elements/p-06c00b5c.entry.js.map +1 -0
- package/dist/stripe-elements/p-1b4515a4.js +3 -0
- package/dist/stripe-elements/p-1b4515a4.js.map +1 -0
- package/dist/stripe-elements/p-3458123a.entry.js +2 -0
- package/dist/stripe-elements/p-3458123a.entry.js.map +1 -0
- package/dist/stripe-elements/p-3a90ad5d.entry.js +2 -0
- package/dist/stripe-elements/p-3a90ad5d.entry.js.map +1 -0
- package/dist/stripe-elements/p-b10d8613.js +2 -0
- package/dist/stripe-elements/p-b10d8613.js.map +1 -0
- package/dist/stripe-elements/p-c5a2b2e8.entry.js +2 -0
- package/dist/stripe-elements/p-c5a2b2e8.entry.js.map +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +2 -1
- package/dist/stripe-elements/stripe-elements.esm.js.map +1 -0
- package/dist/stripe-elements/svg/accessibility-outline.svg +1 -1
- package/dist/stripe-elements/svg/accessibility-sharp.svg +1 -1
- package/dist/stripe-elements/svg/accessibility.svg +1 -1
- package/dist/stripe-elements/svg/add-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/add-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/add-circle.svg +1 -1
- package/dist/stripe-elements/svg/add-outline.svg +1 -1
- package/dist/stripe-elements/svg/add-sharp.svg +1 -1
- package/dist/stripe-elements/svg/add.svg +1 -1
- package/dist/stripe-elements/svg/airplane-outline.svg +1 -1
- package/dist/stripe-elements/svg/airplane-sharp.svg +1 -1
- package/dist/stripe-elements/svg/airplane.svg +1 -1
- package/dist/stripe-elements/svg/alarm-outline.svg +1 -1
- package/dist/stripe-elements/svg/alarm-sharp.svg +1 -1
- package/dist/stripe-elements/svg/alarm.svg +1 -1
- package/dist/stripe-elements/svg/albums-outline.svg +1 -1
- package/dist/stripe-elements/svg/albums-sharp.svg +1 -1
- package/dist/stripe-elements/svg/albums.svg +1 -1
- package/dist/stripe-elements/svg/alert-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/alert-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/alert-circle.svg +1 -1
- package/dist/stripe-elements/svg/alert-outline.svg +1 -1
- package/dist/stripe-elements/svg/alert-sharp.svg +1 -1
- package/dist/stripe-elements/svg/alert.svg +1 -1
- package/dist/stripe-elements/svg/american-football-outline.svg +1 -1
- package/dist/stripe-elements/svg/american-football-sharp.svg +1 -1
- package/dist/stripe-elements/svg/american-football.svg +1 -1
- package/dist/stripe-elements/svg/analytics-outline.svg +1 -1
- package/dist/stripe-elements/svg/analytics-sharp.svg +1 -1
- package/dist/stripe-elements/svg/analytics.svg +1 -1
- package/dist/stripe-elements/svg/aperture-outline.svg +1 -1
- package/dist/stripe-elements/svg/aperture-sharp.svg +1 -1
- package/dist/stripe-elements/svg/aperture.svg +1 -1
- package/dist/stripe-elements/svg/apps-outline.svg +1 -1
- package/dist/stripe-elements/svg/apps-sharp.svg +1 -1
- package/dist/stripe-elements/svg/apps.svg +1 -1
- package/dist/stripe-elements/svg/archive-outline.svg +1 -1
- package/dist/stripe-elements/svg/archive-sharp.svg +1 -1
- package/dist/stripe-elements/svg/archive.svg +1 -1
- package/dist/stripe-elements/svg/arrow-back-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-back-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-back-circle.svg +1 -1
- package/dist/stripe-elements/svg/arrow-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-back.svg +1 -1
- package/dist/stripe-elements/svg/arrow-down-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-down-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-down-circle.svg +1 -1
- package/dist/stripe-elements/svg/arrow-down-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-down-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-down.svg +1 -1
- package/dist/stripe-elements/svg/arrow-forward-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-forward-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-forward-circle.svg +1 -1
- package/dist/stripe-elements/svg/arrow-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-forward.svg +1 -1
- package/dist/stripe-elements/svg/arrow-redo-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-redo-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-redo-circle.svg +1 -1
- package/dist/stripe-elements/svg/arrow-redo-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-redo-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-redo.svg +1 -1
- package/dist/stripe-elements/svg/arrow-undo-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-undo-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-undo-circle.svg +1 -1
- package/dist/stripe-elements/svg/arrow-undo-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-undo-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-undo.svg +1 -1
- package/dist/stripe-elements/svg/arrow-up-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-up-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-up-circle.svg +1 -1
- package/dist/stripe-elements/svg/arrow-up-outline.svg +1 -1
- package/dist/stripe-elements/svg/arrow-up-sharp.svg +1 -1
- package/dist/stripe-elements/svg/arrow-up.svg +1 -1
- package/dist/stripe-elements/svg/at-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/at-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/at-circle.svg +1 -1
- package/dist/stripe-elements/svg/at-outline.svg +1 -1
- package/dist/stripe-elements/svg/at-sharp.svg +1 -1
- package/dist/stripe-elements/svg/at.svg +1 -1
- package/dist/stripe-elements/svg/attach-outline.svg +1 -1
- package/dist/stripe-elements/svg/attach-sharp.svg +1 -1
- package/dist/stripe-elements/svg/attach.svg +1 -1
- package/dist/stripe-elements/svg/backspace-outline.svg +1 -1
- package/dist/stripe-elements/svg/backspace-sharp.svg +1 -1
- package/dist/stripe-elements/svg/backspace.svg +1 -1
- package/dist/stripe-elements/svg/bag-add-outline.svg +1 -1
- package/dist/stripe-elements/svg/bag-add-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bag-add.svg +1 -1
- package/dist/stripe-elements/svg/bag-check-outline.svg +1 -1
- package/dist/stripe-elements/svg/bag-check-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bag-check.svg +1 -1
- package/dist/stripe-elements/svg/bag-handle-outline.svg +1 -1
- package/dist/stripe-elements/svg/bag-handle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bag-handle.svg +1 -1
- package/dist/stripe-elements/svg/bag-outline.svg +1 -1
- package/dist/stripe-elements/svg/bag-remove-outline.svg +1 -1
- package/dist/stripe-elements/svg/bag-remove-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bag-remove.svg +1 -1
- package/dist/stripe-elements/svg/bag-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bag.svg +1 -1
- package/dist/stripe-elements/svg/balloon-outline.svg +1 -1
- package/dist/stripe-elements/svg/balloon-sharp.svg +1 -1
- package/dist/stripe-elements/svg/balloon.svg +1 -1
- package/dist/stripe-elements/svg/ban-outline.svg +1 -1
- package/dist/stripe-elements/svg/ban-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ban.svg +1 -1
- package/dist/stripe-elements/svg/bandage-outline.svg +1 -1
- package/dist/stripe-elements/svg/bandage-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bandage.svg +1 -1
- package/dist/stripe-elements/svg/bar-chart-outline.svg +1 -1
- package/dist/stripe-elements/svg/bar-chart-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bar-chart.svg +1 -1
- package/dist/stripe-elements/svg/barbell-outline.svg +1 -1
- package/dist/stripe-elements/svg/barbell-sharp.svg +1 -1
- package/dist/stripe-elements/svg/barbell.svg +1 -1
- package/dist/stripe-elements/svg/barcode-outline.svg +1 -1
- package/dist/stripe-elements/svg/barcode-sharp.svg +1 -1
- package/dist/stripe-elements/svg/barcode.svg +1 -1
- package/dist/stripe-elements/svg/baseball-outline.svg +1 -1
- package/dist/stripe-elements/svg/baseball-sharp.svg +1 -1
- package/dist/stripe-elements/svg/baseball.svg +1 -1
- package/dist/stripe-elements/svg/basket-outline.svg +1 -1
- package/dist/stripe-elements/svg/basket-sharp.svg +1 -1
- package/dist/stripe-elements/svg/basket.svg +1 -1
- package/dist/stripe-elements/svg/basketball-outline.svg +1 -1
- package/dist/stripe-elements/svg/basketball-sharp.svg +1 -1
- package/dist/stripe-elements/svg/basketball.svg +1 -1
- package/dist/stripe-elements/svg/battery-charging-outline.svg +1 -1
- package/dist/stripe-elements/svg/battery-charging-sharp.svg +1 -1
- package/dist/stripe-elements/svg/battery-charging.svg +1 -1
- package/dist/stripe-elements/svg/battery-dead-outline.svg +1 -1
- package/dist/stripe-elements/svg/battery-dead-sharp.svg +1 -1
- package/dist/stripe-elements/svg/battery-dead.svg +1 -1
- package/dist/stripe-elements/svg/battery-full-outline.svg +1 -1
- package/dist/stripe-elements/svg/battery-full-sharp.svg +1 -1
- package/dist/stripe-elements/svg/battery-full.svg +1 -1
- package/dist/stripe-elements/svg/battery-half-outline.svg +1 -1
- package/dist/stripe-elements/svg/battery-half-sharp.svg +1 -1
- package/dist/stripe-elements/svg/battery-half.svg +1 -1
- package/dist/stripe-elements/svg/beaker-outline.svg +1 -1
- package/dist/stripe-elements/svg/beaker-sharp.svg +1 -1
- package/dist/stripe-elements/svg/beaker.svg +1 -1
- package/dist/stripe-elements/svg/bed-outline.svg +1 -1
- package/dist/stripe-elements/svg/bed-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bed.svg +1 -1
- package/dist/stripe-elements/svg/beer-outline.svg +1 -1
- package/dist/stripe-elements/svg/beer-sharp.svg +1 -1
- package/dist/stripe-elements/svg/beer.svg +1 -1
- package/dist/stripe-elements/svg/bicycle-outline.svg +1 -1
- package/dist/stripe-elements/svg/bicycle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bicycle.svg +1 -1
- package/dist/stripe-elements/svg/bluetooth-outline.svg +1 -1
- package/dist/stripe-elements/svg/bluetooth-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bluetooth.svg +1 -1
- package/dist/stripe-elements/svg/boat-outline.svg +1 -1
- package/dist/stripe-elements/svg/boat-sharp.svg +1 -1
- package/dist/stripe-elements/svg/boat.svg +1 -1
- package/dist/stripe-elements/svg/body-outline.svg +1 -1
- package/dist/stripe-elements/svg/body-sharp.svg +1 -1
- package/dist/stripe-elements/svg/body.svg +1 -1
- package/dist/stripe-elements/svg/bonfire-outline.svg +1 -1
- package/dist/stripe-elements/svg/bonfire-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bonfire.svg +1 -1
- package/dist/stripe-elements/svg/book-outline.svg +1 -1
- package/dist/stripe-elements/svg/book-sharp.svg +1 -1
- package/dist/stripe-elements/svg/book.svg +1 -1
- package/dist/stripe-elements/svg/bookmark-outline.svg +1 -1
- package/dist/stripe-elements/svg/bookmark-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bookmark.svg +1 -1
- package/dist/stripe-elements/svg/bookmarks-outline.svg +1 -1
- package/dist/stripe-elements/svg/bookmarks-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bookmarks.svg +1 -1
- package/dist/stripe-elements/svg/bowling-ball-outline.svg +1 -1
- package/dist/stripe-elements/svg/bowling-ball-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bowling-ball.svg +1 -1
- package/dist/stripe-elements/svg/briefcase-outline.svg +1 -1
- package/dist/stripe-elements/svg/briefcase-sharp.svg +1 -1
- package/dist/stripe-elements/svg/briefcase.svg +1 -1
- package/dist/stripe-elements/svg/browsers-outline.svg +1 -1
- package/dist/stripe-elements/svg/browsers-sharp.svg +1 -1
- package/dist/stripe-elements/svg/browsers.svg +1 -1
- package/dist/stripe-elements/svg/brush-outline.svg +1 -1
- package/dist/stripe-elements/svg/brush-sharp.svg +1 -1
- package/dist/stripe-elements/svg/brush.svg +1 -1
- package/dist/stripe-elements/svg/bug-outline.svg +1 -1
- package/dist/stripe-elements/svg/bug-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bug.svg +1 -1
- package/dist/stripe-elements/svg/build-outline.svg +1 -1
- package/dist/stripe-elements/svg/build-sharp.svg +1 -1
- package/dist/stripe-elements/svg/build.svg +1 -1
- package/dist/stripe-elements/svg/bulb-outline.svg +1 -1
- package/dist/stripe-elements/svg/bulb-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bulb.svg +1 -1
- package/dist/stripe-elements/svg/bus-outline.svg +1 -1
- package/dist/stripe-elements/svg/bus-sharp.svg +1 -1
- package/dist/stripe-elements/svg/bus.svg +1 -1
- package/dist/stripe-elements/svg/business-outline.svg +1 -1
- package/dist/stripe-elements/svg/business-sharp.svg +1 -1
- package/dist/stripe-elements/svg/business.svg +1 -1
- package/dist/stripe-elements/svg/cafe-outline.svg +1 -1
- package/dist/stripe-elements/svg/cafe-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cafe.svg +1 -1
- package/dist/stripe-elements/svg/calculator-outline.svg +1 -1
- package/dist/stripe-elements/svg/calculator-sharp.svg +1 -1
- package/dist/stripe-elements/svg/calculator.svg +1 -1
- package/dist/stripe-elements/svg/calendar-clear-outline.svg +1 -1
- package/dist/stripe-elements/svg/calendar-clear-sharp.svg +1 -1
- package/dist/stripe-elements/svg/calendar-clear.svg +1 -1
- package/dist/stripe-elements/svg/calendar-number-outline.svg +1 -1
- package/dist/stripe-elements/svg/calendar-number-sharp.svg +1 -1
- package/dist/stripe-elements/svg/calendar-number.svg +1 -1
- package/dist/stripe-elements/svg/calendar-outline.svg +1 -1
- package/dist/stripe-elements/svg/calendar-sharp.svg +1 -1
- package/dist/stripe-elements/svg/calendar.svg +1 -1
- package/dist/stripe-elements/svg/call-outline.svg +1 -1
- package/dist/stripe-elements/svg/call-sharp.svg +1 -1
- package/dist/stripe-elements/svg/call.svg +1 -1
- package/dist/stripe-elements/svg/camera-outline.svg +1 -1
- package/dist/stripe-elements/svg/camera-reverse-outline.svg +1 -1
- package/dist/stripe-elements/svg/camera-reverse-sharp.svg +1 -1
- package/dist/stripe-elements/svg/camera-reverse.svg +1 -1
- package/dist/stripe-elements/svg/camera-sharp.svg +1 -1
- package/dist/stripe-elements/svg/camera.svg +1 -1
- package/dist/stripe-elements/svg/car-outline.svg +1 -1
- package/dist/stripe-elements/svg/car-sharp.svg +1 -1
- package/dist/stripe-elements/svg/car-sport-outline.svg +1 -1
- package/dist/stripe-elements/svg/car-sport-sharp.svg +1 -1
- package/dist/stripe-elements/svg/car-sport.svg +1 -1
- package/dist/stripe-elements/svg/car.svg +1 -1
- package/dist/stripe-elements/svg/card-outline.svg +1 -1
- package/dist/stripe-elements/svg/card-sharp.svg +1 -1
- package/dist/stripe-elements/svg/card.svg +1 -1
- package/dist/stripe-elements/svg/caret-back-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-back-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-back-circle.svg +1 -1
- package/dist/stripe-elements/svg/caret-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-back.svg +1 -1
- package/dist/stripe-elements/svg/caret-down-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-down-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-down-circle.svg +1 -1
- package/dist/stripe-elements/svg/caret-down-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-down-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-down.svg +1 -1
- package/dist/stripe-elements/svg/caret-forward-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-forward-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-forward-circle.svg +1 -1
- package/dist/stripe-elements/svg/caret-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-forward.svg +1 -1
- package/dist/stripe-elements/svg/caret-up-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-up-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-up-circle.svg +1 -1
- package/dist/stripe-elements/svg/caret-up-outline.svg +1 -1
- package/dist/stripe-elements/svg/caret-up-sharp.svg +1 -1
- package/dist/stripe-elements/svg/caret-up.svg +1 -1
- package/dist/stripe-elements/svg/cart-outline.svg +1 -1
- package/dist/stripe-elements/svg/cart-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cart.svg +1 -1
- package/dist/stripe-elements/svg/cash-outline.svg +1 -1
- package/dist/stripe-elements/svg/cash-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cash.svg +1 -1
- package/dist/stripe-elements/svg/cellular-outline.svg +1 -1
- package/dist/stripe-elements/svg/cellular-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cellular.svg +1 -1
- package/dist/stripe-elements/svg/chatbox-ellipses-outline.svg +1 -1
- package/dist/stripe-elements/svg/chatbox-ellipses-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chatbox-ellipses.svg +1 -1
- package/dist/stripe-elements/svg/chatbox-outline.svg +1 -1
- package/dist/stripe-elements/svg/chatbox-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chatbox.svg +1 -1
- package/dist/stripe-elements/svg/chatbubble-ellipses-outline.svg +1 -1
- package/dist/stripe-elements/svg/chatbubble-ellipses-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chatbubble-ellipses.svg +1 -1
- package/dist/stripe-elements/svg/chatbubble-outline.svg +1 -1
- package/dist/stripe-elements/svg/chatbubble-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chatbubble.svg +1 -1
- package/dist/stripe-elements/svg/chatbubbles-outline.svg +1 -1
- package/dist/stripe-elements/svg/chatbubbles-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chatbubbles.svg +1 -1
- package/dist/stripe-elements/svg/checkbox-outline.svg +1 -1
- package/dist/stripe-elements/svg/checkbox-sharp.svg +1 -1
- package/dist/stripe-elements/svg/checkbox.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-circle.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-done-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-done-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-done-circle.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-done-outline.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-done-sharp.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-done.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-outline.svg +1 -1
- package/dist/stripe-elements/svg/checkmark-sharp.svg +1 -1
- package/dist/stripe-elements/svg/checkmark.svg +1 -1
- package/dist/stripe-elements/svg/chevron-back-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-back-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-back-circle.svg +1 -1
- package/dist/stripe-elements/svg/chevron-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-back.svg +1 -1
- package/dist/stripe-elements/svg/chevron-collapse-outline.svg +1 -0
- package/dist/stripe-elements/svg/chevron-collapse-sharp.svg +1 -0
- package/dist/stripe-elements/svg/chevron-collapse.svg +1 -0
- package/dist/stripe-elements/svg/chevron-down-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-down-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-down-circle.svg +1 -1
- package/dist/stripe-elements/svg/chevron-down-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-down-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-down.svg +1 -1
- package/dist/stripe-elements/svg/chevron-expand-outline.svg +1 -0
- package/dist/stripe-elements/svg/chevron-expand-sharp.svg +1 -0
- package/dist/stripe-elements/svg/chevron-expand.svg +1 -0
- package/dist/stripe-elements/svg/chevron-forward-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-forward-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-forward-circle.svg +1 -1
- package/dist/stripe-elements/svg/chevron-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-forward.svg +1 -1
- package/dist/stripe-elements/svg/chevron-up-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-up-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-up-circle.svg +1 -1
- package/dist/stripe-elements/svg/chevron-up-outline.svg +1 -1
- package/dist/stripe-elements/svg/chevron-up-sharp.svg +1 -1
- package/dist/stripe-elements/svg/chevron-up.svg +1 -1
- package/dist/stripe-elements/svg/clipboard-outline.svg +1 -1
- package/dist/stripe-elements/svg/clipboard-sharp.svg +1 -1
- package/dist/stripe-elements/svg/clipboard.svg +1 -1
- package/dist/stripe-elements/svg/close-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/close-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/close-circle.svg +1 -1
- package/dist/stripe-elements/svg/close-outline.svg +1 -1
- package/dist/stripe-elements/svg/close-sharp.svg +1 -1
- package/dist/stripe-elements/svg/close.svg +1 -1
- package/dist/stripe-elements/svg/cloud-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloud-circle.svg +1 -1
- package/dist/stripe-elements/svg/cloud-done-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-done-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloud-done.svg +1 -1
- package/dist/stripe-elements/svg/cloud-download-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-download-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloud-download.svg +1 -1
- package/dist/stripe-elements/svg/cloud-offline-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-offline-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloud-offline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloud-upload-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloud-upload-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloud-upload.svg +1 -1
- package/dist/stripe-elements/svg/cloud.svg +1 -1
- package/dist/stripe-elements/svg/cloudy-night-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloudy-night-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloudy-night.svg +1 -1
- package/dist/stripe-elements/svg/cloudy-outline.svg +1 -1
- package/dist/stripe-elements/svg/cloudy-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cloudy.svg +1 -1
- package/dist/stripe-elements/svg/code-download-outline.svg +1 -1
- package/dist/stripe-elements/svg/code-download-sharp.svg +1 -1
- package/dist/stripe-elements/svg/code-download.svg +1 -1
- package/dist/stripe-elements/svg/code-outline.svg +1 -1
- package/dist/stripe-elements/svg/code-sharp.svg +1 -1
- package/dist/stripe-elements/svg/code-slash-outline.svg +1 -1
- package/dist/stripe-elements/svg/code-slash-sharp.svg +1 -1
- package/dist/stripe-elements/svg/code-slash.svg +1 -1
- package/dist/stripe-elements/svg/code-working-outline.svg +1 -1
- package/dist/stripe-elements/svg/code-working-sharp.svg +1 -1
- package/dist/stripe-elements/svg/code-working.svg +1 -1
- package/dist/stripe-elements/svg/code.svg +1 -1
- package/dist/stripe-elements/svg/cog-outline.svg +1 -1
- package/dist/stripe-elements/svg/cog-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cog.svg +1 -1
- package/dist/stripe-elements/svg/color-fill-outline.svg +1 -1
- package/dist/stripe-elements/svg/color-fill-sharp.svg +1 -1
- package/dist/stripe-elements/svg/color-fill.svg +1 -1
- package/dist/stripe-elements/svg/color-filter-outline.svg +1 -1
- package/dist/stripe-elements/svg/color-filter-sharp.svg +1 -1
- package/dist/stripe-elements/svg/color-filter.svg +1 -1
- package/dist/stripe-elements/svg/color-palette-outline.svg +1 -1
- package/dist/stripe-elements/svg/color-palette-sharp.svg +1 -1
- package/dist/stripe-elements/svg/color-palette.svg +1 -1
- package/dist/stripe-elements/svg/color-wand-outline.svg +1 -1
- package/dist/stripe-elements/svg/color-wand-sharp.svg +1 -1
- package/dist/stripe-elements/svg/color-wand.svg +1 -1
- package/dist/stripe-elements/svg/compass-outline.svg +1 -1
- package/dist/stripe-elements/svg/compass-sharp.svg +1 -1
- package/dist/stripe-elements/svg/compass.svg +1 -1
- package/dist/stripe-elements/svg/construct-outline.svg +1 -1
- package/dist/stripe-elements/svg/construct-sharp.svg +1 -1
- package/dist/stripe-elements/svg/construct.svg +1 -1
- package/dist/stripe-elements/svg/contract-outline.svg +1 -1
- package/dist/stripe-elements/svg/contract-sharp.svg +1 -1
- package/dist/stripe-elements/svg/contract.svg +1 -1
- package/dist/stripe-elements/svg/contrast-outline.svg +1 -1
- package/dist/stripe-elements/svg/contrast-sharp.svg +1 -1
- package/dist/stripe-elements/svg/contrast.svg +1 -1
- package/dist/stripe-elements/svg/copy-outline.svg +1 -1
- package/dist/stripe-elements/svg/copy-sharp.svg +1 -1
- package/dist/stripe-elements/svg/copy.svg +1 -1
- package/dist/stripe-elements/svg/create-outline.svg +1 -1
- package/dist/stripe-elements/svg/create-sharp.svg +1 -1
- package/dist/stripe-elements/svg/create.svg +1 -1
- package/dist/stripe-elements/svg/crop-outline.svg +1 -1
- package/dist/stripe-elements/svg/crop-sharp.svg +1 -1
- package/dist/stripe-elements/svg/crop.svg +1 -1
- package/dist/stripe-elements/svg/cube-outline.svg +1 -1
- package/dist/stripe-elements/svg/cube-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cube.svg +1 -1
- package/dist/stripe-elements/svg/cut-outline.svg +1 -1
- package/dist/stripe-elements/svg/cut-sharp.svg +1 -1
- package/dist/stripe-elements/svg/cut.svg +1 -1
- package/dist/stripe-elements/svg/desktop-outline.svg +1 -1
- package/dist/stripe-elements/svg/desktop-sharp.svg +1 -1
- package/dist/stripe-elements/svg/desktop.svg +1 -1
- package/dist/stripe-elements/svg/diamond-outline.svg +1 -1
- package/dist/stripe-elements/svg/diamond-sharp.svg +1 -1
- package/dist/stripe-elements/svg/diamond.svg +1 -1
- package/dist/stripe-elements/svg/dice-outline.svg +1 -1
- package/dist/stripe-elements/svg/dice-sharp.svg +1 -1
- package/dist/stripe-elements/svg/dice.svg +1 -1
- package/dist/stripe-elements/svg/disc-outline.svg +1 -1
- package/dist/stripe-elements/svg/disc-sharp.svg +1 -1
- package/dist/stripe-elements/svg/disc.svg +1 -1
- package/dist/stripe-elements/svg/document-attach-outline.svg +1 -1
- package/dist/stripe-elements/svg/document-attach-sharp.svg +1 -1
- package/dist/stripe-elements/svg/document-attach.svg +1 -1
- package/dist/stripe-elements/svg/document-lock-outline.svg +1 -1
- package/dist/stripe-elements/svg/document-lock-sharp.svg +1 -1
- package/dist/stripe-elements/svg/document-lock.svg +1 -1
- package/dist/stripe-elements/svg/document-outline.svg +1 -1
- package/dist/stripe-elements/svg/document-sharp.svg +1 -1
- package/dist/stripe-elements/svg/document-text-outline.svg +1 -1
- package/dist/stripe-elements/svg/document-text-sharp.svg +1 -1
- package/dist/stripe-elements/svg/document-text.svg +1 -1
- package/dist/stripe-elements/svg/document.svg +1 -1
- package/dist/stripe-elements/svg/documents-outline.svg +1 -1
- package/dist/stripe-elements/svg/documents-sharp.svg +1 -1
- package/dist/stripe-elements/svg/documents.svg +1 -1
- package/dist/stripe-elements/svg/download-outline.svg +1 -1
- package/dist/stripe-elements/svg/download-sharp.svg +1 -1
- package/dist/stripe-elements/svg/download.svg +1 -1
- package/dist/stripe-elements/svg/duplicate-outline.svg +1 -1
- package/dist/stripe-elements/svg/duplicate-sharp.svg +1 -1
- package/dist/stripe-elements/svg/duplicate.svg +1 -1
- package/dist/stripe-elements/svg/ear-outline.svg +1 -1
- package/dist/stripe-elements/svg/ear-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ear.svg +1 -1
- package/dist/stripe-elements/svg/earth-outline.svg +1 -1
- package/dist/stripe-elements/svg/earth-sharp.svg +1 -1
- package/dist/stripe-elements/svg/earth.svg +1 -1
- package/dist/stripe-elements/svg/easel-outline.svg +1 -1
- package/dist/stripe-elements/svg/easel-sharp.svg +1 -1
- package/dist/stripe-elements/svg/easel.svg +1 -1
- package/dist/stripe-elements/svg/egg-outline.svg +1 -1
- package/dist/stripe-elements/svg/egg-sharp.svg +1 -1
- package/dist/stripe-elements/svg/egg.svg +1 -1
- package/dist/stripe-elements/svg/ellipse-outline.svg +1 -1
- package/dist/stripe-elements/svg/ellipse-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ellipse.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-horizontal-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-horizontal-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-horizontal-circle.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-horizontal-outline.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-horizontal-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-horizontal.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-vertical-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-vertical-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-vertical-circle.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-vertical-outline.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-vertical-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ellipsis-vertical.svg +1 -1
- package/dist/stripe-elements/svg/enter-outline.svg +1 -1
- package/dist/stripe-elements/svg/enter-sharp.svg +1 -1
- package/dist/stripe-elements/svg/enter.svg +1 -1
- package/dist/stripe-elements/svg/exit-outline.svg +1 -1
- package/dist/stripe-elements/svg/exit-sharp.svg +1 -1
- package/dist/stripe-elements/svg/exit.svg +1 -1
- package/dist/stripe-elements/svg/expand-outline.svg +1 -1
- package/dist/stripe-elements/svg/expand-sharp.svg +1 -1
- package/dist/stripe-elements/svg/expand.svg +1 -1
- package/dist/stripe-elements/svg/extension-puzzle-outline.svg +1 -1
- package/dist/stripe-elements/svg/extension-puzzle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/extension-puzzle.svg +1 -1
- package/dist/stripe-elements/svg/eye-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/eye-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/eye-off.svg +1 -1
- package/dist/stripe-elements/svg/eye-outline.svg +1 -1
- package/dist/stripe-elements/svg/eye-sharp.svg +1 -1
- package/dist/stripe-elements/svg/eye.svg +1 -1
- package/dist/stripe-elements/svg/eyedrop-outline.svg +1 -1
- package/dist/stripe-elements/svg/eyedrop-sharp.svg +1 -1
- package/dist/stripe-elements/svg/eyedrop.svg +1 -1
- package/dist/stripe-elements/svg/fast-food-outline.svg +1 -1
- package/dist/stripe-elements/svg/fast-food-sharp.svg +1 -1
- package/dist/stripe-elements/svg/fast-food.svg +1 -1
- package/dist/stripe-elements/svg/female-outline.svg +1 -1
- package/dist/stripe-elements/svg/female-sharp.svg +1 -1
- package/dist/stripe-elements/svg/female.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-full-outline.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-full-sharp.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-full.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-outline.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-sharp.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-stacked-outline.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-stacked-sharp.svg +1 -1
- package/dist/stripe-elements/svg/file-tray-stacked.svg +1 -1
- package/dist/stripe-elements/svg/file-tray.svg +1 -1
- package/dist/stripe-elements/svg/film-outline.svg +1 -1
- package/dist/stripe-elements/svg/film-sharp.svg +1 -1
- package/dist/stripe-elements/svg/film.svg +1 -1
- package/dist/stripe-elements/svg/filter-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/filter-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/filter-circle.svg +1 -1
- package/dist/stripe-elements/svg/filter-outline.svg +1 -1
- package/dist/stripe-elements/svg/filter-sharp.svg +1 -1
- package/dist/stripe-elements/svg/filter.svg +1 -1
- package/dist/stripe-elements/svg/finger-print-outline.svg +1 -1
- package/dist/stripe-elements/svg/finger-print-sharp.svg +1 -1
- package/dist/stripe-elements/svg/finger-print.svg +1 -1
- package/dist/stripe-elements/svg/fish-outline.svg +1 -1
- package/dist/stripe-elements/svg/fish-sharp.svg +1 -1
- package/dist/stripe-elements/svg/fish.svg +1 -1
- package/dist/stripe-elements/svg/fitness-outline.svg +1 -1
- package/dist/stripe-elements/svg/fitness-sharp.svg +1 -1
- package/dist/stripe-elements/svg/fitness.svg +1 -1
- package/dist/stripe-elements/svg/flag-outline.svg +1 -1
- package/dist/stripe-elements/svg/flag-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flag.svg +1 -1
- package/dist/stripe-elements/svg/flame-outline.svg +1 -1
- package/dist/stripe-elements/svg/flame-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flame.svg +1 -1
- package/dist/stripe-elements/svg/flash-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/flash-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flash-off.svg +1 -1
- package/dist/stripe-elements/svg/flash-outline.svg +1 -1
- package/dist/stripe-elements/svg/flash-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flash.svg +1 -1
- package/dist/stripe-elements/svg/flashlight-outline.svg +1 -1
- package/dist/stripe-elements/svg/flashlight-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flashlight.svg +1 -1
- package/dist/stripe-elements/svg/flask-outline.svg +1 -1
- package/dist/stripe-elements/svg/flask-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flask.svg +1 -1
- package/dist/stripe-elements/svg/flower-outline.svg +1 -1
- package/dist/stripe-elements/svg/flower-sharp.svg +1 -1
- package/dist/stripe-elements/svg/flower.svg +1 -1
- package/dist/stripe-elements/svg/folder-open-outline.svg +1 -1
- package/dist/stripe-elements/svg/folder-open-sharp.svg +1 -1
- package/dist/stripe-elements/svg/folder-open.svg +1 -1
- package/dist/stripe-elements/svg/folder-outline.svg +1 -1
- package/dist/stripe-elements/svg/folder-sharp.svg +1 -1
- package/dist/stripe-elements/svg/folder.svg +1 -1
- package/dist/stripe-elements/svg/football-outline.svg +1 -1
- package/dist/stripe-elements/svg/football-sharp.svg +1 -1
- package/dist/stripe-elements/svg/football.svg +1 -1
- package/dist/stripe-elements/svg/footsteps-outline.svg +1 -1
- package/dist/stripe-elements/svg/footsteps-sharp.svg +1 -1
- package/dist/stripe-elements/svg/footsteps.svg +1 -1
- package/dist/stripe-elements/svg/funnel-outline.svg +1 -1
- package/dist/stripe-elements/svg/funnel-sharp.svg +1 -1
- package/dist/stripe-elements/svg/funnel.svg +1 -1
- package/dist/stripe-elements/svg/game-controller-outline.svg +1 -1
- package/dist/stripe-elements/svg/game-controller-sharp.svg +1 -1
- package/dist/stripe-elements/svg/game-controller.svg +1 -1
- package/dist/stripe-elements/svg/gift-outline.svg +1 -1
- package/dist/stripe-elements/svg/gift-sharp.svg +1 -1
- package/dist/stripe-elements/svg/gift.svg +1 -1
- package/dist/stripe-elements/svg/git-branch-outline.svg +1 -1
- package/dist/stripe-elements/svg/git-branch-sharp.svg +1 -1
- package/dist/stripe-elements/svg/git-branch.svg +1 -1
- package/dist/stripe-elements/svg/git-commit-outline.svg +1 -1
- package/dist/stripe-elements/svg/git-commit-sharp.svg +1 -1
- package/dist/stripe-elements/svg/git-commit.svg +1 -1
- package/dist/stripe-elements/svg/git-compare-outline.svg +1 -1
- package/dist/stripe-elements/svg/git-compare-sharp.svg +1 -1
- package/dist/stripe-elements/svg/git-compare.svg +1 -1
- package/dist/stripe-elements/svg/git-merge-outline.svg +1 -1
- package/dist/stripe-elements/svg/git-merge-sharp.svg +1 -1
- package/dist/stripe-elements/svg/git-merge.svg +1 -1
- package/dist/stripe-elements/svg/git-network-outline.svg +1 -1
- package/dist/stripe-elements/svg/git-network-sharp.svg +1 -1
- package/dist/stripe-elements/svg/git-network.svg +1 -1
- package/dist/stripe-elements/svg/git-pull-request-outline.svg +1 -1
- package/dist/stripe-elements/svg/git-pull-request-sharp.svg +1 -1
- package/dist/stripe-elements/svg/git-pull-request.svg +1 -1
- package/dist/stripe-elements/svg/glasses-outline.svg +1 -1
- package/dist/stripe-elements/svg/glasses-sharp.svg +1 -1
- package/dist/stripe-elements/svg/glasses.svg +1 -1
- package/dist/stripe-elements/svg/globe-outline.svg +1 -1
- package/dist/stripe-elements/svg/globe-sharp.svg +1 -1
- package/dist/stripe-elements/svg/globe.svg +1 -1
- package/dist/stripe-elements/svg/golf-outline.svg +1 -1
- package/dist/stripe-elements/svg/golf-sharp.svg +1 -1
- package/dist/stripe-elements/svg/golf.svg +1 -1
- package/dist/stripe-elements/svg/grid-outline.svg +1 -1
- package/dist/stripe-elements/svg/grid-sharp.svg +1 -1
- package/dist/stripe-elements/svg/grid.svg +1 -1
- package/dist/stripe-elements/svg/hammer-outline.svg +1 -1
- package/dist/stripe-elements/svg/hammer-sharp.svg +1 -1
- package/dist/stripe-elements/svg/hammer.svg +1 -1
- package/dist/stripe-elements/svg/hand-left-outline.svg +1 -1
- package/dist/stripe-elements/svg/hand-left-sharp.svg +1 -1
- package/dist/stripe-elements/svg/hand-left.svg +1 -1
- package/dist/stripe-elements/svg/hand-right-outline.svg +1 -1
- package/dist/stripe-elements/svg/hand-right-sharp.svg +1 -1
- package/dist/stripe-elements/svg/hand-right.svg +1 -1
- package/dist/stripe-elements/svg/happy-outline.svg +1 -1
- package/dist/stripe-elements/svg/happy-sharp.svg +1 -1
- package/dist/stripe-elements/svg/happy.svg +1 -1
- package/dist/stripe-elements/svg/hardware-chip-outline.svg +1 -1
- package/dist/stripe-elements/svg/hardware-chip-sharp.svg +1 -1
- package/dist/stripe-elements/svg/hardware-chip.svg +1 -1
- package/dist/stripe-elements/svg/headset-outline.svg +1 -1
- package/dist/stripe-elements/svg/headset-sharp.svg +1 -1
- package/dist/stripe-elements/svg/headset.svg +1 -1
- package/dist/stripe-elements/svg/heart-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/heart-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/heart-circle.svg +1 -1
- package/dist/stripe-elements/svg/heart-dislike-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/heart-dislike-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/heart-dislike-circle.svg +1 -1
- package/dist/stripe-elements/svg/heart-dislike-outline.svg +1 -1
- package/dist/stripe-elements/svg/heart-dislike-sharp.svg +1 -1
- package/dist/stripe-elements/svg/heart-dislike.svg +1 -1
- package/dist/stripe-elements/svg/heart-half-outline.svg +1 -1
- package/dist/stripe-elements/svg/heart-half-sharp.svg +1 -1
- package/dist/stripe-elements/svg/heart-half.svg +1 -1
- package/dist/stripe-elements/svg/heart-outline.svg +1 -1
- package/dist/stripe-elements/svg/heart-sharp.svg +1 -1
- package/dist/stripe-elements/svg/heart.svg +1 -1
- package/dist/stripe-elements/svg/help-buoy-outline.svg +1 -1
- package/dist/stripe-elements/svg/help-buoy-sharp.svg +1 -1
- package/dist/stripe-elements/svg/help-buoy.svg +1 -1
- package/dist/stripe-elements/svg/help-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/help-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/help-circle.svg +1 -1
- package/dist/stripe-elements/svg/help-outline.svg +1 -1
- package/dist/stripe-elements/svg/help-sharp.svg +1 -1
- package/dist/stripe-elements/svg/help.svg +1 -1
- package/dist/stripe-elements/svg/home-outline.svg +1 -1
- package/dist/stripe-elements/svg/home-sharp.svg +1 -1
- package/dist/stripe-elements/svg/home.svg +1 -1
- package/dist/stripe-elements/svg/hourglass-outline.svg +1 -1
- package/dist/stripe-elements/svg/hourglass-sharp.svg +1 -1
- package/dist/stripe-elements/svg/hourglass.svg +1 -1
- package/dist/stripe-elements/svg/ice-cream-outline.svg +1 -1
- package/dist/stripe-elements/svg/ice-cream-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ice-cream.svg +1 -1
- package/dist/stripe-elements/svg/id-card-outline.svg +1 -1
- package/dist/stripe-elements/svg/id-card-sharp.svg +1 -1
- package/dist/stripe-elements/svg/id-card.svg +1 -1
- package/dist/stripe-elements/svg/image-outline.svg +1 -1
- package/dist/stripe-elements/svg/image-sharp.svg +1 -1
- package/dist/stripe-elements/svg/image.svg +1 -1
- package/dist/stripe-elements/svg/images-outline.svg +1 -1
- package/dist/stripe-elements/svg/images-sharp.svg +1 -1
- package/dist/stripe-elements/svg/images.svg +1 -1
- package/dist/stripe-elements/svg/infinite-outline.svg +1 -1
- package/dist/stripe-elements/svg/infinite-sharp.svg +1 -1
- package/dist/stripe-elements/svg/infinite.svg +1 -1
- package/dist/stripe-elements/svg/information-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/information-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/information-circle.svg +1 -1
- package/dist/stripe-elements/svg/information-outline.svg +1 -1
- package/dist/stripe-elements/svg/information-sharp.svg +1 -1
- package/dist/stripe-elements/svg/information.svg +1 -1
- package/dist/stripe-elements/svg/invert-mode-outline.svg +1 -1
- package/dist/stripe-elements/svg/invert-mode-sharp.svg +1 -1
- package/dist/stripe-elements/svg/invert-mode.svg +1 -1
- package/dist/stripe-elements/svg/journal-outline.svg +1 -1
- package/dist/stripe-elements/svg/journal-sharp.svg +1 -1
- package/dist/stripe-elements/svg/journal.svg +1 -1
- package/dist/stripe-elements/svg/key-outline.svg +1 -1
- package/dist/stripe-elements/svg/key-sharp.svg +1 -1
- package/dist/stripe-elements/svg/key.svg +1 -1
- package/dist/stripe-elements/svg/keypad-outline.svg +1 -1
- package/dist/stripe-elements/svg/keypad-sharp.svg +1 -1
- package/dist/stripe-elements/svg/keypad.svg +1 -1
- package/dist/stripe-elements/svg/language-outline.svg +1 -1
- package/dist/stripe-elements/svg/language-sharp.svg +1 -1
- package/dist/stripe-elements/svg/language.svg +1 -1
- package/dist/stripe-elements/svg/laptop-outline.svg +1 -1
- package/dist/stripe-elements/svg/laptop-sharp.svg +1 -1
- package/dist/stripe-elements/svg/laptop.svg +1 -1
- package/dist/stripe-elements/svg/layers-outline.svg +1 -1
- package/dist/stripe-elements/svg/layers-sharp.svg +1 -1
- package/dist/stripe-elements/svg/layers.svg +1 -1
- package/dist/stripe-elements/svg/leaf-outline.svg +1 -1
- package/dist/stripe-elements/svg/leaf-sharp.svg +1 -1
- package/dist/stripe-elements/svg/leaf.svg +1 -1
- package/dist/stripe-elements/svg/library-outline.svg +1 -1
- package/dist/stripe-elements/svg/library-sharp.svg +1 -1
- package/dist/stripe-elements/svg/library.svg +1 -1
- package/dist/stripe-elements/svg/link-outline.svg +1 -1
- package/dist/stripe-elements/svg/link-sharp.svg +1 -1
- package/dist/stripe-elements/svg/link.svg +1 -1
- package/dist/stripe-elements/svg/list-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/list-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/list-circle.svg +1 -1
- package/dist/stripe-elements/svg/list-outline.svg +1 -1
- package/dist/stripe-elements/svg/list-sharp.svg +1 -1
- package/dist/stripe-elements/svg/list.svg +1 -1
- package/dist/stripe-elements/svg/locate-outline.svg +1 -1
- package/dist/stripe-elements/svg/locate-sharp.svg +1 -1
- package/dist/stripe-elements/svg/locate.svg +1 -1
- package/dist/stripe-elements/svg/location-outline.svg +1 -1
- package/dist/stripe-elements/svg/location-sharp.svg +1 -1
- package/dist/stripe-elements/svg/location.svg +1 -1
- package/dist/stripe-elements/svg/lock-closed-outline.svg +1 -1
- package/dist/stripe-elements/svg/lock-closed-sharp.svg +1 -1
- package/dist/stripe-elements/svg/lock-closed.svg +1 -1
- package/dist/stripe-elements/svg/lock-open-outline.svg +1 -1
- package/dist/stripe-elements/svg/lock-open-sharp.svg +1 -1
- package/dist/stripe-elements/svg/lock-open.svg +1 -1
- package/dist/stripe-elements/svg/log-in-outline.svg +1 -1
- package/dist/stripe-elements/svg/log-in-sharp.svg +1 -1
- package/dist/stripe-elements/svg/log-in.svg +1 -1
- package/dist/stripe-elements/svg/log-out-outline.svg +1 -1
- package/dist/stripe-elements/svg/log-out-sharp.svg +1 -1
- package/dist/stripe-elements/svg/log-out.svg +1 -1
- package/dist/stripe-elements/svg/logo-alipay.svg +1 -1
- package/dist/stripe-elements/svg/logo-amazon.svg +1 -1
- package/dist/stripe-elements/svg/logo-amplify.svg +1 -1
- package/dist/stripe-elements/svg/logo-android.svg +1 -1
- package/dist/stripe-elements/svg/logo-angular.svg +1 -1
- package/dist/stripe-elements/svg/logo-apple-appstore.svg +1 -1
- package/dist/stripe-elements/svg/logo-apple-ar.svg +1 -1
- package/dist/stripe-elements/svg/logo-apple.svg +1 -1
- package/dist/stripe-elements/svg/logo-behance.svg +1 -1
- package/dist/stripe-elements/svg/logo-bitbucket.svg +1 -1
- package/dist/stripe-elements/svg/logo-bitcoin.svg +1 -1
- package/dist/stripe-elements/svg/logo-buffer.svg +1 -1
- package/dist/stripe-elements/svg/logo-capacitor.svg +1 -1
- package/dist/stripe-elements/svg/logo-chrome.svg +1 -1
- package/dist/stripe-elements/svg/logo-closed-captioning.svg +1 -1
- package/dist/stripe-elements/svg/logo-codepen.svg +1 -1
- package/dist/stripe-elements/svg/logo-css3.svg +1 -1
- package/dist/stripe-elements/svg/logo-designernews.svg +1 -1
- package/dist/stripe-elements/svg/logo-deviantart.svg +1 -1
- package/dist/stripe-elements/svg/logo-discord.svg +1 -1
- package/dist/stripe-elements/svg/logo-docker.svg +1 -1
- package/dist/stripe-elements/svg/logo-dribbble.svg +1 -1
- package/dist/stripe-elements/svg/logo-dropbox.svg +1 -1
- package/dist/stripe-elements/svg/logo-edge.svg +1 -1
- package/dist/stripe-elements/svg/logo-electron.svg +1 -1
- package/dist/stripe-elements/svg/logo-euro.svg +1 -1
- package/dist/stripe-elements/svg/logo-facebook.svg +1 -1
- package/dist/stripe-elements/svg/logo-figma.svg +1 -1
- package/dist/stripe-elements/svg/logo-firebase.svg +1 -1
- package/dist/stripe-elements/svg/logo-firefox.svg +1 -1
- package/dist/stripe-elements/svg/logo-flickr.svg +1 -1
- package/dist/stripe-elements/svg/logo-foursquare.svg +1 -1
- package/dist/stripe-elements/svg/logo-github.svg +1 -1
- package/dist/stripe-elements/svg/logo-gitlab.svg +1 -1
- package/dist/stripe-elements/svg/logo-google-playstore.svg +1 -1
- package/dist/stripe-elements/svg/logo-google.svg +1 -1
- package/dist/stripe-elements/svg/logo-hackernews.svg +1 -1
- package/dist/stripe-elements/svg/logo-html5.svg +1 -1
- package/dist/stripe-elements/svg/logo-instagram.svg +1 -1
- package/dist/stripe-elements/svg/logo-ionic.svg +1 -1
- package/dist/stripe-elements/svg/logo-ionitron.svg +1 -1
- package/dist/stripe-elements/svg/logo-javascript.svg +1 -1
- package/dist/stripe-elements/svg/logo-laravel.svg +1 -1
- package/dist/stripe-elements/svg/logo-linkedin.svg +1 -1
- package/dist/stripe-elements/svg/logo-markdown.svg +1 -1
- package/dist/stripe-elements/svg/logo-mastodon.svg +1 -1
- package/dist/stripe-elements/svg/logo-medium.svg +1 -1
- package/dist/stripe-elements/svg/logo-microsoft.svg +1 -1
- package/dist/stripe-elements/svg/logo-no-smoking.svg +1 -1
- package/dist/stripe-elements/svg/logo-nodejs.svg +1 -1
- package/dist/stripe-elements/svg/logo-npm.svg +1 -1
- package/dist/stripe-elements/svg/logo-octocat.svg +1 -1
- package/dist/stripe-elements/svg/logo-paypal.svg +1 -1
- package/dist/stripe-elements/svg/logo-pinterest.svg +1 -1
- package/dist/stripe-elements/svg/logo-playstation.svg +1 -1
- package/dist/stripe-elements/svg/logo-pwa.svg +1 -1
- package/dist/stripe-elements/svg/logo-python.svg +1 -1
- package/dist/stripe-elements/svg/logo-react.svg +1 -1
- package/dist/stripe-elements/svg/logo-reddit.svg +1 -1
- package/dist/stripe-elements/svg/logo-rss.svg +1 -1
- package/dist/stripe-elements/svg/logo-sass.svg +1 -1
- package/dist/stripe-elements/svg/logo-skype.svg +1 -1
- package/dist/stripe-elements/svg/logo-slack.svg +1 -1
- package/dist/stripe-elements/svg/logo-snapchat.svg +1 -1
- package/dist/stripe-elements/svg/logo-soundcloud.svg +1 -1
- package/dist/stripe-elements/svg/logo-stackoverflow.svg +1 -1
- package/dist/stripe-elements/svg/logo-steam.svg +1 -1
- package/dist/stripe-elements/svg/logo-stencil.svg +1 -1
- package/dist/stripe-elements/svg/logo-tableau.svg +1 -1
- package/dist/stripe-elements/svg/logo-tiktok.svg +1 -1
- package/dist/stripe-elements/svg/logo-tumblr.svg +1 -1
- package/dist/stripe-elements/svg/logo-tux.svg +1 -1
- package/dist/stripe-elements/svg/logo-twitch.svg +1 -1
- package/dist/stripe-elements/svg/logo-twitter.svg +1 -1
- package/dist/stripe-elements/svg/logo-usd.svg +1 -1
- package/dist/stripe-elements/svg/logo-venmo.svg +1 -1
- package/dist/stripe-elements/svg/logo-vercel.svg +1 -1
- package/dist/stripe-elements/svg/logo-vimeo.svg +1 -1
- package/dist/stripe-elements/svg/logo-vk.svg +1 -1
- package/dist/stripe-elements/svg/logo-vue.svg +1 -1
- package/dist/stripe-elements/svg/logo-web-component.svg +1 -1
- package/dist/stripe-elements/svg/logo-wechat.svg +1 -1
- package/dist/stripe-elements/svg/logo-whatsapp.svg +1 -1
- package/dist/stripe-elements/svg/logo-windows.svg +1 -1
- package/dist/stripe-elements/svg/logo-wordpress.svg +1 -1
- package/dist/stripe-elements/svg/logo-xbox.svg +1 -1
- package/dist/stripe-elements/svg/logo-xing.svg +1 -1
- package/dist/stripe-elements/svg/logo-yahoo.svg +1 -1
- package/dist/stripe-elements/svg/logo-yen.svg +1 -1
- package/dist/stripe-elements/svg/logo-youtube.svg +1 -1
- package/dist/stripe-elements/svg/magnet-outline.svg +1 -1
- package/dist/stripe-elements/svg/magnet-sharp.svg +1 -1
- package/dist/stripe-elements/svg/magnet.svg +1 -1
- package/dist/stripe-elements/svg/mail-open-outline.svg +1 -1
- package/dist/stripe-elements/svg/mail-open-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mail-open.svg +1 -1
- package/dist/stripe-elements/svg/mail-outline.svg +1 -1
- package/dist/stripe-elements/svg/mail-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mail-unread-outline.svg +1 -1
- package/dist/stripe-elements/svg/mail-unread-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mail-unread.svg +1 -1
- package/dist/stripe-elements/svg/mail.svg +1 -1
- package/dist/stripe-elements/svg/male-female-outline.svg +1 -1
- package/dist/stripe-elements/svg/male-female-sharp.svg +1 -1
- package/dist/stripe-elements/svg/male-female.svg +1 -1
- package/dist/stripe-elements/svg/male-outline.svg +1 -1
- package/dist/stripe-elements/svg/male-sharp.svg +1 -1
- package/dist/stripe-elements/svg/male.svg +1 -1
- package/dist/stripe-elements/svg/man-outline.svg +1 -1
- package/dist/stripe-elements/svg/man-sharp.svg +1 -1
- package/dist/stripe-elements/svg/man.svg +1 -1
- package/dist/stripe-elements/svg/map-outline.svg +1 -1
- package/dist/stripe-elements/svg/map-sharp.svg +1 -1
- package/dist/stripe-elements/svg/map.svg +1 -1
- package/dist/stripe-elements/svg/medal-outline.svg +1 -1
- package/dist/stripe-elements/svg/medal-sharp.svg +1 -1
- package/dist/stripe-elements/svg/medal.svg +1 -1
- package/dist/stripe-elements/svg/medical-outline.svg +1 -1
- package/dist/stripe-elements/svg/medical-sharp.svg +1 -1
- package/dist/stripe-elements/svg/medical.svg +1 -1
- package/dist/stripe-elements/svg/medkit-outline.svg +1 -1
- package/dist/stripe-elements/svg/medkit-sharp.svg +1 -1
- package/dist/stripe-elements/svg/medkit.svg +1 -1
- package/dist/stripe-elements/svg/megaphone-outline.svg +1 -1
- package/dist/stripe-elements/svg/megaphone-sharp.svg +1 -1
- package/dist/stripe-elements/svg/megaphone.svg +1 -1
- package/dist/stripe-elements/svg/menu-outline.svg +1 -1
- package/dist/stripe-elements/svg/menu-sharp.svg +1 -1
- package/dist/stripe-elements/svg/menu.svg +1 -1
- package/dist/stripe-elements/svg/mic-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/mic-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mic-circle.svg +1 -1
- package/dist/stripe-elements/svg/mic-off-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/mic-off-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mic-off-circle.svg +1 -1
- package/dist/stripe-elements/svg/mic-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/mic-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mic-off.svg +1 -1
- package/dist/stripe-elements/svg/mic-outline.svg +1 -1
- package/dist/stripe-elements/svg/mic-sharp.svg +1 -1
- package/dist/stripe-elements/svg/mic.svg +1 -1
- package/dist/stripe-elements/svg/moon-outline.svg +1 -1
- package/dist/stripe-elements/svg/moon-sharp.svg +1 -1
- package/dist/stripe-elements/svg/moon.svg +1 -1
- package/dist/stripe-elements/svg/move-outline.svg +1 -1
- package/dist/stripe-elements/svg/move-sharp.svg +1 -1
- package/dist/stripe-elements/svg/move.svg +1 -1
- package/dist/stripe-elements/svg/musical-note-outline.svg +1 -1
- package/dist/stripe-elements/svg/musical-note-sharp.svg +1 -1
- package/dist/stripe-elements/svg/musical-note.svg +1 -1
- package/dist/stripe-elements/svg/musical-notes-outline.svg +1 -1
- package/dist/stripe-elements/svg/musical-notes-sharp.svg +1 -1
- package/dist/stripe-elements/svg/musical-notes.svg +1 -1
- package/dist/stripe-elements/svg/navigate-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/navigate-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/navigate-circle.svg +1 -1
- package/dist/stripe-elements/svg/navigate-outline.svg +1 -1
- package/dist/stripe-elements/svg/navigate-sharp.svg +1 -1
- package/dist/stripe-elements/svg/navigate.svg +1 -1
- package/dist/stripe-elements/svg/newspaper-outline.svg +1 -1
- package/dist/stripe-elements/svg/newspaper-sharp.svg +1 -1
- package/dist/stripe-elements/svg/newspaper.svg +1 -1
- package/dist/stripe-elements/svg/notifications-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/notifications-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/notifications-circle.svg +1 -1
- package/dist/stripe-elements/svg/notifications-off-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/notifications-off-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/notifications-off-circle.svg +1 -1
- package/dist/stripe-elements/svg/notifications-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/notifications-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/notifications-off.svg +1 -1
- package/dist/stripe-elements/svg/notifications-outline.svg +1 -1
- package/dist/stripe-elements/svg/notifications-sharp.svg +1 -1
- package/dist/stripe-elements/svg/notifications.svg +1 -1
- package/dist/stripe-elements/svg/nuclear-outline.svg +1 -1
- package/dist/stripe-elements/svg/nuclear-sharp.svg +1 -1
- package/dist/stripe-elements/svg/nuclear.svg +1 -1
- package/dist/stripe-elements/svg/nutrition-outline.svg +1 -1
- package/dist/stripe-elements/svg/nutrition-sharp.svg +1 -1
- package/dist/stripe-elements/svg/nutrition.svg +1 -1
- package/dist/stripe-elements/svg/open-outline.svg +1 -1
- package/dist/stripe-elements/svg/open-sharp.svg +1 -1
- package/dist/stripe-elements/svg/open.svg +1 -1
- package/dist/stripe-elements/svg/options-outline.svg +1 -1
- package/dist/stripe-elements/svg/options-sharp.svg +1 -1
- package/dist/stripe-elements/svg/options.svg +1 -1
- package/dist/stripe-elements/svg/paper-plane-outline.svg +1 -1
- package/dist/stripe-elements/svg/paper-plane-sharp.svg +1 -1
- package/dist/stripe-elements/svg/paper-plane.svg +1 -1
- package/dist/stripe-elements/svg/partly-sunny-outline.svg +1 -1
- package/dist/stripe-elements/svg/partly-sunny-sharp.svg +1 -1
- package/dist/stripe-elements/svg/partly-sunny.svg +1 -1
- package/dist/stripe-elements/svg/pause-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/pause-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pause-circle.svg +1 -1
- package/dist/stripe-elements/svg/pause-outline.svg +1 -1
- package/dist/stripe-elements/svg/pause-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pause.svg +1 -1
- package/dist/stripe-elements/svg/paw-outline.svg +1 -1
- package/dist/stripe-elements/svg/paw-sharp.svg +1 -1
- package/dist/stripe-elements/svg/paw.svg +1 -1
- package/dist/stripe-elements/svg/pencil-outline.svg +1 -1
- package/dist/stripe-elements/svg/pencil-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pencil.svg +1 -1
- package/dist/stripe-elements/svg/people-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/people-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/people-circle.svg +1 -1
- package/dist/stripe-elements/svg/people-outline.svg +1 -1
- package/dist/stripe-elements/svg/people-sharp.svg +1 -1
- package/dist/stripe-elements/svg/people.svg +1 -1
- package/dist/stripe-elements/svg/person-add-outline.svg +1 -1
- package/dist/stripe-elements/svg/person-add-sharp.svg +1 -1
- package/dist/stripe-elements/svg/person-add.svg +1 -1
- package/dist/stripe-elements/svg/person-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/person-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/person-circle.svg +1 -1
- package/dist/stripe-elements/svg/person-outline.svg +1 -1
- package/dist/stripe-elements/svg/person-remove-outline.svg +1 -1
- package/dist/stripe-elements/svg/person-remove-sharp.svg +1 -1
- package/dist/stripe-elements/svg/person-remove.svg +1 -1
- package/dist/stripe-elements/svg/person-sharp.svg +1 -1
- package/dist/stripe-elements/svg/person.svg +1 -1
- package/dist/stripe-elements/svg/phone-landscape-outline.svg +1 -1
- package/dist/stripe-elements/svg/phone-landscape-sharp.svg +1 -1
- package/dist/stripe-elements/svg/phone-landscape.svg +1 -1
- package/dist/stripe-elements/svg/phone-portrait-outline.svg +1 -1
- package/dist/stripe-elements/svg/phone-portrait-sharp.svg +1 -1
- package/dist/stripe-elements/svg/phone-portrait.svg +1 -1
- package/dist/stripe-elements/svg/pie-chart-outline.svg +1 -1
- package/dist/stripe-elements/svg/pie-chart-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pie-chart.svg +1 -1
- package/dist/stripe-elements/svg/pin-outline.svg +1 -1
- package/dist/stripe-elements/svg/pin-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pin.svg +1 -1
- package/dist/stripe-elements/svg/pint-outline.svg +1 -1
- package/dist/stripe-elements/svg/pint-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pint.svg +1 -1
- package/dist/stripe-elements/svg/pizza-outline.svg +1 -1
- package/dist/stripe-elements/svg/pizza-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pizza.svg +1 -1
- package/dist/stripe-elements/svg/planet-outline.svg +1 -1
- package/dist/stripe-elements/svg/planet-sharp.svg +1 -1
- package/dist/stripe-elements/svg/planet.svg +1 -1
- package/dist/stripe-elements/svg/play-back-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-back-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-back-circle.svg +1 -1
- package/dist/stripe-elements/svg/play-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-back.svg +1 -1
- package/dist/stripe-elements/svg/play-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-circle.svg +1 -1
- package/dist/stripe-elements/svg/play-forward-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-forward-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-forward-circle.svg +1 -1
- package/dist/stripe-elements/svg/play-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-forward.svg +1 -1
- package/dist/stripe-elements/svg/play-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-back-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-back-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-back-circle.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-back.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-forward-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-forward-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-forward-circle.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/play-skip-forward.svg +1 -1
- package/dist/stripe-elements/svg/play.svg +1 -1
- package/dist/stripe-elements/svg/podium-outline.svg +1 -1
- package/dist/stripe-elements/svg/podium-sharp.svg +1 -1
- package/dist/stripe-elements/svg/podium.svg +1 -1
- package/dist/stripe-elements/svg/power-outline.svg +1 -1
- package/dist/stripe-elements/svg/power-sharp.svg +1 -1
- package/dist/stripe-elements/svg/power.svg +1 -1
- package/dist/stripe-elements/svg/pricetag-outline.svg +1 -1
- package/dist/stripe-elements/svg/pricetag-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pricetag.svg +1 -1
- package/dist/stripe-elements/svg/pricetags-outline.svg +1 -1
- package/dist/stripe-elements/svg/pricetags-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pricetags.svg +1 -1
- package/dist/stripe-elements/svg/print-outline.svg +1 -1
- package/dist/stripe-elements/svg/print-sharp.svg +1 -1
- package/dist/stripe-elements/svg/print.svg +1 -1
- package/dist/stripe-elements/svg/prism-outline.svg +1 -1
- package/dist/stripe-elements/svg/prism-sharp.svg +1 -1
- package/dist/stripe-elements/svg/prism.svg +1 -1
- package/dist/stripe-elements/svg/pulse-outline.svg +1 -1
- package/dist/stripe-elements/svg/pulse-sharp.svg +1 -1
- package/dist/stripe-elements/svg/pulse.svg +1 -1
- package/dist/stripe-elements/svg/push-outline.svg +1 -1
- package/dist/stripe-elements/svg/push-sharp.svg +1 -1
- package/dist/stripe-elements/svg/push.svg +1 -1
- package/dist/stripe-elements/svg/qr-code-outline.svg +1 -1
- package/dist/stripe-elements/svg/qr-code-sharp.svg +1 -1
- package/dist/stripe-elements/svg/qr-code.svg +1 -1
- package/dist/stripe-elements/svg/radio-button-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/radio-button-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/radio-button-off.svg +1 -1
- package/dist/stripe-elements/svg/radio-button-on-outline.svg +1 -1
- package/dist/stripe-elements/svg/radio-button-on-sharp.svg +1 -1
- package/dist/stripe-elements/svg/radio-button-on.svg +1 -1
- package/dist/stripe-elements/svg/radio-outline.svg +1 -1
- package/dist/stripe-elements/svg/radio-sharp.svg +1 -1
- package/dist/stripe-elements/svg/radio.svg +1 -1
- package/dist/stripe-elements/svg/rainy-outline.svg +1 -1
- package/dist/stripe-elements/svg/rainy-sharp.svg +1 -1
- package/dist/stripe-elements/svg/rainy.svg +1 -1
- package/dist/stripe-elements/svg/reader-outline.svg +1 -1
- package/dist/stripe-elements/svg/reader-sharp.svg +1 -1
- package/dist/stripe-elements/svg/reader.svg +1 -1
- package/dist/stripe-elements/svg/receipt-outline.svg +1 -1
- package/dist/stripe-elements/svg/receipt-sharp.svg +1 -1
- package/dist/stripe-elements/svg/receipt.svg +1 -1
- package/dist/stripe-elements/svg/recording-outline.svg +1 -1
- package/dist/stripe-elements/svg/recording-sharp.svg +1 -1
- package/dist/stripe-elements/svg/recording.svg +1 -1
- package/dist/stripe-elements/svg/refresh-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/refresh-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/refresh-circle.svg +1 -1
- package/dist/stripe-elements/svg/refresh-outline.svg +1 -1
- package/dist/stripe-elements/svg/refresh-sharp.svg +1 -1
- package/dist/stripe-elements/svg/refresh.svg +1 -1
- package/dist/stripe-elements/svg/reload-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/reload-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/reload-circle.svg +1 -1
- package/dist/stripe-elements/svg/reload-outline.svg +1 -1
- package/dist/stripe-elements/svg/reload-sharp.svg +1 -1
- package/dist/stripe-elements/svg/reload.svg +1 -1
- package/dist/stripe-elements/svg/remove-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/remove-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/remove-circle.svg +1 -1
- package/dist/stripe-elements/svg/remove-outline.svg +1 -1
- package/dist/stripe-elements/svg/remove-sharp.svg +1 -1
- package/dist/stripe-elements/svg/remove.svg +1 -1
- package/dist/stripe-elements/svg/reorder-four-outline.svg +1 -1
- package/dist/stripe-elements/svg/reorder-four-sharp.svg +1 -1
- package/dist/stripe-elements/svg/reorder-four.svg +1 -1
- package/dist/stripe-elements/svg/reorder-three-outline.svg +1 -1
- package/dist/stripe-elements/svg/reorder-three-sharp.svg +1 -1
- package/dist/stripe-elements/svg/reorder-three.svg +1 -1
- package/dist/stripe-elements/svg/reorder-two-outline.svg +1 -1
- package/dist/stripe-elements/svg/reorder-two-sharp.svg +1 -1
- package/dist/stripe-elements/svg/reorder-two.svg +1 -1
- package/dist/stripe-elements/svg/repeat-outline.svg +1 -1
- package/dist/stripe-elements/svg/repeat-sharp.svg +1 -1
- package/dist/stripe-elements/svg/repeat.svg +1 -1
- package/dist/stripe-elements/svg/resize-outline.svg +1 -1
- package/dist/stripe-elements/svg/resize-sharp.svg +1 -1
- package/dist/stripe-elements/svg/resize.svg +1 -1
- package/dist/stripe-elements/svg/restaurant-outline.svg +1 -1
- package/dist/stripe-elements/svg/restaurant-sharp.svg +1 -1
- package/dist/stripe-elements/svg/restaurant.svg +1 -1
- package/dist/stripe-elements/svg/return-down-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/return-down-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/return-down-back.svg +1 -1
- package/dist/stripe-elements/svg/return-down-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/return-down-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/return-down-forward.svg +1 -1
- package/dist/stripe-elements/svg/return-up-back-outline.svg +1 -1
- package/dist/stripe-elements/svg/return-up-back-sharp.svg +1 -1
- package/dist/stripe-elements/svg/return-up-back.svg +1 -1
- package/dist/stripe-elements/svg/return-up-forward-outline.svg +1 -1
- package/dist/stripe-elements/svg/return-up-forward-sharp.svg +1 -1
- package/dist/stripe-elements/svg/return-up-forward.svg +1 -1
- package/dist/stripe-elements/svg/ribbon-outline.svg +1 -1
- package/dist/stripe-elements/svg/ribbon-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ribbon.svg +1 -1
- package/dist/stripe-elements/svg/rocket-outline.svg +1 -1
- package/dist/stripe-elements/svg/rocket-sharp.svg +1 -1
- package/dist/stripe-elements/svg/rocket.svg +1 -1
- package/dist/stripe-elements/svg/rose-outline.svg +1 -1
- package/dist/stripe-elements/svg/rose-sharp.svg +1 -1
- package/dist/stripe-elements/svg/rose.svg +1 -1
- package/dist/stripe-elements/svg/sad-outline.svg +1 -1
- package/dist/stripe-elements/svg/sad-sharp.svg +1 -1
- package/dist/stripe-elements/svg/sad.svg +1 -1
- package/dist/stripe-elements/svg/save-outline.svg +1 -1
- package/dist/stripe-elements/svg/save-sharp.svg +1 -1
- package/dist/stripe-elements/svg/save.svg +1 -1
- package/dist/stripe-elements/svg/scale-outline.svg +1 -1
- package/dist/stripe-elements/svg/scale-sharp.svg +1 -1
- package/dist/stripe-elements/svg/scale.svg +1 -1
- package/dist/stripe-elements/svg/scan-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/scan-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/scan-circle.svg +1 -1
- package/dist/stripe-elements/svg/scan-outline.svg +1 -1
- package/dist/stripe-elements/svg/scan-sharp.svg +1 -1
- package/dist/stripe-elements/svg/scan.svg +1 -1
- package/dist/stripe-elements/svg/school-outline.svg +1 -1
- package/dist/stripe-elements/svg/school-sharp.svg +1 -1
- package/dist/stripe-elements/svg/school.svg +1 -1
- package/dist/stripe-elements/svg/search-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/search-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/search-circle.svg +1 -1
- package/dist/stripe-elements/svg/search-outline.svg +1 -1
- package/dist/stripe-elements/svg/search-sharp.svg +1 -1
- package/dist/stripe-elements/svg/search.svg +1 -1
- package/dist/stripe-elements/svg/send-outline.svg +1 -1
- package/dist/stripe-elements/svg/send-sharp.svg +1 -1
- package/dist/stripe-elements/svg/send.svg +1 -1
- package/dist/stripe-elements/svg/server-outline.svg +1 -1
- package/dist/stripe-elements/svg/server-sharp.svg +1 -1
- package/dist/stripe-elements/svg/server.svg +1 -1
- package/dist/stripe-elements/svg/settings-outline.svg +1 -1
- package/dist/stripe-elements/svg/settings-sharp.svg +1 -1
- package/dist/stripe-elements/svg/settings.svg +1 -1
- package/dist/stripe-elements/svg/shapes-outline.svg +1 -1
- package/dist/stripe-elements/svg/shapes-sharp.svg +1 -1
- package/dist/stripe-elements/svg/shapes.svg +1 -1
- package/dist/stripe-elements/svg/share-outline.svg +1 -1
- package/dist/stripe-elements/svg/share-sharp.svg +1 -1
- package/dist/stripe-elements/svg/share-social-outline.svg +1 -1
- package/dist/stripe-elements/svg/share-social-sharp.svg +1 -1
- package/dist/stripe-elements/svg/share-social.svg +1 -1
- package/dist/stripe-elements/svg/share.svg +1 -1
- package/dist/stripe-elements/svg/shield-checkmark-outline.svg +1 -1
- package/dist/stripe-elements/svg/shield-checkmark-sharp.svg +1 -1
- package/dist/stripe-elements/svg/shield-checkmark.svg +1 -1
- package/dist/stripe-elements/svg/shield-half-outline.svg +1 -1
- package/dist/stripe-elements/svg/shield-half-sharp.svg +1 -1
- package/dist/stripe-elements/svg/shield-half.svg +1 -1
- package/dist/stripe-elements/svg/shield-outline.svg +1 -1
- package/dist/stripe-elements/svg/shield-sharp.svg +1 -1
- package/dist/stripe-elements/svg/shield.svg +1 -1
- package/dist/stripe-elements/svg/shirt-outline.svg +1 -1
- package/dist/stripe-elements/svg/shirt-sharp.svg +1 -1
- package/dist/stripe-elements/svg/shirt.svg +1 -1
- package/dist/stripe-elements/svg/shuffle-outline.svg +1 -1
- package/dist/stripe-elements/svg/shuffle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/shuffle.svg +1 -1
- package/dist/stripe-elements/svg/skull-outline.svg +1 -1
- package/dist/stripe-elements/svg/skull-sharp.svg +1 -1
- package/dist/stripe-elements/svg/skull.svg +1 -1
- package/dist/stripe-elements/svg/snow-outline.svg +1 -1
- package/dist/stripe-elements/svg/snow-sharp.svg +1 -1
- package/dist/stripe-elements/svg/snow.svg +1 -1
- package/dist/stripe-elements/svg/sparkles-outline.svg +1 -1
- package/dist/stripe-elements/svg/sparkles-sharp.svg +1 -1
- package/dist/stripe-elements/svg/sparkles.svg +1 -1
- package/dist/stripe-elements/svg/speedometer-outline.svg +1 -1
- package/dist/stripe-elements/svg/speedometer-sharp.svg +1 -1
- package/dist/stripe-elements/svg/speedometer.svg +1 -1
- package/dist/stripe-elements/svg/square-outline.svg +1 -1
- package/dist/stripe-elements/svg/square-sharp.svg +1 -1
- package/dist/stripe-elements/svg/square.svg +1 -1
- package/dist/stripe-elements/svg/star-half-outline.svg +1 -1
- package/dist/stripe-elements/svg/star-half-sharp.svg +1 -1
- package/dist/stripe-elements/svg/star-half.svg +1 -1
- package/dist/stripe-elements/svg/star-outline.svg +1 -1
- package/dist/stripe-elements/svg/star-sharp.svg +1 -1
- package/dist/stripe-elements/svg/star.svg +1 -1
- package/dist/stripe-elements/svg/stats-chart-outline.svg +1 -1
- package/dist/stripe-elements/svg/stats-chart-sharp.svg +1 -1
- package/dist/stripe-elements/svg/stats-chart.svg +1 -1
- package/dist/stripe-elements/svg/stop-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/stop-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/stop-circle.svg +1 -1
- package/dist/stripe-elements/svg/stop-outline.svg +1 -1
- package/dist/stripe-elements/svg/stop-sharp.svg +1 -1
- package/dist/stripe-elements/svg/stop.svg +1 -1
- package/dist/stripe-elements/svg/stopwatch-outline.svg +1 -1
- package/dist/stripe-elements/svg/stopwatch-sharp.svg +1 -1
- package/dist/stripe-elements/svg/stopwatch.svg +1 -1
- package/dist/stripe-elements/svg/storefront-outline.svg +1 -1
- package/dist/stripe-elements/svg/storefront-sharp.svg +1 -1
- package/dist/stripe-elements/svg/storefront.svg +1 -1
- package/dist/stripe-elements/svg/subway-outline.svg +1 -1
- package/dist/stripe-elements/svg/subway-sharp.svg +1 -1
- package/dist/stripe-elements/svg/subway.svg +1 -1
- package/dist/stripe-elements/svg/sunny-outline.svg +1 -1
- package/dist/stripe-elements/svg/sunny-sharp.svg +1 -1
- package/dist/stripe-elements/svg/sunny.svg +1 -1
- package/dist/stripe-elements/svg/swap-horizontal-outline.svg +1 -1
- package/dist/stripe-elements/svg/swap-horizontal-sharp.svg +1 -1
- package/dist/stripe-elements/svg/swap-horizontal.svg +1 -1
- package/dist/stripe-elements/svg/swap-vertical-outline.svg +1 -1
- package/dist/stripe-elements/svg/swap-vertical-sharp.svg +1 -1
- package/dist/stripe-elements/svg/swap-vertical.svg +1 -1
- package/dist/stripe-elements/svg/sync-circle-outline.svg +1 -1
- package/dist/stripe-elements/svg/sync-circle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/sync-circle.svg +1 -1
- package/dist/stripe-elements/svg/sync-outline.svg +1 -1
- package/dist/stripe-elements/svg/sync-sharp.svg +1 -1
- package/dist/stripe-elements/svg/sync.svg +1 -1
- package/dist/stripe-elements/svg/tablet-landscape-outline.svg +1 -1
- package/dist/stripe-elements/svg/tablet-landscape-sharp.svg +1 -1
- package/dist/stripe-elements/svg/tablet-landscape.svg +1 -1
- package/dist/stripe-elements/svg/tablet-portrait-outline.svg +1 -1
- package/dist/stripe-elements/svg/tablet-portrait-sharp.svg +1 -1
- package/dist/stripe-elements/svg/tablet-portrait.svg +1 -1
- package/dist/stripe-elements/svg/telescope-outline.svg +1 -1
- package/dist/stripe-elements/svg/telescope-sharp.svg +1 -1
- package/dist/stripe-elements/svg/telescope.svg +1 -1
- package/dist/stripe-elements/svg/tennisball-outline.svg +1 -1
- package/dist/stripe-elements/svg/tennisball-sharp.svg +1 -1
- package/dist/stripe-elements/svg/tennisball.svg +1 -1
- package/dist/stripe-elements/svg/terminal-outline.svg +1 -1
- package/dist/stripe-elements/svg/terminal-sharp.svg +1 -1
- package/dist/stripe-elements/svg/terminal.svg +1 -1
- package/dist/stripe-elements/svg/text-outline.svg +1 -1
- package/dist/stripe-elements/svg/text-sharp.svg +1 -1
- package/dist/stripe-elements/svg/text.svg +1 -1
- package/dist/stripe-elements/svg/thermometer-outline.svg +1 -1
- package/dist/stripe-elements/svg/thermometer-sharp.svg +1 -1
- package/dist/stripe-elements/svg/thermometer.svg +1 -1
- package/dist/stripe-elements/svg/thumbs-down-outline.svg +1 -1
- package/dist/stripe-elements/svg/thumbs-down-sharp.svg +1 -1
- package/dist/stripe-elements/svg/thumbs-down.svg +1 -1
- package/dist/stripe-elements/svg/thumbs-up-outline.svg +1 -1
- package/dist/stripe-elements/svg/thumbs-up-sharp.svg +1 -1
- package/dist/stripe-elements/svg/thumbs-up.svg +1 -1
- package/dist/stripe-elements/svg/thunderstorm-outline.svg +1 -1
- package/dist/stripe-elements/svg/thunderstorm-sharp.svg +1 -1
- package/dist/stripe-elements/svg/thunderstorm.svg +1 -1
- package/dist/stripe-elements/svg/ticket-outline.svg +1 -1
- package/dist/stripe-elements/svg/ticket-sharp.svg +1 -1
- package/dist/stripe-elements/svg/ticket.svg +1 -1
- package/dist/stripe-elements/svg/time-outline.svg +1 -1
- package/dist/stripe-elements/svg/time-sharp.svg +1 -1
- package/dist/stripe-elements/svg/time.svg +1 -1
- package/dist/stripe-elements/svg/timer-outline.svg +1 -1
- package/dist/stripe-elements/svg/timer-sharp.svg +1 -1
- package/dist/stripe-elements/svg/timer.svg +1 -1
- package/dist/stripe-elements/svg/today-outline.svg +1 -1
- package/dist/stripe-elements/svg/today-sharp.svg +1 -1
- package/dist/stripe-elements/svg/today.svg +1 -1
- package/dist/stripe-elements/svg/toggle-outline.svg +1 -1
- package/dist/stripe-elements/svg/toggle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/toggle.svg +1 -1
- package/dist/stripe-elements/svg/trail-sign-outline.svg +1 -1
- package/dist/stripe-elements/svg/trail-sign-sharp.svg +1 -1
- package/dist/stripe-elements/svg/trail-sign.svg +1 -1
- package/dist/stripe-elements/svg/train-outline.svg +1 -1
- package/dist/stripe-elements/svg/train-sharp.svg +1 -1
- package/dist/stripe-elements/svg/train.svg +1 -1
- package/dist/stripe-elements/svg/transgender-outline.svg +1 -1
- package/dist/stripe-elements/svg/transgender-sharp.svg +1 -1
- package/dist/stripe-elements/svg/transgender.svg +1 -1
- package/dist/stripe-elements/svg/trash-bin-outline.svg +1 -1
- package/dist/stripe-elements/svg/trash-bin-sharp.svg +1 -1
- package/dist/stripe-elements/svg/trash-bin.svg +1 -1
- package/dist/stripe-elements/svg/trash-outline.svg +1 -1
- package/dist/stripe-elements/svg/trash-sharp.svg +1 -1
- package/dist/stripe-elements/svg/trash.svg +1 -1
- package/dist/stripe-elements/svg/trending-down-outline.svg +1 -1
- package/dist/stripe-elements/svg/trending-down-sharp.svg +1 -1
- package/dist/stripe-elements/svg/trending-down.svg +1 -1
- package/dist/stripe-elements/svg/trending-up-outline.svg +1 -1
- package/dist/stripe-elements/svg/trending-up-sharp.svg +1 -1
- package/dist/stripe-elements/svg/trending-up.svg +1 -1
- package/dist/stripe-elements/svg/triangle-outline.svg +1 -1
- package/dist/stripe-elements/svg/triangle-sharp.svg +1 -1
- package/dist/stripe-elements/svg/triangle.svg +1 -1
- package/dist/stripe-elements/svg/trophy-outline.svg +1 -1
- package/dist/stripe-elements/svg/trophy-sharp.svg +1 -1
- package/dist/stripe-elements/svg/trophy.svg +1 -1
- package/dist/stripe-elements/svg/tv-outline.svg +1 -1
- package/dist/stripe-elements/svg/tv-sharp.svg +1 -1
- package/dist/stripe-elements/svg/tv.svg +1 -1
- package/dist/stripe-elements/svg/umbrella-outline.svg +1 -1
- package/dist/stripe-elements/svg/umbrella-sharp.svg +1 -1
- package/dist/stripe-elements/svg/umbrella.svg +1 -1
- package/dist/stripe-elements/svg/unlink-outline.svg +1 -1
- package/dist/stripe-elements/svg/unlink-sharp.svg +1 -1
- package/dist/stripe-elements/svg/unlink.svg +1 -1
- package/dist/stripe-elements/svg/videocam-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/videocam-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/videocam-off.svg +1 -1
- package/dist/stripe-elements/svg/videocam-outline.svg +1 -1
- package/dist/stripe-elements/svg/videocam-sharp.svg +1 -1
- package/dist/stripe-elements/svg/videocam.svg +1 -1
- package/dist/stripe-elements/svg/volume-high-outline.svg +1 -1
- package/dist/stripe-elements/svg/volume-high-sharp.svg +1 -1
- package/dist/stripe-elements/svg/volume-high.svg +1 -1
- package/dist/stripe-elements/svg/volume-low-outline.svg +1 -1
- package/dist/stripe-elements/svg/volume-low-sharp.svg +1 -1
- package/dist/stripe-elements/svg/volume-low.svg +1 -1
- package/dist/stripe-elements/svg/volume-medium-outline.svg +1 -1
- package/dist/stripe-elements/svg/volume-medium-sharp.svg +1 -1
- package/dist/stripe-elements/svg/volume-medium.svg +1 -1
- package/dist/stripe-elements/svg/volume-mute-outline.svg +1 -1
- package/dist/stripe-elements/svg/volume-mute-sharp.svg +1 -1
- package/dist/stripe-elements/svg/volume-mute.svg +1 -1
- package/dist/stripe-elements/svg/volume-off-outline.svg +1 -1
- package/dist/stripe-elements/svg/volume-off-sharp.svg +1 -1
- package/dist/stripe-elements/svg/volume-off.svg +1 -1
- package/dist/stripe-elements/svg/walk-outline.svg +1 -1
- package/dist/stripe-elements/svg/walk-sharp.svg +1 -1
- package/dist/stripe-elements/svg/walk.svg +1 -1
- package/dist/stripe-elements/svg/wallet-outline.svg +1 -1
- package/dist/stripe-elements/svg/wallet-sharp.svg +1 -1
- package/dist/stripe-elements/svg/wallet.svg +1 -1
- package/dist/stripe-elements/svg/warning-outline.svg +1 -1
- package/dist/stripe-elements/svg/warning-sharp.svg +1 -1
- package/dist/stripe-elements/svg/warning.svg +1 -1
- package/dist/stripe-elements/svg/watch-outline.svg +1 -1
- package/dist/stripe-elements/svg/watch-sharp.svg +1 -1
- package/dist/stripe-elements/svg/watch.svg +1 -1
- package/dist/stripe-elements/svg/water-outline.svg +1 -1
- package/dist/stripe-elements/svg/water-sharp.svg +1 -1
- package/dist/stripe-elements/svg/water.svg +1 -1
- package/dist/stripe-elements/svg/wifi-outline.svg +1 -1
- package/dist/stripe-elements/svg/wifi-sharp.svg +1 -1
- package/dist/stripe-elements/svg/wifi.svg +1 -1
- package/dist/stripe-elements/svg/wine-outline.svg +1 -1
- package/dist/stripe-elements/svg/wine-sharp.svg +1 -1
- package/dist/stripe-elements/svg/wine.svg +1 -1
- package/dist/stripe-elements/svg/woman-outline.svg +1 -1
- package/dist/stripe-elements/svg/woman-sharp.svg +1 -1
- package/dist/stripe-elements/svg/woman.svg +1 -1
- package/dist/types/components.d.ts +3 -0
- package/dist/types/interfaces.d.ts +12 -12
- package/dist/types/stencil-public-runtime.d.ts +92 -19
- package/dist/types/utils/platform.d.ts +1 -1
- package/loader/index.d.ts +9 -0
- package/loader/package.json +1 -0
- package/package.json +24 -24
- package/dist/custom-elements/index.d.ts +0 -63
- package/dist/stripe-elements/p-3922cc8d.js +0 -2
- package/dist/stripe-elements/p-50848f78.entry.js +0 -1
- package/dist/stripe-elements/p-56a89bc1.js +0 -1
- package/dist/stripe-elements/p-8e1243b3.entry.js +0 -1
- package/dist/stripe-elements/p-9232a32e.entry.js +0 -1
- package/dist/stripe-elements/p-cdf60a81.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-
|
|
2
|
-
import { l as loadStripe } from './stripe.esm-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-58f9666b.js';
|
|
2
|
+
import { l as loadStripe } from './stripe.esm-bad47977.js';
|
|
3
3
|
|
|
4
4
|
const getPlatforms = (win) => setupPlatforms(win);
|
|
5
5
|
const setupPlatforms = (win = window) => {
|
|
@@ -113,44 +113,26 @@ function _typeof(obj) {
|
|
|
113
113
|
}, _typeof(obj);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
function
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
value: value,
|
|
120
|
-
enumerable: true,
|
|
121
|
-
configurable: true,
|
|
122
|
-
writable: true
|
|
123
|
-
});
|
|
124
|
-
} else {
|
|
125
|
-
obj[key] = value;
|
|
116
|
+
function _classCallCheck(instance, Constructor) {
|
|
117
|
+
if (!(instance instanceof Constructor)) {
|
|
118
|
+
throw new TypeError("Cannot call a class as a function");
|
|
126
119
|
}
|
|
127
|
-
|
|
128
|
-
return obj;
|
|
129
120
|
}
|
|
130
121
|
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
ownKeys.forEach(function (key) {
|
|
143
|
-
_defineProperty(target, key, source[key]);
|
|
144
|
-
});
|
|
122
|
+
function _toPrimitive(input, hint) {
|
|
123
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
124
|
+
var prim = input[Symbol.toPrimitive];
|
|
125
|
+
if (prim !== undefined) {
|
|
126
|
+
var res = prim.call(input, hint || "default");
|
|
127
|
+
if (_typeof(res) !== "object") return res;
|
|
128
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
145
129
|
}
|
|
146
|
-
|
|
147
|
-
return target;
|
|
130
|
+
return (hint === "string" ? String : Number)(input);
|
|
148
131
|
}
|
|
149
132
|
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
133
|
+
function _toPropertyKey(arg) {
|
|
134
|
+
var key = _toPrimitive(arg, "string");
|
|
135
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
154
136
|
}
|
|
155
137
|
|
|
156
138
|
function _defineProperties(target, props) {
|
|
@@ -159,10 +141,9 @@ function _defineProperties(target, props) {
|
|
|
159
141
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
160
142
|
descriptor.configurable = true;
|
|
161
143
|
if ("value" in descriptor) descriptor.writable = true;
|
|
162
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
144
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
163
145
|
}
|
|
164
146
|
}
|
|
165
|
-
|
|
166
147
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
167
148
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
168
149
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
@@ -176,27 +157,9 @@ function _assertThisInitialized(self) {
|
|
|
176
157
|
if (self === void 0) {
|
|
177
158
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
178
159
|
}
|
|
179
|
-
|
|
180
160
|
return self;
|
|
181
161
|
}
|
|
182
162
|
|
|
183
|
-
function _possibleConstructorReturn(self, call) {
|
|
184
|
-
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
185
|
-
return call;
|
|
186
|
-
} else if (call !== void 0) {
|
|
187
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return _assertThisInitialized(self);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function _getPrototypeOf(o) {
|
|
194
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
195
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
196
|
-
};
|
|
197
|
-
return _getPrototypeOf(o);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
163
|
function _setPrototypeOf(o, p) {
|
|
201
164
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
202
165
|
o.__proto__ = p;
|
|
@@ -209,7 +172,6 @@ function _inherits(subClass, superClass) {
|
|
|
209
172
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
210
173
|
throw new TypeError("Super expression must either be null or a function");
|
|
211
174
|
}
|
|
212
|
-
|
|
213
175
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
214
176
|
constructor: {
|
|
215
177
|
value: subClass,
|
|
@@ -223,6 +185,70 @@ function _inherits(subClass, superClass) {
|
|
|
223
185
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
224
186
|
}
|
|
225
187
|
|
|
188
|
+
function _possibleConstructorReturn(self, call) {
|
|
189
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
190
|
+
return call;
|
|
191
|
+
} else if (call !== void 0) {
|
|
192
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
193
|
+
}
|
|
194
|
+
return _assertThisInitialized(self);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function _getPrototypeOf(o) {
|
|
198
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
199
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
200
|
+
};
|
|
201
|
+
return _getPrototypeOf(o);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function _defineProperty(obj, key, value) {
|
|
205
|
+
key = _toPropertyKey(key);
|
|
206
|
+
if (key in obj) {
|
|
207
|
+
Object.defineProperty(obj, key, {
|
|
208
|
+
value: value,
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
obj[key] = value;
|
|
215
|
+
}
|
|
216
|
+
return obj;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function _arrayWithHoles(arr) {
|
|
220
|
+
if (Array.isArray(arr)) return arr;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function _iterableToArray(iter) {
|
|
224
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function _arrayLikeToArray(arr, len) {
|
|
228
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
229
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
230
|
+
return arr2;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
234
|
+
if (!o) return;
|
|
235
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
236
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
237
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
238
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
239
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function _nonIterableRest() {
|
|
243
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function _toArray(arr) {
|
|
247
|
+
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
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; }
|
|
251
|
+
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; }
|
|
226
252
|
var consoleLogger = {
|
|
227
253
|
type: 'logger',
|
|
228
254
|
log: function log(args) {
|
|
@@ -238,16 +264,12 @@ var consoleLogger = {
|
|
|
238
264
|
if (console && console[type]) console[type].apply(console, args);
|
|
239
265
|
}
|
|
240
266
|
};
|
|
241
|
-
|
|
242
267
|
var Logger = function () {
|
|
243
268
|
function Logger(concreteLogger) {
|
|
244
269
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
245
|
-
|
|
246
270
|
_classCallCheck(this, Logger);
|
|
247
|
-
|
|
248
271
|
this.init(concreteLogger, options);
|
|
249
272
|
}
|
|
250
|
-
|
|
251
273
|
_createClass(Logger, [{
|
|
252
274
|
key: "init",
|
|
253
275
|
value: function init(concreteLogger) {
|
|
@@ -268,7 +290,6 @@ var Logger = function () {
|
|
|
268
290
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
269
291
|
args[_key] = arguments[_key];
|
|
270
292
|
}
|
|
271
|
-
|
|
272
293
|
return this.forward(args, 'log', '', true);
|
|
273
294
|
}
|
|
274
295
|
}, {
|
|
@@ -277,7 +298,6 @@ var Logger = function () {
|
|
|
277
298
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
278
299
|
args[_key2] = arguments[_key2];
|
|
279
300
|
}
|
|
280
|
-
|
|
281
301
|
return this.forward(args, 'warn', '', true);
|
|
282
302
|
}
|
|
283
303
|
}, {
|
|
@@ -286,7 +306,6 @@ var Logger = function () {
|
|
|
286
306
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
287
307
|
args[_key3] = arguments[_key3];
|
|
288
308
|
}
|
|
289
|
-
|
|
290
309
|
return this.forward(args, 'error', '');
|
|
291
310
|
}
|
|
292
311
|
}, {
|
|
@@ -295,7 +314,6 @@ var Logger = function () {
|
|
|
295
314
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
296
315
|
args[_key4] = arguments[_key4];
|
|
297
316
|
}
|
|
298
|
-
|
|
299
317
|
return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
|
|
300
318
|
}
|
|
301
319
|
}, {
|
|
@@ -308,32 +326,33 @@ var Logger = function () {
|
|
|
308
326
|
}, {
|
|
309
327
|
key: "create",
|
|
310
328
|
value: function create(moduleName) {
|
|
311
|
-
return new Logger(this.logger, _objectSpread({}, {
|
|
329
|
+
return new Logger(this.logger, _objectSpread$6(_objectSpread$6({}, {
|
|
312
330
|
prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
|
|
313
|
-
}, this.options));
|
|
331
|
+
}), this.options));
|
|
332
|
+
}
|
|
333
|
+
}, {
|
|
334
|
+
key: "clone",
|
|
335
|
+
value: function clone(options) {
|
|
336
|
+
options = options || this.options;
|
|
337
|
+
options.prefix = options.prefix || this.prefix;
|
|
338
|
+
return new Logger(this.logger, options);
|
|
314
339
|
}
|
|
315
340
|
}]);
|
|
316
|
-
|
|
317
341
|
return Logger;
|
|
318
342
|
}();
|
|
319
|
-
|
|
320
343
|
var baseLogger = new Logger();
|
|
321
344
|
|
|
322
345
|
var EventEmitter = function () {
|
|
323
346
|
function EventEmitter() {
|
|
324
347
|
_classCallCheck(this, EventEmitter);
|
|
325
|
-
|
|
326
348
|
this.observers = {};
|
|
327
349
|
}
|
|
328
|
-
|
|
329
350
|
_createClass(EventEmitter, [{
|
|
330
351
|
key: "on",
|
|
331
352
|
value: function on(events, listener) {
|
|
332
353
|
var _this = this;
|
|
333
|
-
|
|
334
354
|
events.split(' ').forEach(function (event) {
|
|
335
355
|
_this.observers[event] = _this.observers[event] || [];
|
|
336
|
-
|
|
337
356
|
_this.observers[event].push(listener);
|
|
338
357
|
});
|
|
339
358
|
return this;
|
|
@@ -342,12 +361,10 @@ var EventEmitter = function () {
|
|
|
342
361
|
key: "off",
|
|
343
362
|
value: function off(event, listener) {
|
|
344
363
|
if (!this.observers[event]) return;
|
|
345
|
-
|
|
346
364
|
if (!listener) {
|
|
347
365
|
delete this.observers[event];
|
|
348
366
|
return;
|
|
349
367
|
}
|
|
350
|
-
|
|
351
368
|
this.observers[event] = this.observers[event].filter(function (l) {
|
|
352
369
|
return l !== listener;
|
|
353
370
|
});
|
|
@@ -358,24 +375,20 @@ var EventEmitter = function () {
|
|
|
358
375
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
359
376
|
args[_key - 1] = arguments[_key];
|
|
360
377
|
}
|
|
361
|
-
|
|
362
378
|
if (this.observers[event]) {
|
|
363
379
|
var cloned = [].concat(this.observers[event]);
|
|
364
380
|
cloned.forEach(function (observer) {
|
|
365
381
|
observer.apply(void 0, args);
|
|
366
382
|
});
|
|
367
383
|
}
|
|
368
|
-
|
|
369
384
|
if (this.observers['*']) {
|
|
370
385
|
var _cloned = [].concat(this.observers['*']);
|
|
371
|
-
|
|
372
386
|
_cloned.forEach(function (observer) {
|
|
373
387
|
observer.apply(observer, [event].concat(args));
|
|
374
388
|
});
|
|
375
389
|
}
|
|
376
390
|
}
|
|
377
391
|
}]);
|
|
378
|
-
|
|
379
392
|
return EventEmitter;
|
|
380
393
|
}();
|
|
381
394
|
|
|
@@ -399,68 +412,56 @@ function copy(a, s, t) {
|
|
|
399
412
|
if (s[m]) t[m] = s[m];
|
|
400
413
|
});
|
|
401
414
|
}
|
|
402
|
-
|
|
403
415
|
function getLastOfPath(object, path, Empty) {
|
|
404
416
|
function cleanKey(key) {
|
|
405
417
|
return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;
|
|
406
418
|
}
|
|
407
|
-
|
|
408
419
|
function canNotTraverseDeeper() {
|
|
409
420
|
return !object || typeof object === 'string';
|
|
410
421
|
}
|
|
411
|
-
|
|
412
422
|
var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');
|
|
413
|
-
|
|
414
423
|
while (stack.length > 1) {
|
|
415
424
|
if (canNotTraverseDeeper()) return {};
|
|
416
425
|
var key = cleanKey(stack.shift());
|
|
417
426
|
if (!object[key] && Empty) object[key] = new Empty();
|
|
418
|
-
|
|
419
427
|
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
420
428
|
object = object[key];
|
|
421
429
|
} else {
|
|
422
430
|
object = {};
|
|
423
431
|
}
|
|
424
432
|
}
|
|
425
|
-
|
|
426
433
|
if (canNotTraverseDeeper()) return {};
|
|
427
434
|
return {
|
|
428
435
|
obj: object,
|
|
429
436
|
k: cleanKey(stack.shift())
|
|
430
437
|
};
|
|
431
438
|
}
|
|
432
|
-
|
|
433
439
|
function setPath(object, path, newValue) {
|
|
434
440
|
var _getLastOfPath = getLastOfPath(object, path, Object),
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
441
|
+
obj = _getLastOfPath.obj,
|
|
442
|
+
k = _getLastOfPath.k;
|
|
438
443
|
obj[k] = newValue;
|
|
439
444
|
}
|
|
440
445
|
function pushPath(object, path, newValue, concat) {
|
|
441
446
|
var _getLastOfPath2 = getLastOfPath(object, path, Object),
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
447
|
+
obj = _getLastOfPath2.obj,
|
|
448
|
+
k = _getLastOfPath2.k;
|
|
445
449
|
obj[k] = obj[k] || [];
|
|
446
450
|
if (concat) obj[k] = obj[k].concat(newValue);
|
|
447
451
|
if (!concat) obj[k].push(newValue);
|
|
448
452
|
}
|
|
449
453
|
function getPath(object, path) {
|
|
450
454
|
var _getLastOfPath3 = getLastOfPath(object, path),
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
455
|
+
obj = _getLastOfPath3.obj,
|
|
456
|
+
k = _getLastOfPath3.k;
|
|
454
457
|
if (!obj) return undefined;
|
|
455
458
|
return obj[k];
|
|
456
459
|
}
|
|
457
460
|
function getPathWithDefaults(data, defaultData, key) {
|
|
458
461
|
var value = getPath(data, key);
|
|
459
|
-
|
|
460
462
|
if (value !== undefined) {
|
|
461
463
|
return value;
|
|
462
464
|
}
|
|
463
|
-
|
|
464
465
|
return getPath(defaultData, key);
|
|
465
466
|
}
|
|
466
467
|
function deepExtend(target, source, overwrite) {
|
|
@@ -477,7 +478,6 @@ function deepExtend(target, source, overwrite) {
|
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
480
|
}
|
|
480
|
-
|
|
481
481
|
return target;
|
|
482
482
|
}
|
|
483
483
|
function regexEscape(str) {
|
|
@@ -497,83 +497,92 @@ function escape(data) {
|
|
|
497
497
|
return _entityMap[s];
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
|
-
|
|
501
500
|
return data;
|
|
502
501
|
}
|
|
503
|
-
var isIE10 = typeof window !== 'undefined' && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;
|
|
504
|
-
|
|
502
|
+
var isIE10 = typeof window !== 'undefined' && window.navigator && typeof window.navigator.userAgentData === 'undefined' && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;
|
|
503
|
+
var chars = [' ', ',', '?', '!', ';'];
|
|
504
|
+
function looksLikeObjectPath(key, nsSeparator, keySeparator) {
|
|
505
|
+
nsSeparator = nsSeparator || '';
|
|
506
|
+
keySeparator = keySeparator || '';
|
|
507
|
+
var possibleChars = chars.filter(function (c) {
|
|
508
|
+
return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0;
|
|
509
|
+
});
|
|
510
|
+
if (possibleChars.length === 0) return true;
|
|
511
|
+
var r = new RegExp("(".concat(possibleChars.map(function (c) {
|
|
512
|
+
return c === '?' ? '\\?' : c;
|
|
513
|
+
}).join('|'), ")"));
|
|
514
|
+
var matched = !r.test(key);
|
|
515
|
+
if (!matched) {
|
|
516
|
+
var ki = key.indexOf(keySeparator);
|
|
517
|
+
if (ki > 0 && !r.test(key.substring(0, ki))) {
|
|
518
|
+
matched = true;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return matched;
|
|
522
|
+
}
|
|
505
523
|
function deepFind(obj, path) {
|
|
506
524
|
var keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
507
525
|
if (!obj) return undefined;
|
|
508
526
|
if (obj[path]) return obj[path];
|
|
509
527
|
var paths = path.split(keySeparator);
|
|
510
528
|
var current = obj;
|
|
511
|
-
|
|
512
529
|
for (var i = 0; i < paths.length; ++i) {
|
|
513
530
|
if (!current) return undefined;
|
|
514
|
-
|
|
515
531
|
if (typeof current[paths[i]] === 'string' && i + 1 < paths.length) {
|
|
516
532
|
return undefined;
|
|
517
533
|
}
|
|
518
|
-
|
|
519
534
|
if (current[paths[i]] === undefined) {
|
|
520
535
|
var j = 2;
|
|
521
536
|
var p = paths.slice(i, i + j).join(keySeparator);
|
|
522
537
|
var mix = current[p];
|
|
523
|
-
|
|
524
538
|
while (mix === undefined && paths.length > i + j) {
|
|
525
539
|
j++;
|
|
526
540
|
p = paths.slice(i, i + j).join(keySeparator);
|
|
527
541
|
mix = current[p];
|
|
528
542
|
}
|
|
529
|
-
|
|
530
543
|
if (mix === undefined) return undefined;
|
|
531
|
-
if (
|
|
532
|
-
if (p
|
|
544
|
+
if (mix === null) return null;
|
|
545
|
+
if (path.endsWith(p)) {
|
|
546
|
+
if (typeof mix === 'string') return mix;
|
|
547
|
+
if (p && typeof mix[p] === 'string') return mix[p];
|
|
548
|
+
}
|
|
533
549
|
var joinedPath = paths.slice(i + j).join(keySeparator);
|
|
534
550
|
if (joinedPath) return deepFind(mix, joinedPath, keySeparator);
|
|
535
551
|
return undefined;
|
|
536
552
|
}
|
|
537
|
-
|
|
538
553
|
current = current[paths[i]];
|
|
539
554
|
}
|
|
540
|
-
|
|
541
555
|
return current;
|
|
542
556
|
}
|
|
543
557
|
|
|
558
|
+
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; }
|
|
559
|
+
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; }
|
|
560
|
+
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); }; }
|
|
561
|
+
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; } }
|
|
544
562
|
var ResourceStore = function (_EventEmitter) {
|
|
545
563
|
_inherits(ResourceStore, _EventEmitter);
|
|
546
|
-
|
|
564
|
+
var _super = _createSuper$3(ResourceStore);
|
|
547
565
|
function ResourceStore(data) {
|
|
548
566
|
var _this;
|
|
549
|
-
|
|
550
567
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
551
568
|
ns: ['translation'],
|
|
552
569
|
defaultNS: 'translation'
|
|
553
570
|
};
|
|
554
|
-
|
|
555
571
|
_classCallCheck(this, ResourceStore);
|
|
556
|
-
|
|
557
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(ResourceStore).call(this));
|
|
558
|
-
|
|
572
|
+
_this = _super.call(this);
|
|
559
573
|
if (isIE10) {
|
|
560
574
|
EventEmitter.call(_assertThisInitialized(_this));
|
|
561
575
|
}
|
|
562
|
-
|
|
563
576
|
_this.data = data || {};
|
|
564
577
|
_this.options = options;
|
|
565
|
-
|
|
566
578
|
if (_this.options.keySeparator === undefined) {
|
|
567
579
|
_this.options.keySeparator = '.';
|
|
568
580
|
}
|
|
569
|
-
|
|
570
581
|
if (_this.options.ignoreJSONStructure === undefined) {
|
|
571
582
|
_this.options.ignoreJSONStructure = true;
|
|
572
583
|
}
|
|
573
|
-
|
|
574
584
|
return _this;
|
|
575
585
|
}
|
|
576
|
-
|
|
577
586
|
_createClass(ResourceStore, [{
|
|
578
587
|
key: "addNamespaces",
|
|
579
588
|
value: function addNamespaces(ns) {
|
|
@@ -585,7 +594,6 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
585
594
|
key: "removeNamespaces",
|
|
586
595
|
value: function removeNamespaces(ns) {
|
|
587
596
|
var index = this.options.ns.indexOf(ns);
|
|
588
|
-
|
|
589
597
|
if (index > -1) {
|
|
590
598
|
this.options.ns.splice(index, 1);
|
|
591
599
|
}
|
|
@@ -599,11 +607,9 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
599
607
|
var path = [lng, ns];
|
|
600
608
|
if (key && typeof key !== 'string') path = path.concat(key);
|
|
601
609
|
if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
602
|
-
|
|
603
610
|
if (lng.indexOf('.') > -1) {
|
|
604
611
|
path = lng.split('.');
|
|
605
612
|
}
|
|
606
|
-
|
|
607
613
|
var result = getPath(this.data, path);
|
|
608
614
|
if (result || !ignoreJSONStructure || typeof key !== 'string') return result;
|
|
609
615
|
return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
|
|
@@ -614,17 +620,14 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
614
620
|
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
615
621
|
silent: false
|
|
616
622
|
};
|
|
617
|
-
var keySeparator = this.options.keySeparator;
|
|
618
|
-
if (keySeparator === undefined) keySeparator = '.';
|
|
623
|
+
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
619
624
|
var path = [lng, ns];
|
|
620
625
|
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
621
|
-
|
|
622
626
|
if (lng.indexOf('.') > -1) {
|
|
623
627
|
path = lng.split('.');
|
|
624
628
|
value = ns;
|
|
625
629
|
ns = path[1];
|
|
626
630
|
}
|
|
627
|
-
|
|
628
631
|
this.addNamespaces(ns);
|
|
629
632
|
setPath(this.data, path, value);
|
|
630
633
|
if (!options.silent) this.emit('added', lng, ns, key, value);
|
|
@@ -635,13 +638,11 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
635
638
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
|
|
636
639
|
silent: false
|
|
637
640
|
};
|
|
638
|
-
|
|
639
641
|
for (var m in resources) {
|
|
640
642
|
if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {
|
|
641
643
|
silent: true
|
|
642
644
|
});
|
|
643
645
|
}
|
|
644
|
-
|
|
645
646
|
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
646
647
|
}
|
|
647
648
|
}, {
|
|
@@ -651,23 +652,19 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
651
652
|
silent: false
|
|
652
653
|
};
|
|
653
654
|
var path = [lng, ns];
|
|
654
|
-
|
|
655
655
|
if (lng.indexOf('.') > -1) {
|
|
656
656
|
path = lng.split('.');
|
|
657
657
|
deep = resources;
|
|
658
658
|
resources = ns;
|
|
659
659
|
ns = path[1];
|
|
660
660
|
}
|
|
661
|
-
|
|
662
661
|
this.addNamespaces(ns);
|
|
663
662
|
var pack = getPath(this.data, path) || {};
|
|
664
|
-
|
|
665
663
|
if (deep) {
|
|
666
664
|
deepExtend(pack, resources, overwrite);
|
|
667
665
|
} else {
|
|
668
|
-
pack = _objectSpread({}, pack, resources);
|
|
666
|
+
pack = _objectSpread$5(_objectSpread$5({}, pack), resources);
|
|
669
667
|
}
|
|
670
|
-
|
|
671
668
|
setPath(this.data, path, pack);
|
|
672
669
|
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
673
670
|
}
|
|
@@ -677,7 +674,6 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
677
674
|
if (this.hasResourceBundle(lng, ns)) {
|
|
678
675
|
delete this.data[lng][ns];
|
|
679
676
|
}
|
|
680
|
-
|
|
681
677
|
this.removeNamespaces(ns);
|
|
682
678
|
this.emit('removed', lng, ns);
|
|
683
679
|
}
|
|
@@ -690,7 +686,7 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
690
686
|
key: "getResourceBundle",
|
|
691
687
|
value: function getResourceBundle(lng, ns) {
|
|
692
688
|
if (!ns) ns = this.options.defaultNS;
|
|
693
|
-
if (this.options.compatibilityAPI === 'v1') return _objectSpread({}, {}, this.getResource(lng, ns));
|
|
689
|
+
if (this.options.compatibilityAPI === 'v1') return _objectSpread$5(_objectSpread$5({}, {}), this.getResource(lng, ns));
|
|
694
690
|
return this.getResource(lng, ns);
|
|
695
691
|
}
|
|
696
692
|
}, {
|
|
@@ -698,13 +694,21 @@ var ResourceStore = function (_EventEmitter) {
|
|
|
698
694
|
value: function getDataByLanguage(lng) {
|
|
699
695
|
return this.data[lng];
|
|
700
696
|
}
|
|
697
|
+
}, {
|
|
698
|
+
key: "hasLanguageSomeTranslations",
|
|
699
|
+
value: function hasLanguageSomeTranslations(lng) {
|
|
700
|
+
var data = this.getDataByLanguage(lng);
|
|
701
|
+
var n = data && Object.keys(data) || [];
|
|
702
|
+
return !!n.find(function (v) {
|
|
703
|
+
return data[v] && Object.keys(data[v]).length > 0;
|
|
704
|
+
});
|
|
705
|
+
}
|
|
701
706
|
}, {
|
|
702
707
|
key: "toJSON",
|
|
703
708
|
value: function toJSON() {
|
|
704
709
|
return this.data;
|
|
705
710
|
}
|
|
706
711
|
}]);
|
|
707
|
-
|
|
708
712
|
return ResourceStore;
|
|
709
713
|
}(EventEmitter);
|
|
710
714
|
|
|
@@ -715,7 +719,6 @@ var postProcessor = {
|
|
|
715
719
|
},
|
|
716
720
|
handle: function handle(processors, value, key, options, translator) {
|
|
717
721
|
var _this = this;
|
|
718
|
-
|
|
719
722
|
processors.forEach(function (processor) {
|
|
720
723
|
if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);
|
|
721
724
|
});
|
|
@@ -723,35 +726,30 @@ var postProcessor = {
|
|
|
723
726
|
}
|
|
724
727
|
};
|
|
725
728
|
|
|
729
|
+
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; }
|
|
730
|
+
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; }
|
|
731
|
+
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); }; }
|
|
732
|
+
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; } }
|
|
726
733
|
var checkedLoadedFor = {};
|
|
727
|
-
|
|
728
734
|
var Translator = function (_EventEmitter) {
|
|
729
735
|
_inherits(Translator, _EventEmitter);
|
|
730
|
-
|
|
736
|
+
var _super = _createSuper$2(Translator);
|
|
731
737
|
function Translator(services) {
|
|
732
738
|
var _this;
|
|
733
|
-
|
|
734
739
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
735
|
-
|
|
736
740
|
_classCallCheck(this, Translator);
|
|
737
|
-
|
|
738
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(Translator).call(this));
|
|
739
|
-
|
|
741
|
+
_this = _super.call(this);
|
|
740
742
|
if (isIE10) {
|
|
741
743
|
EventEmitter.call(_assertThisInitialized(_this));
|
|
742
744
|
}
|
|
743
|
-
|
|
744
745
|
copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));
|
|
745
746
|
_this.options = options;
|
|
746
|
-
|
|
747
747
|
if (_this.options.keySeparator === undefined) {
|
|
748
748
|
_this.options.keySeparator = '.';
|
|
749
749
|
}
|
|
750
|
-
|
|
751
750
|
_this.logger = baseLogger.create('translator');
|
|
752
751
|
return _this;
|
|
753
752
|
}
|
|
754
|
-
|
|
755
753
|
_createClass(Translator, [{
|
|
756
754
|
key: "changeLanguage",
|
|
757
755
|
value: function changeLanguage(lng) {
|
|
@@ -763,11 +761,9 @@ var Translator = function (_EventEmitter) {
|
|
|
763
761
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
764
762
|
interpolation: {}
|
|
765
763
|
};
|
|
766
|
-
|
|
767
764
|
if (key === undefined || key === null) {
|
|
768
765
|
return false;
|
|
769
766
|
}
|
|
770
|
-
|
|
771
767
|
var resolved = this.resolve(key, options);
|
|
772
768
|
return resolved && resolved.res !== undefined;
|
|
773
769
|
}
|
|
@@ -777,23 +773,21 @@ var Translator = function (_EventEmitter) {
|
|
|
777
773
|
var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
|
|
778
774
|
if (nsSeparator === undefined) nsSeparator = ':';
|
|
779
775
|
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
780
|
-
var namespaces = options.ns || this.options.defaultNS;
|
|
781
|
-
|
|
782
|
-
|
|
776
|
+
var namespaces = options.ns || this.options.defaultNS || [];
|
|
777
|
+
var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
|
|
778
|
+
var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
|
|
779
|
+
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
|
|
783
780
|
var m = key.match(this.interpolator.nestingRegexp);
|
|
784
|
-
|
|
785
781
|
if (m && m.length > 0) {
|
|
786
782
|
return {
|
|
787
783
|
key: key,
|
|
788
784
|
namespaces: namespaces
|
|
789
785
|
};
|
|
790
786
|
}
|
|
791
|
-
|
|
792
787
|
var parts = key.split(nsSeparator);
|
|
793
788
|
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
|
|
794
789
|
key = parts.join(keySeparator);
|
|
795
790
|
}
|
|
796
|
-
|
|
797
791
|
if (typeof namespaces === 'string') namespaces = [namespaces];
|
|
798
792
|
return {
|
|
799
793
|
key: key,
|
|
@@ -804,33 +798,46 @@ var Translator = function (_EventEmitter) {
|
|
|
804
798
|
key: "translate",
|
|
805
799
|
value: function translate(keys, options, lastKey) {
|
|
806
800
|
var _this2 = this;
|
|
807
|
-
|
|
808
801
|
if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
|
|
809
802
|
options = this.options.overloadTranslationOptionHandler(arguments);
|
|
810
803
|
}
|
|
811
|
-
|
|
804
|
+
if (_typeof(options) === 'object') options = _objectSpread$4({}, options);
|
|
812
805
|
if (!options) options = {};
|
|
813
806
|
if (keys === undefined || keys === null) return '';
|
|
814
807
|
if (!Array.isArray(keys)) keys = [String(keys)];
|
|
808
|
+
var returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;
|
|
815
809
|
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
816
|
-
|
|
817
810
|
var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
811
|
+
key = _this$extractFromKey.key,
|
|
812
|
+
namespaces = _this$extractFromKey.namespaces;
|
|
821
813
|
var namespace = namespaces[namespaces.length - 1];
|
|
822
814
|
var lng = options.lng || this.language;
|
|
823
815
|
var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
824
|
-
|
|
825
816
|
if (lng && lng.toLowerCase() === 'cimode') {
|
|
826
817
|
if (appendNamespaceToCIMode) {
|
|
827
818
|
var nsSeparator = options.nsSeparator || this.options.nsSeparator;
|
|
828
|
-
|
|
819
|
+
if (returnDetails) {
|
|
820
|
+
return {
|
|
821
|
+
res: "".concat(namespace).concat(nsSeparator).concat(key),
|
|
822
|
+
usedKey: key,
|
|
823
|
+
exactUsedKey: key,
|
|
824
|
+
usedLng: lng,
|
|
825
|
+
usedNS: namespace
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
return "".concat(namespace).concat(nsSeparator).concat(key);
|
|
829
|
+
}
|
|
830
|
+
if (returnDetails) {
|
|
831
|
+
return {
|
|
832
|
+
res: key,
|
|
833
|
+
usedKey: key,
|
|
834
|
+
exactUsedKey: key,
|
|
835
|
+
usedLng: lng,
|
|
836
|
+
usedNS: namespace
|
|
837
|
+
};
|
|
829
838
|
}
|
|
830
|
-
|
|
831
839
|
return key;
|
|
832
840
|
}
|
|
833
|
-
|
|
834
841
|
var resolved = this.resolve(keys, options);
|
|
835
842
|
var res = resolved && resolved.res;
|
|
836
843
|
var resUsedKey = resolved && resolved.usedKey || key;
|
|
@@ -840,34 +847,34 @@ var Translator = function (_EventEmitter) {
|
|
|
840
847
|
var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
|
|
841
848
|
var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
842
849
|
var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';
|
|
843
|
-
|
|
844
850
|
if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {
|
|
845
851
|
if (!options.returnObjects && !this.options.returnObjects) {
|
|
846
852
|
if (!this.options.returnedObjectHandler) {
|
|
847
853
|
this.logger.warn('accessing an object - but returnObjects options is not enabled!');
|
|
848
854
|
}
|
|
849
|
-
|
|
850
|
-
return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread({}, options, {
|
|
855
|
+
var r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$4(_objectSpread$4({}, options), {}, {
|
|
851
856
|
ns: namespaces
|
|
852
857
|
})) : "key '".concat(key, " (").concat(this.language, ")' returned an object instead of string.");
|
|
858
|
+
if (returnDetails) {
|
|
859
|
+
resolved.res = r;
|
|
860
|
+
return resolved;
|
|
861
|
+
}
|
|
862
|
+
return r;
|
|
853
863
|
}
|
|
854
|
-
|
|
855
864
|
if (keySeparator) {
|
|
856
865
|
var resTypeIsArray = resType === '[object Array]';
|
|
857
866
|
var copy = resTypeIsArray ? [] : {};
|
|
858
867
|
var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
|
|
859
|
-
|
|
860
868
|
for (var m in res) {
|
|
861
869
|
if (Object.prototype.hasOwnProperty.call(res, m)) {
|
|
862
870
|
var deepKey = "".concat(newKeyToUse).concat(keySeparator).concat(m);
|
|
863
|
-
copy[m] = this.translate(deepKey, _objectSpread({}, options, {
|
|
871
|
+
copy[m] = this.translate(deepKey, _objectSpread$4(_objectSpread$4({}, options), {
|
|
864
872
|
joinArrays: false,
|
|
865
873
|
ns: namespaces
|
|
866
874
|
}));
|
|
867
875
|
if (copy[m] === deepKey) copy[m] = res[m];
|
|
868
876
|
}
|
|
869
877
|
}
|
|
870
|
-
|
|
871
878
|
res = copy;
|
|
872
879
|
}
|
|
873
880
|
} else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {
|
|
@@ -878,36 +885,29 @@ var Translator = function (_EventEmitter) {
|
|
|
878
885
|
var usedKey = false;
|
|
879
886
|
var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
|
|
880
887
|
var hasDefaultValue = Translator.hasDefaultValue(options);
|
|
881
|
-
var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count) : '';
|
|
888
|
+
var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';
|
|
882
889
|
var defaultValue = options["defaultValue".concat(defaultValueSuffix)] || options.defaultValue;
|
|
883
|
-
|
|
884
890
|
if (!this.isValidLookup(res) && hasDefaultValue) {
|
|
885
891
|
usedDefault = true;
|
|
886
892
|
res = defaultValue;
|
|
887
893
|
}
|
|
888
|
-
|
|
889
894
|
if (!this.isValidLookup(res)) {
|
|
890
895
|
usedKey = true;
|
|
891
896
|
res = key;
|
|
892
897
|
}
|
|
893
|
-
|
|
894
898
|
var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
|
|
895
899
|
var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
|
|
896
900
|
var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
|
|
897
|
-
|
|
898
901
|
if (usedKey || usedDefault || updateMissing) {
|
|
899
902
|
this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
|
|
900
|
-
|
|
901
903
|
if (keySeparator) {
|
|
902
|
-
var fk = this.resolve(key, _objectSpread({}, options, {
|
|
904
|
+
var fk = this.resolve(key, _objectSpread$4(_objectSpread$4({}, options), {}, {
|
|
903
905
|
keySeparator: false
|
|
904
906
|
}));
|
|
905
907
|
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.');
|
|
906
908
|
}
|
|
907
|
-
|
|
908
909
|
var lngs = [];
|
|
909
910
|
var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);
|
|
910
|
-
|
|
911
911
|
if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
|
|
912
912
|
for (var i = 0; i < fallbackLngs.length; i++) {
|
|
913
913
|
lngs.push(fallbackLngs[i]);
|
|
@@ -917,21 +917,19 @@ var Translator = function (_EventEmitter) {
|
|
|
917
917
|
} else {
|
|
918
918
|
lngs.push(options.lng || this.language);
|
|
919
919
|
}
|
|
920
|
-
|
|
921
|
-
|
|
920
|
+
var send = function send(l, k, specificDefaultValue) {
|
|
921
|
+
var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
|
922
922
|
if (_this2.options.missingKeyHandler) {
|
|
923
|
-
_this2.options.missingKeyHandler(l, namespace, k,
|
|
923
|
+
_this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
924
924
|
} else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {
|
|
925
|
-
_this2.backendConnector.saveMissing(l, namespace, k,
|
|
925
|
+
_this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
926
926
|
}
|
|
927
|
-
|
|
928
927
|
_this2.emit('missingKey', l, namespace, k, res);
|
|
929
928
|
};
|
|
930
|
-
|
|
931
929
|
if (this.options.saveMissing) {
|
|
932
930
|
if (this.options.saveMissingPlurals && needsPluralHandling) {
|
|
933
931
|
lngs.forEach(function (language) {
|
|
934
|
-
_this2.pluralResolver.getSuffixes(language).forEach(function (suffix) {
|
|
932
|
+
_this2.pluralResolver.getSuffixes(language, options).forEach(function (suffix) {
|
|
935
933
|
send([language], key + suffix, options["defaultValue".concat(suffix)] || defaultValue);
|
|
936
934
|
});
|
|
937
935
|
});
|
|
@@ -940,77 +938,74 @@ var Translator = function (_EventEmitter) {
|
|
|
940
938
|
}
|
|
941
939
|
}
|
|
942
940
|
}
|
|
943
|
-
|
|
944
941
|
res = this.extendTranslation(res, keys, options, resolved, lastKey);
|
|
945
942
|
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = "".concat(namespace, ":").concat(key);
|
|
946
|
-
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler)
|
|
943
|
+
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
944
|
+
if (this.options.compatibilityAPI !== 'v1') {
|
|
945
|
+
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(namespace, ":").concat(key) : key, usedDefault ? res : undefined);
|
|
946
|
+
} else {
|
|
947
|
+
res = this.options.parseMissingKeyHandler(res);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
if (returnDetails) {
|
|
952
|
+
resolved.res = res;
|
|
953
|
+
return resolved;
|
|
947
954
|
}
|
|
948
|
-
|
|
949
955
|
return res;
|
|
950
956
|
}
|
|
951
957
|
}, {
|
|
952
958
|
key: "extendTranslation",
|
|
953
959
|
value: function extendTranslation(res, key, options, resolved, lastKey) {
|
|
954
960
|
var _this3 = this;
|
|
955
|
-
|
|
956
961
|
if (this.i18nFormat && this.i18nFormat.parse) {
|
|
957
|
-
res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, {
|
|
962
|
+
res = this.i18nFormat.parse(res, _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), options), resolved.usedLng, resolved.usedNS, resolved.usedKey, {
|
|
958
963
|
resolved: resolved
|
|
959
964
|
});
|
|
960
965
|
} else if (!options.skipInterpolation) {
|
|
961
|
-
if (options.interpolation) this.interpolator.init(_objectSpread({}, options, {
|
|
962
|
-
interpolation: _objectSpread({}, this.options.interpolation, options.interpolation)
|
|
966
|
+
if (options.interpolation) this.interpolator.init(_objectSpread$4(_objectSpread$4({}, options), {
|
|
967
|
+
interpolation: _objectSpread$4(_objectSpread$4({}, this.options.interpolation), options.interpolation)
|
|
963
968
|
}));
|
|
964
|
-
var skipOnVariables = options.interpolation && options.interpolation.skipOnVariables
|
|
969
|
+
var skipOnVariables = typeof res === 'string' && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
965
970
|
var nestBef;
|
|
966
|
-
|
|
967
971
|
if (skipOnVariables) {
|
|
968
972
|
var nb = res.match(this.interpolator.nestingRegexp);
|
|
969
973
|
nestBef = nb && nb.length;
|
|
970
974
|
}
|
|
971
|
-
|
|
972
975
|
var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;
|
|
973
|
-
if (this.options.interpolation.defaultVariables) data = _objectSpread({}, this.options.interpolation.defaultVariables, data);
|
|
976
|
+
if (this.options.interpolation.defaultVariables) data = _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), data);
|
|
974
977
|
res = this.interpolator.interpolate(res, data, options.lng || this.language, options);
|
|
975
|
-
|
|
976
978
|
if (skipOnVariables) {
|
|
977
979
|
var na = res.match(this.interpolator.nestingRegexp);
|
|
978
980
|
var nestAft = na && na.length;
|
|
979
981
|
if (nestBef < nestAft) options.nest = false;
|
|
980
982
|
}
|
|
981
|
-
|
|
983
|
+
if (!options.lng && this.options.compatibilityAPI !== 'v1' && resolved && resolved.res) options.lng = resolved.usedLng;
|
|
982
984
|
if (options.nest !== false) res = this.interpolator.nest(res, function () {
|
|
983
985
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
984
986
|
args[_key] = arguments[_key];
|
|
985
987
|
}
|
|
986
|
-
|
|
987
988
|
if (lastKey && lastKey[0] === args[0] && !options.context) {
|
|
988
989
|
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
|
|
989
|
-
|
|
990
990
|
return null;
|
|
991
991
|
}
|
|
992
|
-
|
|
993
992
|
return _this3.translate.apply(_this3, args.concat([key]));
|
|
994
993
|
}, options);
|
|
995
994
|
if (options.interpolation) this.interpolator.reset();
|
|
996
995
|
}
|
|
997
|
-
|
|
998
996
|
var postProcess = options.postProcess || this.options.postProcess;
|
|
999
997
|
var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;
|
|
1000
|
-
|
|
1001
998
|
if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
|
|
1002
|
-
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread({
|
|
999
|
+
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread$4({
|
|
1003
1000
|
i18nResolved: resolved
|
|
1004
1001
|
}, options) : options, this);
|
|
1005
1002
|
}
|
|
1006
|
-
|
|
1007
1003
|
return res;
|
|
1008
1004
|
}
|
|
1009
1005
|
}, {
|
|
1010
1006
|
key: "resolve",
|
|
1011
1007
|
value: function resolve(keys) {
|
|
1012
1008
|
var _this4 = this;
|
|
1013
|
-
|
|
1014
1009
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1015
1010
|
var found;
|
|
1016
1011
|
var usedKey;
|
|
@@ -1020,44 +1015,50 @@ var Translator = function (_EventEmitter) {
|
|
|
1020
1015
|
if (typeof keys === 'string') keys = [keys];
|
|
1021
1016
|
keys.forEach(function (k) {
|
|
1022
1017
|
if (_this4.isValidLookup(found)) return;
|
|
1023
|
-
|
|
1024
1018
|
var extracted = _this4.extractFromKey(k, options);
|
|
1025
|
-
|
|
1026
1019
|
var key = extracted.key;
|
|
1027
1020
|
usedKey = key;
|
|
1028
1021
|
var namespaces = extracted.namespaces;
|
|
1029
1022
|
if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);
|
|
1030
1023
|
var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
|
|
1024
|
+
var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi();
|
|
1031
1025
|
var needsContextHandling = options.context !== undefined && (typeof options.context === 'string' || typeof options.context === 'number') && options.context !== '';
|
|
1032
1026
|
var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);
|
|
1033
1027
|
namespaces.forEach(function (ns) {
|
|
1034
1028
|
if (_this4.isValidLookup(found)) return;
|
|
1035
1029
|
usedNS = ns;
|
|
1036
|
-
|
|
1037
1030
|
if (!checkedLoadedFor["".concat(codes[0], "-").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {
|
|
1038
1031
|
checkedLoadedFor["".concat(codes[0], "-").concat(ns)] = true;
|
|
1039
|
-
|
|
1040
1032
|
_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!!!');
|
|
1041
1033
|
}
|
|
1042
|
-
|
|
1043
1034
|
codes.forEach(function (code) {
|
|
1044
1035
|
if (_this4.isValidLookup(found)) return;
|
|
1045
1036
|
usedLng = code;
|
|
1046
|
-
var
|
|
1047
|
-
var finalKeys = [finalKey];
|
|
1048
|
-
|
|
1037
|
+
var finalKeys = [key];
|
|
1049
1038
|
if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {
|
|
1050
1039
|
_this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
|
|
1051
1040
|
} else {
|
|
1052
1041
|
var pluralSuffix;
|
|
1053
|
-
if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count);
|
|
1054
|
-
|
|
1055
|
-
if (
|
|
1056
|
-
|
|
1042
|
+
if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options);
|
|
1043
|
+
var zeroSuffix = "".concat(_this4.options.pluralSeparator, "zero");
|
|
1044
|
+
if (needsPluralHandling) {
|
|
1045
|
+
finalKeys.push(key + pluralSuffix);
|
|
1046
|
+
if (needsZeroSuffixLookup) {
|
|
1047
|
+
finalKeys.push(key + zeroSuffix);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
if (needsContextHandling) {
|
|
1051
|
+
var contextKey = "".concat(key).concat(_this4.options.contextSeparator).concat(options.context);
|
|
1052
|
+
finalKeys.push(contextKey);
|
|
1053
|
+
if (needsPluralHandling) {
|
|
1054
|
+
finalKeys.push(contextKey + pluralSuffix);
|
|
1055
|
+
if (needsZeroSuffixLookup) {
|
|
1056
|
+
finalKeys.push(contextKey + zeroSuffix);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1057
1060
|
}
|
|
1058
|
-
|
|
1059
1061
|
var possibleKey;
|
|
1060
|
-
|
|
1061
1062
|
while (possibleKey = finalKeys.pop()) {
|
|
1062
1063
|
if (!_this4.isValidLookup(found)) {
|
|
1063
1064
|
exactUsedKey = possibleKey;
|
|
@@ -1091,34 +1092,27 @@ var Translator = function (_EventEmitter) {
|
|
|
1091
1092
|
key: "hasDefaultValue",
|
|
1092
1093
|
value: function hasDefaultValue(options) {
|
|
1093
1094
|
var prefix = 'defaultValue';
|
|
1094
|
-
|
|
1095
1095
|
for (var option in options) {
|
|
1096
1096
|
if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
|
|
1097
1097
|
return true;
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
|
|
1101
1100
|
return false;
|
|
1102
1101
|
}
|
|
1103
1102
|
}]);
|
|
1104
|
-
|
|
1105
1103
|
return Translator;
|
|
1106
1104
|
}(EventEmitter);
|
|
1107
1105
|
|
|
1108
1106
|
function capitalize(string) {
|
|
1109
1107
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
1110
1108
|
}
|
|
1111
|
-
|
|
1112
1109
|
var LanguageUtil = function () {
|
|
1113
1110
|
function LanguageUtil(options) {
|
|
1114
1111
|
_classCallCheck(this, LanguageUtil);
|
|
1115
|
-
|
|
1116
1112
|
this.options = options;
|
|
1117
|
-
this.whitelist = this.options.supportedLngs || false;
|
|
1118
1113
|
this.supportedLngs = this.options.supportedLngs || false;
|
|
1119
1114
|
this.logger = baseLogger.create('languageUtils');
|
|
1120
1115
|
}
|
|
1121
|
-
|
|
1122
1116
|
_createClass(LanguageUtil, [{
|
|
1123
1117
|
key: "getScriptPartFromCode",
|
|
1124
1118
|
value: function getScriptPartFromCode(code) {
|
|
@@ -1142,7 +1136,6 @@ var LanguageUtil = function () {
|
|
|
1142
1136
|
if (typeof code === 'string' && code.indexOf('-') > -1) {
|
|
1143
1137
|
var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];
|
|
1144
1138
|
var p = code.split('-');
|
|
1145
|
-
|
|
1146
1139
|
if (this.options.lowerCaseLng) {
|
|
1147
1140
|
p = p.map(function (part) {
|
|
1148
1141
|
return part.toLowerCase();
|
|
@@ -1158,55 +1151,41 @@ var LanguageUtil = function () {
|
|
|
1158
1151
|
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
1159
1152
|
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
|
|
1160
1153
|
}
|
|
1161
|
-
|
|
1162
1154
|
return p.join('-');
|
|
1163
1155
|
}
|
|
1164
|
-
|
|
1165
1156
|
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
|
1166
1157
|
}
|
|
1167
|
-
}, {
|
|
1168
|
-
key: "isWhitelisted",
|
|
1169
|
-
value: function isWhitelisted(code) {
|
|
1170
|
-
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.');
|
|
1171
|
-
return this.isSupportedCode(code);
|
|
1172
|
-
}
|
|
1173
1158
|
}, {
|
|
1174
1159
|
key: "isSupportedCode",
|
|
1175
1160
|
value: function isSupportedCode(code) {
|
|
1176
1161
|
if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
|
|
1177
1162
|
code = this.getLanguagePartFromCode(code);
|
|
1178
1163
|
}
|
|
1179
|
-
|
|
1180
1164
|
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
|
|
1181
1165
|
}
|
|
1182
1166
|
}, {
|
|
1183
1167
|
key: "getBestMatchFromCodes",
|
|
1184
1168
|
value: function getBestMatchFromCodes(codes) {
|
|
1185
1169
|
var _this = this;
|
|
1186
|
-
|
|
1187
1170
|
if (!codes) return null;
|
|
1188
1171
|
var found;
|
|
1189
1172
|
codes.forEach(function (code) {
|
|
1190
1173
|
if (found) return;
|
|
1191
|
-
|
|
1192
1174
|
var cleanedLng = _this.formatLanguageCode(code);
|
|
1193
|
-
|
|
1194
1175
|
if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;
|
|
1195
1176
|
});
|
|
1196
|
-
|
|
1197
1177
|
if (!found && this.options.supportedLngs) {
|
|
1198
1178
|
codes.forEach(function (code) {
|
|
1199
1179
|
if (found) return;
|
|
1200
|
-
|
|
1201
1180
|
var lngOnly = _this.getLanguagePartFromCode(code);
|
|
1202
|
-
|
|
1203
1181
|
if (_this.isSupportedCode(lngOnly)) return found = lngOnly;
|
|
1204
1182
|
found = _this.options.supportedLngs.find(function (supportedLng) {
|
|
1183
|
+
if (supportedLng === lngOnly) return supportedLng;
|
|
1184
|
+
if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;
|
|
1205
1185
|
if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;
|
|
1206
1186
|
});
|
|
1207
1187
|
});
|
|
1208
1188
|
}
|
|
1209
|
-
|
|
1210
1189
|
if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
|
|
1211
1190
|
return found;
|
|
1212
1191
|
}
|
|
@@ -1229,20 +1208,16 @@ var LanguageUtil = function () {
|
|
|
1229
1208
|
key: "toResolveHierarchy",
|
|
1230
1209
|
value: function toResolveHierarchy(code, fallbackCode) {
|
|
1231
1210
|
var _this2 = this;
|
|
1232
|
-
|
|
1233
1211
|
var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
|
|
1234
1212
|
var codes = [];
|
|
1235
|
-
|
|
1236
1213
|
var addCode = function addCode(c) {
|
|
1237
1214
|
if (!c) return;
|
|
1238
|
-
|
|
1239
1215
|
if (_this2.isSupportedCode(c)) {
|
|
1240
1216
|
codes.push(c);
|
|
1241
1217
|
} else {
|
|
1242
1218
|
_this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c));
|
|
1243
1219
|
}
|
|
1244
1220
|
};
|
|
1245
|
-
|
|
1246
1221
|
if (typeof code === 'string' && code.indexOf('-') > -1) {
|
|
1247
1222
|
if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
|
|
1248
1223
|
if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
|
|
@@ -1250,14 +1225,12 @@ var LanguageUtil = function () {
|
|
|
1250
1225
|
} else if (typeof code === 'string') {
|
|
1251
1226
|
addCode(this.formatLanguageCode(code));
|
|
1252
1227
|
}
|
|
1253
|
-
|
|
1254
1228
|
fallbackCodes.forEach(function (fc) {
|
|
1255
1229
|
if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));
|
|
1256
1230
|
});
|
|
1257
1231
|
return codes;
|
|
1258
1232
|
}
|
|
1259
1233
|
}]);
|
|
1260
|
-
|
|
1261
1234
|
return LanguageUtil;
|
|
1262
1235
|
}();
|
|
1263
1236
|
|
|
@@ -1422,7 +1395,15 @@ var _rulesPluralsTypes = {
|
|
|
1422
1395
|
return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);
|
|
1423
1396
|
}
|
|
1424
1397
|
};
|
|
1425
|
-
|
|
1398
|
+
var deprecatedJsonVersions = ['v1', 'v2', 'v3'];
|
|
1399
|
+
var suffixesOrder = {
|
|
1400
|
+
zero: 0,
|
|
1401
|
+
one: 1,
|
|
1402
|
+
two: 2,
|
|
1403
|
+
few: 3,
|
|
1404
|
+
many: 4,
|
|
1405
|
+
other: 5
|
|
1406
|
+
};
|
|
1426
1407
|
function createRules() {
|
|
1427
1408
|
var rules = {};
|
|
1428
1409
|
sets.forEach(function (set) {
|
|
@@ -1435,19 +1416,19 @@ function createRules() {
|
|
|
1435
1416
|
});
|
|
1436
1417
|
return rules;
|
|
1437
1418
|
}
|
|
1438
|
-
|
|
1439
1419
|
var PluralResolver = function () {
|
|
1440
1420
|
function PluralResolver(languageUtils) {
|
|
1441
1421
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1442
|
-
|
|
1443
1422
|
_classCallCheck(this, PluralResolver);
|
|
1444
|
-
|
|
1445
1423
|
this.languageUtils = languageUtils;
|
|
1446
1424
|
this.options = options;
|
|
1447
1425
|
this.logger = baseLogger.create('pluralResolver');
|
|
1426
|
+
if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === 'v4') && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
|
|
1427
|
+
this.options.compatibilityJSON = 'v3';
|
|
1428
|
+
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.');
|
|
1429
|
+
}
|
|
1448
1430
|
this.rules = createRules();
|
|
1449
1431
|
}
|
|
1450
|
-
|
|
1451
1432
|
_createClass(PluralResolver, [{
|
|
1452
1433
|
key: "addRule",
|
|
1453
1434
|
value: function addRule(lng, obj) {
|
|
@@ -1456,96 +1437,129 @@ var PluralResolver = function () {
|
|
|
1456
1437
|
}, {
|
|
1457
1438
|
key: "getRule",
|
|
1458
1439
|
value: function getRule(code) {
|
|
1440
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1441
|
+
if (this.shouldUseIntlApi()) {
|
|
1442
|
+
try {
|
|
1443
|
+
return new Intl.PluralRules(code, {
|
|
1444
|
+
type: options.ordinal ? 'ordinal' : 'cardinal'
|
|
1445
|
+
});
|
|
1446
|
+
} catch (_unused) {
|
|
1447
|
+
return;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1459
1450
|
return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
|
|
1460
1451
|
}
|
|
1461
1452
|
}, {
|
|
1462
1453
|
key: "needsPlural",
|
|
1463
1454
|
value: function needsPlural(code) {
|
|
1464
|
-
var
|
|
1455
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1456
|
+
var rule = this.getRule(code, options);
|
|
1457
|
+
if (this.shouldUseIntlApi()) {
|
|
1458
|
+
return rule && rule.resolvedOptions().pluralCategories.length > 1;
|
|
1459
|
+
}
|
|
1465
1460
|
return rule && rule.numbers.length > 1;
|
|
1466
1461
|
}
|
|
1467
1462
|
}, {
|
|
1468
1463
|
key: "getPluralFormsOfKey",
|
|
1469
1464
|
value: function getPluralFormsOfKey(code, key) {
|
|
1470
|
-
|
|
1471
|
-
|
|
1465
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1466
|
+
return this.getSuffixes(code, options).map(function (suffix) {
|
|
1467
|
+
return "".concat(key).concat(suffix);
|
|
1472
1468
|
});
|
|
1473
1469
|
}
|
|
1474
1470
|
}, {
|
|
1475
1471
|
key: "getSuffixes",
|
|
1476
1472
|
value: function getSuffixes(code) {
|
|
1477
1473
|
var _this = this;
|
|
1478
|
-
|
|
1479
|
-
var rule = this.getRule(code);
|
|
1480
|
-
|
|
1474
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1475
|
+
var rule = this.getRule(code, options);
|
|
1481
1476
|
if (!rule) {
|
|
1482
1477
|
return [];
|
|
1483
1478
|
}
|
|
1484
|
-
|
|
1479
|
+
if (this.shouldUseIntlApi()) {
|
|
1480
|
+
return rule.resolvedOptions().pluralCategories.sort(function (pluralCategory1, pluralCategory2) {
|
|
1481
|
+
return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];
|
|
1482
|
+
}).map(function (pluralCategory) {
|
|
1483
|
+
return "".concat(_this.options.prepend).concat(pluralCategory);
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1485
1486
|
return rule.numbers.map(function (number) {
|
|
1486
|
-
return _this.getSuffix(code, number);
|
|
1487
|
+
return _this.getSuffix(code, number, options);
|
|
1487
1488
|
});
|
|
1488
1489
|
}
|
|
1489
1490
|
}, {
|
|
1490
1491
|
key: "getSuffix",
|
|
1491
1492
|
value: function getSuffix(code, count) {
|
|
1492
|
-
var
|
|
1493
|
-
|
|
1494
|
-
var rule = this.getRule(code);
|
|
1495
|
-
|
|
1493
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1494
|
+
var rule = this.getRule(code, options);
|
|
1496
1495
|
if (rule) {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1501
|
-
if (suffix === 2) {
|
|
1502
|
-
suffix = 'plural';
|
|
1503
|
-
} else if (suffix === 1) {
|
|
1504
|
-
suffix = '';
|
|
1505
|
-
}
|
|
1496
|
+
if (this.shouldUseIntlApi()) {
|
|
1497
|
+
return "".concat(this.options.prepend).concat(rule.select(count));
|
|
1506
1498
|
}
|
|
1507
|
-
|
|
1508
|
-
var returnSuffix = function returnSuffix() {
|
|
1509
|
-
return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();
|
|
1510
|
-
};
|
|
1511
|
-
|
|
1512
|
-
if (this.options.compatibilityJSON === 'v1') {
|
|
1513
|
-
if (suffix === 1) return '';
|
|
1514
|
-
if (typeof suffix === 'number') return "_plural_".concat(suffix.toString());
|
|
1515
|
-
return returnSuffix();
|
|
1516
|
-
} else if (this.options.compatibilityJSON === 'v2') {
|
|
1517
|
-
return returnSuffix();
|
|
1518
|
-
} else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1519
|
-
return returnSuffix();
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
|
|
1499
|
+
return this.getSuffixRetroCompatible(rule, count);
|
|
1523
1500
|
}
|
|
1524
|
-
|
|
1525
1501
|
this.logger.warn("no plural rule found for: ".concat(code));
|
|
1526
1502
|
return '';
|
|
1527
1503
|
}
|
|
1504
|
+
}, {
|
|
1505
|
+
key: "getSuffixRetroCompatible",
|
|
1506
|
+
value: function getSuffixRetroCompatible(rule, count) {
|
|
1507
|
+
var _this2 = this;
|
|
1508
|
+
var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
|
|
1509
|
+
var suffix = rule.numbers[idx];
|
|
1510
|
+
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1511
|
+
if (suffix === 2) {
|
|
1512
|
+
suffix = 'plural';
|
|
1513
|
+
} else if (suffix === 1) {
|
|
1514
|
+
suffix = '';
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
var returnSuffix = function returnSuffix() {
|
|
1518
|
+
return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();
|
|
1519
|
+
};
|
|
1520
|
+
if (this.options.compatibilityJSON === 'v1') {
|
|
1521
|
+
if (suffix === 1) return '';
|
|
1522
|
+
if (typeof suffix === 'number') return "_plural_".concat(suffix.toString());
|
|
1523
|
+
return returnSuffix();
|
|
1524
|
+
} else if (this.options.compatibilityJSON === 'v2') {
|
|
1525
|
+
return returnSuffix();
|
|
1526
|
+
} else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1527
|
+
return returnSuffix();
|
|
1528
|
+
}
|
|
1529
|
+
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
|
|
1530
|
+
}
|
|
1531
|
+
}, {
|
|
1532
|
+
key: "shouldUseIntlApi",
|
|
1533
|
+
value: function shouldUseIntlApi() {
|
|
1534
|
+
return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);
|
|
1535
|
+
}
|
|
1528
1536
|
}]);
|
|
1529
|
-
|
|
1530
1537
|
return PluralResolver;
|
|
1531
1538
|
}();
|
|
1532
1539
|
|
|
1540
|
+
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; }
|
|
1541
|
+
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; }
|
|
1542
|
+
function deepFindWithDefaults(data, defaultData, key) {
|
|
1543
|
+
var keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
|
|
1544
|
+
var ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
1545
|
+
var path = getPathWithDefaults(data, defaultData, key);
|
|
1546
|
+
if (!path && ignoreJSONStructure && typeof key === 'string') {
|
|
1547
|
+
path = deepFind(data, key, keySeparator);
|
|
1548
|
+
if (path === undefined) path = deepFind(defaultData, key, keySeparator);
|
|
1549
|
+
}
|
|
1550
|
+
return path;
|
|
1551
|
+
}
|
|
1533
1552
|
var Interpolator = function () {
|
|
1534
1553
|
function Interpolator() {
|
|
1535
1554
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1536
|
-
|
|
1537
1555
|
_classCallCheck(this, Interpolator);
|
|
1538
|
-
|
|
1539
1556
|
this.logger = baseLogger.create('interpolator');
|
|
1540
1557
|
this.options = options;
|
|
1541
|
-
|
|
1542
1558
|
this.format = options.interpolation && options.interpolation.format || function (value) {
|
|
1543
1559
|
return value;
|
|
1544
1560
|
};
|
|
1545
|
-
|
|
1546
1561
|
this.init(options);
|
|
1547
1562
|
}
|
|
1548
|
-
|
|
1549
1563
|
_createClass(Interpolator, [{
|
|
1550
1564
|
key: "init",
|
|
1551
1565
|
value: function init() {
|
|
@@ -1588,35 +1602,30 @@ var Interpolator = function () {
|
|
|
1588
1602
|
key: "interpolate",
|
|
1589
1603
|
value: function interpolate(str, data, lng, options) {
|
|
1590
1604
|
var _this = this;
|
|
1591
|
-
|
|
1592
1605
|
var match;
|
|
1593
1606
|
var value;
|
|
1594
1607
|
var replaces;
|
|
1595
1608
|
var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
|
1596
|
-
|
|
1597
1609
|
function regexSafe(val) {
|
|
1598
1610
|
return val.replace(/\$/g, '$$$$');
|
|
1599
1611
|
}
|
|
1600
|
-
|
|
1601
1612
|
var handleFormat = function handleFormat(key) {
|
|
1602
1613
|
if (key.indexOf(_this.formatSeparator) < 0) {
|
|
1603
|
-
var path =
|
|
1604
|
-
return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread({}, options, data, {
|
|
1614
|
+
var path = deepFindWithDefaults(data, defaultData, key, _this.options.keySeparator, _this.options.ignoreJSONStructure);
|
|
1615
|
+
return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {
|
|
1605
1616
|
interpolationkey: key
|
|
1606
1617
|
})) : path;
|
|
1607
1618
|
}
|
|
1608
|
-
|
|
1609
1619
|
var p = key.split(_this.formatSeparator);
|
|
1610
1620
|
var k = p.shift().trim();
|
|
1611
1621
|
var f = p.join(_this.formatSeparator).trim();
|
|
1612
|
-
return _this.format(
|
|
1622
|
+
return _this.format(deepFindWithDefaults(data, defaultData, k, _this.options.keySeparator, _this.options.ignoreJSONStructure), f, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {
|
|
1613
1623
|
interpolationkey: k
|
|
1614
1624
|
}));
|
|
1615
1625
|
};
|
|
1616
|
-
|
|
1617
1626
|
this.resetRegExp();
|
|
1618
1627
|
var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
|
1619
|
-
var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables
|
|
1628
|
+
var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1620
1629
|
var todos = [{
|
|
1621
1630
|
regex: this.regexpUnescape,
|
|
1622
1631
|
safeValue: function safeValue(val) {
|
|
@@ -1630,38 +1639,34 @@ var Interpolator = function () {
|
|
|
1630
1639
|
}];
|
|
1631
1640
|
todos.forEach(function (todo) {
|
|
1632
1641
|
replaces = 0;
|
|
1633
|
-
|
|
1634
1642
|
while (match = todo.regex.exec(str)) {
|
|
1635
|
-
|
|
1636
|
-
|
|
1643
|
+
var matchedVar = match[1].trim();
|
|
1644
|
+
value = handleFormat(matchedVar);
|
|
1637
1645
|
if (value === undefined) {
|
|
1638
1646
|
if (typeof missingInterpolationHandler === 'function') {
|
|
1639
1647
|
var temp = missingInterpolationHandler(str, match, options);
|
|
1640
1648
|
value = typeof temp === 'string' ? temp : '';
|
|
1649
|
+
} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
|
|
1650
|
+
value = '';
|
|
1641
1651
|
} else if (skipOnVariables) {
|
|
1642
1652
|
value = match[0];
|
|
1643
1653
|
continue;
|
|
1644
1654
|
} else {
|
|
1645
|
-
_this.logger.warn("missed to pass in variable ".concat(
|
|
1646
|
-
|
|
1655
|
+
_this.logger.warn("missed to pass in variable ".concat(matchedVar, " for interpolating ").concat(str));
|
|
1647
1656
|
value = '';
|
|
1648
1657
|
}
|
|
1649
1658
|
} else if (typeof value !== 'string' && !_this.useRawValueToEscape) {
|
|
1650
1659
|
value = makeString(value);
|
|
1651
1660
|
}
|
|
1652
|
-
|
|
1653
1661
|
var safeValue = todo.safeValue(value);
|
|
1654
1662
|
str = str.replace(match[0], safeValue);
|
|
1655
|
-
|
|
1656
1663
|
if (skipOnVariables) {
|
|
1657
|
-
todo.regex.lastIndex +=
|
|
1664
|
+
todo.regex.lastIndex += value.length;
|
|
1658
1665
|
todo.regex.lastIndex -= match[0].length;
|
|
1659
1666
|
} else {
|
|
1660
1667
|
todo.regex.lastIndex = 0;
|
|
1661
1668
|
}
|
|
1662
|
-
|
|
1663
1669
|
replaces++;
|
|
1664
|
-
|
|
1665
1670
|
if (replaces >= _this.maxReplaces) {
|
|
1666
1671
|
break;
|
|
1667
1672
|
}
|
|
@@ -1673,16 +1678,10 @@ var Interpolator = function () {
|
|
|
1673
1678
|
key: "nest",
|
|
1674
1679
|
value: function nest(str, fc) {
|
|
1675
1680
|
var _this2 = this;
|
|
1676
|
-
|
|
1677
1681
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1678
1682
|
var match;
|
|
1679
1683
|
var value;
|
|
1680
|
-
|
|
1681
|
-
var clonedOptions = _objectSpread({}, options);
|
|
1682
|
-
|
|
1683
|
-
clonedOptions.applyPostProcessor = false;
|
|
1684
|
-
delete clonedOptions.defaultValue;
|
|
1685
|
-
|
|
1684
|
+
var clonedOptions;
|
|
1686
1685
|
function handleHasOptions(key, inheritedOptions) {
|
|
1687
1686
|
var sep = this.nestingOptionsSeparator;
|
|
1688
1687
|
if (key.indexOf(sep) < 0) return key;
|
|
@@ -1690,24 +1689,28 @@ var Interpolator = function () {
|
|
|
1690
1689
|
var optionsString = "{".concat(c[1]);
|
|
1691
1690
|
key = c[0];
|
|
1692
1691
|
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1693
|
-
|
|
1694
|
-
|
|
1692
|
+
var matchedSingleQuotes = optionsString.match(/'/g);
|
|
1693
|
+
var matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1694
|
+
if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
|
|
1695
|
+
optionsString = optionsString.replace(/'/g, '"');
|
|
1696
|
+
}
|
|
1695
1697
|
try {
|
|
1696
1698
|
clonedOptions = JSON.parse(optionsString);
|
|
1697
|
-
if (inheritedOptions) clonedOptions = _objectSpread({}, inheritedOptions, clonedOptions);
|
|
1699
|
+
if (inheritedOptions) clonedOptions = _objectSpread$3(_objectSpread$3({}, inheritedOptions), clonedOptions);
|
|
1698
1700
|
} catch (e) {
|
|
1699
1701
|
this.logger.warn("failed parsing options string in nesting for key ".concat(key), e);
|
|
1700
1702
|
return "".concat(key).concat(sep).concat(optionsString);
|
|
1701
1703
|
}
|
|
1702
|
-
|
|
1703
1704
|
delete clonedOptions.defaultValue;
|
|
1704
1705
|
return key;
|
|
1705
1706
|
}
|
|
1706
|
-
|
|
1707
1707
|
while (match = this.nestingRegexp.exec(str)) {
|
|
1708
1708
|
var formatters = [];
|
|
1709
|
+
clonedOptions = _objectSpread$3({}, options);
|
|
1710
|
+
clonedOptions = clonedOptions.replace && typeof clonedOptions.replace !== 'string' ? clonedOptions.replace : clonedOptions;
|
|
1711
|
+
clonedOptions.applyPostProcessor = false;
|
|
1712
|
+
delete clonedOptions.defaultValue;
|
|
1709
1713
|
var doReduce = false;
|
|
1710
|
-
|
|
1711
1714
|
if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {
|
|
1712
1715
|
var r = match[1].split(this.formatSeparator).map(function (elem) {
|
|
1713
1716
|
return elem.trim();
|
|
@@ -1716,119 +1719,246 @@ var Interpolator = function () {
|
|
|
1716
1719
|
formatters = r;
|
|
1717
1720
|
doReduce = true;
|
|
1718
1721
|
}
|
|
1719
|
-
|
|
1720
1722
|
value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
|
|
1721
1723
|
if (value && match[0] === str && typeof value !== 'string') return value;
|
|
1722
1724
|
if (typeof value !== 'string') value = makeString(value);
|
|
1723
|
-
|
|
1724
1725
|
if (!value) {
|
|
1725
1726
|
this.logger.warn("missed to resolve ".concat(match[1], " for nesting ").concat(str));
|
|
1726
1727
|
value = '';
|
|
1727
1728
|
}
|
|
1728
|
-
|
|
1729
1729
|
if (doReduce) {
|
|
1730
1730
|
value = formatters.reduce(function (v, f) {
|
|
1731
|
-
return _this2.format(v, f, options.lng, _objectSpread({}, options, {
|
|
1731
|
+
return _this2.format(v, f, options.lng, _objectSpread$3(_objectSpread$3({}, options), {}, {
|
|
1732
1732
|
interpolationkey: match[1].trim()
|
|
1733
1733
|
}));
|
|
1734
1734
|
}, value.trim());
|
|
1735
1735
|
}
|
|
1736
|
-
|
|
1737
1736
|
str = str.replace(match[0], value);
|
|
1738
1737
|
this.regexp.lastIndex = 0;
|
|
1739
1738
|
}
|
|
1740
|
-
|
|
1741
1739
|
return str;
|
|
1742
1740
|
}
|
|
1743
1741
|
}]);
|
|
1744
|
-
|
|
1745
1742
|
return Interpolator;
|
|
1746
1743
|
}();
|
|
1747
1744
|
|
|
1748
|
-
function
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1745
|
+
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; }
|
|
1746
|
+
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; }
|
|
1747
|
+
function parseFormatStr(formatStr) {
|
|
1748
|
+
var formatName = formatStr.toLowerCase().trim();
|
|
1749
|
+
var formatOptions = {};
|
|
1750
|
+
if (formatStr.indexOf('(') > -1) {
|
|
1751
|
+
var p = formatStr.split('(');
|
|
1752
|
+
formatName = p[0].toLowerCase().trim();
|
|
1753
|
+
var optStr = p[1].substring(0, p[1].length - 1);
|
|
1754
|
+
if (formatName === 'currency' && optStr.indexOf(':') < 0) {
|
|
1755
|
+
if (!formatOptions.currency) formatOptions.currency = optStr.trim();
|
|
1756
|
+
} else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
|
|
1757
|
+
if (!formatOptions.range) formatOptions.range = optStr.trim();
|
|
1758
|
+
} else {
|
|
1759
|
+
var opts = optStr.split(';');
|
|
1760
|
+
opts.forEach(function (opt) {
|
|
1761
|
+
if (!opt) return;
|
|
1762
|
+
var _opt$split = opt.split(':'),
|
|
1763
|
+
_opt$split2 = _toArray(_opt$split),
|
|
1764
|
+
key = _opt$split2[0],
|
|
1765
|
+
rest = _opt$split2.slice(1);
|
|
1766
|
+
var val = rest.join(':').trim().replace(/^'+|'+$/g, '');
|
|
1767
|
+
if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val;
|
|
1768
|
+
if (val === 'false') formatOptions[key.trim()] = false;
|
|
1769
|
+
if (val === 'true') formatOptions[key.trim()] = true;
|
|
1770
|
+
if (!isNaN(val)) formatOptions[key.trim()] = parseInt(val, 10);
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1754
1773
|
}
|
|
1774
|
+
return {
|
|
1775
|
+
formatName: formatName,
|
|
1776
|
+
formatOptions: formatOptions
|
|
1777
|
+
};
|
|
1755
1778
|
}
|
|
1779
|
+
function createCachedFormatter(fn) {
|
|
1780
|
+
var cache = {};
|
|
1781
|
+
return function invokeFormatter(val, lng, options) {
|
|
1782
|
+
var key = lng + JSON.stringify(options);
|
|
1783
|
+
var formatter = cache[key];
|
|
1784
|
+
if (!formatter) {
|
|
1785
|
+
formatter = fn(lng, options);
|
|
1786
|
+
cache[key] = formatter;
|
|
1787
|
+
}
|
|
1788
|
+
return formatter(val);
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
var Formatter = function () {
|
|
1792
|
+
function Formatter() {
|
|
1793
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1794
|
+
_classCallCheck(this, Formatter);
|
|
1795
|
+
this.logger = baseLogger.create('formatter');
|
|
1796
|
+
this.options = options;
|
|
1797
|
+
this.formats = {
|
|
1798
|
+
number: createCachedFormatter(function (lng, opt) {
|
|
1799
|
+
var formatter = new Intl.NumberFormat(lng, _objectSpread$2({}, opt));
|
|
1800
|
+
return function (val) {
|
|
1801
|
+
return formatter.format(val);
|
|
1802
|
+
};
|
|
1803
|
+
}),
|
|
1804
|
+
currency: createCachedFormatter(function (lng, opt) {
|
|
1805
|
+
var formatter = new Intl.NumberFormat(lng, _objectSpread$2(_objectSpread$2({}, opt), {}, {
|
|
1806
|
+
style: 'currency'
|
|
1807
|
+
}));
|
|
1808
|
+
return function (val) {
|
|
1809
|
+
return formatter.format(val);
|
|
1810
|
+
};
|
|
1811
|
+
}),
|
|
1812
|
+
datetime: createCachedFormatter(function (lng, opt) {
|
|
1813
|
+
var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2({}, opt));
|
|
1814
|
+
return function (val) {
|
|
1815
|
+
return formatter.format(val);
|
|
1816
|
+
};
|
|
1817
|
+
}),
|
|
1818
|
+
relativetime: createCachedFormatter(function (lng, opt) {
|
|
1819
|
+
var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2({}, opt));
|
|
1820
|
+
return function (val) {
|
|
1821
|
+
return formatter.format(val, opt.range || 'day');
|
|
1822
|
+
};
|
|
1823
|
+
}),
|
|
1824
|
+
list: createCachedFormatter(function (lng, opt) {
|
|
1825
|
+
var formatter = new Intl.ListFormat(lng, _objectSpread$2({}, opt));
|
|
1826
|
+
return function (val) {
|
|
1827
|
+
return formatter.format(val);
|
|
1828
|
+
};
|
|
1829
|
+
})
|
|
1830
|
+
};
|
|
1831
|
+
this.init(options);
|
|
1832
|
+
}
|
|
1833
|
+
_createClass(Formatter, [{
|
|
1834
|
+
key: "init",
|
|
1835
|
+
value: function init(services) {
|
|
1836
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
1837
|
+
interpolation: {}
|
|
1838
|
+
};
|
|
1839
|
+
var iOpts = options.interpolation;
|
|
1840
|
+
this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';
|
|
1841
|
+
}
|
|
1842
|
+
}, {
|
|
1843
|
+
key: "add",
|
|
1844
|
+
value: function add(name, fc) {
|
|
1845
|
+
this.formats[name.toLowerCase().trim()] = fc;
|
|
1846
|
+
}
|
|
1847
|
+
}, {
|
|
1848
|
+
key: "addCached",
|
|
1849
|
+
value: function addCached(name, fc) {
|
|
1850
|
+
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
|
|
1851
|
+
}
|
|
1852
|
+
}, {
|
|
1853
|
+
key: "format",
|
|
1854
|
+
value: function format(value, _format, lng) {
|
|
1855
|
+
var _this = this;
|
|
1856
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1857
|
+
var formats = _format.split(this.formatSeparator);
|
|
1858
|
+
var result = formats.reduce(function (mem, f) {
|
|
1859
|
+
var _parseFormatStr = parseFormatStr(f),
|
|
1860
|
+
formatName = _parseFormatStr.formatName,
|
|
1861
|
+
formatOptions = _parseFormatStr.formatOptions;
|
|
1862
|
+
if (_this.formats[formatName]) {
|
|
1863
|
+
var formatted = mem;
|
|
1864
|
+
try {
|
|
1865
|
+
var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
|
|
1866
|
+
var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
|
1867
|
+
formatted = _this.formats[formatName](mem, l, _objectSpread$2(_objectSpread$2(_objectSpread$2({}, formatOptions), options), valOptions));
|
|
1868
|
+
} catch (error) {
|
|
1869
|
+
_this.logger.warn(error);
|
|
1870
|
+
}
|
|
1871
|
+
return formatted;
|
|
1872
|
+
} else {
|
|
1873
|
+
_this.logger.warn("there was no format function for ".concat(formatName));
|
|
1874
|
+
}
|
|
1875
|
+
return mem;
|
|
1876
|
+
}, value);
|
|
1877
|
+
return result;
|
|
1878
|
+
}
|
|
1879
|
+
}]);
|
|
1880
|
+
return Formatter;
|
|
1881
|
+
}();
|
|
1756
1882
|
|
|
1883
|
+
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; }
|
|
1884
|
+
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; }
|
|
1885
|
+
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); }; }
|
|
1886
|
+
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; } }
|
|
1887
|
+
function removePending(q, name) {
|
|
1888
|
+
if (q.pending[name] !== undefined) {
|
|
1889
|
+
delete q.pending[name];
|
|
1890
|
+
q.pendingCount--;
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1757
1893
|
var Connector = function (_EventEmitter) {
|
|
1758
1894
|
_inherits(Connector, _EventEmitter);
|
|
1759
|
-
|
|
1895
|
+
var _super = _createSuper$1(Connector);
|
|
1760
1896
|
function Connector(backend, store, services) {
|
|
1761
1897
|
var _this;
|
|
1762
|
-
|
|
1763
1898
|
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1764
|
-
|
|
1765
1899
|
_classCallCheck(this, Connector);
|
|
1766
|
-
|
|
1767
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this));
|
|
1768
|
-
|
|
1900
|
+
_this = _super.call(this);
|
|
1769
1901
|
if (isIE10) {
|
|
1770
1902
|
EventEmitter.call(_assertThisInitialized(_this));
|
|
1771
1903
|
}
|
|
1772
|
-
|
|
1773
1904
|
_this.backend = backend;
|
|
1774
1905
|
_this.store = store;
|
|
1775
1906
|
_this.services = services;
|
|
1776
1907
|
_this.languageUtils = services.languageUtils;
|
|
1777
1908
|
_this.options = options;
|
|
1778
1909
|
_this.logger = baseLogger.create('backendConnector');
|
|
1910
|
+
_this.waitingReads = [];
|
|
1911
|
+
_this.maxParallelReads = options.maxParallelReads || 10;
|
|
1912
|
+
_this.readingCalls = 0;
|
|
1913
|
+
_this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
|
|
1914
|
+
_this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
|
|
1779
1915
|
_this.state = {};
|
|
1780
1916
|
_this.queue = [];
|
|
1781
|
-
|
|
1782
1917
|
if (_this.backend && _this.backend.init) {
|
|
1783
1918
|
_this.backend.init(services, options.backend, options);
|
|
1784
1919
|
}
|
|
1785
|
-
|
|
1786
1920
|
return _this;
|
|
1787
1921
|
}
|
|
1788
|
-
|
|
1789
1922
|
_createClass(Connector, [{
|
|
1790
1923
|
key: "queueLoad",
|
|
1791
1924
|
value: function queueLoad(languages, namespaces, options, callback) {
|
|
1792
1925
|
var _this2 = this;
|
|
1793
|
-
|
|
1794
|
-
var
|
|
1795
|
-
var
|
|
1796
|
-
var
|
|
1797
|
-
var toLoadNamespaces = [];
|
|
1926
|
+
var toLoad = {};
|
|
1927
|
+
var pending = {};
|
|
1928
|
+
var toLoadLanguages = {};
|
|
1929
|
+
var toLoadNamespaces = {};
|
|
1798
1930
|
languages.forEach(function (lng) {
|
|
1799
1931
|
var hasAllNamespaces = true;
|
|
1800
1932
|
namespaces.forEach(function (ns) {
|
|
1801
1933
|
var name = "".concat(lng, "|").concat(ns);
|
|
1802
|
-
|
|
1803
1934
|
if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {
|
|
1804
1935
|
_this2.state[name] = 2;
|
|
1805
1936
|
} else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {
|
|
1806
|
-
if (pending
|
|
1937
|
+
if (pending[name] === undefined) pending[name] = true;
|
|
1807
1938
|
} else {
|
|
1808
1939
|
_this2.state[name] = 1;
|
|
1809
1940
|
hasAllNamespaces = false;
|
|
1810
|
-
if (pending
|
|
1811
|
-
if (toLoad
|
|
1812
|
-
if (toLoadNamespaces
|
|
1941
|
+
if (pending[name] === undefined) pending[name] = true;
|
|
1942
|
+
if (toLoad[name] === undefined) toLoad[name] = true;
|
|
1943
|
+
if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;
|
|
1813
1944
|
}
|
|
1814
1945
|
});
|
|
1815
|
-
if (!hasAllNamespaces) toLoadLanguages
|
|
1946
|
+
if (!hasAllNamespaces) toLoadLanguages[lng] = true;
|
|
1816
1947
|
});
|
|
1817
|
-
|
|
1818
|
-
if (toLoad.length || pending.length) {
|
|
1948
|
+
if (Object.keys(toLoad).length || Object.keys(pending).length) {
|
|
1819
1949
|
this.queue.push({
|
|
1820
1950
|
pending: pending,
|
|
1951
|
+
pendingCount: Object.keys(pending).length,
|
|
1821
1952
|
loaded: {},
|
|
1822
1953
|
errors: [],
|
|
1823
1954
|
callback: callback
|
|
1824
1955
|
});
|
|
1825
1956
|
}
|
|
1826
|
-
|
|
1827
1957
|
return {
|
|
1828
|
-
toLoad: toLoad,
|
|
1829
|
-
pending: pending,
|
|
1830
|
-
toLoadLanguages: toLoadLanguages,
|
|
1831
|
-
toLoadNamespaces: toLoadNamespaces
|
|
1958
|
+
toLoad: Object.keys(toLoad),
|
|
1959
|
+
pending: Object.keys(pending),
|
|
1960
|
+
toLoadLanguages: Object.keys(toLoadLanguages),
|
|
1961
|
+
toLoadNamespaces: Object.keys(toLoadNamespaces)
|
|
1832
1962
|
};
|
|
1833
1963
|
}
|
|
1834
1964
|
}, {
|
|
@@ -1838,30 +1968,26 @@ var Connector = function (_EventEmitter) {
|
|
|
1838
1968
|
var lng = s[0];
|
|
1839
1969
|
var ns = s[1];
|
|
1840
1970
|
if (err) this.emit('failedLoading', lng, ns, err);
|
|
1841
|
-
|
|
1842
1971
|
if (data) {
|
|
1843
1972
|
this.store.addResourceBundle(lng, ns, data);
|
|
1844
1973
|
}
|
|
1845
|
-
|
|
1846
1974
|
this.state[name] = err ? -1 : 2;
|
|
1847
1975
|
var loaded = {};
|
|
1848
1976
|
this.queue.forEach(function (q) {
|
|
1849
1977
|
pushPath(q.loaded, [lng], ns);
|
|
1850
|
-
|
|
1978
|
+
removePending(q, name);
|
|
1851
1979
|
if (err) q.errors.push(err);
|
|
1852
|
-
|
|
1853
|
-
if (q.pending.length === 0 && !q.done) {
|
|
1980
|
+
if (q.pendingCount === 0 && !q.done) {
|
|
1854
1981
|
Object.keys(q.loaded).forEach(function (l) {
|
|
1855
|
-
if (!loaded[l]) loaded[l] =
|
|
1856
|
-
|
|
1857
|
-
if (
|
|
1858
|
-
|
|
1859
|
-
if (loaded[l]
|
|
1982
|
+
if (!loaded[l]) loaded[l] = {};
|
|
1983
|
+
var loadedKeys = q.loaded[l];
|
|
1984
|
+
if (loadedKeys.length) {
|
|
1985
|
+
loadedKeys.forEach(function (n) {
|
|
1986
|
+
if (loaded[l][n] === undefined) loaded[l][n] = true;
|
|
1860
1987
|
});
|
|
1861
1988
|
}
|
|
1862
1989
|
});
|
|
1863
1990
|
q.done = true;
|
|
1864
|
-
|
|
1865
1991
|
if (q.errors.length) {
|
|
1866
1992
|
q.callback(q.errors);
|
|
1867
1993
|
} else {
|
|
@@ -1878,44 +2004,71 @@ var Connector = function (_EventEmitter) {
|
|
|
1878
2004
|
key: "read",
|
|
1879
2005
|
value: function read(lng, ns, fcName) {
|
|
1880
2006
|
var _this3 = this;
|
|
1881
|
-
|
|
1882
2007
|
var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1883
|
-
var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] :
|
|
2008
|
+
var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;
|
|
1884
2009
|
var callback = arguments.length > 5 ? arguments[5] : undefined;
|
|
1885
2010
|
if (!lng.length) return callback(null, {});
|
|
1886
|
-
|
|
1887
|
-
|
|
2011
|
+
if (this.readingCalls >= this.maxParallelReads) {
|
|
2012
|
+
this.waitingReads.push({
|
|
2013
|
+
lng: lng,
|
|
2014
|
+
ns: ns,
|
|
2015
|
+
fcName: fcName,
|
|
2016
|
+
tried: tried,
|
|
2017
|
+
wait: wait,
|
|
2018
|
+
callback: callback
|
|
2019
|
+
});
|
|
2020
|
+
return;
|
|
2021
|
+
}
|
|
2022
|
+
this.readingCalls++;
|
|
2023
|
+
var resolver = function resolver(err, data) {
|
|
2024
|
+
_this3.readingCalls--;
|
|
2025
|
+
if (_this3.waitingReads.length > 0) {
|
|
2026
|
+
var next = _this3.waitingReads.shift();
|
|
2027
|
+
_this3.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
|
|
2028
|
+
}
|
|
2029
|
+
if (err && data && tried < _this3.maxRetries) {
|
|
1888
2030
|
setTimeout(function () {
|
|
1889
2031
|
_this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);
|
|
1890
2032
|
}, wait);
|
|
1891
2033
|
return;
|
|
1892
2034
|
}
|
|
1893
|
-
|
|
1894
2035
|
callback(err, data);
|
|
1895
|
-
}
|
|
2036
|
+
};
|
|
2037
|
+
var fc = this.backend[fcName].bind(this.backend);
|
|
2038
|
+
if (fc.length === 2) {
|
|
2039
|
+
try {
|
|
2040
|
+
var r = fc(lng, ns);
|
|
2041
|
+
if (r && typeof r.then === 'function') {
|
|
2042
|
+
r.then(function (data) {
|
|
2043
|
+
return resolver(null, data);
|
|
2044
|
+
})["catch"](resolver);
|
|
2045
|
+
} else {
|
|
2046
|
+
resolver(null, r);
|
|
2047
|
+
}
|
|
2048
|
+
} catch (err) {
|
|
2049
|
+
resolver(err);
|
|
2050
|
+
}
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
2053
|
+
return fc(lng, ns, resolver);
|
|
1896
2054
|
}
|
|
1897
2055
|
}, {
|
|
1898
2056
|
key: "prepareLoading",
|
|
1899
2057
|
value: function prepareLoading(languages, namespaces) {
|
|
1900
2058
|
var _this4 = this;
|
|
1901
|
-
|
|
1902
2059
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1903
2060
|
var callback = arguments.length > 3 ? arguments[3] : undefined;
|
|
1904
|
-
|
|
1905
2061
|
if (!this.backend) {
|
|
1906
2062
|
this.logger.warn('No backend was added via i18next.use. Will not load resources.');
|
|
1907
2063
|
return callback && callback();
|
|
1908
2064
|
}
|
|
1909
|
-
|
|
1910
2065
|
if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);
|
|
1911
2066
|
if (typeof namespaces === 'string') namespaces = [namespaces];
|
|
1912
2067
|
var toLoad = this.queueLoad(languages, namespaces, options, callback);
|
|
1913
|
-
|
|
1914
2068
|
if (!toLoad.toLoad.length) {
|
|
1915
2069
|
if (!toLoad.pending.length) callback();
|
|
1916
2070
|
return null;
|
|
1917
2071
|
}
|
|
1918
|
-
|
|
1919
2072
|
toLoad.toLoad.forEach(function (name) {
|
|
1920
2073
|
_this4.loadOne(name);
|
|
1921
2074
|
});
|
|
@@ -1936,7 +2089,6 @@ var Connector = function (_EventEmitter) {
|
|
|
1936
2089
|
key: "loadOne",
|
|
1937
2090
|
value: function loadOne(name) {
|
|
1938
2091
|
var _this5 = this;
|
|
1939
|
-
|
|
1940
2092
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1941
2093
|
var s = name.split('|');
|
|
1942
2094
|
var lng = s[0];
|
|
@@ -1944,7 +2096,6 @@ var Connector = function (_EventEmitter) {
|
|
|
1944
2096
|
this.read(lng, ns, 'read', undefined, undefined, function (err, data) {
|
|
1945
2097
|
if (err) _this5.logger.warn("".concat(prefix, "loading namespace ").concat(ns, " for language ").concat(lng, " failed"), err);
|
|
1946
2098
|
if (!err && data) _this5.logger.log("".concat(prefix, "loaded namespace ").concat(ns, " for language ").concat(lng), data);
|
|
1947
|
-
|
|
1948
2099
|
_this5.loaded(name, err, data);
|
|
1949
2100
|
});
|
|
1950
2101
|
}
|
|
@@ -1952,25 +2103,43 @@ var Connector = function (_EventEmitter) {
|
|
|
1952
2103
|
key: "saveMissing",
|
|
1953
2104
|
value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
|
1954
2105
|
var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
1955
|
-
|
|
2106
|
+
var clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : function () {};
|
|
1956
2107
|
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
|
|
1957
2108
|
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!!!');
|
|
1958
2109
|
return;
|
|
1959
2110
|
}
|
|
1960
|
-
|
|
1961
2111
|
if (key === undefined || key === null || key === '') return;
|
|
1962
|
-
|
|
1963
2112
|
if (this.backend && this.backend.create) {
|
|
1964
|
-
|
|
2113
|
+
var opts = _objectSpread$1(_objectSpread$1({}, options), {}, {
|
|
1965
2114
|
isUpdate: isUpdate
|
|
1966
|
-
})
|
|
2115
|
+
});
|
|
2116
|
+
var fc = this.backend.create.bind(this.backend);
|
|
2117
|
+
if (fc.length < 6) {
|
|
2118
|
+
try {
|
|
2119
|
+
var r;
|
|
2120
|
+
if (fc.length === 5) {
|
|
2121
|
+
r = fc(languages, namespace, key, fallbackValue, opts);
|
|
2122
|
+
} else {
|
|
2123
|
+
r = fc(languages, namespace, key, fallbackValue);
|
|
2124
|
+
}
|
|
2125
|
+
if (r && typeof r.then === 'function') {
|
|
2126
|
+
r.then(function (data) {
|
|
2127
|
+
return clb(null, data);
|
|
2128
|
+
})["catch"](clb);
|
|
2129
|
+
} else {
|
|
2130
|
+
clb(null, r);
|
|
2131
|
+
}
|
|
2132
|
+
} catch (err) {
|
|
2133
|
+
clb(err);
|
|
2134
|
+
}
|
|
2135
|
+
} else {
|
|
2136
|
+
fc(languages, namespace, key, fallbackValue, clb, opts);
|
|
2137
|
+
}
|
|
1967
2138
|
}
|
|
1968
|
-
|
|
1969
2139
|
if (!languages || !languages[0]) return;
|
|
1970
2140
|
this.store.addResource(languages[0], namespace, key, fallbackValue);
|
|
1971
2141
|
}
|
|
1972
2142
|
}]);
|
|
1973
|
-
|
|
1974
2143
|
return Connector;
|
|
1975
2144
|
}(EventEmitter);
|
|
1976
2145
|
|
|
@@ -1982,8 +2151,6 @@ function get() {
|
|
|
1982
2151
|
defaultNS: ['translation'],
|
|
1983
2152
|
fallbackLng: ['dev'],
|
|
1984
2153
|
fallbackNS: false,
|
|
1985
|
-
whitelist: false,
|
|
1986
|
-
nonExplicitWhitelist: false,
|
|
1987
2154
|
supportedLngs: false,
|
|
1988
2155
|
nonExplicitSupportedLngs: false,
|
|
1989
2156
|
load: 'all',
|
|
@@ -2015,14 +2182,12 @@ function get() {
|
|
|
2015
2182
|
if (_typeof(args[1]) === 'object') ret = args[1];
|
|
2016
2183
|
if (typeof args[1] === 'string') ret.defaultValue = args[1];
|
|
2017
2184
|
if (typeof args[2] === 'string') ret.tDescription = args[2];
|
|
2018
|
-
|
|
2019
2185
|
if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {
|
|
2020
2186
|
var options = args[3] || args[2];
|
|
2021
2187
|
Object.keys(options).forEach(function (key) {
|
|
2022
2188
|
ret[key] = options[key];
|
|
2023
2189
|
});
|
|
2024
2190
|
}
|
|
2025
|
-
|
|
2026
2191
|
return ret;
|
|
2027
2192
|
},
|
|
2028
2193
|
interpolation: {
|
|
@@ -2038,113 +2203,108 @@ function get() {
|
|
|
2038
2203
|
nestingSuffix: ')',
|
|
2039
2204
|
nestingOptionsSeparator: ',',
|
|
2040
2205
|
maxReplaces: 1000,
|
|
2041
|
-
skipOnVariables:
|
|
2206
|
+
skipOnVariables: true
|
|
2042
2207
|
}
|
|
2043
2208
|
};
|
|
2044
2209
|
}
|
|
2045
2210
|
function transformOptions(options) {
|
|
2046
2211
|
if (typeof options.ns === 'string') options.ns = [options.ns];
|
|
2047
2212
|
if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];
|
|
2048
|
-
if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];
|
|
2049
|
-
|
|
2050
|
-
if (options.whitelist) {
|
|
2051
|
-
if (options.whitelist && options.whitelist.indexOf('cimode') < 0) {
|
|
2052
|
-
options.whitelist = options.whitelist.concat(['cimode']);
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
options.supportedLngs = options.whitelist;
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
if (options.nonExplicitWhitelist) {
|
|
2059
|
-
options.nonExplicitSupportedLngs = options.nonExplicitWhitelist;
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2213
|
+
if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];
|
|
2062
2214
|
if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {
|
|
2063
2215
|
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
|
2064
2216
|
}
|
|
2065
|
-
|
|
2066
2217
|
return options;
|
|
2067
2218
|
}
|
|
2068
2219
|
|
|
2220
|
+
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; }
|
|
2221
|
+
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; }
|
|
2222
|
+
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); }; }
|
|
2223
|
+
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; } }
|
|
2069
2224
|
function noop() {}
|
|
2070
|
-
|
|
2225
|
+
function bindMemberFunctions(inst) {
|
|
2226
|
+
var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
|
|
2227
|
+
mems.forEach(function (mem) {
|
|
2228
|
+
if (typeof inst[mem] === 'function') {
|
|
2229
|
+
inst[mem] = inst[mem].bind(inst);
|
|
2230
|
+
}
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2071
2233
|
var I18n = function (_EventEmitter) {
|
|
2072
2234
|
_inherits(I18n, _EventEmitter);
|
|
2073
|
-
|
|
2235
|
+
var _super = _createSuper(I18n);
|
|
2074
2236
|
function I18n() {
|
|
2075
2237
|
var _this;
|
|
2076
|
-
|
|
2077
2238
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2078
2239
|
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2079
|
-
|
|
2080
2240
|
_classCallCheck(this, I18n);
|
|
2081
|
-
|
|
2082
|
-
_this = _possibleConstructorReturn(this, _getPrototypeOf(I18n).call(this));
|
|
2083
|
-
|
|
2241
|
+
_this = _super.call(this);
|
|
2084
2242
|
if (isIE10) {
|
|
2085
2243
|
EventEmitter.call(_assertThisInitialized(_this));
|
|
2086
2244
|
}
|
|
2087
|
-
|
|
2088
2245
|
_this.options = transformOptions(options);
|
|
2089
2246
|
_this.services = {};
|
|
2090
2247
|
_this.logger = baseLogger;
|
|
2091
2248
|
_this.modules = {
|
|
2092
2249
|
external: []
|
|
2093
2250
|
};
|
|
2094
|
-
|
|
2251
|
+
bindMemberFunctions(_assertThisInitialized(_this));
|
|
2095
2252
|
if (callback && !_this.isInitialized && !options.isClone) {
|
|
2096
2253
|
if (!_this.options.initImmediate) {
|
|
2097
2254
|
_this.init(options, callback);
|
|
2098
|
-
|
|
2099
2255
|
return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
|
|
2100
2256
|
}
|
|
2101
|
-
|
|
2102
2257
|
setTimeout(function () {
|
|
2103
2258
|
_this.init(options, callback);
|
|
2104
2259
|
}, 0);
|
|
2105
2260
|
}
|
|
2106
|
-
|
|
2107
2261
|
return _this;
|
|
2108
2262
|
}
|
|
2109
|
-
|
|
2110
2263
|
_createClass(I18n, [{
|
|
2111
2264
|
key: "init",
|
|
2112
2265
|
value: function init() {
|
|
2113
2266
|
var _this2 = this;
|
|
2114
|
-
|
|
2115
2267
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2116
2268
|
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2117
|
-
|
|
2118
2269
|
if (typeof options === 'function') {
|
|
2119
2270
|
callback = options;
|
|
2120
2271
|
options = {};
|
|
2121
2272
|
}
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2273
|
+
if (!options.defaultNS && options.defaultNS !== false && options.ns) {
|
|
2274
|
+
if (typeof options.ns === 'string') {
|
|
2275
|
+
options.defaultNS = options.ns;
|
|
2276
|
+
} else if (options.ns.indexOf('translation') < 0) {
|
|
2277
|
+
options.defaultNS = options.ns[0];
|
|
2278
|
+
}
|
|
2125
2279
|
}
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2280
|
+
var defOpts = get();
|
|
2281
|
+
this.options = _objectSpread(_objectSpread(_objectSpread({}, defOpts), this.options), transformOptions(options));
|
|
2282
|
+
if (this.options.compatibilityAPI !== 'v1') {
|
|
2283
|
+
this.options.interpolation = _objectSpread(_objectSpread({}, defOpts.interpolation), this.options.interpolation);
|
|
2284
|
+
}
|
|
2285
|
+
if (options.keySeparator !== undefined) {
|
|
2286
|
+
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
2287
|
+
}
|
|
2288
|
+
if (options.nsSeparator !== undefined) {
|
|
2289
|
+
this.options.userDefinedNsSeparator = options.nsSeparator;
|
|
2129
2290
|
}
|
|
2130
|
-
|
|
2131
|
-
this.options = _objectSpread({}, get(), this.options, transformOptions(options));
|
|
2132
|
-
this.format = this.options.interpolation.format;
|
|
2133
|
-
if (!callback) callback = noop;
|
|
2134
|
-
|
|
2135
2291
|
function createClassOnDemand(ClassOrObject) {
|
|
2136
2292
|
if (!ClassOrObject) return null;
|
|
2137
2293
|
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
|
2138
2294
|
return ClassOrObject;
|
|
2139
2295
|
}
|
|
2140
|
-
|
|
2141
2296
|
if (!this.options.isClone) {
|
|
2142
2297
|
if (this.modules.logger) {
|
|
2143
2298
|
baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
|
|
2144
2299
|
} else {
|
|
2145
2300
|
baseLogger.init(null, this.options);
|
|
2146
2301
|
}
|
|
2147
|
-
|
|
2302
|
+
var formatter;
|
|
2303
|
+
if (this.modules.formatter) {
|
|
2304
|
+
formatter = this.modules.formatter;
|
|
2305
|
+
} else if (typeof Intl !== 'undefined') {
|
|
2306
|
+
formatter = Formatter;
|
|
2307
|
+
}
|
|
2148
2308
|
var lu = new LanguageUtil(this.options);
|
|
2149
2309
|
this.store = new ResourceStore(this.options.resources, this.options);
|
|
2150
2310
|
var s = this.services;
|
|
@@ -2156,6 +2316,11 @@ var I18n = function (_EventEmitter) {
|
|
|
2156
2316
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
2157
2317
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
2158
2318
|
});
|
|
2319
|
+
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
2320
|
+
s.formatter = createClassOnDemand(formatter);
|
|
2321
|
+
s.formatter.init(s, this.options);
|
|
2322
|
+
this.options.interpolation.format = s.formatter.format.bind(s.formatter);
|
|
2323
|
+
}
|
|
2159
2324
|
s.interpolator = new Interpolator(this.options);
|
|
2160
2325
|
s.utils = {
|
|
2161
2326
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
@@ -2165,47 +2330,40 @@ var I18n = function (_EventEmitter) {
|
|
|
2165
2330
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2166
2331
|
args[_key - 1] = arguments[_key];
|
|
2167
2332
|
}
|
|
2168
|
-
|
|
2169
2333
|
_this2.emit.apply(_this2, [event].concat(args));
|
|
2170
2334
|
});
|
|
2171
|
-
|
|
2172
2335
|
if (this.modules.languageDetector) {
|
|
2173
2336
|
s.languageDetector = createClassOnDemand(this.modules.languageDetector);
|
|
2174
|
-
s.languageDetector.init(s, this.options.detection, this.options);
|
|
2337
|
+
if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
|
|
2175
2338
|
}
|
|
2176
|
-
|
|
2177
2339
|
if (this.modules.i18nFormat) {
|
|
2178
2340
|
s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
|
|
2179
2341
|
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
|
2180
2342
|
}
|
|
2181
|
-
|
|
2182
2343
|
this.translator = new Translator(this.services, this.options);
|
|
2183
2344
|
this.translator.on('*', function (event) {
|
|
2184
2345
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2185
2346
|
args[_key2 - 1] = arguments[_key2];
|
|
2186
2347
|
}
|
|
2187
|
-
|
|
2188
2348
|
_this2.emit.apply(_this2, [event].concat(args));
|
|
2189
2349
|
});
|
|
2190
2350
|
this.modules.external.forEach(function (m) {
|
|
2191
2351
|
if (m.init) m.init(_this2);
|
|
2192
2352
|
});
|
|
2193
2353
|
}
|
|
2194
|
-
|
|
2354
|
+
this.format = this.options.interpolation.format;
|
|
2355
|
+
if (!callback) callback = noop;
|
|
2195
2356
|
if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2196
2357
|
var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2197
2358
|
if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
|
|
2198
2359
|
}
|
|
2199
|
-
|
|
2200
2360
|
if (!this.services.languageDetector && !this.options.lng) {
|
|
2201
2361
|
this.logger.warn('init: no languageDetector is used and no lng is defined');
|
|
2202
2362
|
}
|
|
2203
|
-
|
|
2204
2363
|
var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
|
|
2205
2364
|
storeApi.forEach(function (fcName) {
|
|
2206
2365
|
_this2[fcName] = function () {
|
|
2207
2366
|
var _this2$store;
|
|
2208
|
-
|
|
2209
2367
|
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
|
|
2210
2368
|
};
|
|
2211
2369
|
});
|
|
@@ -2213,63 +2371,48 @@ var I18n = function (_EventEmitter) {
|
|
|
2213
2371
|
storeApiChained.forEach(function (fcName) {
|
|
2214
2372
|
_this2[fcName] = function () {
|
|
2215
2373
|
var _this2$store2;
|
|
2216
|
-
|
|
2217
2374
|
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
|
|
2218
|
-
|
|
2219
2375
|
return _this2;
|
|
2220
2376
|
};
|
|
2221
2377
|
});
|
|
2222
2378
|
var deferred = defer();
|
|
2223
|
-
|
|
2224
2379
|
var load = function load() {
|
|
2225
2380
|
var finish = function finish(err, t) {
|
|
2226
2381
|
if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');
|
|
2227
2382
|
_this2.isInitialized = true;
|
|
2228
2383
|
if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
|
|
2229
|
-
|
|
2230
2384
|
_this2.emit('initialized', _this2.options);
|
|
2231
|
-
|
|
2232
2385
|
deferred.resolve(t);
|
|
2233
2386
|
callback(err, t);
|
|
2234
2387
|
};
|
|
2235
|
-
|
|
2236
2388
|
if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));
|
|
2237
|
-
|
|
2238
2389
|
_this2.changeLanguage(_this2.options.lng, finish);
|
|
2239
2390
|
};
|
|
2240
|
-
|
|
2241
2391
|
if (this.options.resources || !this.options.initImmediate) {
|
|
2242
2392
|
load();
|
|
2243
2393
|
} else {
|
|
2244
2394
|
setTimeout(load, 0);
|
|
2245
2395
|
}
|
|
2246
|
-
|
|
2247
2396
|
return deferred;
|
|
2248
2397
|
}
|
|
2249
2398
|
}, {
|
|
2250
2399
|
key: "loadResources",
|
|
2251
2400
|
value: function loadResources(language) {
|
|
2252
2401
|
var _this3 = this;
|
|
2253
|
-
|
|
2254
2402
|
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2255
2403
|
var usedCallback = callback;
|
|
2256
2404
|
var usedLng = typeof language === 'string' ? language : this.language;
|
|
2257
2405
|
if (typeof language === 'function') usedCallback = language;
|
|
2258
|
-
|
|
2259
2406
|
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
2260
2407
|
if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();
|
|
2261
2408
|
var toLoad = [];
|
|
2262
|
-
|
|
2263
2409
|
var append = function append(lng) {
|
|
2264
2410
|
if (!lng) return;
|
|
2265
|
-
|
|
2266
2411
|
var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);
|
|
2267
|
-
|
|
2268
2412
|
lngs.forEach(function (l) {
|
|
2269
2413
|
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
|
2270
2414
|
});
|
|
2271
2415
|
};
|
|
2272
|
-
|
|
2273
2416
|
if (!usedLng) {
|
|
2274
2417
|
var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2275
2418
|
fallbacks.forEach(function (l) {
|
|
@@ -2278,14 +2421,15 @@ var I18n = function (_EventEmitter) {
|
|
|
2278
2421
|
} else {
|
|
2279
2422
|
append(usedLng);
|
|
2280
2423
|
}
|
|
2281
|
-
|
|
2282
2424
|
if (this.options.preload) {
|
|
2283
2425
|
this.options.preload.forEach(function (l) {
|
|
2284
2426
|
return append(l);
|
|
2285
2427
|
});
|
|
2286
2428
|
}
|
|
2287
|
-
|
|
2288
|
-
|
|
2429
|
+
this.services.backendConnector.load(toLoad, this.options.ns, function (e) {
|
|
2430
|
+
if (!e && !_this3.resolvedLanguage && _this3.language) _this3.setResolvedLanguage(_this3.language);
|
|
2431
|
+
usedCallback(e);
|
|
2432
|
+
});
|
|
2289
2433
|
} else {
|
|
2290
2434
|
usedCallback(null);
|
|
2291
2435
|
}
|
|
@@ -2308,58 +2452,66 @@ var I18n = function (_EventEmitter) {
|
|
|
2308
2452
|
value: function use(module) {
|
|
2309
2453
|
if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
|
|
2310
2454
|
if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
|
|
2311
|
-
|
|
2312
2455
|
if (module.type === 'backend') {
|
|
2313
2456
|
this.modules.backend = module;
|
|
2314
2457
|
}
|
|
2315
|
-
|
|
2316
2458
|
if (module.type === 'logger' || module.log && module.warn && module.error) {
|
|
2317
2459
|
this.modules.logger = module;
|
|
2318
2460
|
}
|
|
2319
|
-
|
|
2320
2461
|
if (module.type === 'languageDetector') {
|
|
2321
2462
|
this.modules.languageDetector = module;
|
|
2322
2463
|
}
|
|
2323
|
-
|
|
2324
2464
|
if (module.type === 'i18nFormat') {
|
|
2325
2465
|
this.modules.i18nFormat = module;
|
|
2326
2466
|
}
|
|
2327
|
-
|
|
2328
2467
|
if (module.type === 'postProcessor') {
|
|
2329
2468
|
postProcessor.addPostProcessor(module);
|
|
2330
2469
|
}
|
|
2331
|
-
|
|
2470
|
+
if (module.type === 'formatter') {
|
|
2471
|
+
this.modules.formatter = module;
|
|
2472
|
+
}
|
|
2332
2473
|
if (module.type === '3rdParty') {
|
|
2333
2474
|
this.modules.external.push(module);
|
|
2334
2475
|
}
|
|
2335
|
-
|
|
2336
2476
|
return this;
|
|
2337
2477
|
}
|
|
2478
|
+
}, {
|
|
2479
|
+
key: "setResolvedLanguage",
|
|
2480
|
+
value: function setResolvedLanguage(l) {
|
|
2481
|
+
if (!l || !this.languages) return;
|
|
2482
|
+
if (['cimode', 'dev'].indexOf(l) > -1) return;
|
|
2483
|
+
for (var li = 0; li < this.languages.length; li++) {
|
|
2484
|
+
var lngInLngs = this.languages[li];
|
|
2485
|
+
if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
|
|
2486
|
+
if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
|
|
2487
|
+
this.resolvedLanguage = lngInLngs;
|
|
2488
|
+
break;
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2338
2492
|
}, {
|
|
2339
2493
|
key: "changeLanguage",
|
|
2340
2494
|
value: function changeLanguage(lng, callback) {
|
|
2341
2495
|
var _this4 = this;
|
|
2342
|
-
|
|
2343
2496
|
this.isLanguageChangingTo = lng;
|
|
2344
2497
|
var deferred = defer();
|
|
2345
2498
|
this.emit('languageChanging', lng);
|
|
2346
|
-
|
|
2499
|
+
var setLngProps = function setLngProps(l) {
|
|
2500
|
+
_this4.language = l;
|
|
2501
|
+
_this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
|
|
2502
|
+
_this4.resolvedLanguage = undefined;
|
|
2503
|
+
_this4.setResolvedLanguage(l);
|
|
2504
|
+
};
|
|
2347
2505
|
var done = function done(err, l) {
|
|
2348
2506
|
if (l) {
|
|
2349
|
-
|
|
2350
|
-
_this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
|
|
2351
|
-
|
|
2507
|
+
setLngProps(l);
|
|
2352
2508
|
_this4.translator.changeLanguage(l);
|
|
2353
|
-
|
|
2354
2509
|
_this4.isLanguageChangingTo = undefined;
|
|
2355
|
-
|
|
2356
2510
|
_this4.emit('languageChanged', l);
|
|
2357
|
-
|
|
2358
2511
|
_this4.logger.log('languageChanged', l);
|
|
2359
2512
|
} else {
|
|
2360
2513
|
_this4.isLanguageChangingTo = undefined;
|
|
2361
2514
|
}
|
|
2362
|
-
|
|
2363
2515
|
deferred.resolve(function () {
|
|
2364
2516
|
return _this4.t.apply(_this4, arguments);
|
|
2365
2517
|
});
|
|
@@ -2367,68 +2519,67 @@ var I18n = function (_EventEmitter) {
|
|
|
2367
2519
|
return _this4.t.apply(_this4, arguments);
|
|
2368
2520
|
});
|
|
2369
2521
|
};
|
|
2370
|
-
|
|
2371
2522
|
var setLng = function setLng(lngs) {
|
|
2372
2523
|
if (!lng && !lngs && _this4.services.languageDetector) lngs = [];
|
|
2373
2524
|
var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);
|
|
2374
|
-
|
|
2375
2525
|
if (l) {
|
|
2376
2526
|
if (!_this4.language) {
|
|
2377
|
-
|
|
2378
|
-
_this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
|
|
2527
|
+
setLngProps(l);
|
|
2379
2528
|
}
|
|
2380
|
-
|
|
2381
2529
|
if (!_this4.translator.language) _this4.translator.changeLanguage(l);
|
|
2382
|
-
if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);
|
|
2530
|
+
if (_this4.services.languageDetector && _this4.services.languageDetector.cacheUserLanguage) _this4.services.languageDetector.cacheUserLanguage(l);
|
|
2383
2531
|
}
|
|
2384
|
-
|
|
2385
2532
|
_this4.loadResources(l, function (err) {
|
|
2386
2533
|
done(err, l);
|
|
2387
2534
|
});
|
|
2388
2535
|
};
|
|
2389
|
-
|
|
2390
2536
|
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
|
|
2391
2537
|
setLng(this.services.languageDetector.detect());
|
|
2392
2538
|
} else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
|
|
2393
|
-
this.services.languageDetector.detect
|
|
2539
|
+
if (this.services.languageDetector.detect.length === 0) {
|
|
2540
|
+
this.services.languageDetector.detect().then(setLng);
|
|
2541
|
+
} else {
|
|
2542
|
+
this.services.languageDetector.detect(setLng);
|
|
2543
|
+
}
|
|
2394
2544
|
} else {
|
|
2395
2545
|
setLng(lng);
|
|
2396
2546
|
}
|
|
2397
|
-
|
|
2398
2547
|
return deferred;
|
|
2399
2548
|
}
|
|
2400
2549
|
}, {
|
|
2401
2550
|
key: "getFixedT",
|
|
2402
2551
|
value: function getFixedT(lng, ns, keyPrefix) {
|
|
2403
2552
|
var _this5 = this;
|
|
2404
|
-
|
|
2405
2553
|
var fixedT = function fixedT(key, opts) {
|
|
2406
2554
|
var options;
|
|
2407
|
-
|
|
2408
2555
|
if (_typeof(opts) !== 'object') {
|
|
2409
2556
|
for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
|
2410
2557
|
rest[_key3 - 2] = arguments[_key3];
|
|
2411
2558
|
}
|
|
2412
|
-
|
|
2413
2559
|
options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2414
2560
|
} else {
|
|
2415
2561
|
options = _objectSpread({}, opts);
|
|
2416
2562
|
}
|
|
2417
|
-
|
|
2418
2563
|
options.lng = options.lng || fixedT.lng;
|
|
2419
2564
|
options.lngs = options.lngs || fixedT.lngs;
|
|
2420
2565
|
options.ns = options.ns || fixedT.ns;
|
|
2566
|
+
options.keyPrefix = options.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
2421
2567
|
var keySeparator = _this5.options.keySeparator || '.';
|
|
2422
|
-
var resultKey
|
|
2568
|
+
var resultKey;
|
|
2569
|
+
if (options.keyPrefix && Array.isArray(key)) {
|
|
2570
|
+
resultKey = key.map(function (k) {
|
|
2571
|
+
return "".concat(options.keyPrefix).concat(keySeparator).concat(k);
|
|
2572
|
+
});
|
|
2573
|
+
} else {
|
|
2574
|
+
resultKey = options.keyPrefix ? "".concat(options.keyPrefix).concat(keySeparator).concat(key) : key;
|
|
2575
|
+
}
|
|
2423
2576
|
return _this5.t(resultKey, options);
|
|
2424
2577
|
};
|
|
2425
|
-
|
|
2426
2578
|
if (typeof lng === 'string') {
|
|
2427
2579
|
fixedT.lng = lng;
|
|
2428
2580
|
} else {
|
|
2429
2581
|
fixedT.lngs = lng;
|
|
2430
2582
|
}
|
|
2431
|
-
|
|
2432
2583
|
fixedT.ns = ns;
|
|
2433
2584
|
fixedT.keyPrefix = keyPrefix;
|
|
2434
2585
|
return fixedT;
|
|
@@ -2437,14 +2588,12 @@ var I18n = function (_EventEmitter) {
|
|
|
2437
2588
|
key: "t",
|
|
2438
2589
|
value: function t() {
|
|
2439
2590
|
var _this$translator;
|
|
2440
|
-
|
|
2441
2591
|
return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);
|
|
2442
2592
|
}
|
|
2443
2593
|
}, {
|
|
2444
2594
|
key: "exists",
|
|
2445
2595
|
value: function exists() {
|
|
2446
2596
|
var _this$translator2;
|
|
2447
|
-
|
|
2448
2597
|
return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);
|
|
2449
2598
|
}
|
|
2450
2599
|
}, {
|
|
@@ -2456,37 +2605,29 @@ var I18n = function (_EventEmitter) {
|
|
|
2456
2605
|
key: "hasLoadedNamespace",
|
|
2457
2606
|
value: function hasLoadedNamespace(ns) {
|
|
2458
2607
|
var _this6 = this;
|
|
2459
|
-
|
|
2460
2608
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2461
|
-
|
|
2462
2609
|
if (!this.isInitialized) {
|
|
2463
2610
|
this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
|
|
2464
2611
|
return false;
|
|
2465
2612
|
}
|
|
2466
|
-
|
|
2467
2613
|
if (!this.languages || !this.languages.length) {
|
|
2468
2614
|
this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
|
|
2469
2615
|
return false;
|
|
2470
2616
|
}
|
|
2471
|
-
|
|
2472
|
-
var lng = this.languages[0];
|
|
2617
|
+
var lng = options.lng || this.resolvedLanguage || this.languages[0];
|
|
2473
2618
|
var fallbackLng = this.options ? this.options.fallbackLng : false;
|
|
2474
2619
|
var lastLng = this.languages[this.languages.length - 1];
|
|
2475
2620
|
if (lng.toLowerCase() === 'cimode') return true;
|
|
2476
|
-
|
|
2477
2621
|
var loadNotPending = function loadNotPending(l, n) {
|
|
2478
2622
|
var loadState = _this6.services.backendConnector.state["".concat(l, "|").concat(n)];
|
|
2479
|
-
|
|
2480
2623
|
return loadState === -1 || loadState === 2;
|
|
2481
2624
|
};
|
|
2482
|
-
|
|
2483
2625
|
if (options.precheck) {
|
|
2484
2626
|
var preResult = options.precheck(this, loadNotPending);
|
|
2485
2627
|
if (preResult !== undefined) return preResult;
|
|
2486
2628
|
}
|
|
2487
|
-
|
|
2488
2629
|
if (this.hasResourceBundle(lng, ns)) return true;
|
|
2489
|
-
if (!this.services.backendConnector.backend) return true;
|
|
2630
|
+
if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
|
|
2490
2631
|
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
2491
2632
|
return false;
|
|
2492
2633
|
}
|
|
@@ -2494,14 +2635,11 @@ var I18n = function (_EventEmitter) {
|
|
|
2494
2635
|
key: "loadNamespaces",
|
|
2495
2636
|
value: function loadNamespaces(ns, callback) {
|
|
2496
2637
|
var _this7 = this;
|
|
2497
|
-
|
|
2498
2638
|
var deferred = defer();
|
|
2499
|
-
|
|
2500
2639
|
if (!this.options.ns) {
|
|
2501
|
-
callback
|
|
2640
|
+
if (callback) callback();
|
|
2502
2641
|
return Promise.resolve();
|
|
2503
2642
|
}
|
|
2504
|
-
|
|
2505
2643
|
if (typeof ns === 'string') ns = [ns];
|
|
2506
2644
|
ns.forEach(function (n) {
|
|
2507
2645
|
if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);
|
|
@@ -2521,12 +2659,10 @@ var I18n = function (_EventEmitter) {
|
|
|
2521
2659
|
var newLngs = lngs.filter(function (lng) {
|
|
2522
2660
|
return preloaded.indexOf(lng) < 0;
|
|
2523
2661
|
});
|
|
2524
|
-
|
|
2525
2662
|
if (!newLngs.length) {
|
|
2526
2663
|
if (callback) callback();
|
|
2527
2664
|
return Promise.resolve();
|
|
2528
2665
|
}
|
|
2529
|
-
|
|
2530
2666
|
this.options.preload = preloaded.concat(newLngs);
|
|
2531
2667
|
this.loadResources(function (err) {
|
|
2532
2668
|
deferred.resolve();
|
|
@@ -2537,31 +2673,25 @@ var I18n = function (_EventEmitter) {
|
|
|
2537
2673
|
}, {
|
|
2538
2674
|
key: "dir",
|
|
2539
2675
|
value: function dir(lng) {
|
|
2540
|
-
if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language;
|
|
2676
|
+
if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
|
|
2541
2677
|
if (!lng) return 'rtl';
|
|
2542
|
-
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'];
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
}, {
|
|
2546
|
-
key: "createInstance",
|
|
2547
|
-
value: function createInstance() {
|
|
2548
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2549
|
-
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2550
|
-
return new I18n(options, callback);
|
|
2678
|
+
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'];
|
|
2679
|
+
var languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());
|
|
2680
|
+
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2551
2681
|
}
|
|
2552
2682
|
}, {
|
|
2553
2683
|
key: "cloneInstance",
|
|
2554
2684
|
value: function cloneInstance() {
|
|
2555
2685
|
var _this8 = this;
|
|
2556
|
-
|
|
2557
2686
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2558
2687
|
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2559
|
-
|
|
2560
|
-
var mergedOptions = _objectSpread({}, this.options, options, {
|
|
2688
|
+
var mergedOptions = _objectSpread(_objectSpread(_objectSpread({}, this.options), options), {
|
|
2561
2689
|
isClone: true
|
|
2562
2690
|
});
|
|
2563
|
-
|
|
2564
2691
|
var clone = new I18n(mergedOptions);
|
|
2692
|
+
if (options.debug !== undefined || options.prefix !== undefined) {
|
|
2693
|
+
clone.logger = clone.logger.clone(options);
|
|
2694
|
+
}
|
|
2565
2695
|
var membersToCopy = ['store', 'services', 'language'];
|
|
2566
2696
|
membersToCopy.forEach(function (m) {
|
|
2567
2697
|
clone[m] = _this8[m];
|
|
@@ -2575,7 +2705,6 @@ var I18n = function (_EventEmitter) {
|
|
|
2575
2705
|
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
2576
2706
|
args[_key4 - 1] = arguments[_key4];
|
|
2577
2707
|
}
|
|
2578
|
-
|
|
2579
2708
|
clone.emit.apply(clone, [event].concat(args));
|
|
2580
2709
|
});
|
|
2581
2710
|
clone.init(mergedOptions, callback);
|
|
@@ -2592,15 +2721,20 @@ var I18n = function (_EventEmitter) {
|
|
|
2592
2721
|
options: this.options,
|
|
2593
2722
|
store: this.store,
|
|
2594
2723
|
language: this.language,
|
|
2595
|
-
languages: this.languages
|
|
2724
|
+
languages: this.languages,
|
|
2725
|
+
resolvedLanguage: this.resolvedLanguage
|
|
2596
2726
|
};
|
|
2597
2727
|
}
|
|
2598
2728
|
}]);
|
|
2599
|
-
|
|
2600
2729
|
return I18n;
|
|
2601
2730
|
}(EventEmitter);
|
|
2602
|
-
|
|
2603
|
-
var
|
|
2731
|
+
_defineProperty(I18n, "createInstance", function () {
|
|
2732
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2733
|
+
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2734
|
+
return new I18n(options, callback);
|
|
2735
|
+
});
|
|
2736
|
+
var instance = I18n.createInstance();
|
|
2737
|
+
instance.createInstance = I18n.createInstance;
|
|
2604
2738
|
|
|
2605
2739
|
var arr = [];
|
|
2606
2740
|
var each = arr.forEach;
|
|
@@ -2618,103 +2752,80 @@ function defaults(obj) {
|
|
|
2618
2752
|
|
|
2619
2753
|
// eslint-disable-next-line no-control-regex
|
|
2620
2754
|
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
2621
|
-
|
|
2622
2755
|
var serializeCookie = function serializeCookie(name, val, options) {
|
|
2623
2756
|
var opt = options || {};
|
|
2624
2757
|
opt.path = opt.path || '/';
|
|
2625
2758
|
var value = encodeURIComponent(val);
|
|
2626
|
-
var str = name
|
|
2627
|
-
|
|
2759
|
+
var str = "".concat(name, "=").concat(value);
|
|
2628
2760
|
if (opt.maxAge > 0) {
|
|
2629
2761
|
var maxAge = opt.maxAge - 0;
|
|
2630
|
-
if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
|
|
2631
|
-
str +=
|
|
2762
|
+
if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
|
|
2763
|
+
str += "; Max-Age=".concat(Math.floor(maxAge));
|
|
2632
2764
|
}
|
|
2633
|
-
|
|
2634
2765
|
if (opt.domain) {
|
|
2635
2766
|
if (!fieldContentRegExp.test(opt.domain)) {
|
|
2636
2767
|
throw new TypeError('option domain is invalid');
|
|
2637
2768
|
}
|
|
2638
|
-
|
|
2639
|
-
str += '; Domain=' + opt.domain;
|
|
2769
|
+
str += "; Domain=".concat(opt.domain);
|
|
2640
2770
|
}
|
|
2641
|
-
|
|
2642
2771
|
if (opt.path) {
|
|
2643
2772
|
if (!fieldContentRegExp.test(opt.path)) {
|
|
2644
2773
|
throw new TypeError('option path is invalid');
|
|
2645
2774
|
}
|
|
2646
|
-
|
|
2647
|
-
str += '; Path=' + opt.path;
|
|
2775
|
+
str += "; Path=".concat(opt.path);
|
|
2648
2776
|
}
|
|
2649
|
-
|
|
2650
2777
|
if (opt.expires) {
|
|
2651
2778
|
if (typeof opt.expires.toUTCString !== 'function') {
|
|
2652
2779
|
throw new TypeError('option expires is invalid');
|
|
2653
2780
|
}
|
|
2654
|
-
|
|
2655
|
-
str += '; Expires=' + opt.expires.toUTCString();
|
|
2781
|
+
str += "; Expires=".concat(opt.expires.toUTCString());
|
|
2656
2782
|
}
|
|
2657
|
-
|
|
2658
2783
|
if (opt.httpOnly) str += '; HttpOnly';
|
|
2659
2784
|
if (opt.secure) str += '; Secure';
|
|
2660
|
-
|
|
2661
2785
|
if (opt.sameSite) {
|
|
2662
2786
|
var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
2663
|
-
|
|
2664
2787
|
switch (sameSite) {
|
|
2665
2788
|
case true:
|
|
2666
2789
|
str += '; SameSite=Strict';
|
|
2667
2790
|
break;
|
|
2668
|
-
|
|
2669
2791
|
case 'lax':
|
|
2670
2792
|
str += '; SameSite=Lax';
|
|
2671
2793
|
break;
|
|
2672
|
-
|
|
2673
2794
|
case 'strict':
|
|
2674
2795
|
str += '; SameSite=Strict';
|
|
2675
2796
|
break;
|
|
2676
|
-
|
|
2677
2797
|
case 'none':
|
|
2678
2798
|
str += '; SameSite=None';
|
|
2679
2799
|
break;
|
|
2680
|
-
|
|
2681
2800
|
default:
|
|
2682
2801
|
throw new TypeError('option sameSite is invalid');
|
|
2683
2802
|
}
|
|
2684
2803
|
}
|
|
2685
|
-
|
|
2686
2804
|
return str;
|
|
2687
2805
|
};
|
|
2688
|
-
|
|
2689
2806
|
var cookie = {
|
|
2690
2807
|
create: function create(name, value, minutes, domain) {
|
|
2691
2808
|
var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
2692
2809
|
path: '/',
|
|
2693
2810
|
sameSite: 'strict'
|
|
2694
2811
|
};
|
|
2695
|
-
|
|
2696
2812
|
if (minutes) {
|
|
2697
2813
|
cookieOptions.expires = new Date();
|
|
2698
2814
|
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);
|
|
2699
2815
|
}
|
|
2700
|
-
|
|
2701
2816
|
if (domain) cookieOptions.domain = domain;
|
|
2702
2817
|
document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);
|
|
2703
2818
|
},
|
|
2704
2819
|
read: function read(name) {
|
|
2705
|
-
var nameEQ = name
|
|
2820
|
+
var nameEQ = "".concat(name, "=");
|
|
2706
2821
|
var ca = document.cookie.split(';');
|
|
2707
|
-
|
|
2708
2822
|
for (var i = 0; i < ca.length; i++) {
|
|
2709
2823
|
var c = ca[i];
|
|
2710
|
-
|
|
2711
2824
|
while (c.charAt(0) === ' ') {
|
|
2712
2825
|
c = c.substring(1, c.length);
|
|
2713
2826
|
}
|
|
2714
|
-
|
|
2715
2827
|
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
2716
2828
|
}
|
|
2717
|
-
|
|
2718
2829
|
return null;
|
|
2719
2830
|
},
|
|
2720
2831
|
remove: function remove(name) {
|
|
@@ -2725,12 +2836,10 @@ var cookie$1 = {
|
|
|
2725
2836
|
name: 'cookie',
|
|
2726
2837
|
lookup: function lookup(options) {
|
|
2727
2838
|
var found;
|
|
2728
|
-
|
|
2729
2839
|
if (options.lookupCookie && typeof document !== 'undefined') {
|
|
2730
2840
|
var c = cookie.read(options.lookupCookie);
|
|
2731
2841
|
if (c) found = c;
|
|
2732
2842
|
}
|
|
2733
|
-
|
|
2734
2843
|
return found;
|
|
2735
2844
|
},
|
|
2736
2845
|
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
@@ -2744,39 +2853,30 @@ var querystring = {
|
|
|
2744
2853
|
name: 'querystring',
|
|
2745
2854
|
lookup: function lookup(options) {
|
|
2746
2855
|
var found;
|
|
2747
|
-
|
|
2748
2856
|
if (typeof window !== 'undefined') {
|
|
2749
2857
|
var search = window.location.search;
|
|
2750
|
-
|
|
2751
2858
|
if (!window.location.search && window.location.hash && window.location.hash.indexOf('?') > -1) {
|
|
2752
2859
|
search = window.location.hash.substring(window.location.hash.indexOf('?'));
|
|
2753
2860
|
}
|
|
2754
|
-
|
|
2755
2861
|
var query = search.substring(1);
|
|
2756
2862
|
var params = query.split('&');
|
|
2757
|
-
|
|
2758
2863
|
for (var i = 0; i < params.length; i++) {
|
|
2759
2864
|
var pos = params[i].indexOf('=');
|
|
2760
|
-
|
|
2761
2865
|
if (pos > 0) {
|
|
2762
2866
|
var key = params[i].substring(0, pos);
|
|
2763
|
-
|
|
2764
2867
|
if (key === options.lookupQuerystring) {
|
|
2765
2868
|
found = params[i].substring(pos + 1);
|
|
2766
2869
|
}
|
|
2767
2870
|
}
|
|
2768
2871
|
}
|
|
2769
2872
|
}
|
|
2770
|
-
|
|
2771
2873
|
return found;
|
|
2772
2874
|
}
|
|
2773
2875
|
};
|
|
2774
2876
|
|
|
2775
2877
|
var hasLocalStorageSupport = null;
|
|
2776
|
-
|
|
2777
2878
|
var localStorageAvailable = function localStorageAvailable() {
|
|
2778
2879
|
if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
|
|
2779
|
-
|
|
2780
2880
|
try {
|
|
2781
2881
|
hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
|
|
2782
2882
|
var testKey = 'i18next.translate.boo';
|
|
@@ -2785,20 +2885,16 @@ var localStorageAvailable = function localStorageAvailable() {
|
|
|
2785
2885
|
} catch (e) {
|
|
2786
2886
|
hasLocalStorageSupport = false;
|
|
2787
2887
|
}
|
|
2788
|
-
|
|
2789
2888
|
return hasLocalStorageSupport;
|
|
2790
2889
|
};
|
|
2791
|
-
|
|
2792
2890
|
var localStorage = {
|
|
2793
2891
|
name: 'localStorage',
|
|
2794
2892
|
lookup: function lookup(options) {
|
|
2795
2893
|
var found;
|
|
2796
|
-
|
|
2797
2894
|
if (options.lookupLocalStorage && localStorageAvailable()) {
|
|
2798
2895
|
var lng = window.localStorage.getItem(options.lookupLocalStorage);
|
|
2799
2896
|
if (lng) found = lng;
|
|
2800
2897
|
}
|
|
2801
|
-
|
|
2802
2898
|
return found;
|
|
2803
2899
|
},
|
|
2804
2900
|
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
@@ -2809,10 +2905,8 @@ var localStorage = {
|
|
|
2809
2905
|
};
|
|
2810
2906
|
|
|
2811
2907
|
var hasSessionStorageSupport = null;
|
|
2812
|
-
|
|
2813
2908
|
var sessionStorageAvailable = function sessionStorageAvailable() {
|
|
2814
2909
|
if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
|
|
2815
|
-
|
|
2816
2910
|
try {
|
|
2817
2911
|
hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;
|
|
2818
2912
|
var testKey = 'i18next.translate.boo';
|
|
@@ -2821,20 +2915,16 @@ var sessionStorageAvailable = function sessionStorageAvailable() {
|
|
|
2821
2915
|
} catch (e) {
|
|
2822
2916
|
hasSessionStorageSupport = false;
|
|
2823
2917
|
}
|
|
2824
|
-
|
|
2825
2918
|
return hasSessionStorageSupport;
|
|
2826
2919
|
};
|
|
2827
|
-
|
|
2828
2920
|
var sessionStorage = {
|
|
2829
2921
|
name: 'sessionStorage',
|
|
2830
2922
|
lookup: function lookup(options) {
|
|
2831
2923
|
var found;
|
|
2832
|
-
|
|
2833
2924
|
if (options.lookupSessionStorage && sessionStorageAvailable()) {
|
|
2834
2925
|
var lng = window.sessionStorage.getItem(options.lookupSessionStorage);
|
|
2835
2926
|
if (lng) found = lng;
|
|
2836
2927
|
}
|
|
2837
|
-
|
|
2838
2928
|
return found;
|
|
2839
2929
|
},
|
|
2840
2930
|
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
@@ -2848,7 +2938,6 @@ var navigator$1 = {
|
|
|
2848
2938
|
name: 'navigator',
|
|
2849
2939
|
lookup: function lookup(options) {
|
|
2850
2940
|
var found = [];
|
|
2851
|
-
|
|
2852
2941
|
if (typeof navigator !== 'undefined') {
|
|
2853
2942
|
if (navigator.languages) {
|
|
2854
2943
|
// chrome only; not an array, so can't use .push.apply instead of iterating
|
|
@@ -2856,16 +2945,13 @@ var navigator$1 = {
|
|
|
2856
2945
|
found.push(navigator.languages[i]);
|
|
2857
2946
|
}
|
|
2858
2947
|
}
|
|
2859
|
-
|
|
2860
2948
|
if (navigator.userLanguage) {
|
|
2861
2949
|
found.push(navigator.userLanguage);
|
|
2862
2950
|
}
|
|
2863
|
-
|
|
2864
2951
|
if (navigator.language) {
|
|
2865
2952
|
found.push(navigator.language);
|
|
2866
2953
|
}
|
|
2867
2954
|
}
|
|
2868
|
-
|
|
2869
2955
|
return found.length > 0 ? found : undefined;
|
|
2870
2956
|
}
|
|
2871
2957
|
};
|
|
@@ -2875,11 +2961,9 @@ var htmlTag = {
|
|
|
2875
2961
|
lookup: function lookup(options) {
|
|
2876
2962
|
var found;
|
|
2877
2963
|
var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
|
|
2878
|
-
|
|
2879
2964
|
if (htmlTag && typeof htmlTag.getAttribute === 'function') {
|
|
2880
2965
|
found = htmlTag.getAttribute('lang');
|
|
2881
2966
|
}
|
|
2882
|
-
|
|
2883
2967
|
return found;
|
|
2884
2968
|
}
|
|
2885
2969
|
};
|
|
@@ -2888,23 +2972,19 @@ var path = {
|
|
|
2888
2972
|
name: 'path',
|
|
2889
2973
|
lookup: function lookup(options) {
|
|
2890
2974
|
var found;
|
|
2891
|
-
|
|
2892
2975
|
if (typeof window !== 'undefined') {
|
|
2893
2976
|
var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
2894
|
-
|
|
2895
2977
|
if (language instanceof Array) {
|
|
2896
2978
|
if (typeof options.lookupFromPathIndex === 'number') {
|
|
2897
2979
|
if (typeof language[options.lookupFromPathIndex] !== 'string') {
|
|
2898
2980
|
return undefined;
|
|
2899
2981
|
}
|
|
2900
|
-
|
|
2901
2982
|
found = language[options.lookupFromPathIndex].replace('/', '');
|
|
2902
2983
|
} else {
|
|
2903
2984
|
found = language[0].replace('/', '');
|
|
2904
2985
|
}
|
|
2905
2986
|
}
|
|
2906
2987
|
}
|
|
2907
|
-
|
|
2908
2988
|
return found;
|
|
2909
2989
|
}
|
|
2910
2990
|
};
|
|
@@ -2912,21 +2992,17 @@ var path = {
|
|
|
2912
2992
|
var subdomain = {
|
|
2913
2993
|
name: 'subdomain',
|
|
2914
2994
|
lookup: function lookup(options) {
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
if
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
}
|
|
2927
|
-
}
|
|
2928
|
-
|
|
2929
|
-
return found;
|
|
2995
|
+
// If given get the subdomain index else 1
|
|
2996
|
+
var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;
|
|
2997
|
+
// get all matches if window.location. is existing
|
|
2998
|
+
// first item of match is the match itself and the second is the first group macht which sould be the first subdomain match
|
|
2999
|
+
// is the hostname no public domain get the or option of localhost
|
|
3000
|
+
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);
|
|
3001
|
+
|
|
3002
|
+
// if there is no match (null) return undefined
|
|
3003
|
+
if (!language) return undefined;
|
|
3004
|
+
// return the given group match
|
|
3005
|
+
return language[lookupFromSubdomainIndex];
|
|
2930
3006
|
}
|
|
2931
3007
|
};
|
|
2932
3008
|
|
|
@@ -2939,31 +3015,30 @@ function getDefaults() {
|
|
|
2939
3015
|
lookupSessionStorage: 'i18nextLng',
|
|
2940
3016
|
// cache user language
|
|
2941
3017
|
caches: ['localStorage'],
|
|
2942
|
-
excludeCacheFor: ['cimode']
|
|
2943
|
-
//
|
|
2944
|
-
|
|
3018
|
+
excludeCacheFor: ['cimode']
|
|
3019
|
+
// cookieMinutes: 10,
|
|
3020
|
+
// cookieDomain: 'myDomain'
|
|
2945
3021
|
};
|
|
2946
3022
|
}
|
|
2947
|
-
|
|
2948
3023
|
var Browser = /*#__PURE__*/function () {
|
|
2949
3024
|
function Browser(services) {
|
|
2950
3025
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2951
|
-
|
|
2952
3026
|
_classCallCheck(this, Browser);
|
|
2953
|
-
|
|
2954
3027
|
this.type = 'languageDetector';
|
|
2955
3028
|
this.detectors = {};
|
|
2956
3029
|
this.init(services, options);
|
|
2957
3030
|
}
|
|
2958
|
-
|
|
2959
3031
|
_createClass(Browser, [{
|
|
2960
3032
|
key: "init",
|
|
2961
3033
|
value: function init(services) {
|
|
2962
3034
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2963
3035
|
var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
2964
|
-
this.services = services
|
|
2965
|
-
|
|
3036
|
+
this.services = services || {
|
|
3037
|
+
languageUtils: {}
|
|
3038
|
+
}; // this way the language detector can be used without i18next
|
|
3039
|
+
this.options = defaults(options, this.options || {}, getDefaults());
|
|
2966
3040
|
|
|
3041
|
+
// backwards compatibility
|
|
2967
3042
|
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
|
2968
3043
|
this.i18nOptions = i18nOptions;
|
|
2969
3044
|
this.addDetector(cookie$1);
|
|
@@ -2984,26 +3059,22 @@ var Browser = /*#__PURE__*/function () {
|
|
|
2984
3059
|
key: "detect",
|
|
2985
3060
|
value: function detect(detectionOrder) {
|
|
2986
3061
|
var _this = this;
|
|
2987
|
-
|
|
2988
3062
|
if (!detectionOrder) detectionOrder = this.options.order;
|
|
2989
3063
|
var detected = [];
|
|
2990
3064
|
detectionOrder.forEach(function (detectorName) {
|
|
2991
3065
|
if (_this.detectors[detectorName]) {
|
|
2992
3066
|
var lookup = _this.detectors[detectorName].lookup(_this.options);
|
|
2993
|
-
|
|
2994
3067
|
if (lookup && typeof lookup === 'string') lookup = [lookup];
|
|
2995
3068
|
if (lookup) detected = detected.concat(lookup);
|
|
2996
3069
|
}
|
|
2997
3070
|
});
|
|
2998
3071
|
if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0
|
|
2999
|
-
|
|
3000
3072
|
return detected.length > 0 ? detected[0] : null; // a little backward compatibility
|
|
3001
3073
|
}
|
|
3002
3074
|
}, {
|
|
3003
3075
|
key: "cacheUserLanguage",
|
|
3004
3076
|
value: function cacheUserLanguage(lng, caches) {
|
|
3005
3077
|
var _this2 = this;
|
|
3006
|
-
|
|
3007
3078
|
if (!caches) caches = this.options.caches;
|
|
3008
3079
|
if (!caches) return;
|
|
3009
3080
|
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
|
|
@@ -3012,13 +3083,11 @@ var Browser = /*#__PURE__*/function () {
|
|
|
3012
3083
|
});
|
|
3013
3084
|
}
|
|
3014
3085
|
}]);
|
|
3015
|
-
|
|
3016
3086
|
return Browser;
|
|
3017
3087
|
}();
|
|
3018
|
-
|
|
3019
3088
|
Browser.type = 'languageDetector';
|
|
3020
3089
|
|
|
3021
|
-
|
|
3090
|
+
instance.use(Browser).init({
|
|
3022
3091
|
fallbackLng: 'en',
|
|
3023
3092
|
debug: false,
|
|
3024
3093
|
resources: {
|
|
@@ -3041,86 +3110,29 @@ i18next.use(Browser).init({
|
|
|
3041
3110
|
'Postal Code': '郵便番号',
|
|
3042
3111
|
},
|
|
3043
3112
|
},
|
|
3113
|
+
'pt-BR': {
|
|
3114
|
+
translation: {
|
|
3115
|
+
'Pay': 'Pagar',
|
|
3116
|
+
'Failed to load Stripe': 'Falha ao ler Stripe',
|
|
3117
|
+
'Add your payment information': 'Informações do seu Pagamento',
|
|
3118
|
+
'Add card': 'Adicionar Cartão',
|
|
3119
|
+
'Add a card': 'Adicionar um Cartão',
|
|
3120
|
+
'Add': 'Adicionar',
|
|
3121
|
+
'Card information': 'Informações do Cartão',
|
|
3122
|
+
'Card Number': 'Número do Cartão',
|
|
3123
|
+
'MM / YY': 'MM / AA',
|
|
3124
|
+
'CVC': 'Número de Segurança(CVC)',
|
|
3125
|
+
'Country or region': 'País ou região',
|
|
3126
|
+
'Postal Code': 'Cep',
|
|
3127
|
+
},
|
|
3128
|
+
},
|
|
3044
3129
|
},
|
|
3045
3130
|
});
|
|
3046
|
-
const i18n =
|
|
3131
|
+
const i18n = instance;
|
|
3047
3132
|
|
|
3048
|
-
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\",
|
|
3133
|
+
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)}";
|
|
3049
3134
|
|
|
3050
3135
|
const StripePayment = class {
|
|
3051
|
-
constructor(hostRef) {
|
|
3052
|
-
registerInstance(this, hostRef);
|
|
3053
|
-
this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
|
|
3054
|
-
this.formSubmit = createEvent(this, "formSubmit", 7);
|
|
3055
|
-
this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult", 7);
|
|
3056
|
-
/**
|
|
3057
|
-
* Status of the Stripe client initilizing process
|
|
3058
|
-
*/
|
|
3059
|
-
this.loadStripeStatus = '';
|
|
3060
|
-
/**
|
|
3061
|
-
* Default submit handle type.
|
|
3062
|
-
* If you want to use `setupIntent`, should update this attribute.
|
|
3063
|
-
*/
|
|
3064
|
-
this.intentType = 'payment';
|
|
3065
|
-
/**
|
|
3066
|
-
* If true, show zip code field
|
|
3067
|
-
*/
|
|
3068
|
-
this.zip = true;
|
|
3069
|
-
/**
|
|
3070
|
-
* Payment sheet title
|
|
3071
|
-
* By default we recommended to use these string
|
|
3072
|
-
* - 'Add your payment information' -> PaymentSheet / PaymentFlow(Android)
|
|
3073
|
-
* - 'Add a card' -> PaymentFlow(iOS)
|
|
3074
|
-
* These strings will translated automatically by this library.
|
|
3075
|
-
*/
|
|
3076
|
-
this.sheetTitle = 'Add your payment information';
|
|
3077
|
-
/**
|
|
3078
|
-
* Submit button label
|
|
3079
|
-
* By default we recommended to use these string
|
|
3080
|
-
* - 'Pay' -> PaymentSheet
|
|
3081
|
-
* - 'Add' -> PaymentFlow(Android)
|
|
3082
|
-
* - 'Add card' -> PaymentFlow(iOS)
|
|
3083
|
-
* - 'Add a card' -> PaymentFlow(iOS)
|
|
3084
|
-
* These strings will translated automatically by this library.
|
|
3085
|
-
*
|
|
3086
|
-
*/
|
|
3087
|
-
this.buttonLabel = 'Pay';
|
|
3088
|
-
/**
|
|
3089
|
-
* The progress status of the checkout process
|
|
3090
|
-
*/
|
|
3091
|
-
this.progress = '';
|
|
3092
|
-
/**
|
|
3093
|
-
* Error message
|
|
3094
|
-
*/
|
|
3095
|
-
this.errorMessage = '';
|
|
3096
|
-
/**
|
|
3097
|
-
* zip code
|
|
3098
|
-
*/
|
|
3099
|
-
this.zipCode = '';
|
|
3100
|
-
/**
|
|
3101
|
-
* Overwrite the application name that registered
|
|
3102
|
-
* For wrapper library (like Capacitor)
|
|
3103
|
-
*/
|
|
3104
|
-
this.applicationName = 'stripe-pwa-elements';
|
|
3105
|
-
/**
|
|
3106
|
-
* Show the form label
|
|
3107
|
-
*/
|
|
3108
|
-
this.showLabel = false;
|
|
3109
|
-
/**
|
|
3110
|
-
* The component will provide a function to call the `stripe.confirmCardPayment`API.
|
|
3111
|
-
* If you want to customize the behavior, should set false.
|
|
3112
|
-
* And listen the 'formSubmit' event on the element
|
|
3113
|
-
*/
|
|
3114
|
-
this.shouldUseDefaultFormSubmitAction = true;
|
|
3115
|
-
if (this.publishableKey) {
|
|
3116
|
-
this.initStripe(this.publishableKey, {
|
|
3117
|
-
stripeAccount: this.stripeAccount,
|
|
3118
|
-
});
|
|
3119
|
-
}
|
|
3120
|
-
else {
|
|
3121
|
-
this.loadStripeStatus = 'failure';
|
|
3122
|
-
}
|
|
3123
|
-
}
|
|
3124
3136
|
/**
|
|
3125
3137
|
* Get Stripe.js, and initialize elements
|
|
3126
3138
|
* @param publishableKey
|
|
@@ -3295,6 +3307,39 @@ const StripePayment = class {
|
|
|
3295
3307
|
throw e;
|
|
3296
3308
|
}
|
|
3297
3309
|
}
|
|
3310
|
+
constructor(hostRef) {
|
|
3311
|
+
registerInstance(this, hostRef);
|
|
3312
|
+
this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
|
|
3313
|
+
this.formSubmit = createEvent(this, "formSubmit", 7);
|
|
3314
|
+
this.defaultFormSubmitResult = createEvent(this, "defaultFormSubmitResult", 7);
|
|
3315
|
+
this.loadStripeStatus = '';
|
|
3316
|
+
this.stripe = undefined;
|
|
3317
|
+
this.intentType = 'payment';
|
|
3318
|
+
this.zip = true;
|
|
3319
|
+
this.sheetTitle = 'Add your payment information';
|
|
3320
|
+
this.buttonLabel = 'Pay';
|
|
3321
|
+
this.progress = '';
|
|
3322
|
+
this.errorMessage = '';
|
|
3323
|
+
this.zipCode = '';
|
|
3324
|
+
this.publishableKey = undefined;
|
|
3325
|
+
this.stripeAccount = undefined;
|
|
3326
|
+
this.applicationName = 'stripe-pwa-elements';
|
|
3327
|
+
this.showLabel = false;
|
|
3328
|
+
this.intentClientSecret = undefined;
|
|
3329
|
+
this.shouldUseDefaultFormSubmitAction = true;
|
|
3330
|
+
this.showPaymentRequestButton = undefined;
|
|
3331
|
+
this.paymentRequestOption = undefined;
|
|
3332
|
+
this.handleSubmit = undefined;
|
|
3333
|
+
this.stripeDidLoaded = undefined;
|
|
3334
|
+
if (this.publishableKey) {
|
|
3335
|
+
this.initStripe(this.publishableKey, {
|
|
3336
|
+
stripeAccount: this.stripeAccount,
|
|
3337
|
+
});
|
|
3338
|
+
}
|
|
3339
|
+
else {
|
|
3340
|
+
this.loadStripeStatus = 'failure';
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3298
3343
|
/**
|
|
3299
3344
|
* Initialize Component using Stripe Element
|
|
3300
3345
|
*/
|
|
@@ -3412,20 +3457,13 @@ const StripePayment = class {
|
|
|
3412
3457
|
};
|
|
3413
3458
|
StripePayment.style = stripePaymentSheetCss;
|
|
3414
3459
|
|
|
3415
|
-
const stripeElementModalCss = "*:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\",
|
|
3460
|
+
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}";
|
|
3416
3461
|
|
|
3417
3462
|
const StripeSheet = class {
|
|
3418
3463
|
constructor(hostRef) {
|
|
3419
3464
|
registerInstance(this, hostRef);
|
|
3420
3465
|
this.close = createEvent(this, "close", 7);
|
|
3421
|
-
/**
|
|
3422
|
-
* If true, the modal display close button
|
|
3423
|
-
*/
|
|
3424
3466
|
this.showCloseButton = true;
|
|
3425
|
-
/**
|
|
3426
|
-
* Modal state.
|
|
3427
|
-
* If true, the modal will open
|
|
3428
|
-
*/
|
|
3429
3467
|
this.open = false;
|
|
3430
3468
|
}
|
|
3431
3469
|
/**
|
|
@@ -3462,3 +3500,5 @@ const StripeSheet = class {
|
|
|
3462
3500
|
StripeSheet.style = stripeElementModalCss;
|
|
3463
3501
|
|
|
3464
3502
|
export { StripePayment as stripe_payment, StripeSheet as stripe_sheet };
|
|
3503
|
+
|
|
3504
|
+
//# sourceMappingURL=stripe-payment_2.entry.js.map
|