sevago-sso-fe 1.0.1 → 1.0.2

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.cjs.js CHANGED
@@ -4,12 +4,11 @@ const React = require("react");
4
4
  const material = require("@mui/material");
5
5
  const reactRedux = require("react-redux");
6
6
  const reactRouterDom = require("react-router-dom");
7
- const toolkit = require("@reduxjs/toolkit");
8
7
  const reduxPersist = require("redux-persist");
8
+ const toolkit = require("@reduxjs/toolkit");
9
9
  const system = require("@mui/system");
10
- const emStyled = require("@emotion/styled");
11
10
  require("@emotion/react");
12
- const ReactDOM = require("react-dom");
11
+ const emStyled = require("@emotion/styled");
13
12
  function _interopNamespaceDefault(e) {
14
13
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
15
14
  if (e) {
@@ -85,21 +84,21 @@ function requireReactJsxRuntime_production() {
85
84
  if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
86
85
  hasRequiredReactJsxRuntime_production = 1;
87
86
  var REACT_ELEMENT_TYPE2 = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
88
- function jsxProd(type, config2, maybeKey) {
87
+ function jsxProd(type, config, maybeKey) {
89
88
  var key = null;
90
89
  void 0 !== maybeKey && (key = "" + maybeKey);
91
- void 0 !== config2.key && (key = "" + config2.key);
92
- if ("key" in config2) {
90
+ void 0 !== config.key && (key = "" + config.key);
91
+ if ("key" in config) {
93
92
  maybeKey = {};
94
- for (var propName in config2)
95
- "key" !== propName && (maybeKey[propName] = config2[propName]);
96
- } else maybeKey = config2;
97
- config2 = maybeKey.ref;
93
+ for (var propName in config)
94
+ "key" !== propName && (maybeKey[propName] = config[propName]);
95
+ } else maybeKey = config;
96
+ config = maybeKey.ref;
98
97
  return {
99
98
  $$typeof: REACT_ELEMENT_TYPE2,
100
99
  type,
101
100
  key,
102
- ref: void 0 !== config2 ? config2 : null,
101
+ ref: void 0 !== config ? config : null,
103
102
  props: maybeKey
104
103
  };
105
104
  }
@@ -209,12 +208,12 @@ function requireReactJsxRuntime_development() {
209
208
  function UnknownOwner() {
210
209
  return Error("react-stack-top-frame");
211
210
  }
212
- function hasValidKey(config2) {
213
- if (hasOwnProperty2.call(config2, "key")) {
214
- var getter = Object.getOwnPropertyDescriptor(config2, "key").get;
211
+ function hasValidKey(config) {
212
+ if (hasOwnProperty2.call(config, "key")) {
213
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
215
214
  if (getter && getter.isReactWarning) return false;
216
215
  }
217
- return void 0 !== config2.key;
216
+ return void 0 !== config.key;
218
217
  }
219
218
  function defineKeyPropWarningGetter(props, displayName) {
220
219
  function warnAboutAccessingKey() {
@@ -278,8 +277,8 @@ function requireReactJsxRuntime_development() {
278
277
  Object.freeze && (Object.freeze(type.props), Object.freeze(type));
279
278
  return type;
280
279
  }
281
- function jsxDEVImpl(type, config2, maybeKey, isStaticChildren, debugStack, debugTask) {
282
- var children = config2.children;
280
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
281
+ var children = config.children;
283
282
  if (void 0 !== children)
284
283
  if (isStaticChildren)
285
284
  if (isArrayImpl(children)) {
@@ -291,9 +290,9 @@ function requireReactJsxRuntime_development() {
291
290
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
292
291
  );
293
292
  else validateChildKeys(children);
294
- if (hasOwnProperty2.call(config2, "key")) {
293
+ if (hasOwnProperty2.call(config, "key")) {
295
294
  children = getComponentNameFromType(type);
296
- var keys2 = Object.keys(config2).filter(function(k) {
295
+ var keys2 = Object.keys(config).filter(function(k) {
297
296
  return "key" !== k;
298
297
  });
299
298
  isStaticChildren = 0 < keys2.length ? "{key: someKey, " + keys2.join(": ..., ") + ": ...}" : "{key: someKey}";
@@ -307,12 +306,12 @@ function requireReactJsxRuntime_development() {
307
306
  }
308
307
  children = null;
309
308
  void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
310
- hasValidKey(config2) && (checkKeyStringCoercion(config2.key), children = "" + config2.key);
311
- if ("key" in config2) {
309
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
310
+ if ("key" in config) {
312
311
  maybeKey = {};
313
- for (var propName in config2)
314
- "key" !== propName && (maybeKey[propName] = config2[propName]);
315
- } else maybeKey = config2;
312
+ for (var propName in config)
313
+ "key" !== propName && (maybeKey[propName] = config[propName]);
314
+ } else maybeKey = config;
316
315
  children && defineKeyPropWarningGetter(
317
316
  maybeKey,
318
317
  "function" === typeof type ? type.displayName || type.name || "Unknown" : type
@@ -349,22 +348,22 @@ function requireReactJsxRuntime_development() {
349
348
  var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
350
349
  var didWarnAboutKeySpread = {};
351
350
  reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
352
- reactJsxRuntime_development.jsx = function(type, config2, maybeKey) {
351
+ reactJsxRuntime_development.jsx = function(type, config, maybeKey) {
353
352
  var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
354
353
  return jsxDEVImpl(
355
354
  type,
356
- config2,
355
+ config,
357
356
  maybeKey,
358
357
  false,
359
358
  trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
360
359
  trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
361
360
  );
362
361
  };
363
- reactJsxRuntime_development.jsxs = function(type, config2, maybeKey) {
362
+ reactJsxRuntime_development.jsxs = function(type, config, maybeKey) {
364
363
  var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
365
364
  return jsxDEVImpl(
366
365
  type,
367
- config2,
366
+ config,
368
367
  maybeKey,
369
368
  true,
370
369
  trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
@@ -2468,12 +2467,12 @@ function callIfFn(maybeFn, arg) {
2468
2467
  return typeof maybeFn === "function" ? maybeFn(arg) : maybeFn;
2469
2468
  }
2470
2469
  function unstable_createStyleFunctionSx() {
2471
- function getThemeValue(prop, val, theme, config2) {
2470
+ function getThemeValue(prop, val, theme, config) {
2472
2471
  const props = {
2473
2472
  [prop]: val,
2474
2473
  theme
2475
2474
  };
2476
- const options = config2[prop];
2475
+ const options = config[prop];
2477
2476
  if (!options) {
2478
2477
  return {
2479
2478
  [prop]: val
@@ -2520,7 +2519,7 @@ function unstable_createStyleFunctionSx() {
2520
2519
  if (!sx) {
2521
2520
  return null;
2522
2521
  }
2523
- const config2 = theme.unstable_sxConfig ?? defaultSxConfig;
2522
+ const config = theme.unstable_sxConfig ?? defaultSxConfig;
2524
2523
  function traverse(sxInput) {
2525
2524
  let sxObject = sxInput;
2526
2525
  if (typeof sxInput === "function") {
@@ -2538,8 +2537,8 @@ function unstable_createStyleFunctionSx() {
2538
2537
  const value2 = callIfFn(sxObject[styleKey], theme);
2539
2538
  if (value2 !== null && value2 !== void 0) {
2540
2539
  if (typeof value2 === "object") {
2541
- if (config2[styleKey]) {
2542
- css = merge$1(css, getThemeValue(styleKey, value2, theme, config2));
2540
+ if (config[styleKey]) {
2541
+ css = merge$1(css, getThemeValue(styleKey, value2, theme, config));
2543
2542
  } else {
2544
2543
  const breakpointsValues = handleBreakpoints({
2545
2544
  theme
@@ -2557,7 +2556,7 @@ function unstable_createStyleFunctionSx() {
2557
2556
  }
2558
2557
  }
2559
2558
  } else {
2560
- css = merge$1(css, getThemeValue(styleKey, value2, theme, config2));
2559
+ css = merge$1(css, getThemeValue(styleKey, value2, theme, config));
2561
2560
  }
2562
2561
  }
2563
2562
  });
@@ -3450,23 +3449,6 @@ function internal_serializeStyles(styles2) {
3450
3449
  wrapper[0] = styles2;
3451
3450
  return serializeStyles(wrapper);
3452
3451
  }
3453
- const specialProperty = "exact-prop: ​";
3454
- function exactProp(propTypes2) {
3455
- if (process.env.NODE_ENV === "production") {
3456
- return propTypes2;
3457
- }
3458
- return {
3459
- ...propTypes2,
3460
- [specialProperty]: (props) => {
3461
- const unsupportedProps = Object.keys(props).filter((prop) => !propTypes2.hasOwnProperty(prop));
3462
- if (unsupportedProps.length > 0) {
3463
- return new Error(`The following props are not supported: ${unsupportedProps.map((prop) => `\`${prop}\``).join(", ")}. Please remove them.`);
3464
- }
3465
- return null;
3466
- }
3467
- };
3468
- }
3469
- const useEnhancedEffect = typeof window !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
3470
3452
  function r(e) {
3471
3453
  var t, f, n = "";
3472
3454
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -3548,12 +3530,12 @@ function getThemeProps(params) {
3548
3530
  if (!theme || !theme.components || !theme.components[name2]) {
3549
3531
  return props;
3550
3532
  }
3551
- const config2 = theme.components[name2];
3552
- if (config2.defaultProps) {
3553
- return resolveProps(config2.defaultProps, props, theme.components.mergeClassNameAndStyle);
3533
+ const config = theme.components[name2];
3534
+ if (config.defaultProps) {
3535
+ return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
3554
3536
  }
3555
- if (!config2.styleOverrides && !config2.variants) {
3556
- return resolveProps(config2, props, theme.components.mergeClassNameAndStyle);
3537
+ if (!config.styleOverrides && !config.variants) {
3538
+ return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
3557
3539
  }
3558
3540
  return props;
3559
3541
  }
@@ -4969,6 +4951,23 @@ function useTheme() {
4969
4951
  }
4970
4952
  return theme[THEME_ID] || theme;
4971
4953
  }
4954
+ function GlobalStyles$1(props) {
4955
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(system.GlobalStyles, {
4956
+ ...props,
4957
+ defaultTheme,
4958
+ themeId: THEME_ID
4959
+ });
4960
+ }
4961
+ process.env.NODE_ENV !== "production" ? GlobalStyles$1.propTypes = {
4962
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
4963
+ // │ These PropTypes are generated from the TypeScript type definitions. │
4964
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
4965
+ // └─────────────────────────────────────────────────────────────────────┘
4966
+ /**
4967
+ * The styles you want to apply globally.
4968
+ */
4969
+ styles: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool])
4970
+ } : void 0;
4972
4971
  function getFunctionComponentName(Component2, fallback = "") {
4973
4972
  return Component2.displayName || Component2.name || fallback;
4974
4973
  }
@@ -5259,6 +5258,19 @@ const styled = createStyled({
5259
5258
  defaultTheme,
5260
5259
  rootShouldForwardProp
5261
5260
  });
5261
+ function globalCss(styles2) {
5262
+ return function GlobalStylesWrapper(props) {
5263
+ return (
5264
+ // Pigment CSS `globalCss` support callback with theme inside an object but `GlobalStyles` support theme as a callback value.
5265
+ /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStyles$1, {
5266
+ styles: typeof styles2 === "function" ? (theme) => styles2({
5267
+ theme,
5268
+ ...props
5269
+ }) : styles2
5270
+ })
5271
+ );
5272
+ };
5273
+ }
5262
5274
  process.env.NODE_ENV !== "production" ? {
5263
5275
  // ┌────────────────────────────── Warning ──────────────────────────────┐
5264
5276
  // │ These PropTypes are generated from the TypeScript type definitions. │
@@ -5276,6 +5288,147 @@ process.env.NODE_ENV !== "production" ? {
5276
5288
  function useDefaultProps(params) {
5277
5289
  return useDefaultProps$1(params);
5278
5290
  }
5291
+ const isDynamicSupport = typeof globalCss({}) === "function";
5292
+ const html = (theme, enableColorScheme) => ({
5293
+ WebkitFontSmoothing: "antialiased",
5294
+ // Antialiasing.
5295
+ MozOsxFontSmoothing: "grayscale",
5296
+ // Antialiasing.
5297
+ // Change from `box-sizing: content-box` so that `width`
5298
+ // is not affected by `padding` or `border`.
5299
+ boxSizing: "border-box",
5300
+ // Fix font resize problem in iOS
5301
+ WebkitTextSizeAdjust: "100%",
5302
+ // When used under CssVarsProvider, colorScheme should not be applied dynamically because it will generate the stylesheet twice for server-rendered applications.
5303
+ ...enableColorScheme && !theme.vars && {
5304
+ colorScheme: theme.palette.mode
5305
+ }
5306
+ });
5307
+ const body = (theme) => ({
5308
+ color: (theme.vars || theme).palette.text.primary,
5309
+ ...theme.typography.body1,
5310
+ backgroundColor: (theme.vars || theme).palette.background.default,
5311
+ "@media print": {
5312
+ // Save printer ink.
5313
+ backgroundColor: (theme.vars || theme).palette.common.white
5314
+ }
5315
+ });
5316
+ const styles = (theme, enableColorScheme = false) => {
5317
+ const colorSchemeStyles = {};
5318
+ if (enableColorScheme && theme.colorSchemes && typeof theme.getColorSchemeSelector === "function") {
5319
+ Object.entries(theme.colorSchemes).forEach(([key, scheme]) => {
5320
+ const selector = theme.getColorSchemeSelector(key);
5321
+ if (selector.startsWith("@")) {
5322
+ colorSchemeStyles[selector] = {
5323
+ ":root": {
5324
+ colorScheme: scheme.palette?.mode
5325
+ }
5326
+ };
5327
+ } else {
5328
+ colorSchemeStyles[selector.replace(/\s*&/, "")] = {
5329
+ colorScheme: scheme.palette?.mode
5330
+ };
5331
+ }
5332
+ });
5333
+ }
5334
+ let defaultStyles = {
5335
+ html: html(theme, enableColorScheme),
5336
+ "*, *::before, *::after": {
5337
+ boxSizing: "inherit"
5338
+ },
5339
+ "strong, b": {
5340
+ fontWeight: theme.typography.fontWeightBold
5341
+ },
5342
+ body: {
5343
+ margin: 0,
5344
+ // Remove the margin in all browsers.
5345
+ ...body(theme),
5346
+ // Add support for document.body.requestFullScreen().
5347
+ // Other elements, if background transparent, are not supported.
5348
+ "&::backdrop": {
5349
+ backgroundColor: (theme.vars || theme).palette.background.default
5350
+ }
5351
+ },
5352
+ ...colorSchemeStyles
5353
+ };
5354
+ const themeOverrides = theme.components?.MuiCssBaseline?.styleOverrides;
5355
+ if (themeOverrides) {
5356
+ defaultStyles = [defaultStyles, themeOverrides];
5357
+ }
5358
+ return defaultStyles;
5359
+ };
5360
+ const SELECTOR = "mui-ecs";
5361
+ const staticStyles = (theme) => {
5362
+ const result = styles(theme, false);
5363
+ const baseStyles = Array.isArray(result) ? result[0] : result;
5364
+ if (!theme.vars && baseStyles) {
5365
+ baseStyles.html[`:root:has(${SELECTOR})`] = {
5366
+ colorScheme: theme.palette.mode
5367
+ };
5368
+ }
5369
+ if (theme.colorSchemes) {
5370
+ Object.entries(theme.colorSchemes).forEach(([key, scheme]) => {
5371
+ const selector = theme.getColorSchemeSelector(key);
5372
+ if (selector.startsWith("@")) {
5373
+ baseStyles[selector] = {
5374
+ [`:root:not(:has(.${SELECTOR}))`]: {
5375
+ colorScheme: scheme.palette?.mode
5376
+ }
5377
+ };
5378
+ } else {
5379
+ baseStyles[selector.replace(/\s*&/, "")] = {
5380
+ [`&:not(:has(.${SELECTOR}))`]: {
5381
+ colorScheme: scheme.palette?.mode
5382
+ }
5383
+ };
5384
+ }
5385
+ });
5386
+ }
5387
+ return result;
5388
+ };
5389
+ const GlobalStyles = globalCss(isDynamicSupport ? ({
5390
+ theme,
5391
+ enableColorScheme
5392
+ }) => styles(theme, enableColorScheme) : ({
5393
+ theme
5394
+ }) => staticStyles(theme));
5395
+ function CssBaseline(inProps) {
5396
+ const props = useDefaultProps({
5397
+ props: inProps,
5398
+ name: "MuiCssBaseline"
5399
+ });
5400
+ const {
5401
+ children,
5402
+ enableColorScheme = false
5403
+ } = props;
5404
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(React__namespace.Fragment, {
5405
+ children: [isDynamicSupport && /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalStyles, {
5406
+ enableColorScheme
5407
+ }), !isDynamicSupport && !enableColorScheme && /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
5408
+ className: SELECTOR,
5409
+ style: {
5410
+ display: "none"
5411
+ }
5412
+ }), children]
5413
+ });
5414
+ }
5415
+ process.env.NODE_ENV !== "production" ? CssBaseline.propTypes = {
5416
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
5417
+ // │ These PropTypes are generated from the TypeScript type definitions. │
5418
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
5419
+ // └─────────────────────────────────────────────────────────────────────┘
5420
+ /**
5421
+ * You can wrap a node.
5422
+ */
5423
+ children: PropTypes.node,
5424
+ /**
5425
+ * Enable `color-scheme` CSS property to use `theme.palette.mode`.
5426
+ * For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
5427
+ * For browser support, check out https://caniuse.com/?search=color-scheme
5428
+ * @default false
5429
+ */
5430
+ enableColorScheme: PropTypes.bool
5431
+ } : void 0;
5279
5432
  const getDefaultsFromPostinstall = () => void 0;
5280
5433
  /**
5281
5434
  * @license
@@ -6746,12 +6899,12 @@ const ERROR_FACTORY$2 = new ErrorFactory("app", "Firebase", ERRORS);
6746
6899
  * limitations under the License.
6747
6900
  */
6748
6901
  class FirebaseAppImpl {
6749
- constructor(options, config2, container) {
6902
+ constructor(options, config, container) {
6750
6903
  this._isDeleted = false;
6751
6904
  this._options = { ...options };
6752
- this._config = { ...config2 };
6753
- this._name = config2.name;
6754
- this._automaticDataCollectionEnabled = config2.automaticDataCollectionEnabled;
6905
+ this._config = { ...config };
6906
+ this._name = config.name;
6907
+ this._automaticDataCollectionEnabled = config.automaticDataCollectionEnabled;
6755
6908
  this._container = container;
6756
6909
  this.container.addComponent(new Component(
6757
6910
  "app",
@@ -6805,12 +6958,12 @@ function initializeApp(_options, rawConfig = {}) {
6805
6958
  const name3 = rawConfig;
6806
6959
  rawConfig = { name: name3 };
6807
6960
  }
6808
- const config2 = {
6961
+ const config = {
6809
6962
  name: DEFAULT_ENTRY_NAME,
6810
6963
  automaticDataCollectionEnabled: true,
6811
6964
  ...rawConfig
6812
6965
  };
6813
- const name2 = config2.name;
6966
+ const name2 = config.name;
6814
6967
  if (typeof name2 !== "string" || !name2) {
6815
6968
  throw ERROR_FACTORY$2.create("bad-app-name", {
6816
6969
  appName: String(name2)
@@ -6825,7 +6978,7 @@ function initializeApp(_options, rawConfig = {}) {
6825
6978
  }
6826
6979
  const existingApp = _apps.get(name2);
6827
6980
  if (existingApp) {
6828
- if (deepEqual(options, existingApp.options) && deepEqual(config2, existingApp.config)) {
6981
+ if (deepEqual(options, existingApp.options) && deepEqual(config, existingApp.config)) {
6829
6982
  return existingApp;
6830
6983
  } else {
6831
6984
  throw ERROR_FACTORY$2.create("duplicate-app", { appName: name2 });
@@ -6835,7 +6988,7 @@ function initializeApp(_options, rawConfig = {}) {
6835
6988
  for (const component of _components.values()) {
6836
6989
  container.addComponent(component);
6837
6990
  }
6838
- const newApp = new FirebaseAppImpl(options, config2, container);
6991
+ const newApp = new FirebaseAppImpl(options, config, container);
6839
6992
  _apps.set(name2, newApp);
6840
6993
  return newApp;
6841
6994
  }
@@ -7361,7 +7514,7 @@ async function createInstallationRequest({ appConfig, heartbeatServiceProvider }
7361
7514
  headers.append("x-firebase-client", heartbeatsHeader);
7362
7515
  }
7363
7516
  }
7364
- const body = {
7517
+ const body2 = {
7365
7518
  fid,
7366
7519
  authVersion: INTERNAL_AUTH_VERSION,
7367
7520
  appId: appConfig.appId,
@@ -7370,7 +7523,7 @@ async function createInstallationRequest({ appConfig, heartbeatServiceProvider }
7370
7523
  const request = {
7371
7524
  method: "POST",
7372
7525
  headers,
7373
- body: JSON.stringify(body)
7526
+ body: JSON.stringify(body2)
7374
7527
  };
7375
7528
  const response = await retryIfServerError(() => fetch(endpoint, request));
7376
7529
  if (response.ok) {
@@ -7758,7 +7911,7 @@ async function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider },
7758
7911
  headers.append("x-firebase-client", heartbeatsHeader);
7759
7912
  }
7760
7913
  }
7761
- const body = {
7914
+ const body2 = {
7762
7915
  installation: {
7763
7916
  sdkVersion: PACKAGE_VERSION,
7764
7917
  appId: appConfig.appId
@@ -7767,7 +7920,7 @@ async function generateAuthTokenRequest({ appConfig, heartbeatServiceProvider },
7767
7920
  const request = {
7768
7921
  method: "POST",
7769
7922
  headers,
7770
- body: JSON.stringify(body)
7923
+ body: JSON.stringify(body2)
7771
7924
  };
7772
7925
  const response = await retryIfServerError(() => fetch(endpoint, request));
7773
7926
  if (response.ok) {
@@ -7951,7 +8104,7 @@ async function getId(installations) {
7951
8104
  * See the License for the specific language governing permissions and
7952
8105
  * limitations under the License.
7953
8106
  */
7954
- async function getToken(installations, forceRefresh = false) {
8107
+ async function getToken$2(installations, forceRefresh = false) {
7955
8108
  const installationsImpl = installations;
7956
8109
  await completeInstallationRegistration(installationsImpl);
7957
8110
  const authToken = await refreshAuthToken(installationsImpl, forceRefresh);
@@ -8043,7 +8196,7 @@ const internalFactory = (container) => {
8043
8196
  const installations = _getProvider(app2, INSTALLATIONS_NAME).getImmediate();
8044
8197
  const installationsInternal = {
8045
8198
  getId: () => getId(installations),
8046
- getToken: (forceRefresh) => getToken(installations, forceRefresh)
8199
+ getToken: (forceRefresh) => getToken$2(installations, forceRefresh)
8047
8200
  };
8048
8201
  return installationsInternal;
8049
8202
  };
@@ -8411,11 +8564,11 @@ const ERROR_FACTORY = new ErrorFactory("messaging", "Messaging", ERROR_MAP);
8411
8564
  */
8412
8565
  async function requestGetToken(firebaseDependencies, subscriptionOptions) {
8413
8566
  const headers = await getHeaders(firebaseDependencies);
8414
- const body = getBody(subscriptionOptions);
8567
+ const body2 = getBody(subscriptionOptions);
8415
8568
  const subscribeOptions = {
8416
8569
  method: "POST",
8417
8570
  headers,
8418
- body: JSON.stringify(body)
8571
+ body: JSON.stringify(body2)
8419
8572
  };
8420
8573
  let responseData;
8421
8574
  try {
@@ -8442,11 +8595,11 @@ async function requestGetToken(firebaseDependencies, subscriptionOptions) {
8442
8595
  }
8443
8596
  async function requestUpdateToken(firebaseDependencies, tokenDetails) {
8444
8597
  const headers = await getHeaders(firebaseDependencies);
8445
- const body = getBody(tokenDetails.subscriptionOptions);
8598
+ const body2 = getBody(tokenDetails.subscriptionOptions);
8446
8599
  const updateOptions = {
8447
8600
  method: "PATCH",
8448
8601
  headers,
8449
- body: JSON.stringify(body)
8602
+ body: JSON.stringify(body2)
8450
8603
  };
8451
8604
  let responseData;
8452
8605
  try {
@@ -8505,7 +8658,7 @@ async function getHeaders({ appConfig, installations }) {
8505
8658
  });
8506
8659
  }
8507
8660
  function getBody({ p256dh, auth, endpoint, vapidKey }) {
8508
- const body = {
8661
+ const body2 = {
8509
8662
  web: {
8510
8663
  endpoint,
8511
8664
  auth,
@@ -8513,9 +8666,9 @@ function getBody({ p256dh, auth, endpoint, vapidKey }) {
8513
8666
  }
8514
8667
  };
8515
8668
  if (vapidKey !== DEFAULT_VAPID_KEY) {
8516
- body.web.applicationPubKey = vapidKey;
8669
+ body2.web.applicationPubKey = vapidKey;
8517
8670
  }
8518
- return body;
8671
+ return body2;
8519
8672
  }
8520
8673
  /**
8521
8674
  * @license
@@ -8644,9 +8797,9 @@ function propagateNotificationPayload(payload, messagePayloadInternal) {
8644
8797
  if (!!title) {
8645
8798
  payload.notification.title = title;
8646
8799
  }
8647
- const body = messagePayloadInternal.notification.body;
8648
- if (!!body) {
8649
- payload.notification.body = body;
8800
+ const body2 = messagePayloadInternal.notification.body;
8801
+ if (!!body2) {
8802
+ payload.notification.body = body2;
8650
8803
  }
8651
8804
  const image = messagePayloadInternal.notification.image;
8652
8805
  if (!!image) {
@@ -9093,6 +9246,10 @@ function getMessagingInWindow(app2 = getApp()) {
9093
9246
  });
9094
9247
  return _getProvider(getModularInstance(app2), "messaging").getImmediate();
9095
9248
  }
9249
+ async function getToken(messaging2, options) {
9250
+ messaging2 = getModularInstance(messaging2);
9251
+ return getToken$1(messaging2, options);
9252
+ }
9096
9253
  registerMessagingInWindow();
9097
9254
  var name = "firebase";
9098
9255
  var version = "12.3.0";
@@ -9455,9 +9612,6 @@ var RouteType = /* @__PURE__ */ ((RouteType2) => {
9455
9612
  RouteType2["PROTECTED"] = "PROTECTED";
9456
9613
  return RouteType2;
9457
9614
  })(RouteType || {});
9458
- const DASHBOARD_BASE = "/dashboard";
9459
- const PREFIX_SETTING_JOB = "job-settings/";
9460
- const PREFIX_WORKFLOW_ENGINE = "/workflow";
9461
9615
  const ALLOW_USER_TYPES = [UserType.ADMIN, UserType.HR, UserType.User, UserType.C_B, UserType.ROOT];
9462
9616
  const PAGE = {
9463
9617
  // Public
@@ -9474,15 +9628,11 @@ const PAGE = {
9474
9628
  };
9475
9629
  const DASHBOARD_SCREEN = {
9476
9630
  DASHBOARD: {
9477
- path: "",
9478
- type: RouteType.PROTECTED,
9479
- allowUserTypes: ALLOW_USER_TYPES
9631
+ type: RouteType.PROTECTED
9480
9632
  },
9481
9633
  // dashboard
9482
9634
  PROJECT_DASHBOARD: {
9483
- path: "project-dashboard",
9484
- type: RouteType.PROTECTED,
9485
- allowUserTypes: ALLOW_USER_TYPES
9635
+ type: RouteType.PROTECTED
9486
9636
  },
9487
9637
  JOB_DASHBOARD: {
9488
9638
  path: "job-dashboard",
@@ -9490,208 +9640,151 @@ const DASHBOARD_SCREEN = {
9490
9640
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9491
9641
  },
9492
9642
  PROJECT_TASK_PROCESS: {
9493
- path: "process-dashboard",
9494
- type: RouteType.PROTECTED,
9495
- allowUserTypes: ALLOW_USER_TYPES
9643
+ type: RouteType.PROTECTED
9496
9644
  },
9497
9645
  // job
9498
9646
  JOB: {
9499
- path: "job-hr",
9500
9647
  type: RouteType.PROTECTED,
9501
9648
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9502
9649
  },
9503
9650
  JOB_RECRUITMENT: {
9504
- path: "job-recruitment",
9505
9651
  type: RouteType.PROTECTED,
9506
9652
  allowUserTypes: [UserType.ADMIN, UserType.User, UserType.C_B, UserType.ROOT]
9507
9653
  },
9508
9654
  JOB_RECRUITMENT_DETAIL: {
9509
- path: "job-recruitment/:id",
9510
9655
  type: RouteType.PROTECTED,
9511
9656
  allowUserTypes: [UserType.ADMIN, UserType.User, UserType.C_B, UserType.ROOT]
9512
9657
  },
9513
9658
  JOB_DETAIL: {
9514
- path: "job-hr/:id",
9515
9659
  type: RouteType.PROTECTED,
9516
9660
  allowUserTypes: [UserType.ADMIN, UserType.C_B, UserType.HR, UserType.ROOT]
9517
9661
  },
9518
9662
  //setting job parent
9519
9663
  JOB_TITLE: {
9520
- path: PREFIX_SETTING_JOB + "job-title",
9521
- type: RouteType.PROTECTED,
9522
- allowUserTypes: ALLOW_USER_TYPES
9664
+ type: RouteType.PROTECTED
9523
9665
  },
9524
9666
  JOB_BANNER: {
9525
- path: PREFIX_SETTING_JOB + "banner",
9526
9667
  type: RouteType.PROTECTED,
9527
9668
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9528
9669
  },
9529
9670
  JOB_SOCIAL: {
9530
- path: PREFIX_SETTING_JOB + "job-social",
9531
9671
  type: RouteType.PROTECTED,
9532
9672
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9533
9673
  },
9534
9674
  JOB_RECRUITMENT_HISTORY: {
9535
- path: PREFIX_SETTING_JOB + "history-recruitment",
9536
9675
  type: RouteType.PROTECTED,
9537
9676
  allowUserTypes: [UserType.ADMIN, UserType.User, UserType.C_B, UserType.ROOT]
9538
9677
  },
9539
9678
  INDUSTRY: {
9540
- path: PREFIX_SETTING_JOB + "industry",
9541
- type: RouteType.PROTECTED,
9542
- allowUserTypes: ALLOW_USER_TYPES
9679
+ type: RouteType.PROTECTED
9543
9680
  },
9544
9681
  EMAIL_TEMPLATE: {
9545
- path: PREFIX_SETTING_JOB + "email-template",
9546
9682
  type: RouteType.PROTECTED,
9547
9683
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9548
9684
  },
9549
9685
  FAQ: {
9550
- path: PREFIX_SETTING_JOB + "faq",
9551
9686
  type: RouteType.PROTECTED,
9552
9687
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9553
9688
  },
9554
9689
  SALARY: {
9555
- path: PREFIX_SETTING_JOB + "salary-range",
9556
- type: RouteType.PROTECTED,
9557
- allowUserTypes: ALLOW_USER_TYPES
9690
+ type: RouteType.PROTECTED
9558
9691
  },
9559
9692
  // application
9560
9693
  APPLICATION: {
9561
- path: "application-office",
9562
- type: RouteType.PROTECTED,
9563
- allowUserTypes: ALLOW_USER_TYPES
9694
+ type: RouteType.PROTECTED
9564
9695
  },
9565
9696
  APPLICATION_OPERATOR: {
9566
- path: "application-operator",
9567
9697
  type: RouteType.PROTECTED,
9568
9698
  allowUserTypes: [UserType.ADMIN, UserType.HR, UserType.ROOT]
9569
9699
  },
9570
9700
  // project - Phần này để tạm sẽ fix thêm 1 lần nữa
9571
9701
  PROJECT_TASK: {
9572
9702
  path: "project-task",
9573
- type: RouteType.PROTECTED,
9574
- allowUserTypes: ALLOW_USER_TYPES
9703
+ type: RouteType.PROTECTED
9575
9704
  },
9576
9705
  CREATE_PROJECT: {
9577
- path: "create-project",
9578
- type: RouteType.PROTECTED,
9579
- allowUserTypes: ALLOW_USER_TYPES
9706
+ type: RouteType.PROTECTED
9580
9707
  },
9581
9708
  DETAIL_PROJECT: {
9582
- path: "detail-project",
9583
- type: RouteType.PROTECTED,
9584
- allowUserTypes: ALLOW_USER_TYPES
9709
+ type: RouteType.PROTECTED
9585
9710
  },
9586
9711
  CREATE_TASK: {
9587
- path: "create-task",
9588
- type: RouteType.PROTECTED,
9589
- allowUserTypes: ALLOW_USER_TYPES
9712
+ type: RouteType.PROTECTED
9590
9713
  },
9591
9714
  ALL_PROJECT_OF_DIVISION: {
9592
- path: "all-project-of-division",
9593
- type: RouteType.PROTECTED,
9594
- allowUserTypes: ALLOW_USER_TYPES
9715
+ type: RouteType.PROTECTED
9595
9716
  },
9596
9717
  // org
9597
9718
  ORG_UNIT_TREE: {
9598
- path: "org-unit-tree",
9599
- type: RouteType.PROTECTED,
9600
- allowUserTypes: ALLOW_USER_TYPES
9719
+ type: RouteType.PROTECTED
9601
9720
  },
9602
9721
  ORG_UNIT_RESTORE: {
9603
- path: "org-unit-restore",
9604
- type: RouteType.PROTECTED,
9605
- allowUserTypes: ALLOW_USER_TYPES
9722
+ type: RouteType.PROTECTED
9606
9723
  },
9607
9724
  ORG_STRUCTURE: {
9608
9725
  path: "org-structure",
9609
- type: RouteType.PROTECTED,
9610
- allowUserTypes: ALLOW_USER_TYPES
9726
+ type: RouteType.PROTECTED
9611
9727
  },
9612
9728
  POSITION_TREE: {
9613
- path: "position-tree",
9614
- type: RouteType.PROTECTED,
9615
- allowUserTypes: ALLOW_USER_TYPES
9729
+ type: RouteType.PROTECTED
9616
9730
  },
9617
9731
  POSITION_RESTORE: {
9618
- path: "position-restore",
9619
- type: RouteType.PROTECTED,
9620
- allowUserTypes: ALLOW_USER_TYPES
9732
+ type: RouteType.PROTECTED
9621
9733
  },
9622
9734
  //user
9623
9735
  USER: {
9624
9736
  path: "user-list",
9625
- type: RouteType.PROTECTED,
9626
- allowUserTypes: ALLOW_USER_TYPES
9737
+ type: RouteType.PROTECTED
9627
9738
  },
9628
9739
  USER_RESTORE: {
9629
- path: "user-restore",
9630
- type: RouteType.PROTECTED,
9631
- allowUserTypes: ALLOW_USER_TYPES
9740
+ type: RouteType.PROTECTED
9632
9741
  },
9633
9742
  // other
9634
9743
  ACCOUNT: {
9635
9744
  path: "account",
9636
- type: RouteType.PROTECTED,
9637
- allowUserTypes: ALLOW_USER_TYPES
9745
+ type: RouteType.PROTECTED
9638
9746
  },
9639
9747
  NOTIFICATION: {
9640
- path: "notification",
9641
- type: RouteType.PROTECTED,
9642
- allowUserTypes: ALLOW_USER_TYPES
9748
+ type: RouteType.PROTECTED
9643
9749
  },
9644
9750
  // check in
9645
9751
  CHECK_IN: {
9646
9752
  path: "check-in",
9647
- type: RouteType.PROTECTED,
9648
- allowUserTypes: ALLOW_USER_TYPES
9753
+ type: RouteType.PROTECTED
9649
9754
  },
9650
9755
  // payroll
9651
9756
  PAYROLL: {
9652
9757
  path: "payroll",
9653
- type: RouteType.PROTECTED,
9654
- allowUserTypes: ALLOW_USER_TYPES
9758
+ type: RouteType.PROTECTED
9655
9759
  },
9656
9760
  // training
9657
9761
  TRAINING: {
9658
9762
  path: "training",
9659
- type: RouteType.PROTECTED,
9660
- allowUserTypes: ALLOW_USER_TYPES
9763
+ type: RouteType.PROTECTED
9661
9764
  },
9662
9765
  // truyền thông
9663
9766
  INSIDE: {
9664
9767
  path: "inside",
9665
- type: RouteType.PROTECTED,
9666
- allowUserTypes: ALLOW_USER_TYPES
9768
+ type: RouteType.PROTECTED
9667
9769
  },
9668
9770
  //list proposal
9669
9771
  PROPOSAL_SELECTOR: {
9670
- path: "proposal-selector",
9671
- type: RouteType.PROTECTED,
9672
- allowUserTypes: ALLOW_USER_TYPES
9772
+ type: RouteType.PROTECTED
9673
9773
  },
9674
9774
  // Các loại proposal workflow cụ thể
9675
9775
  PROPOSAL_WORKFLOW_PROJECT: {
9676
- path: "proposal-workflow/project-proposal",
9677
- type: RouteType.PROTECTED,
9678
- allowUserTypes: ALLOW_USER_TYPES
9776
+ type: RouteType.PROTECTED
9679
9777
  },
9680
9778
  PROPOSAL_WORKFLOW_JOB: {
9681
- path: "proposal-workflow/job-recruitment",
9682
- type: RouteType.PROTECTED,
9683
- allowUserTypes: ALLOW_USER_TYPES
9779
+ type: RouteType.PROTECTED
9684
9780
  },
9685
9781
  PROPOSAL_WORKFLOW_USER: {
9686
- path: "proposal-workflow/user-movement",
9687
- type: RouteType.PROTECTED,
9688
- allowUserTypes: ALLOW_USER_TYPES
9782
+ type: RouteType.PROTECTED
9689
9783
  },
9690
9784
  // Chat
9691
9785
  CHAT: {
9692
9786
  path: "chat",
9693
- type: RouteType.PROTECTED,
9694
- allowUserTypes: ALLOW_USER_TYPES
9787
+ type: RouteType.PROTECTED
9695
9788
  }
9696
9789
  };
9697
9790
  const BOOKING_SCREEN = {
@@ -9703,62 +9796,42 @@ const WORKFLOW_ENGINE_SCREEN = {
9703
9796
  //job
9704
9797
  PROPOSAL_JOB_RECRUITMENT: {
9705
9798
  path: "request-job",
9706
- type: RouteType.PROTECTED,
9707
- allowUserTypes: ALLOW_USER_TYPES
9799
+ type: RouteType.PROTECTED
9708
9800
  },
9709
9801
  PROPOSAL_WORKFLOW: {
9710
- path: ":type/:id",
9711
- type: RouteType.PROTECTED,
9712
- allowUserTypes: ALLOW_USER_TYPES
9802
+ type: RouteType.PROTECTED
9713
9803
  },
9714
9804
  // project
9715
9805
  PROPOSAL_PROJECT_TASK: {
9716
- path: "request-project",
9717
- type: RouteType.PROTECTED,
9718
- allowUserTypes: ALLOW_USER_TYPES
9806
+ type: RouteType.PROTECTED
9719
9807
  },
9720
9808
  //user
9721
9809
  PROPOSAL_USER_TRANSFER: {
9722
- path: "user-transfer",
9723
- type: RouteType.PROTECTED,
9724
- allowUserTypes: ALLOW_USER_TYPES
9810
+ type: RouteType.PROTECTED
9725
9811
  },
9726
9812
  PROPOSAL_USER_APPOINTMENT: {
9727
- path: "user-appointment",
9728
- type: RouteType.PROTECTED,
9729
- allowUserTypes: ALLOW_USER_TYPES
9813
+ type: RouteType.PROTECTED
9730
9814
  },
9731
9815
  PROPOSAL_USER_EXEMPTION: {
9732
- path: "user-exemption",
9733
- type: RouteType.PROTECTED,
9734
- allowUserTypes: ALLOW_USER_TYPES
9816
+ type: RouteType.PROTECTED
9735
9817
  },
9736
9818
  PROPOSAL_USER_WORKFLOW_APPOINTMENT: {
9737
- path: "user-appointment/:type",
9738
- type: RouteType.PROTECTED,
9739
- allowUserTypes: ALLOW_USER_TYPES
9819
+ type: RouteType.PROTECTED
9740
9820
  },
9741
9821
  PROPOSAL_USER_WORKFLOW_TRANSFER: {
9742
- path: "user-transfer/:type",
9743
- type: RouteType.PROTECTED,
9744
- allowUserTypes: ALLOW_USER_TYPES
9822
+ type: RouteType.PROTECTED
9745
9823
  },
9746
9824
  PROPOSAL_USER_WORKFLOW_DEMOTION: {
9747
- path: "user-exemption/:type",
9748
- type: RouteType.PROTECTED,
9749
- allowUserTypes: ALLOW_USER_TYPES
9825
+ type: RouteType.PROTECTED
9750
9826
  }
9751
9827
  };
9752
9828
  const WORKFLOW_TRACKING_SCREEN = {
9753
9829
  MY_TASK: {
9754
9830
  path: "my-task",
9755
- type: RouteType.PROTECTED,
9756
- allowUserTypes: ALLOW_USER_TYPES
9831
+ type: RouteType.PROTECTED
9757
9832
  },
9758
9833
  MY_WORK: {
9759
- path: "my-work",
9760
- type: RouteType.PROTECTED,
9761
- allowUserTypes: ALLOW_USER_TYPES
9834
+ type: RouteType.PROTECTED
9762
9835
  }
9763
9836
  };
9764
9837
  var AppCategory = /* @__PURE__ */ ((AppCategory2) => {
@@ -11001,6 +11074,24 @@ function requireStorage() {
11001
11074
  }
11002
11075
  var storageExports = requireStorage();
11003
11076
  const storage = /* @__PURE__ */ getDefaultExportFromCjs(storageExports);
11077
+ const changeMode = toolkit.createAsyncThunk("CHANGE_MODE", (currentMode) => {
11078
+ return currentMode === Mode.LIGHT ? Mode.DARK : Mode.LIGHT;
11079
+ });
11080
+ const initialStateSystem = {
11081
+ mode: Mode.LIGHT
11082
+ };
11083
+ const slice$1 = toolkit.createSlice({
11084
+ // Name Slice
11085
+ name: "system",
11086
+ initialState: initialStateSystem,
11087
+ reducers: {},
11088
+ extraReducers: (builder) => {
11089
+ builder.addCase(changeMode.fulfilled, (state, action) => {
11090
+ state.mode = action.payload;
11091
+ });
11092
+ }
11093
+ });
11094
+ const reducerSystem = slice$1.reducer;
11004
11095
  function bind(fn, thisArg) {
11005
11096
  return function wrap2() {
11006
11097
  return fn.apply(thisArg, arguments);
@@ -11273,7 +11364,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
11273
11364
  isArray$1(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
11274
11365
  return obj;
11275
11366
  };
11276
- const noop$2 = () => {
11367
+ const noop$1 = () => {
11277
11368
  };
11278
11369
  const toFiniteNumber = (value2, defaultValue) => {
11279
11370
  return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
@@ -11376,7 +11467,7 @@ const utils$1 = {
11376
11467
  freezeMethods,
11377
11468
  toObjectSet,
11378
11469
  toCamelCase,
11379
- noop: noop$2,
11470
+ noop: noop$1,
11380
11471
  toFiniteNumber,
11381
11472
  findKey,
11382
11473
  global: _global,
@@ -11389,7 +11480,7 @@ const utils$1 = {
11389
11480
  asap,
11390
11481
  isIterable
11391
11482
  };
11392
- function AxiosError$1(message, code, config2, request, response) {
11483
+ function AxiosError$1(message, code, config, request, response) {
11393
11484
  Error.call(this);
11394
11485
  if (Error.captureStackTrace) {
11395
11486
  Error.captureStackTrace(this, this.constructor);
@@ -11399,7 +11490,7 @@ function AxiosError$1(message, code, config2, request, response) {
11399
11490
  this.message = message;
11400
11491
  this.name = "AxiosError";
11401
11492
  code && (this.code = code);
11402
- config2 && (this.config = config2);
11493
+ config && (this.config = config);
11403
11494
  request && (this.request = request);
11404
11495
  if (response) {
11405
11496
  this.response = response;
@@ -11448,7 +11539,7 @@ const descriptors = {};
11448
11539
  });
11449
11540
  Object.defineProperties(AxiosError$1, descriptors);
11450
11541
  Object.defineProperty(prototype$1, "isAxiosError", { value: true });
11451
- AxiosError$1.from = (error, code, config2, request, response, customProps) => {
11542
+ AxiosError$1.from = (error, code, config, request, response, customProps) => {
11452
11543
  const axiosError = Object.create(prototype$1);
11453
11544
  utils$1.toFlatObject(error, axiosError, function filter3(obj) {
11454
11545
  return obj !== Error.prototype;
@@ -11457,7 +11548,7 @@ AxiosError$1.from = (error, code, config2, request, response, customProps) => {
11457
11548
  });
11458
11549
  const msg = error && error.message ? error.message : "Error";
11459
11550
  const errCode = code == null && error ? error.code : code;
11460
- AxiosError$1.call(axiosError, msg, errCode, config2, request, response);
11551
+ AxiosError$1.call(axiosError, msg, errCode, config, request, response);
11461
11552
  if (error && axiosError.cause == null) {
11462
11553
  Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
11463
11554
  }
@@ -12173,12 +12264,12 @@ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value: value2 }, key) =>
12173
12264
  });
12174
12265
  utils$1.freezeMethods(AxiosHeaders$1);
12175
12266
  function transformData(fns, response) {
12176
- const config2 = this || defaults;
12177
- const context = response || config2;
12267
+ const config = this || defaults;
12268
+ const context = response || config;
12178
12269
  const headers = AxiosHeaders$1.from(context.headers);
12179
12270
  let data = context.data;
12180
12271
  utils$1.forEach(fns, function transform(fn) {
12181
- data = fn.call(config2, data, headers.normalize(), response ? response.status : void 0);
12272
+ data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
12182
12273
  });
12183
12274
  headers.normalize();
12184
12275
  return data;
@@ -12186,8 +12277,8 @@ function transformData(fns, response) {
12186
12277
  function isCancel$1(value2) {
12187
12278
  return !!(value2 && value2.__CANCEL__);
12188
12279
  }
12189
- function CanceledError$1(message, config2, request) {
12190
- AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config2, request);
12280
+ function CanceledError$1(message, config, request) {
12281
+ AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
12191
12282
  this.name = "CanceledError";
12192
12283
  }
12193
12284
  utils$1.inherits(CanceledError$1, AxiosError$1, {
@@ -12363,7 +12454,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
12363
12454
  const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
12364
12455
  function mergeConfig$1(config1, config2) {
12365
12456
  config2 = config2 || {};
12366
- const config3 = {};
12457
+ const config = {};
12367
12458
  function getMergedValue(target, source, prop, caseless) {
12368
12459
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
12369
12460
  return utils$1.merge.call({ caseless }, target, source);
@@ -12434,15 +12525,15 @@ function mergeConfig$1(config1, config2) {
12434
12525
  utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
12435
12526
  const merge2 = mergeMap[prop] || mergeDeepProperties;
12436
12527
  const configValue = merge2(config1[prop], config2[prop], prop);
12437
- utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue);
12528
+ utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
12438
12529
  });
12439
- return config3;
12530
+ return config;
12440
12531
  }
12441
- const resolveConfig = (config2) => {
12442
- const newConfig = mergeConfig$1({}, config2);
12532
+ const resolveConfig = (config) => {
12533
+ const newConfig = mergeConfig$1({}, config);
12443
12534
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
12444
12535
  newConfig.headers = headers = AxiosHeaders$1.from(headers);
12445
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config2.params, config2.paramsSerializer);
12536
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
12446
12537
  if (auth) {
12447
12538
  headers.set(
12448
12539
  "Authorization",
@@ -12474,9 +12565,9 @@ const resolveConfig = (config2) => {
12474
12565
  return newConfig;
12475
12566
  };
12476
12567
  const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
12477
- const xhrAdapter = isXHRAdapterSupported && function(config2) {
12568
+ const xhrAdapter = isXHRAdapterSupported && function(config) {
12478
12569
  return new Promise(function dispatchXhrRequest(resolve, reject) {
12479
- const _config = resolveConfig(config2);
12570
+ const _config = resolveConfig(config);
12480
12571
  let requestData = _config.data;
12481
12572
  const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
12482
12573
  let { responseType, onUploadProgress, onDownloadProgress } = _config;
@@ -12505,7 +12596,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config2) {
12505
12596
  status: request.status,
12506
12597
  statusText: request.statusText,
12507
12598
  headers: responseHeaders,
12508
- config: config2,
12599
+ config,
12509
12600
  request
12510
12601
  };
12511
12602
  settle(function _resolve(value2) {
@@ -12534,12 +12625,12 @@ const xhrAdapter = isXHRAdapterSupported && function(config2) {
12534
12625
  if (!request) {
12535
12626
  return;
12536
12627
  }
12537
- reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config2, request));
12628
+ reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
12538
12629
  request = null;
12539
12630
  };
12540
12631
  request.onerror = function handleError(event) {
12541
12632
  const msg = event && event.message ? event.message : "Network Error";
12542
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config2, request);
12633
+ const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
12543
12634
  err.event = event || null;
12544
12635
  reject(err);
12545
12636
  request = null;
@@ -12553,7 +12644,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config2) {
12553
12644
  reject(new AxiosError$1(
12554
12645
  timeoutErrorMessage,
12555
12646
  transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
12556
- config2,
12647
+ config,
12557
12648
  request
12558
12649
  ));
12559
12650
  request = null;
@@ -12584,7 +12675,7 @@ const xhrAdapter = isXHRAdapterSupported && function(config2) {
12584
12675
  if (!request) {
12585
12676
  return;
12586
12677
  }
12587
- reject(!cancel || cancel.type ? new CanceledError$1(null, config2, request) : cancel);
12678
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
12588
12679
  request.abort();
12589
12680
  request = null;
12590
12681
  };
@@ -12595,15 +12686,15 @@ const xhrAdapter = isXHRAdapterSupported && function(config2) {
12595
12686
  }
12596
12687
  const protocol2 = parseProtocol(_config.url);
12597
12688
  if (protocol2 && platform.protocols.indexOf(protocol2) === -1) {
12598
- reject(new AxiosError$1("Unsupported protocol " + protocol2 + ":", AxiosError$1.ERR_BAD_REQUEST, config2));
12689
+ reject(new AxiosError$1("Unsupported protocol " + protocol2 + ":", AxiosError$1.ERR_BAD_REQUEST, config));
12599
12690
  return;
12600
12691
  }
12601
12692
  request.send(requestData || null);
12602
12693
  });
12603
12694
  };
12604
- const composeSignals = (signals, timeout2) => {
12695
+ const composeSignals = (signals, timeout) => {
12605
12696
  const { length } = signals = signals ? signals.filter(Boolean) : [];
12606
- if (timeout2 || length) {
12697
+ if (timeout || length) {
12607
12698
  let controller = new AbortController();
12608
12699
  let aborted;
12609
12700
  const onabort = function(reason) {
@@ -12614,10 +12705,10 @@ const composeSignals = (signals, timeout2) => {
12614
12705
  controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
12615
12706
  }
12616
12707
  };
12617
- let timer = timeout2 && setTimeout(() => {
12708
+ let timer = timeout && setTimeout(() => {
12618
12709
  timer = null;
12619
- onabort(new AxiosError$1(`timeout ${timeout2} of ms exceeded`, AxiosError$1.ETIMEDOUT));
12620
- }, timeout2);
12710
+ onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
12711
+ }, timeout);
12621
12712
  const unsubscribe = () => {
12622
12713
  if (signals) {
12623
12714
  timer && clearTimeout(timer);
@@ -12757,61 +12848,61 @@ const factory = (env) => {
12757
12848
  };
12758
12849
  isFetchSupported && (() => {
12759
12850
  ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
12760
- !resolvers[type] && (resolvers[type] = (res, config2) => {
12851
+ !resolvers[type] && (resolvers[type] = (res, config) => {
12761
12852
  let method = res && res[type];
12762
12853
  if (method) {
12763
12854
  return method.call(res);
12764
12855
  }
12765
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config2);
12856
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
12766
12857
  });
12767
12858
  });
12768
12859
  })();
12769
- const getBodyLength = async (body) => {
12770
- if (body == null) {
12860
+ const getBodyLength = async (body2) => {
12861
+ if (body2 == null) {
12771
12862
  return 0;
12772
12863
  }
12773
- if (utils$1.isBlob(body)) {
12774
- return body.size;
12864
+ if (utils$1.isBlob(body2)) {
12865
+ return body2.size;
12775
12866
  }
12776
- if (utils$1.isSpecCompliantForm(body)) {
12867
+ if (utils$1.isSpecCompliantForm(body2)) {
12777
12868
  const _request = new Request2(platform.origin, {
12778
12869
  method: "POST",
12779
- body
12870
+ body: body2
12780
12871
  });
12781
12872
  return (await _request.arrayBuffer()).byteLength;
12782
12873
  }
12783
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
12784
- return body.byteLength;
12874
+ if (utils$1.isArrayBufferView(body2) || utils$1.isArrayBuffer(body2)) {
12875
+ return body2.byteLength;
12785
12876
  }
12786
- if (utils$1.isURLSearchParams(body)) {
12787
- body = body + "";
12877
+ if (utils$1.isURLSearchParams(body2)) {
12878
+ body2 = body2 + "";
12788
12879
  }
12789
- if (utils$1.isString(body)) {
12790
- return (await encodeText(body)).byteLength;
12880
+ if (utils$1.isString(body2)) {
12881
+ return (await encodeText(body2)).byteLength;
12791
12882
  }
12792
12883
  };
12793
- const resolveBodyLength = async (headers, body) => {
12884
+ const resolveBodyLength = async (headers, body2) => {
12794
12885
  const length = utils$1.toFiniteNumber(headers.getContentLength());
12795
- return length == null ? getBodyLength(body) : length;
12886
+ return length == null ? getBodyLength(body2) : length;
12796
12887
  };
12797
- return async (config2) => {
12888
+ return async (config) => {
12798
12889
  let {
12799
12890
  url: url2,
12800
12891
  method,
12801
12892
  data,
12802
12893
  signal,
12803
12894
  cancelToken,
12804
- timeout: timeout2,
12895
+ timeout,
12805
12896
  onDownloadProgress,
12806
12897
  onUploadProgress,
12807
12898
  responseType,
12808
12899
  headers,
12809
12900
  withCredentials = "same-origin",
12810
12901
  fetchOptions
12811
- } = resolveConfig(config2);
12902
+ } = resolveConfig(config);
12812
12903
  let _fetch = envFetch || fetch;
12813
12904
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
12814
- let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout2);
12905
+ let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
12815
12906
  let request = null;
12816
12907
  const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
12817
12908
  composedSignal.unsubscribe();
@@ -12871,7 +12962,7 @@ const factory = (env) => {
12871
12962
  );
12872
12963
  }
12873
12964
  responseType = responseType || "text";
12874
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config2);
12965
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
12875
12966
  !isStreamResponse && unsubscribe && unsubscribe();
12876
12967
  return await new Promise((resolve, reject) => {
12877
12968
  settle(resolve, reject, {
@@ -12879,7 +12970,7 @@ const factory = (env) => {
12879
12970
  headers: AxiosHeaders$1.from(response.headers),
12880
12971
  status: response.status,
12881
12972
  statusText: response.statusText,
12882
- config: config2,
12973
+ config,
12883
12974
  request
12884
12975
  });
12885
12976
  });
@@ -12887,19 +12978,19 @@ const factory = (env) => {
12887
12978
  unsubscribe && unsubscribe();
12888
12979
  if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
12889
12980
  throw Object.assign(
12890
- new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config2, request),
12981
+ new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
12891
12982
  {
12892
12983
  cause: err.cause || err
12893
12984
  }
12894
12985
  );
12895
12986
  }
12896
- throw AxiosError$1.from(err, err && err.code, config2, request);
12987
+ throw AxiosError$1.from(err, err && err.code, config, request);
12897
12988
  }
12898
12989
  };
12899
12990
  };
12900
12991
  const seedCache = /* @__PURE__ */ new Map();
12901
- const getFetch = (config2) => {
12902
- let env = config2 ? config2.env : {};
12992
+ const getFetch = (config) => {
12993
+ let env = config ? config.env : {};
12903
12994
  const { fetch: fetch2, Request: Request2, Response } = env;
12904
12995
  const seeds = [
12905
12996
  Request2,
@@ -12935,7 +13026,7 @@ utils$1.forEach(knownAdapters, (fn, value2) => {
12935
13026
  const renderReason = (reason) => `- ${reason}`;
12936
13027
  const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
12937
13028
  const adapters = {
12938
- getAdapter: (adapters2, config2) => {
13029
+ getAdapter: (adapters2, config) => {
12939
13030
  adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
12940
13031
  const { length } = adapters2;
12941
13032
  let nameOrAdapter;
@@ -12951,7 +13042,7 @@ const adapters = {
12951
13042
  throw new AxiosError$1(`Unknown adapter '${id2}'`);
12952
13043
  }
12953
13044
  }
12954
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config2)))) {
13045
+ if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
12955
13046
  break;
12956
13047
  }
12957
13048
  rejectedReasons[id2 || "#" + i] = adapter;
@@ -12970,41 +13061,41 @@ const adapters = {
12970
13061
  },
12971
13062
  adapters: knownAdapters
12972
13063
  };
12973
- function throwIfCancellationRequested(config2) {
12974
- if (config2.cancelToken) {
12975
- config2.cancelToken.throwIfRequested();
13064
+ function throwIfCancellationRequested(config) {
13065
+ if (config.cancelToken) {
13066
+ config.cancelToken.throwIfRequested();
12976
13067
  }
12977
- if (config2.signal && config2.signal.aborted) {
12978
- throw new CanceledError$1(null, config2);
13068
+ if (config.signal && config.signal.aborted) {
13069
+ throw new CanceledError$1(null, config);
12979
13070
  }
12980
13071
  }
12981
- function dispatchRequest(config2) {
12982
- throwIfCancellationRequested(config2);
12983
- config2.headers = AxiosHeaders$1.from(config2.headers);
12984
- config2.data = transformData.call(
12985
- config2,
12986
- config2.transformRequest
13072
+ function dispatchRequest(config) {
13073
+ throwIfCancellationRequested(config);
13074
+ config.headers = AxiosHeaders$1.from(config.headers);
13075
+ config.data = transformData.call(
13076
+ config,
13077
+ config.transformRequest
12987
13078
  );
12988
- if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
12989
- config2.headers.setContentType("application/x-www-form-urlencoded", false);
13079
+ if (["post", "put", "patch"].indexOf(config.method) !== -1) {
13080
+ config.headers.setContentType("application/x-www-form-urlencoded", false);
12990
13081
  }
12991
- const adapter = adapters.getAdapter(config2.adapter || defaults.adapter, config2);
12992
- return adapter(config2).then(function onAdapterResolution(response) {
12993
- throwIfCancellationRequested(config2);
13082
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
13083
+ return adapter(config).then(function onAdapterResolution(response) {
13084
+ throwIfCancellationRequested(config);
12994
13085
  response.data = transformData.call(
12995
- config2,
12996
- config2.transformResponse,
13086
+ config,
13087
+ config.transformResponse,
12997
13088
  response
12998
13089
  );
12999
13090
  response.headers = AxiosHeaders$1.from(response.headers);
13000
13091
  return response;
13001
13092
  }, function onAdapterRejection(reason) {
13002
13093
  if (!isCancel$1(reason)) {
13003
- throwIfCancellationRequested(config2);
13094
+ throwIfCancellationRequested(config);
13004
13095
  if (reason && reason.response) {
13005
13096
  reason.response.data = transformData.call(
13006
- config2,
13007
- config2.transformResponse,
13097
+ config,
13098
+ config.transformResponse,
13008
13099
  reason.response
13009
13100
  );
13010
13101
  reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
@@ -13072,11 +13163,11 @@ function assertOptions(options, schema, allowUnknown) {
13072
13163
  }
13073
13164
  }
13074
13165
  }
13075
- const validator$1 = {
13166
+ const validator = {
13076
13167
  assertOptions,
13077
13168
  validators: validators$1
13078
13169
  };
13079
- const validators = validator$1.validators;
13170
+ const validators = validator.validators;
13080
13171
  let Axios$1 = class Axios {
13081
13172
  constructor(instanceConfig) {
13082
13173
  this.defaults = instanceConfig || {};
@@ -13093,9 +13184,9 @@ let Axios$1 = class Axios {
13093
13184
  *
13094
13185
  * @returns {Promise} The Promise to be fulfilled
13095
13186
  */
13096
- async request(configOrUrl, config2) {
13187
+ async request(configOrUrl, config) {
13097
13188
  try {
13098
- return await this._request(configOrUrl, config2);
13189
+ return await this._request(configOrUrl, config);
13099
13190
  } catch (err) {
13100
13191
  if (err instanceof Error) {
13101
13192
  let dummy = {};
@@ -13113,17 +13204,17 @@ let Axios$1 = class Axios {
13113
13204
  throw err;
13114
13205
  }
13115
13206
  }
13116
- _request(configOrUrl, config2) {
13207
+ _request(configOrUrl, config) {
13117
13208
  if (typeof configOrUrl === "string") {
13118
- config2 = config2 || {};
13119
- config2.url = configOrUrl;
13209
+ config = config || {};
13210
+ config.url = configOrUrl;
13120
13211
  } else {
13121
- config2 = configOrUrl || {};
13212
+ config = configOrUrl || {};
13122
13213
  }
13123
- config2 = mergeConfig$1(this.defaults, config2);
13124
- const { transitional: transitional2, paramsSerializer, headers } = config2;
13214
+ config = mergeConfig$1(this.defaults, config);
13215
+ const { transitional: transitional2, paramsSerializer, headers } = config;
13125
13216
  if (transitional2 !== void 0) {
13126
- validator$1.assertOptions(transitional2, {
13217
+ validator.assertOptions(transitional2, {
13127
13218
  silentJSONParsing: validators.transitional(validators.boolean),
13128
13219
  forcedJSONParsing: validators.transitional(validators.boolean),
13129
13220
  clarifyTimeoutError: validators.transitional(validators.boolean)
@@ -13131,30 +13222,30 @@ let Axios$1 = class Axios {
13131
13222
  }
13132
13223
  if (paramsSerializer != null) {
13133
13224
  if (utils$1.isFunction(paramsSerializer)) {
13134
- config2.paramsSerializer = {
13225
+ config.paramsSerializer = {
13135
13226
  serialize: paramsSerializer
13136
13227
  };
13137
13228
  } else {
13138
- validator$1.assertOptions(paramsSerializer, {
13229
+ validator.assertOptions(paramsSerializer, {
13139
13230
  encode: validators.function,
13140
13231
  serialize: validators.function
13141
13232
  }, true);
13142
13233
  }
13143
13234
  }
13144
- if (config2.allowAbsoluteUrls !== void 0) ;
13235
+ if (config.allowAbsoluteUrls !== void 0) ;
13145
13236
  else if (this.defaults.allowAbsoluteUrls !== void 0) {
13146
- config2.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
13237
+ config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
13147
13238
  } else {
13148
- config2.allowAbsoluteUrls = true;
13239
+ config.allowAbsoluteUrls = true;
13149
13240
  }
13150
- validator$1.assertOptions(config2, {
13241
+ validator.assertOptions(config, {
13151
13242
  baseUrl: validators.spelling("baseURL"),
13152
13243
  withXsrfToken: validators.spelling("withXSRFToken")
13153
13244
  }, true);
13154
- config2.method = (config2.method || this.defaults.method || "get").toLowerCase();
13245
+ config.method = (config.method || this.defaults.method || "get").toLowerCase();
13155
13246
  let contextHeaders = headers && utils$1.merge(
13156
13247
  headers.common,
13157
- headers[config2.method]
13248
+ headers[config.method]
13158
13249
  );
13159
13250
  headers && utils$1.forEach(
13160
13251
  ["delete", "get", "head", "post", "put", "patch", "common"],
@@ -13162,11 +13253,11 @@ let Axios$1 = class Axios {
13162
13253
  delete headers[method];
13163
13254
  }
13164
13255
  );
13165
- config2.headers = AxiosHeaders$1.concat(contextHeaders, headers);
13256
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
13166
13257
  const requestInterceptorChain = [];
13167
13258
  let synchronousRequestInterceptors = true;
13168
13259
  this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
13169
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
13260
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
13170
13261
  return;
13171
13262
  }
13172
13263
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
@@ -13184,14 +13275,14 @@ let Axios$1 = class Axios {
13184
13275
  chain.unshift(...requestInterceptorChain);
13185
13276
  chain.push(...responseInterceptorChain);
13186
13277
  len = chain.length;
13187
- promise = Promise.resolve(config2);
13278
+ promise = Promise.resolve(config);
13188
13279
  while (i < len) {
13189
13280
  promise = promise.then(chain[i++], chain[i++]);
13190
13281
  }
13191
13282
  return promise;
13192
13283
  }
13193
13284
  len = requestInterceptorChain.length;
13194
- let newConfig = config2;
13285
+ let newConfig = config;
13195
13286
  while (i < len) {
13196
13287
  const onFulfilled = requestInterceptorChain[i++];
13197
13288
  const onRejected = requestInterceptorChain[i++];
@@ -13214,25 +13305,25 @@ let Axios$1 = class Axios {
13214
13305
  }
13215
13306
  return promise;
13216
13307
  }
13217
- getUri(config2) {
13218
- config2 = mergeConfig$1(this.defaults, config2);
13219
- const fullPath = buildFullPath(config2.baseURL, config2.url, config2.allowAbsoluteUrls);
13220
- return buildURL(fullPath, config2.params, config2.paramsSerializer);
13308
+ getUri(config) {
13309
+ config = mergeConfig$1(this.defaults, config);
13310
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
13311
+ return buildURL(fullPath, config.params, config.paramsSerializer);
13221
13312
  }
13222
13313
  };
13223
13314
  utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
13224
- Axios$1.prototype[method] = function(url2, config2) {
13225
- return this.request(mergeConfig$1(config2 || {}, {
13315
+ Axios$1.prototype[method] = function(url2, config) {
13316
+ return this.request(mergeConfig$1(config || {}, {
13226
13317
  method,
13227
13318
  url: url2,
13228
- data: (config2 || {}).data
13319
+ data: (config || {}).data
13229
13320
  }));
13230
13321
  };
13231
13322
  });
13232
13323
  utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
13233
13324
  function generateHTTPMethod(isForm) {
13234
- return function httpMethod(url2, data, config2) {
13235
- return this.request(mergeConfig$1(config2 || {}, {
13325
+ return function httpMethod(url2, data, config) {
13326
+ return this.request(mergeConfig$1(config || {}, {
13236
13327
  method,
13237
13328
  headers: isForm ? {
13238
13329
  "Content-Type": "multipart/form-data"
@@ -13274,11 +13365,11 @@ let CancelToken$1 = class CancelToken {
13274
13365
  };
13275
13366
  return promise;
13276
13367
  };
13277
- executor(function cancel(message, config2, request) {
13368
+ executor(function cancel(message, config, request) {
13278
13369
  if (token.reason) {
13279
13370
  return;
13280
13371
  }
13281
- token.reason = new CanceledError$1(message, config2, request);
13372
+ token.reason = new CanceledError$1(message, config, request);
13282
13373
  resolvePromise(token.reason);
13283
13374
  });
13284
13375
  }
@@ -13486,35 +13577,17 @@ const remainingWeightSlice = toolkit.createSlice({
13486
13577
  const { setRemainingWeight, updateRemainingWeight, resetRemainingWeight } = remainingWeightSlice.actions;
13487
13578
  const remainingWeightReducer = remainingWeightSlice.reducer;
13488
13579
  const ACTION_ACCOUNT = accountActions;
13489
- const changeMode = toolkit.createAsyncThunk("CHANGE_MODE", (currentMode) => {
13490
- return currentMode === Mode.LIGHT ? Mode.DARK : Mode.LIGHT;
13491
- });
13492
- const initialStateSystem = {
13493
- mode: Mode.LIGHT
13494
- };
13495
- const slice$1 = toolkit.createSlice({
13496
- // Name Slice
13497
- name: "system",
13498
- initialState: initialStateSystem,
13499
- reducers: {},
13500
- extraReducers: (builder) => {
13501
- builder.addCase(changeMode.fulfilled, (state, action) => {
13502
- state.mode = action.payload;
13503
- });
13504
- }
13505
- });
13506
- const reducerSystem = slice$1.reducer;
13507
13580
  const axiosRequest = axios.create({
13508
13581
  baseURL: "https://dev.be.office.sevago.local",
13509
13582
  timeout: 2e4,
13510
13583
  headers: { "Content-Type": "application/json", "X-CSRF-TOKEN": "CSRF-Token" },
13511
13584
  withCredentials: true
13512
13585
  });
13513
- axiosRequest.interceptors.request.use(async (config2) => {
13586
+ axiosRequest.interceptors.request.use(async (config) => {
13514
13587
  const { userUnitPositionId, accessToken } = store.getState().account;
13515
- if (accessToken) config2.headers.Authorization = `Bearer ${accessToken}`;
13516
- if (userUnitPositionId) config2.headers["userUnitPositionId"] = userUnitPositionId;
13517
- return config2;
13588
+ if (accessToken) config.headers.Authorization = `Bearer ${accessToken}`;
13589
+ if (userUnitPositionId) config.headers["userUnitPositionId"] = userUnitPositionId;
13590
+ return config;
13518
13591
  });
13519
13592
  let refreshingToken = null;
13520
13593
  axiosRequest.interceptors.response.use(
@@ -15846,8 +15919,8 @@ class Socket2 extends Emitter {
15846
15919
  */
15847
15920
  _registerAckCallback(id2, ack) {
15848
15921
  var _a;
15849
- const timeout2 = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;
15850
- if (timeout2 === void 0) {
15922
+ const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;
15923
+ if (timeout === void 0) {
15851
15924
  this.acks[id2] = ack;
15852
15925
  return;
15853
15926
  }
@@ -15859,7 +15932,7 @@ class Socket2 extends Emitter {
15859
15932
  }
15860
15933
  }
15861
15934
  ack.call(this, new Error("operation has timed out"));
15862
- }, timeout2);
15935
+ }, timeout);
15863
15936
  const fn = (...args) => {
15864
15937
  this.io.clearTimeoutFn(timer);
15865
15938
  ack.apply(this, args);
@@ -16257,8 +16330,8 @@ class Socket2 extends Emitter {
16257
16330
  *
16258
16331
  * @returns self
16259
16332
  */
16260
- timeout(timeout2) {
16261
- this.flags.timeout = timeout2;
16333
+ timeout(timeout) {
16334
+ this.flags.timeout = timeout;
16262
16335
  return this;
16263
16336
  }
16264
16337
  /**
@@ -16579,12 +16652,12 @@ class Manager extends Emitter {
16579
16652
  };
16580
16653
  const errorSub = on(socket, "error", onError);
16581
16654
  if (false !== this._timeout) {
16582
- const timeout2 = this._timeout;
16655
+ const timeout = this._timeout;
16583
16656
  const timer = this.setTimeoutFn(() => {
16584
16657
  openSubDestroy();
16585
16658
  onError(new Error("timeout"));
16586
16659
  socket.close();
16587
- }, timeout2);
16660
+ }, timeout);
16588
16661
  if (this.opts.autoUnref) {
16589
16662
  timer.unref();
16590
16663
  }
@@ -16894,14 +16967,14 @@ const socketConfig = (namespace, roomId) => {
16894
16967
  sockets[namespace] = socket;
16895
16968
  return socket;
16896
16969
  };
16897
- const login$1 = async (body) => await axiosRequest.post("auth/login", body);
16898
- const logout$1 = async (body) => await axiosRequest.post("auth/logout", body);
16899
- const forgotPassword = async (body) => await axiosRequest.post("auth/forgot-password", body);
16900
- const verifyOtp = async (body) => await axiosRequest.post("auth/verify-otp", body);
16901
- const resetPassword$1 = async (body) => await axiosRequest.post("auth/reset-password", body);
16902
- const refreshToken$1 = async (body) => await axiosRequest.post("auth/refresh-token", body);
16903
- const subscribeTopic$1 = async (body) => await axiosRequest.post("auth/subscribe-topic", body);
16904
- const unsubscribeTopic$1 = async (body) => await axiosRequest.post("auth/unsubscribe-topic", body);
16970
+ const login$1 = async (body2) => await axiosRequest.post("auth/login", body2);
16971
+ const logout$1 = async (body2) => await axiosRequest.post("auth/logout", body2);
16972
+ const forgotPassword = async (body2) => await axiosRequest.post("auth/forgot-password", body2);
16973
+ const verifyOtp = async (body2) => await axiosRequest.post("auth/verify-otp", body2);
16974
+ const resetPassword$1 = async (body2) => await axiosRequest.post("auth/reset-password", body2);
16975
+ const refreshToken$1 = async (body2) => await axiosRequest.post("auth/refresh-token", body2);
16976
+ const subscribeTopic$1 = async (body2) => await axiosRequest.post("auth/subscribe-topic", body2);
16977
+ const unsubscribeTopic$1 = async (body2) => await axiosRequest.post("auth/unsubscribe-topic", body2);
16905
16978
  const authApiMethods = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16906
16979
  __proto__: null,
16907
16980
  forgotPassword,
@@ -16934,18 +17007,18 @@ var ForgotPasswordType = /* @__PURE__ */ ((ForgotPasswordType2) => {
16934
17007
  return ForgotPasswordType2;
16935
17008
  })(ForgotPasswordType || {});
16936
17009
  const authApi = authApiMethods;
16937
- const createUser = async (body) => await axiosRequest.post("user", body);
16938
- const updateUser = async (id2, body) => await axiosRequest.put("user/" + id2, body);
16939
- const updateAccount$1 = async (body) => await axiosRequest.patch("user", body);
17010
+ const createUser = async (body2) => await axiosRequest.post("user", body2);
17011
+ const updateUser = async (id2, body2) => await axiosRequest.put("user/" + id2, body2);
17012
+ const updateAccount$1 = async (body2) => await axiosRequest.patch("user", body2);
16940
17013
  const deleteUser = async (id2) => await axiosRequest.delete("user/" + id2);
16941
- const getListUser = async (body) => await axiosRequest.post("user/list", body);
16942
- const getListUserRelations = async (body) => await axiosRequest.post("user/list/relations", body);
17014
+ const getListUser = async (body2) => await axiosRequest.post("user/list", body2);
17015
+ const getListUserRelations = async (body2) => await axiosRequest.post("user/list/relations", body2);
16943
17016
  const getUser = async (id2) => await axiosRequest.get("user/" + id2);
16944
17017
  const getUserInformationHistory = async (id2) => await axiosRequest.get("user/user-history/" + id2);
16945
17018
  const getUserOrgUnitPositionById = async (userId) => await axiosRequest.get("user/user-org-unit-position/" + userId);
16946
17019
  const getUserGenerateNextUserCode = async () => await axiosRequest.get("user/generate-next-user-code");
16947
17020
  const getUserNearestManagers = async () => await axiosRequest.get(`user/nearest-managers/current`);
16948
- const getUserByOrgUnit = async (body) => await axiosRequest.post(`/org-unit/users-by-org-units`, body);
17021
+ const getUserByOrgUnit = async (body2) => await axiosRequest.post(`/org-unit/users-by-org-units`, body2);
16949
17022
  const userApiMethods = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
16950
17023
  __proto__: null,
16951
17024
  createUser,
@@ -16962,9 +17035,9 @@ const userApiMethods = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
16962
17035
  updateUser
16963
17036
  }, Symbol.toStringTag, { value: "Module" }));
16964
17037
  const userApi = userApiMethods;
16965
- const updateNotification = async (body) => await axiosRequest.put("notification", body);
17038
+ const updateNotification = async (body2) => await axiosRequest.put("notification", body2);
16966
17039
  const getListNotification = async (params) => await axiosRequest.get("notification", { params });
16967
- const updateNotificationSetting = async (id2, body) => await axiosRequest.put("notification-setting/" + id2, body);
17040
+ const updateNotificationSetting = async (id2, body2) => await axiosRequest.put("notification-setting/" + id2, body2);
16968
17041
  const getListNotificationSetting = async (params) => await axiosRequest.get("notification-setting", {
16969
17042
  params
16970
17043
  });
@@ -17086,9 +17159,9 @@ const changeSidebarCount = toolkit.createAsyncThunk(
17086
17159
  );
17087
17160
  const updateAccount = toolkit.createAsyncThunk(
17088
17161
  "UPDATE_ACCOUNT",
17089
- async (body, { rejectWithValue, getState }) => {
17162
+ async (body2, { rejectWithValue, getState }) => {
17090
17163
  try {
17091
- await userApi.updateAccount(body);
17164
+ await userApi.updateAccount(body2);
17092
17165
  const state = getState();
17093
17166
  if (!state.account.user) {
17094
17167
  throw new Error("User not found");
@@ -17221,10 +17294,7 @@ const persistConfig = {
17221
17294
  if (!state) return Promise.resolve(void 0);
17222
17295
  state.account = { ...initialStateAccount, ...state.account };
17223
17296
  state.system = { ...initialStateSystem, ...state.system };
17224
- state.remainingWeight = {
17225
- ...initialStateRemainingWeight,
17226
- ...state.remainingWeight
17227
- };
17297
+ state.remainingWeight = { ...initialStateRemainingWeight, ...state.remainingWeight };
17228
17298
  return Promise.resolve(state);
17229
17299
  }
17230
17300
  };
@@ -17264,2051 +17334,47 @@ function composeClasses(slots, getUtilityClass, classes = void 0) {
17264
17334
  }
17265
17335
  return output;
17266
17336
  }
17267
- function useEventCallback$1(fn) {
17268
- const ref = React__namespace.useRef(fn);
17269
- useEnhancedEffect(() => {
17270
- ref.current = fn;
17271
- });
17272
- return React__namespace.useRef((...args) => (
17273
- // @ts-expect-error hide `this`
17274
- (0, ref.current)(...args)
17275
- )).current;
17276
- }
17277
- const UNINITIALIZED = {};
17278
- function useLazyRef(init, initArg) {
17279
- const ref = React__namespace.useRef(UNINITIALIZED);
17280
- if (ref.current === UNINITIALIZED) {
17281
- ref.current = init(initArg);
17282
- }
17283
- return ref;
17284
- }
17285
- const EMPTY = [];
17286
- function useOnMount(fn) {
17287
- React__namespace.useEffect(fn, EMPTY);
17288
- }
17289
- class Timeout {
17290
- static create() {
17291
- return new Timeout();
17292
- }
17293
- currentId = null;
17294
- /**
17295
- * Executes `fn` after `delay`, clearing any previously scheduled call.
17296
- */
17297
- start(delay2, fn) {
17298
- this.clear();
17299
- this.currentId = setTimeout(() => {
17300
- this.currentId = null;
17301
- fn();
17302
- }, delay2);
17337
+ function chainPropTypes(propType1, propType2) {
17338
+ if (process.env.NODE_ENV === "production") {
17339
+ return () => null;
17303
17340
  }
17304
- clear = () => {
17305
- if (this.currentId !== null) {
17306
- clearTimeout(this.currentId);
17307
- this.currentId = null;
17308
- }
17309
- };
17310
- disposeEffect = () => {
17311
- return this.clear;
17341
+ return function validate(...args) {
17342
+ return propType1(...args) || propType2(...args);
17312
17343
  };
17313
17344
  }
17314
- function useTimeout() {
17315
- const timeout2 = useLazyRef(Timeout.create).current;
17316
- useOnMount(timeout2.disposeEffect);
17317
- return timeout2;
17318
- }
17319
- function extractEventHandlers(object2, excludeKeys = []) {
17320
- if (object2 === void 0) {
17321
- return {};
17322
- }
17345
+ const memoTheme = system.unstable_memoTheme;
17346
+ function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
17323
17347
  const result = {};
17324
- Object.keys(object2).filter((prop) => prop.match(/^on[A-Z]/) && typeof object2[prop] === "function" && !excludeKeys.includes(prop)).forEach((prop) => {
17325
- result[prop] = object2[prop];
17348
+ slots.forEach((slot) => {
17349
+ result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
17326
17350
  });
17327
17351
  return result;
17328
17352
  }
17329
- function useSnackbar$1(parameters = {}) {
17330
- const {
17331
- autoHideDuration = null,
17332
- disableWindowBlurListener = false,
17333
- onClose,
17334
- open,
17335
- resumeHideDuration
17336
- } = parameters;
17337
- const timerAutoHide = useTimeout();
17338
- React__namespace.useEffect(() => {
17339
- if (!open) {
17340
- return void 0;
17341
- }
17342
- function handleKeyDown(nativeEvent) {
17343
- if (!nativeEvent.defaultPrevented) {
17344
- if (nativeEvent.key === "Escape") {
17345
- onClose?.(nativeEvent, "escapeKeyDown");
17346
- }
17347
- }
17348
- }
17349
- document.addEventListener("keydown", handleKeyDown);
17350
- return () => {
17351
- document.removeEventListener("keydown", handleKeyDown);
17352
- };
17353
- }, [open, onClose]);
17354
- const handleClose = useEventCallback$1((event, reason) => {
17355
- onClose?.(event, reason);
17356
- });
17357
- const setAutoHideTimer = useEventCallback$1((autoHideDurationParam) => {
17358
- if (!onClose || autoHideDurationParam == null) {
17359
- return;
17360
- }
17361
- timerAutoHide.start(autoHideDurationParam, () => {
17362
- handleClose(null, "timeout");
17363
- });
17364
- });
17365
- React__namespace.useEffect(() => {
17366
- if (open) {
17367
- setAutoHideTimer(autoHideDuration);
17368
- }
17369
- return timerAutoHide.clear;
17370
- }, [open, autoHideDuration, setAutoHideTimer, timerAutoHide]);
17371
- const handleClickAway = (event) => {
17372
- onClose?.(event, "clickaway");
17373
- };
17374
- const handlePause = timerAutoHide.clear;
17375
- const handleResume = React__namespace.useCallback(() => {
17376
- if (autoHideDuration != null) {
17377
- setAutoHideTimer(resumeHideDuration != null ? resumeHideDuration : autoHideDuration * 0.5);
17378
- }
17379
- }, [autoHideDuration, resumeHideDuration, setAutoHideTimer]);
17380
- const createHandleBlur = (otherHandlers) => (event) => {
17381
- const onBlurCallback = otherHandlers.onBlur;
17382
- onBlurCallback?.(event);
17383
- handleResume();
17384
- };
17385
- const createHandleFocus = (otherHandlers) => (event) => {
17386
- const onFocusCallback = otherHandlers.onFocus;
17387
- onFocusCallback?.(event);
17388
- handlePause();
17389
- };
17390
- const createMouseEnter = (otherHandlers) => (event) => {
17391
- const onMouseEnterCallback = otherHandlers.onMouseEnter;
17392
- onMouseEnterCallback?.(event);
17393
- handlePause();
17394
- };
17395
- const createMouseLeave = (otherHandlers) => (event) => {
17396
- const onMouseLeaveCallback = otherHandlers.onMouseLeave;
17397
- onMouseLeaveCallback?.(event);
17398
- handleResume();
17399
- };
17400
- React__namespace.useEffect(() => {
17401
- if (!disableWindowBlurListener && open) {
17402
- window.addEventListener("focus", handleResume);
17403
- window.addEventListener("blur", handlePause);
17404
- return () => {
17405
- window.removeEventListener("focus", handleResume);
17406
- window.removeEventListener("blur", handlePause);
17407
- };
17408
- }
17409
- return void 0;
17410
- }, [disableWindowBlurListener, open, handleResume, handlePause]);
17411
- const getRootProps = (externalProps = {}) => {
17412
- const externalEventHandlers = {
17413
- ...extractEventHandlers(parameters),
17414
- ...extractEventHandlers(externalProps)
17415
- };
17416
- return {
17417
- // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
17418
- // See https://github.com/mui/material-ui/issues/29080
17419
- role: "presentation",
17420
- ...externalProps,
17421
- ...externalEventHandlers,
17422
- onBlur: createHandleBlur(externalEventHandlers),
17423
- onFocus: createHandleFocus(externalEventHandlers),
17424
- onMouseEnter: createMouseEnter(externalEventHandlers),
17425
- onMouseLeave: createMouseLeave(externalEventHandlers)
17426
- };
17427
- };
17428
- return {
17429
- getRootProps,
17430
- onClickAway: handleClickAway
17431
- };
17432
- }
17433
- function ownerDocument(node) {
17434
- return node && node.ownerDocument || document;
17435
- }
17436
- function useForkRef(...refs) {
17437
- const cleanupRef = React__namespace.useRef(void 0);
17438
- const refEffect = React__namespace.useCallback((instance) => {
17439
- const cleanups = refs.map((ref) => {
17440
- if (ref == null) {
17441
- return null;
17442
- }
17443
- if (typeof ref === "function") {
17444
- const refCallback = ref;
17445
- const refCleanup = refCallback(instance);
17446
- return typeof refCleanup === "function" ? refCleanup : () => {
17447
- refCallback(null);
17448
- };
17449
- }
17450
- ref.current = instance;
17451
- return () => {
17452
- ref.current = null;
17453
- };
17454
- });
17455
- return () => {
17456
- cleanups.forEach((refCleanup) => refCleanup?.());
17457
- };
17458
- }, refs);
17459
- return React__namespace.useMemo(() => {
17460
- if (refs.every((ref) => ref == null)) {
17461
- return null;
17462
- }
17463
- return (value2) => {
17464
- if (cleanupRef.current) {
17465
- cleanupRef.current();
17466
- cleanupRef.current = void 0;
17467
- }
17468
- if (value2 != null) {
17469
- cleanupRef.current = refEffect(value2);
17470
- }
17471
- };
17472
- }, refs);
17473
- }
17474
- function chainPropTypes(propType1, propType2) {
17475
- if (process.env.NODE_ENV === "production") {
17476
- return () => null;
17477
- }
17478
- return function validate(...args) {
17479
- return propType1(...args) || propType2(...args);
17480
- };
17481
- }
17482
- function isClassComponent(elementType) {
17483
- const {
17484
- prototype: prototype2 = {}
17485
- } = elementType;
17486
- return Boolean(prototype2.isReactComponent);
17487
- }
17488
- function acceptingRef(props, propName, componentName, location2, propFullName) {
17489
- const element = props[propName];
17490
- const safePropName = propFullName || propName;
17491
- if (element == null || // When server-side rendering React doesn't warn either.
17492
- // This is not an accurate check for SSR.
17493
- // This is only in place for Emotion compat.
17494
- // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
17495
- typeof window === "undefined") {
17496
- return null;
17497
- }
17498
- let warningHint;
17499
- const elementType = element.type;
17500
- if (typeof elementType === "function" && !isClassComponent(elementType)) {
17501
- warningHint = "Did you accidentally use a plain function component for an element instead?";
17502
- }
17503
- if (warningHint !== void 0) {
17504
- return new Error(`Invalid ${location2} \`${safePropName}\` supplied to \`${componentName}\`. Expected an element that can hold a ref. ${warningHint} For more information see https://mui.com/r/caveat-with-refs-guide`);
17505
- }
17506
- return null;
17507
- }
17508
- const elementAcceptingRef = chainPropTypes(PropTypes.element, acceptingRef);
17509
- elementAcceptingRef.isRequired = chainPropTypes(PropTypes.element.isRequired, acceptingRef);
17510
- function getReactElementRef(element) {
17511
- if (parseInt(React__namespace.version, 10) >= 19) {
17512
- return element?.props?.ref || null;
17513
- }
17514
- return element?.ref || null;
17515
- }
17516
- function mapEventPropToEvent(eventProp) {
17517
- return eventProp.substring(2).toLowerCase();
17518
- }
17519
- function clickedRootScrollbar(event, doc) {
17520
- return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;
17521
- }
17522
- function ClickAwayListener(props) {
17523
- const {
17524
- children,
17525
- disableReactTree = false,
17526
- mouseEvent = "onClick",
17527
- onClickAway,
17528
- touchEvent = "onTouchEnd"
17529
- } = props;
17530
- const movedRef = React__namespace.useRef(false);
17531
- const nodeRef = React__namespace.useRef(null);
17532
- const activatedRef = React__namespace.useRef(false);
17533
- const syntheticEventRef = React__namespace.useRef(false);
17534
- React__namespace.useEffect(() => {
17535
- setTimeout(() => {
17536
- activatedRef.current = true;
17537
- }, 0);
17538
- return () => {
17539
- activatedRef.current = false;
17540
- };
17541
- }, []);
17542
- const handleRef = useForkRef(getReactElementRef(children), nodeRef);
17543
- const handleClickAway = useEventCallback$1((event) => {
17544
- const insideReactTree = syntheticEventRef.current;
17545
- syntheticEventRef.current = false;
17546
- const doc = ownerDocument(nodeRef.current);
17547
- if (!activatedRef.current || !nodeRef.current || "clientX" in event && clickedRootScrollbar(event, doc)) {
17548
- return;
17549
- }
17550
- if (movedRef.current) {
17551
- movedRef.current = false;
17552
- return;
17553
- }
17554
- let insideDOM;
17555
- if (event.composedPath) {
17556
- insideDOM = event.composedPath().includes(nodeRef.current);
17557
- } else {
17558
- insideDOM = !doc.documentElement.contains(
17559
- // @ts-expect-error returns `false` as intended when not dispatched from a Node
17560
- event.target
17561
- ) || nodeRef.current.contains(
17562
- // @ts-expect-error returns `false` as intended when not dispatched from a Node
17563
- event.target
17564
- );
17565
- }
17566
- if (!insideDOM && (disableReactTree || !insideReactTree)) {
17567
- onClickAway(event);
17568
- }
17569
- });
17570
- const createHandleSynthetic = (handlerName) => (event) => {
17571
- syntheticEventRef.current = true;
17572
- const childrenPropsHandler = children.props[handlerName];
17573
- if (childrenPropsHandler) {
17574
- childrenPropsHandler(event);
17575
- }
17576
- };
17577
- const childrenProps = {
17578
- ref: handleRef
17579
- };
17580
- if (touchEvent !== false) {
17581
- childrenProps[touchEvent] = createHandleSynthetic(touchEvent);
17582
- }
17583
- React__namespace.useEffect(() => {
17584
- if (touchEvent !== false) {
17585
- const mappedTouchEvent = mapEventPropToEvent(touchEvent);
17586
- const doc = ownerDocument(nodeRef.current);
17587
- const handleTouchMove = () => {
17588
- movedRef.current = true;
17589
- };
17590
- doc.addEventListener(mappedTouchEvent, handleClickAway);
17591
- doc.addEventListener("touchmove", handleTouchMove);
17592
- return () => {
17593
- doc.removeEventListener(mappedTouchEvent, handleClickAway);
17594
- doc.removeEventListener("touchmove", handleTouchMove);
17595
- };
17596
- }
17597
- return void 0;
17598
- }, [handleClickAway, touchEvent]);
17599
- if (mouseEvent !== false) {
17600
- childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);
17601
- }
17602
- React__namespace.useEffect(() => {
17603
- if (mouseEvent !== false) {
17604
- const mappedMouseEvent = mapEventPropToEvent(mouseEvent);
17605
- const doc = ownerDocument(nodeRef.current);
17606
- doc.addEventListener(mappedMouseEvent, handleClickAway);
17607
- return () => {
17608
- doc.removeEventListener(mappedMouseEvent, handleClickAway);
17609
- };
17610
- }
17611
- return void 0;
17612
- }, [handleClickAway, mouseEvent]);
17613
- return /* @__PURE__ */ React__namespace.cloneElement(children, childrenProps);
17614
- }
17615
- process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes = {
17616
- // ┌────────────────────────────── Warning ──────────────────────────────┐
17617
- // │ These PropTypes are generated from the TypeScript type definitions. │
17618
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
17619
- // └─────────────────────────────────────────────────────────────────────┘
17620
- /**
17621
- * The wrapped element.
17622
- */
17623
- children: elementAcceptingRef.isRequired,
17624
- /**
17625
- * If `true`, the React tree is ignored and only the DOM tree is considered.
17626
- * This prop changes how portaled elements are handled.
17627
- * @default false
17628
- */
17629
- disableReactTree: PropTypes.bool,
17630
- /**
17631
- * The mouse event to listen to. You can disable the listener by providing `false`.
17632
- * @default 'onClick'
17633
- */
17634
- mouseEvent: PropTypes.oneOf(["onClick", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", false]),
17635
- /**
17636
- * Callback fired when a "click away" event is detected.
17637
- */
17638
- onClickAway: PropTypes.func.isRequired,
17639
- /**
17640
- * The touch event to listen to. You can disable the listener by providing `false`.
17641
- * @default 'onTouchEnd'
17642
- */
17643
- touchEvent: PropTypes.oneOf(["onTouchEnd", "onTouchStart", false])
17644
- } : void 0;
17645
- if (process.env.NODE_ENV !== "production") {
17646
- ClickAwayListener["propTypes"] = exactProp(ClickAwayListener.propTypes);
17647
- }
17648
- const memoTheme = system.unstable_memoTheme;
17649
- function _objectWithoutPropertiesLoose$1(r2, e) {
17650
- if (null == r2) return {};
17651
- var t = {};
17652
- for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) {
17653
- if (-1 !== e.indexOf(n)) continue;
17654
- t[n] = r2[n];
17655
- }
17656
- return t;
17657
- }
17658
- function _setPrototypeOf(t, e) {
17659
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
17660
- return t2.__proto__ = e2, t2;
17661
- }, _setPrototypeOf(t, e);
17662
- }
17663
- function _inheritsLoose(t, o) {
17664
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
17665
- }
17666
- const config = {
17667
- disabled: false
17668
- };
17669
- var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
17670
- enter: PropTypes.number,
17671
- exit: PropTypes.number,
17672
- appear: PropTypes.number
17673
- }).isRequired]) : null;
17674
- process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
17675
- enter: PropTypes.string,
17676
- exit: PropTypes.string,
17677
- active: PropTypes.string
17678
- }), PropTypes.shape({
17679
- enter: PropTypes.string,
17680
- enterDone: PropTypes.string,
17681
- enterActive: PropTypes.string,
17682
- exit: PropTypes.string,
17683
- exitDone: PropTypes.string,
17684
- exitActive: PropTypes.string
17685
- })]) : null;
17686
- const TransitionGroupContext = React.createContext(null);
17687
- var forceReflow = function forceReflow2(node) {
17688
- return node.scrollTop;
17689
- };
17690
- var UNMOUNTED = "unmounted";
17691
- var EXITED = "exited";
17692
- var ENTERING = "entering";
17693
- var ENTERED = "entered";
17694
- var EXITING = "exiting";
17695
- var Transition = /* @__PURE__ */ (function(_React$Component) {
17696
- _inheritsLoose(Transition2, _React$Component);
17697
- function Transition2(props, context) {
17698
- var _this;
17699
- _this = _React$Component.call(this, props, context) || this;
17700
- var parentGroup = context;
17701
- var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
17702
- var initialStatus;
17703
- _this.appearStatus = null;
17704
- if (props.in) {
17705
- if (appear) {
17706
- initialStatus = EXITED;
17707
- _this.appearStatus = ENTERING;
17708
- } else {
17709
- initialStatus = ENTERED;
17710
- }
17711
- } else {
17712
- if (props.unmountOnExit || props.mountOnEnter) {
17713
- initialStatus = UNMOUNTED;
17714
- } else {
17715
- initialStatus = EXITED;
17716
- }
17717
- }
17718
- _this.state = {
17719
- status: initialStatus
17720
- };
17721
- _this.nextCallback = null;
17722
- return _this;
17723
- }
17724
- Transition2.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
17725
- var nextIn = _ref.in;
17726
- if (nextIn && prevState.status === UNMOUNTED) {
17727
- return {
17728
- status: EXITED
17729
- };
17730
- }
17731
- return null;
17732
- };
17733
- var _proto = Transition2.prototype;
17734
- _proto.componentDidMount = function componentDidMount() {
17735
- this.updateStatus(true, this.appearStatus);
17736
- };
17737
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
17738
- var nextStatus = null;
17739
- if (prevProps !== this.props) {
17740
- var status = this.state.status;
17741
- if (this.props.in) {
17742
- if (status !== ENTERING && status !== ENTERED) {
17743
- nextStatus = ENTERING;
17744
- }
17745
- } else {
17746
- if (status === ENTERING || status === ENTERED) {
17747
- nextStatus = EXITING;
17748
- }
17749
- }
17750
- }
17751
- this.updateStatus(false, nextStatus);
17752
- };
17753
- _proto.componentWillUnmount = function componentWillUnmount() {
17754
- this.cancelNextCallback();
17755
- };
17756
- _proto.getTimeouts = function getTimeouts() {
17757
- var timeout2 = this.props.timeout;
17758
- var exit, enter, appear;
17759
- exit = enter = appear = timeout2;
17760
- if (timeout2 != null && typeof timeout2 !== "number") {
17761
- exit = timeout2.exit;
17762
- enter = timeout2.enter;
17763
- appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
17764
- }
17765
- return {
17766
- exit,
17767
- enter,
17768
- appear
17769
- };
17770
- };
17771
- _proto.updateStatus = function updateStatus(mounting, nextStatus) {
17772
- if (mounting === void 0) {
17773
- mounting = false;
17774
- }
17775
- if (nextStatus !== null) {
17776
- this.cancelNextCallback();
17777
- if (nextStatus === ENTERING) {
17778
- if (this.props.unmountOnExit || this.props.mountOnEnter) {
17779
- var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
17780
- if (node) forceReflow(node);
17781
- }
17782
- this.performEnter(mounting);
17783
- } else {
17784
- this.performExit();
17785
- }
17786
- } else if (this.props.unmountOnExit && this.state.status === EXITED) {
17787
- this.setState({
17788
- status: UNMOUNTED
17789
- });
17790
- }
17791
- };
17792
- _proto.performEnter = function performEnter(mounting) {
17793
- var _this2 = this;
17794
- var enter = this.props.enter;
17795
- var appearing = this.context ? this.context.isMounting : mounting;
17796
- var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
17797
- var timeouts = this.getTimeouts();
17798
- var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
17799
- if (!mounting && !enter || config.disabled) {
17800
- this.safeSetState({
17801
- status: ENTERED
17802
- }, function() {
17803
- _this2.props.onEntered(maybeNode);
17804
- });
17805
- return;
17806
- }
17807
- this.props.onEnter(maybeNode, maybeAppearing);
17808
- this.safeSetState({
17809
- status: ENTERING
17810
- }, function() {
17811
- _this2.props.onEntering(maybeNode, maybeAppearing);
17812
- _this2.onTransitionEnd(enterTimeout, function() {
17813
- _this2.safeSetState({
17814
- status: ENTERED
17815
- }, function() {
17816
- _this2.props.onEntered(maybeNode, maybeAppearing);
17817
- });
17818
- });
17819
- });
17820
- };
17821
- _proto.performExit = function performExit() {
17822
- var _this3 = this;
17823
- var exit = this.props.exit;
17824
- var timeouts = this.getTimeouts();
17825
- var maybeNode = this.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
17826
- if (!exit || config.disabled) {
17827
- this.safeSetState({
17828
- status: EXITED
17829
- }, function() {
17830
- _this3.props.onExited(maybeNode);
17831
- });
17832
- return;
17833
- }
17834
- this.props.onExit(maybeNode);
17835
- this.safeSetState({
17836
- status: EXITING
17837
- }, function() {
17838
- _this3.props.onExiting(maybeNode);
17839
- _this3.onTransitionEnd(timeouts.exit, function() {
17840
- _this3.safeSetState({
17841
- status: EXITED
17842
- }, function() {
17843
- _this3.props.onExited(maybeNode);
17844
- });
17845
- });
17846
- });
17847
- };
17848
- _proto.cancelNextCallback = function cancelNextCallback() {
17849
- if (this.nextCallback !== null) {
17850
- this.nextCallback.cancel();
17851
- this.nextCallback = null;
17852
- }
17853
- };
17854
- _proto.safeSetState = function safeSetState(nextState, callback) {
17855
- callback = this.setNextCallback(callback);
17856
- this.setState(nextState, callback);
17857
- };
17858
- _proto.setNextCallback = function setNextCallback(callback) {
17859
- var _this4 = this;
17860
- var active = true;
17861
- this.nextCallback = function(event) {
17862
- if (active) {
17863
- active = false;
17864
- _this4.nextCallback = null;
17865
- callback(event);
17866
- }
17867
- };
17868
- this.nextCallback.cancel = function() {
17869
- active = false;
17870
- };
17871
- return this.nextCallback;
17872
- };
17873
- _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
17874
- this.setNextCallback(handler);
17875
- var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
17876
- var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
17877
- if (!node || doesNotHaveTimeoutOrListener) {
17878
- setTimeout(this.nextCallback, 0);
17879
- return;
17880
- }
17881
- if (this.props.addEndListener) {
17882
- var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1];
17883
- this.props.addEndListener(maybeNode, maybeNextCallback);
17884
- }
17885
- if (timeout2 != null) {
17886
- setTimeout(this.nextCallback, timeout2);
17887
- }
17888
- };
17889
- _proto.render = function render() {
17890
- var status = this.state.status;
17891
- if (status === UNMOUNTED) {
17892
- return null;
17893
- }
17894
- var _this$props = this.props, children = _this$props.children;
17895
- _this$props.in;
17896
- _this$props.mountOnEnter;
17897
- _this$props.unmountOnExit;
17898
- _this$props.appear;
17899
- _this$props.enter;
17900
- _this$props.exit;
17901
- _this$props.timeout;
17902
- _this$props.addEndListener;
17903
- _this$props.onEnter;
17904
- _this$props.onEntering;
17905
- _this$props.onEntered;
17906
- _this$props.onExit;
17907
- _this$props.onExiting;
17908
- _this$props.onExited;
17909
- _this$props.nodeRef;
17910
- var childProps = _objectWithoutPropertiesLoose$1(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
17911
- return (
17912
- // allows for nested Transitions
17913
- /* @__PURE__ */ React.createElement(TransitionGroupContext.Provider, {
17914
- value: null
17915
- }, typeof children === "function" ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))
17916
- );
17917
- };
17918
- return Transition2;
17919
- })(React.Component);
17920
- Transition.contextType = TransitionGroupContext;
17921
- Transition.propTypes = process.env.NODE_ENV !== "production" ? {
17922
- /**
17923
- * A React reference to DOM element that need to transition:
17924
- * https://stackoverflow.com/a/51127130/4671932
17925
- *
17926
- * - When `nodeRef` prop is used, `node` is not passed to callback functions
17927
- * (e.g. `onEnter`) because user already has direct access to the node.
17928
- * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
17929
- * `nodeRef` need to be provided to `Transition` with changed `key` prop
17930
- * (see
17931
- * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
17932
- */
17933
- nodeRef: PropTypes.shape({
17934
- current: typeof Element === "undefined" ? PropTypes.any : function(propValue, key, componentName, location2, propFullName, secret) {
17935
- var value2 = propValue[key];
17936
- return PropTypes.instanceOf(value2 && "ownerDocument" in value2 ? value2.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location2, propFullName, secret);
17937
- }
17938
- }),
17939
- /**
17940
- * A `function` child can be used instead of a React element. This function is
17941
- * called with the current transition status (`'entering'`, `'entered'`,
17942
- * `'exiting'`, `'exited'`), which can be used to apply context
17943
- * specific props to a component.
17944
- *
17945
- * ```jsx
17946
- * <Transition in={this.state.in} timeout={150}>
17947
- * {state => (
17948
- * <MyComponent className={`fade fade-${state}`} />
17949
- * )}
17950
- * </Transition>
17951
- * ```
17952
- */
17953
- children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
17954
- /**
17955
- * Show the component; triggers the enter or exit states
17956
- */
17957
- in: PropTypes.bool,
17958
- /**
17959
- * By default the child component is mounted immediately along with
17960
- * the parent `Transition` component. If you want to "lazy mount" the component on the
17961
- * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
17962
- * mounted, even on "exited", unless you also specify `unmountOnExit`.
17963
- */
17964
- mountOnEnter: PropTypes.bool,
17965
- /**
17966
- * By default the child component stays mounted after it reaches the `'exited'` state.
17967
- * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
17968
- */
17969
- unmountOnExit: PropTypes.bool,
17970
- /**
17971
- * By default the child component does not perform the enter transition when
17972
- * it first mounts, regardless of the value of `in`. If you want this
17973
- * behavior, set both `appear` and `in` to `true`.
17974
- *
17975
- * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
17976
- * > only adds an additional enter transition. However, in the
17977
- * > `<CSSTransition>` component that first enter transition does result in
17978
- * > additional `.appear-*` classes, that way you can choose to style it
17979
- * > differently.
17980
- */
17981
- appear: PropTypes.bool,
17982
- /**
17983
- * Enable or disable enter transitions.
17984
- */
17985
- enter: PropTypes.bool,
17986
- /**
17987
- * Enable or disable exit transitions.
17988
- */
17989
- exit: PropTypes.bool,
17990
- /**
17991
- * The duration of the transition, in milliseconds.
17992
- * Required unless `addEndListener` is provided.
17993
- *
17994
- * You may specify a single timeout for all transitions:
17995
- *
17996
- * ```jsx
17997
- * timeout={500}
17998
- * ```
17999
- *
18000
- * or individually:
18001
- *
18002
- * ```jsx
18003
- * timeout={{
18004
- * appear: 500,
18005
- * enter: 300,
18006
- * exit: 500,
18007
- * }}
18008
- * ```
18009
- *
18010
- * - `appear` defaults to the value of `enter`
18011
- * - `enter` defaults to `0`
18012
- * - `exit` defaults to `0`
18013
- *
18014
- * @type {number | { enter?: number, exit?: number, appear?: number }}
18015
- */
18016
- timeout: function timeout(props) {
18017
- var pt = timeoutsShape;
18018
- if (!props.addEndListener) pt = pt.isRequired;
18019
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
18020
- args[_key - 1] = arguments[_key];
18021
- }
18022
- return pt.apply(void 0, [props].concat(args));
18023
- },
18024
- /**
18025
- * Add a custom transition end trigger. Called with the transitioning
18026
- * DOM node and a `done` callback. Allows for more fine grained transition end
18027
- * logic. Timeouts are still used as a fallback if provided.
18028
- *
18029
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
18030
- *
18031
- * ```jsx
18032
- * addEndListener={(node, done) => {
18033
- * // use the css transitionend event to mark the finish of a transition
18034
- * node.addEventListener('transitionend', done, false);
18035
- * }}
18036
- * ```
18037
- */
18038
- addEndListener: PropTypes.func,
18039
- /**
18040
- * Callback fired before the "entering" status is applied. An extra parameter
18041
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
18042
- *
18043
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
18044
- *
18045
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
18046
- */
18047
- onEnter: PropTypes.func,
18048
- /**
18049
- * Callback fired after the "entering" status is applied. An extra parameter
18050
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
18051
- *
18052
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
18053
- *
18054
- * @type Function(node: HtmlElement, isAppearing: bool)
18055
- */
18056
- onEntering: PropTypes.func,
18057
- /**
18058
- * Callback fired after the "entered" status is applied. An extra parameter
18059
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
18060
- *
18061
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
18062
- *
18063
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
18064
- */
18065
- onEntered: PropTypes.func,
18066
- /**
18067
- * Callback fired before the "exiting" status is applied.
18068
- *
18069
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
18070
- *
18071
- * @type Function(node: HtmlElement) -> void
18072
- */
18073
- onExit: PropTypes.func,
18074
- /**
18075
- * Callback fired after the "exiting" status is applied.
18076
- *
18077
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
18078
- *
18079
- * @type Function(node: HtmlElement) -> void
18080
- */
18081
- onExiting: PropTypes.func,
18082
- /**
18083
- * Callback fired after the "exited" status is applied.
18084
- *
18085
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
18086
- *
18087
- * @type Function(node: HtmlElement) -> void
18088
- */
18089
- onExited: PropTypes.func
18090
- } : {};
18091
- function noop$1() {
18092
- }
18093
- Transition.defaultProps = {
18094
- in: false,
18095
- mountOnEnter: false,
18096
- unmountOnExit: false,
18097
- appear: false,
18098
- enter: true,
18099
- exit: true,
18100
- onEnter: noop$1,
18101
- onEntering: noop$1,
18102
- onEntered: noop$1,
18103
- onExit: noop$1,
18104
- onExiting: noop$1,
18105
- onExited: noop$1
18106
- };
18107
- Transition.UNMOUNTED = UNMOUNTED;
18108
- Transition.EXITED = EXITED;
18109
- Transition.ENTERING = ENTERING;
18110
- Transition.ENTERED = ENTERED;
18111
- Transition.EXITING = EXITING;
18112
- const reflow = (node) => node.scrollTop;
18113
- function getTransitionProps(props, options) {
18114
- const {
18115
- timeout: timeout2,
18116
- easing: easing2,
18117
- style: style2 = {}
18118
- } = props;
18119
- return {
18120
- duration: style2.transitionDuration ?? (typeof timeout2 === "number" ? timeout2 : timeout2[options.mode] || 0),
18121
- easing: style2.transitionTimingFunction ?? (typeof easing2 === "object" ? easing2[options.mode] : easing2),
18122
- delay: style2.transitionDelay
18123
- };
18124
- }
18125
- function getScale(value2) {
18126
- return `scale(${value2}, ${value2 ** 2})`;
18127
- }
18128
- const styles = {
18129
- entering: {
18130
- opacity: 1,
18131
- transform: getScale(1)
18132
- },
18133
- entered: {
18134
- opacity: 1,
18135
- transform: "none"
18136
- }
18137
- };
18138
- const isWebKit154 = typeof navigator !== "undefined" && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);
18139
- const Grow = /* @__PURE__ */ React__namespace.forwardRef(function Grow2(props, ref) {
18140
- const {
18141
- addEndListener,
18142
- appear = true,
18143
- children,
18144
- easing: easing2,
18145
- in: inProp,
18146
- onEnter,
18147
- onEntered,
18148
- onEntering,
18149
- onExit,
18150
- onExited,
18151
- onExiting,
18152
- style: style2,
18153
- timeout: timeout2 = "auto",
18154
- // eslint-disable-next-line react/prop-types
18155
- TransitionComponent = Transition,
18156
- ...other
18157
- } = props;
18158
- const timer = useTimeout();
18159
- const autoTimeout = React__namespace.useRef();
18160
- const theme = useTheme();
18161
- const nodeRef = React__namespace.useRef(null);
18162
- const handleRef = useForkRef(nodeRef, getReactElementRef(children), ref);
18163
- const normalizedTransitionCallback = (callback) => (maybeIsAppearing) => {
18164
- if (callback) {
18165
- const node = nodeRef.current;
18166
- if (maybeIsAppearing === void 0) {
18167
- callback(node);
18168
- } else {
18169
- callback(node, maybeIsAppearing);
18170
- }
18171
- }
18172
- };
18173
- const handleEntering = normalizedTransitionCallback(onEntering);
18174
- const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
18175
- reflow(node);
18176
- const {
18177
- duration: transitionDuration,
18178
- delay: delay2,
18179
- easing: transitionTimingFunction
18180
- } = getTransitionProps({
18181
- style: style2,
18182
- timeout: timeout2,
18183
- easing: easing2
18184
- }, {
18185
- mode: "enter"
18186
- });
18187
- let duration2;
18188
- if (timeout2 === "auto") {
18189
- duration2 = theme.transitions.getAutoHeightDuration(node.clientHeight);
18190
- autoTimeout.current = duration2;
18191
- } else {
18192
- duration2 = transitionDuration;
18193
- }
18194
- node.style.transition = [theme.transitions.create("opacity", {
18195
- duration: duration2,
18196
- delay: delay2
18197
- }), theme.transitions.create("transform", {
18198
- duration: isWebKit154 ? duration2 : duration2 * 0.666,
18199
- delay: delay2,
18200
- easing: transitionTimingFunction
18201
- })].join(",");
18202
- if (onEnter) {
18203
- onEnter(node, isAppearing);
18204
- }
18205
- });
18206
- const handleEntered = normalizedTransitionCallback(onEntered);
18207
- const handleExiting = normalizedTransitionCallback(onExiting);
18208
- const handleExit = normalizedTransitionCallback((node) => {
18209
- const {
18210
- duration: transitionDuration,
18211
- delay: delay2,
18212
- easing: transitionTimingFunction
18213
- } = getTransitionProps({
18214
- style: style2,
18215
- timeout: timeout2,
18216
- easing: easing2
18217
- }, {
18218
- mode: "exit"
18219
- });
18220
- let duration2;
18221
- if (timeout2 === "auto") {
18222
- duration2 = theme.transitions.getAutoHeightDuration(node.clientHeight);
18223
- autoTimeout.current = duration2;
18224
- } else {
18225
- duration2 = transitionDuration;
18226
- }
18227
- node.style.transition = [theme.transitions.create("opacity", {
18228
- duration: duration2,
18229
- delay: delay2
18230
- }), theme.transitions.create("transform", {
18231
- duration: isWebKit154 ? duration2 : duration2 * 0.666,
18232
- delay: isWebKit154 ? delay2 : delay2 || duration2 * 0.333,
18233
- easing: transitionTimingFunction
18234
- })].join(",");
18235
- node.style.opacity = 0;
18236
- node.style.transform = getScale(0.75);
18237
- if (onExit) {
18238
- onExit(node);
18239
- }
18240
- });
18241
- const handleExited = normalizedTransitionCallback(onExited);
18242
- const handleAddEndListener = (next) => {
18243
- if (timeout2 === "auto") {
18244
- timer.start(autoTimeout.current || 0, next);
18245
- }
18246
- if (addEndListener) {
18247
- addEndListener(nodeRef.current, next);
18248
- }
18249
- };
18250
- return /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionComponent, {
18251
- appear,
18252
- in: inProp,
18253
- nodeRef,
18254
- onEnter: handleEnter,
18255
- onEntered: handleEntered,
18256
- onEntering: handleEntering,
18257
- onExit: handleExit,
18258
- onExited: handleExited,
18259
- onExiting: handleExiting,
18260
- addEndListener: handleAddEndListener,
18261
- timeout: timeout2 === "auto" ? null : timeout2,
18262
- ...other,
18263
- children: (state, {
18264
- ownerState,
18265
- ...restChildProps
18266
- }) => {
18267
- return /* @__PURE__ */ React__namespace.cloneElement(children, {
18268
- style: {
18269
- opacity: 0,
18270
- transform: getScale(0.75),
18271
- visibility: state === "exited" && !inProp ? "hidden" : void 0,
18272
- ...styles[state],
18273
- ...style2,
18274
- ...children.props.style
18275
- },
18276
- ref: handleRef,
18277
- ...restChildProps
18278
- });
18279
- }
18280
- });
18281
- });
18282
- process.env.NODE_ENV !== "production" ? Grow.propTypes = {
18283
- // ┌────────────────────────────── Warning ──────────────────────────────┐
18284
- // │ These PropTypes are generated from the TypeScript type definitions. │
18285
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
18286
- // └─────────────────────────────────────────────────────────────────────┘
18287
- /**
18288
- * Add a custom transition end trigger. Called with the transitioning DOM
18289
- * node and a done callback. Allows for more fine grained transition end
18290
- * logic. Note: Timeouts are still used as a fallback if provided.
18291
- */
18292
- addEndListener: PropTypes.func,
18293
- /**
18294
- * Perform the enter transition when it first mounts if `in` is also `true`.
18295
- * Set this to `false` to disable this behavior.
18296
- * @default true
18297
- */
18298
- appear: PropTypes.bool,
18299
- /**
18300
- * A single child content element.
18301
- */
18302
- children: elementAcceptingRef.isRequired,
18303
- /**
18304
- * The transition timing function.
18305
- * You may specify a single easing or a object containing enter and exit values.
18306
- */
18307
- easing: PropTypes.oneOfType([PropTypes.shape({
18308
- enter: PropTypes.string,
18309
- exit: PropTypes.string
18310
- }), PropTypes.string]),
18311
- /**
18312
- * If `true`, the component will transition in.
18313
- */
18314
- in: PropTypes.bool,
18315
- /**
18316
- * @ignore
18317
- */
18318
- onEnter: PropTypes.func,
18319
- /**
18320
- * @ignore
18321
- */
18322
- onEntered: PropTypes.func,
18323
- /**
18324
- * @ignore
18325
- */
18326
- onEntering: PropTypes.func,
18327
- /**
18328
- * @ignore
18329
- */
18330
- onExit: PropTypes.func,
18331
- /**
18332
- * @ignore
18333
- */
18334
- onExited: PropTypes.func,
18335
- /**
18336
- * @ignore
18337
- */
18338
- onExiting: PropTypes.func,
18339
- /**
18340
- * @ignore
18341
- */
18342
- style: PropTypes.object,
18343
- /**
18344
- * The duration for the transition, in milliseconds.
18345
- * You may specify a single timeout for all transitions, or individually with an object.
18346
- *
18347
- * Set to 'auto' to automatically calculate transition time based on height.
18348
- * @default 'auto'
18349
- */
18350
- timeout: PropTypes.oneOfType([PropTypes.oneOf(["auto"]), PropTypes.number, PropTypes.shape({
18351
- appear: PropTypes.number,
18352
- enter: PropTypes.number,
18353
- exit: PropTypes.number
18354
- })])
18355
- } : void 0;
18356
- if (Grow) {
18357
- Grow.muiSupportAuto = true;
18358
- }
18359
- function getTypeByValue(value2) {
18360
- const valueType = typeof value2;
18361
- switch (valueType) {
18362
- case "number":
18363
- if (Number.isNaN(value2)) {
18364
- return "NaN";
18365
- }
18366
- if (!Number.isFinite(value2)) {
18367
- return "Infinity";
18368
- }
18369
- if (value2 !== Math.floor(value2)) {
18370
- return "float";
18371
- }
18372
- return "number";
18373
- case "object":
18374
- if (value2 === null) {
18375
- return "null";
18376
- }
18377
- return value2.constructor.name;
18378
- default:
18379
- return valueType;
18380
- }
18381
- }
18382
- function requiredInteger(props, propName, componentName, location2) {
18383
- const propValue = props[propName];
18384
- if (propValue == null || !Number.isInteger(propValue)) {
18385
- const propType = getTypeByValue(propValue);
18386
- return new RangeError(`Invalid ${location2} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
18387
- }
18388
- return null;
18389
- }
18390
- function validator(props, propName, componentName, location2) {
18391
- const propValue = props[propName];
18392
- if (propValue === void 0) {
18393
- return null;
18394
- }
18395
- return requiredInteger(props, propName, componentName, location2);
18396
- }
18397
- function validatorNoop() {
18398
- return null;
18399
- }
18400
- validator.isRequired = requiredInteger;
18401
- validatorNoop.isRequired = validatorNoop;
18402
- const integerPropType = process.env.NODE_ENV === "production" ? validatorNoop : validator;
18403
- function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
18404
- const result = {};
18405
- slots.forEach((slot) => {
18406
- result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
18407
- });
18408
- return result;
18409
- }
18410
- function getPaperUtilityClass(slot) {
18411
- return generateUtilityClass("MuiPaper", slot);
18412
- }
18413
- generateUtilityClasses("MuiPaper", ["root", "rounded", "outlined", "elevation", "elevation0", "elevation1", "elevation2", "elevation3", "elevation4", "elevation5", "elevation6", "elevation7", "elevation8", "elevation9", "elevation10", "elevation11", "elevation12", "elevation13", "elevation14", "elevation15", "elevation16", "elevation17", "elevation18", "elevation19", "elevation20", "elevation21", "elevation22", "elevation23", "elevation24"]);
18414
- const useUtilityClasses$3 = (ownerState) => {
18415
- const {
18416
- square,
18417
- elevation,
18418
- variant,
18419
- classes
18420
- } = ownerState;
18421
- const slots = {
18422
- root: ["root", variant, !square && "rounded", variant === "elevation" && `elevation${elevation}`]
18423
- };
18424
- return composeClasses(slots, getPaperUtilityClass, classes);
18425
- };
18426
- const PaperRoot = styled("div", {
18427
- name: "MuiPaper",
18428
- slot: "Root",
18429
- overridesResolver: (props, styles2) => {
18430
- const {
18431
- ownerState
18432
- } = props;
18433
- return [styles2.root, styles2[ownerState.variant], !ownerState.square && styles2.rounded, ownerState.variant === "elevation" && styles2[`elevation${ownerState.elevation}`]];
18434
- }
18435
- })(memoTheme(({
18436
- theme
18437
- }) => ({
18438
- backgroundColor: (theme.vars || theme).palette.background.paper,
18439
- color: (theme.vars || theme).palette.text.primary,
18440
- transition: theme.transitions.create("box-shadow"),
18441
- variants: [{
18442
- props: ({
18443
- ownerState
18444
- }) => !ownerState.square,
18445
- style: {
18446
- borderRadius: theme.shape.borderRadius
18447
- }
18448
- }, {
18449
- props: {
18450
- variant: "outlined"
18451
- },
18452
- style: {
18453
- border: `1px solid ${(theme.vars || theme).palette.divider}`
18454
- }
18455
- }, {
18456
- props: {
18457
- variant: "elevation"
18458
- },
18459
- style: {
18460
- boxShadow: "var(--Paper-shadow)",
18461
- backgroundImage: "var(--Paper-overlay)"
18462
- }
18463
- }]
18464
- })));
18465
- const Paper = /* @__PURE__ */ React__namespace.forwardRef(function Paper2(inProps, ref) {
18466
- const props = useDefaultProps({
18467
- props: inProps,
18468
- name: "MuiPaper"
18469
- });
18470
- const theme = useTheme();
18471
- const {
18472
- className,
18473
- component = "div",
18474
- elevation = 1,
18475
- square = false,
18476
- variant = "elevation",
18477
- ...other
18478
- } = props;
18479
- const ownerState = {
18480
- ...props,
18481
- component,
18482
- elevation,
18483
- square,
18484
- variant
18485
- };
18486
- const classes = useUtilityClasses$3(ownerState);
18487
- if (process.env.NODE_ENV !== "production") {
18488
- if (theme.shadows[elevation] === void 0) {
18489
- console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join("\n"));
18490
- }
18491
- }
18492
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PaperRoot, {
18493
- as: component,
18494
- ownerState,
18495
- className: clsx(classes.root, className),
18496
- ref,
18497
- ...other,
18498
- style: {
18499
- ...variant === "elevation" && {
18500
- "--Paper-shadow": (theme.vars || theme).shadows[elevation],
18501
- ...theme.vars && {
18502
- "--Paper-overlay": theme.vars.overlays?.[elevation]
18503
- },
18504
- ...!theme.vars && theme.palette.mode === "dark" && {
18505
- "--Paper-overlay": `linear-gradient(${alpha$1("#fff", getOverlayAlpha(elevation))}, ${alpha$1("#fff", getOverlayAlpha(elevation))})`
18506
- }
18507
- },
18508
- ...other.style
18509
- }
18510
- });
18511
- });
18512
- process.env.NODE_ENV !== "production" ? Paper.propTypes = {
18513
- // ┌────────────────────────────── Warning ──────────────────────────────┐
18514
- // │ These PropTypes are generated from the TypeScript type definitions. │
18515
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
18516
- // └─────────────────────────────────────────────────────────────────────┘
18517
- /**
18518
- * The content of the component.
18519
- */
18520
- children: PropTypes.node,
18521
- /**
18522
- * Override or extend the styles applied to the component.
18523
- */
18524
- classes: PropTypes.object,
18525
- /**
18526
- * @ignore
18527
- */
18528
- className: PropTypes.string,
18529
- /**
18530
- * The component used for the root node.
18531
- * Either a string to use a HTML element or a component.
18532
- */
18533
- component: PropTypes.elementType,
18534
- /**
18535
- * Shadow depth, corresponds to `dp` in the spec.
18536
- * It accepts values between 0 and 24 inclusive.
18537
- * @default 1
18538
- */
18539
- elevation: chainPropTypes(integerPropType, (props) => {
18540
- const {
18541
- elevation,
18542
- variant
18543
- } = props;
18544
- if (elevation > 0 && variant === "outlined") {
18545
- return new Error(`MUI: Combining \`elevation={${elevation}}\` with \`variant="${variant}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`);
18546
- }
18547
- return null;
18548
- }),
18549
- /**
18550
- * If `true`, rounded corners are disabled.
18551
- * @default false
18552
- */
18553
- square: PropTypes.bool,
18554
- /**
18555
- * @ignore
18556
- */
18557
- style: PropTypes.object,
18558
- /**
18559
- * The system prop that allows defining system overrides as well as additional CSS styles.
18560
- */
18561
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
18562
- /**
18563
- * The variant to use.
18564
- * @default 'elevation'
18565
- */
18566
- variant: PropTypes.oneOfType([PropTypes.oneOf(["elevation", "outlined"]), PropTypes.string])
18567
- } : void 0;
18568
- function getSnackbarContentUtilityClass(slot) {
18569
- return generateUtilityClass("MuiSnackbarContent", slot);
18570
- }
18571
- generateUtilityClasses("MuiSnackbarContent", ["root", "message", "action"]);
18572
- const useUtilityClasses$2 = (ownerState) => {
18573
- const {
18574
- classes
18575
- } = ownerState;
18576
- const slots = {
18577
- root: ["root"],
18578
- action: ["action"],
18579
- message: ["message"]
18580
- };
18581
- return composeClasses(slots, getSnackbarContentUtilityClass, classes);
18582
- };
18583
- const SnackbarContentRoot = styled(Paper, {
18584
- name: "MuiSnackbarContent",
18585
- slot: "Root"
18586
- })(memoTheme(({
18587
- theme
18588
- }) => {
18589
- const emphasis = theme.palette.mode === "light" ? 0.8 : 0.98;
18590
- return {
18591
- ...theme.typography.body2,
18592
- color: theme.vars ? theme.vars.palette.SnackbarContent.color : theme.palette.getContrastText(emphasize(theme.palette.background.default, emphasis)),
18593
- backgroundColor: theme.vars ? theme.vars.palette.SnackbarContent.bg : emphasize(theme.palette.background.default, emphasis),
18594
- display: "flex",
18595
- alignItems: "center",
18596
- flexWrap: "wrap",
18597
- padding: "6px 16px",
18598
- flexGrow: 1,
18599
- [theme.breakpoints.up("sm")]: {
18600
- flexGrow: "initial",
18601
- minWidth: 288
18602
- }
18603
- };
18604
- }));
18605
- const SnackbarContentMessage = styled("div", {
18606
- name: "MuiSnackbarContent",
18607
- slot: "Message"
18608
- })({
18609
- padding: "8px 0"
18610
- });
18611
- const SnackbarContentAction = styled("div", {
18612
- name: "MuiSnackbarContent",
18613
- slot: "Action"
18614
- })({
18615
- display: "flex",
18616
- alignItems: "center",
18617
- marginLeft: "auto",
18618
- paddingLeft: 16,
18619
- marginRight: -8
18620
- });
18621
- const SnackbarContent = /* @__PURE__ */ React__namespace.forwardRef(function SnackbarContent2(inProps, ref) {
18622
- const props = useDefaultProps({
18623
- props: inProps,
18624
- name: "MuiSnackbarContent"
18625
- });
18626
- const {
18627
- action,
18628
- className,
18629
- message,
18630
- role = "alert",
18631
- ...other
18632
- } = props;
18633
- const ownerState = props;
18634
- const classes = useUtilityClasses$2(ownerState);
18635
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(SnackbarContentRoot, {
18636
- role,
18637
- elevation: 6,
18638
- className: clsx(classes.root, className),
18639
- ownerState,
18640
- ref,
18641
- ...other,
18642
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx(SnackbarContentMessage, {
18643
- className: classes.message,
18644
- ownerState,
18645
- children: message
18646
- }), action ? /* @__PURE__ */ jsxRuntimeExports.jsx(SnackbarContentAction, {
18647
- className: classes.action,
18648
- ownerState,
18649
- children: action
18650
- }) : null]
18651
- });
18652
- });
18653
- process.env.NODE_ENV !== "production" ? SnackbarContent.propTypes = {
18654
- // ┌────────────────────────────── Warning ──────────────────────────────┐
18655
- // │ These PropTypes are generated from the TypeScript type definitions. │
18656
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
18657
- // └─────────────────────────────────────────────────────────────────────┘
18658
- /**
18659
- * The action to display. It renders after the message, at the end of the snackbar.
18660
- */
18661
- action: PropTypes.node,
18662
- /**
18663
- * Override or extend the styles applied to the component.
18664
- */
18665
- classes: PropTypes.object,
18666
- /**
18667
- * @ignore
18668
- */
18669
- className: PropTypes.string,
18670
- /**
18671
- * The message to display.
18672
- */
18673
- message: PropTypes.node,
18674
- /**
18675
- * The ARIA role attribute of the element.
18676
- * @default 'alert'
18677
- */
18678
- role: PropTypes.string,
18679
- /**
18680
- * The system prop that allows defining system overrides as well as additional CSS styles.
18681
- */
18682
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
18683
- } : void 0;
18684
- function getSnackbarUtilityClass(slot) {
18685
- return generateUtilityClass("MuiSnackbar", slot);
18686
- }
18687
- generateUtilityClasses("MuiSnackbar", ["root", "anchorOriginTopCenter", "anchorOriginBottomCenter", "anchorOriginTopRight", "anchorOriginBottomRight", "anchorOriginTopLeft", "anchorOriginBottomLeft"]);
18688
- function isHostComponent(element) {
18689
- return typeof element === "string";
18690
- }
18691
- function appendOwnerState(elementType, otherProps, ownerState) {
18692
- if (elementType === void 0 || isHostComponent(elementType)) {
18693
- return otherProps;
18694
- }
18695
- return {
18696
- ...otherProps,
18697
- ownerState: {
18698
- ...otherProps.ownerState,
18699
- ...ownerState
18700
- }
18701
- };
18702
- }
18703
- function resolveComponentProps(componentProps, ownerState, slotState) {
18704
- if (typeof componentProps === "function") {
18705
- return componentProps(ownerState, slotState);
18706
- }
18707
- return componentProps;
18708
- }
18709
- function omitEventHandlers(object2) {
18710
- if (object2 === void 0) {
18711
- return {};
18712
- }
18713
- const result = {};
18714
- Object.keys(object2).filter((prop) => !(prop.match(/^on[A-Z]/) && typeof object2[prop] === "function")).forEach((prop) => {
18715
- result[prop] = object2[prop];
18716
- });
18717
- return result;
18718
- }
18719
- function mergeSlotProps(parameters) {
18720
- const {
18721
- getSlotProps,
18722
- additionalProps,
18723
- externalSlotProps,
18724
- externalForwardedProps,
18725
- className
18726
- } = parameters;
18727
- if (!getSlotProps) {
18728
- const joinedClasses2 = clsx(additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
18729
- const mergedStyle2 = {
18730
- ...additionalProps?.style,
18731
- ...externalForwardedProps?.style,
18732
- ...externalSlotProps?.style
18733
- };
18734
- const props2 = {
18735
- ...additionalProps,
18736
- ...externalForwardedProps,
18737
- ...externalSlotProps
18738
- };
18739
- if (joinedClasses2.length > 0) {
18740
- props2.className = joinedClasses2;
18741
- }
18742
- if (Object.keys(mergedStyle2).length > 0) {
18743
- props2.style = mergedStyle2;
18744
- }
18745
- return {
18746
- props: props2,
18747
- internalRef: void 0
18748
- };
18749
- }
18750
- const eventHandlers = extractEventHandlers({
18751
- ...externalForwardedProps,
18752
- ...externalSlotProps
18753
- });
18754
- const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
18755
- const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
18756
- const internalSlotProps = getSlotProps(eventHandlers);
18757
- const joinedClasses = clsx(internalSlotProps?.className, additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
18758
- const mergedStyle = {
18759
- ...internalSlotProps?.style,
18760
- ...additionalProps?.style,
18761
- ...externalForwardedProps?.style,
18762
- ...externalSlotProps?.style
18763
- };
18764
- const props = {
18765
- ...internalSlotProps,
18766
- ...additionalProps,
18767
- ...otherPropsWithoutEventHandlers,
18768
- ...componentsPropsWithoutEventHandlers
18769
- };
18770
- if (joinedClasses.length > 0) {
18771
- props.className = joinedClasses;
18772
- }
18773
- if (Object.keys(mergedStyle).length > 0) {
18774
- props.style = mergedStyle;
18775
- }
18776
- return {
18777
- props,
18778
- internalRef: internalSlotProps.ref
18779
- };
18780
- }
18781
- function useSlot(name2, parameters) {
18782
- const {
18783
- className,
18784
- elementType: initialElementType,
18785
- ownerState,
18786
- externalForwardedProps,
18787
- internalForwardedProps,
18788
- shouldForwardComponentProp = false,
18789
- ...useSlotPropsParams
18790
- } = parameters;
18791
- const {
18792
- component: rootComponent,
18793
- slots = {
18794
- [name2]: void 0
18795
- },
18796
- slotProps = {
18797
- [name2]: void 0
18798
- },
18799
- ...other
18800
- } = externalForwardedProps;
18801
- const elementType = slots[name2] || initialElementType;
18802
- const resolvedComponentsProps = resolveComponentProps(slotProps[name2], ownerState);
18803
- const {
18804
- props: {
18805
- component: slotComponent,
18806
- ...mergedProps
18807
- },
18808
- internalRef
18809
- } = mergeSlotProps({
18810
- className,
18811
- ...useSlotPropsParams,
18812
- externalForwardedProps: name2 === "root" ? other : void 0,
18813
- externalSlotProps: resolvedComponentsProps
18814
- });
18815
- const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.ref);
18816
- const LeafComponent = name2 === "root" ? slotComponent || rootComponent : slotComponent;
18817
- const props = appendOwnerState(elementType, {
18818
- ...name2 === "root" && !rootComponent && !slots[name2] && internalForwardedProps,
18819
- ...name2 !== "root" && !slots[name2] && internalForwardedProps,
18820
- ...mergedProps,
18821
- ...LeafComponent && !shouldForwardComponentProp && {
18822
- as: LeafComponent
18823
- },
18824
- ...LeafComponent && shouldForwardComponentProp && {
18825
- component: LeafComponent
18826
- },
18827
- ref
18828
- }, ownerState);
18829
- return [elementType, props];
18830
- }
18831
- const useUtilityClasses$1 = (ownerState) => {
18832
- const {
18833
- classes,
18834
- anchorOrigin
18835
- } = ownerState;
18836
- const slots = {
18837
- root: ["root", `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}`]
18838
- };
18839
- return composeClasses(slots, getSnackbarUtilityClass, classes);
18840
- };
18841
- const SnackbarRoot = styled("div", {
18842
- name: "MuiSnackbar",
18843
- slot: "Root",
18844
- overridesResolver: (props, styles2) => {
18845
- const {
18846
- ownerState
18847
- } = props;
18848
- return [styles2.root, styles2[`anchorOrigin${capitalize(ownerState.anchorOrigin.vertical)}${capitalize(ownerState.anchorOrigin.horizontal)}`]];
18849
- }
18850
- })(memoTheme(({
18851
- theme
18852
- }) => ({
18853
- zIndex: (theme.vars || theme).zIndex.snackbar,
18854
- position: "fixed",
18855
- display: "flex",
18856
- left: 8,
18857
- right: 8,
18858
- justifyContent: "center",
18859
- alignItems: "center",
18860
- variants: [{
18861
- props: ({
18862
- ownerState
18863
- }) => ownerState.anchorOrigin.vertical === "top",
18864
- style: {
18865
- top: 8,
18866
- [theme.breakpoints.up("sm")]: {
18867
- top: 24
18868
- }
18869
- }
18870
- }, {
18871
- props: ({
18872
- ownerState
18873
- }) => ownerState.anchorOrigin.vertical !== "top",
18874
- style: {
18875
- bottom: 8,
18876
- [theme.breakpoints.up("sm")]: {
18877
- bottom: 24
18878
- }
18879
- }
18880
- }, {
18881
- props: ({
18882
- ownerState
18883
- }) => ownerState.anchorOrigin.horizontal === "left",
18884
- style: {
18885
- justifyContent: "flex-start",
18886
- [theme.breakpoints.up("sm")]: {
18887
- left: 24,
18888
- right: "auto"
18889
- }
18890
- }
18891
- }, {
18892
- props: ({
18893
- ownerState
18894
- }) => ownerState.anchorOrigin.horizontal === "right",
18895
- style: {
18896
- justifyContent: "flex-end",
18897
- [theme.breakpoints.up("sm")]: {
18898
- right: 24,
18899
- left: "auto"
18900
- }
18901
- }
18902
- }, {
18903
- props: ({
18904
- ownerState
18905
- }) => ownerState.anchorOrigin.horizontal === "center",
18906
- style: {
18907
- [theme.breakpoints.up("sm")]: {
18908
- left: "50%",
18909
- right: "auto",
18910
- transform: "translateX(-50%)"
18911
- }
18912
- }
18913
- }]
18914
- })));
18915
- const Snackbar = /* @__PURE__ */ React__namespace.forwardRef(function Snackbar2(inProps, ref) {
18916
- const props = useDefaultProps({
18917
- props: inProps,
18918
- name: "MuiSnackbar"
18919
- });
18920
- const theme = useTheme();
18921
- const defaultTransitionDuration = {
18922
- enter: theme.transitions.duration.enteringScreen,
18923
- exit: theme.transitions.duration.leavingScreen
18924
- };
18925
- const {
18926
- action,
18927
- anchorOrigin: {
18928
- vertical,
18929
- horizontal
18930
- } = {
18931
- vertical: "bottom",
18932
- horizontal: "left"
18933
- },
18934
- autoHideDuration = null,
18935
- children,
18936
- className,
18937
- ClickAwayListenerProps: ClickAwayListenerPropsProp,
18938
- ContentProps: ContentPropsProp,
18939
- disableWindowBlurListener = false,
18940
- message,
18941
- onBlur,
18942
- onClose,
18943
- onFocus,
18944
- onMouseEnter,
18945
- onMouseLeave,
18946
- open,
18947
- resumeHideDuration,
18948
- slots = {},
18949
- slotProps = {},
18950
- TransitionComponent: TransitionComponentProp,
18951
- transitionDuration = defaultTransitionDuration,
18952
- TransitionProps: {
18953
- onEnter,
18954
- onExited,
18955
- ...TransitionPropsProp
18956
- } = {},
18957
- ...other
18958
- } = props;
18959
- const ownerState = {
18960
- ...props,
18961
- anchorOrigin: {
18962
- vertical,
18963
- horizontal
18964
- },
18965
- autoHideDuration,
18966
- disableWindowBlurListener,
18967
- TransitionComponent: TransitionComponentProp,
18968
- transitionDuration
18969
- };
18970
- const classes = useUtilityClasses$1(ownerState);
18971
- const {
18972
- getRootProps,
18973
- onClickAway
18974
- } = useSnackbar$1({
18975
- ...ownerState
18976
- });
18977
- const [exited, setExited] = React__namespace.useState(true);
18978
- const handleExited = (node) => {
18979
- setExited(true);
18980
- if (onExited) {
18981
- onExited(node);
18982
- }
18983
- };
18984
- const handleEnter = (node, isAppearing) => {
18985
- setExited(false);
18986
- if (onEnter) {
18987
- onEnter(node, isAppearing);
18988
- }
18989
- };
18990
- const externalForwardedProps = {
18991
- slots: {
18992
- transition: TransitionComponentProp,
18993
- ...slots
18994
- },
18995
- slotProps: {
18996
- content: ContentPropsProp,
18997
- clickAwayListener: ClickAwayListenerPropsProp,
18998
- transition: TransitionPropsProp,
18999
- ...slotProps
19000
- }
19001
- };
19002
- const [Root, rootProps] = useSlot("root", {
19003
- ref,
19004
- className: [classes.root, className],
19005
- elementType: SnackbarRoot,
19006
- getSlotProps: getRootProps,
19007
- externalForwardedProps: {
19008
- ...externalForwardedProps,
19009
- ...other
19010
- },
19011
- ownerState
19012
- });
19013
- const [ClickAwaySlot, {
19014
- ownerState: clickAwayOwnerStateProp,
19015
- ...clickAwayListenerProps
19016
- }] = useSlot("clickAwayListener", {
19017
- elementType: ClickAwayListener,
19018
- externalForwardedProps,
19019
- getSlotProps: (handlers) => ({
19020
- onClickAway: (...params) => {
19021
- const event = params[0];
19022
- handlers.onClickAway?.(...params);
19023
- if (event?.defaultMuiPrevented) {
19024
- return;
19025
- }
19026
- onClickAway(...params);
19027
- }
19028
- }),
19029
- ownerState
19030
- });
19031
- const [ContentSlot, contentSlotProps] = useSlot("content", {
19032
- elementType: SnackbarContent,
19033
- shouldForwardComponentProp: true,
19034
- externalForwardedProps,
19035
- additionalProps: {
19036
- message,
19037
- action
19038
- },
19039
- ownerState
19040
- });
19041
- const [TransitionSlot, transitionProps] = useSlot("transition", {
19042
- elementType: Grow,
19043
- externalForwardedProps,
19044
- getSlotProps: (handlers) => ({
19045
- onEnter: (...params) => {
19046
- handlers.onEnter?.(...params);
19047
- handleEnter(...params);
19048
- },
19049
- onExited: (...params) => {
19050
- handlers.onExited?.(...params);
19051
- handleExited(...params);
19052
- }
19053
- }),
19054
- additionalProps: {
19055
- appear: true,
19056
- in: open,
19057
- timeout: transitionDuration,
19058
- direction: vertical === "top" ? "down" : "up"
19059
- },
19060
- ownerState
19061
- });
19062
- if (!open && exited) {
19063
- return null;
19064
- }
19065
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ClickAwaySlot, {
19066
- ...clickAwayListenerProps,
19067
- ...slots.clickAwayListener && {
19068
- ownerState: clickAwayOwnerStateProp
19069
- },
19070
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root, {
19071
- ...rootProps,
19072
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionSlot, {
19073
- ...transitionProps,
19074
- children: children || /* @__PURE__ */ jsxRuntimeExports.jsx(ContentSlot, {
19075
- ...contentSlotProps
19076
- })
19077
- })
19078
- })
19079
- });
19080
- });
19081
- process.env.NODE_ENV !== "production" ? Snackbar.propTypes = {
19082
- // ┌────────────────────────────── Warning ──────────────────────────────┐
19083
- // │ These PropTypes are generated from the TypeScript type definitions. │
19084
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
19085
- // └─────────────────────────────────────────────────────────────────────┘
19086
- /**
19087
- * The action to display. It renders after the message, at the end of the snackbar.
19088
- */
19089
- action: PropTypes.node,
19090
- /**
19091
- * The anchor of the `Snackbar`.
19092
- * On smaller screens, the component grows to occupy all the available width,
19093
- * the horizontal alignment is ignored.
19094
- * @default { vertical: 'bottom', horizontal: 'left' }
19095
- */
19096
- anchorOrigin: PropTypes.shape({
19097
- horizontal: PropTypes.oneOf(["center", "left", "right"]).isRequired,
19098
- vertical: PropTypes.oneOf(["bottom", "top"]).isRequired
19099
- }),
19100
- /**
19101
- * The number of milliseconds to wait before automatically calling the
19102
- * `onClose` function. `onClose` should then set the state of the `open`
19103
- * prop to hide the Snackbar. This behavior is disabled by default with
19104
- * the `null` value.
19105
- * @default null
19106
- */
19107
- autoHideDuration: PropTypes.number,
19108
- /**
19109
- * Replace the `SnackbarContent` component.
19110
- */
19111
- children: PropTypes.element,
19112
- /**
19113
- * Override or extend the styles applied to the component.
19114
- */
19115
- classes: PropTypes.object,
19116
- /**
19117
- * @ignore
19118
- */
19119
- className: PropTypes.string,
19120
- /**
19121
- * Props applied to the `ClickAwayListener` element.
19122
- * @deprecated Use `slotProps.clickAwayListener` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
19123
- */
19124
- ClickAwayListenerProps: PropTypes.object,
19125
- /**
19126
- * Props applied to the [`SnackbarContent`](https://mui.com/material-ui/api/snackbar-content/) element.
19127
- * @deprecated Use `slotProps.content` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
19128
- */
19129
- ContentProps: PropTypes.object,
19130
- /**
19131
- * If `true`, the `autoHideDuration` timer will expire even if the window is not focused.
19132
- * @default false
19133
- */
19134
- disableWindowBlurListener: PropTypes.bool,
19135
- /**
19136
- * When displaying multiple consecutive snackbars using a single parent-rendered
19137
- * `<Snackbar/>`, add the `key` prop to ensure independent treatment of each message.
19138
- * For instance, use `<Snackbar key={message} />`. Otherwise, messages might update
19139
- * in place, and features like `autoHideDuration` could be affected.
19140
- */
19141
- key: () => null,
19142
- /**
19143
- * The message to display.
19144
- */
19145
- message: PropTypes.node,
19146
- /**
19147
- * @ignore
19148
- */
19149
- onBlur: PropTypes.func,
19150
- /**
19151
- * Callback fired when the component requests to be closed.
19152
- * Typically `onClose` is used to set state in the parent component,
19153
- * which is used to control the `Snackbar` `open` prop.
19154
- * The `reason` parameter can optionally be used to control the response to `onClose`,
19155
- * for example ignoring `clickaway`.
19156
- *
19157
- * @param {React.SyntheticEvent<any> | Event} event The event source of the callback.
19158
- * @param {string} reason Can be: `"timeout"` (`autoHideDuration` expired), `"clickaway"`, or `"escapeKeyDown"`.
19159
- */
19160
- onClose: PropTypes.func,
19161
- /**
19162
- * @ignore
19163
- */
19164
- onFocus: PropTypes.func,
19165
- /**
19166
- * @ignore
19167
- */
19168
- onMouseEnter: PropTypes.func,
19169
- /**
19170
- * @ignore
19171
- */
19172
- onMouseLeave: PropTypes.func,
19173
- /**
19174
- * If `true`, the component is shown.
19175
- */
19176
- open: PropTypes.bool,
19177
- /**
19178
- * The number of milliseconds to wait before dismissing after user interaction.
19179
- * If `autoHideDuration` prop isn't specified, it does nothing.
19180
- * If `autoHideDuration` prop is specified but `resumeHideDuration` isn't,
19181
- * we default to `autoHideDuration / 2` ms.
19182
- */
19183
- resumeHideDuration: PropTypes.number,
19184
- /**
19185
- * The props used for each slot inside.
19186
- * @default {}
19187
- */
19188
- slotProps: PropTypes.shape({
19189
- clickAwayListener: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
19190
- content: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
19191
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
19192
- transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
19193
- }),
19194
- /**
19195
- * The components used for each slot inside.
19196
- * @default {}
19197
- */
19198
- slots: PropTypes.shape({
19199
- clickAwayListener: PropTypes.elementType,
19200
- content: PropTypes.elementType,
19201
- root: PropTypes.elementType,
19202
- transition: PropTypes.elementType
19203
- }),
19204
- /**
19205
- * The system prop that allows defining system overrides as well as additional CSS styles.
19206
- */
19207
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
19208
- /**
19209
- * The component used for the transition.
19210
- * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
19211
- * @deprecated Use `slots.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
19212
- * @default Grow
19213
- */
19214
- TransitionComponent: PropTypes.elementType,
19215
- /**
19216
- * The duration for the transition, in milliseconds.
19217
- * You may specify a single timeout for all transitions, or individually with an object.
19218
- * @default {
19219
- * enter: theme.transitions.duration.enteringScreen,
19220
- * exit: theme.transitions.duration.leavingScreen,
19221
- * }
19222
- */
19223
- transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
19224
- appear: PropTypes.number,
19225
- enter: PropTypes.number,
19226
- exit: PropTypes.number
19227
- })]),
19228
- /**
19229
- * Props applied to the transition element.
19230
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
19231
- * @deprecated Use `slotProps.transition` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
19232
- * @default {}
19233
- */
19234
- TransitionProps: PropTypes.object
19235
- } : void 0;
19236
- var SnackbarType = /* @__PURE__ */ ((SnackbarType2) => {
19237
- SnackbarType2["INFO"] = "info";
19238
- SnackbarType2["SUCCESS"] = "success";
19239
- SnackbarType2["ERROR"] = "error";
19240
- SnackbarType2["WARNING"] = "warning";
19241
- return SnackbarType2;
19242
- })(SnackbarType || {});
19243
- const SnackbarContext = React.createContext(
19244
- void 0
19245
- );
19246
- const SnackbarProvider = ({
19247
- children
19248
- }) => {
19249
- const [snackbar, setSnackbar] = React.useState(
19250
- {
19251
- open: false,
19252
- message: "",
19253
- type: "info"
19254
- /* INFO */
19255
- }
19256
- );
19257
- const showSnackbar = (params) => {
19258
- setSnackbar({
19259
- open: true,
19260
- ...params
19261
- });
19262
- };
19263
- const handleClose = () => {
19264
- setSnackbar({ ...snackbar, open: false });
19265
- };
19266
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(SnackbarContext.Provider, { value: { showSnackbar }, children: [
19267
- children,
19268
- /* @__PURE__ */ jsxRuntimeExports.jsx(
19269
- Snackbar,
19270
- {
19271
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
19272
- sx: {
19273
- "&.MuiSnackbar-root": {
19274
- bottom: STYLE.PADDING_GAP_LAYOUT,
19275
- right: STYLE.PADDING_GAP_LAYOUT
19276
- }
19277
- },
19278
- open: snackbar.open,
19279
- autoHideDuration: 6e3,
19280
- onClose: handleClose,
19281
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
19282
- material.Alert,
19283
- {
19284
- sx: { borderRadius: STYLE.BORDER_RADIUS_ELEMENT, boxShadow: 1 },
19285
- onClose: handleClose,
19286
- severity: snackbar.type,
19287
- children: snackbar.message
19288
- }
19289
- )
19290
- }
19291
- )
19292
- ] });
19293
- };
19294
- const useSnackbar = () => {
19295
- const context = React.useContext(SnackbarContext);
19296
- if (!context)
19297
- throw new Error("useSnackbar must be used within a SnackbarProvider");
19298
- return context;
19299
- };
19300
- const AuthLayout = ({ children }) => {
19301
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
19302
- material.Stack,
19303
- {
19304
- sx: {
19305
- height: "100vh",
19306
- width: "100%",
19307
- backgroundImage: `url(/images/login.jpg)`,
19308
- backgroundSize: "cover",
19309
- backgroundPosition: "center"
19310
- },
19311
- children
17353
+ var SnackbarType = /* @__PURE__ */ ((SnackbarType2) => {
17354
+ SnackbarType2["INFO"] = "info";
17355
+ SnackbarType2["SUCCESS"] = "success";
17356
+ SnackbarType2["ERROR"] = "error";
17357
+ SnackbarType2["WARNING"] = "warning";
17358
+ return SnackbarType2;
17359
+ })(SnackbarType || {});
17360
+ const SnackbarContext = React.createContext(void 0);
17361
+ const useSnackbar = () => {
17362
+ const context = React.useContext(SnackbarContext);
17363
+ if (!context) throw new Error("useSnackbar must be used within a SnackbarProvider");
17364
+ return context;
17365
+ };
17366
+ const AuthLayout = ({ children }) => {
17367
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
17368
+ material.Stack,
17369
+ {
17370
+ sx: {
17371
+ height: "100vh",
17372
+ width: "100%",
17373
+ backgroundImage: `url(/images/login.jpg)`,
17374
+ backgroundSize: "cover",
17375
+ backgroundPosition: "center"
17376
+ },
17377
+ children
19312
17378
  }
19313
17379
  );
19314
17380
  };
@@ -19582,9 +17648,9 @@ const extractNumberAtStartString = (string2) => {
19582
17648
  const match = string2.match(/^\d+(\.\d+)?/);
19583
17649
  return match ? parseFloat(match[0]) : 0;
19584
17650
  };
19585
- const stripHtml = (html) => {
17651
+ const stripHtml = (html2) => {
19586
17652
  const tempDiv = document.createElement("div");
19587
- tempDiv.innerHTML = html;
17653
+ tempDiv.innerHTML = html2;
19588
17654
  return tempDiv.textContent || tempDiv.innerText || "";
19589
17655
  };
19590
17656
  const getErrorMessage = (e) => e?.message ?? "Đã xảy ra lỗi không xác định!";
@@ -20722,15 +18788,6 @@ const useIsSystemMonitor = () => {
20722
18788
  const normalize = (p) => p.replace(/\/+$/, "");
20723
18789
  return normalize(location2.pathname) === normalize(PAGE.DASHBOARD.path);
20724
18790
  };
20725
- const useAllApps = () => {
20726
- const userType = reactRedux.useSelector((state) => state.account.user?.type);
20727
- const allApps = React.useMemo(() => {
20728
- return SYSTEM_MODULES.filter((app2) => {
20729
- return app2.allowUserTypes.includes(userType);
20730
- });
20731
- }, [userType]);
20732
- return allApps;
20733
- };
20734
18791
  const useActiveSidebar = () => {
20735
18792
  const { user, current_access } = reactRedux.useSelector((state) => state.account);
20736
18793
  const activeSidebar = React.useMemo(() => {
@@ -20740,18 +18797,6 @@ const useActiveSidebar = () => {
20740
18797
  }, [current_access, user]);
20741
18798
  return activeSidebar;
20742
18799
  };
20743
- const useSidebarState = () => {
20744
- const [isSidebarOpen, setIsSidebarOpen] = React.useState(false);
20745
- const openSidebar = () => setIsSidebarOpen(true);
20746
- const closeSidebar = () => setIsSidebarOpen(false);
20747
- const toggleSidebar = () => setIsSidebarOpen((prev) => !prev);
20748
- return {
20749
- isSidebarOpen,
20750
- openSidebar,
20751
- closeSidebar,
20752
- toggleSidebar
20753
- };
20754
- };
20755
18800
  const BellComponent = ({}) => {
20756
18801
  const isSystemMonitor = useIsSystemMonitor();
20757
18802
  const { notificationCount } = reactRedux.useSelector((state) => state.account);
@@ -21282,13 +19327,7 @@ const MonitorPart = ({ children }) => {
21282
19327
  },
21283
19328
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(system.Stack, { p: { padding: STYLE.PADDING_GAP_LAYOUT }, children: [
21284
19329
  /* @__PURE__ */ jsxRuntimeExports.jsxs(StackRowJustBetween, { children: [
21285
- /* @__PURE__ */ jsxRuntimeExports.jsx(StackRowAlignCenter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
21286
- LogoComponent,
21287
- {
21288
- url: "/images/logo/logo-sub-3.svg",
21289
- fillColor: "white"
21290
- }
21291
- ) }),
19330
+ /* @__PURE__ */ jsxRuntimeExports.jsx(StackRowAlignCenter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(LogoComponent, { url: "/images/logo/logo-sub-3.svg", fillColor: "white" }) }),
21292
19331
  /* @__PURE__ */ jsxRuntimeExports.jsxs(StackRowAlignCenter, { children: [
21293
19332
  /* @__PURE__ */ jsxRuntimeExports.jsx(BellComponent, {}),
21294
19333
  /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarUserComponent, {})
@@ -24178,13 +22217,13 @@ Object.assign(/* @__PURE__ */ Object.create(null), {
24178
22217
  });
24179
22218
  const isSchema = (obj) => obj && obj.__isYupSchema__;
24180
22219
  class Condition {
24181
- static fromOptions(refs, config2) {
24182
- if (!config2.then && !config2.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
22220
+ static fromOptions(refs, config) {
22221
+ if (!config.then && !config.otherwise) throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");
24183
22222
  let {
24184
22223
  is,
24185
22224
  then,
24186
22225
  otherwise
24187
- } = config2;
22226
+ } = config;
24188
22227
  let check = typeof is === "function" ? is : (...values2) => values2.every((value2) => value2 === is);
24189
22228
  return new Condition(refs, (values2, schema) => {
24190
22229
  var _branch;
@@ -24270,7 +22309,7 @@ class Reference {
24270
22309
  }
24271
22310
  Reference.prototype.__isYupRef = true;
24272
22311
  const isAbsent = (value2) => value2 == null;
24273
- function createValidation(config2) {
22312
+ function createValidation(config) {
24274
22313
  function validate({
24275
22314
  value: value2,
24276
22315
  path = "",
@@ -24284,7 +22323,7 @@ function createValidation(config2) {
24284
22323
  params,
24285
22324
  message,
24286
22325
  skipAbsent
24287
- } = config2;
22326
+ } = config;
24288
22327
  let {
24289
22328
  parent,
24290
22329
  context,
@@ -24352,7 +22391,7 @@ function createValidation(config2) {
24352
22391
  }
24353
22392
  handleResult(result);
24354
22393
  }
24355
- validate.OPTIONS = config2;
22394
+ validate.OPTIONS = config;
24356
22395
  return validate;
24357
22396
  }
24358
22397
  function resolveParams(params, options) {
@@ -25958,17 +23997,11 @@ const AuthPage = ({}) => {
25958
23997
  resetForm();
25959
23998
  break;
25960
23999
  case AuthProcess.FORGOT_PASSWORD:
25961
- await authApi.forgotPassword({
25962
- phone: authDto.phone,
25963
- type: ForgotPasswordType.PHONE
25964
- });
24000
+ await authApi.forgotPassword({ phone: authDto.phone, type: ForgotPasswordType.PHONE });
25965
24001
  setAuthProcess(AuthProcess.VERIFY_OTP);
25966
24002
  break;
25967
24003
  case AuthProcess.VERIFY_OTP: {
25968
- const res = await authApi.verifyOtp({
25969
- otp: authDto.otp,
25970
- phone: authDto.phone
25971
- });
24004
+ const res = await authApi.verifyOtp({ otp: authDto.otp, phone: authDto.phone });
25972
24005
  setFieldValue("token", res.token);
25973
24006
  setAuthProcess(AuthProcess.RESET_PASSWORD);
25974
24007
  break;
@@ -25987,170 +24020,140 @@ const AuthPage = ({}) => {
25987
24020
  break;
25988
24021
  }
25989
24022
  } catch (error) {
25990
- showSnackbar({
25991
- message: getErrorMessage(error),
25992
- type: SnackbarType.ERROR
25993
- });
24023
+ showSnackbar({ message: getErrorMessage(error), type: SnackbarType.ERROR });
25994
24024
  } finally {
25995
24025
  if (showPassword) setShowPassword(false);
25996
24026
  setLoading(false);
25997
24027
  }
25998
24028
  };
25999
24029
  const [showPassword, setShowPassword] = React.useState(false);
26000
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
26001
- material.Stack,
24030
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(material.Stack, { sx: { display: "flex", justifyContent: "center", alignItems: "center", position: "relative", width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
24031
+ Formik,
26002
24032
  {
26003
- sx: {
26004
- display: "flex",
26005
- justifyContent: "center",
26006
- alignItems: "center",
26007
- position: "relative",
26008
- width: "100%",
26009
- height: "100%"
26010
- },
26011
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26012
- Formik,
26013
- {
26014
- initialValues: {
26015
- emailOrPhone: "",
26016
- password: "",
26017
- token: "",
26018
- otp: "",
26019
- phone: ""
26020
- },
26021
- validationSchema: validationSchema(authProcess),
26022
- onSubmit,
26023
- validateOnChange: false,
26024
- enableReinitialize: true,
26025
- children: (formik) => {
26026
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { noValidate: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
26027
- material.Stack,
26028
- {
26029
- sx: {
26030
- width: 400,
26031
- backgroundColor: `${palette.background.default}${OPACITY[80]}`,
26032
- backdropFilter: "blur(10px)",
26033
- borderRadius: 3.5,
26034
- padding: 3,
26035
- boxShadow: 1,
26036
- alignItems: "center"
26037
- },
26038
- gap: 3,
26039
- children: [
26040
- /* @__PURE__ */ jsxRuntimeExports.jsx(LogoComponent, { url: "/images/logo/logo-sub-4.svg" }),
26041
- authProcess === AuthProcess.LOGIN && /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
26042
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26043
- TextFieldElement,
26044
- {
26045
- iconLabel: "mail",
26046
- label: "Số điện thoại",
26047
- name: "emailOrPhone",
26048
- placeholder: "Nhập số điện thoại",
26049
- error: formik.errors.emailOrPhone,
26050
- value: formik.values.emailOrPhone,
26051
- onChange: formik.handleChange,
26052
- sx: {
26053
- "& fieldset": { borderColor: palette.primary.light }
26054
- },
26055
- required: true
26056
- }
26057
- ),
26058
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26059
- TextFieldElement,
24033
+ initialValues: { emailOrPhone: "", password: "", token: "", otp: "", phone: "" },
24034
+ validationSchema: validationSchema(authProcess),
24035
+ onSubmit,
24036
+ validateOnChange: false,
24037
+ enableReinitialize: true,
24038
+ children: (formik) => {
24039
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { noValidate: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
24040
+ material.Stack,
24041
+ {
24042
+ sx: {
24043
+ width: 400,
24044
+ backgroundColor: `${palette.background.default}${OPACITY[80]}`,
24045
+ backdropFilter: "blur(10px)",
24046
+ borderRadius: 3.5,
24047
+ padding: 3,
24048
+ boxShadow: 1,
24049
+ alignItems: "center"
24050
+ },
24051
+ gap: 3,
24052
+ children: [
24053
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LogoComponent, { url: "/images/logo/logo-sub-4.svg" }),
24054
+ authProcess === AuthProcess.LOGIN && /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
24055
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24056
+ TextFieldElement,
24057
+ {
24058
+ iconLabel: "mail",
24059
+ label: "Số điện thoại",
24060
+ name: "emailOrPhone",
24061
+ placeholder: "Nhập số điện thoại",
24062
+ error: formik.errors.emailOrPhone,
24063
+ value: formik.values.emailOrPhone,
24064
+ onChange: formik.handleChange,
24065
+ sx: { "& fieldset": { borderColor: palette.primary.light } },
24066
+ required: true
24067
+ }
24068
+ ),
24069
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24070
+ TextFieldElement,
24071
+ {
24072
+ iconLabel: "vpn_key",
24073
+ label: "Mật khẩu",
24074
+ name: "password",
24075
+ autoComplete: "current-password",
24076
+ placeholder: "Nhập mật khẩu",
24077
+ error: formik.errors.password,
24078
+ value: formik.values.password,
24079
+ onChange: formik.handleChange,
24080
+ type: showPassword ? "text" : "password",
24081
+ sx: { "& fieldset": { borderColor: palette.primary.light } },
24082
+ InputProps: {
24083
+ endAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(material.InputAdornment, { position: "end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
24084
+ IconElement,
24085
+ {
24086
+ icon: showPassword ? "visibility" : "visibility_off",
24087
+ onClick: () => setShowPassword(!showPassword)
24088
+ }
24089
+ ) })
24090
+ },
24091
+ required: true
24092
+ }
24093
+ )
24094
+ ] }),
24095
+ authProcess === AuthProcess.FORGOT_PASSWORD && /* @__PURE__ */ jsxRuntimeExports.jsx(
24096
+ TextFieldElement,
24097
+ {
24098
+ iconLabel: "mail",
24099
+ label: "Số điện thoại",
24100
+ name: "phone",
24101
+ placeholder: "Nhập số điện thoại",
24102
+ sx: { "& fieldset": { borderColor: palette.primary.light } },
24103
+ error: formik.errors.phone,
24104
+ value: formik.values.phone,
24105
+ onChange: formik.handleChange,
24106
+ required: true
24107
+ }
24108
+ ),
24109
+ authProcess === AuthProcess.VERIFY_OTP && /* @__PURE__ */ jsxRuntimeExports.jsx(OtpPart, { setAuthProcess }),
24110
+ authProcess === AuthProcess.RESET_PASSWORD && /* @__PURE__ */ jsxRuntimeExports.jsx(
24111
+ TextFieldElement,
24112
+ {
24113
+ label: "Mật khẩu",
24114
+ placeholder: "Nhập mật khẩu",
24115
+ name: "password",
24116
+ error: formik.errors.password,
24117
+ required: true,
24118
+ value: formik.values.password,
24119
+ onChange: formik.handleChange,
24120
+ sx: { "& fieldset": { borderColor: palette.primary.light } },
24121
+ type: showPassword ? "text" : "password",
24122
+ InputProps: {
24123
+ endAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(material.InputAdornment, { position: "end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
24124
+ IconElement,
26060
24125
  {
26061
- iconLabel: "vpn_key",
26062
- label: "Mật khẩu",
26063
- name: "password",
26064
- autoComplete: "current-password",
26065
- placeholder: "Nhập mật khẩu",
26066
- error: formik.errors.password,
26067
- value: formik.values.password,
26068
- onChange: formik.handleChange,
26069
- type: showPassword ? "text" : "password",
26070
- sx: {
26071
- "& fieldset": { borderColor: palette.primary.light }
26072
- },
26073
- InputProps: {
26074
- endAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(material.InputAdornment, { position: "end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26075
- IconElement,
26076
- {
26077
- icon: showPassword ? "visibility" : "visibility_off",
26078
- onClick: () => setShowPassword(!showPassword)
26079
- }
26080
- ) })
26081
- },
26082
- required: true
26083
- }
26084
- )
26085
- ] }),
26086
- authProcess === AuthProcess.FORGOT_PASSWORD && /* @__PURE__ */ jsxRuntimeExports.jsx(
26087
- TextFieldElement,
26088
- {
26089
- iconLabel: "mail",
26090
- label: "Số điện thoại",
26091
- name: "phone",
26092
- placeholder: "Nhập số điện thoại",
26093
- sx: {
26094
- "& fieldset": { borderColor: palette.primary.light }
26095
- },
26096
- error: formik.errors.phone,
26097
- value: formik.values.phone,
26098
- onChange: formik.handleChange,
26099
- required: true
26100
- }
26101
- ),
26102
- authProcess === AuthProcess.VERIFY_OTP && /* @__PURE__ */ jsxRuntimeExports.jsx(OtpPart, { setAuthProcess }),
26103
- authProcess === AuthProcess.RESET_PASSWORD && /* @__PURE__ */ jsxRuntimeExports.jsx(
26104
- TextFieldElement,
26105
- {
26106
- label: "Mật khẩu",
26107
- placeholder: "Nhập mật khẩu",
26108
- name: "password",
26109
- error: formik.errors.password,
26110
- required: true,
26111
- value: formik.values.password,
26112
- onChange: formik.handleChange,
26113
- sx: {
26114
- "& fieldset": { borderColor: palette.primary.light }
26115
- },
26116
- type: showPassword ? "text" : "password",
26117
- InputProps: {
26118
- endAdornment: /* @__PURE__ */ jsxRuntimeExports.jsx(material.InputAdornment, { position: "end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
26119
- IconElement,
26120
- {
26121
- icon: showPassword ? "visibility" : "visibility_off",
26122
- onClick: () => setShowPassword(!showPassword)
26123
- }
26124
- ) })
24126
+ icon: showPassword ? "visibility" : "visibility_off",
24127
+ onClick: () => setShowPassword(!showPassword)
26125
24128
  }
26126
- }
26127
- ),
26128
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26129
- IconContentElement,
26130
- {
26131
- icon: BUTTON_BACK_ICON_CONTENT[authProcess].backIcon,
26132
- content: BUTTON_BACK_ICON_CONTENT[authProcess].backContent,
26133
- sx: { flexDirection: "row-reverse", width: "100%" },
26134
- onClick: () => authProcess === AuthProcess.LOGIN ? setAuthProcess(AuthProcess.FORGOT_PASSWORD) : setAuthProcess(AuthProcess.LOGIN)
26135
- }
26136
- ),
26137
- /* @__PURE__ */ jsxRuntimeExports.jsx(
26138
- ButtonElement,
26139
- {
26140
- loading,
26141
- content: BUTTON_BACK_ICON_CONTENT[authProcess].button,
26142
- type: "submit",
26143
- disabled: authProcess === AuthProcess.VERIFY_OTP ? formik.values.otp.length < 4 : false
26144
- }
26145
- )
26146
- ]
26147
- }
26148
- ) });
24129
+ ) })
24130
+ }
24131
+ }
24132
+ ),
24133
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24134
+ IconContentElement,
24135
+ {
24136
+ icon: BUTTON_BACK_ICON_CONTENT[authProcess].backIcon,
24137
+ content: BUTTON_BACK_ICON_CONTENT[authProcess].backContent,
24138
+ sx: { flexDirection: "row-reverse", width: "100%" },
24139
+ onClick: () => authProcess === AuthProcess.LOGIN ? setAuthProcess(AuthProcess.FORGOT_PASSWORD) : setAuthProcess(AuthProcess.LOGIN)
24140
+ }
24141
+ ),
24142
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
24143
+ ButtonElement,
24144
+ {
24145
+ loading,
24146
+ content: BUTTON_BACK_ICON_CONTENT[authProcess].button,
24147
+ type: "submit",
24148
+ disabled: authProcess === AuthProcess.VERIFY_OTP ? formik.values.otp.length < 4 : false
24149
+ }
24150
+ )
24151
+ ]
26149
24152
  }
26150
- }
26151
- )
24153
+ ) });
24154
+ }
26152
24155
  }
26153
- );
24156
+ ) });
26154
24157
  };
