@questpie/admin 3.2.3 → 3.2.5

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 (244) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +2 -2
  2. package/dist/client/blocks/block-renderer.mjs +164 -339
  3. package/dist/client/components/actions/action-button.mjs +9 -9
  4. package/dist/client/components/actions/action-dialog.mjs +195 -493
  5. package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
  6. package/dist/client/components/actions/header-actions.mjs +73 -165
  7. package/dist/client/components/admin-link.d.mts +2 -2
  8. package/dist/client/components/admin-link.mjs +40 -126
  9. package/dist/client/components/auth/auth-loading.mjs +9 -44
  10. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  11. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  12. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  13. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  14. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  15. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  16. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  17. package/dist/client/components/blocks/block-item.mjs +136 -370
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +106 -220
  19. package/dist/client/components/blocks/block-tree.mjs +12 -68
  20. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  21. package/dist/client/components/brand-logo.mjs +35 -149
  22. package/dist/client/components/component-renderer.mjs +42 -118
  23. package/dist/client/components/error-boundary.mjs +14 -58
  24. package/dist/client/components/fields/array-field.mjs +209 -521
  25. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  26. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  27. package/dist/client/components/fields/boolean-field.mjs +29 -59
  28. package/dist/client/components/fields/date-field.mjs +7 -37
  29. package/dist/client/components/fields/datetime-field.mjs +7 -38
  30. package/dist/client/components/fields/email-field.mjs +25 -54
  31. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  32. package/dist/client/components/fields/json-field.mjs +107 -313
  33. package/dist/client/components/fields/locale-badge.mjs +6 -15
  34. package/dist/client/components/fields/number-field.mjs +27 -60
  35. package/dist/client/components/fields/object-array-field.mjs +283 -659
  36. package/dist/client/components/fields/object-field.mjs +165 -633
  37. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  38. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  39. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  40. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  41. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  42. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  43. package/dist/client/components/fields/relation-field.mjs +10 -66
  44. package/dist/client/components/fields/relation-picker.mjs +18 -18
  45. package/dist/client/components/fields/relation-select.mjs +12 -12
  46. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -182
  47. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
  48. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  49. package/dist/client/components/fields/rich-text-editor/index.mjs +196 -530
  50. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  51. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  52. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  53. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  54. package/dist/client/components/fields/select-field.mjs +39 -74
  55. package/dist/client/components/fields/text-field.mjs +26 -59
  56. package/dist/client/components/fields/textarea-field.mjs +26 -58
  57. package/dist/client/components/fields/time-field.mjs +7 -35
  58. package/dist/client/components/fields/upload-field.mjs +47 -165
  59. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  60. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  61. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  62. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  63. package/dist/client/components/history-sidebar.mjs +306 -611
  64. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  65. package/dist/client/components/locale-switcher.mjs +106 -228
  66. package/dist/client/components/media/media-grid.mjs +84 -273
  67. package/dist/client/components/media/media-picker-dialog.mjs +177 -494
  68. package/dist/client/components/preview/live-preview-mode.mjs +240 -438
  69. package/dist/client/components/preview/preview-pane.mjs +22 -22
  70. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  71. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  72. package/dist/client/components/primitives/date-input.mjs +109 -327
  73. package/dist/client/components/primitives/dropzone.mjs +209 -336
  74. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  75. package/dist/client/components/primitives/number-input.mjs +4 -4
  76. package/dist/client/components/primitives/select-multi.mjs +200 -559
  77. package/dist/client/components/primitives/select-single.mjs +165 -499
  78. package/dist/client/components/primitives/time-input.mjs +43 -117
  79. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  80. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  81. package/dist/client/components/ui/accordion.mjs +35 -155
  82. package/dist/client/components/ui/alert.mjs +13 -68
  83. package/dist/client/components/ui/badge.mjs +9 -51
  84. package/dist/client/components/ui/button.mjs +8 -54
  85. package/dist/client/components/ui/card.mjs +37 -193
  86. package/dist/client/components/ui/checkbox.mjs +12 -68
  87. package/dist/client/components/ui/command.mjs +48 -219
  88. package/dist/client/components/ui/dialog.mjs +50 -262
  89. package/dist/client/components/ui/drawer.mjs +55 -259
  90. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  91. package/dist/client/components/ui/empty-state.mjs +28 -98
  92. package/dist/client/components/ui/field.mjs +73 -309
  93. package/dist/client/components/ui/input-group.mjs +42 -167
  94. package/dist/client/components/ui/input.mjs +7 -37
  95. package/dist/client/components/ui/kbd.mjs +6 -36
  96. package/dist/client/components/ui/label.mjs +7 -37
  97. package/dist/client/components/ui/popover.mjs +34 -169
  98. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  99. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  100. package/dist/client/components/ui/search-input.mjs +33 -100
  101. package/dist/client/components/ui/select.mjs +72 -393
  102. package/dist/client/components/ui/separator.mjs +7 -38
  103. package/dist/client/components/ui/sheet.mjs +49 -269
  104. package/dist/client/components/ui/sidebar.mjs +171 -690
  105. package/dist/client/components/ui/skeleton.mjs +7 -38
  106. package/dist/client/components/ui/sonner.mjs +11 -42
  107. package/dist/client/components/ui/switch.mjs +9 -45
  108. package/dist/client/components/ui/table.mjs +48 -266
  109. package/dist/client/components/ui/tabs.mjs +26 -139
  110. package/dist/client/components/ui/textarea.mjs +6 -32
  111. package/dist/client/components/ui/tooltip.mjs +27 -129
  112. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  113. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  114. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  115. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  116. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  117. package/dist/client/components/widgets/table-widget.mjs +9 -9
  118. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  119. package/dist/client/components/widgets/value-widget.mjs +74 -381
  120. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  121. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  122. package/dist/client/contexts/focus-context.d.mts +4 -0
  123. package/dist/client/contexts/focus-context.mjs +87 -150
  124. package/dist/client/hooks/typed-hooks.mjs +241 -701
  125. package/dist/client/hooks/use-action.mjs +62 -198
  126. package/dist/client/hooks/use-admin-config.mjs +5 -35
  127. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  128. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  129. package/dist/client/hooks/use-audit-history.mjs +21 -69
  130. package/dist/client/hooks/use-brand.mjs +1 -9
  131. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  132. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  133. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  134. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  135. package/dist/client/hooks/use-collection.mjs +194 -614
  136. package/dist/client/hooks/use-current-user.mjs +0 -1
  137. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  138. package/dist/client/hooks/use-field-options.mjs +61 -202
  139. package/dist/client/hooks/use-global-fields.mjs +14 -46
  140. package/dist/client/hooks/use-global-meta.mjs +9 -30
  141. package/dist/client/hooks/use-global-schema.mjs +9 -30
  142. package/dist/client/hooks/use-global.mjs +63 -219
  143. package/dist/client/hooks/use-locks.mjs +117 -325
  144. package/dist/client/hooks/use-media-query.mjs +16 -36
  145. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  146. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  147. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  148. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  149. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  150. package/dist/client/hooks/use-saved-views.mjs +22 -103
  151. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  152. package/dist/client/hooks/use-search.mjs +31 -143
  153. package/dist/client/hooks/use-server-actions.mjs +18 -50
  154. package/dist/client/hooks/use-server-validation.mjs +72 -166
  155. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  156. package/dist/client/hooks/use-setup-status.mjs +12 -25
  157. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  158. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  159. package/dist/client/hooks/use-upload.mjs +54 -152
  160. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  161. package/dist/client/hooks/use-view-state.mjs +187 -437
  162. package/dist/client/i18n/hooks.mjs +65 -197
  163. package/dist/client/lib/render-profiler.mjs +14 -41
  164. package/dist/client/preview/block-scope-context.d.mts +2 -2
  165. package/dist/client/preview/block-scope-context.mjs +14 -36
  166. package/dist/client/preview/diff.mjs +110 -0
  167. package/dist/client/preview/preview-banner.mjs +42 -108
  168. package/dist/client/preview/preview-field.d.mts +4 -4
  169. package/dist/client/preview/preview-field.mjs +166 -409
  170. package/dist/client/preview/use-collection-preview.mjs +135 -201
  171. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  172. package/dist/client/runtime/locale-scope.mjs +22 -63
  173. package/dist/client/runtime/provider.mjs +100 -255
  174. package/dist/client/runtime/translations-provider.mjs +41 -107
  175. package/dist/client/scope/picker.d.mts +2 -2
  176. package/dist/client/scope/picker.mjs +86 -321
  177. package/dist/client/scope/provider.d.mts +2 -2
  178. package/dist/client/scope/provider.mjs +8 -17
  179. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  180. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  181. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  182. package/dist/client/views/auth/auth-layout.mjs +104 -284
  183. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  184. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  185. package/dist/client/views/auth/invite-form.mjs +107 -442
  186. package/dist/client/views/auth/login-form.d.mts +2 -2
  187. package/dist/client/views/auth/login-form.mjs +116 -337
  188. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  189. package/dist/client/views/auth/setup-form.mjs +140 -478
  190. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  191. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
  192. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  193. package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
  194. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  195. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  196. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  197. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  198. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  199. package/dist/client/views/collection/field-renderer.mjs +11 -24
  200. package/dist/client/views/collection/form-view.mjs +288 -560
  201. package/dist/client/views/collection/table-view.mjs +239 -469
  202. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  203. package/dist/client/views/common/global-search.mjs +241 -543
  204. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  205. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  206. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  207. package/dist/client/views/globals/global-form-view.mjs +478 -1298
  208. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  209. package/dist/client/views/layout/admin-layout.mjs +83 -246
  210. package/dist/client/views/layout/admin-router.mjs +457 -1289
  211. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  212. package/dist/client/views/layout/admin-theme.mjs +30 -64
  213. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  216. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  217. package/dist/client/views/pages/invite-page.mjs +35 -90
  218. package/dist/client/views/pages/login-page.mjs +41 -121
  219. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  220. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  221. package/dist/client/views/pages/setup-page.d.mts +2 -2
  222. package/dist/client/views/pages/setup-page.mjs +33 -95
  223. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  224. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  225. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  226. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  227. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  228. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  229. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  230. package/dist/server/modules/admin/collections/assets.d.mts +34 -34
  231. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  232. package/dist/server/modules/admin/collections/user.d.mts +53 -53
  233. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  234. package/dist/server/modules/admin/index.d.mts +21 -20
  235. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  236. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  237. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  238. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  239. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  240. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  241. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  242. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  243. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
  244. package/package.json +3 -5
@@ -13,7 +13,6 @@ import { getGlobalMetaQueryOptions } from "../../hooks/use-global-meta.mjs";
13
13
  import { AdminViewHeader } from "./admin-view-layout.mjs";
