@cyberskill/shared 1.50.0 → 1.52.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 (147) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +100 -129
  2. package/dist/_tsup-dts-rollup.d.ts +100 -129
  3. package/dist/cli.cjs +1 -2146
  4. package/dist/cli.d.cts +1 -2
  5. package/dist/cli.d.ts +1 -2
  6. package/dist/cli.js +1 -2066
  7. package/dist/configs/commitlint/base.cjs +1 -64
  8. package/dist/configs/commitlint/base.js +1 -7
  9. package/dist/configs/eslint/base.cjs +1 -121
  10. package/dist/configs/eslint/base.js +1 -52
  11. package/dist/configs/eslint/nestjs.cjs +1 -155
  12. package/dist/configs/eslint/nestjs.js +1 -85
  13. package/dist/configs/eslint/nextjs.cjs +1 -155
  14. package/dist/configs/eslint/nextjs.js +1 -85
  15. package/dist/configs/eslint/nodejs.cjs +1 -156
  16. package/dist/configs/eslint/nodejs.js +1 -86
  17. package/dist/configs/eslint/vite-react.cjs +1 -159
  18. package/dist/configs/eslint/vite-react.js +1 -89
  19. package/dist/configs/graphql/graphql-codegen.cjs +1 -125
  20. package/dist/configs/graphql/graphql-codegen.js +1 -64
  21. package/dist/configs/graphql/index.cjs +1 -126
  22. package/dist/configs/graphql/index.js +1 -64
  23. package/dist/configs/i18n/react/i18next.cjs +1 -80
  24. package/dist/configs/i18n/react/i18next.js +1 -7
  25. package/dist/configs/i18n/react/index.cjs +1 -81
  26. package/dist/configs/i18n/react/index.js +1 -7
  27. package/dist/configs/index.cjs +1 -232
  28. package/dist/configs/index.js +1 -166
  29. package/dist/configs/lint-staged/base.cjs +1 -64
  30. package/dist/configs/lint-staged/base.js +1 -7
  31. package/dist/configs/vitest/react/e2e.cjs +1 -128
  32. package/dist/configs/vitest/react/e2e.js +1 -59
  33. package/dist/configs/vitest/react/unit.cjs +1 -305
  34. package/dist/configs/vitest/react/unit.js +1 -228
  35. package/dist/configs/vitest/react/unit.setup.cjs +1 -60
  36. package/dist/configs/vitest/react/unit.setup.js +1 -8
  37. package/dist/constants/index.cjs +1 -677
  38. package/dist/constants/index.d.cts +8 -3
  39. package/dist/constants/index.d.ts +8 -3
  40. package/dist/constants/index.js +1 -468
  41. package/dist/constants/path.cjs +1 -422
  42. package/dist/constants/path.d.cts +8 -3
  43. package/dist/constants/path.d.ts +8 -3
  44. package/dist/constants/path.js +1 -217
  45. package/dist/constants/response-status.cjs +1 -313
  46. package/dist/constants/response-status.js +1 -252
  47. package/dist/index.cjs +1 -4559
  48. package/dist/index.d.cts +13 -8
  49. package/dist/index.d.ts +13 -8
  50. package/dist/index.js +1 -4142
  51. package/dist/nodejs/index.cjs +1 -2138
  52. package/dist/nodejs/index.js +1 -2054
  53. package/dist/nodejs/mongo.cjs +1 -2137
  54. package/dist/nodejs/mongo.js +1 -2054
  55. package/dist/react/apollo-client.cjs +1 -177
  56. package/dist/react/apollo-client.js +1 -116
  57. package/dist/react/index.cjs +1 -990
  58. package/dist/react/index.js +1 -876
  59. package/dist/react/loading.cjs +1 -301
  60. package/dist/react/loading.js +1 -216
  61. package/dist/react/next-intl.cjs +1 -744
  62. package/dist/react/next-intl.js +1 -655
  63. package/dist/react/storage.cjs +1 -631
  64. package/dist/react/storage.js +1 -558
  65. package/dist/typescript/api-response.cjs +1 -48
  66. package/dist/typescript/apollo.cjs +1 -48
  67. package/dist/typescript/command.cjs +1 -68
  68. package/dist/typescript/command.d.cts +3 -0
  69. package/dist/typescript/command.d.ts +3 -0
  70. package/dist/typescript/command.js +1 -7
  71. package/dist/typescript/config.cjs +1 -48
  72. package/dist/typescript/fs.cjs +1 -48
  73. package/dist/typescript/graphql-codegen.cjs +1 -48
  74. package/dist/typescript/index.cjs +1 -175
  75. package/dist/typescript/index.d.cts +3 -0
  76. package/dist/typescript/index.d.ts +3 -0
  77. package/dist/typescript/index.js +1 -151
  78. package/dist/typescript/loading.cjs +1 -48
  79. package/dist/typescript/log.cjs +1 -48
  80. package/dist/typescript/mongo.cjs +1 -164
  81. package/dist/typescript/mongo.js +1 -145
  82. package/dist/typescript/next-intl.cjs +1 -48
  83. package/dist/typescript/react.cjs +1 -48
  84. package/dist/typescript/serializer.cjs +1 -48
  85. package/dist/typescript/string.cjs +1 -48
  86. package/dist/utils/command.cjs +1 -1387
  87. package/dist/utils/command.d.cts +2 -2
  88. package/dist/utils/command.d.ts +2 -2
  89. package/dist/utils/command.js +1 -1287
  90. package/dist/utils/common.cjs +1 -300
  91. package/dist/utils/common.js +1 -219
  92. package/dist/utils/config.cjs +1 -146
  93. package/dist/utils/config.js +1 -89
  94. package/dist/utils/fs.cjs +1 -132
  95. package/dist/utils/fs.js +1 -47
  96. package/dist/utils/index-nodejs.cjs +1 -1752
  97. package/dist/utils/index-nodejs.d.cts +2 -5
  98. package/dist/utils/index-nodejs.d.ts +2 -5
  99. package/dist/utils/index-nodejs.js +1 -1581
  100. package/dist/utils/index.cjs +1 -727
  101. package/dist/utils/index.js +1 -625
  102. package/dist/utils/log.cjs +1 -330
  103. package/dist/utils/log.js +1 -269
  104. package/dist/utils/package.cjs +1 -941
  105. package/dist/utils/package.js +1 -857
  106. package/dist/utils/path.cjs +1 -291
  107. package/dist/utils/path.d.cts +0 -3
  108. package/dist/utils/path.d.ts +0 -3
  109. package/dist/utils/path.js +1 -191
  110. package/dist/utils/serializer.cjs +1 -91
  111. package/dist/utils/serializer.js +1 -30
  112. package/dist/utils/storage-client.cjs +1 -349
  113. package/dist/utils/storage-client.js +1 -276
  114. package/dist/utils/storage-server.cjs +1 -636
  115. package/dist/utils/storage-server.js +1 -550
  116. package/dist/utils/string.cjs +1 -152
  117. package/dist/utils/string.js +1 -75
  118. package/dist/utils/validate.cjs +1 -90
  119. package/dist/utils/validate.js +1 -33
  120. package/package.json +15 -13
  121. /package/{src/public → public}/favicon/android-icon-144x144.png +0 -0
  122. /package/{src/public → public}/favicon/android-icon-192x192.png +0 -0
  123. /package/{src/public → public}/favicon/android-icon-36x36.png +0 -0
  124. /package/{src/public → public}/favicon/android-icon-48x48.png +0 -0
  125. /package/{src/public → public}/favicon/android-icon-72x72.png +0 -0
  126. /package/{src/public → public}/favicon/android-icon-96x96.png +0 -0
  127. /package/{src/public → public}/favicon/apple-icon-114x114.png +0 -0
  128. /package/{src/public → public}/favicon/apple-icon-120x120.png +0 -0
  129. /package/{src/public → public}/favicon/apple-icon-144x144.png +0 -0
  130. /package/{src/public → public}/favicon/apple-icon-152x152.png +0 -0
  131. /package/{src/public → public}/favicon/apple-icon-180x180.png +0 -0
  132. /package/{src/public → public}/favicon/apple-icon-57x57.png +0 -0
  133. /package/{src/public → public}/favicon/apple-icon-60x60.png +0 -0
  134. /package/{src/public → public}/favicon/apple-icon-72x72.png +0 -0
  135. /package/{src/public → public}/favicon/apple-icon-76x76.png +0 -0
  136. /package/{src/public → public}/favicon/apple-icon-precomposed.png +0 -0
  137. /package/{src/public → public}/favicon/apple-icon.png +0 -0
  138. /package/{src/public → public}/favicon/browserconfig.xml +0 -0
  139. /package/{src/public → public}/favicon/favicon-16x16.png +0 -0
  140. /package/{src/public → public}/favicon/favicon-32x32.png +0 -0
  141. /package/{src/public → public}/favicon/favicon-96x96.png +0 -0
  142. /package/{src/public → public}/favicon/favicon.ico +0 -0
  143. /package/{src/public → public}/favicon/manifest.json +0 -0
  144. /package/{src/public → public}/favicon/ms-icon-144x144.png +0 -0
  145. /package/{src/public → public}/favicon/ms-icon-150x150.png +0 -0
  146. /package/{src/public → public}/favicon/ms-icon-310x310.png +0 -0
  147. /package/{src/public → public}/favicon/ms-icon-70x70.png +0 -0
