@quidgest/ui 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/json/api.json +1109 -3
  3. package/dist/manifest/components.json +1 -0
  4. package/dist/ui.css +1181 -5
  5. package/dist/ui.esm.js +1444 -843
  6. package/dist/ui.js +1405 -804
  7. package/dist/ui.min.css +2 -1
  8. package/dist/ui.min.js +1405 -804
  9. package/dist/ui.scss +373 -7
  10. package/esm/components/QField/QField.d.ts.map +1 -1
  11. package/esm/components/QField/QField.vue.js +1 -1
  12. package/esm/components/QInputGroup/QInputGroup.d.ts +147 -3
  13. package/esm/components/QInputGroup/QInputGroup.d.ts.map +1 -1
  14. package/esm/components/QInputGroup/QInputGroup.vue.js +32 -23
  15. package/esm/components/QInputGroup/index.d.ts +81 -4
  16. package/esm/components/QInputGroup/index.d.ts.map +1 -1
  17. package/esm/components/QList/QList.d.ts.map +1 -1
  18. package/esm/components/QList/QList.vue.js +3 -1
  19. package/esm/components/QList/QListItem.d.ts.map +1 -1
  20. package/esm/components/QList/QListItem.vue.js +24 -28
  21. package/esm/components/QList/types.d.ts +1 -1
  22. package/esm/components/QOverlay/types.d.ts +3 -1
  23. package/esm/components/QOverlay/types.d.ts.map +1 -1
  24. package/esm/components/QPhoneField/QPhoneField.d.ts +2263 -0
  25. package/esm/components/QPhoneField/QPhoneField.d.ts.map +1 -0
  26. package/esm/components/QPhoneField/QPhoneField.vue.js +478 -0
  27. package/esm/components/QPhoneField/QPhoneField2.vue.js +5 -0
  28. package/esm/components/QPhoneField/constants.d.ts +11 -0
  29. package/esm/components/QPhoneField/constants.d.ts.map +1 -0
  30. package/esm/components/QPhoneField/constants.js +14 -0
  31. package/esm/components/QPhoneField/index.d.ts +1253 -0
  32. package/esm/components/QPhoneField/index.d.ts.map +1 -0
  33. package/esm/components/QPhoneField/index.js +6 -0
  34. package/esm/components/QPhoneField/types.d.ts +108 -0
  35. package/esm/components/QPhoneField/types.d.ts.map +1 -0
  36. package/esm/components/QSelect/QSelect.d.ts +16 -1
  37. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  38. package/esm/components/QSelect/QSelect.vue.js +158 -129
  39. package/esm/components/QSelect/index.d.ts +31 -3
  40. package/esm/components/QSelect/index.d.ts.map +1 -1
  41. package/esm/components/QSelect/types.d.ts +13 -0
  42. package/esm/components/QSelect/types.d.ts.map +1 -1
  43. package/esm/components/index.d.ts +1 -0
  44. package/esm/components/index.d.ts.map +1 -1
  45. package/esm/components/index.js +36 -34
  46. package/esm/composables/useDialog/index.d.ts +2 -88
  47. package/esm/composables/useDialog/index.d.ts.map +1 -1
  48. package/esm/composables/useDialog/index.js +6 -6
  49. package/esm/composables/useDialog/types.d.ts +14 -4
  50. package/esm/composables/useDialog/types.d.ts.map +1 -1
  51. package/esm/index.d.ts +1 -0
  52. package/esm/vendors/country-flag-icons/modules/countries.json.js +4 -0
  53. package/esm/vendors/country-flag-icons/modules/hasFlag.js +7 -0
  54. package/esm/vendors/libphonenumber-js/es6/AsYouType.js +312 -0
  55. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +142 -0
  56. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +145 -0
  57. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +45 -0
  58. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.js +258 -0
  59. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.util.js +57 -0
  60. package/esm/vendors/libphonenumber-js/es6/AsYouTypeParser.js +242 -0
  61. package/esm/vendors/libphonenumber-js/es6/AsYouTypeState.js +115 -0
  62. package/esm/vendors/libphonenumber-js/es6/ParseError.js +116 -0
  63. package/esm/vendors/libphonenumber-js/es6/PhoneNumber.js +164 -0
  64. package/esm/vendors/libphonenumber-js/es6/constants.js +4 -0
  65. package/esm/vendors/libphonenumber-js/es6/format.js +77 -0
  66. package/esm/vendors/libphonenumber-js/es6/formatIncompletePhoneNumber.js +7 -0
  67. package/esm/vendors/libphonenumber-js/es6/getCountries.js +7 -0
  68. package/esm/vendors/libphonenumber-js/es6/getExampleNumber.js +7 -0
  69. package/esm/vendors/libphonenumber-js/es6/helpers/RFC3966.js +9 -0
  70. package/esm/vendors/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +7 -0
  71. package/esm/vendors/libphonenumber-js/es6/helpers/checkNumberLength.js +21 -0
  72. package/esm/vendors/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +11 -0
  73. package/esm/vendors/libphonenumber-js/es6/helpers/extension/extractExtension.js +16 -0
  74. package/esm/vendors/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +36 -0
  75. package/esm/vendors/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +21 -0
  76. package/esm/vendors/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +18 -0
  77. package/esm/vendors/libphonenumber-js/es6/helpers/extractNationalNumber.js +27 -0
  78. package/esm/vendors/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +27 -0
  79. package/esm/vendors/libphonenumber-js/es6/helpers/extractPhoneContext.js +15 -0
  80. package/esm/vendors/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +11 -0
  81. package/esm/vendors/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js +13 -0
  82. package/esm/vendors/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +12 -0
  83. package/esm/vendors/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +43 -0
  84. package/esm/vendors/libphonenumber-js/es6/helpers/getIddPrefix.js +10 -0
  85. package/esm/vendors/libphonenumber-js/es6/helpers/getNumberType.js +61 -0
  86. package/esm/vendors/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +14 -0
  87. package/esm/vendors/libphonenumber-js/es6/helpers/isCallingCode.js +7 -0
  88. package/esm/vendors/libphonenumber-js/es6/helpers/isCountryCode.js +7 -0
  89. package/esm/vendors/libphonenumber-js/es6/helpers/isObject.js +7 -0
  90. package/esm/vendors/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +12 -0
  91. package/esm/vendors/libphonenumber-js/es6/helpers/matchesEntirely.js +6 -0
  92. package/esm/vendors/libphonenumber-js/es6/helpers/mergeArrays.js +39 -0
  93. package/esm/vendors/libphonenumber-js/es6/helpers/parseDigits.js +82 -0
  94. package/esm/vendors/libphonenumber-js/es6/helpers/stripIddPrefix.js +18 -0
  95. package/esm/vendors/libphonenumber-js/es6/isPossible.js +32 -0
  96. package/esm/vendors/libphonenumber-js/es6/isValid.js +11 -0
  97. package/esm/vendors/libphonenumber-js/es6/metadata.js +474 -0
  98. package/esm/vendors/libphonenumber-js/es6/normalizeArguments.js +110 -0
  99. package/esm/vendors/libphonenumber-js/es6/parse.js +103 -0
  100. package/esm/vendors/libphonenumber-js/es6/parseIncompletePhoneNumber.js +48 -0
  101. package/esm/vendors/libphonenumber-js/es6/parsePhoneNumber.js +9 -0
  102. package/esm/vendors/libphonenumber-js/es6/parsePhoneNumberWithError_.js +58 -0
  103. package/esm/vendors/libphonenumber-js/es6/parsePhoneNumber_.js +66 -0
  104. package/esm/vendors/libphonenumber-js/es6/tools/semver-compare.js +14 -0
  105. package/esm/vendors/libphonenumber-js/examples.mobile.json.js +250 -0
  106. package/esm/vendors/libphonenumber-js/max/exports/AsYouType.js +9 -0
  107. package/esm/vendors/libphonenumber-js/max/exports/formatIncompletePhoneNumber.js +8 -0
  108. package/esm/vendors/libphonenumber-js/max/exports/getCountries.js +8 -0
  109. package/esm/vendors/libphonenumber-js/max/exports/getCountryCallingCode.js +8 -0
  110. package/esm/vendors/libphonenumber-js/max/exports/getExampleNumber.js +8 -0
  111. package/esm/vendors/libphonenumber-js/max/exports/isSupportedCountry.js +8 -0
  112. package/esm/vendors/libphonenumber-js/max/exports/parsePhoneNumber.js +8 -0
  113. package/esm/vendors/libphonenumber-js/max/exports/withMetadataArgument.js +8 -0
  114. package/esm/vendors/libphonenumber-js/metadata.max.json.js +10489 -0
  115. package/package.json +3 -1
