@cyberskill/shared 1.208.0 → 1.209.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/config-CwzVfkkX.js +6 -0
  2. package/dist/index-BG1UznTl.js +628 -0
  3. package/dist/{magic-string.es-C6Zk6wMx.js → magic-string.es-BQ9KnLz-.js} +105 -117
  4. package/dist/src/config/config.type.d.ts +1 -1
  5. package/dist/src/config/config.util.d.ts +1 -1
  6. package/dist/src/config/config.util.js +48 -7
  7. package/dist/src/config/env/env.util.js +10 -10
  8. package/dist/src/config/eslint/index.js +4 -15
  9. package/dist/src/config/graphql-codegen/graphql-codegen.util.js +30 -39
  10. package/dist/src/config/index.js +1 -1
  11. package/dist/src/config/vitest/vitest.e2e.js +9 -19
  12. package/dist/src/config/vitest/vitest.unit.js +11 -22
  13. package/dist/src/config/vitest/vitest.unit.setup.js +9339 -9868
  14. package/dist/src/constant/common.js +1 -1
  15. package/dist/src/node/apollo-server/apollo-server.util.js +23 -54
  16. package/dist/src/node/cli/index.d.ts +2 -1
  17. package/dist/src/node/cli/index.js +108 -1
  18. package/dist/src/node/command/command.util.js +9 -10
  19. package/dist/src/node/command/index.js +1 -1
  20. package/dist/src/node/express/express.util.js +39 -77
  21. package/dist/src/node/express/index.js +9 -9
  22. package/dist/src/node/fs/fs.util.js +40 -59
  23. package/dist/src/node/log/index.js +6 -6
  24. package/dist/src/node/log/log.util.js +32 -33
  25. package/dist/src/node/mongo/mongo.util.js +381 -457
  26. package/dist/src/node/package/index.js +3 -3
  27. package/dist/src/node/package/package.util.js +2 -2
  28. package/dist/src/node/path/index.js +30 -30
  29. package/dist/src/node/path/path.constant.js +30 -30
  30. package/dist/src/node/storage/storage.util.js +40 -70
  31. package/dist/src/node/upload/index.js +1 -1
  32. package/dist/src/node/upload/upload.util.js +125 -6
  33. package/dist/src/react/apollo-client/apollo-client.component.js +15 -13
  34. package/dist/src/react/apollo-client/apollo-client.type.d.ts +1 -1
  35. package/dist/src/react/apollo-client/apollo-client.util.js +66 -81
  36. package/dist/src/react/apollo-client/index.js +25 -26
  37. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.js +7 -8
  38. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.js +11 -21
  39. package/dist/src/react/apollo-error/apollo-error.component.js +7 -7
  40. package/dist/src/react/apollo-error/apollo-error.util.js +7 -7
  41. package/dist/src/react/loading/loading.component.js +24 -45
  42. package/dist/src/react/loading/loading.provider.d.ts +1 -1
  43. package/dist/src/react/log/log.util.js +9 -9
  44. package/dist/src/react/next-intl/next-intl.hoc.d.ts +1 -1
  45. package/dist/src/react/next-intl/next-intl.hoc.js +17 -29
  46. package/dist/src/react/next-intl/next-intl.provider.js +18 -19
  47. package/dist/src/react/next-intl/next-intl.type.d.ts +1 -1
  48. package/dist/src/react/storage/storage.hook.js +37 -53
  49. package/dist/src/react/storage/storage.util.js +25 -50
  50. package/dist/src/react/userback/userback.component.js +16 -43
  51. package/dist/src/typescript/index.d.ts +2 -2
  52. package/dist/src/typescript/index.js +2 -2
  53. package/dist/src/typescript/style.d.js +1 -1
  54. package/dist/src/util/common/common.util.js +14 -25
  55. package/dist/src/util/object/object.util.d.ts +1 -1
  56. package/dist/src/util/object/object.util.js +39 -49
  57. package/dist/src/util/string/string.util.js +40 -53
  58. package/dist/style.css +1 -1
  59. package/package.json +43 -76
  60. package/dist/config-B7WSlzSh.js +0 -8
  61. package/dist/config-DDQ9k8fw.cjs +0 -1
  62. package/dist/config.util-Ci2CZDut.cjs +0 -1
  63. package/dist/config.util-DKBwEBKR.js +0 -61
  64. package/dist/favicon/android-icon-144x144.png +0 -0
  65. package/dist/favicon/android-icon-192x192.png +0 -0
  66. package/dist/favicon/android-icon-36x36.png +0 -0
  67. package/dist/favicon/android-icon-48x48.png +0 -0
  68. package/dist/favicon/android-icon-72x72.png +0 -0
  69. package/dist/favicon/android-icon-96x96.png +0 -0
  70. package/dist/favicon/apple-icon-114x114.png +0 -0
  71. package/dist/favicon/apple-icon-120x120.png +0 -0
  72. package/dist/favicon/apple-icon-144x144.png +0 -0
  73. package/dist/favicon/apple-icon-152x152.png +0 -0
  74. package/dist/favicon/apple-icon-180x180.png +0 -0
  75. package/dist/favicon/apple-icon-57x57.png +0 -0
  76. package/dist/favicon/apple-icon-60x60.png +0 -0
  77. package/dist/favicon/apple-icon-72x72.png +0 -0
  78. package/dist/favicon/apple-icon-76x76.png +0 -0
  79. package/dist/favicon/apple-icon-precomposed.png +0 -0
  80. package/dist/favicon/apple-icon.png +0 -0
  81. package/dist/favicon/browserconfig.xml +0 -2
  82. package/dist/favicon/favicon-16x16.png +0 -0
  83. package/dist/favicon/favicon-32x32.png +0 -0
  84. package/dist/favicon/favicon-96x96.png +0 -0
  85. package/dist/favicon/favicon.ico +0 -0
  86. package/dist/favicon/manifest.json +0 -41
  87. package/dist/favicon/ms-icon-144x144.png +0 -0
  88. package/dist/favicon/ms-icon-150x150.png +0 -0
  89. package/dist/favicon/ms-icon-310x310.png +0 -0
  90. package/dist/favicon/ms-icon-70x70.png +0 -0
  91. package/dist/log.type-CMvG6Box.cjs +0 -1
  92. package/dist/log.type-DTOvZHyz.js +0 -4
  93. package/dist/magic-string.es-CjWtD8Pa.cjs +0 -10
  94. package/dist/path.constant-CWtb99gS.cjs +0 -2
  95. package/dist/path.constant-CvSr0Rrx.js +0 -682
  96. package/dist/src/config/commitlint/index.cjs +0 -1
  97. package/dist/src/config/config.util.cjs +0 -1
  98. package/dist/src/config/env/env.constant.cjs +0 -1
  99. package/dist/src/config/env/env.d.cjs +0 -1
  100. package/dist/src/config/env/env.d.js +0 -1
  101. package/dist/src/config/env/env.util.cjs +0 -1
  102. package/dist/src/config/env/index.cjs +0 -1
  103. package/dist/src/config/eslint/index.cjs +0 -1
  104. package/dist/src/config/graphql-codegen/graphql-codegen.util.cjs +0 -1
  105. package/dist/src/config/graphql-codegen/index.cjs +0 -1
  106. package/dist/src/config/index.cjs +0 -1
  107. package/dist/src/config/lint-staged/index.cjs +0 -1
  108. package/dist/src/config/vitest/index.cjs +0 -1
  109. package/dist/src/config/vitest/vitest.e2e.cjs +0 -1
  110. package/dist/src/config/vitest/vitest.unit.cjs +0 -1
  111. package/dist/src/config/vitest/vitest.unit.setup.cjs +0 -508
  112. package/dist/src/constant/common.cjs +0 -1
  113. package/dist/src/constant/index.cjs +0 -1
  114. package/dist/src/constant/response-status.cjs +0 -1
  115. package/dist/src/node/apollo-server/apollo-server.util.cjs +0 -1
  116. package/dist/src/node/apollo-server/index.cjs +0 -1
  117. package/dist/src/node/cli/cli.util.cjs +0 -6
  118. package/dist/src/node/cli/cli.util.d.ts +0 -2
  119. package/dist/src/node/cli/cli.util.js +0 -171
  120. package/dist/src/node/cli/index.cjs +0 -1
  121. package/dist/src/node/command/command.util.cjs +0 -1
  122. package/dist/src/node/command/index.cjs +0 -1
  123. package/dist/src/node/express/express.util.cjs +0 -1
  124. package/dist/src/node/express/index.cjs +0 -1
  125. package/dist/src/node/fs/fs.util.cjs +0 -1
  126. package/dist/src/node/fs/index.cjs +0 -1
  127. package/dist/src/node/log/index.cjs +0 -1
  128. package/dist/src/node/log/log.util.cjs +0 -1
  129. package/dist/src/node/mongo/index.cjs +0 -1
  130. package/dist/src/node/mongo/mongo.constant.cjs +0 -1
  131. package/dist/src/node/mongo/mongo.util.cjs +0 -5
  132. package/dist/src/node/package/index.cjs +0 -1
  133. package/dist/src/node/package/package.util.cjs +0 -1
  134. package/dist/src/node/path/index.cjs +0 -1
  135. package/dist/src/node/path/path.constant.cjs +0 -1
  136. package/dist/src/node/path/path.util.cjs +0 -1
  137. package/dist/src/node/storage/index.cjs +0 -1
  138. package/dist/src/node/storage/storage.util.cjs +0 -1
  139. package/dist/src/node/upload/index.cjs +0 -1
  140. package/dist/src/node/upload/upload.util.cjs +0 -1
  141. package/dist/src/node/ws/index.cjs +0 -1
  142. package/dist/src/node/ws/ts.util.cjs +0 -1
  143. package/dist/src/react/apollo-client/apollo-client.component.cjs +0 -1
  144. package/dist/src/react/apollo-client/apollo-client.constant.cjs +0 -1
  145. package/dist/src/react/apollo-client/apollo-client.context.cjs +0 -1
  146. package/dist/src/react/apollo-client/apollo-client.hook.cjs +0 -1
  147. package/dist/src/react/apollo-client/apollo-client.util.cjs +0 -1
  148. package/dist/src/react/apollo-client/index.cjs +0 -1
  149. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +0 -1
  150. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +0 -1
  151. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +0 -1
  152. package/dist/src/react/apollo-client-nextjs/index.cjs +0 -1
  153. package/dist/src/react/apollo-error/apollo-error.component.cjs +0 -1
  154. package/dist/src/react/apollo-error/apollo-error.context.cjs +0 -1
  155. package/dist/src/react/apollo-error/apollo-error.hook.cjs +0 -1
  156. package/dist/src/react/apollo-error/apollo-error.provider.cjs +0 -1
  157. package/dist/src/react/apollo-error/apollo-error.util.cjs +0 -1
  158. package/dist/src/react/apollo-error/index.cjs +0 -1
  159. package/dist/src/react/i18next/i18next.hook.cjs +0 -1
  160. package/dist/src/react/i18next/i18next.util.cjs +0 -1
  161. package/dist/src/react/i18next/index.cjs +0 -1
  162. package/dist/src/react/loading/index.cjs +0 -1
  163. package/dist/src/react/loading/loading.component.cjs +0 -6
  164. package/dist/src/react/loading/loading.context.cjs +0 -1
  165. package/dist/src/react/loading/loading.hook.cjs +0 -1
  166. package/dist/src/react/loading/loading.provider.cjs +0 -1
  167. package/dist/src/react/log/index.cjs +0 -1
  168. package/dist/src/react/log/log.util.cjs +0 -1
  169. package/dist/src/react/next-intl/index.cjs +0 -1
  170. package/dist/src/react/next-intl/next-intl.constant.cjs +0 -1
  171. package/dist/src/react/next-intl/next-intl.context.cjs +0 -1
  172. package/dist/src/react/next-intl/next-intl.hoc.cjs +0 -1
  173. package/dist/src/react/next-intl/next-intl.hook.cjs +0 -1
  174. package/dist/src/react/next-intl/next-intl.provider.cjs +0 -1
  175. package/dist/src/react/storage/index.cjs +0 -1
  176. package/dist/src/react/storage/storage.hook.cjs +0 -1
  177. package/dist/src/react/storage/storage.util.cjs +0 -1
  178. package/dist/src/react/toast/index.cjs +0 -1
  179. package/dist/src/react/userback/index.cjs +0 -1
  180. package/dist/src/react/userback/userback.component.cjs +0 -1
  181. package/dist/src/typescript/common.cjs +0 -1
  182. package/dist/src/typescript/common.js +0 -4
  183. package/dist/src/typescript/index.cjs +0 -1
  184. package/dist/src/typescript/react.cjs +0 -1
  185. package/dist/src/typescript/react.js +0 -1
  186. package/dist/src/typescript/style.d.cjs +0 -1
  187. package/dist/src/util/common/common.util.cjs +0 -1
  188. package/dist/src/util/common/index.cjs +0 -1
  189. package/dist/src/util/index.cjs +0 -1
  190. package/dist/src/util/object/index.cjs +0 -1
  191. package/dist/src/util/object/object.util.cjs +0 -1
  192. package/dist/src/util/serializer/index.cjs +0 -1
  193. package/dist/src/util/serializer/serializer.util.cjs +0 -1
  194. package/dist/src/util/string/index.cjs +0 -1
  195. package/dist/src/util/string/string.util.cjs +0 -1
  196. package/dist/src/util/validate/index.cjs +0 -1
  197. package/dist/src/util/validate/validate.util.cjs +0 -1
  198. package/dist/tsconfig.base.json +0 -37
  199. package/dist/upload.util-CE3MjBdh.cjs +0 -1
  200. package/dist/upload.util-D4aUdmPo.js +0 -160
  201. /package/dist/src/typescript/{common.d.ts → common.type.d.ts} +0 -0
  202. /package/dist/src/typescript/{react.d.ts → react.type.d.ts} +0 -0
