@erpsquad/common 1.8.102 → 1.8.103

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.
@@ -1,5 +1,7 @@
1
- var dist = { exports: {} };
1
+ import { getAugmentedNamespace } from "../_commonjsHelpers/index.esm.js";
2
+ import * as index from "../../node_modules/@mui/material/utils/index/index.esm.js";
3
+ var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
2
4
  export {
3
- dist as __module
5
+ require$$0 as default
4
6
  };
5
7
  //# sourceMappingURL=index.esm11.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm11.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.esm11.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,7 +1,5 @@
1
- import { getAugmentedNamespace } from "../_commonjsHelpers/index.esm.js";
2
- import * as index from "../../node_modules/@mui/material/utils/index/index.esm.js";
3
- var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
1
+ var dist = { exports: {} };
4
2
  export {
5
- require$$0 as default
3
+ dist as __module
6
4
  };
7
5
  //# sourceMappingURL=index.esm2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.esm2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__module={exports:{}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_commonjsHelpers/index.js"),r=require("../../node_modules/@mui/material/utils/index/index.js"),s=/* @__PURE__ */e.getAugmentedNamespace(r);exports.default=s;
2
2
  //# sourceMappingURL=index11.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_commonjsHelpers/index.js"),r=require("../../node_modules/@mui/material/utils/index/index.js"),s=/* @__PURE__ */e.getAugmentedNamespace(r);exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__module={exports:{}};
2
2
  //# sourceMappingURL=index2.js.map
@@ -8,8 +8,6 @@ import { LanguageProvider } from "../../../contexts/languageContext/index.esm.js
8
8
  import { PageProvider } from "../../../contexts/page-context/index.esm.js";
9
9
  import { PermissionsProvider } from "../../../contexts/permission-context/index.esm.js";
10
10
  import MUIThemeWrapper from "../../../theme/themeWrapper/index.esm.js";
11
- import { Loader } from "../../loader/index.esm.js";
12
- import { useAppTranslations } from "../../../hooks/use-translations/index.esm.js";
13
11
  import { initializeApiConfig } from "../../../utils/api-config/index.esm.js";
14
12
  import { initializeApiBaseUrls } from "../../../utils/api/index.esm.js";
15
13
  import { createLibraryStore } from "../../../redux/store/index.esm.js";
@@ -60,10 +58,6 @@ const ERPUIProvider = ({
60
58
  console.error("Failed to initialize API configuration:", error);
61
59
  }
62
60
  }