26155
24158
  const DashboardPage = () => {
26156
24159
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Outlet, {});
@@ -29479,10 +27482,10 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
29479
27482
  }
29480
27483
  return values2;
29481
27484
  }
29482
- const makeUseVisualState = (config2) => (props, isStatic) => {
27485
+ const makeUseVisualState = (config) => (props, isStatic) => {
29483
27486
  const context = React.useContext(MotionContext);
29484
27487
  const presenceContext = React.useContext(PresenceContext);
29485
- const make = () => makeState(config2, props, context, presenceContext);
27488
+ const make = () => makeState(config, props, context, presenceContext);
29486
27489
  return isStatic ? make() : useConstant(make);
29487
27490
  };
29488
27491
  function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
@@ -31814,13 +29817,13 @@ class FlatTree {
31814
29817
  this.children.forEach(callback);
31815
29818
  }
31816
29819
  }
31817
- function delay(callback, timeout2) {
29820
+ function delay(callback, timeout) {
31818
29821
  const start = time.now();
31819
29822
  const checkElapsed = ({ timestamp }) => {
31820
29823
  const elapsed = timestamp - start;
31821
- if (elapsed >= timeout2) {
29824
+ if (elapsed >= timeout) {
31822
29825
  cancelFrame(checkElapsed);
31823
- callback(elapsed - timeout2);
29826
+ callback(elapsed - timeout);
31824
29827
  }
31825
29828
  };
31826
29829
  frame.setup(checkElapsed, true);
@@ -32806,10 +30809,10 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
32806
30809
  }
32807
30810
  const stack = this.sharedNodes.get(layoutId);
32808
30811
  stack.add(node);
32809
- const config2 = node.options.initialPromotionConfig;
30812
+ const config = node.options.initialPromotionConfig;
32810
30813
  node.promote({
32811
- transition: config2 ? config2.transition : void 0,
32812
- preserveFollowOpacity: config2 && config2.shouldPreserveFollowOpacity ? config2.shouldPreserveFollowOpacity(node) : void 0
30814
+ transition: config ? config.transition : void 0,
30815
+ preserveFollowOpacity: config && config.shouldPreserveFollowOpacity ? config.shouldPreserveFollowOpacity(node) : void 0
32813
30816
  });
32814
30817
  }
32815
30818
  isLead() {
@@ -33776,18 +31779,10 @@ const routes = [
33776
31779
  }
33777
31780
  ];
33778
31781
  const renderRoutes = (routes2, account) => routes2.map((route) => {
33779
- const {
33780
- path,
33781
- layout: layout2,
33782
- element,
33783
- type,
33784
- allowUserTypes = [],
33785
- children
33786
- } = route;
31782
+ const { path, layout: layout2, element, type, allowUserTypes = [], children } = route;
33787
31783
  const Layout = layout2 || React.Fragment;
33788
31784
  let Element2 = element;
33789
- if (path === PAGE.AUTH.path && account.isLogin)
33790
- Element2 = () => /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { to: PAGE.DASHBOARD.path });
31785
+ if (path === PAGE.AUTH.path && account.isLogin) Element2 = () => /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { to: PAGE.DASHBOARD.path });
33791
31786
  if (type === RouteType.PROTECTED) {
33792
31787
  if (!account.isLogin) Element2 = () => /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { to: PAGE.AUTH.path });
33793
31788
  else if (allowUserTypes.length && !allowUserTypes.includes(account.user.type) && account.user.type !== UserType.ROOT)
@@ -33803,7 +31798,184 @@ const renderRoutes = (routes2, account) => routes2.map((route) => {
33803
31798
  path
33804
31799
  );
33805
31800
  });
