@hot-updater/console 0.36.6 → 1.0.0-rc.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 (266) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/AnalyticsCapabilityContext-BCke57-7.js +1 -0
  3. package/.output/public/assets/BundleActivityChart-CnsBe_1J.js +42 -0
  4. package/.output/public/assets/BundleIdDisplay-Dky75zLU.js +1 -0
  5. package/.output/public/assets/alert-C-1KvDW8.js +1 -0
  6. package/.output/public/assets/analytics-Bqz0c-BT.js +1 -0
  7. package/.output/public/assets/analytics-api-CJdrTLLO.js +1 -0
  8. package/.output/public/assets/api-B_Rh-uzC.js +1 -0
  9. package/.output/public/assets/api-keys-BurCFhzH.js +1 -0
  10. package/.output/public/assets/api-keys-api-BEDJdQg3.js +1 -0
  11. package/.output/public/assets/badge-Bf0fZ-Gx.js +1 -0
  12. package/.output/public/assets/chart-no-axes-combined-FaYMGmQS.js +1 -0
  13. package/.output/public/assets/createServerFn-gM2-LFBy.js +3 -0
  14. package/.output/public/assets/dialog-BS60BRr2.js +1 -0
  15. package/.output/public/assets/dist-DspNKfMj.js +1 -0
  16. package/.output/public/assets/download-O-yNBc9H.js +1 -0
  17. package/.output/public/assets/field-Buq148-A.js +1 -0
  18. package/.output/public/assets/index-kFhd2S78.js +10 -0
  19. package/.output/public/assets/installations-BrQ-od41.js +2 -0
  20. package/.output/public/assets/installations-CGlZ3ROz.js +1 -0
  21. package/.output/public/assets/lazyRouteComponent-rPzgA7S-.js +1 -0
  22. package/.output/public/assets/loader-circle-DCYF-wJl.js +1 -0
  23. package/.output/public/assets/preload-helper-TKOBYGYD.js +1 -0
  24. package/.output/public/assets/refresh-cw-n8XYbPPj.js +1 -0
  25. package/.output/public/assets/routes-CrdokJ80.js +1 -0
  26. package/.output/public/assets/routes-DcQnVajO.js +2 -0
  27. package/.output/public/assets/search-DLhbWw3W.js +1 -0
  28. package/.output/public/assets/shield-check-DE_hVuHu.js +1 -0
  29. package/.output/public/assets/signing-HRexfjsH.js +1 -0
  30. package/.output/public/assets/styles-eB4EtvFS.css +2 -0
  31. package/.output/public/assets/table-D8CLieHX.js +1 -0
  32. package/.output/public/assets/textarea-YJLTVAoq.js +1 -0
  33. package/.output/public/assets/useMutation-JsGVjQMY.js +1 -0
  34. package/.output/public/assets/useOpenInteractionType-4cRD5xO0.js +1 -0
  35. package/.output/server/__23tanstack-start-server-fn-resolver-DBP9TQ7K.mjs +146 -0
  36. package/.output/server/_libs/@base-ui/react+[...].mjs +16124 -0
  37. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +1554 -0
  38. package/.output/server/_libs/@tanstack/react-router+[...].mjs +41 -10
  39. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +132 -0
  40. package/.output/server/_libs/d3-array.mjs +231 -0
  41. package/.output/server/_libs/d3-color.mjs +330 -0
  42. package/.output/server/_libs/d3-format.mjs +252 -0
  43. package/.output/server/_libs/d3-interpolate.mjs +207 -0
  44. package/.output/server/_libs/d3-path.mjs +77 -0
  45. package/.output/server/_libs/d3-scale+[...].mjs +1907 -0
  46. package/.output/server/_libs/d3-shape.mjs +818 -0
  47. package/.output/server/_libs/decimal.js-light.mjs +884 -0
  48. package/.output/server/_libs/es-toolkit.mjs +1134 -0
  49. package/.output/server/_libs/eventemitter3.mjs +236 -0
  50. package/.output/server/_libs/immer.mjs +532 -0
  51. package/.output/server/_libs/lucide-react.mjs +141 -13
  52. package/.output/server/_libs/next-themes.mjs +2 -2
  53. package/.output/server/_libs/react-redux+[...].mjs +205 -0
  54. package/.output/server/_libs/recharts+[...].mjs +14117 -0
  55. package/.output/server/_libs/sonner.mjs +2 -2
  56. package/.output/server/_libs/tanstack__query-core.mjs +114 -1
  57. package/.output/server/_libs/tanstack__react-query.mjs +3 -4
  58. package/.output/server/_runtime.mjs +10 -1
  59. package/.output/server/_ssr/AnalyticsCapabilityContext-ui4DX8GO.mjs +15 -0
  60. package/.output/server/_ssr/BundleActivityChart-BiB9ZORH.mjs +288 -0
  61. package/.output/server/_ssr/BundleIdDisplay-Czk6iR6p.mjs +13 -0
  62. package/.output/server/_ssr/alert-Dim3MGY5.mjs +86 -0
  63. package/.output/server/_ssr/analytics-DtMTn8fn.mjs +858 -0
  64. package/.output/server/_ssr/analytics-api-Cg1M5v_H.mjs +71 -0
  65. package/.output/server/_ssr/analytics-input-fRRRn0uA.mjs +96 -0
  66. package/.output/server/_ssr/analytics-rpc-DY5uXvHT.mjs +155 -0
  67. package/.output/server/_ssr/api-BTSv1tZb.mjs +282 -0
  68. package/.output/server/_ssr/api-keys-BnM_o2nS.mjs +300 -0
  69. package/.output/server/_ssr/api-keys-api-CIywsSF5.mjs +60 -0
  70. package/.output/server/_ssr/api-keys-rpc-BSp1wkIV.mjs +136 -0
  71. package/.output/server/_ssr/api-rpc-cG5wd_tO.mjs +1468 -0
  72. package/.output/server/_ssr/auth-BF8mbAgF.mjs +21 -0
  73. package/.output/server/_ssr/auth-rpc-BrJ6obHJ.mjs +24 -0
  74. package/.output/server/_ssr/auth.server-DwKoZoQM.mjs +50 -0
  75. package/.output/server/_ssr/badge-DCxbEeof.mjs +26 -0
  76. package/.output/server/_ssr/bundle-signing-rpc-COoQhW8E.mjs +16 -0
  77. package/.output/server/_ssr/bundle-signing.server-D5u8KkMp.mjs +51 -0
  78. package/.output/server/_ssr/config-Dv8qLDZ0.mjs +13 -0
  79. package/.output/server/_ssr/config.server-DEiLhKmy.mjs +361 -0
  80. package/.output/server/_ssr/{createServerFn-DzU0k62V.mjs → createServerFn-B2hcXoPM.mjs} +1 -1
  81. package/.output/server/_ssr/createServerRpc-DB29C_5p.mjs +12 -0
  82. package/.output/server/_ssr/{sidebar-Cv_H0_Jv.mjs → createSsrRpc-9P0S0lJ3.mjs} +68 -50
  83. package/.output/server/_ssr/databaseRows-CwbNwYSl.mjs +166 -0
  84. package/.output/server/_ssr/deleteBundle-Cu_XOMt0.mjs +66 -0
  85. package/.output/server/_ssr/dialog-CQuRMNZ4.mjs +170 -0
  86. package/.output/server/_ssr/dist-BVSLTpoP.mjs +250 -0
  87. package/.output/server/_ssr/downloadBundle-CNnYxYO2.mjs +24 -0
  88. package/.output/server/_ssr/{empty-plugin-adapters-B4HCzgmM.mjs → empty-plugin-adapters-B5QvGpEl.mjs} +1 -1
  89. package/.output/server/_ssr/field-DRIXKjZG.mjs +74 -0
  90. package/.output/server/_ssr/{getBundleChildren-CVtSiH5t.mjs → getBundleChildren-BcRMFoDF.mjs} +10 -18
  91. package/.output/server/_ssr/installations-B-azgAvX.mjs +19 -0
  92. package/.output/server/_ssr/installations-Ctvzp2JH.mjs +535 -0
  93. package/.output/server/_ssr/router-C-KUBfOi.mjs +513 -0
  94. package/.output/server/_ssr/routes-BM4ht9jb.mjs +2286 -0
  95. package/.output/server/_ssr/routes-Z7TwC6nC.mjs +37 -0
  96. package/.output/server/_ssr/runtime.server-awTLiiXW.mjs +527 -0
  97. package/.output/server/_ssr/server-BjzmvXnO.mjs +7468 -0
  98. package/.output/server/_ssr/signing-k8GxyBDF.mjs +202 -0
  99. package/.output/server/_ssr/ssr.mjs +4 -5740
  100. package/.output/server/_ssr/start-DpViQGnt.mjs +4 -0
  101. package/.output/server/_ssr/table-v1yCvYo7.mjs +53 -0
  102. package/.output/server/_ssr/textarea-DYHnskhb.mjs +14 -0
  103. package/.output/server/_ssr/uuidv7-BbJ-9D_I.mjs +31 -0
  104. package/.output/server/_tanstack-start-manifest_v-CH4StzJu.mjs +108 -0
  105. package/.output/server/index.mjs +249 -46
  106. package/README.md +29 -8
  107. package/lib/index.d.mts +36 -0
  108. package/lib/index.mjs +4 -0
  109. package/lib/vite-internal.mjs +127 -0
  110. package/lib/vite.d.mts +10 -0
  111. package/lib/vite.mjs +5 -0
  112. package/package.json +51 -29
  113. package/public/apple-touch-icon.png +0 -0
  114. package/public/favicon-16x16.png +0 -0
  115. package/public/favicon-32x32.png +0 -0
  116. package/public/favicon.ico +0 -0
  117. package/public/logo.svg +1 -0
  118. package/public/manifest.json +30 -0
  119. package/public/robots.txt +3 -0
  120. package/src/components/AppSidebar.tsx +159 -0
  121. package/src/components/BundleIdDisplay.tsx +18 -0
  122. package/src/components/ChannelBadge.tsx +31 -0
  123. package/src/components/ConsoleAccessPage.tsx +122 -0
  124. package/src/components/EnabledStatusIcon.tsx +54 -0
  125. package/src/components/HashValueDisplay.tsx +85 -0
  126. package/src/components/HotUpdaterLogo.tsx +30 -0
  127. package/src/components/NotFoundPage.tsx +33 -0
  128. package/src/components/PlatformIcon.tsx +39 -0
  129. package/src/components/RolloutPercentageBadge.tsx +28 -0
  130. package/src/components/ThemeProvider.tsx +116 -0
  131. package/src/components/TimestampDisplay.tsx +41 -0
  132. package/src/components/features/analytics/ActivityChart.tsx +150 -0
  133. package/src/components/features/analytics/AnalyticsCapabilityContext.tsx +24 -0
  134. package/src/components/features/analytics/AnalyticsControls.tsx +115 -0
  135. package/src/components/features/analytics/AnalyticsErrorAlert.tsx +21 -0
  136. package/src/components/features/analytics/AnalyticsOverview.tsx +208 -0
  137. package/src/components/features/analytics/BundleDistribution.tsx +133 -0
  138. package/src/components/features/analytics/BundleSelector.tsx +114 -0
  139. package/src/components/features/analytics/InstallationHistoryCard.tsx +248 -0
  140. package/src/components/features/analytics/InstallationMatchesCard.tsx +132 -0
  141. package/src/components/features/analytics/InstallationPageHeader.tsx +138 -0
  142. package/src/components/features/analytics/InstallationPagination.tsx +48 -0
  143. package/src/components/features/analytics/InstallationSearch.tsx +230 -0
  144. package/src/components/features/analytics/UpdateOutcomes.tsx +147 -0
  145. package/src/components/features/api-keys/ApiKeysPage.tsx +377 -0
  146. package/src/components/features/bundles/BundleActivityChart.tsx +193 -0
  147. package/src/components/features/bundles/BundleAnalyticsSummary.tsx +123 -0
  148. package/src/components/features/bundles/BundleChildrenPanel.tsx +201 -0
  149. package/src/components/features/bundles/BundleMetadata.tsx +136 -0
  150. package/src/components/features/bundles/RolloutCohortsDialog.tsx +201 -0
  151. package/src/components/features/channels/ChannelManagementDialog.tsx +228 -0
  152. package/src/components/features/releases/ReleaseEditorSheet.tsx +879 -0
  153. package/src/components/features/releases/ReleaseStateBadge.tsx +20 -0
  154. package/src/components/features/signing/BundleSigningPage.tsx +247 -0
  155. package/src/components/ui/alert-dialog.tsx +185 -0
  156. package/src/components/ui/alert.tsx +76 -0
  157. package/src/components/ui/badge.tsx +49 -0
  158. package/src/components/ui/button.tsx +58 -0
  159. package/src/components/ui/card.tsx +89 -0
  160. package/src/components/ui/chart.tsx +371 -0
  161. package/src/components/ui/combobox.tsx +303 -0
  162. package/src/components/ui/dialog.tsx +156 -0
  163. package/src/components/ui/dropdown-menu.tsx +270 -0
  164. package/src/components/ui/field.tsx +235 -0
  165. package/src/components/ui/input-group.tsx +147 -0
  166. package/src/components/ui/input.tsx +19 -0
  167. package/src/components/ui/label.tsx +25 -0
  168. package/src/components/ui/progress.tsx +84 -0
  169. package/src/components/ui/select.tsx +205 -0
  170. package/src/components/ui/separator.tsx +23 -0
  171. package/src/components/ui/sheet.tsx +132 -0
  172. package/src/components/ui/sidebar.tsx +779 -0
  173. package/src/components/ui/skeleton.tsx +13 -0
  174. package/src/components/ui/slider.tsx +56 -0
  175. package/src/components/ui/sonner.tsx +45 -0
  176. package/src/components/ui/switch.tsx +25 -0
  177. package/src/components/ui/table.tsx +114 -0
  178. package/src/components/ui/textarea.tsx +18 -0
  179. package/src/components/ui/toggle-group.tsx +89 -0
  180. package/src/components/ui/toggle.tsx +43 -0
  181. package/src/components/ui/tooltip.tsx +66 -0
  182. package/src/hooks/use-mobile.ts +30 -0
  183. package/src/index.ts +48 -0
  184. package/src/lib/analytics-api.ts +145 -0
  185. package/src/lib/analytics-error.ts +19 -0
  186. package/src/lib/analytics-input.ts +187 -0
  187. package/src/lib/analytics-overview.ts +170 -0
  188. package/src/lib/analytics-rpc.ts +218 -0
  189. package/src/lib/api-keys-api.ts +69 -0
  190. package/src/lib/api-keys-rpc.ts +87 -0
  191. package/src/lib/api-rpc.ts +478 -0
  192. package/src/lib/api.ts +444 -0
  193. package/src/lib/auth-rpc.ts +16 -0
  194. package/src/lib/bundle-signing-api.ts +14 -0
  195. package/src/lib/bundle-signing-rpc.ts +16 -0
  196. package/src/lib/constants.ts +1 -0
  197. package/src/lib/git.ts +51 -0
  198. package/src/lib/server/auth.server.ts +43 -0
  199. package/src/lib/server/bundle-signing.server.ts +100 -0
  200. package/src/lib/server/config.server.ts +109 -0
  201. package/src/lib/server/console-runtime.server.ts +70 -0
  202. package/src/lib/server/deleteBundle.ts +145 -0
  203. package/src/lib/server/downloadBundle.ts +46 -0
  204. package/src/lib/server/getBundleChildren.ts +130 -0
  205. package/src/lib/server/listReleases.ts +61 -0
  206. package/src/lib/server/releaseActivity.ts +27 -0
  207. package/src/lib/server/releaseReachability.ts +95 -0
  208. package/src/lib/server/runtime.server.ts +172 -0
  209. package/src/lib/utils.ts +9 -0
  210. package/src/logo.svg +1 -0
  211. package/src/routeTree.gen.ts +199 -0
  212. package/src/router.tsx +21 -0
  213. package/src/routes/-installations-search.ts +19 -0
  214. package/src/routes/-releases-search.ts +74 -0
  215. package/src/routes/__root.tsx +174 -0
  216. package/src/routes/analytics.tsx +139 -0
  217. package/src/routes/api/auth/$.ts +19 -0
  218. package/src/routes/api/bundles/$bundleId/download.ts +17 -0
  219. package/src/routes/api-keys.tsx +37 -0
  220. package/src/routes/index.tsx +982 -0
  221. package/src/routes/installations.tsx +194 -0
  222. package/src/routes/signing.tsx +37 -0
  223. package/src/styles.css +152 -0
  224. package/src/virtual-modules.d.ts +21 -0
  225. package/src/vite-env.d.ts +1 -0
  226. package/src/vite-internal.ts +195 -0
  227. package/src/vite.ts +12 -0
  228. package/.output/public/assets/dist-DJX53faP.js +0 -3
  229. package/.output/public/assets/index-Iylis5kY.js +0 -10
  230. package/.output/public/assets/routes-HT21hs0C.js +0 -54
  231. package/.output/public/assets/styles-C0Re4quB.css +0 -2
  232. package/.output/server/__23tanstack-start-server-fn-resolver-CgwgZ0-i.mjs +0 -66
  233. package/.output/server/_libs/@floating-ui/core+[...].mjs +0 -698
  234. package/.output/server/_libs/@floating-ui/dom+[...].mjs +0 -644
  235. package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +0 -839
  236. package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +0 -2138
  237. package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +0 -308
  238. package/.output/server/_libs/@radix-ui/react-select+[...].mjs +0 -1038
  239. package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +0 -196
  240. package/.output/server/_libs/@tanstack/form-core+[...].mjs +0 -3228
  241. package/.output/server/_libs/@tanstack/react-form+[...].mjs +0 -430
  242. package/.output/server/_libs/@tanstack/react-table+[...].mjs +0 -2382
  243. package/.output/server/_libs/radix-ui__number.mjs +0 -6
  244. package/.output/server/_libs/radix-ui__primitive.mjs +0 -9
  245. package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
  246. package/.output/server/_libs/radix-ui__react-collection.mjs +0 -78
  247. package/.output/server/_libs/radix-ui__react-direction.mjs +0 -13
  248. package/.output/server/_libs/radix-ui__react-label.mjs +0 -22
  249. package/.output/server/_libs/radix-ui__react-separator.mjs +0 -30
  250. package/.output/server/_libs/radix-ui__react-slider.mjs +0 -510
  251. package/.output/server/_libs/radix-ui__react-switch.mjs +0 -157
  252. package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -493
  253. package/.output/server/_ssr/api-rpc-BIbDUKSz.mjs +0 -292
  254. package/.output/server/_ssr/config.server-BSS366KT.mjs +0 -41
  255. package/.output/server/_ssr/deleteBundle-BgbZTtpW.mjs +0 -141
  256. package/.output/server/_ssr/dist-KboydRVk.mjs +0 -120
  257. package/.output/server/_ssr/router-C3hqEy3k.mjs +0 -307
  258. package/.output/server/_ssr/routes-B0lQvvlC.mjs +0 -3048
  259. package/.output/server/_ssr/start-02sLteYG.mjs +0 -4
  260. package/.output/server/_ssr/storageProfile-FVkjPoGb.mjs +0 -9
  261. package/.output/server/_tanstack-start-manifest_v-Bpx52WOU.mjs +0 -20
  262. package/.output/server/node_modules/tslib/modules/index.js +0 -70
  263. package/.output/server/node_modules/tslib/modules/package.json +0 -3
  264. package/.output/server/node_modules/tslib/package.json +0 -47
  265. package/.output/server/node_modules/tslib/tslib.js +0 -484
  266. package/.output/server/package.json +0 -9
