pixel-react 1.15.13 → 1.15.15
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/README.md +75 -75
- package/lib/_virtual/index10.js +2 -2
- package/lib/_virtual/index11.js +2 -2
- package/lib/_virtual/index12.js +2 -2
- package/lib/_virtual/index9.js +2 -2
- package/lib/assets/icons/navigate_to_pages.svg.js +6 -0
- package/lib/assets/icons/navigate_to_pages.svg.js.map +1 -0
- package/lib/assets/icons/spinner.svg.js +1 -1
- package/lib/assets/icons/spinner.svg.js.map +1 -1
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/Accordion.js +5 -3
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/types.d.ts +1 -0
- package/lib/components/Editor/VariableDropdown.js +2 -2
- package/lib/components/Icon/iconList.js +2 -0
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/InputWithDropdown/InputWithDropdown.js +4 -3
- package/lib/components/InputWithDropdown/InputWithDropdown.js.map +1 -1
- package/lib/index.cjs +9901 -3778
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/node_modules/@date-fns/tz/date/index.js +1 -19
- package/lib/node_modules/@date-fns/tz/date/index.js.map +1 -1
- package/lib/node_modules/@date-fns/tz/date/mini.js +34 -6
- package/lib/node_modules/@date-fns/tz/date/mini.js.map +1 -1
- package/lib/node_modules/@date-fns/tz/tzName/index.js +40 -0
- package/lib/node_modules/@date-fns/tz/tzName/index.js.map +1 -0
- package/lib/node_modules/@date-fns/tz/tzOffset/index.js +6 -5
- package/lib/node_modules/@date-fns/tz/tzOffset/index.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js +93 -98
- package/lib/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/config/index.js +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/config/index.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/loader/index.js +15 -13
- package/lib/node_modules/@monaco-editor/loader/lib/es/loader/index.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/utils/compose.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/utils/curry.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js +1 -0
- package/lib/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js.map +1 -1
- package/lib/node_modules/@monaco-editor/loader/lib/es/validators/index.js +1 -2
- package/lib/node_modules/@monaco-editor/loader/lib/es/validators/index.js.map +1 -1
- package/lib/node_modules/janus-gateway/npm/dist/janus.es.js +26 -57
- package/lib/node_modules/janus-gateway/npm/dist/janus.es.js.map +1 -1
- package/lib/node_modules/js-beautify/js/src/css/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/css/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/css/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/html/tokenizer.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/index.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/options.js +1 -1
- package/lib/node_modules/js-beautify/js/src/javascript/tokenizer.js +1 -1
- package/lib/node_modules/jsencrypt/lib/JSEncrypt.js +246 -0
- package/lib/node_modules/jsencrypt/lib/JSEncrypt.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/JSEncryptRSAKey.js +325 -0
- package/lib/node_modules/jsencrypt/lib/JSEncryptRSAKey.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/index.js +6 -0
- package/lib/node_modules/jsencrypt/lib/index.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/asn1.js +570 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/asn1.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/base64.js +88 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/base64.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/hex.js +66 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/hex.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/int10.js +87 -0
- package/lib/node_modules/jsencrypt/lib/lib/asn1js/int10.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/base64.js +65 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/base64.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/jsbn.js +1700 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/jsbn.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/prng4.js +48 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/prng4.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rng.js +77 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rng.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rsa.js +415 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/rsa.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/sha256.js +307 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/sha256.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/util.js +61 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsbn/util.js.map +1 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js +1559 -0
- package/lib/node_modules/jsencrypt/lib/lib/jsrsasign/asn1-1.0.js.map +1 -0
- package/lib/node_modules/libphonenumber-js/es6/AsYouType.js +115 -82
- package/lib/node_modules/libphonenumber-js/es6/AsYouType.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +68 -58
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +36 -23
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +13 -9
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js +226 -187
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js +21 -27
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeParser.js +150 -117
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeParser.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeState.js +57 -38
- package/lib/node_modules/libphonenumber-js/es6/AsYouTypeState.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/ParseError.js +70 -109
- package/lib/node_modules/libphonenumber-js/es6/ParseError.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/PhoneNumber.js +72 -57
- package/lib/node_modules/libphonenumber-js/es6/PhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/constants.js +15 -9
- package/lib/node_modules/libphonenumber-js/es6/constants.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/format.js +67 -93
- package/lib/node_modules/libphonenumber-js/es6/format.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js +0 -1
- package/lib/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/getCountries.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/RFC3966.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +49 -10
- package/lib/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +20 -32
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +5 -4
- package/lib/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +25 -18
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +12 -11
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +13 -11
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +21 -11
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +12 -11
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +15 -12
- package/lib/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +4 -4
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +59 -35
- package/lib/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +2 -2
- package/lib/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +38 -36
- package/lib/node_modules/libphonenumber-js/es6/helpers/getNumberType.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/isObject.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +14 -10
- package/lib/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +4 -4
- package/lib/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +22 -27
- package/lib/node_modules/libphonenumber-js/es6/helpers/parseDigits.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +6 -6
- package/lib/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/isPossible.js +6 -7
- package/lib/node_modules/libphonenumber-js/es6/isPossible.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/isValid.js +6 -5
- package/lib/node_modules/libphonenumber-js/es6/isValid.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +44 -26
- package/lib/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/metadata.js +120 -69
- package/lib/node_modules/libphonenumber-js/es6/metadata.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/normalizeArguments.js +87 -68
- package/lib/node_modules/libphonenumber-js/es6/normalizeArguments.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parse.js +58 -40
- package/lib/node_modules/libphonenumber-js/es6/parse.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +32 -36
- package/lib/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +44 -26
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +46 -28
- package/lib/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/es6/tools/semver-compare.js.map +1 -1
- package/lib/node_modules/libphonenumber-js/metadata.min.json.js +19 -19
- package/lib/node_modules/libphonenumber-js/metadata.min.json.js.map +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/DayPicker.js +88 -64
- package/lib/node_modules/react-day-picker/dist/esm/DayPicker.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/UI.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/classes/DateLib.js +71 -6
- package/lib/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Button.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -14
- package/lib/node_modules/react-day-picker/dist/esm/components/Chevron.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Day.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Dropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/DropdownNav.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Footer.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Month.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/MonthCaption.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/MonthGrid.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Months.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Nav.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Option.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Root.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Select.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Week.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/WeekNumber.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Weekday.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Weekdays.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/Weeks.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +3 -2
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatDay.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/formatters/index.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getComponents.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDays.js +4 -4
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +2 -2
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +9 -11
- package/lib/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/index.js +2 -2
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +3 -2
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelGrid.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelNav.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelNext.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelNext.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useAnimation.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useAnimation.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useCalendar.js +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useCalendar.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useDayPicker.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useFocus.js +6 -0
- package/lib/node_modules/react-day-picker/dist/esm/useFocus.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/useSelection.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/addToRange.js +6 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js.map +1 -1
- package/lib/node_modules/react-day-picker/dist/esm/utils/typeguards.js.map +1 -1
- package/lib/node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js +64 -0
- package/lib/node_modules/react-day-picker/node_modules/date-fns/eachYearOfInterval.js.map +1 -0
- package/lib/node_modules/react-hook-form/dist/index.esm.js +67 -44
- package/lib/node_modules/react-hook-form/dist/index.esm.js.map +1 -1
- package/lib/node_modules/react-virtuoso/dist/index.js +1246 -1200
- package/lib/node_modules/react-virtuoso/dist/index.js.map +1 -1
- package/lib/node_modules/ua-parser-js/src/ua-parser.js +85 -71
- package/lib/node_modules/ua-parser-js/src/ua-parser.js.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/getEncryptedData/getEncryptedData.d.ts +1 -1
- package/lib/utils/getEncryptedData/getEncryptedData.js +8 -17
- package/lib/utils/getEncryptedData/getEncryptedData.js.map +1 -1
- package/package.json +107 -106
|
@@ -1,65 +1,77 @@
|
|
|
1
1
|
import PatternParser from './AsYouTypeFormatter.PatternParser.js';
|
|
2
2
|
|
|
3
|
-
function _createForOfIteratorHelperLoose(
|
|
4
|
-
var
|
|
5
|
-
if (
|
|
6
|
-
if (Array.isArray(
|
|
7
|
-
|
|
8
|
-
var
|
|
3
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
4
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
5
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
6
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
7
|
+
t && (r = t);
|
|
8
|
+
var o = 0;
|
|
9
9
|
return function () {
|
|
10
|
-
|
|
10
|
+
return o >= r.length ? {
|
|
11
11
|
done: true
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
12
|
+
} : {
|
|
14
13
|
done: false,
|
|
15
|
-
value: o
|
|
14
|
+
value: r[o++]
|
|
16
15
|
};
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
18
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
20
19
|
}
|
|
21
|
-
function _unsupportedIterableToArray(
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
27
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
28
|
-
}
|
|
29
|
-
function _arrayLikeToArray(arr, len) {
|
|
30
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
31
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
32
|
-
arr2[i] = arr[i];
|
|
20
|
+
function _unsupportedIterableToArray(r, a) {
|
|
21
|
+
if (r) {
|
|
22
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
23
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
24
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
33
25
|
}
|
|
34
|
-
return arr2;
|
|
35
26
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
function _arrayLikeToArray(r, a) {
|
|
28
|
+
(null == a || a > r.length) && (a = r.length);
|
|
29
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
30
|
+
return n;
|
|
31
|
+
}
|
|
32
|
+
function _typeof(o) {
|
|
33
|
+
"@babel/helpers - typeof";
|
|
34
|
+
|
|
35
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
36
|
+
return typeof o;
|
|
37
|
+
} : function (o) {
|
|
38
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
39
|
+
}, _typeof(o);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Object.defineProperty(
|
|
41
|
+
function _classCallCheck(a, n) {
|
|
42
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
43
|
+
}
|
|
44
|
+
function _defineProperties(e, r) {
|
|
45
|
+
for (var t = 0; t < r.length; t++) {
|
|
46
|
+
var o = r[t];
|
|
47
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function _createClass(
|
|
51
|
-
|
|
52
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
50
|
+
function _createClass(e, r, t) {
|
|
51
|
+
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
|
53
52
|
writable: false
|
|
54
|
-
});
|
|
55
|
-
|
|
53
|
+
}), e;
|
|
54
|
+
}
|
|
55
|
+
function _toPropertyKey(t) {
|
|
56
|
+
var i = _toPrimitive(t, "string");
|
|
57
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
58
|
+
}
|
|
59
|
+
function _toPrimitive(t, r) {
|
|
60
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
61
|
+
var e = t[Symbol.toPrimitive];
|
|
62
|
+
if (void 0 !== e) {
|
|
63
|
+
var i = e.call(t, r);
|
|
64
|
+
if ("object" != _typeof(i)) return i;
|
|
65
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
66
|
+
}
|
|
67
|
+
return (String )(t);
|
|
56
68
|
}
|
|
57
69
|
var PatternMatcher = /*#__PURE__*/function () {
|
|
58
70
|
function PatternMatcher(pattern) {
|
|
59
71
|
_classCallCheck(this, PatternMatcher);
|
|
60
72
|
this.matchTree = new PatternParser().parse(pattern);
|
|
61
73
|
}
|
|
62
|
-
_createClass(PatternMatcher, [{
|
|
74
|
+
return _createClass(PatternMatcher, [{
|
|
63
75
|
key: "match",
|
|
64
76
|
value: function match(string) {
|
|
65
77
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
@@ -79,7 +91,6 @@ var PatternMatcher = /*#__PURE__*/function () {
|
|
|
79
91
|
return result;
|
|
80
92
|
}
|
|
81
93
|
}]);
|
|
82
|
-
return PatternMatcher;
|
|
83
94
|
}();
|
|
84
95
|
function _match(characters, tree, last) {
|
|
85
96
|
// If `tree` is a string, then `tree` is a single character.
|
|
@@ -94,21 +105,20 @@ function _match(characters, tree, last) {
|
|
|
94
105
|
// `tree` is always a single character.
|
|
95
106
|
// If `tree.indexOf(characterString) === 0`
|
|
96
107
|
// then `characters.length === tree.length`.
|
|
97
|
-
|
|
98
108
|
/* istanbul ignore else */
|
|
99
109
|
if (characters.length === tree.length) {
|
|
100
110
|
return {
|
|
101
111
|
match: true,
|
|
102
112
|
matchedChars: characters
|
|
103
113
|
};
|
|
104
|
-
}
|
|
114
|
+
}
|
|
115
|
+
// `tree` is always a single character.
|
|
105
116
|
// If `tree.indexOf(characterString) === 0`
|
|
106
117
|
// then `characters.length === tree.length`.
|
|
107
|
-
|
|
108
118
|
/* istanbul ignore next */
|
|
109
|
-
|
|
110
119
|
return {
|
|
111
|
-
partialMatch: true
|
|
120
|
+
partialMatch: true
|
|
121
|
+
// matchedChars: characters
|
|
112
122
|
};
|
|
113
123
|
}
|
|
114
124
|
if (characterString.indexOf(tree) === 0) {
|
|
@@ -120,7 +130,6 @@ function _match(characters, tree, last) {
|
|
|
120
130
|
// which would also mean `tree.indexOf(characterString) === 0` and that'd mean
|
|
121
131
|
// that the `if (tree.indexOf(characterString) === 0)` condition before this
|
|
122
132
|
// `if` condition would be entered, and returned from there, not reaching this code.
|
|
123
|
-
|
|
124
133
|
/* istanbul ignore else */
|
|
125
134
|
if (characters.length > tree.length) {
|
|
126
135
|
return {
|
|
@@ -156,7 +165,8 @@ function _match(characters, tree, last) {
|
|
|
156
165
|
};
|
|
157
166
|
} else {
|
|
158
167
|
return {
|
|
159
|
-
partialMatch: true
|
|
168
|
+
partialMatch: true
|
|
169
|
+
// matchedChars: characters
|
|
160
170
|
};
|
|
161
171
|
}
|
|
162
172
|
}
|
|
@@ -164,18 +174,18 @@ function _match(characters, tree, last) {
|
|
|
164
174
|
/* istanbul ignore else */
|
|
165
175
|
if (result.partialMatch) {
|
|
166
176
|
return {
|
|
167
|
-
partialMatch: true
|
|
177
|
+
partialMatch: true
|
|
178
|
+
// matchedChars: characters
|
|
168
179
|
};
|
|
169
180
|
} else {
|
|
170
181
|
throw new Error("Unsupported match result:\n".concat(JSON.stringify(result, null, 2)));
|
|
171
182
|
}
|
|
172
183
|
}
|
|
173
184
|
i++;
|
|
174
|
-
}
|
|
185
|
+
}
|
|
186
|
+
// If `last` then overflow has already been checked
|
|
175
187
|
// by the last element of the `tree` array.
|
|
176
|
-
|
|
177
188
|
/* istanbul ignore if */
|
|
178
|
-
|
|
179
189
|
if (last) {
|
|
180
190
|
return {
|
|
181
191
|
overflow: true
|
|
@@ -212,10 +222,11 @@ function _match(characters, tree, last) {
|
|
|
212
222
|
}
|
|
213
223
|
if (partialMatch) {
|
|
214
224
|
return {
|
|
215
|
-
partialMatch: true
|
|
225
|
+
partialMatch: true
|
|
226
|
+
// matchedChars: ...
|
|
216
227
|
};
|
|
217
|
-
}
|
|
218
|
-
|
|
228
|
+
}
|
|
229
|
+
// Not even a partial match.
|
|
219
230
|
return;
|
|
220
231
|
case '[]':
|
|
221
232
|
for (var _iterator2 = _createForOfIteratorHelperLoose(tree.args), _step2; !(_step2 = _iterator2()).done;) {
|
|
@@ -237,12 +248,11 @@ function _match(characters, tree, last) {
|
|
|
237
248
|
matchedChars: [_char]
|
|
238
249
|
};
|
|
239
250
|
}
|
|
240
|
-
}
|
|
241
|
-
|
|
251
|
+
}
|
|
252
|
+
// No character matches.
|
|
242
253
|
return;
|
|
243
254
|
|
|
244
255
|
/* istanbul ignore next */
|
|
245
|
-
|
|
246
256
|
default:
|
|
247
257
|
throw new Error("Unsupported instruction tree: ".concat(tree));
|
|
248
258
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsYouTypeFormatter.PatternMatcher.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport PatternParser from './AsYouTypeFormatter.PatternParser.js';\n\nvar PatternMatcher = /*#__PURE__*/function () {\n function PatternMatcher(pattern) {\n _classCallCheck(this, PatternMatcher);\n\n this.matchTree = new PatternParser().parse(pattern);\n }\n\n _createClass(PatternMatcher, [{\n key: \"match\",\n value: function match(string) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n allowOverflow = _ref.allowOverflow;\n\n if (!string) {\n throw new Error('String is required');\n }\n\n var result = _match(string.split(''), this.matchTree, true);\n\n if (result && result.match) {\n delete result.matchedChars;\n }\n\n if (result && result.overflow) {\n if (!allowOverflow) {\n return;\n }\n }\n\n return result;\n }\n }]);\n\n return PatternMatcher;\n}();\n/**\r\n * Matches `characters` against a pattern compiled into a `tree`.\r\n * @param {string[]} characters\r\n * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.\r\n * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.\r\n * @return {object} See the `*.d.ts` file for the description of the result object.\r\n */\n\n\nexport { PatternMatcher as default };\n\nfunction _match(characters, tree, last) {\n // If `tree` is a string, then `tree` is a single character.\n // That's because when a pattern is parsed, multi-character-string parts\n // of a pattern are compiled into arrays of single characters.\n // I still wrote this piece of code for a \"general\" hypothetical case\n // when `tree` could be a string of several characters, even though\n // such case is not possible with the current implementation.\n if (typeof tree === 'string') {\n var characterString = characters.join('');\n\n if (tree.indexOf(characterString) === 0) {\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n\n /* istanbul ignore else */\n if (characters.length === tree.length) {\n return {\n match: true,\n matchedChars: characters\n };\n } // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n\n /* istanbul ignore next */\n\n\n return {\n partialMatch: true // matchedChars: characters\n\n };\n }\n\n if (characterString.indexOf(tree) === 0) {\n if (last) {\n // The `else` path is not possible because `tree` is always a single character.\n // The `else` case for `characters.length > tree.length` would be\n // `characters.length <= tree.length` which means `characters.length <= 1`.\n // `characters` array can't be empty, so that means `characters === [tree]`,\n // which would also mean `tree.indexOf(characterString) === 0` and that'd mean\n // that the `if (tree.indexOf(characterString) === 0)` condition before this\n // `if` condition would be entered, and returned from there, not reaching this code.\n\n /* istanbul ignore else */\n if (characters.length > tree.length) {\n return {\n overflow: true\n };\n }\n }\n\n return {\n match: true,\n matchedChars: characters.slice(0, tree.length)\n };\n }\n\n return;\n }\n\n if (Array.isArray(tree)) {\n var restCharacters = characters.slice();\n var i = 0;\n\n while (i < tree.length) {\n var subtree = tree[i];\n\n var result = _match(restCharacters, subtree, last && i === tree.length - 1);\n\n if (!result) {\n return;\n } else if (result.overflow) {\n return result;\n } else if (result.match) {\n // Continue with the next subtree with the rest of the characters.\n restCharacters = restCharacters.slice(result.matchedChars.length);\n\n if (restCharacters.length === 0) {\n if (i === tree.length - 1) {\n return {\n match: true,\n matchedChars: characters\n };\n } else {\n return {\n partialMatch: true // matchedChars: characters\n\n };\n }\n }\n } else {\n /* istanbul ignore else */\n if (result.partialMatch) {\n return {\n partialMatch: true // matchedChars: characters\n\n };\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(result, null, 2)));\n }\n }\n\n i++;\n } // If `last` then overflow has already been checked\n // by the last element of the `tree` array.\n\n /* istanbul ignore if */\n\n\n if (last) {\n return {\n overflow: true\n };\n }\n\n return {\n match: true,\n matchedChars: characters.slice(0, characters.length - restCharacters.length)\n };\n }\n\n switch (tree.op) {\n case '|':\n var partialMatch;\n\n for (var _iterator = _createForOfIteratorHelperLoose(tree.args), _step; !(_step = _iterator()).done;) {\n var branch = _step.value;\n\n var _result = _match(characters, branch, last);\n\n if (_result) {\n if (_result.overflow) {\n return _result;\n } else if (_result.match) {\n return {\n match: true,\n matchedChars: _result.matchedChars\n };\n } else {\n /* istanbul ignore else */\n if (_result.partialMatch) {\n partialMatch = true;\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(_result, null, 2)));\n }\n }\n }\n }\n\n if (partialMatch) {\n return {\n partialMatch: true // matchedChars: ...\n\n };\n } // Not even a partial match.\n\n\n return;\n\n case '[]':\n for (var _iterator2 = _createForOfIteratorHelperLoose(tree.args), _step2; !(_step2 = _iterator2()).done;) {\n var _char = _step2.value;\n\n if (characters[0] === _char) {\n if (characters.length === 1) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n\n if (last) {\n return {\n overflow: true\n };\n }\n\n return {\n match: true,\n matchedChars: [_char]\n };\n }\n } // No character matches.\n\n\n return;\n\n /* istanbul ignore next */\n\n default:\n throw new Error(\"Unsupported instruction tree: \".concat(tree));\n }\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map"],"names":["PatternMatcher","pattern","_classCallCheck","matchTree","PatternParser","parse","match","string","_ref","arguments","length","undefined","allowOverflow","Error","result","_match","split","matchedChars","overflow","characters","tree","last","characterString","join","indexOf","partialMatch","slice","Array","isArray","restCharacters","i","subtree","concat","JSON","stringify","op","_iterator","_createForOfIteratorHelperLoose","args","_step","done","branch","value","_result","_iterator2","_step2","_char"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEqBA;EACpB,SAAAA,cAAAA,CAAYC,OAAZ,EAAqB;AAAAC,IAAAA,eAAA,OAAAF,cAAA,CAAA;IACpB,IAAA,CAAKG,SAAL,GAAiB,IAAIC,aAAJ,GAAoBC,KAApB,CAA0BJ,OAA1B,CAAjB;AACA,EAAA;;;WAED,SAAAK,KAAAA,CAAMC,MAAN,EAAsC;AAAA,MAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAJ,EAAI;QAAtBG,aAAsB,GAAAJ,IAAA,CAAtBI,aAAsB;MACrC,IAAI,CAACL,MAAL,EAAa;AACZ,QAAA,MAAM,IAAIM,KAAJ,CAAU,oBAAV,CAAN;AACA,MAAA;AACD,MAAA,IAAMC,MAAM,GAAGC,MAAK,CAACR,MAAM,CAACS,KAAP,CAAa,EAAb,CAAD,EAAmB,IAAA,CAAKb,SAAxB,EAAmC,IAAnC,CAApB;AACA,MAAA,IAAIW,MAAM,IAAIA,MAAM,CAACR,KAArB,EAA4B;QAC3B,OAAOQ,MAAM,CAACG,YAAd;AACA,MAAA;AACD,MAAA,IAAIH,MAAM,IAAIA,MAAM,CAACI,QAArB,EAA+B;QAC9B,IAAI,CAACN,aAAL,EAAoB;AACnB,UAAA;AACA,QAAA;AACD,MAAA;AACD,MAAA,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AAA,GAAAP,+BAAA,CAAmBjB,IAAI,CAACkB,IAAxB,CAAA,EAAAO,MAAA,IAAAA,MAAA,GAAAD,UAAA,EAAA,EAAAJ,IAAA,GAA8B;AAAA,QAAA,IAAnBM,KAAmB,GAAAD,MAAA,CAAAH,KAAA;AAC7B,QAAA,IAAIvB,UAAU,CAAC,CAAD,CAAV,KAAkB2B,KAAtB,EAA4B;AAC3B,UAAA,IAAI3B,UAAU,CAACT,MAAX,KAAsB,CAA1B,EAA6B;YAC5B,OAAO;AACNJ,cAAAA,KAAK,EAAE,IADD;AAENW,cAAAA,YAAY,EAAEE;aAFf;AAIA,UAAA;AACD,UAAA,IAAIE,IAAJ,EAAU;YACT,OAAO;AACNH,cAAAA,QAAQ,EAAE;aADX;AAGA,UAAA;UACD,OAAO;AACNZ,YAAAA,KAAK,EAAE,IADD;YAENW,YAAY,EAAE,CAAC6B,KAAD;WAFf;AAIA,QAAA;AACD,MAAA,CAnBF;;AAqBC,MAAA;;AAED;;AACA,IAAA;AACC,MAAA,MAAM,IAAIjC,KAAJ,CAAA,gCAAA,CAAAmB,MAAA,CAA2CZ,IAA3C,CAAA,CAAN;AAzDF;AA2DA;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"AsYouTypeFormatter.PatternMatcher.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport PatternParser from './AsYouTypeFormatter.PatternParser.js';\nvar PatternMatcher = /*#__PURE__*/function () {\n function PatternMatcher(pattern) {\n _classCallCheck(this, PatternMatcher);\n this.matchTree = new PatternParser().parse(pattern);\n }\n return _createClass(PatternMatcher, [{\n key: \"match\",\n value: function match(string) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n allowOverflow = _ref.allowOverflow;\n if (!string) {\n throw new Error('String is required');\n }\n var result = _match(string.split(''), this.matchTree, true);\n if (result && result.match) {\n delete result.matchedChars;\n }\n if (result && result.overflow) {\n if (!allowOverflow) {\n return;\n }\n }\n return result;\n }\n }]);\n}();\n/**\r\n * Matches `characters` against a pattern compiled into a `tree`.\r\n * @param {string[]} characters\r\n * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.\r\n * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.\r\n * @return {object} See the `*.d.ts` file for the description of the result object.\r\n */\nexport { PatternMatcher as default };\nfunction _match(characters, tree, last) {\n // If `tree` is a string, then `tree` is a single character.\n // That's because when a pattern is parsed, multi-character-string parts\n // of a pattern are compiled into arrays of single characters.\n // I still wrote this piece of code for a \"general\" hypothetical case\n // when `tree` could be a string of several characters, even though\n // such case is not possible with the current implementation.\n if (typeof tree === 'string') {\n var characterString = characters.join('');\n if (tree.indexOf(characterString) === 0) {\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n /* istanbul ignore else */\n if (characters.length === tree.length) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n /* istanbul ignore next */\n return {\n partialMatch: true\n // matchedChars: characters\n };\n }\n if (characterString.indexOf(tree) === 0) {\n if (last) {\n // The `else` path is not possible because `tree` is always a single character.\n // The `else` case for `characters.length > tree.length` would be\n // `characters.length <= tree.length` which means `characters.length <= 1`.\n // `characters` array can't be empty, so that means `characters === [tree]`,\n // which would also mean `tree.indexOf(characterString) === 0` and that'd mean\n // that the `if (tree.indexOf(characterString) === 0)` condition before this\n // `if` condition would be entered, and returned from there, not reaching this code.\n /* istanbul ignore else */\n if (characters.length > tree.length) {\n return {\n overflow: true\n };\n }\n }\n return {\n match: true,\n matchedChars: characters.slice(0, tree.length)\n };\n }\n return;\n }\n if (Array.isArray(tree)) {\n var restCharacters = characters.slice();\n var i = 0;\n while (i < tree.length) {\n var subtree = tree[i];\n var result = _match(restCharacters, subtree, last && i === tree.length - 1);\n if (!result) {\n return;\n } else if (result.overflow) {\n return result;\n } else if (result.match) {\n // Continue with the next subtree with the rest of the characters.\n restCharacters = restCharacters.slice(result.matchedChars.length);\n if (restCharacters.length === 0) {\n if (i === tree.length - 1) {\n return {\n match: true,\n matchedChars: characters\n };\n } else {\n return {\n partialMatch: true\n // matchedChars: characters\n };\n }\n }\n } else {\n /* istanbul ignore else */\n if (result.partialMatch) {\n return {\n partialMatch: true\n // matchedChars: characters\n };\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(result, null, 2)));\n }\n }\n i++;\n }\n // If `last` then overflow has already been checked\n // by the last element of the `tree` array.\n /* istanbul ignore if */\n if (last) {\n return {\n overflow: true\n };\n }\n return {\n match: true,\n matchedChars: characters.slice(0, characters.length - restCharacters.length)\n };\n }\n switch (tree.op) {\n case '|':\n var partialMatch;\n for (var _iterator = _createForOfIteratorHelperLoose(tree.args), _step; !(_step = _iterator()).done;) {\n var branch = _step.value;\n var _result = _match(characters, branch, last);\n if (_result) {\n if (_result.overflow) {\n return _result;\n } else if (_result.match) {\n return {\n match: true,\n matchedChars: _result.matchedChars\n };\n } else {\n /* istanbul ignore else */\n if (_result.partialMatch) {\n partialMatch = true;\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(_result, null, 2)));\n }\n }\n }\n }\n if (partialMatch) {\n return {\n partialMatch: true\n // matchedChars: ...\n };\n }\n // Not even a partial match.\n return;\n case '[]':\n for (var _iterator2 = _createForOfIteratorHelperLoose(tree.args), _step2; !(_step2 = _iterator2()).done;) {\n var _char = _step2.value;\n if (characters[0] === _char) {\n if (characters.length === 1) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n if (last) {\n return {\n overflow: true\n };\n }\n return {\n match: true,\n matchedChars: [_char]\n };\n }\n }\n // No character matches.\n return;\n\n /* istanbul ignore next */\n default:\n throw new Error(\"Unsupported instruction tree: \".concat(tree));\n }\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map"],"names":["PatternMatcher","pattern","_classCallCheck","matchTree","PatternParser","parse","_createClass","key","value","match","string","_ref","arguments","length","undefined","allowOverflow","Error","result","_match","split","matchedChars","overflow","characters","tree","last","characterString","join","indexOf","partialMatch","slice","Array","isArray","restCharacters","i","subtree","concat","JSON","stringify","op","_iterator","_createForOfIteratorHelperLoose","args","_step","done","branch","_result","_iterator2","_step2","_char"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAiE,IAE5CA,cAAc,gBAAA,YAAA;EAClC,SAAAA,cAAAA,CAAYC,OAAO,EAAE;AAAAC,IAAAA,eAAA,OAAAF,cAAA,CAAA;IACpB,IAAI,CAACG,SAAS,GAAG,IAAIC,aAAa,EAAE,CAACC,KAAK,CAACJ,OAAO,CAAC;AACpD,EAAA;EAAC,OAAAK,YAAA,CAAAN,cAAA,EAAA,CAAA;IAAAO,GAAA,EAAA,OAAA;AAAAC,IAAAA,KAAA,EAED,SAAAC,KAAKA,CAACC,MAAM,EAA0B;AAAA,MAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAJ,EAAE;QAApBG,aAAa,GAAAJ,IAAA,CAAbI,aAAa;MAC5B,IAAI,CAACL,MAAM,EAAE;AACZ,QAAA,MAAM,IAAIM,KAAK,CAAC,oBAAoB,CAAC;AACtC,MAAA;AACA,MAAA,IAAMC,MAAM,GAAGC,MAAK,CAACR,MAAM,CAACS,KAAK,CAAC,EAAE,CAAC,EAAE,IAAI,CAAChB,SAAS,EAAE,IAAI,CAAC;AAC5D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ACD,QAAA;AACD,MAAA;AACA,MAAA,IAAIjB,YAAY,EAAE;QACjB,OAAO;AACNA,UAAAA,YAAY,EAAE;AACd;SACA;AACF,MAAA;AACA;AACA,MAAA;AAED,IAAA,KAAK,IAAI;AACR,MAAA,KAAA,IAAAkB,UAAA,GAAAN,+BAAA,CAAmBjB,IAAI,CAACkB,IAAI,CAAA,EAAAM,MAAA,IAAAA,MAAA,GAAAD,UAAA,EAAA,EAAAH,IAAA,GAAE;AAAA,QAAA,IAAnBK,KAAI,GAAAD,MAAA,CAAAvC,KAAA;AACd,QAAA,IAAIc,UAAU,CAAC,CAAC,CAAC,KAAK0B,KAAI,EAAE;AAC3B,UAAA,IAAI1B,UAAU,CAACT,MAAM,KAAK,CAAC,EAAE;YAC5B,OAAO;AACNJ,cAAAA,KAAK,EAAE,IAAI;AACXW,cAAAA,YAAY,EAAEE;aACd;AACF,UAAA;AACA,UAAA,IAAIE,IAAI,EAAE;YACT,OAAO;AACNH,cAAAA,QAAQ,EAAE;aACV;AACF,UAAA;UACA,OAAO;AACNZ,YAAAA,KAAK,EAAE,IAAI;YACXW,YAAY,EAAE,CAAC4B,KAAI;WACnB;AACF,QAAA;AACD,MAAA;AACA;AACA,MAAA;;AAED;AACA,IAAA;AACC,MAAA,MAAM,IAAIhC,KAAK,CAAA,gCAAA,CAAAmB,MAAA,CAAkCZ,IAAI,CAAE,CAAC;AAC1D;AACD;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,29 +1,45 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
function _typeof(o) {
|
|
2
|
+
"@babel/helpers - typeof";
|
|
3
|
+
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
5
|
+
return typeof o;
|
|
6
|
+
} : function (o) {
|
|
7
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
+
}, _typeof(o);
|
|
9
|
+
}
|
|
10
|
+
function _classCallCheck(a, n) {
|
|
11
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
5
12
|
}
|
|
6
|
-
function _defineProperties(
|
|
7
|
-
for (var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
descriptor.configurable = true;
|
|
11
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
12
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
function _defineProperties(e, r) {
|
|
14
|
+
for (var t = 0; t < r.length; t++) {
|
|
15
|
+
var o = r[t];
|
|
16
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
|
-
function _createClass(
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
19
|
+
function _createClass(e, r, t) {
|
|
20
|
+
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
|
18
21
|
writable: false
|
|
19
|
-
});
|
|
20
|
-
|
|
22
|
+
}), e;
|
|
23
|
+
}
|
|
24
|
+
function _toPropertyKey(t) {
|
|
25
|
+
var i = _toPrimitive(t, "string");
|
|
26
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
27
|
+
}
|
|
28
|
+
function _toPrimitive(t, r) {
|
|
29
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
30
|
+
var e = t[Symbol.toPrimitive];
|
|
31
|
+
if (void 0 !== e) {
|
|
32
|
+
var i = e.call(t, r);
|
|
33
|
+
if ("object" != _typeof(i)) return i;
|
|
34
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
35
|
+
}
|
|
36
|
+
return (String )(t);
|
|
21
37
|
}
|
|
22
38
|
var PatternParser = /*#__PURE__*/function () {
|
|
23
39
|
function PatternParser() {
|
|
24
40
|
_classCallCheck(this, PatternParser);
|
|
25
41
|
}
|
|
26
|
-
_createClass(PatternParser, [{
|
|
42
|
+
return _createClass(PatternParser, [{
|
|
27
43
|
key: "parse",
|
|
28
44
|
value: function parse(pattern) {
|
|
29
45
|
this.context = [{
|
|
@@ -43,8 +59,8 @@ var PatternParser = /*#__PURE__*/function () {
|
|
|
43
59
|
args: branches.concat([expandSingleElementArray(instructions)])
|
|
44
60
|
};
|
|
45
61
|
}
|
|
46
|
-
/* istanbul ignore if */
|
|
47
62
|
|
|
63
|
+
/* istanbul ignore if */
|
|
48
64
|
if (instructions.length === 0) {
|
|
49
65
|
throw new Error('Pattern is required');
|
|
50
66
|
}
|
|
@@ -121,11 +137,10 @@ var PatternParser = /*#__PURE__*/function () {
|
|
|
121
137
|
}
|
|
122
138
|
if (before) {
|
|
123
139
|
this.parsePattern(before);
|
|
124
|
-
}
|
|
125
|
-
|
|
140
|
+
}
|
|
141
|
+
// The top-level is an implicit "or" group, if required.
|
|
126
142
|
if (!this.getContext().branches) {
|
|
127
143
|
// `branches` are not defined only for the root implicit "or" operator.
|
|
128
|
-
|
|
129
144
|
/* istanbul ignore else */
|
|
130
145
|
if (this.context.length === 1) {
|
|
131
146
|
this.getContext().branches = [];
|
|
@@ -156,7 +171,6 @@ var PatternParser = /*#__PURE__*/function () {
|
|
|
156
171
|
break;
|
|
157
172
|
|
|
158
173
|
/* istanbul ignore next */
|
|
159
|
-
|
|
160
174
|
default:
|
|
161
175
|
throw new Error("Unknown operator: ".concat(operator));
|
|
162
176
|
}
|
|
@@ -165,7 +179,6 @@ var PatternParser = /*#__PURE__*/function () {
|
|
|
165
179
|
}
|
|
166
180
|
}
|
|
167
181
|
}]);
|
|
168
|
-
return PatternParser;
|
|
169
182
|
}();
|
|
170
183
|
function parseOneOfSet(pattern) {
|
|
171
184
|
var values = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsYouTypeFormatter.PatternParser.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js"],"sourcesContent":["function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar PatternParser = /*#__PURE__*/function () {\n function PatternParser() {\n _classCallCheck(this, PatternParser);\n }\n\n _createClass(PatternParser, [{\n key: \"parse\",\n value: function parse(pattern) {\n this.context = [{\n or: true,\n instructions: []\n }];\n this.parsePattern(pattern);\n\n if (this.context.length !== 1) {\n throw new Error('Non-finalized contexts left when pattern parse ended');\n }\n\n var _this$context$ = this.context[0],\n branches = _this$context$.branches,\n instructions = _this$context$.instructions;\n\n if (branches) {\n return {\n op: '|',\n args: branches.concat([expandSingleElementArray(instructions)])\n };\n }\n /* istanbul ignore if */\n\n\n if (instructions.length === 0) {\n throw new Error('Pattern is required');\n }\n\n if (instructions.length === 1) {\n return instructions[0];\n }\n\n return instructions;\n }\n }, {\n key: \"startContext\",\n value: function startContext(context) {\n this.context.push(context);\n }\n }, {\n key: \"endContext\",\n value: function endContext() {\n this.context.pop();\n }\n }, {\n key: \"getContext\",\n value: function getContext() {\n return this.context[this.context.length - 1];\n }\n }, {\n key: \"parsePattern\",\n value: function parsePattern(pattern) {\n if (!pattern) {\n throw new Error('Pattern is required');\n }\n\n var match = pattern.match(OPERATOR);\n\n if (!match) {\n if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\n throw new Error(\"Illegal characters found in a pattern: \".concat(pattern));\n }\n\n this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));\n return;\n }\n\n var operator = match[1];\n var before = pattern.slice(0, match.index);\n var rightPart = pattern.slice(match.index + operator.length);\n\n switch (operator) {\n case '(?:':\n if (before) {\n this.parsePattern(before);\n }\n\n this.startContext({\n or: true,\n instructions: [],\n branches: []\n });\n break;\n\n case ')':\n if (!this.getContext().or) {\n throw new Error('\")\" operator must be preceded by \"(?:\" operator');\n }\n\n if (before) {\n this.parsePattern(before);\n }\n\n if (this.getContext().instructions.length === 0) {\n throw new Error('No instructions found after \"|\" operator in an \"or\" group');\n }\n\n var _this$getContext = this.getContext(),\n branches = _this$getContext.branches;\n\n branches.push(expandSingleElementArray(this.getContext().instructions));\n this.endContext();\n this.getContext().instructions.push({\n op: '|',\n args: branches\n });\n break;\n\n case '|':\n if (!this.getContext().or) {\n throw new Error('\"|\" operator can only be used inside \"or\" groups');\n }\n\n if (before) {\n this.parsePattern(before);\n } // The top-level is an implicit \"or\" group, if required.\n\n\n if (!this.getContext().branches) {\n // `branches` are not defined only for the root implicit \"or\" operator.\n\n /* istanbul ignore else */\n if (this.context.length === 1) {\n this.getContext().branches = [];\n } else {\n throw new Error('\"branches\" not found in an \"or\" group context');\n }\n }\n\n this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));\n this.getContext().instructions = [];\n break;\n\n case '[':\n if (before) {\n this.parsePattern(before);\n }\n\n this.startContext({\n oneOfSet: true\n });\n break;\n\n case ']':\n if (!this.getContext().oneOfSet) {\n throw new Error('\"]\" operator must be preceded by \"[\" operator');\n }\n\n this.endContext();\n this.getContext().instructions.push({\n op: '[]',\n args: parseOneOfSet(before)\n });\n break;\n\n /* istanbul ignore next */\n\n default:\n throw new Error(\"Unknown operator: \".concat(operator));\n }\n\n if (rightPart) {\n this.parsePattern(rightPart);\n }\n }\n }]);\n\n return PatternParser;\n}();\n\nexport { PatternParser as default };\n\nfunction parseOneOfSet(pattern) {\n var values = [];\n var i = 0;\n\n while (i < pattern.length) {\n if (pattern[i] === '-') {\n if (i === 0 || i === pattern.length - 1) {\n throw new Error(\"Couldn't parse a one-of set pattern: \".concat(pattern));\n }\n\n var prevValue = pattern[i - 1].charCodeAt(0) + 1;\n var nextValue = pattern[i + 1].charCodeAt(0) - 1;\n var value = prevValue;\n\n while (value <= nextValue) {\n values.push(String.fromCharCode(value));\n value++;\n }\n } else {\n values.push(pattern[i]);\n }\n\n i++;\n }\n\n return values;\n}\n\nvar ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/;\nvar OPERATOR = new RegExp( // any of:\n'(' + // or operator\n'\\\\|' + // or\n'|' + // or group start\n'\\\\(\\\\?\\\\:' + // or\n'|' + // or group end\n'\\\\)' + // or\n'|' + // one-of set start\n'\\\\[' + // or\n'|' + // one-of set end\n'\\\\]' + ')');\n\nfunction expandSingleElementArray(array) {\n if (array.length === 1) {\n return array[0];\n }\n\n return array;\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternParser.js.map"],"names":["PatternParser","parse","pattern","context","or","instructions","parsePattern","length","Error","_this$context$","branches","op","args","concat","expandSingleElementArray","startContext","push","endContext","pop","getContext","match","OPERATOR","ILLEGAL_CHARACTER_REGEXP","test","split","operator","before","slice","index","rightPart","_this$getContext","oneOfSet","parseOneOfSet","values","i","prevValue","charCodeAt","nextValue","value","String","fromCharCode","RegExp","array"],"mappings":";;;;;;;;;;;;;;;;;;;;;IAAqBA;;;;;;WACpB,SAAAC,KAAAA,CAAMC,OAAN,EAAe;MACd,IAAA,CAAKC,OAAL,GAAe,CAAC;AACfC,QAAAA,EAAE,EAAE,IADW;AAEfC,QAAAA,YAAY,EAAE;AAFC,OAAD,CAAf;MAKA,IAAA,CAAKC,YAAL,CAAkBJ,OAAlB,CAAA;AAEA,MAAA,IAAI,KAAKC,OAAL,CAAaI,MAAb,KAAwB,CAA5B,EAA+B;AAC9B,QAAA,MAAM,IAAIC,KAAJ,CAAU,sDAAV,CAAN;AACA,MAAA;AAED,MAAA,IAAAC,cAAA,GAAmC,IAAA,CAAKN,OAAL,CAAa,CAAb,CAAnC;QAAQO,Q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,CAAjD;AACA,MAAA,IAAMC,SAAS,GAAGnC,OAAO,CAACgC,CAAC,GAAG,CAAL,CAAP,CAAeE,UAAf,CAA0B,CAA1B,IAA+B,CAAjD;MACA,IAAIE,KAAK,GAAGH,SAAZ;MACA,OAAOG,KAAK,IAAID,SAAhB,EAA2B;QAC1BJ,MAAM,CAACjB,IAAP,CAAYuB,MAAM,CAACC,YAAP,CAAoBF,KAApB,CAAZ,CAAA;QACAA,KAAK,EAAA;AACL,MAAA;AACD,IAAA,CAXD,MAWO;AACNL,MAAAA,MAAM,CAACjB,IAAP,CAAYd,OAAO,CAACgC,CAAD,CAAnB,CAAA;AACA,IAAA;IACDA,CAAC,EAAA;AACD,EAAA;AACD,EAAA,OAAOD,MAAP;AACA;AAED,IAAMX,wBAAwB,GAAG,kBAAjC;AAEA,IAAMD,QAAQ,GAAG,IAAIoB,MAAJ;AAChB;AACA,GAAA;AACC;AACA,KAFD;AAGC;AACA,GAJD;AAKC;AACA,WAND;AAOC;AACA,GARD;AASC;AACA,KAVD;AAWC;AACA,GAZD;AAaC;AACA,KAdD;AAeC;AACA,GAhBD;AAiBC;AACA,KAlBD,GAmBA,GArBgB,CAAjB;AAwBA,SAAS3B,wBAATA,CAAkC4B,KAAlC,EAAyC;AACxC,EAAA,IAAIA,KAAK,CAACnC,MAAN,KAAiB,CAArB,EAAwB;IACvB,OAAOmC,KAAK,CAAC,CAAD,CAAZ;AACA,EAAA;AACD,EAAA,OAAOA,KAAP;AACA;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"AsYouTypeFormatter.PatternParser.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar PatternParser = /*#__PURE__*/function () {\n function PatternParser() {\n _classCallCheck(this, PatternParser);\n }\n return _createClass(PatternParser, [{\n key: \"parse\",\n value: function parse(pattern) {\n this.context = [{\n or: true,\n instructions: []\n }];\n this.parsePattern(pattern);\n if (this.context.length !== 1) {\n throw new Error('Non-finalized contexts left when pattern parse ended');\n }\n var _this$context$ = this.context[0],\n branches = _this$context$.branches,\n instructions = _this$context$.instructions;\n if (branches) {\n return {\n op: '|',\n args: branches.concat([expandSingleElementArray(instructions)])\n };\n }\n\n /* istanbul ignore if */\n if (instructions.length === 0) {\n throw new Error('Pattern is required');\n }\n if (instructions.length === 1) {\n return instructions[0];\n }\n return instructions;\n }\n }, {\n key: \"startContext\",\n value: function startContext(context) {\n this.context.push(context);\n }\n }, {\n key: \"endContext\",\n value: function endContext() {\n this.context.pop();\n }\n }, {\n key: \"getContext\",\n value: function getContext() {\n return this.context[this.context.length - 1];\n }\n }, {\n key: \"parsePattern\",\n value: function parsePattern(pattern) {\n if (!pattern) {\n throw new Error('Pattern is required');\n }\n var match = pattern.match(OPERATOR);\n if (!match) {\n if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\n throw new Error(\"Illegal characters found in a pattern: \".concat(pattern));\n }\n this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));\n return;\n }\n var operator = match[1];\n var before = pattern.slice(0, match.index);\n var rightPart = pattern.slice(match.index + operator.length);\n switch (operator) {\n case '(?:':\n if (before) {\n this.parsePattern(before);\n }\n this.startContext({\n or: true,\n instructions: [],\n branches: []\n });\n break;\n case ')':\n if (!this.getContext().or) {\n throw new Error('\")\" operator must be preceded by \"(?:\" operator');\n }\n if (before) {\n this.parsePattern(before);\n }\n if (this.getContext().instructions.length === 0) {\n throw new Error('No instructions found after \"|\" operator in an \"or\" group');\n }\n var _this$getContext = this.getContext(),\n branches = _this$getContext.branches;\n branches.push(expandSingleElementArray(this.getContext().instructions));\n this.endContext();\n this.getContext().instructions.push({\n op: '|',\n args: branches\n });\n break;\n case '|':\n if (!this.getContext().or) {\n throw new Error('\"|\" operator can only be used inside \"or\" groups');\n }\n if (before) {\n this.parsePattern(before);\n }\n // The top-level is an implicit \"or\" group, if required.\n if (!this.getContext().branches) {\n // `branches` are not defined only for the root implicit \"or\" operator.\n /* istanbul ignore else */\n if (this.context.length === 1) {\n this.getContext().branches = [];\n } else {\n throw new Error('\"branches\" not found in an \"or\" group context');\n }\n }\n this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));\n this.getContext().instructions = [];\n break;\n case '[':\n if (before) {\n this.parsePattern(before);\n }\n this.startContext({\n oneOfSet: true\n });\n break;\n case ']':\n if (!this.getContext().oneOfSet) {\n throw new Error('\"]\" operator must be preceded by \"[\" operator');\n }\n this.endContext();\n this.getContext().instructions.push({\n op: '[]',\n args: parseOneOfSet(before)\n });\n break;\n\n /* istanbul ignore next */\n default:\n throw new Error(\"Unknown operator: \".concat(operator));\n }\n if (rightPart) {\n this.parsePattern(rightPart);\n }\n }\n }]);\n}();\nexport { PatternParser as default };\nfunction parseOneOfSet(pattern) {\n var values = [];\n var i = 0;\n while (i < pattern.length) {\n if (pattern[i] === '-') {\n if (i === 0 || i === pattern.length - 1) {\n throw new Error(\"Couldn't parse a one-of set pattern: \".concat(pattern));\n }\n var prevValue = pattern[i - 1].charCodeAt(0) + 1;\n var nextValue = pattern[i + 1].charCodeAt(0) - 1;\n var value = prevValue;\n while (value <= nextValue) {\n values.push(String.fromCharCode(value));\n value++;\n }\n } else {\n values.push(pattern[i]);\n }\n i++;\n }\n return values;\n}\nvar ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/;\nvar OPERATOR = new RegExp(\n// any of:\n'(' +\n// or operator\n'\\\\|' +\n// or\n'|' +\n// or group start\n'\\\\(\\\\?\\\\:' +\n// or\n'|' +\n// or group end\n'\\\\)' +\n// or\n'|' +\n// one-of set start\n'\\\\[' +\n// or\n'|' +\n// one-of set end\n'\\\\]' + ')');\nfunction expandSingleElementArray(array) {\n if (array.length === 1) {\n return array[0];\n }\n return array;\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternParser.js.map"],"names":["PatternParser","_classCallCheck","_createClass","key","value","parse","pattern","context","or","instructions","parsePattern","length","Error","_this$context$","branches","op","args","concat","expandSingleElementArray","startContext","push","endContext","pop","getContext","match","OPERATOR","ILLEGAL_CHARACTER_REGEXP","test","split","operator","before","slice","index","rightPart","_this$getContext","oneOfSet","parseOneOfSet","values","i","prevValue","charCodeAt","nextValue","String","fromCharCode","RegExp","array"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAqBA,aAAa,gBAAA,YAAA;AAAA,EAAA,SAAAA,aAAAA,GAAA;AAAAC,IAAAA,eAAA,OAAAD,aAAA,CAAA;AAAA,EAAA;EAAA,OAAAE,YAAA,CAAAF,aAAA,EAAA,CAAA;IAAAG,GAAA,EAAA,OAAA;AAAAC,IAAAA,KAAA,EACjC,SAAAC,KAAKA,CAACC,OAAO,EAAE;MACd,IAAI,CAACC,OAAO,GAAG,CAAC;AACf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,CAAClC,MAAM,KAAK,CAAC,EAAE;IACvB,OAAOkC,KAAK,CAAC,CAAC,CAAC;AAChB,EAAA;AACA,EAAA,OAAOA,KAAK;AACb;;;;","x_google_ignoreList":[0]}
|
|
@@ -15,18 +15,21 @@ function formatCompleteNumber(state, format, _ref) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function canFormatCompleteNumber(nationalSignificantNumber, metadata) {
|
|
19
|
-
return checkNumberLength(nationalSignificantNumber, metadata) === 'IS_POSSIBLE';
|
|
18
|
+
function canFormatCompleteNumber(nationalSignificantNumber, country, metadata) {
|
|
19
|
+
return checkNumberLength(nationalSignificantNumber, country, metadata) === 'IS_POSSIBLE';
|
|
20
20
|
}
|
|
21
21
|
function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {
|
|
22
22
|
var metadata = _ref2.metadata,
|
|
23
23
|
shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,
|
|
24
24
|
getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
|
|
25
25
|
// `format` has already been checked for `nationalPrefix` requirement.
|
|
26
|
+
|
|
26
27
|
state.nationalSignificantNumber;
|
|
27
28
|
state.international;
|
|
28
29
|
state.nationalPrefix;
|
|
29
|
-
state.carrierCode;
|
|
30
|
+
state.carrierCode;
|
|
31
|
+
|
|
32
|
+
// Format the number with using `national_prefix_formatting_rule`.
|
|
30
33
|
// If the resulting formatted number is a valid formatted number, then return it.
|
|
31
34
|
//
|
|
32
35
|
// Google's AsYouType formatter is different in a way that it doesn't try
|
|
@@ -36,7 +39,6 @@ function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, f
|
|
|
36
39
|
// The reason is that "national prefix formatting rule" may use parentheses,
|
|
37
40
|
// which wouldn't be included has it used the simpler Google's way.
|
|
38
41
|
//
|
|
39
|
-
|
|
40
42
|
if (shouldTryNationalPrefixFormattingRule(format)) {
|
|
41
43
|
var formattedNumber = formatNationalNumber(state, format, {
|
|
42
44
|
useNationalPrefixFormattingRule: true,
|
|
@@ -46,8 +48,9 @@ function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, f
|
|
|
46
48
|
if (formattedNumber) {
|
|
47
49
|
return formattedNumber;
|
|
48
50
|
}
|
|
49
|
-
}
|
|
51
|
+
}
|
|
50
52
|
|
|
53
|
+
// Format the number without using `national_prefix_formatting_rule`.
|
|
51
54
|
return formatNationalNumber(state, format, {
|
|
52
55
|
useNationalPrefixFormattingRule: false,
|
|
53
56
|
getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,
|
|
@@ -69,14 +72,16 @@ function formatNationalNumber(state, format, _ref3) {
|
|
|
69
72
|
// If a national prefix was extracted, then just prepend it,
|
|
70
73
|
// followed by a " " character.
|
|
71
74
|
formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;
|
|
72
|
-
} else if (state.
|
|
73
|
-
formattedNationalNumber = state.
|
|
75
|
+
} else if (state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {
|
|
76
|
+
formattedNationalNumber = state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + ' ' + formattedNationalNumber;
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
|
|
77
80
|
return formattedNationalNumber;
|
|
78
81
|
}
|
|
79
|
-
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Check that the formatted phone number contains exactly
|
|
80
85
|
// the same digits that have been input by the user.
|
|
81
86
|
// For example, when "0111523456789" is input for `AR` country,
|
|
82
87
|
// the extracted `this.nationalSignificantNumber` is "91123456789",
|
|
@@ -105,7 +110,6 @@ function formatNationalNumber(state, format, _ref3) {
|
|
|
105
110
|
// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5
|
|
106
111
|
// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b
|
|
107
112
|
//
|
|
108
|
-
|
|
109
113
|
function isValidFormattedNationalNumber(formattedNationalNumber, state) {
|
|
110
114
|
return parseDigits(formattedNationalNumber) === state.getNationalDigits();
|
|
111
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsYouTypeFormatter.complete.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js"],"sourcesContent":["import checkNumberLength from './helpers/checkNumberLength.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nexport default function formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n
|
|
1
|
+
{"version":3,"file":"AsYouTypeFormatter.complete.js","sources":["../../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js"],"sourcesContent":["import checkNumberLength from './helpers/checkNumberLength.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nexport default function formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;\n var matcher = new RegExp(\"^(?:\".concat(format.pattern(), \")$\"));\n if (matcher.test(state.nationalSignificantNumber)) {\n return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {\n metadata: metadata,\n shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix\n });\n }\n}\nexport function canFormatCompleteNumber(nationalSignificantNumber, country, metadata) {\n return checkNumberLength(nationalSignificantNumber, country, metadata) === 'IS_POSSIBLE';\n}\nfunction formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {\n var metadata = _ref2.metadata,\n shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;\n // `format` has already been checked for `nationalPrefix` requirement.\n\n var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode;\n\n // Format the number with using `national_prefix_formatting_rule`.\n // If the resulting formatted number is a valid formatted number, then return it.\n //\n // Google's AsYouType formatter is different in a way that it doesn't try\n // to format using the \"national prefix formatting rule\", and instead it\n // simply prepends a national prefix followed by a \" \" character.\n // This code does that too, but as a fallback.\n // The reason is that \"national prefix formatting rule\" may use parentheses,\n // which wouldn't be included has it used the simpler Google's way.\n //\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n if (formattedNumber) {\n return formattedNumber;\n }\n }\n\n // Format the number without using `national_prefix_formatting_rule`.\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n}\nfunction formatNationalNumber(state, format, _ref3) {\n var metadata = _ref3.metadata,\n useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;\n var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {\n carrierCode: state.carrierCode,\n useInternationalFormat: state.international,\n withNationalPrefix: useNationalPrefixFormattingRule,\n metadata: metadata\n });\n if (!useNationalPrefixFormattingRule) {\n if (state.nationalPrefix) {\n // If a national prefix was extracted, then just prepend it,\n // followed by a \" \" character.\n formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;\n } else if (state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {\n formattedNationalNumber = state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + ' ' + formattedNationalNumber;\n }\n }\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\n }\n}\n\n// Check that the formatted phone number contains exactly\n// the same digits that have been input by the user.\n// For example, when \"0111523456789\" is input for `AR` country,\n// the extracted `this.nationalSignificantNumber` is \"91123456789\",\n// which means that the national part of `this.digits` isn't simply equal to\n// `this.nationalPrefix` + `this.nationalSignificantNumber`.\n//\n// Also, a `format` can add extra digits to the `this.nationalSignificantNumber`\n// being formatted via `metadata[country].national_prefix_transform_rule`.\n// For example, for `VI` country, it prepends `340` to the national number,\n// and if this check hasn't been implemented, then there would be a bug\n// when `340` \"area coude\" is \"duplicated\" during input for `VI` country:\n// https://github.com/catamphetamine/libphonenumber-js/issues/318\n//\n// So, all these \"gotchas\" are filtered out.\n//\n// In the original Google's code, the comments say:\n// \"Check that we didn't remove nor add any extra digits when we matched\n// this formatting pattern. This usually happens after we entered the last\n// digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when\n// formatted but AYTF should retain all the number entered and not change\n// in order to match a format (of same leading digits and length) display\n// in that way.\"\n// \"If it's the same (i.e entered number and format is same), then it's\n// safe to return this in formatted number as nothing is lost / added.\"\n// Otherwise, don't use this format.\n// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5\n// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b\n//\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return parseDigits(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map"],"names":["formatCompleteNumber","state","format","_ref","metadata","shouldTryNationalPrefixFormattingRule","getSeparatorAfterNationalPrefix","matcher","RegExp","concat","pattern","test","nationalSignificantNumber","formatNationalNumberWithAndWithoutNationalPrefixFormattingRule","canFormatCompleteNumber","country","checkNumberLength","_ref2","international","nationalPrefix","carrierCode","formattedNumber","formatNationalNumber","useNationalPrefixFormattingRule","_ref3","formattedNationalNumber","formatNationalNumberUsingFormat","useInternationalFormat","withNationalPrefix","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","isValidFormattedNationalNumber","parseDigits","getNationalDigits"],"mappings":";;;;AAIe,SAASA,oBAAoBA,CAACC,KAAK,EAAEC,MAAM,EAAAC,IAAA,EAIvD;AAAA,EAAA,IAHFC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,qCAAqC,GAAAF,IAAA,CAArCE,qCAAqC;IACrCC,+BAA+B,GAAAH,IAAA,CAA/BG,+BAA+B;AAE/B,EAAA,IAAMC,OAAO,GAAG,IAAIC,MAAM,CAAA,MAAA,CAAAC,MAAA,CAAQP,MAAM,CAACQ,OAAO,EAAE,OAAI,CAAC;EACvD,IAAIH,OAAO,CAACI,IAAI,CAACV,KAAK,CAACW,yBAAyB,CAAC,EAAE;AAClD,IAAA,OAAOC,8DAA8D,CACpEZ,KAAK,EACLC,MAAM,EACN;AACCE,MAAAA,QAAQ,EAARA,QAAQ;AACRC,MAAAA,qCAAqC,EAArCA,qCAAqC;AACrCC,MAAAA,+BAA+B,EAA/BA;AACD,KACD,CAAC;AACF,EAAA;AACD;AAEO,SAASQ,uBAAuBA,CAACF,yBAAyB,EAAEG,OAAO,EAAEX,QAAQ,EAAE;EACrF,OAAOY,iBAAiB,CAACJ,yBAAyB,EAAEG,OAAO,EAAEX,QAAQ,CAAC,KAAK,aAAa;AACzF;AAEA,SAASS,8DAA8DA,CAACZ,KAAK,EAAEC,MAAM,EAAAe,KAAA,EAIlF;AAAA,EAAA,IAHFb,QAAQ,GAAAa,KAAA,CAARb,QAAQ;IACRC,qCAAqC,GAAAY,KAAA,CAArCZ,qCAAqC;IACrCC,+B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