31801
+ function useVersionCheck(options) {
31802
+ React.useEffect(() => {
31803
+ let currentVersion = localStorage.getItem("app_version");
31804
+ const checkVersion = async () => {
31805
+ try {
31806
+ const res = await fetch("/version.json", { cache: "no-store" });
31807
+ const data = await res.json();
31808
+ if (!currentVersion) {
31809
+ localStorage.setItem("app_version", data.version);
31810
+ currentVersion = data.version;
31811
+ return;
31812
+ }
31813
+ if (currentVersion !== data.version) {
31814
+ localStorage.setItem("app_version", data.version);
31815
+ window.location.reload();
31816
+ }
31817
+ } catch (err) {
31818
+ console.error("Failed to check version", err);
31819
+ }
31820
+ };
31821
+ checkVersion();
31822
+ if (options?.interval && options.interval > 0) {
31823
+ const timer = setInterval(checkVersion, options.interval);
31824
+ return () => clearInterval(timer);
31825
+ }
31826
+ }, [options?.interval]);
31827
+ }
33806
31828
  initSockets(store);
31829
+ function App() {
31830
+ useVersionCheck({ interval: 5 * 60 * 1e3 });
31831
+ const dispatch = useAppDispatch();
31832
+ const account = reactRedux.useSelector((state) => state.account);
31833
+ const system2 = reactRedux.useSelector((state) => state.system);
31834
+ const { showSnackbar } = useSnackbar();
31835
+ const theme = material.createTheme({
31836
+ ...MODE[system2.mode],
31837
+ ...MODE.OTHER,
31838
+ components: {
31839
+ MuiStack: {
31840
+ styleOverrides: {
31841
+ root: { gap: STYLE.PADDING_GAP_LAYOUT }
31842
+ }
31843
+ },
31844
+ MuiButton: {
31845
+ defaultProps: {
31846
+ size: "medium",
31847
+ fullWidth: true
31848
+ },
31849
+ styleOverrides: {
31850
+ root: {
31851
+ "&.Mui-disabled": {
31852
+ borderColor: MODE[system2.mode].palette.divider
31853
+ },
31854
+ fontWeight: 400,
31855
+ lineHeight: "unset",
31856
+ height: STYLE.HEIGHT_DEFAULT_TEXT_FIELD_BUTTON
31857
+ }
31858
+ }
31859
+ },
31860
+ MuiTooltip: {
31861
+ styleOverrides: {
31862
+ tooltip: {
31863
+ backgroundColor: MODE[system2.mode].palette.background.paper,
31864
+ color: MODE[system2.mode].palette.text.primary,
31865
+ boxShadow: MODE[system2.mode].shadows[1],
31866
+ padding: STYLE.PADDING_GAP_ITEM,
31867
+ margin: `5px !important`,
31868
+ borderRadius: STYLE.BORDER_RADIUS_ELEMENT_WRAPPER,
31869
+ maxWidth: "none"
31870
+ }
31871
+ }
31872
+ },
31873
+ MuiTextField: {
31874
+ defaultProps: {
31875
+ variant: "outlined",
31876
+ size: "small",
31877
+ fullWidth: true
31878
+ },
31879
+ styleOverrides: {
31880
+ root: {
31881
+ "& fieldset": {
31882
+ borderColor: MODE[system2.mode].palette.divider,
31883
+ borderRadius: STYLE.BORDER_RADIUS_ELEMENT
31884
+ },
31885
+ "& .MuiFormHelperText-root": {
31886
+ ...getLimitLineCss(1)
31887
+ }
31888
+ }
31889
+ }
31890
+ },
31891
+ MuiDivider: {
31892
+ styleOverrides: {
31893
+ root: {
31894
+ borderColor: `${MODE[system2.mode].palette.divider}${OPACITY[30]}`
31895
+ }
31896
+ }
31897
+ },
31898
+ MuiTableCell: {
31899
+ styleOverrides: {
31900
+ root: {
31901
+ fontWeight: "unset",
31902
+ boxShadow: "none",
31903
+ border: "none",
31904
+ "&:first-of-type": {
31905
+ borderTopLeftRadius: STYLE.BORDER_RADIUS_ELEMENT,
31906
+ borderBottomLeftRadius: STYLE.BORDER_RADIUS_ELEMENT
31907
+ },
31908
+ "&:last-of-type": {
31909
+ borderTopRightRadius: STYLE.BORDER_RADIUS_ELEMENT,
31910
+ borderBottomRightRadius: STYLE.BORDER_RADIUS_ELEMENT
31911
+ }
31912
+ }
31913
+ }
31914
+ }
31915
+ }
31916
+ });
31917
+ React.useEffect(() => {
31918
+ (async () => {
31919
+ try {
31920
+ account.user && await dispatch(ACTION_ACCOUNT.getAccount(account.user.id)).unwrap();
31921
+ } catch (error) {
31922
+ showSnackbar({
31923
+ message: getErrorMessage(error),
31924
+ type: SnackbarType.ERROR
31925
+ });
31926
+ }
31927
+ })();
31928
+ }, []);
31929
+ React.useEffect(() => {
31930
+ (async () => {
31931
+ try {
31932
+ if (!("serviceWorker" in navigator)) return;
31933
+ const registration = await navigator.serviceWorker.register(
31934
+ "/firebase-messaging-sw.js"
31935
+ );
31936
+ await navigator.serviceWorker.ready;
31937
+ const permission = await Notification.requestPermission();
31938
+ if (permission === "granted" && account.isLogin && !account.fcmToken) {
31939
+ const fcmToken = await getToken(messaging, {
31940
+ vapidKey: void 0,
31941
+ serviceWorkerRegistration: registration
31942
+ });
31943
+ if (fcmToken)
31944
+ await dispatch(
31945
+ ACTION_ACCOUNT.subscribeTopic({ fcmToken })
31946
+ ).unwrap();
31947
+ }
31948
+ } catch (error) {
31949
+ showSnackbar({
31950
+ message: getErrorMessage(error),
31951
+ type: SnackbarType.ERROR
31952
+ });
31953
+ }
31954
+ })();
31955
+ }, [account.isLogin]);
31956
+ React.useEffect(() => {
31957
+ const handler = async (event) => {
31958
+ if (!event.data) return;
31959
+ const { title, message } = event.data;
31960
+ const currentCount = store.getState().account.notificationCount;
31961
+ await dispatch(
31962
+ ACTION_ACCOUNT.changeNotificationCount(currentCount + 1)
31963
+ ).unwrap();
31964
+ showSnackbar({
31965
+ message: `${title}: ${message}`,
31966
+ type: SnackbarType.INFO
31967
+ });
31968
+ };
31969
+ navigator.serviceWorker.addEventListener("message", handler);
31970
+ return () => {
31971
+ navigator.serviceWorker.removeEventListener("message", handler);
31972
+ };
31973
+ }, []);
31974
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(material.ThemeProvider, { theme, children: [
31975
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CssBaseline, {}),
31976
+ /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Routes, { children: renderRoutes(routes, account) })
31977
+ ] });
31978
+ }
33807
31979
  var Country = /* @__PURE__ */ ((Country2) => {
33808
31980
  Country2["VIETNAM"] = "Vietnam";
33809
31981
  Country2["USA"] = "USA";
@@ -33941,12 +32113,10 @@ const useTagSelector = (movementId) => {
33941
32113
  // Export để component cha có thể biết những user nào đã được tag
33942
32114
  };
33943
32115
  };
33944
- exports.ALLOW_USER_TYPES = ALLOW_USER_TYPES;
33945
32116
  exports.ANIMATION_TIME = ANIMATION_TIME;
33946
32117
  exports.AppCategory = AppCategory;
33947
32118
  exports.AppType = AppType;
33948
32119
  exports.BACKGROUND_SYSTEM = BACKGROUND_SYSTEM;
33949
- exports.BOOKING_SCREEN = BOOKING_SCREEN;
33950
32120
  exports.BORDER_COLOR = BORDER_COLOR;
33951
32121
  exports.BORDER_COLOR_CARD = BORDER_COLOR_CARD;
33952
32122
  exports.BORDER_COLOR_LAYOUT = BORDER_COLOR_LAYOUT;
@@ -33957,8 +32127,6 @@ exports.BORDER_RADIUS_ELEMENT_SMALL = BORDER_RADIUS_ELEMENT_SMALL;
33957
32127
  exports.BORDER_RADIUS_ELEMENT_TAG = BORDER_RADIUS_ELEMENT_TAG;
33958
32128
  exports.BORDER_RADIUS_ELEMENT_WRAPPER = BORDER_RADIUS_ELEMENT_WRAPPER;
33959
32129
  exports.Country = Country;
33960
- exports.DASHBOARD_BASE = DASHBOARD_BASE;
33961
- exports.DASHBOARD_SCREEN = DASHBOARD_SCREEN;
33962
32130
  exports.FONT_SIZE_ICON = FONT_SIZE_ICON;
33963
32131
  exports.FONT_SIZE_LOADING = FONT_SIZE_LOADING;
33964
32132
  exports.FileTypeEnum = FileTypeEnum;
@@ -33986,8 +32154,6 @@ exports.PADDING_GAP_ITEM_SMALL = PADDING_GAP_ITEM_SMALL;
33986
32154
  exports.PADDING_GAP_LAYOUT = PADDING_GAP_LAYOUT;
33987
32155
  exports.PADDING_GAP_TAB = PADDING_GAP_TAB;
33988
32156
  exports.PADDING_LAYOUT_HEADER = PADDING_LAYOUT_HEADER;
33989
- exports.PAGE = PAGE;
33990
- exports.PREFIX_WORKFLOW_ENGINE = PREFIX_WORKFLOW_ENGINE;
33991
32157
  exports.PaymentMethod = PaymentMethod;
33992
32158
  exports.RefreshTokenStatus = RefreshTokenStatus;
33993
32159
  exports.RejectionReason = RejectionReason;
@@ -33996,8 +32162,7 @@ exports.RouteType = RouteType;
33996
32162
  exports.SCALE_VALUE = SCALE_VALUE;
33997
32163
  exports.STYLE = STYLE;
33998
32164
  exports.SYSTEM_MODULES = SYSTEM_MODULES;
33999
- exports.SnackbarProvider = SnackbarProvider;
34000
- exports.SnackbarType = SnackbarType;
32165
+ exports.SevagoSSOApp = App;
34001
32166
  exports.SocketNamespace = SocketNamespace;
34002
32167
  exports.SocketSystemEvent = SocketSystemEvent;
34003
32168
  exports.SocketSystemRoom = SocketSystemRoom;
@@ -34039,8 +32204,6 @@ exports.WIDTH_LAYOUT_DESKTOP = WIDTH_LAYOUT_DESKTOP;
34039
32204
  exports.WIDTH_SIDEBAR = WIDTH_SIDEBAR;
34040
32205
  exports.WIDTH_SIDEBAR_EXPAND = WIDTH_SIDEBAR_EXPAND;
34041
32206
  exports.WIDTH_TEXT_FIELD = WIDTH_TEXT_FIELD;
34042
- exports.WORKFLOW_ENGINE_SCREEN = WORKFLOW_ENGINE_SCREEN;
34043
- exports.WORKFLOW_TRACKING_SCREEN = WORKFLOW_TRACKING_SCREEN;
34044
32207
  exports.authApi = authApi;
34045
32208
  exports.axiosRequest = axiosRequest;
34046
32209
  exports.checkNowYear = checkNowYear;
@@ -34084,7 +32247,7 @@ exports.phoneRegExp = phoneRegExp;
34084
32247
  exports.refreshToken = refreshToken$1;
34085
32248
  exports.renderRoutes = renderRoutes;
34086
32249
  exports.resetPassword = resetPassword$1;
34087
- exports.routes = routes;
32250
+ exports.routeConstants = PAGE;
34088
32251
  exports.socketConfig = socketConfig;
34089
32252
  exports.store = store;
34090
32253
  exports.stringToColor = stringToColor;
@@ -34099,14 +32262,11 @@ exports.updateAccount = updateAccount$1;
34099
32262
  exports.updateNotification = updateNotification;
34100
32263
  exports.updateNotificationSetting = updateNotificationSetting;
34101
32264
  exports.updateUser = updateUser;
34102
- exports.useActiveSidebar = useActiveSidebar;
34103
- exports.useAllApps = useAllApps;
34104
32265
  exports.useApps = useApps;
34105
- exports.useIsSystemMonitor = useIsSystemMonitor;
34106
- exports.useSidebarState = useSidebarState;
34107
32266
  exports.useSnackbar = useSnackbar;
34108
32267
  exports.useTagSelector = useTagSelector;
34109
32268
  exports.useUpdateCurrentAccess = useUpdateCurrentAccess;
32269
+ exports.useVersionCheck = useVersionCheck;
34110
32270
  exports.userApi = userApi;
34111
32271
  exports.verifyOtp = verifyOtp;
34112
32272
  //# sourceMappingURL=index.cjs.js.map