14
14
  import { FormViewSkeleton, TableViewSkeleton } from "../collection/view-skeletons.mjs";
15
15
  import { DashboardGrid } from "../dashboard/dashboard-grid.mjs";
16
- import { c } from "react/compiler-runtime";
17
16
  import { Icon } from "@iconify/react";
18
17
  import * as React from "react";
19
18
  import { useQueryClient } from "@tanstack/react-query";
@@ -49,92 +48,36 @@ const componentLoaderCache = /* @__PURE__ */ new WeakMap();
49
48
  * Suspends until server config is loaded - no loading checks needed.
50
49
  */
51
50
  function useRouterConfig(props) {
52
- const $ = c(20);
53
- const admin = useAdminStore(_temp);
51
+ const admin = useAdminStore((s) => s.admin);
54
52
  const { data: serverConfig } = useSuspenseAdminConfig();
55
- let t0;
56
- if ($[0] !== admin) {
57
- t0 = admin.getPages();
58
- $[0] = admin;
59
- $[1] = t0;
60
- } else t0 = $[1];
61
- const storePages = t0;
62
- let t1;
63
- if ($[2] !== admin) {
64
- t1 = admin.getViews();
65
- $[2] = admin;
66
- $[3] = t1;
67
- } else t1 = $[3];
68
- const storeViews = t1;
53
+ const storePages = admin.getPages();
54
+ const storeViews = admin.getViews();
69
55
  let serverCollections;
70
56
  if (props.collections) serverCollections = props.collections;
71
- else if ($[4] !== serverConfig) {
57
+ else {
72
58
  serverCollections = {};
73
- if (serverConfig?.collections) {
74
- let t2$1;
75
- if ($[6] !== serverConfig.collections) {
76
- t2$1 = Object.entries(serverConfig.collections);
77
- $[6] = serverConfig.collections;
78
- $[7] = t2$1;
79
- } else t2$1 = $[7];
80
- for (const [name, meta] of t2$1) serverCollections[name] = meta ?? {};
81
- }
82
- $[4] = serverConfig;
83
- $[5] = serverCollections;
84
- } else serverCollections = $[5];
59
+ if (serverConfig?.collections) for (const [name, meta] of Object.entries(serverConfig.collections)) serverCollections[name] = meta ?? {};
60
+ }
85
61
  let serverGlobals;
86
62
  if (props.globals) serverGlobals = props.globals;
87
- else if ($[8] !== serverConfig) {
63
+ else {
88
64
  serverGlobals = {};
89
- if (serverConfig?.globals) {
90
- let t2$1;
91
- if ($[10] !== serverConfig.globals) {
92
- t2$1 = Object.entries(serverConfig.globals);
93
- $[10] = serverConfig.globals;
94
- $[11] = t2$1;
95
- } else t2$1 = $[11];
96
- for (const [name_0, meta_0] of t2$1) serverGlobals[name_0] = meta_0 ?? {};
97
- }
98
- $[8] = serverConfig;
99
- $[9] = serverGlobals;
100
- } else serverGlobals = $[9];
101
- serverConfig?.dashboard;
102
- let t2;
103
- bb0: {
104
- const serverDashboard = serverConfig?.dashboard;
105
- if (serverDashboard?.items?.length) {
106
- t2 = serverDashboard;
107
- break bb0;
108
- }
109
- t2 = props.dashboardConfig;
65
+ if (serverConfig?.globals) for (const [name, meta] of Object.entries(serverConfig.globals)) serverGlobals[name] = meta ?? {};
110
66
  }
111
- const mergedDashboard = t2;
112
- const t3 = props.pages ?? storePages;
113
- const t4 = serverConfig?.branding?.name;
114
- let t5;
115
- if ($[12] !== mergedDashboard || $[13] !== props.DashboardComponent || $[14] !== serverCollections || $[15] !== serverGlobals || $[16] !== storeViews || $[17] !== t3 || $[18] !== t4) {
116
- t5 = {
117
- collections: serverCollections,
118
- globals: serverGlobals,
119
- pages: t3,
120
- views: storeViews,
121
- brandingName: t4,
122
- dashboardConfig: mergedDashboard,
123
- DashboardComponent: props.DashboardComponent
124
- };
125
- $[12] = mergedDashboard;
126
- $[13] = props.DashboardComponent;
127
- $[14] = serverCollections;
128
- $[15] = serverGlobals;
129
- $[16] = storeViews;
130
- $[17] = t3;
131
- $[18] = t4;
132
- $[19] = t5;
133
- } else t5 = $[19];
134
- return t5;
135
- }
136
- function _temp(s) {
137
- return s.admin;
67
+ const mergedDashboard = React.useMemo(() => {
68
+ const serverDashboard = serverConfig?.dashboard;
69
+ if (serverDashboard?.items?.length) return serverDashboard;
70
+ return props.dashboardConfig;
71
+ }, [props.dashboardConfig, serverConfig?.dashboard]);
72
+ return {
73
+ collections: serverCollections,
74
+ globals: serverGlobals,
75
+ pages: props.pages ?? storePages,
76
+ views: storeViews,
77
+ brandingName: serverConfig?.branding?.name,
78
+ dashboardConfig: mergedDashboard,
79
+ DashboardComponent: props.DashboardComponent
80
+ };
138
81
  }
139
82
  function matchRoute(segments, _collections = {}, globals = {}, pages = {}) {
140
83
  if (segments.length === 0) return { type: "dashboard" };
@@ -234,170 +177,94 @@ function cacheComponent(loader, Component) {
234
177
  if (!isDynamicImportLoader(loader)) return;
235
178
  componentLoaderCache.set(loader, Component);
236
179
  }
237
- function ViewLoadingState(t0) {
238
- const $ = c(2);
239
- const { viewKind } = t0;
240
- let t1;
241
- if ($[0] !== viewKind) {
242
- t1 = viewKind === "list" ? /* @__PURE__ */ jsx(TableViewSkeleton, {}) : /* @__PURE__ */ jsx(FormViewSkeleton, {});
243
- $[0] = viewKind;
244
- $[1] = t1;
245
- } else t1 = $[1];
246
- return t1;
180
+ function ViewLoadingState({ viewKind }) {
181
+ return viewKind === "list" ? /* @__PURE__ */ jsx(TableViewSkeleton, {}) : /* @__PURE__ */ jsx(FormViewSkeleton, {});
247
182
  }
248
- function UnknownViewState(t0) {
249
- const $ = c(13);
250
- const { viewKind, viewId } = t0;
183
+ function UnknownViewState({ viewKind, viewId }) {
251
184
  const { t } = useTranslation();
252
- let t1;
253
- if ($[0] !== t || $[1] !== viewKind) {
254
- t1 = t("error.failedToLoadView", { viewType: viewKind });
255
- $[0] = t;
256
- $[1] = viewKind;
257
- $[2] = t1;
258
- } else t1 = $[2];
259
- let t2;
260
- if ($[3] !== t1) {
261
- t2 = /* @__PURE__ */ jsx("h1", {
262
- className: "text-lg font-semibold",
263
- children: t1
264
- });
265
- $[3] = t1;
266
- $[4] = t2;
267
- } else t2 = $[4];
268
- let t3;
269
- if ($[5] !== t || $[6] !== viewId) {
270
- t3 = t("error.unregisteredViewDescription", { viewId });
271
- $[5] = t;
272
- $[6] = viewId;
273
- $[7] = t3;
274
- } else t3 = $[7];
275
- let t4;
276
- if ($[8] !== t3) {
277
- t4 = /* @__PURE__ */ jsx("p", {
278
- className: "text-muted-foreground mt-2 text-sm",
279
- children: t3
280
- });
281
- $[8] = t3;
282
- $[9] = t4;
283
- } else t4 = $[9];
284
- let t5;
285
- if ($[10] !== t2 || $[11] !== t4) {
286
- t5 = /* @__PURE__ */ jsx("div", {
287
- className: "container",
288
- children: /* @__PURE__ */ jsxs(Card, {
289
- className: "border-warning/30 bg-warning/5 p-6",
290
- children: [t2, t4]
291
- })
292
- });
293
- $[10] = t2;
294
- $[11] = t4;
295
- $[12] = t5;
296
- } else t5 = $[12];
297
- return t5;
185
+ return /* @__PURE__ */ jsx("div", {
186
+ className: "container",
187
+ children: /* @__PURE__ */ jsxs(Card, {
188
+ className: "border-warning/30 bg-warning/5 p-6",
189
+ children: [/* @__PURE__ */ jsx("h1", {
190
+ className: "text-lg font-semibold",
191
+ children: t("error.failedToLoadView", { viewType: viewKind })
192
+ }), /* @__PURE__ */ jsx("p", {
193
+ className: "text-muted-foreground mt-2 text-sm",
194
+ children: t("error.unregisteredViewDescription", { viewId })
195
+ })]
196
+ })
197
+ });
298
198
  }
299
199
  /**
300
200
  * Skeleton shown while router config is loading (Suspense fallback)
301
201
  */
302
202
  function RouterSkeleton() {
303
- const $ = c(3);
304
- let t0;
305
- let t1;
306
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
307
- t0 = /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48" });
308
- t1 = /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" });
309
- $[0] = t0;
310
- $[1] = t1;
311
- } else {
312
- t0 = $[0];
313
- t1 = $[1];
314
- }
315
- let t2;
316
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
317
- t2 = /* @__PURE__ */ jsxs("div", {
318
- className: "qa-router-skeleton container space-y-4 py-6",
319
- children: [
320
- t0,
321
- t1,
322
- /* @__PURE__ */ jsxs("div", {
323
- className: "space-y-2",
324
- children: [
325
- /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
326
- /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
327
- /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" })
328
- ]
329
- })
330
- ]
331
- });
332
- $[2] = t2;
333
- } else t2 = $[2];
334
- return t2;
203
+ return /* @__PURE__ */ jsxs("div", {
204
+ className: "qa-router-skeleton container space-y-4 py-6",
205
+ children: [
206
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48" }),
207
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
208
+ /* @__PURE__ */ jsxs("div", {
209
+ className: "space-y-2",
210
+ children: [
211
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
212
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
213
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" })
214
+ ]
215
+ })
216
+ ]
217
+ });
335
218
  }
336
219
  function AuthPageSkeleton() {
337
- const $ = c(3);
338
- let t0;
339
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
340
- t0 = /* @__PURE__ */ jsxs("aside", {
341
- className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
342
- children: [/* @__PURE__ */ jsxs("div", {
343
- className: "flex items-center gap-3",
344
- children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9" }), /* @__PURE__ */ jsx(Skeleton, {
220
+ return /* @__PURE__ */ jsx("div", {
221
+ className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
222
+ children: /* @__PURE__ */ jsxs("div", {
223
+ className: "qa-auth-layout__shell grid w-full max-w-4xl items-center gap-10 lg:grid-cols-[minmax(220px,280px)_minmax(360px,384px)] lg:gap-16",
224
+ children: [/* @__PURE__ */ jsxs("aside", {
225
+ className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
226
+ children: [/* @__PURE__ */ jsxs("div", {
227
+ className: "flex items-center gap-3",
228
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9" }), /* @__PURE__ */ jsx(Skeleton, {
229
+ variant: "text",
230
+ className: "h-4 w-36"
231
+ })]
232
+ }), /* @__PURE__ */ jsx(Skeleton, {
345
233
  variant: "text",
346
- className: "h-4 w-36"
234
+ className: "hidden h-3 w-40 lg:block"
347
235
  })]
348
- }), /* @__PURE__ */ jsx(Skeleton, {
349
- variant: "text",
350
- className: "hidden h-3 w-40 lg:block"
351
- })]
352
- });
353
- $[0] = t0;
354
- } else t0 = $[0];
355
- let t1;
356
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
357
- t1 = /* @__PURE__ */ jsxs("div", {
358
- className: "space-y-2",
359
- children: [/* @__PURE__ */ jsx(Skeleton, {
360
- variant: "text",
361
- className: "h-4 w-20"
362
- }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
363
- });
364
- $[1] = t1;
365
- } else t1 = $[1];
366
- let t2;
367
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
368
- t2 = /* @__PURE__ */ jsx("div", {
369
- className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
370
- children: /* @__PURE__ */ jsxs("div", {
371
- className: "qa-auth-layout__shell grid w-full max-w-4xl items-center gap-10 lg:grid-cols-[minmax(220px,280px)_minmax(360px,384px)] lg:gap-16",
372
- children: [t0, /* @__PURE__ */ jsx("main", {
373
- className: "qa-auth-layout__form-panel flex items-center justify-center",
374
- children: /* @__PURE__ */ jsx(Card, {
375
- className: "border-border-subtle w-full max-w-sm shadow-none",
376
- children: /* @__PURE__ */ jsxs("div", {
377
- className: "space-y-5 p-4",
378
- children: [
379
- t1,
380
- /* @__PURE__ */ jsxs("div", {
381
- className: "space-y-2",
382
- children: [/* @__PURE__ */ jsx(Skeleton, {
383
- variant: "text",
384
- className: "h-4 w-24"
385
- }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
386
- }),
387
- /* @__PURE__ */ jsx(Skeleton, {
236
+ }), /* @__PURE__ */ jsx("main", {
237
+ className: "qa-auth-layout__form-panel flex items-center justify-center",
238
+ children: /* @__PURE__ */ jsx(Card, {
239
+ className: "border-border-subtle w-full max-w-sm shadow-none",
240
+ children: /* @__PURE__ */ jsxs("div", {
241
+ className: "space-y-5 p-4",
242
+ children: [
243
+ /* @__PURE__ */ jsxs("div", {
244
+ className: "space-y-2",
245
+ children: [/* @__PURE__ */ jsx(Skeleton, {
388
246
  variant: "text",
389
- className: "h-4 w-28"
390
- }),
391
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
392
- ]
393
- })
247
+ className: "h-4 w-20"
248
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
249
+ }),
250
+ /* @__PURE__ */ jsxs("div", {
251
+ className: "space-y-2",
252
+ children: [/* @__PURE__ */ jsx(Skeleton, {
253
+ variant: "text",
254
+ className: "h-4 w-24"
255
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
256
+ }),
257
+ /* @__PURE__ */ jsx(Skeleton, {
258
+ variant: "text",
259
+ className: "h-4 w-28"
260
+ }),
261
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
262
+ ]
394
263
  })
395
- })]
396
- })
397
- });
398
- $[2] = t2;
399
- } else t2 = $[2];
400
- return t2;
264
+ })
265
+ })]
266
+ })
267
+ });
401
268
  }
402
269
  function getFallbackForSegments(segments) {
403
270
  const [first, second, third] = segments;
@@ -420,543 +287,223 @@ function areRegistryViewRendererPropsEqual(prev, next) {
420
287
  if (prev.viewId !== next.viewId) return false;
421
288
  return shallowEqualComponentProps(prev.componentProps, next.componentProps);
422
289
  }
423
- const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(t0) {
424
- const $ = c(18);
425
- const { loader, componentProps, viewKind, viewId } = t0;
426
- let t1;
427
- if ($[0] !== loader) {
428
- t1 = () => {
429
- const cachedComponent = getCachedComponent(loader);
430
- return {
431
- Component: cachedComponent ?? null,
432
- loading: !cachedComponent,
433
- error: null
434
- };
435
- };
436
- $[0] = loader;
437
- $[1] = t1;
438
- } else t1 = $[1];
439
- const [state, setState] = React.useState(t1);
440
- let t2;
441
- let t3;
442
- if ($[2] !== loader) {
443
- t2 = () => {
444
- if (!loader) {
445
- setState({
446
- Component: null,
447
- loading: false,
448
- error: null
449
- });
450
- return;
451
- }
452
- if (!isDynamicImportLoader(loader)) {
453
- setState({
454
- Component: loader,
455
- loading: false,
290
+ const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1({ loader, componentProps, viewKind, viewId }) {
291
+ const loaderIsDynamic = isDynamicImportLoader(loader);
292
+ const directComponent = loader && !loaderIsDynamic ? loader : null;
293
+ const cachedComponent = React.useMemo(() => loaderIsDynamic ? getCachedComponent(loader) ?? null : null, [loader, loaderIsDynamic]);
294
+ const needsAsyncLoad = loaderIsDynamic && !cachedComponent;
295
+ const [asyncState, setAsyncState] = React.useState({
296
+ loader: null,
297
+ Component: null,
298
+ error: null
299
+ });
300
+ React.useEffect(() => {
301
+ if (!needsAsyncLoad || !isDynamicImportLoader(loader)) return;
302
+ let mounted = true;
303
+ (async () => {
304
+ try {
305
+ const result = await loader();
306
+ if (!mounted) return;
307
+ let Component$1;
308
+ if (result.default) Component$1 = result.default;
309
+ else Component$1 = result;
310
+ cacheComponent(loader, Component$1);
311
+ setAsyncState({
312
+ loader,
313
+ Component: Component$1,
456
314
  error: null
457
315
  });
458
- return;
459
- }
460
- const cachedComponent_0 = getCachedComponent(loader);
461
- if (cachedComponent_0) {
462
- setState({
463
- Component: cachedComponent_0,
464
- loading: false,
465
- error: null
316
+ } catch (error$1) {
317
+ if (!mounted) return;
318
+ let resolvedError;
319
+ if (error$1 instanceof Error) resolvedError = error$1;
320
+ else resolvedError = /* @__PURE__ */ new Error("Failed to load view component");
321
+ setAsyncState({
322
+ loader,
323
+ Component: null,
324
+ error: resolvedError
466
325
  });
467
- return;
468
326
  }
469
- let mounted = true;
470
- setState(_temp2);
471
- (async () => {
472
- try {
473
- const result = await loader();
474
- if (!mounted) return;
475
- let Component;
476
- if (result.default) Component = result.default;
477
- else Component = result;
478
- cacheComponent(loader, Component);
479
- setState({
480
- Component,
481
- loading: false,
482
- error: null
483
- });
484
- } catch (t4$1) {
485
- const error = t4$1;
486
- if (!mounted) return;
487
- let resolvedError;
488
- if (error instanceof Error) resolvedError = error;
489
- else resolvedError = /* @__PURE__ */ new Error("Failed to load view component");
490
- setState({
491
- Component: null,
492
- loading: false,
493
- error: resolvedError
494
- });
495
- }
496
- })();
497
- return () => {
498
- mounted = false;
499
- };
327
+ })();
328
+ return () => {
329
+ mounted = false;
500
330
  };
501
- t3 = [loader];
502
- $[2] = loader;
503
- $[3] = t2;
504
- $[4] = t3;
505
- } else {
506
- t2 = $[3];
507
- t3 = $[4];
508
- }
509
- React.useEffect(t2, t3);
510
- if (state.loading) {
511
- let t4$1;
512
- if ($[5] !== viewKind) {
513
- t4$1 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
514
- $[5] = viewKind;
515
- $[6] = t4$1;
516
- } else t4$1 = $[6];
517
- return t4$1;
518
- }
519
- if (state.error || !state.Component) {
520
- let t4$1;
521
- if ($[7] !== viewId || $[8] !== viewKind) {
522
- t4$1 = /* @__PURE__ */ jsx(UnknownViewState, {
523
- viewKind,
524
- viewId
525
- });
526
- $[7] = viewId;
527
- $[8] = viewKind;
528
- $[9] = t4$1;
529
- } else t4$1 = $[9];
530
- return t4$1;
531
- }
532
- const Component_0 = state.Component;
533
- let t4;
534
- if ($[10] !== viewKind) {
535
- t4 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
536
- $[10] = viewKind;
537
- $[11] = t4;
538
- } else t4 = $[11];
539
- let t5;
540
- if ($[12] !== Component_0 || $[13] !== componentProps) {
541
- t5 = /* @__PURE__ */ jsx(Component_0, { ...componentProps });
542
- $[12] = Component_0;
543
- $[13] = componentProps;
544
- $[14] = t5;
545
- } else t5 = $[14];
546
- let t6;
547
- if ($[15] !== t4 || $[16] !== t5) {
548
- t6 = /* @__PURE__ */ jsx(React.Suspense, {
549
- fallback: t4,
550
- children: t5
551
- });
552
- $[15] = t4;
553
- $[16] = t5;
554
- $[17] = t6;
555
- } else t6 = $[17];
556
- return t6;
331
+ }, [loader, needsAsyncLoad]);
332
+ const asyncMatches = asyncState.loader === loader;
333
+ const Component = directComponent ?? cachedComponent ?? (asyncMatches ? asyncState.Component : null);
334
+ const error = asyncMatches ? asyncState.error : null;
335
+ if (needsAsyncLoad && !Component && !error) return /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
336
+ if (error || !Component) return /* @__PURE__ */ jsx(UnknownViewState, {
337
+ viewKind,
338
+ viewId
339
+ });
340
+ return /* @__PURE__ */ jsx(React.Suspense, {
341
+ fallback: /* @__PURE__ */ jsx(ViewLoadingState, { viewKind }),
342
+ children: /* @__PURE__ */ jsx(Component, { ...componentProps })
343
+ });
557
344
  }, areRegistryViewRendererPropsEqual);
558
345
  function DefaultDashboard() {
559
- const $ = c(27);
560
346
  const { t, formatDate } = useTranslation();
561
- let t0;
562
- if ($[0] !== formatDate) {
563
- t0 = formatDate(/* @__PURE__ */ new Date(), {
564
- weekday: "long",
565
- year: "numeric",
566
- month: "long",
567
- day: "numeric"
568
- });
569
- $[0] = formatDate;
570
- $[1] = t0;
571
- } else t0 = $[1];
572
- const date = t0;
573
- let t1;
574
- if ($[2] !== t) {
575
- t1 = t("dashboard.title");
576
- $[2] = t;
577
- $[3] = t1;
578
- } else t1 = $[3];
579
- let t2;
580
- if ($[4] !== date || $[5] !== t1) {
581
- t2 = /* @__PURE__ */ jsx(AdminViewHeader, {
347
+ const date = formatDate(/* @__PURE__ */ new Date(), {
348
+ weekday: "long",
349
+ year: "numeric",
350
+ month: "long",
351
+ day: "numeric"
352
+ });
353
+ return /* @__PURE__ */ jsxs("div", {
354
+ className: "qa-default-dashboard container",
355
+ children: [/* @__PURE__ */ jsx(AdminViewHeader, {
582
356
  className: "mb-4",
583
- title: t1,
357
+ title: t("dashboard.title"),
584
358
  meta: date
585
- });
586
- $[4] = date;
587
- $[5] = t1;
588
- $[6] = t2;
589
- } else t2 = $[6];
590
- let t3;
591
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
592
- t3 = /* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" });
593
- $[7] = t3;
594
- } else t3 = $[7];
595
- let t4;
596
- if ($[8] !== t) {
597
- t4 = t("dashboard.systemStatus");
598
- $[8] = t;
599
- $[9] = t4;
600
- } else t4 = $[9];
601
- let t5;
602
- if ($[10] !== t4) {
603
- t5 = /* @__PURE__ */ jsxs("div", {
604
- className: "mb-4 flex items-center gap-3",
605
- children: [t3, /* @__PURE__ */ jsx("h3", {
606
- className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
607
- children: t4
608
- })]
609
- });
610
- $[10] = t4;
611
- $[11] = t5;
612
- } else t5 = $[11];
613
- let t6;
614
- if ($[12] !== t) {
615
- t6 = t("dashboard.welcome");
616
- $[12] = t;
617
- $[13] = t6;
618
- } else t6 = $[13];
619
- let t7;
620
- if ($[14] !== t6) {
621
- t7 = /* @__PURE__ */ jsx("h2", {
622
- className: "mb-2 text-xl font-semibold",
623
- children: t6
624
- });
625
- $[14] = t6;
626
- $[15] = t7;
627
- } else t7 = $[15];
628
- let t8;
629
- if ($[16] !== t) {
630
- t8 = t("dashboard.welcomeDescription");
631
- $[16] = t;
632
- $[17] = t8;
633
- } else t8 = $[17];
634
- let t9;
635
- if ($[18] !== t8) {
636
- t9 = /* @__PURE__ */ jsx("p", {
637
- className: "text-muted-foreground text-sm leading-relaxed",
638
- children: t8
639
- });
640
- $[18] = t8;
641
- $[19] = t9;
642
- } else t9 = $[19];
643
- let t10;
644
- if ($[20] !== t5 || $[21] !== t7 || $[22] !== t9) {
645
- t10 = /* @__PURE__ */ jsx("div", {
359
+ }), /* @__PURE__ */ jsx("div", {
646
360
  className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",
647
361
  children: /* @__PURE__ */ jsx(Card, {
648
362
  className: "p-6",
649
363
  children: /* @__PURE__ */ jsxs("div", { children: [
650
- t5,
651
- t7,
652
- t9
364
+ /* @__PURE__ */ jsxs("div", {
365
+ className: "mb-4 flex items-center gap-3",
366
+ children: [/* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" }), /* @__PURE__ */ jsx("h3", {
367
+ className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
368
+ children: t("dashboard.systemStatus")
369
+ })]
370
+ }),
371
+ /* @__PURE__ */ jsx("h2", {
372
+ className: "mb-2 text-xl font-semibold",
373
+ children: t("dashboard.welcome")
374
+ }),
375
+ /* @__PURE__ */ jsx("p", {
376
+ className: "text-muted-foreground text-sm leading-relaxed",
377
+ children: t("dashboard.welcomeDescription")
378
+ })
653
379
  ] })
654
380
  })
655
- });
656
- $[20] = t5;
657
- $[21] = t7;
658
- $[22] = t9;
659
- $[23] = t10;
660
- } else t10 = $[23];
661
- let t11;
662
- if ($[24] !== t10 || $[25] !== t2) {
663
- t11 = /* @__PURE__ */ jsxs("div", {
664
- className: "qa-default-dashboard container",
665
- children: [t2, t10]
666
- });
667
- $[24] = t10;
668
- $[25] = t2;
669
- $[26] = t11;
670
- } else t11 = $[26];
671
- return t11;
381
+ })]
382
+ });
672
383
  }
673
384
  function DefaultNotFound() {
674
- const $ = c(11);
675
385
  const { t } = useTranslation();
676
- let t0;
677
- if ($[0] !== t) {
678
- t0 = t("error.pageNotFound");
679
- $[0] = t;
680
- $[1] = t0;
681
- } else t0 = $[1];
682
- let t1;
683
- if ($[2] !== t0) {
684
- t1 = /* @__PURE__ */ jsx("h1", {
386
+ return /* @__PURE__ */ jsxs("div", {
387
+ className: "qa-not-found container",
388
+ children: [/* @__PURE__ */ jsx("h1", {
685
389
  className: "mb-4 text-2xl font-bold",
686
- children: t0
687
- });
688
- $[2] = t0;
689
- $[3] = t1;
690
- } else t1 = $[3];
691
- let t2;
692
- if ($[4] !== t) {
693
- t2 = t("error.pageNotFoundDescription");
694
- $[4] = t;
695
- $[5] = t2;
696
- } else t2 = $[5];
697
- let t3;
698
- if ($[6] !== t2) {
699
- t3 = /* @__PURE__ */ jsx("p", {
390
+ children: t("error.pageNotFound")
391
+ }), /* @__PURE__ */ jsx("p", {
700
392
  className: "text-muted-foreground",
701
- children: t2
702
- });
703
- $[6] = t2;
704
- $[7] = t3;
705
- } else t3 = $[7];
706
- let t4;
707
- if ($[8] !== t1 || $[9] !== t3) {
708
- t4 = /* @__PURE__ */ jsxs("div", {
709
- className: "qa-not-found container",
710
- children: [t1, t3]
711
- });
712
- $[8] = t1;
713
- $[9] = t3;
714
- $[10] = t4;
715
- } else t4 = $[10];
716
- return t4;
393
+ children: t("error.pageNotFoundDescription")
394
+ })]
395
+ });
717
396
  }
718
- function RestrictedAccess(t0) {
719
- const $ = c(24);
720
- const { type, name, navigate, basePath } = t0;
397
+ function RestrictedAccess({ type, name, navigate, basePath }) {
721
398
  const { t } = useTranslation();
722
- let t1;
723
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
724
- t1 = /* @__PURE__ */ jsx("div", {
725
- className: "bg-muted mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full",
726
- children: /* @__PURE__ */ jsx(Icon, {
727
- icon: "ph:lock-simple",
728
- className: "text-muted-foreground h-8 w-8"
729
- })
730
- });
731
- $[0] = t1;
732
- } else t1 = $[0];
733
- let t2;
734
- if ($[1] !== t) {
735
- t2 = t("error.accessRestricted");
736
- $[1] = t;
737
- $[2] = t2;
738
- } else t2 = $[2];
739
- let t3;
740
- if ($[3] !== t2) {
741
- t3 = /* @__PURE__ */ jsx("h1", {
742
- className: "mb-2 text-xl font-semibold",
743
- children: t2
744
- });
745
- $[3] = t2;
746
- $[4] = t3;
747
- } else t3 = $[4];
748
- let t4;
749
- if ($[5] !== name || $[6] !== t || $[7] !== type) {
750
- t4 = t("error.accessRestrictedResourceDescription", {
751
- type,
752
- name
753
- });
754
- $[5] = name;
755
- $[6] = t;
756
- $[7] = type;
757
- $[8] = t4;
758
- } else t4 = $[8];
759
- let t5;
760
- if ($[9] !== t4) {
761
- t5 = /* @__PURE__ */ jsx("p", {
762
- className: "text-muted-foreground mb-6 text-sm",
763
- children: t4
764
- });
765
- $[9] = t4;
766
- $[10] = t5;
767
- } else t5 = $[10];
768
- let t6;
769
- if ($[11] !== basePath || $[12] !== navigate) {
770
- t6 = () => navigate(basePath);
771
- $[11] = basePath;
772
- $[12] = navigate;
773
- $[13] = t6;
774
- } else t6 = $[13];
775
- let t7;
776
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
777
- t7 = /* @__PURE__ */ jsx(Icon, {
778
- icon: "ph:arrow-left",
779
- className: "h-4 w-4"
780
- });
781
- $[14] = t7;
782
- } else t7 = $[14];
783
- let t8;
784
- if ($[15] !== t) {
785
- t8 = t("error.backToDashboard");
786
- $[15] = t;
787
- $[16] = t8;
788
- } else t8 = $[16];
789
- let t9;
790
- if ($[17] !== t6 || $[18] !== t8) {
791
- t9 = /* @__PURE__ */ jsxs(Button, {
792
- variant: "outline",
793
- onClick: t6,
794
- children: [t7, t8]
795
- });
796
- $[17] = t6;
797
- $[18] = t8;
798
- $[19] = t9;
799
- } else t9 = $[19];
800
- let t10;
801
- if ($[20] !== t3 || $[21] !== t5 || $[22] !== t9) {
802
- t10 = /* @__PURE__ */ jsx("div", {
803
- className: "qa-restricted-access container py-12",
804
- children: /* @__PURE__ */ jsx(Card, {
805
- className: "mx-auto max-w-lg p-8 text-center",
806
- children: /* @__PURE__ */ jsxs("div", { children: [
807
- t1,
808
- t3,
809
- t5,
810
- t9
811
- ] })
812
- })
813
- });
814
- $[20] = t3;
815
- $[21] = t5;
816
- $[22] = t9;
817
- $[23] = t10;
818
- } else t10 = $[23];
819
- return t10;
399
+ return /* @__PURE__ */ jsx("div", {
400
+ className: "qa-restricted-access container py-12",
401
+ children: /* @__PURE__ */ jsx(Card, {
402
+ className: "mx-auto max-w-lg p-8 text-center",
403
+ children: /* @__PURE__ */ jsxs("div", { children: [
404
+ /* @__PURE__ */ jsx("div", {
405
+ className: "bg-muted mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full",
406
+ children: /* @__PURE__ */ jsx(Icon, {
407
+ icon: "ph:lock-simple",
408
+ className: "text-muted-foreground h-8 w-8"
409
+ })
410
+ }),
411
+ /* @__PURE__ */ jsx("h1", {
412
+ className: "mb-2 text-xl font-semibold",
413
+ children: t("error.accessRestricted")
414
+ }),
415
+ /* @__PURE__ */ jsx("p", {
416
+ className: "text-muted-foreground mb-6 text-sm",
417
+ children: t("error.accessRestrictedResourceDescription", {
418
+ type,
419
+ name
420
+ })
421
+ }),
422
+ /* @__PURE__ */ jsxs(Button, {
423
+ variant: "outline",
424
+ onClick: () => navigate(basePath),
425
+ children: [/* @__PURE__ */ jsx(Icon, {
426
+ icon: "ph:arrow-left",
427
+ className: "h-4 w-4"
428
+ }), t("error.backToDashboard")]
429
+ })
430
+ ] })
431
+ })
432
+ });
820
433
  }
821
- function LazyPageRenderer(t0) {
822
- const $ = c(21);
823
- const { config } = t0;
434
+ function LazyPageRenderer({ config }) {
824
435
  const { t } = useTranslation();
825
436
  const component = config.component;
826
- let t1;
827
- if ($[0] !== component) {
828
- t1 = () => getCachedComponent(component) ?? null;
829
- $[0] = component;
830
- $[1] = t1;
831
- } else t1 = $[1];
832
- const [Component, setComponent] = React.useState(t1);
833
- let t2;
834
- if ($[2] !== Component) {
835
- t2 = () => Component == null;
836
- $[2] = Component;
837
- $[3] = t2;
838
- } else t2 = $[3];
839
- const [loading, setLoading] = React.useState(t2);
437
+ const [Component, setComponent] = React.useState(() => getCachedComponent(component) ?? null);
438
+ const [loading, setLoading] = React.useState(() => Component == null);
840
439
  const [error, setError] = React.useState(null);
841
- let t3;
842
- let t4;
843
- if ($[4] !== component || $[5] !== t) {
844
- t3 = () => {
845
- let mounted = true;
846
- (async function load() {
847
- try {
848
- const cachedComponent = getCachedComponent(component);
849
- if (cachedComponent) {
850
- if (mounted) {
851
- setComponent(() => cachedComponent);
852
- setLoading(false);
853
- setError(null);
854
- }
855
- return;
856
- }
440
+ React.useEffect(() => {
441
+ let mounted = true;
442
+ async function load() {
443
+ try {
444
+ const cachedComponent = getCachedComponent(component);
445
+ if (cachedComponent) {
857
446
  if (mounted) {
858
- setLoading(true);
447
+ setComponent(() => cachedComponent);
448
+ setLoading(false);
859
449
  setError(null);
860
450
  }
861
- if (typeof component === "function") {
862
- const result = component();
863
- let isThenable = false;
864
- if (result != null) {
865
- if (typeof result.then === "function") isThenable = true;
866
- }
867
- if (isThenable) {
868
- const mod = await result;
869
- if (mounted) {
870
- let resolved;
871
- if (mod.default) resolved = mod.default;
872
- else resolved = mod;
873
- cacheComponent(component, resolved);
874
- setComponent(() => resolved);
875
- }
876
- } else if (mounted) setComponent(() => component);
877
- } else if (component) {
878
- if (mounted) setComponent(() => component);
879
- }
880
- if (mounted) setLoading(false);
881
- } catch (t5$1) {
882
- const err = t5$1;
883
- if (mounted) {
884
- let resolvedError;
885
- if (err instanceof Error) resolvedError = err;
886
- else resolvedError = new Error(t("error.failedToLoad"));
887
- setError(resolvedError);
451
+ return;
452
+ }
453
+ if (mounted) {
454
+ setLoading(true);
455
+ setError(null);
456
+ }
457
+ if (typeof component === "function") {
458
+ const result = component();
459
+ let isThenable = false;
460
+ if (result != null) {
461
+ if (typeof result.then === "function") isThenable = true;
888
462
  }
889
- if (mounted) setLoading(false);
463
+ if (isThenable) {
464
+ const mod = await result;
465
+ if (mounted) {
466
+ let resolved;
467
+ if (mod.default) resolved = mod.default;
468
+ else resolved = mod;
469
+ cacheComponent(component, resolved);
470
+ setComponent(() => resolved);
471
+ }
472
+ } else if (mounted) setComponent(() => component);
473
+ } else if (component) {
474
+ if (mounted) setComponent(() => component);
890
475
  }
891
- })();
892
- return () => {
893
- mounted = false;
894
- };
476
+ if (mounted) setLoading(false);
477
+ } catch (err) {
478
+ if (mounted) {
479
+ let resolvedError;
480
+ if (err instanceof Error) resolvedError = err;
481
+ else resolvedError = new Error(t("error.failedToLoad"));
482
+ setError(resolvedError);
483
+ }
484
+ if (mounted) setLoading(false);
485
+ }
486
+ }
487
+ load();
488
+ return () => {
489
+ mounted = false;
895
490
  };
896
- t4 = [component, t];
897
- $[4] = component;
898
- $[5] = t;
899
- $[6] = t3;
900
- $[7] = t4;
901
- } else {
902
- t3 = $[6];
903
- t4 = $[7];
904
- }
905
- React.useEffect(t3, t4);
491
+ }, [component, t]);
906
492
  if (loading) {
907
- let t5$1;
908
- if ($[8] !== config.path) {
909
- const path = config.path?.replace(/^\//, "") ?? "";
910
- t5$1 = AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
911
- $[8] = config.path;
912
- $[9] = t5$1;
913
- } else t5$1 = $[9];
914
- return t5$1;
493
+ const path = config.path?.replace(/^\//, "") ?? "";
494
+ return AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
915
495
  }
916
- if (error) {
917
- let t5$1;
918
- if ($[10] !== t) {
919
- t5$1 = t("error.unexpectedError");
920
- $[10] = t;
921
- $[11] = t5$1;
922
- } else t5$1 = $[11];
923
- let t6;
924
- if ($[12] !== t5$1) {
925
- t6 = /* @__PURE__ */ jsx("h1", {
926
- className: "text-destructive mb-4 text-2xl font-bold",
927
- children: t5$1
928
- });
929
- $[12] = t5$1;
930
- $[13] = t6;
931
- } else t6 = $[13];
932
- let t7;
933
- if ($[14] !== error.message) {
934
- t7 = /* @__PURE__ */ jsx("p", {
935
- className: "text-muted-foreground",
936
- children: error.message
937
- });
938
- $[14] = error.message;
939
- $[15] = t7;
940
- } else t7 = $[15];
941
- let t8;
942
- if ($[16] !== t6 || $[17] !== t7) {
943
- t8 = /* @__PURE__ */ jsxs("div", {
944
- className: "container",
945
- children: [t6, t7]
946
- });
947
- $[16] = t6;
948
- $[17] = t7;
949
- $[18] = t8;
950
- } else t8 = $[18];
951
- return t8;
952
- }
953
- let t5;
954
- if ($[19] !== Component) {
955
- t5 = Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
956
- $[19] = Component;
957
- $[20] = t5;
958
- } else t5 = $[20];
959
- return t5;
496
+ if (error) return /* @__PURE__ */ jsxs("div", {
497
+ className: "container",
498
+ children: [/* @__PURE__ */ jsx("h1", {
499
+ className: "text-destructive mb-4 text-2xl font-bold",
500
+ children: t("error.unexpectedError")
501
+ }), /* @__PURE__ */ jsx("p", {
502
+ className: "text-muted-foreground",
503
+ children: error.message
504
+ })]
505
+ });
506
+ return Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
960
507
  }
961
508
  /**
962
509
  * AdminRouter Component
@@ -965,609 +512,230 @@ function LazyPageRenderer(t0) {
965
512
  * Uses Suspense internally - shows skeleton while config loads.
966
513
  */
967
514
  function AdminRouter(props) {
968
- const $ = c(7);
969
- let t0;
970
- if ($[0] !== props.segments) {
971
- t0 = getFallbackForSegments(props.segments);
972
- $[0] = props.segments;
973
- $[1] = t0;
974
- } else t0 = $[1];
975
- let t1;
976
- if ($[2] !== props) {
977
- t1 = /* @__PURE__ */ jsx(AdminRouterInner, { ...props });
978
- $[2] = props;
979
- $[3] = t1;
980
- } else t1 = $[3];
981
- let t2;
982
- if ($[4] !== t0 || $[5] !== t1) {
983
- t2 = /* @__PURE__ */ jsx(React.Suspense, {
984
- fallback: t0,
985
- children: t1
986
- });
987
- $[4] = t0;
988
- $[5] = t1;
989
- $[6] = t2;
990
- } else t2 = $[6];
991
- return t2;
515
+ return /* @__PURE__ */ jsx(React.Suspense, {
516
+ fallback: getFallbackForSegments(props.segments),
517
+ children: /* @__PURE__ */ jsx(AdminRouterInner, { ...props })
518
+ });
992
519
  }
993
520
  /**
994
521
  * Inner router component that uses Suspense for data loading.
995
522
  * Guaranteed to have config loaded when rendering.
996
523
  */
997
- function AdminRouterInner(t0) {
998
- const $ = c(153);
999
- const { segments, navigate, basePath: t1, searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, registry, NotFoundComponent } = t0;
1000
- const basePath = t1 === void 0 ? "/admin" : t1;
524
+ function AdminRouterInner({ segments, navigate, basePath = "/admin", searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, renderFormFields: _renderFormFields, registry, NotFoundComponent }) {
1001
525
  const resolvedCollectionComponents = collectionComponents ?? EMPTY_COLLECTION_COMPONENTS;
1002
526
  const resolvedGlobalComponents = globalComponents ?? EMPTY_GLOBAL_COMPONENTS;
1003
- let t2;
1004
- bb0: {
1005
- if (searchParamsProp) {
1006
- t2 = searchParamsProp;
1007
- break bb0;
1008
- }
1009
- if (typeof window !== "undefined") {
1010
- let t3$2;
1011
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1012
- t3$2 = new URLSearchParams(window.location.search);
1013
- $[0] = t3$2;
1014
- } else t3$2 = $[0];
1015
- t2 = t3$2;
1016
- break bb0;
1017
- }
1018
- let t3$1;
1019
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1020
- t3$1 = new URLSearchParams();
1021
- $[1] = t3$1;
1022
- } else t3$1 = $[1];
1023
- t2 = t3$1;
1024
- }
1025
- const searchParams = t2;
1026
- let t3;
1027
- if ($[2] !== searchParams) {
1028
- t3 = parsePrefillParams(searchParams);
1029
- $[2] = searchParams;
1030
- $[3] = t3;
1031
- } else t3 = $[3];
1032
- const prefillValues = t3;
1033
- let t4;
1034
- if ($[4] !== DashboardComponentProp || $[5] !== collectionsProp || $[6] !== dashboardConfigProp || $[7] !== globalsProp || $[8] !== pagesProp) {
1035
- t4 = {
1036
- collections: collectionsProp,
1037
- globals: globalsProp,
1038
- pages: pagesProp,
1039
- dashboardConfig: dashboardConfigProp,
1040
- DashboardComponent: DashboardComponentProp
1041
- };
1042
- $[4] = DashboardComponentProp;
1043
- $[5] = collectionsProp;
1044
- $[6] = dashboardConfigProp;
1045
- $[7] = globalsProp;
1046
- $[8] = pagesProp;
1047
- $[9] = t4;
1048
- } else t4 = $[9];
1049
- const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig(t4);
1050
- let t5;
1051
- if ($[10] !== collections || $[11] !== globals || $[12] !== pages || $[13] !== segments) {
1052
- t5 = matchRoute(segments, collections, globals, pages);
1053
- $[10] = collections;
1054
- $[11] = globals;
1055
- $[12] = pages;
1056
- $[13] = segments;
1057
- $[14] = t5;
1058
- } else t5 = $[14];
1059
- const route = t5;
527
+ const searchParams = React.useMemo(() => {
528
+ if (searchParamsProp) return searchParamsProp;
529
+ if (typeof window !== "undefined") return new URLSearchParams(window.location.search);
530
+ return new URLSearchParams();
531
+ }, [searchParamsProp]);
532
+ const prefillValues = React.useMemo(() => parsePrefillParams(searchParams), [searchParams]);
533
+ const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig({
534
+ collections: collectionsProp,
535
+ globals: globalsProp,
536
+ pages: pagesProp,
537
+ dashboardConfig: dashboardConfigProp,
538
+ DashboardComponent: DashboardComponentProp
539
+ });
540
+ const route = React.useMemo(() => matchRoute(segments, collections, globals, pages), [
541
+ segments,
542
+ collections,
543
+ globals,
544
+ pages
545
+ ]);
1060
546
  const activeCollectionName = route.type === "collection-list" || route.type === "collection-create" || route.type === "collection-edit" ? route.name : "";
1061
547
  const activeGlobalName = route.type === "global-edit" ? route.name : "";
1062
548
  const queryClient = useQueryClient();
1063
549
  const client = useAdminStore(selectClient);
1064
550
  if (activeCollectionName && client) queryClient.prefetchQuery(getCollectionMetaQueryOptions(activeCollectionName, client));
1065
551
  if (activeGlobalName && client) queryClient.prefetchQuery(getGlobalMetaQueryOptions(activeGlobalName, client));
1066
- const t6 = !!activeCollectionName;
1067
- let t7;
1068
- if ($[15] !== t6) {
1069
- t7 = { enabled: t6 };
1070
- $[15] = t6;
1071
- $[16] = t7;
1072
- } else t7 = $[16];
1073
- const { data: activeCollectionSchema } = useCollectionSchema(activeCollectionName, t7);
1074
- const t8 = !!activeGlobalName;
1075
- let t9;
1076
- if ($[17] !== t8) {
1077
- t9 = { enabled: t8 };
1078
- $[17] = t8;
1079
- $[18] = t9;
1080
- } else t9 = $[18];
1081
- const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, t9);
552
+ const { data: activeCollectionSchema } = useCollectionSchema(activeCollectionName, { enabled: !!activeCollectionName });
553
+ const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, { enabled: !!activeGlobalName });
1082
554
  const { t } = useTranslation();
1083
555
  const resolveText = useResolveText();
1084
- let t10;
1085
- if ($[19] !== activeCollectionSchema || $[20] !== activeGlobalSchema || $[21] !== brandingName || $[22] !== collections || $[23] !== dashboardConfig?.description || $[24] !== dashboardConfig?.title || $[25] !== globals || $[26] !== resolveText || $[27] !== route.config || $[28] !== route.name || $[29] !== route.type || $[30] !== t) {
1086
- t10 = () => {
1087
- const appTitle = resolveText(brandingName, "Admin");
1088
- let pageTitle = t("dashboard.title");
1089
- let metaDescription = pageTitle;
1090
- const resolveResourceLabel = (config, schemaConfig, fallback) => resolveText(config?.label ?? config?.meta?.label ?? schemaConfig?.label, formatLabel(fallback));
1091
- const resolveResourceDescription = (config_0, schemaConfig_0) => resolveText(config_0?.description ?? config_0?.meta?.description ?? schemaConfig_0?.description).trim();
1092
- bb104: switch (route.type) {
1093
- case "dashboard":
1094
- pageTitle = resolveText(dashboardConfig?.title, t("dashboard.title"));
1095
- metaDescription = resolveText(dashboardConfig?.description).trim() || pageTitle;
1096
- break bb104;
1097
- case "collection-list": {
1098
- const config_4 = collections[route.name];
1099
- const schemaConfig_4 = activeCollectionSchema?.admin?.config;
1100
- const label_2 = resolveResourceLabel(config_4, schemaConfig_4, route.name);
1101
- pageTitle = label_2;
1102
- metaDescription = resolveResourceDescription(config_4, schemaConfig_4) || t("collection.list", { name: label_2 });
1103
- break bb104;
1104
- }
1105
- case "collection-create": {
1106
- const config_3 = collections[route.name];
1107
- const schemaConfig_3 = activeCollectionSchema?.admin?.config;
1108
- const label_1 = resolveResourceLabel(config_3, schemaConfig_3, route.name);
1109
- pageTitle = `${label_1}: ${t("common.create")}`;
1110
- metaDescription = resolveResourceDescription(config_3, schemaConfig_3) || t("collection.create", { name: label_1 });
1111
- break bb104;
1112
- }
1113
- case "collection-edit": {
1114
- const config_2 = collections[route.name];
1115
- const schemaConfig_2 = activeCollectionSchema?.admin?.config;
1116
- const label_0 = resolveResourceLabel(config_2, schemaConfig_2, route.name);
1117
- pageTitle = `${label_0}: ${t("common.edit")}`;
1118
- metaDescription = resolveResourceDescription(config_2, schemaConfig_2) || t("collection.edit", { name: label_0 });
1119
- break bb104;
1120
- }
1121
- case "global-edit": {
1122
- const config_1 = globals[route.name];
1123
- const schemaConfig_1 = activeGlobalSchema?.admin?.config;
1124
- const label = resolveResourceLabel(config_1, schemaConfig_1, route.name);
1125
- pageTitle = label;
1126
- metaDescription = resolveResourceDescription(config_1, schemaConfig_1) || label;
1127
- break bb104;
1128
- }
1129
- case "page":
1130
- pageTitle = resolveText(route.config.label, formatLabel(route.name));
1131
- metaDescription = pageTitle;
1132
- break bb104;
1133
- case "not-found":
1134
- pageTitle = t("error.notFound");
1135
- metaDescription = pageTitle;
556
+ React.useEffect(() => {
557
+ const appTitle = resolveText(brandingName, "Admin");
558
+ let pageTitle = t("dashboard.title");
559
+ let metaDescription = pageTitle;
560
+ const resolveResourceLabel = (config, schemaConfig, fallback) => resolveText(config?.label ?? config?.meta?.label ?? schemaConfig?.label, formatLabel(fallback));
561
+ const resolveResourceDescription = (config, schemaConfig) => resolveText(config?.description ?? config?.meta?.description ?? schemaConfig?.description).trim();
562
+ switch (route.type) {
563
+ case "dashboard":
564
+ pageTitle = resolveText(dashboardConfig?.title, t("dashboard.title"));
565
+ metaDescription = resolveText(dashboardConfig?.description).trim() || pageTitle;
566
+ break;
567
+ case "collection-list": {
568
+ const config = collections[route.name];
569
+ const schemaConfig = activeCollectionSchema?.admin?.config;
570
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
571
+ pageTitle = label;
572
+ metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.list", { name: label });
573
+ break;
1136
574
  }
1137
- document.title = formatDocumentTitle(pageTitle, appTitle);
1138
- setDocumentMetaDescription(metaDescription || pageTitle);
1139
- };
1140
- $[19] = activeCollectionSchema;
1141
- $[20] = activeGlobalSchema;
1142
- $[21] = brandingName;
1143
- $[22] = collections;
1144
- $[23] = dashboardConfig?.description;
1145
- $[24] = dashboardConfig?.title;
1146
- $[25] = globals;
1147
- $[26] = resolveText;
1148
- $[27] = route.config;
1149
- $[28] = route.name;
1150
- $[29] = route.type;
1151
- $[30] = t;
1152
- $[31] = t10;
1153
- } else t10 = $[31];
1154
- let t11;
1155
- if ($[32] !== activeCollectionSchema || $[33] !== activeGlobalSchema || $[34] !== brandingName || $[35] !== collections || $[36] !== dashboardConfig || $[37] !== globals || $[38] !== resolveText || $[39] !== route || $[40] !== t) {
1156
- t11 = [
1157
- activeCollectionSchema,
1158
- activeGlobalSchema,
1159
- brandingName,
1160
- collections,
1161
- dashboardConfig,
1162
- globals,
1163
- resolveText,
1164
- route,
1165
- t
1166
- ];
1167
- $[32] = activeCollectionSchema;
1168
- $[33] = activeGlobalSchema;
1169
- $[34] = brandingName;
1170
- $[35] = collections;
1171
- $[36] = dashboardConfig;
1172
- $[37] = globals;
1173
- $[38] = resolveText;
1174
- $[39] = route;
1175
- $[40] = t;
1176
- $[41] = t11;
1177
- } else t11 = $[41];
1178
- React.useEffect(t10, t11);
1179
- let t12;
1180
- if ($[42] !== segments) {
1181
- t12 = segments.join("/");
1182
- $[42] = segments;
1183
- $[43] = t12;
1184
- } else t12 = $[43];
1185
- const routeKey = t12;
1186
- let t13;
1187
- if ($[44] !== routeKey) {
1188
- t13 = [routeKey];
1189
- $[44] = routeKey;
1190
- $[45] = t13;
1191
- } else t13 = $[45];
1192
- React.useEffect(_temp3, t13);
1193
- if (route.type === "dashboard") {
1194
- if (DashboardComponent) {
1195
- let t14$2;
1196
- if ($[46] !== DashboardComponent) {
1197
- t14$2 = /* @__PURE__ */ jsx(DashboardComponent, {});
1198
- $[46] = DashboardComponent;
1199
- $[47] = t14$2;
1200
- } else t14$2 = $[47];
1201
- return t14$2;
1202
- }
1203
- if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) {
1204
- let t14$2;
1205
- if ($[48] !== basePath || $[49] !== dashboardConfig || $[50] !== navigate) {
1206
- t14$2 = /* @__PURE__ */ jsx(DashboardGrid, {
1207
- config: dashboardConfig,
1208
- basePath,
1209
- navigate
1210
- });
1211
- $[48] = basePath;
1212
- $[49] = dashboardConfig;
1213
- $[50] = navigate;
1214
- $[51] = t14$2;
1215
- } else t14$2 = $[51];
1216
- return t14$2;
575
+ case "collection-create": {
576
+ const config = collections[route.name];
577
+ const schemaConfig = activeCollectionSchema?.admin?.config;
578
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
579
+ pageTitle = `${label}: ${t("common.create")}`;
580
+ metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.create", { name: label });
581
+ break;
582
+ }
583
+ case "collection-edit": {
584
+ const config = collections[route.name];
585
+ const schemaConfig = activeCollectionSchema?.admin?.config;
586
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
587
+ pageTitle = `${label}: ${t("common.edit")}`;
588
+ metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.edit", { name: label });
589
+ break;
590
+ }
591
+ case "global-edit": {
592
+ const config = globals[route.name];
593
+ const schemaConfig = activeGlobalSchema?.admin?.config;
594
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
595
+ pageTitle = label;
596
+ metaDescription = resolveResourceDescription(config, schemaConfig) || label;
597
+ break;
598
+ }
599
+ case "page":
600
+ pageTitle = resolveText(route.config.label, formatLabel(route.name));
601
+ metaDescription = pageTitle;
602
+ break;
603
+ case "not-found":
604
+ pageTitle = t("error.notFound");
605
+ metaDescription = pageTitle;
606
+ break;
1217
607
  }
1218
- let t14$1;
1219
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
1220
- t14$1 = /* @__PURE__ */ jsx(DefaultDashboard, {});
1221
- $[52] = t14$1;
1222
- } else t14$1 = $[52];
1223
- return t14$1;
608
+ document.title = formatDocumentTitle(pageTitle, appTitle);
609
+ setDocumentMetaDescription(metaDescription || pageTitle);
610
+ }, [
611
+ activeCollectionSchema,
612
+ activeGlobalSchema,
613
+ brandingName,
614
+ collections,
615
+ dashboardConfig,
616
+ globals,
617
+ resolveText,
618
+ route,
619
+ t
620
+ ]);
621
+ const routeKey = segments.join("/");
622
+ React.useEffect(() => {
623
+ const main = document.getElementById("main-content");
624
+ if (main) requestAnimationFrame(() => {
625
+ main.focus({ preventScroll: true });
626
+ });
627
+ }, [routeKey]);
628
+ if (route.type === "dashboard") {
629
+ if (DashboardComponent) return /* @__PURE__ */ jsx(DashboardComponent, {});
630
+ if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) return /* @__PURE__ */ jsx(DashboardGrid, {
631
+ config: dashboardConfig,
632
+ basePath,
633
+ navigate
634
+ });
635
+ return /* @__PURE__ */ jsx(DefaultDashboard, {});
1224
636
  }
1225
637
  if (route.type === "collection-list") {
1226
638
  const { name } = route;
1227
- const config_5 = collections[name];
1228
- if (!config_5) {
1229
- let t14$2;
1230
- if ($[53] !== basePath || $[54] !== name || $[55] !== navigate) {
1231
- t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1232
- type: "collection",
1233
- name,
1234
- navigate,
1235
- basePath
1236
- });
1237
- $[53] = basePath;
1238
- $[54] = name;
1239
- $[55] = navigate;
1240
- $[56] = t14$2;
1241
- } else t14$2 = $[56];
1242
- return t14$2;
1243
- }
639
+ const config = collections[name];
640
+ if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
641
+ type: "collection",
642
+ name,
643
+ navigate,
644
+ basePath
645
+ });
1244
646
  const custom = resolvedCollectionComponents[name];
1245
647
  const viewNameFromSchema = activeCollectionSchema?.admin?.list?.view;
1246
- const t14$1 = config_5?.list;
1247
- let t15;
1248
- if ($[57] !== t14$1) {
1249
- t15 = getConfiguredViewName(t14$1);
1250
- $[57] = t14$1;
1251
- $[58] = t15;
1252
- } else t15 = $[58];
1253
- const viewNameFromConfig = t15;
1254
- let t16;
1255
- if ($[59] !== viewNameFromConfig || $[60] !== viewNameFromSchema || $[61] !== views) {
1256
- t16 = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
1257
- $[59] = viewNameFromConfig;
1258
- $[60] = viewNameFromSchema;
1259
- $[61] = views;
1260
- $[62] = t16;
1261
- } else t16 = $[62];
1262
- const selectedListView = t16;
648
+ const viewNameFromConfig = getConfiguredViewName(config?.list);
649
+ const selectedListView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
1263
650
  const selectedListViewDefinition = views[selectedListView];
1264
- let t17;
1265
- if ($[63] !== activeCollectionSchema || $[64] !== config_5 || $[65] !== selectedListViewDefinition) {
1266
- t17 = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config_5?.list?.config ?? config_5?.list ?? activeCollectionSchema?.admin?.list);
1267
- $[63] = activeCollectionSchema;
1268
- $[64] = config_5;
1269
- $[65] = selectedListViewDefinition;
1270
- $[66] = t17;
1271
- } else t17 = $[66];
1272
- const selectedListViewConfig = t17;
1273
- let t18;
1274
- if ($[67] !== selectedListViewDefinition) {
1275
- t18 = getViewLoader(selectedListViewDefinition);
1276
- $[67] = selectedListViewDefinition;
1277
- $[68] = t18;
1278
- } else t18 = $[68];
1279
- const listViewLoader = t18;
651
+ const selectedListViewConfig = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config?.list?.config ?? config?.list ?? activeCollectionSchema?.admin?.list);
652
+ const listViewLoader = getViewLoader(selectedListViewDefinition);
1280
653
  if (selectedListViewDefinition && selectedListViewDefinition.kind !== "list" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedListView}" kind "${selectedListViewDefinition.kind}" != expected "list"`);
1281
- if (custom?.List) {
1282
- let t19$1;
1283
- if ($[69] !== custom.List) {
1284
- t19$1 = /* @__PURE__ */ jsx(custom.List, {});
1285
- $[69] = custom.List;
1286
- $[70] = t19$1;
1287
- } else t19$1 = $[70];
1288
- return t19$1;
1289
- }
1290
- let t19;
1291
- if ($[71] !== basePath || $[72] !== config_5 || $[73] !== name || $[74] !== navigate || $[75] !== selectedListViewConfig) {
1292
- t19 = {
654
+ if (custom?.List) return /* @__PURE__ */ jsx(custom.List, {});
655
+ return /* @__PURE__ */ jsx(RegistryViewRenderer, {
656
+ loader: listViewLoader,
657
+ viewKind: "list",
658
+ viewId: selectedListView,
659
+ componentProps: {
1293
660
  collection: name,
1294
- config: config_5,
661
+ config,
1295
662
  viewConfig: selectedListViewConfig,
1296
663
  navigate,
1297
664
  basePath
1298
- };
1299
- $[71] = basePath;
1300
- $[72] = config_5;
1301
- $[73] = name;
1302
- $[74] = navigate;
1303
- $[75] = selectedListViewConfig;
1304
- $[76] = t19;
1305
- } else t19 = $[76];
1306
- const listComponentProps = t19;
1307
- let t20;
1308
- if ($[77] !== listComponentProps || $[78] !== listViewLoader || $[79] !== name || $[80] !== selectedListView) {
1309
- t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1310
- loader: listViewLoader,
1311
- viewKind: "list",
1312
- viewId: selectedListView,
1313
- componentProps: listComponentProps
1314
- }, name);
1315
- $[77] = listComponentProps;
1316
- $[78] = listViewLoader;
1317
- $[79] = name;
1318
- $[80] = selectedListView;
1319
- $[81] = t20;
1320
- } else t20 = $[81];
1321
- return t20;
665
+ }
666
+ }, name);
1322
667
  }
1323
668
  if (route.type === "collection-create" || route.type === "collection-edit") {
1324
- const { name: name_0 } = route;
669
+ const { name } = route;
1325
670
  const id = route.type === "collection-edit" ? route.id : void 0;
1326
- const config_6 = collections[name_0];
1327
- if (!config_6) {
1328
- let t14$2;
1329
- if ($[82] !== basePath || $[83] !== name_0 || $[84] !== navigate) {
1330
- t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1331
- type: "collection",
1332
- name: name_0,
1333
- navigate,
1334
- basePath
1335
- });
1336
- $[82] = basePath;
1337
- $[83] = name_0;
1338
- $[84] = navigate;
1339
- $[85] = t14$2;
1340
- } else t14$2 = $[85];
1341
- return t14$2;
1342
- }
1343
- const custom_0 = resolvedCollectionComponents[name_0];
1344
- const viewNameFromSchema_0 = activeCollectionSchema?.admin?.form?.view;
1345
- const t14$1 = config_6?.form;
1346
- let t15;
1347
- if ($[86] !== t14$1) {
1348
- t15 = getConfiguredViewName(t14$1);
1349
- $[86] = t14$1;
1350
- $[87] = t15;
1351
- } else t15 = $[87];
1352
- const viewNameFromConfig_0 = t15;
1353
- let t16;
1354
- if ($[88] !== viewNameFromConfig_0 || $[89] !== viewNameFromSchema_0 || $[90] !== views) {
1355
- t16 = viewNameFromSchema_0 ?? viewNameFromConfig_0 ?? findDefaultView(views, "form");
1356
- $[88] = viewNameFromConfig_0;
1357
- $[89] = viewNameFromSchema_0;
1358
- $[90] = views;
1359
- $[91] = t16;
1360
- } else t16 = $[91];
1361
- const selectedFormView = t16;
671
+ const config = collections[name];
672
+ if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
673
+ type: "collection",
674
+ name,
675
+ navigate,
676
+ basePath
677
+ });
678
+ const custom = resolvedCollectionComponents[name];
679
+ const viewNameFromSchema = activeCollectionSchema?.admin?.form?.view;
680
+ const viewNameFromConfig = getConfiguredViewName(config?.form);
681
+ const selectedFormView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "form");
1362
682
  const selectedFormViewDefinition = views[selectedFormView];
1363
- let t17;
1364
- if ($[92] !== activeCollectionSchema || $[93] !== config_6 || $[94] !== selectedFormViewDefinition) {
1365
- t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config_6?.form?.config ?? config_6?.form ?? activeCollectionSchema?.admin?.form);
1366
- $[92] = activeCollectionSchema;
1367
- $[93] = config_6;
1368
- $[94] = selectedFormViewDefinition;
1369
- $[95] = t17;
1370
- } else t17 = $[95];
1371
- const selectedFormViewConfig = t17;
1372
- let t18;
1373
- if ($[96] !== selectedFormViewDefinition) {
1374
- t18 = getViewLoader(selectedFormViewDefinition);
1375
- $[96] = selectedFormViewDefinition;
1376
- $[97] = t18;
1377
- } else t18 = $[97];
1378
- const formViewLoader = t18;
683
+ const selectedFormViewConfig = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config?.form?.config ?? config?.form ?? activeCollectionSchema?.admin?.form);
684
+ const formViewLoader = getViewLoader(selectedFormViewDefinition);
1379
685
  if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
1380
- if (custom_0?.Form) {
1381
- let t19$1;
1382
- if ($[98] !== custom_0.Form) {
1383
- t19$1 = /* @__PURE__ */ jsx(custom_0.Form, {});
1384
- $[98] = custom_0.Form;
1385
- $[99] = t19$1;
1386
- } else t19$1 = $[99];
1387
- return t19$1;
1388
- }
1389
- let t19;
1390
- if ($[100] !== prefillValues || $[101] !== route.type) {
1391
- t19 = route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0;
1392
- $[100] = prefillValues;
1393
- $[101] = route.type;
1394
- $[102] = t19;
1395
- } else t19 = $[102];
1396
- const defaultValues = t19;
1397
- let t20;
1398
- if ($[103] !== basePath || $[104] !== collections || $[105] !== config_6 || $[106] !== defaultValues || $[107] !== id || $[108] !== name_0 || $[109] !== navigate || $[110] !== registry || $[111] !== selectedFormViewConfig) {
1399
- t20 = {
1400
- collection: name_0,
686
+ if (custom?.Form) return /* @__PURE__ */ jsx(custom.Form, {});
687
+ return /* @__PURE__ */ jsx(RegistryViewRenderer, {
688
+ loader: formViewLoader,
689
+ viewKind: "form",
690
+ viewId: selectedFormView,
691
+ componentProps: {
692
+ collection: name,
1401
693
  id,
1402
- config: config_6,
694
+ config,
1403
695
  viewConfig: selectedFormViewConfig,
1404
696
  navigate,
1405
697
  basePath,
1406
- defaultValues,
698
+ defaultValues: route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0,
1407
699
  registry,
1408
700
  allCollectionsConfig: collections
1409
- };
1410
- $[103] = basePath;
1411
- $[104] = collections;
1412
- $[105] = config_6;
1413
- $[106] = defaultValues;
1414
- $[107] = id;
1415
- $[108] = name_0;
1416
- $[109] = navigate;
1417
- $[110] = registry;
1418
- $[111] = selectedFormViewConfig;
1419
- $[112] = t20;
1420
- } else t20 = $[112];
1421
- const editComponentProps = t20;
1422
- const t21 = `${name_0}-${id ?? "create"}`;
1423
- let t22;
1424
- if ($[113] !== editComponentProps || $[114] !== formViewLoader || $[115] !== selectedFormView || $[116] !== t21) {
1425
- t22 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1426
- loader: formViewLoader,
1427
- viewKind: "form",
1428
- viewId: selectedFormView,
1429
- componentProps: editComponentProps
1430
- }, t21);
1431
- $[113] = editComponentProps;
1432
- $[114] = formViewLoader;
1433
- $[115] = selectedFormView;
1434
- $[116] = t21;
1435
- $[117] = t22;
1436
- } else t22 = $[117];
1437
- return t22;
701
+ }
702
+ }, `${name}-${id ?? "create"}`);
1438
703
  }
