@rpcbase/ui 0.206.0 → 0.208.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 (232) hide show
  1. package/dist/index.js +7 -7
  2. package/dist/index19.js +1 -1
  3. package/dist/index19.js.map +1 -1
  4. package/dist/index200.js +56 -55
  5. package/dist/index200.js.map +1 -1
  6. package/dist/index201.js +60 -8
  7. package/dist/index201.js.map +1 -1
  8. package/dist/index202.js +7 -15
  9. package/dist/index202.js.map +1 -1
  10. package/dist/index203.js +15 -143
  11. package/dist/index203.js.map +1 -1
  12. package/dist/index204.js +145 -4
  13. package/dist/index204.js.map +1 -1
  14. package/dist/index205.js +4 -11
  15. package/dist/index205.js.map +1 -1
  16. package/dist/index206.js +10 -104
  17. package/dist/index206.js.map +1 -1
  18. package/dist/index207.js +94 -347
  19. package/dist/index207.js.map +1 -1
  20. package/dist/index208.js +349 -87
  21. package/dist/index208.js.map +1 -1
  22. package/dist/index209.js +73 -304
  23. package/dist/index209.js.map +1 -1
  24. package/dist/index210.js +309 -193
  25. package/dist/index210.js.map +1 -1
  26. package/dist/index211.js +211 -19
  27. package/dist/index211.js.map +1 -1
  28. package/dist/index212.js +18 -27
  29. package/dist/index212.js.map +1 -1
  30. package/dist/index213.js +27 -187
  31. package/dist/index213.js.map +1 -1
  32. package/dist/index214.js +186 -16
  33. package/dist/index214.js.map +1 -1
  34. package/dist/index215.js +18 -44
  35. package/dist/index215.js.map +1 -1
  36. package/dist/index216.js +60 -8
  37. package/dist/index216.js.map +1 -1
  38. package/dist/index217.js +42 -23
  39. package/dist/index217.js.map +1 -1
  40. package/dist/index218.js +9 -44
  41. package/dist/index218.js.map +1 -1
  42. package/dist/index219.js +25 -18
  43. package/dist/index219.js.map +1 -1
  44. package/dist/index220.js +45 -3
  45. package/dist/index220.js.map +1 -1
  46. package/dist/index221.js +17 -4
  47. package/dist/index221.js.map +1 -1
  48. package/dist/index222.js +3 -21
  49. package/dist/index222.js.map +1 -1
  50. package/dist/index223.js +4 -24
  51. package/dist/index223.js.map +1 -1
  52. package/dist/index224.js +17 -64
  53. package/dist/index224.js.map +1 -1
  54. package/dist/index225.js +23 -13
  55. package/dist/index225.js.map +1 -1
  56. package/dist/index226.js +68 -4
  57. package/dist/index226.js.map +1 -1
  58. package/dist/index227.js +14 -50
  59. package/dist/index227.js.map +1 -1
  60. package/dist/index228.js +4 -6
  61. package/dist/index228.js.map +1 -1
  62. package/dist/index229.js +50 -26
  63. package/dist/index229.js.map +1 -1
  64. package/dist/index230.js +5 -13
  65. package/dist/index230.js.map +1 -1
  66. package/dist/index231.js +25 -8
  67. package/dist/index231.js.map +1 -1
  68. package/dist/index232.js +17 -3
  69. package/dist/index232.js.map +1 -0
  70. package/dist/index233.js +8 -24
  71. package/dist/index233.js.map +1 -1
  72. package/dist/index234.js +2 -71
  73. package/dist/index235.js +29 -3
  74. package/dist/index235.js.map +1 -0
  75. package/dist/index236.js +69 -12
  76. package/dist/index236.js.map +1 -1
  77. package/dist/index237.js +3 -54
  78. package/dist/index238.js +11 -114
  79. package/dist/index238.js.map +1 -1
  80. package/dist/index239.js +51 -6
  81. package/dist/index239.js.map +1 -1
  82. package/dist/index240.js +115 -13
  83. package/dist/index240.js.map +1 -1
  84. package/dist/index241.js +6 -687
  85. package/dist/index241.js.map +1 -1
  86. package/dist/index242.js +13 -253
  87. package/dist/index242.js.map +1 -1
  88. package/dist/index243.js +662 -676
  89. package/dist/index243.js.map +1 -1
  90. package/dist/index244.js +252 -7430
  91. package/dist/index244.js.map +1 -1
  92. package/dist/index245.js +700 -6
  93. package/dist/index245.js.map +1 -1
  94. package/dist/index246.js +7429 -11
  95. package/dist/index246.js.map +1 -1
  96. package/dist/index247.js +5 -4
  97. package/dist/index247.js.map +1 -1
  98. package/dist/index248.js +11 -458
  99. package/dist/index248.js.map +1 -1
  100. package/dist/index249.js +5 -37
  101. package/dist/index249.js.map +1 -1
  102. package/dist/index250.js +458 -18
  103. package/dist/index250.js.map +1 -1
  104. package/dist/index251.js +34 -24
  105. package/dist/index251.js.map +1 -1
  106. package/dist/index252.js +19 -4
  107. package/dist/index252.js.map +1 -1
  108. package/dist/index253.js +23 -54
  109. package/dist/index253.js.map +1 -1
  110. package/dist/index254.js +4 -7
  111. package/dist/index254.js.map +1 -1
  112. package/dist/index255.js +57 -11
  113. package/dist/index255.js.map +1 -1
  114. package/dist/index256.js +8 -3
  115. package/dist/index256.js.map +1 -1
  116. package/dist/index257.js +12 -16
  117. package/dist/index257.js.map +1 -1
  118. package/dist/index258.js +3 -26
  119. package/dist/index258.js.map +1 -1
  120. package/dist/index259.js +15 -42
  121. package/dist/index259.js.map +1 -1
  122. package/dist/index260.js +25 -13
  123. package/dist/index260.js.map +1 -1
  124. package/dist/index261.js +40 -22
  125. package/dist/index261.js.map +1 -1
  126. package/dist/index262.js +13 -17
  127. package/dist/index262.js.map +1 -1
  128. package/dist/index263.js +24 -34
  129. package/dist/index263.js.map +1 -1
  130. package/dist/index264.js +17 -5
  131. package/dist/index264.js.map +1 -1
  132. package/dist/index265.js +35 -9
  133. package/dist/index265.js.map +1 -1
  134. package/dist/index266.js +5 -8
  135. package/dist/index266.js.map +1 -1
  136. package/dist/index267.js +9 -9
  137. package/dist/index267.js.map +1 -1
  138. package/dist/index268.js +8 -10
  139. package/dist/index268.js.map +1 -1
  140. package/dist/index269.js +9 -7
  141. package/dist/index269.js.map +1 -1
  142. package/dist/index270.js +9 -72
  143. package/dist/index270.js.map +1 -1
  144. package/dist/index271.js +7 -171
  145. package/dist/index271.js.map +1 -1
  146. package/dist/index272.js +63 -104
  147. package/dist/index272.js.map +1 -1
  148. package/dist/index273.js +169 -12
  149. package/dist/index273.js.map +1 -1
  150. package/dist/index274.js +109 -75
  151. package/dist/index274.js.map +1 -1
  152. package/dist/index275.js +12 -44
  153. package/dist/index275.js.map +1 -1
  154. package/dist/index276.js +79 -12
  155. package/dist/index276.js.map +1 -1
  156. package/dist/index277.js +45 -15
  157. package/dist/index277.js.map +1 -1
  158. package/dist/index278.js +12 -98
  159. package/dist/index278.js.map +1 -1
  160. package/dist/index279.js +15 -55
  161. package/dist/index279.js.map +1 -1
  162. package/dist/index280.js +89 -98
  163. package/dist/index280.js.map +1 -1
  164. package/dist/index281.js +27 -42
  165. package/dist/index281.js.map +1 -1
  166. package/dist/index282.js +92 -97
  167. package/dist/index282.js.map +1 -1
  168. package/dist/index283.js +62 -46
  169. package/dist/index283.js.map +1 -1
  170. package/dist/index284.js +108 -38
  171. package/dist/index284.js.map +1 -1
  172. package/dist/index285.js +48 -135
  173. package/dist/index285.js.map +1 -1
  174. package/dist/index286.js +43 -139
  175. package/dist/index286.js.map +1 -1
  176. package/dist/index287.js +105 -217
  177. package/dist/index287.js.map +1 -1
  178. package/dist/index288.js +109 -210
  179. package/dist/index288.js.map +1 -1
  180. package/dist/index289.js +168 -212
  181. package/dist/index289.js.map +1 -1
  182. package/dist/index290.js +240 -5
  183. package/dist/index290.js.map +1 -1
  184. package/dist/index291.js +298 -6
  185. package/dist/index291.js.map +1 -1
  186. package/dist/index292.js +5 -7
  187. package/dist/index292.js.map +1 -1
  188. package/dist/index293.js +4 -4
  189. package/dist/index293.js.map +1 -1
  190. package/dist/index294.js +7 -6
  191. package/dist/index294.js.map +1 -1
  192. package/dist/index295.js +6 -21
  193. package/dist/index295.js.map +1 -1
  194. package/dist/index296.js +6 -10
  195. package/dist/index296.js.map +1 -1
  196. package/dist/index297.js +18 -123
  197. package/dist/index297.js.map +1 -1
  198. package/dist/index298.js +10 -164
  199. package/dist/index298.js.map +1 -1
  200. package/dist/index299.js +116 -58
  201. package/dist/index299.js.map +1 -1
  202. package/dist/index300.js +161 -106
  203. package/dist/index300.js.map +1 -1
  204. package/dist/index301.js +66 -489
  205. package/dist/index301.js.map +1 -1
  206. package/dist/index302.js +106 -59
  207. package/dist/index302.js.map +1 -1
  208. package/dist/index303.js +492 -4
  209. package/dist/index303.js.map +1 -1
  210. package/dist/index304.js +62 -27
  211. package/dist/index304.js.map +1 -1
  212. package/dist/index305.js +4 -66
  213. package/dist/index305.js.map +1 -1
  214. package/dist/index306.js +27 -152
  215. package/dist/index306.js.map +1 -1
  216. package/dist/index307.js +59 -555
  217. package/dist/index307.js.map +1 -1
  218. package/dist/index308.js +143 -201
  219. package/dist/index308.js.map +1 -1
  220. package/dist/index309.js +56 -326
  221. package/dist/index309.js.map +1 -1
  222. package/dist/index310.js +553 -260
  223. package/dist/index310.js.map +1 -1
  224. package/dist/index311.js +214 -0
  225. package/dist/index311.js.map +1 -0
  226. package/dist/index312.js +335 -0
  227. package/dist/index312.js.map +1 -0
  228. package/dist/index313.js +272 -0
  229. package/dist/index313.js.map +1 -0
  230. package/package.json +2 -2
  231. package/dist/index234.js.map +0 -1
  232. package/dist/index237.js.map +0 -1
