@fctc/interface-logic 1.8.2 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/configs.d.mts +12 -0
  2. package/dist/configs.d.ts +12 -0
  3. package/dist/configs.js +2386 -0
  4. package/dist/configs.mjs +2349 -0
  5. package/dist/constants.d.mts +131 -0
  6. package/dist/constants.d.ts +131 -0
  7. package/dist/constants.js +205 -0
  8. package/dist/constants.mjs +166 -0
  9. package/dist/environment.d.mts +53 -0
  10. package/dist/environment.d.ts +53 -0
  11. package/dist/environment.js +3080 -0
  12. package/dist/environment.mjs +3042 -0
  13. package/dist/hooks.d.mts +359 -0
  14. package/dist/hooks.d.ts +359 -0
  15. package/dist/{index.js → hooks.js} +203 -1435
  16. package/dist/{index.mjs → hooks.mjs} +159 -1251
  17. package/dist/provider.d.mts +16 -0
  18. package/dist/provider.d.ts +16 -0
  19. package/dist/provider.js +3600 -0
  20. package/dist/provider.mjs +3561 -0
  21. package/dist/services.d.mts +255 -0
  22. package/dist/services.d.ts +255 -0
  23. package/dist/services.js +4653 -0
  24. package/dist/services.mjs +4608 -0
  25. package/dist/store.d.mts +377 -0
  26. package/dist/store.d.ts +377 -0
  27. package/dist/store.js +814 -0
  28. package/dist/store.mjs +709 -0
  29. package/dist/types.d.mts +17 -0
  30. package/dist/types.d.ts +17 -0
  31. package/dist/types.js +18 -0
  32. package/dist/types.mjs +0 -0
  33. package/dist/utils.d.mts +93 -0
  34. package/dist/utils.d.ts +93 -0
  35. package/dist/utils.js +2962 -0
  36. package/dist/utils.mjs +2896 -0
  37. package/dist/view-type-D8ukwj_2.d.mts +113 -0
  38. package/dist/view-type-D8ukwj_2.d.ts +113 -0
  39. package/package.json +1 -1
  40. package/dist/index.d.mts +0 -1681
  41. package/dist/index.d.ts +0 -1681
  42. package/dist/index.js.map +0 -1
  43. package/dist/index.mjs.map +0 -1
@@ -1,34 +1,5 @@
1
- // src/configs/axios-client.ts
2
- import axios from "axios";
3
-
4
- // src/constants/api/key-constant.ts
5
- var KeyConstants = /* @__PURE__ */ ((KeyConstants2) => {
6
- KeyConstants2["PROFILE"] = "userinfo";
7
- KeyConstants2["CURRENT_COMPANY"] = "current_company";
8
- KeyConstants2["LIST_COMPANY"] = "list_company";
9
- KeyConstants2["COMPANY_INFO"] = "company_info";
10
- KeyConstants2["MENU"] = "menus";
11
- KeyConstants2["GET_VIEW_BY_ACTION"] = "get_view_by_action";
12
- KeyConstants2["ACTION_DETAIL"] = "action_detail";
13
- KeyConstants2["GET_DATA_SELECTION"] = "get_data_select";
14
- KeyConstants2["WEB_SAVE"] = "web_save";
15
- KeyConstants2["WEB_READ"] = "web_read";
16
- KeyConstants2["GET_PROVIDER"] = "get_provider";
17
- return KeyConstants2;
18
- })(KeyConstants || {});
19
-
20
- // src/constants/api/method-constant.ts
21
- var MethodConstants = /* @__PURE__ */ ((MethodConstants2) => {
22
- MethodConstants2["WEB_SEARCH_READ"] = "web_search_read";
23
- MethodConstants2["WEB_READ_GROUP"] = "web_read_group";
24
- MethodConstants2["WEB_READ"] = "web_read";
25
- MethodConstants2["WEB_SAVE"] = "web_save";
26
- MethodConstants2["UNLINK"] = "unlink";
27
- MethodConstants2["ONCHANGE"] = "onchange";
28
- MethodConstants2["GET_ONCHANGE_FIELDS"] = "get_fields_onchange";
29
- MethodConstants2["GET_FIELD_VIEW"] = "get_fields_view_v2";
30
- return MethodConstants2;
31
- })(MethodConstants || {});
1
+ // src/hooks/auth/use-forgot-password.ts
2
+ import { useMutation } from "@tanstack/react-query";
32
3
 
33
4
  // src/constants/api/uri-constant.ts
34
5
  var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
@@ -60,380 +31,11 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
60
31
  return UriConstants2;
61
32
  })(UriConstants || {});
62
33
 
63
- // src/utils/error-handler.ts
64
- var WesapError = class extends Error {
65
- code;
66
- constructor(message, code) {
67
- super(message);
68
- this.code = code;
69
- }
70
- };
71
- function handleError(error, env2) {
72
- if (error instanceof WesapError) {
73
- env2.services.notification.error(error.message);
74
- } else {
75
- env2.services.notification.error("An unexpected error occurred");
76
- }
77
- }
34
+ // src/configs/axios-client.ts
35
+ import axios from "axios";
78
36
 
79
37
  // src/utils/format.ts
80
38
  import moment from "moment";
