codeforlife 2.10.7 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/App-3VkR-ZEZ.js +27 -0
  2. package/dist/App-3VkR-ZEZ.js.map +1 -0
  3. package/dist/App-UfeajXtp.cjs +2 -0
  4. package/dist/App-UfeajXtp.cjs.map +1 -0
  5. package/dist/Countdown-BtUbr1J_.cjs +2 -0
  6. package/dist/{Countdown-CyJ-01oU.cjs.map → Countdown-BtUbr1J_.cjs.map} +1 -1
  7. package/dist/{Countdown-BTyB1rrK.js → Countdown-DhjAmB0u.js} +9 -9
  8. package/dist/{Countdown-BTyB1rrK.js.map → Countdown-DhjAmB0u.js.map} +1 -1
  9. package/dist/{Image-CgYjq-tA.cjs → Image-CgRVUblT.cjs} +2 -2
  10. package/dist/{Image-CgYjq-tA.cjs.map → Image-CgRVUblT.cjs.map} +1 -1
  11. package/dist/{Image-C-f2ChBh.js → Image-DTOu0h-V.js} +2 -2
  12. package/dist/{Image-C-f2ChBh.js.map → Image-DTOu0h-V.js.map} +1 -1
  13. package/dist/{LinkButton-BOPjG7_2.cjs → LinkButton-Kw2brLTK.cjs} +2 -2
  14. package/dist/{LinkButton-BOPjG7_2.cjs.map → LinkButton-Kw2brLTK.cjs.map} +1 -1
  15. package/dist/{LinkButton-Bk50AHHg.js → LinkButton-sQ5jgHnX.js} +3 -3
  16. package/dist/{LinkButton-Bk50AHHg.js.map → LinkButton-sQ5jgHnX.js.map} +1 -1
  17. package/dist/{Navigate-SL_oMjPc.js → Navigate-ClPcw87e.js} +3 -3
  18. package/dist/{Navigate-SL_oMjPc.js.map → Navigate-ClPcw87e.js.map} +1 -1
  19. package/dist/Navigate-CrMwdIBB.cjs +2 -0
  20. package/dist/{Navigate-C_sgy8Xs.cjs.map → Navigate-CrMwdIBB.cjs.map} +1 -1
  21. package/dist/_commonjsHelpers-DKOUU3wS.cjs +2 -0
  22. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +1 -0
  23. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  24. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  25. package/dist/api/endpoints/index.cjs.js +1 -1
  26. package/dist/api/endpoints/index.es.js +2 -2
  27. package/dist/api/index.cjs.js +3 -3
  28. package/dist/api/index.es.js +3 -3
  29. package/dist/api-9cnyvZj7.cjs +2 -0
  30. package/dist/{api-DIgp_6Vr.cjs.map → api-9cnyvZj7.cjs.map} +1 -1
  31. package/dist/{api-BvUiTeR7.js → api-BFYu8ZvQ.js} +2 -2
  32. package/dist/{api-BvUiTeR7.js.map → api-BFYu8ZvQ.js.map} +1 -1
  33. package/dist/{api-CaeeoZaI.cjs → api-CAH3GT1O.cjs} +2 -2
  34. package/dist/{api-CaeeoZaI.cjs.map → api-CAH3GT1O.cjs.map} +1 -1
  35. package/dist/{auth-CQ1InCxP.js → auth-Bb8WkZGN.js} +4 -4
  36. package/dist/{auth-CQ1InCxP.js.map → auth-Bb8WkZGN.js.map} +1 -1
  37. package/dist/auth-BwpsrTko.cjs +2 -0
  38. package/dist/{auth-B7Vdot4N.cjs.map → auth-BwpsrTko.cjs.map} +1 -1
  39. package/dist/client-BK9NlSVR.js +25208 -0
  40. package/dist/client-BK9NlSVR.js.map +1 -0
  41. package/dist/client-CmAMc2Wj.cjs +251 -0
  42. package/dist/client-CmAMc2Wj.cjs.map +1 -0
  43. package/dist/components/form/index.cjs.js +1 -1
  44. package/dist/components/form/index.es.js +1 -1
  45. package/dist/components/index.cjs.js +1 -1
  46. package/dist/components/index.cjs.js.map +1 -1
  47. package/dist/components/index.d.ts +0 -1
  48. package/dist/components/index.es.js +146 -182
  49. package/dist/components/index.es.js.map +1 -1
  50. package/dist/components/page/index.cjs.js +1 -1
  51. package/dist/components/page/index.es.js +1 -1
  52. package/dist/components/router/index.cjs.js +1 -1
  53. package/dist/components/router/index.es.js +2 -2
  54. package/dist/components/table/index.cjs.js +1 -1
  55. package/dist/components/table/index.es.js +1 -1
  56. package/dist/features/index.cjs.js +1 -1
  57. package/dist/features/index.cjs.js.map +1 -1
  58. package/dist/features/index.es.js +10 -11
  59. package/dist/features/index.es.js.map +1 -1
  60. package/dist/general-Bo6JGvKB.cjs +2 -0
  61. package/dist/{general-BPbbmkeX.cjs.map → general-Bo6JGvKB.cjs.map} +1 -1
  62. package/dist/{general-CtTJPCJn.js → general-D7Hqi3gj.js} +3 -3
  63. package/dist/{general-CtTJPCJn.js.map → general-D7Hqi3gj.js.map} +1 -1
  64. package/dist/hooks/index.cjs.js +1 -1
  65. package/dist/hooks/index.es.js +2 -2
  66. package/dist/{index-CBPn0wyX.cjs → index-5C9hpxRF.cjs} +2 -2
  67. package/dist/{index-CBPn0wyX.cjs.map → index-5C9hpxRF.cjs.map} +1 -1
  68. package/dist/{index-Dfo744Sb.js → index-B3e_XaVG.js} +2 -2
  69. package/dist/{index-Dfo744Sb.js.map → index-B3e_XaVG.js.map} +1 -1
  70. package/dist/{index-CXYppxE3.cjs → index-B89FjK7v.cjs} +2 -2
  71. package/dist/{index-CXYppxE3.cjs.map → index-B89FjK7v.cjs.map} +1 -1
  72. package/dist/{index-CI5O_yH6.js → index-BRHFlEjS.js} +37 -39
  73. package/dist/{index-CI5O_yH6.js.map → index-BRHFlEjS.js.map} +1 -1
  74. package/dist/{index-D8Gc0IWi.js → index-CHboZsxD.js} +2 -2
  75. package/dist/{index-D8Gc0IWi.js.map → index-CHboZsxD.js.map} +1 -1
  76. package/dist/index-CwC9mpb3.cjs +2 -0
  77. package/dist/{index-B6aNVvMr.cjs.map → index-CwC9mpb3.cjs.map} +1 -1
  78. package/dist/{index-DCI-3m7f.cjs → index-DuArGzQE.cjs} +3 -3
  79. package/dist/{index-DCI-3m7f.cjs.map → index-DuArGzQE.cjs.map} +1 -1
  80. package/dist/{index-DcmDxIXA.js → index-hdS8RgRc.js} +5 -5
  81. package/dist/{index-DcmDxIXA.js.map → index-hdS8RgRc.js.map} +1 -1
  82. package/dist/index.cjs.js +1 -1
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.es.js +6 -6
  85. package/dist/{jsx-runtime-Dszzpdy0.cjs → jsx-runtime-B2pbW5Fp.cjs} +3 -3
  86. package/dist/{jsx-runtime-Dszzpdy0.cjs.map → jsx-runtime-B2pbW5Fp.cjs.map} +1 -1
  87. package/dist/{jsx-runtime-C7wFtzyj.js → jsx-runtime-lzYHhGH3.js} +15 -15
  88. package/dist/{jsx-runtime-C7wFtzyj.js.map → jsx-runtime-lzYHhGH3.js.map} +1 -1
  89. package/dist/{schemas-D3tO0rys.js → schemas-BMQZbhti.js} +2 -2
  90. package/dist/{schemas-D3tO0rys.js.map → schemas-BMQZbhti.js.map} +1 -1
  91. package/dist/{schemas-CpAWhNsP.cjs → schemas-DXX4rh8i.cjs} +2 -2
  92. package/dist/{schemas-CpAWhNsP.cjs.map → schemas-DXX4rh8i.cjs.map} +1 -1
  93. package/dist/server/App.d.ts +15 -0
  94. package/dist/server/entry.cjs.js +209 -0
  95. package/dist/server/entry.cjs.js.map +1 -0
  96. package/dist/server/entry.d.ts +14 -0
  97. package/dist/server/entry.es.js +21885 -0
  98. package/dist/server/entry.es.js.map +1 -0
  99. package/dist/server/index.cjs.js +6 -0
  100. package/dist/server/index.cjs.js.map +1 -0
  101. package/dist/server/index.d.ts +6 -0
  102. package/dist/{server.es.js → server/index.es.js} +19 -17
  103. package/dist/server/index.es.js.map +1 -0
  104. package/dist/settings/index.cjs.js +1 -1
  105. package/dist/settings/index.cjs.js.map +1 -1
  106. package/dist/settings/index.d.ts +1 -2
  107. package/dist/settings/index.es.js +5 -5
  108. package/dist/settings/index.es.js.map +1 -1
  109. package/dist/theme/components/index.cjs.js +1 -1
  110. package/dist/theme/components/index.es.js +1 -1
  111. package/dist/theme/index.cjs.js +1 -1
  112. package/dist/theme/index.cjs.js.map +1 -1
  113. package/dist/theme/index.d.ts +1 -2
  114. package/dist/theme/index.es.js +5 -5
  115. package/dist/theme/index.es.js.map +1 -1
  116. package/dist/{urls-RtSTEZfW.cjs → urls-CGZI0f1w.cjs} +2 -2
  117. package/dist/{urls-RtSTEZfW.cjs.map → urls-CGZI0f1w.cjs.map} +1 -1
  118. package/dist/{urls-5m9PgoEX.js → urls-DP4a8kxP.js} +2 -2
  119. package/dist/{urls-5m9PgoEX.js.map → urls-DP4a8kxP.js.map} +1 -1
  120. package/dist/utils/api.cjs.js +1 -1
  121. package/dist/utils/api.es.js +2 -2
  122. package/dist/utils/router.cjs.js +1 -1
  123. package/dist/utils/router.es.js +2 -2
  124. package/dist/utils/test.cjs.js +1 -250
  125. package/dist/utils/test.cjs.js.map +1 -1
  126. package/dist/utils/test.es.js +20 -25223
  127. package/dist/utils/test.es.js.map +1 -1
  128. package/dist/utils/theme.cjs.js +1 -1
  129. package/dist/utils/theme.es.js +2 -2
  130. package/package.json +15 -8
  131. package/dist/Countdown-CyJ-01oU.cjs +0 -2
  132. package/dist/Navigate-C_sgy8Xs.cjs +0 -2
  133. package/dist/api-DIgp_6Vr.cjs +0 -2
  134. package/dist/auth-B7Vdot4N.cjs +0 -2
  135. package/dist/components/App.d.ts +0 -18
  136. package/dist/general-BPbbmkeX.cjs +0 -2
  137. package/dist/index-B6aNVvMr.cjs +0 -2
  138. package/dist/server.cjs.js +0 -6
  139. package/dist/server.cjs.js.map +0 -1
  140. package/dist/server.es.js.map +0 -1
  141. /package/dist/{server.d.ts → server/server.d.ts} +0 -0