package/dist/index250.js CHANGED
@@ -1,23 +1,463 @@
1
- import { Metadata as e } from "./index248.js";
1
+ import e from "./index248.js";
2
2
  import t from "./index249.js";
3
- //#region ../../node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js
4
- function n(e, t, n) {
5
- return r(e, t, void 0, n);
6
- }
7
- function r(n, i, a, o) {
8
- i && (o = new e(o.metadata), o.selectNumberingPlan(i));
9
- var s = o.type(a), c = s && s.possibleLengths() || o.possibleLengths();
10
- if (!c) return "IS_POSSIBLE";
11
- if (a === "FIXED_LINE_OR_MOBILE") {
12
- /* istanbul ignore next */
13
- if (!o.type("FIXED_LINE")) return r(n, i, "MOBILE", o);
14
- var l = o.type("MOBILE");
15
- l && (c = t(c, l.possibleLengths()));
16
- } else if (a && !s) return "INVALID_LENGTH";
17
- var u = n.length, d = c[0];
18
- return d === u ? "IS_POSSIBLE" : d > u ? "TOO_SHORT" : c[c.length - 1] < u ? "TOO_LONG" : c.indexOf(u, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
3
+ //#region ../../node_modules/libphonenumber-js/es6/metadata.js
4
+ function n(e) {
5
+ "@babel/helpers - typeof";
6
+ return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
7
+ return typeof e;
8
+ } : function(e) {
9
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
10
+ }, n(e);
11
+ }
12
+ function r(e, t) {
13
+ if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
14
+ }
15
+ function i(e, t) {
16
+ for (var n = 0; n < t.length; n++) {
17
+ var r = t[n];
18
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, o(r.key), r);
19
+ }
20
+ }
21
+ function a(e, t, n) {
22
+ return t && i(e.prototype, t), n && i(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
23
+ }
24
+ function o(e) {
25
+ var t = s(e, "string");
26
+ return n(t) == "symbol" ? t : t + "";
27
+ }
28
+ function s(e, t) {
29
+ if (n(e) != "object" || !e) return e;
30
+ var r = e[Symbol.toPrimitive];
31
+ if (r !== void 0) {
32
+ var i = r.call(e, t || "default");
33
+ if (n(i) != "object") return i;
34
+ throw TypeError("@@toPrimitive must return a primitive value.");
35
+ }
36
+ return (t === "string" ? String : Number)(e);
37
+ }
38
+ var c = "1.2.0", l = "1.7.35", u = " ext. ", d = /^\d+$/, f = /* @__PURE__ */ function() {
39
+ function e(t) {
40
+ r(this, e), v(t), this.metadata = t, x.call(this, t);
41
+ }
42
+ return a(e, [
43
+ {
44
+ key: "getCountries",
45
+ value: function() {
46
+ return Object.keys(this.metadata.countries).filter(function(e) {
47
+ return e !== "001";
48
+ });
49
+ }
50
+ },
51
+ {
52
+ key: "getCountryMetadata",
53
+ value: function(e) {
54
+ return this.metadata.countries[e];
55
+ }
56
+ },
57
+ {
58
+ key: "nonGeographic",
59
+ value: function() {
60
+ if (!(this.v1 || this.v2 || this.v3)) return this.metadata.nonGeographic || this.metadata.nonGeographical;
61
+ }
62
+ },
63
+ {
64
+ key: "hasCountry",
65
+ value: function(e) {
66
+ return this.getCountryMetadata(e) !== void 0;
67
+ }
68
+ },
69
+ {
70
+ key: "hasCallingCode",
71
+ value: function(e) {
72
+ if (this.getCountryCodesForCallingCode(e)) return !0;
73
+ if (this.nonGeographic()) {
74
+ if (this.nonGeographic()[e]) return !0;
75
+ } else {
76
+ var t = this.countryCallingCodes()[e];
77
+ if (t && t.length === 1 && t[0] === "001") return !0;
78
+ }
79
+ }
80
+ },
81
+ {
82
+ key: "isNonGeographicCallingCode",
83
+ value: function(e) {
84
+ return this.nonGeographic() ? !!this.nonGeographic()[e] : !this.getCountryCodesForCallingCode(e);
85
+ }
86
+ },
87
+ {
88
+ key: "country",
89
+ value: function(e) {
90
+ return this.selectNumberingPlan(e);
91
+ }
92
+ },
93
+ {
94
+ key: "selectNumberingPlan",
95
+ value: function(e, t) {
96
+ if (e && d.test(e) && (t = e, e = null), e && e !== "001") {
97
+ if (!this.hasCountry(e)) throw Error(`Unknown country: ${e}`);
98
+ this.numberingPlan = new p(this.getCountryMetadata(e), this);
99
+ } else if (t) {
100
+ if (!this.hasCallingCode(t)) throw Error(`Unknown calling code: ${t}`);
101
+ this.numberingPlan = new p(this.getNumberingPlanMetadata(t), this);
102
+ } else this.numberingPlan = void 0;
103
+ return this;
104
+ }
105
+ },
106
+ {
107
+ key: "getCountryCodesForCallingCode",
108
+ value: function(e) {
109
+ var t = this.countryCallingCodes()[e];
110
+ if (t) return t.length === 1 && t[0].length === 3 ? void 0 : t;
111
+ }
112
+ },
113
+ {
114
+ key: "getCountryCodeForCallingCode",
115
+ value: function(e) {
116
+ var t = this.getCountryCodesForCallingCode(e);
117
+ if (t) return t[0];
118
+ }
119
+ },
120
+ {
121
+ key: "getNumberingPlanMetadata",
122
+ value: function(e) {
123
+ var t = this.getCountryCodeForCallingCode(e);
124
+ if (t) return this.getCountryMetadata(t);
125
+ if (this.nonGeographic()) {
126
+ var n = this.nonGeographic()[e];
127
+ if (n) return n;
128
+ } else {
129
+ var r = this.countryCallingCodes()[e];
130
+ if (r && r.length === 1 && r[0] === "001") return this.metadata.countries["001"];
131
+ }
132
+ }
133
+ },
134
+ {
135
+ key: "countryCallingCode",
136
+ value: function() {
137
+ return this.numberingPlan.callingCode();
138
+ }
139
+ },
140
+ {
141
+ key: "IDDPrefix",
142
+ value: function() {
143
+ return this.numberingPlan.IDDPrefix();
144
+ }
145
+ },
146
+ {
147
+ key: "defaultIDDPrefix",
148
+ value: function() {
149
+ return this.numberingPlan.defaultIDDPrefix();
150
+ }
151
+ },
152
+ {
153
+ key: "nationalNumberPattern",
154
+ value: function() {
155
+ return this.numberingPlan.nationalNumberPattern();
156
+ }
157
+ },
158
+ {
159
+ key: "possibleLengths",
160
+ value: function() {
161
+ return this.numberingPlan.possibleLengths();
162
+ }
163
+ },
164
+ {
165
+ key: "formats",
166
+ value: function() {
167
+ return this.numberingPlan.formats();
168
+ }
169
+ },
170
+ {
171
+ key: "nationalPrefixForParsing",
172
+ value: function() {
173
+ return this.numberingPlan.nationalPrefixForParsing();
174
+ }
175
+ },
176
+ {
177
+ key: "nationalPrefixTransformRule",
178
+ value: function() {
179
+ return this.numberingPlan.nationalPrefixTransformRule();
180
+ }
181
+ },
182
+ {
183
+ key: "leadingDigits",
184
+ value: function() {
185
+ return this.numberingPlan.leadingDigits();
186
+ }
187
+ },
188
+ {
189
+ key: "hasTypes",
190
+ value: function() {
191
+ return this.numberingPlan.hasTypes();
192
+ }
193
+ },
194
+ {
195
+ key: "type",
196
+ value: function(e) {
197
+ return this.numberingPlan.type(e);
198
+ }
199
+ },
200
+ {
201
+ key: "ext",
202
+ value: function() {
203
+ return this.numberingPlan.ext();
204
+ }
205
+ },
206
+ {
207
+ key: "countryCallingCodes",
208
+ value: function() {
209
+ return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes;
210
+ }
211
+ },
212
+ {
213
+ key: "chooseCountryByCountryCallingCode",
214
+ value: function(e) {
215
+ return this.selectNumberingPlan(e);
216
+ }
217
+ },
218
+ {
219
+ key: "hasSelectedNumberingPlan",
220
+ value: function() {
221
+ return this.numberingPlan !== void 0;
222
+ }
223
+ }
224
+ ]);
225
+ }(), p = /* @__PURE__ */ function() {
226
+ function e(t, n) {
227
+ r(this, e), this.globalMetadataObject = n, this.metadata = t, x.call(this, n.metadata);
228
+ }
229
+ return a(e, [
230
+ {
231
+ key: "callingCode",
232
+ value: function() {
233
+ return this.metadata[0];
234
+ }
235
+ },
236
+ {
237
+ key: "getDefaultCountryMetadataForRegion",
238
+ value: function() {
239
+ return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
240
+ }
241
+ },
242
+ {
243
+ key: "IDDPrefix",
244
+ value: function() {
245
+ if (!(this.v1 || this.v2)) return this.metadata[1];
246
+ }
247
+ },
248
+ {
249
+ key: "defaultIDDPrefix",
250
+ value: function() {
251
+ if (!(this.v1 || this.v2)) return this.metadata[12];
252
+ }
253
+ },
254
+ {
255
+ key: "nationalNumberPattern",
256
+ value: function() {
257
+ return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2];
258
+ }
259
+ },
260
+ {
261
+ key: "possibleLengths",
262
+ value: function() {
263
+ if (!this.v1) return this.metadata[this.v2 ? 2 : 3];
264
+ }
265
+ },
266
+ {
267
+ key: "_getFormats",
268
+ value: function(e) {
269
+ return e[this.v1 ? 2 : this.v2 ? 3 : 4];
270
+ }
271
+ },
272
+ {
273
+ key: "formats",
274
+ value: function() {
275
+ var e = this;
276
+ return (this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || []).map(function(t) {
277
+ return new m(t, e);
278
+ });
279
+ }
280
+ },
281
+ {
282
+ key: "nationalPrefix",
283
+ value: function() {
284
+ return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
285
+ }
286
+ },
287
+ {
288
+ key: "_getNationalPrefixFormattingRule",
289
+ value: function(e) {
290
+ return e[this.v1 ? 4 : this.v2 ? 5 : 6];
291
+ }
292
+ },
293
+ {
294
+ key: "nationalPrefixFormattingRule",
295
+ value: function() {
296
+ return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
297
+ }
298
+ },
299
+ {
300
+ key: "_nationalPrefixForParsing",
301
+ value: function() {
302
+ return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
303
+ }
304
+ },
305
+ {
306
+ key: "nationalPrefixForParsing",
307
+ value: function() {
308
+ return this._nationalPrefixForParsing() || this.nationalPrefix();
309
+ }
310
+ },
311
+ {
312
+ key: "nationalPrefixTransformRule",
313
+ value: function() {
314
+ return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
315
+ }
316
+ },
317
+ {
318
+ key: "_getNationalPrefixIsOptionalWhenFormatting",
319
+ value: function() {
320
+ return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
321
+ }
322
+ },
323
+ {
324
+ key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
325
+ value: function() {
326
+ return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
327
+ }
328
+ },
329
+ {
330
+ key: "leadingDigits",
331
+ value: function() {
332
+ return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
333
+ }
334
+ },
335
+ {
336
+ key: "types",
337
+ value: function() {
338
+ return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
339
+ }
340
+ },
341
+ {
342
+ key: "hasTypes",
343
+ value: function() {
344
+ return this.types() && this.types().length === 0 ? !1 : !!this.types();
345
+ }
346
+ },
347
+ {
348
+ key: "type",
349
+ value: function(e) {
350
+ if (this.hasTypes() && _(this.types(), e)) return new g(_(this.types(), e), this);
351
+ }
352
+ },
353
+ {
354
+ key: "ext",
355
+ value: function() {
356
+ return this.v1 || this.v2 ? u : this.metadata[13] || u;
357
+ }
358
+ }
359
+ ]);
360
+ }(), m = /* @__PURE__ */ function() {
361
+ function e(t, n) {
362
+ r(this, e), this._format = t, this.metadata = n;
363
+ }
364
+ return a(e, [
365
+ {
366
+ key: "pattern",
367
+ value: function() {
368
+ return this._format[0];
369
+ }
370
+ },
371
+ {
372
+ key: "format",
373
+ value: function() {
374
+ return this._format[1];
375
+ }
376
+ },
377
+ {
378
+ key: "leadingDigitsPatterns",
379
+ value: function() {
380
+ return this._format[2] || [];
381
+ }
382
+ },
383
+ {
384
+ key: "nationalPrefixFormattingRule",
385
+ value: function() {
386
+ return this._format[3] || this.metadata.nationalPrefixFormattingRule();
387
+ }
388
+ },
389
+ {
390
+ key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
391
+ value: function() {
392
+ return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
393
+ }
394
+ },
395
+ {
396
+ key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
397
+ value: function() {
398
+ return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
399
+ }
400
+ },
401
+ {
402
+ key: "usesNationalPrefix",
403
+ value: function() {
404
+ return !!(this.nationalPrefixFormattingRule() && !h.test(this.nationalPrefixFormattingRule()));
405
+ }
406
+ },
407
+ {
408
+ key: "internationalFormat",
409
+ value: function() {
410
+ return this._format[5] || this.format();
411
+ }
412
+ }
413
+ ]);
414
+ }(), h = /^\(?\$1\)?$/, g = /* @__PURE__ */ function() {
415
+ function e(t, n) {
416
+ r(this, e), this.type = t, this.metadata = n;
417
+ }
418
+ return a(e, [{
419
+ key: "pattern",
420
+ value: function() {
421
+ return this.metadata.v1 ? this.type : this.type[0];
422
+ }
423
+ }, {
424
+ key: "possibleLengths",
425
+ value: function() {
426
+ if (!this.metadata.v1) return this.type[1] || this.metadata.possibleLengths();
427
+ }
428
+ }]);
429
+ }();
430
+ function _(e, t) {
431
+ switch (t) {
432
+ case "FIXED_LINE": return e[0];
433
+ case "MOBILE": return e[1];
434
+ case "TOLL_FREE": return e[2];
435
+ case "PREMIUM_RATE": return e[3];
436
+ case "PERSONAL_NUMBER": return e[4];
437
+ case "VOICEMAIL": return e[5];
438
+ case "UAN": return e[6];
439
+ case "PAGER": return e[7];
440
+ case "VOIP": return e[8];
441
+ case "SHARED_COST": return e[9];
442
+ }
443
+ }
444
+ function v(e) {
445
+ if (!e) throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
446
+ 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 " + y(e) + ": " + e}.`);
447
+ }
448
+ /* istanbul ignore next */
449
+ var y = function(e) {
450
+ return n(e);
451
+ };
452
+ function b(e, t) {
453
+ if (t = new f(t), t.hasCountry(e)) return t.selectNumberingPlan(e).countryCallingCode();
454
+ throw Error(`Unknown country: ${e}`);
455
+ }
456
+ function x(t) {
457
+ var n = t.version;
458
+ typeof n == "number" ? (this.v1 = n === 1, this.v2 = n === 2, this.v3 = n === 3, this.v4 = n === 4) : n ? e(n, c) === -1 ? this.v2 = !0 : e(n, l) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
19
459
  }
