adp-web-components 0.1.59 → 0.1.60
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/dead-stock-lookup_3.cjs.entry.js +7 -6
- package/dist/cjs/flexible-container.cjs.entry.js +1 -1
- package/dist/cjs/form-checkbox.cjs.entry.js +9 -5
- package/dist/cjs/form-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/form-dialog_8.cjs.entry.js +40 -36
- package/dist/cjs/{form-error-message-CrGiKsoO.js → form-error-message-B2s83XoL.js} +1 -1
- package/dist/cjs/form-input-BZp9_abd.js +24 -0
- package/dist/cjs/form-input_4.cjs.entry.js +24 -18
- package/dist/cjs/form-switch.cjs.entry.js +9 -5
- package/dist/cjs/form-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/general-inquiry-form.cjs.entry.js +24 -22
- package/dist/cjs/get-local-language-DV1oVchQ.js +194 -0
- package/dist/cjs/information-table.cjs.entry.js +1 -1
- package/dist/cjs/{loader-icon-qrSyqpQO.js → loader-icon-OTnFBvzm.js} +1150 -263
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
- package/dist/cjs/manufacturer-part-lookup.cjs.entry.js +8 -7
- package/dist/cjs/part-lookup.cjs.entry.js +6 -5
- package/dist/cjs/service-booking-form.cjs.entry.js +11 -9
- package/dist/cjs/shift-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/shift-components.cjs.js +1 -1
- package/dist/cjs/shift-switch.cjs.entry.js +1 -1
- package/dist/cjs/shift-tab-content.cjs.entry.js +1 -1
- package/dist/cjs/shift-tabs_2.cjs.entry.js +2 -2
- package/dist/cjs/ssc-lookup-form.cjs.entry.js +11 -9
- package/dist/cjs/state-object-DFBHdqbr.js +172 -0
- package/dist/cjs/test-drive-form.cjs.entry.js +11 -9
- package/dist/cjs/{type-BqNpIYcE.js → type-BSH0OxyO.js} +3 -3
- package/dist/cjs/{type-B8LchmnL.js → type-BvWomz0N.js} +2 -2
- package/dist/cjs/{type-BrzZ5GMr.js → type-NRLY9OsL.js} +9 -9
- package/dist/cjs/{get-local-language-CMptyFxH.js → types-B3WMBBhs.js} +4 -187
- package/dist/cjs/validation-BxmICJwK.js +89 -0
- package/dist/cjs/vehicle-accessories_7.cjs.entry.js +18 -17
- package/dist/cjs/vehicle-lookup.cjs.entry.js +6 -5
- package/dist/cjs/vehicle-quotation-form.cjs.entry.js +15 -14
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/components/empty.css +1 -1
- package/dist/collection/components/components/flexible-container.css +1 -1
- package/dist/collection/components/components/information-table.css +1 -1
- package/dist/collection/components/components/loading-spinner.css +1 -1
- package/dist/collection/components/components/shift-tab-content.css +1 -1
- package/dist/collection/components/components/shift-tabs.css +1 -1
- package/dist/collection/components/form-elements/components/form-error-message.js +1 -1
- package/dist/collection/components/form-elements/form-checkbox.js +29 -4
- package/dist/collection/components/form-elements/form-input.js +30 -5
- package/dist/collection/components/form-elements/form-inputs.css +1 -1
- package/dist/collection/components/form-elements/form-phone-number.js +30 -5
- package/dist/collection/components/form-elements/form-picker-input.js +30 -5
- package/dist/collection/components/form-elements/form-select.js +30 -4
- package/dist/collection/components/form-elements/form-submit.js +31 -4
- package/dist/collection/components/form-elements/form-switch.js +29 -4
- package/dist/collection/components/form-elements/form-text-area.js +32 -6
- package/dist/collection/components/form-elements/form-vin-input.js +53 -9
- package/dist/collection/components/forms/defaults/mappers.js +58 -46
- package/dist/collection/components/forms/defaults/style.css +1 -1
- package/dist/collection/components/forms/defaults/validation.js +73 -75
- package/dist/collection/components/forms/general-inquiry.js +20 -20
- package/dist/collection/components/forms/service-booking.js +6 -7
- package/dist/collection/components/forms/ssc-lookup.js +6 -7
- package/dist/collection/components/forms/test-drive.js +6 -7
- package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-claimable-items.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-item-claim-form.js +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-paint-thickness.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-sale-information.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-service-history.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-specification.css +1 -1
- package/dist/collection/components/vehicle-lookup/vehicle-warranty-details.css +1 -1
- package/dist/collection/components/vin-extractor/vin-extractor.css +1 -1
- package/dist/collection/features/form-hook/functions.js +14 -10
- package/dist/collection/features/form-hook/inputs/form-input.js +19 -1
- package/dist/collection/features/form-hook/render-structure.js +1 -1
- package/dist/components/dead-stock-lookup.js +1 -1
- package/dist/components/distributor-lookup.js +1 -1
- package/dist/components/flexible-container.js +1 -1
- package/dist/components/form-checkbox.js +1 -1
- package/dist/components/form-date-picker.js +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-input.js +1 -1
- package/dist/components/form-phone-number.js +1 -1
- package/dist/components/form-picker-input.js +1 -1
- package/dist/components/form-select.js +1 -1
- package/dist/components/form-shadow-input.js +1 -1
- package/dist/components/form-structure-error.js +1 -1
- package/dist/components/form-structure.js +1 -1
- package/dist/components/form-submit.js +1 -1
- package/dist/components/form-switch.js +1 -1
- package/dist/components/form-text-area.js +1 -1
- package/dist/components/form-time-picker.js +1 -1
- package/dist/components/form-vin-input.js +1 -1
- package/dist/components/general-inquiry-form.js +1 -1
- package/dist/components/information-table.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/manufacturer-lookup.js +1 -1
- package/dist/components/manufacturer-part-lookup.js +1 -1
- package/dist/components/p--ZWu5kfe.js +5 -0
- package/dist/components/p-3o70TTPM.js +5 -0
- package/dist/components/p-9Jshpnf4.js +5 -0
- package/dist/components/{p-CwQEFAEF.js → p-B6mLLQ5Z.js} +1 -1
- package/dist/components/p-B6yxFkGn.js +5 -0
- package/dist/components/{p-CHdx52dw.js → p-BFvKdyvP.js} +1 -1
- package/dist/components/p-BMqwfA7R.js +5 -0
- package/dist/components/p-BNfiYxny.js +5 -0
- package/dist/components/{p-BsFKuBtC.js → p-BPtyEnCf.js} +1 -1
- package/dist/components/p-BW74FG6u.js +5 -0
- package/dist/components/p-Bau2XePf.js +5 -0
- package/dist/components/p-BnRsfejo.js +5 -0
- package/dist/components/p-BrEz2vz_.js +5 -0
- package/dist/components/p-C9lmL_jC.js +5 -0
- package/dist/components/p-CD_2-fK9.js +5 -0
- package/dist/components/{p-CRhdQvF0.js → p-CGKHe5aV.js} +1 -1
- package/dist/components/p-CL_w2QQD.js +5 -0
- package/dist/components/p-CTnFqaoj.js +5 -0
- package/dist/components/{p-D930Q75B.js → p-ChgSU1Ua.js} +1 -1
- package/dist/components/{p-DqNmAqS_.js → p-CiwfnrB-.js} +1 -1
- package/dist/components/p-Crd-9v2B.js +5 -0
- package/dist/components/{p-CBXAxKky.js → p-Cu6cHcY1.js} +1 -1
- package/dist/components/p-CzffKzcR.js +5 -0
- package/dist/components/{p-7y7dFWS-.js → p-D39ljWpy.js} +1 -1
- package/dist/components/p-DLBJDU-Z.js +5 -0
- package/dist/components/p-DVOFEN__.js +5 -0
- package/dist/components/p-DW9tnza0.js +5 -0
- package/dist/components/p-DXV8vbHa.js +5 -0
- package/dist/components/{p-B_QEyJOO.js → p-DYUVoVJU.js} +1 -1
- package/dist/components/p-Dbq3Z3a7.js +5 -0
- package/dist/components/p-DodX8HCB.js +5 -0
- package/dist/components/p-Dq5EPmKC.js +5 -0
- package/dist/components/{p-DJaWpqrV.js → p-DvwR_CeT.js} +1 -1
- package/dist/components/p-GjSy7W7d.js +5 -0
- package/dist/components/p-KrwBOds5.js +5 -0
- package/dist/components/p-VJzNTmbc.js +5 -0
- package/dist/components/p-to4xqGcM.js +5 -0
- package/dist/components/p-vJNV_Y5G.js +5 -0
- package/dist/components/part-lookup.js +1 -1
- package/dist/components/service-booking-form.js +1 -1
- package/dist/components/shift-accordion.js +1 -1
- package/dist/components/shift-checkbox.js +1 -1
- package/dist/components/shift-slider.js +1 -1
- package/dist/components/shift-switch.js +1 -1
- package/dist/components/shift-tab-content.js +1 -1
- package/dist/components/shift-tabs.js +1 -1
- package/dist/components/ssc-lookup-form.js +1 -1
- package/dist/components/test-drive-form.js +1 -1
- package/dist/components/vehicle-accessories.js +1 -1
- package/dist/components/vehicle-claimable-items.js +1 -1
- package/dist/components/vehicle-item-claim-form.js +1 -1
- package/dist/components/vehicle-lookup.js +1 -1
- package/dist/components/vehicle-paint-thickness.js +1 -1
- package/dist/components/vehicle-quotation-form.js +1 -1
- package/dist/components/vehicle-sale-information.js +1 -1
- package/dist/components/vehicle-service-history.js +1 -1
- package/dist/components/vehicle-specification.js +1 -1
- package/dist/components/vehicle-warranty-details.js +1 -1
- package/dist/components/vin-extractor.js +1 -1
- package/dist/esm/dead-stock-lookup_3.entry.js +4 -3
- package/dist/esm/flexible-container.entry.js +1 -1
- package/dist/esm/form-checkbox.entry.js +9 -5
- package/dist/esm/form-date-picker.entry.js +2 -2
- package/dist/esm/form-dialog_8.entry.js +37 -33
- package/dist/esm/{form-error-message-BRYZJjPy.js → form-error-message-C4gzgw8C.js} +1 -1
- package/dist/esm/form-input-DRd-doY1.js +22 -0
- package/dist/esm/form-input_4.entry.js +24 -18
- package/dist/esm/form-switch.entry.js +9 -5
- package/dist/esm/form-time-picker.entry.js +2 -2
- package/dist/esm/general-inquiry-form.entry.js +24 -22
- package/dist/esm/get-local-language-DJl5eWCY.js +189 -0
- package/dist/esm/information-table.entry.js +1 -1
- package/dist/esm/{loader-icon-DhBPTC5g.js → loader-icon-DUMSCofl.js} +1150 -263
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-spinner.entry.js +1 -1
- package/dist/esm/manufacturer-part-lookup.entry.js +3 -2
- package/dist/esm/part-lookup.entry.js +4 -3
- package/dist/esm/service-booking-form.entry.js +11 -9
- package/dist/esm/shift-checkbox.entry.js +1 -1
- package/dist/esm/shift-components.js +1 -1
- package/dist/esm/shift-switch.entry.js +1 -1
- package/dist/esm/shift-tab-content.entry.js +1 -1
- package/dist/esm/shift-tabs_2.entry.js +2 -2
- package/dist/esm/ssc-lookup-form.entry.js +10 -8
- package/dist/esm/state-object-D7JLK2vI.js +169 -0
- package/dist/esm/test-drive-form.entry.js +10 -8
- package/dist/esm/{type-BluG_k1P.js → type-BJF9x4jt.js} +1 -1
- package/dist/esm/{type-D_rpjbuj.js → type-TpJOuSTQ.js} +1 -1
- package/dist/esm/{type-zroDKO0U.js → type-r4cI4JJY.js} +1 -1
- package/dist/esm/{get-local-language-CCj6E27L.js → types-Cn7YOi83.js} +1 -184
- package/dist/esm/validation-BsxDkThF.js +86 -0
- package/dist/esm/vehicle-accessories_7.entry.js +10 -9
- package/dist/esm/vehicle-lookup.entry.js +4 -3
- package/dist/esm/vehicle-quotation-form.entry.js +3 -2
- package/dist/shift-components/{p-d7da1152.entry.js → p-16e95508.entry.js} +1 -1
- package/dist/shift-components/{p-2fe3538e.entry.js → p-2c9950cc.entry.js} +1 -1
- package/dist/shift-components/p-380144df.entry.js +5 -0
- package/dist/shift-components/p-3853ea20.entry.js +5 -0
- package/dist/shift-components/{p-0e630c66.entry.js → p-3a91a272.entry.js} +1 -1
- package/dist/shift-components/{p-b4231e50.entry.js → p-5b587a6a.entry.js} +1 -1
- package/dist/shift-components/p-694d921f.entry.js +5 -0
- package/dist/shift-components/p-8a97341b.entry.js +5 -0
- package/dist/shift-components/p-8e6d183e.entry.js +5 -0
- package/dist/shift-components/p-98b10e49.entry.js +5 -0
- package/dist/shift-components/p-B-Ttz-dC.js +5 -0
- package/dist/shift-components/p-BUbNT08a.js +5 -0
- package/dist/shift-components/p-B_8bnsuC.js +5 -0
- package/dist/shift-components/{p-Bfkguwb-.js → p-B_HWC4v3.js} +1 -1
- package/dist/shift-components/p-Cn7YOi83.js +5 -0
- package/dist/shift-components/{p-B-8v_CQL.js → p-CpygzMlx.js} +1 -1
- package/dist/shift-components/p-DDiSIFiM.js +5 -0
- package/dist/shift-components/p-a9ee64a7.entry.js +5 -0
- package/dist/shift-components/p-aa72cb3d.entry.js +5 -0
- package/dist/shift-components/p-aae6a6e7.entry.js +5 -0
- package/dist/shift-components/p-bea5d49e.entry.js +5 -0
- package/dist/shift-components/p-c61723de.entry.js +5 -0
- package/dist/shift-components/p-cb348218.entry.js +5 -0
- package/dist/shift-components/{p-0a728fec.entry.js → p-d09cd43d.entry.js} +1 -1
- package/dist/shift-components/p-d1543879.entry.js +5 -0
- package/dist/shift-components/{p-f4914abc.entry.js → p-d7bb6f3a.entry.js} +1 -1
- package/dist/shift-components/{p-BW6seqLB.js → p-det1AUh4.js} +1 -1
- package/dist/shift-components/p-e4b69987.entry.js +5 -0
- package/dist/shift-components/p-eed5e111.entry.js +5 -0
- package/dist/shift-components/p-fd48f8b4.entry.js +5 -0
- package/dist/shift-components/p-fd626a4f.entry.js +5 -0
- package/dist/shift-components/{p-BK4ZcuiW.js → p-gokv-pzN.js} +1 -1
- package/dist/shift-components/p-nfwRLPgJ.js +5 -0
- package/dist/shift-components/shift-components.esm.js +1 -1
- package/dist/types/components/form-elements/form-checkbox.d.ts +2 -1
- package/dist/types/components/form-elements/form-input.d.ts +2 -0
- package/dist/types/components/form-elements/form-phone-number.d.ts +2 -1
- package/dist/types/components/form-elements/form-picker-input.d.ts +2 -0
- package/dist/types/components/form-elements/form-select.d.ts +2 -1
- package/dist/types/components/form-elements/form-submit.d.ts +2 -1
- package/dist/types/components/form-elements/form-switch.d.ts +2 -1
- package/dist/types/components/form-elements/form-text-area.d.ts +2 -1
- package/dist/types/components/form-elements/form-vin-input.d.ts +5 -0
- package/dist/types/components/forms/defaults/mappers.d.ts +7 -5
- package/dist/types/components/forms/defaults/validation.d.ts +29 -12
- package/dist/types/components.d.ts +76 -2
- package/dist/types/features/form-hook/inputs/form-input.d.ts +13 -0
- package/dist/types/features/form-hook/inputs/form-select.d.ts +2 -0
- package/dist/types/locales/vehicleLookup/claimableItems/type.d.ts +4 -4
- package/dist/types/locales/vehicleLookup/serviceHistory/type.d.ts +2 -2
- package/dist/types/locales/vehicleLookup/wrapper-type.d.ts +4 -4
- package/package.json +1 -1
- package/dist/cjs/state-object-B_0-oj8G.js +0 -243
- package/dist/collection/components/forms/service-booking/element-mapper.js +0 -134
- package/dist/collection/components/forms/service-booking/validations.js +0 -56
- package/dist/components/p-3WjYFbnU.js +0 -5
- package/dist/components/p-64G0Y_tC.js +0 -5
- package/dist/components/p-BEClgvwe.js +0 -5
- package/dist/components/p-BTqv9A1K.js +0 -5
- package/dist/components/p-Bd2-gh8M.js +0 -5
- package/dist/components/p-BffBGA_K.js +0 -5
- package/dist/components/p-Bon4whdT.js +0 -5
- package/dist/components/p-C-4CT4ZF.js +0 -5
- package/dist/components/p-C6WhIy7O.js +0 -5
- package/dist/components/p-CEM5EBP0.js +0 -5
- package/dist/components/p-Cxfsh87m.js +0 -5
- package/dist/components/p-D-tlRZMk.js +0 -5
- package/dist/components/p-DA0taq65.js +0 -5
- package/dist/components/p-DJKERvsE.js +0 -5
- package/dist/components/p-DNn44A0I.js +0 -5
- package/dist/components/p-DdWYx3mw.js +0 -5
- package/dist/components/p-Df56BNKV.js +0 -5
- package/dist/components/p-DjDUhW2q.js +0 -5
- package/dist/components/p-DkA_i--O.js +0 -5
- package/dist/components/p-DuNp8sSh.js +0 -5
- package/dist/components/p-NEl9bwNq.js +0 -5
- package/dist/components/p-RInF2GNQ.js +0 -5
- package/dist/components/p-_C-vBKCe.js +0 -5
- package/dist/components/p-eTLWmtnI.js +0 -5
- package/dist/components/p-vEsQVFLN.js +0 -5
- package/dist/components/p-zofQKKfh.js +0 -5
- package/dist/esm/state-object-Cwph5K2Q.js +0 -238
- package/dist/shift-components/p-0f83786b.entry.js +0 -5
- package/dist/shift-components/p-1c93d5e6.entry.js +0 -5
- package/dist/shift-components/p-26f3e6da.entry.js +0 -5
- package/dist/shift-components/p-3a7196d4.entry.js +0 -5
- package/dist/shift-components/p-45670df9.entry.js +0 -5
- package/dist/shift-components/p-4aa6f707.entry.js +0 -5
- package/dist/shift-components/p-50fd9d29.entry.js +0 -5
- package/dist/shift-components/p-63e1e80e.entry.js +0 -5
- package/dist/shift-components/p-67476178.entry.js +0 -5
- package/dist/shift-components/p-683f3ab3.entry.js +0 -5
- package/dist/shift-components/p-8700e868.entry.js +0 -5
- package/dist/shift-components/p-90a6803f.entry.js +0 -5
- package/dist/shift-components/p-BVMG8UaH.js +0 -5
- package/dist/shift-components/p-BnQp2Q8E.js +0 -5
- package/dist/shift-components/p-C3YLTa2J.js +0 -5
- package/dist/shift-components/p-c7eaf245.entry.js +0 -5
- package/dist/shift-components/p-f7692371.entry.js +0 -5
- package/dist/shift-components/p-f8ac59ee.entry.js +0 -5
- package/dist/shift-components/p-fac0fdb9.entry.js +0 -5
- package/dist/shift-components/p-fe02d5ed.entry.js +0 -5
- package/dist/types/components/forms/service-booking/element-mapper.d.ts +0 -7
- package/dist/types/components/forms/service-booking/validations.d.ts +0 -25
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Copyright (c)
|
|
4
4
|
*/
|
|
5
5
|
import { F as FormHook } from './get-language-from-url-DS2wH9wf.js';
|
|
6
|
-
import
|
|
6
|
+
import './types-Cn7YOi83.js';
|
|
7
|
+
import { b as getSharedFormLocal } from './get-local-language-DJl5eWCY.js';
|
|
7
8
|
import { d as dateFnsExports } from './index-BILW0yP6.js';
|
|
8
9
|
import { h } from './index-Bf4Ol6Qt.js';
|
|
9
10
|
|
|
@@ -57,208 +58,20 @@ async function fetchJson(url) {
|
|
|
57
58
|
return data;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
const formLanguageChange = async (formContext, newLanguage) => {
|
|
61
|
-
var _a, _b, _c, _d, _e;
|
|
62
|
-
const sharedLocales = await getSharedFormLocal(newLanguage);
|
|
63
|
-
const LS = (_b = (_a = formContext.structure) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.localization;
|
|
64
|
-
const structureLocalization = typeof LS === 'object' ? ((_d = (_c = LS === null || LS === void 0 ? void 0 : LS[newLanguage]) !== null && _c !== void 0 ? _c : LS === null || LS === void 0 ? void 0 : LS.en) !== null && _d !== void 0 ? _d : {}) : {};
|
|
65
|
-
formContext.locale = Object.assign(Object.assign({}, structureLocalization), { sharedFormLocales: Object.assign(Object.assign({}, sharedLocales), structureLocalization === null || structureLocalization === void 0 ? void 0 : structureLocalization.sharedFormLocales) });
|
|
66
|
-
formContext.localeLanguage = newLanguage;
|
|
67
|
-
(_e = formContext.form) === null || _e === void 0 ? void 0 : _e.rerender({ rerenderAll: true });
|
|
68
|
-
};
|
|
69
|
-
const formErrorHandler = async (formContext, error) => {
|
|
70
|
-
var _a, _b, _c;
|
|
71
|
-
const message = error.message || ((_c = (_b = (_a = formContext.locale) === null || _a === void 0 ? void 0 : _a.sharedFormLocales) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c.wildCard) || '';
|
|
72
|
-
if (formContext === null || formContext === void 0 ? void 0 : formContext.errorCallback)
|
|
73
|
-
formContext.errorCallback(error, message);
|
|
74
|
-
else
|
|
75
|
-
formContext.errorMessage = message;
|
|
76
|
-
};
|
|
77
|
-
const formLoadingHandler = async (formContext, isLoading) => {
|
|
78
|
-
formContext.isLoading = isLoading;
|
|
79
|
-
if (formContext.loadingChanges)
|
|
80
|
-
formContext.loadingChanges(isLoading);
|
|
81
|
-
};
|
|
82
|
-
const formSuccessHandler = async (formContext, data) => {
|
|
83
|
-
if (formContext.successCallback)
|
|
84
|
-
formContext.successCallback(data, formContext.locale['Form submitted successfully.'] || '');
|
|
85
|
-
else
|
|
86
|
-
formContext.form.openDialog();
|
|
87
|
-
if (!formContext.disableScrollToTop) {
|
|
88
|
-
const formDom = formContext.el.shadowRoot || formContext.el;
|
|
89
|
-
let targetElement = formDom instanceof ShadowRoot ? formDom.firstElementChild : formDom;
|
|
90
|
-
const yOffset = -100;
|
|
91
|
-
const y = targetElement.getBoundingClientRect().top + window.pageYOffset + yOffset;
|
|
92
|
-
window.scrollTo({ top: Math.max(y, 0), behavior: 'smooth' });
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const formDidLoadHandler = async (formContext, validator) => {
|
|
96
|
-
var _a, _b;
|
|
97
|
-
if (!formContext.structure) {
|
|
98
|
-
if (formContext.gistId) {
|
|
99
|
-
const [newGistStructure] = await Promise.all([gistLoader(formContext.gistId), formContext.changeLanguage(formContext.language)]);
|
|
100
|
-
formContext.structure = newGistStructure;
|
|
101
|
-
}
|
|
102
|
-
else if (formContext.structureUrl) {
|
|
103
|
-
const [newGistStructure] = await Promise.all([fetchJson(formContext.structureUrl), formContext.changeLanguage(formContext.language)]);
|
|
104
|
-
formContext.structure = newGistStructure;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
formContext.localeLanguage = formContext.language;
|
|
108
|
-
await formContext.changeLanguage(formContext.language);
|
|
109
|
-
if (!formContext.isMobileForm) {
|
|
110
|
-
try {
|
|
111
|
-
const key = (_b = (_a = formContext.structure) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.recaptchaKey;
|
|
112
|
-
if (key) {
|
|
113
|
-
const script = document.createElement('script');
|
|
114
|
-
script.src = `https://www.google.com/recaptcha/api.js?render=${key}&hl=${formContext.language}`;
|
|
115
|
-
script.async = true;
|
|
116
|
-
script.defer = true;
|
|
117
|
-
document.head.appendChild(script);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
catch (error) {
|
|
121
|
-
console.log(error);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
formContext.form = new FormHook(formContext, validator);
|
|
125
|
-
};
|
|
126
|
-
const formGetFormHandler = async (formContext) => {
|
|
127
|
-
if (formContext.form)
|
|
128
|
-
return formContext.form;
|
|
129
|
-
};
|
|
130
|
-
const handleFormSubmit = async (formContext) => {
|
|
131
|
-
if (formContext.form)
|
|
132
|
-
return formContext.form.submit();
|
|
133
|
-
};
|
|
134
|
-
const formStructureRenderedHandler = async (formContext, isRendered) => {
|
|
135
|
-
var _a;
|
|
136
|
-
if (isRendered)
|
|
137
|
-
(_a = formContext.formReadyCallback) === null || _a === void 0 ? void 0 : _a.call(formContext);
|
|
138
|
-
};
|
|
139
|
-
const onFormSubmit = async ({ context, formValues, middleware, afterSuccess }) => {
|
|
140
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
141
|
-
try {
|
|
142
|
-
context.setIsLoading(true);
|
|
143
|
-
Object.keys(formValues).forEach(key => {
|
|
144
|
-
if (context[`${key}-format`]) {
|
|
145
|
-
formValues[key] = context[`${key}-format`];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
const hasAdditionalData = !!((_b = (_a = context.structure) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.truncatedFields) && !!((_e = Object.keys((_d = (_c = context.structure) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.truncatedFields)) === null || _e === void 0 ? void 0 : _e.length);
|
|
149
|
-
let additionalData = {};
|
|
150
|
-
let payload = Object.assign({}, formValues);
|
|
151
|
-
if ((_g = (_f = context.structure) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.extraPayload)
|
|
152
|
-
payload = Object.assign(Object.assign({}, payload), (_j = (_h = context.structure) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.extraPayload);
|
|
153
|
-
if (hasAdditionalData)
|
|
154
|
-
payload.additionalData = additionalData;
|
|
155
|
-
if (!!(context === null || context === void 0 ? void 0 : context.extraPayload))
|
|
156
|
-
payload = Object.assign(Object.assign({}, payload), context === null || context === void 0 ? void 0 : context.extraPayload);
|
|
157
|
-
if (hasAdditionalData) {
|
|
158
|
-
Object.entries((_l = (_k = context.structure) === null || _k === void 0 ? void 0 : _k.data) === null || _l === void 0 ? void 0 : _l.truncatedFields).forEach(([oldKey, truncateValue]) => {
|
|
159
|
-
if (Array.isArray(truncateValue)) {
|
|
160
|
-
let constructNewValue = '';
|
|
161
|
-
truncateValue.forEach(key => {
|
|
162
|
-
constructNewValue += payload[key.toString()] || key.toString();
|
|
163
|
-
});
|
|
164
|
-
payload = Object.assign(Object.assign({}, payload), { [oldKey]: constructNewValue });
|
|
165
|
-
}
|
|
166
|
-
else if (typeof truncateValue === 'string' && truncateValue) {
|
|
167
|
-
if (oldKey.startsWith('parse date: ')) {
|
|
168
|
-
let tempKey = oldKey.replaceAll('parse date: ', '');
|
|
169
|
-
payload[tempKey] = dateFnsExports.parse(payload[tempKey], truncateValue, new Date());
|
|
170
|
-
}
|
|
171
|
-
else if (oldKey.startsWith('format date: ')) {
|
|
172
|
-
let tempKey = oldKey.replaceAll('format date: ', '');
|
|
173
|
-
payload[tempKey] = dateFnsExports.formatISO(payload[tempKey]);
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
additionalData[truncateValue] = payload[oldKey];
|
|
177
|
-
delete payload[oldKey];
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
let header = {
|
|
183
|
-
'Content-Type': 'application/json',
|
|
184
|
-
'Accept-Language': context.localeLanguage || 'en',
|
|
185
|
-
};
|
|
186
|
-
if (!!(context === null || context === void 0 ? void 0 : context.extraHeader))
|
|
187
|
-
header = Object.assign(Object.assign({}, header), context === null || context === void 0 ? void 0 : context.extraHeader);
|
|
188
|
-
if (!!((_o = (_m = context.structure) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.extraHeader))
|
|
189
|
-
header = Object.assign(Object.assign({}, header), (_q = (_p = context.structure) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q.extraHeader);
|
|
190
|
-
let requestEndpoint = '';
|
|
191
|
-
if (context.isMobileForm) {
|
|
192
|
-
const token = await context.getMobileToken();
|
|
193
|
-
if (token.toLowerCase().startsWith('bearer')) {
|
|
194
|
-
header['Authorization'] = token;
|
|
195
|
-
requestEndpoint = (_s = (_r = context.structure) === null || _r === void 0 ? void 0 : _r.data) === null || _s === void 0 ? void 0 : _s.requestAppUrl;
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
header['verification-token'] = token;
|
|
199
|
-
requestEndpoint = (_u = (_t = context.structure) === null || _t === void 0 ? void 0 : _t.data) === null || _u === void 0 ? void 0 : _u.requestAppCheckUrl;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
requestEndpoint = (_w = (_v = context.structure) === null || _v === void 0 ? void 0 : _v.data) === null || _w === void 0 ? void 0 : _w.requestUrl;
|
|
204
|
-
if ((_y = (_x = context.structure) === null || _x === void 0 ? void 0 : _x.data) === null || _y === void 0 ? void 0 : _y.recaptchaKey) {
|
|
205
|
-
const token = await grecaptcha.execute((_0 = (_z = context.structure) === null || _z === void 0 ? void 0 : _z.data) === null || _0 === void 0 ? void 0 : _0.recaptchaKey, { action: 'submit' });
|
|
206
|
-
header['Recaptcha-Token'] = token;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
if (context.isDev)
|
|
210
|
-
requestEndpoint = requestEndpoint.replaceAll('production=true', 'production=false');
|
|
211
|
-
if (!requestEndpoint) {
|
|
212
|
-
throw new Error('Request endpoint is not configured');
|
|
213
|
-
}
|
|
214
|
-
if (middleware) {
|
|
215
|
-
const middlewareRes = middleware(payload, header, requestEndpoint);
|
|
216
|
-
payload = Object.assign({}, middlewareRes.payload);
|
|
217
|
-
header = Object.assign({}, middlewareRes.header);
|
|
218
|
-
requestEndpoint = middlewareRes.url;
|
|
219
|
-
}
|
|
220
|
-
const response = await fetch(requestEndpoint, Object.assign({ headers: header, method: ((_2 = (_1 = context.structure) === null || _1 === void 0 ? void 0 : _1.data) === null || _2 === void 0 ? void 0 : _2.requestMethod) || 'POST' }, (((_5 = (_4 = (_3 = context.structure) === null || _3 === void 0 ? void 0 : _3.data) === null || _4 === void 0 ? void 0 : _4.requestMethod) === null || _5 === void 0 ? void 0 : _5.toLowerCase()) === 'get' ? {} : { body: JSON.stringify(payload) })));
|
|
221
|
-
if (response.ok) {
|
|
222
|
-
const result = await (response === null || response === void 0 ? void 0 : response.json());
|
|
223
|
-
if (afterSuccess)
|
|
224
|
-
await afterSuccess(payload, header);
|
|
225
|
-
context.setSuccessCallback(result);
|
|
226
|
-
setTimeout(() => {
|
|
227
|
-
context.form.reset();
|
|
228
|
-
context.form.rerender({ rerenderForm: true, rerenderAll: true });
|
|
229
|
-
}, 100);
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
const contentType = response.headers.get('content-type');
|
|
233
|
-
const errorText = (contentType === null || contentType === void 0 ? void 0 : contentType.includes('application/json')) ? (_7 = (_6 = (await response.json())) === null || _6 === void 0 ? void 0 : _6.message) === null || _7 === void 0 ? void 0 : _7.body : await response.text();
|
|
234
|
-
throw new Error(errorText);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
catch (error) {
|
|
238
|
-
console.error(error);
|
|
239
|
-
context.setErrorCallback(error);
|
|
240
|
-
}
|
|
241
|
-
finally {
|
|
242
|
-
context.setIsLoading(false);
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
const functionHooks = {
|
|
246
|
-
formLanguageChange,
|
|
247
|
-
formErrorHandler,
|
|
248
|
-
handleFormSubmit,
|
|
249
|
-
formLoadingHandler,
|
|
250
|
-
formSuccessHandler,
|
|
251
|
-
formDidLoadHandler,
|
|
252
|
-
formGetFormHandler,
|
|
253
|
-
onFormSubmit,
|
|
254
|
-
formStructureRenderedHandler,
|
|
255
|
-
};
|
|
256
|
-
|
|
257
61
|
// This file is a workaround for a bug in web browsers' "native"
|
|
258
62
|
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
259
63
|
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
260
64
|
var metadata = {"version":4,"country_calling_codes":{"1":["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],"7":["RU","KZ"],"20":["EG"],"27":["ZA"],"30":["GR"],"31":["NL"],"32":["BE"],"33":["FR"],"34":["ES"],"36":["HU"],"39":["IT","VA"],"40":["RO"],"41":["CH"],"43":["AT"],"44":["GB","GG","IM","JE"],"45":["DK"],"46":["SE"],"47":["NO","SJ"],"48":["PL"],"49":["DE"],"51":["PE"],"52":["MX"],"53":["CU"],"54":["AR"],"55":["BR"],"56":["CL"],"57":["CO"],"58":["VE"],"60":["MY"],"61":["AU","CC","CX"],"62":["ID"],"63":["PH"],"64":["NZ"],"65":["SG"],"66":["TH"],"81":["JP"],"82":["KR"],"84":["VN"],"86":["CN"],"90":["TR"],"91":["IN"],"92":["PK"],"93":["AF"],"94":["LK"],"95":["MM"],"98":["IR"],"211":["SS"],"212":["MA","EH"],"213":["DZ"],"216":["TN"],"218":["LY"],"220":["GM"],"221":["SN"],"222":["MR"],"223":["ML"],"224":["GN"],"225":["CI"],"226":["BF"],"227":["NE"],"228":["TG"],"229":["BJ"],"230":["MU"],"231":["LR"],"232":["SL"],"233":["GH"],"234":["NG"],"235":["TD"],"236":["CF"],"237":["CM"],"238":["CV"],"239":["ST"],"240":["GQ"],"241":["GA"],"242":["CG"],"243":["CD"],"244":["AO"],"245":["GW"],"246":["IO"],"247":["AC"],"248":["SC"],"249":["SD"],"250":["RW"],"251":["ET"],"252":["SO"],"253":["DJ"],"254":["KE"],"255":["TZ"],"256":["UG"],"257":["BI"],"258":["MZ"],"260":["ZM"],"261":["MG"],"262":["RE","YT"],"263":["ZW"],"264":["NA"],"265":["MW"],"266":["LS"],"267":["BW"],"268":["SZ"],"269":["KM"],"290":["SH","TA"],"291":["ER"],"297":["AW"],"298":["FO"],"299":["GL"],"350":["GI"],"351":["PT"],"352":["LU"],"353":["IE"],"354":["IS"],"355":["AL"],"356":["MT"],"357":["CY"],"358":["FI","AX"],"359":["BG"],"370":["LT"],"371":["LV"],"372":["EE"],"373":["MD"],"374":["AM"],"375":["BY"],"376":["AD"],"377":["MC"],"378":["SM"],"380":["UA"],"381":["RS"],"382":["ME"],"383":["XK"],"385":["HR"],"386":["SI"],"387":["BA"],"389":["MK"],"420":["CZ"],"421":["SK"],"423":["LI"],"500":["FK"],"501":["BZ"],"502":["GT"],"503":["SV"],"504":["HN"],"505":["NI"],"506":["CR"],"507":["PA"],"508":["PM"],"509":["HT"],"590":["GP","BL","MF"],"591":["BO"],"592":["GY"],"593":["EC"],"594":["GF"],"595":["PY"],"596":["MQ"],"597":["SR"],"598":["UY"],"599":["CW","BQ"],"670":["TL"],"672":["NF"],"673":["BN"],"674":["NR"],"675":["PG"],"676":["TO"],"677":["SB"],"678":["VU"],"679":["FJ"],"680":["PW"],"681":["WF"],"682":["CK"],"683":["NU"],"685":["WS"],"686":["KI"],"687":["NC"],"688":["TV"],"689":["PF"],"690":["TK"],"691":["FM"],"692":["MH"],"850":["KP"],"852":["HK"],"853":["MO"],"855":["KH"],"856":["LA"],"880":["BD"],"886":["TW"],"960":["MV"],"961":["LB"],"962":["JO"],"963":["SY"],"964":["IQ"],"965":["KW"],"966":["SA"],"967":["YE"],"968":["OM"],"970":["PS"],"971":["AE"],"972":["IL"],"973":["BH"],"974":["QA"],"975":["BT"],"976":["MN"],"977":["NP"],"992":["TJ"],"993":["TM"],"994":["AZ"],"995":["GE"],"996":["KG"],"998":["UZ"]},"countries":{"AC":["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],"AD":["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],"AE":["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],"AF":["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],"AG":["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],"AI":["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],"AL":["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],"AM":["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],"AO":["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],"AR":["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],"AS":["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],"AT":["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],"AU":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],"AW":["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],"AX":["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],"AZ":["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],"BA":["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],"BB":["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],"BD":["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],"BE":["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],"BF":["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],"BG":["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],"BH":["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],"BI":["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],"BJ":["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],"BL":["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],"BM":["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],"BN":["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],"BO":["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],"BQ":["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],"BR":["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],"BS":["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],"BT":["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],"BW":["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],"BY":["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],"BZ":["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],"CA":["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],"CC":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],"CD":["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],"CF":["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],"CG":["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],"CH":["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],"CI":["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],"CK":["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],"CL":["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],"CM":["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],"CN":["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],"CO":["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],"CR":["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],"CU":["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],"CV":["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],"CW":["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],"CX":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],"CY":["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],"CZ":["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],"DE":["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],"DJ":["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],"DK":["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],"DM":["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],"DO":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],"DZ":["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],"EC":["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],"EE":["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],"EG":["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],"EH":["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],"ER":["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],"ES":["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],"ET":["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],"FI":["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],"FJ":["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],"FK":["500","00","[2-7]\\d{4}",[5]],"FM":["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],"FO":["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],"FR":["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],"GA":["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],"GB":["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],"GD":["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],"GE":["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],"GF":["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],"GG":["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],"GH":["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],"GI":["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],"GL":["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],"GM":["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"GN":["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],"GP":["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],"GQ":["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],"GR":["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],"GT":["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],"GU":["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],"GW":["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],"GY":["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"HK":["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],"HN":["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],"HR":["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],"HT":["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],"HU":["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],"ID":["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],"IE":["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"IL":["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],"IM":["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],"IN":["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],"IO":["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],"IQ":["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],"IR":["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],"IS":["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],"IT":["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],"JE":["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],"JM":["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],"JO":["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],"JP":["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],"KE":["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],"KG":["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"KH":["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"KI":["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],"KM":["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],"KN":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],"KP":["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],"KR":["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],"KW":["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],"KY":["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],"KZ":["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",0,"8~10"],"LA":["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],"LB":["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],"LC":["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],"LI":["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],"LK":["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],"LR":["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],"LS":["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],"LT":["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],"LU":["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],"LV":["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],"LY":["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],"MA":["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:[19]|2[2-46-9]|3[3-9])|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],"MC":["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],"MD":["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],"ME":["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],"MF":["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],"MG":["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],"MH":["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],"MK":["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],"ML":["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],"MM":["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],"MN":["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],"MO":["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],"MP":["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],"MQ":["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"MR":["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],"MS":["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],"MT":["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],"MU":["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],"MV":["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],"MW":["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],"MX":["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],"MY":["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],"MZ":["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],"NA":["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],"NC":["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],"NE":["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],"NF":["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],"NG":["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],"NI":["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],"NL":["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],"NO":["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],"NP":["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],"NR":["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],"NU":["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],"NZ":["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],"OM":["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],"PA":["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],"PE":["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],"PF":["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],"PG":["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],"PH":["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],"PK":["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],"PL":["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],"PM":["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"PR":["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],"PS":["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"PT":["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],"PW":["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"PY":["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],"QA":["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],"RE":["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],"RO":["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],"RS":["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],"RU":["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],"RW":["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],"SA":["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],"SB":["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],"SC":["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],"SD":["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],"SE":["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],"SG":["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],"SH":["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],"SI":["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],"SJ":["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],"SK":["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],"SL":["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],"SM":["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],"SN":["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],"SO":["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],"SR":["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],"SS":["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],"ST":["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],"SV":["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],"SX":["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],"SY":["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],"SZ":["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],"TA":["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],"TC":["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],"TD":["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],"TG":["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],"TH":["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"TJ":["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],"TK":["690","00","[2-47]\\d{3,6}",[4,5,6,7]],"TL":["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],"TM":["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],"TN":["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],"TO":["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],"TR":["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],"TT":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],"TV":["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],"TW":["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],"TZ":["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],"UA":["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],"UG":["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],"US":["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],"UY":["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],"UZ":["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],"VA":["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],"VC":["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],"VE":["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],"VG":["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],"VI":["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],"VN":["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],"VU":["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],"WF":["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],"WS":["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],"XK":["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],"YE":["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],"YT":["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],"ZA":["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],"ZM":["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],"ZW":["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},"nonGeographic":{"800":["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],"808":["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],"870":["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],"878":["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],"881":["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],"882":["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],"883":["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],"888":["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],"979":["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};
|
|
261
65
|
|
|
66
|
+
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
67
|
+
// importing system which is even uncapable of importing "*.json" files.
|
|
68
|
+
|
|
69
|
+
function withMetadataArgument(func, _arguments) {
|
|
70
|
+
var args = Array.prototype.slice.call(_arguments);
|
|
71
|
+
args.push(metadata);
|
|
72
|
+
return func.apply(this, args)
|
|
73
|
+
}
|
|
74
|
+
|
|
262
75
|
// Copy-pasted from:
|
|
263
76
|
// https://github.com/substack/semver-compare/blob/master/index.js
|
|
264
77
|
//
|
|
@@ -291,12 +104,12 @@ function isObject(object) {
|
|
|
291
104
|
return object !== undefined && object !== null && object.constructor === objectConstructor;
|
|
292
105
|
}
|
|
293
106
|
|
|
294
|
-
function _typeof$
|
|
295
|
-
function _classCallCheck$
|
|
296
|
-
function _defineProperties$7(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$
|
|
297
|
-
function _createClass$
|
|
298
|
-
function _toPropertyKey$
|
|
299
|
-
function _toPrimitive$
|
|
107
|
+
function _typeof$c(o) { "@babel/helpers - typeof"; return _typeof$c = "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$c(o); }
|
|
108
|
+
function _classCallCheck$8(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
109
|
+
function _defineProperties$7(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$b(o.key), o); } }
|
|
110
|
+
function _createClass$8(e, r, t) { return r && _defineProperties$7(e.prototype, r), Object.defineProperty(e, "prototype", { writable: false }), e; }
|
|
111
|
+
function _toPropertyKey$b(t) { var i = _toPrimitive$b(t, "string"); return "symbol" == _typeof$c(i) ? i : i + ""; }
|
|
112
|
+
function _toPrimitive$b(t, r) { if ("object" != _typeof$c(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$c(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return (String )(t); }
|
|
300
113
|
|
|
301
114
|
// Added "idd_prefix" and "default_idd_prefix".
|
|
302
115
|
var V3 = '1.2.0';
|
|
@@ -311,12 +124,12 @@ var CALLING_CODE_REG_EXP = /^\d+$/;
|
|
|
311
124
|
*/
|
|
312
125
|
var Metadata = /*#__PURE__*/function () {
|
|
313
126
|
function Metadata(metadata) {
|
|
314
|
-
_classCallCheck$
|
|
127
|
+
_classCallCheck$8(this, Metadata);
|
|
315
128
|
validateMetadata(metadata);
|
|
316
129
|
this.metadata = metadata;
|
|
317
130
|
setVersion.call(this, metadata);
|
|
318
131
|
}
|
|
319
|
-
return _createClass$
|
|
132
|
+
return _createClass$8(Metadata, [{
|
|
320
133
|
key: "getCountries",
|
|
321
134
|
value: function getCountries() {
|
|
322
135
|
return Object.keys(this.metadata.countries).filter(function (_) {
|
|
@@ -557,12 +370,12 @@ var Metadata = /*#__PURE__*/function () {
|
|
|
557
370
|
}();
|
|
558
371
|
var NumberingPlan = /*#__PURE__*/function () {
|
|
559
372
|
function NumberingPlan(metadata, globalMetadataObject) {
|
|
560
|
-
_classCallCheck$
|
|
373
|
+
_classCallCheck$8(this, NumberingPlan);
|
|
561
374
|
this.globalMetadataObject = globalMetadataObject;
|
|
562
375
|
this.metadata = metadata;
|
|
563
376
|
setVersion.call(this, globalMetadataObject.metadata);
|
|
564
377
|
}
|
|
565
|
-
return _createClass$
|
|
378
|
+
return _createClass$8(NumberingPlan, [{
|
|
566
379
|
key: "callingCode",
|
|
567
380
|
value: function callingCode() {
|
|
568
381
|
return this.metadata[0];
|
|
@@ -717,11 +530,11 @@ var NumberingPlan = /*#__PURE__*/function () {
|
|
|
717
530
|
}();
|
|
718
531
|
var Format = /*#__PURE__*/function () {
|
|
719
532
|
function Format(format, metadata) {
|
|
720
|
-
_classCallCheck$
|
|
533
|
+
_classCallCheck$8(this, Format);
|
|
721
534
|
this._format = format;
|
|
722
535
|
this.metadata = metadata;
|
|
723
536
|
}
|
|
724
|
-
return _createClass$
|
|
537
|
+
return _createClass$8(Format, [{
|
|
725
538
|
key: "pattern",
|
|
726
539
|
value: function pattern() {
|
|
727
540
|
return this._format[0];
|
|
@@ -785,11 +598,11 @@ var Format = /*#__PURE__*/function () {
|
|
|
785
598
|
var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
|
|
786
599
|
var Type = /*#__PURE__*/function () {
|
|
787
600
|
function Type(type, metadata) {
|
|
788
|
-
_classCallCheck$
|
|
601
|
+
_classCallCheck$8(this, Type);
|
|
789
602
|
this.type = type;
|
|
790
603
|
this.metadata = metadata;
|
|
791
604
|
}
|
|
792
|
-
return _createClass$
|
|
605
|
+
return _createClass$8(Type, [{
|
|
793
606
|
key: "pattern",
|
|
794
607
|
value: function pattern() {
|
|
795
608
|
if (this.metadata.v1) return this.type;
|
|
@@ -844,7 +657,7 @@ function validateMetadata(metadata) {
|
|
|
844
657
|
// so istanbul will show this as "branch not covered".
|
|
845
658
|
/* istanbul ignore next */
|
|
846
659
|
var typeOf = function typeOf(_) {
|
|
847
|
-
return _typeof$
|
|
660
|
+
return _typeof$c(_);
|
|
848
661
|
};
|
|
849
662
|
|
|
850
663
|
/**
|
|
@@ -864,6 +677,11 @@ function getCountryCallingCode(country, metadata) {
|
|
|
864
677
|
}
|
|
865
678
|
throw new Error("Unknown country: ".concat(country));
|
|
866
679
|
}
|
|
680
|
+
function isSupportedCountry(country, metadata) {
|
|
681
|
+
// metadata = new Metadata(metadata)
|
|
682
|
+
// return metadata.hasCountry(country)
|
|
683
|
+
return metadata.countries.hasOwnProperty(country);
|
|
684
|
+
}
|
|
867
685
|
function setVersion(metadata) {
|
|
868
686
|
var version = metadata.version;
|
|
869
687
|
if (typeof version === 'number') {
|
|
@@ -1054,9 +872,9 @@ function matchesEntirely(text, regularExpressionText) {
|
|
|
1054
872
|
return new RegExp('^(?:' + regularExpressionText + ')$').test(text);
|
|
1055
873
|
}
|
|
1056
874
|
|
|
1057
|
-
function _createForOfIteratorHelperLoose$
|
|
1058
|
-
function _unsupportedIterableToArray$
|
|
1059
|
-
function _arrayLikeToArray$
|
|
875
|
+
function _createForOfIteratorHelperLoose$6(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$9(r)) || e) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: true } : { done: false, 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."); }
|
|
876
|
+
function _unsupportedIterableToArray$9(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$9(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$9(r, a) : void 0; } }
|
|
877
|
+
function _arrayLikeToArray$9(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; }
|
|
1060
878
|
var NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL'];
|
|
1061
879
|
|
|
1062
880
|
// Finds out national phone number type (fixed line, mobile, etc)
|
|
@@ -1112,7 +930,7 @@ function getNumberType(input, options, metadata) {
|
|
|
1112
930
|
}
|
|
1113
931
|
return 'FIXED_LINE';
|
|
1114
932
|
}
|
|
1115
|
-
for (var _iterator = _createForOfIteratorHelperLoose$
|
|
933
|
+
for (var _iterator = _createForOfIteratorHelperLoose$6(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done;) {
|
|
1116
934
|
var type = _step.value;
|
|
1117
935
|
if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
|
|
1118
936
|
return type;
|
|
@@ -1216,6 +1034,11 @@ function couldNationalNumberBelongToCountry(nationalNumber, country, metadata) {
|
|
|
1216
1034
|
}
|
|
1217
1035
|
|
|
1218
1036
|
// The minimum length of the national significant number.
|
|
1037
|
+
var MIN_LENGTH_FOR_NSN = 2;
|
|
1038
|
+
|
|
1039
|
+
// The ITU says the maximum length should be 15,
|
|
1040
|
+
// but one can find longer numbers in Germany.
|
|
1041
|
+
var MAX_LENGTH_FOR_NSN = 17;
|
|
1219
1042
|
|
|
1220
1043
|
// The maximum length of the country calling code.
|
|
1221
1044
|
var MAX_LENGTH_COUNTRY_CODE = 3;
|
|
@@ -1370,9 +1193,9 @@ function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
|
|
|
1370
1193
|
};
|
|
1371
1194
|
}
|
|
1372
1195
|
|
|
1373
|
-
function _createForOfIteratorHelperLoose$
|
|
1374
|
-
function _unsupportedIterableToArray$
|
|
1375
|
-
function _arrayLikeToArray$
|
|
1196
|
+
function _createForOfIteratorHelperLoose$5(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$8(r)) || e) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: true } : { done: false, 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."); }
|
|
1197
|
+
function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$8(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$8(r, a) : void 0; } }
|
|
1198
|
+
function _arrayLikeToArray$8(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; }
|
|
1376
1199
|
|
|
1377
1200
|
// Returns the exact country that the `nationalPhoneNumber` belongs to
|
|
1378
1201
|
// in cases of ambiguity, i.e. when multiple countries share the same "country calling code".
|
|
@@ -1384,7 +1207,7 @@ function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
|
|
|
1384
1207
|
|
|
1385
1208
|
// const matchingCountries = []
|
|
1386
1209
|
|
|
1387
|
-
for (var _iterator = _createForOfIteratorHelperLoose$
|
|
1210
|
+
for (var _iterator = _createForOfIteratorHelperLoose$5(countries), _step; !(_step = _iterator()).done;) {
|
|
1388
1211
|
var country = _step.value;
|
|
1389
1212
|
metadata.selectNumberingPlan(country);
|
|
1390
1213
|
// "Leading digits" patterns are only defined for about 20% of all countries.
|
|
@@ -1842,6 +1665,173 @@ function getIddPrefix(country, callingCode, metadata) {
|
|
|
1842
1665
|
}
|
|
1843
1666
|
}
|
|
1844
1667
|
|
|
1668
|
+
// The RFC 3966 format for extensions.
|
|
1669
|
+
var RFC3966_EXTN_PREFIX = ';ext=';
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Helper method for constructing regular expressions for parsing. Creates
|
|
1673
|
+
* an expression that captures up to max_length digits.
|
|
1674
|
+
* @return {string} RegEx pattern to capture extension digits.
|
|
1675
|
+
*/
|
|
1676
|
+
var getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {
|
|
1677
|
+
return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
|
|
1678
|
+
};
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* Helper initialiser method to create the regular-expression pattern to match
|
|
1682
|
+
* extensions.
|
|
1683
|
+
* Copy-pasted from Google's `libphonenumber`:
|
|
1684
|
+
* https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766
|
|
1685
|
+
* @return {string} RegEx pattern to capture extensions.
|
|
1686
|
+
*/
|
|
1687
|
+
function createExtensionPattern(purpose) {
|
|
1688
|
+
// We cap the maximum length of an extension based on the ambiguity of the way
|
|
1689
|
+
// the extension is prefixed. As per ITU, the officially allowed length for
|
|
1690
|
+
// extensions is actually 40, but we don't support this since we haven't seen real
|
|
1691
|
+
// examples and this introduces many false interpretations as the extension labels
|
|
1692
|
+
// are not standardized.
|
|
1693
|
+
/** @type {string} */
|
|
1694
|
+
var extLimitAfterExplicitLabel = '20';
|
|
1695
|
+
/** @type {string} */
|
|
1696
|
+
var extLimitAfterLikelyLabel = '15';
|
|
1697
|
+
/** @type {string} */
|
|
1698
|
+
var extLimitAfterAmbiguousChar = '9';
|
|
1699
|
+
/** @type {string} */
|
|
1700
|
+
var extLimitWhenNotSure = '6';
|
|
1701
|
+
|
|
1702
|
+
/** @type {string} */
|
|
1703
|
+
var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*";
|
|
1704
|
+
// Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.
|
|
1705
|
+
/** @type {string} */
|
|
1706
|
+
var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*";
|
|
1707
|
+
/** @type {string} */
|
|
1708
|
+
var optionalExtnSuffix = "#?";
|
|
1709
|
+
|
|
1710
|
+
// Here the extension is called out in more explicit way, i.e mentioning it obvious
|
|
1711
|
+
// patterns like "ext.".
|
|
1712
|
+
/** @type {string} */
|
|
1713
|
+
var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)";
|
|
1714
|
+
// One-character symbols that can be used to indicate an extension, and less
|
|
1715
|
+
// commonly used or more ambiguous extension labels.
|
|
1716
|
+
/** @type {string} */
|
|
1717
|
+
var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)";
|
|
1718
|
+
// When extension is not separated clearly.
|
|
1719
|
+
/** @type {string} */
|
|
1720
|
+
var ambiguousSeparator = "[- ]+";
|
|
1721
|
+
// This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching
|
|
1722
|
+
// comma as extension label may have it.
|
|
1723
|
+
/** @type {string} */
|
|
1724
|
+
var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*";
|
|
1725
|
+
// ",," is commonly used for auto dialling the extension when connected. First
|
|
1726
|
+
// comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do
|
|
1727
|
+
// not repeat it here. Semi-colon works in Iphone and Android also to pop up a
|
|
1728
|
+
// button with the extension number following.
|
|
1729
|
+
/** @type {string} */
|
|
1730
|
+
var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
|
|
1731
|
+
|
|
1732
|
+
/** @type {string} */
|
|
1733
|
+
var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
|
|
1734
|
+
/** @type {string} */
|
|
1735
|
+
var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
|
|
1736
|
+
/** @type {string} */
|
|
1737
|
+
var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
1738
|
+
/** @type {string} */
|
|
1739
|
+
var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
|
|
1740
|
+
|
|
1741
|
+
/** @type {string} */
|
|
1742
|
+
var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
|
|
1743
|
+
/** @type {string} */
|
|
1744
|
+
var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
1745
|
+
|
|
1746
|
+
// The first regular expression covers RFC 3966 format, where the extension is added
|
|
1747
|
+
// using ";ext=". The second more generic where extension is mentioned with explicit
|
|
1748
|
+
// labels like "ext:". In both the above cases we allow more numbers in extension than
|
|
1749
|
+
// any other extension labels. The third one captures when single character extension
|
|
1750
|
+
// labels or less commonly used labels are used. In such cases we capture fewer
|
|
1751
|
+
// extension digits in order to reduce the chance of falsely interpreting two
|
|
1752
|
+
// numbers beside each other as a number + extension. The fourth one covers the
|
|
1753
|
+
// special case of American numbers where the extension is written with a hash
|
|
1754
|
+
// at the end, such as "- 503#". The fifth one is exclusively for extension
|
|
1755
|
+
// autodialling formats which are used when dialling and in this case we accept longer
|
|
1756
|
+
// extensions. The last one is more liberal on the number of commas that acts as
|
|
1757
|
+
// extension labels, so we have a strict cap on the number of digits in such extensions.
|
|
1758
|
+
return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
// Regular expression of viable phone numbers. This is location independent.
|
|
1762
|
+
// Checks we have at least three leading digits, and only valid punctuation,
|
|
1763
|
+
// alpha characters and digits in the phone number. Does not include extension
|
|
1764
|
+
// data. The symbol 'x' is allowed here as valid punctuation since it is often
|
|
1765
|
+
// used as a placeholder for carrier codes, for example in Brazilian phone
|
|
1766
|
+
// numbers. We also allow multiple '+' characters at the start.
|
|
1767
|
+
//
|
|
1768
|
+
// Corresponds to the following:
|
|
1769
|
+
// [digits]{minLengthNsn}|
|
|
1770
|
+
// plus_sign*
|
|
1771
|
+
// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*
|
|
1772
|
+
//
|
|
1773
|
+
// The first reg-ex is to allow short numbers (two digits long) to be parsed if
|
|
1774
|
+
// they are entered as "15" etc, but only if there is no punctuation in them.
|
|
1775
|
+
// The second expression restricts the number of digits to three or more, but
|
|
1776
|
+
// then allows them to be in international form, and to have alpha-characters
|
|
1777
|
+
// and punctuation. We split up the two reg-exes here and combine them when
|
|
1778
|
+
// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it
|
|
1779
|
+
// with ^ and append $ to each branch.
|
|
1780
|
+
//
|
|
1781
|
+
// "Note VALID_PUNCTUATION starts with a -,
|
|
1782
|
+
// so must be the first in the range" (c) Google devs.
|
|
1783
|
+
// (wtf did they mean by saying that; probably nothing)
|
|
1784
|
+
//
|
|
1785
|
+
var MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';
|
|
1786
|
+
//
|
|
1787
|
+
// And this is the second reg-exp:
|
|
1788
|
+
// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)
|
|
1789
|
+
//
|
|
1790
|
+
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';
|
|
1791
|
+
|
|
1792
|
+
// This regular expression isn't present in Google's `libphonenumber`
|
|
1793
|
+
// and is only used to determine whether the phone number being input
|
|
1794
|
+
// is too short for it to even consider it a "valid" number.
|
|
1795
|
+
// This is just a way to differentiate between a really invalid phone
|
|
1796
|
+
// number like "abcde" and a valid phone number that a user has just
|
|
1797
|
+
// started inputting, like "+1" or "1": both these cases would be
|
|
1798
|
+
// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this
|
|
1799
|
+
// library can provide a more detailed error message — whether it's
|
|
1800
|
+
// really "not a number", or is it just a start of a valid phone number.
|
|
1801
|
+
var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');
|
|
1802
|
+
var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +
|
|
1803
|
+
// Phone number extensions
|
|
1804
|
+
'(?:' + createExtensionPattern() + ')?';
|
|
1805
|
+
|
|
1806
|
+
// The combined regular expression for valid phone numbers:
|
|
1807
|
+
//
|
|
1808
|
+
var VALID_PHONE_NUMBER_PATTERN = new RegExp(
|
|
1809
|
+
// Either a short two-digit-only phone number
|
|
1810
|
+
'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +
|
|
1811
|
+
// Or a longer fully parsed phone number (min 3 characters)
|
|
1812
|
+
'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');
|
|
1813
|
+
|
|
1814
|
+
// Checks to see if the string of characters could possibly be a phone number at
|
|
1815
|
+
// all. At the moment, checks to see that the string begins with at least 2
|
|
1816
|
+
// digits, ignoring any punctuation commonly found in phone numbers. This method
|
|
1817
|
+
// does not require the number to be normalized in advance - but does assume
|
|
1818
|
+
// that leading non-number symbols have been removed, such as by the method
|
|
1819
|
+
// `extract_possible_number`.
|
|
1820
|
+
//
|
|
1821
|
+
function isViablePhoneNumber(number) {
|
|
1822
|
+
return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
// This is just a way to differentiate between a really invalid phone
|
|
1826
|
+
// number like "abcde" and a valid phone number that a user has just
|
|
1827
|
+
// started inputting, like "+1" or "1": both these cases would be
|
|
1828
|
+
// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this
|
|
1829
|
+
// library can provide a more detailed error message — whether it's
|
|
1830
|
+
// really "not a number", or is it just a start of a valid phone number.
|
|
1831
|
+
function isViablePhoneNumberStart(number) {
|
|
1832
|
+
return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1845
1835
|
/**
|
|
1846
1836
|
* @param {object} - `{ ?number, ?extension }`.
|
|
1847
1837
|
* @return {string} Phone URI (RFC 3966).
|
|
@@ -2059,15 +2049,15 @@ function pickFirstMatchingElement(elements, testFunction) {
|
|
|
2059
2049
|
}
|
|
2060
2050
|
}
|
|
2061
2051
|
|
|
2062
|
-
function _typeof$
|
|
2063
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2064
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2065
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey$
|
|
2066
|
-
function _classCallCheck$
|
|
2067
|
-
function _defineProperties$6(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$
|
|
2068
|
-
function _createClass$
|
|
2069
|
-
function _toPropertyKey$
|
|
2070
|
-
function _toPrimitive$
|
|
2052
|
+
function _typeof$b(o) { "@babel/helpers - typeof"; return _typeof$b = "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$b(o); }
|
|
2053
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2054
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2055
|
+
function _defineProperty$4(e, r, t) { return (r = _toPropertyKey$a(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
|
|
2056
|
+
function _classCallCheck$7(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
2057
|
+
function _defineProperties$6(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey$a(o.key), o); } }
|
|
2058
|
+
function _createClass$7(e, r, t) { return r && _defineProperties$6(e.prototype, r), Object.defineProperty(e, "prototype", { writable: false }), e; }
|
|
2059
|
+
function _toPropertyKey$a(t) { var i = _toPrimitive$a(t, "string"); return "symbol" == _typeof$b(i) ? i : i + ""; }
|
|
2060
|
+
function _toPrimitive$a(t, r) { if ("object" != _typeof$b(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$b(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return (String )(t); }
|
|
2071
2061
|
var PhoneNumber = /*#__PURE__*/function () {
|
|
2072
2062
|
/**
|
|
2073
2063
|
* @param {string} countryOrCountryCallingCode
|
|
@@ -2076,7 +2066,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
2076
2066
|
* @return {PhoneNumber}
|
|
2077
2067
|
*/
|
|
2078
2068
|
function PhoneNumber(countryOrCountryCallingCode, nationalNumber, metadata) {
|
|
2079
|
-
_classCallCheck$
|
|
2069
|
+
_classCallCheck$7(this, PhoneNumber);
|
|
2080
2070
|
// Validate `countryOrCountryCallingCode` argument.
|
|
2081
2071
|
if (!countryOrCountryCallingCode) {
|
|
2082
2072
|
throw new TypeError('First argument is required');
|
|
@@ -2134,7 +2124,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
2134
2124
|
return metadata;
|
|
2135
2125
|
};
|
|
2136
2126
|
}
|
|
2137
|
-
return _createClass$
|
|
2127
|
+
return _createClass$7(PhoneNumber, [{
|
|
2138
2128
|
key: "setExt",
|
|
2139
2129
|
value: function setExt(ext) {
|
|
2140
2130
|
this.ext = ext;
|
|
@@ -2197,7 +2187,7 @@ var PhoneNumber = /*#__PURE__*/function () {
|
|
|
2197
2187
|
}, {
|
|
2198
2188
|
key: "format",
|
|
2199
2189
|
value: function format(_format, options) {
|
|
2200
|
-
return formatNumber(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {
|
|
2190
|
+
return formatNumber(this, _format, options ? _objectSpread$4(_objectSpread$4({}, options), {}, {
|
|
2201
2191
|
v2: true
|
|
2202
2192
|
}) : {
|
|
2203
2193
|
v2: true
|
|
@@ -2243,9 +2233,70 @@ function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJs
|
|
|
2243
2233
|
}
|
|
2244
2234
|
var E164_NUMBER_REGEXP = /^\+\d+$/;
|
|
2245
2235
|
|
|
2246
|
-
function
|
|
2247
|
-
function
|
|
2248
|
-
function
|
|
2236
|
+
function _typeof$a(o) { "@babel/helpers - typeof"; return _typeof$a = "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$a(o); }
|
|
2237
|
+
function _createClass$6(e, r, t) { return Object.defineProperty(e, "prototype", { writable: false }), e; }
|
|
2238
|
+
function _classCallCheck$6(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
2239
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
2240
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof$a(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
2241
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
2242
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: true, configurable: true } }), Object.defineProperty(t, "prototype", { writable: false }), e && _setPrototypeOf(t, e); }
|
|
2243
|
+
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
|
|
2244
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
|
2245
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2246
|
+
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
2247
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
2248
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
2249
|
+
// https://stackoverflow.com/a/46971044/970769
|
|
2250
|
+
// "Breaking changes in Typescript 2.1"
|
|
2251
|
+
// "Extending built-ins like Error, Array, and Map may no longer work."
|
|
2252
|
+
// "As a recommendation, you can manually adjust the prototype immediately after any super(...) calls."
|
|
2253
|
+
// https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
2254
|
+
var ParseError = /*#__PURE__*/function (_Error) {
|
|
2255
|
+
function ParseError(code) {
|
|
2256
|
+
var _this;
|
|
2257
|
+
_classCallCheck$6(this, ParseError);
|
|
2258
|
+
_this = _callSuper(this, ParseError, [code]);
|
|
2259
|
+
// Set the prototype explicitly.
|
|
2260
|
+
// Any subclass of FooError will have to manually set the prototype as well.
|
|
2261
|
+
Object.setPrototypeOf(_this, ParseError.prototype);
|
|
2262
|
+
_this.name = _this.constructor.name;
|
|
2263
|
+
return _this;
|
|
2264
|
+
}
|
|
2265
|
+
_inherits(ParseError, _Error);
|
|
2266
|
+
return _createClass$6(ParseError);
|
|
2267
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
2268
|
+
|
|
2269
|
+
// Regexp of all known extension prefixes used by different regions followed by
|
|
2270
|
+
// 1 or more valid digits, for use when parsing.
|
|
2271
|
+
var EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i');
|
|
2272
|
+
|
|
2273
|
+
// Strips any extension (as in, the part of the number dialled after the call is
|
|
2274
|
+
// connected, usually indicated with extn, ext, x or similar) from the end of
|
|
2275
|
+
// the number, and returns it.
|
|
2276
|
+
function extractExtension(number) {
|
|
2277
|
+
var start = number.search(EXTN_PATTERN);
|
|
2278
|
+
if (start < 0) {
|
|
2279
|
+
return {};
|
|
2280
|
+
}
|
|
2281
|
+
// If we find a potential extension, and the number preceding this is a viable
|
|
2282
|
+
// number, we assume it is an extension.
|
|
2283
|
+
var numberWithoutExtension = number.slice(0, start);
|
|
2284
|
+
var matches = number.match(EXTN_PATTERN);
|
|
2285
|
+
var i = 1;
|
|
2286
|
+
while (i < matches.length) {
|
|
2287
|
+
if (matches[i]) {
|
|
2288
|
+
return {
|
|
2289
|
+
number: numberWithoutExtension,
|
|
2290
|
+
ext: matches[i]
|
|
2291
|
+
};
|
|
2292
|
+
}
|
|
2293
|
+
i++;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
function _createForOfIteratorHelperLoose$4(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$7(r)) || e) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: true } : { done: false, 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."); }
|
|
2298
|
+
function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$7(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$7(r, a) : void 0; } }
|
|
2299
|
+
function _arrayLikeToArray$7(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; }
|
|
2249
2300
|
// These mappings map a character (key) to a specific digit that should
|
|
2250
2301
|
// replace it for normalization purposes. Non-European digits that
|
|
2251
2302
|
// may be used in phone numbers are mapped to a European equivalent.
|
|
@@ -2327,35 +2378,667 @@ function parseDigit(character) {
|
|
|
2327
2378
|
return DIGITS[character];
|
|
2328
2379
|
}
|
|
2329
2380
|
|
|
2330
|
-
/**
|
|
2331
|
-
* Parses phone number digits from a string.
|
|
2332
|
-
* Drops all punctuation leaving only digits.
|
|
2333
|
-
* Also converts wide-ascii and arabic-indic numerals to conventional numerals.
|
|
2334
|
-
* E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
|
|
2335
|
-
* @param {string} string
|
|
2336
|
-
* @return {string}
|
|
2337
|
-
* @example
|
|
2338
|
-
* ```js
|
|
2339
|
-
* parseDigits('8 (800) 555')
|
|
2340
|
-
* // Outputs '8800555'.
|
|
2341
|
-
* ```
|
|
2342
|
-
*/
|
|
2343
|
-
function parseDigits(string) {
|
|
2344
|
-
var result = '';
|
|
2345
|
-
// Using `.split('')` here instead of normal `for ... of`
|
|
2346
|
-
// because the importing application doesn't neccessarily include an ES6 polyfill.
|
|
2347
|
-
// The `.split('')` approach discards "exotic" UTF-8 characters
|
|
2348
|
-
// (the ones consisting of four bytes) but digits
|
|
2349
|
-
// (including non-European ones) don't fall into that range
|
|
2350
|
-
// so such "exotic" characters would be discarded anyway.
|
|
2351
|
-
for (var _iterator = _createForOfIteratorHelperLoose$
|
|
2352
|
-
var character = _step.value;
|
|
2353
|
-
var digit = parseDigit(character);
|
|
2354
|
-
if (digit) {
|
|
2355
|
-
result += digit;
|
|
2381
|
+
/**
|
|
2382
|
+
* Parses phone number digits from a string.
|
|
2383
|
+
* Drops all punctuation leaving only digits.
|
|
2384
|
+
* Also converts wide-ascii and arabic-indic numerals to conventional numerals.
|
|
2385
|
+
* E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
|
|
2386
|
+
* @param {string} string
|
|
2387
|
+
* @return {string}
|
|
2388
|
+
* @example
|
|
2389
|
+
* ```js
|
|
2390
|
+
* parseDigits('8 (800) 555')
|
|
2391
|
+
* // Outputs '8800555'.
|
|
2392
|
+
* ```
|
|
2393
|
+
*/
|
|
2394
|
+
function parseDigits(string) {
|
|
2395
|
+
var result = '';
|
|
2396
|
+
// Using `.split('')` here instead of normal `for ... of`
|
|
2397
|
+
// because the importing application doesn't neccessarily include an ES6 polyfill.
|
|
2398
|
+
// The `.split('')` approach discards "exotic" UTF-8 characters
|
|
2399
|
+
// (the ones consisting of four bytes) but digits
|
|
2400
|
+
// (including non-European ones) don't fall into that range
|
|
2401
|
+
// so such "exotic" characters would be discarded anyway.
|
|
2402
|
+
for (var _iterator = _createForOfIteratorHelperLoose$4(string.split('')), _step; !(_step = _iterator()).done;) {
|
|
2403
|
+
var character = _step.value;
|
|
2404
|
+
var digit = parseDigit(character);
|
|
2405
|
+
if (digit) {
|
|
2406
|
+
result += digit;
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
return result;
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
function _createForOfIteratorHelperLoose$3(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$6(r)) || e) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: true } : { done: false, 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."); }
|
|
2413
|
+
function _unsupportedIterableToArray$6(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$6(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$6(r, a) : void 0; } }
|
|
2414
|
+
function _arrayLikeToArray$6(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; }
|
|
2415
|
+
|
|
2416
|
+
/**
|
|
2417
|
+
* Parses phone number characters from a string.
|
|
2418
|
+
* Drops all punctuation leaving only digits and the leading `+` sign (if any).
|
|
2419
|
+
* Also converts wide-ascii and arabic-indic numerals to conventional numerals.
|
|
2420
|
+
* E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
|
|
2421
|
+
* @param {string} string
|
|
2422
|
+
* @return {string}
|
|
2423
|
+
* @example
|
|
2424
|
+
* ```js
|
|
2425
|
+
* // Outputs '8800555'.
|
|
2426
|
+
* parseIncompletePhoneNumber('8 (800) 555')
|
|
2427
|
+
* // Outputs '+7800555'.
|
|
2428
|
+
* parseIncompletePhoneNumber('+7 800 555')
|
|
2429
|
+
* ```
|
|
2430
|
+
*/
|
|
2431
|
+
function parseIncompletePhoneNumber(string) {
|
|
2432
|
+
var result = '';
|
|
2433
|
+
// Using `.split('')` here instead of normal `for ... of`
|
|
2434
|
+
// because the importing application doesn't neccessarily include an ES6 polyfill.
|
|
2435
|
+
// The `.split('')` approach discards "exotic" UTF-8 characters
|
|
2436
|
+
// (the ones consisting of four bytes) but digits
|
|
2437
|
+
// (including non-European ones) don't fall into that range
|
|
2438
|
+
// so such "exotic" characters would be discarded anyway.
|
|
2439
|
+
for (var _iterator = _createForOfIteratorHelperLoose$3(string.split('')), _step; !(_step = _iterator()).done;) {
|
|
2440
|
+
var character = _step.value;
|
|
2441
|
+
result += parsePhoneNumberCharacter(character, result) || '';
|
|
2442
|
+
}
|
|
2443
|
+
return result;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
/**
|
|
2447
|
+
* Parses next character while parsing phone number digits (including a `+`)
|
|
2448
|
+
* from text: discards everything except `+` and digits, and `+` is only allowed
|
|
2449
|
+
* at the start of a phone number.
|
|
2450
|
+
* For example, is used in `react-phone-number-input` where it uses
|
|
2451
|
+
* [`input-format`](https://gitlab.com/catamphetamine/input-format).
|
|
2452
|
+
* @param {string} character - Yet another character from raw input string.
|
|
2453
|
+
* @param {string?} prevParsedCharacters - Previous parsed characters.
|
|
2454
|
+
* @param {function?} eventListener - An optional "on event" function.
|
|
2455
|
+
* @return {string?} The parsed character.
|
|
2456
|
+
*/
|
|
2457
|
+
function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {
|
|
2458
|
+
// Only allow a leading `+`.
|
|
2459
|
+
if (character === '+') {
|
|
2460
|
+
// If this `+` is not the first parsed character
|
|
2461
|
+
// then discard it.
|
|
2462
|
+
if (prevParsedCharacters) {
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
return '+';
|
|
2466
|
+
}
|
|
2467
|
+
// Allow digits.
|
|
2468
|
+
return parseDigit(character);
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
// When phone numbers are written in `RFC3966` format — `"tel:+12133734253"` —
|
|
2472
|
+
// they can have their "calling code" part written separately in a `phone-context` parameter.
|
|
2473
|
+
// Example: `"tel:12133734253;phone-context=+1"`.
|
|
2474
|
+
// This function parses the full phone number from the local number and the `phone-context`
|
|
2475
|
+
// when the `phone-context` contains a `+` sign.
|
|
2476
|
+
|
|
2477
|
+
var PLUS_SIGN = '+';
|
|
2478
|
+
var RFC3966_VISUAL_SEPARATOR_ = '[\\-\\.\\(\\)]?';
|
|
2479
|
+
var RFC3966_PHONE_DIGIT_ = '(' + '[' + VALID_DIGITS + ']' + '|' + RFC3966_VISUAL_SEPARATOR_ + ')';
|
|
2480
|
+
var RFC3966_GLOBAL_NUMBER_DIGITS_ = '^' + '\\' + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + '*' + '[' + VALID_DIGITS + ']' + RFC3966_PHONE_DIGIT_ + '*' + '$';
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* Regular expression of valid global-number-digits for the phone-context
|
|
2484
|
+
* parameter, following the syntax defined in RFC3966.
|
|
2485
|
+
*/
|
|
2486
|
+
var RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, 'g');
|
|
2487
|
+
|
|
2488
|
+
// In this port of Google's library, we don't accept alpha characters in phone numbers.
|
|
2489
|
+
// const ALPHANUM_ = VALID_ALPHA_ + VALID_DIGITS
|
|
2490
|
+
var ALPHANUM_ = VALID_DIGITS;
|
|
2491
|
+
var RFC3966_DOMAINLABEL_ = '[' + ALPHANUM_ + ']+((\\-)*[' + ALPHANUM_ + '])*';
|
|
2492
|
+
var VALID_ALPHA_ = 'a-zA-Z';
|
|
2493
|
+
var RFC3966_TOPLABEL_ = '[' + VALID_ALPHA_ + ']+((\\-)*[' + ALPHANUM_ + '])*';
|
|
2494
|
+
var RFC3966_DOMAINNAME_ = '^(' + RFC3966_DOMAINLABEL_ + '\\.)*' + RFC3966_TOPLABEL_ + '\\.?$';
|
|
2495
|
+
|
|
2496
|
+
/**
|
|
2497
|
+
* Regular expression of valid domainname for the phone-context parameter,
|
|
2498
|
+
* following the syntax defined in RFC3966.
|
|
2499
|
+
*/
|
|
2500
|
+
var RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, 'g');
|
|
2501
|
+
var RFC3966_PREFIX_ = 'tel:';
|
|
2502
|
+
var RFC3966_PHONE_CONTEXT_ = ';phone-context=';
|
|
2503
|
+
var RFC3966_ISDN_SUBADDRESS_ = ';isub=';
|
|
2504
|
+
|
|
2505
|
+
/**
|
|
2506
|
+
* Extracts the value of the phone-context parameter of `numberToExtractFrom`,
|
|
2507
|
+
* following the syntax defined in RFC3966.
|
|
2508
|
+
*
|
|
2509
|
+
* @param {string} numberToExtractFrom
|
|
2510
|
+
* @return {string|null} the extracted string (possibly empty), or `null` if no phone-context parameter is found.
|
|
2511
|
+
*/
|
|
2512
|
+
function extractPhoneContext(numberToExtractFrom) {
|
|
2513
|
+
var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
|
|
2514
|
+
// If no phone-context parameter is present
|
|
2515
|
+
if (indexOfPhoneContext < 0) {
|
|
2516
|
+
return null;
|
|
2517
|
+
}
|
|
2518
|
+
var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
|
|
2519
|
+
// If phone-context parameter is empty
|
|
2520
|
+
if (phoneContextStart >= numberToExtractFrom.length) {
|
|
2521
|
+
return '';
|
|
2522
|
+
}
|
|
2523
|
+
var phoneContextEnd = numberToExtractFrom.indexOf(';', phoneContextStart);
|
|
2524
|
+
// If phone-context is not the last parameter
|
|
2525
|
+
if (phoneContextEnd >= 0) {
|
|
2526
|
+
return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
|
|
2527
|
+
} else {
|
|
2528
|
+
return numberToExtractFrom.substring(phoneContextStart);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* Returns whether the value of phoneContext follows the syntax defined in RFC3966.
|
|
2534
|
+
*
|
|
2535
|
+
* @param {string|null} phoneContext
|
|
2536
|
+
* @return {boolean}
|
|
2537
|
+
*/
|
|
2538
|
+
function isPhoneContextValid(phoneContext) {
|
|
2539
|
+
if (phoneContext === null) {
|
|
2540
|
+
return true;
|
|
2541
|
+
}
|
|
2542
|
+
if (phoneContext.length === 0) {
|
|
2543
|
+
return false;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
// Does phone-context value match pattern of global-number-digits or domainname.
|
|
2547
|
+
return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
/**
|
|
2551
|
+
* @param {string} numberToParse
|
|
2552
|
+
* @param {string} nationalNumber
|
|
2553
|
+
* @return {}
|
|
2554
|
+
*/
|
|
2555
|
+
function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
|
|
2556
|
+
var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;
|
|
2557
|
+
var phoneContext = extractPhoneContext(numberToParse);
|
|
2558
|
+
if (!isPhoneContextValid(phoneContext)) {
|
|
2559
|
+
throw new ParseError('NOT_A_NUMBER');
|
|
2560
|
+
}
|
|
2561
|
+
var phoneNumberString;
|
|
2562
|
+
if (phoneContext === null) {
|
|
2563
|
+
// Extract a possible number from the string passed in.
|
|
2564
|
+
// (this strips leading characters that could not be the start of a phone number)
|
|
2565
|
+
phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';
|
|
2566
|
+
} else {
|
|
2567
|
+
phoneNumberString = '';
|
|
2568
|
+
|
|
2569
|
+
// If the phone context contains a phone number prefix, we need to capture
|
|
2570
|
+
// it, whereas domains will be ignored.
|
|
2571
|
+
if (phoneContext.charAt(0) === PLUS_SIGN) {
|
|
2572
|
+
phoneNumberString += phoneContext;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
// Now append everything between the "tel:" prefix and the phone-context.
|
|
2576
|
+
// This should include the national number, an optional extension or
|
|
2577
|
+
// isdn-subaddress component. Note we also handle the case when "tel:" is
|
|
2578
|
+
// missing, as we have seen in some of the phone number inputs.
|
|
2579
|
+
// In that case, we append everything from the beginning.
|
|
2580
|
+
var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
|
|
2581
|
+
var indexOfNationalNumber;
|
|
2582
|
+
// RFC 3966 "tel:" prefix is preset at this stage because
|
|
2583
|
+
// `isPhoneContextValid()` requires it to be present.
|
|
2584
|
+
/* istanbul ignore else */
|
|
2585
|
+
if (indexOfRfc3966Prefix >= 0) {
|
|
2586
|
+
indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
|
|
2587
|
+
} else {
|
|
2588
|
+
indexOfNationalNumber = 0;
|
|
2589
|
+
}
|
|
2590
|
+
var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
|
|
2591
|
+
phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
// Delete the isdn-subaddress and everything after it if it is present.
|
|
2595
|
+
// Note extension won't appear at the same time with isdn-subaddress
|
|
2596
|
+
// according to paragraph 5.3 of the RFC3966 spec.
|
|
2597
|
+
var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
|
|
2598
|
+
if (indexOfIsdn > 0) {
|
|
2599
|
+
phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
|
|
2600
|
+
}
|
|
2601
|
+
// If both phone context and isdn-subaddress are absent but other
|
|
2602
|
+
// parameters are present, the parameters are left in nationalNumber.
|
|
2603
|
+
// This is because we are concerned about deleting content from a potential
|
|
2604
|
+
// number string when there is no strong evidence that the number is
|
|
2605
|
+
// actually written in RFC3966.
|
|
2606
|
+
|
|
2607
|
+
if (phoneNumberString !== '') {
|
|
2608
|
+
return phoneNumberString;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
// This is a port of Google Android `libphonenumber`'s
|
|
2613
|
+
// `phonenumberutil.js` of December 31th, 2018.
|
|
2614
|
+
//
|
|
2615
|
+
// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js
|
|
2616
|
+
|
|
2617
|
+
|
|
2618
|
+
// We don't allow input strings for parsing to be longer than 250 chars.
|
|
2619
|
+
// This prevents malicious input from consuming CPU.
|
|
2620
|
+
var MAX_INPUT_STRING_LENGTH = 250;
|
|
2621
|
+
|
|
2622
|
+
// This consists of the plus symbol, digits, and arabic-indic digits.
|
|
2623
|
+
var PHONE_NUMBER_START_PATTERN = new RegExp('[' + PLUS_CHARS + VALID_DIGITS + ']');
|
|
2624
|
+
|
|
2625
|
+
// Regular expression of trailing characters that we want to remove.
|
|
2626
|
+
// A trailing `#` is sometimes used when writing phone numbers with extensions in US.
|
|
2627
|
+
// Example: "+1 (645) 123 1234-910#" number has extension "910".
|
|
2628
|
+
var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + VALID_DIGITS + '#' + ']+$');
|
|
2629
|
+
|
|
2630
|
+
// Examples:
|
|
2631
|
+
//
|
|
2632
|
+
// ```js
|
|
2633
|
+
// parse('8 (800) 555-35-35', 'RU')
|
|
2634
|
+
// parse('8 (800) 555-35-35', 'RU', metadata)
|
|
2635
|
+
// parse('8 (800) 555-35-35', { country: { default: 'RU' } })
|
|
2636
|
+
// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)
|
|
2637
|
+
// parse('+7 800 555 35 35')
|
|
2638
|
+
// parse('+7 800 555 35 35', metadata)
|
|
2639
|
+
// ```
|
|
2640
|
+
//
|
|
2641
|
+
|
|
2642
|
+
/**
|
|
2643
|
+
* Parses a phone number.
|
|
2644
|
+
*
|
|
2645
|
+
* parse('123456789', { defaultCountry: 'RU', v2: true }, metadata)
|
|
2646
|
+
* parse('123456789', { defaultCountry: 'RU' }, metadata)
|
|
2647
|
+
* parse('123456789', undefined, metadata)
|
|
2648
|
+
*
|
|
2649
|
+
* @param {string} input
|
|
2650
|
+
* @param {object} [options]
|
|
2651
|
+
* @param {object} metadata
|
|
2652
|
+
* @return {object|PhoneNumber?} If `options.v2: true` flag is passed, it returns a `PhoneNumber?` instance. Otherwise, returns an object of shape `{ phone: '...', country: '...' }` (or just `{}` if no phone number was parsed).
|
|
2653
|
+
*/
|
|
2654
|
+
function parse(text, options, metadata) {
|
|
2655
|
+
// If assigning the `{}` default value is moved to the arguments above,
|
|
2656
|
+
// code coverage would decrease for some weird reason.
|
|
2657
|
+
options = options || {};
|
|
2658
|
+
metadata = new Metadata(metadata);
|
|
2659
|
+
|
|
2660
|
+
// Validate `defaultCountry`.
|
|
2661
|
+
if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {
|
|
2662
|
+
if (options.v2) {
|
|
2663
|
+
throw new ParseError('INVALID_COUNTRY');
|
|
2664
|
+
}
|
|
2665
|
+
throw new Error("Unknown country: ".concat(options.defaultCountry));
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
// Parse the phone number.
|
|
2669
|
+
var _parseInput = parseInput(text, options.v2, options.extract),
|
|
2670
|
+
formattedPhoneNumber = _parseInput.number,
|
|
2671
|
+
ext = _parseInput.ext,
|
|
2672
|
+
error = _parseInput.error;
|
|
2673
|
+
|
|
2674
|
+
// If the phone number is not viable then return nothing.
|
|
2675
|
+
if (!formattedPhoneNumber) {
|
|
2676
|
+
if (options.v2) {
|
|
2677
|
+
if (error === 'TOO_SHORT') {
|
|
2678
|
+
throw new ParseError('TOO_SHORT');
|
|
2679
|
+
}
|
|
2680
|
+
throw new ParseError('NOT_A_NUMBER');
|
|
2681
|
+
}
|
|
2682
|
+
return {};
|
|
2683
|
+
}
|
|
2684
|
+
var _parsePhoneNumber = parsePhoneNumber$1(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata),
|
|
2685
|
+
country = _parsePhoneNumber.country,
|
|
2686
|
+
nationalNumber = _parsePhoneNumber.nationalNumber,
|
|
2687
|
+
countryCallingCode = _parsePhoneNumber.countryCallingCode,
|
|
2688
|
+
countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource,
|
|
2689
|
+
carrierCode = _parsePhoneNumber.carrierCode;
|
|
2690
|
+
if (!metadata.hasSelectedNumberingPlan()) {
|
|
2691
|
+
if (options.v2) {
|
|
2692
|
+
throw new ParseError('INVALID_COUNTRY');
|
|
2693
|
+
}
|
|
2694
|
+
return {};
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
// Validate national (significant) number length.
|
|
2698
|
+
if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
|
|
2699
|
+
// Won't throw here because the regexp already demands length > 1.
|
|
2700
|
+
/* istanbul ignore if */
|
|
2701
|
+
if (options.v2) {
|
|
2702
|
+
throw new ParseError('TOO_SHORT');
|
|
2703
|
+
}
|
|
2704
|
+
// Google's demo just throws an error in this case.
|
|
2705
|
+
return {};
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
// Validate national (significant) number length.
|
|
2709
|
+
//
|
|
2710
|
+
// A sidenote:
|
|
2711
|
+
//
|
|
2712
|
+
// They say that sometimes national (significant) numbers
|
|
2713
|
+
// can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).
|
|
2714
|
+
// https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36
|
|
2715
|
+
// Such numbers will just be discarded.
|
|
2716
|
+
//
|
|
2717
|
+
if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
|
|
2718
|
+
if (options.v2) {
|
|
2719
|
+
throw new ParseError('TOO_LONG');
|
|
2720
|
+
}
|
|
2721
|
+
// Google's demo just throws an error in this case.
|
|
2722
|
+
return {};
|
|
2723
|
+
}
|
|
2724
|
+
if (options.v2) {
|
|
2725
|
+
var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);
|
|
2726
|
+
if (country) {
|
|
2727
|
+
phoneNumber.country = country;
|
|
2728
|
+
}
|
|
2729
|
+
if (carrierCode) {
|
|
2730
|
+
phoneNumber.carrierCode = carrierCode;
|
|
2731
|
+
}
|
|
2732
|
+
if (ext) {
|
|
2733
|
+
phoneNumber.ext = ext;
|
|
2734
|
+
}
|
|
2735
|
+
phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
|
|
2736
|
+
return phoneNumber;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
// Check if national phone number pattern matches the number.
|
|
2740
|
+
// National number pattern is different for each country,
|
|
2741
|
+
// even for those ones which are part of the "NANPA" group.
|
|
2742
|
+
var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;
|
|
2743
|
+
if (!options.extended) {
|
|
2744
|
+
return valid ? result(country, nationalNumber, ext) : {};
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
// isInternational: countryCallingCode !== undefined
|
|
2748
|
+
|
|
2749
|
+
return {
|
|
2750
|
+
country: country,
|
|
2751
|
+
countryCallingCode: countryCallingCode,
|
|
2752
|
+
carrierCode: carrierCode,
|
|
2753
|
+
valid: valid,
|
|
2754
|
+
possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, country, metadata) ? true : false,
|
|
2755
|
+
phone: nationalNumber,
|
|
2756
|
+
ext: ext
|
|
2757
|
+
};
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
/**
|
|
2761
|
+
* Extracts a formatted phone number from text.
|
|
2762
|
+
* Doesn't guarantee that the extracted phone number
|
|
2763
|
+
* is a valid phone number (for example, doesn't validate its length).
|
|
2764
|
+
* @param {string} text
|
|
2765
|
+
* @param {boolean} [extract] — If `false`, then will parse the entire `text` as a phone number.
|
|
2766
|
+
* @param {boolean} [throwOnError] — By default, it won't throw if the text is too long.
|
|
2767
|
+
* @return {string}
|
|
2768
|
+
* @example
|
|
2769
|
+
* // Returns "(213) 373-4253".
|
|
2770
|
+
* extractFormattedPhoneNumber("Call (213) 373-4253 for assistance.")
|
|
2771
|
+
*/
|
|
2772
|
+
function _extractFormattedPhoneNumber(text, extract, throwOnError) {
|
|
2773
|
+
if (!text) {
|
|
2774
|
+
return;
|
|
2775
|
+
}
|
|
2776
|
+
if (text.length > MAX_INPUT_STRING_LENGTH) {
|
|
2777
|
+
if (throwOnError) {
|
|
2778
|
+
throw new ParseError('TOO_LONG');
|
|
2779
|
+
}
|
|
2780
|
+
return;
|
|
2781
|
+
}
|
|
2782
|
+
if (extract === false) {
|
|
2783
|
+
return text;
|
|
2784
|
+
}
|
|
2785
|
+
// Attempt to extract a possible number from the string passed in
|
|
2786
|
+
var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
|
|
2787
|
+
if (startsAt < 0) {
|
|
2788
|
+
return;
|
|
2789
|
+
}
|
|
2790
|
+
return text
|
|
2791
|
+
// Trim everything to the left of the phone number
|
|
2792
|
+
.slice(startsAt)
|
|
2793
|
+
// Remove trailing non-numerical characters
|
|
2794
|
+
.replace(AFTER_PHONE_NUMBER_END_PATTERN, '');
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
/**
|
|
2798
|
+
* @param {string} text - Input.
|
|
2799
|
+
* @param {boolean} v2 - Legacy API functions don't pass `v2: true` flag.
|
|
2800
|
+
* @param {boolean} [extract] - Whether to extract a phone number from `text`, or attempt to parse the entire text as a phone number.
|
|
2801
|
+
* @return {object} `{ ?number, ?ext }`.
|
|
2802
|
+
*/
|
|
2803
|
+
function parseInput(text, v2, extract) {
|
|
2804
|
+
// // Parse RFC 3966 phone number URI.
|
|
2805
|
+
// if (text && text.indexOf('tel:') === 0) {
|
|
2806
|
+
// return parseRFC3966(text)
|
|
2807
|
+
// }
|
|
2808
|
+
// let number = extractFormattedPhoneNumber(text, extract, v2)
|
|
2809
|
+
var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
|
|
2810
|
+
extractFormattedPhoneNumber: function extractFormattedPhoneNumber(text) {
|
|
2811
|
+
return _extractFormattedPhoneNumber(text, extract, v2);
|
|
2812
|
+
}
|
|
2813
|
+
});
|
|
2814
|
+
// If the phone number is not viable, then abort.
|
|
2815
|
+
if (!number) {
|
|
2816
|
+
return {};
|
|
2817
|
+
}
|
|
2818
|
+
if (!isViablePhoneNumber(number)) {
|
|
2819
|
+
if (isViablePhoneNumberStart(number)) {
|
|
2820
|
+
return {
|
|
2821
|
+
error: 'TOO_SHORT'
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
return {};
|
|
2825
|
+
}
|
|
2826
|
+
// Attempt to parse extension first, since it doesn't require region-specific
|
|
2827
|
+
// data and we want to have the non-normalised number here.
|
|
2828
|
+
var withExtensionStripped = extractExtension(number);
|
|
2829
|
+
if (withExtensionStripped.ext) {
|
|
2830
|
+
return withExtensionStripped;
|
|
2831
|
+
}
|
|
2832
|
+
return {
|
|
2833
|
+
number: number
|
|
2834
|
+
};
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
* Creates `parse()` result object.
|
|
2839
|
+
*/
|
|
2840
|
+
function result(country, nationalNumber, ext) {
|
|
2841
|
+
var result = {
|
|
2842
|
+
country: country,
|
|
2843
|
+
phone: nationalNumber
|
|
2844
|
+
};
|
|
2845
|
+
if (ext) {
|
|
2846
|
+
result.ext = ext;
|
|
2847
|
+
}
|
|
2848
|
+
return result;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
/**
|
|
2852
|
+
* Parses a viable phone number.
|
|
2853
|
+
* @param {string} formattedPhoneNumber — Example: "(213) 373-4253".
|
|
2854
|
+
* @param {string} [defaultCountry]
|
|
2855
|
+
* @param {string} [defaultCallingCode]
|
|
2856
|
+
* @param {Metadata} metadata
|
|
2857
|
+
* @return {object} Returns `{ country: string?, countryCallingCode: string?, nationalNumber: string? }`.
|
|
2858
|
+
*/
|
|
2859
|
+
function parsePhoneNumber$1(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {
|
|
2860
|
+
// Extract calling code from phone number.
|
|
2861
|
+
var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), undefined, defaultCountry, defaultCallingCode, metadata.metadata),
|
|
2862
|
+
countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource,
|
|
2863
|
+
countryCallingCode = _extractCountryCallin.countryCallingCode,
|
|
2864
|
+
number = _extractCountryCallin.number;
|
|
2865
|
+
|
|
2866
|
+
// The exact country of the phone number
|
|
2867
|
+
var country;
|
|
2868
|
+
|
|
2869
|
+
// If `formattedPhoneNumber` is passed in "international" format,
|
|
2870
|
+
// choose a country by `countryCallingCode`.
|
|
2871
|
+
if (countryCallingCode) {
|
|
2872
|
+
metadata.selectNumberingPlan(countryCallingCode);
|
|
2873
|
+
}
|
|
2874
|
+
// Else, if `formattedPhoneNumber` is passed in "national" format,
|
|
2875
|
+
// then `number` is defined and `countryCallingCode` is `undefined`.
|
|
2876
|
+
else if (number && (defaultCountry || defaultCallingCode)) {
|
|
2877
|
+
metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);
|
|
2878
|
+
if (defaultCountry) {
|
|
2879
|
+
country = defaultCountry;
|
|
2880
|
+
}
|
|
2881
|
+
countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata.metadata);
|
|
2882
|
+
} else return {};
|
|
2883
|
+
if (!number) {
|
|
2884
|
+
return {
|
|
2885
|
+
countryCallingCodeSource: countryCallingCodeSource,
|
|
2886
|
+
countryCallingCode: countryCallingCode
|
|
2887
|
+
};
|
|
2888
|
+
}
|
|
2889
|
+
var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), country, metadata),
|
|
2890
|
+
nationalNumber = _extractNationalNumbe.nationalNumber,
|
|
2891
|
+
carrierCode = _extractNationalNumbe.carrierCode;
|
|
2892
|
+
|
|
2893
|
+
// Sometimes there are several countries
|
|
2894
|
+
// corresponding to the same country phone code
|
|
2895
|
+
// (e.g. NANPA countries all having `1` country phone code).
|
|
2896
|
+
// Therefore, to reliably determine the exact country,
|
|
2897
|
+
// national (significant) number should have been parsed first.
|
|
2898
|
+
//
|
|
2899
|
+
// When `metadata.json` is generated, all "ambiguous" country phone codes
|
|
2900
|
+
// get their countries populated with the full set of
|
|
2901
|
+
// "phone number type" regular expressions.
|
|
2902
|
+
//
|
|
2903
|
+
var exactCountry = getCountryByCallingCode(countryCallingCode, {
|
|
2904
|
+
nationalNumber: nationalNumber,
|
|
2905
|
+
metadata: metadata
|
|
2906
|
+
});
|
|
2907
|
+
if (exactCountry) {
|
|
2908
|
+
country = exactCountry;
|
|
2909
|
+
/* istanbul ignore if */
|
|
2910
|
+
if (exactCountry === '001') ; else {
|
|
2911
|
+
metadata.selectNumberingPlan(country);
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
return {
|
|
2915
|
+
country: country,
|
|
2916
|
+
countryCallingCode: countryCallingCode,
|
|
2917
|
+
countryCallingCodeSource: countryCallingCodeSource,
|
|
2918
|
+
nationalNumber: nationalNumber,
|
|
2919
|
+
carrierCode: carrierCode
|
|
2920
|
+
};
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
function _typeof$9(o) { "@babel/helpers - typeof"; return _typeof$9 = "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$9(o); }
|
|
2924
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2925
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty$3(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2926
|
+
function _defineProperty$3(e, r, t) { return (r = _toPropertyKey$9(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
|
|
2927
|
+
function _toPropertyKey$9(t) { var i = _toPrimitive$9(t, "string"); return "symbol" == _typeof$9(i) ? i : i + ""; }
|
|
2928
|
+
function _toPrimitive$9(t, r) { if ("object" != _typeof$9(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$9(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
2929
|
+
function parsePhoneNumberWithError(text, options, metadata) {
|
|
2930
|
+
return parse(text, _objectSpread$3(_objectSpread$3({}, options), {}, {
|
|
2931
|
+
v2: true
|
|
2932
|
+
}), metadata);
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
function _typeof$8(o) { "@babel/helpers - typeof"; return _typeof$8 = "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$8(o); }
|
|
2936
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2937
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty$2(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2938
|
+
function _defineProperty$2(e, r, t) { return (r = _toPropertyKey$8(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
|
|
2939
|
+
function _toPropertyKey$8(t) { var i = _toPrimitive$8(t, "string"); return "symbol" == _typeof$8(i) ? i : i + ""; }
|
|
2940
|
+
function _toPrimitive$8(t, r) { if ("object" != _typeof$8(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$8(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
2941
|
+
function _slicedToArray$2(r, e) { return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$5(r, e) || _nonIterableRest$2(); }
|
|
2942
|
+
function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
2943
|
+
function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$5(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$5(r, a) : void 0; } }
|
|
2944
|
+
function _arrayLikeToArray$5(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; }
|
|
2945
|
+
function _iterableToArrayLimit$2(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = true, o = false; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true); } catch (r) { o = true, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
2946
|
+
function _arrayWithHoles$2(r) { if (Array.isArray(r)) return r; }
|
|
2947
|
+
|
|
2948
|
+
// Extracts the following properties from function arguments:
|
|
2949
|
+
// * input `text`
|
|
2950
|
+
// * `options` object
|
|
2951
|
+
// * `metadata` JSON
|
|
2952
|
+
function normalizeArguments(args) {
|
|
2953
|
+
var _Array$prototype$slic = Array.prototype.slice.call(args),
|
|
2954
|
+
_Array$prototype$slic2 = _slicedToArray$2(_Array$prototype$slic, 4),
|
|
2955
|
+
arg_1 = _Array$prototype$slic2[0],
|
|
2956
|
+
arg_2 = _Array$prototype$slic2[1],
|
|
2957
|
+
arg_3 = _Array$prototype$slic2[2],
|
|
2958
|
+
arg_4 = _Array$prototype$slic2[3];
|
|
2959
|
+
var text;
|
|
2960
|
+
var options;
|
|
2961
|
+
var metadata;
|
|
2962
|
+
|
|
2963
|
+
// If the phone number is passed as a string.
|
|
2964
|
+
// `parsePhoneNumber('88005553535', ...)`.
|
|
2965
|
+
if (typeof arg_1 === 'string') {
|
|
2966
|
+
text = arg_1;
|
|
2967
|
+
} else throw new TypeError('A text for parsing must be a string.');
|
|
2968
|
+
|
|
2969
|
+
// If "default country" argument is being passed then move it to `options`.
|
|
2970
|
+
// `parsePhoneNumber('88005553535', 'RU', [options], metadata)`.
|
|
2971
|
+
if (!arg_2 || typeof arg_2 === 'string') {
|
|
2972
|
+
if (arg_4) {
|
|
2973
|
+
options = arg_3;
|
|
2974
|
+
metadata = arg_4;
|
|
2975
|
+
} else {
|
|
2976
|
+
options = undefined;
|
|
2977
|
+
metadata = arg_3;
|
|
2978
|
+
}
|
|
2979
|
+
if (arg_2) {
|
|
2980
|
+
options = _objectSpread$2({
|
|
2981
|
+
defaultCountry: arg_2
|
|
2982
|
+
}, options);
|
|
2356
2983
|
}
|
|
2357
2984
|
}
|
|
2358
|
-
|
|
2985
|
+
// `defaultCountry` is not passed.
|
|
2986
|
+
// Example: `parsePhoneNumber('+78005553535', [options], metadata)`.
|
|
2987
|
+
else if (isObject(arg_2)) {
|
|
2988
|
+
if (arg_3) {
|
|
2989
|
+
options = arg_2;
|
|
2990
|
+
metadata = arg_3;
|
|
2991
|
+
} else {
|
|
2992
|
+
metadata = arg_2;
|
|
2993
|
+
}
|
|
2994
|
+
} else throw new Error("Invalid second argument: ".concat(arg_2));
|
|
2995
|
+
return {
|
|
2996
|
+
text: text,
|
|
2997
|
+
options: options,
|
|
2998
|
+
metadata: metadata
|
|
2999
|
+
};
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
function _typeof$7(o) { "@babel/helpers - typeof"; return _typeof$7 = "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$7(o); }
|
|
3003
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3004
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3005
|
+
function _defineProperty$1(e, r, t) { return (r = _toPropertyKey$7(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
|
|
3006
|
+
function _toPropertyKey$7(t) { var i = _toPrimitive$7(t, "string"); return "symbol" == _typeof$7(i) ? i : i + ""; }
|
|
3007
|
+
function _toPrimitive$7(t, r) { if ("object" != _typeof$7(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$7(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3008
|
+
function parsePhoneNumber(text, options, metadata) {
|
|
3009
|
+
// Validate `defaultCountry`.
|
|
3010
|
+
if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {
|
|
3011
|
+
options = _objectSpread$1(_objectSpread$1({}, options), {}, {
|
|
3012
|
+
defaultCountry: undefined
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
// Parse phone number.
|
|
3016
|
+
try {
|
|
3017
|
+
return parsePhoneNumberWithError(text, options, metadata);
|
|
3018
|
+
} catch (error) {
|
|
3019
|
+
/* istanbul ignore else */
|
|
3020
|
+
if (error instanceof ParseError) ; else {
|
|
3021
|
+
throw error;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
function _typeof$6(o) { "@babel/helpers - typeof"; return _typeof$6 = "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$6(o); }
|
|
3027
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3028
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3029
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey$6(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
|
|
3030
|
+
function _toPropertyKey$6(t) { var i = _toPrimitive$6(t, "string"); return "symbol" == _typeof$6(i) ? i : i + ""; }
|
|
3031
|
+
function _toPrimitive$6(t, r) { if ("object" != _typeof$6(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof$6(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3032
|
+
function isValidPhoneNumber$1() {
|
|
3033
|
+
var _normalizeArguments = normalizeArguments(arguments),
|
|
3034
|
+
text = _normalizeArguments.text,
|
|
3035
|
+
options = _normalizeArguments.options,
|
|
3036
|
+
metadata = _normalizeArguments.metadata;
|
|
3037
|
+
options = _objectSpread(_objectSpread({}, options), {}, {
|
|
3038
|
+
extract: false
|
|
3039
|
+
});
|
|
3040
|
+
var phoneNumber = parsePhoneNumber(text, options, metadata);
|
|
3041
|
+
return phoneNumber && phoneNumber.isValid() || false;
|
|
2359
3042
|
}
|
|
2360
3043
|
|
|
2361
3044
|
function _typeof$5(o) { "@babel/helpers - typeof"; return _typeof$5 = "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$5(o); }
|
|
@@ -4698,6 +5381,10 @@ var AsYouType$1 = /*#__PURE__*/function () {
|
|
|
4698
5381
|
}]);
|
|
4699
5382
|
}();
|
|
4700
5383
|
|
|
5384
|
+
function isValidPhoneNumber() {
|
|
5385
|
+
return withMetadataArgument(isValidPhoneNumber$1, arguments)
|
|
5386
|
+
}
|
|
5387
|
+
|
|
4701
5388
|
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
4702
5389
|
// importing system which is even uncapable of importing "*.json" files.
|
|
4703
5390
|
|
|
@@ -4708,6 +5395,206 @@ function AsYouType(country) {
|
|
|
4708
5395
|
AsYouType.prototype = Object.create(AsYouType$1.prototype, {});
|
|
4709
5396
|
AsYouType.prototype.constructor = AsYouType;
|
|
4710
5397
|
|
|
5398
|
+
const formLanguageChange = async (formContext, newLanguage) => {
|
|
5399
|
+
var _a, _b, _c, _d, _e;
|
|
5400
|
+
const sharedLocales = await getSharedFormLocal(newLanguage);
|
|
5401
|
+
const LS = (_b = (_a = formContext.structure) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.localization;
|
|
5402
|
+
const structureLocalization = typeof LS === 'object' ? ((_d = (_c = LS === null || LS === void 0 ? void 0 : LS[newLanguage]) !== null && _c !== void 0 ? _c : LS === null || LS === void 0 ? void 0 : LS.en) !== null && _d !== void 0 ? _d : {}) : {};
|
|
5403
|
+
formContext.locale = Object.assign(Object.assign({}, structureLocalization), { sharedFormLocales: Object.assign(Object.assign({}, sharedLocales), structureLocalization === null || structureLocalization === void 0 ? void 0 : structureLocalization.sharedFormLocales) });
|
|
5404
|
+
formContext.localeLanguage = newLanguage;
|
|
5405
|
+
(_e = formContext.form) === null || _e === void 0 ? void 0 : _e.rerender({ rerenderAll: true });
|
|
5406
|
+
};
|
|
5407
|
+
const formErrorHandler = async (formContext, error) => {
|
|
5408
|
+
var _a, _b, _c;
|
|
5409
|
+
const message = error.message || ((_c = (_b = (_a = formContext.locale) === null || _a === void 0 ? void 0 : _a.sharedFormLocales) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c.wildCard) || '';
|
|
5410
|
+
if (formContext === null || formContext === void 0 ? void 0 : formContext.errorCallback)
|
|
5411
|
+
formContext.errorCallback(error, message);
|
|
5412
|
+
else
|
|
5413
|
+
formContext.errorMessage = message;
|
|
5414
|
+
};
|
|
5415
|
+
const formLoadingHandler = async (formContext, isLoading) => {
|
|
5416
|
+
formContext.isLoading = isLoading;
|
|
5417
|
+
if (formContext.loadingChanges)
|
|
5418
|
+
formContext.loadingChanges(isLoading);
|
|
5419
|
+
};
|
|
5420
|
+
const formSuccessHandler = async (formContext, data) => {
|
|
5421
|
+
if (formContext.successCallback)
|
|
5422
|
+
formContext.successCallback(data, formContext.locale['Form submitted successfully.'] || '');
|
|
5423
|
+
else
|
|
5424
|
+
formContext.form.openDialog();
|
|
5425
|
+
if (!formContext.disableScrollToTop) {
|
|
5426
|
+
const formDom = formContext.el.shadowRoot || formContext.el;
|
|
5427
|
+
let targetElement = formDom instanceof ShadowRoot ? formDom.firstElementChild : formDom;
|
|
5428
|
+
const yOffset = -100;
|
|
5429
|
+
const y = targetElement.getBoundingClientRect().top + window.pageYOffset + yOffset;
|
|
5430
|
+
window.scrollTo({ top: Math.max(y, 0), behavior: 'smooth' });
|
|
5431
|
+
}
|
|
5432
|
+
};
|
|
5433
|
+
const formDidLoadHandler = async (formContext, validator) => {
|
|
5434
|
+
var _a, _b;
|
|
5435
|
+
if (!formContext.structure) {
|
|
5436
|
+
if (formContext.gistId) {
|
|
5437
|
+
const [newGistStructure] = await Promise.all([gistLoader(formContext.gistId), formContext.changeLanguage(formContext.language)]);
|
|
5438
|
+
formContext.structure = newGistStructure;
|
|
5439
|
+
}
|
|
5440
|
+
else if (formContext.structureUrl) {
|
|
5441
|
+
const [newGistStructure] = await Promise.all([fetchJson(formContext.structureUrl), formContext.changeLanguage(formContext.language)]);
|
|
5442
|
+
formContext.structure = newGistStructure;
|
|
5443
|
+
}
|
|
5444
|
+
}
|
|
5445
|
+
formContext.localeLanguage = formContext.language;
|
|
5446
|
+
await formContext.changeLanguage(formContext.language);
|
|
5447
|
+
if (!formContext.isMobileForm) {
|
|
5448
|
+
try {
|
|
5449
|
+
const key = (_b = (_a = formContext.structure) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.recaptchaKey;
|
|
5450
|
+
if (key) {
|
|
5451
|
+
const script = document.createElement('script');
|
|
5452
|
+
script.src = `https://www.google.com/recaptcha/api.js?render=${key}&hl=${formContext.language}`;
|
|
5453
|
+
script.async = true;
|
|
5454
|
+
script.defer = true;
|
|
5455
|
+
document.head.appendChild(script);
|
|
5456
|
+
}
|
|
5457
|
+
}
|
|
5458
|
+
catch (error) {
|
|
5459
|
+
console.log(error);
|
|
5460
|
+
}
|
|
5461
|
+
}
|
|
5462
|
+
formContext.form = new FormHook(formContext, validator);
|
|
5463
|
+
};
|
|
5464
|
+
const formGetFormHandler = async (formContext) => {
|
|
5465
|
+
if (formContext.form)
|
|
5466
|
+
return formContext.form;
|
|
5467
|
+
};
|
|
5468
|
+
const handleFormSubmit = async (formContext) => {
|
|
5469
|
+
if (formContext.form)
|
|
5470
|
+
return formContext.form.submit();
|
|
5471
|
+
};
|
|
5472
|
+
const formStructureRenderedHandler = async (formContext, isRendered) => {
|
|
5473
|
+
var _a;
|
|
5474
|
+
if (isRendered)
|
|
5475
|
+
(_a = formContext.formReadyCallback) === null || _a === void 0 ? void 0 : _a.call(formContext);
|
|
5476
|
+
};
|
|
5477
|
+
const onFormSubmit = async ({ context, formValues, middleware, afterSuccess }) => {
|
|
5478
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
5479
|
+
try {
|
|
5480
|
+
context.setIsLoading(true);
|
|
5481
|
+
if ((formValues === null || formValues === void 0 ? void 0 : formValues['phone']) && !isValidPhoneNumber(formValues === null || formValues === void 0 ? void 0 : formValues['phone']))
|
|
5482
|
+
formValues === null || formValues === void 0 ? true : delete formValues['phone'];
|
|
5483
|
+
Object.keys(formValues).forEach(key => {
|
|
5484
|
+
if (context[`${key}-format`]) {
|
|
5485
|
+
formValues[key] = context[`${key}-format`];
|
|
5486
|
+
}
|
|
5487
|
+
});
|
|
5488
|
+
const hasAdditionalData = !!((_b = (_a = context.structure) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.truncatedFields) && !!((_e = Object.keys((_d = (_c = context.structure) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.truncatedFields)) === null || _e === void 0 ? void 0 : _e.length);
|
|
5489
|
+
let additionalData = {};
|
|
5490
|
+
let payload = Object.assign({}, formValues);
|
|
5491
|
+
if ((_g = (_f = context.structure) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.extraPayload)
|
|
5492
|
+
payload = Object.assign(Object.assign({}, payload), (_j = (_h = context.structure) === null || _h === void 0 ? void 0 : _h.data) === null || _j === void 0 ? void 0 : _j.extraPayload);
|
|
5493
|
+
if (hasAdditionalData)
|
|
5494
|
+
payload.additionalData = additionalData;
|
|
5495
|
+
if (!!(context === null || context === void 0 ? void 0 : context.extraPayload))
|
|
5496
|
+
payload = Object.assign(Object.assign({}, payload), context === null || context === void 0 ? void 0 : context.extraPayload);
|
|
5497
|
+
if (hasAdditionalData) {
|
|
5498
|
+
Object.entries((_l = (_k = context.structure) === null || _k === void 0 ? void 0 : _k.data) === null || _l === void 0 ? void 0 : _l.truncatedFields).forEach(([oldKey, truncateValue]) => {
|
|
5499
|
+
if (Array.isArray(truncateValue)) {
|
|
5500
|
+
let constructNewValue = '';
|
|
5501
|
+
truncateValue.forEach(key => {
|
|
5502
|
+
constructNewValue += payload[key.toString()] || key.toString();
|
|
5503
|
+
});
|
|
5504
|
+
payload = Object.assign(Object.assign({}, payload), { [oldKey]: constructNewValue });
|
|
5505
|
+
}
|
|
5506
|
+
else if (typeof truncateValue === 'string' && truncateValue) {
|
|
5507
|
+
if (oldKey.startsWith('parse date: ')) {
|
|
5508
|
+
let tempKey = oldKey.replaceAll('parse date: ', '');
|
|
5509
|
+
payload[tempKey] = dateFnsExports.parse(payload[tempKey], truncateValue, new Date());
|
|
5510
|
+
}
|
|
5511
|
+
else if (oldKey.startsWith('format date: ')) {
|
|
5512
|
+
let tempKey = oldKey.replaceAll('format date: ', '');
|
|
5513
|
+
payload[tempKey] = dateFnsExports.formatISO(payload[tempKey]);
|
|
5514
|
+
}
|
|
5515
|
+
else {
|
|
5516
|
+
additionalData[truncateValue] = payload[oldKey];
|
|
5517
|
+
delete payload[oldKey];
|
|
5518
|
+
}
|
|
5519
|
+
}
|
|
5520
|
+
});
|
|
5521
|
+
}
|
|
5522
|
+
let header = {
|
|
5523
|
+
'Content-Type': 'application/json',
|
|
5524
|
+
'Brand': (_o = (_m = context.structure) === null || _m === void 0 ? void 0 : _m.data) === null || _o === void 0 ? void 0 : _o.brandId,
|
|
5525
|
+
'Accept-Language': context.localeLanguage || 'en',
|
|
5526
|
+
};
|
|
5527
|
+
if (!!(context === null || context === void 0 ? void 0 : context.extraHeader))
|
|
5528
|
+
header = Object.assign(Object.assign({}, header), context === null || context === void 0 ? void 0 : context.extraHeader);
|
|
5529
|
+
if (!!((_q = (_p = context.structure) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q.extraHeader))
|
|
5530
|
+
header = Object.assign(Object.assign({}, header), (_s = (_r = context.structure) === null || _r === void 0 ? void 0 : _r.data) === null || _s === void 0 ? void 0 : _s.extraHeader);
|
|
5531
|
+
let requestEndpoint = '';
|
|
5532
|
+
if (context.isMobileForm) {
|
|
5533
|
+
const token = await context.getMobileToken();
|
|
5534
|
+
if (token.toLowerCase().startsWith('bearer')) {
|
|
5535
|
+
header['Authorization'] = token;
|
|
5536
|
+
requestEndpoint = (_u = (_t = context.structure) === null || _t === void 0 ? void 0 : _t.data) === null || _u === void 0 ? void 0 : _u.requestAppUrl;
|
|
5537
|
+
}
|
|
5538
|
+
else {
|
|
5539
|
+
header['verification-token'] = token;
|
|
5540
|
+
requestEndpoint = (_w = (_v = context.structure) === null || _v === void 0 ? void 0 : _v.data) === null || _w === void 0 ? void 0 : _w.requestAppCheckUrl;
|
|
5541
|
+
}
|
|
5542
|
+
}
|
|
5543
|
+
else {
|
|
5544
|
+
requestEndpoint = (_y = (_x = context.structure) === null || _x === void 0 ? void 0 : _x.data) === null || _y === void 0 ? void 0 : _y.requestUrl;
|
|
5545
|
+
if ((_0 = (_z = context.structure) === null || _z === void 0 ? void 0 : _z.data) === null || _0 === void 0 ? void 0 : _0.recaptchaKey) {
|
|
5546
|
+
const token = await grecaptcha.execute((_2 = (_1 = context.structure) === null || _1 === void 0 ? void 0 : _1.data) === null || _2 === void 0 ? void 0 : _2.recaptchaKey, { action: 'submit' });
|
|
5547
|
+
header['Recaptcha-Token'] = token;
|
|
5548
|
+
}
|
|
5549
|
+
}
|
|
5550
|
+
if (context.isDev)
|
|
5551
|
+
requestEndpoint = requestEndpoint.replaceAll('production=true', 'production=false');
|
|
5552
|
+
if (!requestEndpoint) {
|
|
5553
|
+
throw new Error('Request endpoint is not configured');
|
|
5554
|
+
}
|
|
5555
|
+
if (middleware) {
|
|
5556
|
+
const middlewareRes = middleware(payload, header, requestEndpoint);
|
|
5557
|
+
payload = Object.assign({}, middlewareRes.payload);
|
|
5558
|
+
header = Object.assign({}, middlewareRes.header);
|
|
5559
|
+
requestEndpoint = middlewareRes.url;
|
|
5560
|
+
}
|
|
5561
|
+
const response = await fetch(requestEndpoint, Object.assign({ headers: header, method: ((_4 = (_3 = context.structure) === null || _3 === void 0 ? void 0 : _3.data) === null || _4 === void 0 ? void 0 : _4.requestMethod) || 'POST' }, (((_7 = (_6 = (_5 = context.structure) === null || _5 === void 0 ? void 0 : _5.data) === null || _6 === void 0 ? void 0 : _6.requestMethod) === null || _7 === void 0 ? void 0 : _7.toLowerCase()) === 'get' ? {} : { body: JSON.stringify(payload) })));
|
|
5562
|
+
if (response.ok) {
|
|
5563
|
+
const result = await (response === null || response === void 0 ? void 0 : response.json());
|
|
5564
|
+
if (afterSuccess)
|
|
5565
|
+
await afterSuccess(payload, header);
|
|
5566
|
+
context.setSuccessCallback(result);
|
|
5567
|
+
setTimeout(() => {
|
|
5568
|
+
context.form.reset();
|
|
5569
|
+
context.form.rerender({ rerenderForm: true, rerenderAll: true });
|
|
5570
|
+
}, 100);
|
|
5571
|
+
}
|
|
5572
|
+
else {
|
|
5573
|
+
const contentType = response.headers.get('content-type');
|
|
5574
|
+
const errorText = (contentType === null || contentType === void 0 ? void 0 : contentType.includes('application/json')) ? (_9 = (_8 = (await response.json())) === null || _8 === void 0 ? void 0 : _8.message) === null || _9 === void 0 ? void 0 : _9.body : await response.text();
|
|
5575
|
+
throw new Error(errorText);
|
|
5576
|
+
}
|
|
5577
|
+
}
|
|
5578
|
+
catch (error) {
|
|
5579
|
+
console.error(error);
|
|
5580
|
+
context.setErrorCallback(error);
|
|
5581
|
+
}
|
|
5582
|
+
finally {
|
|
5583
|
+
context.setIsLoading(false);
|
|
5584
|
+
}
|
|
5585
|
+
};
|
|
5586
|
+
const functionHooks = {
|
|
5587
|
+
formLanguageChange,
|
|
5588
|
+
formErrorHandler,
|
|
5589
|
+
handleFormSubmit,
|
|
5590
|
+
formLoadingHandler,
|
|
5591
|
+
formSuccessHandler,
|
|
5592
|
+
formDidLoadHandler,
|
|
5593
|
+
formGetFormHandler,
|
|
5594
|
+
onFormSubmit,
|
|
5595
|
+
formStructureRenderedHandler,
|
|
5596
|
+
};
|
|
5597
|
+
|
|
4711
5598
|
const getPhoneValidator = (countryCode) => {
|
|
4712
5599
|
const phoneValidator = new AsYouType(Array.isArray(countryCode) ? undefined : countryCode);
|
|
4713
5600
|
if (Array.isArray(countryCode)) {
|