@@ -1,558 +1 @@
1
- // src/react/storage.tsx
2
- function _array_like_to_array(arr, len) {
3
- if (len == null || len > arr.length) len = arr.length;
4
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5
- return arr2;
6
- }
7
- function _array_with_holes(arr) {
8
- if (Array.isArray(arr)) return arr;
9
- }
10
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
11
- try {
12
- var info = gen[key](arg);
13
- var value = info.value;
14
- } catch (error) {
15
- reject(error);
16
- return;
17
- }
18
- if (info.done) {
19
- resolve(value);
20
- } else {
21
- Promise.resolve(value).then(_next, _throw);
22
- }
23
- }
24
- function _async_to_generator(fn) {
25
- return function() {
26
- var self = this, args = arguments;
27
- return new Promise(function(resolve, reject) {
28
- var gen = fn.apply(self, args);
29
- function _next(value) {
30
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
31
- }
32
- function _throw(err) {
33
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
34
- }
35
- _next(undefined);
36
- });
37
- };
38
- }
39
- function _instanceof(left, right) {
40
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
41
- return !!right[Symbol.hasInstance](left);
42
- } else {
43
- return left instanceof right;
44
- }
45
- }
46
- function _iterable_to_array_limit(arr, i) {
47
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
48
- if (_i == null) return;
49
- var _arr = [];
50
- var _n = true;
51
- var _d = false;
52
- var _s, _e;
53
- try {
54
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
55
- _arr.push(_s.value);
56
- if (i && _arr.length === i) break;
57
- }
58
- } catch (err) {
59
- _d = true;
60
- _e = err;
61
- } finally{
62
- try {
63
- if (!_n && _i["return"] != null) _i["return"]();
64
- } finally{
65
- if (_d) throw _e;
66
- }
67
- }
68
- return _arr;
69
- }
70
- function _non_iterable_rest() {
71
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
72
- }
73
- function _sliced_to_array(arr, i) {
74
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
75
- }
76
- function _unsupported_iterable_to_array(o, minLen) {
77
- if (!o) return;
78
- if (typeof o === "string") return _array_like_to_array(o, minLen);
79
- var n = Object.prototype.toString.call(o).slice(8, -1);
80
- if (n === "Object" && o.constructor) n = o.constructor.name;
81
- if (n === "Map" || n === "Set") return Array.from(n);
82
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
83
- }
84
- function _ts_generator(thisArg, body) {
85
- var f, y, t, g, _ = {
86
- label: 0,
87
- sent: function() {
88
- if (t[0] & 1) throw t[1];
89
- return t[1];
90
- },
91
- trys: [],
92
- ops: []
93
- };
94
- return g = {
95
- next: verb(0),
96
- "throw": verb(1),
97
- "return": verb(2)
98
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
99
- return this;
100
- }), g;
101
- function verb(n) {
102
- return function(v) {
103
- return step([
104
- n,
105
- v
106
- ]);
107
- };
108
- }
109
- function step(op) {
110
- if (f) throw new TypeError("Generator is already executing.");
111
- while(_)try {
112
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
113
- if (y = 0, t) op = [
114
- op[0] & 2,
115
- t.value
116
- ];
117
- switch(op[0]){
118
- case 0:
119
- case 1:
120
- t = op;
121
- break;
122
- case 4:
123
- _.label++;
124
- return {
125
- value: op[1],
126
- done: false
127
- };
128
- case 5:
129
- _.label++;
130
- y = op[1];
131
- op = [
132
- 0
133
- ];
134
- continue;
135
- case 7:
136
- op = _.ops.pop();
137
- _.trys.pop();
138
- continue;
139
- default:
140
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
141
- _ = 0;
142
- continue;
143
- }
144
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
145
- _.label = op[1];
146
- break;
147
- }
148
- if (op[0] === 6 && _.label < t[1]) {
149
- _.label = t[1];
150
- t = op;
151
- break;
152
- }
153
- if (t && _.label < t[2]) {
154
- _.label = t[2];
155
- _.ops.push(op);
156
- break;
157
- }
158
- if (t[2]) _.ops.pop();
159
- _.trys.pop();
160
- continue;
161
- }
162
- op = body.call(thisArg, _);
163
- } catch (e) {
164
- op = [
165
- 6,
166
- e
167
- ];
168
- y = 0;
169
- } finally{
170
- f = t = 0;
171
- }
172
- if (op[0] & 5) throw op[1];
173
- return {
174
- value: op[0] ? op[1] : void 0,
175
- done: true
176
- };
177
- }
178
- }
179
- import { useCallback, useEffect, useState } from "react";
180
- // src/utils/serializer.ts
181
- var serializer = {
182
- serialize: function(value) {
183
- return JSON.stringify(value, function(_, v) {
184
- if (_instanceof(v, Date)) {
185
- return {
186
- __type: "Date",
187
- value: v.toISOString()
188
- };
189
- }
190
- return v;
191
- });
192
- },
193
- deserialize: function(value) {
194
- return JSON.parse(value, function(_, v) {
195
- if ((v === null || v === void 0 ? void 0 : v.__type) === "Date") {
196
- return new Date(v.value);
197
- }
198
- return v;
199
- });
200
- }
201
- };
202
- // src/utils/storage-client.ts
203
- import localForage from "localforage";
204
- var storageClient = {
205
- get: function get(key) {
206
- return _async_to_generator(function() {
207
- var error;
208
- return _ts_generator(this, function(_state) {
209
- switch(_state.label){
210
- case 0:
211
- _state.trys.push([
212
- 0,
213
- 2,
214
- ,
215
- 3
216
- ]);
217
- return [
218
- 4,
219
- localForage.getItem(key)
220
- ];
221
- case 1:
222
- return [
223
- 2,
224
- _state.sent()
225
- ];
226
- case 2:
227
- error = _state.sent();
228
- console.error('❌ [Storage:get] Error getting key "'.concat(key, '":'), error);
229
- return [
230
- 2,
231
- null
232
- ];
233
- case 3:
234
- return [
235
- 2
236
- ];
237
- }
238
- });
239
- })();
240
- },
241
- set: function set(key, value) {
242
- return _async_to_generator(function() {
243
- var error;
244
- return _ts_generator(this, function(_state) {
245
- switch(_state.label){
246
- case 0:
247
- _state.trys.push([
248
- 0,
249
- 2,
250
- ,
251
- 3
252
- ]);
253
- return [
254
- 4,
255
- localForage.setItem(key, value)
256
- ];
257
- case 1:
258
- _state.sent();
259
- return [
260
- 3,
261
- 3
262
- ];
263
- case 2:
264
- error = _state.sent();
265
- console.error('❌ [Storage:set] Error setting key "'.concat(key, '":'), error);
266
- return [
267
- 3,
268
- 3
269
- ];
270
- case 3:
271
- return [
272
- 2
273
- ];
274
- }
275
- });
276
- })();
277
- },
278
- remove: function remove(key) {
279
- return _async_to_generator(function() {
280
- var error;
281
- return _ts_generator(this, function(_state) {
282
- switch(_state.label){
283
- case 0:
284
- _state.trys.push([
285
- 0,
286
- 2,
287
- ,
288
- 3
289
- ]);
290
- return [
291
- 4,
292
- localForage.removeItem(key)
293
- ];
294
- case 1:
295
- _state.sent();
296
- return [
297
- 3,
298
- 3
299
- ];
300
- case 2:
301
- error = _state.sent();
302
- console.error('❌ [Storage:remove] Error removing key "'.concat(key, '":'), error);
303
- return [
304
- 3,
305
- 3
306
- ];
307
- case 3:
308
- return [
309
- 2
310
- ];
311
- }
312
- });
313
- })();
314
- },
315
- keys: function keys() {
316
- return _async_to_generator(function() {
317
- var keys, error;
318
- return _ts_generator(this, function(_state) {
319
- switch(_state.label){
320
- case 0:
321
- _state.trys.push([
322
- 0,
323
- 2,
324
- ,
325
- 3
326
- ]);
327
- return [
328
- 4,
329
- localForage.keys()
330
- ];
331
- case 1:
332
- keys = _state.sent();
333
- return [
334
- 2,
335
- keys !== null && keys !== void 0 ? keys : []
336
- ];
337
- case 2:
338
- error = _state.sent();
339
- console.error("❌ [Storage:keys] Error getting keys:", error);
340
- return [
341
- 2,
342
- []
343
- ];
344
- case 3:
345
- return [
346
- 2
347
- ];
348
- }
349
- });
350
- })();
351
- }
352
- };
353
- // src/react/storage.tsx
354
- function useStorage(key, initialValue) {
355
- var serializer2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : serializer;
356
- var _useState = _sliced_to_array(useState(initialValue), 2), value = _useState[0], setValue = _useState[1];
357
- var _useState1 = _sliced_to_array(useState(false), 2), isLoaded = _useState1[0], setIsLoaded = _useState1[1];
358
- useEffect(function() {
359
- var isMounted = true;
360
- var loadValue = /*#__PURE__*/ function() {
361
- var _ref = _async_to_generator(function() {
362
- var valueFound, parsedValue, serialized, error;
363
- return _ts_generator(this, function(_state) {
364
- switch(_state.label){
365
- case 0:
366
- _state.trys.push([
367
- 0,
368
- 6,
369
- 7,
370
- 8
371
- ]);
372
- return [
373
- 4,
374
- storageClient.get(key)
375
- ];
376
- case 1:
377
- valueFound = _state.sent();
378
- if (!isMounted) return [
379
- 3,
380
- 5
381
- ];
382
- if (!(valueFound !== null)) return [
383
- 3,
384
- 2
385
- ];
386
- parsedValue = serializer2.deserialize(valueFound);
387
- setValue(parsedValue);
388
- return [
389
- 3,
390
- 5
391
- ];
392
- case 2:
393
- if (!(initialValue !== void 0)) return [
394
- 3,
395
- 4
396
- ];
397
- serialized = serializer2.serialize(initialValue);
398
- return [
399
- 4,
400
- storageClient.set(key, serialized)
401
- ];
402
- case 3:
403
- _state.sent();
404
- setValue(initialValue);
405
- return [
406
- 3,
407
- 5
408
- ];
409
- case 4:
410
- setValue(void 0);
411
- _state.label = 5;
412
- case 5:
413
- return [
414
- 3,
415
- 8
416
- ];
417
- case 6:
418
- error = _state.sent();
419
- console.error('Error loading value for key "'.concat(key, '":'), error);
420
- if (isMounted) {
421
- setValue(initialValue);
422
- }
423
- return [
424
- 3,
425
- 8
426
- ];
427
- case 7:
428
- if (isMounted) setIsLoaded(true);
429
- return [
430
- 7
431
- ];
432
- case 8:
433
- return [
434
- 2
435
- ];
436
- }
437
- });
438
- });
439
- return function loadValue() {
440
- return _ref.apply(this, arguments);
441
- };
442
- }();
443
- loadValue();
444
- return function() {
445
- isMounted = false;
446
- setIsLoaded(false);
447
- };
448
- }, [
449
- key,
450
- initialValue,
451
- serializer2
452
- ]);
453
- useEffect(function() {
454
- if (!isLoaded) return;
455
- var saveValue = /*#__PURE__*/ function() {
456
- var _ref = _async_to_generator(function() {
457
- var serialized, error;
458
- return _ts_generator(this, function(_state) {
459
- switch(_state.label){
460
- case 0:
461
- _state.trys.push([
462
- 0,
463
- 3,
464
- ,
465
- 4
466
- ]);
467
- if (!(value !== void 0)) return [
468
- 3,
469
- 2
470
- ];
471
- serialized = serializer2.serialize(value);
472
- return [
473
- 4,
474
- storageClient.set(key, serialized)
475
- ];
476
- case 1:
477
- _state.sent();
478
- _state.label = 2;
479
- case 2:
480
- return [
481
- 3,
482
- 4
483
- ];
484
- case 3:
485
- error = _state.sent();
486
- console.error('Error saving value for key "'.concat(key, '":'), error);
487
- return [
488
- 3,
489
- 4
490
- ];
491
- case 4:
492
- return [
493
- 2
494
- ];
495
- }
496
- });
497
- });
498
- return function saveValue() {
499
- return _ref.apply(this, arguments);
500
- };
501
- }();
502
- saveValue();
503
- }, [
504
- value,
505
- key,
506
- serializer2,
507
- isLoaded
508
- ]);
509
- var set = useCallback(function(newValue) {
510
- setValue(function(prev) {
511
- return typeof newValue === "function" ? newValue(prev) : newValue;
512
- });
513
- }, []);
514
- var remove = useCallback(/*#__PURE__*/ _async_to_generator(function() {
515
- var error;
516
- return _ts_generator(this, function(_state) {
517
- switch(_state.label){
518
- case 0:
519
- _state.trys.push([
520
- 0,
521
- 2,
522
- ,
523
- 3
524
- ]);
525
- return [
526
- 4,
527
- storageClient.remove(key)
528
- ];
529
- case 1:
530
- _state.sent();
531
- setValue(void 0);
532
- return [
533
- 3,
534
- 3
535
- ];
536
- case 2:
537
- error = _state.sent();
538
- console.error('Error removing key "'.concat(key, '":'), error);
539
- return [
540
- 3,
541
- 3
542
- ];
543
- case 3:
544
- return [
545
- 2
546
- ];
547
- }
548
- });
549
- }), [
550
- key
551
- ]);
552
- return {
553
- value: value,
554
- set: set,
555
- remove: remove
556
- };
557
- }
558
- export { useStorage };
1
+ function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(e,r,t,n,u,o,a){try{var i=e[o](a);var s=i.value}catch(e){t(e);return}if(i.done){r(s)}else{Promise.resolve(s).then(n,u)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(u,o){var a=e.apply(r,n);function i(e){t(a,u,o,i,s,"next",e)}function s(e){t(a,u,o,i,s,"throw",e)}i(undefined)})}}function u(e,r){if(r!=null&&typeof Symbol!=="undefined"&&r[Symbol.hasInstance]){return!!r[Symbol.hasInstance](e)}else{return e instanceof r}}function o(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var u=true;var o=false;var a,i;try{for(t=t.call(e);!(u=(a=t.next()).done);u=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){o=true;i=e}finally{try{if(!u&&t["return"]!=null)t["return"]()}finally{if(o)throw i}}return n}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(e,t){return r(e)||o(e,t)||s(e,t)||a()}function s(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function c(e,r){var t,n,u,o,a={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return o={next:i(0),"throw":i(1),"return":i(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function i(e){return function(r){return s([e,r])}}function s(o){if(t)throw new TypeError("Generator is already executing.");while(a)try{if(t=1,n&&(u=o[0]&2?n["return"]:o[0]?n["throw"]||((u=n["return"])&&u.call(n),0):n.next)&&!(u=u.call(n,o[1])).done)return u;if(n=0,u)o=[o[0]&2,u.value];switch(o[0]){case 0:case 1:u=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;n=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(u=a.trys,u=u.length>0&&u[u.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!u||o[1]>u[0]&&o[1]<u[3])){a.label=o[1];break}if(o[0]===6&&a.label<u[1]){a.label=u[1];u=o;break}if(u&&a.label<u[2]){a.label=u[2];a.ops.push(o);break}if(u[2])a.ops.pop();a.trys.pop();continue}o=r.call(e,a)}catch(e){o=[6,e];n=0}finally{t=u=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}import{useCallback as l,useEffect as f,useState as v}from"react";var y={serialize:function(e){return JSON.stringify(e,function(e,r){return u(r,Date)?{__type:"Date",value:r.toISOString()}:r})},deserialize:function(e){return JSON.parse(e,function(e,r){return(r===null||r===void 0?void 0:r.__type)==="Date"?new Date(r.value):r})}};import h from"localforage";var p={get:function e(e){return n(function(){var r;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,h.getItem(e)];case 1:return[2,t.sent()];case 2:r=t.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 3:return[2]}})})()},set:function e(e,r){return n(function(){var t;return c(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,h.setItem(e,r)];case 1:n.sent();return[3,3];case 2:t=n.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},remove:function e(e){return n(function(){var r;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,h.removeItem(e)];case 1:t.sent();return[3,3];case 2:r=t.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},keys:function e(){return n(function(){var e,r;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,h.keys()];case 1:return[2,(e=t.sent())!==null&&e!==void 0?e:[]];case 2:r=t.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",r),[])];case 3:return[2]}})})()}};function b(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y;var u=i(v(r),2),o=u[0],a=u[1],s=i(v(!1),2),h=s[0],b=s[1];f(function(){var u=!0;return n(function(){var n,o,i,s;return c(this,function(c){switch(c.label){case 0:c.trys.push([0,6,7,8]);return[4,p.get(e)];case 1:n=c.sent();if(!u)return[3,5];if(!(n!==null))return[3,2];o=t.deserialize(n);a(o);return[3,5];case 2:if(!(r!==void 0))return[3,4];i=t.serialize(r);return[4,p.set(e,i)];case 3:c.sent(),a(r);return[3,5];case 4:a(void 0);c.label=5;case 5:return[3,8];case 6:s=c.sent();console.error('Error loading value for key "'.concat(e,'":'),s),u&&a(r);return[3,8];case 7:u&&b(!0);return[7];case 8:return[2]}})})(),function(){u=!1,b(!1)}},[e,r,t]),f(function(){if(!h)return;n(function(){var r,n;return c(this,function(u){switch(u.label){case 0:u.trys.push([0,3,,4]);if(!(o!==void 0))return[3,2];r=t.serialize(o);return[4,p.set(e,r)];case 1:u.sent();u.label=2;case 2:return[3,4];case 3:n=u.sent();console.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},[o,e,t,h]);var g=l(function(e){a(function(r){return typeof e=="function"?e(r):e})},[]),m=l(/*#__PURE__*/n(function(){var r;return c(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,p.remove(e)];case 1:t.sent(),a(void 0);return[3,3];case 2:r=t.sent();console.error('Error removing key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})}),[e]);return{value:o,set:g,remove:m}}export{b as useStorage};
@@ -1,48 +1 @@
1
- "use strict";
2
- function _type_of(obj) {
3
- "@swc/helpers - typeof";
4
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5
- }
6
- var __defProp = Object.defineProperty;
7
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
- var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __copyProps = function(to, from, except, desc) {
11
- if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
12
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
13
- try {
14
- var _loop = function() {
15
- var key = _step.value;
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: function() {
18
- return from[key];
19
- },
20
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
- });
22
- };
23
- for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
24
- } catch (err) {
25
- _didIteratorError = true;
26
- _iteratorError = err;
27
- } finally{
28
- try {
29
- if (!_iteratorNormalCompletion && _iterator.return != null) {
30
- _iterator.return();
31
- }
32
- } finally{
33
- if (_didIteratorError) {
34
- throw _iteratorError;
35
- }
36
- }
37
- }
38
- }
39
- return to;
40
- };
41
- var __toCommonJS = function(mod) {
42
- return __copyProps(__defProp({}, "__esModule", {
43
- value: true
44
- }), mod);
45
- };
46
- // src/typescript/api-response.ts
47
- var api_response_exports = {};
48
- module.exports = __toCommonJS(api_response_exports);
1
+ "use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(u,a,f,l){var c=true,i=false,y=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var p=function(){var e=d.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(l=t(a,e))||l.enumerable})};for(var v=n(a)[Symbol.iterator](),d;!(c=(d=v.next()).done);c=true)p()}catch(e){i=true;y=e}finally{try{if(!c&&v.return!=null){v.return()}}finally{if(i){throw y}}}return u};var a=function(e){return u(r({},"__esModule",{value:!0}),e)};var f={};module.exports=a(f);
@@ -1,48 +1 @@
1
- "use strict";
2
- function _type_of(obj) {
3
- "@swc/helpers - typeof";
4
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5
- }
6
- var __defProp = Object.defineProperty;
7
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
- var __getOwnPropNames = Object.getOwnPropertyNames;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __copyProps = function(to, from, except, desc) {
11
- if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
12
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
13
- try {
14
- var _loop = function() {
15
- var key = _step.value;
16
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
- get: function() {
18
- return from[key];
19
- },
20
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
- });
22
- };
23
- for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
24
- } catch (err) {
25
- _didIteratorError = true;
26
- _iteratorError = err;
27
- } finally{
28
- try {
29
- if (!_iteratorNormalCompletion && _iterator.return != null) {
30
- _iterator.return();
31
- }
32
- } finally{
33
- if (_didIteratorError) {
34
- throw _iteratorError;
35
- }
36
- }
37
- }
38
- }
39
- return to;
40
- };
41
- var __toCommonJS = function(mod) {
42
- return __copyProps(__defProp({}, "__esModule", {
43
- value: true
44
- }), mod);
45
- };
46
- // src/typescript/apollo.ts
47
- var apollo_exports = {};
48
- module.exports = __toCommonJS(apollo_exports);
1
+ "use strict";function e(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}var r=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var u=function(u,a,f,l){var c=true,i=false,y=undefined;if(a&&(typeof a==="undefined"?"undefined":e(a))=="object"||typeof a=="function")try{var p=function(){var e=d.value;!o.call(u,e)&&e!==f&&r(u,e,{get:function(){return a[e]},enumerable:!(l=t(a,e))||l.enumerable})};for(var v=n(a)[Symbol.iterator](),d;!(c=(d=v.next()).done);c=true)p()}catch(e){i=true;y=e}finally{try{if(!c&&v.return!=null){v.return()}}finally{if(i){throw y}}}return u};var a=function(e){return u(r({},"__esModule",{value:!0}),e)};var f={};module.exports=a(f);