63
- const { isLoading } = useAppTranslations();
64
- if (isLoading) {
65
- return /* @__PURE__ */ jsx(Loader, {});
66
- }
67
61
  const store = React__default.useMemo(() => {
68
62
  if (!useRedux) return null;
69
63
  if (reduxStore) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../../src/components/providers/ERPUIProvider.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode, Suspense } from 'react';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { SnackbarProvider } from 'notistack';\nimport { BrowserRouter } from 'react-router-dom';\nimport { createLibraryStore, ApiClientConfig } from '../../redux';\nimport { createLightTheme, createDarkTheme, Color } from '../../theme';\nimport { AuthProvider } from '../../contexts/AuthContext';\nimport { LanguageProvider } from '../../contexts/languageContext';\nimport { PageProvider } from '../../contexts/page-context';\nimport { PermissionsProvider } from '../../contexts/permission-context';\nimport MUIThemeWrapper from '../../theme/themeWrapper';\nimport Loader from '../loader';\nimport useAppTranslations from '../../hooks/use-translations';\nimport '../../utils/i18n';\nimport { initializeApiConfig, ApiConfig } from '../../utils/api-config';\nimport { initializeApiBaseUrls } from '../../utils/api';\n\n// Context for library configuration\ninterface ERPUIContextValue {\n useRedux: boolean;\n apiClient?: ApiClientConfig;\n theme?: any;\n themeMode: 'light' | 'dark';\n direction: 'ltr' | 'rtl';\n primaryColor?: Color;\n}\n\nconst ERPUIContext = createContext<ERPUIContextValue>({\n useRedux: false,\n themeMode: 'light',\n direction: 'ltr',\n});\n\nexport const useERPUI = () => useContext(ERPUIContext);\n\n// Provider props interface\ninterface ERPUIProviderProps {\n children: ReactNode;\n\n // Redux configuration\n useRedux?: boolean;\n reduxStore?: any;\n apiClient?: ApiClientConfig;\n additionalReducers?: Record<string, any>;\n\n // Theme configuration\n theme?: any;\n themeMode?: 'light' | 'dark';\n primaryColor?: Color;\n direction?: 'ltr' | 'rtl';\n\n // Context providers configuration\n enableAuth?: boolean;\n enableLanguage?: boolean;\n enablePages?: boolean;\n enablePermissions?: boolean;\n enableRouter?: boolean;\n enableSnackbar?: boolean;\n\n // Other configuration\n enableCssBaseline?: boolean;\n snackbarConfig?: {\n maxSnack?: number;\n anchorOrigin?: {\n vertical: 'top' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n autoHideDuration?: number;\n };\n\n // API configuration\n apiConfig?: ApiConfig;\n}\n\nexport const ERPUIProvider: React.FC<ERPUIProviderProps> = ({\n children,\n\n // Redux props\n useRedux = false,\n reduxStore,\n apiClient,\n additionalReducers = {},\n\n // Theme props\n theme: customTheme,\n themeMode = 'light',\n primaryColor,\n direction = 'ltr',\n\n // Context providers configuration\n enableAuth = true,\n enableLanguage = true,\n enablePages = true,\n enablePermissions = true,\n enableRouter = false, // Default false since consuming app usually provides router\n enableSnackbar = true,\n\n // Other props\n enableCssBaseline = true,\n snackbarConfig = {\n maxSnack: 3,\n anchorOrigin: { vertical: 'top', horizontal: 'right' },\n autoHideDuration: 5000,\n },\n\n // API configuration\n apiConfig: providedApiConfig,\n}) => {\n\n // Initialize API configuration synchronously before first render\n // This prevents \"API configuration not initialized\" errors when components\n // try to use the API during initial render\n const isInitialized = React.useRef(false);\n\n if (providedApiConfig && !isInitialized.current) {\n try {\n initializeApiConfig(providedApiConfig);\n initializeApiBaseUrls();\n isInitialized.current = true;\n } catch (error) {\n console.error('Failed to initialize API configuration:', error);\n }\n }\n const { isLoading } = useAppTranslations();\n if (isLoading) {\n return <Loader />;\n }\n // Create or use provided Redux store\n const store = React.useMemo(() => {\n if (!useRedux) return null;\n\n if (reduxStore) {\n return reduxStore;\n }\n\n return createLibraryStore(additionalReducers, apiClient);\n }, [useRedux, reduxStore, additionalReducers, apiClient]);\n\n // Create theme\n const theme = React.useMemo(() => {\n if (customTheme) {\n return customTheme;\n }\n\n const themeCreator = themeMode === 'dark' ? createDarkTheme : createLightTheme;\n const { theme: generatedTheme } = themeCreator(primaryColor, direction);\n return generatedTheme;\n }, [customTheme, themeMode, primaryColor, direction]);\n\n // Context value\n const contextValue: ERPUIContextValue = {\n useRedux,\n apiClient,\n theme,\n themeMode,\n direction,\n primaryColor,\n };\n\n // Build provider tree from inside out\n let content = (\n <ERPUIContext.Provider value={contextValue}>\n {/* <ThemeProvider theme={theme}>\n {enableCssBaseline && <CssBaseline />} */}\n {/* <Suspense fallback={<Loader />}> */}\n <MUIThemeWrapper theme={theme} enableCssBaseline={enableCssBaseline}>\n {children}\n </MUIThemeWrapper>\n {/* </Suspense> */}\n {/* </ThemeProvider> */}\n </ERPUIContext.Provider>\n );\n\n // Wrap with snackbar provider if enabled\n if (enableSnackbar) {\n content = (\n <SnackbarProvider {...snackbarConfig}>\n {content}\n </SnackbarProvider>\n );\n }\n\n // Wrap with page provider if enabled\n if (enablePages) {\n content = (\n <PageProvider>\n {content}\n </PageProvider>\n );\n }\n\n // Wrap with permissions provider if enabled\n if (enablePermissions) {\n content = (\n <PermissionsProvider>\n {content}\n </PermissionsProvider>\n );\n }\n\n // Wrap with language provider if enabled\n if (enableLanguage) {\n content = (\n <LanguageProvider>\n {content}\n </LanguageProvider>\n );\n }\n\n // Wrap with auth provider if enabled\n if (enableAuth) {\n content = (\n <AuthProvider>\n {content}\n </AuthProvider>\n );\n }\n\n // Wrap with router if enabled\n if (enableRouter) {\n content = (\n <BrowserRouter>\n {content}\n </BrowserRouter>\n );\n }\n\n // Wrap with Redux provider if enabled\n if (useRedux && store) {\n content = (\n <ReduxProvider store={store}>\n {content}\n </ReduxProvider>\n );\n }\n\n return content;\n};\n\nexport default ERPUIProvider;"],"names":["React","ReduxProvider"],"mappings":";;;;;;;;;;;;;;;;AA6BA,MAAM,eAAe,cAAiC;AAAA,EACpD,UAAU;AAAA,EACV,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAEM,MAAM,WAAW,MAAM,WAAW,YAAY;AAyC9C,MAAM,gBAA8C,CAAC;AAAA,EAC1D;AAAA;AAAA,EAGA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,qBAAqB,CAAA;AAAA;AAAA,EAGrB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA;AAAA,EAGZ,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,eAAe;AAAA;AAAA,EACf,iBAAiB;AAAA;AAAA,EAGjB,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,IACf,UAAU;AAAA,IACV,cAAc,EAAE,UAAU,OAAO,YAAY,QAAA;AAAA,IAC7C,kBAAkB;AAAA,EAAA;AAAA;AAAA,EAIpB,WAAW;AACb,MAAM;AAKJ,QAAM,gBAAgBA,eAAM,OAAO,KAAK;AAExC,MAAI,qBAAqB,CAAC,cAAc,SAAS;AAC/C,QAAI;AACF,0BAAoB,iBAAiB;AACrC,4BAAA;AACA,oBAAc,UAAU;AAAA,IAC1B,SAAS,OAAO;AACd,cAAQ,MAAM,2CAA2C,KAAK;AAAA,IAChE;AAA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ACrB,cACE,oBAACC,UAAA,EAAc,OACZ,UAAA,SACH;AAAA,EAEJ;AAEA,SAAO;AACT;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../src/components/providers/ERPUIProvider.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode, Suspense } from 'react';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { SnackbarProvider } from 'notistack';\nimport { BrowserRouter } from 'react-router-dom';\nimport { createLibraryStore, ApiClientConfig } from '../../redux';\nimport { createLightTheme, createDarkTheme, Color } from '../../theme';\nimport { AuthProvider } from '../../contexts/AuthContext';\nimport { LanguageProvider } from '../../contexts/languageContext';\nimport { PageProvider } from '../../contexts/page-context';\nimport { PermissionsProvider } from '../../contexts/permission-context';\nimport MUIThemeWrapper from '../../theme/themeWrapper';\nimport Loader from '../loader';\nimport useAppTranslations from '../../hooks/use-translations';\nimport '../../utils/i18n';\nimport { initializeApiConfig, ApiConfig } from '../../utils/api-config';\nimport { initializeApiBaseUrls } from '../../utils/api';\n\n// Context for library configuration\ninterface ERPUIContextValue {\n useRedux: boolean;\n apiClient?: ApiClientConfig;\n theme?: any;\n themeMode: 'light' | 'dark';\n direction: 'ltr' | 'rtl';\n primaryColor?: Color;\n}\n\nconst ERPUIContext = createContext<ERPUIContextValue>({\n useRedux: false,\n themeMode: 'light',\n direction: 'ltr',\n});\n\nexport const useERPUI = () => useContext(ERPUIContext);\n\n// Provider props interface\ninterface ERPUIProviderProps {\n children: ReactNode;\n\n // Redux configuration\n useRedux?: boolean;\n reduxStore?: any;\n apiClient?: ApiClientConfig;\n additionalReducers?: Record<string, any>;\n\n // Theme configuration\n theme?: any;\n themeMode?: 'light' | 'dark';\n primaryColor?: Color;\n direction?: 'ltr' | 'rtl';\n\n // Context providers configuration\n enableAuth?: boolean;\n enableLanguage?: boolean;\n enablePages?: boolean;\n enablePermissions?: boolean;\n enableRouter?: boolean;\n enableSnackbar?: boolean;\n\n // Other configuration\n enableCssBaseline?: boolean;\n snackbarConfig?: {\n maxSnack?: number;\n anchorOrigin?: {\n vertical: 'top' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n autoHideDuration?: number;\n };\n\n // API configuration\n apiConfig?: ApiConfig;\n}\n\nexport const ERPUIProvider: React.FC<ERPUIProviderProps> = ({\n children,\n\n // Redux props\n useRedux = false,\n reduxStore,\n apiClient,\n additionalReducers = {},\n\n // Theme props\n theme: customTheme,\n themeMode = 'light',\n primaryColor,\n direction = 'ltr',\n\n // Context providers configuration\n enableAuth = true,\n enableLanguage = true,\n enablePages = true,\n enablePermissions = true,\n enableRouter = false, // Default false since consuming app usually provides router\n enableSnackbar = true,\n\n // Other props\n enableCssBaseline = true,\n snackbarConfig = {\n maxSnack: 3,\n anchorOrigin: { vertical: 'top', horizontal: 'right' },\n autoHideDuration: 5000,\n },\n\n // API configuration\n apiConfig: providedApiConfig,\n}) => {\n\n // Initialize API configuration synchronously before first render\n // This prevents \"API configuration not initialized\" errors when components\n // try to use the API during initial render\n const isInitialized = React.useRef(false);\n\n if (providedApiConfig && !isInitialized.current) {\n try {\n initializeApiConfig(providedApiConfig);\n initializeApiBaseUrls();\n isInitialized.current = true;\n } catch (error) {\n console.error('Failed to initialize API configuration:', error);\n }\n }\n // const { isLoading } = useAppTranslations();\n // if (isLoading) {\n // return <Loader />;\n // }\n // Create or use provided Redux store\n const store = React.useMemo(() => {\n if (!useRedux) return null;\n\n if (reduxStore) {\n return reduxStore;\n }\n\n return createLibraryStore(additionalReducers, apiClient);\n }, [useRedux, reduxStore, additionalReducers, apiClient]);\n\n // Create theme\n const theme = React.useMemo(() => {\n if (customTheme) {\n return customTheme;\n }\n\n const themeCreator = themeMode === 'dark' ? createDarkTheme : createLightTheme;\n const { theme: generatedTheme } = themeCreator(primaryColor, direction);\n return generatedTheme;\n }, [customTheme, themeMode, primaryColor, direction]);\n\n // Context value\n const contextValue: ERPUIContextValue = {\n useRedux,\n apiClient,\n theme,\n themeMode,\n direction,\n primaryColor,\n };\n\n // Build provider tree from inside out\n let content = (\n <ERPUIContext.Provider value={contextValue}>\n {/* <ThemeProvider theme={theme}>\n {enableCssBaseline && <CssBaseline />} */}\n {/* <Suspense fallback={<Loader />}> */}\n <MUIThemeWrapper theme={theme} enableCssBaseline={enableCssBaseline}>\n {children}\n </MUIThemeWrapper>\n {/* </Suspense> */}\n {/* </ThemeProvider> */}\n </ERPUIContext.Provider>\n );\n\n // Wrap with snackbar provider if enabled\n if (enableSnackbar) {\n content = (\n <SnackbarProvider {...snackbarConfig}>\n {content}\n </SnackbarProvider>\n );\n }\n\n // Wrap with page provider if enabled\n if (enablePages) {\n content = (\n <PageProvider>\n {content}\n </PageProvider>\n );\n }\n\n // Wrap with permissions provider if enabled\n if (enablePermissions) {\n content = (\n <PermissionsProvider>\n {content}\n </PermissionsProvider>\n );\n }\n\n // Wrap with language provider if enabled\n if (enableLanguage) {\n content = (\n <LanguageProvider>\n {content}\n </LanguageProvider>\n );\n }\n\n // Wrap with auth provider if enabled\n if (enableAuth) {\n content = (\n <AuthProvider>\n {content}\n </AuthProvider>\n );\n }\n\n // Wrap with router if enabled\n if (enableRouter) {\n content = (\n <BrowserRouter>\n {content}\n </BrowserRouter>\n );\n }\n\n // Wrap with Redux provider if enabled\n if (useRedux && store) {\n content = (\n <ReduxProvider store={store}>\n {content}\n </ReduxProvider>\n );\n }\n\n return content;\n};\n\nexport default ERPUIProvider;"],"names":["React","ReduxProvider"],"mappings":";;;;;;;;;;;;;;AA6BA,MAAM,eAAe,cAAiC;AAAA,EACpD,UAAU;AAAA,EACV,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAEM,MAAM,WAAW,MAAM,WAAW,YAAY;AAyC9C,MAAM,gBAA8C,CAAC;AAAA,EAC1D;AAAA;AAAA,EAGA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,qBAAqB,CAAA;AAAA;AAAA,EAGrB,OAAO;AAAA,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,MAAI,gBAAgB;AAClB,cACE,oBAAC,kBAAA,EAAkB,GAAG,gBACnB,UAAA,SACH;AAAA,EAEJ;AAGA,MAAI,aAAa;AACf,cACE,oBAAC,gBACE,UAAA,QAAA,CACH;AAAA,EAEJ;AAGA,MAAI,mBAAmB;AACrB,cACE,oBAAC,uBACE,UAAA,QAAA,CACH;AAAA,EAEJ;AAGA,MAAI,gBAAgB;AAClB,cACE,oBAAC,oBACE,UAAA,QAAA,CACH;AAAA,EAEJ;AAGA,MAAI,YAAY;AACd,cACE,oBAAC,gBACE,UAAA,QAAA,CACH;AAAA,EAEJ;AAGA,MAAI,cAAc;AAChB,cACE,oBAAC,iBACE,UAAA,QAAA,CACH;AAAA,EAEJ;AAGA,MAAI,YAAY,OAAO;AACrB,cACE,oBAACC,UAAA,EAAc,OACZ,UAAA,SACH;AAAA,EAEJ;AAEA,SAAO;AACT;"}
@@ -1,3 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),i=require("react-redux"),t=require("../../../node_modules/notistack/notistack.esm/index.js"),n=require("react-router-dom"),s=require("../../../contexts/AuthContext/index.js"),o=require("../../../contexts/languageContext/index.js"),a=require("../../../contexts/page-context/index.js"),u=require("../../../contexts/permission-context/index.js"),d=require("../../../theme/themeWrapper/index.js"),l=require("../../loader/index.js"),c=require("../../../hooks/use-translations/index.js"),x=require("../../../utils/api-config/index.js"),h=require("../../../utils/api/index.js"),m=require("../../../redux/store/index.js"),j=require("../../../theme/theme-impl/index.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=/* @__PURE__ */p(r);const f=r.createContext({useRedux:!1,themeMode:"light",direction:"ltr"}),q=({children:r,useRedux:p=!1,reduxStore:q,apiClient:P,additionalReducers:b={},theme:v,themeMode:C="light",primaryColor:k,direction:R="ltr",enableAuth:y=!0,enableLanguage:A=!0,enablePages:L=!0,enablePermissions:M=!0,enableRouter:S=!1,enableSnackbar:B=!0,enableCssBaseline:z=!0,snackbarConfig:T={maxSnack:3,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:5e3},apiConfig:U})=>{const _=g.default.useRef(!1);if(U&&!_.current)try{x.initializeApiConfig(U),h.initializeApiBaseUrls(),_.current=!0}catch(H){}const{isLoading:D}=c.useAppTranslations();if(D)/* @__PURE__ */
2
- return e.jsx(l.Loader,{});const E=g.default.useMemo(()=>p?q||m.createLibraryStore(b,P):null,[p,q,b,P]),I=g.default.useMemo(()=>{if(v)return v;const e="dark"===C?j.createDarkTheme:j.createLightTheme,{theme:r}=e(k,R);return r},[v,C,k,R]),O={useRedux:p,apiClient:P,theme:I,themeMode:C,direction:R,primaryColor:k};let w=/* @__PURE__ */e.jsx(f.Provider,{value:O,children:/* @__PURE__ */e.jsx(d.default,{theme:I,enableCssBaseline:z,children:r})});return B&&(w=/* @__PURE__ */e.jsx(t.SnackbarProvider,{...T,children:w})),L&&(w=/* @__PURE__ */e.jsx(a.PageProvider,{children:w})),M&&(w=/* @__PURE__ */e.jsx(u.PermissionsProvider,{children:w})),A&&(w=/* @__PURE__ */e.jsx(o.LanguageProvider,{children:w})),y&&(w=/* @__PURE__ */e.jsx(s.AuthProvider,{children:w})),S&&(w=/* @__PURE__ */e.jsx(n.BrowserRouter,{children:w})),p&&E&&(w=/* @__PURE__ */e.jsx(i.Provider,{store:E,children:w})),w};exports.ERPUIProvider=q,exports.default=q,exports.useERPUI=()=>r.useContext(f);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("react-redux"),i=require("../../../node_modules/notistack/notistack.esm/index.js"),n=require("react-router-dom"),s=require("../../../contexts/AuthContext/index.js"),a=require("../../../contexts/languageContext/index.js"),o=require("../../../contexts/page-context/index.js"),u=require("../../../contexts/permission-context/index.js"),d=require("../../../theme/themeWrapper/index.js"),l=require("../../../utils/api-config/index.js"),c=require("../../../utils/api/index.js"),x=require("../../../redux/store/index.js"),h=require("../../../theme/theme-impl/index.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var j=/* @__PURE__ */m(r);const p=r.createContext({useRedux:!1,themeMode:"light",direction:"ltr"}),g=({children:r,useRedux:m=!1,reduxStore:g,apiClient:f,additionalReducers:P={},theme:b,themeMode:q="light",primaryColor:v,direction:C="ltr",enableAuth:R=!0,enableLanguage:k=!0,enablePages:y=!0,enablePermissions:M=!0,enableRouter:A=!1,enableSnackbar:S=!0,enableCssBaseline:B=!0,snackbarConfig:L={maxSnack:3,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:5e3},apiConfig:z})=>{const U=j.default.useRef(!1);if(z&&!U.current)try{l.initializeApiConfig(z),c.initializeApiBaseUrls(),U.current=!0}catch(O){}const _=j.default.useMemo(()=>m?g||x.createLibraryStore(P,f):null,[m,g,P,f]),D=j.default.useMemo(()=>{if(b)return b;const e="dark"===q?h.createDarkTheme:h.createLightTheme,{theme:r}=e(v,C);return r},[b,q,v,C]),E={useRedux:m,apiClient:f,theme:D,themeMode:q,direction:C,primaryColor:v};let I=/* @__PURE__ */e.jsx(p.Provider,{value:E,children:/* @__PURE__ */e.jsx(d.default,{theme:D,enableCssBaseline:B,children:r})});return S&&(I=/* @__PURE__ */e.jsx(i.SnackbarProvider,{...L,children:I})),y&&(I=/* @__PURE__ */e.jsx(o.PageProvider,{children:I})),M&&(I=/* @__PURE__ */e.jsx(u.PermissionsProvider,{children:I})),k&&(I=/* @__PURE__ */e.jsx(a.LanguageProvider,{children:I})),R&&(I=/* @__PURE__ */e.jsx(s.AuthProvider,{children:I})),A&&(I=/* @__PURE__ */e.jsx(n.BrowserRouter,{children:I})),m&&_&&(I=/* @__PURE__ */e.jsx(t.Provider,{store:_,children:I})),I};exports.ERPUIProvider=g,exports.default=g,exports.useERPUI=()=>r.useContext(p);
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/providers/ERPUIProvider.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode, Suspense } from 'react';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { SnackbarProvider } from 'notistack';\nimport { BrowserRouter } from 'react-router-dom';\nimport { createLibraryStore, ApiClientConfig } from '../../redux';\nimport { createLightTheme, createDarkTheme, Color } from '../../theme';\nimport { AuthProvider } from '../../contexts/AuthContext';\nimport { LanguageProvider } from '../../contexts/languageContext';\nimport { PageProvider } from '../../contexts/page-context';\nimport { PermissionsProvider } from '../../contexts/permission-context';\nimport MUIThemeWrapper from '../../theme/themeWrapper';\nimport Loader from '../loader';\nimport useAppTranslations from '../../hooks/use-translations';\nimport '../../utils/i18n';\nimport { initializeApiConfig, ApiConfig } from '../../utils/api-config';\nimport { initializeApiBaseUrls } from '../../utils/api';\n\n// Context for library configuration\ninterface ERPUIContextValue {\n useRedux: boolean;\n apiClient?: ApiClientConfig;\n theme?: any;\n themeMode: 'light' | 'dark';\n direction: 'ltr' | 'rtl';\n primaryColor?: Color;\n}\n\nconst ERPUIContext = createContext<ERPUIContextValue>({\n useRedux: false,\n themeMode: 'light',\n direction: 'ltr',\n});\n\nexport const useERPUI = () => useContext(ERPUIContext);\n\n// Provider props interface\ninterface ERPUIProviderProps {\n children: ReactNode;\n\n // Redux configuration\n useRedux?: boolean;\n reduxStore?: any;\n apiClient?: ApiClientConfig;\n additionalReducers?: Record<string, any>;\n\n // Theme configuration\n theme?: any;\n themeMode?: 'light' | 'dark';\n primaryColor?: Color;\n direction?: 'ltr' | 'rtl';\n\n // Context providers configuration\n enableAuth?: boolean;\n enableLanguage?: boolean;\n enablePages?: boolean;\n enablePermissions?: boolean;\n enableRouter?: boolean;\n enableSnackbar?: boolean;\n\n // Other configuration\n enableCssBaseline?: boolean;\n snackbarConfig?: {\n maxSnack?: number;\n anchorOrigin?: {\n vertical: 'top' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n autoHideDuration?: number;\n };\n\n // API configuration\n apiConfig?: ApiConfig;\n}\n\nexport const ERPUIProvider: React.FC<ERPUIProviderProps> = ({\n children,\n\n // Redux props\n useRedux = false,\n reduxStore,\n apiClient,\n additionalReducers = {},\n\n // Theme props\n theme: customTheme,\n themeMode = 'light',\n primaryColor,\n direction = 'ltr',\n\n // Context providers configuration\n enableAuth = true,\n enableLanguage = true,\n enablePages = true,\n enablePermissions = true,\n enableRouter = false, // Default false since consuming app usually provides router\n enableSnackbar = true,\n\n // Other props\n enableCssBaseline = true,\n snackbarConfig = {\n maxSnack: 3,\n anchorOrigin: { vertical: 'top', horizontal: 'right' },\n autoHideDuration: 5000,\n },\n\n // API configuration\n apiConfig: providedApiConfig,\n}) => {\n\n // Initialize API configuration synchronously before first render\n // This prevents \"API configuration not initialized\" errors when components\n // try to use the API during initial render\n const isInitialized = React.useRef(false);\n\n if (providedApiConfig && !isInitialized.current) {\n try {\n initializeApiConfig(providedApiConfig);\n initializeApiBaseUrls();\n isInitialized.current = true;\n } catch (error) {\n console.error('Failed to initialize API configuration:', error);\n }\n }\n const { isLoading } = useAppTranslations();\n if (isLoading) {\n return <Loader />;\n }\n // Create or use provided Redux store\n const store = React.useMemo(() => {\n if (!useRedux) return null;\n\n if (reduxStore) {\n return reduxStore;\n }\n\n return createLibraryStore(additionalReducers, apiClient);\n }, [useRedux, reduxStore, additionalReducers, apiClient]);\n\n // Create theme\n const theme = React.useMemo(() => {\n if (customTheme) {\n return customTheme;\n }\n\n const themeCreator = themeMode === 'dark' ? createDarkTheme : createLightTheme;\n const { theme: generatedTheme } = themeCreator(primaryColor, direction);\n return generatedTheme;\n }, [customTheme, themeMode, primaryColor, direction]);\n\n // Context value\n const contextValue: ERPUIContextValue = {\n useRedux,\n apiClient,\n theme,\n themeMode,\n direction,\n primaryColor,\n };\n\n // Build provider tree from inside out\n let content = (\n <ERPUIContext.Provider value={contextValue}>\n {/* <ThemeProvider theme={theme}>\n {enableCssBaseline && <CssBaseline />} */}\n {/* <Suspense fallback={<Loader />}> */}\n <MUIThemeWrapper theme={theme} enableCssBaseline={enableCssBaseline}>\n {children}\n </MUIThemeWrapper>\n {/* </Suspense> */}\n {/* </ThemeProvider> */}\n </ERPUIContext.Provider>\n );\n\n // Wrap with snackbar provider if enabled\n if (enableSnackbar) {\n content = (\n <SnackbarProvider {...snackbarConfig}>\n {content}\n </SnackbarProvider>\n );\n }\n\n // Wrap with page provider if enabled\n if (enablePages) {\n content = (\n <PageProvider>\n {content}\n </PageProvider>\n );\n }\n\n // Wrap with permissions provider if enabled\n if (enablePermissions) {\n content = (\n <PermissionsProvider>\n {content}\n </PermissionsProvider>\n );\n }\n\n // Wrap with language provider if enabled\n if (enableLanguage) {\n content = (\n <LanguageProvider>\n {content}\n </LanguageProvider>\n );\n }\n\n // Wrap with auth provider if enabled\n if (enableAuth) {\n content = (\n <AuthProvider>\n {content}\n </AuthProvider>\n );\n }\n\n // Wrap with router if enabled\n if (enableRouter) {\n content = (\n <BrowserRouter>\n {content}\n </BrowserRouter>\n );\n }\n\n // Wrap with Redux provider if enabled\n if (useRedux && store) {\n content = (\n <ReduxProvider store={store}>\n {content}\n </ReduxProvider>\n );\n }\n\n return content;\n};\n\nexport default ERPUIProvider;"],"names":["ERPUIContext","createContext","useRedux","themeMode","direction","ERPUIProvider","children","reduxStore","apiClient","additionalReducers","theme","customTheme","primaryColor","enableAuth","enableLanguage","enablePages","enablePermissions","enableRouter","enableSnackbar","enableCssBaseline","snackbarConfig","maxSnack","anchorOrigin","vertical","horizontal","autoHideDuration","apiConfig","providedApiConfig","isInitialized","React","useRef","current","initializeApiConfig","initializeApiBaseUrls","error","isLoading","useAppTranslations","Loader","store","useMemo","createLibraryStore","themeCreator","createDarkTheme","createLightTheme","generatedTheme","contextValue","content","jsx","Provider","value","MUIThemeWrapper","SnackbarProvider","PageProvider","PermissionsProvider","LanguageProvider","AuthProvider","BrowserRouter","ReduxProvider","useContext"],"mappings":"k3BA6BA,MAAMA,EAAeC,E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AAAwC,KAMH9B,IACF8B,mBACEC,IAACM,EAAAA,qBACE/C,SAAAwC,KAMHhC,IACFgC,mBACEC,IAACO,EAAAA,kBACEhD,SAAAwC,KAMHjC,IACFiC,mBACEC,IAACQ,EAAAA,cACEjD,SAAAwC,KAMH7B,IACF6B,mBACEC,IAACS,EAAAA,eACElD,SAAAwC,KAMH5C,GAAYoC,IACdQ,iBACEC,EAAAA,IAACU,EAAAA,SAAA,CAAAnB,MAAcA,EACZhC,SAAAwC,KAKAA,8DA3Me,IAAMY,EAAAA,WAAW1D"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/providers/ERPUIProvider.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode, Suspense } from 'react';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { SnackbarProvider } from 'notistack';\nimport { BrowserRouter } from 'react-router-dom';\nimport { createLibraryStore, ApiClientConfig } from '../../redux';\nimport { createLightTheme, createDarkTheme, Color } from '../../theme';\nimport { AuthProvider } from '../../contexts/AuthContext';\nimport { LanguageProvider } from '../../contexts/languageContext';\nimport { PageProvider } from '../../contexts/page-context';\nimport { PermissionsProvider } from '../../contexts/permission-context';\nimport MUIThemeWrapper from '../../theme/themeWrapper';\nimport Loader from '../loader';\nimport useAppTranslations from '../../hooks/use-translations';\nimport '../../utils/i18n';\nimport { initializeApiConfig, ApiConfig } from '../../utils/api-config';\nimport { initializeApiBaseUrls } from '../../utils/api';\n\n// Context for library configuration\ninterface ERPUIContextValue {\n useRedux: boolean;\n apiClient?: ApiClientConfig;\n theme?: any;\n themeMode: 'light' | 'dark';\n direction: 'ltr' | 'rtl';\n primaryColor?: Color;\n}\n\nconst ERPUIContext = createContext<ERPUIContextValue>({\n useRedux: false,\n themeMode: 'light',\n direction: 'ltr',\n});\n\nexport const useERPUI = () => useContext(ERPUIContext);\n\n// Provider props interface\ninterface ERPUIProviderProps {\n children: ReactNode;\n\n // Redux configuration\n useRedux?: boolean;\n reduxStore?: any;\n apiClient?: ApiClientConfig;\n additionalReducers?: Record<string, any>;\n\n // Theme configuration\n theme?: any;\n themeMode?: 'light' | 'dark';\n primaryColor?: Color;\n direction?: 'ltr' | 'rtl';\n\n // Context providers configuration\n enableAuth?: boolean;\n enableLanguage?: boolean;\n enablePages?: boolean;\n enablePermissions?: boolean;\n enableRouter?: boolean;\n enableSnackbar?: boolean;\n\n // Other configuration\n enableCssBaseline?: boolean;\n snackbarConfig?: {\n maxSnack?: number;\n anchorOrigin?: {\n vertical: 'top' | 'bottom';\n horizontal: 'left' | 'center' | 'right';\n };\n autoHideDuration?: number;\n };\n\n // API configuration\n apiConfig?: ApiConfig;\n}\n\nexport const ERPUIProvider: React.FC<ERPUIProviderProps> = ({\n children,\n\n // Redux props\n useRedux = false,\n reduxStore,\n apiClient,\n additionalReducers = {},\n\n // Theme props\n theme: customTheme,\n themeMode = 'light',\n primaryColor,\n direction = 'ltr',\n\n // Context providers configuration\n enableAuth = true,\n enableLanguage = true,\n enablePages = true,\n enablePermissions = true,\n enableRouter = false, // Default false since consuming app usually provides router\n enableSnackbar = true,\n\n // Other props\n enableCssBaseline = true,\n snackbarConfig = {\n maxSnack: 3,\n anchorOrigin: { vertical: 'top', horizontal: 'right' },\n autoHideDuration: 5000,\n },\n\n // API configuration\n apiConfig: providedApiConfig,\n}) => {\n\n // Initialize API configuration synchronously before first render\n // This prevents \"API configuration not initialized\" errors when components\n // try to use the API during initial render\n const isInitialized = React.useRef(false);\n\n if (providedApiConfig && !isInitialized.current) {\n try {\n initializeApiConfig(providedApiConfig);\n initializeApiBaseUrls();\n isInitialized.current = true;\n } catch (error) {\n console.error('Failed to initialize API configuration:', error);\n }\n }\n // const { isLoading } = useAppTranslations();\n // if (isLoading) {\n // return <Loader />;\n // }\n // Create or use provided Redux store\n const store = React.useMemo(() => {\n if (!useRedux) return null;\n\n if (reduxStore) {\n return reduxStore;\n }\n\n return createLibraryStore(additionalReducers, apiClient);\n }, [useRedux, reduxStore, additionalReducers, apiClient]);\n\n // Create theme\n const theme = React.useMemo(() => {\n if (customTheme) {\n return customTheme;\n }\n\n const themeCreator = themeMode === 'dark' ? createDarkTheme : createLightTheme;\n const { theme: generatedTheme } = themeCreator(primaryColor, direction);\n return generatedTheme;\n }, [customTheme, themeMode, primaryColor, direction]);\n\n // Context value\n const contextValue: ERPUIContextValue = {\n useRedux,\n apiClient,\n theme,\n themeMode,\n direction,\n primaryColor,\n };\n\n // Build provider tree from inside out\n let content = (\n <ERPUIContext.Provider value={contextValue}>\n {/* <ThemeProvider theme={theme}>\n {enableCssBaseline && <CssBaseline />} */}\n {/* <Suspense fallback={<Loader />}> */}\n <MUIThemeWrapper theme={theme} enableCssBaseline={enableCssBaseline}>\n {children}\n </MUIThemeWrapper>\n {/* </Suspense> */}\n {/* </ThemeProvider> */}\n </ERPUIContext.Provider>\n );\n\n // Wrap with snackbar provider if enabled\n if (enableSnackbar) {\n content = (\n <SnackbarProvider {...snackbarConfig}>\n {content}\n </SnackbarProvider>\n );\n }\n\n // Wrap with page provider if enabled\n if (enablePages) {\n content = (\n <PageProvider>\n {content}\n </PageProvider>\n );\n }\n\n // Wrap with permissions provider if enabled\n if (enablePermissions) {\n content = (\n <PermissionsProvider>\n {content}\n </PermissionsProvider>\n );\n }\n\n // Wrap with language provider if enabled\n if (enableLanguage) {\n content = (\n <LanguageProvider>\n {content}\n </LanguageProvider>\n );\n }\n\n // Wrap with auth provider if enabled\n if (enableAuth) {\n content = (\n <AuthProvider>\n {content}\n </AuthProvider>\n );\n }\n\n // Wrap with router if enabled\n if (enableRouter) {\n content = (\n <BrowserRouter>\n {content}\n </BrowserRouter>\n );\n }\n\n // Wrap with Redux provider if enabled\n if (useRedux && store) {\n content = (\n <ReduxProvider store={store}>\n {content}\n </ReduxProvider>\n );\n }\n\n return content;\n};\n\nexport default ERPUIProvider;"],"names":["ERPUIContext","createContext","useRedux","themeMode","direction","ERPUIProvider","children","reduxStore","apiClient","additionalReducers","theme","customTheme","primaryColor","enableAuth","enableLanguage","enablePages","enablePermissions","enableRouter","enableSnackbar","enableCssBaseline","snackbarConfig","maxSnack","anchorOrigin","vertical","horizontal","autoHideDuration","apiConfig","providedApiConfig","isInitialized","React","useRef","current","initializeApiConfig","initializeApiBaseUrls","error","store","useMemo","createLibraryStore","themeCreator","createDarkTheme","createLightTheme","generatedTheme","contextValue","content","jsx","Provider","value","MUIThemeWrapper","SnackbarProvider","PageProvider","PermissionsProvider","LanguageProvider","AuthProvider","BrowserRouter","ReduxProvider","useContext"],"mappings":"yxBA6BA,MAAMA,EAAeC,EAAAA,cAAiC,CACpDC,UAAU,EACVC,UAAW,QACXC,UAAW,QA4CAC,EAA8C,EACzDC,WAGAJ,YAAW,EACXK,aACAC,YACAC,qBAAqB,CAAA,EAGrBC,MAAOC,EACPR,YAAY,QACZS,eACAR,YAAY,MAGZS,cAAa,EACbC,kBAAiB,EACjBC,eAAc,EACdC,qBAAoB,EACpBC,gBAAe,EACfC,kBAAiB,EAGjBC,qBAAoB,EACpBC,iBAAiB,CACfC,SAAU,EACVC,aAAc,CAAEC,SAAU,MAAOC,WAAY,SAC7CC,iBAAkB,KAIpBC,UAAWC,MAMX,MAAMC,EAAgBC,EAAAA,QAAMC,QAAO,GAEnC,GAAIH,IAAsBC,EAAcG,QACtC,IACEC,EAAAA,oBAAoBL,GACpBM,0BACAL,EAAcG,SAAU,CAC1B,OAASG,GAET,CAOF,MAAMC,EAAQN,UAAMO,QAAQ,IACrBlC,EAEDK,GAIG8B,EAAAA,mBAAmB5B,EAAoBD,GANxB,KAOrB,CAACN,EAAUK,EAAYE,EAAoBD,IAGxCE,EAAQmB,UAAMO,QAAQ,KAC1B,GAAIzB,EACF,OAAOA,EAGT,MAAM2B,EAA6B,SAAdnC,EAAuBoC,EAAAA,gBAAkBC,EAAAA,kBACtD9B,MAAO+B,GAAmBH,EAAa1B,EAAcR,GAC7D,OAAOqC,GACN,CAAC9B,EAAaR,EAAWS,EAAcR,IAGpCsC,EAAkC,CACtCxC,WACAM,YACAE,QACAP,YACAC,YACAQ,gBAIF,IAAI+B,iBACFC,EAAAA,IAAC5C,EAAa6C,SAAb,CAAsBC,MAAOJ,EAI5BpC,0BAAAsC,IAACG,EAAAA,QAAA,CAAgBrC,QAAcS,oBAC5Bb,eAsEP,OA9DIY,IACFyB,iBACEC,EAAAA,IAACI,mBAAA,IAAqB5B,EACnBd,SAAAqC,KAMH5B,IACF4B,mBACEC,IAACK,EAAAA,cACE3C,SAAAqC,KAMH3B,IACF2B,mBACEC,IAACM,EAAAA,qBACE5C,SAAAqC,KAMH7B,IACF6B,mBACEC,IAACO,EAAAA,kBACE7C,SAAAqC,KAMH9B,IACF8B,mBACEC,IAACQ,EAAAA,cACE9C,SAAAqC,KAMH1B,IACF0B,mBACEC,IAACS,EAAAA,eACE/C,SAAAqC,KAMHzC,GAAYiC,IACdQ,iBACEC,EAAAA,IAACU,EAAAA,SAAA,CAAAnB,MAAcA,EACZ7B,SAAAqC,KAKAA,8DA3Me,IAAMY,EAAAA,WAAWvD"}
@@ -1,5 +1,4 @@
1
1
  import { useState, useEffect } from "react";
