@webority/mobile-core 0.0.29 → 0.2.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 (242) hide show
  1. package/README.md +32 -0
  2. package/lib/commonjs/api/baseUrl.js +1 -34
  3. package/lib/commonjs/api/clientHeaders.js +1 -0
  4. package/lib/commonjs/api/curl.js +1 -109
  5. package/lib/commonjs/api/minAppVersion.js +1 -0
  6. package/lib/commonjs/api/multipart.js +1 -21
  7. package/lib/commonjs/api/publicClient.js +1 -79
  8. package/lib/commonjs/api/requestDefaults.js +1 -0
  9. package/lib/commonjs/api/responseBodyText.js +1 -0
  10. package/lib/commonjs/api/retry.js +1 -91
  11. package/lib/commonjs/api/tokenRefresh.js +1 -205
  12. package/lib/commonjs/api/userClient.js +1 -265
  13. package/lib/commonjs/auth/authStore.js +1 -265
  14. package/lib/commonjs/auth/index.js +1 -44
  15. package/lib/commonjs/auth/jwt.js +1 -112
  16. package/lib/commonjs/config/index.js +1 -72
  17. package/lib/commonjs/deepLink/index.js +1 -286
  18. package/lib/commonjs/download/adapters/expoFs.js +1 -69
  19. package/lib/commonjs/download/adapters/shared.js +1 -13
  20. package/lib/commonjs/download/index.js +1 -250
  21. package/lib/commonjs/errors/extractApiError.js +1 -0
  22. package/lib/commonjs/errors/index.js +1 -0
  23. package/lib/commonjs/formatters/currency.js +1 -70
  24. package/lib/commonjs/formatters/date.js +1 -167
  25. package/lib/commonjs/formatters/dateMath.js +1 -311
  26. package/lib/commonjs/formatters/formatConfig.js +1 -0
  27. package/lib/commonjs/formatters/house.js +1 -0
  28. package/lib/commonjs/formatters/index.js +1 -246
  29. package/lib/commonjs/formatters/initials.js +1 -32
  30. package/lib/commonjs/formatters/intlCache.js +1 -37
  31. package/lib/commonjs/formatters/number.js +1 -89
  32. package/lib/commonjs/formatters/phone.js +1 -369
  33. package/lib/commonjs/formatters/windowsToIanaTable.js +1 -164
  34. package/lib/commonjs/geolocation/adapters/expoLocation.js +1 -126
  35. package/lib/commonjs/geolocation/index.js +1 -355
  36. package/lib/commonjs/index.js +1 -644
  37. package/lib/commonjs/initSDK.js +1 -66
  38. package/lib/commonjs/initUserAuth.js +1 -37
  39. package/lib/commonjs/logger/crashlytics.js +1 -0
  40. package/lib/commonjs/logger/index.js +1 -301
  41. package/lib/commonjs/logger/redact.js +1 -50
  42. package/lib/commonjs/network/index.js +1 -31
  43. package/lib/commonjs/network/networkStatus.js +1 -171
  44. package/lib/commonjs/permissions/calendar.js +1 -14
  45. package/lib/commonjs/permissions/camera.js +1 -14
  46. package/lib/commonjs/permissions/contacts.js +1 -10
  47. package/lib/commonjs/permissions/index.js +1 -133
  48. package/lib/commonjs/permissions/location.js +1 -14
  49. package/lib/commonjs/permissions/mediaLibrary.js +1 -10
  50. package/lib/commonjs/permissions/notifications.js +1 -10
  51. package/lib/commonjs/permissions/photos.js +1 -14
  52. package/lib/commonjs/phone/countries.js +1 -265
  53. package/lib/commonjs/push/index.js +1 -61
  54. package/lib/commonjs/push/push.js +1 -468
  55. package/lib/commonjs/push/status.js +1 -0
  56. package/lib/commonjs/push/task.js +1 -43
  57. package/lib/commonjs/query/apiBaseQuery.js +1 -0
  58. package/lib/commonjs/query/createAppApi.js +1 -0
  59. package/lib/commonjs/query/index.js +1 -0
  60. package/lib/commonjs/query/listeners.js +1 -0
  61. package/lib/commonjs/query/paging.js +1 -0
  62. package/lib/commonjs/query/tags.js +1 -0
  63. package/lib/commonjs/redux/errorToastMiddleware.js +1 -0
  64. package/lib/commonjs/redux/index.js +1 -0
  65. package/lib/commonjs/redux/rootReducer.js +1 -0
  66. package/lib/commonjs/redux/serializableCheck.js +1 -0
  67. package/lib/commonjs/secureScreen/index.js +1 -0
  68. package/lib/commonjs/share/index.js +1 -70
  69. package/lib/commonjs/smsRetriever/index.js +1 -91
  70. package/lib/commonjs/specs/NativeSmsRetriever.js +1 -15
  71. package/lib/commonjs/sqlite/adapters/expo.js +1 -53
  72. package/lib/commonjs/sqlite/index.js +1 -604
  73. package/lib/commonjs/storage/index.js +1 -214
  74. package/lib/commonjs/types/axios.js +1 -4
  75. package/lib/commonjs/types/globals.d.js +1 -6
  76. package/lib/commonjs/utils/base64.js +1 -24
  77. package/lib/commonjs/utils/imageCompression.js +1 -389
  78. package/lib/commonjs/utils/index.js +1 -19
  79. package/lib/commonjs/validators/index.js +1 -227
  80. package/lib/commonjs/versionCheck/buildNumber.js +1 -0
  81. package/lib/commonjs/versionCheck/index.js +1 -419
  82. package/lib/module/api/baseUrl.js +1 -30
  83. package/lib/module/api/clientHeaders.js +1 -0
  84. package/lib/module/api/curl.js +1 -104
  85. package/lib/module/api/minAppVersion.js +1 -0
  86. package/lib/module/api/multipart.js +1 -16
  87. package/lib/module/api/publicClient.js +1 -75
  88. package/lib/module/api/requestDefaults.js +1 -0
  89. package/lib/module/api/responseBodyText.js +1 -0
  90. package/lib/module/api/retry.js +1 -85
  91. package/lib/module/api/tokenRefresh.js +1 -192
  92. package/lib/module/api/userClient.js +1 -243
  93. package/lib/module/auth/authStore.js +1 -257
  94. package/lib/module/auth/index.js +1 -5
  95. package/lib/module/auth/jwt.js +1 -106
  96. package/lib/module/config/index.js +1 -64
  97. package/lib/module/deepLink/index.js +1 -280
  98. package/lib/module/download/adapters/expoFs.js +1 -64
  99. package/lib/module/download/adapters/shared.js +1 -8
  100. package/lib/module/download/index.js +1 -242
  101. package/lib/module/errors/extractApiError.js +1 -0
  102. package/lib/module/errors/index.js +1 -0
  103. package/lib/module/formatters/currency.js +1 -65
  104. package/lib/module/formatters/date.js +1 -159
  105. package/lib/module/formatters/dateMath.js +1 -295
  106. package/lib/module/formatters/formatConfig.js +1 -0
  107. package/lib/module/formatters/house.js +1 -0
  108. package/lib/module/formatters/index.js +1 -9
  109. package/lib/module/formatters/initials.js +1 -27
  110. package/lib/module/formatters/intlCache.js +1 -30
  111. package/lib/module/formatters/number.js +1 -82
  112. package/lib/module/formatters/phone.js +1 -302
  113. package/lib/module/formatters/windowsToIanaTable.js +1 -160
  114. package/lib/module/geolocation/adapters/expoLocation.js +1 -121
  115. package/lib/module/geolocation/index.js +1 -347
  116. package/lib/module/index.js +1 -57
  117. package/lib/module/initSDK.js +1 -61
  118. package/lib/module/initUserAuth.js +1 -33
  119. package/lib/module/logger/crashlytics.js +1 -0
  120. package/lib/module/logger/index.js +1 -295
  121. package/lib/module/logger/redact.js +1 -44
  122. package/lib/module/network/index.js +1 -4
  123. package/lib/module/network/networkStatus.js +1 -161
  124. package/lib/module/permissions/calendar.js +1 -15
  125. package/lib/module/permissions/camera.js +1 -15
  126. package/lib/module/permissions/contacts.js +1 -11
  127. package/lib/module/permissions/index.js +1 -128
  128. package/lib/module/permissions/location.js +1 -15
  129. package/lib/module/permissions/mediaLibrary.js +1 -11
  130. package/lib/module/permissions/notifications.js +1 -11
  131. package/lib/module/permissions/photos.js +1 -15
  132. package/lib/module/phone/countries.js +1 -261
  133. package/lib/module/push/index.js +1 -4
  134. package/lib/module/push/push.js +1 -452
  135. package/lib/module/push/status.js +1 -0
  136. package/lib/module/push/task.js +1 -38
  137. package/lib/module/query/apiBaseQuery.js +1 -0
  138. package/lib/module/query/createAppApi.js +1 -0
  139. package/lib/module/query/index.js +1 -0
  140. package/lib/module/query/listeners.js +1 -0
  141. package/lib/module/query/paging.js +1 -0
  142. package/lib/module/query/tags.js +1 -0
  143. package/lib/module/redux/errorToastMiddleware.js +1 -0
  144. package/lib/module/redux/index.js +1 -0
  145. package/lib/module/redux/rootReducer.js +1 -0
  146. package/lib/module/redux/serializableCheck.js +1 -0
  147. package/lib/module/secureScreen/index.js +1 -0
  148. package/lib/module/share/index.js +1 -64
  149. package/lib/module/smsRetriever/index.js +1 -86
  150. package/lib/module/specs/NativeSmsRetriever.js +1 -13
  151. package/lib/module/sqlite/adapters/expo.js +1 -48
  152. package/lib/module/sqlite/index.js +1 -594
  153. package/lib/module/storage/index.js +1 -208
  154. package/lib/module/types/axios.js +1 -4
  155. package/lib/module/types/globals.d.js +1 -10
  156. package/lib/module/utils/base64.js +1 -19
  157. package/lib/module/utils/imageCompression.js +1 -383
  158. package/lib/module/utils/index.js +1 -4
  159. package/lib/module/validators/index.js +1 -205
  160. package/lib/module/versionCheck/buildNumber.js +1 -0
  161. package/lib/module/versionCheck/index.js +1 -413
  162. package/lib/typescript/commonjs/api/clientHeaders.d.ts +25 -0
  163. package/lib/typescript/commonjs/api/minAppVersion.d.ts +24 -0
  164. package/lib/typescript/commonjs/api/requestDefaults.d.ts +21 -0
  165. package/lib/typescript/commonjs/api/responseBodyText.d.ts +6 -0
  166. package/lib/typescript/commonjs/api/retry.d.ts +23 -9
  167. package/lib/typescript/commonjs/api/tokenRefresh.d.ts +14 -2
  168. package/lib/typescript/commonjs/api/userClient.d.ts +1 -1
  169. package/lib/typescript/commonjs/auth/authStore.d.ts +76 -0
  170. package/lib/typescript/commonjs/auth/index.d.ts +2 -2
  171. package/lib/typescript/commonjs/config/index.d.ts +31 -2
  172. package/lib/typescript/commonjs/errors/extractApiError.d.ts +69 -0
  173. package/lib/typescript/commonjs/errors/index.d.ts +3 -0
  174. package/lib/typescript/commonjs/formatters/currency.d.ts +22 -7
  175. package/lib/typescript/commonjs/formatters/date.d.ts +13 -13
  176. package/lib/typescript/commonjs/formatters/dateMath.d.ts +4 -2
  177. package/lib/typescript/commonjs/formatters/formatConfig.d.ts +48 -0
  178. package/lib/typescript/commonjs/formatters/house.d.ts +143 -0
  179. package/lib/typescript/commonjs/formatters/index.d.ts +4 -0
  180. package/lib/typescript/commonjs/formatters/number.d.ts +15 -5
  181. package/lib/typescript/commonjs/index.d.ts +26 -8
  182. package/lib/typescript/commonjs/initSDK.d.ts +18 -6
  183. package/lib/typescript/commonjs/initUserAuth.d.ts +29 -0
  184. package/lib/typescript/commonjs/logger/crashlytics.d.ts +31 -0
  185. package/lib/typescript/commonjs/logger/index.d.ts +17 -0
  186. package/lib/typescript/commonjs/push/index.d.ts +3 -1
  187. package/lib/typescript/commonjs/push/push.d.ts +1 -1
  188. package/lib/typescript/commonjs/push/status.d.ts +9 -0
  189. package/lib/typescript/commonjs/query/apiBaseQuery.d.ts +55 -0
  190. package/lib/typescript/commonjs/query/createAppApi.d.ts +21 -0
  191. package/lib/typescript/commonjs/query/index.d.ts +9 -0
  192. package/lib/typescript/commonjs/query/listeners.d.ts +11 -0
  193. package/lib/typescript/commonjs/query/paging.d.ts +42 -0
  194. package/lib/typescript/commonjs/query/tags.d.ts +31 -0
  195. package/lib/typescript/commonjs/redux/errorToastMiddleware.d.ts +51 -0
  196. package/lib/typescript/commonjs/redux/index.d.ts +6 -0
  197. package/lib/typescript/commonjs/redux/rootReducer.d.ts +19 -0
  198. package/lib/typescript/commonjs/redux/serializableCheck.d.ts +14 -0
  199. package/lib/typescript/commonjs/secureScreen/index.d.ts +25 -0
  200. package/lib/typescript/commonjs/versionCheck/buildNumber.d.ts +14 -0
  201. package/lib/typescript/commonjs/versionCheck/index.d.ts +28 -17
  202. package/lib/typescript/module/api/clientHeaders.d.ts +25 -0
  203. package/lib/typescript/module/api/minAppVersion.d.ts +24 -0
  204. package/lib/typescript/module/api/requestDefaults.d.ts +21 -0
  205. package/lib/typescript/module/api/responseBodyText.d.ts +6 -0
  206. package/lib/typescript/module/api/retry.d.ts +23 -9
  207. package/lib/typescript/module/api/tokenRefresh.d.ts +14 -2
  208. package/lib/typescript/module/api/userClient.d.ts +1 -1
  209. package/lib/typescript/module/auth/authStore.d.ts +76 -0
  210. package/lib/typescript/module/auth/index.d.ts +2 -2
  211. package/lib/typescript/module/config/index.d.ts +31 -2
  212. package/lib/typescript/module/errors/extractApiError.d.ts +69 -0
  213. package/lib/typescript/module/errors/index.d.ts +3 -0
  214. package/lib/typescript/module/formatters/currency.d.ts +22 -7
  215. package/lib/typescript/module/formatters/date.d.ts +13 -13
  216. package/lib/typescript/module/formatters/dateMath.d.ts +4 -2
  217. package/lib/typescript/module/formatters/formatConfig.d.ts +48 -0
  218. package/lib/typescript/module/formatters/house.d.ts +143 -0
  219. package/lib/typescript/module/formatters/index.d.ts +4 -0
  220. package/lib/typescript/module/formatters/number.d.ts +15 -5
  221. package/lib/typescript/module/index.d.ts +26 -8
  222. package/lib/typescript/module/initSDK.d.ts +18 -6
  223. package/lib/typescript/module/initUserAuth.d.ts +29 -0
  224. package/lib/typescript/module/logger/crashlytics.d.ts +31 -0
  225. package/lib/typescript/module/logger/index.d.ts +17 -0
  226. package/lib/typescript/module/push/index.d.ts +3 -1
  227. package/lib/typescript/module/push/push.d.ts +1 -1
  228. package/lib/typescript/module/push/status.d.ts +9 -0
  229. package/lib/typescript/module/query/apiBaseQuery.d.ts +55 -0
  230. package/lib/typescript/module/query/createAppApi.d.ts +21 -0
  231. package/lib/typescript/module/query/index.d.ts +9 -0
  232. package/lib/typescript/module/query/listeners.d.ts +11 -0
  233. package/lib/typescript/module/query/paging.d.ts +42 -0
  234. package/lib/typescript/module/query/tags.d.ts +31 -0
  235. package/lib/typescript/module/redux/errorToastMiddleware.d.ts +51 -0
  236. package/lib/typescript/module/redux/index.d.ts +6 -0
  237. package/lib/typescript/module/redux/rootReducer.d.ts +19 -0
  238. package/lib/typescript/module/redux/serializableCheck.d.ts +14 -0
  239. package/lib/typescript/module/secureScreen/index.d.ts +25 -0
  240. package/lib/typescript/module/versionCheck/buildNumber.d.ts +14 -0
  241. package/lib/typescript/module/versionCheck/index.d.ts +28 -17
  242. package/package.json +52 -5
