@dxtmisha/functional-basic 0.11.2 → 0.11.3
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/dist/library.d.ts +15 -2
- package/dist/library.js +240 -229
- package/package.json +1 -1
package/dist/library.d.ts
CHANGED
|
@@ -13,8 +13,10 @@ export declare function addTagHighlightMatch(value: string, search?: string, cla
|
|
|
13
13
|
*
|
|
14
14
|
* Преобразование значения в строку.
|
|
15
15
|
* @param value values for conversion/ значения для преобразования
|
|
16
|
+
* @param isArrayString if true, then arrays will be converted to strings/
|
|
17
|
+
* если true, то массивы будут преобразованы в строки
|
|
16
18
|
*/
|
|
17
|
-
export declare function anyToString<V>(value: V): string;
|
|
19
|
+
export declare function anyToString<V>(value: V, isArrayString?: boolean): string;
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* Class for working with requests.
|
|
@@ -1602,6 +1604,17 @@ export declare type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'nul
|
|
|
1602
1604
|
*/
|
|
1603
1605
|
export declare function encodeAttribute(text: string): string;
|
|
1604
1606
|
|
|
1607
|
+
/**
|
|
1608
|
+
* Ensures that an image does not exceed the maximum size by resizing it if needed.
|
|
1609
|
+
*
|
|
1610
|
+
* Гарантирует, что изображение не превышает максимальный размер, изменяя его размер при необходимости.
|
|
1611
|
+
* @param file image file as Uint8Array / файл изображения в виде Uint8Array
|
|
1612
|
+
* @param compress maximum size as a fraction of the original size (default is 0.7)/
|
|
1613
|
+
* максимальный размер в виде доли от оригинального размера (по умолчанию 0.7)
|
|
1614
|
+
* @param type image type (default is 'image/jpeg') / тип изображения (по умолчанию 'image/jpeg')
|
|
1615
|
+
*/
|
|
1616
|
+
export declare function ensureMaxSize(file: Uint8Array, compress?: number, type?: string): Promise<string>;
|
|
1617
|
+
|
|
1605
1618
|
/**
|
|
1606
1619
|
* Escapes special regex characters in a string so it can be used safely in a RegExp.
|
|
1607
1620
|
*
|
|
@@ -5844,7 +5857,7 @@ export declare const TRANSLATE_GLOBAL_PREFIX = "global";
|
|
|
5844
5857
|
* Request timeout for batch loading (ms).
|
|
5845
5858
|
* Таймаут запроса для пакетной загрузки (мс).
|
|
5846
5859
|
*/
|
|
5847
|
-
export declare const TRANSLATE_TIME_OUT =
|
|
5860
|
+
export declare const TRANSLATE_TIME_OUT = 160;
|
|
5848
5861
|
|
|
5849
5862
|
/**
|
|
5850
5863
|
* Translation code or a list of translation codes for template replacement.
|
package/dist/library.js
CHANGED
|
@@ -155,15 +155,15 @@ function y(e, t, n) {
|
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/classes/DataStorage.ts
|
|
158
|
-
var
|
|
158
|
+
var ne = {}, re = "ui-storage", b = class {
|
|
159
159
|
static setPrefix(e) {
|
|
160
|
-
|
|
160
|
+
re = e;
|
|
161
161
|
}
|
|
162
162
|
constructor(e, t = !1) {
|
|
163
163
|
y(this, "value", void 0), y(this, "age", void 0), this.name = e, this.isSession = t;
|
|
164
164
|
let n = `${t ? "session" : "storage"}#${e}`;
|
|
165
|
-
if (n in
|
|
166
|
-
this.make(),
|
|
165
|
+
if (n in ne) return ne[n];
|
|
166
|
+
this.make(), ne[n] = this;
|
|
167
167
|
}
|
|
168
168
|
get(e, t) {
|
|
169
169
|
if (this.value !== null && this.value !== void 0 && this.isCache(t)) return this.value;
|
|
@@ -198,7 +198,7 @@ var b = {}, ne = "ui-storage", x = class {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
getIndex() {
|
|
201
|
-
return `${
|
|
201
|
+
return `${re}__${this.name}`;
|
|
202
202
|
}
|
|
203
203
|
getValue() {
|
|
204
204
|
var e;
|
|
@@ -213,7 +213,7 @@ var b = {}, ne = "ui-storage", x = class {
|
|
|
213
213
|
let e = this.getValue();
|
|
214
214
|
return e ? (this.value = e.value, this.age = e.age) : (this.value = void 0, this.age = void 0), this;
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, x, ie = "geo-code", S = class {
|
|
217
217
|
static get() {
|
|
218
218
|
return this.item;
|
|
219
219
|
}
|
|
@@ -297,17 +297,17 @@ var b = {}, ne = "ui-storage", x = class {
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
};
|
|
300
|
-
|
|
300
|
+
x = S, y(S, "storage", new b(ie)), y(S, "location", void 0), y(S, "item", void 0), y(S, "language", void 0), y(S, "timezone", (/* @__PURE__ */ new Date()).getTimezoneOffset()), x.location = x.findLocation(), x.language = x.findLanguage(x.location), x.item = x.getByCode(x.location);
|
|
301
301
|
//#endregion
|
|
302
302
|
//#region src/functions/isWindow.ts
|
|
303
|
-
function
|
|
303
|
+
function ae(e) {
|
|
304
304
|
return d() && e === window;
|
|
305
305
|
}
|
|
306
306
|
//#endregion
|
|
307
307
|
//#region src/functions/getElement.ts
|
|
308
|
-
function
|
|
308
|
+
function C(e) {
|
|
309
309
|
if (d()) {
|
|
310
|
-
if (
|
|
310
|
+
if (ae(e)) return document.body;
|
|
311
311
|
if (l(e)) {
|
|
312
312
|
var t;
|
|
313
313
|
return (t = document.querySelector(e)) == null ? void 0 : t;
|
|
@@ -317,30 +317,30 @@ function T(e) {
|
|
|
317
317
|
}
|
|
318
318
|
//#endregion
|
|
319
319
|
//#region src/functions/getElementOrWindow.ts
|
|
320
|
-
function
|
|
321
|
-
return
|
|
320
|
+
function oe(e) {
|
|
321
|
+
return ae(e) ? e : C(e);
|
|
322
322
|
}
|
|
323
323
|
//#endregion
|
|
324
324
|
//#region src/functions/isInDom.ts
|
|
325
|
-
function
|
|
325
|
+
function se(e) {
|
|
326
326
|
var t;
|
|
327
|
-
return !!((t =
|
|
327
|
+
return !!((t = C(e)) != null && t.closest("html"));
|
|
328
328
|
}
|
|
329
329
|
//#endregion
|
|
330
330
|
//#region src/functions/toArray.ts
|
|
331
|
-
function
|
|
331
|
+
function w(e) {
|
|
332
332
|
return Array.isArray(e) ? e : [e];
|
|
333
333
|
}
|
|
334
334
|
//#endregion
|
|
335
335
|
//#region src/classes/EventItem.ts
|
|
336
|
-
var
|
|
336
|
+
var T = class {
|
|
337
337
|
constructor(e, t = ["click"], r, i, a) {
|
|
338
338
|
y(this, "element", void 0), y(this, "elementControl", void 0), y(this, "elementControlEdit", void 0), y(this, "type", void 0), y(this, "listenerRecent", (e) => {
|
|
339
|
-
if (
|
|
339
|
+
if (se(this.elementControl)) {
|
|
340
340
|
var t, r;
|
|
341
341
|
(t = this.listener) == null || t.call(this.element, e, this.detail), n(this.options) && (r = this.options) != null && r.once && this.stop();
|
|
342
342
|
} else this.stop();
|
|
343
|
-
}), y(this, "activity", !1), y(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element =
|
|
343
|
+
}), y(this, "activity", !1), y(this, "activityItems", []), this.listener = r, this.options = i, this.detail = a, this.element = oe(e), this.elementControl = C(e), this.type = w(t);
|
|
344
344
|
}
|
|
345
345
|
isActive() {
|
|
346
346
|
return this.activity;
|
|
@@ -349,14 +349,14 @@ var D = class {
|
|
|
349
349
|
return this.element;
|
|
350
350
|
}
|
|
351
351
|
setElement(e) {
|
|
352
|
-
let t =
|
|
353
|
-
return this.elementControlEdit || (this.elementControl =
|
|
352
|
+
let t = oe(e);
|
|
353
|
+
return this.elementControlEdit || (this.elementControl = C(e)), this.element = t, this.reset(), this;
|
|
354
354
|
}
|
|
355
355
|
setElementControl(e) {
|
|
356
|
-
return this.elementControl =
|
|
356
|
+
return this.elementControl = C(e), this.elementControlEdit = !o(this.elementControl), this.elementControlEdit || (this.elementControl = C(this.element)), this;
|
|
357
357
|
}
|
|
358
358
|
setType(e) {
|
|
359
|
-
return this.type =
|
|
359
|
+
return this.type = w(e), this.reset(), this;
|
|
360
360
|
}
|
|
361
361
|
setListener(e) {
|
|
362
362
|
return this.listener = e, this;
|
|
@@ -425,7 +425,7 @@ var D = class {
|
|
|
425
425
|
}
|
|
426
426
|
return !1;
|
|
427
427
|
}
|
|
428
|
-
},
|
|
428
|
+
}, ce, le = "ui-loading", E = class {
|
|
429
429
|
static is() {
|
|
430
430
|
return this.value > 0;
|
|
431
431
|
}
|
|
@@ -440,7 +440,7 @@ var D = class {
|
|
|
440
440
|
}
|
|
441
441
|
static registrationEvent(e, t) {
|
|
442
442
|
if (d()) {
|
|
443
|
-
let n = new
|
|
443
|
+
let n = new T(window, le, e).setElementControl(t).start();
|
|
444
444
|
this.registrationList.push({
|
|
445
445
|
item: n,
|
|
446
446
|
listener: e,
|
|
@@ -456,10 +456,10 @@ var D = class {
|
|
|
456
456
|
(e = this.event) == null || e.dispatch({ loading: this.is() });
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
|
|
459
|
+
ce = E, y(E, "value", 0), y(E, "event", void 0), y(E, "registrationList", []), d() && (ce.event = new T(window, le));
|
|
460
460
|
//#endregion
|
|
461
461
|
//#region src/classes/ApiHeaders.ts
|
|
462
|
-
var
|
|
462
|
+
var ue = class {
|
|
463
463
|
constructor() {
|
|
464
464
|
y(this, "headers", {});
|
|
465
465
|
}
|
|
@@ -472,9 +472,9 @@ var ce = class {
|
|
|
472
472
|
set(e) {
|
|
473
473
|
return c(e) && (this.headers = e), this;
|
|
474
474
|
}
|
|
475
|
-
},
|
|
475
|
+
}, D = /* @__PURE__ */ function(e) {
|
|
476
476
|
return e.get = "GET", e.post = "POST", e.put = "PUT", e.delete = "DELETE", e;
|
|
477
|
-
}({}),
|
|
477
|
+
}({}), de = class {
|
|
478
478
|
constructor() {
|
|
479
479
|
y(this, "value", void 0);
|
|
480
480
|
}
|
|
@@ -498,7 +498,7 @@ var ce = class {
|
|
|
498
498
|
addByFormData(e, t) {
|
|
499
499
|
for (let n in t) e.has(n) || e.set(n, t[n]);
|
|
500
500
|
}
|
|
501
|
-
},
|
|
501
|
+
}, O = class {
|
|
502
502
|
constructor() {
|
|
503
503
|
y(this, "value", void 0);
|
|
504
504
|
}
|
|
@@ -556,18 +556,18 @@ var ce = class {
|
|
|
556
556
|
};
|
|
557
557
|
//#endregion
|
|
558
558
|
//#region src/functions/executePromise.ts
|
|
559
|
-
async function
|
|
559
|
+
async function fe(e) {
|
|
560
560
|
let t = g(e);
|
|
561
561
|
return t instanceof Promise ? await t : t;
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
564
|
//#region src/functions/random.ts
|
|
565
|
-
function
|
|
565
|
+
function k(e, t) {
|
|
566
566
|
return Math.floor(Math.random() * (t - e + 1) + e);
|
|
567
567
|
}
|
|
568
568
|
//#endregion
|
|
569
569
|
//#region src/classes/ApiResponse.ts
|
|
570
|
-
var
|
|
570
|
+
var pe = "d-response-loading", me = class {
|
|
571
571
|
constructor(e) {
|
|
572
572
|
y(this, "first", []), y(this, "response", []), y(this, "loading", void 0), y(this, "devMode", !1), this.requestDefault = e;
|
|
573
573
|
}
|
|
@@ -578,13 +578,13 @@ var de = "d-response-loading", fe = class {
|
|
|
578
578
|
return this.response.filter((e) => e.isForGlobal !== !0);
|
|
579
579
|
}
|
|
580
580
|
add(e) {
|
|
581
|
-
return this.response.push(...
|
|
581
|
+
return this.response.push(...w(e)), this;
|
|
582
582
|
}
|
|
583
583
|
setDevMode(e) {
|
|
584
584
|
return this.devMode = e, this;
|
|
585
585
|
}
|
|
586
586
|
async emulator(e) {
|
|
587
|
-
let { path: t = "", method: n =
|
|
587
|
+
let { path: t = "", method: n = D.get, global: r = n === D.get, devMode: i = !1 } = e;
|
|
588
588
|
if (r || this.isDevMode(i)) {
|
|
589
589
|
let r = this.requestDefault.request(e.request), a = this.get(t, n, r, i);
|
|
590
590
|
if (a) {
|
|
@@ -611,22 +611,22 @@ var de = "d-response-loading", fe = class {
|
|
|
611
611
|
}
|
|
612
612
|
fetch(e, t) {
|
|
613
613
|
return this.startResponseLoading(), new Promise((n) => {
|
|
614
|
-
|
|
615
|
-
e != null && e.lag ? (
|
|
616
|
-
this.stopResponseLoading(), n(t),
|
|
617
|
-
},
|
|
614
|
+
fe(h(e.response) ? e.response(t) : e.response).then((t) => {
|
|
615
|
+
e != null && e.lag ? (E.show(), setTimeout(() => {
|
|
616
|
+
this.stopResponseLoading(), n(t), E.hide();
|
|
617
|
+
}, k(0, 2e3))) : (this.stopResponseLoading(), n(t));
|
|
618
618
|
});
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
621
|
startResponseLoading() {
|
|
622
|
-
this.loading && clearTimeout(this.loading), d() && document.body.classList.add(
|
|
622
|
+
this.loading && clearTimeout(this.loading), d() && document.body.classList.add(pe);
|
|
623
623
|
}
|
|
624
624
|
stopResponseLoading() {
|
|
625
625
|
this.loading = setTimeout(() => {
|
|
626
|
-
this.loading = void 0, d() && document.body.classList.remove(
|
|
626
|
+
this.loading = void 0, d() && document.body.classList.remove(pe);
|
|
627
627
|
}, 1200);
|
|
628
628
|
}
|
|
629
|
-
},
|
|
629
|
+
}, he = class {
|
|
630
630
|
constructor() {
|
|
631
631
|
y(this, "callback", void 0), y(this, "callbackEnd", void 0), y(this, "loading", !1);
|
|
632
632
|
}
|
|
@@ -654,7 +654,7 @@ var de = "d-response-loading", fe = class {
|
|
|
654
654
|
let n = {};
|
|
655
655
|
return this.callbackEnd && (n = await this.callbackEnd(e, t)), n;
|
|
656
656
|
}
|
|
657
|
-
},
|
|
657
|
+
}, ge, A = class e {
|
|
658
658
|
static isLocalhost() {
|
|
659
659
|
return typeof location > "u" || location.hostname === "localhost";
|
|
660
660
|
}
|
|
@@ -665,14 +665,14 @@ var de = "d-response-loading", fe = class {
|
|
|
665
665
|
return this.response;
|
|
666
666
|
}
|
|
667
667
|
static getUrl(e, t = !0) {
|
|
668
|
-
return `${t ? this.url : ""}${e}`.replace("{locale}",
|
|
668
|
+
return `${t ? this.url : ""}${e}`.replace("{locale}", S.getLocation()).replace("{country}", S.getCountry()).replace("{language}", S.getLanguage());
|
|
669
669
|
}
|
|
670
|
-
static getBody(e = {}, t =
|
|
670
|
+
static getBody(e = {}, t = D.get) {
|
|
671
671
|
if (e instanceof FormData) return e;
|
|
672
|
-
if (t !==
|
|
672
|
+
if (t !== D.get && s(e)) return l(e) ? e : JSON.stringify(e);
|
|
673
673
|
}
|
|
674
|
-
static getBodyForGet(e, t = "", n =
|
|
675
|
-
if (n ===
|
|
674
|
+
static getBodyForGet(e, t = "", n = D.get) {
|
|
675
|
+
if (n === D.get) {
|
|
676
676
|
let n = t.match(/\?/) ? "&" : "?", r = typeof e == "object" ? i(e) : e;
|
|
677
677
|
if (s(r)) return `${n}${r}`;
|
|
678
678
|
}
|
|
@@ -697,38 +697,38 @@ var de = "d-response-loading", fe = class {
|
|
|
697
697
|
return l(e) ? await this.fetch({ path: e }) : await this.fetch(e);
|
|
698
698
|
}
|
|
699
699
|
static get(e) {
|
|
700
|
-
return this.request(t(e, { method:
|
|
700
|
+
return this.request(t(e, { method: D.get }));
|
|
701
701
|
}
|
|
702
702
|
static post(e) {
|
|
703
|
-
return this.request(t(e, { method:
|
|
703
|
+
return this.request(t(e, { method: D.post }));
|
|
704
704
|
}
|
|
705
705
|
static put(e) {
|
|
706
|
-
return this.request(t(e, { method:
|
|
706
|
+
return this.request(t(e, { method: D.put }));
|
|
707
707
|
}
|
|
708
708
|
static delete(e) {
|
|
709
|
-
return this.request(t(e, { method:
|
|
709
|
+
return this.request(t(e, { method: D.delete }));
|
|
710
710
|
}
|
|
711
711
|
static async fetch(e) {
|
|
712
712
|
let { toData: t = !0, hideError: n = !1, queryReturn: r = void 0, globalPreparation: i = !0, globalEnd: a = !0 } = e, o = await this.response.emulator(e);
|
|
713
713
|
if (o) return o;
|
|
714
|
-
let s = new
|
|
715
|
-
|
|
714
|
+
let s = new O(), c;
|
|
715
|
+
E.show();
|
|
716
716
|
try {
|
|
717
717
|
await this.preparation.make(i, e);
|
|
718
718
|
let t = await this.makeQuery(e), n = await this.preparation.makeEnd(a, t, e);
|
|
719
|
-
if (s.setStatus(t.status, t.statusText), this.status.setStatus(t.status, t.statusText), n != null && n.reset) return
|
|
719
|
+
if (s.setStatus(t.status, t.statusText), this.status.setStatus(t.status, t.statusText), n != null && n.reset) return E.hide(), await this.fetch(e);
|
|
720
720
|
c = await this.readData(t, r, n);
|
|
721
721
|
} catch (e) {
|
|
722
|
-
throw n || console.error("Api: ", e), s.setError(String(e)), this.status.setError(String(e)),
|
|
722
|
+
throw n || console.error("Api: ", e), s.setError(String(e)), this.status.setError(String(e)), E.hide(), e;
|
|
723
723
|
}
|
|
724
|
-
return
|
|
724
|
+
return E.hide(), s.setLastResponse(c), this.status.setLastResponse(c), this.makeStatus(this.makeData(c, t), s);
|
|
725
725
|
}
|
|
726
726
|
static async readData(e, t, n) {
|
|
727
727
|
var r;
|
|
728
728
|
return t ? await t(e) : "data" in n ? n.data : ((r = e.headers.get("Content-Type")) == null ? "" : r).match("application/json") ? await e.json() : { data: await e.text() };
|
|
729
729
|
}
|
|
730
730
|
static async makeQuery(e) {
|
|
731
|
-
let n = this.requestDefault.request(e.request), { api: r = !0, path: i = "", pathFull: a = void 0, method: o =
|
|
731
|
+
let n = this.requestDefault.request(e.request), { api: r = !0, path: i = "", pathFull: a = void 0, method: o = D.get, headers: s = {}, type: c = "application/json;charset=UTF-8", init: l = {}, controller: u = void 0 } = e, d = a == null ? this.getUrl(i, r) : a, f = `${d}${this.getBodyForGet(n, d, o)}`, p = this.headers.get(s, c), m = t(l, {
|
|
732
732
|
method: o,
|
|
733
733
|
body: this.getBody(n, o)
|
|
734
734
|
});
|
|
@@ -747,10 +747,10 @@ var de = "d-response-loading", fe = class {
|
|
|
747
747
|
} : e;
|
|
748
748
|
}
|
|
749
749
|
};
|
|
750
|
-
|
|
750
|
+
ge = A, y(A, "url", "/api/"), y(A, "headers", new ue()), y(A, "requestDefault", new de()), y(A, "status", new O()), y(A, "response", new me(ge.requestDefault)), y(A, "preparation", new he());
|
|
751
751
|
//#endregion
|
|
752
752
|
//#region src/classes/BroadcastMessage.ts
|
|
753
|
-
var
|
|
753
|
+
var _e = class {
|
|
754
754
|
constructor(e, t, n) {
|
|
755
755
|
if (y(this, "channel", void 0), y(this, "update", (e) => {
|
|
756
756
|
var t;
|
|
@@ -759,7 +759,7 @@ var he = class {
|
|
|
759
759
|
var t;
|
|
760
760
|
return (t = this.callbackError) == null || t.call(this, e), this;
|
|
761
761
|
}), this.callback = t, this.callbackError = n, d()) try {
|
|
762
|
-
this.channel = new BroadcastChannel(`${
|
|
762
|
+
this.channel = new BroadcastChannel(`${ve()}__${e}`), this.channel.onmessage = this.update, this.channel.onmessageerror = this.updateError;
|
|
763
763
|
} catch (t) {
|
|
764
764
|
console.error(`BroadcastMessage ${e}:`, t);
|
|
765
765
|
}
|
|
@@ -777,7 +777,7 @@ var he = class {
|
|
|
777
777
|
setCallbackError(e) {
|
|
778
778
|
return this.callbackError = e, this;
|
|
779
779
|
}
|
|
780
|
-
},
|
|
780
|
+
}, ve = () => new b("__broadcast-name").get(() => `name_${k(1e6, 9999999)}`), ye = class {
|
|
781
781
|
constructor(e) {
|
|
782
782
|
y(this, "cache", void 0), y(this, "cacheOld", void 0), y(this, "comparisons", []), this.callback = e;
|
|
783
783
|
}
|
|
@@ -799,7 +799,7 @@ var he = class {
|
|
|
799
799
|
isUpdate(e) {
|
|
800
800
|
return this.cache === void 0 || this.comparisons.length !== e.length || this.comparisons.findIndex((t, n) => t !== e[n]) >= 0 ? (this.comparisons = [...e], !0) : !1;
|
|
801
801
|
}
|
|
802
|
-
},
|
|
802
|
+
}, be = class {
|
|
803
803
|
constructor() {
|
|
804
804
|
y(this, "cache", {});
|
|
805
805
|
}
|
|
@@ -810,17 +810,17 @@ var he = class {
|
|
|
810
810
|
return await this.getCacheItem(e, t).getCacheAsync(n == null ? [] : n);
|
|
811
811
|
}
|
|
812
812
|
getCacheItem(e, t) {
|
|
813
|
-
return e in this.cache || (this.cache[e] = new
|
|
813
|
+
return e in this.cache || (this.cache[e] = new ye(t)), this.cache[e];
|
|
814
814
|
}
|
|
815
|
-
},
|
|
815
|
+
}, xe, Se = class {
|
|
816
816
|
static get(e, t, n) {
|
|
817
817
|
return this.cache.get(e, t, n);
|
|
818
818
|
}
|
|
819
819
|
};
|
|
820
|
-
|
|
820
|
+
xe = Se, y(Se, "cache", void 0), xe.cache = new be();
|
|
821
821
|
//#endregion
|
|
822
822
|
//#region src/functions/transformation.ts
|
|
823
|
-
function
|
|
823
|
+
function Ce(e, t = !1) {
|
|
824
824
|
if (typeof e == "string") {
|
|
825
825
|
let r = e.trim();
|
|
826
826
|
switch (r) {
|
|
@@ -844,7 +844,7 @@ function xe(e, t = !1) {
|
|
|
844
844
|
}
|
|
845
845
|
//#endregion
|
|
846
846
|
//#region src/classes/CookieBlock.ts
|
|
847
|
-
var
|
|
847
|
+
var we = "cookie-block", j = class {
|
|
848
848
|
static get() {
|
|
849
849
|
var e;
|
|
850
850
|
return (e = this.storage.get()) == null ? !1 : e;
|
|
@@ -853,13 +853,13 @@ var Se = "cookie-block", Ce = class {
|
|
|
853
853
|
this.storage.set(e);
|
|
854
854
|
}
|
|
855
855
|
};
|
|
856
|
-
y(
|
|
856
|
+
y(j, "storage", new b(we));
|
|
857
857
|
//#endregion
|
|
858
858
|
//#region src/classes/Cookie.ts
|
|
859
|
-
var
|
|
859
|
+
var Te, M = {}, Ee = class {
|
|
860
860
|
constructor(e) {
|
|
861
861
|
if (y(this, "value", void 0), y(this, "options", {}), this.name = e, e in De) return De[e];
|
|
862
|
-
this.value =
|
|
862
|
+
this.value = M == null ? void 0 : M[e], De[e] = this;
|
|
863
863
|
}
|
|
864
864
|
get(e, t) {
|
|
865
865
|
return this.value === void 0 && e && this.set(e, t), this.value;
|
|
@@ -875,7 +875,7 @@ var we, Te = {}, Ee = class {
|
|
|
875
875
|
return (e = (t = this.options) == null ? void 0 : t.age) == null ? 10080 * 60 : e;
|
|
876
876
|
}
|
|
877
877
|
update() {
|
|
878
|
-
if (d() && !_() && !
|
|
878
|
+
if (d() && !_() && !j.get()) {
|
|
879
879
|
var e, t, n, r, i;
|
|
880
880
|
let a = String((e = this.value) == null ? "" : e);
|
|
881
881
|
document.cookie = [
|
|
@@ -889,11 +889,11 @@ var we, Te = {}, Ee = class {
|
|
|
889
889
|
static updateData() {
|
|
890
890
|
for (let e of document.cookie.split(";")) {
|
|
891
891
|
let [t, n] = e.trim().split("=");
|
|
892
|
-
t && s(n) && (
|
|
892
|
+
t && s(n) && (M[t] = Ce(n));
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
};
|
|
896
|
-
|
|
896
|
+
Te = Ee, d() && !_() && Te.updateData();
|
|
897
897
|
var De = {};
|
|
898
898
|
//#endregion
|
|
899
899
|
//#region src/functions/toDate.ts
|
|
@@ -902,7 +902,7 @@ function N(e) {
|
|
|
902
902
|
if (e instanceof Date) return e;
|
|
903
903
|
if (o(e)) return /* @__PURE__ */ new Date();
|
|
904
904
|
if (typeof e == "number") return new Date(e);
|
|
905
|
-
let u = e, d =
|
|
905
|
+
let u = e, d = S.getTimezoneFormat().trim();
|
|
906
906
|
e.replace(/^([\s\S]+)([-+]\d{2}:?\d{2})$/, (e, t, n) => (u = t, d = n.trim(), e));
|
|
907
907
|
let f = (t = (n = (r = (i = (a = (s = (c = (l = /^\d{4}\d{2}\d{2}$/.exec(u) && `${u.replace(/^(\d{4})(\d{2})(\d{2})$/, "$1-$2-$3")}T00:00:00`) == null ? /^\d{4}\d{2}$/.exec(u) && `${u.replace(/^(\d{4})(\d{2})$/, "$1-$2")}-01T00:00:00` : l) == null ? /^\d{4}\d{2}\d{2} \d{2}:\d{2}:\d{2}$/.exec(u) && u.replace(/^(\d{4})(\d{2})(\d{2}) (\d{2}):(\d{2}):(\d{2})$/, "$1-$2-$3T$4:$5:$6") : c) == null ? /^\d{4}-\d{2}-\d{2}$/.exec(u) && `${u}T00:00:00` : s) == null ? /^\d{4}-\d{2}$/.exec(u) && `${u}-01T00:00:00` : a) == null ? /^\d{4}$/.exec(u) && `${u}-01-01T00:00:00` : i) == null ? /^\d{2}:\d{2}$/.exec(u) && `2000-01-01T${u}:00` : r) == null ? /^\d{2}:\d{2}:\d{2}$/.exec(u) && `2000-01-01T${u}` : n) == null ? u.replace(" ", "T") : t;
|
|
908
908
|
return /* @__PURE__ */ new Date(`${f.trim()}${d}`);
|
|
@@ -915,14 +915,14 @@ function Oe(e, t) {
|
|
|
915
915
|
//#endregion
|
|
916
916
|
//#region src/classes/GeoIntl.ts
|
|
917
917
|
var P = class e {
|
|
918
|
-
static getInstance(t =
|
|
918
|
+
static getInstance(t = S.getLocation()) {
|
|
919
919
|
return new e(t);
|
|
920
920
|
}
|
|
921
|
-
constructor(e =
|
|
922
|
-
y(this, "geo", void 0), this.geo =
|
|
921
|
+
constructor(e = S.getLocation()) {
|
|
922
|
+
y(this, "geo", void 0), this.geo = S.find(e);
|
|
923
923
|
let t = this.getLocation();
|
|
924
|
-
if (t in
|
|
925
|
-
|
|
924
|
+
if (t in ke) return ke[t];
|
|
925
|
+
ke[t] = this;
|
|
926
926
|
}
|
|
927
927
|
getLocation() {
|
|
928
928
|
return this.geo.standard;
|
|
@@ -949,7 +949,7 @@ var P = class e {
|
|
|
949
949
|
type: "language",
|
|
950
950
|
style: t
|
|
951
951
|
};
|
|
952
|
-
return this.display(
|
|
952
|
+
return this.display(S.getByCode(e).language, n);
|
|
953
953
|
}
|
|
954
954
|
countryName(e, t) {
|
|
955
955
|
let n = {
|
|
@@ -1214,8 +1214,8 @@ var P = class e {
|
|
|
1214
1214
|
"second"
|
|
1215
1215
|
].indexOf(e) !== -1 && (n.second = "2-digit")), n;
|
|
1216
1216
|
}
|
|
1217
|
-
},
|
|
1218
|
-
constructor(e, t = "date", n =
|
|
1217
|
+
}, ke = {}, Ae = class e {
|
|
1218
|
+
constructor(e, t = "date", n = S.getLocation()) {
|
|
1219
1219
|
y(this, "date", void 0), y(this, "hour24", !1), y(this, "watch", void 0), this.type = t, this.code = n, this.date = N(e);
|
|
1220
1220
|
}
|
|
1221
1221
|
getIntl() {
|
|
@@ -1478,36 +1478,36 @@ var P = class e {
|
|
|
1478
1478
|
};
|
|
1479
1479
|
//#endregion
|
|
1480
1480
|
//#region src/functions/anyToString.ts
|
|
1481
|
-
function
|
|
1482
|
-
var
|
|
1483
|
-
return l(e) ? e.trim() : a(e) && e.findIndex((e) => n(e)) === -1 ? e.join(",") : n(e) ? JSON.stringify(e) : e === !0 ? "1" : e === !1 ? "0" : (
|
|
1481
|
+
function F(e, t = !0) {
|
|
1482
|
+
var r;
|
|
1483
|
+
return l(e) ? e.trim() : a(e) && e.findIndex((e) => n(e)) === -1 && t ? e.join(",") : n(e) ? JSON.stringify(e) : e === !0 ? "1" : e === !1 ? "0" : (r = e == null ? void 0 : e.toString()) == null ? "" : r;
|
|
1484
1484
|
}
|
|
1485
1485
|
//#endregion
|
|
1486
1486
|
//#region src/functions/strSplit.ts
|
|
1487
|
-
function
|
|
1488
|
-
let r =
|
|
1487
|
+
function je(e, t, n) {
|
|
1488
|
+
let r = F(e);
|
|
1489
1489
|
if (!n || n <= 0) return r.split(t);
|
|
1490
1490
|
let i = r.split(t, n), a = r.split(t);
|
|
1491
1491
|
return i.length === a.length ? i : (i.pop(), [...i, a.slice(n - 1).join(t)]);
|
|
1492
1492
|
}
|
|
1493
1493
|
//#endregion
|
|
1494
1494
|
//#region src/functions/getItemByPath.ts
|
|
1495
|
-
function
|
|
1495
|
+
function I(e, t) {
|
|
1496
1496
|
var r;
|
|
1497
1497
|
if (!s(t)) return;
|
|
1498
|
-
let i =
|
|
1499
|
-
return a && e != null && e[a] && n(e[a]) && i != null && i[1] ?
|
|
1498
|
+
let i = je(t, ".", 2), a = i[0];
|
|
1499
|
+
return a && e != null && e[a] && n(e[a]) && i != null && i[1] ? I(e[a], i[1]) : (r = s(a) && (e == null ? void 0 : e[a])) == null ? void 0 : r;
|
|
1500
1500
|
}
|
|
1501
1501
|
//#endregion
|
|
1502
1502
|
//#region src/functions/toCamelCase.ts
|
|
1503
|
-
function
|
|
1503
|
+
function Me(e) {
|
|
1504
1504
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/-+([a-zA-Z0-9])/g, (...e) => `${String(e[1]).toUpperCase()}`).replace(/^([A-Z])/, (e) => `${e.toLowerCase()}`);
|
|
1505
1505
|
}
|
|
1506
1506
|
//#endregion
|
|
1507
1507
|
//#region src/types/formattersTypes.ts
|
|
1508
|
-
var
|
|
1508
|
+
var L = /* @__PURE__ */ function(e) {
|
|
1509
1509
|
return e.currency = "currency", e.date = "date", e.name = "name", e.number = "number", e.plural = "plural", e.unit = "unit", e;
|
|
1510
|
-
}({}),
|
|
1510
|
+
}({}), Ne = class {
|
|
1511
1511
|
constructor(e, t) {
|
|
1512
1512
|
this.options = e, this.list = t;
|
|
1513
1513
|
}
|
|
@@ -1521,7 +1521,7 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
1521
1521
|
return this.list ? this.isArray() ? this.list.length : 1 : 0;
|
|
1522
1522
|
}
|
|
1523
1523
|
getList() {
|
|
1524
|
-
return this.list ?
|
|
1524
|
+
return this.list ? w(this.list) : [];
|
|
1525
1525
|
}
|
|
1526
1526
|
getOptions() {
|
|
1527
1527
|
return this.options;
|
|
@@ -1539,25 +1539,25 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
1539
1539
|
getFormatData(e) {
|
|
1540
1540
|
let t = {};
|
|
1541
1541
|
return r(this.options, (n, r) => {
|
|
1542
|
-
let i = `${
|
|
1542
|
+
let i = `${Me(r)}Format`, a = I(e, r);
|
|
1543
1543
|
n != null && n.transformation ? s(a) ? t[i] = n.transformation(a, e, n.options) : t[i] = "" : t[i] = this.transformation(a, e, n.type, n.options);
|
|
1544
1544
|
}), t;
|
|
1545
1545
|
}
|
|
1546
1546
|
transformation(e, t, n, r) {
|
|
1547
|
-
if (s(e) || n ===
|
|
1548
|
-
case
|
|
1549
|
-
case
|
|
1550
|
-
case
|
|
1551
|
-
case
|
|
1552
|
-
case
|
|
1553
|
-
case
|
|
1547
|
+
if (s(e) || n === L.name) switch (n) {
|
|
1548
|
+
case L.currency: return this.formatCurrency(e, t, r);
|
|
1549
|
+
case L.date: return this.formatDate(e, r);
|
|
1550
|
+
case L.name: return this.formatName(t, r);
|
|
1551
|
+
case L.number: return this.formatNumber(e, r);
|
|
1552
|
+
case L.plural: return this.formatPlural(e, r);
|
|
1553
|
+
case L.unit: return this.formatUnit(e, r);
|
|
1554
1554
|
default: return String(e);
|
|
1555
1555
|
}
|
|
1556
1556
|
return "";
|
|
1557
1557
|
}
|
|
1558
1558
|
formatCurrency(e, t, n) {
|
|
1559
1559
|
var r;
|
|
1560
|
-
let i = n != null && n.currencyPropName ?
|
|
1560
|
+
let i = n != null && n.currencyPropName ? I(t, n.currencyPropName) : t == null ? void 0 : t.currency;
|
|
1561
1561
|
return P.getInstance().currency(e, (r = n == null ? void 0 : n.options) == null ? i : r, n == null ? void 0 : n.numberOnly);
|
|
1562
1562
|
}
|
|
1563
1563
|
formatDate(e, t) {
|
|
@@ -1565,7 +1565,7 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
1565
1565
|
}
|
|
1566
1566
|
formatName(e, t) {
|
|
1567
1567
|
var n, r, i;
|
|
1568
|
-
let a =
|
|
1568
|
+
let a = I(e, (n = t == null ? void 0 : t.lastPropName) == null ? "lastName" : n), o = I(e, (r = t == null ? void 0 : t.firstPropName) == null ? "firstName" : r), s = I(e, (i = t == null ? void 0 : t.surname) == null ? "surname" : i);
|
|
1569
1569
|
return a && o ? P.getInstance().fullName(a, o, s, t == null ? void 0 : t.short) : "";
|
|
1570
1570
|
}
|
|
1571
1571
|
formatNumber(e, t) {
|
|
@@ -1577,12 +1577,12 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
1577
1577
|
formatUnit(e, t) {
|
|
1578
1578
|
return t && t.unit ? P.getInstance().unit(e, t.unit) : e;
|
|
1579
1579
|
}
|
|
1580
|
-
},
|
|
1581
|
-
constructor(e =
|
|
1580
|
+
}, Pe = "f", Fe = class e {
|
|
1581
|
+
constructor(e = S.getLocation()) {
|
|
1582
1582
|
this.code = e;
|
|
1583
1583
|
}
|
|
1584
1584
|
get(t = this.code) {
|
|
1585
|
-
let n =
|
|
1585
|
+
let n = S.find(t);
|
|
1586
1586
|
if (n) {
|
|
1587
1587
|
var r;
|
|
1588
1588
|
let t = this.getCountry(n);
|
|
@@ -1630,7 +1630,7 @@ var R = /* @__PURE__ */ function(e) {
|
|
|
1630
1630
|
return this.getLocation().countryName(e.country);
|
|
1631
1631
|
}
|
|
1632
1632
|
};
|
|
1633
|
-
y(
|
|
1633
|
+
y(Fe, "flags", {
|
|
1634
1634
|
AD: "f-ad",
|
|
1635
1635
|
AE: "f-ae",
|
|
1636
1636
|
AF: "f-af",
|
|
@@ -1875,7 +1875,7 @@ y(Pe, "flags", {
|
|
|
1875
1875
|
});
|
|
1876
1876
|
//#endregion
|
|
1877
1877
|
//#region src/classes/GeoPhone.ts
|
|
1878
|
-
var
|
|
1878
|
+
var R, z = class {
|
|
1879
1879
|
static get(e) {
|
|
1880
1880
|
return this.list.find((t) => e === t.value);
|
|
1881
1881
|
}
|
|
@@ -1929,11 +1929,11 @@ var Fe, z = class {
|
|
|
1929
1929
|
return (t = (n = e.match(/\*/g)) == null ? void 0 : n.length) == null ? 0 : t;
|
|
1930
1930
|
}
|
|
1931
1931
|
static makeList() {
|
|
1932
|
-
this.list = r(
|
|
1932
|
+
this.list = r(S.getList(), (e) => {
|
|
1933
1933
|
if (e != null && e.phoneMask) return {
|
|
1934
1934
|
phone: (e == null ? void 0 : e.phoneCode) && Number(e.phoneCode.replace(/[^0-9]+/, "")) || void 0,
|
|
1935
1935
|
within: (e == null ? void 0 : e.phoneWithin) || 0,
|
|
1936
|
-
mask:
|
|
1936
|
+
mask: w(e.phoneMask),
|
|
1937
1937
|
value: e.country
|
|
1938
1938
|
};
|
|
1939
1939
|
}).sort((e, t) => e.phone - t.phone);
|
|
@@ -1971,7 +1971,7 @@ var Fe, z = class {
|
|
|
1971
1971
|
return e.replace(/\*/, this.getWithinSymbol(t));
|
|
1972
1972
|
}
|
|
1973
1973
|
};
|
|
1974
|
-
|
|
1974
|
+
R = z, y(z, "list", []), y(z, "map", {}), R.makeList(), R.makeMap();
|
|
1975
1975
|
//#endregion
|
|
1976
1976
|
//#region src/classes/Global.ts
|
|
1977
1977
|
var B, Ie = class {
|
|
@@ -1981,7 +1981,7 @@ var B, Ie = class {
|
|
|
1981
1981
|
static add(e) {
|
|
1982
1982
|
B === void 0 && (B = t(e));
|
|
1983
1983
|
}
|
|
1984
|
-
},
|
|
1984
|
+
}, V, H = class {
|
|
1985
1985
|
static get(e, t) {
|
|
1986
1986
|
return !(e in this.hash) && t && this.set(e, t), this.hash[e];
|
|
1987
1987
|
}
|
|
@@ -2009,7 +2009,7 @@ var B, Ie = class {
|
|
|
2009
2009
|
}
|
|
2010
2010
|
static getLocation() {
|
|
2011
2011
|
let e = {};
|
|
2012
|
-
return location.hash.replace(/([\w-]+)[:=]([^;]+)/gi, (...t) => (e[String(t[1])] =
|
|
2012
|
+
return location.hash.replace(/([\w-]+)[:=]([^;]+)/gi, (...t) => (e[String(t[1])] = Ce(t[2]), "")), e;
|
|
2013
2013
|
}
|
|
2014
2014
|
static update() {
|
|
2015
2015
|
this.block = !0, history.replaceState(null, "", `#${i(this.hash, "=", ";")}`), requestAnimationFrame(() => {
|
|
@@ -2023,10 +2023,10 @@ var B, Ie = class {
|
|
|
2023
2023
|
});
|
|
2024
2024
|
}
|
|
2025
2025
|
};
|
|
2026
|
-
|
|
2026
|
+
V = H, y(H, "hash", {}), y(H, "watch", {}), y(H, "block", !1), d() && (V.reload(), addEventListener("hashchange", () => V.reload()));
|
|
2027
2027
|
//#endregion
|
|
2028
2028
|
//#region src/classes/Icons.ts
|
|
2029
|
-
var
|
|
2029
|
+
var Le, Re = "__UI_ICON", ze = 320, Be = "--LOAD--", U = class {
|
|
2030
2030
|
static is(e) {
|
|
2031
2031
|
return e in this.icons || this.getName(e) in this.icons;
|
|
2032
2032
|
}
|
|
@@ -2039,7 +2039,7 @@ var Re, H = "__UI_ICON", ze = 320, Be = "--LOAD--", U = class {
|
|
|
2039
2039
|
return r(this.icons, (e, t) => t.replace(/^@/, ""));
|
|
2040
2040
|
}
|
|
2041
2041
|
static getUrlGlobal() {
|
|
2042
|
-
return `${
|
|
2042
|
+
return `${A.isLocalhost(), ""}${this.url}`;
|
|
2043
2043
|
}
|
|
2044
2044
|
static add(e, t) {
|
|
2045
2045
|
this.icons[this.getName(e)] = t;
|
|
@@ -2063,17 +2063,17 @@ var Re, H = "__UI_ICON", ze = 320, Be = "--LOAD--", U = class {
|
|
|
2063
2063
|
return new Promise((e) => setTimeout(() => e(), ze));
|
|
2064
2064
|
}
|
|
2065
2065
|
};
|
|
2066
|
-
|
|
2066
|
+
Le = U, y(U, "icons", {}), y(U, "url", "/icons/"), d() && (Re in window || (window[Re] = {}), Le.icons = window[Re]);
|
|
2067
2067
|
//#endregion
|
|
2068
2068
|
//#region src/functions/getElementItem.ts
|
|
2069
2069
|
function Ve(e, t, n) {
|
|
2070
2070
|
var r, i;
|
|
2071
|
-
return (r = (i =
|
|
2071
|
+
return (r = (i = C(e)) == null ? void 0 : i[t]) == null ? n : r;
|
|
2072
2072
|
}
|
|
2073
2073
|
//#endregion
|
|
2074
2074
|
//#region src/functions/setElementItem.ts
|
|
2075
2075
|
function He(e, t, i) {
|
|
2076
|
-
let a =
|
|
2076
|
+
let a = C(e);
|
|
2077
2077
|
if (a) {
|
|
2078
2078
|
let e = Ve(a, t);
|
|
2079
2079
|
if (n(e) && n(i)) r(i, (t, n) => {
|
|
@@ -2314,7 +2314,7 @@ var G = class {
|
|
|
2314
2314
|
return this;
|
|
2315
2315
|
}
|
|
2316
2316
|
setKeywords(e) {
|
|
2317
|
-
return this.set(K.keywords,
|
|
2317
|
+
return this.set(K.keywords, w(e).join(", ")), this;
|
|
2318
2318
|
}
|
|
2319
2319
|
setDescription(e) {
|
|
2320
2320
|
return this.set(K.description, e), this;
|
|
@@ -2383,7 +2383,7 @@ var G = class {
|
|
|
2383
2383
|
});
|
|
2384
2384
|
}
|
|
2385
2385
|
};
|
|
2386
|
-
y(Y, "storage", new
|
|
2386
|
+
y(Y, "storage", new b("scrollbar", !0)), y(Y, "calculate", !1);
|
|
2387
2387
|
//#endregion
|
|
2388
2388
|
//#region src/functions/escapeExp.ts
|
|
2389
2389
|
function X(e) {
|
|
@@ -2441,8 +2441,8 @@ var nt = class {
|
|
|
2441
2441
|
toFormatItem(e, t) {
|
|
2442
2442
|
let n = {};
|
|
2443
2443
|
return this.columns && this.columns.forEach((r) => {
|
|
2444
|
-
let i = this.getColumnName(r), a =
|
|
2445
|
-
n[i] = s(a) && t ? this.addTag(a) :
|
|
2444
|
+
let i = this.getColumnName(r), a = I(e, r);
|
|
2445
|
+
n[i] = s(a) && t ? this.addTag(a) : F(a);
|
|
2446
2446
|
}), {
|
|
2447
2447
|
...e,
|
|
2448
2448
|
...n,
|
|
@@ -2453,7 +2453,7 @@ var nt = class {
|
|
|
2453
2453
|
return e.replace(/\.([a-z0-9])/gi, (e, t) => t.toUpperCase()) + "Search";
|
|
2454
2454
|
}
|
|
2455
2455
|
addTag(e) {
|
|
2456
|
-
return tt(
|
|
2456
|
+
return tt(F(e), this.item.get(), this.options.getClassName());
|
|
2457
2457
|
}
|
|
2458
2458
|
generateCache() {
|
|
2459
2459
|
if (!this.isList()) return [];
|
|
@@ -2461,8 +2461,8 @@ var nt = class {
|
|
|
2461
2461
|
for (let t of this.list) {
|
|
2462
2462
|
let n = "";
|
|
2463
2463
|
if (this.columns) for (let e of this.columns) {
|
|
2464
|
-
let r =
|
|
2465
|
-
s(r) && (n += ` ${
|
|
2464
|
+
let r = I(t, e);
|
|
2465
|
+
s(r) && (n += ` ${F(r)}`);
|
|
2466
2466
|
}
|
|
2467
2467
|
e.push({
|
|
2468
2468
|
item: t,
|
|
@@ -2639,7 +2639,7 @@ var st = class {
|
|
|
2639
2639
|
return c(t) && r(t, (e, t) => {
|
|
2640
2640
|
n = n.replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})(.*?)(?:\\[|\\{)\\/${t}(?:\\]|\\})`, "g"), (t, n) => String(e).replace(/(?:\[|\{)content(?:\]|\})/g, n)).replace(RegExp(`(?:\\[|\\{)${t}(?:\\]|\\})`, "g"), String(e));
|
|
2641
2641
|
}), n;
|
|
2642
|
-
}, ft = "global", pt =
|
|
2642
|
+
}, ft = "global", pt = 160, Z = class {
|
|
2643
2643
|
static isFile() {
|
|
2644
2644
|
return Object.keys(this.files).length > 0 && this.getIndex() !== void 0;
|
|
2645
2645
|
}
|
|
@@ -2656,8 +2656,8 @@ var st = class {
|
|
|
2656
2656
|
});
|
|
2657
2657
|
}
|
|
2658
2658
|
static getIndex() {
|
|
2659
|
-
if (
|
|
2660
|
-
if (
|
|
2659
|
+
if (S.getLocation() in this.files) return S.getLocation();
|
|
2660
|
+
if (S.getLanguage() in this.files) return S.getLanguage();
|
|
2661
2661
|
if ("global" in this.files) return ft;
|
|
2662
2662
|
}
|
|
2663
2663
|
static getByData(e) {
|
|
@@ -2665,8 +2665,8 @@ var st = class {
|
|
|
2665
2665
|
}
|
|
2666
2666
|
static async getByFile(e) {
|
|
2667
2667
|
if (e in this.files) {
|
|
2668
|
-
let t = await this.files[e]
|
|
2669
|
-
return this.data[e] = t, t;
|
|
2668
|
+
let t = await g(this.files[e]);
|
|
2669
|
+
return t && (this.data[e] = t), t;
|
|
2670
2670
|
}
|
|
2671
2671
|
}
|
|
2672
2672
|
};
|
|
@@ -2677,7 +2677,7 @@ var Q = class e {
|
|
|
2677
2677
|
static async get(e, t) {
|
|
2678
2678
|
var n;
|
|
2679
2679
|
let r = this.getText(e);
|
|
2680
|
-
return r ? this.replacement(r, t) : (
|
|
2680
|
+
return r ? this.replacement(r, t) : (A.isLocalhost() || await this.add(e), this.replacement((n = this.getText(e)) == null ? e : n));
|
|
2681
2681
|
}
|
|
2682
2682
|
static getSync(e, t = !1, n) {
|
|
2683
2683
|
let r = this.getText(e);
|
|
@@ -2708,7 +2708,7 @@ var Q = class e {
|
|
|
2708
2708
|
this.timeout = void 0, this.make().then(() => {
|
|
2709
2709
|
this.resolveList.forEach((e) => e()), this.resolveList = [];
|
|
2710
2710
|
});
|
|
2711
|
-
},
|
|
2711
|
+
}, 160)) : t();
|
|
2712
2712
|
});
|
|
2713
2713
|
}
|
|
2714
2714
|
static addSync(e) {
|
|
@@ -2717,7 +2717,7 @@ var Q = class e {
|
|
|
2717
2717
|
});
|
|
2718
2718
|
}
|
|
2719
2719
|
static async addNormalOrSync(e) {
|
|
2720
|
-
if (s(e)) if (
|
|
2720
|
+
if (s(e)) if (A.isLocalhost()) this.addSync(e);
|
|
2721
2721
|
else {
|
|
2722
2722
|
let t = Object.keys(e);
|
|
2723
2723
|
t.length > 0 && await this.add(t);
|
|
@@ -2753,22 +2753,22 @@ var Q = class e {
|
|
|
2753
2753
|
if (r in this.data) return this.data[r];
|
|
2754
2754
|
}
|
|
2755
2755
|
static getName(e) {
|
|
2756
|
-
return `${
|
|
2756
|
+
return `${S.getLocation()}-${e}`;
|
|
2757
2757
|
}
|
|
2758
2758
|
static getNameByLanguage(e) {
|
|
2759
|
-
return `${
|
|
2759
|
+
return `${S.getLanguage()}-${e}`;
|
|
2760
2760
|
}
|
|
2761
2761
|
static getNameByGlobal(e) {
|
|
2762
2762
|
return `${ft}-${e}`;
|
|
2763
2763
|
}
|
|
2764
2764
|
static getNamesNone(e) {
|
|
2765
2765
|
let t = [];
|
|
2766
|
-
return
|
|
2766
|
+
return w(e).forEach((e) => {
|
|
2767
2767
|
e !== "__TRANSLATE_START__" && e !== "__TRANSLATE_END__" && !(this.getName(e) in this.data) && t.push(e);
|
|
2768
2768
|
}), t;
|
|
2769
2769
|
}
|
|
2770
2770
|
static async getResponse() {
|
|
2771
|
-
let e = await
|
|
2771
|
+
let e = await A.get({
|
|
2772
2772
|
api: !1,
|
|
2773
2773
|
path: this.url,
|
|
2774
2774
|
request: { [this.propsName]: this.cache },
|
|
@@ -2819,22 +2819,55 @@ function _t(e) {
|
|
|
2819
2819
|
if (d()) return document.querySelectorAll(e);
|
|
2820
2820
|
}
|
|
2821
2821
|
//#endregion
|
|
2822
|
-
//#region src/functions/
|
|
2822
|
+
//#region src/functions/getElementImage.ts
|
|
2823
2823
|
function vt(e) {
|
|
2824
|
+
return l(e) ? W(void 0, "img", { src: e }) : e;
|
|
2825
|
+
}
|
|
2826
|
+
//#endregion
|
|
2827
|
+
//#region src/functions/resizeImageByMax.ts
|
|
2828
|
+
function yt(e, t = "auto") {
|
|
2829
|
+
switch (t) {
|
|
2830
|
+
case "auto": return e.naturalWidth >= e.naturalHeight;
|
|
2831
|
+
case "width": return !0;
|
|
2832
|
+
case "height": return !1;
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
function bt(e, t, n = "auto", r) {
|
|
2836
|
+
let i = vt(e);
|
|
2837
|
+
if (i && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
|
|
2838
|
+
var a;
|
|
2839
|
+
let e = yt(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
|
|
2840
|
+
if (o) return o.canvas.width = e ? t : i.naturalWidth / i.naturalHeight * t, o.canvas.height = e ? i.naturalHeight / i.naturalWidth * t : t, o.drawImage(i, 0, 0, o.canvas.width, o.canvas.height), o.canvas.toDataURL(r);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
//#endregion
|
|
2844
|
+
//#region src/functions/ensureMaxSize.ts
|
|
2845
|
+
async function xt(e, t = .56, n = "image/jpeg") {
|
|
2846
|
+
return new Promise((r) => {
|
|
2847
|
+
let i = new Blob([e], { type: n }), a = vt(URL.createObjectURL(i));
|
|
2848
|
+
a ? a.onload = () => {
|
|
2849
|
+
let e = bt(a, t * a.naturalWidth, "width", n);
|
|
2850
|
+
r(e == null ? "" : e);
|
|
2851
|
+
} : ht(i).then((e) => r(String(e == null ? "" : e)));
|
|
2852
|
+
});
|
|
2853
|
+
}
|
|
2854
|
+
//#endregion
|
|
2855
|
+
//#region src/functions/eventStopPropagation.ts
|
|
2856
|
+
function St(e) {
|
|
2824
2857
|
e.preventDefault(), e.stopPropagation();
|
|
2825
2858
|
}
|
|
2826
2859
|
//#endregion
|
|
2827
2860
|
//#region src/functions/frame.ts
|
|
2828
|
-
function
|
|
2861
|
+
function Ct(e, t, n) {
|
|
2829
2862
|
let r = () => {
|
|
2830
|
-
e(), t != null && t() ?
|
|
2863
|
+
e(), t != null && t() ? Ct(e, t, n) : n == null || n();
|
|
2831
2864
|
};
|
|
2832
2865
|
d() ? requestAnimationFrame(r) : r();
|
|
2833
2866
|
}
|
|
2834
2867
|
//#endregion
|
|
2835
2868
|
//#region src/functions/getAttributes.ts
|
|
2836
|
-
function
|
|
2837
|
-
let t = {}, n =
|
|
2869
|
+
function wt(e) {
|
|
2870
|
+
let t = {}, n = C(e);
|
|
2838
2871
|
if (n) for (let e of n.attributes) {
|
|
2839
2872
|
var r;
|
|
2840
2873
|
t[e.name] = (r = (e == null ? void 0 : e.value) || (e == null ? void 0 : e.textContent)) == null ? void 0 : r;
|
|
@@ -2843,71 +2876,66 @@ function bt(e) {
|
|
|
2843
2876
|
}
|
|
2844
2877
|
//#endregion
|
|
2845
2878
|
//#region src/functions/getClipboardData.ts
|
|
2846
|
-
async function
|
|
2879
|
+
async function Tt(e) {
|
|
2847
2880
|
var t, n;
|
|
2848
2881
|
return (t = e == null || (n = e.clipboardData) == null ? void 0 : n.getData("text")) == null ? await navigator.clipboard.readText() || "" : t;
|
|
2849
2882
|
}
|
|
2850
2883
|
//#endregion
|
|
2851
2884
|
//#region src/functions/getCurrentDate.ts
|
|
2852
|
-
function
|
|
2853
|
-
return new
|
|
2885
|
+
function Et(e = "datetime") {
|
|
2886
|
+
return new Ae(void 0, e).standard();
|
|
2854
2887
|
}
|
|
2855
2888
|
//#endregion
|
|
2856
2889
|
//#region src/functions/getElementId.ts
|
|
2857
|
-
var
|
|
2858
|
-
function
|
|
2859
|
-
let n =
|
|
2860
|
-
return n ? (s(n.id) || n.setAttribute("id", `id-${
|
|
2861
|
-
}
|
|
2862
|
-
//#endregion
|
|
2863
|
-
//#region src/functions/getElementImage.ts
|
|
2864
|
-
function Tt(e) {
|
|
2865
|
-
return l(e) ? W(void 0, "img", { src: e }) : e;
|
|
2890
|
+
var Dt = k(1e5, 9e5);
|
|
2891
|
+
function Ot(e, t) {
|
|
2892
|
+
let n = C(e);
|
|
2893
|
+
return n ? (s(n.id) || n.setAttribute("id", `id-${Dt++}`), t ? `#${n.id}${t}`.trim() : n.id) : `id-${Dt++}`;
|
|
2866
2894
|
}
|
|
2867
2895
|
//#endregion
|
|
2868
2896
|
//#region src/functions/getKey.ts
|
|
2869
|
-
function
|
|
2897
|
+
function kt(e) {
|
|
2870
2898
|
var t, n, r;
|
|
2871
2899
|
return (t = (n = e == null ? void 0 : e.key) == null ? e == null ? void 0 : e.code : n) == null ? e == null || (r = e.keyCode) == null ? void 0 : r.toString() : t;
|
|
2872
2900
|
}
|
|
2873
2901
|
//#endregion
|
|
2874
2902
|
//#region src/functions/getLengthOfAllArray.ts
|
|
2875
|
-
function
|
|
2903
|
+
function At(e) {
|
|
2876
2904
|
return r(e, (e) => e.length);
|
|
2877
2905
|
}
|
|
2878
2906
|
//#endregion
|
|
2879
2907
|
//#region src/functions/getMaxLengthAllArray.ts
|
|
2880
|
-
function
|
|
2881
|
-
return Math.max(...
|
|
2908
|
+
function jt(e) {
|
|
2909
|
+
return Math.max(...At(e));
|
|
2882
2910
|
}
|
|
2883
2911
|
//#endregion
|
|
2884
2912
|
//#region src/functions/getMinLengthAllArray.ts
|
|
2885
|
-
function
|
|
2886
|
-
return Math.min(...
|
|
2913
|
+
function Mt(e) {
|
|
2914
|
+
return Math.min(...At(e));
|
|
2887
2915
|
}
|
|
2888
2916
|
//#endregion
|
|
2889
2917
|
//#region src/functions/getMouseClientX.ts
|
|
2890
|
-
function
|
|
2918
|
+
function Nt(e) {
|
|
2891
2919
|
var t, n;
|
|
2892
2920
|
return (e == null ? void 0 : e.clientX) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientX) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientX) || 0;
|
|
2893
2921
|
}
|
|
2894
2922
|
//#endregion
|
|
2895
2923
|
//#region src/functions/getMouseClientY.ts
|
|
2896
|
-
function
|
|
2924
|
+
function Pt(e) {
|
|
2897
2925
|
var t, n;
|
|
2898
2926
|
return (e == null ? void 0 : e.clientY) || (e == null || (t = e.targetTouches) == null || (t = t[0]) == null ? void 0 : t.clientY) || (e == null || (n = e.touches) == null || (n = n[0]) == null ? void 0 : n.clientY) || 0;
|
|
2899
2927
|
}
|
|
2900
2928
|
//#endregion
|
|
2901
2929
|
//#region src/functions/getMouseClient.ts
|
|
2902
|
-
function
|
|
2930
|
+
function Ft(e) {
|
|
2903
2931
|
return {
|
|
2904
|
-
x:
|
|
2905
|
-
y:
|
|
2932
|
+
x: Nt(e),
|
|
2933
|
+
y: Pt(e)
|
|
2906
2934
|
};
|
|
2907
2935
|
}
|
|
2908
2936
|
//#endregion
|
|
2909
2937
|
//#region src/functions/getObjectByKeys.ts
|
|
2910
|
-
function
|
|
2938
|
+
function It(e, t) {
|
|
2911
2939
|
let n = {};
|
|
2912
2940
|
return t.forEach((t) => {
|
|
2913
2941
|
t in e && e[t] !== void 0 && (n[t] = e[t]);
|
|
@@ -2915,7 +2943,7 @@ function Nt(e, t) {
|
|
|
2915
2943
|
}
|
|
2916
2944
|
//#endregion
|
|
2917
2945
|
//#region src/functions/getObjectNoUndefined.ts
|
|
2918
|
-
function
|
|
2946
|
+
function Lt(e, t = void 0) {
|
|
2919
2947
|
let n = {};
|
|
2920
2948
|
return r(e, (e, r) => {
|
|
2921
2949
|
e !== t && (n[r] = e);
|
|
@@ -2923,49 +2951,49 @@ function Pt(e, t = void 0) {
|
|
|
2923
2951
|
}
|
|
2924
2952
|
//#endregion
|
|
2925
2953
|
//#region src/functions/getObjectOrNone.ts
|
|
2926
|
-
function
|
|
2954
|
+
function Rt(e) {
|
|
2927
2955
|
return c(e) ? e : {};
|
|
2928
2956
|
}
|
|
2929
2957
|
//#endregion
|
|
2930
2958
|
//#region src/functions/strFill.ts
|
|
2931
|
-
function
|
|
2959
|
+
function zt(e, t) {
|
|
2932
2960
|
return mt(e, t).join("");
|
|
2933
2961
|
}
|
|
2934
2962
|
//#endregion
|
|
2935
2963
|
//#region src/functions/getRandomText.ts
|
|
2936
|
-
function
|
|
2937
|
-
let a =
|
|
2938
|
-
for (let e = 0; e < a; e++) o.push(
|
|
2964
|
+
function Bt(e, t, n = "#", r = 2, i = 12) {
|
|
2965
|
+
let a = k(e, t), o = [];
|
|
2966
|
+
for (let e = 0; e < a; e++) o.push(zt(n, k(r, i)));
|
|
2939
2967
|
return o.join(" ");
|
|
2940
2968
|
}
|
|
2941
2969
|
//#endregion
|
|
2942
2970
|
//#region src/functions/getStepPercent.ts
|
|
2943
|
-
function
|
|
2971
|
+
function Vt(e, t) {
|
|
2944
2972
|
let n = e == null ? 0 : e;
|
|
2945
2973
|
return t > n ? 100 / (t - n) : 0;
|
|
2946
2974
|
}
|
|
2947
2975
|
//#endregion
|
|
2948
2976
|
//#region src/functions/getStepValue.ts
|
|
2949
|
-
function
|
|
2977
|
+
function Ht(e, t) {
|
|
2950
2978
|
let n = e == null ? 0 : e;
|
|
2951
2979
|
return t > n ? (t - n) / 100 : 0;
|
|
2952
2980
|
}
|
|
2953
2981
|
//#endregion
|
|
2954
2982
|
//#region src/functions/goScroll.ts
|
|
2955
|
-
var
|
|
2956
|
-
function
|
|
2983
|
+
var Ut = 0;
|
|
2984
|
+
function Wt(e, t, n) {
|
|
2957
2985
|
let r = t == null ? void 0 : t.closest(e);
|
|
2958
2986
|
if (t && r && r.scrollHeight !== r.offsetHeight) {
|
|
2959
2987
|
let e = r.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
2960
2988
|
if (n) {
|
|
2961
2989
|
let a = n.getBoundingClientRect();
|
|
2962
2990
|
r.scrollTop = t.offsetTop - (a.top - e.top) - (a.height / 2 - i.height / 2), r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = t.offsetTop + t.offsetHeight - r.offsetHeight);
|
|
2963
|
-
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top -
|
|
2991
|
+
} else r.scrollTop > t.offsetTop ? r.scrollTop = i.top - e.top - Ut : r.scrollTop + r.offsetHeight < t.offsetTop + t.offsetHeight && (r.scrollTop = i.top - e.top + i.height - e.height + Ut);
|
|
2964
2992
|
}
|
|
2965
2993
|
}
|
|
2966
2994
|
//#endregion
|
|
2967
2995
|
//#region src/functions/goScrollSmooth.ts
|
|
2968
|
-
function
|
|
2996
|
+
function Gt(e, t, n = 0) {
|
|
2969
2997
|
if (!d()) return;
|
|
2970
2998
|
let r = (t == null ? void 0 : t.behavior) || "smooth";
|
|
2971
2999
|
if ("scrollIntoView" in e && !n) {
|
|
@@ -2987,7 +3015,7 @@ function Ht(e, t, n = 0) {
|
|
|
2987
3015
|
}
|
|
2988
3016
|
//#endregion
|
|
2989
3017
|
//#region src/functions/goScrollTo.ts
|
|
2990
|
-
function
|
|
3018
|
+
function Kt(e, t, n = "smooth") {
|
|
2991
3019
|
if (!d() || !e || !t) return;
|
|
2992
3020
|
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
2993
3021
|
e.scrollBy({
|
|
@@ -2998,12 +3026,12 @@ function Ut(e, t, n = "smooth") {
|
|
|
2998
3026
|
}
|
|
2999
3027
|
//#endregion
|
|
3000
3028
|
//#region src/functions/inArray.ts
|
|
3001
|
-
function
|
|
3029
|
+
function qt(e, t) {
|
|
3002
3030
|
return e.indexOf(t) !== -1;
|
|
3003
3031
|
}
|
|
3004
3032
|
//#endregion
|
|
3005
3033
|
//#region src/functions/initScrollbarOffset.ts
|
|
3006
|
-
async function
|
|
3034
|
+
async function Jt() {
|
|
3007
3035
|
if (d()) {
|
|
3008
3036
|
let e = await Y.get();
|
|
3009
3037
|
document.body.style.setProperty("--sys-scrollbar-offset", `${e}px`);
|
|
@@ -3011,7 +3039,7 @@ async function Gt() {
|
|
|
3011
3039
|
}
|
|
3012
3040
|
//#endregion
|
|
3013
3041
|
//#region src/functions/intersectKey.ts
|
|
3014
|
-
function
|
|
3042
|
+
function Yt(e, t) {
|
|
3015
3043
|
let i = {};
|
|
3016
3044
|
return n(e) && n(t) && r(e, (e, n) => {
|
|
3017
3045
|
n in t && (i[n] = e);
|
|
@@ -3019,13 +3047,13 @@ function Kt(e, t) {
|
|
|
3019
3047
|
}
|
|
3020
3048
|
//#endregion
|
|
3021
3049
|
//#region src/functions/isApiSuccess.ts
|
|
3022
|
-
var
|
|
3050
|
+
var Xt = (e) => {
|
|
3023
3051
|
var t;
|
|
3024
|
-
return a(e) ? !0 : !!(e && c(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && String(e.statusObject.status).match(/^2/) || !("status" in e) && !("success" in e) && !("statusObject" in e) && String(
|
|
3052
|
+
return a(e) ? !0 : !!(e && c(e) && ((e == null ? void 0 : e.status) === "success" || e != null && e.success || !(e == null || (t = e.statusObject) == null) && t.status && String(e.statusObject.status).match(/^2/) || !("status" in e) && !("success" in e) && !("statusObject" in e) && String(A.getStatus().getStatus()).match(/^2/)));
|
|
3025
3053
|
};
|
|
3026
3054
|
//#endregion
|
|
3027
3055
|
//#region src/functions/isDifferent.ts
|
|
3028
|
-
function
|
|
3056
|
+
function Zt(e, t) {
|
|
3029
3057
|
let n = Object.keys(e).length !== Object.keys(t).length;
|
|
3030
3058
|
return n || r(e, (e, r) => {
|
|
3031
3059
|
e !== (t == null ? void 0 : t[r]) && (n = !0);
|
|
@@ -3033,16 +3061,16 @@ function Jt(e, t) {
|
|
|
3033
3061
|
}
|
|
3034
3062
|
//#endregion
|
|
3035
3063
|
//#region src/functions/isInput.ts
|
|
3036
|
-
var
|
|
3064
|
+
var Qt = (e) => {
|
|
3037
3065
|
if (e instanceof HTMLElement) {
|
|
3038
3066
|
let t = e.tagName.toLowerCase();
|
|
3039
3067
|
return !!(t === "input" || t === "textarea" || t === "select" || e.isContentEditable || e.getAttribute("contenteditable") === "true");
|
|
3040
3068
|
}
|
|
3041
3069
|
return !1;
|
|
3042
|
-
},
|
|
3070
|
+
}, $t = (e, t) => e.code === "Space" || e.code === "Enter" || e.key === " " || e.key === "Spacebar" || e.key === "Enter" || e.keyCode === 13 || e.keyCode === 32 ? t === void 0 ? !Qt(e.target) : !t : !1;
|
|
3043
3071
|
//#endregion
|
|
3044
3072
|
//#region src/functions/isFloat.ts
|
|
3045
|
-
function
|
|
3073
|
+
function en(e) {
|
|
3046
3074
|
switch (typeof e) {
|
|
3047
3075
|
case "number": return !0;
|
|
3048
3076
|
case "string": return !!e.match(/^([0-9]+|[0-9]+\.[0-9]+)$/);
|
|
@@ -3051,18 +3079,18 @@ function Zt(e) {
|
|
|
3051
3079
|
}
|
|
3052
3080
|
//#endregion
|
|
3053
3081
|
//#region src/functions/isIntegerBetween.ts
|
|
3054
|
-
function
|
|
3082
|
+
function tn(e, t) {
|
|
3055
3083
|
let n = Math.floor(t);
|
|
3056
3084
|
return e >= n && e < n + 1;
|
|
3057
3085
|
}
|
|
3058
3086
|
//#endregion
|
|
3059
3087
|
//#region src/functions/isSelectedByList.ts
|
|
3060
|
-
function
|
|
3088
|
+
function nn(e, t) {
|
|
3061
3089
|
return Array.isArray(e) ? e.every((e) => m(e, t)) : m(e, t);
|
|
3062
3090
|
}
|
|
3063
3091
|
//#endregion
|
|
3064
3092
|
//#region src/functions/removeCommonPrefix.ts
|
|
3065
|
-
function
|
|
3093
|
+
function rn(e, t) {
|
|
3066
3094
|
if (e.startsWith(t)) return e.slice(t.length).trim();
|
|
3067
3095
|
let n = 0;
|
|
3068
3096
|
for (; e[n] === t[n] && n < e.length && n < t.length;) n++;
|
|
@@ -3070,13 +3098,13 @@ function en(e, t) {
|
|
|
3070
3098
|
}
|
|
3071
3099
|
//#endregion
|
|
3072
3100
|
//#region src/functions/replaceComponentName.ts
|
|
3073
|
-
var
|
|
3101
|
+
var an = (e, t, n) => {
|
|
3074
3102
|
var r;
|
|
3075
3103
|
return e == null || (r = e.replace(RegExp(`<${t}`, "ig"), `<${n}`)) == null || (r = r.replace(RegExp(`</${t}`, "ig"), `</${n}`)) == null ? void 0 : r.trim();
|
|
3076
3104
|
};
|
|
3077
3105
|
//#endregion
|
|
3078
3106
|
//#region src/functions/uniqueArray.ts
|
|
3079
|
-
function
|
|
3107
|
+
function on(e) {
|
|
3080
3108
|
return [...new Set(e)];
|
|
3081
3109
|
}
|
|
3082
3110
|
//#endregion
|
|
@@ -3085,43 +3113,26 @@ function $(e, t, i = !0) {
|
|
|
3085
3113
|
let a = u(e);
|
|
3086
3114
|
return n(e) && n(t) && r(t, (t, r) => {
|
|
3087
3115
|
let o = e == null ? void 0 : e[r];
|
|
3088
|
-
n(o) && n(t) ? i && Array.isArray(o) && Array.isArray(t) ? a[r] = u(
|
|
3116
|
+
n(o) && n(t) ? i && Array.isArray(o) && Array.isArray(t) ? a[r] = u(on([...o, ...t])) : a[r] = $(Array.isArray(o) ? { ...o } : o, t, i) : a[r] = n(t) ? u(t) : t;
|
|
3089
3117
|
}), a;
|
|
3090
3118
|
}
|
|
3091
3119
|
//#endregion
|
|
3092
3120
|
//#region src/functions/replaceTemplate.ts
|
|
3093
|
-
function
|
|
3121
|
+
function sn(e, t) {
|
|
3094
3122
|
let n = e;
|
|
3095
3123
|
return r(t, (e, t) => {
|
|
3096
3124
|
n = n.replace(it(`[${t}]`), g(e));
|
|
3097
3125
|
}), n;
|
|
3098
3126
|
}
|
|
3099
3127
|
//#endregion
|
|
3100
|
-
//#region src/functions/resizeImageByMax.ts
|
|
3101
|
-
function an(e, t = "auto") {
|
|
3102
|
-
switch (t) {
|
|
3103
|
-
case "auto": return e.naturalWidth >= e.naturalHeight;
|
|
3104
|
-
case "width": return !0;
|
|
3105
|
-
case "height": return !1;
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
function on(e, t, n = "auto", r) {
|
|
3109
|
-
let i = Tt(e);
|
|
3110
|
-
if (i && (i.naturalWidth > t && (n === "auto" || n === "width") || i.naturalHeight > t && (n === "auto" || n === "height"))) {
|
|
3111
|
-
var a;
|
|
3112
|
-
let e = an(i, n), o = (a = document.createElement("canvas")) == null ? void 0 : a.getContext("2d");
|
|
3113
|
-
if (o) return o.canvas.width = e ? t : i.naturalWidth / i.naturalHeight * t, o.canvas.height = e ? i.naturalHeight / i.naturalWidth * t : t, o.drawImage(i, 0, 0, o.canvas.width, o.canvas.height), o.canvas.toDataURL(r);
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
//#endregion
|
|
3117
3128
|
//#region src/functions/secondToTime.ts
|
|
3118
|
-
function
|
|
3129
|
+
function cn(e) {
|
|
3119
3130
|
let t = p(e);
|
|
3120
3131
|
return t > 0 ? `${String(Math.floor(t / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}` : "00:00";
|
|
3121
3132
|
}
|
|
3122
3133
|
//#endregion
|
|
3123
3134
|
//#region src/functions/setValues.ts
|
|
3124
|
-
function
|
|
3135
|
+
function ln(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: i = !0, notEmpty: o = !1 }) {
|
|
3125
3136
|
if (n) {
|
|
3126
3137
|
if (a(e)) {
|
|
3127
3138
|
let n = e.indexOf(t), i = [...e];
|
|
@@ -3133,7 +3144,7 @@ function cn(e, t, { multiple: n = !1, maxlength: r = 0, alwaysChange: i = !0, no
|
|
|
3133
3144
|
}
|
|
3134
3145
|
//#endregion
|
|
3135
3146
|
//#region src/functions/splice.ts
|
|
3136
|
-
function
|
|
3147
|
+
function un(e, t, i) {
|
|
3137
3148
|
if (n(e) && n(t)) {
|
|
3138
3149
|
if (i) {
|
|
3139
3150
|
let a = {}, o = !1;
|
|
@@ -3147,34 +3158,34 @@ function ln(e, t, i) {
|
|
|
3147
3158
|
}
|
|
3148
3159
|
//#endregion
|
|
3149
3160
|
//#region src/functions/toCamelCaseFirst.ts
|
|
3150
|
-
function
|
|
3151
|
-
return
|
|
3161
|
+
function dn(e) {
|
|
3162
|
+
return Me(e).replace(/^([a-z])/, (e) => `${e.toUpperCase()}`);
|
|
3152
3163
|
}
|
|
3153
3164
|
//#endregion
|
|
3154
3165
|
//#region src/functions/toKebabCase.ts
|
|
3155
|
-
function
|
|
3166
|
+
function fn(e) {
|
|
3156
3167
|
return e.toString().trim().replace(/[^\w-. ]+/g, "").replace(/[ .]+/g, "-").replace(/(?<=[A-Z])([A-Z])/g, (e) => `${e.toLowerCase()}`).replace(/^[A-Z]/, (e) => e.toLowerCase()).replace(/(?<=[\w ])[A-Z]/g, (e) => `-${e.toLowerCase()}`).replace(/[A-Z]/g, (e) => e.toLowerCase());
|
|
3157
3168
|
}
|
|
3158
3169
|
//#endregion
|
|
3159
3170
|
//#region src/functions/toNumberByMax.ts
|
|
3160
|
-
function
|
|
3171
|
+
function pn(e, t, n, r) {
|
|
3161
3172
|
let i = p(e), a = p(t);
|
|
3162
|
-
return t && a < i ? `${
|
|
3173
|
+
return t && a < i ? `${mn(a, n, r)}+` : mn(i, n, r);
|
|
3163
3174
|
}
|
|
3164
|
-
var
|
|
3175
|
+
var mn = (e, t, n) => t ? new P(n).number(e) : e;
|
|
3165
3176
|
//#endregion
|
|
3166
3177
|
//#region src/functions/toPercent.ts
|
|
3167
|
-
function
|
|
3178
|
+
function hn(e, t) {
|
|
3168
3179
|
return 1 / e * t;
|
|
3169
3180
|
}
|
|
3170
3181
|
//#endregion
|
|
3171
3182
|
//#region src/functions/toPercentBy100.ts
|
|
3172
|
-
function
|
|
3173
|
-
return
|
|
3183
|
+
function gn(e, t) {
|
|
3184
|
+
return hn(e, t) * 100;
|
|
3174
3185
|
}
|
|
3175
3186
|
//#endregion
|
|
3176
3187
|
//#region src/functions/uint8ArrayToBase64.ts
|
|
3177
|
-
function
|
|
3188
|
+
function _n(e) {
|
|
3178
3189
|
let t = "";
|
|
3179
3190
|
for (let n of e) t += String.fromCharCode(n);
|
|
3180
3191
|
if (d()) return window.btoa(t);
|
|
@@ -3186,7 +3197,7 @@ function gn(e) {
|
|
|
3186
3197
|
}
|
|
3187
3198
|
//#endregion
|
|
3188
3199
|
//#region src/functions/writeClipboardData.ts
|
|
3189
|
-
async function
|
|
3200
|
+
async function vn(e) {
|
|
3190
3201
|
if (d()) try {
|
|
3191
3202
|
await navigator.clipboard.writeText(e);
|
|
3192
3203
|
} catch (n) {
|
|
@@ -3195,4 +3206,4 @@ async function _n(e) {
|
|
|
3195
3206
|
}
|
|
3196
3207
|
}
|
|
3197
3208
|
//#endregion
|
|
3198
|
-
export {
|
|
3209
|
+
export { A as Api, de as ApiDefault, ue as ApiHeaders, D as ApiMethodItem, he as ApiPreparation, me as ApiResponse, O as ApiStatus, _e as BroadcastMessage, be as Cache, ye as CacheItem, Se as CacheStatic, Ee as Cookie, j as CookieBlock, b as DataStorage, Ae as Datetime, T as EventItem, Ne as Formatters, L as FormattersType, Pe as GEO_FLAG_ICON_NAME, S as Geo, Fe as GeoFlag, P as GeoIntl, z as GeoPhone, Ie as Global, H as Hash, U as Icons, E as Loading, $e as Meta, G as MetaManager, Ze as MetaOg, Je as MetaOpenGraphAge, Ke as MetaOpenGraphAvailability, qe as MetaOpenGraphCondition, Ye as MetaOpenGraphGender, q as MetaOpenGraphTag, Ge as MetaOpenGraphType, We as MetaRobots, K as MetaTag, Qe as MetaTwitter, Xe as MetaTwitterCard, J as MetaTwitterTag, Y as ScrollbarWidth, lt as SearchList, nt as SearchListData, rt as SearchListItem, st as SearchListMatcher, ct as SearchListOptions, ft as TRANSLATE_GLOBAL_PREFIX, pt as TRANSLATE_TIME_OUT, Q as Translate, Z as TranslateFile, tt as addTagHighlightMatch, F as anyToString, dt as applyTemplate, mt as arrFill, ht as blobToBase64, u as copyObject, t as copyObjectLite, W as createElement, gt as domQuerySelector, _t as domQuerySelectorAll, Ue as encodeAttribute, xt as ensureMaxSize, X as escapeExp, St as eventStopPropagation, g as executeFunction, fe as executePromise, r as forEach, Ct as frame, wt as getAttributes, Tt as getClipboardData, Oe as getColumn, Et as getCurrentDate, C as getElement, Ot as getElementId, vt as getElementImage, Ve as getElementItem, oe as getElementOrWindow, at as getExactSearchExp, it as getExp, I as getItemByPath, kt as getKey, At as getLengthOfAllArray, jt as getMaxLengthAllArray, Mt as getMinLengthAllArray, Ft as getMouseClient, Nt as getMouseClientX, Pt as getMouseClientY, It as getObjectByKeys, Lt as getObjectNoUndefined, Rt as getObjectOrNone, Bt as getRandomText, i as getRequestString, ot as getSearchExp, et as getSeparatingSearchExp, Vt as getStepPercent, Ht as getStepValue, Wt as goScroll, Gt as goScrollSmooth, Kt as goScrollTo, qt as inArray, Jt as initScrollbarOffset, Yt as intersectKey, Xt as isApiSuccess, a as isArray, Zt as isDifferent, _ as isDomData, d as isDomRuntime, $t as isEnter, s as isFilled, en as isFloat, h as isFunction, se as isInDom, Qt as isInput, tn as isIntegerBetween, o as isNull, f as isNumber, n as isObject, c as isObjectNotArray, m as isSelected, nn as isSelectedByList, l as isString, ae as isWindow, k as random, rn as removeCommonPrefix, an as replaceComponentName, $ as replaceRecursive, sn as replaceTemplate, bt as resizeImageByMax, cn as secondToTime, He as setElementItem, ln as setValues, un as splice, zt as strFill, je as strSplit, w as toArray, Me as toCamelCase, dn as toCamelCaseFirst, N as toDate, fn as toKebabCase, p as toNumber, pn as toNumberByMax, hn as toPercent, gn as toPercentBy100, Ce as transformation, _n as uint8ArrayToBase64, on as uniqueArray, vn as writeClipboardData };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/functional-basic",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Foundational utility library for modern web development — HTTP client, geolocation, i18n, SEO meta tags, caching, storage, DOM utilities, and more. Framework-agnostic, zero dependencies, TypeScript-first.",
|
|
7
7
|
"keywords": [
|