@rpcbase/ui 0.261.0 → 0.263.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
package/dist/index325.js CHANGED
@@ -1,9 +1,38 @@
1
- import { VALID_PUNCTUATION as e } from "./index317.js";
2
- //#region ../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
3
- function t(t) {
4
- return t.replace(RegExp(`[${e}]+`, "g"), " ").trim();
1
+ import e from "./index308.js";
2
+ import t from "./index319.js";
3
+ import n from "./index324.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)
30
+ };
31
+ m++;
32
+ }
33
+ return {};
5
34
  }
6
35
  //#endregion
7
- export { t as default };
36
+ export { r as default };
8
37
 
9
38
  //# sourceMappingURL=index325.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index325.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js"],"sourcesContent":["import { VALID_PUNCTUATION } from '../constants.js';\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains `<intlFormat/>`s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `<intlFormat/>` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map"],"x_google_ignoreList":[0],"mappings":";;AAgCA,SAAwB,EAAiC,GAAiB;CACxE,OAAO,EAAgB,QAAY,OAAO,IAAW,OAA0B,GAAG,GAAG,GAAG,CAAC,CAAC,KAAK;AACjG"}
1
+ {"version":3,"file":"index325.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"}
package/dist/index326.js CHANGED
@@ -1,13 +1,9 @@
1
- import e from "./index325.js";
2
- //#region ../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
3
- var t = /(\$\d)/;
4
- function n(n, r, i) {
5
- var a = i.useInternationalFormat, o = i.withNationalPrefix;
6
- i.carrierCode, i.metadata;
7
- var s = n.replace(new RegExp(r.pattern()), a ? r.internationalFormat() : o && r.nationalPrefixFormattingRule() ? r.format().replace(t, r.nationalPrefixFormattingRule()) : r.format());
8
- return a ? e(s) : s;
1
+ import { VALID_PUNCTUATION as e } from "./index318.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
3
+ function t(t) {
4
+ return t.replace(RegExp(`[${e}]+`, "g"), " ").trim();
9
5
  }
10
6
  //#endregion
11
- export { t as FIRST_GROUP_PATTERN, n as default };
7
+ export { t as default };
12
8
 
13
9
  //# sourceMappingURL=index326.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index326.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js"],"sourcesContent":["import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle.js';\n\n// This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() :\n // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map"],"x_google_ignoreList":[0],"mappings":";;AAMA,IAAW,IAAsB;AACjC,SAAwB,EAAgC,GAAQ,GAAQ,GAAM;CAC5E,IAAI,IAAyB,EAAK,wBAChC,IAAqB,EAAK;CAEf,AADG,EAAK,aACR,EAAK;CAClB,IAAI,IAAkB,EAAO,QAAQ,IAAI,OAAO,EAAO,QAAQ,CAAC,GAAG,IAAyB,EAAO,oBAAoB,IAcvH,KAAsB,EAAO,6BAA6B,IAAI,EAAO,OAAO,CAAC,CAAC,QAAQ,GAAqB,EAAO,6BAA6B,CAAC,IAAI,EAAO,OAAO,CAAC;CAInK,OAHI,IACK,EAAiC,CAAe,IAElD;AACT"}
1
+ {"version":3,"file":"index326.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js"],"sourcesContent":["import { VALID_PUNCTUATION } from '../constants.js';\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains `<intlFormat/>`s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `<intlFormat/>` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map"],"x_google_ignoreList":[0],"mappings":";;AAgCA,SAAwB,EAAiC,GAAiB;CACxE,OAAO,EAAgB,QAAY,OAAO,IAAW,OAA0B,GAAG,GAAG,GAAG,CAAC,CAAC,KAAK;AACjG"}
package/dist/index327.js CHANGED
@@ -1,12 +1,13 @@
1
- import e from "./index307.js";
2
- //#region ../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
3
- var t = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
1
+ import e from "./index326.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
3
+ var t = /(\$\d)/;
4
4
  function n(n, r, i) {
5
- var a = new e(i);
6
- if (a.selectNumberingPlan(n || r), a.defaultIDDPrefix()) return a.defaultIDDPrefix();
7
- if (t.test(a.IDDPrefix())) return a.IDDPrefix();
5
+ var a = i.useInternationalFormat, o = i.withNationalPrefix;
6
+ i.carrierCode, i.metadata;
7
+ var s = n.replace(new RegExp(r.pattern()), a ? r.internationalFormat() : o && r.nationalPrefixFormattingRule() ? r.format().replace(t, r.nationalPrefixFormattingRule()) : r.format());
8
+ return a ? e(s) : s;
8
9
  }
