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