@@ -0,0 +1,82 @@
1
+ //#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/parseDigits.js
2
+ function e(e, n) {
3
+ var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
4
+ if (r) return (r = r.call(e)).next.bind(r);
5
+ if (Array.isArray(e) || (r = t(e)) || n && e && typeof e.length == "number") {
6
+ r && (e = r);
7
+ var i = 0;
8
+ return function() {
9
+ return i >= e.length ? { done: !0 } : {
10
+ done: !1,
11
+ value: e[i++]
12
+ };
13
+ };
14
+ }
15
+ throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16
+ }
17
+ function t(e, t) {
18
+ if (e) {
19
+ if (typeof e == "string") return n(e, t);
20
+ var r = {}.toString.call(e).slice(8, -1);
21
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? n(e, t) : void 0;
22
+ }
23
+ }
24
+ function n(e, t) {
25
+ (t == null || t > e.length) && (t = e.length);
26
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
27
+ return r;
28
+ }
29
+ var r = {
30
+ 0: "0",
31
+ 1: "1",
32
+ 2: "2",
33
+ 3: "3",
34
+ 4: "4",
35
+ 5: "5",
36
+ 6: "6",
37
+ 7: "7",
38
+ 8: "8",
39
+ 9: "9",
40
+ "0": "0",
41
+ "1": "1",
42
+ "2": "2",
43
+ "3": "3",
44
+ "4": "4",
45
+ "5": "5",
46
+ "6": "6",
47
+ "7": "7",
48
+ "8": "8",
49
+ "9": "9",
50
+ "٠": "0",
51
+ "١": "1",
52
+ "٢": "2",
53
+ "٣": "3",
54
+ "٤": "4",
55
+ "٥": "5",
56
+ "٦": "6",
57
+ "٧": "7",
58
+ "٨": "8",
59
+ "٩": "9",
60
+ "۰": "0",
61
+ "۱": "1",
62
+ "۲": "2",
63
+ "۳": "3",
64
+ "۴": "4",
65
+ "۵": "5",
66
+ "۶": "6",
67
+ "۷": "7",
68
+ "۸": "8",
69
+ "۹": "9"
70
+ };
71
+ function i(e) {
72
+ return r[e];
73
+ }
74
+ function a(t) {
75
+ for (var n = "", r = e(t.split("")), a; !(a = r()).done;) {
76
+ var o = a.value, s = i(o);
77
+ s && (n += s);
78
+ }
79
+ return n;
80
+ }
81
+ //#endregion
82
+ export { r as DIGITS, a as default, i as parseDigit };
@@ -0,0 +1,18 @@
1
+ import { VALID_DIGITS as e } from "../constants.js";
2
+ import t from "../metadata.js";
3
+ //#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
4
+ var n = RegExp("([" + e + "])");
5
+ function r(e, r, i, a) {
6
+ if (r) {
7
+ var o = new t(a);
8
+ o.selectNumberingPlan(r || i);
9
+ var s = new RegExp(o.IDDPrefix());
10
+ if (e.search(s) === 0) {
11
+ e = e.slice(e.match(s)[0].length);
12
+ var c = e.match(n);
13
+ if (!(c && c[1] != null && c[1].length > 0 && c[1] === "0")) return e;
14
+ }
15
+ }
16
+ }
17
+ //#endregion
18
+ export { r as default };
@@ -0,0 +1,32 @@
1
+ import e from "./metadata.js";
2
+ import t from "./helpers/checkNumberLength.js";
3
+ //#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/isPossible.js
4
+ function n(t, n, i) {
5
+ /* istanbul ignore if */
6
+ n === void 0 && (n = {});
7
+ var a = new e(i);
8
+ if (n.v2) {
9
+ if (!t.countryCallingCode) throw Error("Invalid phone number object passed");
10
+ a.selectNumberingPlan(t.country || t.countryCallingCode);
11
+ } else {
12
+ if (!t.phone) return !1;
13
+ if (t.country) {
14
+ if (!a.hasCountry(t.country)) throw Error(`Unknown country: ${t.country}`);
15
+ a.selectNumberingPlan(t.country);
16
+ } else {
17
+ if (!t.countryCallingCode) throw Error("Invalid phone number object passed");
18
+ a.selectNumberingPlan(t.countryCallingCode);
19
+ }
20
+ }
21
+ if (a.possibleLengths()) return r(t.phone || t.nationalNumber, a);
22
+ if (t.countryCallingCode && a.isNonGeographicCallingCode(t.countryCallingCode)) return !0;
23
+ throw Error("Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.");
24
+ }
25
+ function r(e, n) {
26
+ switch (t(e, void 0, n)) {
27
+ case "IS_POSSIBLE": return !0;
28
+ default: return !1;
29
+ }
30
+ }
31
+ //#endregion
32
+ export { n as default, r as isPossibleNumber };
@@ -0,0 +1,11 @@
1
+ import e from "./metadata.js";
2
+ import t from "./helpers/matchesEntirely.js";
3
+ import n from "./helpers/getNumberType.js";
4
+ //#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/isValid.js
5
+ function r(r, i, a) {
6
+ i ||= {};
7
+ var o = new e(a);
8
+ return o.selectNumberingPlan(r.country || r.countryCallingCode), o.hasTypes() ? n(r, i, o.metadata) !== void 0 : t(i.v2 ? r.nationalNumber : r.phone, o.nationalNumberPattern());
9
+ }
10
+ //#endregion
11
+ export { r as default };
@@ -0,0 +1,474 @@
1
+ import e from "./helpers/isObject.js";
2
+ import t from "./tools/semver-compare.js";
3
+ import n from "./helpers/isCallingCode.js";
4
+ //#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/metadata.js
5
+ function r(e) {
6
+ "@babel/helpers - typeof";
7
+ return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
8
+ return typeof e;
9
+ } : function(e) {
10
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
11
+ }, r(e);
12
+ }
13
+ function i(e, t) {
14
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
15
+ }
16
+ function a(e, t) {
17
+ for (var n = 0; n < t.length; n++) {
18
+ var r = t[n];
19
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, s(r.key), r);
20
+ }
21
+ }
22
+ function o(e, t, n) {
23
+ return t && a(e.prototype, t), n && a(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
24
+ }
25
+ function s(e) {
26
+ var t = c(e, "string");
27
+ return r(t) == "symbol" ? t : t + "";
28
+ }
29
+ function c(e, t) {
30
+ if (r(e) != "object" || !e) return e;
31
+ var n = e[Symbol.toPrimitive];
32
+ if (n !== void 0) {
33
+ var i = n.call(e, t || "default");
34
+ if (r(i) != "object") return i;
35
+ throw TypeError("@@toPrimitive must return a primitive value.");
36
+ }
37
+ return (t === "string" ? String : Number)(e);
38
+ }
39
+ var l = "1.2.0", u = "1.7.35", d = " ext. ", f = /*#__PURE__*/ function() {
40
+ function e(t) {
41
+ i(this, e), v(t), this.metadata = t, S.call(this, t);
42
+ }
43
+ return o(e, [
44
+ {
45
+ key: "getCountries",
46
+ value: function() {
47
+ return Object.keys(this.metadata.countries).filter(function(e) {
48
+ return e !== "001";
49
+ });
50
+ }
51
+ },
52
+ {
53
+ key: "getCountryMetadata",
54
+ value: function(e) {
55
+ return this.metadata.countries[e];
56
+ }
57
+ },
58
+ {
59
+ key: "nonGeographic",
60
+ value: function() {
61
+ if (!(this.v1 || this.v2 || this.v3)) return this.metadata.nonGeographic || this.metadata.nonGeographical;
62
+ }
63
+ },
64
+ {
65
+ key: "hasCountry",
66
+ value: function(e) {
67
+ return this.getCountryMetadata(e) !== void 0;
68
+ }
69
+ },
70
+ {
71
+ key: "hasCallingCode",
72
+ value: function(e) {
73
+ if (this.getCountryCodesForCallingCode(e)) return !0;
74
+ if (this.nonGeographic()) {
75
+ if (this.nonGeographic()[e]) return !0;
76
+ } else {
77
+ var t = this.countryCallingCodes()[e];
78
+ if (t && t.length === 1 && t[0] === "001") return !0;
79
+ }
80
+ }
81
+ },
82
+ {
83
+ key: "isNonGeographicCallingCode",
84
+ value: function(e) {
85
+ return this.nonGeographic() ? !!this.nonGeographic()[e] : !this.getCountryCodesForCallingCode(e);
86
+ }
87
+ },
88
+ {
89
+ key: "country",
90
+ value: function(e) {
91
+ return this.selectNumberingPlan(e);
92
+ }
93
+ },
94
+ {
95
+ key: "selectNumberingPlan",
96
+ value: function(e, t) {
97
+ var r, i;
98
+ if (e && (n(e) ? i = e : r = e), t && (i = t), r && r !== "001") {
99
+ var a = this.getCountryMetadata(r);
100
+ if (!a) throw Error(`Unknown country: ${r}`);
101
+ this.numberingPlan = new p(a, this);
102
+ } else if (i) {
103
+ if (!this.hasCallingCode(i)) throw Error(`Unknown calling code: ${i}`);
104
+ this.numberingPlan = new p(this.getNumberingPlanMetadata(i), this);
105
+ } else this.numberingPlan = void 0;
106
+ return this;
107
+ }
108
+ },
109
+ {
110
+ key: "getCountryCodesForCallingCode",
111
+ value: function(e) {
112
+ var t = this.countryCallingCodes()[e];
113
+ if (t) return t.length === 1 && t[0].length === 3 ? void 0 : t;
114
+ }
115
+ },
116
+ {
117
+ key: "getCountryCodeForCallingCode",
118
+ value: function(e) {
119
+ var t = this.getCountryCodesForCallingCode(e);
120
+ if (t) return t[0];
121
+ }
122
+ },
123
+ {
124
+ key: "getNumberingPlanMetadata",
125
+ value: function(e) {
126
+ var t = this.getCountryCodeForCallingCode(e);
127
+ if (t) return this.getCountryMetadata(t);
128
+ if (this.nonGeographic()) {
129
+ var n = this.nonGeographic()[e];
130
+ if (n) return n;
131
+ } else {
132
+ var r = this.countryCallingCodes()[e];
133
+ if (r && r.length === 1 && r[0] === "001") return this.metadata.countries["001"];
134
+ }
135
+ }
136
+ },
137
+ {
138
+ key: "countryCallingCode",
139
+ value: function() {
140
+ return this.numberingPlan.callingCode();
141
+ }
142
+ },
143
+ {
144
+ key: "IDDPrefix",
145
+ value: function() {
146
+ return this.numberingPlan.IDDPrefix();
147
+ }
148
+ },
149
+ {
150
+ key: "defaultIDDPrefix",
151
+ value: function() {
152
+ return this.numberingPlan.defaultIDDPrefix();
153
+ }
154
+ },
155
+ {
156
+ key: "nationalNumberPattern",
157
+ value: function() {
158
+ return this.numberingPlan.nationalNumberPattern();
159
+ }
160
+ },
161
+ {
162
+ key: "possibleLengths",
163
+ value: function() {
164
+ return this.numberingPlan.possibleLengths();
165
+ }
166
+ },
167
+ {
168
+ key: "formats",
169
+ value: function() {
170
+ return this.numberingPlan.formats();
171
+ }
172
+ },
173
+ {
174
+ key: "nationalPrefixForParsing",
175
+ value: function() {
176
+ return this.numberingPlan.nationalPrefixForParsing();
177
+ }
178
+ },
179
+ {
180
+ key: "nationalPrefixTransformRule",
181
+ value: function() {
182
+ return this.numberingPlan.nationalPrefixTransformRule();
183
+ }
184
+ },
185
+ {
186
+ key: "leadingDigits",
187
+ value: function() {
188
+ return this.numberingPlan.leadingDigits();
189
+ }
190
+ },
191
+ {
192
+ key: "hasTypes",
193
+ value: function() {
194
+ return this.numberingPlan.hasTypes();
195
+ }
196
+ },
197
+ {
198
+ key: "type",
199
+ value: function(e) {
200
+ return this.numberingPlan.type(e);
201
+ }
202
+ },
203
+ {
204
+ key: "ext",
205
+ value: function() {
206
+ return this.numberingPlan.ext();
207
+ }
208
+ },
209
+ {
210
+ key: "countryCallingCodes",
211
+ value: function() {
212
+ return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes;
213
+ }
214
+ },
215
+ {
216
+ key: "chooseCountryByCountryCallingCode",
217
+ value: function(e) {
218
+ return this.selectNumberingPlan(e);
219
+ }
220
+ },
221
+ {
222
+ key: "hasSelectedNumberingPlan",
223
+ value: function() {
224
+ return this.numberingPlan !== void 0;
225
+ }
226
+ }
227
+ ]);
228
+ }(), p = /*#__PURE__*/ function() {
229
+ function e(t, n) {
230
+ i(this, e), this.globalMetadataObject = n, this.metadata = t, S.call(this, n.metadata);
231
+ }
232
+ return o(e, [
233
+ {
234
+ key: "callingCode",
235
+ value: function() {
236
+ return this.metadata[0];
237
+ }
238
+ },
239
+ {
240
+ key: "_getDefaultCountryMetadataForThisCallingCode",
241
+ value: function() {
242
+ return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
243
+ }
244
+ },
245
+ {
246
+ key: "getDefaultCountryMetadataForRegion",
247
+ value: function() {
248
+ return this._getDefaultCountryMetadataForThisCallingCode();
249
+ }
250
+ },
251
+ {
252
+ key: "IDDPrefix",
253
+ value: function() {
254
+ if (!(this.v1 || this.v2)) return this.metadata[1];
255
+ }
256
+ },
257
+ {
258
+ key: "defaultIDDPrefix",
259
+ value: function() {
260
+ if (!(this.v1 || this.v2)) return this.metadata[12];
261
+ }
262
+ },
263
+ {
264
+ key: "nationalNumberPattern",
265
+ value: function() {
266
+ return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2];
267
+ }
268
+ },
269
+ {
270
+ key: "possibleLengths",
271
+ value: function() {
272
+ if (!this.v1) return this.metadata[this.v2 ? 2 : 3];
273
+ }
274
+ },
275
+ {
276
+ key: "_getFormats",
277
+ value: function(e) {
278
+ return e[this.v1 ? 2 : this.v2 ? 3 : 4];
279
+ }
280
+ },
281
+ {
282
+ key: "formats",
283
+ value: function() {
284
+ var e = this;
285
+ return (this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || []).map(function(t) {
286
+ return new m(t, e);
287
+ });
288
+ }
289
+ },
290
+ {
291
+ key: "nationalPrefix",
292
+ value: function() {
293
+ return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
294
+ }
295
+ },
296
+ {
297
+ key: "_getNationalPrefixFormattingRule",
298
+ value: function(e) {
299
+ return e[this.v1 ? 4 : this.v2 ? 5 : 6];
300
+ }
301
+ },
302
+ {
303
+ key: "nationalPrefixFormattingRule",
304
+ value: function() {
305
+ return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
306
+ }
307
+ },
308
+ {
309
+ key: "_nationalPrefixForParsing",
310
+ value: function() {
311
+ return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
312
+ }
313
+ },
314
+ {
315
+ key: "nationalPrefixForParsing",
316
+ value: function() {
317
+ return this._nationalPrefixForParsing() || this.nationalPrefix();
318
+ }
319
+ },
320
+ {
321
+ key: "nationalPrefixTransformRule",
322
+ value: function() {
323
+ return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
324
+ }
325
+ },
326
+ {
327
+ key: "_getNationalPrefixIsOptionalWhenFormatting",
328
+ value: function() {
329
+ return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
330
+ }
331
+ },
332
+ {
333
+ key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
334
+ value: function() {
335
+ return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
336
+ }
337
+ },
338
+ {
339
+ key: "leadingDigits",
340
+ value: function() {
341
+ return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
342
+ }
343
+ },
344
+ {
345
+ key: "types",
346
+ value: function() {
347
+ return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
348
+ }
349
+ },
350
+ {
351
+ key: "hasTypes",
352
+ value: function() {
353
+ return this.types() && this.types().length === 0 ? !1 : !!this.types();
354
+ }
355
+ },
356
+ {
357
+ key: "type",
358
+ value: function(e) {
359
+ if (this.hasTypes() && _(this.types(), e)) return new g(_(this.types(), e), this);
360
+ }
361
+ },
362
+ {
363
+ key: "ext",
364
+ value: function() {
365
+ return this.v1 || this.v2 ? d : this.metadata[13] || d;
366
+ }
367
+ }
368
+ ]);
369
+ }(), m = /*#__PURE__*/ function() {
370
+ function e(t, n) {
371
+ i(this, e), this._format = t, this.metadata = n;
372
+ }
373
+ return o(e, [
374
+ {
375
+ key: "pattern",
376
+ value: function() {
377
+ return this._format[0];
378
+ }
379
+ },
380
+ {
381
+ key: "format",
382
+ value: function() {
383
+ return this._format[1];
384
+ }
385
+ },
386
+ {
387
+ key: "leadingDigitsPatterns",
388
+ value: function() {
389
+ return this._format[2] || [];
390
+ }
391
+ },
392
+ {
393
+ key: "nationalPrefixFormattingRule",
394
+ value: function() {
395
+ return this._format[3] || this.metadata.nationalPrefixFormattingRule();
396
+ }
397
+ },
398
+ {
399
+ key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
400
+ value: function() {
401
+ return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
402
+ }
403
+ },
404
+ {
405
+ key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
406
+ value: function() {
407
+ return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
408
+ }
409
+ },
410
+ {
411
+ key: "usesNationalPrefix",
412
+ value: function() {
413
+ return !!(this.nationalPrefixFormattingRule() && !h.test(this.nationalPrefixFormattingRule()));
414
+ }
415
+ },
416
+ {
417
+ key: "internationalFormat",
418
+ value: function() {
419
+ return this._format[5] || this.format();
420
+ }
421
+ }
422
+ ]);
423
+ }(), h = /^\(?\$1\)?$/, g = /*#__PURE__*/ function() {
424
+ function e(t, n) {
425
+ i(this, e), this.type = t, this.metadata = n;
426
+ }
427
+ return o(e, [{
428
+ key: "pattern",
429
+ value: function() {
430
+ return this.metadata.v1 ? this.type : this.type[0];
431
+ }
432
+ }, {
433
+ key: "possibleLengths",
434
+ value: function() {
435
+ if (!this.metadata.v1) return this.type[1] || this.metadata.possibleLengths();
436
+ }
437
+ }]);
438
+ }();
439
+ function _(e, t) {
440
+ switch (t) {
441
+ case "FIXED_LINE": return e[0];
442
+ case "MOBILE": return e[1];
443
+ case "TOLL_FREE": return e[2];
444
+ case "PREMIUM_RATE": return e[3];
445
+ case "PERSONAL_NUMBER": return e[4];
446
+ case "VOICEMAIL": return e[5];
447
+ case "UAN": return e[6];
448
+ case "PAGER": return e[7];
449
+ case "VOIP": return e[8];
450
+ case "SHARED_COST": return e[9];
451
+ }
452
+ }
453
+ function v(t) {
454
+ if (!t) throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
455
+ if (!e(t) || !e(t.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 ${e(t) ? "an object of shape: { " + Object.keys(t).join(", ") + " }" : "a " + y(t) + ": " + t}.`);
456
+ }
457
+ /* istanbul ignore next */
458
+ var y = function(e) {
459
+ return r(e);
460
+ };
461
+ function b(e, t) {
462
+ var n = new f(t);
463
+ if (n.hasCountry(e)) return n.selectNumberingPlan(e).countryCallingCode();
464
+ throw Error(`Unknown country: ${e}`);
465
+ }
466
+ function x(e, t) {
467
+ return t.countries.hasOwnProperty(e);
468
+ }
469
+ function S(e) {
470
+ var n = e.version;
471
+ typeof n == "number" ? (this.v1 = n === 1, this.v2 = n === 2, this.v3 = n === 3, this.v4 = n === 4) : n ? t(n, l) === -1 ? this.v2 = !0 : t(n, u) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
472
+ }
473
+ //#endregion
474
+ export { f as default, b as getCountryCallingCode, x as isSupportedCountry, v as validateMetadata };