@@ -1,77 +1,61 @@
1
- var l = (o, a, e) => new Promise((c, r) => {
2
- var d = (s) => {
3
- try {
4
- n(e.next(s));
5
- } catch (t) {
6
- r(t);
7
- }
8
- }, u = (s) => {
9
- try {
10
- n(e.throw(s));
11
- } catch (t) {
12
- r(t);
13
- }
14
- }, n = (s) => s.done ? c(s.value) : Promise.resolve(s.value).then(d, u);
15
- n((e = e.apply(o, a)).next());
16
- });
17
- import { useState as h, useEffect as g, useCallback as w } from "react";
18
- import { serializer as y } from "../../util/serializer/serializer.util.js";
19
- import { catchError as p } from "../log/log.util.js";
20
- import { storage as m } from "./storage.util.js";
21
- function x(o, a, e = y) {
22
- const [c, r] = h(a), [d, u] = h(!1);
23
- g(() => {
1
+ import { useState as m, useEffect as v, useCallback as p } from "react";
2
+ import { storage as n } from "./storage.util.js";
3
+ import { serializer as w } from "../../util/serializer/serializer.util.js";
4
+ import { catchError as u } from "../log/log.util.js";
5
+ function S(e, o, a = w) {
6
+ const [c, r] = m(o), [i, l] = m(!1);
7
+ v(() => {
24
8
  let t = !0;
25
- return l(null, null, function* () {
9
+ return (async () => {
26
10
  try {
27
- const i = yield m.get(o);
11
+ const f = await n.get(e);
28
12
  if (t)
29
- if (i !== null) {
30
- const v = e.deserialize(i);
31
- r(v);
32
- } else if (a !== void 0) {
33
- const v = e.serialize(a);
34
- yield m.set(o, v), r(a);
13
+ if (f !== null) {
14
+ const d = a.deserialize(f);
15
+ r(d);
16
+ } else if (o !== void 0) {
17
+ const d = a.serialize(o);
18
+ await n.set(e, d), r(o);
35
19
  } else
36
20
  r(void 0);
37
- } catch (i) {
38
- p(i), t && r(a);
21
+ } catch (f) {
22
+ u(f), t && r(o);
39
23
  } finally {
40
- t && u(!0);
24
+ t && l(!0);
41
25
  }
42
- }), () => {
43
- t = !1, u(!1);
26
+ })(), () => {
27
+ t = !1, l(!1);
44
28
  };
45
- }, [o, a, e]), g(() => {
46
- if (!d)
29
+ }, [e, o, a]), v(() => {
30
+ if (!i)
47
31
  return;
48
- l(null, null, function* () {
32
+ (async () => {
49
33
  try {
50
34
  if (c !== void 0) {
51
- const f = e.serialize(c);
52
- yield m.set(o, f);
35
+ const s = a.serialize(c);
36
+ await n.set(e, s);
53
37
  }
54
- } catch (f) {
55
- p(f);
38
+ } catch (s) {
39
+ u(s);
56
40
  }
57
- });
58
- }, [c, o, e, d]);
59
- const n = w(
41
+ })();
42
+ }, [c, e, a, i]);
43
+ const h = p(
60
44
  (t) => {
61
45
  r(
62
- (f) => typeof t == "function" ? t(f) : t
46
+ (s) => typeof t == "function" ? t(s) : t
63
47
  );
64
48
  },
65
49
  []
66
- ), s = w(() => l(null, null, function* () {
50
+ ), g = p(async () => {
67
51
  try {
68
- yield m.remove(o), r(void 0);
52
+ await n.remove(e), r(void 0);
69
53
  } catch (t) {
70
- p(t);
54
+ u(t);
71
55
  }
72
- }), [o]);
73
- return { value: c, set: n, remove: s };
56
+ }, [e]);
57
+ return { value: c, set: h, remove: g };
74
58
  }
75
59
  export {
76
- x as useStorage
60
+ S as useStorage
77
61
  };
@@ -1,60 +1,35 @@
1
- var c = (r, t, a) => new Promise((y, u) => {
2
- var i = (e) => {
1
+ import e from "localforage";
2
+ import { catchError as a } from "../log/log.util.js";
3
+ const s = {
4
+ async get(r) {
3
5
  try {
4
- s(a.next(e));
5
- } catch (m) {
6
- u(m);
6
+ return await e.getItem(r);
7
+ } catch (t) {
8
+ return a(t, { returnValue: null });
7
9
  }
8
- }, l = (e) => {
10
+ },
11
+ async set(r, t) {
9
12
  try {
10
- s(a.throw(e));
11
- } catch (m) {
12
- u(m);
13
+ await e.setItem(r, t);
14
+ } catch (c) {
15
+ a(c);
13
16
  }
14
- }, s = (e) => e.done ? y(e.value) : Promise.resolve(e.value).then(i, l);
15
- s((a = a.apply(r, t)).next());
16
- });
17
- import o from "localforage";
18
- import { catchError as n } from "../log/log.util.js";
19
- const p = {
20
- get(r) {
21
- return c(this, null, function* () {
22
- try {
23
- return yield o.getItem(r);
24
- } catch (t) {
25
- return n(t, { returnValue: null });
26
- }
27
- });
28
- },
29
- set(r, t) {
30
- return c(this, null, function* () {
31
- try {
32
- yield o.setItem(r, t);
33
- } catch (a) {
34
- n(a);
35
- }
36
- });
37
17
  },
38
- remove(r) {
39
- return c(this, null, function* () {
40
- try {
41
- yield o.removeItem(r);
42
- } catch (t) {
43
- n(t);
44
- }
45
- });
18
+ async remove(r) {
19
+ try {
20
+ await e.removeItem(r);
21
+ } catch (t) {
22
+ a(t);
23
+ }
46
24
  },
47
- keys() {
48
- return c(this, null, function* () {
49
- try {
50
- const r = yield o.keys();
51
- return r != null ? r : [];
52
- } catch (r) {
53
- return n(r, { returnValue: [] });
54
- }
55
- });
25
+ async keys() {
26
+ try {
27
+ return await e.keys() ?? [];
28
+ } catch (r) {
29
+ return a(r, { returnValue: [] });
30
+ }
56
31
  }
57
32
  };
58
33
  export {
59
- p as storage
34
+ s as storage
60
35
  };
@@ -1,54 +1,27 @@
1
- var i = Object.getOwnPropertySymbols;
2
- var m = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable;
3
- var s = (r, n) => {
4
- var e = {};
5
- for (var t in r)
6
- m.call(r, t) && n.indexOf(t) < 0 && (e[t] = r[t]);
7
- if (r != null && i)
8
- for (var t of i(r))
9
- n.indexOf(t) < 0 && h.call(r, t) && (e[t] = r[t]);
10
- return e;
11
- };
12
- var d = (r, n, e) => new Promise((t, o) => {
13
- var l = (c) => {
14
- try {
15
- u(e.next(c));
16
- } catch (f) {
17
- o(f);
18
- }
19
- }, a = (c) => {
20
- try {
21
- u(e.throw(c));
22
- } catch (f) {
23
- o(f);
24
- }
25
- }, u = (c) => c.done ? t(c.value) : Promise.resolve(c.value).then(l, a);
26
- u((e = e.apply(r, n)).next());
27
- });
28
- import b from "@userback/widget";
29
- import { useEffect as E } from "react";
30
- function v({ token: r, options: n }) {
31
- return E(() => {
1
+ import a from "@userback/widget";
2
+ import { useEffect as l } from "react";
3
+ function d({ token: r, options: n }) {
4
+ return l(() => {
32
5
  if (!r)
33
6
  return;
34
- let e;
35
- return d(null, null, function* () {
36
- const a = n || {}, { hide: o } = a, l = s(a, ["hide"]);
37
- yield b(r, l), o && o.length > 0 && o.forEach((u) => {
38
- document.querySelectorAll(u).forEach((c) => c.remove());
39
- }), e = new MutationObserver(() => {
40
- o && o.length > 0 && o.forEach((u) => {
41
- document.querySelectorAll(u).forEach((c) => c.remove());
7
+ let t;
8
+ return (async () => {
9
+ const { hide: e, ...u } = n || {};
10
+ await a(r, u), e && e.length > 0 && e.forEach((o) => {
11
+ document.querySelectorAll(o).forEach((c) => c.remove());
12
+ }), t = new MutationObserver(() => {
13
+ e && e.length > 0 && e.forEach((o) => {
14
+ document.querySelectorAll(o).forEach((c) => c.remove());
42
15
  });
43
- }), e.observe(document.body, {
16
+ }), t.observe(document.body, {
44
17
  childList: !0,
45
18
  subtree: !0
46
19
  });
47
- }), () => {
48
- e == null || e.disconnect();
20
+ })(), () => {
21
+ t?.disconnect();
49
22
  };
50
23
  }, [r, n]), null;
51
24
  }
52
25
  export {
53
- v as Userback
26
+ d as Userback
54
27
  };
@@ -1,2 +1,2 @@
1
- export * from './common.js';
2
- export * from './react.js';
1
+ export * from './common.type.js';
2
+ export * from './react.type.js';
@@ -1,4 +1,4 @@
1
- import { E_Environment as r } from "./common.js";
1
+ var p = /* @__PURE__ */ ((e) => (e.PRODUCTION = "production", e.STAGING = "staging", e.DEVELOPMENT = "development", e))(p || {});
2
2
  export {
3
- r as E_Environment
3
+ p as E_Environment
4
4
  };
@@ -1 +1 @@
1
-
1
+ import "react-hot-toast";
@@ -1,17 +1,6 @@
1
- var u = Object.defineProperty;
2
- var a = Object.getOwnPropertySymbols;
3
- var O = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
4
- var p = (n, r, e) => r in n ? u(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e, E = (n, r) => {
5
- for (var e in r || (r = {}))
6
- O.call(r, e) && p(n, e, r[e]);
7
- if (a)
8
- for (var e of a(r))
9
- D.call(r, e) && p(n, e, r[e]);
10
- return n;
11
- };
12
- import N from "unorm";
13
- import { E_Environment as o } from "../../typescript/common.js";
14
- const s = {
1
+ import a from "unorm";
2
+ import { E_Environment as o } from "../../typescript/index.js";
3
+ const E = {
15
4
  a: ["à", "á", "ạ", "ả", "ã", "â", "ầ", "ấ", "ậ", "ẩ", "ẫ", "ă", "ằ", "ắ", "ặ", "ẳ", "ẵ"],
16
5
  e: ["è", "é", "ẹ", "ẻ", "ẽ", "ê", "ề", "ế", "ệ", "ể", "ễ"],
17
6
  i: ["ì", "í", "ị", "ỉ", "ĩ"],
@@ -19,23 +8,23 @@ const s = {
19
8
  u: ["ù", "ú", "ụ", "ủ", "ũ", "ư", "ừ", "ứ", "ự", "ử", "ữ"],
20
9
  y: ["ỳ", "ý", "ỵ", "ỷ", "ỹ"],
21
10
  d: ["đ"]
22
- }, m = Object.entries(s).reduce(
11
+ }, p = Object.entries(E).reduce(
23
12
  (n, [r, e]) => (n[r.toUpperCase()] = e.map((t) => t.toUpperCase()), n),
24
13
  {}
25
14
  );
26
- function P(n) {
27
- n = N.nfkc(n);
28
- const r = E(E({}, s), m);
15
+ function O(n) {
16
+ n = a.nfkc(n);
17
+ const r = { ...E, ...p };
29
18
  for (const [e, t] of Object.entries(r)) {
30
19
  const c = `[${e}${t.join("")}]`, i = `(${[e, ...t].join("|")})`;
31
20
  n = n.replace(new RegExp(c, "g"), i);
32
21
  }
33
22
  return n;
34
23
  }
35
- function V(n) {
24
+ function D(n) {
36
25
  return n.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
37
26
  }
38
- function _(n, r) {
27
+ function N(n, r) {
39
28
  if (!r)
40
29
  return Array.from(new Set(n));
41
30
  const e = /* @__PURE__ */ new Set(), t = [];
@@ -45,15 +34,15 @@ function _(n, r) {
45
34
  }
46
35
  return t;
47
36
  }
48
- function C(n) {
37
+ function m(n) {
49
38
  const { NODE_ENV: r = o.DEVELOPMENT, NODE_ENV_MODE: e = o.DEVELOPMENT } = n, t = r === o.DEVELOPMENT && e === o.DEVELOPMENT, c = r === o.PRODUCTION && e === o.STAGING, i = r === o.PRODUCTION && e === o.PRODUCTION;
50
39
  if (r === o.PRODUCTION && e === o.DEVELOPMENT)
51
40
  throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");
52
41
  return { IS_DEV: t, IS_STAG: c, IS_PROD: i };
53
42
  }
54
43
  export {
55
- C as mapEnvironment,
56
- P as regexSearchMapper,
57
- V as removeAccent,
58
- _ as uniqueArray
44
+ m as mapEnvironment,
45
+ O as regexSearchMapper,
46
+ D as removeAccent,
47
+ N as uniqueArray
59
48
  };
@@ -1,4 +1,4 @@
1
- import { T_Object } from '../../typescript/common.js';
1
+ import { T_Object } from '../../typescript/index.js';
2
2
  /**
3
3
  * Check if a string is a valid JSON string.
4
4
  * @param str - The string to check.
@@ -1,77 +1,67 @@
1
- var y = Object.defineProperty, d = Object.defineProperties;
2
- var p = Object.getOwnPropertyDescriptors;
3
- var f = Object.getOwnPropertySymbols;
4
- var g = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
- var c = (e, r, t) => r in e ? y(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, s = (e, r) => {
6
- for (var t in r || (r = {}))
7
- g.call(r, t) && c(e, t, r[t]);
8
- if (f)
9
- for (var t of f(r))
10
- A.call(r, t) && c(e, t, r[t]);
11
- return e;
12
- }, i = (e, r) => d(e, p(r));
13
- function S(e) {
1
+ function a(e) {
14
2
  try {
15
3
  return JSON.parse(e), !0;
16
- } catch (r) {
4
+ } catch {
17
5
  return !1;
18
6
  }
19
7
  }
20
- function a(e) {
8
+ function s(e) {
21
9
  return typeof e == "object" && e !== null && !Array.isArray(e);
22
10
  }
23
- function N(...e) {
24
- const r = {};
25
- for (const t of e.flat())
26
- for (const [n, u] of Object.entries(t)) {
27
- const o = r[n];
11
+ function f(...e) {
12
+ const t = {};
13
+ for (const n of e.flat())
14
+ for (const [r, u] of Object.entries(n)) {
15
+ const o = t[r];
28
16
  if (Array.isArray(u)) {
29
- const l = Array.isArray(o) ? o : [];
30
- r[n] = [.../* @__PURE__ */ new Set([...l, ...u])];
17
+ const i = Array.isArray(o) ? o : [];
18
+ t[r] = [.../* @__PURE__ */ new Set([...i, ...u])];
31
19
  continue;
32
20
  }
33
- if (a(u)) {
34
- r[n] = N(
35
- a(o) ? o : {},
21
+ if (s(u)) {
22
+ t[r] = f(
23
+ s(o) ? o : {},
36
24
  u
37
25
  );
38
26
  continue;
39
27
  }
40
- r[n] = u;
28
+ t[r] = u;
41
29
  }
42
- return r;
30
+ return t;
43
31
  }
44
- function V(e) {
32
+ function l(e) {
45
33
  return JSON.parse(JSON.stringify(e));
46
34
  }
47
- function b(e, r) {
48
- return r.reduce((t, n) => {
49
- if (t && typeof t == "object" && n in t)
50
- return t[n];
35
+ function y(e, t) {
36
+ return t.reduce((n, r) => {
37
+ if (n && typeof n == "object" && r in n)
38
+ return n[r];
51
39
  }, e);
52
40
  }
53
- function O(e, r, t) {
54
- if (r.length === 0)
41
+ function c(e, t, n) {
42
+ if (t.length === 0)
55
43
  return e;
56
- const [n, ...u] = r;
44
+ const [r, ...u] = t;
57
45
  if (u.length === 0)
58
- return i(s({}, e), {
59
- [n]: t
60
- });
61
- const o = e[n];
62
- return i(s({}, e), {
63
- [n]: O(
46
+ return {
47
+ ...e,
48
+ [r]: n
49
+ };
50
+ const o = e[r];
51
+ return {
52
+ ...e,
53
+ [r]: c(
64
54
  typeof o == "object" && o !== null ? o : {},
65
55
  u,
66
- t
56
+ n
67
57
  )
68
- });
58
+ };
69
59
  }
70
60
  export {
71
- V as deepClone,
72
- N as deepMerge,
73
- b as getNestedValue,
74
- S as isJson,
75
- a as isObject,
76
- O as setNestedValue
61
+ l as deepClone,
62
+ f as deepMerge,
63
+ y as getNestedValue,
64
+ a as isJson,
65
+ s as isObject,
66
+ c as setNestedValue
77
67
  };
@@ -1,64 +1,51 @@
1
- var a = Object.defineProperty;
2
- var o = Object.getOwnPropertySymbols;
3
- var d = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
4
- var s = (t, e, r) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, l = (t, e) => {
5
- for (var r in e || (e = {}))
6
- d.call(e, r) && s(t, r, e[r]);
7
- if (o)
8
- for (var r of o(e))
9
- g.call(e, r) && s(t, r, e[r]);
10
- return t;
11
- };
12
1
  import i from "crypto-js";
13
- import u from "slugify";
14
- import { isObject as m } from "../object/object.util.js";
15
- const h = u.default || u;
16
- function I(t, e) {
17
- const r = (n) => {
18
- var c, f;
19
- return h(n != null ? n : "", l({
20
- lower: (c = e == null ? void 0 : e.lower) != null ? c : !0,
21
- locale: (f = e == null ? void 0 : e.locale) != null ? f : "vi"
22
- }, e));
23
- };
24
- if (m(t)) {
25
- const n = {};
26
- for (const [c, f] of Object.entries(t))
27
- n[c] = r(f);
28
- return n;
2
+ import c from "slugify";
3
+ import { isObject as f } from "../object/object.util.js";
4
+ const l = c.default || c;
5
+ function g(e, r) {
6
+ const n = (t) => l(t ?? "", {
7
+ lower: r?.lower ?? !0,
8
+ locale: r?.locale ?? "vi",
9
+ ...r
10
+ });
11
+ if (f(e)) {
12
+ const t = {};
13
+ for (const [o, s] of Object.entries(e))
14
+ t[o] = n(s);
15
+ return t;
29
16
  }
30
- return r(t);
17
+ return n(e);
31
18
  }
32
- function S(t, e = 4) {
33
- return i.SHA256(t).toString(i.enc.Hex).slice(0, e);
19
+ function m(e, r = 4) {
20
+ return i.SHA256(e).toString(i.enc.Hex).slice(0, r);
34
21
  }
35
- function b(t = 8) {
36
- const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?";
37
- let r = "";
38
- for (let n = 0; n < t; n++) {
39
- const c = Math.floor(Math.random() * e.length);
40
- r += e.charAt(c);
22
+ function h(e = 8) {
23
+ const r = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+[]{}|;:,.<>?";
24
+ let n = "";
25
+ for (let t = 0; t < e; t++) {
26
+ const o = Math.floor(Math.random() * r.length);
27
+ n += r.charAt(o);
41
28
  }
42
- return r;
29
+ return n;
43
30
  }
44
- function j(t = "", e = !1) {
45
- const r = t.split(/[?#]/)[0] || "", n = r.substring(r.lastIndexOf("/") + 1);
46
- if (e)
47
- return n;
48
- const c = n.lastIndexOf(".");
49
- return c > 0 ? n.slice(0, c) : n;
31
+ function x(e = "", r = !1) {
32
+ const n = e.split(/[?#]/)[0] || "", t = n.substring(n.lastIndexOf("/") + 1);
33
+ if (r)
34
+ return t;
35
+ const o = t.lastIndexOf(".");
36
+ return o > 0 ? t.slice(0, o) : t;
50
37
  }
51
- function A(t, e, r) {
52
- const n = t.indexOf(e);
53
- if (n === -1)
38
+ function w(e, r, n) {
39
+ const t = e.indexOf(r);
40
+ if (t === -1)
54
41
  return "";
55
- const c = n + e.length, f = t.indexOf(r, c);
56
- return f === -1 ? "" : t.slice(c, f);
42
+ const o = t + r.length, s = e.indexOf(n, o);
43
+ return s === -1 ? "" : e.slice(o, s);
57
44
  }
58
45
  export {
59
- b as generateRandomPassword,
60
- S as generateShortId,
61
- I as generateSlug,
62
- j as getFileName,
63
- A as substringBetween
46
+ h as generateRandomPassword,
47
+ m as generateShortId,
48
+ g as generateSlug,
49
+ x as getFileName,
50
+ w as substringBetween
64
51
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- ._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_8fveh_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22:hover{color:#f87171}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36{font-size:1.75rem;font-weight:700;margin-bottom:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._main_8fveh_72{color:#fca5a5}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._network_8fveh_75{color:#fde68a}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._extra_8fveh_78{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 ul{padding-left:1rem;color:#fda4af;list-style:disc}
1
+ ._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{z-index:999999;background:linear-gradient(135deg,#ffffff59,#ffffffb3);-webkit-backdrop-filter:blur(20px) saturate(200%);backdrop-filter:blur(20px) saturate(200%);display:flex;justify-content:center;align-items:center;width:100%;height:100%;animation:_overlay-fade-in_b1d9o_1 .5s ease-out;border:1.5px solid rgba(255,255,255,.35);box-shadow:0 4px 32px #1f26872e,inset 0 1.5px 8px #ffffff40}._full_b1d9o_1,._block_b1d9o_2{pointer-events:none}._full_b1d9o_1{position:fixed;inset:0}._block_b1d9o_2{position:absolute;width:100%;height:100%;left:50%;top:50%;transform:translate(-50%,-50%);background:#ffffff1a;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}._container_b1d9o_40{display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative;padding:1rem;gap:1.5rem;text-align:center}._container_b1d9o_40 ._ring_b1d9o_50{width:clamp(60px,10vw,150px);height:clamp(60px,10vw,150px);border:2px solid transparent;border-radius:50%;position:absolute;transition:transform .3s ease}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(1){border-bottom:8px solid hsl(315,90%,60%);animation:_rotate1_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(2){border-bottom:8px solid hsl(345,90%,50%);animation:_rotate2_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(3){border-bottom:8px solid hsl(180,80%,40%);animation:_rotate3_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._ring_b1d9o_50:nth-child(4){border-bottom:8px solid hsl(40,100%,45%);animation:_rotate4_b1d9o_1 1s linear infinite}._container_b1d9o_40 ._message_b1d9o_74{font-weight:700;color:#2f2f37;text-shadow:0 1px 2px rgba(255,255,255,.8);animation:_text-fade_b1d9o_1 2s ease-in-out infinite alternate;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}@keyframes _rotate1_b1d9o_1{0%{transform:rotateX(50deg) rotate(110deg)}to{transform:rotateX(50deg) rotate(470deg)}}@keyframes _rotate2_b1d9o_1{0%{transform:rotateX(20deg) rotateY(50deg) rotate(20deg)}to{transform:rotateX(20deg) rotateY(50deg) rotate(380deg)}}@keyframes _rotate3_b1d9o_1{0%{transform:rotateX(40deg) rotateY(130deg) rotate(450deg)}to{transform:rotateX(40deg) rotateY(130deg) rotate(90deg)}}@keyframes _rotate4_b1d9o_1{0%{transform:rotateX(70deg) rotate(270deg)}to{transform:rotateX(70deg) rotate(630deg)}}@keyframes _text-fade_b1d9o_1{0%{opacity:.6}to{opacity:1}}@keyframes _overlay-fade-in_b1d9o_1{0%{opacity:0}to{opacity:1}}@media (prefers-reduced-motion: reduce){._ring_b1d9o_50,._message_b1d9o_74,._overlay_b1d9o_1,._full_b1d9o_1,._block_b1d9o_2{animation:none!important}}._modal-backdrop_8fveh_1{position:fixed;inset:0;z-index:9999999;background-color:#0009;display:flex;align-items:center;justify-content:center;padding:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11{position:relative;background-color:#0f172a;color:#fff;max-width:80vw;width:100%;border-radius:.75rem;box-shadow:0 10px 20px #00000080;overflow:hidden;padding:2rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22{position:absolute;top:.75rem;right:1rem;font-size:1.25rem;color:#fff;background:none;border:none;cursor:pointer;transition:color .2s}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._btn-close_8fveh_22:hover{color:#f87171}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36{font-size:1.75rem;font-weight:700;margin-bottom:1rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41{background:linear-gradient(to right,#3b82f6,#06b6d4);color:#fff;font-weight:600;padding:.5rem 1.5rem;border-radius:.75rem;transition:background .3s ease;border:none;cursor:pointer}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-title_8fveh_36 ._btn-retry_8fveh_41:hover{background:linear-gradient(to right,#2563eb,#0891b2)}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54{background-color:#1e293b;text-align:left;font-size:.875rem;border-radius:.5rem;padding:1rem;margin-bottom:1.5rem;max-height:50vh;overflow-y:auto;border:1px solid #334155;display:flex;flex-direction:column;gap:.5rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre{white-space:pre-wrap;word-break:break-word}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._main_8fveh_72{color:#fca5a5}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._network_8fveh_75{color:#fde68a}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 pre._extra_8fveh_78{color:#67e8f9;overflow-x:auto;white-space:pre;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background-color:#0f172a;padding:.5rem;border-radius:.375rem}._modal-backdrop_8fveh_1 ._modal-content_8fveh_11 ._error-details_8fveh_54 ul{padding-left:1rem;color:#fda4af;list-style:disc}