81
- var formatCurrency = (amount, currency = "USD") => {
82
- const formatter = new Intl.NumberFormat("vi-VN", {
83
- style: "currency",
84
- currency,
85
- minimumFractionDigits: 0
86
- });
87
- return formatter.format(amount).replaceAll(".", ",");
88
- };
89
- var formatDate = (date, locale = "en-US") => {
90
- return new Intl.DateTimeFormat(locale).format(new Date(date));
91
- };
92
- var validateAndParseDate = (input, isDateTime = false) => {
93
- if (!input || typeof input !== "string") return null;
94
- const cleanInput = input.replace(/[^0-9-\/:\s]/g, "");
95
- const dateFormat = "YYYY-MM-DD";
96
- const dateTimeFormat = "YYYY-MM-DD HH:mm:ss";
97
- const currentDay = moment().format("DD");
98
- const currentMonth = moment().format("MM");
99
- const currentYear = moment().format("YYYY");
100
- const defaultTime = "00:00:00";
101
- const maxYear = parseInt(currentYear) + 10;
102
- const isValidDate = (day, month, year) => {
103
- const date = moment(`${day}-${month}-${year}`, "DD-MM-YYYY", true);
104
- return date.isValid();
105
- };
106
- const isValidTime = (hour, minute = "00", second = "00") => {
107
- const h = parseInt(hour, 10);
108
- const m = parseInt(minute, 10);
109
- const s = parseInt(second, 10);
110
- return h >= 0 && h <= 23 && m >= 0 && m <= 59 && s >= 0 && s <= 59;
111
- };
112
- const formatOutput = (day, month, year, time = defaultTime) => {
113
- let result = moment(
114
- `${day}-${month}-${year} ${time}`,
115
- "DD-MM-YYYY HH:mm:ss"
116
- );
117
- if (!result.isValid()) return null;
118
- if (isDateTime) {
119
- result = result.subtract(7, "hours");
120
- return result.format(dateTimeFormat);
121
- }
122
- return result.format(dateFormat);
123
- };
124
- if (isDateTime && input.match(
125
- /^\d{1,2}[\/-]\d{1,2}[\/-]\d{2,4}\s+\d{1,2}(:\d{1,2}(:\d{1,2})?)?$/
126
- )) {
127
- const [datePart, timePart] = input.split(/\s+/);
128
- const dateParts = datePart.split(/[\/-]/);
129
- const timeParts = timePart.split(":");
130
- const day = dateParts[0].padStart(2, "0");
131
- const month = dateParts[1].padStart(2, "0");
132
- const year = dateParts[2].length <= 2 ? `20${dateParts[2].padStart(2, "0")}` : dateParts[2].padStart(4, "0");
133
- const hour = timeParts[0].padStart(2, "0");
134
- const minute = timeParts[1] ? timeParts[1].padStart(2, "0") : "00";
135
- const second = timeParts[2] ? timeParts[2].padStart(2, "0") : "00";
136
- if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
137
- let result = moment(
138
- `${day}-${month}-${year} ${hour}:${minute}:${second}`,
139
- "DD-MM-YYYY HH:mm:ss"
140
- );
141
- if (!result.isValid()) return null;
142
- result = result.subtract(7, "hours");
143
- return result.format(dateTimeFormat);
144
- }
145
- return null;
146
- }
147
- if (cleanInput.match(/^\d{4}-\d{2}-\d{2}$/)) {
148
- const [year, month, day] = cleanInput.split("-");
149
- if (isValidDate(day, month, year)) {
150
- return formatOutput(day, month, year);
151
- }
152
- return null;
153
- }
154
- if (cleanInput.match(/^\d{1,2}\/\d{1,2}\/\d{2,4}$/)) {
155
- const [day, month, year] = cleanInput.split("/");
156
- const paddedDay = day.padStart(2, "0");
157
- const paddedMonth = month.padStart(2, "0");
158
- const fullYear = year.length <= 2 ? `20${year.padStart(2, "0")}` : year.padStart(4, "0");
159
- if (isValidDate(paddedDay, paddedMonth, fullYear)) {
160
- return formatOutput(paddedDay, paddedMonth, fullYear);
161
- }
162
- return null;
163
- }
164
- if (cleanInput.match(/^\d{1,2}-\d{1,2}-\d{2,4}$/)) {
165
- const [day, month, year] = cleanInput.split("-");
166
- const paddedDay = day.padStart(2, "0");
167
- const paddedMonth = month.padStart(2, "0");
168
- const fullYear = year.length <= 2 ? `20${year.padStart(2, "0")}` : year.padStart(4, "0");
169
- if (isValidDate(paddedDay, paddedMonth, fullYear)) {
170
- return formatOutput(paddedDay, paddedMonth, fullYear);
171
- }
172
- return null;
173
- }
174
- if (cleanInput.match(/^\d{1,2}[\/-]\d{1,2}$/)) {
175
- const [day, month] = cleanInput.split(/[\/-]/);
176
- const paddedDay = day.padStart(2, "0");
177
- const paddedMonth = month.padStart(2, "0");
178
- if (isValidDate(paddedDay, paddedMonth, currentYear)) {
179
- return formatOutput(paddedDay, paddedMonth, currentYear);
180
- }
181
- return null;
182
- }
183
- if (cleanInput.match(/^\d{4}$/)) {
184
- const num = parseInt(cleanInput, 10);
185
- if (num >= 2e3 && num <= maxYear) {
186
- if (isValidDate(currentDay, currentMonth, num.toString())) {
187
- return formatOutput(currentDay, currentMonth, num.toString());
188
- }
189
- return null;
190
- }
191
- const day = cleanInput.slice(0, 2);
192
- const month = cleanInput.slice(2, 4);
193
- if (isValidDate(day, month, currentYear)) {
194
- return formatOutput(day, month, currentYear);
195
- }
196
- return null;
197
- }
198
- if (cleanInput.startsWith("-") && /^\-\d+$/.test(cleanInput)) {
199
- const daysToSubtract = Math.abs(parseInt(cleanInput, 10));
200
- let result = moment().subtract(daysToSubtract, "days");
201
- if (isDateTime) {
202
- result = result.subtract(7, "hours");
203
- }
204
- if (result.isValid()) {
205
- return isDateTime ? result.format(dateTimeFormat) : result.format(dateFormat);
206
- }
207
- return null;
208
- }
209
- if (input.match(/^\d{1,2}[^0-9-\/]+\d{1,2}[^0-9-\/]+\d{2,4}.*$/)) {
210
- const parts = input.split(/[^0-9-\/]+/).filter(Boolean);
211
- const day = parts[0].padStart(2, "0");
212
- const month = parts[1].padStart(2, "0");
213
- let year = parts[2];
214
- year = year.length === 2 ? `20${year}` : year.padStart(4, "0");
215
- if (isValidDate(day, month, year)) {
216
- return formatOutput(day, month, year);
217
- }
218
- return null;
219
- }
220
- if (isDateTime) {
221
- if (cleanInput.length === 9) {
222
- const day = cleanInput.slice(0, 2);
223
- const month = cleanInput.slice(2, 4);
224
- const year = cleanInput.slice(4, 8);
225
- const hour = cleanInput.slice(8, 9).padStart(2, "0");
226
- if (isValidDate(day, month, year) && isValidTime(hour)) {
227
- let result = moment(
228
- `${day}-${month}-${year} ${hour}:00:00`,
229
- "DD-MM-YYYY HH:mm:ss"
230
- );
231
- if (!result.isValid()) return null;
232
- result = result.subtract(7, "hours");
233
- return result.format(dateTimeFormat);
234
- }
235
- return null;
236
- }
237
- if (cleanInput.length === 10) {
238
- const day = cleanInput.slice(0, 2);
239
- const month = cleanInput.slice(2, 4);
240
- const year = cleanInput.slice(4, 8);
241
- const hour = cleanInput.slice(8, 10);
242
- if (isValidDate(day, month, year) && isValidTime(hour)) {
243
- let result = moment(
244
- `${day}-${month}-${year} ${hour}:00:00`,
245
- "DD-MM-YYYY HH:mm:ss"
246
- );
247
- if (!result.isValid()) return null;
248
- result = result.subtract(7, "hours");
249
- return result.format(dateTimeFormat);
250
- }
251
- return null;
252
- }
253
- if (cleanInput.length === 11) {
254
- const day = cleanInput.slice(0, 2);
255
- const month = cleanInput.slice(2, 4);
256
- const year = cleanInput.slice(4, 8);
257
- const hour = cleanInput.slice(8, 10);
258
- const minute = cleanInput.slice(10, 11).padStart(2, "0");
259
- if (isValidDate(day, month, year) && isValidTime(hour, minute)) {
260
- let result = moment(
261
- `${day}-${month}-${year} ${hour}:${minute}:00`,
262
- "DD-MM-YYYY HH:mm:ss"
263
- );
264
- if (!result.isValid()) return null;
265
- result = result.subtract(7, "hours");
266
- return result.format(dateTimeFormat);
267
- }
268
- return null;
269
- }
270
- if (cleanInput.length === 12) {
271
- const day = cleanInput.slice(0, 2);
272
- const month = cleanInput.slice(2, 4);
273
- const year = cleanInput.slice(4, 8);
274
- const hour = cleanInput.slice(8, 10);
275
- const minute = cleanInput.slice(10, 12);
276
- if (isValidDate(day, month, year) && isValidTime(hour, minute)) {
277
- let result = moment(
278
- `${day}-${month}-${year} ${hour}:${minute}:00`,
279
- "DD-MM-YYYY HH:mm:ss"
280
- );
281
- if (!result.isValid()) return null;
282
- result = result.subtract(7, "hours");
283
- return result.format(dateTimeFormat);
284
- }
285
- return null;
286
- }
287
- if (cleanInput.length === 13) {
288
- const day = cleanInput.slice(0, 2);
289
- const month = cleanInput.slice(2, 4);
290
- const year = cleanInput.slice(4, 8);
291
- const hour = cleanInput.slice(8, 10);
292
- const minute = cleanInput.slice(10, 12);
293
- const second = cleanInput.slice(12, 13).padStart(2, "0");
294
- if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
295
- let result = moment(
296
- `${day}-${month}-${year} ${hour}:${minute}:${second}`,
297
- "DD-MM-YYYY HH:mm:ss"
298
- );
299
- if (!result.isValid()) return null;
300
- result = result.subtract(7, "hours");
301
- return result.format(dateTimeFormat);
302
- }
303
- return null;
304
- }
305
- if (cleanInput.length === 14) {
306
- const day = cleanInput.slice(0, 2);
307
- const month = cleanInput.slice(2, 4);
308
- const year = cleanInput.slice(4, 8);
309
- const hour = cleanInput.slice(8, 10);
310
- const minute = cleanInput.slice(10, 12);
311
- const second = cleanInput.slice(12, 14);
312
- if (isValidDate(day, month, year) && isValidTime(hour, minute, second)) {
313
- let result = moment(
314
- `${day}-${month}-${year} ${hour}:${minute}:${second}`,
315
- "DD-MM-YYYY HH:mm:ss"
316
- );
317
- if (!result.isValid()) return null;
318
- result = result.subtract(7, "hours");
319
- return result.format(dateTimeFormat);
320
- }
321
- return null;
322
- }
323
- }
324
- const len = cleanInput.length;
325
- if (len === 1 || len === 2) {
326
- const paddedDay = cleanInput.padStart(2, "0");
327
- if (isValidDate(paddedDay, currentMonth, currentYear)) {
328
- return formatOutput(paddedDay, currentMonth, currentYear);
329
- }
330
- return null;
331
- }
332
- if (len === 3) {
333
- const day = cleanInput.slice(0, 2);
334
- const month = cleanInput.slice(2, 3).padStart(2, "0");
335
- if (isValidDate(day, month, currentYear)) {
336
- return formatOutput(day, month, currentYear);
337
- }
338
- return null;
339
- }
340
- if (len === 6) {
341
- const day = cleanInput.slice(0, 2);
342
- const month = cleanInput.slice(2, 4);
343
- let year = cleanInput.slice(4, 6);
344
- year = `20${year}`;
345
- if (parseInt(month) > 12) {
346
- if (isValidDate(day, currentMonth, currentYear)) {
347
- return formatOutput(day, currentMonth, currentYear);
348
- }
349
- return null;
350
- }
351
- if (isValidDate(day, month, year)) {
352
- return formatOutput(day, month, year);
353
- }
354
- return null;
355
- }
356
- if (len === 7) {
357
- return null;
358
- }
359
- if (len === 8) {
360
- const day = cleanInput.slice(0, 2);
361
- const month = cleanInput.slice(2, 4);
362
- const year = cleanInput.slice(4, 8);
363
- if (isValidDate(day, month, year)) {
364
- return formatOutput(day, month, year);
365
- }
366
- return null;
367
- }
368
- if (len > 8 && !isDateTime) {
369
- return null;
370
- }
371
- return null;
372
- };
373
-
374
- // src/constants/field/field-type-constant.ts
375
- var FieldTypeConstants = /* @__PURE__ */ ((FieldTypeConstants2) => {
376
- FieldTypeConstants2["CHAR"] = "char";
377
- FieldTypeConstants2["TEXT"] = "text";
378
- FieldTypeConstants2["INTEGER"] = "integer";
379
- FieldTypeConstants2["FLOAT"] = "float";
380
- FieldTypeConstants2["BOOLEAN"] = "boolean";
381
- FieldTypeConstants2["DATE"] = "date";
382
- FieldTypeConstants2["DATETIME"] = "datetime";
383
- FieldTypeConstants2["BINARY"] = "binary";
384
- FieldTypeConstants2["SELECTION"] = "selection";
385
- FieldTypeConstants2["HTML"] = "html";
386
- FieldTypeConstants2["MANY2ONE"] = "many2one";
387
- FieldTypeConstants2["ONE2MANY"] = "one2many";
388
- FieldTypeConstants2["MANY2MANY"] = "many2many";
389
- FieldTypeConstants2["MONETARY"] = "monetary";
390
- FieldTypeConstants2["REFERENCE"] = "reference";
391
- FieldTypeConstants2["FUNCTION"] = "function";
392
- FieldTypeConstants2["PROPERTY"] = "property";
393
- return FieldTypeConstants2;
394
- })(FieldTypeConstants || {});
395
-
396
- // src/constants/method/method-type-constant.ts
397
- var MethodType = /* @__PURE__ */ ((MethodType2) => {
398
- MethodType2[MethodType2["CREATE"] = 0] = "CREATE";
399
- MethodType2[MethodType2["UPDATE"] = 1] = "UPDATE";
400
- MethodType2[MethodType2["DELETE"] = 2] = "DELETE";
401
- MethodType2[MethodType2["UNLINK"] = 3] = "UNLINK";
402
- MethodType2[MethodType2["NO_CHANGE"] = 4] = "NO_CHANGE";
403
- return MethodType2;
404
- })(MethodType || {});
405
-
406
- // src/constants/model/model-constant.ts
407
- var ModelConstants = /* @__PURE__ */ ((ModelConstants2) => {
408
- ModelConstants2["MENU"] = "ir.ui.menu";
409
- ModelConstants2["USER"] = "res.users";
410
- ModelConstants2["COMPANY"] = "res.company";
411
- ModelConstants2["WINDOW_ACTION"] = "ir.actions.act_window";
412
- ModelConstants2["BASE_IMPORT"] = "base_import.import";
413
- ModelConstants2["GET_IMPORT"] = "get_import_templates";
414
- return ModelConstants2;
415
- })(ModelConstants || {});
416
-
417
- // src/constants/type/index.ts
418
- var ComponentType = /* @__PURE__ */ ((ComponentType2) => {
419
- ComponentType2["GROUP"] = "group";
420
- ComponentType2["FIELD"] = "field";
421
- ComponentType2["TREE"] = "tree";
422
- ComponentType2["DIV"] = "div";
423
- ComponentType2["LIST"] = "list";
424
- ComponentType2["FORM"] = "form";
425
- ComponentType2["SETTINGS"] = "setting";
426
- ComponentType2["SPAN"] = "span";
427
- ComponentType2["KANBAN"] = "kanban";
428
- ComponentType2["CALENDAR"] = "calendar";
429
- ComponentType2["TYPE"] = "view-type";
430
- return ComponentType2;
431
- })(ComponentType || {});
432
- var SearchType = {
433
- FILTER: "filter_by",
434
- SEARCH: "search_by",
435
- GROUP: "group_by"
436
- };
437
39
 
