@caspeco/casper-ui-library 10.5.0 → 10.5.1
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/components/phone-input/country-data.d.ts +1 -1
- package/dist/components/phone-input/country-data.d.ts.map +1 -1
- package/dist/components/phone-input/country-data.js +2 -2
- package/dist/components/phone-input/country-list.d.ts +1 -1
- package/dist/components/phone-input/country-list.d.ts.map +1 -1
- package/dist/components/phone-input/country-list.js +1 -0
- package/dist/components/phone-input/country-selector.d.ts +1 -1
- package/dist/components/phone-input/country-selector.d.ts.map +1 -1
- package/dist/components/phone-input/phone-input-helpers.d.ts +1 -1
- package/dist/components/phone-input/phone-input-helpers.d.ts.map +1 -1
- package/dist/components/phone-input/phone-input-helpers.js +5 -5
- package/dist/components/phone-input/types.d.ts +1 -1
- package/dist/components/phone-input/types.d.ts.map +1 -1
- package/dist/components/phone-input/use-phone-input.d.ts +1 -1
- package/dist/components/phone-input/use-phone-input.d.ts.map +1 -1
- package/dist/components/phone-input/use-phone-input.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/ParseError.js +8 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/PhoneNumber.js +73 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/constants.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/format.js +22 -22
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/getCountries.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/RFC3966.js +8 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/applyInternationalSeparatorStyle.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/checkNumberLength.js +6 -6
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extension/createExtensionPattern.js +2 -4
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extension/extractExtension.js +4 -3
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extractCountryCallingCode.js +15 -14
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +21 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +21 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extractNationalNumber.js +7 -7
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +27 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/extractPhoneContext.js +4 -3
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/formatNationalNumberUsingFormat.js +9 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/getCountryAndCallingCodeFromOneOfThem.js +2 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getCountryByCallingCode.js +8 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getCountryByNationalNumber.js +14 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/getIddPrefix.js +2 -2
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getNumberType.js +30 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getPossibleCountriesForNumber.js +12 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isCallingCode.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isCountryCode.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isObject.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isViablePhoneNumber.js +1 -1
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/matchesEntirely.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/mergeArrays.js +8 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/parseDigits.js +1 -1
- package/dist/node_modules/libphonenumber-js/es6-modern/helpers/stripIddPrefix.js +16 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/isPossible.js +2 -2
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/isValid.js +3 -3
- package/dist/node_modules/libphonenumber-js/es6-modern/isValidPhoneNumber.js +20 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/metadata.js +254 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/normalizeArguments.js +26 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parse.js +100 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parseIncompletePhoneNumber.js +19 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parsePhoneNumber.js +9 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parsePhoneNumberWithError_.js +16 -0
- package/dist/node_modules/libphonenumber-js/es6-modern/parsePhoneNumber_.js +24 -0
- package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/tools/semver-compare.js +1 -1
- package/dist/node_modules/libphonenumber-js/max/es6/exports/PhoneNumber.js +10 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/getCountries.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/getCountryCallingCode.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/isSupportedCountry.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/isValidPhoneNumber.js +8 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/parsePhoneNumber.js +9 -0
- package/dist/node_modules/libphonenumber-js/max/es6/exports/withMetadataArgument.js +10 -0
- package/dist/node_modules/libphonenumber-js/{metadata.min.json.js → metadata.max.json.js} +3313 -254
- package/package.json +1 -1
- package/dist/node_modules/libphonenumber-js/es6/ParseError.js +0 -116
- package/dist/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -164
- package/dist/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -9
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -21
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -18
- package/dist/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -27
- package/dist/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -11
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -7
- package/dist/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -43
- package/dist/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -61
- package/dist/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -14
- package/dist/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js +0 -39
- package/dist/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -18
- package/dist/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js +0 -62
- package/dist/node_modules/libphonenumber-js/es6/metadata.js +0 -474
- package/dist/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -110
- package/dist/node_modules/libphonenumber-js/es6/parse.js +0 -103
- package/dist/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -48
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -9
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -58
- package/dist/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -66
- package/dist/node_modules/libphonenumber-js/min/exports/getCountries.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -8
- package/dist/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import e from "../metadata.js";
|
|
2
|
-
//#region ../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
|
|
2
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/helpers/getIddPrefix.js
|
|
3
3
|
var t = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
|
|
4
4
|
function n(n, r, i) {
|
|
5
|
-
|
|
5
|
+
let a = new e(i);
|
|
6
6
|
if (a.selectNumberingPlan(n || r), a.defaultIDDPrefix()) return a.defaultIDDPrefix();
|
|
7
7
|
if (t.test(a.IDDPrefix())) return a.IDDPrefix();
|
|
8
8
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import e from "../metadata.js";
|
|
2
|
+
import t from "./matchesEntirely.js";
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/helpers/getNumberType.js
|
|
4
|
+
var n = [
|
|
5
|
+
"MOBILE",
|
|
6
|
+
"PREMIUM_RATE",
|
|
7
|
+
"TOLL_FREE",
|
|
8
|
+
"SHARED_COST",
|
|
9
|
+
"VOIP",
|
|
10
|
+
"PERSONAL_NUMBER",
|
|
11
|
+
"PAGER",
|
|
12
|
+
"UAN",
|
|
13
|
+
"VOICEMAIL"
|
|
14
|
+
];
|
|
15
|
+
function r(r, a, o) {
|
|
16
|
+
if (a ||= {}, !r.country && !r.countryCallingCode) return;
|
|
17
|
+
let s = new e(o);
|
|
18
|
+
s.selectNumberingPlan(r.country || r.countryCallingCode);
|
|
19
|
+
let c = a.v2 ? r.nationalNumber : r.phone;
|
|
20
|
+
if (t(c, s.nationalNumberPattern())) {
|
|
21
|
+
if (i(c, "FIXED_LINE", s)) return s.type("MOBILE") && s.type("MOBILE").pattern() === "" || !s.type("MOBILE") || i(c, "MOBILE", s) ? "FIXED_LINE_OR_MOBILE" : "FIXED_LINE";
|
|
22
|
+
for (let e of n) if (i(c, e, s)) return e;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function i(e, n, r) {
|
|
26
|
+
let i = r.type(n);
|
|
27
|
+
return !i || !i.pattern() || i.possibleLengths() && i.possibleLengths().indexOf(e.length) < 0 ? !1 : t(e, i.pattern());
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { r as default, i as isNumberTypeEqualTo };
|
package/dist/node_modules/libphonenumber-js/es6-modern/helpers/getPossibleCountriesForNumber.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import e from "../metadata.js";
|
|
2
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/helpers/getPossibleCountriesForNumber.js
|
|
3
|
+
function t(t, r, i) {
|
|
4
|
+
let a = new e(i).getCountryCodesForCallingCode(t);
|
|
5
|
+
return a ? a.filter((e) => n(r, e, i)) : [];
|
|
6
|
+
}
|
|
7
|
+
function n(t, n, r) {
|
|
8
|
+
let i = new e(r);
|
|
9
|
+
return i.selectNumberingPlan(n), i.numberingPlan.possibleLengths().indexOf(t.length) >= 0;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as default };
|
package/dist/node_modules/libphonenumber-js/{es6 → es6-modern}/helpers/isViablePhoneNumber.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PLUS_CHARS as e, VALID_DIGITS as t, VALID_PUNCTUATION as n } from "../constants.js";
|
|
2
2
|
import r from "./extension/createExtensionPattern.js";
|
|
3
|
-
//#region ../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/helpers/isViablePhoneNumber.js
|
|
4
4
|
var i = "[" + t + "]{2}", a = "[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){3,}[" + n + t + "]*", o = RegExp("^[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){1,2}$", "i"), s = a + "(?:" + r() + ")?", c = RegExp("^" + i + "$|^" + s + "$", "i");
|
|
5
5
|
function l(e) {
|
|
6
6
|
return e.length >= 2 && c.test(e);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "../metadata.js";
|
|
2
|
+
import { VALID_DIGITS as t } from "../constants.js";
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/helpers/stripIddPrefix.js
|
|
4
|
+
var n = RegExp("([" + t + "])");
|
|
5
|
+
function r(t, r, i, a) {
|
|
6
|
+
if (!r) return;
|
|
7
|
+
let o = new e(a);
|
|
8
|
+
o.selectNumberingPlan(r || i);
|
|
9
|
+
let s = new RegExp(o.IDDPrefix());
|
|
10
|
+
if (t.search(s) !== 0) return;
|
|
11
|
+
t = t.slice(t.match(s)[0].length);
|
|
12
|
+
let c = t.match(n);
|
|
13
|
+
if (!(c && c[1] != null && c[1].length > 0 && c[1] === "0")) return t;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import e from "./metadata.js";
|
|
2
2
|
import t from "./helpers/checkNumberLength.js";
|
|
3
|
-
//#region ../../node_modules/libphonenumber-js/es6/isPossible.js
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/isPossible.js
|
|
4
4
|
function n(t, n, i) {
|
|
5
5
|
/* istanbul ignore if */
|
|
6
6
|
n === void 0 && (n = {});
|
|
7
|
-
|
|
7
|
+
let a = new e(i);
|
|
8
8
|
if (n.v2) {
|
|
9
9
|
if (!t.countryCallingCode) throw Error("Invalid phone number object passed");
|
|
10
10
|
a.selectNumberingPlan(t.country || t.countryCallingCode);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import e from "./metadata.js";
|
|
2
2
|
import t from "./helpers/matchesEntirely.js";
|
|
3
3
|
import n from "./helpers/getNumberType.js";
|
|
4
|
-
//#region ../../node_modules/libphonenumber-js/es6/isValid.js
|
|
4
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/isValid.js
|
|
5
5
|
function r(r, i, a) {
|
|
6
6
|
i ||= {};
|
|
7
|
-
|
|
7
|
+
let o = new e(a);
|
|
8
8
|
if (o.selectNumberingPlan(r.country || r.countryCallingCode), o.hasTypes()) return n(r, i, o.metadata) !== void 0;
|
|
9
|
-
|
|
9
|
+
let s = i.v2 ? r.nationalNumber : r.phone;
|
|
10
10
|
return t(s, o.nationalNumberPattern());
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import e from "./normalizeArguments.js";
|
|
2
|
+
import t from "./parsePhoneNumber_.js";
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/isValidPhoneNumber.js
|
|
4
|
+
function n() {
|
|
5
|
+
return n = Object.assign ? Object.assign.bind() : function(e) {
|
|
6
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
7
|
+
var n = arguments[t];
|
|
8
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
9
|
+
}
|
|
10
|
+
return e;
|
|
11
|
+
}, n.apply(null, arguments);
|
|
12
|
+
}
|
|
13
|
+
function r() {
|
|
14
|
+
let { text: r, options: i, metadata: a } = e(arguments);
|
|
15
|
+
i = n({}, i, { extract: !1 });
|
|
16
|
+
let o = t(r, i, a);
|
|
17
|
+
return o && o.isValid() || !1;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as default };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import e from "./tools/semver-compare.js";
|
|
2
|
+
import t from "./helpers/isObject.js";
|
|
3
|
+
import n from "./helpers/isCallingCode.js";
|
|
4
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/metadata.js
|
|
5
|
+
var r = "1.2.0", i = "1.7.35", a = " ext. ", o = class {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
f(e), this.metadata = e, g.call(this, e);
|
|
8
|
+
}
|
|
9
|
+
getCountries() {
|
|
10
|
+
return Object.keys(this.metadata.countries).filter((e) => e !== "001");
|
|
11
|
+
}
|
|
12
|
+
getCountryMetadata(e) {
|
|
13
|
+
return this.metadata.countries[e];
|
|
14
|
+
}
|
|
15
|
+
nonGeographic() {
|
|
16
|
+
if (!(this.v1 || this.v2 || this.v3)) return this.metadata.nonGeographic || this.metadata.nonGeographical;
|
|
17
|
+
}
|
|
18
|
+
hasCountry(e) {
|
|
19
|
+
return this.getCountryMetadata(e) !== void 0;
|
|
20
|
+
}
|
|
21
|
+
hasCallingCode(e) {
|
|
22
|
+
if (this.getCountryCodesForCallingCode(e)) return !0;
|
|
23
|
+
if (this.nonGeographic()) {
|
|
24
|
+
if (this.nonGeographic()[e]) return !0;
|
|
25
|
+
} else {
|
|
26
|
+
let t = this.countryCallingCodes()[e];
|
|
27
|
+
if (t && t.length === 1 && t[0] === "001") return !0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
isNonGeographicCallingCode(e) {
|
|
31
|
+
return this.nonGeographic() ? !!this.nonGeographic()[e] : !this.getCountryCodesForCallingCode(e);
|
|
32
|
+
}
|
|
33
|
+
country(e) {
|
|
34
|
+
return this.selectNumberingPlan(e);
|
|
35
|
+
}
|
|
36
|
+
selectNumberingPlan(e, t) {
|
|
37
|
+
let r, i;
|
|
38
|
+
if (e && (n(e) ? i = e : r = e), t && (i = t), r && r !== "001") {
|
|
39
|
+
let e = this.getCountryMetadata(r);
|
|
40
|
+
if (!e) throw Error(`Unknown country: ${r}`);
|
|
41
|
+
this.numberingPlan = new s(e, this);
|
|
42
|
+
} else if (i) {
|
|
43
|
+
if (!this.hasCallingCode(i)) throw Error(`Unknown calling code: ${i}`);
|
|
44
|
+
this.numberingPlan = new s(this.getNumberingPlanMetadata(i), this);
|
|
45
|
+
} else this.numberingPlan = void 0;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
getCountryCodesForCallingCode(e) {
|
|
49
|
+
let t = this.countryCallingCodes()[e];
|
|
50
|
+
if (t) return t.length === 1 && t[0].length === 3 ? void 0 : t;
|
|
51
|
+
}
|
|
52
|
+
getCountryCodeForCallingCode(e) {
|
|
53
|
+
let t = this.getCountryCodesForCallingCode(e);
|
|
54
|
+
if (t) return t[0];
|
|
55
|
+
}
|
|
56
|
+
getNumberingPlanMetadata(e) {
|
|
57
|
+
let t = this.getCountryCodeForCallingCode(e);
|
|
58
|
+
if (t) return this.getCountryMetadata(t);
|
|
59
|
+
if (this.nonGeographic()) {
|
|
60
|
+
let t = this.nonGeographic()[e];
|
|
61
|
+
if (t) return t;
|
|
62
|
+
} else {
|
|
63
|
+
let t = this.countryCallingCodes()[e];
|
|
64
|
+
if (t && t.length === 1 && t[0] === "001") return this.metadata.countries["001"];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
countryCallingCode() {
|
|
68
|
+
return this.numberingPlan.callingCode();
|
|
69
|
+
}
|
|
70
|
+
IDDPrefix() {
|
|
71
|
+
return this.numberingPlan.IDDPrefix();
|
|
72
|
+
}
|
|
73
|
+
defaultIDDPrefix() {
|
|
74
|
+
return this.numberingPlan.defaultIDDPrefix();
|
|
75
|
+
}
|
|
76
|
+
nationalNumberPattern() {
|
|
77
|
+
return this.numberingPlan.nationalNumberPattern();
|
|
78
|
+
}
|
|
79
|
+
possibleLengths() {
|
|
80
|
+
return this.numberingPlan.possibleLengths();
|
|
81
|
+
}
|
|
82
|
+
formats() {
|
|
83
|
+
return this.numberingPlan.formats();
|
|
84
|
+
}
|
|
85
|
+
nationalPrefixForParsing() {
|
|
86
|
+
return this.numberingPlan.nationalPrefixForParsing();
|
|
87
|
+
}
|
|
88
|
+
nationalPrefixTransformRule() {
|
|
89
|
+
return this.numberingPlan.nationalPrefixTransformRule();
|
|
90
|
+
}
|
|
91
|
+
leadingDigits() {
|
|
92
|
+
return this.numberingPlan.leadingDigits();
|
|
93
|
+
}
|
|
94
|
+
hasTypes() {
|
|
95
|
+
return this.numberingPlan.hasTypes();
|
|
96
|
+
}
|
|
97
|
+
type(e) {
|
|
98
|
+
return this.numberingPlan.type(e);
|
|
99
|
+
}
|
|
100
|
+
ext() {
|
|
101
|
+
return this.numberingPlan.ext();
|
|
102
|
+
}
|
|
103
|
+
countryCallingCodes() {
|
|
104
|
+
return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes;
|
|
105
|
+
}
|
|
106
|
+
chooseCountryByCountryCallingCode(e) {
|
|
107
|
+
return this.selectNumberingPlan(e);
|
|
108
|
+
}
|
|
109
|
+
hasSelectedNumberingPlan() {
|
|
110
|
+
return this.numberingPlan !== void 0;
|
|
111
|
+
}
|
|
112
|
+
}, s = class {
|
|
113
|
+
constructor(e, t) {
|
|
114
|
+
this.globalMetadataObject = t, this.metadata = e, g.call(this, t.metadata);
|
|
115
|
+
}
|
|
116
|
+
callingCode() {
|
|
117
|
+
return this.metadata[0];
|
|
118
|
+
}
|
|
119
|
+
_getDefaultCountryMetadataForThisCallingCode() {
|
|
120
|
+
return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
|
|
121
|
+
}
|
|
122
|
+
getDefaultCountryMetadataForRegion() {
|
|
123
|
+
return this._getDefaultCountryMetadataForThisCallingCode();
|
|
124
|
+
}
|
|
125
|
+
IDDPrefix() {
|
|
126
|
+
if (!(this.v1 || this.v2)) return this.metadata[1];
|
|
127
|
+
}
|
|
128
|
+
defaultIDDPrefix() {
|
|
129
|
+
if (!(this.v1 || this.v2)) return this.metadata[12];
|
|
130
|
+
}
|
|
131
|
+
nationalNumberPattern() {
|
|
132
|
+
return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2];
|
|
133
|
+
}
|
|
134
|
+
possibleLengths() {
|
|
135
|
+
if (!this.v1) return this.metadata[this.v2 ? 2 : 3];
|
|
136
|
+
}
|
|
137
|
+
_getFormats(e) {
|
|
138
|
+
return e[this.v1 ? 2 : this.v2 ? 3 : 4];
|
|
139
|
+
}
|
|
140
|
+
formats() {
|
|
141
|
+
return (this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || []).map((e) => new c(e, this));
|
|
142
|
+
}
|
|
143
|
+
nationalPrefix() {
|
|
144
|
+
return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
|
|
145
|
+
}
|
|
146
|
+
_getNationalPrefixFormattingRule(e) {
|
|
147
|
+
return e[this.v1 ? 4 : this.v2 ? 5 : 6];
|
|
148
|
+
}
|
|
149
|
+
nationalPrefixFormattingRule() {
|
|
150
|
+
return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
|
|
151
|
+
}
|
|
152
|
+
_nationalPrefixForParsing() {
|
|
153
|
+
return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
|
|
154
|
+
}
|
|
155
|
+
nationalPrefixForParsing() {
|
|
156
|
+
return this._nationalPrefixForParsing() || this.nationalPrefix();
|
|
157
|
+
}
|
|
158
|
+
nationalPrefixTransformRule() {
|
|
159
|
+
return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
|
|
160
|
+
}
|
|
161
|
+
_getNationalPrefixIsOptionalWhenFormatting() {
|
|
162
|
+
return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
|
|
163
|
+
}
|
|
164
|
+
nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
|
|
165
|
+
return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
|
|
166
|
+
}
|
|
167
|
+
leadingDigits() {
|
|
168
|
+
return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
|
|
169
|
+
}
|
|
170
|
+
types() {
|
|
171
|
+
return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
|
|
172
|
+
}
|
|
173
|
+
hasTypes() {
|
|
174
|
+
return this.types() && this.types().length === 0 ? !1 : !!this.types();
|
|
175
|
+
}
|
|
176
|
+
type(e) {
|
|
177
|
+
if (this.hasTypes() && d(this.types(), e)) return new u(d(this.types(), e), this);
|
|
178
|
+
}
|
|
179
|
+
ext() {
|
|
180
|
+
return this.v1 || this.v2 ? a : this.metadata[13] || a;
|
|
181
|
+
}
|
|
182
|
+
}, c = class {
|
|
183
|
+
constructor(e, t) {
|
|
184
|
+
this._format = e, this.metadata = t;
|
|
185
|
+
}
|
|
186
|
+
pattern() {
|
|
187
|
+
return this._format[0];
|
|
188
|
+
}
|
|
189
|
+
format() {
|
|
190
|
+
return this._format[1];
|
|
191
|
+
}
|
|
192
|
+
leadingDigitsPatterns() {
|
|
193
|
+
return this._format[2] || [];
|
|
194
|
+
}
|
|
195
|
+
nationalPrefixFormattingRule() {
|
|
196
|
+
return this._format[3] || this.metadata.nationalPrefixFormattingRule();
|
|
197
|
+
}
|
|
198
|
+
nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
|
|
199
|
+
return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
200
|
+
}
|
|
201
|
+
nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
|
|
202
|
+
return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
203
|
+
}
|
|
204
|
+
usesNationalPrefix() {
|
|
205
|
+
return !!(this.nationalPrefixFormattingRule() && !l.test(this.nationalPrefixFormattingRule()));
|
|
206
|
+
}
|
|
207
|
+
internationalFormat() {
|
|
208
|
+
return this._format[5] || this.format();
|
|
209
|
+
}
|
|
210
|
+
}, l = /^\(?\$1\)?$/, u = class {
|
|
211
|
+
constructor(e, t) {
|
|
212
|
+
this.type = e, this.metadata = t;
|
|
213
|
+
}
|
|
214
|
+
pattern() {
|
|
215
|
+
return this.metadata.v1 ? this.type : this.type[0];
|
|
216
|
+
}
|
|
217
|
+
possibleLengths() {
|
|
218
|
+
if (!this.metadata.v1) return this.type[1] || this.metadata.possibleLengths();
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
function d(e, t) {
|
|
222
|
+
switch (t) {
|
|
223
|
+
case "FIXED_LINE": return e[0];
|
|
224
|
+
case "MOBILE": return e[1];
|
|
225
|
+
case "TOLL_FREE": return e[2];
|
|
226
|
+
case "PREMIUM_RATE": return e[3];
|
|
227
|
+
case "PERSONAL_NUMBER": return e[4];
|
|
228
|
+
case "VOICEMAIL": return e[5];
|
|
229
|
+
case "UAN": return e[6];
|
|
230
|
+
case "PAGER": return e[7];
|
|
231
|
+
case "VOIP": return e[8];
|
|
232
|
+
case "SHARED_COST": return e[9];
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function f(e) {
|
|
236
|
+
if (!e) throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
237
|
+
if (!t(e) || !t(e.countries)) throw Error(`[libphonenumber-js] \`metadata\` argument was passed but it's not a valid metadata. Must be an object having \`.countries\` child object property. Got ${t(e) ? "an object of shape: { " + Object.keys(e).join(", ") + " }" : "a " + p(e) + ": " + e}.`);
|
|
238
|
+
}
|
|
239
|
+
/* istanbul ignore next */
|
|
240
|
+
var p = (e) => typeof e;
|
|
241
|
+
function m(e, t) {
|
|
242
|
+
let n = new o(t);
|
|
243
|
+
if (n.hasCountry(e)) return n.selectNumberingPlan(e).countryCallingCode();
|
|
244
|
+
throw Error(`Unknown country: ${e}`);
|
|
245
|
+
}
|
|
246
|
+
function h(e, t) {
|
|
247
|
+
return t.countries.hasOwnProperty(e);
|
|
248
|
+
}
|
|
249
|
+
function g(t) {
|
|
250
|
+
let { version: n } = t;
|
|
251
|
+
typeof n == "number" ? (this.v1 = n === 1, this.v2 = n === 2, this.v3 = n === 3, this.v4 = n === 4) : n ? e(n, r) === -1 ? this.v2 = !0 : e(n, i) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
export { o as default, m as getCountryCallingCode, h as isSupportedCountry, f as validateMetadata };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import e from "./helpers/isObject.js";
|
|
2
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/normalizeArguments.js
|
|
3
|
+
function t() {
|
|
4
|
+
return t = Object.assign ? Object.assign.bind() : function(e) {
|
|
5
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
6
|
+
var n = arguments[t];
|
|
7
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
8
|
+
}
|
|
9
|
+
return e;
|
|
10
|
+
}, t.apply(null, arguments);
|
|
11
|
+
}
|
|
12
|
+
function n(n) {
|
|
13
|
+
let [r, i, a, o] = Array.prototype.slice.call(n), s, c, l;
|
|
14
|
+
if (typeof r == "string") s = r;
|
|
15
|
+
else throw TypeError("A text for parsing must be a string.");
|
|
16
|
+
if (!i || typeof i == "string") o ? (c = a, l = o) : (c = void 0, l = a), i && (c = t({ defaultCountry: i }, c));
|
|
17
|
+
else if (e(i)) a ? (c = i, l = a) : l = i;
|
|
18
|
+
else throw Error(`Invalid second argument: ${i}`);
|
|
19
|
+
return {
|
|
20
|
+
text: s,
|
|
21
|
+
options: c,
|
|
22
|
+
metadata: l
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { n as default };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import e from "./metadata.js";
|
|
2
|
+
import { isPossibleNumber as t } from "./isPossible.js";
|
|
3
|
+
import n from "./helpers/matchesEntirely.js";
|
|
4
|
+
import { PLUS_CHARS as r, VALID_DIGITS as i } from "./constants.js";
|
|
5
|
+
import a from "./helpers/getCountryByCallingCode.js";
|
|
6
|
+
import o from "./helpers/extractNationalNumber.js";
|
|
7
|
+
import s from "./helpers/extractCountryCallingCode.js";
|
|
8
|
+
import c, { isViablePhoneNumberStart as l } from "./helpers/isViablePhoneNumber.js";
|
|
9
|
+
import u from "./PhoneNumber.js";
|
|
10
|
+
import d from "./ParseError.js";
|
|
11
|
+
import f from "./helpers/extension/extractExtension.js";
|
|
12
|
+
import p from "./parseIncompletePhoneNumber.js";
|
|
13
|
+
import m from "./helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js";
|
|
14
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/parse.js
|
|
15
|
+
var h = 250, g = RegExp("[" + r + i + "]"), _ = RegExp("[^" + i + "#]+$");
|
|
16
|
+
function v(r, i, a) {
|
|
17
|
+
i ||= {};
|
|
18
|
+
let o = new e(a);
|
|
19
|
+
if (i.defaultCountry && !o.hasCountry(i.defaultCountry)) throw i.v2 ? new d("INVALID_COUNTRY") : Error(`Unknown country: ${i.defaultCountry}`);
|
|
20
|
+
let { number: s, ext: c, error: l } = b(r, i.v2, i.extract);
|
|
21
|
+
if (!s) {
|
|
22
|
+
if (i.v2) throw l === "TOO_SHORT" ? new d("TOO_SHORT") : new d("NOT_A_NUMBER");
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
let { country: f, nationalNumber: p, countryCallingCode: m, countryCallingCodeSource: h, carrierCode: g } = S(s, i.defaultCountry, i.defaultCallingCode, o);
|
|
26
|
+
if (!o.hasSelectedNumberingPlan()) {
|
|
27
|
+
if (i.v2) throw new d("INVALID_COUNTRY");
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
if (!p || p.length < 2) {
|
|
31
|
+
/* istanbul ignore if */
|
|
32
|
+
if (i.v2) throw new d("TOO_SHORT");
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
if (p.length > 17) {
|
|
36
|
+
if (i.v2) throw new d("TOO_LONG");
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
if (i.v2) {
|
|
40
|
+
let e = new u(m, p, o.metadata);
|
|
41
|
+
return f && (e.country = f), g && (e.carrierCode = g), c && (e.ext = c), e.__countryCallingCodeSource = h, e;
|
|
42
|
+
}
|
|
43
|
+
let _ = (i.extended ? o.hasSelectedNumberingPlan() : f) ? n(p, o.nationalNumberPattern()) : !1;
|
|
44
|
+
return i.extended ? {
|
|
45
|
+
country: f,
|
|
46
|
+
countryCallingCode: m,
|
|
47
|
+
carrierCode: g,
|
|
48
|
+
valid: _,
|
|
49
|
+
possible: _ ? !0 : !!(i.extended === !0 && o.possibleLengths() && t(p, o)),
|
|
50
|
+
phone: p,
|
|
51
|
+
ext: c
|
|
52
|
+
} : _ ? x(f, p, c) : {};
|
|
53
|
+
}
|
|
54
|
+
function y(e, t, n) {
|
|
55
|
+
if (!e) return;
|
|
56
|
+
if (e.length > h) {
|
|
57
|
+
if (n) throw new d("TOO_LONG");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (t === !1) return e;
|
|
61
|
+
let r = e.search(g);
|
|
62
|
+
if (!(r < 0)) return e.slice(r).replace(_, "");
|
|
63
|
+
}
|
|
64
|
+
function b(e, t, n) {
|
|
65
|
+
let r = m(e, { extractFormattedPhoneNumber: (e) => y(e, n, t) });
|
|
66
|
+
if (!r) return {};
|
|
67
|
+
if (!c(r)) return l(r) ? { error: "TOO_SHORT" } : {};
|
|
68
|
+
let i = f(r);
|
|
69
|
+
return i.ext ? i : { number: r };
|
|
70
|
+
}
|
|
71
|
+
function x(e, t, n) {
|
|
72
|
+
let r = {
|
|
73
|
+
country: e,
|
|
74
|
+
phone: t
|
|
75
|
+
};
|
|
76
|
+
return n && (r.ext = n), r;
|
|
77
|
+
}
|
|
78
|
+
function S(e, t, n, r) {
|
|
79
|
+
let { countryCallingCodeSource: i, countryCallingCode: c, number: l } = s(p(e), void 0, t, n, r.metadata), u;
|
|
80
|
+
if (c) r.selectNumberingPlan(c);
|
|
81
|
+
else if (l && (t || n)) t ? (u = t, r.selectNumberingPlan(t), c = r.numberingPlan.callingCode()) : (r.selectNumberingPlan(n), c = n);
|
|
82
|
+
else return {};
|
|
83
|
+
if (!l) return {
|
|
84
|
+
countryCallingCodeSource: i,
|
|
85
|
+
countryCallingCode: c
|
|
86
|
+
};
|
|
87
|
+
let { nationalNumber: d, carrierCode: f } = o(p(l), void 0, r), m = a(c, {
|
|
88
|
+
nationalNumber: d,
|
|
89
|
+
metadata: r
|
|
90
|
+
});
|
|
91
|
+
return m && (u = m, m === "001" || r.selectNumberingPlan(u)), {
|
|
92
|
+
country: u,
|
|
93
|
+
countryCallingCode: c,
|
|
94
|
+
countryCallingCodeSource: i,
|
|
95
|
+
nationalNumber: d,
|
|
96
|
+
carrierCode: f
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { v as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { parseDigit as e } from "./helpers/parseDigits.js";
|
|
2
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/parseIncompletePhoneNumber.js
|
|
3
|
+
function t(e) {
|
|
4
|
+
let t = "";
|
|
5
|
+
for (let r of e.split("")) t += n(r, t) || "";
|
|
6
|
+
return t;
|
|
7
|
+
}
|
|
8
|
+
function n(t, n, r) {
|
|
9
|
+
if (t === "+") {
|
|
10
|
+
if (n) {
|
|
11
|
+
typeof r == "function" && r("end");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
return "+";
|
|
15
|
+
}
|
|
16
|
+
return e(t);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as default, n as parsePhoneNumberCharacter };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from "./normalizeArguments.js";
|
|
2
|
+
import t from "./parsePhoneNumber_.js";
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/parsePhoneNumber.js
|
|
4
|
+
function n() {
|
|
5
|
+
let { text: n, options: r, metadata: i } = e(arguments);
|
|
6
|
+
return t(n, r, i);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "./parse.js";
|
|
2
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/parsePhoneNumberWithError_.js
|
|
3
|
+
function t() {
|
|
4
|
+
return t = Object.assign ? Object.assign.bind() : function(e) {
|
|
5
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
6
|
+
var n = arguments[t];
|
|
7
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
8
|
+
}
|
|
9
|
+
return e;
|
|
10
|
+
}, t.apply(null, arguments);
|
|
11
|
+
}
|
|
12
|
+
function n(n, r, i) {
|
|
13
|
+
return e(n, t({}, r, { v2: !0 }), i);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isSupportedCountry as e } from "./metadata.js";
|
|
2
|
+
import t from "./ParseError.js";
|
|
3
|
+
import n from "./parsePhoneNumberWithError_.js";
|
|
4
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/parsePhoneNumber_.js
|
|
5
|
+
function r() {
|
|
6
|
+
return r = Object.assign ? Object.assign.bind() : function(e) {
|
|
7
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
8
|
+
var n = arguments[t];
|
|
9
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
10
|
+
}
|
|
11
|
+
return e;
|
|
12
|
+
}, r.apply(null, arguments);
|
|
13
|
+
}
|
|
14
|
+
function i(i, a, o) {
|
|
15
|
+
a && a.defaultCountry && !e(a.defaultCountry, o) && (a = r({}, a, { defaultCountry: void 0 }));
|
|
16
|
+
try {
|
|
17
|
+
return n(i, a, o);
|
|
18
|
+
} catch (e) {
|
|
19
|
+
/* istanbul ignore else */
|
|
20
|
+
if (!(e instanceof t)) throw e;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/libphonenumber-js/es6/tools/semver-compare.js
|
|
1
|
+
//#region ../../node_modules/libphonenumber-js/es6-modern/tools/semver-compare.js
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
e = e.split("-"), t = t.split("-");
|
|
4
4
|
for (var n = e[0].split("."), r = t[0].split("."), i = 0; i < 3; i++) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "../../../metadata.max.json.js";
|
|
2
|
+
import t from "../../../es6-modern/PhoneNumber.js";
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/max/es6/exports/PhoneNumber.js
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
super(t, e);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as PhoneNumber };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "./withMetadataArgument.js";
|
|
2
|
+
import t from "../../../es6-modern/getCountries.js";
|
|
3
|
+
//#region ../../node_modules/libphonenumber-js/max/es6/exports/getCountries.js
|
|
4
|
+
function n() {
|
|
5
|
+
return e(t, arguments);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as getCountries };
|