@e1011/es-kit 1.5.2 → 1.5.4
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/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.js +1 -1
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/array.js +1 -1
- package/dist/lib/cjs/src/core/utils/array.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/date.js +1 -1
- package/dist/lib/cjs/src/core/utils/date.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/other.js +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/other.js.map +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/textValueOperations.js +1 -1
- package/dist/lib/cjs/src/core/utils/helpers/textValueOperations.js.map +1 -1
- package/dist/lib/cjs/src/index.js +1 -1
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js +9 -10
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -1
- package/dist/lib/esm/src/core/utils/array.js +2 -18
- package/dist/lib/esm/src/core/utils/array.js.map +1 -1
- package/dist/lib/esm/src/core/utils/date.js +38 -42
- package/dist/lib/esm/src/core/utils/date.js.map +1 -1
- package/dist/lib/esm/src/core/utils/helpers/other.js +24 -19
- package/dist/lib/esm/src/core/utils/helpers/other.js.map +1 -1
- package/dist/lib/esm/src/core/utils/helpers/textValueOperations.js +13 -14
- package/dist/lib/esm/src/core/utils/helpers/textValueOperations.js.map +1 -1
- package/dist/lib/esm/src/index.js +57 -59
- package/dist/lib/esm/src/index.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/index.d.ts +0 -2
- package/dist/types/src/core/utils/appState/peregrineMQ/index.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/peregrineMQ.d.ts.map +1 -1
- package/dist/types/src/core/utils/appState/peregrineMQ/peregrineMQ.stories.d.ts.map +1 -1
- package/dist/types/src/core/utils/array.d.ts +2 -10
- package/dist/types/src/core/utils/array.d.ts.map +1 -1
- package/dist/types/src/core/utils/array.spec.d.ts +1 -1
- package/dist/types/src/core/utils/array.spec.d.ts.map +1 -1
- package/dist/types/src/core/utils/date.d.ts.map +1 -1
- package/dist/types/src/core/utils/helpers/other.d.ts +8 -3
- package/dist/types/src/core/utils/helpers/other.d.ts.map +1 -1
- package/dist/types/src/core/utils/helpers/textValueOperations.d.ts.map +1 -1
- package/dist/types/src/core/utils/keyExtractor.d.ts +1 -1
- package/dist/types/src/core/utils/keyExtractor.d.ts.map +1 -1
- package/dist/utils/appState/peregrineMQ/peregrineMQ.js +2 -0
- package/dist/utils/appState/peregrineMQ/peregrineMQ.js.map +1 -0
- package/dist/utils/appState/peregrineMQ/peregrineMQ.types.js.map +1 -0
- package/dist/utils/appState/stateMachine/tiny-state-machine.base.js.map +1 -0
- package/dist/utils/appState/store/store.vanillajs.js.map +1 -0
- package/dist/utils/appState/store/store.vanillajs.templates.js.map +1 -0
- package/dist/utils/array.js +2 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/date.js +2 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/esm/{src/core/utils/appState → appState}/peregrineMQ/peregrineMQ.js +9 -10
- package/dist/utils/esm/appState/peregrineMQ/peregrineMQ.js.map +1 -0
- package/dist/utils/esm/appState/peregrineMQ/peregrineMQ.types.js.map +1 -0
- package/dist/utils/esm/appState/stateMachine/tiny-state-machine.base.js.map +1 -0
- package/dist/utils/esm/appState/store/store.vanillajs.js.map +1 -0
- package/dist/utils/esm/appState/store/store.vanillajs.templates.js.map +1 -0
- package/dist/utils/esm/array.js +6 -0
- package/dist/utils/esm/array.js.map +1 -0
- package/dist/utils/esm/date.js +100 -0
- package/dist/utils/esm/date.js.map +1 -0
- package/dist/utils/esm/helpers/birthnumber.validator.js.map +1 -0
- package/dist/utils/esm/helpers/birthnumberCZSKvalidator.js.map +1 -0
- package/dist/utils/esm/helpers/cancelableDelayedFunction.js.map +1 -0
- package/dist/utils/esm/helpers/date.js.map +1 -0
- package/dist/utils/esm/helpers/deviceInfo.js.map +1 -0
- package/dist/utils/esm/helpers/emailMatcher.js.map +1 -0
- package/dist/utils/esm/helpers/file.js.map +1 -0
- package/dist/utils/esm/helpers/fileValidator.js.map +1 -0
- package/dist/utils/esm/helpers/objectOperations.js.map +1 -0
- package/dist/utils/esm/helpers/other.js +29 -0
- package/dist/utils/esm/helpers/other.js.map +1 -0
- package/dist/utils/esm/helpers/text.js.map +1 -0
- package/dist/utils/esm/helpers/textValueOperations.js +17 -0
- package/dist/utils/esm/helpers/textValueOperations.js.map +1 -0
- package/dist/utils/esm/helpers/ui.js.map +1 -0
- package/dist/utils/esm/helpers/valueOperations.js.map +1 -0
- package/dist/utils/esm/index.js +125 -0
- package/dist/utils/esm/{src/core/utils/index.js.map → index.js.map} +1 -1
- package/dist/utils/esm/keyExtractor.js.map +1 -0
- package/dist/utils/esm/webComponents/webComponent.utils.js.map +1 -0
- package/dist/utils/helpers/birthnumber.validator.js.map +1 -0
- package/dist/utils/helpers/birthnumberCZSKvalidator.js.map +1 -0
- package/dist/utils/helpers/cancelableDelayedFunction.js.map +1 -0
- package/dist/utils/helpers/date.js.map +1 -0
- package/dist/utils/helpers/deviceInfo.js.map +1 -0
- package/dist/utils/helpers/emailMatcher.js.map +1 -0
- package/dist/utils/helpers/file.js.map +1 -0
- package/dist/utils/helpers/fileValidator.js.map +1 -0
- package/dist/utils/helpers/objectOperations.js.map +1 -0
- package/dist/utils/helpers/other.js +2 -0
- package/dist/utils/helpers/other.js.map +1 -0
- package/dist/utils/helpers/text.js.map +1 -0
- package/dist/utils/helpers/textValueOperations.js +2 -0
- package/dist/utils/helpers/textValueOperations.js.map +1 -0
- package/dist/utils/helpers/ui.js.map +1 -0
- package/dist/utils/helpers/valueOperations.js.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/keyExtractor.js.map +1 -0
- package/dist/utils/webComponents/webComponent.utils.js.map +1 -0
- package/package.json +21 -5
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/native.js +0 -2
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/rng.js +0 -2
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/stringify.js +0 -2
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/v4.js +0 -2
- package/dist/lib/cjs/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/index.js +0 -2
- package/dist/lib/cjs/src/core/utils/appState/peregrineMQ/index.js.map +0 -1
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/rng.js +0 -11
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/stringify.js +0 -10
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/v4.js +0 -14
- package/dist/lib/esm/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/index.js +0 -9
- package/dist/lib/esm/src/core/utils/appState/peregrineMQ/index.js.map +0 -1
- package/dist/ui/styles/generic.anims.css +0 -169
- package/dist/ui/styles/generic.anims.css.map +0 -1
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/native.js +0 -7
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/rng.js +0 -11
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/stringify.js +0 -10
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/v4.js +0 -14
- package/dist/utils/esm/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/index.js +0 -9
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/index.js.map +0 -1
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +0 -1
- package/dist/utils/esm/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js.map +0 -1
- package/dist/utils/esm/src/core/utils/appState/stateMachine/tiny-state-machine.base.js.map +0 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.js.map +0 -1
- package/dist/utils/esm/src/core/utils/appState/store/store.vanillajs.templates.js.map +0 -1
- package/dist/utils/esm/src/core/utils/array.js +0 -22
- package/dist/utils/esm/src/core/utils/array.js.map +0 -1
- package/dist/utils/esm/src/core/utils/date.js +0 -104
- package/dist/utils/esm/src/core/utils/date.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/birthnumber.validator.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/birthnumberCZSKvalidator.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/cancelableDelayedFunction.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/date.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/deviceInfo.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/emailMatcher.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/file.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/fileValidator.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/objectOperations.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/other.js +0 -24
- package/dist/utils/esm/src/core/utils/helpers/other.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/text.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/textValueOperations.js +0 -18
- package/dist/utils/esm/src/core/utils/helpers/textValueOperations.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/ui.js.map +0 -1
- package/dist/utils/esm/src/core/utils/helpers/valueOperations.js.map +0 -1
- package/dist/utils/esm/src/core/utils/index.js +0 -127
- package/dist/utils/esm/src/core/utils/keyExtractor.js.map +0 -1
- package/dist/utils/esm/src/core/utils/webComponents/webComponent.utils.js.map +0 -1
- package/dist/utils/node_modules/uuid/dist/esm-browser/native.js +0 -2
- package/dist/utils/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
- package/dist/utils/node_modules/uuid/dist/esm-browser/rng.js +0 -2
- package/dist/utils/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
- package/dist/utils/node_modules/uuid/dist/esm-browser/stringify.js +0 -2
- package/dist/utils/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/dist/utils/node_modules/uuid/dist/esm-browser/v4.js +0 -2
- package/dist/utils/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
- package/dist/utils/src/core/utils/appState/peregrineMQ/index.js +0 -2
- package/dist/utils/src/core/utils/appState/peregrineMQ/index.js.map +0 -1
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.js +0 -2
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.js.map +0 -1
- package/dist/utils/src/core/utils/appState/peregrineMQ/peregrineMQ.types.js.map +0 -1
- package/dist/utils/src/core/utils/appState/stateMachine/tiny-state-machine.base.js.map +0 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.js.map +0 -1
- package/dist/utils/src/core/utils/appState/store/store.vanillajs.templates.js.map +0 -1
- package/dist/utils/src/core/utils/array.js +0 -2
- package/dist/utils/src/core/utils/array.js.map +0 -1
- package/dist/utils/src/core/utils/date.js +0 -2
- package/dist/utils/src/core/utils/date.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/birthnumber.validator.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/birthnumberCZSKvalidator.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/cancelableDelayedFunction.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/date.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/deviceInfo.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/emailMatcher.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/file.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/fileValidator.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/objectOperations.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/other.js +0 -2
- package/dist/utils/src/core/utils/helpers/other.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/text.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/textValueOperations.js +0 -2
- package/dist/utils/src/core/utils/helpers/textValueOperations.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/ui.js.map +0 -1
- package/dist/utils/src/core/utils/helpers/valueOperations.js.map +0 -1
- package/dist/utils/src/core/utils/index.js +0 -2
- package/dist/utils/src/core/utils/keyExtractor.js.map +0 -1
- package/dist/utils/src/core/utils/webComponents/webComponent.utils.js.map +0 -1
- /package/dist/utils/{src/core/utils/appState → appState}/peregrineMQ/peregrineMQ.types.js +0 -0
- /package/dist/utils/{src/core/utils/appState → appState}/stateMachine/tiny-state-machine.base.js +0 -0
- /package/dist/utils/{src/core/utils/appState → appState}/store/store.vanillajs.js +0 -0
- /package/dist/utils/{src/core/utils/appState → appState}/store/store.vanillajs.templates.js +0 -0
- /package/dist/utils/esm/{src/core/utils/appState → appState}/peregrineMQ/peregrineMQ.types.js +0 -0
- /package/dist/utils/esm/{src/core/utils/appState → appState}/stateMachine/tiny-state-machine.base.js +0 -0
- /package/dist/utils/esm/{src/core/utils/appState → appState}/store/store.vanillajs.js +0 -0
- /package/dist/utils/esm/{src/core/utils/appState → appState}/store/store.vanillajs.templates.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/birthnumber.validator.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/birthnumberCZSKvalidator.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/cancelableDelayedFunction.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/date.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/deviceInfo.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/emailMatcher.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/file.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/fileValidator.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/objectOperations.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/text.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/ui.js +0 -0
- /package/dist/utils/esm/{src/core/utils/helpers → helpers}/valueOperations.js +0 -0
- /package/dist/utils/esm/{src/core/utils/keyExtractor.js → keyExtractor.js} +0 -0
- /package/dist/utils/esm/{src/core/utils/webComponents → webComponents}/webComponent.utils.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/birthnumber.validator.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/birthnumberCZSKvalidator.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/cancelableDelayedFunction.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/date.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/deviceInfo.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/emailMatcher.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/file.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/fileValidator.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/objectOperations.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/text.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/ui.js +0 -0
- /package/dist/utils/{src/core/utils/helpers → helpers}/valueOperations.js +0 -0
- /package/dist/utils/{src/core/utils/index.js.map → index.js.map} +0 -0
- /package/dist/utils/{src/core/utils/keyExtractor.js → keyExtractor.js} +0 -0
- /package/dist/utils/{src/core/utils/webComponents → webComponents}/webComponent.utils.js +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(Array.prototype, "last", {
|
|
2
|
-
get() {
|
|
3
|
-
return this[this.length - 1];
|
|
4
|
-
},
|
|
5
|
-
set(t) {
|
|
6
|
-
return this[this.length - 1] = t, this;
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
Object.defineProperty(Array.prototype, "first", {
|
|
10
|
-
get() {
|
|
11
|
-
return this[0];
|
|
12
|
-
},
|
|
13
|
-
set(t) {
|
|
14
|
-
return this[0] = t, this;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
const r = Array.prototype.first, e = Array.prototype.last;
|
|
18
|
-
export {
|
|
19
|
-
r as ArrayFirst,
|
|
20
|
-
e as ArrayLast
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=array.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"array.js","sources":["../../../../../../src/core/utils/array.ts"],"sourcesContent":["/* eslint-disable no-extend-native */\nObject.defineProperty(Array.prototype, 'last', {\n get() { return this[this.length - 1] },\n set(v) { this[this.length - 1] = v; return this },\n})\n\n\nObject.defineProperty(Array.prototype, 'first', {\n get() { return this[0] },\n set(v) { this[0] = v; return this },\n})\n\n// redeclare array, to have last, first accessors\ndeclare global {\n interface Array<T> {\n last: T | undefined\n first: T | undefined\n }\n}\n\nexport default Array.prototype\n\n\nexport const ArrayFirst = Array.prototype.first\nexport const ArrayLast = Array.prototype.last\n"],"names":["v","ArrayFirst","ArrayLast"],"mappings":"AACA,OAAO,eAAe,MAAM,WAAW,QAAQ;AAAA,EAC7C,MAAM;AAAE,WAAO,KAAK,KAAK,SAAS,CAAC;AAAA,EAAE;AAAA,EACrC,IAAIA,GAAG;AAAE,gBAAK,KAAK,SAAS,CAAC,IAAIA,GAAU;AAAA,EAAK;AAClD,CAAC;AAGD,OAAO,eAAe,MAAM,WAAW,SAAS;AAAA,EAC9C,MAAM;AAAE,WAAO,KAAK,CAAC;AAAA,EAAE;AAAA,EACvB,IAAIA,GAAG;AAAE,gBAAK,CAAC,IAAIA,GAAU;AAAA,EAAK;AACpC,CAAC;AAaM,MAAMC,IAAa,MAAM,UAAU,OAC7BC,IAAY,MAAM,UAAU;"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import e from "dayjs";
|
|
2
|
-
import f from "dayjs/plugin/relativeTime";
|
|
3
|
-
import u from "dayjs/plugin/updateLocale";
|
|
4
|
-
import p from "dayjs/plugin/customParseFormat";
|
|
5
|
-
const M = {
|
|
6
|
-
thresholds: [
|
|
7
|
-
{ l: "s", r: 1 },
|
|
8
|
-
{ l: "m", r: 1 },
|
|
9
|
-
{ l: "mm", r: 59, d: "minute" },
|
|
10
|
-
{ l: "h", r: 1 },
|
|
11
|
-
{ l: "hh", r: 23, d: "hour" },
|
|
12
|
-
{ l: "d", r: 1 },
|
|
13
|
-
{ l: "dd", r: 29, d: "day" },
|
|
14
|
-
{ l: "M", r: 1 },
|
|
15
|
-
{ l: "MM", r: 11, d: "month" },
|
|
16
|
-
{ l: "y", r: 1 },
|
|
17
|
-
{ l: "yy", d: "year" }
|
|
18
|
-
]
|
|
19
|
-
}, l = {
|
|
20
|
-
future: "in %s",
|
|
21
|
-
past: "%s ago",
|
|
22
|
-
s: "now",
|
|
23
|
-
m: "now",
|
|
24
|
-
mm: "now",
|
|
25
|
-
h: "1 hour",
|
|
26
|
-
hh: "%d hours",
|
|
27
|
-
d: "a day",
|
|
28
|
-
dd: "%d days",
|
|
29
|
-
// probably 'a week' instead?
|
|
30
|
-
M: "a month",
|
|
31
|
-
MM: "%d months",
|
|
32
|
-
y: "a year",
|
|
33
|
-
yy: "%d years"
|
|
34
|
-
}, y = {
|
|
35
|
-
future: "za %s",
|
|
36
|
-
past: "%s před",
|
|
37
|
-
s: "nyní",
|
|
38
|
-
m: "nyní",
|
|
39
|
-
mm: "nyní",
|
|
40
|
-
h: "1 hodinu",
|
|
41
|
-
hh: "%d hodiny",
|
|
42
|
-
d: "den",
|
|
43
|
-
dd: "%d dny",
|
|
44
|
-
M: "měsíc",
|
|
45
|
-
MM: "%d měsíci",
|
|
46
|
-
y: "rok",
|
|
47
|
-
yy: "%d roky"
|
|
48
|
-
};
|
|
49
|
-
e.extend(p);
|
|
50
|
-
e.extend(f, M);
|
|
51
|
-
e.extend(u);
|
|
52
|
-
e.updateLocale("cz", {
|
|
53
|
-
relativeTime: {
|
|
54
|
-
...y
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
e.updateLocale("en", {
|
|
58
|
-
relativeTime: {
|
|
59
|
-
...l
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const z = (t, o) => (e.updateLocale("en", {
|
|
63
|
-
relativeTime: {
|
|
64
|
-
...o === "cz" ? y : l,
|
|
65
|
-
...f
|
|
66
|
-
}
|
|
67
|
-
}), e(t, void 0).fromNow(!0)), x = (t, o) => T({ ...o, from: !0, value: t }), $ = (t, o) => T({ ...o, to: !0, value: t }), T = ({
|
|
68
|
-
value: t,
|
|
69
|
-
valueFormat: o,
|
|
70
|
-
formatString: a,
|
|
71
|
-
language: r = "en",
|
|
72
|
-
relativeTime: i,
|
|
73
|
-
from: m,
|
|
74
|
-
to: d,
|
|
75
|
-
shouldAddDay: n = !1,
|
|
76
|
-
shouldSubtractDay: s = !1,
|
|
77
|
-
showPreffix: h = !1
|
|
78
|
-
}) => {
|
|
79
|
-
if (e.updateLocale("en", {
|
|
80
|
-
relativeTime: {
|
|
81
|
-
...r === "cz" ? y : l,
|
|
82
|
-
...i
|
|
83
|
-
}
|
|
84
|
-
}), e.locale(r), !m && d) {
|
|
85
|
-
const c = e(t, o || void 0).add(n ? 1 : 0, "day");
|
|
86
|
-
return e(/* @__PURE__ */ new Date()).locale(r).to(c, !h);
|
|
87
|
-
}
|
|
88
|
-
if (m && !d) {
|
|
89
|
-
const c = e(t, o || void 0).subtract(s ? 1 : 0, "day");
|
|
90
|
-
return e(c, o || void 0).locale(r).fromNow(!h);
|
|
91
|
-
}
|
|
92
|
-
return e(t, o || void 0).locale(r).format(a);
|
|
93
|
-
}, k = (t, o, a, r, i = " - ", m = "month") => {
|
|
94
|
-
const d = e(t), n = e(o), s = d.diff(n, m);
|
|
95
|
-
return `${d.format(s === 0 ? a : r)}${i}${n.format(r)}`;
|
|
96
|
-
};
|
|
97
|
-
export {
|
|
98
|
-
k as dateRangeFormat,
|
|
99
|
-
T as getDateTime,
|
|
100
|
-
x as getTimeFromNow,
|
|
101
|
-
z as getTimeFromNowOriginal,
|
|
102
|
-
$ as getTimeTo
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=date.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sources":["../../../../../../src/core/utils/date.ts"],"sourcesContent":["import dayjs, { UnitType } from 'dayjs'\nimport relativeTime from 'dayjs/plugin/relativeTime'\nimport updateLocale from 'dayjs/plugin/updateLocale'\nimport customParseFormat from 'dayjs/plugin/customParseFormat'\n\nexport type DateTimeFormat = {\n value: Date | string | number\n valueFormat?: string\n formatString?: string\n language?: string\n relativeTime?: Record<string, string>\n from?: boolean\n to?: boolean\n shouldSubtractDay?: boolean\n shouldAddDay?: boolean\n showPreffix?: boolean\n}\n\nconst relativeTimeConfig = {\n thresholds: [\n { l: 's', r: 1 },\n { l: 'm', r: 1 },\n { l: 'mm', r: 59, d: 'minute' },\n { l: 'h', r: 1 },\n { l: 'hh', r: 23, d: 'hour' },\n { l: 'd', r: 1 },\n { l: 'dd', r: 29, d: 'day' },\n { l: 'M', r: 1 },\n { l: 'MM', r: 11, d: 'month' },\n { l: 'y', r: 1 },\n { l: 'yy', d: 'year' },\n ],\n}\n\nconst relativeTimeEN = {\n future: 'in %s',\n past: '%s ago',\n s: 'now',\n m: 'now',\n mm: 'now',\n h: '1 hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days', // probably 'a week' instead?\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n}\n\nconst relativeTimeCZ = {\n future: 'za %s',\n past: '%s před',\n s: 'nyní',\n m: 'nyní',\n mm: 'nyní',\n h: '1 hodinu',\n hh: '%d hodiny',\n d: 'den',\n dd: '%d dny',\n M: 'měsíc',\n MM: '%d měsíci',\n y: 'rok',\n yy: '%d roky',\n}\n\ndayjs.extend(customParseFormat)\ndayjs.extend(relativeTime, relativeTimeConfig)\ndayjs.extend(updateLocale)\n\ndayjs.updateLocale('cz', {\n relativeTime: {\n ...relativeTimeCZ,\n },\n})\ndayjs.updateLocale('en', {\n relativeTime: {\n ...relativeTimeEN,\n },\n})\n\nexport const getTimeFromNowOriginal = (value: string, language: string): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n return dayjs(value, undefined).fromNow(true)\n}\n\nexport const getTimeFromNow = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, from: true, value })\n\nexport const getTimeTo = (\n value: Date | string | number,\n valueFormat?: Partial<DateTimeFormat>,\n): string => getDateTime({ ...valueFormat, to: true, value })\n\nexport const getDateTime = ({\n value,\n valueFormat,\n formatString,\n language = 'en',\n relativeTime,\n from,\n to,\n shouldAddDay = false,\n shouldSubtractDay = false,\n showPreffix = false,\n}: DateTimeFormat): string => {\n dayjs.updateLocale('en', {\n relativeTime: {\n ...(language === 'cz' ? relativeTimeCZ : relativeTimeEN),\n ...relativeTime,\n },\n })\n\n dayjs.locale(language)\n\n if (!from && to) {\n const dateTo = dayjs(value, valueFormat || undefined).add(shouldAddDay ? 1 : 0, 'day')\n\n return dayjs(new Date()).locale(language).to(dateTo, !showPreffix)\n }\n\n if (from && !to) {\n const dateTo = dayjs(value, valueFormat || undefined).subtract(shouldSubtractDay ? 1 : 0, 'day')\n\n return dayjs(dateTo, valueFormat || undefined).locale(language).fromNow(!showPreffix)\n }\n\n return dayjs(value, valueFormat || undefined).locale(language).format(formatString)\n}\n\nexport const dateRangeFormat = (\n dateFrom: Date, dateTo: Date, shortFormat: string, longFormat: string,\n delimiter = ' - ', datePeriod: UnitType = 'month',\n) : string => {\n const dayJSFrom = dayjs(dateFrom)\n const dayJSTo = dayjs(dateTo)\n\n const diffMonths = dayJSFrom.diff(dayJSTo, datePeriod)\n\n return `${dayJSFrom.format(diffMonths === 0 ? shortFormat : longFormat)}${delimiter}${dayJSTo.format(longFormat)}`\n}\n"],"names":["relativeTimeConfig","relativeTimeEN","relativeTimeCZ","dayjs","customParseFormat","relativeTime","updateLocale","getTimeFromNowOriginal","value","language","getTimeFromNow","valueFormat","getDateTime","getTimeTo","formatString","from","to","shouldAddDay","shouldSubtractDay","showPreffix","dateTo","dateRangeFormat","dateFrom","shortFormat","longFormat","delimiter","datePeriod","dayJSFrom","dayJSTo","diffMonths"],"mappings":";;;;AAkBA,MAAMA,IAAqB;AAAA,EACzB,YAAY;AAAA,IACV,EAAE,GAAG,KAAK,GAAG,EAAA;AAAA,IACb,EAAE,GAAG,KAAK,GAAG,EAAA;AAAA,IACb,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,SAAA;AAAA,IACrB,EAAE,GAAG,KAAK,GAAG,EAAA;AAAA,IACb,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,OAAA;AAAA,IACrB,EAAE,GAAG,KAAK,GAAG,EAAA;AAAA,IACb,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,MAAA;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AU;AAErD,SAAO,GAAGC,EAAU,OAAOE,MAAe,IAAIN,IAAcC,CAAU,CAAC,GAAGC,CAAS,GAAGG,EAAQ,OAAOJ,CAAU,CAAC;AAClH;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"birthnumber.validator.js","sources":["../../../../../../../src/core/utils/helpers/birthnumber.validator.ts"],"sourcesContent":["import {\n parse as parseBirthNumber,\n isValidFormat,\n isValidModulo11,\n} from './birthnumberCZSKvalidator'\n\n// TODO Lukas Z, add spec/test for isBirthNumberValid\nexport const isBirthNumberValid = (birthnumber: string, birthdate: string, gender: string): boolean => {\n if (!isValidFormat(birthnumber) || !isValidModulo11(birthnumber)) {\n return false\n }\n\n const parsedBirthNumber = parseBirthNumber(birthnumber)\n\n if (parsedBirthNumber) {\n if (gender !== parsedBirthNumber.gender) {\n return false\n }\n const { year, month, day } = parsedBirthNumber\n\n if (birthdate !== `${String(day).padStart(2, '0')}.${String(month).padStart(2, '0')}.${year}`) {\n return false\n }\n }\n return true\n}\n"],"names":["isBirthNumberValid","birthnumber","birthdate","gender","isValidFormat","isValidModulo11","parsedBirthNumber","parseBirthNumber","year","month","day"],"mappings":";AAOO,MAAMA,IAAqB,CAACC,GAAqBC,GAAmBC,MAA4B;AACrG,MAAI,CAACC,EAAcH,CAAW,KAAK,CAACI,EAAgBJ,CAAW;AAC7D,WAAO;AAGT,QAAMK,IAAoBC,EAAiBN,CAAW;AAEtD,MAAIK,GAAmB;AACrB,QAAIH,MAAWG,EAAkB;AAC/B,aAAO;AAET,UAAM,EAAE,MAAAE,GAAM,OAAAC,GAAO,KAAAC,EAAA,IAAQJ;AAE7B,QAAIJ,MAAc,GAAG,OAAOQ,CAAG,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI,OAAOD,CAAK,EAAE,SAAS,GAAG,GAAG,CAAC,IAAID,CAAI;AACzF,aAAO;AAAA,EAEX;AACA,SAAO;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"birthnumberCZSKvalidator.js","sources":["../../../../../../../src/core/utils/helpers/birthnumberCZSKvalidator.ts"],"sourcesContent":["export const regex = /^\\s*(\\d\\d)(\\d\\d)(\\d\\d)[/]*(\\d\\d\\d)(\\d?)\\s*$/\n\nexport const getMatch: (value: string | number) => null | RegExpMatchArray\n = (value: string | number) => String(value).match(regex)\n\nexport const isValidFormat = (value: string | number): boolean => {\n const match = getMatch(value)\n\n return match !== null && !!match[0] && parse(value) !== null\n}\n\nexport const isValidModulo11 = (value: string | number): boolean => {\n const validFormat = isValidFormat(value)\n\n if (!validFormat) {\n return false\n }\n\n let stringValue: string\n\n if (typeof value === 'string') {\n stringValue = value.replace('/', '')\n } else {\n stringValue = (value as number).toString()\n }\n\n if (stringValue.length < 10) {\n return true\n }\n\n const controlDigit = stringValue.substr(9, 1)\n let mod = parseInt(stringValue.substr(0, 9), 10) % 11\n\n if (mod === 10) {\n mod = 0\n }\n\n return parseInt(controlDigit, 10) === mod\n}\n\ntype RangeTupleType = [number, number, string, number]\n\nconst monthRange = {\n ranges: [\n // M\n [1, 12, 'M', 0],\n // M\n [21, 32, 'M', 20],\n // F\n [51, 62, 'F', 50],\n // F\n [71, 82, 'F', 70],\n ] as RangeTupleType[],\n getRange(monthHint: number): RangeTupleType | undefined {\n return this.ranges.find(([min, max]) => monthHint >= min && monthHint <= max)\n },\n getGender(monthHint: number): string | null {\n const range = this.getRange(monthHint)\n\n return range ? range[2] as string : null\n },\n getMonth(monthHint: number): string {\n const range = this.getRange(monthHint)\n\n return String(range ? monthHint - (range[3] as number) : null).padStart(2, '0')\n },\n}\n\ntype ParsedBirthNumber = {\n day: string | number | null\n month: string | number | null\n year: string | number | null\n gender: string | null\n}\n\nexport const parse = (value: string | number | undefined): ParsedBirthNumber | null => {\n if (!value) {\n return null\n }\n const match = getMatch(value)\n\n if (!match) {\n return null\n }\n\n const controlDigit = match[5]\n\n let year = parseInt(match[1], 10)\n\n // eslint-disable-next-line no-nested-ternary\n year += controlDigit === '' ? (year < 54 ? 1900 : 1800) : (year < 54 ? 2000 : 1900)\n const monthHint = parseInt(match[2], 10)\n const month = monthRange.getMonth(monthHint)\n const gender = monthRange.getGender(monthHint)\n const day = String(parseInt(match[3], 10)).padStart(2, '0')\n\n // console.log('year-month-day')\n // console.log(`${year}-${month}-${day}`)\n\n const date = new Date(`${year}-${month}-${day}`)\n\n if (date instanceof Date && !Number.isNaN(date) && date.getMonth() + 1 === parseInt(month, 10)) {\n return {\n day,\n month,\n year,\n gender,\n }\n }\n return null\n}\n\n// TODO, control digit and year control\n/*\n if ($c === '') {\n $year += $year < 54 ? 1900 : 1800;\n } else {\n // kontrolní číslice\n $mod = ($year . $month . $day . $ext) % 11;\n if ($mod === 10) $mod = 0;\n if ($mod !== (int) $c) {\n return false;\n }\n\n $year += $year < 54 ? 2000 : 1900;\n }\n*/\n"],"names":["regex","getMatch","value","isValidFormat","match","parse","isValidModulo11","stringValue","controlDigit","mod","monthRange","monthHint","min","max","range","year","month","gender","day","date"],"mappings":"AAAO,MAAMA,IAAQ,+CAERC,IACT,CAACC,MAA2B,OAAOA,CAAK,EAAE,MAAMF,CAAK,GAE5CG,IAAgB,CAACD,MAAoC;AAChE,QAAME,IAAQH,EAASC,CAAK;AAE5B,SAAOE,MAAU,QAAQ,CAAC,CAACA,EAAM,CAAC,KAAKC,EAAMH,CAAK,MAAM;AAC1D,GAEaI,IAAkB,CAACJ,MAAoC;AAGlE,MAAI,CAFgBC,EAAcD,CAAK;AAGrC,WAAO;AAGT,MAAIK;AAQJ,MANI,OAAOL,KAAU,WACnBK,IAAcL,EAAM,QAAQ,KAAK,EAAE,IAEnCK,IAAeL,EAAiB,SAAA,GAG9BK,EAAY,SAAS;AACvB,WAAO;AAGT,QAAMC,IAAeD,EAAY,OAAO,GAAG,CAAC;AAC5C,MAAIE,IAAM,SAASF,EAAY,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI;AAEnD,SAAIE,MAAQ,OACVA,IAAM,IAG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IC,aAAgB,QAAQ,CAAC,OAAO,MAAMA,CAAI,KAAKA,EAAK,SAAA,IAAa,MAAM,SAASH,GAAO,EAAE,IACpF;AAAA,IACL,KAAAE;AAAA,IACA,OAAAF;AAAA,IACA,MAAAD;AAAA,IACA,QAAAE;AAAA,EAAA,IAGG;AACT;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancelableDelayedFunction.js","sources":["../../../../../../../src/core/utils/helpers/cancelableDelayedFunction.ts"],"sourcesContent":["export const cancelableSetInterval = (func: () => void, delay = 100): () => void => {\n const timeoutInterval = setInterval(func, delay)\n\n return (): void => clearInterval(timeoutInterval)\n}\n\nexport const cancelableSetTimeout = (func: () => void, delay = 100): () => void => {\n const timeoutInterval = setTimeout(func, delay)\n\n return (): void => clearTimeout(timeoutInterval)\n}\n"],"names":["cancelableSetInterval","func","delay","timeoutInterval","cancelableSetTimeout"],"mappings":"AAAO,MAAMA,IAAwB,CAACC,GAAkBC,IAAQ,QAAoB;AAClF,QAAMC,IAAkB,YAAYF,GAAMC,CAAK;AAE/C,SAAO,MAAY,cAAcC,CAAe;AAClD,GAEaC,IAAuB,CAACH,GAAkBC,IAAQ,QAAoB;AACjF,QAAMC,IAAkB,WAAWF,GAAMC,CAAK;AAE9C,SAAO,MAAY,aAAaC,CAAe;AACjD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sources":["../../../../../../../src/core/utils/helpers/date.ts"],"sourcesContent":["import dayjs from 'dayjs'\n\nexport const getDate = (): string => new Date().toString()\n\n\nexport const formatDateToTimestamp = (date = new Date()): string => dayjs(date).format('YYYY-MM-DD HH:mm:ss')\n\nexport const DATE_FORMAT = 'MM-DD-YYYY'\nexport const DATE_TIME_FORMAT = 'MM-DD-YYYY HH-mm-ss'\n\nexport const formatDate = (date: string | Date): string => dayjs(date).format(DATE_FORMAT)\nexport const formatDateTime = (date: string | Date): string => dayjs(date).format(DATE_TIME_FORMAT)\n\n"],"names":["getDate","formatDateToTimestamp","date","dayjs","DATE_FORMAT","DATE_TIME_FORMAT","formatDate","formatDateTime"],"mappings":";AAEO,MAAMA,IAAU,OAAc,oBAAI,KAAA,GAAO,SAAA,GAGnCC,IAAwB,CAACC,IAAO,oBAAI,KAAA,MAAmBC,EAAMD,CAAI,EAAE,OAAO,qBAAqB,GAE/FE,IAAc,cACdC,IAAmB,uBAEnBC,IAAa,CAACJ,MAAgCC,EAAMD,CAAI,EAAE,OAAOE,CAAW,GAC5EG,IAAiB,CAACL,MAAgCC,EAAMD,CAAI,EAAE,OAAOG,CAAgB;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deviceInfo.js","sources":["../../../../../../../src/core/utils/helpers/deviceInfo.ts"],"sourcesContent":["export const getDeviceId = async (): Promise<string | null | undefined> => {\n try {\n const devices = await navigator?.mediaDevices?.enumerateDevices?.()\n const device = devices.find((device) => device.kind === 'videoinput')\n\n return device?.deviceId || device?.groupId\n } catch (error: any) {\n return null\n }\n}\n"],"names":["getDeviceId","_a","_b","device"],"mappings":"AAAO,MAAMA,IAAc,YAAgD;AAApE,MAAAC,GAAAC;AACL,MAAI;AAEF,UAAMC,KADU,QAAMD,KAAAD,IAAA,uCAAW,iBAAX,gBAAAA,EAAyB,qBAAzB,gBAAAC,EAAA,KAAAD,KACC,KAAK,CAACE,MAAWA,EAAO,SAAS,YAAY;AAEpE,YAAOA,KAAA,gBAAAA,EAAQ,cAAYA,KAAA,gBAAAA,EAAQ;AAAA,EACrC,QAAqB;AACnB,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emailMatcher.js","sources":["../../../../../../../src/core/utils/helpers/emailMatcher.ts"],"sourcesContent":["export const regexBuilder\n= (domain: string, prefix = '', suffix = ''): RegExp => {\n const normPrefix = prefix.replace('.', '\\\\.')\n const normSuffix = suffix.replace('.', '\\\\.')\n\n if (normPrefix && normSuffix) {\n return new RegExp(\n `^(${normPrefix})+(.+)+(${normSuffix})+@(${domain})$`,\n )\n } if (normPrefix) {\n return new RegExp(\n `^(${normPrefix})+(.+)+@(${domain})$`,\n )\n } if (normSuffix) {\n return new RegExp(\n `^(.+)+(${normSuffix})+@(${domain})$`,\n )\n }\n return new RegExp(\n `^(${domain})$`,\n )\n}\n\nexport const emailMatch = (rgx:RegExp, email:string): boolean => rgx.test(email)\n\n// eslint-disable-next-line default-param-last\nexport const emailMatcher = (domain: string, prefix = '', suffix = '', email:string): boolean => {\n const rgx: RegExp = regexBuilder(domain, prefix, suffix)\n\n return emailMatch(rgx, email)\n}\n\n// const rgx = regexBuilder('gmail.com', 'ext.')\n// const rgx2 = regexBuilder('gmail.com', '', 'ddssds')\n\n// console.log(rgx.test('ddssds@gmail.com'))\n// console.log(rgx.test('extddssds@gmail.com'))\n// console.log(rgx.test('ext.ddssds@gmail.com'))\n\n// console.log(rgx2.test('xddssds@gmail.com'))\n// console.log(rgx2.test('extddssds@gmail.com'))\n// console.log(rgx2.test('ext.ddssds@gmail.com'))\n"],"names":["regexBuilder","domain","prefix","suffix","normPrefix","normSuffix","emailMatch","rgx","email","emailMatcher"],"mappings":"AAAO,MAAMA,IACX,CAACC,GAAgBC,IAAS,IAAIC,IAAS,OAAe;AACtD,QAAMC,IAAaF,EAAO,QAAQ,KAAK,KAAK,GACtCG,IAAaF,EAAO,QAAQ,KAAK,KAAK;AAE5C,SAAIC,KAAcC,IACT,IAAI;AAAA,IACT,KAAKD,CAAU,WAAWC,CAAU,OAAOJ,CAAM;AAAA,EAAA,IAE/CG,IACG,IAAI;AAAA,IACT,KAAKA,CAAU,YAAYH,CAAM;AAAA,EAAA,IAE/BI,IACG,IAAI;AAAA,IACT,UAAUA,CAAU,OAAOJ,CAAM;AAAA,EAAA,IAG9B,IAAI;AAAA,IACT,KAAKA,CAAM;AAAA,EAAA;AAEf,GAEaK,IAAa,CAACC,GAAYC,MAA0BD,EAAI,KAAKC,CAAK,GAGlEC,IAAe,CAACR,GAAgBC,IAAS,IAAIC,IAAS,IAAIK,MAA0B;AAC/F,QAAMD,IAAcP,EAAaC,GAAQC,GAAQC,CAAM;AAEvD,SAAOG,EAAWC,GAAKC,CAAK;AAC9B;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.js","sources":["../../../../../../../src/core/utils/helpers/file.ts"],"sourcesContent":["export const cleanCsvLines = (data:string): string => {\n if (!data || !data.length) {\n return data\n }\n\n let lineDelimiter = '\\r\\n'\n let lines: string[] = data.split(lineDelimiter)\n\n if (lines.length <= 1) {\n lineDelimiter = '\\n'\n lines = data.split(lineDelimiter)\n }\n\n let linesNum = lines.length\n\n // eslint-disable-next-line no-cond-assign\n // eslint-disable-next-line no-plusplus\n while (linesNum--) {\n if (lines[linesNum].trim() === '' || lines[linesNum].split(';').join('').trim() === '') {\n lines.splice(linesNum, 1)\n }\n }\n return lines.join(lineDelimiter)\n}\n\nexport const formatFilePath = (filePath?: string): string | undefined => filePath?.split('/')?.pop()\n"],"names":["cleanCsvLines","data","lineDelimiter","lines","linesNum","formatFilePath","filePath","_a"],"mappings":"AAAO,MAAMA,IAAgB,CAACC,MAAwB;AACpD,MAAI,CAACA,KAAQ,CAACA,EAAK;AACjB,WAAOA;AAGT,MAAIC,IAAgB;AAAA,GAChBC,IAAkBF,EAAK,MAAMC,CAAa;AAE9C,EAAIC,EAAM,UAAU,MAClBD,IAAgB;AAAA,GAChBC,IAAQF,EAAK,MAAMC,CAAa;AAGlC,MAAIE,IAAWD,EAAM;AAIrB,SAAOC;AACL,KAAID,EAAMC,CAAQ,EAAE,KAAA,MAAW,MAAMD,EAAMC,CAAQ,EAAE,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,KAAA,MAAW,OAClFD,EAAM,OAAOC,GAAU,CAAC;AAG5B,SAAOD,EAAM,KAAKD,CAAa;AACjC,GAEaG,IAAiB,CAACC,MAAA;AAzBxB,MAAAC;AAyBkE,UAAAA,IAAAD,KAAA,gBAAAA,EAAU,MAAM,SAAhB,gBAAAC,EAAsB;AAAA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileValidator.js","sources":["../../../../../../../src/core/utils/helpers/fileValidator.ts"],"sourcesContent":["import { fileNameExt } from './textValueOperations'\n\nexport const parseCSVdata = (data: string, columnDelimiter = ';'): {\n firstLine: string\n lines: string[]\n columns: null | string[]\n numColumns: number\n} => {\n let lines: string[] = data.split('\\r\\n')\n\n if (lines.length <= 1) {\n lines = data.split('\\n')\n }\n\n const firstLine: string = lines.shift() as string\n const columns: null | string[] = firstLine ? firstLine.split(columnDelimiter) : null\n const numColumns: number = columns ? columns.length : 0\n\n return {\n firstLine,\n lines,\n columns,\n numColumns,\n }\n}\n\nexport const validateLineNumColumns\n = (lineColumns: Array<string>, numColumns: number, line: string, index: number): ErrorMessage | null => {\n if (lineColumns.length !== numColumns) {\n // errors.push(`Line number of cells is not equal to the number of columns: \"${line}, index: ${index}\"`)\n return {\n message: 'errors.uploadInput.file.line.invalid',\n params: { line, index: index + 1 } } as ErrorMessage\n }\n return null\n }\n\nexport const validateLineCellTrimmed\n = (cell: string, line: string, lineIndex: number, cellIndex: number): ErrorMessage | null => {\n if (cell !== cell.trim()) {\n return {\n message: 'errors.uploadInput.file.cell.invalid',\n params: {\n line, cell, lineIndex, cellIndex,\n },\n } as ErrorMessage\n }\n return null\n }\n\nexport const validateCSVlines = (lines: string[], numColumns: number, columnDelimiter = ';'): ErrorMessage[] => {\n const errors: ErrorMessage[] = []\n // lines without first line of columns (hence the index + 1 in error message)\n let linesNum = lines.length\n\n // eslint-disable-next-line no-cond-assign\n // eslint-disable-next-line no-plusplus\n while (linesNum--) {\n if (lines[linesNum].trim() === '' || lines[linesNum].split(';').join('').trim() === '') {\n lines.splice(linesNum, 1)\n }\n }\n\n let lineColumns = null\n let errorLineNumColumns = null\n let errorLineCellNotTrimmed = null\n\n lines.forEach((line, index) => {\n lineColumns = line.split(columnDelimiter)\n\n errorLineNumColumns = validateLineNumColumns(lineColumns, numColumns, line, index)\n errorLineNumColumns && errors.push(errorLineNumColumns)\n\n lineColumns.forEach((cell, cellIndex) => {\n errorLineCellNotTrimmed = validateLineCellTrimmed(cell, line, index, cellIndex)\n errorLineCellNotTrimmed && errors.push(errorLineCellNotTrimmed)\n })\n })\n\n return errors\n}\n\n/*\n// maybe add aditional mime types\nhttp://fileformats.archiveteam.org/wiki/CSV\n['text/csv','application/csv', 'text/x-csv',\n'application/x-csv', 'text/x-comma-separated-values', 'text/comma-separated-values']\n*/\n\nexport type ErrorMessage = {\n message: string\n params: Record<string, string | number>\n}\n\nexport const validateCSVFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'csv' || !['text/csv', 'text/plain', 'application/vnd.ms-excel'].includes(file.type)) {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = (): void => {\n const data = reader.result ? reader.result.toString() : ''\n\n const { numColumns, lines } = parseCSVdata(data, columnDelimiter)\n\n if (numColumns < 2) {\n callBack(['errors.uploadInput.file.numColumns'])\n return\n }\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n const errors: (ErrorMessage | string)[] = validateCSVlines(lines, numColumns, columnDelimiter)\n\n const flatErrors: string[] = errors.map((errorMsg: ErrorMessage | string) => (\n (errorMsg as ErrorMessage)?.message ? JSON.stringify(errorMsg) : String(errorMsg)))\n\n const errorsArray: string[] = [...new Set(flatErrors)].map((serialized: string) => JSON.parse(serialized))\n\n // callBack && callBack(errorsArray.length ? errorsArray?.splice?.(0, 6) : null)\n callBack && callBack(errorsArray.length ? errorsArray : null)\n }\n\n reader.onerror = (error): void => {\n console.error(error)\n }\n}\n\nexport const validateSDFFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'sdf') {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = (): void => {\n const data = reader.result ? reader.result.toString() : ''\n\n const { lines } = parseCSVdata(data, columnDelimiter)\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n callBack && callBack(null)\n }\n\n reader.onerror = (error): void => {\n console.error(error)\n }\n}\n\nexport const validateJSONFile\n= (file: File, callBack: (errors?: (ErrorMessage | string)[] | null) => void, columnDelimiter = ';'): void => {\n if (!file) {\n callBack(['errors.uploadInput.file.empty'])\n return\n }\n if (fileNameExt(file.name) !== 'json') {\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n const reader = new FileReader()\n\n reader.readAsText(file)\n reader.onloadend = (): void => {\n const data = reader.result ? reader.result.toString() : ''\n\n try {\n const parsed = JSON.parse(data)\n\n JSON.stringify(parsed)\n } catch (error) {\n console.error(error)\n callBack(['errors.uploadInput.file.invalid'])\n return\n }\n\n const { lines } = parseCSVdata(data, columnDelimiter)\n\n if (lines?.length < 1) {\n callBack(['errors.uploadInput.file.numLines'])\n return\n }\n\n callBack && callBack(null)\n }\n\n reader.onerror = (error): void => {\n console.error(error)\n }\n}\n"],"names":["parseCSVdata","data","columnDelimiter","lines","firstLine","columns","numColumns","validateLineNumColumns","lineColumns","line","index","validateLineCellTrimmed","cell","lineIndex","cellIndex","validateCSVlines","errors","linesNum","errorLineNumColumns","errorLineCellNotTrimmed","validateCSVFile","file","callBack","fileNameExt","reader","flatErrors","errorMsg","errorsArray","serialized","error","validateSDFFile","validateJSONFile","parsed"],"mappings":";AAEO,MAAMA,IAAe,CAACC,GAAcC,IAAkB,QAKxD;AACH,MAAIC,IAAkBF,EAAK,MAAM;AAAA,CAAM;AAEvC,EAAIE,EAAM,UAAU,MAClBA,IAAQF,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,KAAYA,EAAS,IAAI;AAAA,EAC3B,GAEAE,EAAO,UAAU,CAACK,MAAgB;AAAA,EAElC;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectOperations.js","sources":["../../../../../../../src/core/utils/helpers/objectOperations.ts"],"sourcesContent":["export const duplicatesInArray = (arr: unknown[]): null | Record<string, number> => {\n const setFromArr = new Set(arr)\n\n if (Array.from(setFromArr).length !== arr.length) {\n const foundDuplicates: Record<string, number> = {}\n const itemsMap: Record<string, number> = {}\n\n arr.forEach((item: unknown) => {\n if (itemsMap[String(item)] !== undefined) {\n foundDuplicates[String(item)] = itemsMap[String(item)] + 1\n itemsMap[String(item)] += 1\n } else {\n itemsMap[String(item)] = 1\n }\n })\n return foundDuplicates\n }\n return null\n}\n\ntype Replacer = ((this: any, key: string, value: any) => any) | undefined\ntype Options = {\n graphQL?: boolean\n [key: string]: any\n}\n\nexport const formatJsonString = (\n value: any,\n replacer?: Replacer | undefined,\n space?: string | number | undefined,\n { graphQL, ...options }: Options = {},\n): string => {\n if (!graphQL) {\n return JSON.stringify(value, replacer, space)\n }\n const strValues: string[] = []\n\n Object.entries(value).forEach(([key, value]) => {\n let str = `${key}: `\n\n if (typeof value === 'object' && !Array.isArray(value)) {\n str += `${formatJsonString(value, replacer, space, { graphQL, ...options })}`\n } else {\n str += JSON.stringify(value)\n }\n strValues.push(str)\n })\n return `{${strValues.join(', ')}}`\n}\n\nconst simpleIdentiy = (value: string | number): string => `${value}`\n\nexport const formatObj = (\n obj: Record<string, string | number>,\n delimiter = ', ',\n mapValue: ((value: string | number) => string) = simpleIdentiy,\n mapKey: ((value: string | number) => string) = simpleIdentiy,\n): string => (typeof obj === 'object'\n ? Object.entries(obj).map(([key, value]) => `${mapKey(key)}: ${mapValue(value)}`).join(delimiter)\n : '')\n\n\nexport const formatObj2 = (\n obj: Record<string, string | number>,\n delimiter = ', ',\n mapValue: ((value: string | number) => string) = simpleIdentiy,\n mapKey: ((value: string | number) => string) = simpleIdentiy,\n): string => {\n if (typeof obj === 'object' && Array.isArray(obj)) {\n return obj\n .map((objValue) => formatObj2(objValue, delimiter, mapValue, mapKey))\n .join(delimiter)\n }\n\n if (typeof obj === 'object') {\n return Object.entries(obj)\n .map(([key, value]) => {\n const mappedKey = mapKey(key)\n const mappedValue = mapValue(typeof value === 'object' ? formatObj2(value) : value)\n\n return `${mappedKey ? `${mappedKey}: ` : ''}${mappedValue}`\n })\n .join(delimiter)\n }\n return ''\n}\n\n\n\n\n\nexport const chunkArray = (dataArray: any[], chunkSize = 100): (any[])[] => {\n const result = []\n\n const len = dataArray.length\n\n for (let i = 0; i < len; i += chunkSize) {\n const chunk = dataArray.slice(i, i + chunkSize)\n\n result.push(chunk)\n }\n return result\n}\n\nexport type TreeNodeStr = (string | TreeNodeStr)[]\n\ntype TreeNode = {\n name: string\n children?: Record<string, TreeNode>\n}\n\n// ['app', ['user', 'dashboard', ['ui', ['header', 'footer', 'menu'], 'realTime']]]\n\nexport const arrayToObjectTree = (itemsInTree: TreeNodeStr[]): Record<string, TreeNode> => {\n let previousParent: TreeNode\n\n const innerMake = (items: TreeNodeStr[]): Record<string, TreeNode> => {\n const treeObject: Record<string, TreeNode> = items.reduce((tree: Record<string, TreeNode>, item, index, array) => {\n let resolvedTree: Record<string, TreeNode> = { ...tree }\n\n if (typeof item === 'string') {\n resolvedTree[item] = { name: item }\n if (!previousParent) {\n previousParent = resolvedTree[item]\n }\n\n if (index === 0 && Array.isArray(array[1])) {\n previousParent = resolvedTree[item]\n }\n }\n if (Array.isArray(item)) {\n let parent = previousParent\n\n if (index > 1) {\n resolvedTree[item[0] as string] = resolvedTree[item[0] as string] || { name: item[0] }\n parent = resolvedTree[item[0] as string]\n\n resolvedTree = { ...resolvedTree, ...innerMake(item as TreeNodeStr[]) }\n } else {\n parent.children = innerMake(item as TreeNodeStr[])\n }\n }\n return resolvedTree\n }, {})\n\n return treeObject\n }\n\n return innerMake(itemsInTree)\n}\n"],"names":["duplicatesInArray","arr","setFromArr","foundDuplicates","itemsMap","item","formatJsonString","value","replacer","space","graphQL","options","strValues","key","str","simpleIdentiy","formatObj","obj","delimiter","mapValue","mapKey","formatObj2","objValue","mappedKey","mappedValue","chunkArray","dataArray","chunkSize","result","len","i","chunk","arrayToObjectTree","itemsInTree","previousParent","innerMake","items","tree","index","array","resolvedTree","parent"],"mappings":"AAAO,MAAMA,IAAoB,CAACC,MAAkD;AAClF,QAAMC,IAAa,IAAI,IAAID,CAAG;AAE9B,MAAI,MAAM,KAAKC,CAAU,EAAE,WAAWD,EAAI,QAAQ;AAChD,UAAME,IAA0C,CAAA,GAC1CC,IAAmC,CAAA;AAEzC,WAAAH,EAAI,QAAQ,CAACI,MAAkB;AAC7B,MAAID,EAAS,OAAOC,CAAI,CAAC,MAAM,UAC7BF,EAAgB,OAAOE,CAAI,CAAC,IAAID,EAAS,OAAOC,CAAI,CAAC,IAAI,GACzDD,EAAS,OAAOC,CAAI,CAAC,KAAK,KAE1BD,EAAS,OAAOC,CAAI,CAAC,IAAI;AAAA,IAE7B,CAAC,GACMF;AAAA,EACT;AACA,SAAO;AACT,GAQaG,IAAmB,CAC9BC,GACAC,GACAC,GACA,EAAE,SAAAC,GAAS,GAAGC,EAAA,IAAqB,OACxB;AACX,MAAI,CAACD;AACH,WAAO,KAAK,UAAUH,GAAOC,GAAUC,CAAK;AAE9C,QAAMG,IAAsB,CAAA;AAE5B,gBAAO,QAAQL,CAAK,EAAE,QAAQ,CAAC,CAACM,GAAKN,CAAK,MAAM;AAC9C,QAAIO,IAAM,GAAGD,CAAG;AAEhB,IAAI,OAAON,KAAU,YAAY,CAAC,MAAM,QAAQA,CAAK,IACnDO,KAAO,GAAGR,EAAiBC,GAAOC,GAAUC,GAAO,EAAE,SAAAC,GAAS,GAAGC,EAAA,CAAS,CAAC,KAE3EG,KAAO,KAAK,UAAUP,CAAK,GAE7BK,EAAU,KAAKE,CAAG;AAAA,EACpB,CAAC,GACM,IAAIF,EAAU,KA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AVI,OAAOhC,KAAS,aAClBmC,EAAanC,CAAI,IAAI,EAAE,MAAMA,EAAA,GACxB6B,MACHA,IAAiBM,EAAanC,CAAI,IAGhCiC,MAAU,KAAK,MAAM,QAAQC,EAAM,CAAC,CAAC,MACvCL,IAAiBM,EAAanC,CAAI,KAGlC,MAAM,QAAQA,CAAI,GAAG;AACvB,UAAIoC,IAASP;AAEb,MAAII,IAAQ,KACVE,EAAanC,EAAK,CAAC,CAAW,IAAImC,EAAanC,EAAK,CAAC,CAAW,KAAK,EAAE,MAAMA,EAAK,CAAC,EAAA,GACnFoC,IAASD,EAAanC,EAAK,CAAC,CAAW,GAEvCmC,IAAe,EAAE,GAAGA,GAAc,GAAGL,EAAU9B,CAAqB,EAAA,KAEpEoC,EAAO,WAAWN,EAAU9B,CAAqB;AAAA,IAErD;AACA,WAAOmC;AAAA,EACT,GAAG,CAAA,CAAE;AAKP,SAAOL,EAAUF,CAAW;AAC9B;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { memoizeWith as c, identity as l } from "ramda";
|
|
2
|
-
const a = (t, o, n) => t ? o : n, d = c(l), f = c((...t) => JSON.stringify(t)), T = (t = (...o) => JSON.stringify(o)) => c(t), z = (t, o = 100, n = !1) => {
|
|
3
|
-
let e;
|
|
4
|
-
return function(...s) {
|
|
5
|
-
const i = this, r = () => {
|
|
6
|
-
clearTimeout(e), e = null, n || t.apply(i, s);
|
|
7
|
-
}, m = n && !e;
|
|
8
|
-
clearTimeout(e), e = setTimeout(r, o), m && t.apply(i, s);
|
|
9
|
-
};
|
|
10
|
-
}, x = (t) => new Promise((o) => {
|
|
11
|
-
setTimeout(() => o(`delayed: ${t}`), t);
|
|
12
|
-
}), u = (async () => {
|
|
13
|
-
}).constructor, N = (t) => t.constructor === u.prototype.constructor;
|
|
14
|
-
export {
|
|
15
|
-
u as AsyncFunctionTemplate,
|
|
16
|
-
z as debounce,
|
|
17
|
-
x as delay,
|
|
18
|
-
N as isFunctionAsync,
|
|
19
|
-
d as memoize,
|
|
20
|
-
f as memoizeComplex,
|
|
21
|
-
T as memoizer,
|
|
22
|
-
a as nestedTernary
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=other.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"other.js","sources":["../../../../../../../src/core/utils/helpers/other.ts"],"sourcesContent":["import { memoizeWith, identity } from 'ramda'\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const nestedTernary = (condition: boolean, branchA: any, branchB: any): any => (condition ? branchA : branchB)\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nexport const memoize = memoizeWith(identity)\n\n// Beware fellow developer, this is to be used with caution and precison\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nexport const memoizeComplex = memoizeWith((...args) => JSON.stringify(args))\n\nexport const memoizer\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n= (memoizeFunc = (...args): string => JSON.stringify(args)): ReturnType<typeof memoizeWith> => memoizeWith(memoizeFunc)\n\nexport const debounce = (func: () => void, wait = 100, immediate = false): () => void => {\n let timeout: any\n\n return function debounced(...args) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const context: unknown = this\n const later = (): void => {\n clearTimeout(timeout)\n timeout = null\n if (!immediate) {\n func.apply(context, args)\n }\n }\n const callNow = immediate && !timeout\n\n clearTimeout(timeout)\n timeout = setTimeout(later, wait)\n if (callNow) {\n func.apply(context, args)\n }\n }\n}\n\nexport const delay = (delay: number): Promise<string> => new Promise((resolve) => {\n setTimeout(() => resolve(`delayed: ${delay}`), delay)\n})\n\nexport const AsyncFunctionTemplate = (async (): Promise<void> => {}).constructor\n\nexport const isFunctionAsync = (\n func: (...args: any[]) => unknown,\n): boolean => func.constructor === AsyncFunctionTemplate.prototype.constructor\n"],"names":["nestedTernary","condition","branchA","branchB","memoize","memoizeWith","identity","memoizeComplex","args","memoizer","memoizeFunc","debounce","func","wait","immediate","timeout","context","later","callNow","delay","resolve","AsyncFunctionTemplate","isFunctionAsync"],"mappings":";AAGO,MAAMA,IAAgB,CAACC,GAAoBC,GAAcC,MAAuBF,IAAYC,IAAUC,GAIhGC,IAAUC,EAAYC,CAAQ,GAK9BC,IAAiBF,EAAY,IAAIG,MAAS,KAAK,UAAUA,CAAI,CAAC,GAE9DC,IAGX,CAACC,IAAc,IAAIF,MAAiB,KAAK,UAAUA,CAAI,MAAsCH,EAAYK,CAAW,GAEzGC,IAAW,CAACC,GAAkBC,IAAO,KAAKC,IAAY,OAAsB;AACvF,MAAIC;AAEJ,SAAO,YAAsBP,GAAM;AAIjC,UAAMQ,IAAmB,MACnBC,IAAQ,MAAY;AACxB,mBAAaF,CAAO,GACpBA,IAAU,MACLD,KACHF,EAAK,MAAMI,GAASR,CAAI;AAAA,IAE5B,GACMU,IAAUJ,KAAa,CAACC;AAE9B,iBAAaA,CAAO,GACpBA,IAAU,WAAWE,GAAOJ,CAAI,GAC5BK,KACFN,EAAK,MAAMI,GAASR,CAAI;AAAA,EAE5B;AACF,GAEaW,IAAQ,CAACA,MAAmC,IAAI,QAAQ,CAACC,MAAY;AAChF,aAAW,MAAMA,EAAQ,YAAYD,CAAK,EAAE,GAAGA,CAAK;AACtD,CAAC,GAEYE,KAAyB,YAA2B;AAAC,GAAG,aAExDC,IAAkB,CAC7BV,MACYA,EAAK,gBAAgBS,EAAsB,UAAU;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../../../../../../src/core/utils/helpers/text.ts"],"sourcesContent":["import _sanitize from 'sanitize-html'\n\nexport const defaultSanitizeConfig = {\n allowedTags: ['b', 'i', 'em', 'strong', 'a', 'p', 'span', 'li', 'ul', 'div', 'h1', 'h2', 'h3', 'h4', 'img'],\n allowedAttributes: {\n a: ['href', 'target', 'style', 'class', 'onclick'],\n '*': ['href', 'target', 'style', 'align', 'alt', 'center', 'bgcolor', 'style', 'src'],\n },\n}\n\nexport const sanitizeHtml\n = (\n text: string,\n sanitizeConfig?: typeof defaultSanitizeConfig,\n ): ReturnType<typeof _sanitize> => _sanitize(text, sanitizeConfig || defaultSanitizeConfig)\n\nexport const composeId = (text: string): string => text?.toLowerCase?.()?.replace(/\\s+/g, '-')\n"],"names":["defaultSanitizeConfig","sanitizeHtml","text","sanitizeConfig","_sanitize","composeId","_b","_a"],"mappings":";AAEO,MAAMA,IAAwB;AAAA,EACnC,aAAa,CAAC,KAAK,KAAK,MAAM,UAAU,KAAK,KAAK,QAAQ,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA,EAC1G,mBAAmB;AAAA,IACjB,GAAG,CAAC,QAAQ,UAAU,SAAS,SAAS,SAAS;AAAA,IACjD,KAAK,CAAC,QAAQ,UAAU,SAAS,SAAS,OAAO,UAAU,WAAW,SAAS,KAAK;AAAA,EAAA;AAExF,GAEaC,IACT,CACAC,GACAC,MACiCC,EAAUF,GAAMC,KAAkBH,CAAqB,GAE/EK,IAAY,CAACH;;AAAyB,UAAAI,KAAAC,IAAAL,KAAA,gBAAAA,EAAM,gBAAN,gBAAAK,EAAA,KAAAL,OAAA,gBAAAI,EAAuB,QAAQ,QAAQ;AAAA;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { toLower as t, toUpper as l } from "ramda";
|
|
2
|
-
const i = (e) => e ? t(e) : "", p = (e) => e ? l(e) : "", u = (e) => e ? e.toString().replace(/ /g, "") : "", f = (e) => e.slice((e.lastIndexOf(".") - 1 >>> 0) + 2), r = (e) => {
|
|
3
|
-
var o, n;
|
|
4
|
-
return (n = (o = e == null ? void 0 : e.normalize("NFD")) == null ? void 0 : o.replace) == null ? void 0 : n.call(o, /[\u0300-\u036f]/g, "");
|
|
5
|
-
}, g = (e, o, n = !0, c = !0) => !o || !e || !o.trim() || !e.trim() ? !1 : n && c ? r(o.toLowerCase()).includes(r(e.toLowerCase())) : n ? o.toLowerCase().includes(e.toLowerCase()) : c ? r(o).includes(r(e)) : o.includes(e), L = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), w = (e, o = 0, n = "...") => !o || e.length <= o ? e : `${e.substr(0, o)}${n}`, a = (e) => e && r(e == null ? void 0 : e.toLocaleLowerCase().replaceAll(/\s/g, "-").replaceAll(/["]/g, "")), C = (e) => e && encodeURIComponent(a(e));
|
|
6
|
-
export {
|
|
7
|
-
L as escapeRegExp,
|
|
8
|
-
f as fileNameExt,
|
|
9
|
-
g as findStringInText,
|
|
10
|
-
r as normalizeString,
|
|
11
|
-
u as removeWhitespaces,
|
|
12
|
-
a as sanitizeId,
|
|
13
|
-
C as sanitizePathId,
|
|
14
|
-
i as toLowerCase,
|
|
15
|
-
p as toUpperCase,
|
|
16
|
-
w as truncateText
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=textValueOperations.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textValueOperations.js","sources":["../../../../../../../src/core/utils/helpers/textValueOperations.ts"],"sourcesContent":["import {\n toLower, toUpper,\n} from 'ramda'\n\n// todo memoize\nexport const toLowerCase = (str: string | number): string | number => (str ? toLower(str as string) as string : '')\n\n// todo memoize\nexport const toUpperCase = (str: string): string => (str ? toUpper(str) as string : '')\n\n// todo memoize\nexport const removeWhitespaces = (str: string | number): string | number => (str ? str.toString()\n .replace(/ /g, '') as string : '')\n\n// eslint-disable-next-line no-bitwise\nexport const fileNameExt = (fileName: string): string => fileName.slice((fileName.lastIndexOf('.') - 1 >>> 0) + 2)\n\nexport const normalizeString = (str: string): string => str?.normalize('NFD')?.replace?.(/[\\u0300-\\u036f]/g, '')\n\nexport const findStringInText = (str: string, text: string, ci = true, norm = true): boolean => {\n if (!text || !str || !text.trim() || !str.trim()) {\n return false\n }\n\n if (ci && norm) {\n return normalizeString(text.toLowerCase()).includes(normalizeString(str.toLowerCase()))\n }\n\n if (ci) {\n return text.toLowerCase().includes(str.toLowerCase())\n }\n\n if (norm) {\n return normalizeString(text).includes(normalizeString(str))\n }\n\n return text.includes(str)\n}\n\n// eslint-disable-next-line no-useless-escape\nexport const escapeRegExp = (str: string): string => str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&')\n\nexport const truncateText = (text: string, maxNumChars = 0, indicator = '...'): string => {\n if (!maxNumChars || text.length <= maxNumChars) {\n return text\n }\n return `${text.substr(0, maxNumChars)}${indicator}`\n}\n\nexport const sanitizeId\n = (id: string): string => id && normalizeString(id?.toLocaleLowerCase().replaceAll(/\\s/g, '-').replaceAll(/[\"]/g, ''))\n\nexport const sanitizePathId\n = (id: string): string => id && encodeURIComponent(sanitizeId(id))\n"],"names":["toLowerCase","str","toLower","toUpperCase","toUpper","removeWhitespaces","fileNameExt","fileName","normalizeString","_b","_a","findStringInText","text","ci","norm","escapeRegExp","truncateText","maxNumChars","indicator","sanitizeId","id","sanitizePathId"],"mappings":";AAKO,MAAMA,IAAc,CAACC,MAA2CA,IAAMC,EAAQD,CAAa,IAAc,IAGnGE,IAAc,CAACF,MAAyBA,IAAMG,EAAQH,CAAG,IAAc,IAGvEI,IAAoB,CAACJ,MAA2CA,IAAMA,EAAI,WACpF,QAAQ,MAAM,EAAE,IAAc,IAGpBK,IAAc,CAACC,MAA6BA,EAAS,OAAOA,EAAS,YAAY,GAAG,IAAI,MAAM,KAAK,CAAC,GAEpGC,IAAkB,CAACP,MAAA;;AAAwB,UAAAQ,KAAAC,IAAAT,KAAA,gBAAAA,EAAK,UAAU,WAAf,gBAAAS,EAAuB,YAAvB,gBAAAD,EAAA,KAAAC,GAAiC,oBAAoB;AAAA,GAEhGC,IAAmB,CAACV,GAAaW,GAAcC,IAAK,IAAMC,IAAO,OACxE,CAACF,KAAQ,CAACX,KAAO,CAACW,EAAK,UAAU,CAACX,EAAI,SACjC,KAGLY,KAAMC,IACDN,EAAgBI,EAAK,aAAa,EAAE,SAASJ,EAAgBP,EAAI,YAAA,CAAa,CAAC,IAGpFY,IACKD,EAAK,YAAA,EAAc,SAASX,EAAI,aAAa,IAGlDa,IACKN,EAAgBI,CAAI,EAAE,SAASJ,EAAgBP,CAAG,CAAC,IAGrDW,EAAK,SAASX,CAAG,GAIbc,IAAe,CAACd,MAAwBA,EAAI,QAAQ,uCAAuC,MAAM,GAEjGe,IAAe,CAACJ,GAAcK,IAAc,GAAGC,IAAY,UAClE,CAACD,KAAeL,EAAK,UAAUK,IAC1BL,IAEF,GAAGA,EAAK,OAAO,GAAGK,CAAW,CAAC,GAAGC,CAAS,IAGtCC,IACT,CAACC,MAAuBA,KAAMZ,EAAgBY,KAAA,gBAAAA,EAAI,oBAAoB,WAAW,OAAO,KAAK,WAAW,QAAQ,GAAG,GAE1GC,IACT,CAACD,MAAuBA,KAAM,mBAAmBD,EAAWC,CAAE,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":["../../../../../../../src/core/utils/helpers/ui.ts"],"sourcesContent":["export const mapSerReplacer\n= (key: string, value: unknown): unknown | { dataType: string; value: Array<unknown>} => {\n if (value instanceof Map) {\n return {\n dataType: 'Map',\n value: Array.from(value.entries()), // or with spread: value: [...value]\n }\n }\n return value\n}\n\nexport type TClassName = string | boolean | null | undefined\nexport const classNames = (...classes: TClassName[]): string => classes\n .filter((className: TClassName) => (typeof className === 'string' && className !== undefined && className !== null))\n .filter(Boolean).join(' ')\n\n\nexport type PropsCategoriesType = {\n dataProps: Record<string, unknown>\n restProps: Record<string, unknown>\n};\n\nexport const parseProps = (props: Record<string, unknown>):PropsCategoriesType => {\n const dataProps: Record<string, unknown> = {}\n const restProps: Record<string, unknown> = {}\n\n Object.entries(props).forEach(([key, value]) => {\n if (key.substr(0, 5) === 'data-' || key.substr(0, 4) === 'data') {\n dataProps[key] = value\n } else {\n restProps[key] = value\n }\n })\n return { dataProps, restProps }\n}\n\n\n\ntype GeneratorIdCallable = (token: string, increment?: boolean, forcedValue?: number | undefined) => string\ntype GenerateId = { tokens?: Record<string, number | null | undefined> } & GeneratorIdCallable\n\nexport const generateId: GenerateId = (\n token: string,\n increment = true,\n forcedValue: number | undefined = undefined,\n) => {\n generateId.tokens = generateId.tokens || {}\n\n if (forcedValue !== undefined && forcedValue !== null) {\n generateId.tokens[token] = forcedValue\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n const noValue = generateId?.tokens[token] === undefined || generateId?.tokens[token] === null\n\n generateId.tokens[token] = generateId.tokens[token] || 0\n\n if (noValue) {\n return `${token}${0}`\n }\n\n if (increment) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n generateId.tokens[token] += 1\n\n return `${token}${generateId?.tokens?.[token] as number}`\n }\n\n return `${token}${generateId?.tokens?.[token] as number}`\n}\n\ntype FAnchorClick = { aElement?: HTMLAnchorElement | null }\n & ((href: string, target?: string, remove?: boolean) => void)\n\nexport const anchorClick: FAnchorClick = (href: string, target = '_top', remove = false): HTMLAnchorElement | null => {\n anchorClick.aElement = anchorClick.aElement || document.createElement('a')\n\n const { aElement } = anchorClick\n\n aElement.setAttribute('href', href)\n aElement.setAttribute('target', target)\n\n aElement.dataset.date = `${Date.now()}`\n aElement.click()\n if (remove) {\n aElement.remove()\n anchorClick.aElement = null\n }\n\n return aElement\n}\n\n\n\nexport type NoopEvent = {\n preventDefault?: () => void\n stopPropagation?: () => void\n stopImmediatePropagation?: () => void\n} | Event\n\nexport const noop = (event?: NoopEvent): void => {\n event?.preventDefault?.()\n event?.stopPropagation?.()\n event?.stopImmediatePropagation?.()\n}\n\n/**\n * Type definition for theme map.\n * @typedef {Object} ThemeMap\n * @property {string} dark - CSS class for the dark theme.\n * @property {string} light - CSS class for the light theme.\n */\nexport type ThemeMap = {\n dark: string\n light: string\n}\n\nconst THEME_PROP = '__eskit_themes__'\n\nconst defaultThemes: ThemeMap = {\n dark: 'theme-dark',\n light: 'theme-light',\n}\n\n/**\n * Reads the theme config stored on the given element.\n * Falls back to defaultThemes when no config has been set.\n * Scoping to the element means different microfrontends (different roots) are isolated,\n * while all bundles targeting the same element share one config.\n * @param {HTMLElement} [element] - The element to read from. Defaults to document.body.\n * @returns {ThemeMap} The current base themes for the element.\n */\nexport const getBaseThemes = (element?: HTMLElement): ThemeMap => {\n const el = element ?? document.body\n\n return (el as unknown as Record<string, unknown>)[THEME_PROP] as ThemeMap ?? defaultThemes\n}\n\n/**\n * Sets the base theme class names on the given element.\n * @param {ThemeMap} themes - CSS classes for dark and light themes.\n * @param {HTMLElement} [element] - The element to store config on. Defaults to document.body.\n */\nexport const setThemeClassNames = (themes: ThemeMap, element?: HTMLElement): void => {\n const el = element ?? document.body\n const store = el as unknown as Record<string, unknown>\n\n store[THEME_PROP] = themes\n}\n\n/**\n * Switches the color theme of the document.\n * @param {boolean} isDark - Flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n * @param {boolean} [findShadows=true] - Flag to determine if shadow DOM elements should also be themed.\n */\nexport const switchColorTheme = (\n isDark: boolean, htmlElement?: HTMLElement, findShadows = true,\n): void => {\n const themes = getBaseThemes(htmlElement)\n const oldClass = isDark ? themes.light : themes.dark\n const newClass = isDark ? themes.dark : themes.light\n\n if (htmlElement) {\n htmlElement.classList.remove(oldClass)\n htmlElement.classList.remove(newClass)\n htmlElement.classList.add(newClass)\n }\n\n if (typeof document !== 'undefined') {\n document.querySelectorAll(`.${oldClass}`).forEach((element) => {\n element.classList.add(`.${newClass}`)\n element.classList.remove(`.${oldClass}`)\n })\n\n if (findShadows) {\n document.querySelectorAll('.shadow-div').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n })\n\n document.querySelectorAll('esmf-wrapper').forEach((element) => {\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.add(newClass)\n element.shadowRoot?.querySelector(`.${oldClass}`)?.classList.remove(oldClass)\n\n const firstChild: HTMLElement = element.shadowRoot?.childNodes[0] as HTMLElement\n\n if (firstChild) {\n firstChild.classList.add(newClass)\n firstChild.classList.remove(oldClass)\n }\n })\n }\n }\n}\n\n/**\n * Updates the color theme of the document.\n * @param {boolean} [isDark] - Optional flag to determine if the dark theme should be applied.\n * @param {HTMLElement} [htmlElement] - The HTML element to which the theme will be applied.\n */\nexport const updateColorTheme = (isDark?: boolean, htmlElement?: HTMLElement): void => {\n const el = htmlElement || document.body\n let resolvedIsDark: boolean = isDark || false\n\n if (typeof document !== 'undefined' && isDark === undefined) {\n resolvedIsDark = document.body.classList.contains(getBaseThemes(el).dark)\n }\n switchColorTheme(resolvedIsDark, el)\n}\n\nconst windowMatchMediaChangeEventType = 'change'\n\n/**\n * Observes the user's theme preference and applies the appropriate theme.\n * @param {() => HTMLElement} [getHtmlElement] - Function to get the HTML element to which the theme will be applied.\n * @param {(isDark: boolean) => void} [switchCallback] - Callback function to execute when the theme changes.\n * @returns {() => void} Function to stop observing the theme preference.\n */\nexport const observeThemePreference = (\n getHtmlElement: () => HTMLElement = (): HTMLElement => document.body,\n switchCallback: (isDark: boolean) => void = (isDark: boolean): boolean => isDark,\n): () => void => {\n const switchColorThemeHandler = (isDark: boolean): void => {\n const htmlElement = getHtmlElement()\n\n switchColorTheme?.(isDark, htmlElement)\n switchCallback?.(isDark)\n }\n\n const changeDarkColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(event.matches)\n }\n\n const changeLightColorThemeHandler = (event: MediaQueryListEvent): void => {\n switchColorThemeHandler(!event.matches)\n }\n\n const isDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n try {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n } catch (error) {\n console.error(`Error::observeThemePreference::removeEventListener: ${error}`)\n }\n\n switchColorThemeHandler(isDark?.matches)\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').addEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n\n return () => {\n window.matchMedia('(prefers-color-scheme: dark)').removeEventListener(\n windowMatchMediaChangeEventType, changeDarkColorThemeHandler,\n )\n window.matchMedia('(prefers-color-scheme: light)').removeEventListener(\n windowMatchMediaChangeEventType, changeLightColorThemeHandler,\n )\n }\n}\n"],"names":["mapSerReplacer","key","value","classNames","classes","className","parseProps","props","dataProps","restProps","generateId","token","increment","forcedValue","_a","_b","_c","noValue","anchorClick","href","target","remove","aElement","noop","event","THEME_PROP","defaultThemes","getBaseThemes","element","setThemeClassNames","themes","store","switchColorTheme","isDark","htmlElement","findShadows","oldClass","newClass","_d","_e","firstChild","updateColorTheme","el","resolvedIsDark","windowMatchMediaChangeEventType","observeThemePreference","getHtmlElement","switchCallback","switchColorThemeHandler","changeDarkColorThemeHandler","changeLightColorThemeHandler"],"mappings":"AAAO,MAAMA,IACX,CAACC,GAAaC,MACVA,aAAiB,MACZ;AAAA,EACL,UAAU;AAAA,EACV,OAAO,MAAM,KAAKA,EAAM,SAAS;AAAA;AAAA,IAG9BA,GAIIC,IAAa,IAAIC,MAAkCA,EAC7D,OAAO,CAACC,MAA2B,OAAOA,KAAc,YAAYA,MAAc,UAAaA,MAAc,IAAK,EAClH,OAAO,OAAO,EAAE,KAAK,GAAG,GAQdC,IAAa,CAACC,MAAuD;AAChF,QAAMC,IAAqC,CAAA,GACrCC,IAAqC,CAAA;AAE3C,gBAAO,QAAQF,CAAK,EAAE,QAAQ,CAAC,CAACN,GAAKC,CAAK,MAAM;AAC9C,IAAID,EAAI,OAAO,GAAG,CAAC,MAAM,WAAWA,EAAI,OAA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AAA,MAAiCK;AAAA,IAAA,GAEnC,OAAO,WAAW,+BAA+B,EAAE;AAAA,MACjDL;AAAA,MAAiCM;AAAA,IAAA;AAAA,EAErC,QAAgB;AAAA,EAEhB;AAEA,SAAAF,EAAwBf,KAAA,gBAAAA,EAAQ,OAAO,GACvC,OAAO,WAAW,8BAA8B,EAAE;AAAA,IAChDW;AAAA,IAAiCK;AAAA,EAAA,GAEnC,OAAO,WAAW,+BAA+B,EAAE;AAAA,IACjDL;AAAA,IAAiCM;AAAA,EAAA,GAG5B,MAAM;AACX,WAAO,WAAW,8BAA8B,EAAE;AAAA,MAChDN;AAAA,MAAiCK;AAAA,IAAA,GAEnC,OAAO,WAAW,+BAA+B,EAAE;AAAA,MACjDL;AAAA,MAAiCM;AAAA,IAAA;AAAA,EAErC;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"valueOperations.js","sources":["../../../../../../../src/core/utils/helpers/valueOperations.ts"],"sourcesContent":["export type Limit = {\n min?: number\n max?: number\n};\n\nexport const numberDefined = (value?: number | undefined | null): boolean => value !== undefined && value !== null\n\nexport const restrictNumberInLimits = (value: number, limit?: Limit): number => Math.max(\n Math.min(value, numberDefined(limit?.max) ? (limit?.max as number) : Infinity),\n numberDefined(limit?.min) ? (limit?.min as number) : -Infinity,\n)\n\nexport enum Operation {\n ADD = 'add',\n SUBTRACT = 'subtract',\n MULTIPLY = 'multiply',\n DIVIDE = 'divide',\n}\n\nexport const numberOperation = (\n value: number,\n operand: number,\n operation: Operation,\n limit?: Limit,\n): number => {\n let result = 0\n\n switch (operation) {\n case Operation.ADD: {\n result = value + operand\n break\n }\n case Operation.SUBTRACT: {\n result = value - operand\n break\n }\n case Operation.MULTIPLY: {\n result = value * operand\n break\n }\n case Operation.DIVIDE: {\n result = operand === 0 ? 0 : value / operand\n break\n }\n default:\n value\n }\n\n return restrictNumberInLimits(result, limit)\n}\n\nexport const incerementValue\n // eslint-disable-next-line default-param-last\n = (value: number, inc = 1, limit?: Limit): number => numberOperation(value, inc, Operation.ADD, limit)\n\nexport const decrementValue\n // eslint-disable-next-line default-param-last\n = (value: number, inc = 1, limit?: Limit): number => numberOperation(value, inc, Operation.SUBTRACT, limit)\n\nexport const setValue = (\n value: number | string | Record<string, unknown> | any,\n limit?: Limit,\n): any => (typeof value === 'number' && limit ? restrictNumberInLimits(value, limit) : value)\n"],"names":["numberDefined","value","restrictNumberInLimits","limit","Operation","numberOperation","operand","operation","result","incerementValue","inc","decrementValue","setValue"],"mappings":"AAKO,MAAMA,IAAgB,CAACC,MAAsEA,KAAU,MAEjGC,IAAyB,CAACD,GAAeE,MAA0B,KAAK;AAAA,EACnF,KAAK,IAAIF,GAAOD,EAAcG,KAAA,gBAAAA,EAAO,GAAG,IAAKA,KAAA,gBAAAA,EAAO,MAAiB,KAAQ;AAAA,EAC7EH,EAAcG,KAAA,gBAAAA,EAAO,GAAG,IAAKA,KAAA,gBAAAA,EAAO,MAAiB;AACvD;AAEO,IAAKC,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,WAAW,YACXA,EAAA,WAAW,YACXA,EAAA,SAAS,UAJCA,IAAAA,KAAA,CAAA,CAAA;AAOL,MAAMC,IAAkB,CAC7BJ,GACAK,GACAC,GACAJ,MACW;AACX,MAAIK,IAAS;AAEb,UAAQD,GAAA;AAAA,IACN,KAAK,OAAe;AAClB,MAAAC,IAASP,IAAQK;AACjB;AAAA,IACF;AAAA,IACA,KAAK,YAAoB;AACvB,MAAAE,IAASP,IAAQK;AACjB;AAAA,IACF;AAAA,IACA,KAAK,YAAoB;AACvB,MAAAE,IAASP,IAAQK;AACjB;AAAA,IACF;AAAA,IACA,KAAK,UAAkB;AACrB,MAAAE,IAASF,MAAY,IAAI,IAAIL,IAAQK;AACrC;AAAA,IACF;AAAA,EAEE;AAGJ,SAAOJ,EAAuBM,GAAQL,CAAK;AAC7C,GAEaM,IAET,CAACR,GAAeS,IAAM,GAAGP,MAA0BE,EAAgBJ,GAAOS,GAAK,OAAeP,CAAK,GAE1FQ,IAET,CAACV,GAAeS,IAAM,GAAGP,MAA0BE,EAAgBJ,GAAOS,GAAK,YAAoBP,CAAK,GAE/FS,IAAW,CACtBX,GACAE,MACS,OAAOF,KAAU,YAAYE,IAAQD,EAAuBD,GAAOE,CAAK,IAAIF;"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { keyExtractor as r, keyExtractorFunction as a } from "./keyExtractor.js";
|
|
2
|
-
import { dateRangeFormat as i, getDateTime as m, getTimeFromNow as n, getTimeFromNowOriginal as l, getTimeTo as s } from "./date.js";
|
|
3
|
-
import { peregrineMQInstance as c } from "./appState/peregrineMQ/index.js";
|
|
4
|
-
import { ArrayFirst as x, ArrayLast as T } from "./array.js";
|
|
5
|
-
import { AsyncFunctionTemplate as u, debounce as S, delay as g, isFunctionAsync as h, memoize as y, memoizeComplex as C, memoizer as M, nestedTernary as v } from "./helpers/other.js";
|
|
6
|
-
import { DATE_FORMAT as F, DATE_TIME_FORMAT as N, formatDate as b, formatDateTime as A, formatDateToTimestamp as I, getDate as D } from "./helpers/date.js";
|
|
7
|
-
import { NON_EXISTENT_CHANNEL as V } from "./appState/peregrineMQ/peregrineMQ.types.js";
|
|
8
|
-
import { Operation as L, decrementValue as P, incerementValue as R, numberDefined as w, numberOperation as _, restrictNumberInLimits as k, setValue as j } from "./helpers/valueOperations.js";
|
|
9
|
-
import { PeregrineMQ as Q, PeregrineMQClearError as H } from "./appState/peregrineMQ/peregrineMQ.js";
|
|
10
|
-
import { TinyStateMachine as q, TinyStateMachineEvent as U, TinyStateMachineEventType as W, TinyStateMachineState as X, createStates as G, stateIterator as K } from "./appState/stateMachine/tiny-state-machine.base.js";
|
|
11
|
-
import { anchorClick as Z, classNames as $, generateId as ee, getBaseThemes as te, mapSerReplacer as re, noop as ae, observeThemePreference as oe, parseProps as ie, setThemeClassNames as me, switchColorTheme as ne, updateColorTheme as le } from "./helpers/ui.js";
|
|
12
|
-
import { arrayToObjectTree as pe, chunkArray as ce, duplicatesInArray as fe, formatJsonString as xe, formatObj as Te, formatObj2 as de } from "./helpers/objectOperations.js";
|
|
13
|
-
import { canSetStateMerge as Se, createStore as ge, getSetStateMerge as he, shallowEqual as ye } from "./appState/store/store.vanillajs.js";
|
|
14
|
-
import { cancelableSetInterval as Me, cancelableSetTimeout as ve } from "./helpers/cancelableDelayedFunction.js";
|
|
15
|
-
import { ced as Fe, createResolveAttribute as Ne, customElementDefine as be, resolveAttributes as Ae } from "./webComponents/webComponent.utils.js";
|
|
16
|
-
import { cleanCsvLines as De, formatFilePath as Oe } from "./helpers/file.js";
|
|
17
|
-
import { composeId as ze, defaultSanitizeConfig as Le, sanitizeHtml as Pe } from "./helpers/text.js";
|
|
18
|
-
import { createDataStore as we } from "./appState/store/store.vanillajs.templates.js";
|
|
19
|
-
import { emailMatch as ke, emailMatcher as je, regexBuilder as Be } from "./helpers/emailMatcher.js";
|
|
20
|
-
import { escapeRegExp as He, fileNameExt as Je, findStringInText as qe, normalizeString as Ue, removeWhitespaces as We, sanitizeId as Xe, sanitizePathId as Ge, toLowerCase as Ke, toUpperCase as Ye, truncateText as Ze } from "./helpers/textValueOperations.js";
|
|
21
|
-
import { getDeviceId as et } from "./helpers/deviceInfo.js";
|
|
22
|
-
import { getMatch as rt, isValidFormat as at, isValidModulo11 as ot, parse as it, regex as mt } from "./helpers/birthnumberCZSKvalidator.js";
|
|
23
|
-
import { isBirthNumberValid as lt } from "./helpers/birthnumber.validator.js";
|
|
24
|
-
import { parseCSVdata as pt, validateCSVFile as ct, validateCSVlines as ft, validateJSONFile as xt, validateLineCellTrimmed as Tt, validateLineNumColumns as dt, validateSDFFile as ut } from "./helpers/fileValidator.js";
|
|
25
|
-
export {
|
|
26
|
-
x as ArrayFirst,
|
|
27
|
-
T as ArrayLast,
|
|
28
|
-
u as AsyncFunctionTemplate,
|
|
29
|
-
F as DATE_FORMAT,
|
|
30
|
-
N as DATE_TIME_FORMAT,
|
|
31
|
-
V as NON_EXISTENT_CHANNEL,
|
|
32
|
-
L as Operation,
|
|
33
|
-
Q as PeregrineMQ,
|
|
34
|
-
H as PeregrineMQClearError,
|
|
35
|
-
q as TinyStateMachine,
|
|
36
|
-
U as TinyStateMachineEvent,
|
|
37
|
-
W as TinyStateMachineEventType,
|
|
38
|
-
X as TinyStateMachineState,
|
|
39
|
-
Z as anchorClick,
|
|
40
|
-
pe as arrayToObjectTree,
|
|
41
|
-
Se as canSetStateMerge,
|
|
42
|
-
Me as cancelableSetInterval,
|
|
43
|
-
ve as cancelableSetTimeout,
|
|
44
|
-
Fe as ced,
|
|
45
|
-
ce as chunkArray,
|
|
46
|
-
$ as classNames,
|
|
47
|
-
De as cleanCsvLines,
|
|
48
|
-
ze as composeId,
|
|
49
|
-
we as createDataStore,
|
|
50
|
-
Ne as createResolveAttribute,
|
|
51
|
-
G as createStates,
|
|
52
|
-
ge as createStore,
|
|
53
|
-
be as customElementDefine,
|
|
54
|
-
i as dateRangeFormat,
|
|
55
|
-
S as debounce,
|
|
56
|
-
P as decrementValue,
|
|
57
|
-
Le as defaultSanitizeConfig,
|
|
58
|
-
g as delay,
|
|
59
|
-
fe as duplicatesInArray,
|
|
60
|
-
ke as emailMatch,
|
|
61
|
-
je as emailMatcher,
|
|
62
|
-
He as escapeRegExp,
|
|
63
|
-
Je as fileNameExt,
|
|
64
|
-
qe as findStringInText,
|
|
65
|
-
b as formatDate,
|
|
66
|
-
A as formatDateTime,
|
|
67
|
-
I as formatDateToTimestamp,
|
|
68
|
-
Oe as formatFilePath,
|
|
69
|
-
xe as formatJsonString,
|
|
70
|
-
Te as formatObj,
|
|
71
|
-
de as formatObj2,
|
|
72
|
-
ee as generateId,
|
|
73
|
-
te as getBaseThemes,
|
|
74
|
-
D as getDate,
|
|
75
|
-
m as getDateTime,
|
|
76
|
-
et as getDeviceId,
|
|
77
|
-
rt as getMatch,
|
|
78
|
-
he as getSetStateMerge,
|
|
79
|
-
n as getTimeFromNow,
|
|
80
|
-
l as getTimeFromNowOriginal,
|
|
81
|
-
s as getTimeTo,
|
|
82
|
-
R as incerementValue,
|
|
83
|
-
lt as isBirthNumberValid,
|
|
84
|
-
h as isFunctionAsync,
|
|
85
|
-
at as isValidFormat,
|
|
86
|
-
ot as isValidModulo11,
|
|
87
|
-
r as keyExtractor,
|
|
88
|
-
a as keyExtractorFunction,
|
|
89
|
-
re as mapSerReplacer,
|
|
90
|
-
y as memoize,
|
|
91
|
-
C as memoizeComplex,
|
|
92
|
-
M as memoizer,
|
|
93
|
-
v as nestedTernary,
|
|
94
|
-
ae as noop,
|
|
95
|
-
Ue as normalizeString,
|
|
96
|
-
w as numberDefined,
|
|
97
|
-
_ as numberOperation,
|
|
98
|
-
oe as observeThemePreference,
|
|
99
|
-
it as parse,
|
|
100
|
-
pt as parseCSVdata,
|
|
101
|
-
ie as parseProps,
|
|
102
|
-
c as peregrineMQInstance,
|
|
103
|
-
mt as regex,
|
|
104
|
-
Be as regexBuilder,
|
|
105
|
-
We as removeWhitespaces,
|
|
106
|
-
Ae as resolveAttributes,
|
|
107
|
-
k as restrictNumberInLimits,
|
|
108
|
-
Pe as sanitizeHtml,
|
|
109
|
-
Xe as sanitizeId,
|
|
110
|
-
Ge as sanitizePathId,
|
|
111
|
-
me as setThemeClassNames,
|
|
112
|
-
j as setValue,
|
|
113
|
-
ye as shallowEqual,
|
|
114
|
-
K as stateIterator,
|
|
115
|
-
ne as switchColorTheme,
|
|
116
|
-
Ke as toLowerCase,
|
|
117
|
-
Ye as toUpperCase,
|
|
118
|
-
Ze as truncateText,
|
|
119
|
-
le as updateColorTheme,
|
|
120
|
-
ct as validateCSVFile,
|
|
121
|
-
ft as validateCSVlines,
|
|
122
|
-
xt as validateJSONFile,
|
|
123
|
-
Tt as validateLineCellTrimmed,
|
|
124
|
-
dt as validateLineNumColumns,
|
|
125
|
-
ut as validateSDFFile
|
|
126
|
-
};
|
|
127
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyExtractor.js","sources":["../../../../../../src/core/utils/keyExtractor.ts"],"sourcesContent":["import { memoizeComplex } from './helpers/other'\n\ntype ItemLikeObject = {\n key?: string\n id?: string | number\n}\n\nexport function keyExtractorFunction<Item extends ItemLikeObject>(item: Item, index: number): string {\n return String(item?.key ?? item?.id ?? index)\n}\n\nexport const keyExtractor = memoizeComplex(keyExtractorFunction)\n"],"names":["keyExtractorFunction","item","index","keyExtractor","memoizeComplex"],"mappings":";AAOO,SAASA,EAAkDC,GAAYC,GAAuB;AACnG,SAAO,QAAOD,KAAA,gBAAAA,EAAM,SAAOA,KAAA,gBAAAA,EAAM,OAAMC,CAAK;AAC9C;AAEO,MAAMC,IAAeC,EAAeJ,CAAoB;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webComponent.utils.js","sources":["../../../../../../../src/core/utils/webComponents/webComponent.utils.ts"],"sourcesContent":["/* custom elements define */\nexport const ced = (name: string): (componentClass: typeof HTMLElement) => void => (\n componentClass: typeof HTMLElement,\n) => {\n customElements.get(name) || customElements.define(name, componentClass)\n}\n\nexport const customElementDefine = ced\n\n\n\nexport const createResolveAttribute = (\n component: Element & Record<string, any>,\n) => (\n attributeName: string,\n // eslint-disable-next-line default-param-last\n overrideProperty = true,\n valueMap?: (value: unknown) => unknown,\n): boolean => {\n const attrValue = component.getAttribute(attributeName)\n const attrValueDefined = attrValue !== undefined\n\n if (overrideProperty && attrValueDefined && component[attributeName] === undefined) {\n // eslint-disable-next-line no-param-reassign\n component[attributeName] = valueMap ? valueMap(attrValue) : attrValue\n }\n\n return attrValueDefined\n}\n\nexport const resolveAttributes = (\n component: Element & Record<string, any>,\n attributes: ({ name: string; override: boolean; valueMap?: (value: unknown) => unknown } | string)[],\n): void => {\n const resolver = createResolveAttribute(component)\n\n attributes.forEach((attribute) => {\n if (typeof attribute === 'string') {\n resolver(attribute)\n } else {\n const { name, override, valueMap } = attribute\n\n resolver(name, override, valueMap)\n }\n })\n}\n"],"names":["ced","name","componentClass","customElementDefine","createResolveAttribute","component","attributeName","overrideProperty","valueMap","attrValue","attrValueDefined","resolveAttributes","attributes","resolver","attribute","override"],"mappings":"AACO,MAAMA,IAAM,CAACC,MAA+D,CACjFC,MACG;AACH,iBAAe,IAAID,CAAI,KAAK,eAAe,OAAOA,GAAMC,CAAc;AACxE,GAEaC,IAAsBH,GAItBI,IAAyB,CACpCC,MACG,CACHC,GAEAC,IAAmB,IACnBC,MACY;AACZ,QAAMC,IAAYJ,EAAU,aAAaC,CAAa,GAChDI,IAAmBD,MAAc;AAEvC,SAAIF,KAAoBG,KAAoBL,EAAUC,CAAa,MAAM,WAEvED,EAAUC,CAAa,IAAIE,IAAWA,EAASC,CAAS,IAAIA,IAGvDC;AACT,GAEaC,IAAoB,CAC/BN,GACAO,MACS;AACT,QAAMC,IAAWT,EAAuBC,CAAS;AAEjD,EAAAO,EAAW,QAAQ,CAACE,MAAc;AAChC,QAAI,OAAOA,KAAc;AACvB,MAAAD,EAASC,CAAS;AAAA,SACb;AACL,YAAM,EAAE,MAAAb,GAAM,UAAAc,GAAU,UAAAP,EAAA,IAAaM;AAErC,MAAAD,EAASZ,GAAMc,GAAUP,CAAQ;AAAA,IACnC;AAAA,EACF,CAAC;AACH;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sources":["../../../../../../node_modules/uuid/dist/esm-browser/native.js"],"sourcesContent":["const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};"],"names":["randomUUID","native"],"mappings":"4GAAA,MAAMA,EAAa,OAAO,OAAW,KAAe,OAAO,YAAc,OAAO,WAAW,KAAK,MAAM,EACtGC,EAAe,CACb,WAAAD,CACF","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let e;const t=new Uint8Array(16);function o(){if(!e&&(e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}exports.default=o;
|
|
2
|
-
//# sourceMappingURL=rng.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rng.js","sources":["../../../../../../node_modules/uuid/dist/esm-browser/rng.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}"],"names":["getRandomValues","rnds8","rng"],"mappings":"4GAGA,IAAIA,EACJ,MAAMC,EAAQ,IAAI,WAAW,EAAE,EAChB,SAASC,GAAM,CAE5B,GAAI,CAACF,IAEHA,EAAkB,OAAO,OAAW,KAAe,OAAO,iBAAmB,OAAO,gBAAgB,KAAK,MAAM,EAE3G,CAACA,GACH,MAAM,IAAI,MAAM,0GAA0G,EAI9H,OAAOA,EAAgBC,CAAK,CAC9B","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=[];for(let i=0;i<256;++i)n.push((i+256).toString(16).slice(1));function c(i,u=0){return n[i[u+0]]+n[i[u+1]]+n[i[u+2]]+n[i[u+3]]+"-"+n[i[u+4]]+n[i[u+5]]+"-"+n[i[u+6]]+n[i[u+7]]+"-"+n[i[u+8]]+n[i[u+9]]+"-"+n[i[u+10]]+n[i[u+11]]+n[i[u+12]]+n[i[u+13]]+n[i[u+14]]+n[i[u+15]]}exports.unsafeStringify=c;
|
|
2
|
-
//# sourceMappingURL=stringify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.js","sources":["../../../../../../node_modules/uuid/dist/esm-browser/stringify.js"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;"],"names":["byteToHex","unsafeStringify","arr","offset"],"mappings":"gFAMA,MAAMA,EAAY,CAAA,EAElB,QAAS,EAAI,EAAG,EAAI,IAAK,EAAE,EACzBA,EAAU,MAAM,EAAI,KAAO,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,EAG3C,SAASC,EAAgBC,EAAKC,EAAS,EAAG,CAG/C,OAAOH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAIH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAIH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAIH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAI,IAAMH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAIH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAI,IAAMH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAIH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAI,IAAMH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAIH,EAAUE,EAAIC,EAAS,CAAC,CAAC,EAAI,IAAMH,EAAUE,EAAIC,EAAS,EAAE,CAAC,EAAIH,EAAUE,EAAIC,EAAS,EAAE,CAAC,EAAIH,EAAUE,EAAIC,EAAS,EAAE,CAAC,EAAIH,EAAUE,EAAIC,EAAS,EAAE,CAAC,EAAIH,EAAUE,EAAIC,EAAS,EAAE,CAAC,EAAIH,EAAUE,EAAIC,EAAS,EAAE,CAAC,CACnf","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./native.js"),u=require("./rng.js"),n=require("./stringify.js");function f(e,a,d){if(t.default.randomUUID&&!e)return t.default.randomUUID();e=e||{};const r=e.random||(e.rng||u.default)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,n.unsafeStringify(r)}exports.default=f;
|
|
2
|
-
//# sourceMappingURL=v4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v4.js","sources":["../../../../../../node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"names":["v4","options","buf","offset","native","rnds","rng","unsafeStringify"],"mappings":"6LAIA,SAASA,EAAGC,EAASC,EAAKC,EAAQ,CAChC,GAAIC,UAAO,YAAsB,CAACH,EAChC,OAAOG,EAAAA,QAAO,WAAU,EAG1BH,EAAUA,GAAW,CAAA,EACrB,MAAMI,EAAOJ,EAAQ,SAAWA,EAAQ,KAAOK,EAAAA,WAE/C,OAAAD,EAAK,CAAC,EAAIA,EAAK,CAAC,EAAI,GAAO,GAC3BA,EAAK,CAAC,EAAIA,EAAK,CAAC,EAAI,GAAO,IAYpBE,EAAAA,gBAAgBF,CAAI,CAC7B","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./peregrineMQ.js"),r=new e.PeregrineMQ;exports.PeregrineMQ=e.PeregrineMQ;exports.PeregrineMQClearError=e.PeregrineMQClearError;exports.peregrineMQInstance=r;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../src/core/utils/appState/peregrineMQ/index.ts"],"sourcesContent":["import { PeregrineMQ } from './peregrineMQ'\n\nexport { PeregrineMQ, PeregrineMQClearError } from './peregrineMQ'\n\nexport const peregrineMQInstance = new PeregrineMQ()\n\nexport * from './peregrineMQ.types'\n"],"names":["peregrineMQInstance","PeregrineMQ"],"mappings":"oHAIaA,EAAsB,IAAIC,EAAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var c=(h,e,s)=>e in h?a(h,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):h[e]=s;var n=(h,e,s)=>c(h,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./peregrineMQ.types.js"),d=require("../../../../../node_modules/uuid/dist/esm-browser/v4.js");class o extends Error{constructor(){super("Clearing PeregrineMQ is not allowed. Please read the documentation for more information."),this.name="PeregrineMQClearError"}}class g{constructor(e,s){n(this,"id");n(this,"config",{allowAutoPrune:!1,pruneInterval:1e4,allowClear:!1});n(this,"channels",new Map);n(this,"listeners",new Map);n(this,"addListener",(e,s)=>{const t=this.listeners.get(e),r=this.channels.get(s);r&&(t?t.push(r):this.listeners.set(e,[r]))});n(this,"removeListener",e=>{const s=this.listeners.get(e);let t=!0;for(const r of s||[])if(t=!r.has(e),!t)break;t&&this.listeners.delete(e)});n(this,"publishToChannel",(e,s,t)=>{const r=this.channels.get(e);if(!r)return f.NON_EXISTENT_CHANNEL;const l=r[Symbol.iterator]();let u=l.next().value;const i=[];for(;u;)i.push(u(e,t)),u=l.next().value;return(i==null?void 0:i.length)===1?i[0]:i});n(this,"configure",e=>{this.config=e;const{allowAutoPrune:s,pruneInterval:t}=e;let r;s&&(r=setInterval(()=>{this.prune()},t));const l=this;return{...s?{clearPruneInterval:()=>{clearInterval(r)},restartPruneInterval:()=>{clearInterval(r),r=setInterval(()=>{l.prune()},t)}}:{}}});n(this,"getChannels",()=>[...this.channels.keys()]);n(this,"prune",()=>{var r;const e=this.channels[Symbol.iterator]();let s=e.next().value;const t=[];for(;s;)((r=s[1])==null?void 0:r.size)===0&&(t.push(s[0]),this.channels.delete(s[0])),s=e.next().value;return t});n(this,"removeChannel",e=>{const s=this.channels.get(e);if(s&&s.size>0){const t=[...s||[]];s.clear();let r=t.length;for(;r--;)this.removeListener(t[r])}return this.channels.delete(e)});n(this,"publish",(e,s)=>{if(e.includes(".")){const t=e.split(".");let{length:r}=t,l=0;const u=[];for(;r--;){const i=this.publishToChannel(t.slice(0,l+1).join("."),r!==t.length-1,s);l+=1,u.push(i)}return u}return this.publishToChannel(e,!1,s)});n(this,"subscribe",(e,s)=>{const t=this.channels.get(e);return t?t.add(s):this.channels.set(e,new Set([s])),this.addListener(s,e),()=>this.unsubscribe(s,{channel:e,prune:!0})});n(this,"unsubscribe",(e,s)=>{const{channel:t,prune:r}=s||{};let l=!1;if(t){const i=this.channels.get(t);return l=i?i.delete(e):!1,r&&(i==null?void 0:i.size)===0&&this.channels.delete(t),this.removeListener(e),l}const u=this.listeners.get(e)||[];for(const i of u)l=i.delete(e),r&&i.size===0&&this.prune();return this.listeners.delete(e),l});n(this,"isSubscribed",(e,s)=>{if(s){const t=this.channels.get(s);return t?t.has(e):!1}return this.listeners.has(e)});n(this,"clear",()=>{if(this.config.allowClear)this.channels.clear(),this.listeners.clear();else throw new o});n(this,"getId",()=>this.id);this.id=e||d.default(),this.configure(s||{})}get length(){return[...this.channels.values()].reduce((e,s)=>e+s.size,0)}}exports.PeregrineMQ=g;exports.PeregrineMQClearError=o;
|
|
2
|
-
//# sourceMappingURL=peregrineMQ.js.map
|