438
40
  // src/constants/widget/widget-avatar-constant.ts
439
41
  var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
@@ -441,28 +43,6 @@ var WIDGETAVATAR = /* @__PURE__ */ ((WIDGETAVATAR2) => {
441
43
  WIDGETAVATAR2["many2many_avatar_user"] = "many2many_avatar_user";
442
44
  return WIDGETAVATAR2;
443
45
  })(WIDGETAVATAR || {});
444
- var WIDGETCURRENCY = /* @__PURE__ */ ((WIDGETCURRENCY2) => {
445
- WIDGETCURRENCY2["many2one_avatar_user"] = "many2one_avatar_user";
446
- WIDGETCURRENCY2["many2many_avatar_user"] = "many2many_avatar_user";
447
- return WIDGETCURRENCY2;
448
- })(WIDGETCURRENCY || {});
449
-
450
- // src/constants/widget/widget-color-constant.ts
451
- var WIDGETCOLOR = /* @__PURE__ */ ((WIDGETCOLOR2) => {
452
- WIDGETCOLOR2["many2many_tags"] = "many2many_tags";
453
- WIDGETCOLOR2["helpdesk_sla_many2many_tags"] = "helpdesk_sla_many2many_tags";
454
- return WIDGETCOLOR2;
455
- })(WIDGETCOLOR || {});
456
-
457
- // src/constants/widget/widget-status-constant.ts
458
- var WIDGETSTATUS = /* @__PURE__ */ ((WIDGETSTATUS2) => {
459
- WIDGETSTATUS2["sla_status_ids"] = "sla_status_ids";
460
- return WIDGETSTATUS2;
461
- })(WIDGETSTATUS || {});
462
- var WIDGETNOSTRING = /* @__PURE__ */ ((WIDGETNOSTRING2) => {
463
- WIDGETNOSTRING2["sla_status_ids"] = "sla_status_ids";
464
- return WIDGETNOSTRING2;
465
- })(WIDGETNOSTRING || {});
466
46
 
467
47
  // src/utils/domain/py_tokenizer.ts