@@ -0,0 +1,27 @@
1
+ import { j as r } from "./jsx-runtime-lzYHhGH3.js";
2
+ import { ThemeProvider as i, CssBaseline as t } from "@mui/material";
3
+ import { CacheProvider as p } from "@emotion/react";
4
+ import "react";
5
+ import { Provider as x } from "react-redux";
6
+ const h = ({
7
+ children: o,
8
+ emotionCache: e,
9
+ theme: s,
10
+ store: m,
11
+ // @ts-expect-error TODO
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ maxIdleSeconds: a = 3600,
14
+ // @ts-expect-error TODO
15
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
+ maxTotalSeconds: d = 3600
17
+ }) => (
18
+ // https://mui.com/material-ui/guides/server-rendering/
19
+ /* @__PURE__ */ r.jsx(p, { value: e, children: /* @__PURE__ */ r.jsxs(i, { theme: s, children: [
20
+ /* @__PURE__ */ r.jsx(t, {}),
21
+ /* @__PURE__ */ r.jsx(x, { store: m, children: o })
22
+ ] }) })
23
+ );
24
+ export {
25
+ h as A
26
+ };
27
+ //# sourceMappingURL=App-3VkR-ZEZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App-3VkR-ZEZ.js","sources":["../src/server/App.tsx"],"sourcesContent":["import { CssBaseline, ThemeProvider } from \"@mui/material\"\nimport {\n type EmotionCache,\n CacheProvider as EmotionCacheProvider,\n} from \"@emotion/react\"\nimport { type JSX, type ReactNode } from \"react\"\nimport {\n Provider as StoreProvider,\n type ProviderProps as StoreProviderProps,\n} from \"react-redux\"\nimport { type Action } from \"redux\"\nimport { type ThemeProviderProps } from \"@mui/material\"\n\nimport \"./App.css\"\n// import { InactiveDialog, ScreenTimeDialog } from \"../features\"\n// import { useCountdown, useEventListener } from \"../hooks\"\n// import \"../scripts\"\n// import {\n// configureFreshworksWidget,\n// toggleOneTrustInfoDisplay,\n// } from \"../utils/window\"\n\nexport interface AppProps<A extends Action = Action, S = unknown> {\n children: ReactNode\n emotionCache: EmotionCache\n theme: ThemeProviderProps[\"theme\"]\n store: StoreProviderProps<A, S>[\"store\"]\n maxIdleSeconds?: number\n maxTotalSeconds?: number\n}\n\nconst App = <A extends Action = Action, S = unknown>({\n children,\n emotionCache,\n theme,\n store,\n // @ts-expect-error TODO\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n maxIdleSeconds = 60 * 60,\n // @ts-expect-error TODO\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n maxTotalSeconds = 60 * 60,\n}: AppProps<A, S>): JSX.Element => {\n // TODO: cannot use document during SSR\n // const root = document.getElementById(\"root\") as HTMLElement\n\n // const [idleSeconds, setIdleSeconds] = useCountdown(maxIdleSeconds)\n // const [totalSeconds, setTotalSeconds] = useCountdown(maxTotalSeconds)\n // const resetIdleSeconds = useCallback(() => {\n // setIdleSeconds(maxIdleSeconds)\n // }, [setIdleSeconds, maxIdleSeconds])\n\n // const isIdle = idleSeconds === 0\n // const tooMuchScreenTime = totalSeconds === 0\n\n // useEventListener(root, \"mousemove\", resetIdleSeconds)\n // useEventListener(root, \"keypress\", resetIdleSeconds)\n\n // React.useEffect(() => {\n // configureFreshworksWidget(\"hide\")\n // }, [])\n\n // if (import.meta.env.PROD) {\n // toggleOneTrustInfoDisplay()\n // }\n\n return (\n // https://mui.com/material-ui/guides/server-rendering/\n <EmotionCacheProvider value={emotionCache}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n <StoreProvider store={store}>\n {/* <InactiveDialog open={isIdle} onClose={resetIdleSeconds} />\n <ScreenTimeDialog\n open={!isIdle && tooMuchScreenTime}\n onClose={() => {\n setTotalSeconds(maxTotalSeconds)\n }}\n /> */}\n {children}\n </StoreProvider>\n </ThemeProvider>\n </EmotionCacheProvider>\n )\n}\n\nexport default App\n\n// TODO: figure out what to do with this\n// function useOneTrustScripts(): void {\n// const oneTrustEventTypes = [\n// useExternalScript({\n// props: {\n// src: \"https://cdn-ukwest.onetrust.com/consent/5da42396-cb12-4493-8d04-5179033cfbad/OtAutoBlock.js\",\n// type: \"text/javascript\",\n// },\n// eventTypes: [\"load\", \"error\"],\n// }),\n// useExternalScript({\n// props: {\n// src: \"https://cdn-ukwest.onetrust.com/scripttemplates/otSDKStub.js\",\n// type: \"text/javascript\",\n// charset: \"UTF-8\",\n// },\n// attrs: {\n// \"data-domain-script\": \"5da42396-cb12-4493-8d04-5179033cfbad\",\n// },\n// eventTypes: [\"load\", \"error\"],\n// }),\n// useExternalScript({\n// props: {\n// src: \"https://cdn-ukwest.onetrust.com/scripttemplates/202302.1.0/otBannerSdk.js\",\n// async: true,\n// type: \"text/javascript\",\n// },\n// eventTypes: [\"load\", \"error\"],\n// }),\n// ]\n// if (oneTrustEventTypes.some(t => t === \"error\")) {\n// alert(\"OneTrust failed to load!\")\n// }\n// }\n"],"names":["App","children","emotionCache","theme","store","maxIdleSeconds","maxTotalSeconds","EmotionCacheProvider","jsxs","ThemeProvider","jsx","CssBaseline","StoreProvider"],"mappings":";;;;;AA+BA,MAAMA,IAAM,CAAyC;AAAA,EACnD,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA;AAAA;AAAA,EAGA,gBAAAC,IAAiB;AAAA;AAAA;AAAA,EAGjB,iBAAAC,IAAkB;AACpB;AAAA;AAAA,wBA0BKC,GAAA,EAAqB,OAAOL,GAC3B,UAAAM,gBAAAA,EAAAA,KAACC,KAAc,OAAAN,GACb,UAAA;AAAA,IAAAO,gBAAAA,EAAAA,IAACC,GAAA,EAAY;AAAA,IACbD,gBAAAA,EAAAA,IAACE,GAAA,EAAc,OAAAR,GAQZ,UAAAH,EAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAAA;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("./jsx-runtime-B2pbW5Fp.cjs"),r=require("@mui/material"),x=require("@emotion/react");require("react");const o=require("react-redux"),u=({children:s,emotionCache:t,theme:i,store:n,maxIdleSeconds:c=3600,maxTotalSeconds:a=3600})=>e.jsxRuntimeExports.jsx(x.CacheProvider,{value:t,children:e.jsxRuntimeExports.jsxs(r.ThemeProvider,{theme:i,children:[e.jsxRuntimeExports.jsx(r.CssBaseline,{}),e.jsxRuntimeExports.jsx(o.Provider,{store:n,children:s})]})});exports.App=u;
2
+ //# sourceMappingURL=App-UfeajXtp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App-UfeajXtp.cjs","sources":["../src/server/App.tsx"],"sourcesContent":["import { CssBaseline, ThemeProvider } from \"@mui/material\"\nimport {\n type EmotionCache,\n CacheProvider as EmotionCacheProvider,\n} from \"@emotion/react\"\nimport { type JSX, type ReactNode } from \"react\"\nimport {\n Provider as StoreProvider,\n type ProviderProps as StoreProviderProps,\n} from \"react-redux\"\nimport { type Action } from \"redux\"\nimport { type ThemeProviderProps } from \"@mui/material\"\n\nimport \"./App.css\"\n// import { InactiveDialog, ScreenTimeDialog } from \"../features\"\n// import { useCountdown, useEventListener } from \"../hooks\"\n// import \"../scripts\"\n// import {\n// configureFreshworksWidget,\n// toggleOneTrustInfoDisplay,\n// } from \"../utils/window\"\n\nexport interface AppProps<A extends Action = Action, S = unknown> {\n children: ReactNode\n emotionCache: EmotionCache\n theme: ThemeProviderProps[\"theme\"]\n store: StoreProviderProps<A, S>[\"store\"]\n maxIdleSeconds?: number\n maxTotalSeconds?: number\n}\n\nconst App = <A extends Action = Action, S = unknown>({\n children,\n emotionCache,\n theme,\n store,\n // @ts-expect-error TODO\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n maxIdleSeconds = 60 * 60,\n // @ts-expect-error TODO\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n maxTotalSeconds = 60 * 60,\n}: AppProps<A, S>): JSX.Element => {\n // TODO: cannot use document during SSR\n // const root = document.getElementById(\"root\") as HTMLElement\n\n // const [idleSeconds, setIdleSeconds] = useCountdown(maxIdleSeconds)\n // const [totalSeconds, setTotalSeconds] = useCountdown(maxTotalSeconds)\n // const resetIdleSeconds = useCallback(() => {\n // setIdleSeconds(maxIdleSeconds)\n // }, [setIdleSeconds, maxIdleSeconds])\n\n // const isIdle = idleSeconds === 0\n // const tooMuchScreenTime = totalSeconds === 0\n\n // useEventListener(root, \"mousemove\", resetIdleSeconds)\n // useEventListener(root, \"keypress\", resetIdleSeconds)\n\n // React.useEffect(() => {\n // configureFreshworksWidget(\"hide\")\n // }, [])\n\n // if (import.meta.env.PROD) {\n // toggleOneTrustInfoDisplay()\n // }\n\n return (\n // https://mui.com/material-ui/guides/server-rendering/\n <EmotionCacheProvider value={emotionCache}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n <StoreProvider store={store}>\n {/* <InactiveDialog open={isIdle} onClose={resetIdleSeconds} />\n <ScreenTimeDialog\n open={!isIdle && tooMuchScreenTime}\n onClose={() => {\n setTotalSeconds(maxTotalSeconds)\n }}\n /> */}\n {children}\n </StoreProvider>\n </ThemeProvider>\n </EmotionCacheProvider>\n )\n}\n\nexport default App\n\n// TODO: figure out what to do with this\n// function useOneTrustScripts(): void {\n// const oneTrustEventTypes = [\n// useExternalScript({\n// props: {\n// src: \"https://cdn-ukwest.onetrust.com/consent/5da42396-cb12-4493-8d04-5179033cfbad/OtAutoBlock.js\",\n// type: \"text/javascript\",\n// },\n// eventTypes: [\"load\", \"error\"],\n// }),\n// useExternalScript({\n// props: {\n// src: \"https://cdn-ukwest.onetrust.com/scripttemplates/otSDKStub.js\",\n// type: \"text/javascript\",\n// charset: \"UTF-8\",\n// },\n// attrs: {\n// \"data-domain-script\": \"5da42396-cb12-4493-8d04-5179033cfbad\",\n// },\n// eventTypes: [\"load\", \"error\"],\n// }),\n// useExternalScript({\n// props: {\n// src: \"https://cdn-ukwest.onetrust.com/scripttemplates/202302.1.0/otBannerSdk.js\",\n// async: true,\n// type: \"text/javascript\",\n// },\n// eventTypes: [\"load\", \"error\"],\n// }),\n// ]\n// if (oneTrustEventTypes.some(t => t === \"error\")) {\n// alert(\"OneTrust failed to load!\")\n// }\n// }\n"],"names":["App","children","emotionCache","theme","store","maxIdleSeconds","maxTotalSeconds","EmotionCacheProvider","jsxs","ThemeProvider","jsx","CssBaseline","StoreProvider"],"mappings":"kKA+BMA,EAAM,CAAyC,CACnD,SAAAC,EACA,aAAAC,EACA,MAAAC,EACA,MAAAC,EAGA,eAAAC,EAAiB,KAGjB,gBAAAC,EAAkB,IACpB,4BA0BKC,EAAAA,cAAA,CAAqB,MAAOL,EAC3B,SAAAM,EAAAA,kBAAAA,KAACC,EAAAA,eAAc,MAAAN,EACb,SAAA,CAAAO,EAAAA,kBAAAA,IAACC,EAAAA,YAAA,EAAY,EACbD,EAAAA,kBAAAA,IAACE,EAAAA,SAAA,CAAc,MAAAR,EAQZ,SAAAH,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CACF"}
@@ -0,0 +1,2 @@
1
+ "use strict";const u=require("./jsx-runtime-B2pbW5Fp.cjs"),a=require("react"),m=require("@mui/material");require("./auth-BwpsrTko.cjs");const x=require("./general-Bo6JGvKB.cjs");require("react-router");require("yup");require("@mui/icons-material");require("./palette-BnIdHKDE.cjs");const c=({seconds:e,start:n=!0,onEnd:i,...o})=>{e=Math.floor(e);const r=x.useCountdown(e)[0],[s,q]=a.useState(!n);r===0&&!s&&(q(!0),i()),e=Math.floor(r%60);const t=Math.floor(r/60);return u.jsxRuntimeExports.jsx(u.jsxRuntimeExports.Fragment,{children:r>0&&u.jsxRuntimeExports.jsxs(m.Typography,{...o,children:[t>0&&`${t} ${t>1?"mins":"min"} `,e>0&&`${e} ${e>1?"secs":"sec"}`]})})};exports.Countdown=c;
2
+ //# sourceMappingURL=Countdown-BtUbr1J_.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Countdown-CyJ-01oU.cjs","sources":["../src/components/Countdown.tsx"],"sourcesContent":["import { type FC, useState } from \"react\"\nimport { Typography, type TypographyProps } from \"@mui/material\"\n\nimport { useCountdown } from \"../hooks\"\n\nexport interface CountdownProps extends Omit<TypographyProps, \"children\"> {\n seconds: number\n start?: boolean\n onEnd: () => void\n}\n\nconst Countdown: FC<CountdownProps> = ({\n seconds,\n start = true,\n onEnd,\n ...typographyProps\n}) => {\n seconds = Math.floor(seconds)\n const _seconds = useCountdown(seconds)[0]\n const [end, setEnd] = useState(!start)\n\n if (_seconds === 0 && !end) {\n setEnd(true)\n onEnd()\n }\n\n seconds = Math.floor(_seconds % 60)\n const minutes = Math.floor(_seconds / 60)\n\n return (\n <>\n {_seconds > 0 && (\n <Typography {...typographyProps}>\n {minutes > 0 && `${minutes} ${minutes > 1 ? \"mins\" : \"min\"} `}\n {seconds > 0 && `${seconds} ${seconds > 1 ? \"secs\" : \"sec\"}`}\n </Typography>\n )}\n </>\n )\n}\n\nexport default Countdown\n"],"names":["Countdown","seconds","start","onEnd","typographyProps","_seconds","useCountdown","end","setEnd","useState","minutes","jsxs","Typography"],"mappings":"0RAWA,MAAMA,EAAgC,CAAC,CACrC,QAAAC,EACA,MAAAC,EAAQ,GACR,MAAAC,EACA,GAAGC,CACL,IAAM,CACJH,EAAU,KAAK,MAAMA,CAAO,EAC5B,MAAMI,EAAWC,EAAAA,aAAaL,CAAO,EAAE,CAAC,EAClC,CAACM,EAAKC,CAAM,EAAIC,EAAAA,SAAS,CAACP,CAAK,EAEjCG,IAAa,GAAK,CAACE,IACrBC,EAAO,EAAI,EACXL,EAAA,GAGFF,EAAU,KAAK,MAAMI,EAAW,EAAE,EAClC,MAAMK,EAAU,KAAK,MAAML,EAAW,EAAE,EAExC,6DAEK,SAAAA,EAAW,GACVM,EAAAA,kBAAAA,KAACC,EAAAA,WAAA,CAAY,GAAGR,EACb,SAAA,CAAAM,EAAU,GAAK,GAAGA,CAAO,IAAIA,EAAU,EAAI,OAAS,KAAK,IACzDT,EAAU,GAAK,GAAGA,CAAO,IAAIA,EAAU,EAAI,OAAS,KAAK,EAAA,CAAA,CAC5D,CAAA,CAEJ,CAEJ"}
1
+ {"version":3,"file":"Countdown-BtUbr1J_.cjs","sources":["../src/components/Countdown.tsx"],"sourcesContent":["import { type FC, useState } from \"react\"\nimport { Typography, type TypographyProps } from \"@mui/material\"\n\nimport { useCountdown } from \"../hooks\"\n\nexport interface CountdownProps extends Omit<TypographyProps, \"children\"> {\n seconds: number\n start?: boolean\n onEnd: () => void\n}\n\nconst Countdown: FC<CountdownProps> = ({\n seconds,\n start = true,\n onEnd,\n ...typographyProps\n}) => {\n seconds = Math.floor(seconds)\n const _seconds = useCountdown(seconds)[0]\n const [end, setEnd] = useState(!start)\n\n if (_seconds === 0 && !end) {\n setEnd(true)\n onEnd()\n }\n\n seconds = Math.floor(_seconds % 60)\n const minutes = Math.floor(_seconds / 60)\n\n return (\n <>\n {_seconds > 0 && (\n <Typography {...typographyProps}>\n {minutes > 0 && `${minutes} ${minutes > 1 ? \"mins\" : \"min\"} `}\n {seconds > 0 && `${seconds} ${seconds > 1 ? \"secs\" : \"sec\"}`}\n </Typography>\n )}\n </>\n )\n}\n\nexport default Countdown\n"],"names":["Countdown","seconds","start","onEnd","typographyProps","_seconds","useCountdown","end","setEnd","useState","minutes","jsxs","Typography"],"mappings":"0RAWA,MAAMA,EAAgC,CAAC,CACrC,QAAAC,EACA,MAAAC,EAAQ,GACR,MAAAC,EACA,GAAGC,CACL,IAAM,CACJH,EAAU,KAAK,MAAMA,CAAO,EAC5B,MAAMI,EAAWC,EAAAA,aAAaL,CAAO,EAAE,CAAC,EAClC,CAACM,EAAKC,CAAM,EAAIC,EAAAA,SAAS,CAACP,CAAK,EAEjCG,IAAa,GAAK,CAACE,IACrBC,EAAO,EAAI,EACXL,EAAA,GAGFF,EAAU,KAAK,MAAMI,EAAW,EAAE,EAClC,MAAMK,EAAU,KAAK,MAAML,EAAW,EAAE,EAExC,6DAEK,SAAAA,EAAW,GACVM,EAAAA,kBAAAA,KAACC,EAAAA,WAAA,CAAY,GAAGR,EACb,SAAA,CAAAM,EAAU,GAAK,GAAGA,CAAO,IAAIA,EAAU,EAAI,OAAS,KAAK,IACzDT,EAAU,GAAK,GAAGA,CAAO,IAAIA,EAAU,EAAI,OAAS,KAAK,EAAA,CAAA,CAC5D,CAAA,CAEJ,CAEJ"}
@@ -1,8 +1,8 @@
1
- import { j as m } from "./jsx-runtime-C7wFtzyj.js";
2
- import { useState as s } from "react";
3
- import { Typography as u } from "@mui/material";
4
- import "./auth-CQ1InCxP.js";
5
- import { a as f } from "./general-CtTJPCJn.js";
1
+ import { j as m } from "./jsx-runtime-lzYHhGH3.js";
2
+ import { useState as u } from "react";
3
+ import { Typography as a } from "@mui/material";
4
+ import "./auth-Bb8WkZGN.js";
5
+ import { u as f } from "./general-D7Hqi3gj.js";
6
6
  import "react-router";
7
7
  import "yup";
8
8
  import "@mui/icons-material";