1439
704
  if (route.type === "global-edit") {
1440
- const { name: name_1 } = route;
1441
- const config_7 = globals[name_1];
1442
- if (!config_7) {
1443
- let t14$2;
1444
- if ($[118] !== basePath || $[119] !== name_1 || $[120] !== navigate) {
1445
- t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1446
- type: "global",
1447
- name: name_1,
1448
- navigate,
1449
- basePath
1450
- });
1451
- $[118] = basePath;
1452
- $[119] = name_1;
1453
- $[120] = navigate;
1454
- $[121] = t14$2;
1455
- } else t14$2 = $[121];
1456
- return t14$2;
1457
- }
1458
- const custom_1 = resolvedGlobalComponents[name_1];
1459
- const viewNameFromSchema_1 = activeGlobalSchema?.admin?.form?.view;
1460
- const t14$1 = config_7?.form;
1461
- let t15;
1462
- if ($[122] !== t14$1) {
1463
- t15 = getConfiguredViewName(t14$1);
1464
- $[122] = t14$1;
1465
- $[123] = t15;
1466
- } else t15 = $[123];
1467
- const viewNameFromConfig_1 = t15;
1468
- let t16;
1469
- if ($[124] !== viewNameFromConfig_1 || $[125] !== viewNameFromSchema_1 || $[126] !== views) {
1470
- t16 = viewNameFromSchema_1 ?? viewNameFromConfig_1 ?? findDefaultView(views, "form");
1471
- $[124] = viewNameFromConfig_1;
1472
- $[125] = viewNameFromSchema_1;
1473
- $[126] = views;
1474
- $[127] = t16;
1475
- } else t16 = $[127];
1476
- const selectedFormView_0 = t16;
1477
- const selectedFormViewDefinition_0 = views[selectedFormView_0];
1478
- let t17;
1479
- if ($[128] !== activeGlobalSchema || $[129] !== config_7 || $[130] !== selectedFormViewDefinition_0) {
1480
- t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition_0), config_7?.form?.config ?? config_7?.form ?? activeGlobalSchema?.admin?.form);
1481
- $[128] = activeGlobalSchema;
1482
- $[129] = config_7;
1483
- $[130] = selectedFormViewDefinition_0;
1484
- $[131] = t17;
1485
- } else t17 = $[131];
1486
- const selectedFormViewConfig_0 = t17;
1487
- let t18;
1488
- if ($[132] !== selectedFormViewDefinition_0) {
1489
- t18 = getViewLoader(selectedFormViewDefinition_0);
1490
- $[132] = selectedFormViewDefinition_0;
1491
- $[133] = t18;
1492
- } else t18 = $[133];
1493
- const globalViewLoader = t18;
1494
- if (selectedFormViewDefinition_0 && selectedFormViewDefinition_0.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView_0}" kind "${selectedFormViewDefinition_0.kind}" != expected "form"`);
1495
- if (custom_1?.Form) {
1496
- let t19$1;
1497
- if ($[134] !== custom_1.Form) {
1498
- t19$1 = /* @__PURE__ */ jsx(custom_1.Form, {});
1499
- $[134] = custom_1.Form;
1500
- $[135] = t19$1;
1501
- } else t19$1 = $[135];
1502
- return t19$1;
1503
- }
1504
- let t19;
1505
- if ($[136] !== basePath || $[137] !== config_7 || $[138] !== globals || $[139] !== name_1 || $[140] !== navigate || $[141] !== registry || $[142] !== selectedFormViewConfig_0) {
1506
- t19 = {
1507
- global: name_1,
1508
- config: config_7,
1509
- viewConfig: selectedFormViewConfig_0,
705
+ const { name } = route;
706
+ const config = globals[name];
707
+ if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
708
+ type: "global",
709
+ name,
710
+ navigate,
711
+ basePath
712
+ });
713
+ const custom = resolvedGlobalComponents[name];
714
+ const viewNameFromSchema = activeGlobalSchema?.admin?.form?.view;
715
+ const viewNameFromConfig = getConfiguredViewName(config?.form);
716
+ const selectedFormView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "form");
717
+ const selectedFormViewDefinition = views[selectedFormView];
718
+ const selectedFormViewConfig = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config?.form?.config ?? config?.form ?? activeGlobalSchema?.admin?.form);
719
+ const globalViewLoader = getViewLoader(selectedFormViewDefinition);
720
+ if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
721
+ if (custom?.Form) return /* @__PURE__ */ jsx(custom.Form, {});
722
+ return /* @__PURE__ */ jsx(RegistryViewRenderer, {
723
+ loader: globalViewLoader,
724
+ viewKind: "form",
725
+ viewId: selectedFormView,
726
+ componentProps: {
727
+ global: name,
728
+ config,
729
+ viewConfig: selectedFormViewConfig,
1510
730
  navigate,
1511
731
  basePath,
1512
732
  registry,
1513
733
  allGlobalsConfig: globals
1514
- };
1515
- $[136] = basePath;
1516
- $[137] = config_7;
1517
- $[138] = globals;
1518
- $[139] = name_1;
1519
- $[140] = navigate;
1520
- $[141] = registry;
1521
- $[142] = selectedFormViewConfig_0;
1522
- $[143] = t19;
1523
- } else t19 = $[143];
1524
- const globalComponentProps = t19;
1525
- let t20;
1526
- if ($[144] !== globalComponentProps || $[145] !== globalViewLoader || $[146] !== name_1 || $[147] !== selectedFormView_0) {
1527
- t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1528
- loader: globalViewLoader,
1529
- viewKind: "form",
1530
- viewId: selectedFormView_0,
1531
- componentProps: globalComponentProps
1532
- }, name_1);
1533
- $[144] = globalComponentProps;
1534
- $[145] = globalViewLoader;
1535
- $[146] = name_1;
1536
- $[147] = selectedFormView_0;
1537
- $[148] = t20;
1538
- } else t20 = $[148];
1539
- return t20;
1540
- }
1541
- if (route.type === "page") {
1542
- let t14$1;
1543
- if ($[149] !== route.config) {
1544
- t14$1 = /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
1545
- $[149] = route.config;
1546
- $[150] = t14$1;
1547
- } else t14$1 = $[150];
1548
- return t14$1;
734
+ }
735
+ }, name);
1549
736
  }
1550
- const NotFound = NotFoundComponent || DefaultNotFound;
1551
- let t14;
1552
- if ($[151] !== NotFound) {
1553
- t14 = /* @__PURE__ */ jsx(NotFound, {});
1554
- $[151] = NotFound;
1555
- $[152] = t14;
1556
- } else t14 = $[152];
1557
- return t14;
1558
- }
1559
- function _temp3() {
1560
- const main = document.getElementById("main-content");
1561
- if (main) requestAnimationFrame(() => {
1562
- main.focus({ preventScroll: true });
1563
- });
1564
- }
1565
- function _temp2(prev) {
1566
- return {
1567
- ...prev,
1568
- loading: true,
1569
- error: null
1570
- };
737
+ if (route.type === "page") return /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
738
+ return /* @__PURE__ */ jsx(NotFoundComponent || DefaultNotFound, {});
1571
739
  }
1572
740
 
1573
741
  //#endregion