9
10
  //#endregion
10
- export { n as default };
11
+ export { t as FIRST_GROUP_PATTERN, n as default };
11
12
 
12
13
  //# sourceMappingURL=index327.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index327.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// If the `country` supports IDD calling, it returns a preferred IDD prefix.\n// If the `country` doesn't support IDD calling, it returns `undefined`.\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country || callingCode);\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map"],"x_google_ignoreList":[0],"mappings":";;AAWA,IAAI,IAA4B;AAIhC,SAAwB,EAAa,GAAS,GAAa,GAAU;CACnE,IAAI,IAAkB,IAAI,EAAS,CAAQ;CAE3C,IADA,EAAgB,oBAAoB,KAAW,CAAW,GACtD,EAAgB,iBAAiB,GACnC,OAAO,EAAgB,iBAAiB;CAE1C,IAAI,EAA0B,KAAK,EAAgB,UAAU,CAAC,GAC5D,OAAO,EAAgB,UAAU;AAErC"}
1
+ {"version":3,"file":"index327.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js"],"sourcesContent":["import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle.js';\n\n// This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() :\n // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map"],"x_google_ignoreList":[0],"mappings":";;AAMA,IAAW,IAAsB;AACjC,SAAwB,EAAgC,GAAQ,GAAQ,GAAM;CAC5E,IAAI,IAAyB,EAAK,wBAChC,IAAqB,EAAK;CAEf,AADG,EAAK,aACR,EAAK;CAClB,IAAI,IAAkB,EAAO,QAAQ,IAAI,OAAO,EAAO,QAAQ,CAAC,GAAG,IAAyB,EAAO,oBAAoB,IAcvH,KAAsB,EAAO,6BAA6B,IAAI,EAAO,OAAO,CAAC,CAAC,QAAQ,GAAqB,EAAO,6BAA6B,CAAC,IAAI,EAAO,OAAO,CAAC;CAInK,OAHI,IACK,EAAiC,CAAe,IAElD;AACT"}
package/dist/index328.js CHANGED
@@ -1,13 +1,12 @@
1
- import { VALID_DIGITS as e } from "./index317.js";
2
- //#region ../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
3
- var t = ";ext=", n = function(t) {
4
- return `([${e}]{1,${t}})`;
5
- };
6
- function r(e) {
7
- var r = "20", i = "15", a = "9", o = "6", s = "[ \xA0\\t,]*", c = "[:\\..]?[ \xA0\\t,-]*", l = "#?", u = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", f = "[- ]+", p = "[ \xA0\\t]*", m = "(?:,{2}|;)", h = t + n(r), g = s + u + c + n(r) + l, _ = s + d + c + n(a) + l, v = f + n(o) + "#", y = p + m + c + n(i) + l, b = p + "(?:,)+" + c + n(a) + l;
8
- return h + "|" + g + "|" + _ + "|" + v + "|" + y + "|" + b;
1
+ import e from "./index308.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
3
+ var t = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
4
+ function n(n, r, i) {
5
+ var a = new e(i);
6
+ if (a.selectNumberingPlan(n || r), a.defaultIDDPrefix()) return a.defaultIDDPrefix();
7
+ if (t.test(a.IDDPrefix())) return a.IDDPrefix();
9
8
  }
10
9
  //#endregion
11
- export { r as default };
10
+ export { n as default };
12
11
 
13
12
  //# sourceMappingURL=index328.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index328.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"],"sourcesContent":["import { VALID_DIGITS } from '../../constants.js';\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n var extLimitWhenNotSure = '6';\n\n /** @type {string} */\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\";\n // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n /** @type {string} */\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n var optionalExtnSuffix = \"#?\";\n\n // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n /** @type {string} */\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\";\n // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n /** @type {string} */\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\";\n // When extension is not separated clearly.\n /** @type {string} */\n var ambiguousSeparator = \"[- ]+\";\n // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n /** @type {string} */\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\";\n // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n /** @type {string} */\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n\n /** @type {string} */\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n\n /** @type {string} */\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n\n // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map"],"x_google_ignoreList":[0],"mappings":";;AAGA,IAAI,IAAsB,SAOtB,IAA4B,SAAmC,GAAW;CAC5E,OAAO,KAAY,QAA6B;AAClD;AASA,SAAwB,EAAuB,GAAS;CAOtD,IAAI,IAA6B,MAE7B,IAA2B,MAE3B,IAA6B,KAE7B,IAAsB,KAGtB,IAA6C,gBAG7C,IAA6B,yBAE7B,IAAqB,MAKrB,IAAoB,iDAIpB,IAAqB,wBAGrB,IAAqB,SAIrB,IAA0C,eAM1C,IAAgC,cAGhC,IAAU,IAAsB,EAA0B,CAA0B,GAEpF,IAAe,IAA6C,IAAoB,IAA6B,EAA0B,CAA0B,IAAI,GAErK,IAAgB,IAA6C,IAAqB,IAA6B,EAA0B,CAA0B,IAAI,GAEvK,IAA8B,IAAqB,EAA0B,CAAmB,IAAI,KAGpG,IAAmB,IAA0C,IAAgC,IAA6B,EAA0B,CAAwB,IAAI,GAEhL,IAAiB,IAA0C,WAAW,IAA6B,EAA0B,CAA0B,IAAI;CAc/J,OAAO,IAAU,MAAM,IAAe,MAAM,IAAgB,MAAM,IAA8B,MAAM,IAAmB,MAAM;AACjI"}
1
+ {"version":3,"file":"index328.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"],"sourcesContent":["import Metadata from '../metadata.js';\n\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// If the `country` supports IDD calling, it returns a preferred IDD prefix.\n// If the `country` doesn't support IDD calling, it returns `undefined`.\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country || callingCode);\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map"],"x_google_ignoreList":[0],"mappings":";;AAWA,IAAI,IAA4B;AAIhC,SAAwB,EAAa,GAAS,GAAa,GAAU;CACnE,IAAI,IAAkB,IAAI,EAAS,CAAQ;CAE3C,IADA,EAAgB,oBAAoB,KAAW,CAAW,GACtD,EAAgB,iBAAiB,GACnC,OAAO,EAAgB,iBAAiB;CAE1C,IAAI,EAA0B,KAAK,EAAgB,UAAU,CAAC,GAC5D,OAAO,EAAgB,UAAU;AAErC"}
package/dist/index329.js CHANGED
@@ -1,14 +1,13 @@
1
- import { PLUS_CHARS as e, VALID_DIGITS as t, VALID_PUNCTUATION as n } from "./index317.js";
2
- import r from "./index328.js";
3
- //#region ../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
4
- var i = "[" + t + "]{2}", a = "[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){3,}[" + n + t + "]*", o = RegExp("^[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){1,2}$", "i"), s = a + "(?:" + r() + ")?", c = RegExp("^" + i + "$|^" + s + "$", "i");
5
- function l(e) {
6
- return e.length >= 2 && c.test(e);
7
- }
8
- function u(e) {
9
- return o.test(e);
1
+ import { VALID_DIGITS as e } from "./index318.js";
2
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
3
+ var t = ";ext=", n = function(t) {
4
+ return `([${e}]{1,${t}})`;
5
+ };
6
+ function r(e) {
7
+ var r = "20", i = "15", a = "9", o = "6", s = "[ \xA0\\t,]*", c = "[:\\..]?[ \xA0\\t,-]*", l = "#?", u = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", f = "[- ]+", p = "[ \xA0\\t]*", m = "(?:,{2}|;)", h = t + n(r), g = s + u + c + n(r) + l, _ = s + d + c + n(a) + l, v = f + n(o) + "#", y = p + m + c + n(i) + l, b = p + "(?:,)+" + c + n(a) + l;
8
+ return h + "|" + g + "|" + _ + "|" + v + "|" + y + "|" + b;
10
9
  }
11
10
  //#endregion
12
- export { a as VALID_PHONE_NUMBER, s as VALID_PHONE_NUMBER_WITH_EXTENSION, l as default, u as isViablePhoneNumberStart };
11
+ export { r as default };
13
12
 
14
13
  //# sourceMappingURL=index329.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index329.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"],"sourcesContent":["import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js';\n\n// Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';\n//\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\n// This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +\n// Phone number extensions\n'(?:' + createExtensionPattern() + ')?';\n\n// The combined regular expression for valid phone numbers:\n//\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp(\n// Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +\n// Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');\n\n// Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;AA2BA,IAAI,IAAkC,MAAM,IAAe,QAKhD,IAAqB,MAAM,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,IAAoB,IAAe,MAWjL,IAAuC,OAAO,OAAY,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,GAAG,GAClK,IAAoC,IAE/C,QAAQ,EAAuB,IAAI,MAI/B,IAAiC,OAErC,MAAM,IAAkC,QAElC,IAAoC,KAAK,GAAG;AASlD,SAAwB,EAAoB,GAAQ;CAClD,OAAO,EAAO,UAAA,KAAgC,EAA2B,KAAK,CAAM;AACtF;AAQA,SAAgB,EAAyB,GAAQ;CAC/C,OAAO,EAAiC,KAAK,CAAM;AACrD"}
1
+ {"version":3,"file":"index329.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"],"sourcesContent":["import { VALID_DIGITS } from '../../constants.js';\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n var extLimitWhenNotSure = '6';\n\n /** @type {string} */\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\";\n // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n /** @type {string} */\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n var optionalExtnSuffix = \"#?\";\n\n // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n /** @type {string} */\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\";\n // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n /** @type {string} */\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\";\n // When extension is not separated clearly.\n /** @type {string} */\n var ambiguousSeparator = \"[- ]+\";\n // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n /** @type {string} */\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\";\n // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n /** @type {string} */\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n\n /** @type {string} */\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n\n /** @type {string} */\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n\n // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map"],"x_google_ignoreList":[0],"mappings":";;AAGA,IAAI,IAAsB,SAOtB,IAA4B,SAAmC,GAAW;CAC5E,OAAO,KAAY,QAA6B;AAClD;AASA,SAAwB,EAAuB,GAAS;CAOtD,IAAI,IAA6B,MAE7B,IAA2B,MAE3B,IAA6B,KAE7B,IAAsB,KAGtB,IAA6C,gBAG7C,IAA6B,yBAE7B,IAAqB,MAKrB,IAAoB,iDAIpB,IAAqB,wBAGrB,IAAqB,SAIrB,IAA0C,eAM1C,IAAgC,cAGhC,IAAU,IAAsB,EAA0B,CAA0B,GAEpF,IAAe,IAA6C,IAAoB,IAA6B,EAA0B,CAA0B,IAAI,GAErK,IAAgB,IAA6C,IAAqB,IAA6B,EAA0B,CAA0B,IAAI,GAEvK,IAA8B,IAAqB,EAA0B,CAAmB,IAAI,KAGpG,IAAmB,IAA0C,IAAgC,IAA6B,EAA0B,CAAwB,IAAI,GAEhL,IAAiB,IAA0C,WAAW,IAA6B,EAA0B,CAA0B,IAAI;CAc/J,OAAO,IAAU,MAAM,IAAe,MAAM,IAAgB,MAAM,IAA8B,MAAM,IAAmB,MAAM;AACjI"}
package/dist/index330.js CHANGED
@@ -1,11 +1,14 @@
1
- //#region ../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js
2
- function e(e) {
3
- var t = e.number, n = e.ext;
4
- if (!t) return "";
5
- if (t[0] !== "+") throw Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format.");
6
- return `tel:${t}${n ? ";ext=" + n : ""}`;
1
+ import { PLUS_CHARS as e, VALID_DIGITS as t, VALID_PUNCTUATION as n } from "./index318.js";
2
+ import r from "./index329.js";
3
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
4
+ var i = "[" + t + "]{2}", a = "[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){3,}[" + n + t + "]*", o = RegExp("^[" + e + "]{0,1}(?:[" + n + "]*[" + t + "]){1,2}$", "i"), s = a + "(?:" + r() + ")?", c = RegExp("^" + i + "$|^" + s + "$", "i");
5
+ function l(e) {
6
+ return e.length >= 2 && c.test(e);
7
+ }
8
+ function u(e) {
9
+ return o.test(e);
7
10
  }
8
11
  //#endregion
9
- export { e as formatRFC3966 };
12
+ export { a as VALID_PHONE_NUMBER, s as VALID_PHONE_NUMBER_WITH_EXTENSION, l as default, u as isViablePhoneNumberStart };
10
13
 
11
14
  //# sourceMappingURL=index330.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index330.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js"],"sourcesContent":["function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _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 isViablePhoneNumber from './isViablePhoneNumber.js';\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nexport function parseRFC3966(text) {\n var number;\n var ext;\n\n // Replace \"tel:\" with \"tel=\" for parsing convenience.\n text = text.replace(/^tel:/, 'tel=');\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n switch (name) {\n case 'tel':\n number = value;\n break;\n case 'ext':\n ext = value;\n break;\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n break;\n }\n }\n\n // If the phone number is not viable, then abort.\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n var result = {\n number: number\n };\n if (ext) {\n result.ext = ext;\n }\n return result;\n}\n\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n if (!number) {\n return '';\n }\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map"],"x_google_ignoreList":[0],"mappings":";AA6DA,SAAgB,EAAc,GAAM;CAClC,IAAI,IAAS,EAAK,QAChB,IAAM,EAAK;CACb,IAAI,CAAC,GACH,OAAO;CAET,IAAI,EAAO,OAAO,KAChB,MAAU,MAAM,+DAA+D;CAEjF,OAAO,OAAc,IAAe,IAAM,UAAU,IAAM;AAC5D"}
1
+ {"version":3,"file":"index330.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"],"sourcesContent":["import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js';\n\n// Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';\n//\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\n// This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +\n// Phone number extensions\n'(?:' + createExtensionPattern() + ')?';\n\n// The combined regular expression for valid phone numbers:\n//\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp(\n// Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +\n// Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');\n\n// Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map"],"x_google_ignoreList":[0],"mappings":";;;AA2BA,IAAI,IAAkC,MAAM,IAAe,QAKhD,IAAqB,MAAM,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,IAAoB,IAAe,MAWjL,IAAuC,OAAO,OAAY,IAAa,eAAyB,IAAoB,QAAa,IAAe,YAAsB,GAAG,GAClK,IAAoC,IAE/C,QAAQ,EAAuB,IAAI,MAI/B,IAAiC,OAErC,MAAM,IAAkC,QAElC,IAAoC,KAAK,GAAG;AASlD,SAAwB,EAAoB,GAAQ;CAClD,OAAO,EAAO,UAAA,KAAgC,EAA2B,KAAK,CAAM;AACtF;AAQA,SAAgB,EAAyB,GAAQ;CAC/C,OAAO,EAAiC,KAAK,CAAM;AACrD"}
package/dist/index331.js CHANGED
@@ -1,79 +1,11 @@
1
- import e, { getCountryCallingCode as t } from "./index307.js";
2
- import n from "./index311.js";
3
- import r from "./index326.js";
4
- import i from "./index327.js";
5
- import { formatRFC3966 as a } from "./index330.js";
6
- //#region ../../node_modules/libphonenumber-js/es6/format.js
7
- var o = { formatExtension: function(e, t, n) {
8
- return `${e}${n.ext()}${t}`;
9
- } };
10
- function s(t, n, r, i) {
11
- r = r ? f({}, o, r) : o;
12
- var s = new e(i);
13
- if (t.country && t.country !== "001") {
14
- if (!s.hasCountry(t.country)) throw Error(`Unknown country: ${t.country}`);
15
- s.selectNumberingPlan(t.country);
16
- } else if (t.countryCallingCode) s.selectNumberingPlan(t.countryCallingCode);
17
- else return t.phone || "";
18
- var l = s.countryCallingCode(), p = r.v2 ? t.nationalNumber : t.phone, m;
19
- switch (n) {
20
- case "NATIONAL": return p ? (m = c(p, t.carrierCode, "NATIONAL", s, r), u(m, t.ext, s, r.formatExtension)) : "";
21
- case "INTERNATIONAL": return p ? (m = c(p, null, "INTERNATIONAL", s, r), m = `+${l} ${m}`, u(m, t.ext, s, r.formatExtension)) : `+${l}`;
22
- case "E.164": return `+${l}${p}`;
23
- case "RFC3966": return a({
24
- number: `+${l}${p}`,
25
- ext: t.ext
26
- });
27
- case "IDD":
28
- if (!r.fromCountry) return;
29
- var h = d(p, t.carrierCode, l, r.fromCountry, s);
30
- return h ? u(h, t.ext, s, r.formatExtension) : void 0;
31
- default: throw Error(`Unknown "format" argument passed to "formatNumber()": "${n}"`);
32
- }
33
- }
34
- function c(e, t, n, i, a) {
35
- var o = l(i.formats(), e);
36
- return o ? r(e, o, {
37
- useInternationalFormat: n === "INTERNATIONAL",
38
- withNationalPrefix: !(o.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && a && a.nationalPrefix === !1),
39
- carrierCode: t,
40
- metadata: i
41
- }) : e;
42
- }
43
- function l(e, t) {
44
- return p(e, function(e) {
45
- if (e.leadingDigitsPatterns().length > 0) {
46
- var r = e.leadingDigitsPatterns()[e.leadingDigitsPatterns().length - 1];
47
- if (t.search(r) !== 0) return !1;
48
- }
49
- return n(t, e.pattern());
50
- });
51
- }
52
- function u(e, t, n, r) {
53
- return t ? r(e, t, n) : e;
54
- }
55
- function d(e, n, r, a, o) {
56
- if (t(a, o.metadata) === r) {
57
- var s = c(e, n, "NATIONAL", o);
58
- return r === "1" ? r + " " + s : s;
59
- }
60
- var l = i(a, void 0, o.metadata);
61
- if (l) return `${l} ${r} ${c(e, null, "INTERNATIONAL", o)}`;
62
- }
63
- function f() {
64
- for (var e = 1, t = [...arguments]; e < t.length;) {
65
- if (t[e]) for (var n in t[e]) t[0][n] = t[e][n];
66
- e++;
67
- }
68
- return t[0];
69
- }
70
- function p(e, t) {
71
- for (var n = 0; n < e.length;) {
72
- if (t(e[n])) return e[n];
73
- n++;
74
- }
1
+ //#region ../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js
2
+ function e(e) {
3
+ var t = e.number, n = e.ext;
4
+ if (!t) return "";
5
+ if (t[0] !== "+") throw Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format.");
6
+ return `tel:${t}${n ? ";ext=" + n : ""}`;
75
7
  }
76
8
  //#endregion
77
- export { l as chooseFormatForNumber, s as default };
9
+ export { e as formatRFC3966 };
78
10
 
79
11
  //# sourceMappingURL=index331.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index331.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/format.js"],"sourcesContent":["// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nimport Metadata, { getCountryCallingCode } from './metadata.js';\nimport getIddPrefix from './helpers/getIddPrefix.js';\nimport { formatRFC3966 } from './helpers/RFC3966.js';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n }\n};\n\n/**\r\n * Formats a phone number.\r\n *\r\n * format(phoneNumberInstance, 'INTERNATIONAL', { ..., v2: true }, metadata)\r\n * format(phoneNumberInstance, 'NATIONAL', { ..., v2: true }, metadata)\r\n *\r\n * format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', { ... }, metadata)\r\n * format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {string} format\r\n * @param {object} [options]\r\n * @param {object} metadataJson\r\n * @return {string}\r\n */\nexport default function formatNumber(input, format, options, metadataJson) {\n // Apply default options.\n if (options) {\n // Using ES6 \"rest spread\" syntax here didn't work with `babel`/`istanbul`\n // for some weird reason: this line of code would cause the code coverage\n // to show as not 100%. That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // options = { ...DEFAULT_OPTIONS, ...options }\n //\n options = merge({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n var metadata = new Metadata(metadataJson);\n\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance.\n // Also, according to the `PhoneNumber` class source code, `country` can't be \"001\".\n // It means that normally `input.country` or `input.countryCallingCode` is supposed\n // to be present because either of the two is always required to exist in a `PhoneNumber` instance.\n // This means that realistically, it's gonna step into either the first `if`\n // or the following `else if`, and normally it won't even reach the legacy-compatibility\n // `else return input.phone || ''` part.\n // So normally, it won't ever return an empty string here.\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n var number;\n switch (format) {\n case 'NATIONAL':\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance,\n // and a `PhoneNumber` class instance is always required to have a `nationalNumber`.\n // This means that the `if (!nationalNumber)` below is just for legacy-compatibility\n // and it normally can't really happen, so normally it won't ever return an empty string here.\n if (!nationalNumber) {\n return '';\n }\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n case 'IDD':\n // If the required `fromCountry` parameter is not passed, it will return `undefined`.\n if (!options.fromCountry) {\n return;\n // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n // If the country of the phone number doesn't support IDD calling, it will return `undefined`.\n if (!formattedNumber) {\n return;\n }\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n if (!format) {\n return number;\n }\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\nexport function chooseFormatForNumber(availableFormats, nationalNumber) {\n // Using a `for ... of` loop here didn't work with `babel`/`istanbul`:\n // for some weird reason, it showed code coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // for (const format of availableFormats) { ... }\n //\n return pickFirstMatchingElement(availableFormats, function (format) {\n // Validate leading digits.\n // The test case for \"else path\" could be found by searching for\n // \"format.leadingDigitsPatterns().length === 0\".\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];\n // If leading digits don't match then move on to the next phone number format\n if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {\n return false;\n }\n }\n // Check that the national number matches the phone number format regular expression\n return matchesEntirely(nationalNumber, format.pattern());\n });\n}\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);\n // When calling within the same country calling code.\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata);\n // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n }\n // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n return formattedNumber;\n }\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\nfunction merge() {\n var i = 1;\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n while (i < objects.length) {\n if (objects[i]) {\n for (var key in objects[i]) {\n objects[0][key] = objects[i][key];\n }\n }\n i++;\n }\n return objects[0];\n}\nfunction pickFirstMatchingElement(elements, testFunction) {\n var i = 0;\n while (i < elements.length) {\n if (testFunction(elements[i])) {\n return elements[i];\n }\n i++;\n }\n}\n//# sourceMappingURL=format.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AAUA,IAAI,IAAkB,EACpB,iBAAiB,SAAyB,GAAiB,GAAW,GAAU;CAC9E,OAAO,GAAU,IAAwB,EAAS,IAAI,IAAU;AAClE,EACF;AAiBA,SAAwB,EAAa,GAAO,GAAQ,GAAS,GAAc;CAEzE,AAUE,IAVE,IAQQ,EAAM,CAAC,GAAG,GAAiB,CAAO,IAElC;CAEZ,IAAI,IAAW,IAAI,EAAS,CAAY;CAUxC,IAAI,EAAM,WAAW,EAAM,YAAY,OAAO;EAE5C,IAAI,CAAC,EAAS,WAAW,EAAM,OAAO,GACpC,MAAU,MAAM,oBAA2B,EAAM,SAAQ;EAE3D,EAAS,oBAAoB,EAAM,OAAO;CAC5C,OAAO,IAAI,EAAM,oBACf,EAAS,oBAAoB,EAAM,kBAAkB;MAChD,OAAO,EAAM,SAAS;CAC7B,IAAI,IAAqB,EAAS,mBAAmB,GACjD,IAAiB,EAAQ,KAAK,EAAM,iBAAiB,EAAM,OAI3D;CACJ,QAAQ,GAAR;EACE,KAAK,YASH,OAJK,KAGL,IAAS,EAAqB,GAAgB,EAAM,aAAa,YAAY,GAAU,CAAO,GACvF,EAAa,GAAQ,EAAM,KAAK,GAAU,EAAQ,eAAe,KAH/D;EAIX,KAAK,iBAQH,OALK,KAGL,IAAS,EAAqB,GAAgB,MAAM,iBAAiB,GAAU,CAAO,GACtF,IAAS,IAAW,KAAgC,KAC7C,EAAa,GAAQ,EAAM,KAAK,GAAU,EAAQ,eAAe,KAJ/D,IAAW;EAKtB,KAAK,SAEH,OAAO,IAAW,IAA2B;EAC/C,KAAK,WACH,OAAO,EAAc;GACnB,QAAQ,IAAW,IAA2B;GAC9C,KAAK,EAAM;EACb,CAAC;EAMH,KAAK;GAEH,IAAI,CAAC,EAAQ,aACX;GAGF,IAAI,IAAkB,EAAU,GAAgB,EAAM,aAAa,GAAoB,EAAQ,aAAa,CAAQ;GAKpH,OAHK,IAGE,EAAa,GAAiB,EAAM,KAAK,GAAU,EAAQ,eAAe,IAF/E;EAGJ,SACE,MAAU,MAAM,0DAAsE,IAAa;CACvG;AACF;AACA,SAAS,EAAqB,GAAQ,GAAa,GAAU,GAAU,GAAS;CAC9E,IAAI,IAAS,EAAsB,EAAS,QAAQ,GAAG,CAAM;CAI7D,OAHK,IAGE,EAAgC,GAAQ,GAAQ;EACrD,wBAAwB,MAAa;EACrC,oBAAoB,IAAO,uDAAuD,KAAK,KAAW,EAAQ,mBAAmB;EAChH;EACH;CACZ,CAAC,IAPQ;AAQX;AACA,SAAgB,EAAsB,GAAkB,GAAgB;CAQtE,OAAO,EAAyB,GAAkB,SAAU,GAAQ;EAIlE,IAAI,EAAO,sBAAsB,CAAC,CAAC,SAAS,GAAG;GAE7C,IAAI,IAA2B,EAAO,sBAAsB,CAAC,CAAC,EAAO,sBAAsB,CAAC,CAAC,SAAS;GAEtG,IAAI,EAAe,OAAO,CAAwB,MAAM,GACtD,OAAO;EAEX;EAEA,OAAO,EAAgB,GAAgB,EAAO,QAAQ,CAAC;CACzD,CAAC;AACH;AACA,SAAS,EAAa,GAAiB,GAAK,GAAU,GAAiB;CACrE,OAAO,IAAM,EAAgB,GAAiB,GAAK,CAAQ,IAAI;AACjE;AACA,SAAS,EAAU,GAAgB,GAAa,GAAoB,GAAa,GAAU;CAGzF,IAF6B,EAAsB,GAAa,EAAS,QAEhD,MAAM,GAAoB;EACjD,IAAI,IAAkB,EAAqB,GAAgB,GAAa,YAAY,CAAQ;EAe5F,OAZI,MAAuB,MAClB,IAAqB,MAAM,IAW7B;CACT;CACA,IAAI,IAAY,EAAa,GAAa,KAAA,GAAW,EAAS,QAAQ;CACtE,IAAI,GACF,OAAO,GAAU,KAAuB,KAAgC,EAAqB,GAAgB,MAAM,iBAAiB,CAAQ;AAEhJ;AACA,SAAS,IAAQ;CAKf,KAJA,IAAI,IAAI,GAC0B,QAChB,YAEX,IAAI,EAAQ,SAAQ;EACzB,IAAI,EAAQ,IACV,KAAK,IAAI,KAAO,EAAQ,IACtB,EAAQ,EAAE,CAAC,KAAO,EAAQ,EAAE,CAAC;EAGjC;CACF;CACA,OAAO,EAAQ;AACjB;AACA,SAAS,EAAyB,GAAU,GAAc;CAExD,KADA,IAAI,IAAI,GACD,IAAI,EAAS,SAAQ;EAC1B,IAAI,EAAa,EAAS,EAAE,GAC1B,OAAO,EAAS;EAElB;CACF;AACF"}
1
+ {"version":3,"file":"index331.js","names":[],"sources":["../../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js"],"sourcesContent":["function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _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 isViablePhoneNumber from './isViablePhoneNumber.js';\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nexport function parseRFC3966(text) {\n var number;\n var ext;\n\n // Replace \"tel:\" with \"tel=\" for parsing convenience.\n text = text.replace(/^tel:/, 'tel=');\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n switch (name) {\n case 'tel':\n number = value;\n break;\n case 'ext':\n ext = value;\n break;\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n break;\n }\n }\n\n // If the phone number is not viable, then abort.\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n var result = {\n number: number\n };\n if (ext) {\n result.ext = ext;\n }\n return result;\n}\n\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n if (!number) {\n return '';\n }\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map"],"x_google_ignoreList":[0],"mappings":";AA6DA,SAAgB,EAAc,GAAM;CAClC,IAAI,IAAS,EAAK,QAChB,IAAM,EAAK;CACb,IAAI,CAAC,GACH,OAAO;CAET,IAAI,EAAO,OAAO,KAChB,MAAU,MAAM,+DAA+D;CAEjF,OAAO,OAAc,IAAe,IAAM,UAAU,IAAM;AAC5D"}