@@ -14,10 +14,10 @@ const w = ({
14
14
  ...p
15
15
  }) => {
16
16
  t = Math.floor(t);
17
- const r = f(t)[0], [e, a] = s(!i);
18
- r === 0 && !e && (a(!0), n()), t = Math.floor(r % 60);
17
+ const r = f(t)[0], [e, s] = u(!i);
18
+ r === 0 && !e && (s(!0), n()), t = Math.floor(r % 60);
19
19
  const o = Math.floor(r / 60);
20
- return /* @__PURE__ */ m.jsx(m.Fragment, { children: r > 0 && /* @__PURE__ */ m.jsxs(u, { ...p, children: [
20
+ return /* @__PURE__ */ m.jsx(m.Fragment, { children: r > 0 && /* @__PURE__ */ m.jsxs(a, { ...p, children: [
21
21
  o > 0 && `${o} ${o > 1 ? "mins" : "min"} `,
22
22
  t > 0 && `${t} ${t > 1 ? "secs" : "sec"}`
23
23
  ] }) });
@@ -25,4 +25,4 @@ const w = ({
25
25
  export {
26
26
  w as C
27
27
  };
28
- //# sourceMappingURL=Countdown-BTyB1rrK.js.map
28
+ //# sourceMappingURL=Countdown-DhjAmB0u.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Countdown-BTyB1rrK.js","sources":["../src/components/Countdown.tsx"],"sourcesContent":["import { type FC, useState } from \"react\"\nimport { Typography, type TypographyProps } from \"@mui/material\"\n\nimport { useCountdown } from \"../hooks\"\n\nexport interface CountdownProps extends Omit<TypographyProps, \"children\"> {\n seconds: number\n start?: boolean\n onEnd: () => void\n}\n\nconst Countdown: FC<CountdownProps> = ({\n seconds,\n start = true,\n onEnd,\n ...typographyProps\n}) => {\n seconds = Math.floor(seconds)\n const _seconds = useCountdown(seconds)[0]\n const [end, setEnd] = useState(!start)\n\n if (_seconds === 0 && !end) {\n setEnd(true)\n onEnd()\n }\n\n seconds = Math.floor(_seconds % 60)\n const minutes = Math.floor(_seconds / 60)\n\n return (\n <>\n {_seconds > 0 && (\n <Typography {...typographyProps}>\n {minutes > 0 && `${minutes} ${minutes > 1 ? \"mins\" : \"min\"} `}\n {seconds > 0 && `${seconds} ${seconds > 1 ? \"secs\" : \"sec\"}`}\n </Typography>\n )}\n </>\n )\n}\n\nexport default Countdown\n"],"names":["Countdown","seconds","start","onEnd","typographyProps","_seconds","useCountdown","end","setEnd","useState","minutes","jsxs","Typography"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAgC,CAAC;AAAA,EACrC,SAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,EAAAH,IAAU,KAAK,MAAMA,CAAO;AAC5B,QAAMI,IAAWC,EAAaL,CAAO,EAAE,CAAC,GAClC,CAACM,GAAKC,CAAM,IAAIC,EAAS,CAACP,CAAK;AAErC,EAAIG,MAAa,KAAK,CAACE,MACrBC,EAAO,EAAI,GACXL,EAAA,IAGFF,IAAU,KAAK,MAAMI,IAAW,EAAE;AAClC,QAAMK,IAAU,KAAK,MAAML,IAAW,EAAE;AAExC,6CAEK,UAAAA,IAAW,KACVM,gBAAAA,EAAAA,KAACC,GAAA,EAAY,GAAGR,GACb,UAAA;AAAA,IAAAM,IAAU,KAAK,GAAGA,CAAO,IAAIA,IAAU,IAAI,SAAS,KAAK;AAAA,IACzDT,IAAU,KAAK,GAAGA,CAAO,IAAIA,IAAU,IAAI,SAAS,KAAK;AAAA,EAAA,EAAA,CAC5D,EAAA,CAEJ;AAEJ;"}
1
+ {"version":3,"file":"Countdown-DhjAmB0u.js","sources":["../src/components/Countdown.tsx"],"sourcesContent":["import { type FC, useState } from \"react\"\nimport { Typography, type TypographyProps } from \"@mui/material\"\n\nimport { useCountdown } from \"../hooks\"\n\nexport interface CountdownProps extends Omit<TypographyProps, \"children\"> {\n seconds: number\n start?: boolean\n onEnd: () => void\n}\n\nconst Countdown: FC<CountdownProps> = ({\n seconds,\n start = true,\n onEnd,\n ...typographyProps\n}) => {\n seconds = Math.floor(seconds)\n const _seconds = useCountdown(seconds)[0]\n const [end, setEnd] = useState(!start)\n\n if (_seconds === 0 && !end) {\n setEnd(true)\n onEnd()\n }\n\n seconds = Math.floor(_seconds % 60)\n const minutes = Math.floor(_seconds / 60)\n\n return (\n <>\n {_seconds > 0 && (\n <Typography {...typographyProps}>\n {minutes > 0 && `${minutes} ${minutes > 1 ? \"mins\" : \"min\"} `}\n {seconds > 0 && `${seconds} ${seconds > 1 ? \"secs\" : \"sec\"}`}\n </Typography>\n )}\n </>\n )\n}\n\nexport default Countdown\n"],"names":["Countdown","seconds","start","onEnd","typographyProps","_seconds","useCountdown","end","setEnd","useState","minutes","jsxs","Typography"],"mappings":";;;;;;;;;AAWA,MAAMA,IAAgC,CAAC;AAAA,EACrC,SAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,EAAAH,IAAU,KAAK,MAAMA,CAAO;AAC5B,QAAMI,IAAWC,EAAaL,CAAO,EAAE,CAAC,GAClC,CAACM,GAAKC,CAAM,IAAIC,EAAS,CAACP,CAAK;AAErC,EAAIG,MAAa,KAAK,CAACE,MACrBC,EAAO,EAAI,GACXL,EAAA,IAGFF,IAAU,KAAK,MAAMI,IAAW,EAAE;AAClC,QAAMK,IAAU,KAAK,MAAML,IAAW,EAAE;AAExC,6CAEK,UAAAA,IAAW,KACVM,gBAAAA,EAAAA,KAACC,GAAA,EAAY,GAAGR,GACb,UAAA;AAAA,IAAAM,IAAU,KAAK,GAAGA,CAAO,IAAIA,IAAU,IAAI,SAAS,KAAK;AAAA,IACzDT,IAAU,KAAK,GAAGA,CAAO,IAAIA,IAAU,IAAI,SAAS,KAAK;AAAA,EAAA,EAAA,CAC5D,EAAA,CAEJ;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const s=require("./jsx-runtime-Dszzpdy0.cjs"),c=require("@mui/material");require("react");const l=require("./utils/general.cjs.js"),u=({href:i,hrefInNewTab:o=!1,...r})=>{let{onClick:t,style:e={},...n}=r;return e.width===void 0&&(e.width="100%"),i!==void 0&&(e={...e,cursor:"pointer"},o?t=()=>{l.openInNewTab(i)}:t=()=>{window.location.replace(i)}),s.jsxRuntimeExports.jsx(c.Box,{component:"img",onClick:t,style:e,...n})};exports.Image=u;
2
- //# sourceMappingURL=Image-CgYjq-tA.cjs.map
1
+ "use strict";const s=require("./jsx-runtime-B2pbW5Fp.cjs"),c=require("@mui/material");require("react");const l=require("./utils/general.cjs.js"),u=({href:i,hrefInNewTab:o=!1,...r})=>{let{onClick:t,style:e={},...n}=r;return e.width===void 0&&(e.width="100%"),i!==void 0&&(e={...e,cursor:"pointer"},o?t=()=>{l.openInNewTab(i)}:t=()=>{window.location.replace(i)}),s.jsxRuntimeExports.jsx(c.Box,{component:"img",onClick:t,style:e,...n})};exports.Image=u;
2
+ //# sourceMappingURL=Image-CgRVUblT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image-CgYjq-tA.cjs","sources":["../src/components/Image.tsx"],"sourcesContent":["import { Box, type BoxProps } from \"@mui/material\"\nimport { type FC } from \"react\"\n\nimport { openInNewTab } from \"../utils/general\"\n\nexport interface ImageProps extends Omit<BoxProps, \"component\"> {\n alt: string\n src: string\n href?: string\n hrefInNewTab?: boolean\n}\n\nconst Image: FC<ImageProps> = ({ href, hrefInNewTab = false, ...props }) => {\n let {\n onClick,\n style = {},\n ...otherProps // eslint-disable-line prefer-const\n } = props\n\n if (style.width === undefined) {\n style.width = \"100%\"\n }\n\n // Override onClick if href provided.\n if (href !== undefined) {\n style = { ...style, cursor: \"pointer\" }\n if (hrefInNewTab) {\n onClick = () => {\n openInNewTab(href)\n }\n } else {\n onClick = () => {\n window.location.replace(href)\n }\n }\n }\n\n return <Box component=\"img\" onClick={onClick} style={style} {...otherProps} />\n}\n\nexport default Image\n"],"names":["Image","href","hrefInNewTab","props","onClick","style","otherProps","openInNewTab","Box"],"mappings":"iJAYMA,EAAwB,CAAC,CAAE,KAAAC,EAAM,aAAAC,EAAe,GAAO,GAAGC,KAAY,CAC1E,GAAI,CACF,QAAAC,EACA,MAAAC,EAAQ,CAAA,EACR,GAAGC,CAAA,EACDH,EAEJ,OAAIE,EAAM,QAAU,SAClBA,EAAM,MAAQ,QAIZJ,IAAS,SACXI,EAAQ,CAAE,GAAGA,EAAO,OAAQ,SAAA,EACxBH,EACFE,EAAU,IAAM,CACdG,EAAAA,aAAaN,CAAI,CACnB,EAEAG,EAAU,IAAM,CACd,OAAO,SAAS,QAAQH,CAAI,CAC9B,2BAIIO,EAAAA,IAAA,CAAI,UAAU,MAAM,QAAAJ,EAAkB,MAAAC,EAAe,GAAGC,EAAY,CAC9E"}
1
+ {"version":3,"file":"Image-CgRVUblT.cjs","sources":["../src/components/Image.tsx"],"sourcesContent":["import { Box, type BoxProps } from \"@mui/material\"\nimport { type FC } from \"react\"\n\nimport { openInNewTab } from \"../utils/general\"\n\nexport interface ImageProps extends Omit<BoxProps, \"component\"> {\n alt: string\n src: string\n href?: string\n hrefInNewTab?: boolean\n}\n\nconst Image: FC<ImageProps> = ({ href, hrefInNewTab = false, ...props }) => {\n let {\n onClick,\n style = {},\n ...otherProps // eslint-disable-line prefer-const\n } = props\n\n if (style.width === undefined) {\n style.width = \"100%\"\n }\n\n // Override onClick if href provided.\n if (href !== undefined) {\n style = { ...style, cursor: \"pointer\" }\n if (hrefInNewTab) {\n onClick = () => {\n openInNewTab(href)\n }\n } else {\n onClick = () => {\n window.location.replace(href)\n }\n }\n }\n\n return <Box component=\"img\" onClick={onClick} style={style} {...otherProps} />\n}\n\nexport default Image\n"],"names":["Image","href","hrefInNewTab","props","onClick","style","otherProps","openInNewTab","Box"],"mappings":"iJAYMA,EAAwB,CAAC,CAAE,KAAAC,EAAM,aAAAC,EAAe,GAAO,GAAGC,KAAY,CAC1E,GAAI,CACF,QAAAC,EACA,MAAAC,EAAQ,CAAA,EACR,GAAGC,CAAA,EACDH,EAEJ,OAAIE,EAAM,QAAU,SAClBA,EAAM,MAAQ,QAIZJ,IAAS,SACXI,EAAQ,CAAE,GAAGA,EAAO,OAAQ,SAAA,EACxBH,EACFE,EAAU,IAAM,CACdG,EAAAA,aAAaN,CAAI,CACnB,EAEAG,EAAU,IAAM,CACd,OAAO,SAAS,QAAQH,CAAI,CAC9B,2BAIIO,EAAAA,IAAA,CAAI,UAAU,MAAM,QAAAJ,EAAkB,MAAAC,EAAe,GAAGC,EAAY,CAC9E"}
@@ -1,4 +1,4 @@
1
- import { j as n } from "./jsx-runtime-C7wFtzyj.js";
1
+ import { j as n } from "./jsx-runtime-lzYHhGH3.js";
2
2
  import { Box as p } from "@mui/material";
3
3
  import "react";
4
4
  import { openInNewTab as s } from "./utils/general.es.js";
@@ -18,4 +18,4 @@ const f = ({ href: i, hrefInNewTab: r = !1, ...e }) => {
18
18
  export {
19
19
  f as I
20
20
  };
21
- //# sourceMappingURL=Image-C-f2ChBh.js.map
21
+ //# sourceMappingURL=Image-DTOu0h-V.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image-C-f2ChBh.js","sources":["../src/components/Image.tsx"],"sourcesContent":["import { Box, type BoxProps } from \"@mui/material\"\nimport { type FC } from \"react\"\n\nimport { openInNewTab } from \"../utils/general\"\n\nexport interface ImageProps extends Omit<BoxProps, \"component\"> {\n alt: string\n src: string\n href?: string\n hrefInNewTab?: boolean\n}\n\nconst Image: FC<ImageProps> = ({ href, hrefInNewTab = false, ...props }) => {\n let {\n onClick,\n style = {},\n ...otherProps // eslint-disable-line prefer-const\n } = props\n\n if (style.width === undefined) {\n style.width = \"100%\"\n }\n\n // Override onClick if href provided.\n if (href !== undefined) {\n style = { ...style, cursor: \"pointer\" }\n if (hrefInNewTab) {\n onClick = () => {\n openInNewTab(href)\n }\n } else {\n onClick = () => {\n window.location.replace(href)\n }\n }\n }\n\n return <Box component=\"img\" onClick={onClick} style={style} {...otherProps} />\n}\n\nexport default Image\n"],"names":["Image","href","hrefInNewTab","props","onClick","style","otherProps","openInNewTab","Box"],"mappings":";;;;AAYA,MAAMA,IAAwB,CAAC,EAAE,MAAAC,GAAM,cAAAC,IAAe,IAAO,GAAGC,QAAY;AAC1E,MAAI;AAAA,IACF,SAAAC;AAAA,IACA,OAAAC,IAAQ,CAAA;AAAA,IACR,GAAGC;AAAA;AAAA,EAAA,IACDH;AAEJ,SAAIE,EAAM,UAAU,WAClBA,EAAM,QAAQ,SAIZJ,MAAS,WACXI,IAAQ,EAAE,GAAGA,GAAO,QAAQ,UAAA,GACxBH,IACFE,IAAU,MAAM;AACd,IAAAG,EAAaN,CAAI;AAAA,EACnB,IAEAG,IAAU,MAAM;AACd,WAAO,SAAS,QAAQH,CAAI;AAAA,EAC9B,0BAIIO,GAAA,EAAI,WAAU,OAAM,SAAAJ,GAAkB,OAAAC,GAAe,GAAGC,GAAY;AAC9E;"}
1
+ {"version":3,"file":"Image-DTOu0h-V.js","sources":["../src/components/Image.tsx"],"sourcesContent":["import { Box, type BoxProps } from \"@mui/material\"\nimport { type FC } from \"react\"\n\nimport { openInNewTab } from \"../utils/general\"\n\nexport interface ImageProps extends Omit<BoxProps, \"component\"> {\n alt: string\n src: string\n href?: string\n hrefInNewTab?: boolean\n}\n\nconst Image: FC<ImageProps> = ({ href, hrefInNewTab = false, ...props }) => {\n let {\n onClick,\n style = {},\n ...otherProps // eslint-disable-line prefer-const\n } = props\n\n if (style.width === undefined) {\n style.width = \"100%\"\n }\n\n // Override onClick if href provided.\n if (href !== undefined) {\n style = { ...style, cursor: \"pointer\" }\n if (hrefInNewTab) {\n onClick = () => {\n openInNewTab(href)\n }\n } else {\n onClick = () => {\n window.location.replace(href)\n }\n }\n }\n\n return <Box component=\"img\" onClick={onClick} style={style} {...otherProps} />\n}\n\nexport default Image\n"],"names":["Image","href","hrefInNewTab","props","onClick","style","otherProps","openInNewTab","Box"],"mappings":";;;;AAYA,MAAMA,IAAwB,CAAC,EAAE,MAAAC,GAAM,cAAAC,IAAe,IAAO,GAAGC,QAAY;AAC1E,MAAI;AAAA,IACF,SAAAC;AAAA,IACA,OAAAC,IAAQ,CAAA;AAAA,IACR,GAAGC;AAAA;AAAA,EAAA,IACDH;AAEJ,SAAIE,EAAM,UAAU,WAClBA,EAAM,QAAQ,SAIZJ,MAAS,WACXI,IAAQ,EAAE,GAAGA,GAAO,QAAQ,UAAA,GACxBH,IACFE,IAAU,MAAM;AACd,IAAAG,EAAaN,CAAI;AAAA,EACnB,IAEAG,IAAU,MAAM;AACd,WAAO,SAAS,QAAQH,CAAI;AAAA,EAC9B,0BAIIO,GAAA,EAAI,WAAU,OAAM,SAAAJ,GAAkB,OAAAC,GAAe,GAAGC,GAAY;AAC9E;"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("./jsx-runtime-Dszzpdy0.cjs"),t=require("@mui/material");require("react");const n=require("react-router");require("@mui/icons-material");require("./palette-BnIdHKDE.cjs");require("./auth-B7Vdot4N.cjs");const u=e=>r.jsxRuntimeExports.jsx(t.Button,{...e,component:n.Link});exports.LinkButton=u;
2
- //# sourceMappingURL=LinkButton-BOPjG7_2.cjs.map
1
+ "use strict";const r=require("./jsx-runtime-B2pbW5Fp.cjs"),t=require("@mui/material");require("react");const n=require("react-router");require("@mui/icons-material");require("./palette-BnIdHKDE.cjs");require("./auth-BwpsrTko.cjs");const u=e=>r.jsxRuntimeExports.jsx(t.Button,{...e,component:n.Link});exports.LinkButton=u;
2
+ //# sourceMappingURL=LinkButton-Kw2brLTK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkButton-BOPjG7_2.cjs","sources":["../src/components/router/LinkButton.tsx"],"sourcesContent":["import { Button, type ButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkButton: {\n (props: LinkButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkButtonProps<\"delta\"> | LinkButtonProps<\"to\">) => {\n return <Button {...{ ...props, component: Link }} />\n}\n\nexport default LinkButton\n"],"names":["LinkButton","props","jsx","Button","Link"],"mappings":"uOAYA,MAAMA,EAKDC,GACIC,EAAAA,kBAAAA,IAACC,EAAAA,QAAa,GAAGF,EAAO,UAAWG,EAAAA,KAAQ"}
1
+ {"version":3,"file":"LinkButton-Kw2brLTK.cjs","sources":["../src/components/router/LinkButton.tsx"],"sourcesContent":["import { Button, type ButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkButton: {\n (props: LinkButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkButtonProps<\"delta\"> | LinkButtonProps<\"to\">) => {\n return <Button {...{ ...props, component: Link }} />\n}\n\nexport default LinkButton\n"],"names":["LinkButton","props","jsx","Button","Link"],"mappings":"uOAYA,MAAMA,EAKDC,GACIC,EAAAA,kBAAAA,IAACC,EAAAA,QAAa,GAAGF,EAAO,UAAWG,EAAAA,KAAQ"}
@@ -1,12 +1,12 @@
1
- import { j as t } from "./jsx-runtime-C7wFtzyj.js";
1
+ import { j as t } from "./jsx-runtime-lzYHhGH3.js";
2
2
  import { Button as r } from "@mui/material";
3
3
  import "react";
4
4
  import { Link as m } from "react-router";
5
5
  import "@mui/icons-material";
6
6
  import "./palette-CYwuLBW7.js";
7
- import "./auth-CQ1InCxP.js";
7
+ import "./auth-Bb8WkZGN.js";
8
8
  const f = (o) => /* @__PURE__ */ t.jsx(r, { ...o, component: m });
9
9
  export {
10
10
  f as L
11
11
  };
12
- //# sourceMappingURL=LinkButton-Bk50AHHg.js.map
12
+ //# sourceMappingURL=LinkButton-sQ5jgHnX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkButton-Bk50AHHg.js","sources":["../src/components/router/LinkButton.tsx"],"sourcesContent":["import { Button, type ButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkButton: {\n (props: LinkButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkButtonProps<\"delta\"> | LinkButtonProps<\"to\">) => {\n return <Button {...{ ...props, component: Link }} />\n}\n\nexport default LinkButton\n"],"names":["LinkButton","props","jsx","Button","Link"],"mappings":";;;;;;;AAYA,MAAMA,IAKF,CAACC,MACIC,gBAAAA,EAAAA,IAACC,KAAa,GAAGF,GAAO,WAAWG,GAAQ;"}
1
+ {"version":3,"file":"LinkButton-sQ5jgHnX.js","sources":["../src/components/router/LinkButton.tsx"],"sourcesContent":["import { Button, type ButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkButton: {\n (props: LinkButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkButtonProps<\"delta\"> | LinkButtonProps<\"to\">) => {\n return <Button {...{ ...props, component: Link }} />\n}\n\nexport default LinkButton\n"],"names":["LinkButton","props","jsx","Button","Link"],"mappings":";;;;;;;AAYA,MAAMA,IAKF,CAACC,MACIC,gBAAAA,EAAAA,IAACC,KAAa,GAAGF,GAAO,WAAWG,GAAQ;"}
@@ -1,10 +1,10 @@
1
- import { j as n } from "./jsx-runtime-C7wFtzyj.js";
1
+ import { j as n } from "./jsx-runtime-lzYHhGH3.js";
2
2
  import { Link as i, IconButton as m, ListItem as a, Tab as c } from "@mui/material";
3
3
  import { useEffect as p } from "react";
4
4
  import { Link as o } from "react-router";
5
5
  import "@mui/icons-material";
6
6
  import "./palette-CYwuLBW7.js";
7
- import { e as u } from "./auth-CQ1InCxP.js";
7
+ import { e as u } from "./auth-Bb8WkZGN.js";
8
8
  const I = (t) => /* @__PURE__ */ n.jsx(i, { component: o, ...t }), v = (t) => /* @__PURE__ */ n.jsx(m, { ...t, component: o }), N = (t) => /* @__PURE__ */ n.jsx(a, { ...t, component: o }), B = (t) => /* @__PURE__ */ n.jsx(c, { ...t, component: o }), E = ({
9
9
  delta: t,
10
10
  to: s,
@@ -22,4 +22,4 @@ export {
22
22
  N as b,
23
23
  B as c
24
24
  };
25
- //# sourceMappingURL=Navigate-SL_oMjPc.js.map
25
+ //# sourceMappingURL=Navigate-ClPcw87e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Navigate-SL_oMjPc.js","sources":["../src/components/router/Link.tsx","../src/components/router/LinkIconButton.tsx","../src/components/router/LinkListItem.tsx","../src/components/router/LinkTab.tsx","../src/components/router/Navigate.tsx"],"sourcesContent":["import { Link as MuiLink, type LinkProps as MuiLinkProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link as RouterLink } from \"react-router\"\n\nimport { type LinkProps as RouterLinkProps } from \"../../utils/router\"\n\nexport type LinkProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<MuiLinkProps, \"component\"> & RouterLinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#link\nconst Link: {\n (props: LinkProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkProps<\"delta\"> | LinkProps<\"to\">) => {\n // @ts-expect-error props are assignable\n return <MuiLink component={RouterLink} {...props} />\n}\n\nexport default Link\n","import { IconButton, type IconButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkIconButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<IconButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkIconButton: {\n (props: LinkIconButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkIconButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkIconButtonProps<\"delta\"> | LinkIconButtonProps<\"to\">) => {\n return <IconButton {...{ ...props, component: Link }} />\n}\n\nexport default LinkIconButton\n","import { ListItem, type ListItemProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkListItemProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ListItemProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#list\nconst LinkListItem: {\n (props: LinkListItemProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkListItemProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkListItemProps<\"delta\"> | LinkListItemProps<\"to\">) => {\n return <ListItem {...{ ...props, component: Link }} />\n}\n\nexport default LinkListItem\n","import { Tab, type TabProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkTabProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<TabProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#tabs\nconst LinkTab: {\n (props: LinkTabProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkTabProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkTabProps<\"delta\"> | LinkTabProps<\"to\">) => {\n return <Tab {...{ ...props, component: Link }} />\n}\n\nexport default LinkTab\n","import { type JSX, useEffect } from \"react\"\nimport { type To } from \"react-router\"\n\nimport { type NavigateOptions, useNavigate } from \"../../hooks\"\n\nexport type NavigateProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Override extends \"delta\"\n ? { delta: number; to?: undefined }\n : { delta?: undefined; to: To } & NavigateOptions<State>\n\nconst Navigate: {\n (props: NavigateProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: NavigateProps<\"to\", State>,\n ): JSX.Element\n} = ({\n delta,\n to,\n ...options\n}: NavigateProps<\"delta\"> | NavigateProps<\"to\">) => {\n const navigate = useNavigate()\n\n useEffect(() => {\n if (typeof delta === \"number\") navigate(delta)\n else navigate(to, options)\n }, [navigate, delta, to, options])\n\n return <></>\n}\n\nexport default Navigate\n"],"names":["Link","props","jsx","MuiLink","RouterLink","LinkIconButton","IconButton","LinkListItem","ListItem","LinkTab","Tab","Navigate","delta","to","options","navigate","useNavigate","useEffect","Fragment"],"mappings":";;;;;;;AAYA,MAAMA,IAKF,CAACC,MAEIC,gBAAAA,EAAAA,IAACC,GAAA,EAAQ,WAAWC,GAAa,GAAGH,GAAO,GCP9CI,IAKF,CAACJ,MACIC,gBAAAA,EAAAA,IAACI,KAAiB,GAAGL,GAAO,WAAWD,GAAQ,GCNlDO,IAKF,CAACN,MACIC,gBAAAA,EAAAA,IAACM,KAAe,GAAGP,GAAO,WAAWD,GAAQ,GCNhDS,IAKF,CAACR,MACIC,gBAAAA,EAAAA,IAACQ,KAAU,GAAGT,GAAO,WAAWD,GAAQ,GCN3CW,IAKF,CAAC;AAAA,EACH,OAAAC;AAAA,EACA,IAAAC;AAAA,EACA,GAAGC;AACL,MAAoD;AAClD,QAAMC,IAAWC,EAAA;AAEjB,SAAAC,EAAU,MAAM;AACd,IAAI,OAAOL,KAAU,WAAUG,EAASH,CAAK,IACxCG,EAASF,GAAIC,CAAO;AAAA,EAC3B,GAAG,CAACC,GAAUH,GAAOC,GAAIC,CAAO,CAAC,GAE1BZ,gBAAAA,EAAAA,IAAAgB,EAAAA,UAAA,EAAE;AACX;"}
1
+ {"version":3,"file":"Navigate-ClPcw87e.js","sources":["../src/components/router/Link.tsx","../src/components/router/LinkIconButton.tsx","../src/components/router/LinkListItem.tsx","../src/components/router/LinkTab.tsx","../src/components/router/Navigate.tsx"],"sourcesContent":["import { Link as MuiLink, type LinkProps as MuiLinkProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link as RouterLink } from \"react-router\"\n\nimport { type LinkProps as RouterLinkProps } from \"../../utils/router\"\n\nexport type LinkProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<MuiLinkProps, \"component\"> & RouterLinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#link\nconst Link: {\n (props: LinkProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkProps<\"delta\"> | LinkProps<\"to\">) => {\n // @ts-expect-error props are assignable\n return <MuiLink component={RouterLink} {...props} />\n}\n\nexport default Link\n","import { IconButton, type IconButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkIconButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<IconButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkIconButton: {\n (props: LinkIconButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkIconButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkIconButtonProps<\"delta\"> | LinkIconButtonProps<\"to\">) => {\n return <IconButton {...{ ...props, component: Link }} />\n}\n\nexport default LinkIconButton\n","import { ListItem, type ListItemProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkListItemProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ListItemProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#list\nconst LinkListItem: {\n (props: LinkListItemProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkListItemProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkListItemProps<\"delta\"> | LinkListItemProps<\"to\">) => {\n return <ListItem {...{ ...props, component: Link }} />\n}\n\nexport default LinkListItem\n","import { Tab, type TabProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkTabProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<TabProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#tabs\nconst LinkTab: {\n (props: LinkTabProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkTabProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkTabProps<\"delta\"> | LinkTabProps<\"to\">) => {\n return <Tab {...{ ...props, component: Link }} />\n}\n\nexport default LinkTab\n","import { type JSX, useEffect } from \"react\"\nimport { type To } from \"react-router\"\n\nimport { type NavigateOptions, useNavigate } from \"../../hooks\"\n\nexport type NavigateProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Override extends \"delta\"\n ? { delta: number; to?: undefined }\n : { delta?: undefined; to: To } & NavigateOptions<State>\n\nconst Navigate: {\n (props: NavigateProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: NavigateProps<\"to\", State>,\n ): JSX.Element\n} = ({\n delta,\n to,\n ...options\n}: NavigateProps<\"delta\"> | NavigateProps<\"to\">) => {\n const navigate = useNavigate()\n\n useEffect(() => {\n if (typeof delta === \"number\") navigate(delta)\n else navigate(to, options)\n }, [navigate, delta, to, options])\n\n return <></>\n}\n\nexport default Navigate\n"],"names":["Link","props","jsx","MuiLink","RouterLink","LinkIconButton","IconButton","LinkListItem","ListItem","LinkTab","Tab","Navigate","delta","to","options","navigate","useNavigate","useEffect","Fragment"],"mappings":";;;;;;;AAYA,MAAMA,IAKF,CAACC,MAEIC,gBAAAA,EAAAA,IAACC,GAAA,EAAQ,WAAWC,GAAa,GAAGH,GAAO,GCP9CI,IAKF,CAACJ,MACIC,gBAAAA,EAAAA,IAACI,KAAiB,GAAGL,GAAO,WAAWD,GAAQ,GCNlDO,IAKF,CAACN,MACIC,gBAAAA,EAAAA,IAACM,KAAe,GAAGP,GAAO,WAAWD,GAAQ,GCNhDS,IAKF,CAACR,MACIC,gBAAAA,EAAAA,IAACQ,KAAU,GAAGT,GAAO,WAAWD,GAAQ,GCN3CW,IAKF,CAAC;AAAA,EACH,OAAAC;AAAA,EACA,IAAAC;AAAA,EACA,GAAGC;AACL,MAAoD;AAClD,QAAMC,IAAWC,EAAA;AAEjB,SAAAC,EAAU,MAAM;AACd,IAAI,OAAOL,KAAU,WAAUG,EAASH,CAAK,IACxCG,EAASF,GAAIC,CAAO;AAAA,EAC3B,GAAG,CAACC,GAAUH,GAAOC,GAAIC,CAAO,CAAC,GAE1BZ,gBAAAA,EAAAA,IAAAgB,EAAAA,UAAA,EAAE;AACX;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const n=require("./jsx-runtime-B2pbW5Fp.cjs"),e=require("@mui/material"),u=require("react"),r=require("react-router");require("@mui/icons-material");require("./palette-BnIdHKDE.cjs");const c=require("./auth-BwpsrTko.cjs"),x=t=>n.jsxRuntimeExports.jsx(e.Link,{component:r.Link,...t}),m=t=>n.jsxRuntimeExports.jsx(e.IconButton,{...t,component:r.Link}),L=t=>n.jsxRuntimeExports.jsx(e.ListItem,{...t,component:r.Link}),a=t=>n.jsxRuntimeExports.jsx(e.Tab,{...t,component:r.Link}),k=({delta:t,to:s,...o})=>{const i=c.useNavigate();return u.useEffect(()=>{typeof t=="number"?i(t):i(s,o)},[i,t,s,o]),n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{})};exports.Link=x;exports.LinkIconButton=m;exports.LinkListItem=L;exports.LinkTab=a;exports.Navigate=k;
2
+ //# sourceMappingURL=Navigate-CrMwdIBB.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Navigate-C_sgy8Xs.cjs","sources":["../src/components/router/Link.tsx","../src/components/router/LinkIconButton.tsx","../src/components/router/LinkListItem.tsx","../src/components/router/LinkTab.tsx","../src/components/router/Navigate.tsx"],"sourcesContent":["import { Link as MuiLink, type LinkProps as MuiLinkProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link as RouterLink } from \"react-router\"\n\nimport { type LinkProps as RouterLinkProps } from \"../../utils/router\"\n\nexport type LinkProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<MuiLinkProps, \"component\"> & RouterLinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#link\nconst Link: {\n (props: LinkProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkProps<\"delta\"> | LinkProps<\"to\">) => {\n // @ts-expect-error props are assignable\n return <MuiLink component={RouterLink} {...props} />\n}\n\nexport default Link\n","import { IconButton, type IconButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkIconButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<IconButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkIconButton: {\n (props: LinkIconButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkIconButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkIconButtonProps<\"delta\"> | LinkIconButtonProps<\"to\">) => {\n return <IconButton {...{ ...props, component: Link }} />\n}\n\nexport default LinkIconButton\n","import { ListItem, type ListItemProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkListItemProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ListItemProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#list\nconst LinkListItem: {\n (props: LinkListItemProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkListItemProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkListItemProps<\"delta\"> | LinkListItemProps<\"to\">) => {\n return <ListItem {...{ ...props, component: Link }} />\n}\n\nexport default LinkListItem\n","import { Tab, type TabProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkTabProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<TabProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#tabs\nconst LinkTab: {\n (props: LinkTabProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkTabProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkTabProps<\"delta\"> | LinkTabProps<\"to\">) => {\n return <Tab {...{ ...props, component: Link }} />\n}\n\nexport default LinkTab\n","import { type JSX, useEffect } from \"react\"\nimport { type To } from \"react-router\"\n\nimport { type NavigateOptions, useNavigate } from \"../../hooks\"\n\nexport type NavigateProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Override extends \"delta\"\n ? { delta: number; to?: undefined }\n : { delta?: undefined; to: To } & NavigateOptions<State>\n\nconst Navigate: {\n (props: NavigateProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: NavigateProps<\"to\", State>,\n ): JSX.Element\n} = ({\n delta,\n to,\n ...options\n}: NavigateProps<\"delta\"> | NavigateProps<\"to\">) => {\n const navigate = useNavigate()\n\n useEffect(() => {\n if (typeof delta === \"number\") navigate(delta)\n else navigate(to, options)\n }, [navigate, delta, to, options])\n\n return <></>\n}\n\nexport default Navigate\n"],"names":["Link","props","jsx","MuiLink","RouterLink","LinkIconButton","IconButton","LinkListItem","ListItem","LinkTab","Tab","Navigate","delta","to","options","navigate","useNavigate","useEffect","Fragment"],"mappings":"2OAYMA,EAKDC,GAEIC,EAAAA,kBAAAA,IAACC,EAAAA,KAAA,CAAQ,UAAWC,EAAAA,KAAa,GAAGH,EAAO,ECP9CI,EAKDJ,GACIC,EAAAA,kBAAAA,IAACI,EAAAA,YAAiB,GAAGL,EAAO,UAAWD,EAAAA,KAAQ,ECNlDO,EAKDN,GACIC,EAAAA,kBAAAA,IAACM,EAAAA,UAAe,GAAGP,EAAO,UAAWD,EAAAA,KAAQ,ECNhDS,EAKDR,GACIC,EAAAA,kBAAAA,IAACQ,EAAAA,KAAU,GAAGT,EAAO,UAAWD,EAAAA,KAAQ,ECN3CW,EAKF,CAAC,CACH,MAAAC,EACA,GAAAC,EACA,GAAGC,CACL,IAAoD,CAClD,MAAMC,EAAWC,EAAAA,YAAA,EAEjBC,OAAAA,EAAAA,UAAU,IAAM,CACV,OAAOL,GAAU,SAAUG,EAASH,CAAK,EACxCG,EAASF,EAAIC,CAAO,CAC3B,EAAG,CAACC,EAAUH,EAAOC,EAAIC,CAAO,CAAC,EAE1BZ,EAAAA,kBAAAA,IAAAgB,EAAAA,kBAAAA,SAAA,EAAE,CACX"}
1
+ {"version":3,"file":"Navigate-CrMwdIBB.cjs","sources":["../src/components/router/Link.tsx","../src/components/router/LinkIconButton.tsx","../src/components/router/LinkListItem.tsx","../src/components/router/LinkTab.tsx","../src/components/router/Navigate.tsx"],"sourcesContent":["import { Link as MuiLink, type LinkProps as MuiLinkProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link as RouterLink } from \"react-router\"\n\nimport { type LinkProps as RouterLinkProps } from \"../../utils/router\"\n\nexport type LinkProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<MuiLinkProps, \"component\"> & RouterLinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#link\nconst Link: {\n (props: LinkProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkProps<\"delta\"> | LinkProps<\"to\">) => {\n // @ts-expect-error props are assignable\n return <MuiLink component={RouterLink} {...props} />\n}\n\nexport default Link\n","import { IconButton, type IconButtonProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkIconButtonProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<IconButtonProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#button\nconst LinkIconButton: {\n (props: LinkIconButtonProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkIconButtonProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkIconButtonProps<\"delta\"> | LinkIconButtonProps<\"to\">) => {\n return <IconButton {...{ ...props, component: Link }} />\n}\n\nexport default LinkIconButton\n","import { ListItem, type ListItemProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkListItemProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<ListItemProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#list\nconst LinkListItem: {\n (props: LinkListItemProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkListItemProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkListItemProps<\"delta\"> | LinkListItemProps<\"to\">) => {\n return <ListItem {...{ ...props, component: Link }} />\n}\n\nexport default LinkListItem\n","import { Tab, type TabProps } from \"@mui/material\"\nimport { type JSX } from \"react\"\nimport { Link } from \"react-router\"\n\nimport { type LinkProps } from \"../../utils/router\"\n\nexport type LinkTabProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Omit<TabProps, \"component\"> & LinkProps<Override, State>\n\n// https://mui.com/material-ui/integrations/routing/#tabs\nconst LinkTab: {\n (props: LinkTabProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: LinkTabProps<\"to\", State>,\n ): JSX.Element\n} = (props: LinkTabProps<\"delta\"> | LinkTabProps<\"to\">) => {\n return <Tab {...{ ...props, component: Link }} />\n}\n\nexport default LinkTab\n","import { type JSX, useEffect } from \"react\"\nimport { type To } from \"react-router\"\n\nimport { type NavigateOptions, useNavigate } from \"../../hooks\"\n\nexport type NavigateProps<\n Override extends \"delta\" | \"to\",\n State extends Record<string, any> = Record<string, any>,\n> = Override extends \"delta\"\n ? { delta: number; to?: undefined }\n : { delta?: undefined; to: To } & NavigateOptions<State>\n\nconst Navigate: {\n (props: NavigateProps<\"delta\">): JSX.Element\n <State extends Record<string, any> = Record<string, any>>(\n props: NavigateProps<\"to\", State>,\n ): JSX.Element\n} = ({\n delta,\n to,\n ...options\n}: NavigateProps<\"delta\"> | NavigateProps<\"to\">) => {\n const navigate = useNavigate()\n\n useEffect(() => {\n if (typeof delta === \"number\") navigate(delta)\n else navigate(to, options)\n }, [navigate, delta, to, options])\n\n return <></>\n}\n\nexport default Navigate\n"],"names":["Link","props","jsx","MuiLink","RouterLink","LinkIconButton","IconButton","LinkListItem","ListItem","LinkTab","Tab","Navigate","delta","to","options","navigate","useNavigate","useEffect","Fragment"],"mappings":"2OAYMA,EAKDC,GAEIC,EAAAA,kBAAAA,IAACC,EAAAA,KAAA,CAAQ,UAAWC,EAAAA,KAAa,GAAGH,EAAO,ECP9CI,EAKDJ,GACIC,EAAAA,kBAAAA,IAACI,EAAAA,YAAiB,GAAGL,EAAO,UAAWD,EAAAA,KAAQ,ECNlDO,EAKDN,GACIC,EAAAA,kBAAAA,IAACM,EAAAA,UAAe,GAAGP,EAAO,UAAWD,EAAAA,KAAQ,ECNhDS,EAKDR,GACIC,EAAAA,kBAAAA,IAACQ,EAAAA,KAAU,GAAGT,EAAO,UAAWD,EAAAA,KAAQ,ECN3CW,EAKF,CAAC,CACH,MAAAC,EACA,GAAAC,EACA,GAAGC,CACL,IAAoD,CAClD,MAAMC,EAAWC,EAAAA,YAAA,EAEjBC,OAAAA,EAAAA,UAAU,IAAM,CACV,OAAOL,GAAU,SAAUG,EAASH,CAAK,EACxCG,EAASF,EAAIC,CAAO,CAC3B,EAAG,CAACC,EAAUH,EAAOC,EAAIC,CAAO,CAAC,EAE1BZ,EAAAA,kBAAAA,IAAAgB,EAAAA,kBAAAA,SAAA,EAAE,CACX"}
@@ -0,0 +1,2 @@
1
+ "use strict";var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}exports.commonjsGlobal=o;exports.getDefaultExportFromCjs=l;
2
+ //# sourceMappingURL=_commonjsHelpers-DKOUU3wS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-DKOUU3wS.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function l(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ export {
6
+ o as c,
7
+ l as g
8
+ };
9
+ //# sourceMappingURL=_commonjsHelpers-DaMA6jEr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-DaMA6jEr.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../api-CaeeoZaI.cjs"),s=require("../../urls-RtSTEZfW.cjs"),i=require("../../session-CacrgFSv.cjs"),l="AuthFactor";function n(r){return{listAuthFactors:r.query({query:e=>({url:t.buildUrl(s.urls.authFactor.list,{search:e}),method:"GET"}),providesTags:t.tagData(l,{includeListTag:!0})})}}const u="Class";function d(r){return{retrieveClass:r.query({query:e=>({url:t.buildUrl(s.urls.class.detail,{url:{id:e}}),method:"GET"}),providesTags:t.tagData(u)}),listClasses:r.query({query:e=>({url:t.buildUrl(s.urls.class.list,{search:e}),method:"GET"}),providesTags:t.tagData(u,{includeListTag:!0})})}}const a="School";function g(r){return{retrieveSchool:r.query({query:e=>({url:t.buildUrl(s.urls.school.detail,{url:{id:e}}),method:"GET"}),providesTags:t.tagData(a)})}}const o="User";function c(r){return{retrieveUser:r.query({query:e=>({url:t.buildUrl(s.urls.user.detail,{url:{id:e}}),method:"GET"}),providesTags:t.tagData(o)}),listUsers:r.query({query:e=>({url:t.buildUrl(s.urls.user.list,{search:e}),method:"GET"}),providesTags:t.tagData(o,{includeListTag:!0})})}}exports.buildLoginEndpoint=i.buildLoginEndpoint;exports.buildLogoutEndpoint=i.buildLogoutEndpoint;exports.AUTH_FACTOR_TAG=l;exports.CLASS_TAG=u;exports.SCHOOL_TAG=a;exports.USER_TAG=o;exports.getReadAuthFactorEndpoints=n;exports.getReadClassEndpoints=d;exports.getReadSchoolEndpoints=g;exports.getReadUserEndpoints=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../api-CAH3GT1O.cjs"),s=require("../../urls-CGZI0f1w.cjs"),i=require("../../session-CacrgFSv.cjs"),l="AuthFactor";function n(r){return{listAuthFactors:r.query({query:e=>({url:t.buildUrl(s.urls.authFactor.list,{search:e}),method:"GET"}),providesTags:t.tagData(l,{includeListTag:!0})})}}const u="Class";function d(r){return{retrieveClass:r.query({query:e=>({url:t.buildUrl(s.urls.class.detail,{url:{id:e}}),method:"GET"}),providesTags:t.tagData(u)}),listClasses:r.query({query:e=>({url:t.buildUrl(s.urls.class.list,{search:e}),method:"GET"}),providesTags:t.tagData(u,{includeListTag:!0})})}}const a="School";function g(r){return{retrieveSchool:r.query({query:e=>({url:t.buildUrl(s.urls.school.detail,{url:{id:e}}),method:"GET"}),providesTags:t.tagData(a)})}}const o="User";function c(r){return{retrieveUser:r.query({query:e=>({url:t.buildUrl(s.urls.user.detail,{url:{id:e}}),method:"GET"}),providesTags:t.tagData(o)}),listUsers:r.query({query:e=>({url:t.buildUrl(s.urls.user.list,{search:e}),method:"GET"}),providesTags:t.tagData(o,{includeListTag:!0})})}}exports.buildLoginEndpoint=i.buildLoginEndpoint;exports.buildLogoutEndpoint=i.buildLogoutEndpoint;exports.AUTH_FACTOR_TAG=l;exports.CLASS_TAG=u;exports.SCHOOL_TAG=a;exports.USER_TAG=o;exports.getReadAuthFactorEndpoints=n;exports.getReadClassEndpoints=d;exports.getReadSchoolEndpoints=g;exports.getReadUserEndpoints=c;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,5 +1,5 @@
1
- import { t, b as s } from "../../api-BvUiTeR7.js";
2
- import { u as o } from "../../urls-5m9PgoEX.js";
1
+ import { t, b as s } from "../../api-BFYu8ZvQ.js";
2
+ import { u as o } from "../../urls-DP4a8kxP.js";
3
3
  import { a as q, b as y } from "../../session-D312kYKk.js";
4
4
  const a = "AuthFactor";
5
5
  function c(r) {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("../rtk-query.modern-PBCErCqb.cjs"),x=require("@reduxjs/toolkit"),T=require("react-redux"),n=require("react"),re=require("../settings/index.cjs.js"),ie=require("../session-CacrgFSv.cjs"),B=require("../utils/auth.cjs.js"),ue=require("../api-CaeeoZaI.cjs"),ce=require("../schemas-CpAWhNsP.cjs"),ae=require("../urls-RtSTEZfW.cjs");function z(e){return e.replace(e[0],e[0].toUpperCase())}function fe(e){let d=0;for(const g in e)d++;return d}function de(e){return e.type==="query"}function le(e){return e.type==="mutation"}function te(e){return e.type==="infinitequery"}function H(e,...d){return Object.assign(e,...d)}var Y=Symbol();function Z(e){const d=n.useRef(e),g=n.useMemo(()=>Q.copyWithStructuralSharing(d.current,e),[e]);return n.useEffect(()=>{d.current!==g&&(d.current=g)},[g]),g}function $(e){const d=n.useRef(e);return n.useEffect(()=>{T.shallowEqual(d.current,e)||(d.current=e)},[e]),T.shallowEqual(d.current,e)?d.current:e}var pe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",be=pe(),ye=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ge=ye(),he=()=>be||ge?n.useLayoutEffect:n.useEffect,me=he(),ee=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Q.QueryStatus.pending}:e;function J(e,...d){const g={};return d.forEach(k=>{g[k]=e[k]}),g}var X=["data","status","isLoading","isSuccess","isError","error"];function ke({api:e,moduleOptions:{batch:d,hooks:{useDispatch:g,useSelector:k,useStore:q},unstable__sideEffectsInRender:h,createSelector:S},serializeQueryArgs:m,context:D}){const C=h?t=>t():n.useEffect;return{buildQueryHooks:A,buildInfiniteQueryHooks:K,buildMutationHook:W,usePrefetch:G};function j(t,r,l){if(r?.endpointName&&t.isUninitialized){const{endpointName:u}=r,a=D.endpointDefinitions[u];l!==Q.skipToken&&m({queryArgs:r.originalArgs,endpointDefinition:a,endpointName:u})===m({queryArgs:l,endpointDefinition:a,endpointName:u})&&(r=void 0)}let c=t.isSuccess?t.data:r?.data;c===void 0&&(c=t.data);const i=c!==void 0,s=t.isLoading,o=(!r||r.isLoading||r.isUninitialized)&&!i&&s,f=t.isSuccess||i&&(s&&!r?.isError||t.isUninitialized);return{...t,data:c,currentData:t.data,isFetching:s,isLoading:o,isSuccess:f}}function F(t,r,l){if(r?.endpointName&&t.isUninitialized){const{endpointName:u}=r,a=D.endpointDefinitions[u];l!==Q.skipToken&&m({queryArgs:r.originalArgs,endpointDefinition:a,endpointName:u})===m({queryArgs:l,endpointDefinition:a,endpointName:u})&&(r=void 0)}let c=t.isSuccess?t.data:r?.data;c===void 0&&(c=t.data);const i=c!==void 0,s=t.isLoading,o=(!r||r.isLoading||r.isUninitialized)&&!i&&s,f=t.isSuccess||s&&i;return{...t,data:c,currentData:t.data,isFetching:s,isLoading:o,isSuccess:f}}function G(t,r){const l=g(),c=$(r);return n.useCallback((i,s)=>l(e.util.prefetch(t,i,{...c,...s})),[t,l,c])}function M(t,r,{refetchOnReconnect:l,refetchOnFocus:c,refetchOnMountOrArgChange:i,skip:s=!1,pollingInterval:o=0,skipPollingIfUnfocused:f=!1,...u}={}){const{initiate:a}=e.endpoints[t],b=g(),O=n.useRef(void 0);if(!O.current){const L=b(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof L!="object"||typeof L?.type=="string"))throw new Error(process.env.NODE_ENV==="production"?x.formatProdErrorMessage(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
2
- You must add the middleware for RTK-Query to function correctly!`);O.current=L}const p=Z(s?Q.skipToken:r),y=$({refetchOnReconnect:l,refetchOnFocus:c,pollingInterval:o,skipPollingIfUnfocused:f}),v=u.initialPageParam,E=$(v),P=n.useRef(void 0);let{queryCacheKey:I,requestId:U}=P.current||{},V=!1;I&&U&&(V=O.current.isRequestSubscribed(I,U));const N=!V&&P.current!==void 0;return C(()=>{N&&(P.current=void 0)},[N]),C(()=>{const L=P.current;if(typeof process<"u"&&process.env.NODE_ENV==="removeMeOnCompilation"&&console.log(N),p===Q.skipToken){L?.unsubscribe(),P.current=void 0;return}const se=P.current?.subscriptionOptions;if(!L||L.arg!==p){L?.unsubscribe();const oe=b(a(p,{subscriptionOptions:y,forceRefetch:i,...te(D.endpointDefinitions[t])?{initialPageParam:E}:{}}));P.current=oe}else y!==se&&L.updateSubscriptionOptions(y)},[b,a,i,p,y,N,E,t]),[P,b,a,y]}function _(t,r){return(c,{skip:i=!1,selectFromResult:s}={})=>{const{select:o}=e.endpoints[t],f=Z(i?Q.skipToken:c),u=n.useRef(void 0),a=n.useMemo(()=>S([o(f),(v,E)=>E,v=>f],r,{memoizeOptions:{resultEqualityCheck:T.shallowEqual}}),[o,f]),b=n.useMemo(()=>s?S([a],s,{devModeChecks:{identityFunctionCheck:"never"}}):a,[a,s]),O=k(v=>b(v,u.current),T.shallowEqual),p=q(),y=a(p.getState(),u.current);return me(()=>{u.current=y},[y]),O}}function w(t){n.useEffect(()=>()=>{t.current?.unsubscribe?.(),t.current=void 0},[t])}function R(t){if(!t.current)throw new Error(process.env.NODE_ENV==="production"?x.formatProdErrorMessage(38):"Cannot refetch a query that has not been started yet.");return t.current.refetch()}function A(t){const r=(i,s={})=>{const[o]=M(t,i,s);return w(o),n.useMemo(()=>({refetch:()=>R(o)}),[o])},l=({refetchOnReconnect:i,refetchOnFocus:s,pollingInterval:o=0,skipPollingIfUnfocused:f=!1}={})=>{const{initiate:u}=e.endpoints[t],a=g(),[b,O]=n.useState(Y),p=n.useRef(void 0),y=$({refetchOnReconnect:i,refetchOnFocus:s,pollingInterval:o,skipPollingIfUnfocused:f});C(()=>{const I=p.current?.subscriptionOptions;y!==I&&p.current?.updateSubscriptionOptions(y)},[y]);const v=n.useRef(y);C(()=>{v.current=y},[y]);const E=n.useCallback(function(I,U=!1){let V;return d(()=>{p.current?.unsubscribe(),p.current=V=a(u(I,{subscriptionOptions:v.current,forceRefetch:!U})),O(I)}),V},[a,u]),P=n.useCallback(()=>{p.current?.queryCacheKey&&a(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[a]);return n.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),n.useEffect(()=>{b!==Y&&!p.current&&E(b,!0)},[b,E]),n.useMemo(()=>[E,b,{reset:P}],[E,b,P])},c=_(t,j);return{useQueryState:c,useQuerySubscription:r,useLazyQuerySubscription:l,useLazyQuery(i){const[s,o,{reset:f}]=l(i),u=c(o,{...i,skip:o===Y}),a=n.useMemo(()=>({lastArg:o}),[o]);return n.useMemo(()=>[s,{...u,reset:f},a],[s,u,f,a])},useQuery(i,s){const o=r(i,s),f=c(i,{selectFromResult:i===Q.skipToken||s?.skip?void 0:ee,...s}),u=J(f,...X);return n.useDebugValue(u),n.useMemo(()=>({...f,...o}),[f,o])}}}function K(t){const r=(c,i={})=>{const[s,o,f,u]=M(t,c,i),a=n.useRef(u);C(()=>{a.current=u},[u]);const b=n.useCallback(function(y,v){let E;return d(()=>{s.current?.unsubscribe(),s.current=E=o(f(y,{subscriptionOptions:a.current,direction:v}))}),E},[s,o,f]);w(s);const O=Z(i.skip?Q.skipToken:c),p=n.useCallback(()=>R(s),[s]);return n.useMemo(()=>({trigger:b,refetch:p,fetchNextPage:()=>b(O,"forward"),fetchPreviousPage:()=>b(O,"backward")}),[p,b,O])},l=_(t,F);return{useInfiniteQueryState:l,useInfiniteQuerySubscription:r,useInfiniteQuery(c,i){const{refetch:s,fetchNextPage:o,fetchPreviousPage:f}=r(c,i),u=l(c,{selectFromResult:c===Q.skipToken||i?.skip?void 0:ee,...i}),a=J(u,...X,"hasNextPage","hasPreviousPage");return n.useDebugValue(a),n.useMemo(()=>({...u,fetchNextPage:o,fetchPreviousPage:f,refetch:s}),[u,o,f,s])}}}function W(t){return({selectFromResult:r,fixedCacheKey:l}={})=>{const{select:c,initiate:i}=e.endpoints[t],s=g(),[o,f]=n.useState();n.useEffect(()=>()=>{o?.arg.fixedCacheKey||o?.reset()},[o]);const u=n.useCallback(function(I){const U=s(i(I,{fixedCacheKey:l}));return f(U),U},[s,i,l]),{requestId:a}=o||{},b=n.useMemo(()=>c({fixedCacheKey:l,requestId:o?.requestId}),[l,o,c]),O=n.useMemo(()=>r?S([b],r):b,[r,b]),p=k(O,T.shallowEqual),y=l==null?o?.arg.originalArgs:void 0,v=n.useCallback(()=>{d(()=>{o&&f(void 0),l&&s(e.internalActions.removeMutationResult({requestId:a,fixedCacheKey:l}))})},[s,l,o,a]),E=J(p,...X,"endpointName");n.useDebugValue(E);const P=n.useMemo(()=>({...p,originalArgs:y,reset:v}),[p,y,v]);return n.useMemo(()=>[u,P],[u,P])}}}var Se=Symbol(),ve=({batch:e=T.batch,hooks:d={useDispatch:T.useDispatch,useSelector:T.useSelector,useStore:T.useStore},createSelector:g=Q.createSelector,unstable__sideEffectsInRender:k=!1,...q}={})=>{if(process.env.NODE_ENV!=="production"){const h=["useDispatch","useSelector","useStore"];let S=!1;for(const m of h)if(fe(q)>0&&(q[m]&&(S||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),S=!0)),d[m]=q[m]),typeof d[m]!="function")throw new Error(process.env.NODE_ENV==="production"?x.formatProdErrorMessage(36):`When using custom hooks for context, all ${h.length} hooks need to be provided: ${h.join(", ")}.
3
- Hook ${m} was either not provided or not a function.`)}return{name:Se,init(h,{serializeQueryArgs:S},m){const D=h,{buildQueryHooks:C,buildInfiniteQueryHooks:j,buildMutationHook:F,usePrefetch:G}=ke({api:h,moduleOptions:{batch:e,hooks:d,unstable__sideEffectsInRender:k,createSelector:g},serializeQueryArgs:S,context:m});return H(D,{usePrefetch:G}),H(m,{batch:e}),{injectEndpoint(M,_){if(de(_)){const{useQuery:w,useLazyQuery:R,useLazyQuerySubscription:A,useQueryState:K,useQuerySubscription:W}=C(M);H(D.endpoints[M],{useQuery:w,useLazyQuery:R,useLazyQuerySubscription:A,useQueryState:K,useQuerySubscription:W}),h[`use${z(M)}Query`]=w,h[`useLazy${z(M)}Query`]=R}if(le(_)){const w=F(M);H(D.endpoints[M],{useMutation:w}),h[`use${z(M)}Mutation`]=w}else if(te(_)){const{useInfiniteQuery:w,useInfiniteQuerySubscription:R,useInfiniteQueryState:A}=j(M);H(D.endpoints[M],{useInfiniteQuery:w,useInfiniteQuerySubscription:R,useInfiniteQueryState:A}),h[`use${z(M)}InfiniteQuery`]=w}}}}}},Ee=Q.buildCreateApi(Q.coreModule(),ve());const ne=["User","School","Class","AuthFactor"];function Pe({tagTypes:e=[]}={}){const d=Q.fetchBaseQuery({baseUrl:`${re.SERVICE_API_URL}/`,credentials:"include",prepareHeaders:(k,q)=>{const{type:h,arg:S}=q,m=typeof S=="string"?"GET":S.method||"GET";if(h==="mutation"||!ue.isSafeHttpMethod(m)){const D=B.getCsrfCookie();D&&k.set("x-csrftoken",D)}return k}}),g=Ee({baseQuery:async(k,q,h)=>{if(q.type==="mutation"&&B.getCsrfCookie()===void 0){const{error:S}=await d({url:"/csrf/cookie/",method:"GET"},q,{});S!==void 0&&console.error(S),B.getCsrfCookie()}return await d(k,q,h)},tagTypes:[...ne,...e],endpoints:()=>({})});return g.injectEndpoints({endpoints:k=>({logout:ie.buildLogoutEndpoint(g,k)})})}exports.schemas=ce.schemas;exports.urls=ae.urls;exports.createApi=Pe;exports.tagTypes=ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("../rtk-query.modern-PBCErCqb.cjs"),x=require("@reduxjs/toolkit"),T=require("react-redux"),n=require("react"),re=require("../settings/index.cjs.js"),ie=require("../session-CacrgFSv.cjs"),B=require("../utils/auth.cjs.js"),ue=require("../api-CAH3GT1O.cjs"),ce=require("../schemas-DXX4rh8i.cjs"),ae=require("../urls-CGZI0f1w.cjs");function $(e){return e.replace(e[0],e[0].toUpperCase())}function fe(e){let d=0;for(const g in e)d++;return d}function de(e){return e.type==="query"}function le(e){return e.type==="mutation"}function te(e){return e.type==="infinitequery"}function H(e,...d){return Object.assign(e,...d)}var Y=Symbol();function Z(e){const d=n.useRef(e),g=n.useMemo(()=>Q.copyWithStructuralSharing(d.current,e),[e]);return n.useEffect(()=>{d.current!==g&&(d.current=g)},[g]),g}function z(e){const d=n.useRef(e);return n.useEffect(()=>{T.shallowEqual(d.current,e)||(d.current=e)},[e]),T.shallowEqual(d.current,e)?d.current:e}var pe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",be=pe(),ye=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ge=ye(),he=()=>be||ge?n.useLayoutEffect:n.useEffect,me=he(),ee=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Q.QueryStatus.pending}:e;function J(e,...d){const g={};return d.forEach(k=>{g[k]=e[k]}),g}var X=["data","status","isLoading","isSuccess","isError","error"];function ke({api:e,moduleOptions:{batch:d,hooks:{useDispatch:g,useSelector:k,useStore:q},unstable__sideEffectsInRender:h,createSelector:S},serializeQueryArgs:m,context:D}){const C=h?t=>t():n.useEffect;return{buildQueryHooks:A,buildInfiniteQueryHooks:K,buildMutationHook:W,usePrefetch:G};function j(t,r,l){if(r?.endpointName&&t.isUninitialized){const{endpointName:u}=r,a=D.endpointDefinitions[u];l!==Q.skipToken&&m({queryArgs:r.originalArgs,endpointDefinition:a,endpointName:u})===m({queryArgs:l,endpointDefinition:a,endpointName:u})&&(r=void 0)}let c=t.isSuccess?t.data:r?.data;c===void 0&&(c=t.data);const i=c!==void 0,s=t.isLoading,o=(!r||r.isLoading||r.isUninitialized)&&!i&&s,f=t.isSuccess||i&&(s&&!r?.isError||t.isUninitialized);return{...t,data:c,currentData:t.data,isFetching:s,isLoading:o,isSuccess:f}}function F(t,r,l){if(r?.endpointName&&t.isUninitialized){const{endpointName:u}=r,a=D.endpointDefinitions[u];l!==Q.skipToken&&m({queryArgs:r.originalArgs,endpointDefinition:a,endpointName:u})===m({queryArgs:l,endpointDefinition:a,endpointName:u})&&(r=void 0)}let c=t.isSuccess?t.data:r?.data;c===void 0&&(c=t.data);const i=c!==void 0,s=t.isLoading,o=(!r||r.isLoading||r.isUninitialized)&&!i&&s,f=t.isSuccess||s&&i;return{...t,data:c,currentData:t.data,isFetching:s,isLoading:o,isSuccess:f}}function G(t,r){const l=g(),c=z(r);return n.useCallback((i,s)=>l(e.util.prefetch(t,i,{...c,...s})),[t,l,c])}function M(t,r,{refetchOnReconnect:l,refetchOnFocus:c,refetchOnMountOrArgChange:i,skip:s=!1,pollingInterval:o=0,skipPollingIfUnfocused:f=!1,...u}={}){const{initiate:a}=e.endpoints[t],b=g(),O=n.useRef(void 0);if(!O.current){const L=b(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof L!="object"||typeof L?.type=="string"))throw new Error(process.env.NODE_ENV==="production"?x.formatProdErrorMessage(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
2
+ You must add the middleware for RTK-Query to function correctly!`);O.current=L}const p=Z(s?Q.skipToken:r),y=z({refetchOnReconnect:l,refetchOnFocus:c,pollingInterval:o,skipPollingIfUnfocused:f}),v=u.initialPageParam,E=z(v),P=n.useRef(void 0);let{queryCacheKey:I,requestId:U}=P.current||{},V=!1;I&&U&&(V=O.current.isRequestSubscribed(I,U));const N=!V&&P.current!==void 0;return C(()=>{N&&(P.current=void 0)},[N]),C(()=>{const L=P.current;if(typeof process<"u"&&process.env.NODE_ENV==="removeMeOnCompilation"&&console.log(N),p===Q.skipToken){L?.unsubscribe(),P.current=void 0;return}const se=P.current?.subscriptionOptions;if(!L||L.arg!==p){L?.unsubscribe();const oe=b(a(p,{subscriptionOptions:y,forceRefetch:i,...te(D.endpointDefinitions[t])?{initialPageParam:E}:{}}));P.current=oe}else y!==se&&L.updateSubscriptionOptions(y)},[b,a,i,p,y,N,E,t]),[P,b,a,y]}function _(t,r){return(c,{skip:i=!1,selectFromResult:s}={})=>{const{select:o}=e.endpoints[t],f=Z(i?Q.skipToken:c),u=n.useRef(void 0),a=n.useMemo(()=>S([o(f),(v,E)=>E,v=>f],r,{memoizeOptions:{resultEqualityCheck:T.shallowEqual}}),[o,f]),b=n.useMemo(()=>s?S([a],s,{devModeChecks:{identityFunctionCheck:"never"}}):a,[a,s]),O=k(v=>b(v,u.current),T.shallowEqual),p=q(),y=a(p.getState(),u.current);return me(()=>{u.current=y},[y]),O}}function w(t){n.useEffect(()=>()=>{t.current?.unsubscribe?.(),t.current=void 0},[t])}function R(t){if(!t.current)throw new Error(process.env.NODE_ENV==="production"?x.formatProdErrorMessage(38):"Cannot refetch a query that has not been started yet.");return t.current.refetch()}function A(t){const r=(i,s={})=>{const[o]=M(t,i,s);return w(o),n.useMemo(()=>({refetch:()=>R(o)}),[o])},l=({refetchOnReconnect:i,refetchOnFocus:s,pollingInterval:o=0,skipPollingIfUnfocused:f=!1}={})=>{const{initiate:u}=e.endpoints[t],a=g(),[b,O]=n.useState(Y),p=n.useRef(void 0),y=z({refetchOnReconnect:i,refetchOnFocus:s,pollingInterval:o,skipPollingIfUnfocused:f});C(()=>{const I=p.current?.subscriptionOptions;y!==I&&p.current?.updateSubscriptionOptions(y)},[y]);const v=n.useRef(y);C(()=>{v.current=y},[y]);const E=n.useCallback(function(I,U=!1){let V;return d(()=>{p.current?.unsubscribe(),p.current=V=a(u(I,{subscriptionOptions:v.current,forceRefetch:!U})),O(I)}),V},[a,u]),P=n.useCallback(()=>{p.current?.queryCacheKey&&a(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[a]);return n.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),n.useEffect(()=>{b!==Y&&!p.current&&E(b,!0)},[b,E]),n.useMemo(()=>[E,b,{reset:P}],[E,b,P])},c=_(t,j);return{useQueryState:c,useQuerySubscription:r,useLazyQuerySubscription:l,useLazyQuery(i){const[s,o,{reset:f}]=l(i),u=c(o,{...i,skip:o===Y}),a=n.useMemo(()=>({lastArg:o}),[o]);return n.useMemo(()=>[s,{...u,reset:f},a],[s,u,f,a])},useQuery(i,s){const o=r(i,s),f=c(i,{selectFromResult:i===Q.skipToken||s?.skip?void 0:ee,...s}),u=J(f,...X);return n.useDebugValue(u),n.useMemo(()=>({...f,...o}),[f,o])}}}function K(t){const r=(c,i={})=>{const[s,o,f,u]=M(t,c,i),a=n.useRef(u);C(()=>{a.current=u},[u]);const b=n.useCallback(function(y,v){let E;return d(()=>{s.current?.unsubscribe(),s.current=E=o(f(y,{subscriptionOptions:a.current,direction:v}))}),E},[s,o,f]);w(s);const O=Z(i.skip?Q.skipToken:c),p=n.useCallback(()=>R(s),[s]);return n.useMemo(()=>({trigger:b,refetch:p,fetchNextPage:()=>b(O,"forward"),fetchPreviousPage:()=>b(O,"backward")}),[p,b,O])},l=_(t,F);return{useInfiniteQueryState:l,useInfiniteQuerySubscription:r,useInfiniteQuery(c,i){const{refetch:s,fetchNextPage:o,fetchPreviousPage:f}=r(c,i),u=l(c,{selectFromResult:c===Q.skipToken||i?.skip?void 0:ee,...i}),a=J(u,...X,"hasNextPage","hasPreviousPage");return n.useDebugValue(a),n.useMemo(()=>({...u,fetchNextPage:o,fetchPreviousPage:f,refetch:s}),[u,o,f,s])}}}function W(t){return({selectFromResult:r,fixedCacheKey:l}={})=>{const{select:c,initiate:i}=e.endpoints[t],s=g(),[o,f]=n.useState();n.useEffect(()=>()=>{o?.arg.fixedCacheKey||o?.reset()},[o]);const u=n.useCallback(function(I){const U=s(i(I,{fixedCacheKey:l}));return f(U),U},[s,i,l]),{requestId:a}=o||{},b=n.useMemo(()=>c({fixedCacheKey:l,requestId:o?.requestId}),[l,o,c]),O=n.useMemo(()=>r?S([b],r):b,[r,b]),p=k(O,T.shallowEqual),y=l==null?o?.arg.originalArgs:void 0,v=n.useCallback(()=>{d(()=>{o&&f(void 0),l&&s(e.internalActions.removeMutationResult({requestId:a,fixedCacheKey:l}))})},[s,l,o,a]),E=J(p,...X,"endpointName");n.useDebugValue(E);const P=n.useMemo(()=>({...p,originalArgs:y,reset:v}),[p,y,v]);return n.useMemo(()=>[u,P],[u,P])}}}var Se=Symbol(),ve=({batch:e=T.batch,hooks:d={useDispatch:T.useDispatch,useSelector:T.useSelector,useStore:T.useStore},createSelector:g=Q.createSelector,unstable__sideEffectsInRender:k=!1,...q}={})=>{if(process.env.NODE_ENV!=="production"){const h=["useDispatch","useSelector","useStore"];let S=!1;for(const m of h)if(fe(q)>0&&(q[m]&&(S||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),S=!0)),d[m]=q[m]),typeof d[m]!="function")throw new Error(process.env.NODE_ENV==="production"?x.formatProdErrorMessage(36):`When using custom hooks for context, all ${h.length} hooks need to be provided: ${h.join(", ")}.
3
+ Hook ${m} was either not provided or not a function.`)}return{name:Se,init(h,{serializeQueryArgs:S},m){const D=h,{buildQueryHooks:C,buildInfiniteQueryHooks:j,buildMutationHook:F,usePrefetch:G}=ke({api:h,moduleOptions:{batch:e,hooks:d,unstable__sideEffectsInRender:k,createSelector:g},serializeQueryArgs:S,context:m});return H(D,{usePrefetch:G}),H(m,{batch:e}),{injectEndpoint(M,_){if(de(_)){const{useQuery:w,useLazyQuery:R,useLazyQuerySubscription:A,useQueryState:K,useQuerySubscription:W}=C(M);H(D.endpoints[M],{useQuery:w,useLazyQuery:R,useLazyQuerySubscription:A,useQueryState:K,useQuerySubscription:W}),h[`use${$(M)}Query`]=w,h[`useLazy${$(M)}Query`]=R}if(le(_)){const w=F(M);H(D.endpoints[M],{useMutation:w}),h[`use${$(M)}Mutation`]=w}else if(te(_)){const{useInfiniteQuery:w,useInfiniteQuerySubscription:R,useInfiniteQueryState:A}=j(M);H(D.endpoints[M],{useInfiniteQuery:w,useInfiniteQuerySubscription:R,useInfiniteQueryState:A}),h[`use${$(M)}InfiniteQuery`]=w}}}}}},Ee=Q.buildCreateApi(Q.coreModule(),ve());const ne=["User","School","Class","AuthFactor"];function Pe({tagTypes:e=[]}={}){const d=Q.fetchBaseQuery({baseUrl:`${re.SERVICE_API_URL}/`,credentials:"include",prepareHeaders:(k,q)=>{const{type:h,arg:S}=q,m=typeof S=="string"?"GET":S.method||"GET";if(h==="mutation"||!ue.isSafeHttpMethod(m)){const D=B.getCsrfCookie();D&&k.set("x-csrftoken",D)}return k}}),g=Ee({baseQuery:async(k,q,h)=>{if(q.type==="mutation"&&B.getCsrfCookie()===void 0){const{error:S}=await d({url:"/csrf/cookie/",method:"GET"},q,{});S!==void 0&&console.error(S),B.getCsrfCookie()}return await d(k,q,h)},tagTypes:[...ne,...e],endpoints:()=>({})});return g.injectEndpoints({endpoints:k=>({logout:ie.buildLogoutEndpoint(g,k)})})}exports.schemas=ce.schemas;exports.urls=ae.urls;exports.createApi=Pe;exports.tagTypes=ne;
4
4
  //# sourceMappingURL=index.cjs.js.map
@@ -5,9 +5,9 @@ import { useCallback as N, useDebugValue as x, useMemo as k, useState as re, use
5
5
  import { SERVICE_API_URL as ve } from "../settings/index.es.js";
6
6
  import { b as Ee } from "../session-D312kYKk.js";
7
7
  import { getCsrfCookie as J } from "../utils/auth.es.js";
8
- import { i as Qe } from "../api-BvUiTeR7.js";
9
- import { s as Be } from "../schemas-D3tO0rys.js";
10
- import { u as Ze } from "../urls-5m9PgoEX.js";
8
+ import { i as Qe } from "../api-BFYu8ZvQ.js";
9
+ import { s as Be } from "../schemas-BMQZbhti.js";
10
+ import { u as Ze } from "../urls-DP4a8kxP.js";
11
11
  function F(e) {
12
12
  return e.replace(e[0], e[0].toUpperCase());
13
13
  }
@@ -0,0 +1,2 @@
1
+ "use strict";const r=require("react");function u(g){const{page:e=0,limit:a=150}=g||{},[c,f]=r.useState({page:e,limit:a,offset:e*a});return[c,t=>{f(({page:p,limit:o})=>{const s=typeof t=="function"?t({page:p,limit:o}):t;let i=s.page;const n=s.limit;return n!==o&&(i=0),{page:i,limit:n,offset:i*n}})}]}exports.usePagination=u;
2
+ //# sourceMappingURL=api-9cnyvZj7.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-DIgp_6Vr.cjs","sources":["../src/hooks/api.tsx"],"sourcesContent":["import { type Dispatch, type SetStateAction, useState } from \"react\"\n\nexport type Pagination = { page: number; limit: number; offset: number }\nexport type SetPagination = Dispatch<\n SetStateAction<{ page: number; limit: number }>\n>\nexport type UsePaginationOptions = Partial<{\n page: number\n limit: number\n}>\n\nexport function usePagination(\n options?: UsePaginationOptions,\n): [Pagination, SetPagination] {\n const { page = 0, limit = 150 } = options || {}\n\n const [pagination, _setPagination] = useState<Pagination>({\n page,\n limit,\n offset: page * limit,\n })\n\n const setPagination: SetPagination = value => {\n _setPagination(({ page: previousPage, limit: previousLimit }) => {\n const pagination =\n typeof value === \"function\"\n ? value({ page: previousPage, limit: previousLimit })\n : value\n let page = pagination.page\n const limit = pagination.limit\n\n if (limit !== previousLimit) page = 0\n\n return { page, limit, offset: page * limit }\n })\n }\n\n return [pagination, setPagination]\n}\n"],"names":["usePagination","options","page","limit","pagination","_setPagination","useState","value","previousPage","previousLimit"],"mappings":"sCAWO,SAASA,EACdC,EAC6B,CAC7B,KAAM,CAAE,KAAAC,EAAO,EAAG,MAAAC,EAAQ,GAAA,EAAQF,GAAW,CAAA,EAEvC,CAACG,EAAYC,CAAc,EAAIC,WAAqB,CACxD,KAAAJ,EACA,MAAAC,EACA,OAAQD,EAAOC,CAAA,CAChB,EAiBD,MAAO,CAACC,EAf6BG,GAAS,CAC5CF,EAAe,CAAC,CAAE,KAAMG,EAAc,MAAOC,KAAoB,CAC/D,MAAML,EACJ,OAAOG,GAAU,WACbA,EAAM,CAAE,KAAMC,EAAc,MAAOC,CAAA,CAAe,EAClDF,EACN,IAAIL,EAAOE,EAAW,KACtB,MAAMD,EAAQC,EAAW,MAEzB,OAAID,IAAUM,IAAeP,EAAO,GAE7B,CAAE,KAAAA,EAAM,MAAAC,EAAO,OAAQD,EAAOC,CAAAA,CACvC,CAAC,CACH,CAEiC,CACnC"}
1
+ {"version":3,"file":"api-9cnyvZj7.cjs","sources":["../src/hooks/api.tsx"],"sourcesContent":["import { type Dispatch, type SetStateAction, useState } from \"react\"\n\nexport type Pagination = { page: number; limit: number; offset: number }\nexport type SetPagination = Dispatch<\n SetStateAction<{ page: number; limit: number }>\n>\nexport type UsePaginationOptions = Partial<{\n page: number\n limit: number\n}>\n\nexport function usePagination(\n options?: UsePaginationOptions,\n): [Pagination, SetPagination] {\n const { page = 0, limit = 150 } = options || {}\n\n const [pagination, _setPagination] = useState<Pagination>({\n page,\n limit,\n offset: page * limit,\n })\n\n const setPagination: SetPagination = value => {\n _setPagination(({ page: previousPage, limit: previousLimit }) => {\n const pagination =\n typeof value === \"function\"\n ? value({ page: previousPage, limit: previousLimit })\n : value\n let page = pagination.page\n const limit = pagination.limit\n\n if (limit !== previousLimit) page = 0\n\n return { page, limit, offset: page * limit }\n })\n }\n\n return [pagination, setPagination]\n}\n"],"names":["usePagination","options","page","limit","pagination","_setPagination","useState","value","previousPage","previousLimit"],"mappings":"sCAWO,SAASA,EACdC,EAC6B,CAC7B,KAAM,CAAE,KAAAC,EAAO,EAAG,MAAAC,EAAQ,GAAA,EAAQF,GAAW,CAAA,EAEvC,CAACG,EAAYC,CAAc,EAAIC,WAAqB,CACxD,KAAAJ,EACA,MAAAC,EACA,OAAQD,EAAOC,CAAA,CAChB,EAiBD,MAAO,CAACC,EAf6BG,GAAS,CAC5CF,EAAe,CAAC,CAAE,KAAMG,EAAc,MAAOC,KAAoB,CAC/D,MAAML,EACJ,OAAOG,GAAU,WACbA,EAAM,CAAE,KAAMC,EAAc,MAAOC,CAAA,CAAe,EAClDF,EACN,IAAIL,EAAOE,EAAW,KACtB,MAAMD,EAAQC,EAAW,MAEzB,OAAID,IAAUM,IAAeP,EAAO,GAE7B,CAAE,KAAAA,EAAM,MAAAC,EAAO,OAAQD,EAAOC,CAAAA,CACvC,CAAC,CACH,CAEiC,CACnC"}
@@ -1,4 +1,4 @@
1
- import { j as u } from "./jsx-runtime-C7wFtzyj.js";
1
+ import { j as u } from "./jsx-runtime-lzYHhGH3.js";
2
2
  import { Stack as h, Typography as m, CircularProgress as p } from "@mui/material";
3
3
  import "react";
4
4
  import { getNestedProperty as g } from "./utils/general.es.js";
@@ -89,4 +89,4 @@ export {
89
89
  C as m,
90
90
  L as t
91
91
  };
92
- //# sourceMappingURL=api-BvUiTeR7.js.map
92
+ //# sourceMappingURL=api-BFYu8ZvQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-BvUiTeR7.js","sources":["../src/components/SyncError.tsx","../src/utils/api.tsx"],"sourcesContent":["import { Stack, Typography } from \"@mui/material\"\nimport { type FC } from \"react\"\nimport { SyncProblem as SyncProblemIcon } from \"@mui/icons-material\"\n\nexport interface SyncErrorProps {}\n\nconst SyncError: FC<SyncErrorProps> = () => (\n <Stack alignItems=\"center\" alignContent=\"center\">\n <SyncProblemIcon color=\"error\" />\n <Typography color=\"error.main\">Failed to sync data</Typography>\n </Stack>\n)\n\nexport default SyncError\n","import type {\n FetchBaseQueryError,\n TypedUseMutationResult,\n TypedUseQueryHookResult,\n TypedUseQueryStateResult,\n} from \"@reduxjs/toolkit/query/react\"\nimport { CircularProgress } from \"@mui/material\"\nimport { type ReactNode } from \"react\"\n\nimport { type Optional, type Required, getNestedProperty } from \"./general\"\nimport { type SchemaMap } from \"./schema\"\nimport SyncError from \"../components/SyncError\"\n\n// -----------------------------------------------------------------------------\n// Model Types\n// -----------------------------------------------------------------------------\n\n// The fields of a model.\nexport type Fields = Record<string, unknown>\n\nexport interface Tag<Type extends string> {\n type: Type\n id: string\n}\n\nexport type ModelId = string | number\n\n/**\n * A data model.\n * Id: The type of Id.\n * Data: The data fields.\n */\nexport type Model<Id extends ModelId, MFields extends Fields = Fields> = {\n id: Id\n} & Omit<MFields, \"id\">\n\nexport type Schemas<M extends Model<any>> = {\n [K in keyof M]-?: SchemaMap<M[K]>\n}\n\nexport type Result<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Pick<M, \"id\" | MFields>\n\nexport type Arg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n> = Required<M, RequiredFields> & Optional<M, OptionalFields>\n\n// -----------------------------------------------------------------------------\n// CRUD Types\n// https://www.django-rest-framework.org/api-guide/viewsets/#viewset-actions\n// -----------------------------------------------------------------------------\n\n// Create\n\nexport type CreateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Result<M, MFields>\n\nexport type CreateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n> = Arg<M, RequiredFields, OptionalFields>\n\nexport type BulkCreateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n ExtraFields extends Fields = Fields,\n> = Array<Result<M, MFields> & ExtraFields>\n\nexport type BulkCreateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n ExtraFields extends Fields = Fields,\n> = Array<Arg<M, RequiredFields, OptionalFields> & ExtraFields>\n\n// Read\n\nexport type RetrieveResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Result<M, MFields>\n\nexport type RetrieveArg<M extends Model<any>> = M[\"id\"]\n\nexport interface ListResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n ExtraFields extends Fields = Fields,\n> {\n count: number\n offset: number\n limit: number\n max_limit: number\n data: Array<Result<M, MFields> & ExtraFields>\n}\n\nexport type ListArg<Filters extends Fields = Fields> = {\n limit: number\n offset: number\n} & Partial<Omit<Filters, \"limit\" | \"offset\">>\n\n// Update\n\nexport type UpdateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Result<M, MFields>\n\ntype UpdateWithBody<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields>,\n> = Pick<M, \"id\"> & Arg<M, RequiredFields, OptionalFields>\n\n// NOTE: Sometimes update does not require a body. For example, if calling the\n// \"refresh\" action on an invitation object updates the expiry date to be 24\n// hours from now. In this case, you only need to pass the ID of the object.\nexport type UpdateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\"> = never,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n> = [RequiredFields] extends [never]\n ? [OptionalFields] extends [never]\n ? M[\"id\"]\n : UpdateWithBody<M, RequiredFields, OptionalFields>\n : UpdateWithBody<M, RequiredFields, OptionalFields>\n\nexport type BulkUpdateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n ExtraFields extends Fields = Fields,\n> = Array<Result<M, MFields> & ExtraFields>\n\nexport type BulkUpdateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n ExtraFields extends Fields = Fields,\n> = Record<M[\"id\"], Arg<M, RequiredFields, OptionalFields> & ExtraFields>\n\n// Delete\n\nexport type DestroyResult = null\n\nexport type DestroyArg<M extends Model<any>> = M[\"id\"]\n\nexport type BulkDestroyResult = null\n\nexport type BulkDestroyArg<M extends Model<any>> = Array<M[\"id\"]>\n\n// -----------------------------------------------------------------------------\n// Functions\n// -----------------------------------------------------------------------------\n\nexport function buildUrl(\n url: string,\n params: {\n search?: Fields\n url?: Fields\n },\n): string {\n if (params.url) {\n Object.entries(params.url).forEach(([key, value]) => {\n url = url.replace(`<${key}>`, String(value))\n })\n }\n\n if (params.search) {\n const searchParams: string[][] = []\n for (const key in params.search) {\n const values = params.search[key]\n if (values === undefined) continue\n\n if (Array.isArray(values)) {\n for (const value of values) searchParams.push([key, String(value)])\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n searchParams.push([key, String(values)])\n }\n }\n\n if (searchParams.length !== 0) {\n url += `?${new URLSearchParams(searchParams).toString()}`\n }\n }\n\n return url\n}\n\nexport function isModelId(value: unknown): boolean {\n return typeof value === \"number\" || typeof value === \"string\"\n}\n\nexport function listTag<Type extends string>(type: Type): Tag<Type> {\n return { type, id: \"LIST\" }\n}\n\nexport type TagDataOptions = Partial<{\n includeListTag: boolean\n argKeysAreIds: boolean\n id: string\n}>\n\nexport function tagData<Type extends string, M extends Model<any>>(\n type: Type,\n options?: TagDataOptions,\n): (\n result:\n | Result<M, any>\n | Array<Result<M, any>>\n | ListResult<M, any>\n | null\n | undefined,\n error: FetchBaseQueryError | undefined,\n arg:\n | Arg<M, any>\n | Array<Arg<M, any>>\n | Record<M[\"id\"], Arg<M, any>>\n | ListArg<any>\n | Array<M[\"id\"]>\n | string\n | number\n | undefined,\n) => Array<Tag<Type>> {\n const {\n includeListTag = false,\n argKeysAreIds = false,\n id = \"id\",\n } = options || {}\n\n function tags(\n ids: ModelId[],\n list: boolean = includeListTag,\n ): Array<Tag<Type>> {\n const tags = ids.map(id => ({ type, id: String(id) }))\n if (list) tags.push(listTag(type))\n return tags\n }\n\n function getModelId(result: Result<M, any>) {\n return getNestedProperty(result, id) as ModelId\n }\n\n return (result, error, arg) => {\n if (!error) {\n if (arg) {\n // The argument is an ID.\n if (isModelId(arg)) return tags([arg as ModelId])\n\n // The argument is an array of IDs.\n if (Array.isArray(arg)) {\n if (arg.length && isModelId(arg[0])) {\n return tags(arg as Array<M[\"id\"]>)\n }\n }\n // The argument is an object that contains the id field.\n else if (typeof arg === \"object\" && argKeysAreIds) {\n return tags(Object.keys(arg as Record<M[\"id\"], any>))\n }\n }\n\n if (result) {\n // The result is an array of models that contain the id field.\n if (Array.isArray(result)) {\n return tags(result.map(getModelId))\n }\n\n // The result is a model that contains the id field.\n if (getModelId(result as Result<M, any>) !== undefined) {\n return tags([getModelId(result as Result<M, any>)])\n }\n\n // The result is a list that contains an array of models that contain\n // the id field.\n return tags((result as ListResult<M, any>).data.map(getModelId), true)\n }\n }\n\n return tags([])\n }\n}\n\nexport function modelUrls(list: string, detail: string) {\n if (list === detail) throw Error(\"List and detail are the same.\")\n\n return { list, detail }\n}\n\nexport type HandleQueryStateOptions = Partial<{\n loading: ReactNode\n error: ReactNode\n}>\n\nexport function handleResultState<QueryArg, ResultType>(\n result:\n | TypedUseQueryHookResult<ResultType, QueryArg, any>\n | TypedUseQueryStateResult<ResultType, QueryArg, any>\n | TypedUseMutationResult<ResultType, QueryArg, any>,\n children: (data: NonNullable<ResultType>) => ReactNode,\n options?: HandleQueryStateOptions,\n): ReactNode {\n const { data, isLoading, isSuccess } = result\n const error = result.error as string | undefined\n\n const {\n loading: loadingNode = <CircularProgress />,\n error: errorNode = <SyncError />,\n } = options || {}\n\n // An error occurred.\n if (error) {\n console.error(error)\n return errorNode\n }\n\n // Busy calling the API.\n if (isLoading) return loadingNode\n\n // Called the API and got data.\n if (data) return children(data)\n\n // Called the API and did not get data.\n if (isSuccess) throw Error(\"Expected to get data from API but got nothing.\")\n\n // Have yet to call the API.\n return loadingNode\n}\n\nexport function isSafeHttpMethod(method: string) {\n // https://datatracker.ietf.org/doc/html/rfc9110.html#section-9.2.1\n return [\"GET\", \"HEAD\", \"OPTIONS\", \"TRACE\"].includes(method.toUpperCase())\n}\n"],"names":["SyncError","jsxs","Stack","jsx","SyncProblemIcon","Typography","buildUrl","url","params","key","value","searchParams","values","isModelId","listTag","type","tagData","options","includeListTag","argKeysAreIds","id","tags","ids","list","getModelId","result","getNestedProperty","error","arg","modelUrls","detail","handleResultState","children","data","isLoading","isSuccess","loadingNode","CircularProgress","errorNode","isSafeHttpMethod","method"],"mappings":";;;;;;AAMA,MAAMA,IAAgC,MACpCC,gBAAAA,EAAAA,KAACC,KAAM,YAAW,UAAS,cAAa,UACtC,UAAA;AAAA,EAAAC,gBAAAA,EAAAA,IAACC,GAAA,EAAgB,OAAM,QAAA,CAAQ;AAAA,EAC/BD,gBAAAA,EAAAA,IAACE,GAAA,EAAW,OAAM,cAAa,UAAA,sBAAA,CAAmB;AAAA,EAAA,CACpD;ACuJK,SAASC,EACdC,GACAC,GAIQ;AAOR,MANIA,EAAO,OACT,OAAO,QAAQA,EAAO,GAAG,EAAE,QAAQ,CAAC,CAACC,GAAKC,CAAK,MAAM;AACnD,IAAAH,IAAMA,EAAI,QAAQ,IAAIE,CAAG,KAAK,OAAOC,CAAK,CAAC;AAAA,EAC7C,CAAC,GAGCF,EAAO,QAAQ;AACjB,UAAMG,IAA2B,CAAA;AACjC,eAAWF,KAAOD,EAAO,QAAQ;AAC/B,YAAMI,IAASJ,EAAO,OAAOC,CAAG;AAChC,UAAIG,MAAW;AAEf,YAAI,MAAM,QAAQA,CAAM;AACtB,qBAAWF,KAASE,EAAQ,CAAAD,EAAa,KAAK,CAACF,GAAK,OAAOC,CAAK,CAAC,CAAC;AAAA;AAGlE,UAAAC,EAAa,KAAK,CAACF,GAAK,OAAOG,CAAM,CAAC,CAAC;AAAA,IAE3C;AAEA,IAAID,EAAa,WAAW,MAC1BJ,KAAO,IAAI,IAAI,gBAAgBI,CAAY,EAAE,UAAU;AAAA,EAE3D;AAEA,SAAOJ;AACT;AAEO,SAASM,EAAUH,GAAyB;AACjD,SAAO,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACvD;AAEO,SAASI,EAA6BC,GAAuB;AAClE,SAAO,EAAE,MAAAA,GAAM,IAAI,OAAA;AACrB;AAQO,SAASC,EACdD,GACAE,GAkBoB;AACpB,QAAM;AAAA,IACJ,gBAAAC,IAAiB;AAAA,IACjB,eAAAC,IAAgB;AAAA,IAChB,IAAAC,IAAK;AAAA,EAAA,IACHH,KAAW,CAAA;AAEf,WAASI,EACPC,GACAC,IAAgBL,GACE;AAClB,UAAMG,IAAOC,EAAI,IAAI,CAAAF,OAAO,EAAE,MAAAL,GAAM,IAAI,OAAOK,CAAE,EAAA,EAAI;AACrD,WAAIG,KAAMF,EAAK,KAAKP,EAAQC,CAAI,CAAC,GAC1BM;AAAAA,EACT;AAEA,WAASG,EAAWC,GAAwB;AAC1C,WAAOC,EAAkBD,GAAQL,CAAE;AAAA,EACrC;AAEA,SAAO,CAACK,GAAQE,GAAOC,MAAQ;AAC7B,QAAI,CAACD,GAAO;AACV,UAAIC,GAAK;AAEP,YAAIf,EAAUe,CAAG,UAAUP,EAAK,CAACO,CAAc,CAAC;AAGhD,YAAI,MAAM,QAAQA,CAAG;AACnB,cAAIA,EAAI,UAAUf,EAAUe,EAAI,CAAC,CAAC;AAChC,mBAAOP,EAAKO,CAAqB;AAAA,mBAI5B,OAAOA,KAAQ,YAAYT;AAClC,iBAAOE,EAAK,OAAO,KAAKO,CAA2B,CAAC;AAAA,MAExD;AAEA,UAAIH;AAEF,eAAI,MAAM,QAAQA,CAAM,IACfJ,EAAKI,EAAO,IAAID,CAAU,CAAC,IAIhCA,EAAWC,CAAwB,MAAM,SACpCJ,EAAK,CAACG,EAAWC,CAAwB,CAAC,CAAC,IAK7CJ,EAAMI,EAA8B,KAAK,IAAID,CAAU,GAAG,EAAI;AAAA,IAEzE;AAEA,WAAOH,EAAK,CAAA,CAAE;AAAA,EAChB;AACF;AAEO,SAASQ,EAAUN,GAAcO,GAAgB;AACtD,MAAIP,MAASO,EAAQ,OAAM,MAAM,+BAA+B;AAEhE,SAAO,EAAE,MAAAP,GAAM,QAAAO,EAAA;AACjB;AAOO,SAASC,EACdN,GAIAO,GACAf,GACW;AACX,QAAM,EAAE,MAAAgB,GAAM,WAAAC,GAAW,WAAAC,EAAA,IAAcV,GACjCE,IAAQF,EAAO,OAEf;AAAA,IACJ,SAASW,IAAcjC,gBAAAA,MAACkC,GAAA,CAAA,CAAiB;AAAA,IACzC,OAAOC,IAAYnC,gBAAAA,MAACH,GAAA,CAAA,CAAU;AAAA,EAAA,IAC5BiB,KAAW,CAAA;AAGf,MAAIU;AACF,mBAAQ,MAAMA,CAAK,GACZW;AAIT,MAAIJ,EAAW,QAAOE;AAGtB,MAAIH,EAAM,QAAOD,EAASC,CAAI;AAG9B,MAAIE,EAAW,OAAM,MAAM,gDAAgD;AAG3E,SAAOC;AACT;AAEO,SAASG,EAAiBC,GAAgB;AAE/C,SAAO,CAAC,OAAO,QAAQ,WAAW,OAAO,EAAE,SAASA,EAAO,aAAa;AAC1E;"}
1
+ {"version":3,"file":"api-BFYu8ZvQ.js","sources":["../src/components/SyncError.tsx","../src/utils/api.tsx"],"sourcesContent":["import { Stack, Typography } from \"@mui/material\"\nimport { type FC } from \"react\"\nimport { SyncProblem as SyncProblemIcon } from \"@mui/icons-material\"\n\nexport interface SyncErrorProps {}\n\nconst SyncError: FC<SyncErrorProps> = () => (\n <Stack alignItems=\"center\" alignContent=\"center\">\n <SyncProblemIcon color=\"error\" />\n <Typography color=\"error.main\">Failed to sync data</Typography>\n </Stack>\n)\n\nexport default SyncError\n","import type {\n FetchBaseQueryError,\n TypedUseMutationResult,\n TypedUseQueryHookResult,\n TypedUseQueryStateResult,\n} from \"@reduxjs/toolkit/query/react\"\nimport { CircularProgress } from \"@mui/material\"\nimport { type ReactNode } from \"react\"\n\nimport { type Optional, type Required, getNestedProperty } from \"./general\"\nimport { type SchemaMap } from \"./schema\"\nimport SyncError from \"../components/SyncError\"\n\n// -----------------------------------------------------------------------------\n// Model Types\n// -----------------------------------------------------------------------------\n\n// The fields of a model.\nexport type Fields = Record<string, unknown>\n\nexport interface Tag<Type extends string> {\n type: Type\n id: string\n}\n\nexport type ModelId = string | number\n\n/**\n * A data model.\n * Id: The type of Id.\n * Data: The data fields.\n */\nexport type Model<Id extends ModelId, MFields extends Fields = Fields> = {\n id: Id\n} & Omit<MFields, \"id\">\n\nexport type Schemas<M extends Model<any>> = {\n [K in keyof M]-?: SchemaMap<M[K]>\n}\n\nexport type Result<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Pick<M, \"id\" | MFields>\n\nexport type Arg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n> = Required<M, RequiredFields> & Optional<M, OptionalFields>\n\n// -----------------------------------------------------------------------------\n// CRUD Types\n// https://www.django-rest-framework.org/api-guide/viewsets/#viewset-actions\n// -----------------------------------------------------------------------------\n\n// Create\n\nexport type CreateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Result<M, MFields>\n\nexport type CreateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n> = Arg<M, RequiredFields, OptionalFields>\n\nexport type BulkCreateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n ExtraFields extends Fields = Fields,\n> = Array<Result<M, MFields> & ExtraFields>\n\nexport type BulkCreateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n ExtraFields extends Fields = Fields,\n> = Array<Arg<M, RequiredFields, OptionalFields> & ExtraFields>\n\n// Read\n\nexport type RetrieveResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Result<M, MFields>\n\nexport type RetrieveArg<M extends Model<any>> = M[\"id\"]\n\nexport interface ListResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n ExtraFields extends Fields = Fields,\n> {\n count: number\n offset: number\n limit: number\n max_limit: number\n data: Array<Result<M, MFields> & ExtraFields>\n}\n\nexport type ListArg<Filters extends Fields = Fields> = {\n limit: number\n offset: number\n} & Partial<Omit<Filters, \"limit\" | \"offset\">>\n\n// Update\n\nexport type UpdateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n> = Result<M, MFields>\n\ntype UpdateWithBody<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields>,\n> = Pick<M, \"id\"> & Arg<M, RequiredFields, OptionalFields>\n\n// NOTE: Sometimes update does not require a body. For example, if calling the\n// \"refresh\" action on an invitation object updates the expiry date to be 24\n// hours from now. In this case, you only need to pass the ID of the object.\nexport type UpdateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\"> = never,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n> = [RequiredFields] extends [never]\n ? [OptionalFields] extends [never]\n ? M[\"id\"]\n : UpdateWithBody<M, RequiredFields, OptionalFields>\n : UpdateWithBody<M, RequiredFields, OptionalFields>\n\nexport type BulkUpdateResult<\n M extends Model<any>,\n MFields extends keyof Omit<M, \"id\"> = never,\n ExtraFields extends Fields = Fields,\n> = Array<Result<M, MFields> & ExtraFields>\n\nexport type BulkUpdateArg<\n M extends Model<any>,\n RequiredFields extends keyof Omit<M, \"id\">,\n OptionalFields extends keyof Omit<M, \"id\" | RequiredFields> = never,\n ExtraFields extends Fields = Fields,\n> = Record<M[\"id\"], Arg<M, RequiredFields, OptionalFields> & ExtraFields>\n\n// Delete\n\nexport type DestroyResult = null\n\nexport type DestroyArg<M extends Model<any>> = M[\"id\"]\n\nexport type BulkDestroyResult = null\n\nexport type BulkDestroyArg<M extends Model<any>> = Array<M[\"id\"]>\n\n// -----------------------------------------------------------------------------\n// Functions\n// -----------------------------------------------------------------------------\n\nexport function buildUrl(\n url: string,\n params: {\n search?: Fields\n url?: Fields\n },\n): string {\n if (params.url) {\n Object.entries(params.url).forEach(([key, value]) => {\n url = url.replace(`<${key}>`, String(value))\n })\n }\n\n if (params.search) {\n const searchParams: string[][] = []\n for (const key in params.search) {\n const values = params.search[key]\n if (values === undefined) continue\n\n if (Array.isArray(values)) {\n for (const value of values) searchParams.push([key, String(value)])\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n searchParams.push([key, String(values)])\n }\n }\n\n if (searchParams.length !== 0) {\n url += `?${new URLSearchParams(searchParams).toString()}`\n }\n }\n\n return url\n}\n\nexport function isModelId(value: unknown): boolean {\n return typeof value === \"number\" || typeof value === \"string\"\n}\n\nexport function listTag<Type extends string>(type: Type): Tag<Type> {\n return { type, id: \"LIST\" }\n}\n\nexport type TagDataOptions = Partial<{\n includeListTag: boolean\n argKeysAreIds: boolean\n id: string\n}>\n\nexport function tagData<Type extends string, M extends Model<any>>(\n type: Type,\n options?: TagDataOptions,\n): (\n result:\n | Result<M, any>\n | Array<Result<M, any>>\n | ListResult<M, any>\n | null\n | undefined,\n error: FetchBaseQueryError | undefined,\n arg:\n | Arg<M, any>\n | Array<Arg<M, any>>\n | Record<M[\"id\"], Arg<M, any>>\n | ListArg<any>\n | Array<M[\"id\"]>\n | string\n | number\n | undefined,\n) => Array<Tag<Type>> {\n const {\n includeListTag = false,\n argKeysAreIds = false,\n id = \"id\",\n } = options || {}\n\n function tags(\n ids: ModelId[],\n list: boolean = includeListTag,\n ): Array<Tag<Type>> {\n const tags = ids.map(id => ({ type, id: String(id) }))\n if (list) tags.push(listTag(type))\n return tags\n }\n\n function getModelId(result: Result<M, any>) {\n return getNestedProperty(result, id) as ModelId\n }\n\n return (result, error, arg) => {\n if (!error) {\n if (arg) {\n // The argument is an ID.\n if (isModelId(arg)) return tags([arg as ModelId])\n\n // The argument is an array of IDs.\n if (Array.isArray(arg)) {\n if (arg.length && isModelId(arg[0])) {\n return tags(arg as Array<M[\"id\"]>)\n }\n }\n // The argument is an object that contains the id field.\n else if (typeof arg === \"object\" && argKeysAreIds) {\n return tags(Object.keys(arg as Record<M[\"id\"], any>))\n }\n }\n\n if (result) {\n // The result is an array of models that contain the id field.\n if (Array.isArray(result)) {\n return tags(result.map(getModelId))\n }\n\n // The result is a model that contains the id field.\n if (getModelId(result as Result<M, any>) !== undefined) {\n return tags([getModelId(result as Result<M, any>)])\n }\n\n // The result is a list that contains an array of models that contain\n // the id field.\n return tags((result as ListResult<M, any>).data.map(getModelId), true)\n }\n }\n\n return tags([])\n }\n}\n\nexport function modelUrls(list: string, detail: string) {\n if (list === detail) throw Error(\"List and detail are the same.\")\n\n return { list, detail }\n}\n\nexport type HandleQueryStateOptions = Partial<{\n loading: ReactNode\n error: ReactNode\n}>\n\nexport function handleResultState<QueryArg, ResultType>(\n result:\n | TypedUseQueryHookResult<ResultType, QueryArg, any>\n | TypedUseQueryStateResult<ResultType, QueryArg, any>\n | TypedUseMutationResult<ResultType, QueryArg, any>,\n children: (data: NonNullable<ResultType>) => ReactNode,\n options?: HandleQueryStateOptions,\n): ReactNode {\n const { data, isLoading, isSuccess } = result\n const error = result.error as string | undefined\n\n const {\n loading: loadingNode = <CircularProgress />,\n error: errorNode = <SyncError />,\n } = options || {}\n\n // An error occurred.\n if (error) {\n console.error(error)\n return errorNode\n }\n\n // Busy calling the API.\n if (isLoading) return loadingNode\n\n // Called the API and got data.\n if (data) return children(data)\n\n // Called the API and did not get data.\n if (isSuccess) throw Error(\"Expected to get data from API but got nothing.\")\n\n // Have yet to call the API.\n return loadingNode\n}\n\nexport function isSafeHttpMethod(method: string) {\n // https://datatracker.ietf.org/doc/html/rfc9110.html#section-9.2.1\n return [\"GET\", \"HEAD\", \"OPTIONS\", \"TRACE\"].includes(method.toUpperCase())\n}\n"],"names":["SyncError","jsxs","Stack","jsx","SyncProblemIcon","Typography","buildUrl","url","params","key","value","searchParams","values","isModelId","listTag","type","tagData","options","includeListTag","argKeysAreIds","id","tags","ids","list","getModelId","result","getNestedProperty","error","arg","modelUrls","detail","handleResultState","children","data","isLoading","isSuccess","loadingNode","CircularProgress","errorNode","isSafeHttpMethod","method"],"mappings":";;;;;;AAMA,MAAMA,IAAgC,MACpCC,gBAAAA,EAAAA,KAACC,KAAM,YAAW,UAAS,cAAa,UACtC,UAAA;AAAA,EAAAC,gBAAAA,EAAAA,IAACC,GAAA,EAAgB,OAAM,QAAA,CAAQ;AAAA,EAC/BD,gBAAAA,EAAAA,IAACE,GAAA,EAAW,OAAM,cAAa,UAAA,sBAAA,CAAmB;AAAA,EAAA,CACpD;ACuJK,SAASC,EACdC,GACAC,GAIQ;AAOR,MANIA,EAAO,OACT,OAAO,QAAQA,EAAO,GAAG,EAAE,QAAQ,CAAC,CAACC,GAAKC,CAAK,MAAM;AACnD,IAAAH,IAAMA,EAAI,QAAQ,IAAIE,CAAG,KAAK,OAAOC,CAAK,CAAC;AAAA,EAC7C,CAAC,GAGCF,EAAO,QAAQ;AACjB,UAAMG,IAA2B,CAAA;AACjC,eAAWF,KAAOD,EAAO,QAAQ;AAC/B,YAAMI,IAASJ,EAAO,OAAOC,CAAG;AAChC,UAAIG,MAAW;AAEf,YAAI,MAAM,QAAQA,CAAM;AACtB,qBAAWF,KAASE,EAAQ,CAAAD,EAAa,KAAK,CAACF,GAAK,OAAOC,CAAK,CAAC,CAAC;AAAA;AAGlE,UAAAC,EAAa,KAAK,CAACF,GAAK,OAAOG,CAAM,CAAC,CAAC;AAAA,IAE3C;AAEA,IAAID,EAAa,WAAW,MAC1BJ,KAAO,IAAI,IAAI,gBAAgBI,CAAY,EAAE,UAAU;AAAA,EAE3D;AAEA,SAAOJ;AACT;AAEO,SAASM,EAAUH,GAAyB;AACjD,SAAO,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACvD;AAEO,SAASI,EAA6BC,GAAuB;AAClE,SAAO,EAAE,MAAAA,GAAM,IAAI,OAAA;AACrB;AAQO,SAASC,EACdD,GACAE,GAkBoB;AACpB,QAAM;AAAA,IACJ,gBAAAC,IAAiB;AAAA,IACjB,eAAAC,IAAgB;AAAA,IAChB,IAAAC,IAAK;AAAA,EAAA,IACHH,KAAW,CAAA;AAEf,WAASI,EACPC,GACAC,IAAgBL,GACE;AAClB,UAAMG,IAAOC,EAAI,IAAI,CAAAF,OAAO,EAAE,MAAAL,GAAM,IAAI,OAAOK,CAAE,EAAA,EAAI;AACrD,WAAIG,KAAMF,EAAK,KAAKP,EAAQC,CAAI,CAAC,GAC1BM;AAAAA,EACT;AAEA,WAASG,EAAWC,GAAwB;AAC1C,WAAOC,EAAkBD,GAAQL,CAAE;AAAA,EACrC;AAEA,SAAO,CAACK,GAAQE,GAAOC,MAAQ;AAC7B,QAAI,CAACD,GAAO;AACV,UAAIC,GAAK;AAEP,YAAIf,EAAUe,CAAG,UAAUP,EAAK,CAACO,CAAc,CAAC;AAGhD,YAAI,MAAM,QAAQA,CAAG;AACnB,cAAIA,EAAI,UAAUf,EAAUe,EAAI,CAAC,CAAC;AAChC,mBAAOP,EAAKO,CAAqB;AAAA,mBAI5B,OAAOA,KAAQ,YAAYT;AAClC,iBAAOE,EAAK,OAAO,KAAKO,CAA2B,CAAC;AAAA,MAExD;AAEA,UAAIH;AAEF,eAAI,MAAM,QAAQA,CAAM,IACfJ,EAAKI,EAAO,IAAID,CAAU,CAAC,IAIhCA,EAAWC,CAAwB,MAAM,SACpCJ,EAAK,CAACG,EAAWC,CAAwB,CAAC,CAAC,IAK7CJ,EAAMI,EAA8B,KAAK,IAAID,CAAU,GAAG,EAAI;AAAA,IAEzE;AAEA,WAAOH,EAAK,CAAA,CAAE;AAAA,EAChB;AACF;AAEO,SAASQ,EAAUN,GAAcO,GAAgB;AACtD,MAAIP,MAASO,EAAQ,OAAM,MAAM,+BAA+B;AAEhE,SAAO,EAAE,MAAAP,GAAM,QAAAO,EAAA;AACjB;AAOO,SAASC,EACdN,GAIAO,GACAf,GACW;AACX,QAAM,EAAE,MAAAgB,GAAM,WAAAC,GAAW,WAAAC,EAAA,IAAcV,GACjCE,IAAQF,EAAO,OAEf;AAAA,IACJ,SAASW,IAAcjC,gBAAAA,MAACkC,GAAA,CAAA,CAAiB;AAAA,IACzC,OAAOC,IAAYnC,gBAAAA,MAACH,GAAA,CAAA,CAAU;AAAA,EAAA,IAC5BiB,KAAW,CAAA;AAGf,MAAIU;AACF,mBAAQ,MAAMA,CAAK,GACZW;AAIT,MAAIJ,EAAW,QAAOE;AAGtB,MAAIH,EAAM,QAAOD,EAASC,CAAI;AAG9B,MAAIE,EAAW,OAAM,MAAM,gDAAgD;AAG3E,SAAOC;AACT;AAEO,SAASG,EAAiBC,GAAgB;AAE/C,SAAO,CAAC,OAAO,QAAQ,WAAW,OAAO,EAAE,SAASA,EAAO,aAAa;AAC1E;"}
@@ -1,2 +1,2 @@
1
- "use strict";const f=require("./jsx-runtime-Dszzpdy0.cjs"),d=require("@mui/material");require("react");const y=require("./utils/general.cjs.js");require("yup");const x=require("@mui/icons-material"),h=()=>f.jsxRuntimeExports.jsxs(d.Stack,{alignItems:"center",alignContent:"center",children:[f.jsxRuntimeExports.jsx(x.SyncProblem,{color:"error"}),f.jsxRuntimeExports.jsx(d.Typography,{color:"error.main",children:"Failed to sync data"})]});function S(r,t){if(t.url&&Object.entries(t.url).forEach(([o,s])=>{r=r.replace(`<${o}>`,String(s))}),t.search){const o=[];for(const s in t.search){const c=t.search[s];if(c!==void 0)if(Array.isArray(c))for(const i of c)o.push([s,String(i)]);else o.push([s,String(c)])}o.length!==0&&(r+=`?${new URLSearchParams(o).toString()}`)}return r}function l(r){return typeof r=="number"||typeof r=="string"}function g(r){return{type:r,id:"LIST"}}function m(r,t){const{includeListTag:o=!1,argKeysAreIds:s=!1,id:c="id"}=t||{};function i(e,u=o){const n=e.map(p=>({type:r,id:String(p)}));return u&&n.push(g(r)),n}function a(e){return y.getNestedProperty(e,c)}return(e,u,n)=>{if(!u){if(n){if(l(n))return i([n]);if(Array.isArray(n)){if(n.length&&l(n[0]))return i(n)}else if(typeof n=="object"&&s)return i(Object.keys(n))}if(e)return Array.isArray(e)?i(e.map(a)):a(e)!==void 0?i([a(e)]):i(e.data.map(a),!0)}return i([])}}function j(r,t){if(r===t)throw Error("List and detail are the same.");return{list:r,detail:t}}function E(r,t,o){const{data:s,isLoading:c,isSuccess:i}=r,a=r.error,{loading:e=f.jsxRuntimeExports.jsx(d.CircularProgress,{}),error:u=f.jsxRuntimeExports.jsx(h,{})}=o||{};if(a)return console.error(a),u;if(c)return e;if(s)return t(s);if(i)throw Error("Expected to get data from API but got nothing.");return e}function A(r){return["GET","HEAD","OPTIONS","TRACE"].includes(r.toUpperCase())}exports.SyncError=h;exports.buildUrl=S;exports.handleResultState=E;exports.isModelId=l;exports.isSafeHttpMethod=A;exports.listTag=g;exports.modelUrls=j;exports.tagData=m;
2
- //# sourceMappingURL=api-CaeeoZaI.cjs.map
1
+ "use strict";const f=require("./jsx-runtime-B2pbW5Fp.cjs"),d=require("@mui/material");require("react");const y=require("./utils/general.cjs.js");require("yup");const x=require("@mui/icons-material"),h=()=>f.jsxRuntimeExports.jsxs(d.Stack,{alignItems:"center",alignContent:"center",children:[f.jsxRuntimeExports.jsx(x.SyncProblem,{color:"error"}),f.jsxRuntimeExports.jsx(d.Typography,{color:"error.main",children:"Failed to sync data"})]});function S(r,t){if(t.url&&Object.entries(t.url).forEach(([o,s])=>{r=r.replace(`<${o}>`,String(s))}),t.search){const o=[];for(const s in t.search){const c=t.search[s];if(c!==void 0)if(Array.isArray(c))for(const i of c)o.push([s,String(i)]);else o.push([s,String(c)])}o.length!==0&&(r+=`?${new URLSearchParams(o).toString()}`)}return r}function l(r){return typeof r=="number"||typeof r=="string"}function g(r){return{type:r,id:"LIST"}}function m(r,t){const{includeListTag:o=!1,argKeysAreIds:s=!1,id:c="id"}=t||{};function i(e,u=o){const n=e.map(p=>({type:r,id:String(p)}));return u&&n.push(g(r)),n}function a(e){return y.getNestedProperty(e,c)}return(e,u,n)=>{if(!u){if(n){if(l(n))return i([n]);if(Array.isArray(n)){if(n.length&&l(n[0]))return i(n)}else if(typeof n=="object"&&s)return i(Object.keys(n))}if(e)return Array.isArray(e)?i(e.map(a)):a(e)!==void 0?i([a(e)]):i(e.data.map(a),!0)}return i([])}}function j(r,t){if(r===t)throw Error("List and detail are the same.");return{list:r,detail:t}}function E(r,t,o){const{data:s,isLoading:c,isSuccess:i}=r,a=r.error,{loading:e=f.jsxRuntimeExports.jsx(d.CircularProgress,{}),error:u=f.jsxRuntimeExports.jsx(h,{})}=o||{};if(a)return console.error(a),u;if(c)return e;if(s)return t(s);if(i)throw Error("Expected to get data from API but got nothing.");return e}function A(r){return["GET","HEAD","OPTIONS","TRACE"].includes(r.toUpperCase())}exports.SyncError=h;exports.buildUrl=S;exports.handleResultState=E;exports.isModelId=l;exports.isSafeHttpMethod=A;exports.listTag=g;exports.modelUrls=j;exports.tagData=m;
2
+ //# sourceMappingURL=api-CAH3GT1O.cjs.map