468
48
  var TokenizerError = class extends Error {
@@ -2231,48 +1811,6 @@ function parseExpr(expr) {
2231
1811
  const tokens = tokenize(expr);
2232
1812
  return parse(tokens);
2233
1813
  }
2234
- function evaluateExpr(expr, context = {}) {
2235
- let ast;
2236
- try {
2237
- ast = parseExpr(expr);
2238
- } catch (error) {
2239
- throw new EvalError(
2240
- `Can not parse python expression: (${expr})
2241
- Error: ${error.message}`
2242
- );
2243
- }
2244
- try {
2245
- return evaluate(ast, context);
2246
- } catch (error) {
2247
- throw new EvalError(
2248
- `Can not evaluate python expression: (${expr})
2249
- Error: ${error.message}`
2250
- );
2251
- }
2252
- }
2253
- function evaluateBooleanExpr(expr, context = {}) {
2254
- if (!expr || expr === "False" || expr === "0") {
2255
- return false;
2256
- }
2257
- if (expr === "True" || expr === "1") {
2258
- return true;
2259
- }
2260
- return evaluateExpr(`bool(${expr})`, context);
2261
- }
2262
-
2263
- // src/utils/domain/context.ts
2264
- function evalPartialContext(_context, evaluationContext = {}) {
2265
- const ast = parseExpr(_context);
2266
- const context = {};
2267
- for (const key in ast.value) {
2268
- const value = ast.value[key];
2269
- try {
2270
- context[key] = evaluate(value, evaluationContext);
2271
- } catch {
2272
- }
2273
- }
2274
- return context;
2275
- }
2276
1814
 
2277
1815
  // src/utils/domain/objects.ts
2278
1816
  function shallowEqual(obj1, obj2, comparisonFn = (a, b) => a === b) {
@@ -2611,280 +2149,14 @@ function matchDomain(record, domain) {
2611
2149
  }
2612
2150
  return matchCondition(record, condStack.pop());
2613
2151
  }
2614
- var checkDomain = (context, domain) => {
2615
- try {
2616
- if (domain === void 0 || domain === "0" || domain === "False" || domain === false) {
2617
- return false;
2618
- } else if (domain === "1" || domain === "True" || domain === true) {
2619
- return true;
2620
- }
2621
- try {
2622
- if (context && domain) {
2623
- const d = new Domain(domain);
2624
- return d.contains(context);
2625
- }
2626
- } catch (error) {
2627
- if (context && domain) {
2628
- const domainEval = evaluateBooleanExpr(domain, context);
2629
- return domainEval;
2630
- }
2631
- return false;
2632
- }
2633
- return false;
2634
- } catch (e) {
2635
- return false;
2636
- }
2637
- };
2638
- var matchDomains = (context, domains) => {
2639
- if (Array.isArray(domains)) {
2640
- if (domains?.length > 0) {
2641
- return domains && domains.some((domain) => checkDomain(context, domain));
2642
- }
2643
- } else return checkDomain(context, domains);
2644
- return false;
2645
- };
2646
2152
 
2647
2153
  // src/utils/function.ts
2648
2154
  import { useEffect, useState } from "react";
2649
- var evalJSONContext = (_context, context = {}) => {
2650
- try {
2651
- return evalPartialContext(_context, context);
2652
- } catch (err) {
2653
- return null;
2654
- }
2655
- };
2656
- var evalJSONDomain = (domain, context) => {
2657
- try {
2658
- if (context) {
2659
- Object.keys(context)?.forEach((key) => {
2660
- if (Array.isArray(context[key])) {
2661
- const isTypeObject = context[key]?.every(
2662
- (item) => typeof item === "object" && item !== null && item?.id !== void 0
2663
- );
2664
- if (isTypeObject) {
2665
- context[key] = context[key]?.map((item) => item?.id);
2666
- }
2667
- }
2668
- });
2669
- }
2670
- const value = evaluateExpr(domain, context);
2671
- return value;
2672
- } catch (err) {
2673
- try {
2674
- const domainObject = new Domain(domain).toList(context);
2675
- return domainObject;
2676
- } catch (err2) {
2677
- return [];
2678
- }
2679
- }
2680
- };
2681
- var formatSortingString = (input) => {
2682
- if (!input) return null;
2683
- return input.split(",").map((field) => {
2684
- const [key, order] = field.trim().split(/\s+/);
2685
- const sortOrder = order?.toUpperCase() === "DESC" ? "DESC" : "ASC";
2686
- return `${key} ${sortOrder}`;
2687
- }).join(", ");
2688
- };
2689
- var domainHelper = {
2690
- checkDomain,
2691
- matchDomains,
2692
- Domain
2693
- };
2694
2155
  var toQueryString = (params) => {
2695
2156
  return Object.keys(params).map(
2696
2157
  (key) => encodeURIComponent(key) + "=" + encodeURIComponent(params[key].toString())
2697
2158
  ).join("&");
2698
2159
  };
2699
- var convertFloatToTime = (floatValue) => {
2700
- const hours = Math.floor(floatValue);
2701
- const minutes = Math.round((floatValue - hours) * 60);
2702
- const formattedHours = String(hours).padStart(2, "0");
2703
- const formattedMinutes = String(minutes).padStart(2, "0");
2704
- return `${formattedHours}:${formattedMinutes}`;
2705
- };
2706
- var convertTimeToFloat = (timeString) => {
2707
- const [hours, minutes] = timeString.split(":").map(Number);
2708
- return hours + minutes / 60;
2709
- };
2710
- var stringToColor = (name, id) => {
2711
- const combined = name + id / 2;
2712
- let hash = 0;
2713
- for (let i = 0; i < combined.length; i++) {
2714
- hash = combined.charCodeAt(i) + ((hash << 5) - hash);
2715
- }
2716
- const r = hash >> 16 & 255;
2717
- const g = hash >> 8 & 255;
2718
- const b = hash & 255;
2719
- const adjustedR = 120 + r % 61;
2720
- const adjustedG = 120 + g % 61;
2721
- const adjustedB = 120 + b % 61;
2722
- return `#${adjustedR.toString(16).padStart(2, "0")}${adjustedG.toString(16).padStart(2, "0")}${adjustedB.toString(16).padStart(2, "0")}`;
2723
- };
2724
- var getFieldsOnChange = (fields) => {
2725
- const result = [];
2726
- function traverse(items) {
2727
- for (const item of items) {
2728
- if (item) {
2729
- if (item?.type_co === "field" && matchDomains(fields, item?.on_change)) {
2730
- result.push(item.name);
2731
- }
2732
- if (item?.fields && Array.isArray(item?.fields)) {
2733
- traverse(item?.fields);
2734
- }
2735
- }
2736
- }
2737
- }
2738
- traverse(fields);
2739
- return result;
2740
- };
2741
- var filterFieldDirty = ({
2742
- id,
2743
- viewData,
2744
- formValues,
2745
- dirtyFields,
2746
- model,
2747
- defaultData
2748
- }) => {
2749
- const data = id ? { ...dirtyFields } : { ...formValues };
2750
- for (const key in data) {
2751
- if (viewData?.models?.[model]?.[key]?.type === "one2many" /* ONE2MANY */) {
2752
- const lineData = [];
2753
- (formValues[key] ?? []).forEach((itemData, index) => {
2754
- if (typeof itemData?.id === "string" && itemData?.id.includes("virtual")) {
2755
- delete itemData?.id;
2756
- }
2757
- if (!itemData?.id) {
2758
- lineData.push([
2759
- 0 /* CREATE */,
2760
- `virtual_${index}`,
2761
- filterFieldDirty({
2762
- id: itemData?.id,
2763
- viewData,
2764
- formValues: itemData,
2765
- dirtyFields: {},
2766
- model: viewData?.models?.[model]?.[key]?.relation,
2767
- defaultData
2768
- })
2769
- ]);
2770
- } else if (dirtyFields[key]?.length) {
2771
- dirtyFields[key].forEach((itemDirty, indexDirty) => {
2772
- if (Object.values(itemDirty).includes(true) && indexDirty === index) {
2773
- lineData.push([
2774
- 1 /* UPDATE */,
2775
- itemData?.id,
2776
- filterFieldDirty({
2777
- id: itemData?.id,
2778
- viewData,
2779
- formValues: itemData,
2780
- dirtyFields: itemDirty,
2781
- model: viewData?.models?.[model]?.[key]?.relation,
2782
- defaultData: {}
2783
- })
2784
- ]);
2785
- }
2786
- });
2787
- }
2788
- });
2789
- (defaultData[key] ?? []).forEach((item) => {
2790
- if (!(formValues[key] ?? []).find(
2791
- (itemData) => itemData?.id === item?.id
2792
- )) {
2793
- lineData.push([2 /* DELETE */, item?.id, item]);
2794
- }
2795
- });
2796
- data[key] = lineData;
2797
- } else if (viewData?.models?.[model]?.[key]?.type === "many2many" /* MANY2MANY */) {
2798
- const lineData = [];
2799
- (formValues[key] || []).forEach((itemData) => {
2800
- if (itemData?.id) {
2801
- lineData.push([4 /* NO_CHANGE */, itemData?.id]);
2802
- }
2803
- });
2804
- (defaultData[key] ?? []).forEach((item) => {
2805
- if (!(formValues[key] ?? []).find(
2806
- (itemData) => itemData?.id === item?.id
2807
- )) {
2808
- lineData.push([3 /* UNLINK */, item?.id]);
2809
- }
2810
- });
2811
- data[key] = lineData;
2812
- } else {
2813
- if (id && (typeof dirtyFields?.[key] === "object" && !dirtyFields?.[key]?.id || typeof dirtyFields[key] !== "object" && !dirtyFields[key])) {
2814
- delete data[key];
2815
- } else {
2816
- if (!data[key]) {
2817
- delete data[key];
2818
- } else {
2819
- data[key] = formValues?.[key]?.display_name ? formValues?.[key]?.id : formValues?.[key];
2820
- }
2821
- }
2822
- }
2823
- }
2824
- return data;
2825
- };
2826
- var mergeObjects = (object1, object2) => {
2827
- if (!object1 || !object2) return void 0;
2828
- const mergedObject = { ...object2 };
2829
- Object.keys(object1).forEach((key) => {
2830
- if (Array.isArray(object1[key]) && Array.isArray(object2[key])) {
2831
- mergedObject[key] = object2[key].map((item, index) => {
2832
- if (object1[key][index]) {
2833
- return {
2834
- ...item,
2835
- ...object1[key][index]
2836
- };
2837
- }
2838
- return item;
2839
- });
2840
- } else if (typeof object1[key] === "object" && typeof object2[key] === "object" && object1[key] !== null && object2[key] !== null) {
2841
- mergedObject[key] = mergeObjects(object1[key], object2[key]);
2842
- } else {
2843
- mergedObject[key] = object1[key] !== void 0 ? object1[key] : object2[key];
2844
- }
2845
- });
2846
- if (object2) {
2847
- Object.keys(object2).forEach((key) => {
2848
- if (!mergedObject.hasOwnProperty(key)) {
2849
- mergedObject[key] = object2[key];
2850
- }
2851
- });
2852
- }
2853
- return mergedObject;
2854
- };
2855
- var formatUrlPath = ({
2856
- viewType,
2857
- aid,
2858
- model,
2859
- id,
2860
- actionPath
2861
- }) => {
2862
- let _url = `/${viewType}/${actionPath}?aid=${aid}&model=${model}`;
2863
- if (id) {
2864
- _url += `&id=${id}`;
2865
- }
2866
- return _url;
2867
- };
2868
- var removeUndefinedFields = (obj) => {
2869
- const newObj = {};
2870
- for (const key in obj) {
2871
- if (obj[key] !== void 0) {
2872
- newObj[key] = obj[key];
2873
- }
2874
- }
2875
- return newObj;
2876
- };
2877
- var useTabModel = (viewData, onchangeData) => {
2878
- const tabsData = viewData?.views?.form?.tabs?.filter((val) => {
2879
- if (!val) return null;
2880
- const hide = checkDomain(onchangeData, val.invisible);
2881
- if (!hide) {
2882
- return val;
2883
- }
2884
- return false;
2885
- }) || [];
2886
- return tabsData;
2887
- };
2888
2160
  var isBase64File = (str) => {
2889
2161
  try {
2890
2162
  const dataUriPattern = /^data:([a-zA-Z]+\/[a-zA-Z0-9-.+]+)?;base64,/;
@@ -2900,69 +2172,6 @@ var isBase64File = (str) => {
2900
2172
  return false;
2901
2173
  }
2902
2174
  };
2903
- var isBase64Image = (str) => {
2904
- const base64Regex = /^data:image\/(png|jpeg|jpg|gif|webp);base64,/;
2905
- if (!base64Regex.test(str)) {
2906
- return false;
2907
- }
2908
- try {
2909
- const base64Data = str.split(",")[1];
2910
- return !!base64Data && atob(base64Data).length > 0;
2911
- } catch (error) {
2912
- return false;
2913
- }
2914
- };
2915
- var checkIsImageLink = (url) => {
2916
- const imageExtensions = /\.(jpg|jpeg|png|gif|bmp|webp|svg|tiff|ico)$/i;
2917
- return imageExtensions.test(url) || isBase64Image(url);
2918
- };
2919
- var formatFileSize = (size) => {
2920
- if (size < 1024) return `${size} B`;
2921
- const i = Math.floor(Math.log(size) / Math.log(1024));
2922
- const sizes = ["B", "KB", "MB", "GB", "TB"];
2923
- return `${(size / Math.pow(1024, i)).toFixed(2)} ${sizes[i]}`;
2924
- };
2925
- var getSubdomain = (url = window.location.href) => {
2926
- const parts = url?.split(".");
2927
- if (parts.length > 2) {
2928
- return parts[0].replace("https://", "").replace("http://", "");
2929
- }
2930
- return null;
2931
- };
2932
- var resequence = (arr, start, end) => {
2933
- if (start < 0 || start >= arr.length || end < 0 || end >= arr.length) {
2934
- return [];
2935
- }
2936
- const [element] = arr.splice(start, 1);
2937
- arr.splice(end, 0, element);
2938
- return arr.slice(Math.min(start, end), Math.max(start, end) + 1);
2939
- };
2940
- var getOffSet = (arr, start, end) => {
2941
- if (start < 0 || start >= arr.length || end < 0 || end >= arr.length) {
2942
- return 0;
2943
- }
2944
- if (start > end) {
2945
- return end;
2946
- }
2947
- return arr.slice(0, start).length;
2948
- };
2949
- var copyTextToClipboard = async (text) => {
2950
- if ("clipboard" in navigator) {
2951
- return await navigator.clipboard.writeText(text);
2952
- } else {
2953
- const textArea = document.createElement("textarea");
2954
- textArea.value = text;
2955
- textArea.style.position = "fixed";
2956
- document.body.appendChild(textArea);
2957
- textArea.focus();
2958
- textArea.select();
2959
- try {
2960
- document.execCommand("copy");
2961
- } finally {
2962
- document.body.removeChild(textArea);
2963
- }
2964
- }
2965
- };
2966
2175
  var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2967
2176
  if (!originalRequest.data) return originalRequest.data;
2968
2177
  if (typeof originalRequest.data === "string") {
@@ -2982,41 +2191,6 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2982
2191
  }
2983
2192
  return originalRequest.data;
2984
2193
  };
2985
- var isObjectEmpty = (obj) => {
2986
- return Object.keys(obj).length === 0;
2987
- };
2988
- var useField = (props) => {
2989
- const [invisible, setInvisible] = useState(true);
2990
- const [required, setRequired] = useState(false);
2991
- const [readonly, setReadOnly] = useState(false);
2992
- const {
2993
- invisible: inv,
2994
- required: req,
2995
- readonly: rea,
2996
- onchangeData,
2997
- rootField,
2998
- index,
2999
- name
3000
- } = props;
3001
- const nameField = rootField ? `${rootField?.name}.${index}.${name}` : null;
3002
- useEffect(() => {
3003
- if (onchangeData && Object.keys(onchangeData).length > 0) {
3004
- setRequired(
3005
- typeof req === "object" ? matchDomains(onchangeData, req) : checkDomain(onchangeData, req)
3006
- );
3007
- setInvisible(matchDomains(onchangeData, inv));
3008
- setReadOnly(
3009
- typeof req === "object" ? matchDomains(onchangeData, rea) : checkDomain(onchangeData, rea)
3010
- );
3011
- }
3012
- }, [onchangeData]);
3013
- return {
3014
- invisible,
3015
- required,
3016
- readonly,
3017
- nameField
3018
- };
3019
- };
3020
2194
 
3021
2195
  // src/utils/storage/local-storage.ts
3022
2196
  var localStorageUtils = () => {
@@ -3058,9 +2232,9 @@ var sessionStorageUtils = () => {
3058
2232
  // src/configs/axios-client.ts
3059
2233
  var axiosClient = {
3060
2234
  init(config) {
3061
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
3062
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
3063
- const db = config.db;
2235
+ const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
2236
+ const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
2237
+ const db = config?.db;
3064
2238
  let isRefreshing = false;
3065
2239
  let failedQueue = [];
3066
2240
  const processQueue = (error, token = null) => {
@@ -3079,16 +2253,19 @@ var axiosClient = {
3079
2253
  timeout: 5e4,
3080
2254
  paramsSerializer: (params) => new URLSearchParams(params).toString()
3081
2255
  });
3082
- instance.interceptors.request.use(async (config2) => {
3083
- const { useRefreshToken, useActionToken, actionToken } = config2;
3084
- if (useActionToken && actionToken) {
3085
- config2.headers["Action-Token"] = actionToken;
3086
- }
3087
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
3088
- const token = await getToken?.();
3089
- if (token) config2.headers["Authorization"] = `Bearer ${token}`;
3090
- return config2;
3091
- }, Promise.reject);
2256
+ instance.interceptors.request.use(
2257
+ async (config2) => {
2258
+ const useRefreshToken = config2.useRefreshToken;
2259
+ const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2260
+ if (token) {
2261
+ config2.headers["Authorization"] = "Bearer " + token;
2262
+ }
2263
+ return config2;
2264
+ },
2265
+ (error) => {
2266
+ Promise.reject(error);
2267
+ }
2268
+ );
3092
2269
  instance.interceptors.response.use(
3093
2270
  (response) => {
3094
2271
  return handleResponse(response);
@@ -3246,7 +2423,6 @@ var breadcrumbsSlice = createSlice({
3246
2423
  }
3247
2424
  });
3248
2425
  var { setBreadCrumbs } = breadcrumbsSlice.actions;
3249
- var selectBreadCrumbs = (state) => state.breadcrumbs;
3250
2426
  var breadcrums_slice_default = breadcrumbsSlice.reducer;
3251
2427
 
3252
2428
  // src/store/reducers/env-slice/index.ts
@@ -3315,7 +2491,6 @@ var {
3315
2491
  setConfig,
3316
2492
  setEnvFile
3317
2493
  } = envSlice.actions;
3318
- var selectEnv = (state) => state.env;
3319
2494
  var env_slice_default = envSlice.reducer;
3320
2495
 
3321
2496
  // src/store/reducers/excel-slice/index.ts
@@ -3360,7 +2535,6 @@ var {
3360
2535
  setSelectedFile,
3361
2536
  setErrorData
3362
2537
  } = excelSlice.actions;
3363
- var selectExcel = (state) => state.excel;
3364
2538
  var excel_slice_default = excelSlice.reducer;
3365
2539
 
3366
2540
  // src/store/reducers/form-slice/index.ts
@@ -3410,7 +2584,6 @@ var {
3410
2584
  setListSubject,
3411
2585
  setDataUser
3412
2586
  } = formSlice.actions;
3413
- var selectForm = (state) => state.form;
3414
2587
  var form_slice_default = formSlice.reducer;
3415
2588
 
3416
2589
  // src/store/reducers/header-slice/index.ts
@@ -3430,7 +2603,6 @@ var headerSlice = createSlice5({
3430
2603
  }
3431
2604
  });
3432
2605
  var { setAllowedCompanyIds, setHeader } = headerSlice.actions;
3433
- var selectHeader = (state) => state.header;
3434
2606
  var header_slice_default = headerSlice.reducer;
3435
2607
 
3436
2608
  // src/store/reducers/list-slice/index.ts
@@ -3496,7 +2668,6 @@ var {
3496
2668
  setTransferDetail,
3497
2669
  setDomainTable
3498
2670
  } = listSlice.actions;
3499
- var selectList = (state) => state.list;
3500
2671
  var list_slice_default = listSlice.reducer;
3501
2672
 
3502
2673
  // src/store/reducers/login-slice/index.ts
@@ -3522,7 +2693,6 @@ var loginSlice = createSlice7({
3522
2693
  }
3523
2694
  });
3524
2695
  var { setDb, setRedirectTo, setForgotPasswordUrl } = loginSlice.actions;
3525
- var selectLogin = (state) => state.login;
3526
2696
  var login_slice_default = loginSlice.reducer;
3527
2697
 
3528
2698
  // src/store/reducers/navbar-slice/index.ts
@@ -3552,7 +2722,6 @@ var navbarSlice = createSlice8({
3552
2722
  }
3553
2723
  });
3554
2724
  var { setMenuFocus, setMenuFocusAction, setNavbarWidth, setMenuList } = navbarSlice.actions;
3555
- var selectNavbar = (state) => state.navbar;
3556
2725
  var navbar_slice_default = navbarSlice.reducer;
3557
2726
 
3558
2727
  // src/store/reducers/profile-slice/index.ts
@@ -3570,7 +2739,6 @@ var profileSlice = createSlice9({
3570
2739
  }
3571
2740
  });
3572
2741
  var { setProfile } = profileSlice.actions;
3573
- var selectProfile = (state) => state.profile;
3574
2742
  var profile_slice_default = profileSlice.reducer;
3575
2743
 
3576
2744
  // src/store/reducers/search-slice/index.ts
@@ -3657,8 +2825,6 @@ var {
3657
2825
  setGroupBy,
3658
2826
  clearSearchMap
3659
2827
  } = searchSlice.actions;
3660
- var selectSearch = (state) => state.search;
3661
- var selectSearchMap = (state) => state.search.searchMap;
3662
2828
  var search_slice_default = searchSlice.reducer;
3663
2829
 
3664
2830
  // src/store/store.ts
@@ -3853,101 +3019,77 @@ var envStore = configureStore({
3853
3019
  })
3854
3020
  });
