@fctc/widget-logic 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -641,8 +641,8 @@ var require_moment = __commonJS({
641
641
  tokens[token2](input, config._a, config, token2);
642
642
  }
643
643
  }
644
- function isLeapYear(year2) {
645
- return year2 % 4 === 0 && year2 % 100 !== 0 || year2 % 400 === 0;
644
+ function isLeapYear(year) {
645
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
646
646
  }
647
647
  var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
648
648
  addFormatToken("Y", 0, 0, function() {
@@ -670,8 +670,8 @@ var require_moment = __commonJS({
670
670
  addParseToken("Y", function(input, array) {
671
671
  array[YEAR] = parseInt(input, 10);
672
672
  });
673
- function daysInYear(year2) {
674
- return isLeapYear(year2) ? 366 : 365;
673
+ function daysInYear(year) {
674
+ return isLeapYear(year) ? 366 : 365;
675
675
  }
676
676
  hooks.parseTwoDigitYear = function(input) {
677
677
  return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
@@ -718,7 +718,7 @@ var require_moment = __commonJS({
718
718
  }
719
719
  }
720
720
  function set$1(mom, unit, value) {
721
- var d, isUTC, year2, month2, date;
721
+ var d, isUTC, year, month, date;
722
722
  if (!mom.isValid() || isNaN(value)) {
723
723
  return;
724
724
  }
@@ -745,11 +745,11 @@ var require_moment = __commonJS({
745
745
  default:
746
746
  return;
747
747
  }
748
- year2 = value;
749
- month2 = mom.month();
748
+ year = value;
749
+ month = mom.month();
750
750
  date = mom.date();
751
- date = date === 29 && month2 === 1 && !isLeapYear(year2) ? 28 : date;
752
- void (isUTC ? d.setUTCFullYear(year2, month2, date) : d.setFullYear(year2, month2, date));
751
+ date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
752
+ void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
753
753
  }
754
754
  function stringGet(units) {
755
755
  units = normalizeUnits(units);
@@ -790,13 +790,13 @@ var require_moment = __commonJS({
790
790
  return -1;
791
791
  };
792
792
  }
793
- function daysInMonth(year2, month2) {
794
- if (isNaN(year2) || isNaN(month2)) {
793
+ function daysInMonth(year, month) {
794
+ if (isNaN(year) || isNaN(month)) {
795
795
  return NaN;
796
796
  }
797
- var modMonth = mod(month2, 12);
798
- year2 += (month2 - modMonth) / 12;
799
- return modMonth === 1 ? isLeapYear(year2) ? 29 : 28 : 31 - modMonth % 7 % 2;
797
+ var modMonth = mod(month, 12);
798
+ year += (month - modMonth) / 12;
799
+ return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
800
800
  }
801
801
  addFormatToken("M", ["MM", 2], "Mo", function() {
802
802
  return this.month() + 1;
@@ -819,9 +819,9 @@ var require_moment = __commonJS({
819
819
  array[MONTH] = toInt(input) - 1;
820
820
  });
821
821
  addParseToken(["MMM", "MMMM"], function(input, array, config, token2) {
822
- var month2 = config._locale.monthsParse(input, token2, config._strict);
823
- if (month2 != null) {
824
- array[MONTH] = month2;
822
+ var month = config._locale.monthsParse(input, token2, config._strict);
823
+ if (month != null) {
824
+ array[MONTH] = month;
825
825
  } else {
826
826
  getParsingFlags(config).invalidMonth = input;
827
827
  }
@@ -931,9 +931,9 @@ var require_moment = __commonJS({
931
931
  }
932
932
  }
933
933
  }
934
- var month2 = value, date = mom.date();
935
- date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month2));
936
- void (mom._isUTC ? mom._d.setUTCMonth(month2, date) : mom._d.setMonth(month2, date));
934
+ var month = value, date = mom.date();
935
+ date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
936
+ void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
937
937
  return mom;
938
938
  }
939
939
  function getSetMonth(value) {
@@ -1036,20 +1036,20 @@ var require_moment = __commonJS({
1036
1036
  }
1037
1037
  return date;
1038
1038
  }
1039
- function firstWeekOffset(year2, dow, doy) {
1040
- var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year2, 0, fwd).getUTCDay() - dow) % 7;
1039
+ function firstWeekOffset(year, dow, doy) {
1040
+ var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
1041
1041
  return -fwdlw + fwd - 1;
1042
1042
  }
1043
- function dayOfYearFromWeeks(year2, week, weekday, dow, doy) {
1044
- var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year2, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
1043
+ function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
1044
+ var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
1045
1045
  if (dayOfYear <= 0) {
1046
- resYear = year2 - 1;
1046
+ resYear = year - 1;
1047
1047
  resDayOfYear = daysInYear(resYear) + dayOfYear;
1048
- } else if (dayOfYear > daysInYear(year2)) {
1049
- resYear = year2 + 1;
1050
- resDayOfYear = dayOfYear - daysInYear(year2);
1048
+ } else if (dayOfYear > daysInYear(year)) {
1049
+ resYear = year + 1;
1050
+ resDayOfYear = dayOfYear - daysInYear(year);
1051
1051
  } else {
1052
- resYear = year2;
1052
+ resYear = year;
1053
1053
  resDayOfYear = dayOfYear;
1054
1054
  }
1055
1055
  return {
@@ -1074,9 +1074,9 @@ var require_moment = __commonJS({
1074
1074
  year: resYear
1075
1075
  };
1076
1076
  }
1077
- function weeksInYear(year2, dow, doy) {
1078
- var weekOffset = firstWeekOffset(year2, dow, doy), weekOffsetNext = firstWeekOffset(year2 + 1, dow, doy);
1079
- return (daysInYear(year2) - weekOffset + weekOffsetNext) / 7;
1077
+ function weeksInYear(year, dow, doy) {
1078
+ var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
1079
+ return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
1080
1080
  }
1081
1081
  addFormatToken("w", ["ww", 2], "wo", "week");
1082
1082
  addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
@@ -1294,12 +1294,12 @@ var require_moment = __commonJS({
1294
1294
  if (!this.isValid()) {
1295
1295
  return input != null ? this : NaN;
1296
1296
  }
1297
- var day2 = get(this, "Day");
1297
+ var day = get(this, "Day");
1298
1298
  if (input != null) {
1299
1299
  input = parseWeekday(input, this.localeData());
1300
- return this.add(input - day2, "d");
1300
+ return this.add(input - day, "d");
1301
1301
  } else {
1302
- return day2;
1302
+ return day;
1303
1303
  }
1304
1304
  }
1305
1305
  function getSetLocaleDayOfWeek(input) {
@@ -1796,13 +1796,13 @@ var require_moment = __commonJS({
1796
1796
  return result;
1797
1797
  }
1798
1798
  function untruncateYear(yearStr) {
1799
- var year2 = parseInt(yearStr, 10);
1800
- if (year2 <= 49) {
1801
- return 2e3 + year2;
1802
- } else if (year2 <= 999) {
1803
- return 1900 + year2;
1799
+ var year = parseInt(yearStr, 10);
1800
+ if (year <= 49) {
1801
+ return 2e3 + year;
1802
+ } else if (year <= 999) {
1803
+ return 1900 + year;
1804
1804
  }
1805
- return year2;
1805
+ return year;
1806
1806
  }
1807
1807
  function preprocessRFC2822(s) {
1808
1808
  return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
@@ -2836,16 +2836,16 @@ var require_moment = __commonJS({
2836
2836
  if (!this.isValid()) {
2837
2837
  return "moment.invalid(/* " + this._i + " */)";
2838
2838
  }
2839
- var func = "moment", zone = "", prefix, year2, datetime, suffix;
2839
+ var func = "moment", zone = "", prefix, year, datetime, suffix;
2840
2840
  if (!this.isLocal()) {
2841
2841
  func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone";
2842
2842
  zone = "Z";
2843
2843
  }
2844
2844
  prefix = "[" + func + '("]';
2845
- year2 = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
2845
+ year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY";
2846
2846
  datetime = "-MM-DD[T]HH:mm:ss.SSS";
2847
2847
  suffix = zone + '[")]';
2848
- return this.format(prefix + year2 + datetime + suffix);
2848
+ return this.format(prefix + year + datetime + suffix);
2849
2849
  }
2850
2850
  function format(inputString) {
2851
2851
  if (!inputString) {
@@ -3184,12 +3184,12 @@ var require_moment = __commonJS({
3184
3184
  }
3185
3185
  }
3186
3186
  }
3187
- function localeErasConvertYear(era, year2) {
3187
+ function localeErasConvertYear(era, year) {
3188
3188
  var dir = era.since <= era.until ? 1 : -1;
3189
- if (year2 === void 0) {
3189
+ if (year === void 0) {
3190
3190
  return hooks(era.since).year();
3191
3191
  } else {
3192
- return hooks(era.since).year() + (year2 - era.offset) * dir;
3192
+ return hooks(era.since).year() + (year - era.offset) * dir;
3193
3193
  }
3194
3194
  }
3195
3195
  function getEraName() {
@@ -4646,8 +4646,129 @@ var useAuth = () => {
4646
4646
  };
4647
4647
  };
4648
4648
 
4649
+ // src/hooks/core/use-app-provider.tsx
4650
+ import { createContext, useContext, useMemo as useMemo7 } from "react";
4651
+
4652
+ // src/hooks/core/use-company.ts
4653
+ import {
4654
+ getEnv as getEnv4,
4655
+ useGetCompanyInfo,
4656
+ useGetCurrentCompany
4657
+ } from "@fctc/interface-logic";
4658
+ import { useQuery as useQuery3 } from "@tanstack/react-query";
4659
+ import { useEffect as useEffect6, useMemo as useMemo6 } from "react";
4660
+ var useCompany = (accessToken) => {
4661
+ const getCurrentCompany = useGetCurrentCompany();
4662
+ const fetchCurrentCompany = async () => {
4663
+ return await getCurrentCompany.mutateAsync();
4664
+ };
4665
+ const currentCompany = useQuery3({
4666
+ queryKey: ["currentCompany", accessToken],
4667
+ queryFn: fetchCurrentCompany,
4668
+ enabled: !!accessToken
4669
+ });
4670
+ const current_company_id = useMemo6(() => {
4671
+ return currentCompany.data?.current_company_id;
4672
+ }, [currentCompany.data]);
4673
+ useEffect6(() => {
4674
+ if (current_company_id) {
4675
+ const companyIDs = [current_company_id];
4676
+ const env = getEnv4();
4677
+ env.setAllowCompanies([...companyIDs]);
4678
+ env.setCompanies(companyIDs);
4679
+ }
4680
+ }, [current_company_id]);
4681
+ const getCompanyInfo = useGetCompanyInfo();
4682
+ const companyInfo = useQuery3({
4683
+ queryKey: ["companyInfoQuery", current_company_id, accessToken],
4684
+ queryFn: () => getCompanyInfo.mutateAsync(Number(current_company_id)),
4685
+ enabled: !!current_company_id && !!accessToken
4686
+ });
4687
+ useEffect6(() => {
4688
+ if (companyInfo.data) {
4689
+ const companyInfoData = companyInfo.data;
4690
+ if (companyInfoData?.length) {
4691
+ const env = getEnv4();
4692
+ env.setDefaultCompany(companyInfoData[0]);
4693
+ }
4694
+ }
4695
+ }, [companyInfo.data]);
4696
+ return {
4697
+ currentCompany,
4698
+ companyInfo,
4699
+ context: { allowed_company_ids: [current_company_id] }
4700
+ };
4701
+ };
4702
+ var use_company_default = useCompany;
4703
+
4704
+ // src/hooks/core/use-app-provider.tsx
4705
+ import { evalJSONContext } from "@fctc/interface-logic";
4706
+ import { jsx } from "react/jsx-runtime";
4707
+ var AppProviderInitialValue = {
4708
+ config: {},
4709
+ user: {},
4710
+ auth: {},
4711
+ company: {},
4712
+ action: {},
4713
+ menu: {},
4714
+ view: {},
4715
+ list: {}
4716
+ };
4717
+ var ReactContext = createContext(AppProviderInitialValue);
4718
+ var AppProvider = ({ children }) => {
4719
+ const config = useConfig({});
4720
+ const auth = useAuth();
4721
+ const user = useUser(auth.accessToken);
4722
+ const company = use_company_default(auth.accessToken);
4723
+ const menuContext = useMemo7(() => {
4724
+ return combineContexts([user.context, company.context]);
4725
+ }, [user.context, company.context]);
4726
+ const menu = useMenu({ context: menuContext });
4727
+ const action = useMemo7(() => {
4728
+ return menu.state.action;
4729
+ }, [menu.state.action]);
4730
+ const viewContext = useMemo7(() => {
4731
+ return combineContexts([
4732
+ menuContext,
4733
+ { ...evalJSONContext(action?.result?.context) }
4734
+ ]);
4735
+ }, [menuContext, action?.result?.context]);
4736
+ const view = useViewV2({
4737
+ action,
4738
+ context: viewContext
4739
+ });
4740
+ const list = useListData({
4741
+ action,
4742
+ viewResponse: view.data,
4743
+ context: viewContext
4744
+ });
4745
+ return /* @__PURE__ */ jsx(
4746
+ ReactContext.Provider,
4747
+ {
4748
+ value: {
4749
+ config,
4750
+ auth,
4751
+ user,
4752
+ company,
4753
+ menu,
4754
+ list,
4755
+ action,
4756
+ view
4757
+ },
4758
+ children
4759
+ }
4760
+ );
4761
+ };
4762
+ var useAppProvider = () => {
4763
+ const context = useContext(ReactContext);
4764
+ if (!context) {
4765
+ return AppProviderInitialValue;
4766
+ }
4767
+ return context;
4768
+ };
4769
+
4649
4770
  // src/hooks/utils/use-click-outside.ts
4650
- import { useEffect as useEffect6, useRef as useRef2 } from "react";
4771
+ import { useEffect as useEffect7, useRef as useRef2 } from "react";
4651
4772
  var DEFAULT_EVENTS = ["mousedown", "touchstart"];
4652
4773
  var useClickOutside = ({
4653
4774
  handler,
@@ -4656,7 +4777,7 @@ var useClickOutside = ({
4656
4777
  refs
4657
4778
  }) => {
4658
4779
  const ref = useRef2(null);
4659
- useEffect6(() => {
4780
+ useEffect7(() => {
4660
4781
  const listener = (event) => {
4661
4782
  const { target } = event;
4662
4783
  if (refs && refs?.length > 0 && refs?.some((r) => r.current?.contains(target))) {
@@ -4678,10 +4799,10 @@ var useClickOutside = ({
4678
4799
  };
4679
4800
 
4680
4801
  // src/hooks/utils/use-debounce.ts
4681
- import { useEffect as useEffect7, useState as useState5 } from "react";
4802
+ import { useEffect as useEffect8, useState as useState5 } from "react";
4682
4803
  function useDebounce(value, delay) {
4683
4804
  const [debouncedValue, setDebouncedValue] = useState5(value);
4684
- useEffect7(() => {
4805
+ useEffect8(() => {
4685
4806
  const handler = setTimeout(() => {
4686
4807
  setDebouncedValue(value);
4687
4808
  }, delay);
@@ -4692,8 +4813,136 @@ function useDebounce(value, delay) {
4692
4813
  return [debouncedValue];
4693
4814
  }
4694
4815
 
4816
+ // src/hooks/api/use-switch-locale.ts
4817
+ import {
4818
+ getEnv as getEnv5,
4819
+ selectEnv,
4820
+ useAppSelector as useAppSelector2,
4821
+ useSwitchLocale
4822
+ } from "@fctc/interface-logic";
4823
+ import { useCallback as useCallback2 } from "react";
4824
+ var useSwitchLocaleHandler = () => {
4825
+ const switchUserLocale = useSwitchLocale();
4826
+ const env = getEnv5();
4827
+ const { context } = useAppSelector2(selectEnv);
4828
+ const switchLocale = useCallback2(
4829
+ async (langId) => {
4830
+ if (!langId) return;
4831
+ await switchUserLocale.mutateAsync({
4832
+ data: {
4833
+ id: parseInt(context?.uid),
4834
+ values: { lang: langId }
4835
+ }
4836
+ });
4837
+ env.setLang(langId);
4838
+ },
4839
+ [switchUserLocale]
4840
+ );
4841
+ return {
4842
+ switchLocale,
4843
+ isLoading: switchUserLocale.isPending,
4844
+ error: switchUserLocale.error
4845
+ };
4846
+ };
4847
+
4848
+ // src/hooks/api/use-login.ts
4849
+ import { useLoginCredential as useLoginCredential2 } from "@fctc/interface-logic";
4850
+ import { useCallback as useCallback3 } from "react";
4851
+ var useLoginHandler = () => {
4852
+ const loginMutate = useLoginCredential2();
4853
+ const login = useCallback3(
4854
+ ({
4855
+ email,
4856
+ password,
4857
+ path
4858
+ }, {
4859
+ onSuccess,
4860
+ onError
4861
+ }) => {
4862
+ loginMutate.mutate(
4863
+ {
4864
+ email,
4865
+ password,
4866
+ path
4867
+ },
4868
+ {
4869
+ onSuccess,
4870
+ onError
4871
+ }
4872
+ );
4873
+ },
4874
+ [loginMutate]
4875
+ );
4876
+ return {
4877
+ login,
4878
+ isLoading: loginMutate.isPending,
4879
+ error: loginMutate.error
4880
+ };
4881
+ };
4882
+
4883
+ // src/hooks/api/use-forgot-password.ts
4884
+ import { useForgotPassword } from "@fctc/interface-logic";
4885
+ import { useCallback as useCallback4 } from "react";
4886
+ var useForgotPasswordHandler = () => {
4887
+ const forgotPasswordMutate = useForgotPassword();
4888
+ const sendForgotPassword = useCallback4(
4889
+ (email, {
4890
+ onSuccess,
4891
+ onError
4892
+ } = {}) => {
4893
+ forgotPasswordMutate.mutate(email, {
4894
+ onSuccess,
4895
+ onError
4896
+ });
4897
+ },
4898
+ [forgotPasswordMutate]
4899
+ );
4900
+ return {
4901
+ sendForgotPassword,
4902
+ isLoading: forgotPasswordMutate.isPending,
4903
+ error: forgotPasswordMutate.error
4904
+ };
4905
+ };
4906
+
4907
+ // src/hooks/api/use-reset-password.ts
4908
+ import { useResetPassword } from "@fctc/interface-logic";
4909
+ import { useCallback as useCallback5 } from "react";
4910
+ var useResetPasswordHandler = () => {
4911
+ const resetPasswordMutate = useResetPassword();
4912
+ const resetPassword = useCallback5(
4913
+ ({
4914
+ password,
4915
+ confirmPassword,
4916
+ token
4917
+ }, {
4918
+ onSuccess,
4919
+ onError
4920
+ }) => {
4921
+ resetPasswordMutate.mutate(
4922
+ {
4923
+ data: {
4924
+ password,
4925
+ confirmPassword
4926
+ },
4927
+ token
4928
+ },
4929
+ {
4930
+ onSuccess,
4931
+ onError
4932
+ }
4933
+ );
4934
+ },
4935
+ [resetPasswordMutate]
4936
+ );
4937
+ return {
4938
+ resetPassword,
4939
+ isLoading: resetPasswordMutate.isPending,
4940
+ error: resetPasswordMutate.error
4941
+ };
4942
+ };
4943
+
4695
4944
  // src/icons/eye-icon.tsx
4696
- import { jsx, jsxs } from "react/jsx-runtime";
4945
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
4697
4946
  var EyeIcon = () => /* @__PURE__ */ jsxs(
4698
4947
  "svg",
4699
4948
  {
@@ -4703,7 +4952,7 @@ var EyeIcon = () => /* @__PURE__ */ jsxs(
4703
4952
  fill: "none",
4704
4953
  xmlns: "http://www.w3.org/2000/svg",
4705
4954
  children: [
4706
- /* @__PURE__ */ jsx(
4955
+ /* @__PURE__ */ jsx2(
4707
4956
  "path",
4708
4957
  {
4709
4958
  d: "M2.72904 13.5776C2.02076 12.6574 1.66663 12.1974 1.66663 10.8312C1.66663 9.46507 2.02076 9.00499 2.72904 8.08483C4.14326 6.24752 6.51505 4.16455 9.99996 4.16455C13.4849 4.16455 15.8567 6.24752 17.2709 8.08483C17.9792 9.00499 18.3333 9.46507 18.3333 10.8312C18.3333 12.1974 17.9792 12.6574 17.2709 13.5776C15.8567 15.4149 13.4849 17.4979 9.99996 17.4979C6.51505 17.4979 4.14326 15.4149 2.72904 13.5776Z",
@@ -4711,7 +4960,7 @@ var EyeIcon = () => /* @__PURE__ */ jsxs(
4711
4960
  strokeWidth: "1.5"
4712
4961
  }
4713
4962
  ),
4714
- /* @__PURE__ */ jsx(
4963
+ /* @__PURE__ */ jsx2(
4715
4964
  "path",
4716
4965
  {
4717
4966
  d: "M12.5 10.8311C12.5 12.2118 11.3807 13.3311 10 13.3311C8.61929 13.3311 7.5 12.2118 7.5 10.8311C7.5 9.45034 8.61929 8.33105 10 8.33105C11.3807 8.33105 12.5 9.45034 12.5 10.8311Z",
@@ -4724,13 +4973,13 @@ var EyeIcon = () => /* @__PURE__ */ jsxs(
4724
4973
  );
4725
4974
 
4726
4975
  // src/icons/loading-icon.tsx
4727
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
4976
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
4728
4977
  var LoadingIcon = ({
4729
4978
  width = 15,
4730
4979
  height = 15,
4731
4980
  ...props
4732
4981
  }) => {
4733
- return /* @__PURE__ */ jsx2(
4982
+ return /* @__PURE__ */ jsx3(
4734
4983
  "svg",
4735
4984
  {
4736
4985
  xmlns: "http://www.w3.org/2000/svg",
@@ -4746,7 +4995,7 @@ var LoadingIcon = ({
4746
4995
  },
4747
4996
  ...props,
4748
4997
  children: /* @__PURE__ */ jsxs2("g", { children: [
4749
- /* @__PURE__ */ jsx2(
4998
+ /* @__PURE__ */ jsx3(
4750
4999
  "circle",
4751
5000
  {
4752
5001
  strokeDasharray: "141.37166941154067 49.12388980384689",
@@ -4756,7 +5005,7 @@ var LoadingIcon = ({
4756
5005
  fill: "none",
4757
5006
  cy: "50",
4758
5007
  cx: "50",
4759
- children: /* @__PURE__ */ jsx2(
5008
+ children: /* @__PURE__ */ jsx3(
4760
5009
  "animateTransform",
4761
5010
  {
4762
5011
  keyTimes: "0;1",
@@ -4769,16 +5018,16 @@ var LoadingIcon = ({
4769
5018
  )
4770
5019
  }
4771
5020
  ),
4772
- /* @__PURE__ */ jsx2("g", {})
5021
+ /* @__PURE__ */ jsx3("g", {})
4773
5022
  ] })
4774
5023
  }
4775
5024
  );
4776
5025
  };
4777
5026
 
4778
5027
  // src/icons/close-icon.tsx
4779
- import { jsx as jsx3 } from "react/jsx-runtime";
5028
+ import { jsx as jsx4 } from "react/jsx-runtime";
4780
5029
  var CloseIcon = ({ className = "" }) => {
4781
- return /* @__PURE__ */ jsx3(
5030
+ return /* @__PURE__ */ jsx4(
4782
5031
  "svg",
4783
5032
  {
4784
5033
  width: "24",
@@ -4787,7 +5036,7 @@ var CloseIcon = ({ className = "" }) => {
4787
5036
  fill: "none",
4788
5037
  xmlns: "http://www.w3.org/2000/svg",
4789
5038
  className,
4790
- children: /* @__PURE__ */ jsx3(
5039
+ children: /* @__PURE__ */ jsx4(
4791
5040
  "path",
4792
5041
  {
4793
5042
  d: "M12.0001 10.7275L16.4551 6.27246L17.7277 7.54506L13.2727 12.0001L17.7277 16.4551L16.4551 17.7277L12.0001 13.2727L7.54506 17.7277L6.27246 16.4551L10.7275 12.0001L6.27246 7.54506L7.54506 6.27246L12.0001 10.7275Z",
@@ -4799,11 +5048,11 @@ var CloseIcon = ({ className = "" }) => {
4799
5048
  };
4800
5049
 
4801
5050
  // src/widget/basic/status-dropdown-field/controller.ts
4802
- import { useEffect as useEffect8, useRef as useRef3, useState as useState6 } from "react";
4803
- import { getEnv as getEnv4, useSave } from "@fctc/interface-logic";
5051
+ import { useEffect as useEffect9, useRef as useRef3, useState as useState6 } from "react";
5052
+ import { getEnv as getEnv6, useSave } from "@fctc/interface-logic";
4804
5053
  var statusDropdownController = (props) => {
4805
5054
  const { selection, isForm, id, model, name, state, onRefetch } = props;
4806
- const env = getEnv4();
5055
+ const env = getEnv6();
4807
5056
  const colors = {
4808
5057
  normal: "bg-[#e9ecef]",
4809
5058
  done: "bg-primary",
@@ -4811,7 +5060,7 @@ var statusDropdownController = (props) => {
4811
5060
  };
4812
5061
  const [isOpen, setIsOpen] = useState6(false);
4813
5062
  const buttonRef = useRef3(null);
4814
- useEffect8(() => {
5063
+ useEffect9(() => {
4815
5064
  const handleClickOutside = (event) => {
4816
5065
  if (buttonRef.current && !buttonRef.current.contains(event.target)) {
4817
5066
  setIsOpen(false);
@@ -4852,14 +5101,14 @@ var statusDropdownController = (props) => {
4852
5101
  };
4853
5102
 
4854
5103
  // src/widget/basic/many2one-field/controller.ts
4855
- import { useCallback as useCallback2, useEffect as useEffect9, useMemo as useMemo6, useState as useState7 } from "react";
5104
+ import { useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo8, useState as useState7 } from "react";
4856
5105
  import {
4857
- evalJSONContext,
5106
+ evalJSONContext as evalJSONContext2,
4858
5107
  evalJSONDomain as evalJSONDomain2,
4859
- selectEnv,
5108
+ selectEnv as selectEnv2,
4860
5109
  selectNavbar,
4861
5110
  setListSubject,
4862
- useAppSelector as useAppSelector2,
5111
+ useAppSelector as useAppSelector3,
4863
5112
  useGetSelection
4864
5113
  } from "@fctc/interface-logic";
4865
5114
  var many2oneFieldController = (props) => {
@@ -4879,21 +5128,21 @@ var many2oneFieldController = (props) => {
4879
5128
  const [options, setOptions] = useState7([]);
4880
5129
  const [isShowModalMany2Many, setIsShowModalMany2Many] = useState7(false);
4881
5130
  const [tempSelectedOption, setTempSelectedOption] = useState7(null);
4882
- const { menuList } = useAppSelector2(selectNavbar);
4883
- const { context } = useAppSelector2(selectEnv);
5131
+ const { menuList } = useAppSelector3(selectNavbar);
5132
+ const { context } = useAppSelector3(selectEnv2);
4884
5133
  const [domainModal, setDomainModal] = useState7(null);
4885
5134
  const initValue = methods?.getValues(name);
4886
- const domainObject = useMemo6(
5135
+ const domainObject = useMemo8(
4887
5136
  () => evalJSONDomain2(domain, JSON.parse(JSON.stringify(formValues)) ?? {}),
4888
5137
  [domain, formValues]
4889
5138
  );
4890
- const optionsObject = evalJSONContext(fieldOptions) || {};
5139
+ const optionsObject = evalJSONContext2(fieldOptions) || {};
4891
5140
  const contextObject = {
4892
- ...evalJSONContext(actionData?.context) || {},
5141
+ ...evalJSONContext2(actionData?.context) || {},
4893
5142
  ...fieldContext,
4894
5143
  ...context
4895
5144
  };
4896
- const actionId = useMemo6(
5145
+ const actionId = useMemo8(
4897
5146
  () => menuList?.flatMap(
4898
5147
  (item) => item?.child_id.filter(
4899
5148
  (childItem) => childItem?.is_display && childItem?.action?.res_model === relation
@@ -4914,25 +5163,25 @@ var many2oneFieldController = (props) => {
4914
5163
  const queryKey = [`data_${relation}`, domainObject];
4915
5164
  const {
4916
5165
  data: dataOfSelection,
4917
- // refetch,
5166
+ refetch,
4918
5167
  isFetching
4919
5168
  } = useGetSelection({
4920
5169
  data,
4921
5170
  queryKey,
4922
5171
  enabled: false
4923
5172
  });
4924
- const selectOptions = useMemo6(() => {
5173
+ const selectOptions = useMemo8(() => {
4925
5174
  return dataOfSelection?.records?.map((val) => ({
4926
5175
  value: val?.id,
4927
5176
  label: val?.display_name || val?.name
4928
5177
  })) || [];
4929
5178
  }, [dataOfSelection]);
4930
- useEffect9(() => {
5179
+ useEffect10(() => {
4931
5180
  setOptions(selectOptions);
4932
5181
  setDomainModal(domainObject);
4933
5182
  if (relation === "student.subject") setListSubject(selectOptions);
4934
5183
  }, [selectOptions]);
4935
- useEffect9(() => {
5184
+ useEffect10(() => {
4936
5185
  if (!propValue && tempSelectedOption) {
4937
5186
  methods.setValue(name, null);
4938
5187
  setTempSelectedOption(null);
@@ -4943,12 +5192,15 @@ var many2oneFieldController = (props) => {
4943
5192
  });
4944
5193
  }
4945
5194
  }, [propValue]);
4946
- useEffect9(() => {
5195
+ const fetchMoreOptions = useCallback6(() => {
5196
+ refetch();
5197
+ }, [refetch]);
5198
+ useEffect10(() => {
4947
5199
  if (actionId) {
4948
5200
  localStorage.setItem("aid", actionId);
4949
5201
  }
4950
5202
  }, [actionId]);
4951
- const handleChooseRecord = useCallback2(
5203
+ const handleChooseRecord = useCallback6(
4952
5204
  (idRecord) => {
4953
5205
  const newOption = options.find(
4954
5206
  (option) => option.value === idRecord
@@ -4973,8 +5225,8 @@ var many2oneFieldController = (props) => {
4973
5225
  },
4974
5226
  [options, methods, name, onChange]
4975
5227
  );
4976
- const handleClose = useCallback2(() => setIsShowModalMany2Many(false), []);
4977
- const handleSelectChange = useCallback2(
5228
+ const handleClose = useCallback6(() => setIsShowModalMany2Many(false), []);
5229
+ const handleSelectChange = useCallback6(
4978
5230
  (selectedOption) => {
4979
5231
  if (!selectedOption) {
4980
5232
  methods.setValue(name, null, { shouldDirty: true });
@@ -5008,13 +5260,13 @@ var many2oneFieldController = (props) => {
5008
5260
  isFetching,
5009
5261
  isShowModalMany2Many,
5010
5262
  options,
5011
- // fetchMoreOptions,
5263
+ fetchMoreOptions,
5012
5264
  domainModal,
5013
5265
  tempSelectedOption,
5014
5266
  setTempSelectedOption,
5015
5267
  setDomainModal,
5016
5268
  dataOfSelection,
5017
- // refetch,
5269
+ refetch,
5018
5270
  selectOptions,
5019
5271
  optionsObject,
5020
5272
  contextObject,
@@ -5025,22 +5277,22 @@ var many2oneFieldController = (props) => {
5025
5277
 
5026
5278
  // src/widget/basic/many2one-button-field/controller.ts
5027
5279
  import {
5028
- evalJSONContext as evalJSONContext2,
5280
+ evalJSONContext as evalJSONContext3,
5029
5281
  evalJSONDomain as evalJSONDomain3,
5030
- getEnv as getEnv5,
5282
+ getEnv as getEnv7,
5031
5283
  useGetSelection as useGetSelection2
5032
5284
  } from "@fctc/interface-logic";
5033
5285
  var many2oneButtonController = (props) => {
5034
5286
  const { domain, methods, relation } = props;
5035
5287
  const actionDataString = sessionStorage.getItem("actionData");
5036
- const env = getEnv5();
5288
+ const env = getEnv7();
5037
5289
  const domainObject = evalJSONDomain3(domain, methods?.getValues() || {});
5038
5290
  const actionData = actionDataString && actionDataString !== "undefined" ? JSON.parse(actionDataString) : {};
5039
5291
  const { data: dataOfSelection } = useGetSelection2({
5040
5292
  data: {
5041
5293
  model: relation ?? "",
5042
5294
  domain: domainObject,
5043
- context: { ...env.context, ...evalJSONContext2(actionData?.context) }
5295
+ context: { ...env.context, ...evalJSONContext3(actionData?.context) }
5044
5296
  },
5045
5297
  queryKey: [`data_${relation}`, domainObject]
5046
5298
  });
@@ -5054,44 +5306,32 @@ var many2oneButtonController = (props) => {
5054
5306
  };
5055
5307
 
5056
5308
  // src/widget/basic/many2many-field/controller.ts
5057
- import { useEffect as useEffect13, useMemo as useMemo10, useState as useState10 } from "react";
5309
+ import { useEffect as useEffect12, useMemo as useMemo10, useState as useState9 } from "react";
5058
5310
  import {
5059
- evalJSONContext as evalJSONContext3,
5311
+ evalJSONContext as evalJSONContext4,
5060
5312
  formatSortingString as formatSortingString2,
5061
- getEnv as getEnv7,
5062
- selectSearch as selectSearch5,
5313
+ getEnv as getEnv8,
5314
+ selectSearch as selectSearch3,
5063
5315
  setFirstDomain,
5064
5316
  setGroupByDomain,
5065
5317
  setPage,
5066
5318
  setViewDataStore,
5067
- useAppDispatch as useAppDispatch8,
5068
- useAppSelector as useAppSelector6,
5319
+ useAppDispatch as useAppDispatch5,
5320
+ useAppSelector as useAppSelector5,
5069
5321
  useGetFormView,
5070
- useGetListData as useGetListData3,
5322
+ useGetListData as useGetListData2,
5071
5323
  useGetView as useGetView2,
5072
5324
  useModel as useModel2
5073
5325
  } from "@fctc/interface-logic";
5074
5326
 
5075
- // src/widget/advance/table/table-body/controller.ts
5076
- import { setSelectedRowKeys, useAppDispatch as useAppDispatch5 } from "@fctc/interface-logic";
5077
- import { useEffect as useEffect10, useMemo as useMemo7 } from "react";
5078
-
5079
- // src/widget/advance/table/table-head/controller.ts
5080
- import {
5081
- selectSearch as selectSearch2,
5082
- setSelectedRowKeys as setSelectedRowKeys2,
5083
- useAppDispatch as useAppDispatch6,
5084
- useAppSelector as useAppSelector3
5085
- } from "@fctc/interface-logic";
5086
-
5087
5327
  // src/widget/advance/table/table-view/controller.ts
5088
5328
  import {
5089
5329
  domainHelper,
5090
5330
  selectList as selectList2,
5091
- selectSearch as selectSearch3,
5331
+ selectSearch as selectSearch2,
5092
5332
  useAppSelector as useAppSelector4
5093
5333
  } from "@fctc/interface-logic";
5094
- import { useEffect as useEffect11, useMemo as useMemo8, useRef as useRef4, useState as useState8 } from "react";
5334
+ import { useEffect as useEffect11, useMemo as useMemo9, useRef as useRef4, useState as useState8 } from "react";
5095
5335
  var tableController = ({ data }) => {
5096
5336
  const [rows, setRows] = useState8(data.records || []);
5097
5337
  const [columns, setColumns] = useState8([]);
@@ -5167,41 +5407,6 @@ var tableController = ({ data }) => {
5167
5407
  };
5168
5408
  };
5169
5409
 
5170
- // src/widget/advance/table/table-group/controller.ts
5171
- import {
5172
- getEnv as getEnv6,
5173
- selectList as selectList3,
5174
- selectSearch as selectSearch4,
5175
- setSelectedRowKeys as setSelectedRowKeys3,
5176
- useAppDispatch as useAppDispatch7,
5177
- useAppSelector as useAppSelector5,
5178
- useGetListData as useGetListData2,
5179
- useOdooDataTransform
5180
- } from "@fctc/interface-logic";
5181
- import { useEffect as useEffect12, useMemo as useMemo9, useState as useState9 } from "react";
5182
-
5183
- // src/utils/i18n.ts
5184
- import { initReactI18next } from "react-i18next";
5185
- import i18n from "i18next";
5186
- import LanguageDetector from "i18next-browser-languagedetector";
5187
- i18n.use(LanguageDetector).use(initReactI18next).init({
5188
- resources: {
5189
- vi: { translation: vi },
5190
- en: { translation: en }
5191
- },
5192
- fallbackLng: "vi",
5193
- lng: "vi_VN",
5194
- debug: false,
5195
- nonExplicitSupportedLngs: true,
5196
- interpolation: {
5197
- escapeValue: false
5198
- },
5199
- detection: {
5200
- caches: ["cookie"]
5201
- }
5202
- });
5203
- var i18n_default = i18n;
5204
-
5205
5410
  // src/widget/basic/many2many-field/controller.ts
5206
5411
  var many2manyFieldController = (props) => {
5207
5412
  const {
@@ -5211,7 +5416,7 @@ var many2manyFieldController = (props) => {
5211
5416
  tab,
5212
5417
  model,
5213
5418
  aid,
5214
- setSelectedRowKeys: setSelectedRowKeys4,
5419
+ setSelectedRowKeys,
5215
5420
  fields,
5216
5421
  setFields,
5217
5422
  groupByDomain,
@@ -5219,14 +5424,14 @@ var many2manyFieldController = (props) => {
5219
5424
  options,
5220
5425
  sessionStorageUtils
5221
5426
  } = props;
5222
- const appDispatch = useAppDispatch8();
5427
+ const appDispatch = useAppDispatch5();
5223
5428
  const actionData = sessionStorageUtils.getActionData();
5224
5429
  const [debouncedPage] = useDebounce(page, 500);
5225
- const [order, setOrder] = useState10();
5226
- const [isLoadedData, setIsLoadedData] = useState10(false);
5227
- const [domainMany2Many, setDomainMany2Many] = useState10(domain);
5228
- const env = getEnv7();
5229
- const { selectedTags } = useAppSelector6(selectSearch5);
5430
+ const [order, setOrder] = useState9();
5431
+ const [isLoadedData, setIsLoadedData] = useState9(false);
5432
+ const [domainMany2Many, setDomainMany2Many] = useState9(domain);
5433
+ const env = getEnv8();
5434
+ const { selectedTags } = useAppSelector5(selectSearch3);
5230
5435
  const viewParams = {
5231
5436
  model: relation,
5232
5437
  views: [
@@ -5265,7 +5470,7 @@ var many2manyFieldController = (props) => {
5265
5470
  return null;
5266
5471
  }, [modelInstance]);
5267
5472
  const default_order = viewResponse && viewResponse?.views?.list?.default_order;
5268
- const optionsObject = tab?.options ? evalJSONContext3(tab?.options) : (options ? evalJSONContext3(options) : {}) || {};
5473
+ const optionsObject = tab?.options ? evalJSONContext4(tab?.options) : (options ? evalJSONContext4(options) : {}) || {};
5269
5474
  const fetchData = async () => {
5270
5475
  try {
5271
5476
  setDomainMany2Many(domain);
@@ -5311,8 +5516,8 @@ var many2manyFieldController = (props) => {
5311
5516
  isLoading: isDataLoading,
5312
5517
  isFetched: isDataResponseFetched,
5313
5518
  isPlaceholderData
5314
- } = useGetListData3(data, queryKey, enabled);
5315
- useEffect13(() => {
5519
+ } = useGetListData2(data, queryKey, enabled);
5520
+ useEffect12(() => {
5316
5521
  if (viewResponse) {
5317
5522
  fetchData();
5318
5523
  }
@@ -5323,7 +5528,7 @@ var many2manyFieldController = (props) => {
5323
5528
  [`${aid}_${relation}_popupmany2many`]: null
5324
5529
  }));
5325
5530
  appDispatch(setPage(0));
5326
- setSelectedRowKeys4([]);
5531
+ setSelectedRowKeys([]);
5327
5532
  setDomainMany2Many(null);
5328
5533
  setIsLoadedData(false);
5329
5534
  };
@@ -5351,13 +5556,13 @@ var many2manyFieldController = (props) => {
5351
5556
  queryKey: [`form-view-action-${relation}`],
5352
5557
  enabled: false
5353
5558
  });
5354
- useEffect13(() => {
5559
+ useEffect12(() => {
5355
5560
  if (isSuccess && dataFormViewResponse) {
5356
5561
  sessionStorage.setItem("actionData", JSON.stringify(dataFormViewResponse));
5357
5562
  window.location.href = `/form/menu?model=${relation}`;
5358
5563
  }
5359
5564
  }, [isSuccess]);
5360
- useEffect13(() => {
5565
+ useEffect12(() => {
5361
5566
  if (domainMany2Many && !isLoadedData) {
5362
5567
  setIsLoadedData(true);
5363
5568
  }
@@ -5375,9 +5580,9 @@ var many2manyFieldController = (props) => {
5375
5580
  // src/widget/basic/many2many-tags-field/controller.ts
5376
5581
  import { useMemo as useMemo11 } from "react";
5377
5582
  import {
5378
- evalJSONContext as evalJSONContext4,
5583
+ evalJSONContext as evalJSONContext5,
5379
5584
  evalJSONDomain as evalJSONDomain4,
5380
- getEnv as getEnv8,
5585
+ getEnv as getEnv9,
5381
5586
  useGetSelection as useGetSelection3,
5382
5587
  WIDGETAVATAR,
5383
5588
  WIDGETCOLOR
@@ -5392,8 +5597,8 @@ var many2manyTagsController = (props) => {
5392
5597
  placeholderNoOption
5393
5598
  } = props;
5394
5599
  const isUser = relation === "res.users" || relation === "res.partner";
5395
- const env = getEnv8();
5396
- const addtionalFields = optionsFields ? evalJSONContext4(optionsFields) : null;
5600
+ const env = getEnv9();
5601
+ const addtionalFields = optionsFields ? evalJSONContext5(optionsFields) : null;
5397
5602
  const domainObject = useMemo11(
5398
5603
  () => evalJSONDomain4(domain, JSON.parse(JSON.stringify(formValues || {}))),
5399
5604
  [domain, formValues]
@@ -5437,13 +5642,13 @@ var many2manyTagsController = (props) => {
5437
5642
  };
5438
5643
 
5439
5644
  // src/widget/basic/status-bar-field/controller.ts
5440
- import { useState as useState11 } from "react";
5645
+ import { useState as useState10 } from "react";
5441
5646
  import {
5442
5647
  evalJSONDomain as evalJSONDomain5,
5443
- selectEnv as selectEnv2,
5444
- useAppSelector as useAppSelector7,
5648
+ selectEnv as selectEnv3,
5649
+ useAppSelector as useAppSelector6,
5445
5650
  useChangeStatus,
5446
- useGetListData as useGetListData4
5651
+ useGetListData as useGetListData3
5447
5652
  } from "@fctc/interface-logic";
5448
5653
  var durationController = (props) => {
5449
5654
  const {
@@ -5461,9 +5666,9 @@ var durationController = (props) => {
5461
5666
  name: "",
5462
5667
  fold: ""
5463
5668
  };
5464
- const [disabled, setDisabled] = useState11(false);
5465
- const [modelStatus, setModalStatus] = useState11(false);
5466
- const { context } = useAppSelector7(selectEnv2);
5669
+ const [disabled, setDisabled] = useState10(false);
5670
+ const [modelStatus, setModalStatus] = useState10(false);
5671
+ const { context } = useAppSelector6(selectEnv3);
5467
5672
  const queryKey = [`data-status-duration`, specification];
5468
5673
  const listDataProps = {
5469
5674
  model: relation,
@@ -5478,7 +5683,7 @@ var durationController = (props) => {
5478
5683
  },
5479
5684
  sort: ""
5480
5685
  };
5481
- const { data: dataResponse } = useGetListData4(listDataProps, queryKey);
5686
+ const { data: dataResponse } = useGetListData3(listDataProps, queryKey);
5482
5687
  const { mutate: fetchChangeStatus } = useChangeStatus();
5483
5688
  const handleClick = async (stage_id) => {
5484
5689
  setDisabled(true);
@@ -5515,7 +5720,7 @@ var durationController = (props) => {
5515
5720
  };
5516
5721
 
5517
5722
  // src/widget/basic/priority-field/controller.ts
5518
- import { evalJSONContext as evalJSONContext5, useSave as useSave2 } from "@fctc/interface-logic";
5723
+ import { evalJSONContext as evalJSONContext6, useSave as useSave2 } from "@fctc/interface-logic";
5519
5724
  var priorityFieldController = (props) => {
5520
5725
  const {
5521
5726
  value,
@@ -5530,7 +5735,7 @@ var priorityFieldController = (props) => {
5530
5735
  viewData,
5531
5736
  context
5532
5737
  } = props;
5533
- const _context = { ...evalJSONContext5(actionData?.context) };
5738
+ const _context = { ...evalJSONContext6(actionData?.context) };
5534
5739
  const contextObject = { ...context, ..._context };
5535
5740
  const defaultPriority = parseInt(value) + 1;
5536
5741
  const label = viewData?.models?.[model]?.[name ?? ""]?.string ?? name;
@@ -5569,7 +5774,7 @@ var priorityFieldController = (props) => {
5569
5774
  };
5570
5775
 
5571
5776
  // src/widget/basic/float-time-field/controller.ts
5572
- import { useState as useState12 } from "react";
5777
+ import { useState as useState11 } from "react";
5573
5778
  import { convertFloatToTime, convertTimeToFloat } from "@fctc/interface-logic";
5574
5779
  var floatTimeFiledController = ({
5575
5780
  onChange: fieldOnChange,
@@ -5579,11 +5784,11 @@ var floatTimeFiledController = ({
5579
5784
  props
5580
5785
  }) => {
5581
5786
  const { name, defaultValue = 0, onChange } = props;
5582
- const [input, setInput] = useState12(
5787
+ const [input, setInput] = useState11(
5583
5788
  convertFloatToTime(value ?? defaultValue)
5584
5789
  );
5585
- const [formattedTime, setFormattedTime] = useState12("");
5586
- const [errors, setErrors] = useState12("");
5790
+ const [formattedTime, setFormattedTime] = useState11("");
5791
+ const [errors, setErrors] = useState11("");
5587
5792
  const handleInputChange = (e) => {
5588
5793
  const raw = e.target.value.replace(/[^\d:]/g, "");
5589
5794
  setInput(raw);
@@ -5656,7 +5861,31 @@ var floatTimeFiledController = ({
5656
5861
  };
5657
5862
 
5658
5863
  // src/widget/basic/float-field/controller.ts
5659
- import { useEffect as useEffect14, useRef as useRef5, useState as useState13 } from "react";
5864
+ import { useEffect as useEffect13, useRef as useRef5, useState as useState12 } from "react";
5865
+
5866
+ // src/utils/i18n.ts
5867
+ import { initReactI18next } from "react-i18next";
5868
+ import i18n from "i18next";
5869
+ import LanguageDetector from "i18next-browser-languagedetector";
5870
+ i18n.use(LanguageDetector).use(initReactI18next).init({
5871
+ resources: {
5872
+ vi: { translation: vi },
5873
+ en: { translation: en }
5874
+ },
5875
+ fallbackLng: "vi",
5876
+ lng: "vi_VN",
5877
+ debug: false,
5878
+ nonExplicitSupportedLngs: true,
5879
+ interpolation: {
5880
+ escapeValue: false
5881
+ },
5882
+ detection: {
5883
+ caches: ["cookie"]
5884
+ }
5885
+ });
5886
+ var i18n_default = i18n;
5887
+
5888
+ // src/widget/basic/float-field/controller.ts
5660
5889
  var floatController = ({
5661
5890
  onChange,
5662
5891
  value,
@@ -5664,10 +5893,10 @@ var floatController = ({
5664
5893
  }) => {
5665
5894
  const { name, required, methods, onChange: handleOnchange, string } = props;
5666
5895
  const { setError, clearErrors } = methods;
5667
- const [inputValue, setInputValue] = useState13(
5896
+ const [inputValue, setInputValue] = useState12(
5668
5897
  value !== void 0 && value !== null ? useFormatFloatNumber(value) : ""
5669
5898
  );
5670
- useEffect14(() => {
5899
+ useEffect13(() => {
5671
5900
  if (value !== void 0 && value !== null && value !== parseFloat(inputValue?.replace(/,/g, ""))) {
5672
5901
  setInputValue(useFormatFloatNumber(value));
5673
5902
  clearErrors(name);
@@ -5778,10 +6007,10 @@ var useFormatFloatNumber = (value) => {
5778
6007
  };
5779
6008
 
5780
6009
  // src/widget/basic/download-file-field/controller.ts
5781
- import { useId, useState as useState14 } from "react";
6010
+ import { useId, useState as useState13 } from "react";
5782
6011
  var downloadFileController = () => {
5783
6012
  const inputId = useId();
5784
- const [file, setFile] = useState14(null);
6013
+ const [file, setFile] = useState13(null);
5785
6014
  const handleFileChange = (e) => {
5786
6015
  setFile(e.target.files[0]);
5787
6016
  };
@@ -5834,9 +6063,6 @@ var downLoadBinaryController = (props) => {
5834
6063
 
5835
6064
  // src/widget/basic/date-field/controller.ts
5836
6065
  var import_moment = __toESM(require_moment());
5837
- import day from "react-datepicker/dist/day";
5838
- import month from "react-datepicker/dist/month";
5839
- import year from "react-datepicker/dist/year";
5840
6066
  var DURATIONS = {
5841
6067
  PAST: "past",
5842
6068
  NOW: "now",
@@ -5943,19 +6169,16 @@ var dateFieldController = (props) => {
5943
6169
  months_en,
5944
6170
  customValidateMinMax,
5945
6171
  minNowValue,
5946
- maxNowValue,
5947
- year,
5948
- month,
5949
- day
6172
+ maxNowValue
5950
6173
  };
5951
6174
  };
5952
6175
 
5953
6176
  // src/widget/basic/copy-link-button/controller.ts
5954
- import { useState as useState15 } from "react";
6177
+ import { useState as useState14 } from "react";
5955
6178
  import { copyTextToClipboard } from "@fctc/interface-logic";
5956
6179
  var copyLinkButtonController = (props) => {
5957
6180
  const { value, defaultValue } = props;
5958
- const [isCopied, setIsCopied] = useState15(false);
6181
+ const [isCopied, setIsCopied] = useState14(false);
5959
6182
  const handleCopyToClipboard = async (value2) => {
5960
6183
  await copyTextToClipboard(value2);
5961
6184
  setIsCopied(true);
@@ -5970,11 +6193,11 @@ var copyLinkButtonController = (props) => {
5970
6193
  };
5971
6194
 
5972
6195
  // src/widget/basic/color-field/color-controller.ts
5973
- import { evalJSONContext as evalJSONContext6, getEnv as getEnv9, useSave as useSave3 } from "@fctc/interface-logic";
6196
+ import { evalJSONContext as evalJSONContext7, getEnv as getEnv10, useSave as useSave3 } from "@fctc/interface-logic";
5974
6197
  var colorFieldController = (props) => {
5975
6198
  const { value, isForm, name, formValues, idForm, model, actionData } = props;
5976
- const env = getEnv9();
5977
- const _context = { ...evalJSONContext6(actionData?.context) || {} };
6199
+ const env = getEnv10();
6200
+ const _context = { ...evalJSONContext7(actionData?.context) || {} };
5978
6201
  const contextObject = { ...env.context, ..._context };
5979
6202
  const idDefault = isForm ? idForm : formValues?.id;
5980
6203
  const { mutate: onSave } = useSave3();
@@ -6002,14 +6225,14 @@ var colorFieldController = (props) => {
6002
6225
  };
6003
6226
 
6004
6227
  // src/widget/basic/binary-field/controller.ts
6005
- import { useEffect as useEffect15, useId as useId2, useRef as useRef6, useState as useState16 } from "react";
6228
+ import { useEffect as useEffect14, useId as useId2, useRef as useRef6, useState as useState15 } from "react";
6006
6229
  import { isBase64Image } from "@fctc/interface-logic";
6007
6230
  var binaryFieldController = (props) => {
6008
6231
  const { name, methods, readonly = false, value } = props;
6009
6232
  const inputId = useId2();
6010
- const [selectedImage, setSelectedImage] = useState16(null);
6011
- const [initialImage, setInitialImage] = useState16(value || null);
6012
- const [isInsideTable, setIsInsideTable] = useState16(false);
6233
+ const [selectedImage, setSelectedImage] = useState15(null);
6234
+ const [initialImage, setInitialImage] = useState15(value || null);
6235
+ const [isInsideTable, setIsInsideTable] = useState15(false);
6013
6236
  const { setValue } = methods;
6014
6237
  const binaryRef = useRef6(null);
6015
6238
  const convertUrlToBase64 = async (url) => {
@@ -6073,14 +6296,14 @@ var binaryFieldController = (props) => {
6073
6296
  else if (base64.startsWith("UklGR")) mimeType = "image/webp";
6074
6297
  return mimeType ? `data:${mimeType};base64,${base64}` : null;
6075
6298
  };
6076
- useEffect15(() => {
6299
+ useEffect14(() => {
6077
6300
  return () => {
6078
6301
  if (selectedImage) {
6079
6302
  URL.revokeObjectURL(selectedImage);
6080
6303
  }
6081
6304
  };
6082
6305
  }, [selectedImage]);
6083
- useEffect15(() => {
6306
+ useEffect14(() => {
6084
6307
  if (binaryRef.current) {
6085
6308
  const isInsideTable2 = !!binaryRef.current.closest("table");
6086
6309
  setIsInsideTable(isInsideTable2);
@@ -6101,6 +6324,7 @@ var binaryFieldController = (props) => {
6101
6324
  export {
6102
6325
  API_APP_URL,
6103
6326
  API_PRESCHOOL_URL,
6327
+ AppProvider,
6104
6328
  CloseIcon,
6105
6329
  EyeIcon,
6106
6330
  LoadingIcon,
@@ -6127,17 +6351,22 @@ export {
6127
6351
  priorityFieldController,
6128
6352
  setStorageItemAsync,
6129
6353
  statusDropdownController,
6354
+ useAppProvider,
6130
6355
  useAuth,
6131
6356
  useCallAction,
6132
6357
  useClickOutside,
6133
6358
  useConfig,
6134
6359
  useDebounce,
6135
6360
  useDetail,
6361
+ useForgotPasswordHandler,
6136
6362
  useGetRowIds,
6137
6363
  useListData,
6364
+ useLoginHandler,
6138
6365
  useMenu,
6139
6366
  useProfile,
6367
+ useResetPasswordHandler,
6140
6368
  useStorageState,
6369
+ useSwitchLocaleHandler,
6141
6370
  useUser,
6142
6371
  useViewV2
6143
6372
  };