20
460
  //#endregion
21
- export { n as default };
461
+ export { f as Metadata, b as getCountryCallingCode, v as validateMetadata };
22
462
 
23
463
  //# sourceMappingURL=index250.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index250.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport mergeArrays from './mergeArrays.js';\nexport default function checkNumberLength(nationalNumber, country, metadata) {\n return checkNumberLengthForType(nationalNumber, country, undefined, metadata);\n}\n\n// Checks whether a number is possible for a certain `country` based on the number length.\n//\n// This function is not supported by metadata generated with ancient versions of\n// `libphonenumber-js` (before version `1.0.18`) which didn't include \"possible lengths\".\n//\n// There was also a known issue with `checkNumberLength()` function:\n// if a number is possible only in a certain `country` among several `countries`\n// that share the same \"country calling code\", that function would check\n// the possibility of the phone number only in the \"main\" `country` for the \"country calling code\"\n// and would not check if it's actually be possible in the speciifc `country`.\n//\n// For example, \"+1310xxxx\" numbers are valid in Canada.\n// However, they are not possible in the US due to being too short.\n// Since Canada and the US share the same country calling code — \"+1\" —\n// `checkNumberLength()` function used to return not \"IS_POSSIBLE\" for \"+1310xxxx\" numbers.\n//\n// In such cases, when using \"/max\" metadata, `isValid()` could output `true`\n// but at the same time `isPossible()` could output `false`, which was contradictory.\n//\n// See https://issuetracker.google.com/issues/335892662 for the discusson in Google's issues.\n//\n// The solution suggested by Google was implemented: an optional `country` argument\n// was added to `checkNumberLength()` function. If present, that `country` will be used\n// to check phone number length for that specific `country` rather than the \"main\" country\n// for the shared \"country calling code\".\n//\nexport function checkNumberLengthForType(nationalNumber, country, type, metadata) {\n // If the exact `country` is specified, it's no necessarily already selected in `metadata`.\n // Most likely, in cases when there're multiple countries corresponding to the same\n // \"country calling code\", the \"main\" country for that \"country calling code\" will be selected.\n if (country) {\n metadata = new Metadata(metadata.metadata);\n metadata.selectNumberingPlan(country);\n }\n var type_info = metadata.type(type);\n\n // There should always be \"<possiblePengths/>\" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \"<possiblePengths/>\" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();\n // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, country, 'MOBILE', metadata);\n }\n var mobile_type = metadata.type('MOBILE');\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());\n // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n }\n // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n var actual_length = nationalNumber.length;\n\n // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n }\n\n // We skip the first element since we've already checked it.\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n//# sourceMappingURL=checkNumberLength.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAEA,SAAwB,EAAkB,GAAgB,GAAS,GAAU;AAC3E,QAAO,EAAyB,GAAgB,GAAS,KAAA,GAAW,EAAS;;AA6B/E,SAAgB,EAAyB,GAAgB,GAAS,GAAM,GAAU;AAIhF,CAAI,MACF,IAAW,IAAI,EAAS,EAAS,SAAS,EAC1C,EAAS,oBAAoB,EAAQ;CAEvC,IAAI,IAAY,EAAS,KAAK,EAAK,EAS/B,IAAmB,KAAa,EAAU,iBAAiB,IAAI,EAAS,iBAAiB;AAI7F,KAAI,CAAC,EACH,QAAO;AAET,KAAI,MAAS,wBAAwB;;AAGnC,MAAI,CAAC,EAAS,KAAK,aAAa,CAG9B,QAAO,EAAyB,GAAgB,GAAS,UAAU,EAAS;EAE9E,IAAI,IAAc,EAAS,KAAK,SAAS;AACzC,EAAI,MAMF,IAAmB,EAAY,GAAkB,EAAY,iBAAiB,CAAC;YAa1E,KAAQ,CAAC,EAChB,QAAO;CAET,IAAI,IAAgB,EAAe,QAU/B,IAAiB,EAAiB;AAYtC,QAXI,MAAmB,IACd,gBAEL,IAAiB,IACZ,cAEL,EAAiB,EAAiB,SAAS,KAAK,IAC3C,aAIF,EAAiB,QAAQ,GAAe,EAAE,IAAI,IAAI,gBAAgB"}