3855
3021
 
3856
- // src/store/index.ts
3857
- var useAppDispatch = useDispatch;
3858
- var useAppSelector = useSelector;
3859
-
3860
3022
  // src/environment/EnvStore.ts
3861
- var EnvStore = class {
3862
- envStore;
3863
- baseUrl;
3864
- requests;
3865
- context;
3866
- defaultCompany;
3867
- config;
3868
- companies;
3869
- user;
3870
- db;
3871
- localStorageUtils;
3872
- sessionStorageUtils;
3873
- refreshTokenEndpoint;
3874
- constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3875
- this.envStore = envStore2;
3876
- this.localStorageUtils = localStorageUtils2;
3877
- this.sessionStorageUtils = sessionStorageUtils2;
3878
- this.setup();
3879
- }
3880
- setup() {
3881
- const env2 = this.envStore.getState().env;
3882
- this.baseUrl = env2?.baseUrl;
3883
- this.requests = env2?.requests;
3884
- this.context = env2?.context;
3885
- this.defaultCompany = env2?.defaultCompany;
3886
- this.config = env2?.config;
3887
- this.companies = env2?.companies || [];
3888
- this.user = env2?.user;
3889
- this.db = env2?.db;
3890
- this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3891
- }
3892
- setupEnv(envConfig) {
3893
- const dispatch = this.envStore.dispatch;
3894
- const env2 = {
3023
+ function createEnvStore(store, localStorageUtil, sessionStorageUtil) {
3024
+ const getEnvState = () => store.getState().env;
3025
+ const setupEnvConfig = () => {
3026
+ const env2 = getEnvState();
3027
+ return {
3028
+ baseUrl: env2?.baseUrl,
3029
+ requests: env2?.requests,
3030
+ context: env2?.context,
3031
+ defaultCompany: env2?.defaultCompany,
3032
+ config: env2?.config,
3033
+ companies: env2?.companies || [],
3034
+ user: env2?.user,
3035
+ db: env2?.db,
3036
+ refreshTokenEndpoint: env2?.refreshTokenEndpoint
3037
+ };
3038
+ };
3039
+ const setupEnv = (envConfig) => {
3040
+ const dispatch = store.dispatch;
3041
+ const updatedEnv = {
3895
3042
  ...envConfig,
3896
- localStorageUtils: this.localStorageUtils,
3897
- sessionStorageUtils: this.sessionStorageUtils
3043
+ localStorageUtils: localStorageUtil,
3044
+ sessionStorageUtils: sessionStorageUtil
3898
3045
  };
3899
- const requests = axiosClient.init(env2);
3900
- dispatch(setEnv({ ...env2, requests }));
3901
- this.setup();
3902
- }
3903
- setUid(uid) {
3904
- const dispatch = this.envStore.dispatch;
3905
- dispatch(setUid(uid));
3906
- this.setup();
3907
- }
3908
- setLang(lang) {
3909
- const dispatch = this.envStore.dispatch;
3910
- dispatch(setLang(lang));
3911
- this.setup();
3912
- }
3913
- setAllowCompanies(allowCompanies) {
3914
- const dispatch = this.envStore.dispatch;
3915
- dispatch(setAllowCompanies(allowCompanies));
3916
- this.setup();
3917
- }
3918
- setCompanies(companies) {
3919
- const dispatch = this.envStore.dispatch;
3920
- dispatch(setCompanies(companies));
3921
- this.setup();
3922
- }
3923
- setDefaultCompany(company) {
3924
- const dispatch = this.envStore.dispatch;
3925
- dispatch(setDefaultCompany(company));
3926
- this.setup();
3927
- }
3928
- setUserInfo(userInfo) {
3929
- const dispatch = this.envStore.dispatch;
3930
- dispatch(setUser(userInfo));
3931
- this.setup();
3932
- }
3933
- };
3934
- var env = null;
3935
- function initEnv({
3936
- localStorageUtils: localStorageUtils2,
3937
- sessionStorageUtils: sessionStorageUtils2
3938
- }) {
3939
- env = new EnvStore(envStore, localStorageUtils2, sessionStorageUtils2);
3940
- return env;
3046
+ const requests = axiosClient.init(updatedEnv);
3047
+ dispatch(setEnv({ ...updatedEnv, requests }));
3048
+ return setupEnvConfig();
3049
+ };
3050
+ const setupUid = (uid) => {
3051
+ store.dispatch(setUid(uid));
3052
+ return setupEnvConfig();
3053
+ };
3054
+ const setupLang = (lang) => {
3055
+ store.dispatch(setLang(lang));
3056
+ return setupEnvConfig();
3057
+ };
3058
+ const setupAllowCompanies = (allowCompanies) => {
3059
+ store.dispatch(setAllowCompanies(allowCompanies));
3060
+ return setupEnvConfig();
3061
+ };
3062
+ const setupCompanies = (companies) => {
3063
+ store.dispatch(setCompanies(companies));
3064
+ return setupEnvConfig();
3065
+ };
3066
+ const setupDefaultCompany = (company) => {
3067
+ store.dispatch(setDefaultCompany(company));
3068
+ return setupEnvConfig();
3069
+ };
3070
+ const setUserInfo = (userInfo) => {
3071
+ store.dispatch(setUser(userInfo));
3072
+ return setupEnvConfig();
3073
+ };
3074
+ return {
3075
+ getEnvConfig: setupEnvConfig,
3076
+ setupEnv,
3077
+ setUid: setupUid,
3078
+ setLang: setupLang,
3079
+ setAllowCompanies: setupAllowCompanies,
3080
+ setCompanies: setupCompanies,
3081
+ setDefaultCompany: setupDefaultCompany,
3082
+ setUserInfo
3083
+ };
3941
3084
  }
3085
+ var env = null;
3942
3086
  function getEnv() {
3943
- if (!env)
3944
- env = new EnvStore(envStore, localStorageUtils(), sessionStorageUtils());
3087
+ if (!env) {
3088
+ env = createEnvStore(envStore, localStorageUtils(), sessionStorageUtils());
3089
+ }
3945
3090
  return env;
3946
3091
  }
3947
3092
 
3948
- // src/hooks/auth/use-forgot-password.ts
3949
- import { useMutation } from "@tanstack/react-query";
3950
-
3951
3093
  // src/services/action-service/index.ts
3952
3094
  var ActionService = {
3953
3095
  // Load Action
@@ -4210,20 +3352,6 @@ var AuthService = {
4210
3352
  }
4211
3353
  });
