@rpcbase/ui 0.260.0 → 0.262.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 (261) hide show
  1. package/dist/assets/sha256.worker-BEf4_Y9w.js.map +1 -0
  2. package/dist/components/FilesUploadField/index.d.ts +19 -6
  3. package/dist/components/FilesUploadField/index.d.ts.map +1 -1
  4. package/dist/components/FilesUploadField/sha256.d.ts +5 -0
  5. package/dist/components/FilesUploadField/sha256.d.ts.map +1 -0
  6. package/dist/components/FilesUploadField/sha256.worker.d.ts +4 -0
  7. package/dist/components/FilesUploadField/sha256.worker.d.ts.map +1 -0
  8. package/dist/components/ImagesField/index.d.ts +4 -2
  9. package/dist/components/ImagesField/index.d.ts.map +1 -1
  10. package/dist/index.js +10 -10
  11. package/dist/index298.js +11 -803
  12. package/dist/index298.js.map +1 -1
  13. package/dist/index299.js +865 -28
  14. package/dist/index299.js.map +1 -1
  15. package/dist/index300.js +26 -510
  16. package/dist/index300.js.map +1 -1
  17. package/dist/index301.js +481 -755
  18. package/dist/index301.js.map +1 -1
  19. package/dist/index302.js +786 -7428
  20. package/dist/index302.js.map +1 -1
  21. package/dist/index303.js +7429 -7
  22. package/dist/index303.js.map +1 -1
  23. package/dist/index304.js +6 -12
  24. package/dist/index304.js.map +1 -1
  25. package/dist/index305.js +12 -5
  26. package/dist/index305.js.map +1 -1
  27. package/dist/index306.js +3 -3
  28. package/dist/index306.js.map +1 -1
  29. package/dist/index307.js +5 -469
  30. package/dist/index307.js.map +1 -1
  31. package/dist/index308.js +464 -32
  32. package/dist/index308.js.map +1 -1
  33. package/dist/index309.js +36 -18
  34. package/dist/index309.js.map +1 -1
  35. package/dist/index310.js +17 -28
  36. package/dist/index310.js.map +1 -1
  37. package/dist/index311.js +30 -4
  38. package/dist/index311.js.map +1 -1
  39. package/dist/index312.js +4 -59
  40. package/dist/index312.js.map +1 -1
  41. package/dist/index313.js +59 -9
  42. package/dist/index313.js.map +1 -1
  43. package/dist/index314.js +9 -5
  44. package/dist/index314.js.map +1 -1
  45. package/dist/index315.js +5 -9
  46. package/dist/index315.js.map +1 -1
  47. package/dist/index316.js +9 -12
  48. package/dist/index316.js.map +1 -1
  49. package/dist/index317.js +13 -3
  50. package/dist/index317.js.map +1 -1
  51. package/dist/index318.js +3 -17
  52. package/dist/index318.js.map +1 -1
  53. package/dist/index319.js +14 -23
  54. package/dist/index319.js.map +1 -1
  55. package/dist/index320.js +23 -39
  56. package/dist/index320.js.map +1 -1
  57. package/dist/index321.js +41 -5
  58. package/dist/index321.js.map +1 -1
  59. package/dist/index322.js +5 -25
  60. package/dist/index322.js.map +1 -1
  61. package/dist/index323.js +24 -18
  62. package/dist/index323.js.map +1 -1
  63. package/dist/index324.js +17 -32
  64. package/dist/index324.js.map +1 -1
  65. package/dist/index325.js +34 -5
  66. package/dist/index325.js.map +1 -1
  67. package/dist/index326.js +5 -9
  68. package/dist/index326.js.map +1 -1
  69. package/dist/index327.js +8 -7
  70. package/dist/index327.js.map +1 -1
  71. package/dist/index328.js +8 -9
  72. package/dist/index328.js.map +1 -1
  73. package/dist/index329.js +9 -10
  74. package/dist/index329.js.map +1 -1
  75. package/dist/index330.js +10 -7
  76. package/dist/index330.js.map +1 -1
  77. package/dist/index331.js +7 -75
  78. package/dist/index331.js.map +1 -1
  79. package/dist/index332.js +66 -153
  80. package/dist/index332.js.map +1 -1
  81. package/dist/index333.js +147 -99
  82. package/dist/index333.js.map +1 -1
  83. package/dist/index334.js +113 -13
  84. package/dist/index334.js.map +1 -1
  85. package/dist/index335.js +12 -78
  86. package/dist/index335.js.map +1 -1
  87. package/dist/index336.js +57 -23
  88. package/dist/index336.js.map +1 -1
  89. package/dist/index337.js +45 -12
  90. package/dist/index337.js.map +1 -1
  91. package/dist/index338.js +13 -16
  92. package/dist/index338.js.map +1 -1
  93. package/dist/index339.js +15 -100
  94. package/dist/index339.js.map +1 -1
  95. package/dist/index340.js +95 -50
  96. package/dist/index340.js.map +1 -1
  97. package/dist/index341.js +5 -57
  98. package/dist/index341.js.map +1 -1
  99. package/dist/index342.js +78 -41
  100. package/dist/index342.js.map +1 -1
  101. package/dist/index343.js +58 -100
  102. package/dist/index343.js.map +1 -1
  103. package/dist/index344.js +104 -46
  104. package/dist/index344.js.map +1 -1
  105. package/dist/index345.js +51 -39
  106. package/dist/index345.js.map +1 -1
  107. package/dist/index346.js +42 -142
  108. package/dist/index346.js.map +1 -1
  109. package/dist/index347.js +123 -120
  110. package/dist/index347.js.map +1 -1
  111. package/dist/index348.js +108 -224
  112. package/dist/index348.js.map +1 -1
  113. package/dist/index349.js +174 -158
  114. package/dist/index349.js.map +1 -1
  115. package/dist/index350.js +144 -213
  116. package/dist/index350.js.map +1 -1
  117. package/dist/index351.js +309 -5
  118. package/dist/index351.js.map +1 -1
  119. package/dist/index352.js +5 -6
  120. package/dist/index352.js.map +1 -1
  121. package/dist/index353.js +6 -7
  122. package/dist/index353.js.map +1 -1
  123. package/dist/index354.js +5 -4
  124. package/dist/index354.js.map +1 -1
  125. package/dist/index355.js +4 -4
  126. package/dist/index355.js.map +1 -1
  127. package/dist/index356.js +6 -21
  128. package/dist/index356.js.map +1 -1
  129. package/dist/index357.js +21 -10
  130. package/dist/index357.js.map +1 -1
  131. package/dist/index358.js +10 -128
  132. package/dist/index358.js.map +1 -1
  133. package/dist/index359.js +122 -36
  134. package/dist/index359.js.map +1 -1
  135. package/dist/index360.js +38 -64
  136. package/dist/index360.js.map +1 -1
  137. package/dist/index361.js +66 -115
  138. package/dist/index361.js.map +1 -1
  139. package/dist/index362.js +112 -485
  140. package/dist/index362.js.map +1 -1
  141. package/dist/index363.js +490 -13
  142. package/dist/index363.js.map +1 -1
  143. package/dist/index364.js +13 -4
  144. package/dist/index364.js.map +1 -1
  145. package/dist/index365.js +4 -47
  146. package/dist/index365.js.map +1 -1
  147. package/dist/index366.js +44 -15
  148. package/dist/index366.js.map +1 -1
  149. package/dist/index367.js +19 -5
  150. package/dist/index367.js.map +1 -1
  151. package/dist/index368.js +5 -27
  152. package/dist/index368.js.map +1 -1
  153. package/dist/index369.js +27 -48
  154. package/dist/index369.js.map +1 -1
  155. package/dist/index370.js +46 -27
  156. package/dist/index370.js.map +1 -1
  157. package/dist/index371.js +27 -16
  158. package/dist/index371.js.map +1 -1
  159. package/dist/index372.js +16 -41
  160. package/dist/index372.js.map +1 -1
  161. package/dist/index373.js +42 -14
  162. package/dist/index373.js.map +1 -1
  163. package/dist/index374.js +14 -10
  164. package/dist/index374.js.map +1 -1
  165. package/dist/index375.js +9 -51
  166. package/dist/index375.js.map +1 -1
  167. package/dist/index376.js +53 -43
  168. package/dist/index376.js.map +1 -1
  169. package/dist/index377.js +43 -16
  170. package/dist/index377.js.map +1 -1
  171. package/dist/index378.js +15 -4
  172. package/dist/index378.js.map +1 -1
  173. package/dist/index379.js +4 -4
  174. package/dist/index379.js.map +1 -1
  175. package/dist/index380.js +4 -9
  176. package/dist/index380.js.map +1 -1
  177. package/dist/index381.js +9 -340
  178. package/dist/index381.js.map +1 -1
  179. package/dist/index382.js +339 -4
  180. package/dist/index382.js.map +1 -1
  181. package/dist/index383.js +5 -16
  182. package/dist/index383.js.map +1 -1
  183. package/dist/index384.js +16 -111
  184. package/dist/index384.js.map +1 -1
  185. package/dist/index385.js +109 -19
  186. package/dist/index385.js.map +1 -1
  187. package/dist/index386.js +18 -18
  188. package/dist/index386.js.map +1 -1
  189. package/dist/index387.js +21 -5
  190. package/dist/index387.js.map +1 -1
  191. package/dist/index388.js +5 -20
  192. package/dist/index388.js.map +1 -1
  193. package/dist/index389.js +19 -13
  194. package/dist/index389.js.map +1 -1
  195. package/dist/index390.js +13 -84
  196. package/dist/index390.js.map +1 -1
  197. package/dist/index391.js +84 -7
  198. package/dist/index391.js.map +1 -1
  199. package/dist/index392.js +9 -29
  200. package/dist/index392.js.map +1 -1
  201. package/dist/index393.js +28 -9
  202. package/dist/index393.js.map +1 -1
  203. package/dist/index394.js +9 -5
  204. package/dist/index394.js.map +1 -1
  205. package/dist/index395.js +6 -252
  206. package/dist/index395.js.map +1 -1
  207. package/dist/index396.js +250 -10
  208. package/dist/index396.js.map +1 -1
  209. package/dist/index397.js +11 -10
  210. package/dist/index397.js.map +1 -1
  211. package/dist/index398.js +10 -6
  212. package/dist/index398.js.map +1 -1
  213. package/dist/index399.js +6 -22
  214. package/dist/index399.js.map +1 -1
  215. package/dist/index400.js +21 -21
  216. package/dist/index400.js.map +1 -1
  217. package/dist/index401.js +21 -107
  218. package/dist/index401.js.map +1 -1
  219. package/dist/index402.js +109 -15
  220. package/dist/index402.js.map +1 -1
  221. package/dist/index403.js +15 -12
  222. package/dist/index403.js.map +1 -1
  223. package/dist/index404.js +10 -8
  224. package/dist/index404.js.map +1 -1
  225. package/dist/index405.js +8 -242
  226. package/dist/index405.js.map +1 -1
  227. package/dist/index406.js +238 -25
  228. package/dist/index406.js.map +1 -1
  229. package/dist/index407.js +29 -51
  230. package/dist/index407.js.map +1 -1
  231. package/dist/index408.js +51 -10
  232. package/dist/index408.js.map +1 -1
  233. package/dist/index409.js +11 -128
  234. package/dist/index409.js.map +1 -1
  235. package/dist/index410.js +124 -35
  236. package/dist/index410.js.map +1 -1
  237. package/dist/index411.js +36 -23
  238. package/dist/index411.js.map +1 -1
  239. package/dist/index412.js +26 -11
  240. package/dist/index412.js.map +1 -1
  241. package/dist/index413.js +11 -23
  242. package/dist/index413.js.map +1 -1
  243. package/dist/index414.js +19 -13
  244. package/dist/index414.js.map +1 -1
  245. package/dist/index415.js +14 -13
  246. package/dist/index415.js.map +1 -1
  247. package/dist/index416.js +14 -322
  248. package/dist/index416.js.map +1 -1
  249. package/dist/index417.js +323 -61
  250. package/dist/index417.js.map +1 -1
  251. package/dist/index418.js +63 -4
  252. package/dist/index418.js.map +1 -1
  253. package/dist/index419.js +4 -28
  254. package/dist/index419.js.map +1 -1
  255. package/dist/index420.js +25 -468
  256. package/dist/index420.js.map +1 -1
  257. package/dist/index421.js +452 -250
  258. package/dist/index421.js.map +1 -1
  259. package/dist/index422.js +272 -0
  260. package/dist/index422.js.map +1 -0
  261. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index318.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport { VALID_DIGITS } from '../constants.js';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadataJson) {\n if (!country) {\n return;\n }\n\n // Get the IDD prefix pattern.\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || callingCode);\n var IDDPrefixPattern = new RegExp(metadata.IDDPrefix());\n\n // Check if the number is IDD-prefixed.\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n }\n\n // Strip IDD prefix.\n number = number.slice(number.match(IDDPrefixPattern)[0].length);\n\n // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAEA,IAAI,IAA8B,OAAO,OAAO,IAAe,IAAI;AACnE,SAAwB,EAAe,GAAQ,GAAS,GAAa,GAAc;CAC5E,OAKL;MAAI,IAAW,IAAI,EAAS,CAAY;EACxC,EAAS,oBAAoB,KAAW,CAAW;EACnD,IAAI,IAAmB,IAAI,OAAO,EAAS,UAAU,CAAC;EAGlD,MAAO,OAAO,CAAgB,MAAM,GAKxC;OAAS,EAAO,MAAM,EAAO,MAAM,CAAgB,CAAC,CAAC,EAAE,CAAC,MAAM;GAM9D,IAAI,IAAgB,EAAO,MAAM,CAAuB;SACpD,KAAiB,EAAc,MAAM,QAAQ,EAAc,EAAE,CAAC,SAAS,KACrE,EAAc,OAAO,MAI3B,OAAO;EAZuD;CAVtB;AAuB1C"}
1
+ {"version":3,"file":"index318.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/constants.js"],"sourcesContent":["// The minimum length of the national significant number.\nexport var MIN_LENGTH_FOR_NSN = 2;\n\n// The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\nexport var MAX_LENGTH_FOR_NSN = 17;\n\n// The maximum length of the country calling code.\nexport var MAX_LENGTH_COUNTRY_CODE = 3;\n\n// Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\nexport var VALID_DIGITS = \"0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9\";\n\n// `DASHES` will be right after the opening square bracket of the \"character class\"\nvar DASHES = \"-\\u2010-\\u2015\\u2212\\u30FC\\uFF0D\";\nvar SLASHES = \"\\uFF0F/\";\nvar DOTS = \"\\uFF0E.\";\nexport var WHITESPACE = \" \\xA0\\xAD\\u200B\\u2060\\u3000\";\nvar BRACKETS = \"()\\uFF08\\uFF09\\uFF3B\\uFF3D\\\\[\\\\]\";\n// export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\nvar TILDES = \"~\\u2053\\u223C\\uFF5E\";\n\n// Regular expression of acceptable punctuation found in phone numbers. This\n// excludes punctuation found as a leading character only. This consists of dash\n// characters, white space characters, full stops, slashes, square brackets,\n// parentheses and tildes. Full-width variants are also present.\nexport var VALID_PUNCTUATION = \"\".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);\nexport var PLUS_CHARS = \"+\\uFF0B\";\n// const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')\n//# sourceMappingURL=constants.js.map"],"x_google_ignoreList":[0],"mappings":";AAYA,IAAW,IAAe,gBAGtB,IAAS,WACT,IAAU,MACV,IAAO,MACA,IAAa,aASb,IAAoB,GAAU,IAAe,IAAgB,IAAa,qBAC1E,IAAa"}
package/dist/index319.js CHANGED
@@ -1,29 +1,20 @@
1
- //#region ../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
2
- function e(e, t) {
3
- if (e && t.numberingPlan.nationalPrefixForParsing()) {
4
- var n = RegExp("^(?:" + t.numberingPlan.nationalPrefixForParsing() + ")"), r = n.exec(e);
5
- if (r) {
6
- var i, a, o = r.length - 1, s = o > 0 && r[o];
7
- if (t.nationalPrefixTransformRule() && s) i = e.replace(n, t.nationalPrefixTransformRule()), o > 1 && (a = r[1]);
8
- else {
9
- var c = r[0];
10
- i = e.slice(c.length), s && (a = r[1]);
11
- }
12
- var l;
13
- if (s) {
14
- var u = e.indexOf(r[1]);
15
- e.slice(0, u) === t.numberingPlan.nationalPrefix() && (l = t.numberingPlan.nationalPrefix());
16
- } else l = r[0];
17
- return {
18
- nationalNumber: i,
19
- nationalPrefix: l,
20
- carrierCode: a
21
- };
1
+ import e from "./index308.js";
2
+ import { VALID_DIGITS as t } from "./index318.js";
3
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
4
+ var n = RegExp("([" + t + "])");
5
+ function r(t, r, i, a) {
6
+ if (r) {
7
+ var o = new e(a);
8
+ o.selectNumberingPlan(r || i);
9
+ var s = new RegExp(o.IDDPrefix());
10
+ if (t.search(s) === 0) {
11
+ t = t.slice(t.match(s)[0].length);
12
+ var c = t.match(n);
13
+ if (!(c && c[1] != null && c[1].length > 0 && c[1] === "0")) return t;
22
14
  }
23
15
  }
24
- return { nationalNumber: e };
25
16
  }
26
17
  //#endregion
27
- export { e as default };
18
+ export { r as default };
28
19
 
29
20
  //# sourceMappingURL=index319.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index319.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js"],"sourcesContent":["/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not.\r\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode;\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());\n // If there's more than one captured group,\n // then carrier code is the second one.\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n }\n // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length);\n // If there's at least one captured group,\n // then carrier code is the first one.\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n }\n // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n var nationalPrefix;\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);\n // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map"],"x_google_ignoreList":[0],"mappings":";AAaA,SAAwB,EAAkD,GAAQ,GAAU;CAC1F,IAAI,KAAU,EAAS,cAAc,yBAAyB,GAAG;EAI/D,IAAI,IAAoB,OAAO,SAAS,EAAS,cAAc,yBAAyB,IAAI,GAAG,GAC3F,IAAc,EAAc,KAAK,CAAM;EAC3C,IAAI,GAAa;GACf,IAAI,GACA,GAiBA,IAAsB,EAAY,SAAS,GAC3C,IAAoB,IAAsB,KAAK,EAAY;GAC/D,IAAI,EAAS,4BAA4B,KAAK,GAI5C,AAHA,IAAiB,EAAO,QAAQ,GAAe,EAAS,4BAA4B,CAAC,GAGjF,IAAsB,MACxB,IAAc,EAAY;QASzB;IAMH,IAAI,IAA6B,EAAY;IAI7C,AAHA,IAAiB,EAAO,MAAM,EAA2B,MAAM,GAG3D,MACF,IAAc,EAAY;GAE9B;GAMA,IAAI;GACJ,IAAI,GAAmB;IACrB,IAAI,IAA0C,EAAO,QAAQ,EAAY,EAAE;IAQ3E,AAP6B,EAAO,MAAM,GAAG,CAOpB,MAAM,EAAS,cAAc,eAAe,MACnE,IAAiB,EAAS,cAAc,eAAe;GAE3D,OACE,IAAiB,EAAY;GAE/B,OAAO;IACW;IACA;IACH;GACf;EACF;CACF;CACA,OAAO,EACL,gBAAgB,EAClB;AACF"}
1
+ {"version":3,"file":"index319.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport { VALID_DIGITS } from '../constants.js';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadataJson) {\n if (!country) {\n return;\n }\n\n // Get the IDD prefix pattern.\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || callingCode);\n var IDDPrefixPattern = new RegExp(metadata.IDDPrefix());\n\n // Check if the number is IDD-prefixed.\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n }\n\n // Strip IDD prefix.\n number = number.slice(number.match(IDDPrefixPattern)[0].length);\n\n // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAEA,IAAI,IAA8B,OAAO,OAAO,IAAe,IAAI;AACnE,SAAwB,EAAe,GAAQ,GAAS,GAAa,GAAc;CAC5E,OAKL;MAAI,IAAW,IAAI,EAAS,CAAY;EACxC,EAAS,oBAAoB,KAAW,CAAW;EACnD,IAAI,IAAmB,IAAI,OAAO,EAAS,UAAU,CAAC;EAGlD,MAAO,OAAO,CAAgB,MAAM,GAKxC;OAAS,EAAO,MAAM,EAAO,MAAM,CAAgB,CAAC,CAAC,EAAE,CAAC,MAAM;GAM9D,IAAI,IAAgB,EAAO,MAAM,CAAuB;SACpD,KAAiB,EAAc,MAAM,QAAQ,EAAc,EAAE,CAAC,SAAS,KACrE,EAAc,OAAO,MAI3B,OAAO;EAZuD;CAVtB;AAuB1C"}
package/dist/index320.js CHANGED
@@ -1,45 +1,29 @@
1
- import e from "./index307.js";
2
- import t from "./index312.js";
3
- //#region ../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
4
- function n(e, t) {
5
- var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
6
- if (n) return (n = n.call(e)).next.bind(n);
7
- if (Array.isArray(e) || (n = r(e)) || t && e && typeof e.length == "number") {
8
- n && (e = n);
9
- var i = 0;
10
- return function() {
11
- return i >= e.length ? { done: !0 } : {
12
- done: !1,
13
- value: e[i++]
1
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
2
+ function e(e, t) {
3
+ if (e && t.numberingPlan.nationalPrefixForParsing()) {
4
+ var n = RegExp("^(?:" + t.numberingPlan.nationalPrefixForParsing() + ")"), r = n.exec(e);
5
+ if (r) {
6
+ var i, a, o = r.length - 1, s = o > 0 && r[o];
7
+ if (t.nationalPrefixTransformRule() && s) i = e.replace(n, t.nationalPrefixTransformRule()), o > 1 && (a = r[1]);
8
+ else {
9
+ var c = r[0];
10
+ i = e.slice(c.length), s && (a = r[1]);
11
+ }
12
+ var l;
13
+ if (s) {
14
+ var u = e.indexOf(r[1]);
15
+ e.slice(0, u) === t.numberingPlan.nationalPrefix() && (l = t.numberingPlan.nationalPrefix());
16
+ } else l = r[0];
17
+ return {
18
+ nationalNumber: i,
19
+ nationalPrefix: l,
20
+ carrierCode: a
14
21
  };
15
- };
16
- }
17
- throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
- }
19
- function r(e, t) {
20
- if (e) {
21
- if (typeof e == "string") return i(e, t);
22
- var n = {}.toString.call(e).slice(8, -1);
23
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? i(e, t) : void 0;
24
- }
25
- }
26
- function i(e, t) {
27
- (t == null || t > e.length) && (t = e.length);
28
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
29
- return r;
30
- }
31
- function a(r, i, a) {
32
- for (var o = new e(a), s = n(i), c; !(c = s()).done;) {
33
- var l = c.value;
34
- if (o.selectNumberingPlan(l), o.leadingDigits()) {
35
- if (r && r.search(o.leadingDigits()) === 0) return l;
36
- } else if (t({
37
- phone: r,
38
- country: l
39
- }, void 0, o.metadata)) return l;
22
+ }
40
23
  }
24
+ return { nationalNumber: e };
41
25
  }
42
26
  //#endregion
43
- export { a as default };
27
+ export { e as default };
44
28
 
45
29
  //# sourceMappingURL=index320.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index320.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport Metadata from '../metadata.js';\nimport getNumberType from './getNumberType.js';\n\n/**\r\n * Returns the exact country that a given national (significant) number belongs to\r\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\r\n * @param {string} [nationalNumber]\r\n * @param {string[]} countries — A list of countries that share the same calling code.\r\n * @param {object} metadata — Metadata JSON.\r\n * @returns {string?} Returns the exact country this number belongs to, or `undefined` if the exact country couldn't be determined.\r\n */\nexport default function getCountryByNationalNumber(nationalNumber, countries, metadataJson) {\n // Create a new `metadata` instance because it will be selecting a `country`.\n var metadata = new Metadata(metadataJson);\n\n // const matchingCountries = []\n\n for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {\n var country = _step.value;\n metadata.selectNumberingPlan(country);\n // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // condition for a phone number to belong to a country.\n // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\n // because of the intended use of that feature.\n if (metadata.leadingDigits()) {\n if (nationalNumber && nationalNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n }\n // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalNumber,\n country: country\n }, undefined, metadata.metadata)) {\n // When multiple countries share the same \"country calling code\",\n // type patterns aren't guaranteed to be unique among them.\n // For example, both `US` and `CA` have the same pattern for `toll_free` numbers.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417147572\n //\n // That means that this `if` condition could be `true` for multiple countries from the list.\n // Currently, it just returns the first one, which is also the \"main\" country for the \"country calling code\".\n // In an example with `toll_free` numbers above, `\"US\"` would be returned even though\n // it could as well be `\"CA\"`.\n //\n // There was also a time when this attempted to be overly smart\n // and kept track of all such multiple matching countries\n // and then picked the one that matched the `defaultCountry`, if provided.\n // For example, with `toll_free` numbers above, and with `defaultCountry: \"CA\"`,\n // it would've returned `\"CA\"` instead of `\"US\"`.\n // Later it turned out that such \"overly smart\" behavior turned out to be just confusing,\n // so this \"overly smart\" country detection was reverted to returning the \"main\" country\n // for the \"country calling code\".\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\n //\n return country;\n //\n // The \"overly smart\" behavior code:\n //\n // if (defaultCountry) {\n // \tif (country === defaultCountry) {\n // \t\treturn country\n // \t} else {\n // \t\tmatchingCountries.push(country)\n // \t}\n // } else {\n // \treturn country\n // }\n }\n }\n\n // // Return the first (\"main\") one of the `matchingCountries`.\n // if (matchingCountries.length > 0) {\n // \treturn matchingCountries[0]\n // }\n}\n//# sourceMappingURL=getCountryByNationalNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAAA,SAAS,EAAgC,GAAG,GAAG;CAAE,IAAI,IAAmB,OAAO,SAAtB,OAAgC,EAAE,OAAO,aAAa,EAAE;CAAe,IAAI,GAAG,QAAQ,IAAI,EAAE,KAAK,CAAC,EAAA,CAAG,KAAK,KAAK,CAAC;CAAG,IAAI,MAAM,QAAQ,CAAC,MAAM,IAAI,EAA4B,CAAC,MAAM,KAAK,KAAiB,OAAO,EAAE,UAArB,UAA6B;EAAE,MAAM,IAAI;EAAI,IAAI,IAAI;EAAG,OAAO,WAAY;GAAE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI;IAAE,MAAM,CAAC;IAAG,OAAO,EAAE;GAAK;EAAG;CAAG;CAAE,MAAU,UAAU,uIAAuI;AAAG;AACziB,SAAS,EAA4B,GAAG,GAAG;CAAE,IAAI,GAAG;EAAE,IAAgB,OAAO,KAAnB,UAAsB,OAAO,EAAkB,GAAG,CAAC;EAAG,IAAI,IAAI,CAAC,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE;EAAG,OAAoB,MAAb,YAAkB,EAAE,gBAAgB,IAAI,EAAE,YAAY,OAAiB,MAAV,SAAyB,MAAV,QAAc,MAAM,KAAK,CAAC,IAAoB,MAAhB,eAAqB,2CAA2C,KAAK,CAAC,IAAI,EAAkB,GAAG,CAAC,IAAI,KAAK;CAAG;AAAE;AACzX,SAAS,EAAkB,GAAG,GAAG;CAAE,CAAS,KAAR,QAAa,IAAI,EAAE,YAAY,IAAI,EAAE;CAAS,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,EAAE,KAAK,EAAE;CAAI,OAAO;AAAG;AAYnJ,SAAwB,EAA2B,GAAgB,GAAW,GAAc;CAM1F,KAAK,IAJD,IAAW,IAAI,EAAS,CAAY,GAI/B,IAAY,EAAgC,CAAS,GAAG,GAAO,EAAE,IAAQ,EAAU,EAAA,CAAG,OAAO;EACpG,IAAI,IAAU,EAAM;EASpB,IARA,EAAS,oBAAoB,CAAO,GAQhC,EAAS,cAAc;OACrB,KAAkB,EAAe,OAAO,EAAS,cAAc,CAAC,MAAM,GACxE,OAAO;EAAA,OAKN,IAAI,EAAc;GACrB,OAAO;GACE;EACX,GAAG,KAAA,GAAW,EAAS,QAAQ,GAqB7B,OAAO;CAcX;AAMF"}
1
+ {"version":3,"file":"index320.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js"],"sourcesContent":["/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not.\r\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode;\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());\n // If there's more than one captured group,\n // then carrier code is the second one.\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n }\n // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length);\n // If there's at least one captured group,\n // then carrier code is the first one.\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n }\n // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n var nationalPrefix;\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);\n // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map"],"x_google_ignoreList":[0],"mappings":";AAaA,SAAwB,EAAkD,GAAQ,GAAU;CAC1F,IAAI,KAAU,EAAS,cAAc,yBAAyB,GAAG;EAI/D,IAAI,IAAoB,OAAO,SAAS,EAAS,cAAc,yBAAyB,IAAI,GAAG,GAC3F,IAAc,EAAc,KAAK,CAAM;EAC3C,IAAI,GAAa;GACf,IAAI,GACA,GAiBA,IAAsB,EAAY,SAAS,GAC3C,IAAoB,IAAsB,KAAK,EAAY;GAC/D,IAAI,EAAS,4BAA4B,KAAK,GAI5C,AAHA,IAAiB,EAAO,QAAQ,GAAe,EAAS,4BAA4B,CAAC,GAGjF,IAAsB,MACxB,IAAc,EAAY;QASzB;IAMH,IAAI,IAA6B,EAAY;IAI7C,AAHA,IAAiB,EAAO,MAAM,EAA2B,MAAM,GAG3D,MACF,IAAc,EAAY;GAE9B;GAMA,IAAI;GACJ,IAAI,GAAmB;IACrB,IAAI,IAA0C,EAAO,QAAQ,EAAY,EAAE;IAQ3E,AAP6B,EAAO,MAAM,GAAG,CAOpB,MAAM,EAAS,cAAc,eAAe,MACnE,IAAiB,EAAS,cAAc,eAAe;GAE3D,OACE,IAAiB,EAAY;GAE/B,OAAO;IACW;IACA;IACH;GACf;EACF;CACF;CACA,OAAO,EACL,gBAAgB,EAClB;AACF"}
package/dist/index321.js CHANGED
@@ -1,9 +1,45 @@
1
- import e from "./index320.js";
2
- function t(t, n) {
3
- var r = n.nationalNumber, i = n.metadata, a = i.getCountryCodesForCallingCode(t);
4
- if (a) return a.length === 1 ? a[0] : e(r, a, i.metadata);
1
+ import e from "./index308.js";
2
+ import t from "./index313.js";
3
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
4
+ function n(e, t) {
5
+ var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
6
+ if (n) return (n = n.call(e)).next.bind(n);
7
+ if (Array.isArray(e) || (n = r(e)) || t && e && typeof e.length == "number") {
8
+ n && (e = n);
9
+ var i = 0;
10
+ return function() {
11
+ return i >= e.length ? { done: !0 } : {
12
+ done: !1,
13
+ value: e[i++]
14
+ };
15
+ };
16
+ }
17
+ throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function r(e, t) {
20
+ if (e) {
21
+ if (typeof e == "string") return i(e, t);
22
+ var n = {}.toString.call(e).slice(8, -1);
23
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? i(e, t) : void 0;
24
+ }
25
+ }
26
+ function i(e, t) {
27
+ (t == null || t > e.length) && (t = e.length);
28
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
29
+ return r;
30
+ }
31
+ function a(r, i, a) {
32
+ for (var o = new e(a), s = n(i), c; !(c = s()).done;) {
33
+ var l = c.value;
34
+ if (o.selectNumberingPlan(l), o.leadingDigits()) {
35
+ if (r && r.search(o.leadingDigits()) === 0) return l;
36
+ } else if (t({
37
+ phone: r,
38
+ country: l
39
+ }, void 0, o.metadata)) return l;
40
+ }
5
41
  }
6
42
  //#endregion
7
- export { t as default };
43
+ export { a as default };
8
44
 
9
45
  //# sourceMappingURL=index321.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index321.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js"],"sourcesContent":["import getCountryByNationalNumber from './getCountryByNationalNumber.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\n/**\r\n * Returns the exact country that a given national (significant) number belongs to\r\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\r\n * @param {string} [callingCode]\r\n * @param {string} [options.nationalNumber] — National (significant) number.\r\n * @param {Metadata} options.metadata — Metadata instance.\r\n * @returns {string?} Returns the most suitable country for this calling code and national (significant) number.\r\n */\nexport default function getCountryByCallingCode(callingCode, _ref) {\n var nationalNumber = _ref.nationalNumber,\n metadata = _ref.metadata;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n }\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n if (!possibleCountries) {\n return;\n }\n // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n return getCountryByNationalNumber(nationalNumber, possibleCountries, metadata.metadata);\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map"],"x_google_ignoreList":[0],"mappings":";AAWA,SAAwB,EAAwB,GAAa,GAAM;CACjE,IAAI,IAAiB,EAAK,gBACxB,IAAW,EAAK,UAOd,IAAoB,EAAS,8BAA8B,CAAW;CACrE,OAQL,OAHI,EAAkB,WAAW,IACxB,EAAkB,KAEpB,EAA2B,GAAgB,GAAmB,EAAS,QAAQ;AACxF"}
1
+ {"version":3,"file":"index321.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport Metadata from '../metadata.js';\nimport getNumberType from './getNumberType.js';\n\n/**\r\n * Returns the exact country that a given national (significant) number belongs to\r\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\r\n * @param {string} [nationalNumber]\r\n * @param {string[]} countries — A list of countries that share the same calling code.\r\n * @param {object} metadata — Metadata JSON.\r\n * @returns {string?} Returns the exact country this number belongs to, or `undefined` if the exact country couldn't be determined.\r\n */\nexport default function getCountryByNationalNumber(nationalNumber, countries, metadataJson) {\n // Create a new `metadata` instance because it will be selecting a `country`.\n var metadata = new Metadata(metadataJson);\n\n // const matchingCountries = []\n\n for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {\n var country = _step.value;\n metadata.selectNumberingPlan(country);\n // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // condition for a phone number to belong to a country.\n // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\n // because of the intended use of that feature.\n if (metadata.leadingDigits()) {\n if (nationalNumber && nationalNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n }\n // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalNumber,\n country: country\n }, undefined, metadata.metadata)) {\n // When multiple countries share the same \"country calling code\",\n // type patterns aren't guaranteed to be unique among them.\n // For example, both `US` and `CA` have the same pattern for `toll_free` numbers.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417147572\n //\n // That means that this `if` condition could be `true` for multiple countries from the list.\n // Currently, it just returns the first one, which is also the \"main\" country for the \"country calling code\".\n // In an example with `toll_free` numbers above, `\"US\"` would be returned even though\n // it could as well be `\"CA\"`.\n //\n // There was also a time when this attempted to be overly smart\n // and kept track of all such multiple matching countries\n // and then picked the one that matched the `defaultCountry`, if provided.\n // For example, with `toll_free` numbers above, and with `defaultCountry: \"CA\"`,\n // it would've returned `\"CA\"` instead of `\"US\"`.\n // Later it turned out that such \"overly smart\" behavior turned out to be just confusing,\n // so this \"overly smart\" country detection was reverted to returning the \"main\" country\n // for the \"country calling code\".\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\n //\n return country;\n //\n // The \"overly smart\" behavior code:\n //\n // if (defaultCountry) {\n // \tif (country === defaultCountry) {\n // \t\treturn country\n // \t} else {\n // \t\tmatchingCountries.push(country)\n // \t}\n // } else {\n // \treturn country\n // }\n }\n }\n\n // // Return the first (\"main\") one of the `matchingCountries`.\n // if (matchingCountries.length > 0) {\n // \treturn matchingCountries[0]\n // }\n}\n//# sourceMappingURL=getCountryByNationalNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAAA,SAAS,EAAgC,GAAG,GAAG;CAAE,IAAI,IAAmB,OAAO,SAAtB,OAAgC,EAAE,OAAO,aAAa,EAAE;CAAe,IAAI,GAAG,QAAQ,IAAI,EAAE,KAAK,CAAC,EAAA,CAAG,KAAK,KAAK,CAAC;CAAG,IAAI,MAAM,QAAQ,CAAC,MAAM,IAAI,EAA4B,CAAC,MAAM,KAAK,KAAiB,OAAO,EAAE,UAArB,UAA6B;EAAE,MAAM,IAAI;EAAI,IAAI,IAAI;EAAG,OAAO,WAAY;GAAE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI;IAAE,MAAM,CAAC;IAAG,OAAO,EAAE;GAAK;EAAG;CAAG;CAAE,MAAU,UAAU,uIAAuI;AAAG;AACziB,SAAS,EAA4B,GAAG,GAAG;CAAE,IAAI,GAAG;EAAE,IAAgB,OAAO,KAAnB,UAAsB,OAAO,EAAkB,GAAG,CAAC;EAAG,IAAI,IAAI,CAAC,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE;EAAG,OAAoB,MAAb,YAAkB,EAAE,gBAAgB,IAAI,EAAE,YAAY,OAAiB,MAAV,SAAyB,MAAV,QAAc,MAAM,KAAK,CAAC,IAAoB,MAAhB,eAAqB,2CAA2C,KAAK,CAAC,IAAI,EAAkB,GAAG,CAAC,IAAI,KAAK;CAAG;AAAE;AACzX,SAAS,EAAkB,GAAG,GAAG;CAAE,CAAS,KAAR,QAAa,IAAI,EAAE,YAAY,IAAI,EAAE;CAAS,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,EAAE,KAAK,EAAE;CAAI,OAAO;AAAG;AAYnJ,SAAwB,EAA2B,GAAgB,GAAW,GAAc;CAM1F,KAAK,IAJD,IAAW,IAAI,EAAS,CAAY,GAI/B,IAAY,EAAgC,CAAS,GAAG,GAAO,EAAE,IAAQ,EAAU,EAAA,CAAG,OAAO;EACpG,IAAI,IAAU,EAAM;EASpB,IARA,EAAS,oBAAoB,CAAO,GAQhC,EAAS,cAAc;OACrB,KAAkB,EAAe,OAAO,EAAS,cAAc,CAAC,MAAM,GACxE,OAAO;EAAA,OAKN,IAAI,EAAc;GACrB,OAAO;GACE;EACX,GAAG,KAAA,GAAW,EAAS,QAAQ,GAqB7B,OAAO;CAcX;AAMF"}
package/dist/index322.js CHANGED
@@ -1,29 +1,9 @@
1
- import e from "./index309.js";
2
- import t from "./index311.js";
3
- import n from "./index319.js";
4
- import r from "./index321.js";
5
- //#region ../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js
6
- function i(e, t, i) {
7
- var s = n(e, i), c = s.carrierCode, l = s.nationalNumber;
8
- return l !== e && (!a(e, l, i) || i.numberingPlan.possibleLengths() && (t ||= r(i.numberingPlan.callingCode(), {
9
- nationalNumber: l,
10
- metadata: i
11
- }), !o(l, t, i))) ? { nationalNumber: e } : {
12
- nationalNumber: l,
13
- carrierCode: c
14
- };
15
- }
16
- function a(e, n, r) {
17
- return !(t(e, r.nationalNumberPattern()) && !t(n, r.nationalNumberPattern()));
18
- }
19
- function o(t, n, r) {
20
- switch (e(t, n, r)) {
21
- case "TOO_SHORT":
22
- case "INVALID_LENGTH": return !1;
23
- default: return !0;
24
- }
1
+ import e from "./index321.js";
2
+ function t(t, n) {
3
+ var r = n.nationalNumber, i = n.metadata, a = i.getCountryCodesForCallingCode(t);
4
+ if (a) return a.length === 1 ? a[0] : e(r, a, i.metadata);
25
5
  }
26
6
  //#endregion
27
- export { i as default };
7
+ export { t as default };
28
8
 
29
9
  //# sourceMappingURL=index322.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index322.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js"],"sourcesContent":["import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryByCallingCode from './getCountryByCallingCode.js';\n\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {string?} country — Specific country to use instead of the one that is pre-selected in the metadata instance.\r\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\nexport default function extractNationalNumber(number, country, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n carrierCode = _extractNationalNumbe.carrierCode,\n nationalNumber = _extractNationalNumbe.nationalNumber;\n if (nationalNumber !== number) {\n if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n // Check the national (significant) number length after extracting national prefix and carrier code.\n // Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature,\n // so this `if` will only be executed with newer metadata.\n if (metadata.numberingPlan.possibleLengths()) {\n // If an exact `country` is not specified, attempt to detect it from the assumed national number.\n if (!country) {\n country = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {\n nationalNumber: nationalNumber,\n metadata: metadata\n });\n }\n\n // The number remaining after stripping the national prefix and carrier code\n // should be long enough to have a possible length for the country.\n // Otherwise, don't strip the national prefix and carrier code,\n // since the original number could be a valid number.\n // This check has been copy-pasted \"as is\" from Google's original library:\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n // It doesn't check for the \"possibility\" of the original `number`.\n // I guess it's fine not checking that one. It works as is anyway.\n if (!isPossibleIncompleteNationalNumber(nationalNumber, country, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n\n// In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\nfunction shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {\n return false;\n }\n // This \"is possible\" national number (length) check has been commented out\n // because it's superceded by the (effectively) same check done in the\n // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`.\n // In other words, why run the same check twice if it could only be run once.\n // // Check the national (significant) number length after extracting national prefix and carrier code.\n // // Fixes a minor \"weird behavior\" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57\n // // (Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature).\n // if (metadata.possibleLengths()) {\n // \tif (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) &&\n // \t\t!isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) {\n // \t\treturn false\n // \t}\n // }\n return true;\n}\n\n/**\r\n * Tells if a given incomplete national number is possible or not.\r\n * @param {string} nationalNumber\r\n * @param {string?} country — Specific country rather than the one that is pre-selected in the metadata instance.\r\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\r\n * @returns {boolean}\r\n */\nfunction isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {\n switch (checkNumberLength(nationalNumber, country, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n return false;\n default:\n return true;\n }\n}\n//# sourceMappingURL=extractNationalNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAeA,SAAwB,EAAsB,GAAQ,GAAS,GAAU;CAUvE,IAAI,IAAwB,EAAkD,GAAQ,CAAQ,GAC5F,IAAc,EAAsB,aACpC,IAAiB,EAAsB;CAoCzC,OAnCI,MAAmB,MACjB,CAAC,EAAkC,GAAQ,GAAgB,CAAQ,KASnE,EAAS,cAAc,gBAAgB,MAEzC,AACE,MAAU,EAAwB,EAAS,cAAc,YAAY,GAAG;EACtD;EACN;CACZ,CAAC,GAWC,CAAC,EAAmC,GAAgB,GAAS,CAAQ,MAEhE,EACL,gBAAgB,EAClB,IAIC;EACW;EACH;CACf;AACF;AAgBA,SAAS,EAAkC,GAAsB,GAAqB,GAAU;CAmB9F,OAhBA,EAAI,EAAgB,GAAsB,EAAS,sBAAsB,CAAC,KAAK,CAAC,EAAgB,GAAqB,EAAS,sBAAsB,CAAC;AAiBvJ;AASA,SAAS,EAAmC,GAAgB,GAAS,GAAU;CAC7E,QAAQ,EAAkB,GAAgB,GAAS,CAAQ,GAA3D;EACE,KAAK;EACL,KAAK,kBAIH,OAAO;EACT,SACE,OAAO;CACX;AACF"}
1
+ {"version":3,"file":"index322.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js"],"sourcesContent":["import getCountryByNationalNumber from './getCountryByNationalNumber.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\n/**\r\n * Returns the exact country that a given national (significant) number belongs to\r\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\r\n * @param {string} [callingCode]\r\n * @param {string} [options.nationalNumber] — National (significant) number.\r\n * @param {Metadata} options.metadata — Metadata instance.\r\n * @returns {string?} Returns the most suitable country for this calling code and national (significant) number.\r\n */\nexport default function getCountryByCallingCode(callingCode, _ref) {\n var nationalNumber = _ref.nationalNumber,\n metadata = _ref.metadata;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n }\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n if (!possibleCountries) {\n return;\n }\n // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n return getCountryByNationalNumber(nationalNumber, possibleCountries, metadata.metadata);\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map"],"x_google_ignoreList":[0],"mappings":";AAWA,SAAwB,EAAwB,GAAa,GAAM;CACjE,IAAI,IAAiB,EAAK,gBACxB,IAAW,EAAK,UAOd,IAAoB,EAAS,8BAA8B,CAAW;CACrE,OAQL,OAHI,EAAkB,WAAW,IACxB,EAAkB,KAEpB,EAA2B,GAAgB,GAAmB,EAAS,QAAQ;AACxF"}
package/dist/index323.js CHANGED
@@ -1,23 +1,29 @@
1
- import e, { getCountryCallingCode as t } from "./index307.js";
2
- import n from "./index309.js";
3
- import r from "./index311.js";
4
- import i from "./index322.js";
5
- //#region ../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
6
- function a(a, o, s, c, l) {
7
- if (!(o || s || c)) return { number: a };
8
- var u = o || s ? t(o || s, l) : c;
9
- if (a.indexOf(u) === 0) {
10
- var d = new e(l);
11
- d.selectNumberingPlan(o || s || c);
12
- var f = a.slice(u.length), p = i(f, void 0, d).nationalNumber, m = i(a, void 0, d).nationalNumber;
13
- if (!r(m, d.nationalNumberPattern()) && r(p, d.nationalNumberPattern()) || n(m, void 0, d) === "TOO_LONG") return {
14
- countryCallingCode: u,
15
- number: f
16
- };
1
+ import e from "./index310.js";
2
+ import t from "./index312.js";
3
+ import n from "./index320.js";
4
+ import r from "./index322.js";
5
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js
6
+ function i(e, t, i) {
7
+ var s = n(e, i), c = s.carrierCode, l = s.nationalNumber;
8
+ return l !== e && (!a(e, l, i) || i.numberingPlan.possibleLengths() && (t ||= r(i.numberingPlan.callingCode(), {
9
+ nationalNumber: l,
10
+ metadata: i
11
+ }), !o(l, t, i))) ? { nationalNumber: e } : {
12
+ nationalNumber: l,
13
+ carrierCode: c
14
+ };
15
+ }
16
+ function a(e, n, r) {
17
+ return !(t(e, r.nationalNumberPattern()) && !t(n, r.nationalNumberPattern()));
18
+ }
19
+ function o(t, n, r) {
20
+ switch (e(t, n, r)) {
21
+ case "TOO_SHORT":
22
+ case "INVALID_LENGTH": return !1;
23
+ default: return !0;
17
24
  }
18
- return { number: a };
19
25
  }
20
26
  //#endregion
21
- export { a as default };
27
+ export { i as default };
22
28
 
23
29
  //# sourceMappingURL=index323.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index323.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits (only digits, no `+`).\r\n * @param {string} [country] — Exact country of the phone number.\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {object} metadataJson\r\n * @return {object} `{ countryCallingCode: string?, number: string }`, where `countryCallingCode` is the calling code that was extracted from the input `number` string, and `number` is the originally passed `number` without the extracted calling code.\r\n */\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson) {\n // Validate arguments.\n // The `number` is known to be in a non-international form\n // because there's no leading \"+\" character.\n // Therefore, there must be either `country` or `defaultCountry` or `defaultCallingCode`.\n // Otherwise, there'd be no source for the calling code to search for in the `number`.\n if (!(country || defaultCountry || defaultCallingCode)) {\n // There's no source for the calling code to search for in the `number`.\n return {\n number: number\n };\n }\n var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadataJson) : defaultCallingCode;\n if (number.indexOf(countryCallingCode) === 0) {\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || defaultCountry || defaultCallingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, undefined, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n var _extractNationalNumbe2 = extractNationalNumber(number, undefined, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber;\n\n // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, undefined, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAgBA,SAAwB,EAAgE,GAAQ,GAAS,GAAgB,GAAoB,GAAc;CAMzJ,IAAI,EAAE,KAAW,KAAkB,IAEjC,OAAO,EACG,UACV;CAEF,IAAI,IAAqB,KAAW,IAAiB,EAAsB,KAAW,GAAgB,CAAY,IAAI;CACtH,IAAI,EAAO,QAAQ,CAAkB,MAAM,GAAG;EAC5C,IAAI,IAAW,IAAI,EAAS,CAAY;EACxC,EAAS,oBAAoB,KAAW,KAAkB,CAAkB;EAC5E,IAAI,IAAwB,EAAO,MAAM,EAAmB,MAAM,GAEhE,IAD0B,EAAsB,GAAuB,KAAA,GAAW,CAC9B,CAAC,CAAC,gBAEtD,IAD2B,EAAsB,GAAQ,KAAA,GAAW,CAC9B,CAAC,CAAC;EAU1C,IAAI,CAAC,EAAgB,GAAgB,EAAS,sBAAsB,CAAC,KAAK,EAAgB,GAA+B,EAAS,sBAAsB,CAAC,KAAK,EAAkB,GAAgB,KAAA,GAAW,CAAQ,MAAM,YACvN,OAAO;GACe;GACpB,QAAQ;EACV;CAEJ;CACA,OAAO,EACG,UACV;AACF"}
1
+ {"version":3,"file":"index323.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js"],"sourcesContent":["import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryByCallingCode from './getCountryByCallingCode.js';\n\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {string?} country — Specific country to use instead of the one that is pre-selected in the metadata instance.\r\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\nexport default function extractNationalNumber(number, country, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n carrierCode = _extractNationalNumbe.carrierCode,\n nationalNumber = _extractNationalNumbe.nationalNumber;\n if (nationalNumber !== number) {\n if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n // Check the national (significant) number length after extracting national prefix and carrier code.\n // Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature,\n // so this `if` will only be executed with newer metadata.\n if (metadata.numberingPlan.possibleLengths()) {\n // If an exact `country` is not specified, attempt to detect it from the assumed national number.\n if (!country) {\n country = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {\n nationalNumber: nationalNumber,\n metadata: metadata\n });\n }\n\n // The number remaining after stripping the national prefix and carrier code\n // should be long enough to have a possible length for the country.\n // Otherwise, don't strip the national prefix and carrier code,\n // since the original number could be a valid number.\n // This check has been copy-pasted \"as is\" from Google's original library:\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n // It doesn't check for the \"possibility\" of the original `number`.\n // I guess it's fine not checking that one. It works as is anyway.\n if (!isPossibleIncompleteNationalNumber(nationalNumber, country, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n\n// In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\nfunction shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {\n return false;\n }\n // This \"is possible\" national number (length) check has been commented out\n // because it's superceded by the (effectively) same check done in the\n // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`.\n // In other words, why run the same check twice if it could only be run once.\n // // Check the national (significant) number length after extracting national prefix and carrier code.\n // // Fixes a minor \"weird behavior\" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57\n // // (Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature).\n // if (metadata.possibleLengths()) {\n // \tif (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) &&\n // \t\t!isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) {\n // \t\treturn false\n // \t}\n // }\n return true;\n}\n\n/**\r\n * Tells if a given incomplete national number is possible or not.\r\n * @param {string} nationalNumber\r\n * @param {string?} country — Specific country rather than the one that is pre-selected in the metadata instance.\r\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\r\n * @returns {boolean}\r\n */\nfunction isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {\n switch (checkNumberLength(nationalNumber, country, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n return false;\n default:\n return true;\n }\n}\n//# sourceMappingURL=extractNationalNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAeA,SAAwB,EAAsB,GAAQ,GAAS,GAAU;CAUvE,IAAI,IAAwB,EAAkD,GAAQ,CAAQ,GAC5F,IAAc,EAAsB,aACpC,IAAiB,EAAsB;CAoCzC,OAnCI,MAAmB,MACjB,CAAC,EAAkC,GAAQ,GAAgB,CAAQ,KASnE,EAAS,cAAc,gBAAgB,MAEzC,AACE,MAAU,EAAwB,EAAS,cAAc,YAAY,GAAG;EACtD;EACN;CACZ,CAAC,GAWC,CAAC,EAAmC,GAAgB,GAAS,CAAQ,MAEhE,EACL,gBAAgB,EAClB,IAIC;EACW;EACH;CACf;AACF;AAgBA,SAAS,EAAkC,GAAsB,GAAqB,GAAU;CAmB9F,OAhBA,EAAI,EAAgB,GAAsB,EAAS,sBAAsB,CAAC,KAAK,CAAC,EAAgB,GAAqB,EAAS,sBAAsB,CAAC;AAiBvJ;AASA,SAAS,EAAmC,GAAgB,GAAS,GAAU;CAC7E,QAAQ,EAAkB,GAAgB,GAAS,CAAQ,GAA3D;EACE,KAAK;EACL,KAAK,kBAIH,OAAO;EACT,SACE,OAAO;CACX;AACF"}
package/dist/index324.js CHANGED
@@ -1,38 +1,23 @@
1
- import e from "./index307.js";
2
- import t from "./index318.js";
3
- import n from "./index323.js";
4
- //#region ../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js
5
- function r(r, i, a, o, s) {
6
- if (!r) return {};
7
- var c;
8
- if (r[0] !== "+") {
9
- var l = t(r, i || a, o, s);
10
- if (l && l !== r) c = !0, r = "+" + l;
11
- else {
12
- if (i || a || o) {
13
- var u = n(r, i, a, o, s), d = u.countryCallingCode, f = u.number;
14
- if (d) return {
15
- countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
16
- countryCallingCode: d,
17
- number: f
18
- };
19
- }
20
- return { number: r };
21
- }
22
- }
23
- if (r[1] === "0") return {};
24
- for (var p = new e(s), m = 2; m - 1 <= 3 && m <= r.length;) {
25
- var h = r.slice(1, m);
26
- if (p.hasCallingCode(h)) return p.selectNumberingPlan(h), {
27
- countryCallingCodeSource: c ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
28
- countryCallingCode: h,
29
- number: r.slice(m)
1
+ import e, { getCountryCallingCode as t } from "./index308.js";
2
+ import n from "./index310.js";
3
+ import r from "./index312.js";
4
+ import i from "./index323.js";
5
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
6
+ function a(a, o, s, c, l) {
7
+ if (!(o || s || c)) return { number: a };
8
+ var u = o || s ? t(o || s, l) : c;
9
+ if (a.indexOf(u) === 0) {
10
+ var d = new e(l);
11
+ d.selectNumberingPlan(o || s || c);
12
+ var f = a.slice(u.length), p = i(f, void 0, d).nationalNumber, m = i(a, void 0, d).nationalNumber;
13
+ if (!r(m, d.nationalNumberPattern()) && r(p, d.nationalNumberPattern()) || n(m, void 0, d) === "TOO_LONG") return {
14
+ countryCallingCode: u,
15
+ number: f
30
16
  };
31
- m++;
32
17
  }
33
- return {};
18
+ return { number: a };
34
19
  }
35
20
  //#endregion
36
- export { r as default };
21
+ export { a as default };
37
22
 
38
23
  //# sourceMappingURL=index324.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index324.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js"],"sourcesContent":["import stripIddPrefix from './stripIddPrefix.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport Metadata from '../metadata.js';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';\n\n/**\r\n * Attempts to extract a calling code from a phone number.\r\n * * If the phone number is found to be \"international\":\r\n * * It will attempt to identify the calling code part of it and whether that part is complete and valid.\r\n * * If the calling code part is complete and valid, it will return two properties:\r\n * that calling code part (without `+`) and the rest of the digits.\r\n * * Otherwise, i.e. if the calling code part is incomplete or invalid,\r\n * it will return an empty object.\r\n * * Otherwise, i.e. if the phone number is national, there's no callind code to extract\r\n * so it will just return the originally-passed `number` string as the only property.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Country.\r\n * @param {string} [defaultCountry] — Default country.\r\n * @param {string} [defaultCallingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadataJson\r\n * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`, where `countryCallingCodeSource` tells how the returned calling code was extracted (if it was extracted), `countryCallingCode` is the calling code that was extracted from the input `number` string, and `number` is the originally passed `number` without the extracted calling code (and without a `+`). If the calling code is present but incomplete or invalid, it will return an empty object.\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', 'US', null, null, metadata)\r\n * extractCountryCallingCode('2133734253', null, 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', null, 'RU', null, metadata)\r\n */\nexport default function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadataJson) {\n if (!number) {\n return {};\n }\n var isNumberWithIddPrefix;\n\n // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadataJson);\n // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n isNumberWithIddPrefix = true;\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || defaultCountry || defaultCallingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n if (countryCallingCode) {\n return {\n countryCallingCodeSource: 'FROM_NUMBER_WITHOUT_PLUS_SIGN',\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n return {\n // No need to set it to `UNSPECIFIED`. It can be just `undefined`.\n // countryCallingCodeSource: 'UNSPECIFIED',\n number: number\n };\n }\n }\n\n // `number` can only be international at this point.\n\n // Fast abortion: country codes do not begin with a '0'\n if (number[1] === '0') {\n return {};\n }\n var metadata = new Metadata(metadataJson);\n\n // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n var i = 2;\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCodeSource: isNumberWithIddPrefix ? 'FROM_NUMBER_WITH_IDD' : 'FROM_NUMBER_WITH_PLUS_SIGN',\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n i++;\n }\n return {};\n}\n\n// The possible values for the returned `countryCallingCodeSource` are:\n//\n// Copy-pasted from:\n// https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto\n//\n// // The source from which the country_code is derived. This is not set in the\n// // general parsing method, but in the method that parses and keeps raw_input.\n// // New fields could be added upon request.\n// enum CountryCodeSource {\n// // Default value returned if this is not set, because the phone number was\n// // created using parse, not parseAndKeepRawInput. hasCountryCodeSource will\n// // return false if this is the case.\n// UNSPECIFIED = 0;\n//\n// // The country_code is derived based on a phone number with a leading \"+\",\n// // e.g. the French number \"+33 1 42 68 53 00\".\n// FROM_NUMBER_WITH_PLUS_SIGN = 1;\n//\n// // The country_code is derived based on a phone number with a leading IDD,\n// // e.g. the French number \"011 33 1 42 68 53 00\", as it is dialled from US.\n// FROM_NUMBER_WITH_IDD = 5;\n//\n// // The country_code is derived based on a phone number without a leading\n// // \"+\", e.g. the French number \"33 1 42 68 53 00\" when defaultCountry is\n// // supplied as France.\n// FROM_NUMBER_WITHOUT_PLUS_SIGN = 10;\n//\n// // The country_code is derived NOT based on the phone number itself, but\n// // from the defaultCountry parameter provided in the parsing function by the\n// // clients. This happens mostly for numbers written in the national format\n// // (without country code). For example, this would be set when parsing the\n// // French number \"01 42 68 53 00\", when defaultCountry is supplied as\n// // France.\n// FROM_DEFAULT_COUNTRY = 20;\n// }\n//# sourceMappingURL=extractCountryCallingCode.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AA6BA,SAAwB,EAA0B,GAAQ,GAAS,GAAgB,GAAoB,GAAc;CACnH,IAAI,CAAC,GACH,OAAO,CAAC;CAEV,IAAI;CASJ,IAAI,EAAO,OAAO,KAAK;EAGrB,IAAI,IAAmB,EAAe,GAAQ,KAAW,GAAgB,GAAoB,CAAY;EAIzG,IAAI,KAAoB,MAAqB,GAE3C,AADA,IAAwB,IACxB,IAAS,MAAM;OACV;GAKL,IAAI,KAAW,KAAkB,GAAoB;IACnD,IAAI,IAAwB,EAAgE,GAAQ,GAAS,GAAgB,GAAoB,CAAY,GAC3J,IAAqB,EAAsB,oBAC3C,IAAgB,EAAsB;IACxC,IAAI,GACF,OAAO;KACL,0BAA0B;KACN;KACpB,QAAQ;IACV;GAEJ;GACA,OAAO,EAGG,UACV;EACF;CACF;CAKA,IAAI,EAAO,OAAO,KAChB,OAAO,CAAC;CAcV,KAZA,IAAI,IAAW,IAAI,EAAS,CAAY,GAWpC,IAAI,GACD,IAAI,KAAA,KAAgC,KAAK,EAAO,SAAQ;EAC7D,IAAI,IAAsB,EAAO,MAAM,GAAG,CAAC;EAC3C,IAAI,EAAS,eAAe,CAAmB,GAE7C,OADA,EAAS,oBAAoB,CAAmB,GACzC;GACL,0BAA0B,IAAwB,yBAAyB;GAC3E,oBAAoB;GACpB,QAAQ,EAAO,MAAM,CAAC;EACxB;EAEF;CACF;CACA,OAAO,CAAC;AACV"}
1
+ {"version":3,"file":"index324.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits (only digits, no `+`).\r\n * @param {string} [country] — Exact country of the phone number.\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {object} metadataJson\r\n * @return {object} `{ countryCallingCode: string?, number: string }`, where `countryCallingCode` is the calling code that was extracted from the input `number` string, and `number` is the originally passed `number` without the extracted calling code.\r\n */\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson) {\n // Validate arguments.\n // The `number` is known to be in a non-international form\n // because there's no leading \"+\" character.\n // Therefore, there must be either `country` or `defaultCountry` or `defaultCallingCode`.\n // Otherwise, there'd be no source for the calling code to search for in the `number`.\n if (!(country || defaultCountry || defaultCallingCode)) {\n // There's no source for the calling code to search for in the `number`.\n return {\n number: number\n };\n }\n var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadataJson) : defaultCallingCode;\n if (number.indexOf(countryCallingCode) === 0) {\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || defaultCountry || defaultCallingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, undefined, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n var _extractNationalNumbe2 = extractNationalNumber(number, undefined, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber;\n\n // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, undefined, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AAgBA,SAAwB,EAAgE,GAAQ,GAAS,GAAgB,GAAoB,GAAc;CAMzJ,IAAI,EAAE,KAAW,KAAkB,IAEjC,OAAO,EACG,UACV;CAEF,IAAI,IAAqB,KAAW,IAAiB,EAAsB,KAAW,GAAgB,CAAY,IAAI;CACtH,IAAI,EAAO,QAAQ,CAAkB,MAAM,GAAG;EAC5C,IAAI,IAAW,IAAI,EAAS,CAAY;EACxC,EAAS,oBAAoB,KAAW,KAAkB,CAAkB;EAC5E,IAAI,IAAwB,EAAO,MAAM,EAAmB,MAAM,GAEhE,IAD0B,EAAsB,GAAuB,KAAA,GAAW,CAC9B,CAAC,CAAC,gBAEtD,IAD2B,EAAsB,GAAQ,KAAA,GAAW,CAC9B,CAAC,CAAC;EAU1C,IAAI,CAAC,EAAgB,GAAgB,EAAS,sBAAsB,CAAC,KAAK,EAAgB,GAA+B,EAAS,sBAAsB,CAAC,KAAK,EAAkB,GAAgB,KAAA,GAAW,CAAQ,MAAM,YACvN,OAAO;GACe;GACpB,QAAQ;EACV;CAEJ;CACA,OAAO,EACG,UACV;AACF"}