@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,116 +1,101 @@
1
- var C = Object.defineProperty;
2
- var y = Object.getOwnPropertySymbols;
3
- var T = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
4
- var g = (t, e, n) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, U = (t, e) => {
5
- for (var n in e || (e = {}))
6
- T.call(e, n) && g(t, n, e[n]);
7
- if (y)
8
- for (var n of y(e))
9
- G.call(e, n) && g(t, n, e[n]);
10
- return t;
11
- };
12
- var N = (t, e, n) => g(t, typeof e != "symbol" ? e + "" : e, n);
13
- import { ApolloError as R, ApolloClient as I, InMemoryCache as P } from "@apollo/client/core/core.cjs";
14
- import { ApolloLink as w, split as S, from as _ } from "@apollo/client/link/core/core.cjs";
15
- import { onError as F } from "@apollo/client/link/error/error.cjs";
16
- import { removeTypenameFromVariables as M } from "@apollo/client/link/remove-typename/remove-typename.cjs";
17
- import { GraphQLWsLink as O } from "@apollo/client/link/subscriptions/subscriptions.cjs";
18
- import { getMainDefinition as q } from "@apollo/client/utilities/utilities.cjs";
19
- import H from "apollo-upload-client/createUploadLink.mjs";
20
- import { createClient as J } from "graphql-ws";
21
- import k from "react";
22
- import { showGlobalApolloError as W } from "../apollo-error/apollo-error.util.js";
23
- import { log as s } from "../log/log.util.js";
24
- import { toast as x } from "react-hot-toast";
25
- import { GRAPHQL_URI_DEFAULT as D } from "./apollo-client.constant.js";
26
- class V extends w {
27
- constructor() {
28
- super(...arguments);
29
- N(this, "count", 0);
30
- }
31
- request(n, a) {
32
- const u = Date.now();
33
- return this.count += 1, a(n).map((p) => {
34
- const d = Date.now() - u, f = n.operationName || "Unnamed";
35
- return s.info(`[Apollo] #${this.count}: ${f} (${d}ms)`), p;
1
+ import { ApolloError as y, ApolloClient as U, InMemoryCache as N } from "@apollo/client/core/core.cjs";
2
+ import { ApolloLink as k, split as x, from as D } from "@apollo/client/link/core/core.cjs";
3
+ import { onError as v } from "@apollo/client/link/error/error.cjs";
4
+ import { removeTypenameFromVariables as C } from "@apollo/client/link/remove-typename/remove-typename.cjs";
5
+ import { GraphQLWsLink as T } from "@apollo/client/link/subscriptions/subscriptions.cjs";
6
+ import { getMainDefinition as G } from "@apollo/client/utilities/utilities.cjs";
7
+ import R from "apollo-upload-client/createUploadLink.mjs";
8
+ import { createClient as I } from "graphql-ws";
9
+ import L from "react";
10
+ import { showGlobalApolloError as P } from "../apollo-error/apollo-error.util.js";
11
+ import { GRAPHQL_URI_DEFAULT as $ } from "./apollo-client.constant.js";
12
+ import { log as r } from "../log/log.util.js";
13
+ import { toast as b } from "react-hot-toast";
14
+ class S extends k {
15
+ count = 0;
16
+ request(o, s) {
17
+ const m = Date.now();
18
+ return this.count += 1, s(o).map((c) => {
19
+ const f = Date.now() - m, p = o.operationName || "Unnamed";
20
+ return r.info(`[Apollo] #${this.count}: ${p} (${f}ms)`), c;
36
21
  });
37
22
  }
38
23
  }
39
- function j(t) {
40
- const { uri: e, wsUrl: n, customLinks: a } = t, u = new V(), p = F(({ graphQLErrors: o, networkError: i, protocolErrors: l, operation: r }) => {
41
- var A, h;
42
- const v = (r == null ? void 0 : r.operationName) || "Unknown";
43
- if (o && o.forEach(({ message: m, locations: c, path: L }) => {
44
- s.error(
45
- `[GraphQL error] ${v}: ${m}, Location: ${JSON.stringify(c, null, 4)}, Path: ${L}`
24
+ function _(i) {
25
+ const { uri: o, wsUrl: s, customLinks: m } = i, c = new S(), f = v(({ graphQLErrors: n, networkError: e, protocolErrors: a, operation: h }) => {
26
+ const A = h?.operationName || "Unknown";
27
+ if (n && n.forEach(({ message: t, locations: l, path: d }) => {
28
+ r.error(
29
+ `[GraphQL error] ${A}: ${t}, Location: ${JSON.stringify(l, null, 4)}, Path: ${d}`
46
30
  );
47
- }), l && l.forEach(({ message: m, extensions: c }) => {
48
- s.error(
49
- `[Protocol error]: ${m}, Extensions: ${JSON.stringify(c, null, 4)}`
31
+ }), a && a.forEach(({ message: t, extensions: l }) => {
32
+ r.error(
33
+ `[Protocol error]: ${t}, Extensions: ${JSON.stringify(l, null, 4)}`
50
34
  );
51
- }), i && s.error(`[Network error]: ${i}`), o || l || i) {
52
- const m = ((A = o == null ? void 0 : o[0]) == null ? void 0 : A.message) || ((h = l == null ? void 0 : l[0]) == null ? void 0 : h.message) || (i == null ? void 0 : i.message) || "Unexpected error", c = new R({
53
- graphQLErrors: o || [],
54
- protocolErrors: l || [],
35
+ }), e && r.error(`[Network error]: ${e}`), n || a || e) {
36
+ const t = n?.[0]?.message || a?.[0]?.message || e?.message || "Unexpected error", l = new y({
37
+ graphQLErrors: n || [],
38
+ protocolErrors: a || [],
55
39
  clientErrors: [],
56
- networkError: i || null,
57
- errorMessage: m,
40
+ networkError: e || null,
41
+ errorMessage: t,
58
42
  extraInfo: {
59
- operation: r
43
+ operation: h
60
44
  }
61
45
  });
62
- typeof window != "undefined" && x.error((L) => /* @__PURE__ */ k.createElement(k.Fragment, null, m, " ", /* @__PURE__ */ k.createElement(
46
+ typeof window < "u" && b.error((d) => /* @__PURE__ */ L.createElement(L.Fragment, null, t, " ", /* @__PURE__ */ L.createElement(
63
47
  "button",
64
48
  {
65
49
  type: "button",
66
50
  className: "text-blue-500 hover:text-blue-700",
67
51
  onClick: () => {
68
52
  setTimeout(() => {
69
- W(c);
70
- }, 0), x.dismiss(L.id);
53
+ P(l);
54
+ }, 0), b.dismiss(d.id);
71
55
  }
72
56
  },
73
57
  "Show Details"
74
58
  )));
75
59
  }
76
- }), d = M();
77
- e || s.warn(`[Apollo] No GraphQL URI provided — using "${D}" as default`);
78
- const f = H({
79
- uri: e != null ? e : D,
60
+ }), p = C();
61
+ o || r.warn(`[Apollo] No GraphQL URI provided — using "${$}" as default`);
62
+ const u = R({
63
+ uri: o ?? $,
80
64
  credentials: "include",
81
65
  headers: {
82
66
  "apollo-require-preflight": "true"
83
67
  }
84
- }), $ = n ? new O(J({ url: n })) : w.empty(), b = $ instanceof w ? S(
85
- ({ query: o }) => {
86
- const i = q(o);
87
- return i.kind === "OperationDefinition" && i.operation === "subscription";
68
+ }), g = s ? new T(I({ url: s })) : k.empty(), w = g instanceof k ? x(
69
+ ({ query: n }) => {
70
+ const e = G(n);
71
+ return e.kind === "OperationDefinition" && e.operation === "subscription";
88
72
  },
89
- $,
90
- f
91
- ) : f;
92
- return b === f && n && s.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
93
- u,
73
+ g,
74
+ u
75
+ ) : u;
76
+ return w === u && s && r.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."), [
77
+ c,
94
78
  // 🪵 custom logger
95
- p,
79
+ f,
96
80
  // ⚠️ Apollo's error handling
97
- d,
81
+ p,
98
82
  // 🧼 cleans up __typename
99
- ...a != null ? a : [],
83
+ ...m ?? [],
100
84
  // 🔗 custom links
101
- b
85
+ w
102
86
  // 📡 HTTP vs WS routing (includes uploadLink)
103
87
  ];
104
88
  }
105
- function me(t = {}) {
106
- const e = _(j(t));
107
- return new I(U({
108
- link: e,
109
- cache: new P()
110
- }, t));
89
+ function K(i = {}) {
90
+ const o = D(_(i));
91
+ return new U({
92
+ link: o,
93
+ cache: new N(),
94
+ ...i
95
+ });
111
96
  }
112
97
  export {
113
- V as DevLoggerLink,
114
- j as createApolloLinks,
115
- me as getClient
98
+ S as DevLoggerLink,
99
+ _ as createApolloLinks,
100
+ K as getClient
116
101
  };
@@ -1,30 +1,29 @@
1
- import { ApolloProvider as u } from "./apollo-client.component.js";
1
+ import { ApolloProvider as o } from "./apollo-client.component.js";
2
2
  import { GRAPHQL_URI_DEFAULT as s } from "./apollo-client.constant.js";
3
- import { ApolloClientContext as n, ApolloClientProvider as p } from "./apollo-client.context.js";
4
- import "react";
5
- import { DevLoggerLink as i, createApolloLinks as m, getClient as y } from "./apollo-client.util.js";
6
- import { makeVar as f } from "@apollo/client/cache/cache.cjs";
7
- import { useApolloClient as A, useBackgroundQuery as L, useFragment as d, useLazyQuery as g, useLoadableQuery as C, useMutation as R, useQuery as c, useQueryRefHandlers as k, useReactiveVar as v, useReadQuery as F, useSubscription as P, useSuspenseFragment as S, useSuspenseQuery as b } from "@apollo/client/react/hooks/hooks.cjs";
3
+ import { ApolloClientContext as l, ApolloClientProvider as n } from "./apollo-client.context.js";
4
+ import { DevLoggerLink as p, createApolloLinks as i, getClient as m } from "./apollo-client.util.js";
5
+ import { makeVar as Q } from "@apollo/client/cache/cache.cjs";
6
+ import { useApolloClient as x, useBackgroundQuery as A, useFragment as L, useLazyQuery as d, useLoadableQuery as g, useMutation as C, useQuery as R, useQueryRefHandlers as c, useReactiveVar as k, useReadQuery as v, useSubscription as F, useSuspenseFragment as P, useSuspenseQuery as S } from "@apollo/client/react/hooks/hooks.cjs";
8
7
  export {
9
- n as ApolloClientContext,
10
- p as ApolloClientProvider,
11
- u as ApolloProvider,
12
- i as DevLoggerLink,
8
+ l as ApolloClientContext,
9
+ n as ApolloClientProvider,
10
+ o as ApolloProvider,
11
+ p as DevLoggerLink,
13
12
  s as GRAPHQL_URI_DEFAULT,
14
- m as createApolloLinks,
15
- y as getClient,
16
- f as makeVar,
17
- A as useApolloClient,
18
- L as useBackgroundQuery,
19
- d as useFragment,
20
- g as useLazyQuery,
21
- C as useLoadableQuery,
22
- R as useMutation,
23
- c as useQuery,
24
- k as useQueryRefHandlers,
25
- v as useReactiveVar,
26
- F as useReadQuery,
27
- P as useSubscription,
28
- S as useSuspenseFragment,
29
- b as useSuspenseQuery
13
+ i as createApolloLinks,
14
+ m as getClient,
15
+ Q as makeVar,
16
+ x as useApolloClient,
17
+ A as useBackgroundQuery,
18
+ L as useFragment,
19
+ d as useLazyQuery,
20
+ g as useLoadableQuery,
21
+ C as useMutation,
22
+ R as useQuery,
23
+ c as useQueryRefHandlers,
24
+ k as useReactiveVar,
25
+ v as useReadQuery,
26
+ F as useSubscription,
27
+ P as useSuspenseFragment,
28
+ S as useSuspenseQuery
30
29
  };
@@ -1,20 +1,19 @@
1
1
  import { ApolloNextAppProvider as l } from "@apollo/client-integration-nextjs";
2
2
  import e, { useMemo as m } from "react";
3
- import { ApolloErrorComponent as n } from "../apollo-error/apollo-error.component.js";
4
- import "../apollo-error/apollo-error.context.js";
3
+ import { getClient as n } from "./apollo-client-nextjs.util.js";
5
4
  import { ApolloErrorProvider as p } from "../apollo-error/apollo-error.provider.js";
6
- import { Toaster as i } from "react-hot-toast";
7
- import { getClient as a } from "./apollo-client-nextjs.util.js";
8
- function s({
5
+ import { ApolloErrorComponent as i } from "../apollo-error/apollo-error.component.js";
6
+ import { Toaster as a } from "react-hot-toast";
7
+ function g({
9
8
  options: r,
10
9
  children: o
11
10
  }) {
12
11
  const t = m(
13
- () => () => a(r || {}),
12
+ () => () => n(r || {}),
14
13
  [r]
15
14
  );
16
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(l, { makeClient: t }, o), /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(i, { position: "top-right" }));
15
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(p, null, /* @__PURE__ */ e.createElement(l, { makeClient: t }, o), /* @__PURE__ */ e.createElement(i, null)), /* @__PURE__ */ e.createElement(a, { position: "top-right" }));
17
16
  }
18
17
  export {
19
- s as ApolloProvider
18
+ g as ApolloProvider
20
19
  };
@@ -1,24 +1,14 @@
1
- var i = Object.defineProperty;
2
- var n = Object.getOwnPropertySymbols;
3
- var l = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
4
- var t = (e, o, r) => o in e ? i(e, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[o] = r, m = (e, o) => {
5
- for (var r in o || (o = {}))
6
- l.call(o, r) && t(e, r, o[r]);
7
- if (n)
8
- for (var r of n(o))
9
- c.call(o, r) && t(e, r, o[r]);
10
- return e;
11
- };
12
- import { ApolloClient as f, InMemoryCache as p } from "@apollo/client-integration-nextjs";
13
- import { from as a } from "@apollo/client/link/core/core.cjs";
14
- import { createApolloLinks as C } from "../apollo-client/apollo-client.util.js";
15
- function A(e = {}) {
16
- const o = a(C(e));
17
- return new f(m({
18
- link: o,
19
- cache: new p()
20
- }, e));
1
+ import { ApolloClient as r, InMemoryCache as n } from "@apollo/client-integration-nextjs";
2
+ import { from as t } from "@apollo/client/link/core/core.cjs";
3
+ import { createApolloLinks as m } from "../apollo-client/apollo-client.util.js";
4
+ function f(o = {}) {
5
+ const e = t(m(o));
6
+ return new r({
7
+ link: e,
8
+ cache: new n(),
9
+ ...o
10
+ });
21
11
  }
22
12
  export {
23
- A as getClient
13
+ f as getClient
24
14
  };
@@ -1,4 +1,4 @@
1
- import e, { use as s } from "react";
1
+ import e, { use as c } from "react";
2
2
  import { ApolloErrorContext as m } from "./apollo-error.context.js";
3
3
  const t = {
4
4
  "modal-backdrop": "_modal-backdrop_8fveh_1",
@@ -8,17 +8,17 @@ const t = {
8
8
  "btn-retry": "_btn-retry_8fveh_41",
9
9
  "error-details": "_error-details_8fveh_54"
10
10
  };
11
- function i() {
12
- const o = s(m), r = o == null ? void 0 : o.error;
11
+ function d() {
12
+ const l = c(m), r = l?.error;
13
13
  if (!r)
14
14
  return null;
15
- const n = (c, l) => l != null && l.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, c, ":"), /* @__PURE__ */ e.createElement("ul", null, l.map((a) => /* @__PURE__ */ e.createElement("li", { key: a.message }, a.message)))) : null;
15
+ const o = (s, n) => n?.length ? /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", null, s, ":"), /* @__PURE__ */ e.createElement("ul", null, n.map((a) => /* @__PURE__ */ e.createElement("li", { key: a.message }, a.message)))) : null;
16
16
  return /* @__PURE__ */ e.createElement("div", { className: t["modal-backdrop"] }, /* @__PURE__ */ e.createElement("div", { className: t["modal-content"] }, /* @__PURE__ */ e.createElement(
17
17
  "button",
18
18
  {
19
19
  type: "button",
20
20
  className: t["btn-close"],
21
- onClick: o.hideError
21
+ onClick: l.hideError
22
22
  },
23
23
  "✕"
24
24
  ), /* @__PURE__ */ e.createElement("div", { className: t["error-title"] }, /* @__PURE__ */ e.createElement(
@@ -29,8 +29,8 @@ function i() {
29
29
  onClick: () => window.location.reload()
30
30
  },
31
31
  "Reload"
32
- ), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message), n("GraphQL Errors", [...r.graphQLErrors]), n("Protocol Errors", [...r.protocolErrors]), n("Client Errors", [...r.clientErrors]), r.extraInfo && /* @__PURE__ */ e.createElement("pre", { className: "extra" }, /* @__PURE__ */ e.createElement("strong", null, "Extra Info:"), " ", JSON.stringify(r.extraInfo, null, 4)))));
32
+ ), " ", r.message), /* @__PURE__ */ e.createElement("div", { className: t["error-details"] }, r.networkError && /* @__PURE__ */ e.createElement("pre", { className: "network" }, /* @__PURE__ */ e.createElement("strong", null, "Network Error:"), " ", r.networkError.message), o("GraphQL Errors", [...r.graphQLErrors]), o("Protocol Errors", [...r.protocolErrors]), o("Client Errors", [...r.clientErrors]), r.extraInfo && /* @__PURE__ */ e.createElement("pre", { className: "extra" }, /* @__PURE__ */ e.createElement("strong", null, "Extra Info:"), " ", JSON.stringify(r.extraInfo, null, 4)))));
33
33
  }
34
34
  export {
35
- i as ApolloErrorComponent
35
+ d as ApolloErrorComponent
36
36
  };
@@ -1,11 +1,11 @@
1
- let l = null;
2
- function n(o) {
3
- l = o;
1
+ let o = null;
2
+ function r(l) {
3
+ o = l;
4
4
  }
5
- function t(o) {
6
- l == null || l(o);
5
+ function a(l) {
6
+ o?.(l);
7
7
  }
8
8
  export {
9
- n as setGlobalApolloErrorCallback,
10
- t as showGlobalApolloError
9
+ r as setGlobalApolloErrorCallback,
10
+ a as showGlobalApolloError
11
11
  };
@@ -1,61 +1,40 @@
1
- var b = Object.defineProperty;
2
- var r = Object.getOwnPropertySymbols;
3
- var m = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
4
- var d = (e, t, n) => t in e ? b(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, _ = (e, t) => {
5
- for (var n in t || (t = {}))
6
- m.call(t, n) && d(e, n, t[n]);
7
- if (r)
8
- for (var n of r(t))
9
- u.call(t, n) && d(e, n, t[n]);
10
- return e;
1
+ import s from "clsx";
2
+ import e, { useEffect as a } from "react";
3
+ const m = "_full_b1d9o_1", u = "_block_b1d9o_2", _ = "_container_b1d9o_40", f = "_ring_b1d9o_50", g = "_message_b1d9o_74", n = {
4
+ full: m,
5
+ block: u,
6
+ container: _,
7
+ ring: f,
8
+ message: g
11
9
  };
12
- var f = (e, t) => {
13
- var n = {};
14
- for (var o in e)
15
- m.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
16
- if (e != null && r)
17
- for (var o of r(e))
18
- t.indexOf(o) < 0 && u.call(e, o) && (n[o] = e[o]);
19
- return n;
20
- };
21
- import g from "clsx";
22
- import c, { useEffect as v } from "react";
23
- const y = "_full_b1d9o_1", p = "_block_b1d9o_2", L = "_container_b1d9o_40", N = "_ring_b1d9o_50", h = "_message_b1d9o_74", l = {
24
- full: y,
25
- block: p,
26
- container: L,
27
- ring: N,
28
- message: h
29
- };
30
- function x() {
10
+ function v() {
31
11
  if (document.getElementById("noscroll-style"))
32
12
  return;
33
- const e = document.createElement("style");
34
- e.id = "noscroll-style", e.innerHTML = `
13
+ const t = document.createElement("style");
14
+ t.id = "noscroll-style", t.innerHTML = `
35
15
  .noscroll {
36
16
  overflow: hidden !important;
37
17
  height: 100vh !important;
38
18
  }
39
- `, document.head.appendChild(e);
19
+ `, document.head.appendChild(t);
40
20
  }
41
- function j(k) {
42
- var s = k, { full: e = !1, className: t = "", message: n = "Loading" } = s, o = f(s, ["full", "className", "message"]);
43
- v(() => {
44
- if (e) {
21
+ function y({ full: t = !1, className: o = "", message: c = "Loading", ...i }) {
22
+ a(() => {
23
+ if (t) {
45
24
  document.body.classList.add("noscroll");
46
- const i = (E) => E.preventDefault();
47
- return document.addEventListener("contextmenu", i), () => {
48
- document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu", i);
25
+ const r = (d) => d.preventDefault();
26
+ return document.addEventListener("contextmenu", r), () => {
27
+ document.body.classList.remove("noscroll"), document.removeEventListener("contextmenu", r);
49
28
  };
50
29
  }
51
- }, [e]), v(() => {
52
- x();
30
+ }, [t]), a(() => {
31
+ v();
53
32
  }, []);
54
- function a() {
55
- return /* @__PURE__ */ c.createElement("div", _({ className: l.container }, o), /* @__PURE__ */ c.createElement("div", { className: l.ring }), /* @__PURE__ */ c.createElement("div", { className: l.ring }), /* @__PURE__ */ c.createElement("div", { className: l.ring }), /* @__PURE__ */ c.createElement("div", { className: l.ring }), n && /* @__PURE__ */ c.createElement("div", { className: l.message }, n));
33
+ function l() {
34
+ return /* @__PURE__ */ e.createElement("div", { className: n.container, ...i }, /* @__PURE__ */ e.createElement("div", { className: n.ring }), /* @__PURE__ */ e.createElement("div", { className: n.ring }), /* @__PURE__ */ e.createElement("div", { className: n.ring }), /* @__PURE__ */ e.createElement("div", { className: n.ring }), c && /* @__PURE__ */ e.createElement("div", { className: n.message }, c));
56
35
  }
57
- return e ? /* @__PURE__ */ c.createElement("div", { className: g(l.full, t) }, a()) : /* @__PURE__ */ c.createElement("div", { className: g(l.block, t) }, a());
36
+ return t ? /* @__PURE__ */ e.createElement("div", { className: s(n.full, o) }, l()) : /* @__PURE__ */ e.createElement("div", { className: s(n.block, o) }, l());
58
37
  }
59
38
  export {
60
- j as Loading
39
+ y as Loading
61
40
  };
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
- import { I_Children } from '../../typescript/react.js';
2
+ import { I_Children } from '../../typescript/index.js';
3
3
  export declare function LoadingProvider({ children }: I_Children): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { consola as e } from "consola/browser";
2
- import { RESPONSE_STATUS as l } from "../../constant/response-status.js";
3
- const n = {
2
+ import { RESPONSE_STATUS as c } from "../../constant/response-status.js";
3
+ const l = {
4
4
  silent: e.silent,
5
5
  level: e.level,
6
6
  fatal: e.fatal,
@@ -16,15 +16,15 @@ const n = {
16
16
  trace: e.trace,
17
17
  verbose: e.verbose
18
18
  };
19
- function u(r, o) {
20
- const { shouldLog: t = !0, returnValue: c, callback: s } = o != null ? o : {}, a = r instanceof Error ? r : new Error(typeof r == "string" ? r : "Unknown error");
21
- return t && n.error(a.message), s && typeof s == "function" && s(a), c || {
19
+ function g(r, a) {
20
+ const { shouldLog: n = !0, returnValue: t, callback: o } = a ?? {}, s = r instanceof Error ? r : new Error(typeof r == "string" ? r : "Unknown error");
21
+ return n && l.error(s.message), o && typeof o == "function" && o(s), t || {
22
22
  success: !1,
23
- message: a.message,
24
- code: l.INTERNAL_SERVER_ERROR.CODE
23
+ message: s.message,
24
+ code: c.INTERNAL_SERVER_ERROR.CODE
25
25
  };
26
26
  }
27
27
  export {
28
- u as catchError,
29
- n as log
28
+ g as catchError,
29
+ l as log
30
30
  };
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, default as React } from 'react';
2
- import { I_Children } from '../../typescript/react.js';
2
+ import { I_Children } from '../../typescript/index.js';
3
3
  import { I_NextIntlLanguage, T_NextIntlMessageList } from './next-intl.type.js';
4
4
  export declare function withNextIntl<T extends I_Children>(Component: ComponentType<T>): {
5
5
  (props: T & {
@@ -1,35 +1,23 @@
1
- var x = Object.defineProperty;
2
- var a = Object.getOwnPropertySymbols;
3
- var E = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
4
- var f = (s, e, t) => e in s ? x(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, N = (s, e) => {
5
- for (var t in e || (e = {}))
6
- E.call(e, t) && f(s, t, e[t]);
7
- if (a)
8
- for (var t of a(e))
9
- _.call(e, t) && f(s, t, e[t]);
10
- return s;
11
- };
12
- import { NextIntlClientProvider as c } from "next-intl";
13
- import r from "react";
14
- import { log as h } from "../log/log.util.js";
15
- import { NEXT_INTL_DEFAULT_LANGUAGE as u } from "./next-intl.constant.js";
16
- import { useNextIntl as w } from "./next-intl.hook.js";
17
- function P(s) {
18
- const e = (t) => {
19
- var m, n;
20
- const { currentLanguage: l } = w(), { messages: i, languages: d } = t, o = "en", v = i[(l == null ? void 0 : l.value) || o], I = (n = (m = d.find((p) => p.value === (l == null ? void 0 : l.value))) == null ? void 0 : m.timezone) != null ? n : u.timezone;
21
- return i ? /* @__PURE__ */ r.createElement(
22
- c,
1
+ import { NextIntlClientProvider as g } from "next-intl";
2
+ import s from "react";
3
+ import { NEXT_INTL_DEFAULT_LANGUAGE as c } from "./next-intl.constant.js";
4
+ import { useNextIntl as f } from "./next-intl.hook.js";
5
+ import { log as N } from "../log/log.util.js";
6
+ function E(t) {
7
+ const a = (l) => {
8
+ const { currentLanguage: e } = f(), { messages: r, languages: o } = l, n = "en", i = r[e?.value || n], m = o.find((u) => u.value === e?.value)?.timezone ?? c.timezone;
9
+ return r ? /* @__PURE__ */ s.createElement(
10
+ g,
23
11
  {
24
- locale: (l == null ? void 0 : l.value) || o,
25
- messages: v || null,
26
- timeZone: I
12
+ locale: e?.value || n,
13
+ messages: i || null,
14
+ timeZone: m
27
15
  },
28
- /* @__PURE__ */ r.createElement(s, N({}, t))
29
- ) : (h.warn(`Missing messages for language: ${(l == null ? void 0 : l.value) || o}`), null);
16
+ /* @__PURE__ */ s.createElement(t, { ...l })
17
+ ) : (N.warn(`Missing messages for language: ${e?.value || n}`), null);
30
18
  };
31
- return e.displayName = `withNextIntl(${s.displayName || s.name || "Component"})`, e;
19
+ return a.displayName = `withNextIntl(${t.displayName || t.name || "Component"})`, a;
32
20
  }
33
21
  export {
34
- P as withNextIntl
22
+ E as withNextIntl
35
23
  };
@@ -1,25 +1,24 @@
1
- import r, { useMemo as p } from "react";
2
- import { useStorage as u } from "../storage/storage.hook.js";
3
- import "localforage";
4
- import "../log/log.util.js";
5
- import { NEXT_INTL_DEFAULT_LANGUAGE as c } from "./next-intl.constant.js";
6
- import { NextIntlContext as i } from "./next-intl.context.js";
7
- import { withNextIntl as f } from "./next-intl.hoc.js";
8
- function l({ children: n }) {
9
- return /* @__PURE__ */ r.createElement(r.Fragment, null, n);
1
+ import { NEXT_INTL_DEFAULT_LANGUAGE as u } from "./next-intl.constant.js";
2
+ import { NextIntlContext as c } from "./next-intl.context.js";
3
+ import { withNextIntl as p } from "./next-intl.hoc.js";
4
+ import "./next-intl.hook.js";
5
+ import t, { useMemo as i } from "react";
6
+ import { useStorage as l } from "../storage/storage.hook.js";
7
+ function f({ children: r }) {
8
+ return /* @__PURE__ */ t.createElement(t.Fragment, null, r);
10
9
  }
11
- const L = f(l);
12
- function A({
13
- children: n,
14
- languages: t,
15
- messages: m
10
+ const L = p(f);
11
+ function I({
12
+ children: r,
13
+ languages: e,
14
+ messages: a
16
15
  }) {
17
- const { value: e, set: o } = u("lang", t[0]), a = p(
18
- () => ({ languages: t, currentLanguage: e != null ? e : c, setCurrentLanguage: o }),
19
- [t, o, e]
16
+ const { value: n, set: o } = l("lang", e[0]), m = i(
17
+ () => ({ languages: e, currentLanguage: n ?? u, setCurrentLanguage: o }),
18
+ [e, o, n]
20
19
  );
21
- return /* @__PURE__ */ r.createElement(i, { value: a }, /* @__PURE__ */ r.createElement(L, { languages: t, messages: m }, n));
20
+ return /* @__PURE__ */ t.createElement(c, { value: m }, /* @__PURE__ */ t.createElement(L, { languages: e, messages: a }, r));
22
21
  }
23
22
  export {
24
- A as NextIntlProvider
23
+ I as NextIntlProvider
25
24
  };
@@ -1,6 +1,6 @@
1
1
  import { Locale } from 'date-fns';
2
2
  import { AbstractIntlMessages, Timezone } from 'next-intl';
3
- import { I_Children } from '../../typescript/react.js';
3
+ import { I_Children } from '../../typescript/index.js';
4
4
  export interface I_NextIntlLanguage {
5
5
  label: string;
6
6
  value: string;