4212
3354
  },
4213
- async isValidActionToken(actionToken, path) {
4214
- const env2 = getEnv();
4215
- return env2?.requests?.post(
4216
- path,
4217
- {},
4218
- {
4219
- headers: {
4220
- "Content-Type": "application/json"
4221
- },
4222
- useActionToken: true,
4223
- actionToken
4224
- }
4225
- );
4226
- },
4227
3355
  async loginSocial({
4228
3356
  db,
4229
3357
  state,
@@ -4988,7 +4116,7 @@ var model_service_default = ModelService;
4988
4116
  var UserService = {
4989
4117
  async getProfile(path) {
4990
4118
  const env2 = getEnv();
4991
- return env2?.requests?.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4119
+ return env2.requests.get(path ?? "/userinfo" /* PROFILE_PATH */, {
4992
4120
  headers: {
4993
4121
  "Content-Type": "application/x-www-form-urlencoded"
4994
4122
  }
@@ -5307,8 +4435,8 @@ var ViewService = {
5307
4435
  },
5308
4436
  async getVersion() {
5309
4437
  const env2 = getEnv();
5310
- console.log("env", env2);
5311
- return env2?.requests.get("", {
4438
+ console.log("env?.requests", env2, env2?.requests);
4439
+ return env2?.requests?.get("", {
5312
4440
  headers: {
5313
4441
  "Content-Type": "application/json"
5314
4442
  }
@@ -5625,33 +4753,19 @@ var useGetAccessByCode = () => {
5625
4753
  };
5626
4754
  var use_get_access_by_code_default = useGetAccessByCode;
5627
4755
 
5628
- // src/hooks/auth/use-validate-action-token.ts
5629
- import { useMutation as useMutation12 } from "@tanstack/react-query";
5630
- var useValidateActionToken = () => {
5631
- return useMutation12({
5632
- mutationFn: ({
5633
- actionToken,
5634
- path
5635
- }) => {
5636
- return auth_service_default.isValidActionToken(actionToken, path);
5637
- }
5638
- });
5639
- };
5640
- var use_validate_action_token_default = useValidateActionToken;
5641
-
5642
4756
  // src/hooks/company/use-get-company-info.ts
5643
- import { useMutation as useMutation13 } from "@tanstack/react-query";
4757
+ import { useMutation as useMutation12 } from "@tanstack/react-query";
5644
4758
  var useGetCompanyInfo = () => {
5645
- return useMutation13({
4759
+ return useMutation12({
5646
4760
  mutationFn: (id) => company_service_default.getInfoCompany(id)
5647
4761
  });
5648
4762
  };
5649
4763
  var use_get_company_info_default = useGetCompanyInfo;
5650
4764
 
5651
4765
  // src/hooks/company/use-get-current-company.ts
5652
- import { useMutation as useMutation14 } from "@tanstack/react-query";
4766
+ import { useMutation as useMutation13 } from "@tanstack/react-query";
5653
4767
  var useGetCurrentCompany = () => {
5654
- return useMutation14({
4768
+ return useMutation13({
5655
4769
  mutationFn: () => company_service_default.getCurrentCompany()
5656
4770
  });
5657
4771
  };
@@ -5678,9 +4792,9 @@ var useGetListCompany = (companyIDs = []) => {
5678
4792
  var use_get_list_company_default = useGetListCompany;
5679
4793
 
5680
4794
  // src/hooks/excel/use-export-excel.ts
5681
- import { useMutation as useMutation15 } from "@tanstack/react-query";
4795
+ import { useMutation as useMutation14 } from "@tanstack/react-query";
5682
4796
  var useExportExcel = () => {
5683
- return useMutation15({
4797
+ return useMutation14({
5684
4798
  mutationFn: ({
5685
4799
  model,
5686
4800
  domain,
@@ -5705,9 +4819,9 @@ var useExportExcel = () => {
5705
4819
  var use_export_excel_default = useExportExcel;
5706
4820
 
5707
4821
  // src/hooks/excel/use-get-field-export.ts
5708
- import { useMutation as useMutation16 } from "@tanstack/react-query";
4822
+ import { useMutation as useMutation15 } from "@tanstack/react-query";
5709
4823
  var useGetFieldExport = () => {
5710
- return useMutation16({
4824
+ return useMutation15({
5711
4825
  mutationFn: ({
5712
4826
  ids,
5713
4827
  model,
@@ -5754,9 +4868,9 @@ var useGetFileExcel = ({ model }) => {
5754
4868
  var use_get_file_excel_default = useGetFileExcel;
5755
4869
 
5756
4870
  // src/hooks/excel/use-parse-preview.ts
5757
- import { useMutation as useMutation17 } from "@tanstack/react-query";
4871
+ import { useMutation as useMutation16 } from "@tanstack/react-query";
5758
4872
  var useParsePreview = () => {
5759
- return useMutation17({
4873
+ return useMutation16({
5760
4874
  mutationFn: ({
5761
4875
  id,
5762
4876
  selectedSheet,
@@ -5773,9 +4887,9 @@ var useParsePreview = () => {
5773
4887
  var use_parse_preview_default = useParsePreview;
5774
4888
 
5775
4889
  // src/hooks/excel/use-upload-file.ts
5776
- import { useMutation as useMutation18 } from "@tanstack/react-query";
4890
+ import { useMutation as useMutation17 } from "@tanstack/react-query";
5777
4891
  var useUploadFile = () => {
5778
- return useMutation18({
4892
+ return useMutation17({
5779
4893
  mutationFn: ({ formData }) => excel_service_default.uploadFile({
5780
4894
  formData
5781
4895
  })
@@ -5784,9 +4898,9 @@ var useUploadFile = () => {
5784
4898
  var use_upload_file_default = useUploadFile;
5785
4899
 
5786
4900
  // src/hooks/excel/use-upload-id-file.ts
5787
- import { useMutation as useMutation19 } from "@tanstack/react-query";
4901
+ import { useMutation as useMutation18 } from "@tanstack/react-query";
5788
4902
  var useUploadIdFile = () => {
5789
- return useMutation19({
4903
+ return useMutation18({
5790
4904
  mutationFn: ({ formData }) => excel_service_default.uploadIdFile({
5791
4905
  formData
5792
4906
  })
@@ -5795,9 +4909,9 @@ var useUploadIdFile = () => {
5795
4909
  var use_upload_id_file_default = useUploadIdFile;
5796
4910
 
5797
4911
  // src/hooks/excel/uss-execute-import.ts
5798
- import { useMutation as useMutation20 } from "@tanstack/react-query";
4912
+ import { useMutation as useMutation19 } from "@tanstack/react-query";
5799
4913
  var useExecuteImport = () => {
5800
- return useMutation20({
4914
+ return useMutation19({
5801
4915
  mutationFn: ({
5802
4916
  fields,
5803
4917
  columns,
@@ -5818,9 +4932,9 @@ var useExecuteImport = () => {
5818
4932
  var uss_execute_import_default = useExecuteImport;
5819
4933
 
5820
4934
  // src/hooks/form/use-change-status.ts
5821
- import { useMutation as useMutation21 } from "@tanstack/react-query";
4935
+ import { useMutation as useMutation20 } from "@tanstack/react-query";
5822
4936
  var useChangeStatus = () => {
5823
- return useMutation21({
4937
+ return useMutation20({
5824
4938
  mutationFn: ({ data }) => {
5825
4939
  return form_service_default.changeStatus({
5826
4940
  data
@@ -5831,9 +4945,9 @@ var useChangeStatus = () => {
5831
4945
  var use_change_status_default = useChangeStatus;
5832
4946
 
5833
4947
  // src/hooks/form/use-delete-comment.ts
5834
- import { useMutation as useMutation22 } from "@tanstack/react-query";
4948
+ import { useMutation as useMutation21 } from "@tanstack/react-query";
5835
4949
  var useDeleteComment = () => {
5836
- return useMutation22({
4950
+ return useMutation21({
5837
4951
  mutationFn: ({ data }) => form_service_default.deleteComment({
5838
4952
  data
5839
4953
  })
@@ -5898,9 +5012,9 @@ var useGetImage = ({
5898
5012
  var use_get_image_default = useGetImage;
5899
5013
 
5900
5014
  // src/hooks/form/use-send-comment.ts
5901
- import { useMutation as useMutation23 } from "@tanstack/react-query";
5015
+ import { useMutation as useMutation22 } from "@tanstack/react-query";
5902
5016
  var useSendComment = () => {
5903
- return useMutation23({
5017
+ return useMutation22({
5904
5018
  mutationFn: ({ data }) => form_service_default.sentComment({
5905
5019
  data
5906
5020
  })
@@ -5909,9 +5023,9 @@ var useSendComment = () => {
5909
5023
  var use_send_comment_default = useSendComment;
5910
5024
 
5911
5025
  // src/hooks/form/use-upload-image.ts
5912
- import { useMutation as useMutation24 } from "@tanstack/react-query";
5026
+ import { useMutation as useMutation23 } from "@tanstack/react-query";
5913
5027
  var useUploadImage = () => {
5914
- return useMutation24({
5028
+ return useMutation23({
5915
5029
  mutationFn: ({ data }) => form_service_default.uploadImage({
5916
5030
  data
5917
5031
  })
@@ -5920,9 +5034,9 @@ var useUploadImage = () => {
5920
5034
  var use_upload_image_default = useUploadImage;
5921
5035
 
5922
5036
  // src/hooks/model/use-delete.ts
5923
- import { useMutation as useMutation25 } from "@tanstack/react-query";
5037
+ import { useMutation as useMutation24 } from "@tanstack/react-query";
5924
5038
  var useDelete = () => {
5925
- return useMutation25({
5039
+ return useMutation24({
5926
5040
  mutationFn: ({ ids, model }) => model_service_default.delete({ ids, model })
5927
5041
  });
5928
5042
  };
@@ -5976,9 +5090,9 @@ var useGetCurrency = () => {
5976
5090
  var use_get_currency_default = useGetCurrency;
5977
5091
 
5978
5092
  // src/hooks/model/use-get-detail.ts
5979
- import { useMutation as useMutation26 } from "@tanstack/react-query";
5093
+ import { useMutation as useMutation25 } from "@tanstack/react-query";
5980
5094
  var useGetDetail = () => {
5981
- return useMutation26({
5095
+ return useMutation25({
5982
5096
  mutationFn: ({
5983
5097
  model,
5984
5098
  ids,
@@ -6171,9 +5285,9 @@ var useOdooDataTransform = () => {
6171
5285
  var use_odoo_data_transform_default = useOdooDataTransform;
6172
5286
 
6173
5287
  // src/hooks/model/use-onchange-form.ts
6174
- import { useMutation as useMutation27 } from "@tanstack/react-query";
5288
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
6175
5289
  var useOnChangeForm = () => {
6176
- return useMutation27({
5290
+ return useMutation26({
6177
5291
  mutationFn: ({
6178
5292
  ids,
6179
5293
  model,
@@ -6194,9 +5308,9 @@ var useOnChangeForm = () => {
6194
5308
  var use_onchange_form_default = useOnChangeForm;
6195
5309
 
6196
5310
  // src/hooks/model/use-save.ts
6197
- import { useMutation as useMutation28 } from "@tanstack/react-query";
5311
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
6198
5312
  var useSave = () => {
6199
- return useMutation28({
5313
+ return useMutation27({
6200
5314
  mutationFn: ({
6201
5315
  ids,
6202
5316
  model,
@@ -6210,18 +5324,18 @@ var useSave = () => {
6210
5324
  var use_save_default = useSave;
6211
5325
 
6212
5326
  // src/hooks/user/use-get-profile.ts
6213
- import { useMutation as useMutation29 } from "@tanstack/react-query";
5327
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
6214
5328
  var useGetProfile = (path) => {
6215
- return useMutation29({
5329
+ return useMutation28({
6216
5330
  mutationFn: () => user_service_default.getProfile(path)
6217
5331
  });
6218
5332
  };
6219
5333
  var use_get_profile_default = useGetProfile;
6220
5334
 
6221
5335
  // src/hooks/user/use-get-user.ts
6222
- import { useMutation as useMutation30 } from "@tanstack/react-query";
5336
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
6223
5337
  var useGetUser = () => {
6224
- return useMutation30({
5338
+ return useMutation29({
6225
5339
  mutationFn: ({ id, context }) => user_service_default.getUser({
6226
5340
  id,
6227
5341
  context
@@ -6231,9 +5345,9 @@ var useGetUser = () => {
6231
5345
  var use_get_user_default = useGetUser;
6232
5346
 
6233
5347
  // src/hooks/user/use-switch-locale.ts
6234
- import { useMutation as useMutation31 } from "@tanstack/react-query";
5348
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
6235
5349
  var useSwitchLocale = () => {
6236
- return useMutation31({
5350
+ return useMutation30({
6237
5351
  mutationFn: ({ data }) => {
6238
5352
  return user_service_default.switchUserLocale({
6239
5353
  id: data.id,
@@ -6245,9 +5359,9 @@ var useSwitchLocale = () => {
6245
5359
  var use_switch_locale_default = useSwitchLocale;
6246
5360
 
6247
5361
  // src/hooks/view/use-button.ts
6248
- import { useMutation as useMutation32 } from "@tanstack/react-query";
5362
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
6249
5363
  var useButton = () => {
6250
- return useMutation32({
5364
+ return useMutation31({
6251
5365
  mutationFn: ({
6252
5366
  model,
6253
5367
  ids,
@@ -6267,9 +5381,9 @@ var useButton = () => {
6267
5381
  var use_button_default = useButton;
6268
5382
 
6269
5383
  // src/hooks/view/use-duplicate-record.ts
6270
- import { useMutation as useMutation33 } from "@tanstack/react-query";
5384
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
6271
5385
  var useDuplicateRecord = () => {
6272
- return useMutation33({
5386
+ return useMutation32({
6273
5387
  mutationFn: ({
6274
5388
  id,
6275
5389
  model,
@@ -6395,9 +5509,9 @@ var useGetMenu = (context, enabled) => {
6395
5509
  var use_get_menu_default = useGetMenu;
6396
5510
 
6397
5511
  // src/hooks/view/use-get-print-report.ts
6398
- import { useMutation as useMutation34 } from "@tanstack/react-query";
5512
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
6399
5513
  var useGetPrintReport = () => {
6400
- return useMutation34({
5514
+ return useMutation33({
6401
5515
  mutationFn: ({ id }) => action_service_default.getPrintReportName({
6402
5516
  id
6403
5517
  })
@@ -6461,9 +5575,9 @@ var useGetView = (viewParams, actData) => {
6461
5575
  var use_get_view_default = useGetView;
6462
5576
 
6463
5577
  // src/hooks/view/use-load-action.ts
6464
- import { useMutation as useMutation35 } from "@tanstack/react-query";
5578
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
6465
5579
  var useLoadAction = () => {
6466
- return useMutation35({
5580
+ return useMutation34({
6467
5581
  mutationFn: ({
6468
5582
  idAction,
6469
5583
  context
@@ -6489,9 +5603,9 @@ var useLoadMessage = () => {
6489
5603
  var use_load_message_default = useLoadMessage;
6490
5604
 
6491
5605
  // src/hooks/view/use-print.ts
6492
- import { useMutation as useMutation36 } from "@tanstack/react-query";
5606
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
6493
5607
  var usePrint = () => {
6494
- return useMutation36({
5608
+ return useMutation35({
6495
5609
  mutationFn: ({ id, report, db }) => action_service_default.print({
6496
5610
  id,
6497
5611
  report,
@@ -6502,9 +5616,9 @@ var usePrint = () => {
6502
5616
  var use_print_default = usePrint;
6503
5617
 
6504
5618
  // src/hooks/view/use-remove-row.ts
6505
- import { useMutation as useMutation37 } from "@tanstack/react-query";
5619
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
6506
5620
  var useRemoveRow = () => {
6507
- return useMutation37({
5621
+ return useMutation36({
6508
5622
  mutationFn: ({
6509
5623
  model,
6510
5624
  ids,
@@ -6536,9 +5650,9 @@ var useGetResequence = (model, resIds, context, offset) => {
6536
5650
  var use_resequence_default = useGetResequence;
6537
5651
 
6538
5652
  // src/hooks/view/use-run-action.ts
6539
- import { useMutation as useMutation38 } from "@tanstack/react-query";
5653
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
6540
5654
  var useRunAction = () => {
6541
- return useMutation38({
5655
+ return useMutation37({
6542
5656
  mutationFn: ({
6543
5657
  idAction,
6544
5658
  context
@@ -6551,9 +5665,9 @@ var useRunAction = () => {
6551
5665
  var use_run_action_default = useRunAction;
6552
5666
 
6553
5667
  // src/hooks/view/use-signin-sso.ts
6554
- import { useMutation as useMutation39 } from "@tanstack/react-query";
5668
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
6555
5669
  var useSignInSSO = () => {
6556
- return useMutation39({
5670
+ return useMutation38({
6557
5671
  mutationFn: ({
6558
5672
  redirect_uri,
6559
5673
  state,
@@ -6574,9 +5688,9 @@ var useSignInSSO = () => {
6574
5688
  var use_signin_sso_default = useSignInSSO;
6575
5689
 
6576
5690
  // src/hooks/view/use-verify-2FA.ts
6577
- import { useMutation as useMutation40 } from "@tanstack/react-query";
5691
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
6578
5692
  var useVerify2FA = () => {
6579
- return useMutation40({
5693
+ return useMutation39({
6580
5694
  mutationFn: ({
6581
5695
  method,
6582
5696
  with_context,
@@ -6597,9 +5711,9 @@ var useVerify2FA = () => {
6597
5711
  var use_verify_2FA_default = useVerify2FA;
6598
5712
 
6599
5713
  // src/hooks/view/uset-get-2FA-method.ts
6600
- import { useMutation as useMutation41 } from "@tanstack/react-query";
5714
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
6601
5715
  var useGet2FAMethods = () => {
6602
- return useMutation41({
5716
+ return useMutation40({
6603
5717
  mutationFn: ({
6604
5718
  method,
6605
5719
  with_context
@@ -6614,9 +5728,9 @@ var useGet2FAMethods = () => {
6614
5728
  var uset_get_2FA_method_default = useGet2FAMethods;
6615
5729
 
6616
5730
  // src/hooks/view/use-get-fields-view-security.ts
6617
- import { useMutation as useMutation42 } from "@tanstack/react-query";
5731
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
6618
5732
  var useGetFieldsViewSecurity = () => {
6619
- return useMutation42({
5733
+ return useMutation41({
6620
5734
  mutationFn: ({
6621
5735
  method,
6622
5736
  token,
@@ -6633,9 +5747,9 @@ var useGetFieldsViewSecurity = () => {
6633
5747
  var use_get_fields_view_security_default = useGetFieldsViewSecurity;
6634
5748
 
6635
5749
  // src/hooks/view/use-grant-access.ts
6636
- import { useMutation as useMutation43 } from "@tanstack/react-query";
5750
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
6637
5751
  var useGrantAccess = () => {
6638
- return useMutation43({
5752
+ return useMutation42({
6639
5753
  mutationFn: ({
6640
5754
  redirect_uri,
6641
5755
  state,
@@ -6654,9 +5768,9 @@ var useGrantAccess = () => {
6654
5768
  var use_grant_access_default = useGrantAccess;
6655
5769
 
6656
5770
  // src/hooks/view/use-remove-totp-setup.ts
6657
- import { useMutation as useMutation44 } from "@tanstack/react-query";
5771
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
6658
5772
  var useRemoveTotpSetup = () => {
6659
- return useMutation44({
5773
+ return useMutation43({
6660
5774
  mutationFn: ({ method, token }) => {
6661
5775
  return view_service_default.removeTotpSetUp({
6662
5776
  method,
@@ -6668,9 +5782,9 @@ var useRemoveTotpSetup = () => {
6668
5782
  var use_remove_totp_setup_default = useRemoveTotpSetup;
6669
5783
 
6670
5784
  // src/hooks/view/use-request-setup-totp.ts
6671
- import { useMutation as useMutation45 } from "@tanstack/react-query";
5785
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
6672
5786
  var useRequestSetupTotp = () => {
6673
- return useMutation45({
5787
+ return useMutation44({
6674
5788
  mutationFn: ({ method, token }) => {
6675
5789
  return view_service_default.requestSetupTotp({
6676
5790
  method,
@@ -6682,9 +5796,9 @@ var useRequestSetupTotp = () => {
6682
5796
  var use_request_setup_totp_default = useRequestSetupTotp;
6683
5797
 
6684
5798
  // src/hooks/view/use-settings-web-read-2fa.ts
6685
- import { useMutation as useMutation46 } from "@tanstack/react-query";
5799
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
6686
5800
  var useSettingsWebRead2fa = () => {
6687
- return useMutation46({
5801
+ return useMutation45({
6688
5802
  mutationFn: ({
6689
5803
  method,
6690
5804
  token,
@@ -6703,9 +5817,9 @@ var useSettingsWebRead2fa = () => {
6703
5817
  var use_settings_web_read_2fa_default = useSettingsWebRead2fa;
6704
5818
 
6705
5819
  // src/hooks/view/use-verify-totp.ts
6706
- import { useMutation as useMutation47 } from "@tanstack/react-query";
5820
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
6707
5821
  var useVerifyTotp = () => {
6708
- return useMutation47({
5822
+ return useMutation46({
6709
5823
  mutationFn: ({
6710
5824
  method,
6711
5825
  action_token,
@@ -6721,210 +5835,9 @@ var useVerifyTotp = () => {
6721
5835
  };
6722
5836
  var use_verify_totp_default = useVerifyTotp;
6723
5837
 
6724
- // src/provider/react-query-provider.tsx
6725
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
6726
- import { jsx } from "react/jsx-runtime";
6727
- var ReactQueryProvider = ({ children }) => {
6728
- const queryClient = new QueryClient({
6729
- defaultOptions: {
6730
- queries: {
6731
- // placeholderData: keepPreviousData,
6732
- refetchOnWindowFocus: false,
6733
- refetchOnMount: false,
6734
- refetchOnReconnect: false,
6735
- retry: false
6736
- }
6737
- }
6738
- });
6739
- return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children });
6740
- };
6741
-
6742
- // src/provider/redux-provider.tsx
6743
- import { Provider } from "react-redux";
6744
- import { jsx as jsx2 } from "react/jsx-runtime";
6745
- var ReduxProvider = ({ children }) => {
6746
- return /* @__PURE__ */ jsx2(Provider, { store: envStore, children });
6747
- };
6748
-
6749
- // src/provider/main-provider.tsx
6750
- import { jsx as jsx3 } from "react/jsx-runtime";
6751
- var MainProvider = ({ children }) => {
6752
- return /* @__PURE__ */ jsx3(ReduxProvider, { children: /* @__PURE__ */ jsx3(ReactQueryProvider, { children }) });
6753
- };
6754
-
6755
- // src/provider/version-gate-provider.tsx
6756
- import { useEffect as useEffect2, useState as useState2 } from "react";
6757
- import { useQueryClient } from "@tanstack/react-query";
6758
- import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
6759
- var VersionGate = ({ children }) => {
6760
- const queryClient = useQueryClient();
6761
- const [ready, setReady] = useState2(false);
6762
- useEffect2(() => {
6763
- const clearVersion = () => {
6764
- queryClient.clear();
6765
- localStorage.removeItem("__api_version__");
6766
- };
6767
- const validateVersion = async () => {
6768
- const serverVersion = await view_service_default.getVersion();
6769
- const cached = localStorage.getItem("__api_version__");
6770
- if (cached !== serverVersion?.api_version) {
6771
- clearVersion();
6772
- localStorage.setItem("__api_version__", serverVersion?.api_version);
6773
- } else {
6774
- console.log("Api version:", serverVersion?.api_version);
6775
- }
6776
- setReady(true);
6777
- };
6778
- validateVersion();
6779
- if (typeof window !== "undefined") {
6780
- const onKey = (e) => {
6781
- const key = e.key.toLowerCase();
6782
- const isHardRefresh = (key === "f5" || key === "r") && e.ctrlKey && (key !== "r" || e.shiftKey) || key === "r" && e.metaKey && e.shiftKey || key === "r" && e.metaKey && e.altKey;
6783
- if (isHardRefresh) clearVersion();
6784
- };
6785
- window.addEventListener("keydown", onKey);
6786
- return () => window.removeEventListener("keydown", onKey);
6787
- }
6788
- }, [queryClient]);
6789
- return ready ? /* @__PURE__ */ jsx4(Fragment, { children }) : null;
6790
- };
5838
+ // src/hooks/env.ts
5839
+ import { useState as useState2, useCallback } from "react";
6791
5840
  export {
6792
- action_service_default as ActionService,
6793
- auth_service_default as AuthService,
6794
- company_service_default as CompanyService,
6795
- ComponentType,
6796
- EnvStore,
6797
- excel_service_default as ExcelService,
6798
- FieldTypeConstants,
6799
- form_service_default as FormService,
6800
- kanban_service_default as KanbanService,
6801
- KeyConstants,
6802
- MainProvider,
6803
- MethodConstants,
6804
- MethodType,
6805
- ModelConstants,
6806
- model_service_default as ModelService,
6807
- ReactQueryProvider,
6808
- SearchType,
6809
- UriConstants,
6810
- user_service_default as UserService,
6811
- VersionGate,
6812
- view_service_default as ViewService,
6813
- WIDGETAVATAR,
6814
- WIDGETCOLOR,
6815
- WIDGETCURRENCY,
6816
- WIDGETNOSTRING,
6817
- WIDGETSTATUS,
6818
- WesapError,
6819
- axiosClient,
6820
- breadcrumbsSlice,
6821
- checkIsImageLink,
6822
- clearSearchMap,
6823
- convertFloatToTime,
6824
- convertTimeToFloat,
6825
- copyTextToClipboard,
6826
- domainHelper,
6827
- env,
6828
- envSlice,
6829
- envStore,
6830
- evalJSONContext,
6831
- evalJSONDomain,
6832
- excelSlice,
6833
- filterFieldDirty,
6834
- formSlice,
6835
- formatCurrency,
6836
- formatDate,
6837
- formatFileSize,
6838
- formatSortingString,
6839
- formatUrlPath,
6840
- getEnv,
6841
- getFieldsOnChange,
6842
- getOffSet,
6843
- getSubdomain,
6844
- handleError,
6845
- headerSlice,
6846
- initEnv,
6847
- isBase64File,
6848
- isBase64Image,
6849
- isObjectEmpty,
6850
- listSlice,
6851
- loginSlice,
6852
- mergeObjects,
6853
- navbarSlice,
6854
- profileSlice,
6855
- removeKeyFromSearchMap,
6856
- removeUndefinedFields,
6857
- resequence,
6858
- searchSlice,
6859
- selectBreadCrumbs,
6860
- selectEnv,
6861
- selectExcel,
6862
- selectForm,
6863
- selectHeader,
6864
- selectList,
6865
- selectLogin,
6866
- selectNavbar,
6867
- selectProfile,
6868
- selectSearch,
6869
- selectSearchMap,
6870
- setAllowCompanies,
6871
- setAllowedCompanyIds,
6872
- setBreadCrumbs,
6873
- setCompanies,
6874
- setConfig,
6875
- setDataParse,
6876
- setDataUser,
6877
- setDb,
6878
- setDefaultCompany,
6879
- setDomainTable,
6880
- setEnv,
6881
- setEnvFile,
6882
- setErrorData,
6883
- setFieldTranslate,
6884
- setFields,
6885
- setFilterBy,
6886
- setFirstDomain,
6887
- setForgotPasswordUrl,
6888
- setFormSubmitComponent,
6889
- setGroupBy,
6890
- setGroupByDomain,
6891
- setHeader,
6892
- setHoveredIndexSearchList,
6893
- setIdFile,
6894
- setIndexRowTableModal,
6895
- setIsFileLoaded,
6896
- setIsShowModalTranslate,
6897
- setIsShowingModalDetail,
6898
- setIsUpdateTableModal,
6899
- setLang,
6900
- setListSubject,
6901
- setLoadingImport,
6902
- setMenuFocus,
6903
- setMenuFocusAction,
6904
- setMenuList,
6905
- setNavbarWidth,
6906
- setOrder,
6907
- setPage,
6908
- setPageLimit,
6909
- setProfile,
6910
- setRedirectTo,
6911
- setSearchBy,
6912
- setSearchMap,
6913
- setSearchString,
6914
- setSelectedFile,
6915
- setSelectedRadioKey,
6916
- setSelectedRowKeys,
6917
- setSelectedTags,
6918
- setTransferDetail,
6919
- setUid,
6920
- setUser,
6921
- setViewDataStore,
6922
- stringToColor,
6923
- toQueryString,
6924
- updateSearchMap,
6925
- updateTokenParamInOriginalRequest,
6926
- useAppDispatch,
6927
- useAppSelector,
6928
5841
  use_button_default as useButton,
6929
5842
  use_change_status_default as useChangeStatus,
6930
5843
  use_delete_default as useDelete,
@@ -6932,7 +5845,6 @@ export {
6932
5845
  use_duplicate_record_default as useDuplicateRecord,
6933
5846
  uss_execute_import_default as useExecuteImport,
6934
5847
  use_export_excel_default as useExportExcel,
6935
- useField,
6936
5848
  use_forgot_password_default as useForgotPassword,
6937
5849
  use_forgotpassword_sso_default as useForgotPasswordSSO,
6938
5850
  uset_get_2FA_method_default as useGet2FAMethods,
@@ -6988,14 +5900,10 @@ export {
6988
5900
  use_settings_web_read_2fa_default as useSettingsWebRead2fa,
6989
5901
  use_signin_sso_default as useSignInSSO,
6990
5902
  use_switch_locale_default as useSwitchLocale,
6991
- useTabModel,
6992
5903
  use_update_password_default as useUpdatePassword,
6993
5904
  use_upload_file_default as useUploadFile,
6994
5905
  use_upload_id_file_default as useUploadIdFile,
6995
5906
  use_upload_image_default as useUploadImage,
6996
- use_validate_action_token_default as useValidateActionToken,
6997
5907
  use_verify_2FA_default as useVerify2FA,
6998
- use_verify_totp_default as useVerifyTotp,
6999
- validateAndParseDate
5908
+ use_verify_totp_default as useVerifyTotp
7000
5909
  };
7001
- //# sourceMappingURL=index.mjs.map