1
+ {"version":3,"file":"index250.js","names":["compare"],"sources":["../../../node_modules/libphonenumber-js/es6/metadata.js"],"sourcesContent":["function _readOnlyError(r) { throw new TypeError('\"' + r + '\" is read-only'); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport compare from './tools/semver-compare.js';\nimport isObject from './helpers/isObject.js';\n\n// Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\nvar V2 = '1.0.18';\n\n// Added \"idd_prefix\" and \"default_idd_prefix\".\nvar V3 = '1.2.0';\n\n// Moved `001` country code to \"nonGeographic\" section of metadata.\nvar V4 = '1.7.35';\nvar DEFAULT_EXT_PREFIX = ' ext. ';\nvar CALLING_CODE_REG_EXP = /^\\d+$/;\n\n/**\r\n * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md\r\n */\nvar Metadata = /*#__PURE__*/function () {\n function Metadata(metadata) {\n _classCallCheck(this, Metadata);\n validateMetadata(metadata);\n this.metadata = metadata;\n setVersion.call(this, metadata);\n }\n return _createClass(Metadata, [{\n key: \"getCountries\",\n value: function getCountries() {\n return Object.keys(this.metadata.countries).filter(function (_) {\n return _ !== '001';\n });\n }\n }, {\n key: \"getCountryMetadata\",\n value: function getCountryMetadata(countryCode) {\n return this.metadata.countries[countryCode];\n }\n }, {\n key: \"nonGeographic\",\n value: function nonGeographic() {\n if (this.v1 || this.v2 || this.v3) return;\n // `nonGeographical` was a typo.\n // It's present in metadata generated from `1.7.35` to `1.7.37`.\n // The test case could be found by searching for \"nonGeographical\".\n return this.metadata.nonGeographic || this.metadata.nonGeographical;\n }\n }, {\n key: \"hasCountry\",\n value: function hasCountry(country) {\n return this.getCountryMetadata(country) !== undefined;\n }\n }, {\n key: \"hasCallingCode\",\n value: function hasCallingCode(callingCode) {\n if (this.getCountryCodesForCallingCode(callingCode)) {\n return true;\n }\n if (this.nonGeographic()) {\n if (this.nonGeographic()[callingCode]) {\n return true;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return true;\n }\n }\n }\n }, {\n key: \"isNonGeographicCallingCode\",\n value: function isNonGeographicCallingCode(callingCode) {\n if (this.nonGeographic()) {\n return this.nonGeographic()[callingCode] ? true : false;\n } else {\n return this.getCountryCodesForCallingCode(callingCode) ? false : true;\n }\n }\n\n // Deprecated.\n }, {\n key: \"country\",\n value: function country(countryCode) {\n return this.selectNumberingPlan(countryCode);\n }\n }, {\n key: \"selectNumberingPlan\",\n value: function selectNumberingPlan(countryCode, callingCode) {\n // Supports just passing `callingCode` as the first argument.\n if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {\n callingCode = countryCode;\n countryCode = null;\n }\n if (countryCode && countryCode !== '001') {\n if (!this.hasCountry(countryCode)) {\n throw new Error(\"Unknown country: \".concat(countryCode));\n }\n this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);\n } else if (callingCode) {\n if (!this.hasCallingCode(callingCode)) {\n throw new Error(\"Unknown calling code: \".concat(callingCode));\n }\n this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);\n } else {\n this.numberingPlan = undefined;\n }\n return this;\n }\n }, {\n key: \"getCountryCodesForCallingCode\",\n value: function getCountryCodesForCallingCode(callingCode) {\n var countryCodes = this.countryCallingCodes()[callingCode];\n if (countryCodes) {\n // Metadata before V4 included \"non-geographic entity\" calling codes\n // inside `country_calling_codes` (for example, `\"881\":[\"001\"]`).\n // Now the semantics of `country_calling_codes` has changed:\n // it's specifically for \"countries\" now.\n // Older versions of custom metadata will simply skip parsing\n // \"non-geographic entity\" phone numbers with new versions\n // of this library: it's not considered a bug,\n // because such numbers are extremely rare,\n // and developers extremely rarely use custom metadata.\n if (countryCodes.length === 1 && countryCodes[0].length === 3) {\n return;\n }\n return countryCodes;\n }\n }\n }, {\n key: \"getCountryCodeForCallingCode\",\n value: function getCountryCodeForCallingCode(callingCode) {\n var countryCodes = this.getCountryCodesForCallingCode(callingCode);\n if (countryCodes) {\n return countryCodes[0];\n }\n }\n }, {\n key: \"getNumberingPlanMetadata\",\n value: function getNumberingPlanMetadata(callingCode) {\n var countryCode = this.getCountryCodeForCallingCode(callingCode);\n if (countryCode) {\n return this.getCountryMetadata(countryCode);\n }\n if (this.nonGeographic()) {\n var metadata = this.nonGeographic()[callingCode];\n if (metadata) {\n return metadata;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n // In that metadata, there was no concept of \"non-geographic\" metadata\n // so metadata for `001` country code was stored along with other countries.\n // The test case can be found by searching for:\n // \"should work around `nonGeographic` metadata not existing\".\n var countryCodes = this.countryCallingCodes()[callingCode];\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return this.metadata.countries['001'];\n }\n }\n }\n\n // Deprecated.\n }, {\n key: \"countryCallingCode\",\n value: function countryCallingCode() {\n return this.numberingPlan.callingCode();\n }\n\n // Deprecated.\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n return this.numberingPlan.IDDPrefix();\n }\n\n // Deprecated.\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n return this.numberingPlan.defaultIDDPrefix();\n }\n\n // Deprecated.\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n return this.numberingPlan.nationalNumberPattern();\n }\n\n // Deprecated.\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n return this.numberingPlan.possibleLengths();\n }\n\n // Deprecated.\n }, {\n key: \"formats\",\n value: function formats() {\n return this.numberingPlan.formats();\n }\n\n // Deprecated.\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n return this.numberingPlan.nationalPrefixForParsing();\n }\n\n // Deprecated.\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.numberingPlan.nationalPrefixTransformRule();\n }\n\n // Deprecated.\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.numberingPlan.leadingDigits();\n }\n\n // Deprecated.\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n return this.numberingPlan.hasTypes();\n }\n\n // Deprecated.\n }, {\n key: \"type\",\n value: function type(_type) {\n return this.numberingPlan.type(_type);\n }\n\n // Deprecated.\n }, {\n key: \"ext\",\n value: function ext() {\n return this.numberingPlan.ext();\n }\n }, {\n key: \"countryCallingCodes\",\n value: function countryCallingCodes() {\n if (this.v1) return this.metadata.country_phone_code_to_countries;\n return this.metadata.country_calling_codes;\n }\n\n // Deprecated.\n }, {\n key: \"chooseCountryByCountryCallingCode\",\n value: function chooseCountryByCountryCallingCode(callingCode) {\n return this.selectNumberingPlan(callingCode);\n }\n }, {\n key: \"hasSelectedNumberingPlan\",\n value: function hasSelectedNumberingPlan() {\n return this.numberingPlan !== undefined;\n }\n }]);\n}();\nexport { Metadata as default };\nvar NumberingPlan = /*#__PURE__*/function () {\n function NumberingPlan(metadata, globalMetadataObject) {\n _classCallCheck(this, NumberingPlan);\n this.globalMetadataObject = globalMetadataObject;\n this.metadata = metadata;\n setVersion.call(this, globalMetadataObject.metadata);\n }\n return _createClass(NumberingPlan, [{\n key: \"callingCode\",\n value: function callingCode() {\n return this.metadata[0];\n }\n\n // Formatting information for regions which share\n // a country calling code is contained by only one region\n // for performance reasons. For example, for NANPA region\n // (\"North American Numbering Plan Administration\",\n // which includes USA, Canada, Cayman Islands, Bahamas, etc)\n // it will be contained in the metadata for `US`.\n }, {\n key: \"getDefaultCountryMetadataForRegion\",\n value: function getDefaultCountryMetadataForRegion() {\n return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());\n }\n\n // Is always present.\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[1];\n }\n\n // Is only present when a country supports multiple IDD prefixes.\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[12];\n }\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n if (this.v1 || this.v2) return this.metadata[1];\n return this.metadata[2];\n }\n\n // \"possible length\" data is always present in Google's metadata.\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.v1) return;\n return this.metadata[this.v2 ? 2 : 3];\n }\n }, {\n key: \"_getFormats\",\n value: function _getFormats(metadata) {\n return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n }\n\n // For countries of the same region (e.g. NANPA)\n // formats are all stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n }, {\n key: \"formats\",\n value: function formats() {\n var _this = this;\n var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];\n return formats.map(function (_) {\n return new Format(_, _this);\n });\n }\n }, {\n key: \"nationalPrefix\",\n value: function nationalPrefix() {\n return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n }\n }, {\n key: \"_getNationalPrefixFormattingRule\",\n value: function _getNationalPrefixFormattingRule(metadata) {\n return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n }\n\n // For countries of the same region (e.g. NANPA)\n // national prefix formatting rule is stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"_nationalPrefixForParsing\",\n value: function _nationalPrefixForParsing() {\n return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];\n }\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n // If `national_prefix_for_parsing` is not set explicitly,\n // then infer it from `national_prefix` (if any)\n return this._nationalPrefixForParsing() || this.nationalPrefix();\n }\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n }\n }, {\n key: \"_getNationalPrefixIsOptionalWhenFormatting\",\n value: function _getNationalPrefixIsOptionalWhenFormatting() {\n return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n }\n\n // For countries of the same region (e.g. NANPA)\n // \"national prefix is optional when formatting\" flag is\n // stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n }\n }, {\n key: \"types\",\n value: function types() {\n return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n }\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n // Versions 1.2.0 - 1.2.4: can be `[]`.\n /* istanbul ignore next */\n if (this.types() && this.types().length === 0) {\n return false;\n }\n // Versions <= 1.2.4: can be `undefined`.\n // Version >= 1.2.5: can be `0`.\n return !!this.types();\n }\n }, {\n key: \"type\",\n value: function type(_type2) {\n if (this.hasTypes() && getType(this.types(), _type2)) {\n return new Type(getType(this.types(), _type2), this);\n }\n }\n }, {\n key: \"ext\",\n value: function ext() {\n if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n return this.metadata[13] || DEFAULT_EXT_PREFIX;\n }\n }]);\n}();\nvar Format = /*#__PURE__*/function () {\n function Format(format, metadata) {\n _classCallCheck(this, Format);\n this._format = format;\n this.metadata = metadata;\n }\n return _createClass(Format, [{\n key: \"pattern\",\n value: function pattern() {\n return this._format[0];\n }\n }, {\n key: \"format\",\n value: function format() {\n return this._format[1];\n }\n }, {\n key: \"leadingDigitsPatterns\",\n value: function leadingDigitsPatterns() {\n return this._format[2] || [];\n }\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._format[3] || this.metadata.nationalPrefixFormattingRule();\n }\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n }, {\n key: \"nationalPrefixIsMandatoryWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {\n // National prefix is omitted if there's no national prefix formatting rule\n // set for this country, or when the national prefix formatting rule\n // contains no national prefix itself, or when this rule is set but\n // national prefix is optional for this phone number format\n // (and it is not enforced explicitly)\n return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n\n // Checks whether national prefix formatting rule contains national prefix.\n }, {\n key: \"usesNationalPrefix\",\n value: function usesNationalPrefix() {\n return this.nationalPrefixFormattingRule() &&\n // Check that national prefix formatting rule is not a \"dummy\" one.\n !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule())\n // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`\n // when `national_prefix_formatting_rule` is not present.\n // So, `true` or `false` are returned explicitly here, so that\n // `0` number isn't returned.\n ? true : false;\n }\n }, {\n key: \"internationalFormat\",\n value: function internationalFormat() {\n return this._format[5] || this.format();\n }\n }]);\n}();\n/**\r\n * A pattern that is used to determine if the national prefix formatting rule\r\n * has the first group only, i.e., does not start with the national prefix.\r\n * Note that the pattern explicitly allows for unbalanced parentheses.\r\n */\nvar FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\\(?\\$1\\)?$/;\nvar Type = /*#__PURE__*/function () {\n function Type(type, metadata) {\n _classCallCheck(this, Type);\n this.type = type;\n this.metadata = metadata;\n }\n return _createClass(Type, [{\n key: \"pattern\",\n value: function pattern() {\n if (this.metadata.v1) return this.type;\n return this.type[0];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.metadata.v1) return;\n return this.type[1] || this.metadata.possibleLengths();\n }\n }]);\n}();\nfunction getType(types, type) {\n switch (type) {\n case 'FIXED_LINE':\n return types[0];\n case 'MOBILE':\n return types[1];\n case 'TOLL_FREE':\n return types[2];\n case 'PREMIUM_RATE':\n return types[3];\n case 'PERSONAL_NUMBER':\n return types[4];\n case 'VOICEMAIL':\n return types[5];\n case 'UAN':\n return types[6];\n case 'PAGER':\n return types[7];\n case 'VOIP':\n return types[8];\n case 'SHARED_COST':\n return types[9];\n }\n}\nexport function validateMetadata(metadata) {\n if (!metadata) {\n throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n }\n\n // `country_phone_code_to_countries` was renamed to `country_calling_codes` in `1.0.18`.\n // For that reason, it's not used in this detection algorithm.\n // Instead, it detects by `countries: {}` property existence.\n if (!isObject(metadata) || !isObject(metadata.countries)) {\n throw new Error(\"[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got \".concat(isObject(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + typeOf(metadata) + ': ' + metadata, \".\"));\n }\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar typeOf = function typeOf(_) {\n return _typeof(_);\n};\n\n/**\r\n * Returns extension prefix for a country.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string?}\r\n * @example\r\n * // Returns \" ext. \"\r\n * getExtPrefix(\"US\")\r\n */\nexport function getExtPrefix(country, metadata) {\n metadata = new Metadata(metadata);\n if (metadata.hasCountry(country)) {\n return metadata.selectNumberingPlan(country).ext();\n }\n return DEFAULT_EXT_PREFIX;\n}\n\n/**\r\n * Returns \"country calling code\" for a country.\r\n * Throws an error if the country doesn't exist or isn't supported by this library.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string}\r\n * @example\r\n * // Returns \"44\"\r\n * getCountryCallingCode(\"GB\")\r\n */\nexport function getCountryCallingCode(country, metadata) {\n metadata = new Metadata(metadata);\n if (metadata.hasCountry(country)) {\n return metadata.selectNumberingPlan(country).countryCallingCode();\n }\n throw new Error(\"Unknown country: \".concat(country));\n}\nexport function isSupportedCountry(country, metadata) {\n // metadata = new Metadata(metadata)\n // return metadata.hasCountry(country)\n return metadata.countries.hasOwnProperty(country);\n}\nfunction setVersion(metadata) {\n var version = metadata.version;\n if (typeof version === 'number') {\n this.v1 = version === 1;\n this.v2 = version === 2;\n this.v3 = version === 3;\n this.v4 = version === 4;\n } else {\n if (!version) {\n this.v1 = true;\n } else if (compare(version, V3) === -1) {\n this.v2 = true;\n } else if (compare(version, V4) === -1) {\n this.v3 = true;\n } else {\n this.v4 = true;\n }\n }\n}\n\n// const ISO_COUNTRY_CODE = /^[A-Z]{2}$/\n// function isCountryCode(countryCode) {\n// \treturn ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)\n// }\n//# sourceMappingURL=metadata.js.map"],"x_google_ignoreList":[0],"mappings":";;;AACA,SAAS,EAAQ,GAAG;AAAE;AAA2B,QAAO,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAU,GAAG;AAAE,SAAO,OAAO;KAAO,SAAU,GAAG;AAAE,SAAO,KAAmB,OAAO,UAArB,cAA+B,EAAE,gBAAgB,UAAU,MAAM,OAAO,YAAY,WAAW,OAAO;IAAM,EAAQ,EAAE;;AAC3T,SAAS,EAAgB,GAAG,GAAG;AAAE,KAAI,EAAE,aAAa,GAAI,OAAU,UAAU,oCAAoC;;AAChH,SAAS,EAAkB,GAAG,GAAG;AAAE,MAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;EAAE,IAAI,IAAI,EAAE;AAAI,IAAE,aAAa,EAAE,cAAc,CAAC,GAAG,EAAE,eAAe,CAAC,GAAG,WA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B,EAAsB,GAAS,GAAU;AAEvD,KADA,IAAW,IAAI,EAAS,EAAS,EAC7B,EAAS,WAAW,EAAQ,CAC9B,QAAO,EAAS,oBAAoB,EAAQ,CAAC,oBAAoB;AAEnE,OAAU,MAAM,oBAA2B,IAAS;;AAOtD,SAAS,EAAW,GAAU;CAC5B,IAAI,IAAU,EAAS;AACvB,CAAI,OAAO,KAAY,YACrB,KAAK,KAAK,MAAY,GACtB,KAAK,KAAK,MAAY,GACtB,KAAK,KAAK,MAAY,GACtB,KAAK,KAAK,MAAY,KAEjB,IAEMA,EAAQ,GAAS,EAAG,KAAK,KAClC,KAAK,KAAK,KACDA,EAAQ,GAAS,EAAG,KAAK,KAClC,KAAK,KAAK,KAEV,KAAK,KAAK,KANV,KAAK,KAAK"}
package/dist/index251.js CHANGED
@@ -1,31 +1,41 @@
1
- import { Metadata as e } from "./index248.js";
2
- import t from "./index250.js";
3
- //#region ../../node_modules/libphonenumber-js/es6/isPossible.js
4
- function n(t, n, i) {
5
- if (n === void 0 && (n = {}), i = new e(i), n.v2) {
6
- if (!t.countryCallingCode) throw Error("Invalid phone number object passed");
7
- i.selectNumberingPlan(t.countryCallingCode);
8
- } else {
9
- if (!t.phone) return !1;
10
- if (t.country) {
11
- if (!i.hasCountry(t.country)) throw Error(`Unknown country: ${t.country}`);
12
- i.selectNumberingPlan(t.country);
13
- } else {
14
- if (!t.countryCallingCode) throw Error("Invalid phone number object passed");
15
- i.selectNumberingPlan(t.countryCallingCode);
16
- }
1
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/mergeArrays.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
+ };
17
14
  }
18
- if (i.possibleLengths()) return r(t.phone || t.nationalNumber, t.country, i);
19
- if (t.countryCallingCode && i.isNonGeographicCallingCode(t.countryCallingCode)) return !0;
20
- throw Error("Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.");
15
+ throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
21
16
  }
22
- function r(e, n, r) {
23
- switch (t(e, n, r)) {
24
- case "IS_POSSIBLE": return !0;
25
- default: return !1;
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;
26
22
  }
27
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
+ function r(t, n) {
30
+ for (var r = t.slice(), i = e(n), a; !(a = i()).done;) {
31
+ var o = a.value;
32
+ t.indexOf(o) < 0 && r.push(o);
33
+ }
34
+ return r.sort(function(e, t) {
35
+ return e - t;
36
+ });
37
+ }
28
38
  //#endregion
29
- export { n as default, r as isPossibleNumber };
39
+ export { r as default };
30
40
 
31
41
  //# sourceMappingURL=index251.js.map