kui-utils 0.0.40 → 0.0.43

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.
package/cjs/index.js CHANGED
@@ -1,2612 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var _ = require('lodash');
7
- var reactRouterDom = require('react-router-dom');
8
- var to = require('await-to-js');
9
- var mobx = require('mobx');
10
- var luxon = require('luxon');
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- function _interopNamespace(e) {
15
- if (e && e.__esModule) return e;
16
- var n = Object.create(null);
17
- if (e) {
18
- Object.keys(e).forEach(function (k) {
19
- if (k !== 'default') {
20
- var d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: function () { return e[k]; }
24
- });
25
- }
26
- });
27
- }
28
- n["default"] = e;
29
- return Object.freeze(n);
30
- }
31
-
32
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
- var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
34
- var to__default = /*#__PURE__*/_interopDefaultLegacy(to);
35
-
36
- function setRef(ref, value) {
37
- if (typeof ref === "function") {
38
- ref(value);
39
- }
40
- else if (ref) {
41
- ref.current = value;
42
- }
43
- }
44
- function useForkRef() {
45
- var refs = [];
46
- for (var _i = 0; _i < arguments.length; _i++) {
47
- refs[_i] = arguments[_i];
48
- }
49
- return React__namespace.useMemo(function () {
50
- if (refs.every(function (ref) { return ref == null; })) {
51
- return null;
52
- }
53
- return function (instance) {
54
- refs.forEach(function (ref) {
55
- setRef(ref, instance);
56
- });
57
- };
58
- }, refs);
59
- }
60
-
61
- var useToggle = function (defaultValue) {
62
- if (defaultValue === void 0) { defaultValue = false; }
63
- var _a = React.useState(defaultValue), isOpen = _a[0], setIsOpen = _a[1];
64
- var handleClose = function () {
65
- setIsOpen(false);
66
- };
67
- var handleOpen = function () {
68
- setIsOpen(true);
69
- };
70
- return [isOpen, handleOpen, handleClose];
71
- };
72
-
73
- var useDebounce = function (value, delay, callback, deps) {
74
- var debouncedChangeHandler = React.useMemo(function () { return ___default["default"].debounce(callback, delay); }, [value, delay, deps]);
75
- React.useEffect(function () {
76
- if (value) {
77
- debouncedChangeHandler();
78
- }
79
- return function () {
80
- debouncedChangeHandler.cancel();
81
- };
82
- }, [value, delay, deps]);
83
- };
84
-
85
- var useTabIndex = function (paths) {
86
- var searchParams = reactRouterDom.useLocation().search;
87
- return paths.findIndex(function (path) { return path.includes(searchParams); }) || null;
88
- };
89
-
90
- var useWindowWidth = function (time) {
91
- if (time === void 0) { time = 10; }
92
- var _a = React.useState(0), width = _a[0], setWidth = _a[1];
93
- React.useEffect(function () {
94
- setWidth(window.innerWidth);
95
- var handleResize = ___default["default"].debounce(function () {
96
- setWidth(window.innerWidth);
97
- }, time);
98
- handleResize();
99
- window.addEventListener("resize", handleResize);
100
- return function () { return window.removeEventListener("resize", handleResize); };
101
- }, []);
102
- return width;
103
- };
104
-
105
- var addLeadZero = function (number) { return (number < 10 ? "0".concat(number) : number); };
106
-
107
- var addToArrayByCondition = function (condition, elem) { return (condition ? [elem] : []); };
108
-
109
- var applyMask = function (str, mask, fill) {
110
- if (!mask)
111
- return str;
112
- var formattedStr = str.replace(/\D/g, "");
113
- var result = "";
114
- var index = 0;
115
- for (var i = 0; i < mask.length; i += 1) {
116
- if (mask[i] === "0") {
117
- result += formattedStr[index];
118
- index += 1;
119
- }
120
- else if (index !== 0) {
121
- result += fill || mask[i];
122
- }
123
- }
124
- return result;
125
- };
126
-
127
- /******************************************************************************
128
- Copyright (c) Microsoft Corporation.
129
-
130
- Permission to use, copy, modify, and/or distribute this software for any
131
- purpose with or without fee is hereby granted.
132
-
133
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
134
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
135
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
136
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
137
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
138
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
139
- PERFORMANCE OF THIS SOFTWARE.
140
- ***************************************************************************** */
141
-
142
- var __assign = function() {
143
- __assign = Object.assign || function __assign(t) {
144
- for (var s, i = 1, n = arguments.length; i < n; i++) {
145
- s = arguments[i];
146
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
147
- }
148
- return t;
149
- };
150
- return __assign.apply(this, arguments);
151
- };
152
-
153
- function __awaiter(thisArg, _arguments, P, generator) {
154
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
155
- return new (P || (P = Promise))(function (resolve, reject) {
156
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
157
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
158
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
159
- step((generator = generator.apply(thisArg, _arguments || [])).next());
160
- });
161
- }
162
-
163
- function __generator(thisArg, body) {
164
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
165
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
166
- function verb(n) { return function (v) { return step([n, v]); }; }
167
- function step(op) {
168
- if (f) throw new TypeError("Generator is already executing.");
169
- while (_) try {
170
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
171
- if (y = 0, t) op = [op[0] & 2, t.value];
172
- switch (op[0]) {
173
- case 0: case 1: t = op; break;
174
- case 4: _.label++; return { value: op[1], done: false };
175
- case 5: _.label++; y = op[1]; op = [0]; continue;
176
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
177
- default:
178
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
179
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
180
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
181
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
182
- if (t[2]) _.ops.pop();
183
- _.trys.pop(); continue;
184
- }
185
- op = body.call(thisArg, _);
186
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
187
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
188
- }
189
- }
190
-
191
- function __spreadArray(to, from, pack) {
192
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
193
- if (ar || !(i in from)) {
194
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
195
- ar[i] = from[i];
196
- }
197
- }
198
- return to.concat(ar || Array.prototype.slice.call(from));
199
- }
200
-
201
- var callPromises = function (promises) { return __awaiter(void 0, void 0, void 0, function () {
202
- var results;
203
- return __generator(this, function (_a) {
204
- switch (_a.label) {
205
- case 0: return [4 /*yield*/, Promise.allSettled(promises)];
206
- case 1:
207
- results = _a.sent();
208
- return [2 /*return*/, results.map(function (result) {
209
- return result.status === "fulfilled" ? result.value : null;
210
- })];
211
- }
212
- });
213
- }); };
214
-
215
- var checkIsIOS = function () {
216
- if (typeof window !== "undefined") {
217
- var userAgent = window.navigator.userAgent.toLowerCase();
218
- return /iphone|ipod|ipad|mac/.test(userAgent);
219
- }
220
- return false;
221
- };
222
-
223
- var getNestedData = function (data, key) {
224
- var result = data;
225
- var keyParts = key.split(".");
226
- keyParts.forEach(function (keyPart) {
227
- if (result)
228
- result = result[keyPart];
229
- });
230
- return result;
231
- };
232
-
233
- var cleanEmptyFields = function (array, data, key) {
234
- var result = [];
235
- array.forEach(function (elem) {
236
- var value = getNestedData(data, String(elem[key]));
237
- if (value)
238
- result.push(elem);
239
- });
240
- return result;
241
- };
242
-
243
- var clearNotValidFields = function (data, withNull) {
244
- Object.keys(data).forEach(function (key) {
245
- var settings = withNull ? data[key] !== null : true;
246
- if (settings &&
247
- (typeof data[key] === "undefined" ||
248
- data[key] === null ||
249
- (typeof data[key] === "object" && Object.keys(data[key]).length === 0))) {
250
- delete data[key];
251
- }
252
- });
253
- return data;
254
- };
255
-
256
- var copyInfo = function (data) {
257
- if (data) {
258
- var textarea = document.createElement("textarea");
259
- document.body.append(textarea);
260
- textarea.value = data;
261
- textarea.select();
262
- document.execCommand("copy");
263
- textarea.remove();
264
- }
265
- };
266
-
267
- var cropText = function (text, limit) {
268
- var abbreviatedText = "".concat(text.slice(0, limit), "..");
269
- return "".concat(text.length > limit ? abbreviatedText : text);
270
- };
271
-
272
- var cases = [2, 0, 1, 1, 1, 2];
273
- var declineByNumber = function (num, titles, withoutNumber) {
274
- return typeof num === "number"
275
- ? "".concat(withoutNumber ? "" : "".concat(num, " ")).concat(titles[num % 100 > 4 && num % 100 < 20
276
- ? 2
277
- : cases[num % 10 < 5 ? num % 10 : 5]])
278
- : "";
279
- };
280
-
281
- var formatError = function (data) {
282
- if (data && typeof data === "object") {
283
- return JSON.stringify(data);
284
- }
285
- return "";
286
- };
287
-
288
- var appendToFormData = function (formData, key, value) {
289
- if (value instanceof Blob) {
290
- formData.append(key, value);
291
- }
292
- else if (typeof value === "string") {
293
- formData.append(key, value);
294
- }
295
- else {
296
- formData.append(key, JSON.stringify(value));
297
- }
298
- };
299
- var generateFormDataBody = function (data, withArray) {
300
- var formData = new FormData();
301
- Object.keys(data).forEach(function (key) {
302
- var value = data[key];
303
- if (typeof value !== "undefined") {
304
- if (value instanceof Array && !withArray) {
305
- value.forEach(function (item) {
306
- appendToFormData(formData, key, item);
307
- });
308
- }
309
- else
310
- appendToFormData(formData, key, value);
311
- }
312
- });
313
- return formData;
314
- };
315
-
316
- var getChangedValue = function (newValue, oldValue, formattedValue) {
317
- if (JSON.stringify(newValue) === JSON.stringify(oldValue))
318
- return undefined;
319
- return formattedValue || newValue;
320
- };
321
-
322
- var getFileNameFromFile = function (file, limit) {
323
- if (limit === void 0) { limit = 10; }
324
- var fileUrlParams = file.name.split(".");
325
- var extension = fileUrlParams.pop();
326
- return "".concat(cropText(fileUrlParams.join("."), limit), ".").concat(extension);
327
- };
328
-
329
- var getFileNameFromUrl = function (text, limit) {
330
- var _a;
331
- if (limit === void 0) { limit = 10; }
332
- var fileUrl = (_a = text.split("/")) === null || _a === void 0 ? void 0 : _a.pop();
333
- var fileUrlParams = fileUrl === null || fileUrl === void 0 ? void 0 : fileUrl.split(".");
334
- var extension = fileUrlParams ? fileUrlParams.pop() : "";
335
- return fileUrlParams
336
- ? "".concat(cropText(fileUrlParams.join("."), limit), ".").concat(extension)
337
- : "";
338
- };
339
-
340
- var countries = [
341
- {
342
- name: "Afghanistan (‫افغانستان‬‎)",
343
- nameCode: "af",
344
- nameRus: "Афганистан",
345
- phoneCode: "93",
346
- mask: "-00-000-0000",
347
- },
348
- {
349
- name: "Albania (Shqipëri)",
350
- nameCode: "al",
351
- nameRus: "Албания",
352
- phoneCode: "355",
353
- mask: "(000)000-000",
354
- },
355
- {
356
- name: "Algeria (‫الجزائر‬‎)",
357
- nameCode: "dz",
358
- nameRus: "Алжир",
359
- phoneCode: "213",
360
- mask: "-00-000-0000",
361
- },
362
- {
363
- name: "American Samoa",
364
- nameCode: "as",
365
- nameRus: "Американское Самоа",
366
- phoneCode: "1684",
367
- mask: "0)000-0000",
368
- },
369
- {
370
- name: "Andorra",
371
- nameCode: "ad",
372
- nameRus: "Андорра",
373
- phoneCode: "376",
374
- mask: "-000-000",
375
- },
376
- {
377
- name: "Angola",
378
- nameCode: "ao",
379
- nameRus: "Ангола",
380
- phoneCode: "244",
381
- mask: "(000)000-000",
382
- },
383
- {
384
- name: "Anguilla",
385
- nameCode: "ai",
386
- nameRus: "Ангилья",
387
- phoneCode: "1264",
388
- mask: "0)000-0000",
389
- },
390
- {
391
- name: "Antigua and Barbuda",
392
- nameCode: "ag",
393
- nameRus: "Антигуа и Барбуда",
394
- phoneCode: "1268",
395
- mask: "0)000-0000",
396
- },
397
- {
398
- name: "Argentina",
399
- nameCode: "ar",
400
- nameRus: "Аргентина",
401
- phoneCode: "54",
402
- mask: "(000)000-0000",
403
- },
404
- {
405
- name: "Armenia (Հայաստան)",
406
- nameCode: "am",
407
- nameRus: "Армения",
408
- phoneCode: "374",
409
- mask: "-00-000-000",
410
- },
411
- {
412
- name: "Aruba",
413
- nameCode: "aw",
414
- nameRus: "Аруба",
415
- phoneCode: "297",
416
- mask: "-000-0000",
417
- },
418
- {
419
- name: "Australia",
420
- nameCode: "au",
421
- nameRus: "Австралия",
422
- phoneCode: "61",
423
- mask: "000000000",
424
- },
425
- {
426
- name: "Austria (Österreich)",
427
- nameCode: "at",
428
- nameRus: "Австрия",
429
- phoneCode: "43",
430
- mask: "(000)000-0000",
431
- },
432
- {
433
- name: "Azerbaijan (Azərbaycan)",
434
- nameCode: "az",
435
- nameRus: "Азербайджан",
436
- phoneCode: "994",
437
- mask: "-00-000-00-00",
438
- },
439
- {
440
- name: "Bahamas",
441
- nameCode: "bs",
442
- nameRus: "Багамы",
443
- phoneCode: "1242",
444
- mask: "0)000-0000",
445
- },
446
- {
447
- name: "Bahrain (‫البحرين‬‎)",
448
- nameCode: "bh",
449
- nameRus: "Бахрейн",
450
- phoneCode: "973",
451
- mask: "-0000-0000",
452
- },
453
- {
454
- name: "Bangladesh (বাংলাদেশ)",
455
- nameCode: "bd",
456
- nameRus: "Бангладеш",
457
- phoneCode: "880",
458
- mask: "-00-000-000",
459
- },
460
- {
461
- name: "Barbados",
462
- nameCode: "bb",
463
- nameRus: "Барбадос",
464
- phoneCode: "1246",
465
- mask: "0)000-0000",
466
- },
467
- {
468
- name: "Belarus (Беларусь)",
469
- nameCode: "by",
470
- nameRus: "Беларусь",
471
- phoneCode: "375",
472
- mask: "(00)000-00-00",
473
- },
474
- {
475
- name: "Belgium (België)",
476
- nameCode: "be",
477
- nameRus: "Бельгия",
478
- phoneCode: "32",
479
- mask: "000000000",
480
- },
481
- {
482
- name: "Belize",
483
- nameCode: "bz",
484
- nameRus: "Белиз",
485
- phoneCode: "501",
486
- mask: "-000-0000",
487
- },
488
- {
489
- name: "Benin (Bénin)",
490
- nameCode: "bj",
491
- nameRus: "Бенин",
492
- phoneCode: "229",
493
- mask: "-00-00-0000",
494
- },
495
- {
496
- name: "Bermuda",
497
- nameCode: "bm",
498
- nameRus: "Бермудские о-ва",
499
- phoneCode: "1441",
500
- mask: "0)000-0000",
501
- },
502
- {
503
- name: "Bhutan (འབྲུག)",
504
- nameCode: "bt",
505
- nameRus: "Бутан",
506
- phoneCode: "975",
507
- mask: "-0-000-000",
508
- },
509
- {
510
- name: "Bolivia",
511
- nameCode: "bo",
512
- nameRus: "Боливия",
513
- phoneCode: "591",
514
- mask: "-0-000-0000",
515
- },
516
- {
517
- name: "Bosnia and Herzegovina (Босна и Херцеговина)",
518
- nameCode: "ba",
519
- nameRus: "Босния и Герцеговина",
520
- phoneCode: "387",
521
- mask: "-00-0000",
522
- },
523
- {
524
- name: "Botswana",
525
- nameCode: "bw",
526
- nameRus: "Ботсвана",
527
- phoneCode: "267",
528
- mask: "-00-000-000",
529
- },
530
- {
531
- name: "Brazil (Brasil)",
532
- nameCode: "br",
533
- nameRus: "Бразилия",
534
- phoneCode: "55",
535
- mask: "-00-0000-0000",
536
- },
537
- {
538
- name: "British Indian Ocean Territory",
539
- nameCode: "io",
540
- nameRus: "Британская территория в Индийском океане",
541
- phoneCode: "246",
542
- mask: "-000-0000",
543
- },
544
- {
545
- name: "British Virgin Islands",
546
- nameCode: "vg",
547
- nameRus: "Виргинские о-ва (Великобритания)",
548
- phoneCode: "1284",
549
- mask: "0)000-0000",
550
- },
551
- {
552
- name: "Brunei",
553
- nameCode: "bn",
554
- nameRus: "Бруней-Даруссалам",
555
- phoneCode: "673",
556
- mask: "-000-0000",
557
- },
558
- {
559
- name: "Bulgaria (България)",
560
- nameCode: "bg",
561
- nameRus: "Болгария",
562
- phoneCode: "359",
563
- mask: "(000)000-000",
564
- },
565
- {
566
- name: "Burkina Faso",
567
- nameCode: "bf",
568
- nameRus: "Буркина-Фасо",
569
- phoneCode: "226",
570
- mask: "-00-00-0000",
571
- },
572
- {
573
- name: "Burundi (Uburundi)",
574
- nameCode: "bi",
575
- nameRus: "Бурунди",
576
- phoneCode: "257",
577
- mask: "-00-00-0000",
578
- },
579
- {
580
- name: "Cambodia (កម្ពុជា)",
581
- nameCode: "kh",
582
- nameRus: "Камбоджа",
583
- phoneCode: "855",
584
- mask: "-00-000-000",
585
- },
586
- {
587
- name: "Cameroon (Cameroun)",
588
- nameCode: "cm",
589
- nameRus: "Камерун",
590
- phoneCode: "237",
591
- mask: "-0000-0000",
592
- },
593
- {
594
- name: "Canada",
595
- nameCode: "ca",
596
- nameRus: "Канада",
597
- phoneCode: "1",
598
- mask: "(000)000-0000",
599
- },
600
- {
601
- name: "Cape Verde (Kabu Verdi)",
602
- nameCode: "cv",
603
- nameRus: "Кабо-Верде",
604
- phoneCode: "238",
605
- mask: "(000)00-00",
606
- },
607
- {
608
- name: "Caribbean Netherlands",
609
- nameCode: "bq",
610
- nameRus: "Бонэйр, Синт-Эстатиус и Саба",
611
- phoneCode: "599",
612
- mask: "-000-0000",
613
- },
614
- {
615
- name: "Cayman Islands",
616
- nameCode: "ky",
617
- nameRus: "Острова Кайман",
618
- phoneCode: "1345",
619
- mask: "0)000-0000",
620
- },
621
- {
622
- name: "Central African Republic (République centrafricaine)",
623
- nameCode: "cf",
624
- nameRus: "Центрально-Африканская Республика",
625
- phoneCode: "236",
626
- mask: "-00-00-0000",
627
- },
628
- {
629
- name: "Chad (Tchad)",
630
- nameCode: "td",
631
- nameRus: "Чад",
632
- phoneCode: "235",
633
- mask: "-00-00-00-00",
634
- },
635
- {
636
- name: "Chile",
637
- nameCode: "cl",
638
- nameRus: "Чили",
639
- phoneCode: "56",
640
- mask: "-0-0000-0000",
641
- },
642
- {
643
- name: "China (中国)",
644
- nameCode: "cn",
645
- nameRus: "Китай",
646
- phoneCode: "86",
647
- mask: "00-00000000",
648
- },
649
- {
650
- name: "Colombia",
651
- nameCode: "co",
652
- nameRus: "Колумбия",
653
- phoneCode: "57",
654
- mask: "(000)000-0000",
655
- },
656
- {
657
- name: "Comoros (‫جزر القمر‬‎)",
658
- nameCode: "km",
659
- nameRus: "Коморы",
660
- phoneCode: "269",
661
- mask: "-00-00000",
662
- },
663
- {
664
- name: "Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)",
665
- nameCode: "cd",
666
- nameRus: "Конго - Киншаса",
667
- phoneCode: "243",
668
- mask: "(000)000-000",
669
- },
670
- {
671
- name: "Congo (Republic) (Congo-Brazzaville)",
672
- nameCode: "cg",
673
- nameRus: "Конго - Браззавиль",
674
- phoneCode: "242",
675
- mask: "-00-000-0000",
676
- },
677
- {
678
- name: "Cook Islands",
679
- nameCode: "ck",
680
- nameRus: "Острова Кука",
681
- phoneCode: "682",
682
- mask: "-00-000",
683
- },
684
- {
685
- name: "Costa Rica",
686
- nameCode: "cr",
687
- nameRus: "Коста-Рика",
688
- phoneCode: "506",
689
- mask: "0000-0000",
690
- },
691
- {
692
- name: "Côte d’Ivoire",
693
- nameCode: "ci",
694
- nameRus: "Кот-д’Ивуар",
695
- phoneCode: "225",
696
- mask: "-00-000-000",
697
- },
698
- {
699
- name: "Croatia (Hrvatska)",
700
- nameCode: "hr",
701
- nameRus: "Хорватия",
702
- phoneCode: "385",
703
- mask: "-00-000-0000",
704
- },
705
- {
706
- name: "Cuba",
707
- nameCode: "cu",
708
- nameRus: "Куба",
709
- phoneCode: "53",
710
- mask: "-0-000-0000",
711
- },
712
- {
713
- name: "Curaçao",
714
- nameCode: "cw",
715
- nameRus: "Кюрасао",
716
- phoneCode: "599",
717
- mask: "-000-0000",
718
- },
719
- {
720
- name: "Cyprus (Κύπρος)",
721
- nameCode: "cy",
722
- nameRus: "Кипр",
723
- phoneCode: "357",
724
- mask: "-00-000-000",
725
- },
726
- {
727
- name: "Czech Republic (Česká republika)",
728
- nameCode: "cz",
729
- nameRus: "Чехия",
730
- phoneCode: "420",
731
- mask: "(000)000-000",
732
- },
733
- {
734
- name: "Denmark (Danmark)",
735
- nameCode: "dk",
736
- nameRus: "Дания",
737
- phoneCode: "45",
738
- mask: "00000000",
739
- },
740
- {
741
- name: "Djibouti",
742
- nameCode: "dj",
743
- nameRus: "Джибути",
744
- phoneCode: "253",
745
- mask: "-00-00-00-00",
746
- },
747
- {
748
- name: "Dominica",
749
- nameCode: "dm",
750
- nameRus: "Доминика",
751
- phoneCode: "1767",
752
- mask: "0)000-0000",
753
- },
754
- {
755
- name: "Dominican Republic (República Dominicana)",
756
- nameCode: "do",
757
- nameRus: "Доминиканская Республика",
758
- phoneCode: "1",
759
- mask: "(000)000-0000",
760
- },
761
- {
762
- name: "Ecuador",
763
- nameCode: "ec",
764
- nameRus: "Эквадор",
765
- phoneCode: "593",
766
- mask: "-0-000-0000",
767
- },
768
- {
769
- name: "Egypt (‫مصر‬‎)",
770
- nameCode: "eg",
771
- nameRus: "Египет",
772
- phoneCode: "20",
773
- mask: "(000)000-0000",
774
- },
775
- {
776
- name: "El Salvador",
777
- nameCode: "sv",
778
- nameRus: "Сальвадор",
779
- phoneCode: "503",
780
- mask: "0000-0000",
781
- },
782
- {
783
- name: "Equatorial Guinea (Guinea Ecuatorial)",
784
- nameCode: "gq",
785
- nameRus: "Экваториальная Гвинея",
786
- phoneCode: "240",
787
- mask: "-00-000-0000",
788
- },
789
- {
790
- name: "Eritrea",
791
- nameCode: "er",
792
- nameRus: "Эритрея",
793
- phoneCode: "291",
794
- mask: "-0-000-000",
795
- },
796
- {
797
- name: "Estonia (Eesti)",
798
- nameCode: "ee",
799
- nameRus: "Эстония",
800
- phoneCode: "372",
801
- mask: "-000-0000",
802
- },
803
- {
804
- name: "Ethiopia",
805
- nameCode: "et",
806
- nameRus: "Эфиопия",
807
- phoneCode: "251",
808
- mask: "-00-000-0000",
809
- },
810
- {
811
- name: "Falkland Islands (Islas Malvinas)",
812
- nameCode: "fk",
813
- nameRus: "Фолклендские о-ва",
814
- phoneCode: "500",
815
- mask: "-00000",
816
- },
817
- {
818
- name: "Faroe Islands (Føroyar)",
819
- nameCode: "fo",
820
- nameRus: "Фарерские о-ва",
821
- phoneCode: "298",
822
- mask: "-000-000",
823
- },
824
- {
825
- name: "Fiji",
826
- nameCode: "fj",
827
- nameRus: "Фиджи",
828
- phoneCode: "679",
829
- mask: "-00-00000",
830
- },
831
- {
832
- name: "Finland (Suomi)",
833
- nameCode: "fi",
834
- nameRus: "Финляндия",
835
- phoneCode: "358",
836
- mask: "0000000000",
837
- },
838
- {
839
- name: "France",
840
- nameCode: "fr",
841
- nameRus: "Франция",
842
- phoneCode: "33",
843
- mask: "000000000",
844
- },
845
- {
846
- name: "French Guiana (Guyane française)",
847
- nameCode: "gf",
848
- nameRus: "Французская Гвиана",
849
- phoneCode: "594",
850
- mask: "-00000-0000",
851
- },
852
- {
853
- name: "French Polynesia (Polynésie française)",
854
- nameCode: "pf",
855
- nameRus: "Французская Полинезия",
856
- phoneCode: "689",
857
- mask: "-00-00-00",
858
- },
859
- {
860
- name: "Gabon",
861
- nameCode: "ga",
862
- nameRus: "Габон",
863
- phoneCode: "241",
864
- mask: "-0-00-00-00",
865
- },
866
- {
867
- name: "Gambia",
868
- nameCode: "gm",
869
- nameRus: "Гамбия",
870
- phoneCode: "220",
871
- mask: "(000)00-00",
872
- },
873
- {
874
- name: "Georgia (საქართველო)",
875
- nameCode: "ge",
876
- nameRus: "Грузия",
877
- phoneCode: "995",
878
- mask: "(000)000-000",
879
- },
880
- {
881
- name: "Germany (Deutschland)",
882
- nameCode: "de",
883
- nameRus: "Германия",
884
- phoneCode: "49",
885
- mask: "0000000000",
886
- },
887
- {
888
- name: "Ghana (Gaana)",
889
- nameCode: "gh",
890
- nameRus: "Гана",
891
- phoneCode: "233",
892
- mask: "(000)000-000",
893
- },
894
- {
895
- name: "Gibraltar",
896
- nameCode: "gi",
897
- nameRus: "Гибралтар",
898
- phoneCode: "350",
899
- mask: "-000-00000",
900
- },
901
- {
902
- name: "Greece (Ελλάδα)",
903
- nameCode: "gr",
904
- nameRus: "Греция",
905
- phoneCode: "30",
906
- mask: "(000)000-0000",
907
- },
908
- {
909
- name: "Greenland (Kalaallit Nunaat)",
910
- nameCode: "gl",
911
- nameRus: "Гренландия",
912
- phoneCode: "299",
913
- mask: "-00-00-00",
914
- },
915
- {
916
- name: "Grenada",
917
- nameCode: "gd",
918
- nameRus: "Гренада",
919
- phoneCode: "1473",
920
- mask: "0)000-0000",
921
- },
922
- {
923
- name: "Guam",
924
- nameCode: "gu",
925
- nameRus: "Гуам",
926
- phoneCode: "1671",
927
- mask: "0)000-0000",
928
- },
929
- {
930
- name: "Guatemala",
931
- nameCode: "gt",
932
- nameRus: "Гватемала",
933
- phoneCode: "502",
934
- mask: "0000-0000",
935
- },
936
- {
937
- name: "Guinea (Guinée)",
938
- nameCode: "gn",
939
- nameRus: "Гвинея",
940
- phoneCode: "224",
941
- mask: "-00-000-000",
942
- },
943
- {
944
- name: "Guinea-Bissau (Guiné Bissau)",
945
- nameCode: "gw",
946
- nameRus: "Гвинея-Бисау",
947
- phoneCode: "245",
948
- mask: "-0-000000",
949
- },
950
- {
951
- name: "Guyana",
952
- nameCode: "gy",
953
- nameRus: "Гайана",
954
- phoneCode: "592",
955
- mask: "-000-0000",
956
- },
957
- {
958
- name: "Haiti",
959
- nameCode: "ht",
960
- nameRus: "Гаити",
961
- phoneCode: "509",
962
- mask: "0000-0000",
963
- },
964
- {
965
- name: "Honduras",
966
- nameCode: "hn",
967
- nameRus: "Гондурас",
968
- phoneCode: "504",
969
- mask: "-0000-0000",
970
- },
971
- {
972
- name: "Hong Kong (香港)",
973
- nameCode: "hk",
974
- nameRus: "Гонконг (САР)",
975
- phoneCode: "852",
976
- mask: "00000000",
977
- },
978
- {
979
- name: "Hungary (Magyarország)",
980
- nameCode: "hu",
981
- nameRus: "Венгрия",
982
- phoneCode: "36",
983
- mask: "(000)000-000",
984
- },
985
- {
986
- name: "Iceland (Ísland)",
987
- nameCode: "is",
988
- nameRus: "Исландия",
989
- phoneCode: "354",
990
- mask: "0000000",
991
- },
992
- {
993
- name: "India (भारत)",
994
- nameCode: "in",
995
- nameRus: "Индия",
996
- phoneCode: "91",
997
- mask: "00000-00000",
998
- },
999
- {
1000
- name: "Indonesia",
1001
- nameCode: "id",
1002
- nameRus: "Индонезия",
1003
- phoneCode: "62",
1004
- mask: "-00-000-00",
1005
- },
1006
- {
1007
- name: "Iran (‫ایران‬‎)",
1008
- nameCode: "ir",
1009
- nameRus: "Иран",
1010
- phoneCode: "98",
1011
- mask: "(000)000-0000",
1012
- },
1013
- {
1014
- name: "Iraq (‫العراق‬‎)",
1015
- nameCode: "iq",
1016
- nameRus: "Ирак",
1017
- phoneCode: "964",
1018
- mask: "(000)000-0000",
1019
- },
1020
- {
1021
- name: "Ireland",
1022
- nameCode: "ie",
1023
- nameRus: "Ирландия",
1024
- phoneCode: "353",
1025
- mask: "000000000",
1026
- },
1027
- {
1028
- name: "Israel (‫ישראל‬‎)",
1029
- nameCode: "il",
1030
- nameRus: "Израиль",
1031
- phoneCode: "972",
1032
- mask: "-0-000-0000",
1033
- },
1034
- {
1035
- name: "Italy (Italia)",
1036
- nameCode: "it",
1037
- nameRus: "Италия",
1038
- phoneCode: "39",
1039
- mask: "000000000",
1040
- },
1041
- {
1042
- name: "Jamaica",
1043
- nameCode: "jm",
1044
- nameRus: "Ямайка",
1045
- phoneCode: "1876",
1046
- mask: "0)000-0000",
1047
- },
1048
- {
1049
- name: "Japan (日本)",
1050
- nameCode: "jp",
1051
- nameRus: "Япония",
1052
- phoneCode: "81",
1053
- mask: "000000000",
1054
- },
1055
- {
1056
- name: "Jordan (‫الأردن‬‎)",
1057
- nameCode: "jo",
1058
- nameRus: "Иордания",
1059
- phoneCode: "962",
1060
- mask: "-0-0000-0000",
1061
- },
1062
- {
1063
- name: "Kazakhstan (Казахстан)",
1064
- nameCode: "kz",
1065
- nameRus: "Казахстан",
1066
- phoneCode: "7",
1067
- mask: "000-000-00-00",
1068
- },
1069
- {
1070
- name: "Kenya",
1071
- nameCode: "ke",
1072
- nameRus: "Кения",
1073
- phoneCode: "254",
1074
- mask: "-000-000000",
1075
- },
1076
- {
1077
- name: "Kiribati",
1078
- nameCode: "ki",
1079
- nameRus: "Кирибати",
1080
- phoneCode: "686",
1081
- mask: "-00-000",
1082
- },
1083
- {
1084
- name: "Kuwait (‫الكويت‬‎)",
1085
- nameCode: "kw",
1086
- nameRus: "Кувейт",
1087
- phoneCode: "965",
1088
- mask: "-0000-0000",
1089
- },
1090
- {
1091
- name: "Kyrgyzstan (Кыргызстан)",
1092
- nameCode: "kg",
1093
- nameRus: "Киргизия",
1094
- phoneCode: "996",
1095
- mask: "(000)000-000",
1096
- },
1097
- {
1098
- name: "Laos (ລາວ)",
1099
- nameCode: "la",
1100
- nameRus: "Лаос",
1101
- phoneCode: "856",
1102
- mask: "-00-000-000",
1103
- },
1104
- {
1105
- name: "Latvia (Latvija)",
1106
- nameCode: "lv",
1107
- nameRus: "Латвия",
1108
- phoneCode: "371",
1109
- mask: "-00-000-000",
1110
- },
1111
- {
1112
- name: "Lebanon (‫لبنان‬‎)",
1113
- nameCode: "lb",
1114
- nameRus: "Ливан",
1115
- phoneCode: "961",
1116
- mask: "-0-000-000",
1117
- },
1118
- {
1119
- name: "Lesotho",
1120
- nameCode: "ls",
1121
- nameRus: "Лесото",
1122
- phoneCode: "266",
1123
- mask: "-0-000-0000",
1124
- },
1125
- {
1126
- name: "Liberia",
1127
- nameCode: "lr",
1128
- nameRus: "Либерия",
1129
- phoneCode: "231",
1130
- mask: "-00-000-000",
1131
- },
1132
- {
1133
- name: "Libya (‫ليبيا‬‎)",
1134
- nameCode: "ly",
1135
- nameRus: "Ливия",
1136
- phoneCode: "218",
1137
- mask: "-00-000-000",
1138
- },
1139
- {
1140
- name: "Liechtenstein",
1141
- nameCode: "li",
1142
- nameRus: "Лихтенштейн",
1143
- phoneCode: "423",
1144
- mask: "(000)000-0000",
1145
- },
1146
- {
1147
- name: "Lithuania (Lietuva)",
1148
- nameCode: "lt",
1149
- nameRus: "Литва",
1150
- phoneCode: "370",
1151
- mask: "(000)00-000",
1152
- },
1153
- {
1154
- name: "Luxembourg",
1155
- nameCode: "lu",
1156
- nameRus: "Люксембург",
1157
- phoneCode: "352",
1158
- mask: "(000)000-000",
1159
- },
1160
- {
1161
- name: "Macau (澳門)",
1162
- nameCode: "mo",
1163
- nameRus: "Макао (САР)",
1164
- phoneCode: "853",
1165
- mask: "-0000-0000",
1166
- },
1167
- {
1168
- name: "Macedonia (FYROM) (Македонија)",
1169
- nameCode: "mk",
1170
- nameRus: "Северная Македония",
1171
- phoneCode: "389",
1172
- mask: "-00-000-000",
1173
- },
1174
- {
1175
- name: "Madagascar (Madagasikara)",
1176
- nameCode: "mg",
1177
- nameRus: "Мадагаскар",
1178
- phoneCode: "261",
1179
- mask: "-00-00-00000",
1180
- },
1181
- {
1182
- name: "Malawi",
1183
- nameCode: "mw",
1184
- nameRus: "Малави",
1185
- phoneCode: "265",
1186
- mask: "-0-0000-0000",
1187
- },
1188
- {
1189
- name: "Malaysia",
1190
- nameCode: "my",
1191
- nameRus: "Малайзия",
1192
- phoneCode: "60",
1193
- mask: "00-0000-0000",
1194
- },
1195
- {
1196
- name: "Maldives",
1197
- nameCode: "mv",
1198
- nameRus: "Мальдивы",
1199
- phoneCode: "960",
1200
- mask: "-000-0000",
1201
- },
1202
- {
1203
- name: "Mali",
1204
- nameCode: "ml",
1205
- nameRus: "Мали",
1206
- phoneCode: "223",
1207
- mask: "-00-00-0000",
1208
- },
1209
- {
1210
- name: "Malta",
1211
- nameCode: "mt",
1212
- nameRus: "Мальта",
1213
- phoneCode: "356",
1214
- mask: "-0000-0000",
1215
- },
1216
- {
1217
- name: "Marshall Islands",
1218
- nameCode: "mh",
1219
- nameRus: "Маршалловы Острова",
1220
- phoneCode: "692",
1221
- mask: "-000-0000",
1222
- },
1223
- {
1224
- name: "Martinique",
1225
- nameCode: "mq",
1226
- nameRus: "Мартиника",
1227
- phoneCode: "596",
1228
- mask: "(000)00-00-00",
1229
- },
1230
- {
1231
- name: "Mauritania (‫موريتانيا‬‎)",
1232
- nameCode: "mr",
1233
- nameRus: "Мавритания",
1234
- phoneCode: "222",
1235
- mask: "-00-00-0000",
1236
- },
1237
- {
1238
- name: "Mauritius (Moris)",
1239
- nameCode: "mu",
1240
- nameRus: "Маврикий",
1241
- phoneCode: "230",
1242
- mask: "-000-0000",
1243
- },
1244
- {
1245
- name: "Mexico (México)",
1246
- nameCode: "mx",
1247
- nameRus: "Мексика",
1248
- phoneCode: "52",
1249
- mask: "-00-00-0000",
1250
- },
1251
- {
1252
- name: "Micronesia",
1253
- nameCode: "fm",
1254
- nameRus: "Федеративные Штаты Микронезии",
1255
- phoneCode: "691",
1256
- mask: "-000-0000",
1257
- },
1258
- {
1259
- name: "Moldova (Republica Moldova)",
1260
- nameCode: "md",
1261
- nameRus: "Молдова",
1262
- phoneCode: "373",
1263
- mask: "-0000-0000",
1264
- },
1265
- {
1266
- name: "Monaco",
1267
- nameCode: "mc",
1268
- nameRus: "Монако",
1269
- phoneCode: "377",
1270
- mask: "-00-000-000",
1271
- },
1272
- {
1273
- name: "Mongolia (Монгол)",
1274
- nameCode: "mn",
1275
- nameRus: "Монголия",
1276
- phoneCode: "976",
1277
- mask: "-00-00-0000",
1278
- },
1279
- {
1280
- name: "Montenegro (Crna Gora)",
1281
- nameCode: "me",
1282
- nameRus: "Черногория",
1283
- phoneCode: "382",
1284
- mask: "-00-000-000",
1285
- },
1286
- {
1287
- name: "Montserrat",
1288
- nameCode: "ms",
1289
- nameRus: "Монтсеррат",
1290
- phoneCode: "1664",
1291
- mask: "0)000-0000",
1292
- },
1293
- {
1294
- name: "Morocco (‫المغرب‬‎)",
1295
- nameCode: "ma",
1296
- nameRus: "Марокко",
1297
- phoneCode: "212",
1298
- mask: "-00-0000-000",
1299
- },
1300
- {
1301
- name: "Mozambique (Moçambique)",
1302
- nameCode: "mz",
1303
- nameRus: "Мозамбик",
1304
- phoneCode: "258",
1305
- mask: "-00-000-000",
1306
- },
1307
- {
1308
- name: "Myanmar (Burma) (မြန်မာ)",
1309
- nameCode: "mm",
1310
- nameRus: "Мьянма (Бирма)",
1311
- phoneCode: "95",
1312
- mask: "-000-000",
1313
- },
1314
- {
1315
- name: "Namibia (Namibië)",
1316
- nameCode: "na",
1317
- nameRus: "Намибия",
1318
- phoneCode: "264",
1319
- mask: "-00-000-0000",
1320
- },
1321
- {
1322
- name: "Nauru",
1323
- nameCode: "nr",
1324
- nameRus: "Науру",
1325
- phoneCode: "674",
1326
- mask: "-000-0000",
1327
- },
1328
- {
1329
- name: "Nepal (नेपाल)",
1330
- nameCode: "np",
1331
- nameRus: "Непал",
1332
- phoneCode: "977",
1333
- mask: "-00-000-000",
1334
- },
1335
- {
1336
- name: "Netherlands (Nederland)",
1337
- nameCode: "nl",
1338
- nameRus: "Нидерланды",
1339
- phoneCode: "31",
1340
- mask: "0000000000",
1341
- },
1342
- {
1343
- name: "New Caledonia (Nouvelle-Calédonie)",
1344
- nameCode: "nc",
1345
- nameRus: "Новая Каледония",
1346
- phoneCode: "687",
1347
- mask: "-00-0000",
1348
- },
1349
- {
1350
- name: "New Zealand",
1351
- nameCode: "nz",
1352
- nameRus: "Новая Зеландия",
1353
- phoneCode: "64",
1354
- mask: "000-000-0000",
1355
- },
1356
- {
1357
- name: "Nicaragua",
1358
- nameCode: "ni",
1359
- nameRus: "Никарагуа",
1360
- phoneCode: "505",
1361
- mask: "-0000-0000",
1362
- },
1363
- {
1364
- name: "Niger (Nijar)",
1365
- nameCode: "ne",
1366
- nameRus: "Нигер",
1367
- phoneCode: "227",
1368
- mask: "-00-00-0000",
1369
- },
1370
- {
1371
- name: "Nigeria",
1372
- nameCode: "ng",
1373
- nameRus: "Нигерия",
1374
- phoneCode: "234",
1375
- mask: "-00-000-00",
1376
- },
1377
- {
1378
- name: "Niue",
1379
- nameCode: "nu",
1380
- nameRus: "Ниуэ",
1381
- phoneCode: "683",
1382
- mask: "-0000",
1383
- },
1384
- {
1385
- name: "Norfolk Island",
1386
- nameCode: "nf",
1387
- nameRus: "о-в Норфолк",
1388
- phoneCode: "672",
1389
- mask: "-000-000",
1390
- },
1391
- {
1392
- name: "North Korea (조선 민주주의 인민 공화국)",
1393
- nameCode: "kp",
1394
- nameRus: "КНДР",
1395
- phoneCode: "850",
1396
- mask: "-000-000",
1397
- },
1398
- {
1399
- name: "Northern Mariana Islands",
1400
- nameCode: "mp",
1401
- nameRus: "Северные Марианские о-ва",
1402
- phoneCode: "1670",
1403
- mask: "0)000-0000",
1404
- },
1405
- {
1406
- name: "Norway (Norge)",
1407
- nameCode: "no",
1408
- nameRus: "Норвегия",
1409
- phoneCode: "47",
1410
- mask: "00000000",
1411
- },
1412
- {
1413
- name: "Oman (‫عُمان‬‎)",
1414
- nameCode: "om",
1415
- nameRus: "Оман",
1416
- phoneCode: "968",
1417
- mask: "-00-000-000",
1418
- },
1419
- {
1420
- name: "Pakistan (‫پاکستان‬‎)",
1421
- nameCode: "pk",
1422
- nameRus: "Пакистан",
1423
- phoneCode: "92",
1424
- mask: "000-0000000",
1425
- },
1426
- {
1427
- name: "Palau",
1428
- nameCode: "pw",
1429
- nameRus: "Палау",
1430
- phoneCode: "680",
1431
- mask: "-000-0000",
1432
- },
1433
- {
1434
- name: "Palestine (‫فلسطين‬‎)",
1435
- nameCode: "ps",
1436
- nameRus: "Палестинские территории",
1437
- phoneCode: "970",
1438
- mask: "-00-000-0000",
1439
- },
1440
- {
1441
- name: "Panama (Panamá)",
1442
- nameCode: "pa",
1443
- nameRus: "Панама",
1444
- phoneCode: "507",
1445
- mask: "-000-0000",
1446
- },
1447
- {
1448
- name: "Papua New Guinea",
1449
- nameCode: "pg",
1450
- nameRus: "Папуа — Новая Гвинея",
1451
- phoneCode: "675",
1452
- mask: "(000)00-000",
1453
- },
1454
- {
1455
- name: "Paraguay",
1456
- nameCode: "py",
1457
- nameRus: "Парагвай",
1458
- phoneCode: "595",
1459
- mask: "(000)000-000",
1460
- },
1461
- {
1462
- name: "Peru (Perú)",
1463
- nameCode: "pe",
1464
- nameRus: "Перу",
1465
- phoneCode: "51",
1466
- mask: "(000)000-000",
1467
- },
1468
- {
1469
- name: "Philippines",
1470
- nameCode: "ph",
1471
- nameRus: "Филиппины",
1472
- phoneCode: "63",
1473
- mask: "0000000",
1474
- },
1475
- {
1476
- name: "Poland (Polska)",
1477
- nameCode: "pl",
1478
- nameRus: "Польша",
1479
- phoneCode: "48",
1480
- mask: "000-000-000",
1481
- },
1482
- {
1483
- name: "Portugal",
1484
- nameCode: "pt",
1485
- nameRus: "Португалия",
1486
- phoneCode: "351",
1487
- mask: "-00-000-0000",
1488
- },
1489
- {
1490
- name: "Puerto Rico",
1491
- nameCode: "pr",
1492
- nameRus: "Пуэрто-Рико",
1493
- phoneCode: "1",
1494
- mask: "(000)000-0000",
1495
- },
1496
- {
1497
- name: "Qatar (‫قطر‬‎)",
1498
- nameCode: "qa",
1499
- nameRus: "Катар",
1500
- phoneCode: "974",
1501
- mask: "-0000-0000",
1502
- },
1503
- {
1504
- name: "Réunion (La Réunion)",
1505
- nameCode: "re",
1506
- nameRus: "Реюньон",
1507
- phoneCode: "262",
1508
- mask: "-00000-0000",
1509
- },
1510
- {
1511
- name: "Romania (România)",
1512
- nameCode: "ro",
1513
- nameRus: "Румыния",
1514
- phoneCode: "40",
1515
- mask: "-00-000-0000",
1516
- },
1517
- {
1518
- name: "Russia (Россия)",
1519
- nameCode: "ru",
1520
- nameRus: "Россия",
1521
- phoneCode: "7",
1522
- mask: "000-000-00-00",
1523
- },
1524
- {
1525
- name: "Rwanda",
1526
- nameCode: "rw",
1527
- nameRus: "Руанда",
1528
- phoneCode: "250",
1529
- mask: "(000)000-000",
1530
- },
1531
- {
1532
- name: "Saint Helena",
1533
- nameCode: "sh",
1534
- nameRus: "о-в Св. Елены",
1535
- phoneCode: "290",
1536
- mask: false,
1537
- },
1538
- {
1539
- name: "Saint Kitts and Nevis",
1540
- nameCode: "kn",
1541
- nameRus: "Сент-Китс и Невис",
1542
- phoneCode: "1869",
1543
- mask: "0)000-0000",
1544
- },
1545
- {
1546
- name: "Saint Lucia",
1547
- nameCode: "lc",
1548
- nameRus: "Сент-Люсия",
1549
- phoneCode: "1758",
1550
- mask: "0)000-0000",
1551
- },
1552
- {
1553
- name: "Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)",
1554
- nameCode: "pm",
1555
- nameRus: "Сен-Пьер и Микелон",
1556
- phoneCode: "508",
1557
- mask: false,
1558
- },
1559
- {
1560
- name: "Saint Vincent and the Grenadines",
1561
- nameCode: "vc",
1562
- nameRus: "Сент-Винсент и Гренадины",
1563
- phoneCode: "1784",
1564
- mask: "0)000-0000",
1565
- },
1566
- {
1567
- name: "Samoa",
1568
- nameCode: "ws",
1569
- nameRus: "Самоа",
1570
- phoneCode: "685",
1571
- mask: "-00-0000",
1572
- },
1573
- {
1574
- name: "San Marino",
1575
- nameCode: "sm",
1576
- nameRus: "Сан-Марино",
1577
- phoneCode: "378",
1578
- mask: "-0000-000000",
1579
- },
1580
- {
1581
- name: "São Tomé and Príncipe (São Tomé e Príncipe)",
1582
- nameCode: "st",
1583
- nameRus: "Сан-Томе и Принсипи",
1584
- phoneCode: "239",
1585
- mask: "-00-00000",
1586
- },
1587
- {
1588
- name: "Saudi Arabia (‫المملكة العربية السعودية‬‎)",
1589
- nameCode: "sa",
1590
- nameRus: "Саудовская Аравия",
1591
- phoneCode: "966",
1592
- mask: "-0-000-0000",
1593
- },
1594
- {
1595
- name: "Senegal (Sénégal)",
1596
- nameCode: "sn",
1597
- nameRus: "Сенегал",
1598
- phoneCode: "221",
1599
- mask: "-00-000-0000",
1600
- },
1601
- {
1602
- name: "Serbia (Србија)",
1603
- nameCode: "rs",
1604
- nameRus: "Сербия",
1605
- phoneCode: "381",
1606
- mask: "-00-000-0000",
1607
- },
1608
- {
1609
- name: "Seychelles",
1610
- nameCode: "sc",
1611
- nameRus: "Сейшельские Острова",
1612
- phoneCode: "248",
1613
- mask: "-0-000-000",
1614
- },
1615
- {
1616
- name: "Sierra Leone",
1617
- nameCode: "sl",
1618
- nameRus: "Сьерра-Леоне",
1619
- phoneCode: "232",
1620
- mask: "-00-000000",
1621
- },
1622
- {
1623
- name: "Singapore",
1624
- nameCode: "sg",
1625
- nameRus: "Сингапур",
1626
- phoneCode: "65",
1627
- mask: "0000-0000",
1628
- },
1629
- {
1630
- name: "Sint Maarten",
1631
- nameCode: "sx",
1632
- nameRus: "Синт-Мартен",
1633
- phoneCode: "1721",
1634
- mask: "0)000-0000",
1635
- },
1636
- {
1637
- name: "Slovakia (Slovensko)",
1638
- nameCode: "sk",
1639
- nameRus: "Словакия",
1640
- phoneCode: "421",
1641
- mask: "(000)000-000",
1642
- },
1643
- {
1644
- name: "Slovenia (Slovenija)",
1645
- nameCode: "si",
1646
- nameRus: "Словения",
1647
- phoneCode: "386",
1648
- mask: "-00-000-000",
1649
- },
1650
- {
1651
- name: "Solomon Islands",
1652
- nameCode: "sb",
1653
- nameRus: "Соломоновы Острова",
1654
- phoneCode: "677",
1655
- mask: "-00000",
1656
- },
1657
- {
1658
- name: "Somalia (Soomaaliya)",
1659
- nameCode: "so",
1660
- nameRus: "Сомали",
1661
- phoneCode: "252",
1662
- mask: "-0-000-000",
1663
- },
1664
- {
1665
- name: "South Africa",
1666
- nameCode: "za",
1667
- nameRus: "Южно-Африканская Республика",
1668
- phoneCode: "27",
1669
- mask: "-00-000-0000",
1670
- },
1671
- {
1672
- name: "South Korea (대한민국)",
1673
- nameCode: "kr",
1674
- nameRus: "Республика Корея",
1675
- phoneCode: "82",
1676
- mask: "-00-000-0000",
1677
- },
1678
- {
1679
- name: "South Sudan (‫جنوب السودان‬‎)",
1680
- nameCode: "ss",
1681
- nameRus: "Южный Судан",
1682
- phoneCode: "211",
1683
- mask: "-00-000-0000",
1684
- },
1685
- {
1686
- name: "Spain (España)",
1687
- nameCode: "es",
1688
- nameRus: "Испания",
1689
- phoneCode: "34",
1690
- mask: "000000000",
1691
- },
1692
- {
1693
- name: "Sri Lanka (ශ්‍රී ලංකාව)",
1694
- nameCode: "lk",
1695
- nameRus: "Шри-Ланка",
1696
- phoneCode: "94",
1697
- mask: "-00-000-0000",
1698
- },
1699
- {
1700
- name: "Sudan (‫السودان‬‎)",
1701
- nameCode: "sd",
1702
- nameRus: "Судан",
1703
- phoneCode: "249",
1704
- mask: "-00-000-0000",
1705
- },
1706
- {
1707
- name: "Suriname",
1708
- nameCode: "sr",
1709
- nameRus: "Суринам",
1710
- phoneCode: "597",
1711
- mask: "-000-000",
1712
- },
1713
- {
1714
- name: "Swaziland",
1715
- nameCode: "sz",
1716
- nameRus: "Эсватини",
1717
- phoneCode: "268",
1718
- mask: "-00-00-0000",
1719
- },
1720
- {
1721
- name: "Sweden (Sverige)",
1722
- nameCode: "se",
1723
- nameRus: "Швеция",
1724
- phoneCode: "46",
1725
- mask: "000000000",
1726
- },
1727
- {
1728
- name: "Switzerland (Schweiz)",
1729
- nameCode: "ch",
1730
- nameRus: "Швейцария",
1731
- phoneCode: "41",
1732
- mask: "000000000",
1733
- },
1734
- {
1735
- name: "Syria (‫سوريا‬‎)",
1736
- nameCode: "sy",
1737
- nameRus: "Сирия",
1738
- phoneCode: "963",
1739
- mask: "-00-0000-000",
1740
- },
1741
- {
1742
- name: "Taiwan (台灣)",
1743
- nameCode: "tw",
1744
- nameRus: "Тайвань",
1745
- phoneCode: "886",
1746
- mask: "-0000-0000",
1747
- },
1748
- {
1749
- name: "Tajikistan",
1750
- nameCode: "tj",
1751
- nameRus: "Таджикистан",
1752
- phoneCode: "992",
1753
- mask: "-00-000-0000",
1754
- },
1755
- {
1756
- name: "Tanzania",
1757
- nameCode: "tz",
1758
- nameRus: "Танзания",
1759
- phoneCode: "255",
1760
- mask: "-00-000-0000",
1761
- },
1762
- {
1763
- name: "Thailand (ไทย)",
1764
- nameCode: "th",
1765
- nameRus: "Таиланд",
1766
- phoneCode: "66",
1767
- mask: "-00-000-000",
1768
- },
1769
- {
1770
- name: "Timor-Leste",
1771
- nameCode: "tl",
1772
- nameRus: "Восточный Тимор",
1773
- phoneCode: "670",
1774
- mask: "-000-0000",
1775
- },
1776
- {
1777
- name: "Togo",
1778
- nameCode: "tg",
1779
- nameRus: "Того",
1780
- phoneCode: "228",
1781
- mask: "-00-000-000",
1782
- },
1783
- {
1784
- name: "Tokelau",
1785
- nameCode: "tk",
1786
- nameRus: "Токелау",
1787
- phoneCode: "600",
1788
- mask: "-0000",
1789
- },
1790
- {
1791
- name: "Tonga",
1792
- nameCode: "to",
1793
- nameRus: "Тонга",
1794
- phoneCode: "676",
1795
- mask: "-00000",
1796
- },
1797
- {
1798
- name: "Trinidad and Tobago",
1799
- nameCode: "tt",
1800
- nameRus: "Тринидад и Тобаго",
1801
- phoneCode: "1868",
1802
- mask: "0)000-0000",
1803
- },
1804
- {
1805
- name: "Tunisia (‫تونس‬‎)",
1806
- nameCode: "tn",
1807
- nameRus: "Тунис",
1808
- phoneCode: "216",
1809
- mask: "-00-000-000",
1810
- },
1811
- {
1812
- name: "Turkey (Türkiye)",
1813
- nameCode: "tr",
1814
- nameRus: "Турция",
1815
- phoneCode: "90",
1816
- mask: "0000000000",
1817
- },
1818
- {
1819
- name: "Turkmenistan",
1820
- nameCode: "tm",
1821
- nameRus: "Туркменистан",
1822
- phoneCode: "993",
1823
- mask: "-0-000-0000",
1824
- },
1825
- {
1826
- name: "Turks and Caicos Islands",
1827
- nameCode: "tc",
1828
- nameRus: "о-ва Тёркс и Кайкос",
1829
- phoneCode: "1649",
1830
- mask: "0)000-0000",
1831
- },
1832
- {
1833
- name: "Tuvalu",
1834
- nameCode: "tv",
1835
- nameRus: "Тувалу",
1836
- phoneCode: "688",
1837
- mask: "-00000",
1838
- },
1839
- {
1840
- name: "U.S. Virgin Islands",
1841
- nameCode: "vi",
1842
- nameRus: "Виргинские о-ва (США)",
1843
- phoneCode: "1340",
1844
- mask: "0)000-0000",
1845
- },
1846
- {
1847
- name: "Uganda",
1848
- nameCode: "ug",
1849
- nameRus: "Уганда",
1850
- phoneCode: "256",
1851
- mask: "(000)000-000",
1852
- },
1853
- {
1854
- name: "Ukraine (Україна)",
1855
- nameCode: "ua",
1856
- nameRus: "Украина",
1857
- phoneCode: "380",
1858
- mask: "(00)000-00-00",
1859
- },
1860
- {
1861
- name: "United Arab Emirates (‫الإمارات العربية المتحدة‬‎)",
1862
- nameCode: "ae",
1863
- nameRus: "ОАЭ",
1864
- phoneCode: "971",
1865
- mask: "-0-000-0000",
1866
- },
1867
- {
1868
- name: "United Kingdom",
1869
- nameCode: "gb",
1870
- nameRus: "Великобритания",
1871
- phoneCode: "44",
1872
- mask: "0000000000",
1873
- },
1874
- {
1875
- name: "United States",
1876
- nameCode: "us",
1877
- nameRus: "Соединенные Штаты",
1878
- phoneCode: "1",
1879
- mask: "(000)000-0000",
1880
- },
1881
- {
1882
- name: "Uruguay",
1883
- nameCode: "uy",
1884
- nameRus: "Уругвай",
1885
- phoneCode: "598",
1886
- mask: "-0-000-00-00",
1887
- },
1888
- {
1889
- name: "Uzbekistan (Oʻzbekiston)",
1890
- nameCode: "uz",
1891
- nameRus: "Узбекистан",
1892
- phoneCode: "998",
1893
- mask: "-00-000-0000",
1894
- },
1895
- {
1896
- name: "Vanuatu",
1897
- nameCode: "vu",
1898
- nameRus: "Вануату",
1899
- phoneCode: "678",
1900
- mask: "-00000",
1901
- },
1902
- {
1903
- name: "Vatican City (Città del Vaticano)",
1904
- nameCode: "va",
1905
- nameRus: "Ватикан",
1906
- phoneCode: "39",
1907
- mask: "0000000000",
1908
- },
1909
- {
1910
- name: "Venezuela",
1911
- nameCode: "ve",
1912
- nameRus: "Венесуэла",
1913
- phoneCode: "58",
1914
- mask: "(000)000-0000",
1915
- },
1916
- {
1917
- name: "Vietnam (Việt Nam)",
1918
- nameCode: "vn",
1919
- nameRus: "Вьетнам",
1920
- phoneCode: "84",
1921
- mask: "-00-0000-000",
1922
- },
1923
- {
1924
- name: "Wallis and Futuna",
1925
- nameCode: "wf",
1926
- nameRus: "Уоллис и Футуна",
1927
- phoneCode: "681",
1928
- mask: "-00-0000",
1929
- },
1930
- {
1931
- name: "Western Sahara",
1932
- nameCode: "eh",
1933
- nameRus: "Западная Сахара",
1934
- phoneCode: "212",
1935
- mask: "-00-0000",
1936
- },
1937
- {
1938
- name: "Yemen (‫اليمن‬‎)",
1939
- nameCode: "ye",
1940
- nameRus: "Йемен",
1941
- phoneCode: "967",
1942
- mask: "-0-000-000",
1943
- },
1944
- {
1945
- name: "Zambia",
1946
- nameCode: "zm",
1947
- nameRus: "Замбия",
1948
- phoneCode: "260",
1949
- mask: "-00-000-0000",
1950
- },
1951
- {
1952
- name: "Zimbabwe",
1953
- nameCode: "zw",
1954
- nameRus: "Зимбабве",
1955
- phoneCode: "263",
1956
- mask: "-0-000000",
1957
- },
1958
- ];
1959
-
1960
- var getPhoneNumberFromPhoneParams = function (_a, fill) {
1961
- var _b;
1962
- var phoneCode = _a.phoneCode, phoneNumber = _a.phoneNumber;
1963
- if (!phoneNumber) {
1964
- return "";
1965
- }
1966
- var phoneMask = ((_b = __spreadArray([], countries, true).find(function (country) { return country.phoneCode === "".concat(phoneCode); })) === null || _b === void 0 ? void 0 : _b.mask) ||
1967
- "";
1968
- return "+".concat(phoneCode).concat(fill || "").concat(applyMask(phoneNumber, String(phoneMask), fill));
1969
- };
1970
-
1971
- var getPhoneParamsFromString = function (phone) {
1972
- var _a;
1973
- if (!phone)
1974
- return null;
1975
- var formattedPhone = phone.replace(/\D/g, "");
1976
- var phoneDigits = formattedPhone.split("");
1977
- var phoneCode = ((_a = __spreadArray([], countries, true).find(function (country) {
1978
- return country.phoneCode === formattedPhone.slice(0, country.phoneCode.length);
1979
- })) === null || _a === void 0 ? void 0 : _a.phoneCode) || phoneDigits[0];
1980
- return (phoneDigits === null || phoneDigits === void 0 ? void 0 : phoneDigits.length) > 0
1981
- ? {
1982
- phoneCode: phoneCode,
1983
- phoneNumber: "".concat(phoneDigits.slice(phoneCode.length).join("")),
1984
- }
1985
- : null;
1986
- };
1987
-
1988
- var promisesWithCallback = function (promises, callback) {
1989
- var progress = 0;
1990
- function tick(promise) {
1991
- promise.then(function () {
1992
- progress += 1;
1993
- if (callback)
1994
- callback(progress, promises.length);
1995
- });
1996
- return promise;
1997
- }
1998
- return Promise.allSettled(promises.map(tick));
1999
- };
2000
-
2001
- var resHandler = function (result, loader, callback, errorMessage, params) {
2002
- var err = result[0], res = result[1];
2003
- if (!err && typeof res !== "undefined") {
2004
- try {
2005
- if (callback)
2006
- callback(res);
2007
- }
2008
- catch (e) {
2009
- loader.endLoading();
2010
- loader.setError(errorMessage, err);
2011
- }
2012
- }
2013
- else {
2014
- loader.endLoading();
2015
- loader.setError(errorMessage, err);
2016
- }
2017
- if ((params === null || params === void 0 ? void 0 : params.withEndLoading) || !params) {
2018
- loader.endLoading();
2019
- }
2020
- };
2021
-
2022
- var toNumber = function (value) {
2023
- if (typeof value === "number")
2024
- return value;
2025
- return typeof value === "string"
2026
- ? Number(String(value).replace(/\s/g, "").replace(/,/g, "."))
2027
- : null;
2028
- };
2029
-
2030
- var updateQueryParams = function (newLink, withBase) {
2031
- var searchQuery = new URLSearchParams(window.location.search);
2032
- var hrefLinkParams = newLink.split(/\?|&/);
2033
- var hrefParams = Object.fromEntries(new URLSearchParams(hrefLinkParams.slice(1).join("&")).entries());
2034
- var searchParams = Object.fromEntries(searchQuery.entries());
2035
- var route =
2036
- // @ts-ignore
2037
- searchQuery.size && !withBase ? hrefLinkParams[0] : window.location.pathname;
2038
- Object.keys(searchParams).forEach(function (key, index) {
2039
- if (key in hrefParams) {
2040
- searchParams[key] = hrefParams[key];
2041
- delete hrefParams[key];
2042
- }
2043
- if (key !== "id") {
2044
- route += "".concat(index === 0 ? "?" : "&").concat(key, "=").concat(searchParams[key]);
2045
- }
2046
- });
2047
- Object.keys(hrefParams).forEach(function (key) {
2048
- // @ts-ignore
2049
- route += "".concat(searchQuery.size ? "&" : "?").concat(key, "=").concat(hrefParams[key]);
2050
- });
2051
- window.history.pushState({ route: route }, "", route);
2052
- };
2053
-
2054
- var longPolling = function (callback, errorHandler, stopCondition, delay) { return __awaiter(void 0, void 0, void 0, function () {
2055
- var _a, err, res;
2056
- return __generator(this, function (_b) {
2057
- switch (_b.label) {
2058
- case 0: return [4 /*yield*/, to__default["default"](callback())];
2059
- case 1:
2060
- _a = _b.sent(), err = _a[0], res = _a[1];
2061
- if (err) {
2062
- errorHandler(err);
2063
- return [2 /*return*/, null];
2064
- }
2065
- if (stopCondition(res)) {
2066
- return [2 /*return*/, res];
2067
- }
2068
- return [4 /*yield*/, new Promise(function (resolve) {
2069
- setTimeout(resolve, delay);
2070
- })];
2071
- case 2:
2072
- _b.sent();
2073
- return [2 /*return*/, longPolling(callback, errorHandler, stopCondition, delay)];
2074
- }
2075
- });
2076
- }); };
2077
-
2078
- var downloadFile = function (fileUrl, fileName) { return __awaiter(void 0, void 0, void 0, function () {
2079
- var resource, blob, url, link;
2080
- return __generator(this, function (_a) {
2081
- switch (_a.label) {
2082
- case 0: return [4 /*yield*/, fetch(fileUrl)];
2083
- case 1:
2084
- resource = _a.sent();
2085
- return [4 /*yield*/, resource.blob()];
2086
- case 2:
2087
- blob = _a.sent();
2088
- url = URL.createObjectURL(blob);
2089
- link = document.createElement("a");
2090
- link.href = url;
2091
- link.download = fileName;
2092
- document.body.appendChild(link);
2093
- link.click();
2094
- document.body.removeChild(link);
2095
- return [2 /*return*/];
2096
- }
2097
- });
2098
- }); };
2099
-
2100
- function cleanObjectForIndexDB(value) {
2101
- if (typeof value === "undefined")
2102
- return null;
2103
- if (value instanceof File)
2104
- return value;
2105
- if (value instanceof luxon.DateTime)
2106
- return value.toISO();
2107
- if (mobx.isObservable(value)) {
2108
- return cleanObjectForIndexDB(mobx.toJS(value));
2109
- }
2110
- if (Array.isArray(value)) {
2111
- return value.map(function (item) { return cleanObjectForIndexDB(item); });
2112
- }
2113
- if (value !== null && typeof value === "object") {
2114
- var plainObject = {};
2115
- // eslint-disable-next-line no-restricted-syntax
2116
- for (var key in value) {
2117
- // eslint-disable-next-line no-prototype-builtins
2118
- if (value.hasOwnProperty(key)) {
2119
- var objectValue = value[key];
2120
- if (typeof objectValue !== "function" && objectValue !== undefined) {
2121
- plainObject[key] = cleanObjectForIndexDB(objectValue);
2122
- }
2123
- }
2124
- }
2125
- return plainObject;
2126
- }
2127
- return value;
2128
- }
2129
- var transactionQueue = Promise.resolve();
2130
- var errorHandler = function (err, data) {
2131
- var Sentry = kuiUtilsSettings.getSettings().Sentry;
2132
- if (err)
2133
- Sentry === null || Sentry === void 0 ? void 0 : Sentry.captureException(err);
2134
- if (data)
2135
- Sentry === null || Sentry === void 0 ? void 0 : Sentry.captureMessage(JSON.stringify(data));
2136
- };
2137
- function addToIndexDBWithQueue(db, storeName, data, loader) {
2138
- transactionQueue = transactionQueue
2139
- .then(function () {
2140
- return new Promise(function (resolve, reject) {
2141
- if (db && db.objectStoreNames.contains(storeName) && data) {
2142
- var transaction = db.transaction(storeName, "readwrite");
2143
- var store = transaction.objectStore(storeName);
2144
- // eslint-disable-next-line no-param-reassign
2145
- data.id = 1;
2146
- var formattedData_1 = cleanObjectForIndexDB(data);
2147
- var request_1 = store.put(formattedData_1);
2148
- request_1.onsuccess = function () {
2149
- resolve(request_1);
2150
- };
2151
- request_1.onerror = function (event) {
2152
- var _a;
2153
- var error = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.error) || new Error("Unknown IndexedDB error");
2154
- loader.setError("Не удалось сохранить данные в локальное хранилище", error);
2155
- errorHandler(error, formattedData_1);
2156
- reject(error);
2157
- };
2158
- }
2159
- });
2160
- })
2161
- .catch(function (error) {
2162
- console.error("Ошибка в очереди транзакций:", error);
2163
- });
2164
- }
2165
- var readFromIndexDB = function (db, name, loader) { return __awaiter(void 0, void 0, void 0, function () {
2166
- var transaction, request_2;
2167
- return __generator(this, function (_a) {
2168
- if (db.objectStoreNames.contains(name)) {
2169
- transaction = db.transaction(name, "readonly").objectStore(name);
2170
- request_2 = transaction.getAll();
2171
- return [2 /*return*/, new Promise(function (resolve, reject) {
2172
- request_2.onerror = function () {
2173
- var error = request_2.error;
2174
- loader.setError("Не удалось прочитать данные с локального хранилища", error);
2175
- errorHandler(error, request_2);
2176
- reject();
2177
- };
2178
- request_2.onsuccess = function () {
2179
- var _a;
2180
- resolve((_a = request_2.result) === null || _a === void 0 ? void 0 : _a[0]);
2181
- };
2182
- })];
2183
- }
2184
- return [2 /*return*/, null];
2185
- });
2186
- }); };
2187
- var initIndexDB = function (dbName, onupgradeneeded, loader, setIndexDB) {
2188
- var dbRequest = indexedDB.open(dbName, 1);
2189
- dbRequest.onerror = function () {
2190
- errorHandler(dbRequest.error, "Ошибка при открытии хранилища на устройстве");
2191
- loader.setError("Ошибка при открытии хранилища на устройстве. Данные не будут сохраняться локально");
2192
- };
2193
- dbRequest.onsuccess = function () {
2194
- var db = dbRequest.result;
2195
- setIndexDB(db);
2196
- };
2197
- dbRequest.onupgradeneeded = function () { return onupgradeneeded(dbRequest.result); };
2198
- };
2199
- var addIndexDBStore = function (db, name) {
2200
- if (db && !db.objectStoreNames.contains(name)) {
2201
- db.createObjectStore(name, { keyPath: "id" });
2202
- }
2203
- };
2204
- var clearIndexStore = function (db, name) {
2205
- if (db) {
2206
- var transaction_1 = db.transaction(name, "readwrite");
2207
- transaction_1.onerror = function () {
2208
- var error = transaction_1.error;
2209
- errorHandler(error, "\u041E\u0448\u0438\u0431\u043A\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438: ".concat(name));
2210
- };
2211
- var objectStore = transaction_1.objectStore(name);
2212
- var objectStoreRequest_1 = objectStore.clear();
2213
- objectStoreRequest_1.onerror = function () {
2214
- var error = objectStoreRequest_1.error;
2215
- errorHandler(error, "\u041E\u0448\u0438\u0431\u043A\u0430 \u043E\u0447\u0438\u0441\u0442\u043A\u0438 objectStore: ".concat(name));
2216
- };
2217
- }
2218
- };
2219
- var clearIndexStores = function (db, stores) {
2220
- Array.from(stores).forEach(function (name) {
2221
- clearIndexStore(db, name);
2222
- });
2223
- };
2224
-
2225
- function setCookie(name, value, options) {
2226
- if (options === void 0) { options = {}; }
2227
- var cookieOptions = __assign({ path: "/" }, options);
2228
- var updatedCookie = "".concat(encodeURIComponent(name), "=").concat(encodeURIComponent(value));
2229
- Object.keys(cookieOptions).forEach(function (key) {
2230
- var val = cookieOptions[key];
2231
- updatedCookie += "; ".concat(key);
2232
- updatedCookie += "=".concat(val);
2233
- });
2234
- document.cookie = updatedCookie;
2235
- }
2236
- function deleteCookie(name) {
2237
- setCookie(name, "", {
2238
- "max-age": -1,
2239
- });
2240
- }
2241
- function getCookie(name) {
2242
- var _a;
2243
- var matches = (_a = document.cookie) === null || _a === void 0 ? void 0 : _a.match(new RegExp("(?:^|; )".concat(name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1"), "=([^;]*)")));
2244
- return matches ? decodeURIComponent(matches[1]) : undefined;
2245
- }
2246
-
2247
- var KUIUtilsSettings = /** @class */ (function () {
2248
- function KUIUtilsSettings() {
2249
- var _this = this;
2250
- this.getSettings = function () { return (__assign({}, _this.settings)); };
2251
- this.setSettings = function (newSettings) {
2252
- _this.settings = __assign(__assign({}, _this.settings), newSettings);
2253
- _this.observers.forEach(function (observer) { return observer(_this.settings); });
2254
- };
2255
- this.subscribeToSettings = function (observer) {
2256
- _this.observers.push(observer);
2257
- };
2258
- this.unsubscribeFromSettings = function (observer) {
2259
- var index = _this.observers.indexOf(observer);
2260
- if (index !== -1)
2261
- _this.observers.splice(index, 1);
2262
- };
2263
- this.settings = {};
2264
- this.observers = [];
2265
- this.id = Math.random() * 100;
2266
- }
2267
- return KUIUtilsSettings;
2268
- }());
2269
- var kuiUtilsSettings = new KUIUtilsSettings();
2270
-
2271
- var defaultDelayTime = 600;
2272
- var Loader = /** @class */ (function () {
2273
- function Loader(isLoading, delayTime) {
2274
- var _this = this;
2275
- this.startLoading = function (message, withoutCleanError) {
2276
- var runMode = kuiUtilsSettings.getSettings().runMode;
2277
- _this.isLoading = true;
2278
- _this.loadingMessage = message;
2279
- if (runMode !== "test") {
2280
- _this.timeBeforeLoading = new Date().getTime();
2281
- }
2282
- if (!withoutCleanError)
2283
- _this.cleanError();
2284
- };
2285
- this.endLoading = function () {
2286
- var runMode = kuiUtilsSettings.getSettings().runMode;
2287
- if (runMode === "test") {
2288
- _this.isLoading = false;
2289
- return null;
2290
- }
2291
- _this.timeAfterLoading = new Date().getTime();
2292
- if (_this.timeAfterLoading - _this.timeBeforeLoading < _this.delayTime) {
2293
- return new Promise(function (resolve) {
2294
- // eslint-disable-next-line no-promise-executor-return
2295
- return setTimeout(function () {
2296
- mobx.runInAction(function () {
2297
- _this.isLoading = false;
2298
- });
2299
- resolve(true);
2300
- }, _this.delayTime - (_this.timeAfterLoading - _this.timeBeforeLoading));
2301
- });
2302
- }
2303
- _this.isLoading = false;
2304
- _this.loadingMessage = "";
2305
- return null;
2306
- };
2307
- this.setError = function (errorMessage, err) {
2308
- _this.hasError = true;
2309
- if ((err === null || err === void 0 ? void 0 : err.status) === 403) {
2310
- _this.errorMessage = "You do not have access to this";
2311
- }
2312
- else {
2313
- _this.errorMessage = "".concat(errorMessage || "request").concat(err ? ": \n".concat(formatError(err)) : "");
2314
- }
2315
- _this.error = err;
2316
- };
2317
- this.cleanError = function () {
2318
- _this.hasError = false;
2319
- _this.errorMessage = "";
2320
- _this.error = null;
2321
- };
2322
- this.isLoading = !!isLoading;
2323
- this.hasError = false;
2324
- this.timeBeforeLoading = 0;
2325
- this.timeAfterLoading = 0;
2326
- this.delayTime = delayTime || defaultDelayTime;
2327
- this.errorMessage = "";
2328
- this.error = null;
2329
- mobx.makeAutoObservable(this);
2330
- }
2331
- return Loader;
2332
- }());
2333
-
2334
- var Paginator = /** @class */ (function () {
2335
- function Paginator(limit, isFetching) {
2336
- if (limit === void 0) { limit = 25; }
2337
- if (isFetching === void 0) { isFetching = true; }
2338
- var _this = this;
2339
- this.getPageResponse = function (res, elements, mapper) {
2340
- _this.updatePage(res);
2341
- var formattedRes = res.results.map(function (elem) { return mapper(elem); });
2342
- if (_this.offset === _this.limit)
2343
- return formattedRes;
2344
- return __spreadArray(__spreadArray([], elements, true), formattedRes, true);
2345
- };
2346
- this.updatePage = function (res) {
2347
- _this.offset += _this.limit;
2348
- if (!res.next) {
2349
- _this.isFinishPage = true;
2350
- }
2351
- _this.stopFetching();
2352
- };
2353
- this.clearOffset = function () {
2354
- _this.offset = 0;
2355
- _this.isFinishPage = false;
2356
- };
2357
- this.startFetching = function () {
2358
- _this.isFetching = true;
2359
- };
2360
- this.stopFetching = function () {
2361
- _this.isFetching = false;
2362
- };
2363
- this.refresh = function () {
2364
- _this.clearOffset();
2365
- _this.startFetching();
2366
- };
2367
- this.limit = limit;
2368
- this.offset = 0;
2369
- this.isFinishPage = false;
2370
- this.isFetching = isFetching;
2371
- mobx.makeAutoObservable(this);
2372
- }
2373
- return Paginator;
2374
- }());
2375
-
2376
- var SortingFilter = /** @class */ (function () {
2377
- function SortingFilter(orderBy, filterQuery, order) {
2378
- var _this = this;
2379
- this.updateSearchQuery = function (newQuery) {
2380
- _this.searchQuery = newQuery;
2381
- };
2382
- this.updateFilterQuery = function (newQuery) {
2383
- _this.filterQuery = newQuery || "";
2384
- };
2385
- this.setOrder = function (order) {
2386
- _this.order = order;
2387
- };
2388
- this.setOrderBy = function (orderBy) {
2389
- _this.orderBy = orderBy;
2390
- };
2391
- this.clearFilter = function () {
2392
- _this.searchQuery = "";
2393
- _this.filterQuery = "";
2394
- };
2395
- this.searchQuery = "";
2396
- this.filterQuery = filterQuery || "";
2397
- this.order = order || "asc";
2398
- this.orderBy = orderBy || "";
2399
- mobx.makeAutoObservable(this);
2400
- }
2401
- Object.defineProperty(SortingFilter.prototype, "searchParams", {
2402
- get: function () {
2403
- return this.searchQuery
2404
- ? "&search=".concat(encodeURIComponent(this.searchQuery))
2405
- : "";
2406
- },
2407
- enumerable: false,
2408
- configurable: true
2409
- });
2410
- Object.defineProperty(SortingFilter.prototype, "orderParams", {
2411
- get: function () {
2412
- if (this.orderBy) {
2413
- var order = this.order === "desc" ? "-" : "";
2414
- return "&ordering=".concat(order).concat(this.orderBy);
2415
- }
2416
- return "";
2417
- },
2418
- enumerable: false,
2419
- configurable: true
2420
- });
2421
- Object.defineProperty(SortingFilter.prototype, "filterParams", {
2422
- get: function () {
2423
- return "".concat(this.searchParams).concat(this.orderParams).concat(this.filterQuery);
2424
- },
2425
- enumerable: false,
2426
- configurable: true
2427
- });
2428
- return SortingFilter;
2429
- }());
2430
-
2431
- var MultistepForm = /** @class */ (function () {
2432
- function MultistepForm(defaultFields, associations) {
2433
- var _this = this;
2434
- this.setFormFields = function (fields) {
2435
- _this.fields = fields;
2436
- };
2437
- this.updateFormFields = function (fields) {
2438
- _this.fields = __assign(__assign({}, _this.fields), fields);
2439
- };
2440
- this.replaceFieldInArray = function (fieldName, newValue, index) {
2441
- if (!_this.fields)
2442
- _this.fields = {};
2443
- if (!_this.fields[fieldName])
2444
- _this.fields[fieldName] = [];
2445
- var currentValue = _this.fields[fieldName][index];
2446
- if (currentValue) {
2447
- _this.fields[fieldName] = _this.fields[fieldName].map(function (value, i) { return (index === i ? newValue : value); });
2448
- }
2449
- else {
2450
- _this.fields[fieldName].push(newValue);
2451
- }
2452
- };
2453
- this.addValueToField = function (valueName, value, fieldName) {
2454
- if (!_this.fields)
2455
- _this.fields = {};
2456
- var path = _this.getNestedField(fieldName);
2457
- path[valueName] = value;
2458
- };
2459
- this.getNestedField = function (fieldName) {
2460
- if (!_this.fields)
2461
- _this.fields = {};
2462
- var fieldParts = fieldName === null || fieldName === void 0 ? void 0 : fieldName.split(".");
2463
- if (fieldParts &&
2464
- !_this.fields[fieldParts[0]] &&
2465
- !Number.isNaN(Number(fieldParts[1]))) {
2466
- // @ts-ignore
2467
- _this.fields[fieldParts[0]] = [];
2468
- }
2469
- var path = _this.fields;
2470
- fieldParts === null || fieldParts === void 0 ? void 0 : fieldParts.forEach(function (part) {
2471
- path = path[part];
2472
- });
2473
- return path;
2474
- };
2475
- this.nextStep = function () {
2476
- _this.step += 1;
2477
- };
2478
- this.prevStep = function () {
2479
- if (_this.step !== 0) {
2480
- _this.step -= 1;
2481
- }
2482
- else {
2483
- throw new Error("You cannot go to the previous step, because you are already at the first step");
2484
- }
2485
- };
2486
- this.setStage = function (stage) {
2487
- if (_this.associations) {
2488
- _this.step = _this.associations.indexOf(stage) + 1;
2489
- }
2490
- };
2491
- this.setStep = function (step) {
2492
- _this.step = step;
2493
- };
2494
- this.resetForm = function () {
2495
- _this.fields = null;
2496
- _this.step = 1;
2497
- };
2498
- this.fields = defaultFields || null;
2499
- this.step = 1;
2500
- this.associations = associations;
2501
- mobx.makeAutoObservable(this);
2502
- }
2503
- Object.defineProperty(MultistepForm.prototype, "stage", {
2504
- get: function () {
2505
- var _a;
2506
- return ((_a = this.associations) === null || _a === void 0 ? void 0 : _a[this.step - 1]) || null;
2507
- },
2508
- enumerable: false,
2509
- configurable: true
2510
- });
2511
- return MultistepForm;
2512
- }());
2513
-
2514
- var Editor = /** @class */ (function () {
2515
- function Editor() {
2516
- var _this = this;
2517
- this.startEditing = function () {
2518
- _this.isEditing = true;
2519
- _this.blockToSendForm();
2520
- };
2521
- this.endEditing = function () {
2522
- _this.isEditing = false;
2523
- _this.blockToSendForm();
2524
- };
2525
- this.allowToSendForm = function () {
2526
- _this.isAllowedToSendForm = true;
2527
- };
2528
- this.blockToSendForm = function () {
2529
- _this.isAllowedToSendForm = false;
2530
- };
2531
- this.isEditing = false;
2532
- this.isAllowedToSendForm = false;
2533
- mobx.makeAutoObservable(this);
2534
- }
2535
- return Editor;
2536
- }());
2537
-
2538
- var phoneRegExp = /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/;
2539
- var isValidWithMaskExp = /^[^_]+$/;
2540
- var dateRegExp = /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/;
2541
- var monthYearRegExp = /(0[1-9]|1[012])[- /.](19|20)\d\d/;
2542
- var emailRegExp = /^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/;
2543
- var carNumberRegExp = /^([А-Яа-я]{1}[0-9]{3}[А-Яа-я]{2}\s{0,1}[0-9]{2,3})?$/;
2544
- var innRegExp = /^(([0-9]{12})|([0-9]{10}))?$/;
2545
- var corrAccountRegExp = /^(301[0-9]{17})?$/;
2546
- var accountRegExp = /^408([0-9]{17})?$/;
2547
- var bicRegExp = /^([0-9]{9})?$/;
2548
- var swiftRegExp = /^([A-Za-z]{6}\w{2}\d{0,3})?$/;
2549
- var simplePasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{10,}$/;
2550
- var mediumPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{12,}$/;
2551
- var strongPasswordRegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{14,}$/;
2552
-
2553
- exports.Editor = Editor;
2554
- exports.KUIUtilsSettings = kuiUtilsSettings;
2555
- exports.Loader = Loader;
2556
- exports.MultistepForm = MultistepForm;
2557
- exports.Paginator = Paginator;
2558
- exports.SortingFilter = SortingFilter;
2559
- exports.accountRegExp = accountRegExp;
2560
- exports.addIndexDBStore = addIndexDBStore;
2561
- exports.addLeadZero = addLeadZero;
2562
- exports.addToArrayByCondition = addToArrayByCondition;
2563
- exports.addToIndexDBWithQueue = addToIndexDBWithQueue;
2564
- exports.applyMask = applyMask;
2565
- exports.bicRegExp = bicRegExp;
2566
- exports.callPromises = callPromises;
2567
- exports.carNumberRegExp = carNumberRegExp;
2568
- exports.checkIsIOS = checkIsIOS;
2569
- exports.cleanEmptyFields = cleanEmptyFields;
2570
- exports.clearIndexStore = clearIndexStore;
2571
- exports.clearIndexStores = clearIndexStores;
2572
- exports.clearNotValidFields = clearNotValidFields;
2573
- exports.copyInfo = copyInfo;
2574
- exports.corrAccountRegExp = corrAccountRegExp;
2575
- exports.countries = countries;
2576
- exports.cropText = cropText;
2577
- exports.dateRegExp = dateRegExp;
2578
- exports.declineByNumber = declineByNumber;
2579
- exports.deleteCookie = deleteCookie;
2580
- exports.downloadFile = downloadFile;
2581
- exports.emailRegExp = emailRegExp;
2582
- exports.formatError = formatError;
2583
- exports.generateFormDataBody = generateFormDataBody;
2584
- exports.getChangedValue = getChangedValue;
2585
- exports.getCookie = getCookie;
2586
- exports.getFileNameFromFile = getFileNameFromFile;
2587
- exports.getFileNameFromUrl = getFileNameFromUrl;
2588
- exports.getNestedData = getNestedData;
2589
- exports.getPhoneNumberFromPhoneParams = getPhoneNumberFromPhoneParams;
2590
- exports.getPhoneParamsFromString = getPhoneParamsFromString;
2591
- exports.initIndexDB = initIndexDB;
2592
- exports.innRegExp = innRegExp;
2593
- exports.isValidWithMaskExp = isValidWithMaskExp;
2594
- exports.longPolling = longPolling;
2595
- exports.mediumPasswordRegExp = mediumPasswordRegExp;
2596
- exports.monthYearRegExp = monthYearRegExp;
2597
- exports.phoneRegExp = phoneRegExp;
2598
- exports.promisesWithCallback = promisesWithCallback;
2599
- exports.readFromIndexDB = readFromIndexDB;
2600
- exports.resHandler = resHandler;
2601
- exports.setCookie = setCookie;
2602
- exports.simplePasswordRegExp = simplePasswordRegExp;
2603
- exports.strongPasswordRegExp = strongPasswordRegExp;
2604
- exports.swiftRegExp = swiftRegExp;
2605
- exports.toNumber = toNumber;
2606
- exports.updateQueryParams = updateQueryParams;
2607
- exports.useDebounce = useDebounce;
2608
- exports.useForkRef = useForkRef;
2609
- exports.useTabIndex = useTabIndex;
2610
- exports.useToggle = useToggle;
2611
- exports.useWindowWidth = useWindowWidth;
2612
- //# sourceMappingURL=index.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("lodash"),a=require("react-router-dom"),o=require("await-to-js"),m=require("mobx"),s=require("luxon");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}})),n.default=e,Object.freeze(n)}var i=r(e),d=t(n),u=t(o);var c=function(e,n,a){if(!n)return e;for(var o=e.replace(/\D/g,""),m="",s=0,t=0;t<n.length;t+=1)"0"===n[t]?(m+=o[s],s+=1):0!==s&&(m+=a||n[t]);return m},C=function(){return C=Object.assign||function(e){for(var n,a=1,o=arguments.length;a<o;a++)for(var m in n=arguments[a])Object.prototype.hasOwnProperty.call(n,m)&&(e[m]=n[m]);return e},C.apply(this,arguments)};function p(e,n,a,o){return new(a||(a=Promise))((function(m,s){function t(e){try{i(o.next(e))}catch(e){s(e)}}function r(e){try{i(o.throw(e))}catch(e){s(e)}}function i(e){var n;e.done?m(e.value):(n=e.value,n instanceof a?n:new a((function(e){e(n)}))).then(t,r)}i((o=o.apply(e,n||[])).next())}))}function h(e,n){var a,o,m,s,t={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function r(s){return function(r){return function(s){if(a)throw new TypeError("Generator is already executing.");for(;t;)try{if(a=1,o&&(m=2&s[0]?o.return:s[0]?o.throw||((m=o.return)&&m.call(o),0):o.next)&&!(m=m.call(o,s[1])).done)return m;switch(o=0,m&&(s=[2&s[0],m.value]),s[0]){case 0:case 1:m=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,o=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(!(m=t.trys,(m=m.length>0&&m[m.length-1])||6!==s[0]&&2!==s[0])){t=0;continue}if(3===s[0]&&(!m||s[1]>m[0]&&s[1]<m[3])){t.label=s[1];break}if(6===s[0]&&t.label<m[1]){t.label=m[1],m=s;break}if(m&&t.label<m[2]){t.label=m[2],t.ops.push(s);break}m[2]&&t.ops.pop(),t.trys.pop();continue}s=n.call(e,t)}catch(e){s=[6,e],o=0}finally{a=m=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,r])}}}function l(e,n,a){if(a||2===arguments.length)for(var o,m=0,s=n.length;m<s;m++)!o&&m in n||(o||(o=Array.prototype.slice.call(n,0,m)),o[m]=n[m]);return e.concat(o||Array.prototype.slice.call(n))}var f=function(e,n){var a=e;return n.split(".").forEach((function(e){a&&(a=a[e])})),a},k=function(e,n){var a="".concat(e.slice(0,n),"..");return"".concat(e.length>n?a:e)},R=[2,0,1,1,1,2],g=function(e){return e&&"object"==typeof e?JSON.stringify(e):""},v=function(e,n,a){a&&a instanceof Blob||"string"==typeof a?e.append(n,a):e.append(n,JSON.stringify(a))},b=[{name:"Afghanistan (‫افغانستان‬‎)",nameCode:"af",nameRus:"Афганистан",phoneCode:"93",mask:"-00-000-0000"},{name:"Albania (Shqipëri)",nameCode:"al",nameRus:"Албания",phoneCode:"355",mask:"(000)000-000"},{name:"Algeria (‫الجزائر‬‎)",nameCode:"dz",nameRus:"Алжир",phoneCode:"213",mask:"-00-000-0000"},{name:"American Samoa",nameCode:"as",nameRus:"Американское Самоа",phoneCode:"1684",mask:"0)000-0000"},{name:"Andorra",nameCode:"ad",nameRus:"Андорра",phoneCode:"376",mask:"-000-000"},{name:"Angola",nameCode:"ao",nameRus:"Ангола",phoneCode:"244",mask:"(000)000-000"},{name:"Anguilla",nameCode:"ai",nameRus:"Ангилья",phoneCode:"1264",mask:"0)000-0000"},{name:"Antigua and Barbuda",nameCode:"ag",nameRus:"Антигуа и Барбуда",phoneCode:"1268",mask:"0)000-0000"},{name:"Argentina",nameCode:"ar",nameRus:"Аргентина",phoneCode:"54",mask:"(000)000-0000"},{name:"Armenia (Հայաստան)",nameCode:"am",nameRus:"Армения",phoneCode:"374",mask:"-00-000-000"},{name:"Aruba",nameCode:"aw",nameRus:"Аруба",phoneCode:"297",mask:"-000-0000"},{name:"Australia",nameCode:"au",nameRus:"Австралия",phoneCode:"61",mask:"000000000"},{name:"Austria (Österreich)",nameCode:"at",nameRus:"Австрия",phoneCode:"43",mask:"(000)000-0000"},{name:"Azerbaijan (Azərbaycan)",nameCode:"az",nameRus:"Азербайджан",phoneCode:"994",mask:"-00-000-00-00"},{name:"Bahamas",nameCode:"bs",nameRus:"Багамы",phoneCode:"1242",mask:"0)000-0000"},{name:"Bahrain (‫البحرين‬‎)",nameCode:"bh",nameRus:"Бахрейн",phoneCode:"973",mask:"-0000-0000"},{name:"Bangladesh (বাংলাদেশ)",nameCode:"bd",nameRus:"Бангладеш",phoneCode:"880",mask:"-00-000-000"},{name:"Barbados",nameCode:"bb",nameRus:"Барбадос",phoneCode:"1246",mask:"0)000-0000"},{name:"Belarus (Беларусь)",nameCode:"by",nameRus:"Беларусь",phoneCode:"375",mask:"(00)000-00-00"},{name:"Belgium (België)",nameCode:"be",nameRus:"Бельгия",phoneCode:"32",mask:"000000000"},{name:"Belize",nameCode:"bz",nameRus:"Белиз",phoneCode:"501",mask:"-000-0000"},{name:"Benin (Bénin)",nameCode:"bj",nameRus:"Бенин",phoneCode:"229",mask:"-00-00-0000"},{name:"Bermuda",nameCode:"bm",nameRus:"Бермудские о-ва",phoneCode:"1441",mask:"0)000-0000"},{name:"Bhutan (འབྲུག)",nameCode:"bt",nameRus:"Бутан",phoneCode:"975",mask:"-0-000-000"},{name:"Bolivia",nameCode:"bo",nameRus:"Боливия",phoneCode:"591",mask:"-0-000-0000"},{name:"Bosnia and Herzegovina (Босна и Херцеговина)",nameCode:"ba",nameRus:"Босния и Герцеговина",phoneCode:"387",mask:"-00-0000"},{name:"Botswana",nameCode:"bw",nameRus:"Ботсвана",phoneCode:"267",mask:"-00-000-000"},{name:"Brazil (Brasil)",nameCode:"br",nameRus:"Бразилия",phoneCode:"55",mask:"-00-0000-0000"},{name:"British Indian Ocean Territory",nameCode:"io",nameRus:"Британская территория в Индийском океане",phoneCode:"246",mask:"-000-0000"},{name:"British Virgin Islands",nameCode:"vg",nameRus:"Виргинские о-ва (Великобритания)",phoneCode:"1284",mask:"0)000-0000"},{name:"Brunei",nameCode:"bn",nameRus:"Бруней-Даруссалам",phoneCode:"673",mask:"-000-0000"},{name:"Bulgaria (България)",nameCode:"bg",nameRus:"Болгария",phoneCode:"359",mask:"(000)000-000"},{name:"Burkina Faso",nameCode:"bf",nameRus:"Буркина-Фасо",phoneCode:"226",mask:"-00-00-0000"},{name:"Burundi (Uburundi)",nameCode:"bi",nameRus:"Бурунди",phoneCode:"257",mask:"-00-00-0000"},{name:"Cambodia (កម្ពុជា)",nameCode:"kh",nameRus:"Камбоджа",phoneCode:"855",mask:"-00-000-000"},{name:"Cameroon (Cameroun)",nameCode:"cm",nameRus:"Камерун",phoneCode:"237",mask:"-0000-0000"},{name:"Canada",nameCode:"ca",nameRus:"Канада",phoneCode:"1",mask:"(000)000-0000"},{name:"Cape Verde (Kabu Verdi)",nameCode:"cv",nameRus:"Кабо-Верде",phoneCode:"238",mask:"(000)00-00"},{name:"Caribbean Netherlands",nameCode:"bq",nameRus:"Бонэйр, Синт-Эстатиус и Саба",phoneCode:"599",mask:"-000-0000"},{name:"Cayman Islands",nameCode:"ky",nameRus:"Острова Кайман",phoneCode:"1345",mask:"0)000-0000"},{name:"Central African Republic (République centrafricaine)",nameCode:"cf",nameRus:"Центрально-Африканская Республика",phoneCode:"236",mask:"-00-00-0000"},{name:"Chad (Tchad)",nameCode:"td",nameRus:"Чад",phoneCode:"235",mask:"-00-00-00-00"},{name:"Chile",nameCode:"cl",nameRus:"Чили",phoneCode:"56",mask:"-0-0000-0000"},{name:"China (中国)",nameCode:"cn",nameRus:"Китай",phoneCode:"86",mask:"00-00000000"},{name:"Colombia",nameCode:"co",nameRus:"Колумбия",phoneCode:"57",mask:"(000)000-0000"},{name:"Comoros (‫جزر القمر‬‎)",nameCode:"km",nameRus:"Коморы",phoneCode:"269",mask:"-00-00000"},{name:"Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)",nameCode:"cd",nameRus:"Конго - Киншаса",phoneCode:"243",mask:"(000)000-000"},{name:"Congo (Republic) (Congo-Brazzaville)",nameCode:"cg",nameRus:"Конго - Браззавиль",phoneCode:"242",mask:"-00-000-0000"},{name:"Cook Islands",nameCode:"ck",nameRus:"Острова Кука",phoneCode:"682",mask:"-00-000"},{name:"Costa Rica",nameCode:"cr",nameRus:"Коста-Рика",phoneCode:"506",mask:"0000-0000"},{name:"Côte d’Ivoire",nameCode:"ci",nameRus:"Кот-д’Ивуар",phoneCode:"225",mask:"-00-000-000"},{name:"Croatia (Hrvatska)",nameCode:"hr",nameRus:"Хорватия",phoneCode:"385",mask:"-00-000-0000"},{name:"Cuba",nameCode:"cu",nameRus:"Куба",phoneCode:"53",mask:"-0-000-0000"},{name:"Curaçao",nameCode:"cw",nameRus:"Кюрасао",phoneCode:"599",mask:"-000-0000"},{name:"Cyprus (Κύπρος)",nameCode:"cy",nameRus:"Кипр",phoneCode:"357",mask:"-00-000-000"},{name:"Czech Republic (Česká republika)",nameCode:"cz",nameRus:"Чехия",phoneCode:"420",mask:"(000)000-000"},{name:"Denmark (Danmark)",nameCode:"dk",nameRus:"Дания",phoneCode:"45",mask:"00000000"},{name:"Djibouti",nameCode:"dj",nameRus:"Джибути",phoneCode:"253",mask:"-00-00-00-00"},{name:"Dominica",nameCode:"dm",nameRus:"Доминика",phoneCode:"1767",mask:"0)000-0000"},{name:"Dominican Republic (República Dominicana)",nameCode:"do",nameRus:"Доминиканская Республика",phoneCode:"1",mask:"(000)000-0000"},{name:"Ecuador",nameCode:"ec",nameRus:"Эквадор",phoneCode:"593",mask:"-0-000-0000"},{name:"Egypt (‫مصر‬‎)",nameCode:"eg",nameRus:"Египет",phoneCode:"20",mask:"(000)000-0000"},{name:"El Salvador",nameCode:"sv",nameRus:"Сальвадор",phoneCode:"503",mask:"0000-0000"},{name:"Equatorial Guinea (Guinea Ecuatorial)",nameCode:"gq",nameRus:"Экваториальная Гвинея",phoneCode:"240",mask:"-00-000-0000"},{name:"Eritrea",nameCode:"er",nameRus:"Эритрея",phoneCode:"291",mask:"-0-000-000"},{name:"Estonia (Eesti)",nameCode:"ee",nameRus:"Эстония",phoneCode:"372",mask:"-000-0000"},{name:"Ethiopia",nameCode:"et",nameRus:"Эфиопия",phoneCode:"251",mask:"-00-000-0000"},{name:"Falkland Islands (Islas Malvinas)",nameCode:"fk",nameRus:"Фолклендские о-ва",phoneCode:"500",mask:"-00000"},{name:"Faroe Islands (Føroyar)",nameCode:"fo",nameRus:"Фарерские о-ва",phoneCode:"298",mask:"-000-000"},{name:"Fiji",nameCode:"fj",nameRus:"Фиджи",phoneCode:"679",mask:"-00-00000"},{name:"Finland (Suomi)",nameCode:"fi",nameRus:"Финляндия",phoneCode:"358",mask:"0000000000"},{name:"France",nameCode:"fr",nameRus:"Франция",phoneCode:"33",mask:"000000000"},{name:"French Guiana (Guyane française)",nameCode:"gf",nameRus:"Французская Гвиана",phoneCode:"594",mask:"-00000-0000"},{name:"French Polynesia (Polynésie française)",nameCode:"pf",nameRus:"Французская Полинезия",phoneCode:"689",mask:"-00-00-00"},{name:"Gabon",nameCode:"ga",nameRus:"Габон",phoneCode:"241",mask:"-0-00-00-00"},{name:"Gambia",nameCode:"gm",nameRus:"Гамбия",phoneCode:"220",mask:"(000)00-00"},{name:"Georgia (საქართველო)",nameCode:"ge",nameRus:"Грузия",phoneCode:"995",mask:"(000)000-000"},{name:"Germany (Deutschland)",nameCode:"de",nameRus:"Германия",phoneCode:"49",mask:"0000000000"},{name:"Ghana (Gaana)",nameCode:"gh",nameRus:"Гана",phoneCode:"233",mask:"(000)000-000"},{name:"Gibraltar",nameCode:"gi",nameRus:"Гибралтар",phoneCode:"350",mask:"-000-00000"},{name:"Greece (Ελλάδα)",nameCode:"gr",nameRus:"Греция",phoneCode:"30",mask:"(000)000-0000"},{name:"Greenland (Kalaallit Nunaat)",nameCode:"gl",nameRus:"Гренландия",phoneCode:"299",mask:"-00-00-00"},{name:"Grenada",nameCode:"gd",nameRus:"Гренада",phoneCode:"1473",mask:"0)000-0000"},{name:"Guam",nameCode:"gu",nameRus:"Гуам",phoneCode:"1671",mask:"0)000-0000"},{name:"Guatemala",nameCode:"gt",nameRus:"Гватемала",phoneCode:"502",mask:"0000-0000"},{name:"Guinea (Guinée)",nameCode:"gn",nameRus:"Гвинея",phoneCode:"224",mask:"-00-000-000"},{name:"Guinea-Bissau (Guiné Bissau)",nameCode:"gw",nameRus:"Гвинея-Бисау",phoneCode:"245",mask:"-0-000000"},{name:"Guyana",nameCode:"gy",nameRus:"Гайана",phoneCode:"592",mask:"-000-0000"},{name:"Haiti",nameCode:"ht",nameRus:"Гаити",phoneCode:"509",mask:"0000-0000"},{name:"Honduras",nameCode:"hn",nameRus:"Гондурас",phoneCode:"504",mask:"-0000-0000"},{name:"Hong Kong (香港)",nameCode:"hk",nameRus:"Гонконг (САР)",phoneCode:"852",mask:"00000000"},{name:"Hungary (Magyarország)",nameCode:"hu",nameRus:"Венгрия",phoneCode:"36",mask:"(000)000-000"},{name:"Iceland (Ísland)",nameCode:"is",nameRus:"Исландия",phoneCode:"354",mask:"0000000"},{name:"India (भारत)",nameCode:"in",nameRus:"Индия",phoneCode:"91",mask:"00000-00000"},{name:"Indonesia",nameCode:"id",nameRus:"Индонезия",phoneCode:"62",mask:"-00-000-00"},{name:"Iran (‫ایران‬‎)",nameCode:"ir",nameRus:"Иран",phoneCode:"98",mask:"(000)000-0000"},{name:"Iraq (‫العراق‬‎)",nameCode:"iq",nameRus:"Ирак",phoneCode:"964",mask:"(000)000-0000"},{name:"Ireland",nameCode:"ie",nameRus:"Ирландия",phoneCode:"353",mask:"000000000"},{name:"Israel (‫ישראל‬‎)",nameCode:"il",nameRus:"Израиль",phoneCode:"972",mask:"-0-000-0000"},{name:"Italy (Italia)",nameCode:"it",nameRus:"Италия",phoneCode:"39",mask:"000000000"},{name:"Jamaica",nameCode:"jm",nameRus:"Ямайка",phoneCode:"1876",mask:"0)000-0000"},{name:"Japan (日本)",nameCode:"jp",nameRus:"Япония",phoneCode:"81",mask:"000000000"},{name:"Jordan (‫الأردن‬‎)",nameCode:"jo",nameRus:"Иордания",phoneCode:"962",mask:"-0-0000-0000"},{name:"Kazakhstan (Казахстан)",nameCode:"kz",nameRus:"Казахстан",phoneCode:"7",mask:"000-000-00-00"},{name:"Kenya",nameCode:"ke",nameRus:"Кения",phoneCode:"254",mask:"-000-000000"},{name:"Kiribati",nameCode:"ki",nameRus:"Кирибати",phoneCode:"686",mask:"-00-000"},{name:"Kuwait (‫الكويت‬‎)",nameCode:"kw",nameRus:"Кувейт",phoneCode:"965",mask:"-0000-0000"},{name:"Kyrgyzstan (Кыргызстан)",nameCode:"kg",nameRus:"Киргизия",phoneCode:"996",mask:"(000)000-000"},{name:"Laos (ລາວ)",nameCode:"la",nameRus:"Лаос",phoneCode:"856",mask:"-00-000-000"},{name:"Latvia (Latvija)",nameCode:"lv",nameRus:"Латвия",phoneCode:"371",mask:"-00-000-000"},{name:"Lebanon (‫لبنان‬‎)",nameCode:"lb",nameRus:"Ливан",phoneCode:"961",mask:"-0-000-000"},{name:"Lesotho",nameCode:"ls",nameRus:"Лесото",phoneCode:"266",mask:"-0-000-0000"},{name:"Liberia",nameCode:"lr",nameRus:"Либерия",phoneCode:"231",mask:"-00-000-000"},{name:"Libya (‫ليبيا‬‎)",nameCode:"ly",nameRus:"Ливия",phoneCode:"218",mask:"-00-000-000"},{name:"Liechtenstein",nameCode:"li",nameRus:"Лихтенштейн",phoneCode:"423",mask:"(000)000-0000"},{name:"Lithuania (Lietuva)",nameCode:"lt",nameRus:"Литва",phoneCode:"370",mask:"(000)00-000"},{name:"Luxembourg",nameCode:"lu",nameRus:"Люксембург",phoneCode:"352",mask:"(000)000-000"},{name:"Macau (澳門)",nameCode:"mo",nameRus:"Макао (САР)",phoneCode:"853",mask:"-0000-0000"},{name:"Macedonia (FYROM) (Македонија)",nameCode:"mk",nameRus:"Северная Македония",phoneCode:"389",mask:"-00-000-000"},{name:"Madagascar (Madagasikara)",nameCode:"mg",nameRus:"Мадагаскар",phoneCode:"261",mask:"-00-00-00000"},{name:"Malawi",nameCode:"mw",nameRus:"Малави",phoneCode:"265",mask:"-0-0000-0000"},{name:"Malaysia",nameCode:"my",nameRus:"Малайзия",phoneCode:"60",mask:"00-0000-0000"},{name:"Maldives",nameCode:"mv",nameRus:"Мальдивы",phoneCode:"960",mask:"-000-0000"},{name:"Mali",nameCode:"ml",nameRus:"Мали",phoneCode:"223",mask:"-00-00-0000"},{name:"Malta",nameCode:"mt",nameRus:"Мальта",phoneCode:"356",mask:"-0000-0000"},{name:"Marshall Islands",nameCode:"mh",nameRus:"Маршалловы Острова",phoneCode:"692",mask:"-000-0000"},{name:"Martinique",nameCode:"mq",nameRus:"Мартиника",phoneCode:"596",mask:"(000)00-00-00"},{name:"Mauritania (‫موريتانيا‬‎)",nameCode:"mr",nameRus:"Мавритания",phoneCode:"222",mask:"-00-00-0000"},{name:"Mauritius (Moris)",nameCode:"mu",nameRus:"Маврикий",phoneCode:"230",mask:"-000-0000"},{name:"Mexico (México)",nameCode:"mx",nameRus:"Мексика",phoneCode:"52",mask:"-00-00-0000"},{name:"Micronesia",nameCode:"fm",nameRus:"Федеративные Штаты Микронезии",phoneCode:"691",mask:"-000-0000"},{name:"Moldova (Republica Moldova)",nameCode:"md",nameRus:"Молдова",phoneCode:"373",mask:"-0000-0000"},{name:"Monaco",nameCode:"mc",nameRus:"Монако",phoneCode:"377",mask:"-00-000-000"},{name:"Mongolia (Монгол)",nameCode:"mn",nameRus:"Монголия",phoneCode:"976",mask:"-00-00-0000"},{name:"Montenegro (Crna Gora)",nameCode:"me",nameRus:"Черногория",phoneCode:"382",mask:"-00-000-000"},{name:"Montserrat",nameCode:"ms",nameRus:"Монтсеррат",phoneCode:"1664",mask:"0)000-0000"},{name:"Morocco (‫المغرب‬‎)",nameCode:"ma",nameRus:"Марокко",phoneCode:"212",mask:"-00-0000-000"},{name:"Mozambique (Moçambique)",nameCode:"mz",nameRus:"Мозамбик",phoneCode:"258",mask:"-00-000-000"},{name:"Myanmar (Burma) (မြန်မာ)",nameCode:"mm",nameRus:"Мьянма (Бирма)",phoneCode:"95",mask:"-000-000"},{name:"Namibia (Namibië)",nameCode:"na",nameRus:"Намибия",phoneCode:"264",mask:"-00-000-0000"},{name:"Nauru",nameCode:"nr",nameRus:"Науру",phoneCode:"674",mask:"-000-0000"},{name:"Nepal (नेपाल)",nameCode:"np",nameRus:"Непал",phoneCode:"977",mask:"-00-000-000"},{name:"Netherlands (Nederland)",nameCode:"nl",nameRus:"Нидерланды",phoneCode:"31",mask:"0000000000"},{name:"New Caledonia (Nouvelle-Calédonie)",nameCode:"nc",nameRus:"Новая Каледония",phoneCode:"687",mask:"-00-0000"},{name:"New Zealand",nameCode:"nz",nameRus:"Новая Зеландия",phoneCode:"64",mask:"000-000-0000"},{name:"Nicaragua",nameCode:"ni",nameRus:"Никарагуа",phoneCode:"505",mask:"-0000-0000"},{name:"Niger (Nijar)",nameCode:"ne",nameRus:"Нигер",phoneCode:"227",mask:"-00-00-0000"},{name:"Nigeria",nameCode:"ng",nameRus:"Нигерия",phoneCode:"234",mask:"-00-000-00"},{name:"Niue",nameCode:"nu",nameRus:"Ниуэ",phoneCode:"683",mask:"-0000"},{name:"Norfolk Island",nameCode:"nf",nameRus:"о-в Норфолк",phoneCode:"672",mask:"-000-000"},{name:"North Korea (조선 민주주의 인민 공화국)",nameCode:"kp",nameRus:"КНДР",phoneCode:"850",mask:"-000-000"},{name:"Northern Mariana Islands",nameCode:"mp",nameRus:"Северные Марианские о-ва",phoneCode:"1670",mask:"0)000-0000"},{name:"Norway (Norge)",nameCode:"no",nameRus:"Норвегия",phoneCode:"47",mask:"00000000"},{name:"Oman (‫عُمان‬‎)",nameCode:"om",nameRus:"Оман",phoneCode:"968",mask:"-00-000-000"},{name:"Pakistan (‫پاکستان‬‎)",nameCode:"pk",nameRus:"Пакистан",phoneCode:"92",mask:"000-0000000"},{name:"Palau",nameCode:"pw",nameRus:"Палау",phoneCode:"680",mask:"-000-0000"},{name:"Palestine (‫فلسطين‬‎)",nameCode:"ps",nameRus:"Палестинские территории",phoneCode:"970",mask:"-00-000-0000"},{name:"Panama (Panamá)",nameCode:"pa",nameRus:"Панама",phoneCode:"507",mask:"-000-0000"},{name:"Papua New Guinea",nameCode:"pg",nameRus:"Папуа — Новая Гвинея",phoneCode:"675",mask:"(000)00-000"},{name:"Paraguay",nameCode:"py",nameRus:"Парагвай",phoneCode:"595",mask:"(000)000-000"},{name:"Peru (Perú)",nameCode:"pe",nameRus:"Перу",phoneCode:"51",mask:"(000)000-000"},{name:"Philippines",nameCode:"ph",nameRus:"Филиппины",phoneCode:"63",mask:"0000000"},{name:"Poland (Polska)",nameCode:"pl",nameRus:"Польша",phoneCode:"48",mask:"000-000-000"},{name:"Portugal",nameCode:"pt",nameRus:"Португалия",phoneCode:"351",mask:"-00-000-0000"},{name:"Puerto Rico",nameCode:"pr",nameRus:"Пуэрто-Рико",phoneCode:"1",mask:"(000)000-0000"},{name:"Qatar (‫قطر‬‎)",nameCode:"qa",nameRus:"Катар",phoneCode:"974",mask:"-0000-0000"},{name:"Réunion (La Réunion)",nameCode:"re",nameRus:"Реюньон",phoneCode:"262",mask:"-00000-0000"},{name:"Romania (România)",nameCode:"ro",nameRus:"Румыния",phoneCode:"40",mask:"-00-000-0000"},{name:"Russia (Россия)",nameCode:"ru",nameRus:"Россия",phoneCode:"7",mask:"000-000-00-00"},{name:"Rwanda",nameCode:"rw",nameRus:"Руанда",phoneCode:"250",mask:"(000)000-000"},{name:"Saint Helena",nameCode:"sh",nameRus:"о-в Св. Елены",phoneCode:"290",mask:!1},{name:"Saint Kitts and Nevis",nameCode:"kn",nameRus:"Сент-Китс и Невис",phoneCode:"1869",mask:"0)000-0000"},{name:"Saint Lucia",nameCode:"lc",nameRus:"Сент-Люсия",phoneCode:"1758",mask:"0)000-0000"},{name:"Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)",nameCode:"pm",nameRus:"Сен-Пьер и Микелон",phoneCode:"508",mask:!1},{name:"Saint Vincent and the Grenadines",nameCode:"vc",nameRus:"Сент-Винсент и Гренадины",phoneCode:"1784",mask:"0)000-0000"},{name:"Samoa",nameCode:"ws",nameRus:"Самоа",phoneCode:"685",mask:"-00-0000"},{name:"San Marino",nameCode:"sm",nameRus:"Сан-Марино",phoneCode:"378",mask:"-0000-000000"},{name:"São Tomé and Príncipe (São Tomé e Príncipe)",nameCode:"st",nameRus:"Сан-Томе и Принсипи",phoneCode:"239",mask:"-00-00000"},{name:"Saudi Arabia (‫المملكة العربية السعودية‬‎)",nameCode:"sa",nameRus:"Саудовская Аравия",phoneCode:"966",mask:"-0-000-0000"},{name:"Senegal (Sénégal)",nameCode:"sn",nameRus:"Сенегал",phoneCode:"221",mask:"-00-000-0000"},{name:"Serbia (Србија)",nameCode:"rs",nameRus:"Сербия",phoneCode:"381",mask:"-00-000-0000"},{name:"Seychelles",nameCode:"sc",nameRus:"Сейшельские Острова",phoneCode:"248",mask:"-0-000-000"},{name:"Sierra Leone",nameCode:"sl",nameRus:"Сьерра-Леоне",phoneCode:"232",mask:"-00-000000"},{name:"Singapore",nameCode:"sg",nameRus:"Сингапур",phoneCode:"65",mask:"0000-0000"},{name:"Sint Maarten",nameCode:"sx",nameRus:"Синт-Мартен",phoneCode:"1721",mask:"0)000-0000"},{name:"Slovakia (Slovensko)",nameCode:"sk",nameRus:"Словакия",phoneCode:"421",mask:"(000)000-000"},{name:"Slovenia (Slovenija)",nameCode:"si",nameRus:"Словения",phoneCode:"386",mask:"-00-000-000"},{name:"Solomon Islands",nameCode:"sb",nameRus:"Соломоновы Острова",phoneCode:"677",mask:"-00000"},{name:"Somalia (Soomaaliya)",nameCode:"so",nameRus:"Сомали",phoneCode:"252",mask:"-0-000-000"},{name:"South Africa",nameCode:"za",nameRus:"Южно-Африканская Республика",phoneCode:"27",mask:"-00-000-0000"},{name:"South Korea (대한민국)",nameCode:"kr",nameRus:"Республика Корея",phoneCode:"82",mask:"-00-000-0000"},{name:"South Sudan (‫جنوب السودان‬‎)",nameCode:"ss",nameRus:"Южный Судан",phoneCode:"211",mask:"-00-000-0000"},{name:"Spain (España)",nameCode:"es",nameRus:"Испания",phoneCode:"34",mask:"000000000"},{name:"Sri Lanka (ශ්‍රී ලංකාව)",nameCode:"lk",nameRus:"Шри-Ланка",phoneCode:"94",mask:"-00-000-0000"},{name:"Sudan (‫السودان‬‎)",nameCode:"sd",nameRus:"Судан",phoneCode:"249",mask:"-00-000-0000"},{name:"Suriname",nameCode:"sr",nameRus:"Суринам",phoneCode:"597",mask:"-000-000"},{name:"Swaziland",nameCode:"sz",nameRus:"Эсватини",phoneCode:"268",mask:"-00-00-0000"},{name:"Sweden (Sverige)",nameCode:"se",nameRus:"Швеция",phoneCode:"46",mask:"000000000"},{name:"Switzerland (Schweiz)",nameCode:"ch",nameRus:"Швейцария",phoneCode:"41",mask:"000000000"},{name:"Syria (‫سوريا‬‎)",nameCode:"sy",nameRus:"Сирия",phoneCode:"963",mask:"-00-0000-000"},{name:"Taiwan (台灣)",nameCode:"tw",nameRus:"Тайвань",phoneCode:"886",mask:"-0000-0000"},{name:"Tajikistan",nameCode:"tj",nameRus:"Таджикистан",phoneCode:"992",mask:"-00-000-0000"},{name:"Tanzania",nameCode:"tz",nameRus:"Танзания",phoneCode:"255",mask:"-00-000-0000"},{name:"Thailand (ไทย)",nameCode:"th",nameRus:"Таиланд",phoneCode:"66",mask:"-00-000-000"},{name:"Timor-Leste",nameCode:"tl",nameRus:"Восточный Тимор",phoneCode:"670",mask:"-000-0000"},{name:"Togo",nameCode:"tg",nameRus:"Того",phoneCode:"228",mask:"-00-000-000"},{name:"Tokelau",nameCode:"tk",nameRus:"Токелау",phoneCode:"600",mask:"-0000"},{name:"Tonga",nameCode:"to",nameRus:"Тонга",phoneCode:"676",mask:"-00000"},{name:"Trinidad and Tobago",nameCode:"tt",nameRus:"Тринидад и Тобаго",phoneCode:"1868",mask:"0)000-0000"},{name:"Tunisia (‫تونس‬‎)",nameCode:"tn",nameRus:"Тунис",phoneCode:"216",mask:"-00-000-000"},{name:"Turkey (Türkiye)",nameCode:"tr",nameRus:"Турция",phoneCode:"90",mask:"0000000000"},{name:"Turkmenistan",nameCode:"tm",nameRus:"Туркменистан",phoneCode:"993",mask:"-0-000-0000"},{name:"Turks and Caicos Islands",nameCode:"tc",nameRus:"о-ва Тёркс и Кайкос",phoneCode:"1649",mask:"0)000-0000"},{name:"Tuvalu",nameCode:"tv",nameRus:"Тувалу",phoneCode:"688",mask:"-00000"},{name:"U.S. Virgin Islands",nameCode:"vi",nameRus:"Виргинские о-ва (США)",phoneCode:"1340",mask:"0)000-0000"},{name:"Uganda",nameCode:"ug",nameRus:"Уганда",phoneCode:"256",mask:"(000)000-000"},{name:"Ukraine (Україна)",nameCode:"ua",nameRus:"Украина",phoneCode:"380",mask:"(00)000-00-00"},{name:"United Arab Emirates (‫الإمارات العربية المتحدة‬‎)",nameCode:"ae",nameRus:"ОАЭ",phoneCode:"971",mask:"-0-000-0000"},{name:"United Kingdom",nameCode:"gb",nameRus:"Великобритания",phoneCode:"44",mask:"0000000000"},{name:"United States",nameCode:"us",nameRus:"Соединенные Штаты",phoneCode:"1",mask:"(000)000-0000"},{name:"Uruguay",nameCode:"uy",nameRus:"Уругвай",phoneCode:"598",mask:"-0-000-00-00"},{name:"Uzbekistan (Oʻzbekiston)",nameCode:"uz",nameRus:"Узбекистан",phoneCode:"998",mask:"-00-000-0000"},{name:"Vanuatu",nameCode:"vu",nameRus:"Вануату",phoneCode:"678",mask:"-00000"},{name:"Vatican City (Città del Vaticano)",nameCode:"va",nameRus:"Ватикан",phoneCode:"39",mask:"0000000000"},{name:"Venezuela",nameCode:"ve",nameRus:"Венесуэла",phoneCode:"58",mask:"(000)000-0000"},{name:"Vietnam (Việt Nam)",nameCode:"vn",nameRus:"Вьетнам",phoneCode:"84",mask:"-00-0000-000"},{name:"Wallis and Futuna",nameCode:"wf",nameRus:"Уоллис и Футуна",phoneCode:"681",mask:"-00-0000"},{name:"Western Sahara",nameCode:"eh",nameRus:"Западная Сахара",phoneCode:"212",mask:"-00-0000"},{name:"Yemen (‫اليمن‬‎)",nameCode:"ye",nameRus:"Йемен",phoneCode:"967",mask:"-0-000-000"},{name:"Zambia",nameCode:"zm",nameRus:"Замбия",phoneCode:"260",mask:"-00-000-0000"},{name:"Zimbabwe",nameCode:"zw",nameRus:"Зимбабве",phoneCode:"263",mask:"-0-000000"}],y=function(e,n,a,o){return p(void 0,void 0,void 0,(function(){var m,s,t;return h(this,(function(r){switch(r.label){case 0:return[4,u.default(e())];case 1:return m=r.sent(),s=m[0],t=m[1],s?(n(s),[2,null]):a(t)?[2,t]:[4,new Promise((function(e){setTimeout(e,o)}))];case 2:return r.sent(),[2,y(e,n,a,o)]}}))}))};function x(e){if(void 0===e)return null;if(e instanceof File)return e;if(e instanceof s.DateTime)return e.toISO();if(m.isObservable(e))return x(m.toJS(e));if(Array.isArray(e))return e.map((function(e){return x(e)}));if(null!==e&&"object"==typeof e){var n={};for(var a in e)if(e.hasOwnProperty(a)){var o=e[a];"function"!=typeof o&&void 0!==o&&(n[a]=x(o))}return n}return e}var S=Promise.resolve(),w=function(e,n){var a=F.getSettings().Sentry;e&&(null==a||a.captureException(e)),n&&(null==a||a.captureMessage(JSON.stringify(n)))};var E=function(e,n){if(e){var a=e.transaction(n,"readwrite");a.onerror=function(){var e=a.error;w(e,"Ошибка создания транзакции: ".concat(n))};var o=a.objectStore(n).clear();o.onerror=function(){var e=o.error;w(e,"Ошибка очистки objectStore: ".concat(n))}}};function P(e,n,a){void 0===a&&(a={});var o=C({path:"/"},a),m="".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n));Object.keys(o).forEach((function(e){var n=o[e];m+="; ".concat(e),m+="=".concat(n)})),document.cookie=m}var F=new function(){var e=this;this.getSettings=function(){return C({},e.settings)},this.setSettings=function(n){e.settings=C(C({},e.settings),n),e.observers.forEach((function(n){return n(e.settings)}))},this.subscribeToSettings=function(n){e.observers.push(n)},this.unsubscribeFromSettings=function(n){var a=e.observers.indexOf(n);-1!==a&&e.observers.splice(a,1)},this.settings={},this.observers=[],this.id=100*Math.random()},j=function(e,n){var a=this;this.startLoading=function(e,n){var o=F.getSettings().runMode;a.isLoading=!0,a.loadingMessage=e,"test"!==o&&(a.timeBeforeLoading=(new Date).getTime()),n||a.cleanError()},this.endLoading=function(){return"test"===F.getSettings().runMode?(a.isLoading=!1,null):(a.timeAfterLoading=(new Date).getTime(),a.timeAfterLoading-a.timeBeforeLoading<a.delayTime?new Promise((function(e){return setTimeout((function(){m.runInAction((function(){a.isLoading=!1})),e(!0)}),a.delayTime-(a.timeAfterLoading-a.timeBeforeLoading))})):(a.isLoading=!1,a.loadingMessage="",null))},this.setError=function(e,n){a.hasError=!0,a.status=null==n?void 0:n.status,403===(null==n?void 0:n.status)?a.errorMessage="You do not have access to this":a.errorMessage="".concat(e||"request").concat(n?": \n".concat(g(n)):""),a.error=n},this.cleanError=function(){a.hasError=!1,a.errorMessage="",a.error=null,a.status=null},this.isLoading=!!e,this.hasError=!1,this.timeBeforeLoading=0,this.timeAfterLoading=0,this.delayTime=n||600,this.errorMessage="",this.error=null,m.makeAutoObservable(this)},M=function(e,n){void 0===e&&(e=25),void 0===n&&(n=!0);var a=this;this.getPageResponse=function(e,n,o){a.updatePage(e);var m=e.results.map((function(e){return o(e)}));return a.offset===a.limit?m:l(l([],n,!0),m,!0)},this.updatePage=function(e){a.offset+=a.limit,e.next||(a.isFinishPage=!0),a.stopFetching()},this.clearOffset=function(){a.offset=0,a.isFinishPage=!1},this.startFetching=function(){a.isFetching=!0},this.stopFetching=function(){a.isFetching=!1},this.refresh=function(){a.clearOffset(),a.startFetching()},this.limit=e,this.offset=0,this.isFinishPage=!1,this.isFetching=n,m.makeAutoObservable(this)},A=function(){function e(e,n,a){var o=this;this.updateSearchQuery=function(e){o.searchQuery=e},this.updateFilterQuery=function(e){o.filterQuery=e||""},this.setOrder=function(e){o.order=e},this.setOrderBy=function(e){o.orderBy=e},this.clearFilter=function(){o.searchQuery="",o.filterQuery=""},this.searchQuery="",this.filterQuery=n||"",this.order=a||"asc",this.orderBy=e||"",m.makeAutoObservable(this)}return Object.defineProperty(e.prototype,"searchParams",{get:function(){return this.searchQuery?"&search=".concat(encodeURIComponent(this.searchQuery)):""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"orderParams",{get:function(){if(this.orderBy){var e="desc"===this.order?"-":"";return"&ordering=".concat(e).concat(this.orderBy)}return""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"filterParams",{get:function(){return"".concat(this.searchParams).concat(this.orderParams).concat(this.filterQuery)},enumerable:!1,configurable:!0}),e}(),N=function(){function e(e,n){var a=this;this.setFormFields=function(e){a.fields=e},this.updateFormFields=function(e){a.fields=C(C({},a.fields),e)},this.replaceFieldInArray=function(e,n,o){a.fields||(a.fields={}),a.fields[e]||(a.fields[e]=[]),a.fields[e][o]?a.fields[e]=a.fields[e].map((function(e,a){return o===a?n:e})):a.fields[e].push(n)},this.addValueToField=function(e,n,o){a.fields||(a.fields={}),a.getNestedField(o)[e]=n},this.getNestedField=function(e){a.fields||(a.fields={});var n=null==e?void 0:e.split(".");!n||a.fields[n[0]]||Number.isNaN(Number(n[1]))||(a.fields[n[0]]=[]);var o=a.fields;return null==n||n.forEach((function(e){o=o[e]})),o},this.nextStep=function(){a.step+=1},this.prevStep=function(){if(0===a.step)throw new Error("You cannot go to the previous step, because you are already at the first step");a.step-=1},this.setStage=function(e){a.associations&&(a.step=a.associations.indexOf(e)+1)},this.setStep=function(e){a.step=e},this.resetForm=function(){a.fields=null,a.step=1},this.fields=e||null,this.step=1,this.associations=n,m.makeAutoObservable(this)}return Object.defineProperty(e.prototype,"stage",{get:function(){var e;return(null===(e=this.associations)||void 0===e?void 0:e[this.step-1])||null},enumerable:!1,configurable:!0}),e}(),O=function(){var e=this;this.startEditing=function(){e.isEditing=!0,e.blockToSendForm()},this.endEditing=function(){e.isEditing=!1,e.blockToSendForm()},this.allowToSendForm=function(){e.isAllowedToSendForm=!0},this.blockToSendForm=function(){e.isAllowedToSendForm=!1},this.isEditing=!1,this.isAllowedToSendForm=!1,m.makeAutoObservable(this)};exports.Editor=O,exports.KUIUtilsSettings=F,exports.Loader=j,exports.MultistepForm=N,exports.Paginator=M,exports.SortingFilter=A,exports.accountRegExp=/^408([0-9]{17})?$/,exports.addIndexDBStore=function(e,n){e&&!e.objectStoreNames.contains(n)&&e.createObjectStore(n,{keyPath:"id"})},exports.addLeadZero=function(e){return e<10?"0".concat(e):e},exports.addToArrayByCondition=function(e,n){return e?[n]:[]},exports.addToIndexDBWithQueue=function(e,n,a,o){S=S.then((function(){return new Promise((function(m,s){if(e&&e.objectStoreNames.contains(n)&&a){var t=e.transaction(n,"readwrite").objectStore(n);a.id=1;var r=x(a),i=t.put(r);i.onsuccess=function(){m(i)},i.onerror=function(e){var n,a=(null===(n=e.target)||void 0===n?void 0:n.error)||new Error("Unknown IndexedDB error");o.setError("Не удалось сохранить данные в локальное хранилище",a),w(a,r),s(a)}}}))})).catch((function(e){console.error("Ошибка в очереди транзакций:",e)}))},exports.applyMask=c,exports.bicRegExp=/^([0-9]{9})?$/,exports.callPromises=function(e){return p(void 0,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,Promise.allSettled(e)];case 1:return[2,n.sent().map((function(e){return"fulfilled"===e.status?e.value:null}))]}}))}))},exports.carNumberRegExp=/^([А-Яа-я]{1}[0-9]{3}[А-Яа-я]{2}\s{0,1}[0-9]{2,3})?$/,exports.checkIsIOS=function(){if("undefined"!=typeof window){var e=window.navigator.userAgent.toLowerCase();return/iphone|ipod|ipad|mac/.test(e)}return!1},exports.cleanEmptyFields=function(e,n,a){var o=[];return e.forEach((function(e){f(n,String(e[a]))&&o.push(e)})),o},exports.clearIndexStore=E,exports.clearIndexStores=function(e,n){Array.from(n).forEach((function(n){E(e,n)}))},exports.clearNotValidFields=function(e,n){return Object.keys(e).forEach((function(a){(!n||null!==e[a])&&(void 0===e[a]||null===e[a]||"object"==typeof e[a]&&0===Object.keys(e[a]).length)&&delete e[a]})),e},exports.copyInfo=function(e){if(e){var n=document.createElement("textarea");document.body.append(n),n.value=e,n.select(),document.execCommand("copy"),n.remove()}},exports.corrAccountRegExp=/^(301[0-9]{17})?$/,exports.countries=b,exports.cropText=k,exports.dateRegExp=/(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d/,exports.declineByNumber=function(e,n,a){return"number"==typeof e?"".concat(a?"":"".concat(e," ")).concat(n[e%100>4&&e%100<20?2:R[e%10<5?e%10:5]]):""},exports.deleteCookie=function(e){P(e,"",{"max-age":-1})},exports.downloadFile=function(e,n){return p(void 0,void 0,void 0,(function(){var a,o,m;return h(this,(function(s){switch(s.label){case 0:return[4,fetch(e)];case 1:return[4,s.sent().blob()];case 2:return a=s.sent(),o=URL.createObjectURL(a),(m=document.createElement("a")).href=o,m.download=n,document.body.appendChild(m),m.click(),document.body.removeChild(m),[2]}}))}))},exports.emailRegExp=/^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/,exports.formatError=g,exports.generateFormDataBody=function(e,n){var a=new FormData;return Object.keys(e).forEach((function(o){var m=e[o];void 0!==m&&(m instanceof Array&&!n?m.forEach((function(e){v(a,o,e)})):v(a,o,m))})),a},exports.getChangedValue=function(e,n,a){if(JSON.stringify(e)!==JSON.stringify(n))return a||e},exports.getCookie=function(e){var n,a=null===(n=document.cookie)||void 0===n?void 0:n.match(new RegExp("(?:^|; )".concat(e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1"),"=([^;]*)")));return a?decodeURIComponent(a[1]):void 0},exports.getFileNameFromFile=function(e,n){void 0===n&&(n=10);var a=e.name.split("."),o=a.pop();return"".concat(k(a.join("."),n),".").concat(o)},exports.getFileNameFromUrl=function(e,n){var a;void 0===n&&(n=10);var o=null===(a=e.split("/"))||void 0===a?void 0:a.pop(),m=null==o?void 0:o.split("."),s=m?m.pop():"";return m?"".concat(k(m.join("."),n),".").concat(s):""},exports.getNestedData=f,exports.getPhoneNumberFromPhoneParams=function(e,n){var a,o=e.phoneCode,m=e.phoneNumber;if(!m)return"";var s=(null===(a=l([],b,!0).find((function(e){return e.phoneCode==="".concat(o)})))||void 0===a?void 0:a.mask)||"";return"+".concat(o).concat(n||"").concat(c(m,String(s),n))},exports.getPhoneParamsFromString=function(e){var n;if(!e)return null;var a=e.replace(/\D/g,""),o=a.split(""),m=(null===(n=l([],b,!0).find((function(e){return e.phoneCode===a.slice(0,e.phoneCode.length)})))||void 0===n?void 0:n.phoneCode)||o[0];return(null==o?void 0:o.length)>0?{phoneCode:m,phoneNumber:"".concat(o.slice(m.length).join(""))}:null},exports.initIndexDB=function(e,n,a,o){var m=indexedDB.open(e,1);m.onerror=function(){w(m.error,"Ошибка при открытии хранилища на устройстве"),a.setError("Ошибка при открытии хранилища на устройстве. Данные не будут сохраняться локально")},m.onsuccess=function(){var e=m.result;o(e)},m.onupgradeneeded=function(){return n(m.result)}},exports.innRegExp=/^(([0-9]{12})|([0-9]{10}))?$/,exports.isValidWithMaskExp=/^[^_]+$/,exports.longPolling=y,exports.mediumPasswordRegExp=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{12,}$/,exports.monthYearRegExp=/(0[1-9]|1[012])[- /.](19|20)\d\d/,exports.phoneRegExp=/^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/,exports.promisesWithCallback=function(e,n){var a=0;return Promise.allSettled(e.map((function(o){return o.then((function(){a+=1,n&&n(a,e.length)})),o})))},exports.readFromIndexDB=function(e,n,a){return p(void 0,void 0,void 0,(function(){var o,m;return h(this,(function(s){return e.objectStoreNames.contains(n)?(o=e.transaction(n,"readonly").objectStore(n),m=o.getAll(),[2,new Promise((function(e,n){m.onerror=function(){var e=m.error;a.setError("Не удалось прочитать данные с локального хранилища",e),w(e,m),n()},m.onsuccess=function(){var n;e(null===(n=m.result)||void 0===n?void 0:n[0])}}))]):[2,null]}))}))},exports.resHandler=function(e,n,a,o,m){var s=e[0],t=e[1];if(s||void 0===t)n.endLoading(),n.setError(o,s);else try{a&&a(t)}catch(e){n.endLoading(),n.setError(o,s)}!(null==m?void 0:m.withEndLoading)&&m||n.endLoading()},exports.setCookie=P,exports.simplePasswordRegExp=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{10,}$/,exports.strongPasswordRegExp=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*]).{14,}$/,exports.swiftRegExp=/^([A-Za-z]{6}\w{2}\d{0,3})?$/,exports.toNumber=function(e){return"number"==typeof e?e:"string"==typeof e?Number(String(e).replace(/\s/g,"").replace(/,/g,".")):null},exports.updateQueryParams=function(e,n){var a=new URLSearchParams(window.location.search),o=e.split(/\?|&/),m=Object.fromEntries(new URLSearchParams(o.slice(1).join("&")).entries()),s=Object.fromEntries(a.entries()),t=a.size&&!n?o[0]:window.location.pathname;Object.keys(s).forEach((function(e,n){e in m&&(s[e]=m[e],delete m[e]),"id"!==e&&(t+="".concat(0===n?"?":"&").concat(e,"=").concat(s[e]))})),Object.keys(m).forEach((function(e){t+="".concat(a.size?"&":"?").concat(e,"=").concat(m[e])})),window.history.pushState({route:t},"",t)},exports.useDebounce=function(n,a,o,m){var s=e.useMemo((function(){return d.default.debounce(o,a)}),[n,a,m]);e.useEffect((function(){return n&&s(),function(){s.cancel()}}),[n,a,m])},exports.useForkRef=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return i.useMemo((function(){return e.every((function(e){return null==e}))?null:function(n){e.forEach((function(e){!function(e,n){"function"==typeof e?e(n):e&&(e.current=n)}(e,n)}))}}),e)},exports.useTabIndex=function(e){var n=a.useLocation().search;return e.findIndex((function(e){return e.includes(n)}))||null},exports.useToggle=function(n){void 0===n&&(n=!1);var a=e.useState(n),o=a[0],m=a[1];return[o,function(){m(!0)},function(){m(!1)}]},exports.useWindowWidth=function(n){void 0===n&&(n=10);var a=e.useState(0),o=a[0],m=a[1];return e.useEffect((function(){m(window.innerWidth);var e=d.default.debounce((function(){m(window.innerWidth)}),n);return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),o};