@@ -0,0 +1,1554 @@
1
+ //#region ../../node_modules/.pnpm/redux@5.0.1/node_modules/redux/dist/redux.mjs
2
+ function formatProdErrorMessage$1(code) {
3
+ return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
4
+ }
5
+ var symbol_observable_default = typeof Symbol === "function" && Symbol.observable || "@@observable";
6
+ var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
7
+ var actionTypes_default = {
8
+ INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
9
+ REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
10
+ PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
11
+ };
12
+ function isPlainObject$1(obj) {
13
+ if (typeof obj !== "object" || obj === null) return false;
14
+ let proto = obj;
15
+ while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto);
16
+ return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
17
+ }
18
+ function createStore(reducer, preloadedState, enhancer) {
19
+ if (typeof reducer !== "function") throw new Error(formatProdErrorMessage$1(2));
20
+ if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") throw new Error(formatProdErrorMessage$1(0));
21
+ if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
22
+ enhancer = preloadedState;
23
+ preloadedState = void 0;
24
+ }
25
+ if (typeof enhancer !== "undefined") {
26
+ if (typeof enhancer !== "function") throw new Error(formatProdErrorMessage$1(1));
27
+ return enhancer(createStore)(reducer, preloadedState);
28
+ }
29
+ let currentReducer = reducer;
30
+ let currentState = preloadedState;
31
+ let currentListeners = /* @__PURE__ */ new Map();
32
+ let nextListeners = currentListeners;
33
+ let listenerIdCounter = 0;
34
+ let isDispatching = false;
35
+ function ensureCanMutateNextListeners() {
36
+ if (nextListeners === currentListeners) {
37
+ nextListeners = /* @__PURE__ */ new Map();
38
+ currentListeners.forEach((listener, key) => {
39
+ nextListeners.set(key, listener);
40
+ });
41
+ }
42
+ }
43
+ function getState() {
44
+ if (isDispatching) throw new Error(formatProdErrorMessage$1(3));
45
+ return currentState;
46
+ }
47
+ function subscribe(listener) {
48
+ if (typeof listener !== "function") throw new Error(formatProdErrorMessage$1(4));
49
+ if (isDispatching) throw new Error(formatProdErrorMessage$1(5));
50
+ let isSubscribed = true;
51
+ ensureCanMutateNextListeners();
52
+ const listenerId = listenerIdCounter++;
53
+ nextListeners.set(listenerId, listener);
54
+ return function unsubscribe() {
55
+ if (!isSubscribed) return;
56
+ if (isDispatching) throw new Error(formatProdErrorMessage$1(6));
57
+ isSubscribed = false;
58
+ ensureCanMutateNextListeners();
59
+ nextListeners.delete(listenerId);
60
+ currentListeners = null;
61
+ };
62
+ }
63
+ function dispatch(action) {
64
+ if (!isPlainObject$1(action)) throw new Error(formatProdErrorMessage$1(7));
65
+ if (typeof action.type === "undefined") throw new Error(formatProdErrorMessage$1(8));
66
+ if (typeof action.type !== "string") throw new Error(formatProdErrorMessage$1(17));
67
+ if (isDispatching) throw new Error(formatProdErrorMessage$1(9));
68
+ try {
69
+ isDispatching = true;
70
+ currentState = currentReducer(currentState, action);
71
+ } finally {
72
+ isDispatching = false;
73
+ }
74
+ (currentListeners = nextListeners).forEach((listener) => {
75
+ listener();
76
+ });
77
+ return action;
78
+ }
79
+ function replaceReducer(nextReducer) {
80
+ if (typeof nextReducer !== "function") throw new Error(formatProdErrorMessage$1(10));
81
+ currentReducer = nextReducer;
82
+ dispatch({ type: actionTypes_default.REPLACE });
83
+ }
84
+ function observable() {
85
+ const outerSubscribe = subscribe;
86
+ return {
87
+ subscribe(observer) {
88
+ if (typeof observer !== "object" || observer === null) throw new Error(formatProdErrorMessage$1(11));
89
+ function observeState() {
90
+ const observerAsObserver = observer;
91
+ if (observerAsObserver.next) observerAsObserver.next(getState());
92
+ }
93
+ observeState();
94
+ return { unsubscribe: outerSubscribe(observeState) };
95
+ },
96
+ [symbol_observable_default]() {
97
+ return this;
98
+ }
99
+ };
100
+ }
101
+ dispatch({ type: actionTypes_default.INIT });
102
+ return {
103
+ dispatch,
104
+ subscribe,
105
+ getState,
106
+ replaceReducer,
107
+ [symbol_observable_default]: observable
108
+ };
109
+ }
110
+ function assertReducerShape(reducers) {
111
+ Object.keys(reducers).forEach((key) => {
112
+ const reducer = reducers[key];
113
+ if (typeof reducer(void 0, { type: actionTypes_default.INIT }) === "undefined") throw new Error(formatProdErrorMessage$1(12));
114
+ if (typeof reducer(void 0, { type: actionTypes_default.PROBE_UNKNOWN_ACTION() }) === "undefined") throw new Error(formatProdErrorMessage$1(13));
115
+ });
116
+ }
117
+ function combineReducers(reducers) {
118
+ const reducerKeys = Object.keys(reducers);
119
+ const finalReducers = {};
120
+ for (let i = 0; i < reducerKeys.length; i++) {
121
+ const key = reducerKeys[i];
122
+ if (typeof reducers[key] === "function") finalReducers[key] = reducers[key];
123
+ }
124
+ const finalReducerKeys = Object.keys(finalReducers);
125
+ let shapeAssertionError;
126
+ try {
127
+ assertReducerShape(finalReducers);
128
+ } catch (e) {
129
+ shapeAssertionError = e;
130
+ }
131
+ return function combination(state = {}, action) {
132
+ if (shapeAssertionError) throw shapeAssertionError;
133
+ let hasChanged = false;
134
+ const nextState = {};
135
+ for (let i = 0; i < finalReducerKeys.length; i++) {
136
+ const key = finalReducerKeys[i];
137
+ const reducer = finalReducers[key];
138
+ const previousStateForKey = state[key];
139
+ const nextStateForKey = reducer(previousStateForKey, action);
140
+ if (typeof nextStateForKey === "undefined") {
141
+ action && action.type;
142
+ throw new Error(formatProdErrorMessage$1(14));
143
+ }
144
+ nextState[key] = nextStateForKey;
145
+ hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
146
+ }
147
+ hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
148
+ return hasChanged ? nextState : state;
149
+ };
150
+ }
151
+ function compose(...funcs) {
152
+ if (funcs.length === 0) return (arg) => arg;
153
+ if (funcs.length === 1) return funcs[0];
154
+ return funcs.reduce((a, b) => (...args) => a(b(...args)));
155
+ }
156
+ function applyMiddleware(...middlewares) {
157
+ return (createStore2) => (reducer, preloadedState) => {
158
+ const store = createStore2(reducer, preloadedState);
159
+ let dispatch = () => {
160
+ throw new Error(formatProdErrorMessage$1(15));
161
+ };
162
+ const middlewareAPI = {
163
+ getState: store.getState,
164
+ dispatch: (action, ...args) => dispatch(action, ...args)
165
+ };
166
+ dispatch = compose(...middlewares.map((middleware) => middleware(middlewareAPI)))(store.dispatch);
167
+ return {
168
+ ...store,
169
+ dispatch
170
+ };
171
+ };
172
+ }
173
+ function isAction(action) {
174
+ return isPlainObject$1(action) && "type" in action && typeof action.type === "string";
175
+ }
176
+ //#endregion
177
+ //#region ../../node_modules/.pnpm/immer@11.1.16/node_modules/immer/dist/immer.mjs
178
+ var NOTHING = Symbol.for("immer-nothing");
179
+ var DRAFTABLE = Symbol.for("immer-draftable");
180
+ var DRAFT_STATE = Symbol.for("immer-state");
181
+ function die(error, ...args) {
182
+ throw new Error(`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`);
183
+ }
184
+ var O = Object;
185
+ var getPrototypeOf = O.getPrototypeOf;
186
+ var CONSTRUCTOR = "constructor";
187
+ var PROTOTYPE = "prototype";
188
+ var CONFIGURABLE = "configurable";
189
+ var ENUMERABLE = "enumerable";
190
+ var WRITABLE = "writable";
191
+ var VALUE = "value";
192
+ var isDraft = (value) => !!value && !!value[DRAFT_STATE];
193
+ function isDraftable(value) {
194
+ if (!value) return false;
195
+ return isPlainObject(value) || isArray(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap(value) || isSet(value);
196
+ }
197
+ var objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString();
198
+ var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
199
+ function isPlainObject(value) {
200
+ if (!value || !isObjectish(value)) return false;
201
+ const proto = getPrototypeOf(value);
202
+ if (proto === null || proto === O[PROTOTYPE]) return true;
203
+ const Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];
204
+ if (Ctor === Object) return true;
205
+ if (!isFunction(Ctor)) return false;
206
+ let ctorString = cachedCtorStrings.get(Ctor);
207
+ if (ctorString === void 0) {
208
+ ctorString = Function.toString.call(Ctor);
209
+ cachedCtorStrings.set(Ctor, ctorString);
210
+ }
211
+ return ctorString === objectCtorString;
212
+ }
213
+ function each(obj, iter, strict = true) {
214
+ if (getArchtype(obj) === 0) (strict ? Reflect.ownKeys(obj) : O.keys(obj)).forEach((key) => {
215
+ iter(key, obj[key], obj);
216
+ });
217
+ else obj.forEach((entry, index) => iter(index, entry, obj));
218
+ }
219
+ function getArchtype(thing) {
220
+ const state = thing[DRAFT_STATE];
221
+ return state ? state.type_ : isArray(thing) ? 1 : isMap(thing) ? 2 : isSet(thing) ? 3 : 0;
222
+ }
223
+ var has = (thing, prop, type = getArchtype(thing)) => type === 2 ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop);
224
+ var get = (thing, prop, type = getArchtype(thing)) => type === 2 ? thing.get(prop) : thing[prop];
225
+ var set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {
226
+ if (type === 2) thing.set(propOrOldValue, value);
227
+ else if (type === 3) thing.add(value);
228
+ else thing[propOrOldValue] = value;
229
+ };
230
+ function is(x, y) {
231
+ if (x === y) return x !== 0 || 1 / x === 1 / y;
232
+ else return x !== x && y !== y;
233
+ }
234
+ var isArray = Array.isArray;
235
+ var isMap = (target) => target instanceof Map;
236
+ var isSet = (target) => target instanceof Set;
237
+ var isObjectish = (target) => typeof target === "object";
238
+ var isFunction = (target) => typeof target === "function";
239
+ var isBoolean$1 = (target) => typeof target === "boolean";
240
+ function isArrayIndex(value) {
241
+ const n = +value;
242
+ return Number.isInteger(n) && String(n) === value;
243
+ }
244
+ var latest = (state) => state.copy_ || state.base_;
245
+ var getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;
246
+ function shallowCopy(base, strict) {
247
+ if (isMap(base)) return new Map(base);
248
+ if (isSet(base)) return new Set(base);
249
+ if (isArray(base)) return Array[PROTOTYPE].slice.call(base);
250
+ const isPlain = isPlainObject(base);
251
+ if (strict === true || strict === "class_only" && !isPlain) {
252
+ const descriptors = O.getOwnPropertyDescriptors(base);
253
+ delete descriptors[DRAFT_STATE];
254
+ let keys = Reflect.ownKeys(descriptors);
255
+ for (let i = 0; i < keys.length; i++) {
256
+ const key = keys[i];
257
+ const desc = descriptors[key];
258
+ if (desc[WRITABLE] === false) {
259
+ desc[WRITABLE] = true;
260
+ desc[CONFIGURABLE] = true;
261
+ }
262
+ if (desc.get || desc.set) descriptors[key] = {
263
+ [CONFIGURABLE]: true,
264
+ [WRITABLE]: true,
265
+ [ENUMERABLE]: desc[ENUMERABLE],
266
+ [VALUE]: base[key]
267
+ };
268
+ }
269
+ return O.create(getPrototypeOf(base), descriptors);
270
+ } else {
271
+ const proto = getPrototypeOf(base);
272
+ if (proto !== null && isPlain) return { ...base };
273
+ const obj = O.create(proto);
274
+ return O.assign(obj, base);
275
+ }
276
+ }
277
+ function freeze(obj, deep = false) {
278
+ if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj)) return obj;
279
+ if (getArchtype(obj) > 1) O.defineProperties(obj, {
280
+ set: dontMutateMethodOverride,
281
+ add: dontMutateMethodOverride,
282
+ clear: dontMutateMethodOverride,
283
+ delete: dontMutateMethodOverride
284
+ });
285
+ O.freeze(obj);
286
+ if (deep) each(obj, (_key, value) => {
287
+ freeze(value, true);
288
+ }, false);
289
+ return obj;
290
+ }
291
+ function dontMutateFrozenCollections() {
292
+ die(2);
293
+ }
294
+ var dontMutateMethodOverride = { [VALUE]: dontMutateFrozenCollections };
295
+ function isFrozen(obj) {
296
+ if (obj === null || !isObjectish(obj)) return true;
297
+ return O.isFrozen(obj);
298
+ }
299
+ var PluginMapSet = "MapSet";
300
+ var PluginPatches = "Patches";
301
+ var PluginArrayMethods = "ArrayMethods";
302
+ var plugins = {};
303
+ function getPlugin(pluginKey) {
304
+ const plugin = plugins[pluginKey];
305
+ if (!plugin) die(0, pluginKey);
306
+ return plugin;
307
+ }
308
+ var isPluginLoaded = (pluginKey) => !!plugins[pluginKey];
309
+ var currentScope;
310
+ var getCurrentScope = () => currentScope;
311
+ var createScope = (parent_, immer_) => ({
312
+ drafts_: [],
313
+ parent_,
314
+ immer_,
315
+ canAutoFreeze_: true,
316
+ unfinalizedDrafts_: 0,
317
+ handledSet_: /* @__PURE__ */ new Set(),
318
+ processedForPatches_: /* @__PURE__ */ new Set(),
319
+ mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,
320
+ arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0
321
+ });
322
+ function usePatchesInScope(scope, patchListener) {
323
+ if (patchListener) {
324
+ scope.patchPlugin_ = getPlugin(PluginPatches);
325
+ scope.patches_ = [];
326
+ scope.inversePatches_ = [];
327
+ scope.patchListener_ = patchListener;
328
+ }
329
+ }
330
+ function revokeScope(scope) {
331
+ leaveScope(scope);
332
+ scope.drafts_.forEach(revokeDraft);
333
+ scope.drafts_ = null;
334
+ }
335
+ function leaveScope(scope) {
336
+ if (scope === currentScope) currentScope = scope.parent_;
337
+ }
338
+ var enterScope = (immer2) => currentScope = createScope(currentScope, immer2);
339
+ function revokeDraft(draft) {
340
+ const state = draft[DRAFT_STATE];
341
+ if (state.type_ === 0 || state.type_ === 1) state.revoke_();
342
+ else state.revoked_ = true;
343
+ }
344
+ function processResult(result, scope) {
345
+ scope.unfinalizedDrafts_ = scope.drafts_.length;
346
+ const baseDraft = scope.drafts_[0];
347
+ if (result !== void 0 && result !== baseDraft) {
348
+ if (baseDraft[DRAFT_STATE].modified_) {
349
+ revokeScope(scope);
350
+ die(4);
351
+ }
352
+ if (isDraftable(result)) result = finalize(scope, result);
353
+ const { patchPlugin_ } = scope;
354
+ if (patchPlugin_) patchPlugin_.generateReplacementPatches_(baseDraft[DRAFT_STATE].base_, result, scope);
355
+ } else result = finalize(scope, baseDraft);
356
+ maybeFreeze(scope, result, true);
357
+ revokeScope(scope);
358
+ if (scope.patches_) scope.patchListener_(scope.patches_, scope.inversePatches_);
359
+ return result !== NOTHING ? result : void 0;
360
+ }
361
+ function finalize(rootScope, value) {
362
+ if (isFrozen(value)) return value;
363
+ const state = value[DRAFT_STATE];
364
+ if (!state) return handleValue(value, rootScope.handledSet_, rootScope);
365
+ if (!isSameScope(state, rootScope)) return value;
366
+ if (!state.modified_) return state.base_;
367
+ if (!state.finalized_) {
368
+ const { callbacks_ } = state;
369
+ if (callbacks_) while (callbacks_.length > 0) callbacks_.pop()(rootScope);
370
+ generatePatchesAndFinalize(state, rootScope);
371
+ }
372
+ return state.copy_;
373
+ }
374
+ function maybeFreeze(scope, value, deep = false) {
375
+ if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) freeze(value, deep);
376
+ }
377
+ function markStateFinalized(state) {
378
+ state.finalized_ = true;
379
+ state.scope_.unfinalizedDrafts_--;
380
+ }
381
+ var isSameScope = (state, rootScope) => state.scope_ === rootScope;
382
+ var EMPTY_LOCATIONS_RESULT = [];
383
+ function updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {
384
+ const parentCopy = latest(parent);
385
+ const parentType = parent.type_;
386
+ if (originalKey !== void 0) {
387
+ if (get(parentCopy, originalKey, parentType) === draftValue) {
388
+ set(parentCopy, originalKey, finalizedValue, parentType);
389
+ return;
390
+ }
391
+ }
392
+ if (!parent.draftLocations_) {
393
+ const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();
394
+ each(parentCopy, (key, value) => {
395
+ if (isDraft(value)) {
396
+ const keys = draftLocations.get(value) || [];
397
+ keys.push(key);
398
+ draftLocations.set(value, keys);
399
+ }
400
+ });
401
+ }
402
+ const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;
403
+ for (const location of locations) set(parentCopy, location, finalizedValue, parentType);
404
+ }
405
+ function registerChildFinalizationCallback(parent, child, key) {
406
+ parent.callbacks_.push(function childCleanup(rootScope) {
407
+ const state = child;
408
+ if (!state || !isSameScope(state, rootScope)) return;
409
+ rootScope.mapSetPlugin_?.fixSetContents(state);
410
+ const finalizedValue = getFinalValue(state);
411
+ updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);
412
+ generatePatchesAndFinalize(state, rootScope);
413
+ });
414
+ }
415
+ function generatePatchesAndFinalize(state, rootScope) {
416
+ if (state.modified_ && !state.finalized_ && (state.type_ === 3 || state.type_ === 1 && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0)) {
417
+ const { patchPlugin_ } = rootScope;
418
+ if (patchPlugin_) {
419
+ const basePath = patchPlugin_.getPath(state);
420
+ if (basePath) patchPlugin_.generatePatches_(state, basePath, rootScope);
421
+ }
422
+ markStateFinalized(state);
423
+ }
424
+ }
425
+ function handleCrossReference(target, key, value) {
426
+ const { scope_ } = target;
427
+ if (isDraft(value)) {
428
+ const state = value[DRAFT_STATE];
429
+ if (isSameScope(state, scope_)) state.callbacks_.push(function crossReferenceCleanup() {
430
+ prepareCopy(target);
431
+ updateDraftInParent(target, value, getFinalValue(state), key);
432
+ });
433
+ } else if (isDraftable(value)) target.callbacks_.push(function nestedDraftCleanup() {
434
+ const targetCopy = latest(target);
435
+ if (target.type_ === 3) {
436
+ if (targetCopy.has(value)) handleValue(value, scope_.handledSet_, scope_);
437
+ } else if (get(targetCopy, key, target.type_) === value) {
438
+ if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) handleValue(get(target.copy_, key, target.type_), scope_.handledSet_, scope_);
439
+ }
440
+ });
441
+ }
442
+ function handleValue(target, handledSet, rootScope) {
443
+ if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) return target;
444
+ if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) return target;
445
+ handledSet.add(target);
446
+ each(target, (key, value) => {
447
+ if (isDraft(value)) {
448
+ const state = value[DRAFT_STATE];
449
+ if (isSameScope(state, rootScope)) {
450
+ set(target, key, getFinalValue(state), target.type_);
451
+ markStateFinalized(state);
452
+ }
453
+ } else if (isDraftable(value)) handleValue(value, handledSet, rootScope);
454
+ });
455
+ return target;
456
+ }
457
+ function createProxyProxy(base, parent) {
458
+ const baseIsArray = isArray(base);
459
+ const state = {
460
+ type_: baseIsArray ? 1 : 0,
461
+ scope_: parent ? parent.scope_ : getCurrentScope(),
462
+ modified_: false,
463
+ finalized_: false,
464
+ assigned_: void 0,
465
+ parent_: parent,
466
+ base_: base,
467
+ draft_: null,
468
+ copy_: null,
469
+ revoke_: null,
470
+ isManual_: false,
471
+ callbacks_: void 0
472
+ };
473
+ let target = state;
474
+ let traps = objectTraps;
475
+ if (baseIsArray) {
476
+ target = [state];
477
+ traps = arrayTraps;
478
+ }
479
+ const { revoke, proxy } = Proxy.revocable(target, traps);
480
+ state.draft_ = proxy;
481
+ state.revoke_ = revoke;
482
+ return [proxy, state];
483
+ }
484
+ var objectTraps = {
485
+ get(state, prop) {
486
+ if (prop === DRAFT_STATE) return state;
487
+ let arrayPlugin = state.scope_.arrayMethodsPlugin_;
488
+ const isArrayWithStringProp = state.type_ === 1 && typeof prop === "string";
489
+ if (isArrayWithStringProp) {
490
+ if (arrayPlugin?.isArrayOperationMethod(prop)) return arrayPlugin.createMethodInterceptor(state, prop);
491
+ }
492
+ const source = latest(state);
493
+ if (!has(source, prop, state.type_)) return readPropFromProto(state, source, prop);
494
+ const value = source[prop];
495
+ if (state.finalized_ || !isDraftable(value)) return value;
496
+ if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(state.operationMethod) && isArrayIndex(prop)) return value;
497
+ if (value === peek(state.base_, prop) || isRelocatedBaseRef(state, prop, value)) {
498
+ prepareCopy(state);
499
+ const childKey = state.type_ === 1 ? +prop : prop;
500
+ const childDraft = createProxy(state.scope_, value, state, childKey);
501
+ return state.copy_[childKey] = childDraft;
502
+ }
503
+ return value;
504
+ },
505
+ has(state, prop) {
506
+ return prop in latest(state);
507
+ },
508
+ ownKeys(state) {
509
+ return Reflect.ownKeys(latest(state));
510
+ },
511
+ set(state, prop, value) {
512
+ const desc = getDescriptorFromProto(latest(state), prop);
513
+ if (desc?.set) {
514
+ desc.set.call(state.draft_, value);
515
+ return true;
516
+ }
517
+ if (!state.modified_) {
518
+ const current2 = peek(latest(state), prop);
519
+ const currentState = current2?.[DRAFT_STATE];
520
+ if (currentState && currentState.base_ === value) {
521
+ state.copy_[prop] = value;
522
+ state.assigned_.set(prop, false);
523
+ return true;
524
+ }
525
+ if (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_))) return true;
526
+ prepareCopy(state);
527
+ markChanged(state);
528
+ }
529
+ if (state.copy_[prop] === value && (value !== void 0 || has(state.copy_, prop, state.type_)) || Number.isNaN(value) && Number.isNaN(state.copy_[prop])) return true;
530
+ state.copy_[prop] = value;
531
+ state.assigned_.set(prop, true);
532
+ handleCrossReference(state, prop, value);
533
+ return true;
534
+ },
535
+ deleteProperty(state, prop) {
536
+ prepareCopy(state);
537
+ if (peek(state.base_, prop) !== void 0 || prop in state.base_) {
538
+ state.assigned_.set(prop, false);
539
+ markChanged(state);
540
+ } else state.assigned_.delete(prop);
541
+ if (state.copy_) delete state.copy_[prop];
542
+ return true;
543
+ },
544
+ getOwnPropertyDescriptor(state, prop) {
545
+ const owner = latest(state);
546
+ const desc = Reflect.getOwnPropertyDescriptor(owner, prop);
547
+ if (!desc) return desc;
548
+ return {
549
+ [WRITABLE]: true,
550
+ [CONFIGURABLE]: state.type_ !== 1 || prop !== "length",
551
+ [ENUMERABLE]: desc[ENUMERABLE],
552
+ [VALUE]: owner[prop]
553
+ };
554
+ },
555
+ defineProperty() {
556
+ die(11);
557
+ },
558
+ getPrototypeOf(state) {
559
+ return getPrototypeOf(state.base_);
560
+ },
561
+ setPrototypeOf() {
562
+ die(12);
563
+ }
564
+ };
565
+ var arrayTraps = {};
566
+ for (let key in objectTraps) {
567
+ let fn = objectTraps[key];
568
+ arrayTraps[key] = function() {
569
+ const args = arguments;
570
+ args[0] = args[0][0];
571
+ return fn.apply(this, args);
572
+ };
573
+ }
574
+ arrayTraps.deleteProperty = function(state, prop) {
575
+ return arrayTraps.set.call(this, state, prop, void 0);
576
+ };
577
+ arrayTraps.set = function(state, prop, value) {
578
+ return objectTraps.set.call(this, state[0], prop, value, state[0]);
579
+ };
580
+ function peek(draft, prop) {
581
+ const state = draft[DRAFT_STATE];
582
+ return (state ? latest(state) : draft)[prop];
583
+ }
584
+ function isRelocatedBaseRef(state, prop, value) {
585
+ if (state.type_ !== 1 || !state.allIndicesReassigned_ || state.assigned_?.get(prop) || !isDraftable(value) || value[DRAFT_STATE]) return false;
586
+ return state.baseRefs_.has(value);
587
+ }
588
+ function readPropFromProto(state, source, prop) {
589
+ const desc = getDescriptorFromProto(source, prop);
590
+ return desc ? VALUE in desc ? desc[VALUE] : desc.get?.call(state.draft_) : void 0;
591
+ }
592
+ function getDescriptorFromProto(source, prop) {
593
+ if (!(prop in source)) return void 0;
594
+ let proto = getPrototypeOf(source);
595
+ while (proto) {
596
+ const desc = Object.getOwnPropertyDescriptor(proto, prop);
597
+ if (desc) return desc;
598
+ proto = getPrototypeOf(proto);
599
+ }
600
+ }
601
+ function markChanged(state) {
602
+ if (!state.modified_) {
603
+ state.modified_ = true;
604
+ if (state.parent_) markChanged(state.parent_);
605
+ }
606
+ }
607
+ function prepareCopy(state) {
608
+ if (!state.copy_) {
609
+ state.assigned_ = /* @__PURE__ */ new Map();
610
+ state.copy_ = shallowCopy(state.base_, state.scope_.immer_.useStrictShallowCopy_);
611
+ }
612
+ }
613
+ var Immer2 = class {
614
+ constructor(config) {
615
+ this.autoFreeze_ = true;
616
+ this.useStrictShallowCopy_ = false;
617
+ this.useStrictIteration_ = false;
618
+ /**
619
+ * The `produce` function takes a value and a "recipe function" (whose
620
+ * return value often depends on the base state). The recipe function is
621
+ * free to mutate its first argument however it wants. All mutations are
622
+ * only ever applied to a __copy__ of the base state.
623
+ *
624
+ * Pass only a function to create a "curried producer" which relieves you
625
+ * from passing the recipe function every time.
626
+ *
627
+ * Only plain objects and arrays are made mutable. All other objects are
628
+ * considered uncopyable.
629
+ *
630
+ * Note: This function is __bound__ to its `Immer` instance.
631
+ *
632
+ * @param {any} base - the initial state
633
+ * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified
634
+ * @param {Function} patchListener - optional function that will be called with all the patches produced here
635
+ * @returns {any} a new state, or the initial state if nothing was modified
636
+ */
637
+ this.produce = (base, recipe, patchListener) => {
638
+ if (isFunction(base) && !isFunction(recipe)) {
639
+ const defaultBase = recipe;
640
+ recipe = base;
641
+ const self = this;
642
+ return function curriedProduce(base2 = defaultBase, ...args) {
643
+ return self.produce(base2, (draft) => recipe.call(this, draft, ...args));
644
+ };
645
+ }
646
+ if (!isFunction(recipe)) die(6);
647
+ if (patchListener !== void 0 && !isFunction(patchListener)) die(7);
648
+ let result;
649
+ if (isDraftable(base)) {
650
+ const scope = enterScope(this);
651
+ const proxy = createProxy(scope, base, void 0);
652
+ let hasError = true;
653
+ try {
654
+ result = recipe(proxy);
655
+ hasError = false;
656
+ } finally {
657
+ if (hasError) revokeScope(scope);
658
+ else leaveScope(scope);
659
+ }
660
+ usePatchesInScope(scope, patchListener);
661
+ return processResult(result, scope);
662
+ } else if (!base || !isObjectish(base)) {
663
+ result = recipe(base);
664
+ if (result === void 0) result = base;
665
+ if (result === NOTHING) result = void 0;
666
+ if (this.autoFreeze_) freeze(result, true);
667
+ if (patchListener) {
668
+ const p = [];
669
+ const ip = [];
670
+ getPlugin(PluginPatches).generateReplacementPatches_(base, result, {
671
+ patches_: p,
672
+ inversePatches_: ip
673
+ });
674
+ patchListener(p, ip);
675
+ }
676
+ return result;
677
+ } else die(1, base);
678
+ };
679
+ this.produceWithPatches = (base, recipe) => {
680
+ if (isFunction(base)) return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));
681
+ let patches, inversePatches;
682
+ return [
683
+ this.produce(base, recipe, (p, ip) => {
684
+ patches = p;
685
+ inversePatches = ip;
686
+ }),
687
+ patches,
688
+ inversePatches
689
+ ];
690
+ };
691
+ if (isBoolean$1(config?.autoFreeze)) this.setAutoFreeze(config.autoFreeze);
692
+ if (isBoolean$1(config?.useStrictShallowCopy)) this.setUseStrictShallowCopy(config.useStrictShallowCopy);
693
+ if (isBoolean$1(config?.useStrictIteration)) this.setUseStrictIteration(config.useStrictIteration);
694
+ }
695
+ createDraft(base) {
696
+ if (!isDraftable(base)) die(8);
697
+ if (isDraft(base)) base = current(base);
698
+ const scope = enterScope(this);
699
+ const proxy = createProxy(scope, base, void 0);
700
+ proxy[DRAFT_STATE].isManual_ = true;
701
+ leaveScope(scope);
702
+ return proxy;
703
+ }
704
+ finishDraft(draft, patchListener) {
705
+ const state = draft && draft[DRAFT_STATE];
706
+ if (!state || !state.isManual_) die(9);
707
+ const { scope_: scope } = state;
708
+ usePatchesInScope(scope, patchListener);
709
+ return processResult(void 0, scope);
710
+ }
711
+ /**
712
+ * Pass true to automatically freeze all copies created by Immer.
713
+ *
714
+ * By default, auto-freezing is enabled.
715
+ */
716
+ setAutoFreeze(value) {
717
+ this.autoFreeze_ = value;
718
+ }
719
+ /**
720
+ * Pass true to enable strict shallow copy.
721
+ *
722
+ * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
723
+ */
724
+ setUseStrictShallowCopy(value) {
725
+ this.useStrictShallowCopy_ = value;
726
+ }
727
+ /**
728
+ * Pass false to use faster iteration that skips non-enumerable properties
729
+ * but still handles symbols for compatibility.
730
+ *
731
+ * By default, strict iteration is enabled (includes all own properties).
732
+ */
733
+ setUseStrictIteration(value) {
734
+ this.useStrictIteration_ = value;
735
+ }
736
+ shouldUseStrictIteration() {
737
+ return this.useStrictIteration_;
738
+ }
739
+ applyPatches(base, patches) {
740
+ let i;
741
+ for (i = patches.length - 1; i >= 0; i--) {
742
+ const patch = patches[i];
743
+ if (patch.path.length === 0 && patch.op === "replace") {
744
+ base = patch.value;
745
+ break;
746
+ }
747
+ }
748
+ if (i > -1) patches = patches.slice(i + 1);
749
+ const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;
750
+ if (isDraft(base)) return applyPatchesImpl(base, patches);
751
+ return this.produce(base, (draft) => applyPatchesImpl(draft, patches));
752
+ }
753
+ };
754
+ function createProxy(rootScope, value, parent, key) {
755
+ const [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);
756
+ (parent?.scope_ ?? getCurrentScope()).drafts_.push(draft);
757
+ state.callbacks_ = parent?.callbacks_ ?? [];
758
+ state.key_ = key;
759
+ if (parent && key !== void 0) registerChildFinalizationCallback(parent, state, key);
760
+ else state.callbacks_.push(function rootDraftCleanup(rootScope2) {
761
+ rootScope2.mapSetPlugin_?.fixSetContents(state);
762
+ const { patchPlugin_ } = rootScope2;
763
+ if (state.modified_ && patchPlugin_) patchPlugin_.generatePatches_(state, [], rootScope2);
764
+ });
765
+ return draft;
766
+ }
767
+ function current(value) {
768
+ if (!isDraft(value)) die(10, value);
769
+ return currentImpl(value);
770
+ }
771
+ function currentImpl(value) {
772
+ if (!isDraftable(value) || isFrozen(value)) return value;
773
+ const state = value[DRAFT_STATE];
774
+ let copy;
775
+ let strict = true;
776
+ if (state) {
777
+ if (!state.modified_) return state.base_;
778
+ state.finalized_ = true;
779
+ copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
780
+ strict = state.scope_.immer_.shouldUseStrictIteration();
781
+ } else copy = shallowCopy(value, true);
782
+ each(copy, (key, childValue) => {
783
+ set(copy, key, currentImpl(childValue));
784
+ }, strict);
785
+ if (state) state.finalized_ = false;
786
+ return copy;
787
+ }
788
+ var produce = new Immer2().produce;
789
+ //#endregion
790
+ //#region ../../node_modules/.pnpm/redux-thunk@3.1.0_redux@5.0.1/node_modules/redux-thunk/dist/redux-thunk.mjs
791
+ function createThunkMiddleware(extraArgument) {
792
+ const middleware = ({ dispatch, getState }) => (next) => (action) => {
793
+ if (typeof action === "function") return action(dispatch, getState, extraArgument);
794
+ return next(action);
795
+ };
796
+ return middleware;
797
+ }
798
+ var thunk = createThunkMiddleware();
799
+ var withExtraArgument = createThunkMiddleware;
800
+ //#endregion
801
+ //#region ../../node_modules/.pnpm/@reduxjs+toolkit@2.12.0_react-redux@9.3.0_@types+react@19.2.15_react@19.2.6_redux@5.0.1__react@19.2.6/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs
802
+ var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
803
+ if (arguments.length === 0) return void 0;
804
+ if (typeof arguments[0] === "object") return compose;
805
+ return compose.apply(null, arguments);
806
+ };
807
+ typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__;
808
+ function createAction(type, prepareAction) {
809
+ function actionCreator(...args) {
810
+ if (prepareAction) {
811
+ let prepared = prepareAction(...args);
812
+ if (!prepared) throw new Error(formatProdErrorMessage(0));
813
+ return {
814
+ type,
815
+ payload: prepared.payload,
816
+ ..."meta" in prepared && { meta: prepared.meta },
817
+ ..."error" in prepared && { error: prepared.error }
818
+ };
819
+ }
820
+ return {
821
+ type,
822
+ payload: args[0]
823
+ };
824
+ }
825
+ actionCreator.toString = () => `${type}`;
826
+ actionCreator.type = type;
827
+ actionCreator.match = (action) => isAction(action) && action.type === type;
828
+ return actionCreator;
829
+ }
830
+ var Tuple = class _Tuple extends Array {
831
+ constructor(...items) {
832
+ super(...items);
833
+ Object.setPrototypeOf(this, _Tuple.prototype);
834
+ }
835
+ static get [Symbol.species]() {
836
+ return _Tuple;
837
+ }
838
+ concat(...arr) {
839
+ return super.concat.apply(this, arr);
840
+ }
841
+ prepend(...arr) {
842
+ if (arr.length === 1 && Array.isArray(arr[0])) return new _Tuple(...arr[0].concat(this));
843
+ return new _Tuple(...arr.concat(this));
844
+ }
845
+ };
846
+ function freezeDraftable(val) {
847
+ return isDraftable(val) ? produce(val, () => {}) : val;
848
+ }
849
+ function getOrInsertComputed(map, key, compute) {
850
+ if (map.has(key)) return map.get(key);
851
+ return map.set(key, compute(key)).get(key);
852
+ }
853
+ function isBoolean(x) {
854
+ return typeof x === "boolean";
855
+ }
856
+ var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {
857
+ const { thunk: thunk$1 = true, immutableCheck = true, serializableCheck = true, actionCreatorCheck = true } = options ?? {};
858
+ let middlewareArray = new Tuple();
859
+ if (thunk$1) if (isBoolean(thunk$1)) middlewareArray.push(thunk);
860
+ else middlewareArray.push(withExtraArgument(thunk$1.extraArgument));
861
+ return middlewareArray;
862
+ };
863
+ var SHOULD_AUTOBATCH = "RTK_autoBatch";
864
+ var prepareAutoBatched = () => (payload) => ({
865
+ payload,
866
+ meta: { [SHOULD_AUTOBATCH]: true }
867
+ });
868
+ var createQueueWithTimer = (timeout) => {
869
+ return (notify) => {
870
+ setTimeout(notify, timeout);
871
+ };
872
+ };
873
+ var createRafWithFallbackTimer = (raf, timeout) => {
874
+ return (notify) => {
875
+ let called = false;
876
+ const callback = () => {
877
+ if (called) return;
878
+ called = true;
879
+ cancelAnimationFrame(rafId);
880
+ clearTimeout(timerId);
881
+ notify();
882
+ };
883
+ const rafId = raf(callback);
884
+ const timerId = setTimeout(callback, timeout);
885
+ };
886
+ };
887
+ var autoBatchEnhancer = (options = { type: "raf" }) => (next) => (...args) => {
888
+ const store = next(...args);
889
+ let notifying = true;
890
+ let shouldNotifyAtEndOfTick = false;
891
+ let notificationQueued = false;
892
+ const listeners = /* @__PURE__ */ new Set();
893
+ const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? typeof window !== "undefined" && window.requestAnimationFrame ? createRafWithFallbackTimer(window.requestAnimationFrame, 100) : createQueueWithTimer(10) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
894
+ const notifyListeners = () => {
895
+ notificationQueued = false;
896
+ if (shouldNotifyAtEndOfTick) {
897
+ shouldNotifyAtEndOfTick = false;
898
+ listeners.forEach((l) => l());
899
+ }
900
+ };
901
+ return Object.assign({}, store, {
902
+ subscribe(listener2) {
903
+ const wrappedListener = () => notifying && listener2();
904
+ const unsubscribe = store.subscribe(wrappedListener);
905
+ listeners.add(listener2);
906
+ return () => {
907
+ unsubscribe();
908
+ listeners.delete(listener2);
909
+ };
910
+ },
911
+ dispatch(action) {
912
+ try {
913
+ notifying = !action?.meta?.[SHOULD_AUTOBATCH];
914
+ shouldNotifyAtEndOfTick = !notifying;
915
+ if (shouldNotifyAtEndOfTick) {
916
+ if (!notificationQueued) {
917
+ notificationQueued = true;
918
+ queueCallback(notifyListeners);
919
+ }
920
+ }
921
+ return store.dispatch(action);
922
+ } finally {
923
+ notifying = true;
924
+ }
925
+ }
926
+ });
927
+ };
928
+ var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {
929
+ const { autoBatch = true } = options ?? {};
930
+ let enhancerArray = new Tuple(middlewareEnhancer);
931
+ if (autoBatch) enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0));
932
+ return enhancerArray;
933
+ };
934
+ function configureStore(options) {
935
+ const getDefaultMiddleware = buildGetDefaultMiddleware();
936
+ const { reducer = void 0, middleware, devTools = true, duplicateMiddlewareCheck = true, preloadedState = void 0, enhancers = void 0 } = options || {};
937
+ let rootReducer;
938
+ if (typeof reducer === "function") rootReducer = reducer;
939
+ else if (isPlainObject$1(reducer)) rootReducer = combineReducers(reducer);
940
+ else throw new Error(formatProdErrorMessage(1));
941
+ let finalMiddleware;
942
+ if (typeof middleware === "function") finalMiddleware = middleware(getDefaultMiddleware);
943
+ else finalMiddleware = getDefaultMiddleware();
944
+ let finalCompose = compose;
945
+ if (devTools) finalCompose = composeWithDevTools({
946
+ trace: false,
947
+ ...typeof devTools === "object" && devTools
948
+ });
949
+ const getDefaultEnhancers = buildGetDefaultEnhancers(applyMiddleware(...finalMiddleware));
950
+ let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
951
+ const composedEnhancer = finalCompose(...storeEnhancers);
952
+ return createStore(rootReducer, preloadedState, composedEnhancer);
953
+ }
954
+ function executeReducerBuilderCallback(builderCallback) {
955
+ const actionsMap = {};
956
+ const actionMatchers = [];
957
+ let defaultCaseReducer;
958
+ const builder = {
959
+ addCase(typeOrActionCreator, reducer) {
960
+ const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
961
+ if (!type) throw new Error(formatProdErrorMessage(28));
962
+ if (type in actionsMap) throw new Error(formatProdErrorMessage(29));
963
+ actionsMap[type] = reducer;
964
+ return builder;
965
+ },
966
+ addAsyncThunk(asyncThunk, reducers) {
967
+ if (reducers.pending) actionsMap[asyncThunk.pending.type] = reducers.pending;
968
+ if (reducers.rejected) actionsMap[asyncThunk.rejected.type] = reducers.rejected;
969
+ if (reducers.fulfilled) actionsMap[asyncThunk.fulfilled.type] = reducers.fulfilled;
970
+ if (reducers.settled) actionMatchers.push({
971
+ matcher: asyncThunk.settled,
972
+ reducer: reducers.settled
973
+ });
974
+ return builder;
975
+ },
976
+ addMatcher(matcher, reducer) {
977
+ actionMatchers.push({
978
+ matcher,
979
+ reducer
980
+ });
981
+ return builder;
982
+ },
983
+ addDefaultCase(reducer) {
984
+ defaultCaseReducer = reducer;
985
+ return builder;
986
+ }
987
+ };
988
+ builderCallback(builder);
989
+ return [
990
+ actionsMap,
991
+ actionMatchers,
992
+ defaultCaseReducer
993
+ ];
994
+ }
995
+ function isStateFunction(x) {
996
+ return typeof x === "function";
997
+ }
998
+ function createReducer(initialState, mapOrBuilderCallback) {
999
+ let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);
1000
+ let getInitialState;
1001
+ if (isStateFunction(initialState)) getInitialState = () => freezeDraftable(initialState());
1002
+ else {
1003
+ const frozenInitialState = freezeDraftable(initialState);
1004
+ getInitialState = () => frozenInitialState;
1005
+ }
1006
+ function reducer(state = getInitialState(), action) {
1007
+ let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({ matcher }) => matcher(action)).map(({ reducer: reducer2 }) => reducer2)];
1008
+ if (caseReducers.filter((cr) => !!cr).length === 0) caseReducers = [finalDefaultCaseReducer];
1009
+ return caseReducers.reduce((previousState, caseReducer) => {
1010
+ if (caseReducer) if (isDraft(previousState)) {
1011
+ const result = caseReducer(previousState, action);
1012
+ if (result === void 0) return previousState;
1013
+ return result;
1014
+ } else if (!isDraftable(previousState)) {
1015
+ const result = caseReducer(previousState, action);
1016
+ if (result === void 0) {
1017
+ if (previousState === null) return previousState;
1018
+ throw Error("A case reducer on a non-draftable value must not return undefined");
1019
+ }
1020
+ return result;
1021
+ } else return produce(previousState, (draft) => {
1022
+ return caseReducer(draft, action);
1023
+ });
1024
+ return previousState;
1025
+ }, state);
1026
+ }
1027
+ reducer.getInitialState = getInitialState;
1028
+ return reducer;
1029
+ }
1030
+ var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
1031
+ var nanoid = (size = 21) => {
1032
+ let id = "";
1033
+ let i = size;
1034
+ while (i--) id += urlAlphabet[Math.random() * 64 | 0];
1035
+ return id;
1036
+ };
1037
+ var asyncThunkSymbol = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
1038
+ function getType(slice, actionKey) {
1039
+ return `${slice}/${actionKey}`;
1040
+ }
1041
+ function buildCreateSlice({ creators } = {}) {
1042
+ const cAT = creators?.asyncThunk?.[asyncThunkSymbol];
1043
+ return function createSlice2(options) {
1044
+ const { name, reducerPath = name } = options;
1045
+ if (!name) throw new Error(formatProdErrorMessage(11));
1046
+ const reducers = (typeof options.reducers === "function" ? options.reducers(buildReducerCreators()) : options.reducers) || {};
1047
+ const reducerNames = Object.keys(reducers);
1048
+ const context = {
1049
+ sliceCaseReducersByName: {},
1050
+ sliceCaseReducersByType: {},
1051
+ actionCreators: {},
1052
+ sliceMatchers: []
1053
+ };
1054
+ const contextMethods = {
1055
+ addCase(typeOrActionCreator, reducer2) {
1056
+ const type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
1057
+ if (!type) throw new Error(formatProdErrorMessage(12));
1058
+ if (type in context.sliceCaseReducersByType) throw new Error(formatProdErrorMessage(13));
1059
+ context.sliceCaseReducersByType[type] = reducer2;
1060
+ return contextMethods;
1061
+ },
1062
+ addMatcher(matcher, reducer2) {
1063
+ context.sliceMatchers.push({
1064
+ matcher,
1065
+ reducer: reducer2
1066
+ });
1067
+ return contextMethods;
1068
+ },
1069
+ exposeAction(name2, actionCreator) {
1070
+ context.actionCreators[name2] = actionCreator;
1071
+ return contextMethods;
1072
+ },
1073
+ exposeCaseReducer(name2, reducer2) {
1074
+ context.sliceCaseReducersByName[name2] = reducer2;
1075
+ return contextMethods;
1076
+ }
1077
+ };
1078
+ reducerNames.forEach((reducerName) => {
1079
+ const reducerDefinition = reducers[reducerName];
1080
+ const reducerDetails = {
1081
+ reducerName,
1082
+ type: getType(name, reducerName),
1083
+ createNotation: typeof options.reducers === "function"
1084
+ };
1085
+ if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);
1086
+ else handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);
1087
+ });
1088
+ function buildReducer() {
1089
+ const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];
1090
+ const finalCaseReducers = {
1091
+ ...extraReducers,
1092
+ ...context.sliceCaseReducersByType
1093
+ };
1094
+ return createReducer(options.initialState, (builder) => {
1095
+ for (let key in finalCaseReducers) builder.addCase(key, finalCaseReducers[key]);
1096
+ for (let sM of context.sliceMatchers) builder.addMatcher(sM.matcher, sM.reducer);
1097
+ for (let m of actionMatchers) builder.addMatcher(m.matcher, m.reducer);
1098
+ if (defaultCaseReducer) builder.addDefaultCase(defaultCaseReducer);
1099
+ });
1100
+ }
1101
+ const selectSelf = (state) => state;
1102
+ const injectedSelectorCache = /* @__PURE__ */ new Map();
1103
+ const injectedStateCache = /* @__PURE__ */ new WeakMap();
1104
+ let _reducer;
1105
+ function reducer(state, action) {
1106
+ if (!_reducer) _reducer = buildReducer();
1107
+ return _reducer(state, action);
1108
+ }
1109
+ function getInitialState() {
1110
+ if (!_reducer) _reducer = buildReducer();
1111
+ return _reducer.getInitialState();
1112
+ }
1113
+ function makeSelectorProps(reducerPath2, injected = false) {
1114
+ function selectSlice(state) {
1115
+ let sliceState = state[reducerPath2];
1116
+ if (typeof sliceState === "undefined") {
1117
+ if (injected) sliceState = getOrInsertComputed(injectedStateCache, selectSlice, getInitialState);
1118
+ }
1119
+ return sliceState;
1120
+ }
1121
+ function getSelectors(selectState = selectSelf) {
1122
+ return getOrInsertComputed(getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap()), selectState, () => {
1123
+ const map = {};
1124
+ for (const [name2, selector] of Object.entries(options.selectors ?? {})) map[name2] = wrapSelector(selector, selectState, () => getOrInsertComputed(injectedStateCache, selectState, getInitialState), injected);
1125
+ return map;
1126
+ });
1127
+ }
1128
+ return {
1129
+ reducerPath: reducerPath2,
1130
+ getSelectors,
1131
+ get selectors() {
1132
+ return getSelectors(selectSlice);
1133
+ },
1134
+ selectSlice
1135
+ };
1136
+ }
1137
+ const slice = {
1138
+ name,
1139
+ reducer,
1140
+ actions: context.actionCreators,
1141
+ caseReducers: context.sliceCaseReducersByName,
1142
+ getInitialState,
1143
+ ...makeSelectorProps(reducerPath),
1144
+ injectInto(injectable, { reducerPath: pathOpt, ...config } = {}) {
1145
+ const newReducerPath = pathOpt ?? reducerPath;
1146
+ injectable.inject({
1147
+ reducerPath: newReducerPath,
1148
+ reducer
1149
+ }, config);
1150
+ return {
1151
+ ...slice,
1152
+ ...makeSelectorProps(newReducerPath, true)
1153
+ };
1154
+ }
1155
+ };
1156
+ return slice;
1157
+ };
1158
+ }
1159
+ function wrapSelector(selector, selectState, getInitialState, injected) {
1160
+ function wrapper(rootState, ...args) {
1161
+ let sliceState = selectState(rootState);
1162
+ if (typeof sliceState === "undefined") {
1163
+ if (injected) sliceState = getInitialState();
1164
+ }
1165
+ return selector(sliceState, ...args);
1166
+ }
1167
+ wrapper.unwrapped = selector;
1168
+ return wrapper;
1169
+ }
1170
+ var createSlice = /* @__PURE__ */ buildCreateSlice();
1171
+ function buildReducerCreators() {
1172
+ function asyncThunk(payloadCreator, config) {
1173
+ return {
1174
+ _reducerDefinitionType: "asyncThunk",
1175
+ payloadCreator,
1176
+ ...config
1177
+ };
1178
+ }
1179
+ asyncThunk.withTypes = () => asyncThunk;
1180
+ return {
1181
+ reducer(caseReducer) {
1182
+ return Object.assign({ [caseReducer.name](...args) {
1183
+ return caseReducer(...args);
1184
+ } }[caseReducer.name], { _reducerDefinitionType: "reducer" });
1185
+ },
1186
+ preparedReducer(prepare, reducer) {
1187
+ return {
1188
+ _reducerDefinitionType: "reducerWithPrepare",
1189
+ prepare,
1190
+ reducer
1191
+ };
1192
+ },
1193
+ asyncThunk
1194
+ };
1195
+ }
1196
+ function handleNormalReducerDefinition({ type, reducerName, createNotation }, maybeReducerWithPrepare, context) {
1197
+ let caseReducer;
1198
+ let prepareCallback;
1199
+ if ("reducer" in maybeReducerWithPrepare) {
1200
+ if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) throw new Error(formatProdErrorMessage(17));
1201
+ caseReducer = maybeReducerWithPrepare.reducer;
1202
+ prepareCallback = maybeReducerWithPrepare.prepare;
1203
+ } else caseReducer = maybeReducerWithPrepare;
1204
+ context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));
1205
+ }
1206
+ function isAsyncThunkSliceReducerDefinition(reducerDefinition) {
1207
+ return reducerDefinition._reducerDefinitionType === "asyncThunk";
1208
+ }
1209
+ function isCaseReducerWithPrepareDefinition(reducerDefinition) {
1210
+ return reducerDefinition._reducerDefinitionType === "reducerWithPrepare";
1211
+ }
1212
+ function handleThunkCaseReducerDefinition({ type, reducerName }, reducerDefinition, context, cAT) {
1213
+ if (!cAT) throw new Error(formatProdErrorMessage(18));
1214
+ const { payloadCreator, fulfilled, pending, rejected, settled, options } = reducerDefinition;
1215
+ const thunk = cAT(type, payloadCreator, options);
1216
+ context.exposeAction(reducerName, thunk);
1217
+ if (fulfilled) context.addCase(thunk.fulfilled, fulfilled);
1218
+ if (pending) context.addCase(thunk.pending, pending);
1219
+ if (rejected) context.addCase(thunk.rejected, rejected);
1220
+ if (settled) context.addMatcher(thunk.settled, settled);
1221
+ context.exposeCaseReducer(reducerName, {
1222
+ fulfilled: fulfilled || noop,
1223
+ pending: pending || noop,
1224
+ rejected: rejected || noop,
1225
+ settled: settled || noop
1226
+ });
1227
+ }
1228
+ function noop() {}
1229
+ var task = "task";
1230
+ var listener = "listener";
1231
+ var completed = "completed";
1232
+ var cancelled = "cancelled";
1233
+ var taskCancelled = `task-${cancelled}`;
1234
+ var taskCompleted = `task-${completed}`;
1235
+ var listenerCancelled = `${listener}-${cancelled}`;
1236
+ var listenerCompleted = `${listener}-${completed}`;
1237
+ var TaskAbortError = class {
1238
+ constructor(code) {
1239
+ this.code = code;
1240
+ this.message = `${task} ${cancelled} (reason: ${code})`;
1241
+ }
1242
+ code;
1243
+ name = "TaskAbortError";
1244
+ message;
1245
+ };
1246
+ var assertFunction = (func, expected) => {
1247
+ if (typeof func !== "function") throw new TypeError(formatProdErrorMessage(32));
1248
+ };
1249
+ var noop2 = () => {};
1250
+ var catchRejection = (promise, onError = noop2) => {
1251
+ promise.catch(onError);
1252
+ return promise;
1253
+ };
1254
+ var addAbortSignalListener = (abortSignal, callback) => {
1255
+ abortSignal.addEventListener("abort", callback, { once: true });
1256
+ return () => abortSignal.removeEventListener("abort", callback);
1257
+ };
1258
+ var validateActive = (signal) => {
1259
+ if (signal.aborted) throw new TaskAbortError(signal.reason);
1260
+ };
1261
+ function raceWithSignal(signal, promise) {
1262
+ let cleanup = noop2;
1263
+ return new Promise((resolve, reject) => {
1264
+ const notifyRejection = () => reject(new TaskAbortError(signal.reason));
1265
+ if (signal.aborted) {
1266
+ notifyRejection();
1267
+ return;
1268
+ }
1269
+ cleanup = addAbortSignalListener(signal, notifyRejection);
1270
+ promise.finally(() => cleanup()).then(resolve, reject);
1271
+ }).finally(() => {
1272
+ cleanup = noop2;
1273
+ });
1274
+ }
1275
+ var runTask = async (task2, cleanUp) => {
1276
+ try {
1277
+ await Promise.resolve();
1278
+ return {
1279
+ status: "ok",
1280
+ value: await task2()
1281
+ };
1282
+ } catch (error) {
1283
+ return {
1284
+ status: error instanceof TaskAbortError ? "cancelled" : "rejected",
1285
+ error
1286
+ };
1287
+ } finally {
1288
+ cleanUp?.();
1289
+ }
1290
+ };
1291
+ var createPause = (signal) => {
1292
+ return (promise) => {
1293
+ return catchRejection(raceWithSignal(signal, promise).then((output) => {
1294
+ validateActive(signal);
1295
+ return output;
1296
+ }));
1297
+ };
1298
+ };
1299
+ var createDelay = (signal) => {
1300
+ const pause = createPause(signal);
1301
+ return (timeoutMs) => {
1302
+ return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs)));
1303
+ };
1304
+ };
1305
+ var { assign } = Object;
1306
+ var INTERNAL_NIL_TOKEN = {};
1307
+ var alm = "listenerMiddleware";
1308
+ var createFork = (parentAbortSignal, parentBlockingPromises) => {
1309
+ const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => controller.abort(parentAbortSignal.reason));
1310
+ return (taskExecutor, opts) => {
1311
+ assertFunction(taskExecutor, "taskExecutor");
1312
+ const childAbortController = new AbortController();
1313
+ linkControllers(childAbortController);
1314
+ const result = runTask(async () => {
1315
+ validateActive(parentAbortSignal);
1316
+ validateActive(childAbortController.signal);
1317
+ const result2 = await taskExecutor({
1318
+ pause: createPause(childAbortController.signal),
1319
+ delay: createDelay(childAbortController.signal),
1320
+ signal: childAbortController.signal
1321
+ });
1322
+ validateActive(childAbortController.signal);
1323
+ return result2;
1324
+ }, () => childAbortController.abort(taskCompleted));
1325
+ if (opts?.autoJoin) parentBlockingPromises.push(result.catch(noop2));
1326
+ return {
1327
+ result: createPause(parentAbortSignal)(result),
1328
+ cancel() {
1329
+ childAbortController.abort(taskCancelled);
1330
+ }
1331
+ };
1332
+ };
1333
+ };
1334
+ var createTakePattern = (startListening, signal) => {
1335
+ const take = async (predicate, timeout) => {
1336
+ validateActive(signal);
1337
+ let unsubscribe = () => {};
1338
+ const promises = [new Promise((resolve, reject) => {
1339
+ let stopListening = startListening({
1340
+ predicate,
1341
+ effect: (action, listenerApi) => {
1342
+ listenerApi.unsubscribe();
1343
+ resolve([
1344
+ action,
1345
+ listenerApi.getState(),
1346
+ listenerApi.getOriginalState()
1347
+ ]);
1348
+ }
1349
+ });
1350
+ unsubscribe = () => {
1351
+ stopListening();
1352
+ reject();
1353
+ };
1354
+ })];
1355
+ if (timeout != null) promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null)));
1356
+ try {
1357
+ const output = await raceWithSignal(signal, Promise.race(promises));
1358
+ validateActive(signal);
1359
+ return output;
1360
+ } finally {
1361
+ unsubscribe();
1362
+ }
1363
+ };
1364
+ return ((predicate, timeout) => catchRejection(take(predicate, timeout)));
1365
+ };
1366
+ var getListenerEntryPropsFrom = (options) => {
1367
+ let { type, actionCreator, matcher, predicate, effect } = options;
1368
+ if (type) predicate = createAction(type).match;
1369
+ else if (actionCreator) {
1370
+ type = actionCreator.type;
1371
+ predicate = actionCreator.match;
1372
+ } else if (matcher) predicate = matcher;
1373
+ else if (predicate) {} else throw new Error(formatProdErrorMessage(21));
1374
+ assertFunction(effect, "options.listener");
1375
+ return {
1376
+ predicate,
1377
+ type,
1378
+ effect
1379
+ };
1380
+ };
1381
+ var createListenerEntry = /* @__PURE__ */ assign((options) => {
1382
+ const { type, predicate, effect } = getListenerEntryPropsFrom(options);
1383
+ return {
1384
+ id: nanoid(),
1385
+ effect,
1386
+ type,
1387
+ predicate,
1388
+ pending: /* @__PURE__ */ new Set(),
1389
+ unsubscribe: () => {
1390
+ throw new Error(formatProdErrorMessage(22));
1391
+ }
1392
+ };
1393
+ }, { withTypes: () => createListenerEntry });
1394
+ var findListenerEntry = (listenerMap, options) => {
1395
+ const { type, effect, predicate } = getListenerEntryPropsFrom(options);
1396
+ return Array.from(listenerMap.values()).find((entry) => {
1397
+ return (typeof type === "string" ? entry.type === type : entry.predicate === predicate) && entry.effect === effect;
1398
+ });
1399
+ };
1400
+ var cancelActiveListeners = (entry) => {
1401
+ entry.pending.forEach((controller) => {
1402
+ controller.abort(listenerCancelled);
1403
+ });
1404
+ };
1405
+ var createClearListenerMiddleware = (listenerMap, executingListeners) => {
1406
+ return () => {
1407
+ for (const listener2 of executingListeners.keys()) cancelActiveListeners(listener2);
1408
+ listenerMap.clear();
1409
+ };
1410
+ };
1411
+ var safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => {
1412
+ try {
1413
+ errorHandler(errorToNotify, errorInfo);
1414
+ } catch (errorHandlerError) {
1415
+ setTimeout(() => {
1416
+ throw errorHandlerError;
1417
+ }, 0);
1418
+ }
1419
+ };
1420
+ var addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), { withTypes: () => addListener });
1421
+ var clearAllListeners = /* @__PURE__ */ createAction(`${alm}/removeAll`);
1422
+ var removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), { withTypes: () => removeListener });
1423
+ var defaultErrorHandler = (...args) => {
1424
+ console.error(`${alm}/error`, ...args);
1425
+ };
1426
+ var createListenerMiddleware = (middlewareOptions = {}) => {
1427
+ const listenerMap = /* @__PURE__ */ new Map();
1428
+ const executingListeners = /* @__PURE__ */ new Map();
1429
+ const trackExecutingListener = (entry) => {
1430
+ const count = executingListeners.get(entry) ?? 0;
1431
+ executingListeners.set(entry, count + 1);
1432
+ };
1433
+ const untrackExecutingListener = (entry) => {
1434
+ const count = executingListeners.get(entry) ?? 1;
1435
+ if (count === 1) executingListeners.delete(entry);
1436
+ else executingListeners.set(entry, count - 1);
1437
+ };
1438
+ const { extra, onError = defaultErrorHandler } = middlewareOptions;
1439
+ assertFunction(onError, "onError");
1440
+ const insertEntry = (entry) => {
1441
+ entry.unsubscribe = () => listenerMap.delete(entry.id);
1442
+ listenerMap.set(entry.id, entry);
1443
+ return (cancelOptions) => {
1444
+ entry.unsubscribe();
1445
+ if (cancelOptions?.cancelActive) cancelActiveListeners(entry);
1446
+ };
1447
+ };
1448
+ const startListening = ((options) => {
1449
+ return insertEntry(findListenerEntry(listenerMap, options) ?? createListenerEntry(options));
1450
+ });
1451
+ assign(startListening, { withTypes: () => startListening });
1452
+ const stopListening = (options) => {
1453
+ const entry = findListenerEntry(listenerMap, options);
1454
+ if (entry) {
1455
+ entry.unsubscribe();
1456
+ if (options.cancelActive) cancelActiveListeners(entry);
1457
+ }
1458
+ return !!entry;
1459
+ };
1460
+ assign(stopListening, { withTypes: () => stopListening });
1461
+ const notifyListener = async (entry, action, api, getOriginalState) => {
1462
+ const internalTaskController = new AbortController();
1463
+ const take = createTakePattern(startListening, internalTaskController.signal);
1464
+ const autoJoinPromises = [];
1465
+ try {
1466
+ entry.pending.add(internalTaskController);
1467
+ trackExecutingListener(entry);
1468
+ await Promise.resolve(entry.effect(action, assign({}, api, {
1469
+ getOriginalState,
1470
+ condition: (predicate, timeout) => take(predicate, timeout).then(Boolean),
1471
+ take,
1472
+ delay: createDelay(internalTaskController.signal),
1473
+ pause: createPause(internalTaskController.signal),
1474
+ extra,
1475
+ signal: internalTaskController.signal,
1476
+ fork: createFork(internalTaskController.signal, autoJoinPromises),
1477
+ unsubscribe: entry.unsubscribe,
1478
+ subscribe: () => {
1479
+ listenerMap.set(entry.id, entry);
1480
+ },
1481
+ cancelActiveListeners: () => {
1482
+ entry.pending.forEach((controller, _, set) => {
1483
+ if (controller !== internalTaskController) {
1484
+ controller.abort(listenerCancelled);
1485
+ set.delete(controller);
1486
+ }
1487
+ });
1488
+ },
1489
+ cancel: () => {
1490
+ internalTaskController.abort(listenerCancelled);
1491
+ entry.pending.delete(internalTaskController);
1492
+ },
1493
+ throwIfCancelled: () => {
1494
+ validateActive(internalTaskController.signal);
1495
+ }
1496
+ })));
1497
+ } catch (listenerError) {
1498
+ if (!(listenerError instanceof TaskAbortError)) safelyNotifyError(onError, listenerError, { raisedBy: "effect" });
1499
+ } finally {
1500
+ await Promise.all(autoJoinPromises);
1501
+ internalTaskController.abort(listenerCompleted);
1502
+ untrackExecutingListener(entry);
1503
+ entry.pending.delete(internalTaskController);
1504
+ }
1505
+ };
1506
+ const clearListenerMiddleware = createClearListenerMiddleware(listenerMap, executingListeners);
1507
+ const middleware = (api) => (next) => (action) => {
1508
+ if (!isAction(action)) return next(action);
1509
+ if (addListener.match(action)) return startListening(action.payload);
1510
+ if (clearAllListeners.match(action)) {
1511
+ clearListenerMiddleware();
1512
+ return;
1513
+ }
1514
+ if (removeListener.match(action)) return stopListening(action.payload);
1515
+ let originalState = api.getState();
1516
+ const getOriginalState = () => {
1517
+ if (originalState === INTERNAL_NIL_TOKEN) throw new Error(formatProdErrorMessage(23));
1518
+ return originalState;
1519
+ };
1520
+ let result;
1521
+ try {
1522
+ result = next(action);
1523
+ if (listenerMap.size > 0) {
1524
+ const currentState = api.getState();
1525
+ const listenerEntries = Array.from(listenerMap.values());
1526
+ for (const entry of listenerEntries) {
1527
+ let runListener = false;
1528
+ try {
1529
+ runListener = entry.predicate(action, currentState, originalState);
1530
+ } catch (predicateError) {
1531
+ runListener = false;
1532
+ safelyNotifyError(onError, predicateError, { raisedBy: "predicate" });
1533
+ }
1534
+ if (!runListener) continue;
1535
+ notifyListener(entry, action, api, getOriginalState);
1536
+ }
1537
+ }
1538
+ } finally {
1539
+ originalState = INTERNAL_NIL_TOKEN;
1540
+ }
1541
+ return result;
1542
+ };
1543
+ return {
1544
+ middleware,
1545
+ startListening,
1546
+ stopListening,
1547
+ clearListeners: clearListenerMiddleware
1548
+ };
1549
+ };
1550
+ function formatProdErrorMessage(code) {
1551
+ return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
1552
+ }
1553
+ //#endregion
1554
+ export { createSlice as a, combineReducers as c, createListenerMiddleware as i, configureStore as n, prepareAutoBatched as o, createAction as r, current as s, autoBatchEnhancer as t };