@@ -1,89 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatPercent = exports.formatNumber = exports.formatCompactNumber = void 0;
7
- var _intlCache = require("./intlCache.js");
8
- const hasIntlNumber = () => typeof Intl !== 'undefined' && typeof Intl.NumberFormat === 'function';
9
-
10
- /**
11
- * Locale-aware number formatter. Defaults to `'en-IN'` (Indian grouping).
12
- */
13
- const formatNumber = (value, fractionDigits, locale = 'en-IN') => {
14
- if (value == null || Number.isNaN(value)) {
15
- return '';
16
- }
17
- if (hasIntlNumber()) {
18
- try {
19
- const opts = {};
20
- if (fractionDigits != null) {
21
- opts.minimumFractionDigits = fractionDigits;
22
- opts.maximumFractionDigits = fractionDigits;
23
- }
24
- return (0, _intlCache.numberFormat)(locale, opts).format(value);
25
- } catch {
26
- /* fall through */
27
- }
28
- }
29
- return fractionDigits != null ? value.toFixed(fractionDigits) : String(value);
30
- };
31
-
32
- /**
33
- * Format a 0–1 ratio (or 0–100 percent) as a percent string.
34
- * Pass `asRatio: false` if your input is already on the 0–100 scale.
35
- */
36
- exports.formatNumber = formatNumber;
37
- const formatPercent = (value, fractionDigits = 0, asRatio = true, locale = 'en-IN') => {
38
- if (value == null || Number.isNaN(value)) {
39
- return '';
40
- }
41
- const ratio = asRatio ? value : value / 100;
42
- if (hasIntlNumber()) {
43
- try {
44
- return (0, _intlCache.numberFormat)(locale, {
45
- style: 'percent',
46
- minimumFractionDigits: fractionDigits,
47
- maximumFractionDigits: fractionDigits
48
- }).format(ratio);
49
- } catch {
50
- /* fall through */
51
- }
52
- }
53
- return `${(ratio * 100).toFixed(fractionDigits)}%`;
54
- };
55
-
56
- /**
57
- * Format a number compactly (1.2K, 3.4M, 1.5L, 2.3Cr).
58
- * Defaults to Indian compact notation via `'en-IN'` locale (lakh / crore).
59
- */
60
- exports.formatPercent = formatPercent;
61
- const formatCompactNumber = (value, locale = 'en-IN') => {
62
- if (value == null || Number.isNaN(value)) {
63
- return '';
64
- }
65
- if (hasIntlNumber()) {
66
- try {
67
- return (0, _intlCache.numberFormat)(locale, {
68
- notation: 'compact',
69
- maximumFractionDigits: 1
70
- }).format(value);
71
- } catch {
72
- /* fall through */
73
- }
74
- }
75
- const abs = Math.abs(value);
76
- const sign = value < 0 ? '-' : '';
77
- if (abs >= 1e7) {
78
- return `${sign}${(abs / 1e7).toFixed(1)}Cr`;
79
- }
80
- if (abs >= 1e5) {
81
- return `${sign}${(abs / 1e5).toFixed(1)}L`;
82
- }
83
- if (abs >= 1e3) {
84
- return `${sign}${(abs / 1e3).toFixed(1)}K`;
85
- }
86
- return `${value}`;
87
- };
88
- exports.formatCompactNumber = formatCompactNumber;
89
- //# sourceMappingURL=number.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatCompactNumber=void 0,exports.formatNumber=formatNumber,exports.formatPercent=formatPercent;var _house=require("./house.js"),_intlCache=require("./intlCache.js");const hasIntlNumber=()=>"undefined"!=typeof Intl&&"function"==typeof Intl.NumberFormat;function formatNumber(t,e,r){if("number"!=typeof e&&void 0===r)return(0,_house.formatNumber)(t,e);const n="number"==typeof e?e:void 0,o=t;if(null==o||Number.isNaN(o))return"";if(hasIntlNumber())try{const t={};return null!=n&&(t.minimumFractionDigits=n,t.maximumFractionDigits=n),(0,_intlCache.numberFormat)(r??"en-IN",t).format(o)}catch{}return null!=n?o.toFixed(n):String(o)}function formatPercent(t,e,r,n){if("number"!=typeof e&&void 0===r&&void 0===n)return(0,_house.formatPercent)(t,e);const o="number"==typeof e?e:0,m=t;if(null==m||Number.isNaN(m))return"";const i=r??1?m:m/100;if(hasIntlNumber())try{return(0,_intlCache.numberFormat)(n??"en-IN",{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(i)}catch{}return`${(100*i).toFixed(o)}%`}const formatCompactNumber=(t,e="en-IN")=>{if(null==t||Number.isNaN(t))return"";if(hasIntlNumber())try{return(0,_intlCache.numberFormat)(e,{notation:"compact",maximumFractionDigits:1}).format(t)}catch{}const r=Math.abs(t),n=t<0?"-":"";return r>=1e7?`${n}${(r/1e7).toFixed(1)}Cr`:r>=1e5?`${n}${(r/1e5).toFixed(1)}L`:r>=1e3?`${n}${(r/1e3).toFixed(1)}K`:`${t}`};exports.formatCompactNumber=formatCompactNumber;
@@ -1,369 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AsYouType", {
7
- enumerable: true,
8
- get: function () {
9
- return _max.AsYouType;
10
- }
11
- });
12
- exports.detectPhoneCountry = exports.countryFlagEmoji = exports.clampNationalNumber = void 0;
13
- exports.formatPhone = formatPhone;
14
- exports.formatPhoneAsTyped = void 0;
15
- Object.defineProperty(exports, "getCountries", {
16
- enumerable: true,
17
- get: function () {
18
- return _max.getCountries;
19
- }
20
- });
21
- Object.defineProperty(exports, "getCountryCallingCode", {
22
- enumerable: true,
23
- get: function () {
24
- return _max.getCountryCallingCode;
25
- }
26
- });
27
- exports.getPhoneCountries = void 0;
28
- Object.defineProperty(exports, "isSupportedCountry", {
29
- enumerable: true,
30
- get: function () {
31
- return _max.isSupportedCountry;
32
- }
33
- });
34
- exports.isValidNationalNumber = void 0;
35
- Object.defineProperty(exports, "isValidPhoneNumber", {
36
- enumerable: true,
37
- get: function () {
38
- return _max.isValidPhoneNumber;
39
- }
40
- });
41
- exports.normalizePhone = exports.maxNationalNumberLength = void 0;
42
- Object.defineProperty(exports, "parsePhoneNumber", {
43
- enumerable: true,
44
- get: function () {
45
- return _max.parsePhoneNumber;
46
- }
47
- });
48
- Object.defineProperty(exports, "parsePhoneNumberFromString", {
49
- enumerable: true,
50
- get: function () {
51
- return _max.parsePhoneNumberFromString;
52
- }
53
- });
54
- exports.splitPhoneNumber = void 0;
55
- Object.defineProperty(exports, "validatePhoneNumberLength", {
56
- enumerable: true,
57
- get: function () {
58
- return _max.validatePhoneNumberLength;
59
- }
60
- });
61
- var _core = require("libphonenumber-js/core");
62
- var _max = require("libphonenumber-js/max");
63
- var _metadataMax = _interopRequireDefault(require("libphonenumber-js/metadata.max.json"));
64
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
65
- /**
66
- * The bare 'libphonenumber-js' entry point actually resolves to the library's
67
- * OWN slimmed-down min/ metadata internally, not its full data - './max' is
68
- * the variant with complete per-country metadata. Since the reason this
69
- * module exists is validation and formatting accuracy, the more accurate
70
- * variant wins throughout this file, not just for validation.
71
- */
72
-
73
- // `Metadata` comes from the core entry with the max data passed in by hand:
74
- // the max entry exports it in its ESM build only, and the CommonJS build jest
75
- // and node resolve has no `Metadata` at all (libphonenumber-js 1.13.12).
76
-
77
- /**
78
- * Re-exported under our own name rather than importing CountryCode directly
79
- * everywhere, so a future need to diverge (or re-narrow) has one place to do
80
- * it. Every ISO 3166-1 alpha-2 code libphonenumber-js recognises - formatPhone
81
- * and detectPhoneCountry below are genuinely correct for all of them, not a
82
- * curated subset.
83
- */
84
-
85
- /**
86
- * Strip everything except digits and a leading `+` (preserved if present).
87
- */
88
- const normalizePhone = input => {
89
- if (!input) {
90
- return '';
91
- }
92
- const trimmed = input.trim();
93
- const hasPlus = trimmed.startsWith('+');
94
- const digits = trimmed.replace(/\D/g, '');
95
- return hasPlus ? `+${digits}` : digits;
96
- };
97
-
98
- /**
99
- * Detect the country of a phone number: from its own `+` country code when
100
- * present, otherwise from `defaultCountryCode`. Returns null when neither
101
- * parses to a recognised country.
102
- */
103
- exports.normalizePhone = normalizePhone;
104
- const detectPhoneCountry = (input, defaultCountryCode = '+91') => {
105
- const normalized = normalizePhone(input);
106
- if (!normalized) {
107
- return null;
108
- }
109
- if (normalized.startsWith('+')) {
110
- return (0, _max.parsePhoneNumberFromString)(normalized)?.country ?? null;
111
- }
112
- const normalizedDefault = normalizePhone(defaultCountryCode);
113
- if (!normalizedDefault.startsWith('+')) {
114
- return null;
115
- }
116
- return (0, _max.parsePhoneNumberFromString)(normalizedDefault + normalized)?.country ?? null;
117
- };
118
- exports.detectPhoneCountry = detectPhoneCountry;
119
- const bestEffortGroup = rest => {
120
- // Not a parseable number at all (garbage input, or a real number that's an
121
- // unsupported length for its country): split the country code (first 1-3
122
- // digits) and group the rest in 4s, rather than returning nothing.
123
- const ccLen = rest.length > 11 ? 3 : rest.length > 10 ? 2 : 1;
124
- const cc = rest.slice(0, ccLen);
125
- const number = rest.slice(ccLen);
126
- const grouped = number.replace(/(.{4})(?=.)/g, '$1 ').trim();
127
- return `+${cc} ${grouped}`.trim();
128
- };
129
-
130
- /**
131
- * Format a phone number for human display, via libphonenumber-js's own
132
- * per-country formatting rather than a hand-rolled grouping table - correct
133
- * for every country it recognises, not a curated subset.
134
- *
135
- * - A number that already carries a `+` country code formats for that country.
136
- * - A bare national number formats for `options.country` when given, else for
137
- * the country implied by `defaultCountryCode` (default `+91`).
138
- * - `includeCountryCode` controls international vs national format; defaults
139
- * to international whenever the country was detected rather than passed in
140
- * explicitly as `options.country`, and to national when it was.
141
- * - Input libphonenumber-js can't parse into a valid number for the resolved
142
- * country falls back to a best-effort `+CC NNNN NNNN…` digit grouping.
143
- */
144
-
145
- function formatPhone(input, arg) {
146
- if (!input) {
147
- return '';
148
- }
149
- const normalized = normalizePhone(input);
150
- if (!normalized) {
151
- return '';
152
- }
153
- const options = typeof arg === 'string' ? {} : arg ?? {};
154
- const defaultCountryCode = typeof arg === 'string' ? arg : options.defaultCountryCode ?? '+91';
155
- const hasOwnCountryCode = normalized.startsWith('+');
156
- let parsed;
157
- // What to best-effort group if parsing fails to produce a valid number.
158
- // Defaults to the plain input; the defaultCountryCode branch below points
159
- // it at the combined digits instead, so a bare number that turns out
160
- // invalid for its detected country still shows that country's code rather
161
- // than silently discarding it.
162
- let fallbackRest = normalized;
163
- if (options.country) {
164
- // parsePhoneNumberFromString ignores this hint when normalized already
165
- // carries its own +, so a real E.164 number is never overridden by a
166
- // wrong or stale options.country.
167
- parsed = (0, _max.parsePhoneNumberFromString)(normalized, options.country);
168
- } else if (hasOwnCountryCode) {
169
- parsed = (0, _max.parsePhoneNumberFromString)(normalized);
170
- } else {
171
- const normalizedDefault = normalizePhone(defaultCountryCode);
172
- if (normalizedDefault.startsWith('+')) {
173
- const combined = normalizedDefault + normalized;
174
- parsed = (0, _max.parsePhoneNumberFromString)(combined);
175
- fallbackRest = combined;
176
- } else {
177
- parsed = undefined;
178
- }
179
- }
180
-
181
- // International by default whenever the country came from the number
182
- // itself (or from defaultCountryCode); national by default only when a
183
- // bare number relied on an explicit options.country to resolve at all.
184
- const includeCcDefault = hasOwnCountryCode || !options.country;
185
- if (parsed?.isValid()) {
186
- const includeCc = options.includeCountryCode ?? includeCcDefault;
187
- return includeCc ? parsed.formatInternational() : parsed.formatNational();
188
- }
189
- return fallbackRest.startsWith('+') ? bestEffortGroup(fallbackRest.slice(1)) : fallbackRest.replace(/(.{4})(?=.)/g, '$1 ').trim();
190
- }
191
-
192
- // ---------------------------------------------------------------------------
193
- // Structured-value helpers. These back PhoneNumberInput in mobile-ui, and are
194
- // exported so an app's own form and API code validates with the same rules
195
- // the field shows on screen, rather than a second regex table.
196
- // ---------------------------------------------------------------------------
197
-
198
- /** Country calling code + national digits, the way a phone field stores them. */
199
-
200
- /**
201
- * Which kinds of number count as valid. `'any'` is libphonenumber's own
202
- * answer (a fixed line passes). `'mobile'` narrows to MOBILE and
203
- * FIXED_LINE_OR_MOBILE, which is what an OTP or WhatsApp field wants: in India
204
- * a 10-digit number starting with 1 to 5 is a real fixed line and passes
205
- * `'any'`, but no SMS will ever reach it.
206
- */
207
-
208
- const onlyDigits = input => input.replace(/\D/g, '');
209
-
210
- /**
211
- * Split a typed or pasted number into calling code + national digits.
212
- * `'+919876543210'` resolves to IN / 91 / 9876543210 from its own prefix; a
213
- * bare `'9876543210'` needs `defaultCountry` to resolve at all. Returns null
214
- * when the input has no digits or no country can be told. A shared calling
215
- * code (`+1` for US and CA) resolves to the country whose area code matches,
216
- * which is why the country comes back as part of the answer rather than being
217
- * looked up again from the code.
218
- */
219
- const splitPhoneNumber = (input, defaultCountry) => {
220
- const normalized = normalizePhone(input);
221
- if (!normalized || onlyDigits(normalized).length === 0) {
222
- return null;
223
- }
224
- const parsed = normalized.startsWith('+') ? (0, _max.parsePhoneNumberFromString)(normalized) : defaultCountry ? (0, _max.parsePhoneNumberFromString)(normalized, defaultCountry) : undefined;
225
- if (!parsed) {
226
- return null;
227
- }
228
- return {
229
- country: parsed.country ?? null,
230
- callingCode: parsed.countryCallingCode,
231
- nationalNumber: parsed.nationalNumber
232
- };
233
- };
234
-
235
- /**
236
- * Cut national digits that run past the longest number the country's plan
237
- * allows, so a field stops accepting the impossible without a per-country
238
- * length table. This is the PLAN's ceiling, not a mobile number's: India runs
239
- * to 13 digits (toll-free 1800 numbers), the US to 10, Germany to 15. A field
240
- * that should stop where a subscriber's number ends asks
241
- * `maxNationalNumberLength` instead. Digits within range, including a number
242
- * still too short, pass through untouched.
243
- */
244
- exports.splitPhoneNumber = splitPhoneNumber;
245
- const clampNationalNumber = (nationalDigits, country) => {
246
- let digits = onlyDigits(nationalDigits);
247
- while (digits.length > 0 && (0, _max.validatePhoneNumberLength)(digits, country) === 'TOO_LONG') {
248
- digits = digits.slice(0, -1);
249
- }
250
- return digits;
251
- };
252
-
253
- // The number types a person types into a phone field. Toll-free, premium,
254
- // shared-cost and pager ranges are what push a plan's ceiling past them.
255
- exports.clampNationalNumber = clampNationalNumber;
256
- const SUBSCRIBER_TYPES = {
257
- any: ['MOBILE', 'FIXED_LINE'],
258
- mobile: ['MOBILE']
259
- };
260
-
261
- // libphonenumber-js types `numberingPlan` without its per-type accessor; the
262
- // runtime object has it, and a type with no lengths of its own answers with the
263
- // plan's.
264
-
265
- /**
266
- * The most national digits a subscriber's number can have in a country, so a
267
- * field can refuse the next digit as it is typed rather than trimming after.
268
- * `'any'` (default) covers mobile and fixed lines, `'mobile'` mobiles only: India
269
- * is 10 either way (its plan's 13 belongs to toll-free numbers), Germany is 15
270
- * for `'any'` and 11 for `'mobile'`, the UAE 9. A country whose metadata lists
271
- * no lengths by type falls back to the plan's longest number.
272
- */
273
- const maxNationalNumberLength = (country, kind = 'any') => {
274
- const metadata = new _core.Metadata(_metadataMax.default);
275
- metadata.selectNumberingPlan(country);
276
- const plan = metadata.numberingPlan;
277
- if (!plan) {
278
- return E164_MAX_NATIONAL_DIGITS;
279
- }
280
- const byType = SUBSCRIBER_TYPES[kind].flatMap(type => plan.type(type)?.possibleLengths() ?? []);
281
- return Math.max(...(byType.length > 0 ? byType : plan.possibleLengths()));
282
- };
283
-
284
- // E.164 allows 15 digits in total; a national number can never exceed it.
285
- exports.maxNationalNumberLength = maxNationalNumberLength;
286
- const E164_MAX_NATIONAL_DIGITS = 15;
287
-
288
- /**
289
- * National digits grouped the way the country writes them, updated on every
290
- * keystroke: `'98765'` for IN is `'98765'`, `'9876543210'` is `'98765 43210'`,
291
- * `'2025550123'` for US is `'(202) 555-0123'`. Output is for display only; the
292
- * digits are what a value stores. Digits past the plan's longest possible
293
- * number are dropped first, so an overflowing paste never formats as a longer
294
- * number; digits that fit no pattern come back ungrouped rather than forced
295
- * into a shape.
296
- *
297
- * Countries that write a leading 0 (the UAE, the UK, Australia, Saudi Arabia)
298
- * only group in national mode when that 0 is typed, and a value never holds
299
- * it. When national mode hands the digits back untouched, the grouping comes
300
- * from the international form with the calling code removed: `'501234567'`
301
- * for AE is `'50 123 4567'`. Countries that group nationally are unaffected.
302
- */
303
- const formatPhoneAsTyped = (nationalDigits, country) => {
304
- const digits = clampNationalNumber(nationalDigits, country);
305
- if (!digits) {
306
- return '';
307
- }
308
- const national = new _max.AsYouType(country).input(digits);
309
- if (national !== digits) {
310
- return national;
311
- }
312
- const prefix = `+${(0, _max.getCountryCallingCode)(country)}`;
313
- const international = new _max.AsYouType().input(`${prefix}${digits}`);
314
- return international.startsWith(prefix) ? international.slice(prefix.length).trimStart() || digits : digits;
315
- };
316
-
317
- /**
318
- * Whether national digits form a real number for the country, by the
319
- * country's own numbering plan rather than a length check. `kind: 'mobile'`
320
- * additionally rejects fixed lines; a number whose type the metadata cannot
321
- * tell is accepted, since the metadata, not the number, is what is missing.
322
- */
323
- exports.formatPhoneAsTyped = formatPhoneAsTyped;
324
- const isValidNationalNumber = (nationalDigits, country, kind = 'any') => {
325
- const digits = onlyDigits(nationalDigits);
326
- if (!digits) {
327
- return false;
328
- }
329
- const parsed = (0, _max.parsePhoneNumberFromString)(digits, country);
330
- if (!parsed?.isValid()) {
331
- return false;
332
- }
333
- if (kind === 'any') {
334
- return true;
335
- }
336
- const type = parsed.getType();
337
- return type === undefined || type === 'MOBILE' || type === 'FIXED_LINE_OR_MOBILE';
338
- };
339
-
340
- /**
341
- * The flag as an emoji built from the ISO code's two regional-indicator
342
- * letters, so no font asset ships with the library: iOS and Android both draw
343
- * these from the system font. An unknown or malformed code returns ''. (Windows
344
- * browsers render the two letters instead of a flag; that is the platform, not
345
- * the code.)
346
- */
347
- exports.isValidNationalNumber = isValidNationalNumber;
348
- const countryFlagEmoji = iso => {
349
- const code = iso.trim().toUpperCase();
350
- if (!/^[A-Z]{2}$/.test(code)) {
351
- return '';
352
- }
353
- return String.fromCodePoint(0x1f1e6 + code.charCodeAt(0) - 65, 0x1f1e6 + code.charCodeAt(1) - 65);
354
- };
355
-
356
- /** Calling code + ISO for one country, the shape a country picker lists. */
357
- exports.countryFlagEmoji = countryFlagEmoji;
358
- /**
359
- * Every country libphonenumber-js knows, with its calling code, in metadata
360
- * order. Names are deliberately not here: they are display data, in one
361
- * language, and live on their own import path (`mobile-core/phone/countries`)
362
- * so an app that never opens a full country list does not carry them.
363
- */
364
- const getPhoneCountries = () => (0, _max.getCountries)().map(iso => ({
365
- iso,
366
- callingCode: (0, _max.getCountryCallingCode)(iso)
367
- }));
368
- exports.getPhoneCountries = getPhoneCountries;
369
- //# sourceMappingURL=phone.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"AsYouType",{enumerable:!0,get:function(){return _max.AsYouType}}),exports.detectPhoneCountry=exports.countryFlagEmoji=exports.clampNationalNumber=void 0,exports.formatPhone=formatPhone,exports.formatPhoneAsTyped=void 0,Object.defineProperty(exports,"getCountries",{enumerable:!0,get:function(){return _max.getCountries}}),Object.defineProperty(exports,"getCountryCallingCode",{enumerable:!0,get:function(){return _max.getCountryCallingCode}}),exports.getPhoneCountries=void 0,Object.defineProperty(exports,"isSupportedCountry",{enumerable:!0,get:function(){return _max.isSupportedCountry}}),exports.isValidNationalNumber=void 0,Object.defineProperty(exports,"isValidPhoneNumber",{enumerable:!0,get:function(){return _max.isValidPhoneNumber}}),exports.normalizePhone=exports.maxNationalNumberLength=void 0,Object.defineProperty(exports,"parsePhoneNumber",{enumerable:!0,get:function(){return _max.parsePhoneNumber}}),Object.defineProperty(exports,"parsePhoneNumberFromString",{enumerable:!0,get:function(){return _max.parsePhoneNumberFromString}}),exports.splitPhoneNumber=void 0,Object.defineProperty(exports,"validatePhoneNumberLength",{enumerable:!0,get:function(){return _max.validatePhoneNumberLength}});var _core=require("libphonenumber-js/core"),_max=require("libphonenumber-js/max"),_metadataMax=_interopRequireDefault(require("libphonenumber-js/metadata.max.json"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const normalizePhone=e=>{if(!e)return"";const t=e.trim(),r=t.startsWith("+"),n=t.replace(/\D/g,"");return r?`+${n}`:n};exports.normalizePhone=normalizePhone;const detectPhoneCountry=(e,t="+91")=>{const r=normalizePhone(e);if(!r)return null;if(r.startsWith("+"))return(0,_max.parsePhoneNumberFromString)(r)?.country??null;const n=normalizePhone(t);return n.startsWith("+")?(0,_max.parsePhoneNumberFromString)(n+r)?.country??null:null};exports.detectPhoneCountry=detectPhoneCountry;const bestEffortGroup=e=>{const t=e.length>11?3:e.length>10?2:1;return`+${e.slice(0,t)} ${e.slice(t).replace(/(.{4})(?=.)/g,"$1 ").trim()}`.trim()};function formatPhone(e,t){if(!e)return"";const r=normalizePhone(e);if(!r)return"";const n="string"==typeof t?{}:t??{},o="string"==typeof t?t:n.defaultCountryCode??"+91",a=r.startsWith("+");let i,u=r;if(n.country)i=(0,_max.parsePhoneNumberFromString)(r,n.country);else if(a)i=(0,_max.parsePhoneNumberFromString)(r);else{const e=normalizePhone(o);if(e.startsWith("+")){const t=e+r;i=(0,_max.parsePhoneNumberFromString)(t),u=t}else i=void 0}const s=a||!n.country;if(i?.isValid()){return n.includeCountryCode??s?i.formatInternational():i.formatNational()}return u.startsWith("+")?bestEffortGroup(u.slice(1)):u.replace(/(.{4})(?=.)/g,"$1 ").trim()}const onlyDigits=e=>e.replace(/\D/g,""),splitPhoneNumber=(e,t)=>{const r=normalizePhone(e);if(!r||0===onlyDigits(r).length)return null;const n=r.startsWith("+")?(0,_max.parsePhoneNumberFromString)(r):t?(0,_max.parsePhoneNumberFromString)(r,t):void 0;return n?{country:n.country??null,callingCode:n.countryCallingCode,nationalNumber:n.nationalNumber}:null};exports.splitPhoneNumber=splitPhoneNumber;const clampNationalNumber=(e,t)=>{let r=onlyDigits(e);for(;r.length>0&&"TOO_LONG"===(0,_max.validatePhoneNumberLength)(r,t);)r=r.slice(0,-1);return r};exports.clampNationalNumber=clampNationalNumber;const SUBSCRIBER_TYPES={any:["MOBILE","FIXED_LINE"],mobile:["MOBILE"]},maxNationalNumberLength=(e,t="any")=>{const r=new _core.Metadata(_metadataMax.default);r.selectNumberingPlan(e);const n=r.numberingPlan;if(!n)return E164_MAX_NATIONAL_DIGITS;const o=SUBSCRIBER_TYPES[t].flatMap(e=>n.type(e)?.possibleLengths()??[]);return Math.max(...o.length>0?o:n.possibleLengths())};exports.maxNationalNumberLength=maxNationalNumberLength;const E164_MAX_NATIONAL_DIGITS=15,formatPhoneAsTyped=(e,t)=>{const r=clampNationalNumber(e,t);if(!r)return"";const n=new _max.AsYouType(t).input(r);if(n!==r)return n;const o=`+${(0,_max.getCountryCallingCode)(t)}`,a=(new _max.AsYouType).input(`${o}${r}`);return a.startsWith(o)&&a.slice(o.length).trimStart()||r};exports.formatPhoneAsTyped=formatPhoneAsTyped;const isValidNationalNumber=(e,t,r="any")=>{const n=onlyDigits(e);if(!n)return!1;const o=(0,_max.parsePhoneNumberFromString)(n,t);if(!o?.isValid())return!1;if("any"===r)return!0;const a=o.getType();return void 0===a||"MOBILE"===a||"FIXED_LINE_OR_MOBILE"===a};exports.isValidNationalNumber=isValidNationalNumber;const countryFlagEmoji=e=>{const t=e.trim().toUpperCase();return/^[A-Z]{2}$/.test(t)?String.fromCodePoint(127462+t.charCodeAt(0)-65,127462+t.charCodeAt(1)-65):""};exports.countryFlagEmoji=countryFlagEmoji;const getPhoneCountries=()=>(0,_max.getCountries)().map(e=>({iso:e,callingCode:(0,_max.getCountryCallingCode)(e)}));exports.getPhoneCountries=getPhoneCountries;
@@ -1,164 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.WINDOWS_TO_IANA = void 0;
7
- /**
8
- * .NET-style Windows time zone ID → IANA time zone name, one entry per
9
- * Windows zone, generated from CLDR's `windowsZones.xml` (the same
10
- * upstream source the retired `windows-iana` npm package derived its own
11
- * table from). Only the `territory="001"` (world-default) row is kept per
12
- * Windows zone — `formatTimeInWindowsZone` only ever reads the first IANA
13
- * candidate, and CLDR's `001` row is exactly that default candidate, so
14
- * per-country territory variants (`US`, `CA`, `ZZ`, …) carry no information
15
- * this table's one caller uses.
16
- *
17
- * Regenerate with `node packages/core/scripts/generate-windows-to-iana-table.mjs
18
- * <path-to-windowsZones.xml>` (CLDR: `common/supplemental/windowsZones.xml` in
19
- * https://github.com/unicode-org/cldr) whenever CLDR adds/renames a zone —
20
- * this is a committed, static table; nothing fetches CLDR at build or test
21
- * time.
22
- */
23
- const WINDOWS_TO_IANA = exports.WINDOWS_TO_IANA = {
24
- 'AUS Central Standard Time': 'Australia/Darwin',
25
- 'AUS Eastern Standard Time': 'Australia/Sydney',
26
- 'Afghanistan Standard Time': 'Asia/Kabul',
27
- 'Alaskan Standard Time': 'America/Anchorage',
28
- 'Aleutian Standard Time': 'America/Adak',
29
- 'Altai Standard Time': 'Asia/Barnaul',
30
- 'Arab Standard Time': 'Asia/Riyadh',
31
- 'Arabian Standard Time': 'Asia/Dubai',
32
- 'Arabic Standard Time': 'Asia/Baghdad',
33
- 'Argentina Standard Time': 'America/Buenos_Aires',
34
- 'Astrakhan Standard Time': 'Europe/Astrakhan',
35
- 'Atlantic Standard Time': 'America/Halifax',
36
- 'Aus Central W. Standard Time': 'Australia/Eucla',
37
- 'Azerbaijan Standard Time': 'Asia/Baku',
38
- 'Azores Standard Time': 'Atlantic/Azores',
39
- 'Bahia Standard Time': 'America/Bahia',
40
- 'Bangladesh Standard Time': 'Asia/Dhaka',
41
- 'Belarus Standard Time': 'Europe/Minsk',
42
- 'Bougainville Standard Time': 'Pacific/Bougainville',
43
- 'Canada Central Standard Time': 'America/Regina',
44
- 'Cape Verde Standard Time': 'Atlantic/Cape_Verde',
45
- 'Caucasus Standard Time': 'Asia/Yerevan',
46
- 'Cen. Australia Standard Time': 'Australia/Adelaide',
47
- 'Central America Standard Time': 'America/Guatemala',
48
- 'Central Asia Standard Time': 'Asia/Almaty',
49
- 'Central Brazilian Standard Time': 'America/Cuiaba',
50
- 'Central Europe Standard Time': 'Europe/Budapest',
51
- 'Central European Standard Time': 'Europe/Warsaw',
52
- 'Central Pacific Standard Time': 'Pacific/Guadalcanal',
53
- 'Central Standard Time': 'America/Chicago',
54
- 'Central Standard Time (Mexico)': 'America/Mexico_City',
55
- 'Chatham Islands Standard Time': 'Pacific/Chatham',
56
- 'China Standard Time': 'Asia/Shanghai',
57
- 'Cuba Standard Time': 'America/Havana',
58
- 'Dateline Standard Time': 'Etc/GMT+12',
59
- 'E. Africa Standard Time': 'Africa/Nairobi',
60
- 'E. Australia Standard Time': 'Australia/Brisbane',
61
- 'E. Europe Standard Time': 'Europe/Chisinau',
62
- 'E. South America Standard Time': 'America/Sao_Paulo',
63
- 'Easter Island Standard Time': 'Pacific/Easter',
64
- 'Eastern Standard Time': 'America/New_York',
65
- 'Eastern Standard Time (Mexico)': 'America/Cancun',
66
- 'Egypt Standard Time': 'Africa/Cairo',
67
- 'Ekaterinburg Standard Time': 'Asia/Yekaterinburg',
68
- 'FLE Standard Time': 'Europe/Kiev',
69
- 'Fiji Standard Time': 'Pacific/Fiji',
70
- 'GMT Standard Time': 'Europe/London',
71
- 'GTB Standard Time': 'Europe/Bucharest',
72
- 'Georgian Standard Time': 'Asia/Tbilisi',
73
- 'Greenland Standard Time': 'America/Godthab',
74
- 'Greenwich Standard Time': 'Atlantic/Reykjavik',
75
- 'Haiti Standard Time': 'America/Port-au-Prince',
76
- 'Hawaiian Standard Time': 'Pacific/Honolulu',
77
- 'India Standard Time': 'Asia/Calcutta',
78
- 'Iran Standard Time': 'Asia/Tehran',
79
- 'Israel Standard Time': 'Asia/Jerusalem',
80
- 'Jordan Standard Time': 'Asia/Amman',
81
- 'Kaliningrad Standard Time': 'Europe/Kaliningrad',
82
- 'Korea Standard Time': 'Asia/Seoul',
83
- 'Libya Standard Time': 'Africa/Tripoli',
84
- 'Line Islands Standard Time': 'Pacific/Kiritimati',
85
- 'Lord Howe Standard Time': 'Australia/Lord_Howe',
86
- 'Magadan Standard Time': 'Asia/Magadan',
87
- 'Magallanes Standard Time': 'America/Punta_Arenas',
88
- 'Marquesas Standard Time': 'Pacific/Marquesas',
89
- 'Mauritius Standard Time': 'Indian/Mauritius',
90
- 'Middle East Standard Time': 'Asia/Beirut',
91
- 'Montevideo Standard Time': 'America/Montevideo',
92
- 'Morocco Standard Time': 'Africa/Casablanca',
93
- 'Mountain Standard Time': 'America/Denver',
94
- 'Mountain Standard Time (Mexico)': 'America/Chihuahua',
95
- 'Myanmar Standard Time': 'Asia/Rangoon',
96
- 'N. Central Asia Standard Time': 'Asia/Novosibirsk',
97
- 'Namibia Standard Time': 'Africa/Windhoek',
98
- 'Nepal Standard Time': 'Asia/Katmandu',
99
- 'New Zealand Standard Time': 'Pacific/Auckland',
100
- 'Newfoundland Standard Time': 'America/St_Johns',
101
- 'Norfolk Standard Time': 'Pacific/Norfolk',
102
- 'North Asia East Standard Time': 'Asia/Irkutsk',
103
- 'North Asia Standard Time': 'Asia/Krasnoyarsk',
104
- 'North Korea Standard Time': 'Asia/Pyongyang',
105
- 'Omsk Standard Time': 'Asia/Omsk',
106
- 'Pacific SA Standard Time': 'America/Santiago',
107
- 'Pacific Standard Time': 'America/Los_Angeles',
108
- 'Pacific Standard Time (Mexico)': 'America/Tijuana',
109
- 'Pakistan Standard Time': 'Asia/Karachi',
110
- 'Paraguay Standard Time': 'America/Asuncion',
111
- 'Qyzylorda Standard Time': 'Asia/Qyzylorda',
112
- 'Romance Standard Time': 'Europe/Paris',
113
- 'Russia Time Zone 10': 'Asia/Srednekolymsk',
114
- 'Russia Time Zone 11': 'Asia/Kamchatka',
115
- 'Russia Time Zone 3': 'Europe/Samara',
116
- 'Russian Standard Time': 'Europe/Moscow',
117
- 'SA Eastern Standard Time': 'America/Cayenne',
118
- 'SA Pacific Standard Time': 'America/Bogota',
119
- 'SA Western Standard Time': 'America/La_Paz',
120
- 'SE Asia Standard Time': 'Asia/Bangkok',
121
- 'Saint Pierre Standard Time': 'America/Miquelon',
122
- 'Sakhalin Standard Time': 'Asia/Sakhalin',
123
- 'Samoa Standard Time': 'Pacific/Apia',
124
- 'Sao Tome Standard Time': 'Africa/Sao_Tome',
125
- 'Saratov Standard Time': 'Europe/Saratov',
126
- 'Singapore Standard Time': 'Asia/Singapore',
127
- 'South Africa Standard Time': 'Africa/Johannesburg',
128
- 'South Sudan Standard Time': 'Africa/Juba',
129
- 'Sri Lanka Standard Time': 'Asia/Colombo',
130
- 'Sudan Standard Time': 'Africa/Khartoum',
131
- 'Syria Standard Time': 'Asia/Damascus',
132
- 'Taipei Standard Time': 'Asia/Taipei',
133
- 'Tasmania Standard Time': 'Australia/Hobart',
134
- 'Tocantins Standard Time': 'America/Araguaina',
135
- 'Tokyo Standard Time': 'Asia/Tokyo',
136
- 'Tomsk Standard Time': 'Asia/Tomsk',
137
- 'Tonga Standard Time': 'Pacific/Tongatapu',
138
- 'Transbaikal Standard Time': 'Asia/Chita',
139
- 'Turkey Standard Time': 'Europe/Istanbul',
140
- 'Turks And Caicos Standard Time': 'America/Grand_Turk',
141
- 'US Eastern Standard Time': 'America/Indianapolis',
142
- 'US Mountain Standard Time': 'America/Phoenix',
143
- UTC: 'Etc/UTC',
144
- 'UTC+12': 'Etc/GMT-12',
145
- 'UTC+13': 'Etc/GMT-13',
146
- 'UTC-02': 'Etc/GMT+2',
147
- 'UTC-08': 'Etc/GMT+8',
148
- 'UTC-09': 'Etc/GMT+9',
149
- 'UTC-11': 'Etc/GMT+11',
150
- 'Ulaanbaatar Standard Time': 'Asia/Ulaanbaatar',
151
- 'Venezuela Standard Time': 'America/Caracas',
152
- 'Vladivostok Standard Time': 'Asia/Vladivostok',
153
- 'Volgograd Standard Time': 'Europe/Volgograd',
154
- 'W. Australia Standard Time': 'Australia/Perth',
155
- 'W. Central Africa Standard Time': 'Africa/Lagos',
156
- 'W. Europe Standard Time': 'Europe/Berlin',
157
- 'W. Mongolia Standard Time': 'Asia/Hovd',
158
- 'West Asia Standard Time': 'Asia/Tashkent',
159
- 'West Bank Standard Time': 'Asia/Hebron',
160
- 'West Pacific Standard Time': 'Pacific/Port_Moresby',
161
- 'Yakutsk Standard Time': 'Asia/Yakutsk',
162
- 'Yukon Standard Time': 'America/Whitehorse'
163
- };
164
- //# sourceMappingURL=windowsToIanaTable.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WINDOWS_TO_IANA=void 0;const WINDOWS_TO_IANA=exports.WINDOWS_TO_IANA={"AUS Central Standard Time":"Australia/Darwin","AUS Eastern Standard Time":"Australia/Sydney","Afghanistan Standard Time":"Asia/Kabul","Alaskan Standard Time":"America/Anchorage","Aleutian Standard Time":"America/Adak","Altai Standard Time":"Asia/Barnaul","Arab Standard Time":"Asia/Riyadh","Arabian Standard Time":"Asia/Dubai","Arabic Standard Time":"Asia/Baghdad","Argentina Standard Time":"America/Buenos_Aires","Astrakhan Standard Time":"Europe/Astrakhan","Atlantic Standard Time":"America/Halifax","Aus Central W. Standard Time":"Australia/Eucla","Azerbaijan Standard Time":"Asia/Baku","Azores Standard Time":"Atlantic/Azores","Bahia Standard Time":"America/Bahia","Bangladesh Standard Time":"Asia/Dhaka","Belarus Standard Time":"Europe/Minsk","Bougainville Standard Time":"Pacific/Bougainville","Canada Central Standard Time":"America/Regina","Cape Verde Standard Time":"Atlantic/Cape_Verde","Caucasus Standard Time":"Asia/Yerevan","Cen. Australia Standard Time":"Australia/Adelaide","Central America Standard Time":"America/Guatemala","Central Asia Standard Time":"Asia/Almaty","Central Brazilian Standard Time":"America/Cuiaba","Central Europe Standard Time":"Europe/Budapest","Central European Standard Time":"Europe/Warsaw","Central Pacific Standard Time":"Pacific/Guadalcanal","Central Standard Time":"America/Chicago","Central Standard Time (Mexico)":"America/Mexico_City","Chatham Islands Standard Time":"Pacific/Chatham","China Standard Time":"Asia/Shanghai","Cuba Standard Time":"America/Havana","Dateline Standard Time":"Etc/GMT+12","E. Africa Standard Time":"Africa/Nairobi","E. Australia Standard Time":"Australia/Brisbane","E. Europe Standard Time":"Europe/Chisinau","E. South America Standard Time":"America/Sao_Paulo","Easter Island Standard Time":"Pacific/Easter","Eastern Standard Time":"America/New_York","Eastern Standard Time (Mexico)":"America/Cancun","Egypt Standard Time":"Africa/Cairo","Ekaterinburg Standard Time":"Asia/Yekaterinburg","FLE Standard Time":"Europe/Kiev","Fiji Standard Time":"Pacific/Fiji","GMT Standard Time":"Europe/London","GTB Standard Time":"Europe/Bucharest","Georgian Standard Time":"Asia/Tbilisi","Greenland Standard Time":"America/Godthab","Greenwich Standard Time":"Atlantic/Reykjavik","Haiti Standard Time":"America/Port-au-Prince","Hawaiian Standard Time":"Pacific/Honolulu","India Standard Time":"Asia/Calcutta","Iran Standard Time":"Asia/Tehran","Israel Standard Time":"Asia/Jerusalem","Jordan Standard Time":"Asia/Amman","Kaliningrad Standard Time":"Europe/Kaliningrad","Korea Standard Time":"Asia/Seoul","Libya Standard Time":"Africa/Tripoli","Line Islands Standard Time":"Pacific/Kiritimati","Lord Howe Standard Time":"Australia/Lord_Howe","Magadan Standard Time":"Asia/Magadan","Magallanes Standard Time":"America/Punta_Arenas","Marquesas Standard Time":"Pacific/Marquesas","Mauritius Standard Time":"Indian/Mauritius","Middle East Standard Time":"Asia/Beirut","Montevideo Standard Time":"America/Montevideo","Morocco Standard Time":"Africa/Casablanca","Mountain Standard Time":"America/Denver","Mountain Standard Time (Mexico)":"America/Chihuahua","Myanmar Standard Time":"Asia/Rangoon","N. Central Asia Standard Time":"Asia/Novosibirsk","Namibia Standard Time":"Africa/Windhoek","Nepal Standard Time":"Asia/Katmandu","New Zealand Standard Time":"Pacific/Auckland","Newfoundland Standard Time":"America/St_Johns","Norfolk Standard Time":"Pacific/Norfolk","North Asia East Standard Time":"Asia/Irkutsk","North Asia Standard Time":"Asia/Krasnoyarsk","North Korea Standard Time":"Asia/Pyongyang","Omsk Standard Time":"Asia/Omsk","Pacific SA Standard Time":"America/Santiago","Pacific Standard Time":"America/Los_Angeles","Pacific Standard Time (Mexico)":"America/Tijuana","Pakistan Standard Time":"Asia/Karachi","Paraguay Standard Time":"America/Asuncion","Qyzylorda Standard Time":"Asia/Qyzylorda","Romance Standard Time":"Europe/Paris","Russia Time Zone 10":"Asia/Srednekolymsk","Russia Time Zone 11":"Asia/Kamchatka","Russia Time Zone 3":"Europe/Samara","Russian Standard Time":"Europe/Moscow","SA Eastern Standard Time":"America/Cayenne","SA Pacific Standard Time":"America/Bogota","SA Western Standard Time":"America/La_Paz","SE Asia Standard Time":"Asia/Bangkok","Saint Pierre Standard Time":"America/Miquelon","Sakhalin Standard Time":"Asia/Sakhalin","Samoa Standard Time":"Pacific/Apia","Sao Tome Standard Time":"Africa/Sao_Tome","Saratov Standard Time":"Europe/Saratov","Singapore Standard Time":"Asia/Singapore","South Africa Standard Time":"Africa/Johannesburg","South Sudan Standard Time":"Africa/Juba","Sri Lanka Standard Time":"Asia/Colombo","Sudan Standard Time":"Africa/Khartoum","Syria Standard Time":"Asia/Damascus","Taipei Standard Time":"Asia/Taipei","Tasmania Standard Time":"Australia/Hobart","Tocantins Standard Time":"America/Araguaina","Tokyo Standard Time":"Asia/Tokyo","Tomsk Standard Time":"Asia/Tomsk","Tonga Standard Time":"Pacific/Tongatapu","Transbaikal Standard Time":"Asia/Chita","Turkey Standard Time":"Europe/Istanbul","Turks And Caicos Standard Time":"America/Grand_Turk","US Eastern Standard Time":"America/Indianapolis","US Mountain Standard Time":"America/Phoenix",UTC:"Etc/UTC","UTC+12":"Etc/GMT-12","UTC+13":"Etc/GMT-13","UTC-02":"Etc/GMT+2","UTC-08":"Etc/GMT+8","UTC-09":"Etc/GMT+9","UTC-11":"Etc/GMT+11","Ulaanbaatar Standard Time":"Asia/Ulaanbaatar","Venezuela Standard Time":"America/Caracas","Vladivostok Standard Time":"Asia/Vladivostok","Volgograd Standard Time":"Europe/Volgograd","W. Australia Standard Time":"Australia/Perth","W. Central Africa Standard Time":"Africa/Lagos","W. Europe Standard Time":"Europe/Berlin","W. Mongolia Standard Time":"Asia/Hovd","West Asia Standard Time":"Asia/Tashkent","West Bank Standard Time":"Asia/Hebron","West Pacific Standard Time":"Pacific/Port_Moresby","Yakutsk Standard Time":"Asia/Yakutsk","Yukon Standard Time":"America/Whitehorse"};