2
- import { useLocation } from "react-router-dom";
3
2
  import { useTranslation } from "react-i18next";
4
3
  import { loadModuleTranslations } from "../../utils/translations/index.esm.js";
5
4
  import modules from "../../constants/modules/index.esm.js";
@@ -8,7 +7,7 @@ let globalIsLoading = false;
8
7
  let globalInitialLoad = true;
9
8
  const useAppTranslations = () => {
10
9
  const [isLoading, setIsLoading] = useState(globalInitialLoad);
11
- const location = useLocation();
10
+ const location = window.location;
12
11
  const { t } = useTranslation();
13
12
  useEffect(() => {
14
13
  const erpModules = modules(t);
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = useLocation()\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names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3,"file":"index.esm.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n// import { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = window.location\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":[],"mappings":";;;;AAOA,IAAI,0BAA0B;AAC9B,IAAI,kBAAkB;AACtB,IAAI,oBAAoB;AAEjB,MAAM,qBAAqB,MAAM;AACvC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,iBAAiB;AAC5D,QAAM,WAAW,OAAO;AACxB,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,YAAU,MAAM;AACf,UAAM,aAAa,QAAQ,CAAC;AAC5B,UAAM,cAAc,SAAS,SAAS,YAAA;AAEtC,UAAM,gBAAgB,WAAW;AAAA,MAChC,CAAC,QAAA;;AACA,mBAAI,KAAK,YAAA,MAAkB,iBAC3B,SAAI,oBAAJ,mBAAqB,KAAK,CAAC,UAAkB,YAAY,WAAW,MAAM,aAAa;AAAA;AAAA,IAAC;AAG1F,QAAI,gBAA0B,CAAA;AAE9B,QAAI,+CAAe,mBAAmB;AACrC,sBAAgB,CAAC,GAAG,cAAc,mBAAmB,QAAQ;AAAA,IAC9D,WAAW,CAAC,iBAAiB,gBAAgB,cAAc;AAC1D,sBAAgB,CAAC,QAAQ;AAAA,IAC1B;AAEA,QAAI,cAAc,SAAS,GAAG;AAC7B,YAAM,YAAY,CAAC,GAAG,aAAa,EAAE,KAAA,EAAO,KAAK,GAAG;AAGpD,UAAI,4BAA4B,aAAa,iBAAiB;AAC7D,YAAI,mBAAmB;AACtB,uBAAa,KAAK;AAClB,8BAAoB;AAAA,QACrB;AACA;AAAA,MACD;AAEA,wBAAkB;AAClB,gCAA0B;AAC1B,mBAAa,IAAI;AAEjB,6BAAuB,aAAa,EAAE,QAAQ,MAAM;AACnD,0BAAkB;AAClB,qBAAa,KAAK;AAClB,4BAAoB;AAAA,MACrB,CAAC;AAAA,IACF,OAAO;AAEN,UAAI,mBAAmB;AACtB,qBAAa,KAAK;AAClB,4BAAoB;AAAA,MACrB;AAAA,IACD;AAAA,EACD,GAAG,CAAC,SAAS,UAAU,CAAC,CAAC;AAEzB,SAAO,EAAE,UAAA;AACV;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-router-dom"),o=require("react-i18next"),r=require("../../utils/translations/index.js"),s=require("../../constants/modules/index.js");let n="",a=!1,i=!0;const l=()=>{const[l,u]=e.useState(i),d=t.useLocation(),{t:c}=o.useTranslation();return e.useEffect(()=>{const e=s.default(c),t=d.pathname.toLowerCase(),o=e.find(e=>{var o;return e.link.toLowerCase()===t||(null==(o=e.connectedRoutes)?void 0:o.some(e=>t.startsWith(e.toLowerCase())))});let l=[];if((null==o?void 0:o.translationModule)?l=[...o.translationModule,"common"]:o||"/dashboard"!==t||(l=["common"]),l.length>0){const e=[...l].sort().join(",");if(n===e||a)return void(i&&(u(!1),i=!1));a=!0,n=e,u(!0),r.loadModuleTranslations(l).finally(()=>{a=!1,u(!1),i=!1})}else i&&(u(!1),i=!1)},[d.pathname,c]),{isLoading:l}};exports.default=l,exports.useAppTranslations=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("react-i18next"),o=require("../../utils/translations/index.js"),n=require("../../constants/modules/index.js");let s="",r=!1,a=!0;const i=()=>{const[i,l]=e.useState(a),u=window.location,{t:d}=t.useTranslation();return e.useEffect(()=>{const e=n.default(d),t=u.pathname.toLowerCase(),i=e.find(e=>{var o;return e.link.toLowerCase()===t||(null==(o=e.connectedRoutes)?void 0:o.some(e=>t.startsWith(e.toLowerCase())))});let c=[];if((null==i?void 0:i.translationModule)?c=[...i.translationModule,"common"]:i||"/dashboard"!==t||(c=["common"]),c.length>0){const e=[...c].sort().join(",");if(s===e||r)return void(a&&(l(!1),a=!1));r=!0,s=e,l(!0),o.loadModuleTranslations(c).finally(()=>{r=!1,l(!1),a=!1})}else a&&(l(!1),a=!1)},[u.pathname,d]),{isLoading:i}};exports.default=i,exports.useAppTranslations=i;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = useLocation()\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":["globalLastLoadedModules","globalIsLoading","globalInitialLoad","useAppTranslations","isLoading","setIsLoading","useState","location","useLocation","t","useTranslation","useEffect","erpModules","modules","currentPath","pathname","toLowerCase","matchedModule","find","mod","link","_a","connectedRoutes","some","route","startsWith","modulesToLoad","translationModule","length","moduleKey","sort","join","loadModuleTranslations","finally"],"mappings":"iPAOA,IAAIA,EAA0B,GAC1BC,GAAkB,EAClBC,GAAoB,EAEjB,MAAMC,EAAqB,KACjC,MAAOC,EAAWC,GAAgBC,EAAAA,SAASJ,GACrCK,EAAWC,EAAAA,eACXC,EAAEA,GAAMC,mBAkDd,OAhDAC,EAAAA,UAAU,KACT,MAAMC,EAAaC,EAAAA,QAAQJ,GACrBK,EAAcP,EAASQ,SAASC,cAEhCC,EAAgBL,EAAWM,KAC/BC,UACA,OAAAA,EAAIC,KAAKJ,gBAAkBF,IAC3B,OAAAO,IAAIC,sBAAJ,EAAAD,EAAqBE,KAAMC,GAAkBV,EAAYW,WAAWD,EAAMR,mBAG5E,IAAIU,EAA0B,GAQ9B,UANIT,WAAeU,mBAClBD,EAAgB,IAAIT,EAAcU,kBAAmB,UAC1CV,GAAiC,eAAhBH,IAC5BY,EAAgB,CAAC,WAGdA,EAAcE,OAAS,EAAG,CAC7B,MAAMC,EAAY,IAAIH,GAAeI,OAAOC,KAAK,KAGjD,GAAI/B,IAA4B6B,GAAa5B,EAK5C,YAJIC,IACHG,GAAa,GACbH,GAAoB,IAKtBD,GAAkB,EAClBD,EAA0B6B,EAC1BxB,GAAa,GAEb2B,yBAAuBN,GAAeO,QAAQ,KAC7ChC,GAAkB,EAClBI,GAAa,GACbH,GAAoB,GAEtB,MAEKA,IACHG,GAAa,GACbH,GAAoB,IAGpB,CAACK,EAASQ,SAAUN,IAEhB,CAAEL"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/hooks/use-translations.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n// import { useLocation } from 'react-router-dom'\nimport { useTranslation } from 'react-i18next'\nimport { loadModuleTranslations } from '../utils/translations'\nimport modules from '../constants/modules'\n\n// Global state to prevent duplicate calls across all hook instances\nlet globalLastLoadedModules = ''\nlet globalIsLoading = false\nlet globalInitialLoad = true\n\nexport const useAppTranslations = () => {\n\tconst [isLoading, setIsLoading] = useState(globalInitialLoad)\n\tconst location = window.location\n\tconst { t } = useTranslation()\n\n\tuseEffect(() => {\n\t\tconst erpModules = modules(t)\n\t\tconst currentPath = location.pathname.toLowerCase()\n\n\t\tconst matchedModule = erpModules.find(\n\t\t\t(mod) =>\n\t\t\t\tmod.link.toLowerCase() === currentPath ||\n\t\t\t\tmod.connectedRoutes?.some((route: string) => currentPath.startsWith(route.toLowerCase()))\n\t\t)\n\n\t\tlet modulesToLoad: string[] = []\n\n\t\tif (matchedModule?.translationModule) {\n\t\t\tmodulesToLoad = [...matchedModule.translationModule, 'common']\n\t\t} else if (!matchedModule && currentPath === '/dashboard') {\n\t\t\tmodulesToLoad = ['common']\n\t\t}\n\n\t\tif (modulesToLoad.length > 0) {\n\t\t\tconst moduleKey = [...modulesToLoad].sort().join(',')\n\n\t\t\t// Skip if same modules are already loaded or currently loading\n\t\t\tif (globalLastLoadedModules === moduleKey || globalIsLoading) {\n\t\t\t\tif (globalInitialLoad) {\n\t\t\t\t\tsetIsLoading(false)\n\t\t\t\t\tglobalInitialLoad = false\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tglobalIsLoading = true\n\t\t\tglobalLastLoadedModules = moduleKey\n\t\t\tsetIsLoading(true)\n\n\t\t\tloadModuleTranslations(modulesToLoad).finally(() => {\n\t\t\t\tglobalIsLoading = false\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t})\n\t\t} else {\n\t\t\t// No modules to load, but still need to handle initial load state\n\t\t\tif (globalInitialLoad) {\n\t\t\t\tsetIsLoading(false)\n\t\t\t\tglobalInitialLoad = false\n\t\t\t}\n\t\t}\n\t}, [location.pathname, t])\n\n\treturn { isLoading }\n};\n\nexport default useAppTranslations;\n"],"names":["globalLastLoadedModules","globalIsLoading","globalInitialLoad","useAppTranslations","isLoading","setIsLoading","useState","location","window","t","useTranslation","useEffect","erpModules","modules","currentPath","pathname","toLowerCase","matchedModule","find","mod","link","_a","connectedRoutes","some","route","startsWith","modulesToLoad","translationModule","length","moduleKey","sort","join","loadModuleTranslations","finally"],"mappings":"mNAOA,IAAIA,EAA0B,GAC1BC,GAAkB,EAClBC,GAAoB,EAEjB,MAAMC,EAAqB,KACjC,MAAOC,EAAWC,GAAgBC,EAAAA,SAASJ,GACrCK,EAAWC,OAAOD,UAClBE,EAAEA,GAAMC,mBAkDd,OAhDAC,EAAAA,UAAU,KACT,MAAMC,EAAaC,EAAAA,QAAQJ,GACrBK,EAAcP,EAASQ,SAASC,cAEhCC,EAAgBL,EAAWM,KAC/BC,UACA,OAAAA,EAAIC,KAAKJ,gBAAkBF,IAC3B,OAAAO,IAAIC,sBAAJ,EAAAD,EAAqBE,KAAMC,GAAkBV,EAAYW,WAAWD,EAAMR,mBAG5E,IAAIU,EAA0B,GAQ9B,UANIT,WAAeU,mBAClBD,EAAgB,IAAIT,EAAcU,kBAAmB,UAC1CV,GAAiC,eAAhBH,IAC5BY,EAAgB,CAAC,WAGdA,EAAcE,OAAS,EAAG,CAC7B,MAAMC,EAAY,IAAIH,GAAeI,OAAOC,KAAK,KAGjD,GAAI/B,IAA4B6B,GAAa5B,EAK5C,YAJIC,IACHG,GAAa,GACbH,GAAoB,IAKtBD,GAAkB,EAClBD,EAA0B6B,EAC1BxB,GAAa,GAEb2B,yBAAuBN,GAAeO,QAAQ,KAC7ChC,GAAkB,EAClBI,GAAa,GACbH,GAAoB,GAEtB,MAEKA,IACHG,GAAa,GACbH,GAAoB,IAGpB,CAACK,EAASQ,SAAUN,IAEhB,CAAEL"}
@@ -1,5 +1,5 @@
1
1
  import { getDefaultExportFromCjs } from "../../../../../_virtual/_commonjsHelpers/index.esm.js";
2
- import { __module as dist } from "../../../../../_virtual/index/index.esm11.js";
2
+ import { __module as dist } from "../../../../../_virtual/index/index.esm2.js";
3
3
  import React__default from "react";
4
4
  import ReactDOM__default from "react-dom";
5
5
  import require$$0 from "react-is";