@panneau/app 4.1.0 → 5.0.0-alpha.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.
package/dist/index.js CHANGED
@@ -1,2887 +1,4 @@
1
- import { c } from 'react/compiler-runtime';
2
- import { useMemoryRouter, createPathToRegexpParser } from '@folklore/routes';
3
- import { useLocation, useSearch, Route, Switch, Redirect, Router } from 'wouter';
4
- import ActionsProvider from '@panneau/actions';
5
- import { useUser, useLogout, useAuth, AuthProvider } from '@panneau/auth';
6
- import { useUrlGenerator, usePanneauResources, usePanneau, usePanneauColorScheme, ResourceProvider, useActionsComponentsManager, useRoutes, usePagesComponentsManager, ComponentsProvider, ModalProvider, RoutesProvider, PanneauProvider } from '@panneau/core/contexts';
7
- import { useResourceItem, DataProvider } from '@panneau/data';
8
- import DisplaysProvider from '@panneau/displays';
9
- import FieldsProvider from '@panneau/fields';
10
- import FiltersProvider from '@panneau/filters';
11
- import FormsProvider from '@panneau/forms';
12
- import { useResourceValues, IntlProvider } from '@panneau/intl';
13
- import ListsProvider from '@panneau/lists';
14
- import ModalsProvider from '@panneau/modals';
15
- import { UppyProvider } from '@panneau/uppy';
16
- import isObject from 'lodash-es/isObject';
17
- import { useState, useEffect } from 'react';
18
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
- import classNames from 'classnames';
20
- import isString from 'lodash-es/isString';
21
- import omit from 'lodash-es/omit';
22
- import queryString from 'query-string';
23
- import { FormattedMessage } from 'react-intl';
24
- import { useResourceUrlGenerator, useResourceTypeName } from '@panneau/core/hooks';
25
- import Alert from '@panneau/element-alert';
26
- import Button from '@panneau/element-button';
27
- import Dropdown from '@panneau/element-dropdown';
28
- import { Modals } from '@panneau/element-modal';
29
- import isArray from 'lodash-es/isArray';
30
- import Link from '@panneau/element-link';
31
- import Menu from '@panneau/element-menu';
32
- import Navbar from '@panneau/element-navbar';
33
- import LabelComponent from '@panneau/element-label';
34
- import ResourceList from '@panneau/list-resource-items';
35
- import Loading from '@panneau/element-loading';
36
- import ResourceForm from '@panneau/form-resource';
37
- import Form from '@panneau/form';
38
- import Filters from '@panneau/filter-filters';
39
-
40
- function ResourceFormWrapper(props) {
41
- const $ = c(2);
42
- let t0;
43
- if ($[0] !== props) {
44
- t0 = /*#__PURE__*/jsx(ResourceForm, {
45
- ...props
46
- });
47
- $[0] = props;
48
- $[1] = t0;
49
- } else {
50
- t0 = $[1];
51
- }
52
- return t0;
53
- }
54
-
55
- function AccountMenu(t0) {
56
- const $ = c(12);
57
- const {
58
- withAccountForm: t1,
59
- className: t2,
60
- itemClassName: t3,
61
- linkClassName: t4
62
- } = t0;
63
- const withAccountForm = t1 === undefined ? false : t1;
64
- const className = t2 === undefined ? null : t2;
65
- const itemClassName = t3 === undefined ? null : t3;
66
- const linkClassName = t4 === undefined ? null : t4;
67
- const route = useUrlGenerator();
68
- const user = useUser();
69
- const logout = useLogout();
70
- let t5;
71
- if ($[0] !== logout) {
72
- t5 = e => {
73
- e.preventDefault();
74
- logout();
75
- };
76
- $[0] = logout;
77
- $[1] = t5;
78
- } else {
79
- t5 = $[1];
80
- }
81
- const onClickLogout = t5;
82
- let t6;
83
- if ($[2] !== onClickLogout || $[3] !== route || $[4] !== user || $[5] !== withAccountForm) {
84
- t6 = user !== null ? [{
85
- id: "account",
86
- label: /*#__PURE__*/jsx(FormattedMessage, {
87
- id: "IuqEHB"
88
- }),
89
- href: route("account"),
90
- dropdown: [...(withAccountForm ? [{
91
- label: /*#__PURE__*/jsx(FormattedMessage, {
92
- id: "V7Us0a"
93
- }),
94
- href: route("account")
95
- }] : []), {
96
- label: /*#__PURE__*/jsx(FormattedMessage, {
97
- id: "REIcPg"
98
- }),
99
- href: route("auth.logout"),
100
- onClick: onClickLogout
101
- }]
102
- }] : [{
103
- label: /*#__PURE__*/jsx(FormattedMessage, {
104
- id: "d0g58T"
105
- }),
106
- href: route("auth.login")
107
- }];
108
- $[2] = onClickLogout;
109
- $[3] = route;
110
- $[4] = user;
111
- $[5] = withAccountForm;
112
- $[6] = t6;
113
- } else {
114
- t6 = $[6];
115
- }
116
- const items = t6;
117
- let t7;
118
- if ($[7] !== className || $[8] !== itemClassName || $[9] !== items || $[10] !== linkClassName) {
119
- t7 = items !== null ? /*#__PURE__*/jsx(Menu, {
120
- className: className,
121
- itemClassName: itemClassName,
122
- linkClassName: linkClassName,
123
- items: items,
124
- dropdownAlign: "end"
125
- }) : null;
126
- $[7] = className;
127
- $[8] = itemClassName;
128
- $[9] = items;
129
- $[10] = linkClassName;
130
- $[11] = t7;
131
- } else {
132
- t7 = $[11];
133
- }
134
- return t7;
135
- }
136
-
137
- function ResourcesMenu(t0) {
138
- const $ = c(12);
139
- const {
140
- className: t1,
141
- itemClassName: t2,
142
- linkClassName: t3
143
- } = t0;
144
- const className = t1 === undefined ? null : t1;
145
- const itemClassName = t2 === undefined ? null : t2;
146
- const linkClassName = t3 === undefined ? null : t3;
147
- const [pathname] = useLocation();
148
- const resources = usePanneauResources();
149
- const resourceRoute = useResourceUrlGenerator();
150
- let t4;
151
- if ($[0] !== pathname || $[1] !== resourceRoute || $[2] !== resources) {
152
- let t5;
153
- if ($[4] !== pathname || $[5] !== resourceRoute) {
154
- t5 = it => {
155
- const url = resourceRoute(it, "index");
156
- return {
157
- id: it.id,
158
- label: it.name,
159
- href: url,
160
- active: pathname.substr(0, url.length) === url
161
- };
162
- };
163
- $[4] = pathname;
164
- $[5] = resourceRoute;
165
- $[6] = t5;
166
- } else {
167
- t5 = $[6];
168
- }
169
- t4 = resources.filter(_temp$6).map(t5);
170
- $[0] = pathname;
171
- $[1] = resourceRoute;
172
- $[2] = resources;
173
- $[3] = t4;
174
- } else {
175
- t4 = $[3];
176
- }
177
- const items = t4;
178
- let t5;
179
- if ($[7] !== className || $[8] !== itemClassName || $[9] !== items || $[10] !== linkClassName) {
180
- t5 = /*#__PURE__*/jsx(Menu, {
181
- items: items,
182
- className: className,
183
- itemClassName: itemClassName,
184
- linkClassName: linkClassName
185
- });
186
- $[7] = className;
187
- $[8] = itemClassName;
188
- $[9] = items;
189
- $[10] = linkClassName;
190
- $[11] = t5;
191
- } else {
192
- t5 = $[11];
193
- }
194
- return t5;
195
- }
196
- function _temp$6(t0) {
197
- const {
198
- settings: t1
199
- } = t0;
200
- const {
201
- hideInNavbar: t2
202
- } = t1 === undefined ? {} : t1;
203
- const hideInNavbar = t2 === undefined ? false : t2;
204
- return !hideInNavbar;
205
- }
206
-
207
- function MainNavbar(t0) {
208
- const $ = c(30);
209
- let className;
210
- let props;
211
- let t1;
212
- let t2;
213
- let t3;
214
- let t4;
215
- if ($[0] !== t0) {
216
- ({
217
- loading: t1,
218
- theme: t2,
219
- vertical: t3,
220
- position: t4,
221
- className,
222
- ...props
223
- } = t0);
224
- $[0] = t0;
225
- $[1] = className;
226
- $[2] = props;
227
- $[3] = t1;
228
- $[4] = t2;
229
- $[5] = t3;
230
- $[6] = t4;
231
- } else {
232
- className = $[1];
233
- props = $[2];
234
- t1 = $[3];
235
- t2 = $[4];
236
- t3 = $[5];
237
- t4 = $[6];
238
- }
239
- const loading = t1 === undefined ? false : t1;
240
- const vertical = t3 === undefined ? false : t3;
241
- const {
242
- name,
243
- menus: t5
244
- } = usePanneau();
245
- const menus = t5 === undefined ? null : t5;
246
- let t6;
247
- if ($[7] !== menus) {
248
- t6 = menus || {};
249
- $[7] = menus;
250
- $[8] = t6;
251
- } else {
252
- t6 = $[8];
253
- }
254
- const {
255
- main: t7,
256
- guest: t8
257
- } = t6;
258
- const main = t7 === undefined ? null : t7;
259
- const guest = t8 === undefined ? null : t8;
260
- const {
261
- background
262
- } = usePanneauColorScheme();
263
- const route = useUrlGenerator();
264
- const user = useUser();
265
- const navClassNames = vertical ? "navbar-nav d-flex flex-column" : "navbar-nav";
266
- let t9;
267
- if ($[9] !== guest || $[10] !== main || $[11] !== navClassNames || $[12] !== user) {
268
- const menuItems = (user !== null ? main : guest) || [];
269
- const hasResources = menuItems.indexOf("resources") !== -1;
270
- const hasAccount = menuItems.indexOf("account") !== -1;
271
- let t10;
272
- if ($[14] !== navClassNames) {
273
- t10 = (currentItems, item, index) => {
274
- if (item === "resources") {
275
- return [...currentItems, /*#__PURE__*/jsx(ResourcesMenu, {
276
- className: navClassNames,
277
- itemClassName: "nav-item",
278
- linkClassName: "nav-link"
279
- }, `menu-item-resource-${index + 1}`)];
280
- }
281
- if (item === "account") {
282
- return [...currentItems, /*#__PURE__*/jsx(AccountMenu, {
283
- className: navClassNames,
284
- itemClassName: "nav-item",
285
- linkClassName: "nav-link"
286
- }, `menu-item-account-${index + 1}`)];
287
- }
288
- if (item === "separator") {
289
- return [...currentItems, /*#__PURE__*/jsx("span", {
290
- className: "ms-auto"
291
- }, `menu-item-spacer-${index + 1}`)];
292
- }
293
- const lastItem = currentItems.length > 0 ? currentItems[currentItems.length - 1] : null;
294
- const menuItem = item;
295
- return isArray(lastItem) ? [...currentItems.slice(0, currentItems.length - 1), [...lastItem, menuItem]] : [...currentItems, [menuItem]];
296
- };
297
- $[14] = navClassNames;
298
- $[15] = t10;
299
- } else {
300
- t10 = $[15];
301
- }
302
- let t11;
303
- if ($[16] !== navClassNames) {
304
- t11 = (it_0, index_0) => isArray(it_0) ? /*#__PURE__*/jsx(Menu, {
305
- items: it_0,
306
- className: navClassNames,
307
- itemClassName: "nav-item",
308
- linkClassName: "nav-link"
309
- }, `submenu-item-${index_0 + 1}`) : it_0;
310
- $[16] = navClassNames;
311
- $[17] = t11;
312
- } else {
313
- t11 = $[17];
314
- }
315
- t9 = [!hasResources && user !== null ? "resources" : null, ...menuItems, !hasAccount && menuItems.indexOf("separator") === -1 ? "separator" : null, !hasAccount ? "account" : null].filter(_temp$5).reduce(t10, []).map(t11);
316
- $[9] = guest;
317
- $[10] = main;
318
- $[11] = navClassNames;
319
- $[12] = user;
320
- $[13] = t9;
321
- } else {
322
- t9 = $[13];
323
- }
324
- const items = t9;
325
- let t10;
326
- if ($[18] !== loading || $[19] !== name || $[20] !== route || $[21] !== vertical) {
327
- t10 = name !== null ? /*#__PURE__*/jsx(Link, {
328
- href: route("home"),
329
- className: "navbar-brand",
330
- children: /*#__PURE__*/jsx("span", {
331
- className: classNames([{
332
- "text-opacity-75": loading,
333
- "ms-2": vertical
334
- }]),
335
- children: name
336
- })
337
- }) : null;
338
- $[18] = loading;
339
- $[19] = name;
340
- $[20] = route;
341
- $[21] = vertical;
342
- $[22] = t10;
343
- } else {
344
- t10 = $[22];
345
- }
346
- let t11;
347
- if ($[23] !== background || $[24] !== className || $[25] !== items || $[26] !== props || $[27] !== t10 || $[28] !== vertical) {
348
- t11 = /*#__PURE__*/jsxs(Navbar, {
349
- theme: background,
350
- vertical: vertical,
351
- className: className,
352
- ...props,
353
- children: [t10, items]
354
- });
355
- $[23] = background;
356
- $[24] = className;
357
- $[25] = items;
358
- $[26] = props;
359
- $[27] = t10;
360
- $[28] = vertical;
361
- $[29] = t11;
362
- } else {
363
- t11 = $[29];
364
- }
365
- return t11;
366
- }
367
- function _temp$5(it) {
368
- return it !== null;
369
- }
370
-
371
- function MainLayout(t0) {
372
- const $ = c(29);
373
- const {
374
- fullscreen: t1,
375
- loading: t2,
376
- children: t3
377
- } = t0;
378
- const fullscreen = t1 === undefined ? false : t1;
379
- const loading = t2 === undefined ? false : t2;
380
- const children = t3 === undefined ? null : t3;
381
- const {
382
- theme: t4,
383
- sidebarPosition: t5,
384
- background: t6,
385
- text: t7
386
- } = usePanneauColorScheme();
387
- const theme = t4 === undefined ? null : t4;
388
- const sidebarPosition = t5 === undefined ? null : t5;
389
- const background = t6 === undefined ? null : t6;
390
- const text = t7 === undefined ? null : t7;
391
- const vertical = sidebarPosition === "left" || sidebarPosition === "right";
392
- const t8 = !vertical;
393
- let t9;
394
- if ($[0] !== t8) {
395
- t9 = classNames(["d-flex", "min-vh-100", {
396
- "flex-column": t8
397
- }]);
398
- $[0] = t8;
399
- $[1] = t9;
400
- } else {
401
- t9 = $[1];
402
- }
403
- const t10 = theme !== null ? theme : undefined;
404
- const t11 = !vertical;
405
- const t12 = !vertical;
406
- const t13 = !vertical;
407
- const t14 = !vertical;
408
- const t15 = vertical && sidebarPosition === "left";
409
- const t16 = vertical && sidebarPosition === "right";
410
- const t17 = vertical && sidebarPosition === "left";
411
- const t18 = vertical && sidebarPosition === "right";
412
- let t19;
413
- if ($[2] !== t11 || $[3] !== t12 || $[4] !== t13 || $[5] !== t14 || $[6] !== t15 || $[7] !== t16 || $[8] !== t17 || $[9] !== t18) {
414
- t19 = classNames([{
415
- "shadow-sm": t11,
416
- "border-bottom": t12,
417
- "sticky-top": t13,
418
- "px-3": t14,
419
- "pe-3": t15,
420
- "ps-3": t16,
421
- "me-2": t17,
422
- "ms-2": t18
423
- }]);
424
- $[2] = t11;
425
- $[3] = t12;
426
- $[4] = t13;
427
- $[5] = t14;
428
- $[6] = t15;
429
- $[7] = t16;
430
- $[8] = t17;
431
- $[9] = t18;
432
- $[10] = t19;
433
- } else {
434
- t19 = $[10];
435
- }
436
- let t20;
437
- if ($[11] !== loading || $[12] !== t19 || $[13] !== theme || $[14] !== vertical) {
438
- t20 = /*#__PURE__*/jsx(MainNavbar, {
439
- className: t19,
440
- theme: theme,
441
- loading: loading,
442
- vertical: vertical
443
- });
444
- $[11] = loading;
445
- $[12] = t19;
446
- $[13] = theme;
447
- $[14] = vertical;
448
- $[15] = t20;
449
- } else {
450
- t20 = $[15];
451
- }
452
- let t21;
453
- if ($[16] !== background || $[17] !== fullscreen || $[18] !== text) {
454
- t21 = classNames(["flex-grow-1", {
455
- "d-flex flex-column": fullscreen
456
- }, background !== null ? `bg-${background}` : null, text !== null ? `text-${text}` : null]);
457
- $[16] = background;
458
- $[17] = fullscreen;
459
- $[18] = text;
460
- $[19] = t21;
461
- } else {
462
- t21 = $[19];
463
- }
464
- let t22;
465
- if ($[20] !== children || $[21] !== t21) {
466
- t22 = /*#__PURE__*/jsx("div", {
467
- className: t21,
468
- children: children
469
- });
470
- $[20] = children;
471
- $[21] = t21;
472
- $[22] = t22;
473
- } else {
474
- t22 = $[22];
475
- }
476
- let t23;
477
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
478
- t23 = /*#__PURE__*/jsx(Modals, {});
479
- $[23] = t23;
480
- } else {
481
- t23 = $[23];
482
- }
483
- let t24;
484
- if ($[24] !== t10 || $[25] !== t20 || $[26] !== t22 || $[27] !== t9) {
485
- t24 = /*#__PURE__*/jsxs("div", {
486
- className: t9,
487
- "data-bs-theme": t10,
488
- children: [t20, t22, t23]
489
- });
490
- $[24] = t10;
491
- $[25] = t20;
492
- $[26] = t22;
493
- $[27] = t9;
494
- $[28] = t24;
495
- } else {
496
- t24 = $[28];
497
- }
498
- return t24;
499
- }
500
-
501
- function PageHeader(t0) {
502
- const $ = c(20);
503
- const {
504
- title: t1,
505
- actions: t2,
506
- small: t3,
507
- className: t4,
508
- children: t5
509
- } = t0;
510
- const title = t1 === undefined ? null : t1;
511
- const actions = t2 === undefined ? null : t2;
512
- const small = t3 === undefined ? false : t3;
513
- const className = t4 === undefined ? null : t4;
514
- const children = t5 === undefined ? null : t5;
515
- const {
516
- text,
517
- background
518
- } = usePanneauColorScheme();
519
- let t6;
520
- if ($[0] !== title) {
521
- t6 = title !== null ? /*#__PURE__*/jsx("h1", {
522
- className: classNames(["mb-0", "h2"]),
523
- children: /*#__PURE__*/jsx(LabelComponent, {
524
- children: title
525
- })
526
- }) : null;
527
- $[0] = title;
528
- $[1] = t6;
529
- } else {
530
- t6 = $[1];
531
- }
532
- let t7;
533
- if ($[2] !== actions) {
534
- t7 = actions !== null ? /*#__PURE__*/jsx("div", {
535
- className: "ms-auto",
536
- children: actions
537
- }) : null;
538
- $[2] = actions;
539
- $[3] = t7;
540
- } else {
541
- t7 = $[3];
542
- }
543
- let t8;
544
- if ($[4] !== t6 || $[5] !== t7) {
545
- t8 = /*#__PURE__*/jsxs("div", {
546
- className: "d-flex align-items-center flex-wrap",
547
- children: [t6, t7]
548
- });
549
- $[4] = t6;
550
- $[5] = t7;
551
- $[6] = t8;
552
- } else {
553
- t8 = $[6];
554
- }
555
- const inner = t8;
556
- const t9 = background !== null ? `bg-${background}` : null;
557
- const t10 = text !== null ? `text-${text}` : null;
558
- const t11 = background || text !== null;
559
- const t12 = className !== null;
560
- let t13;
561
- if ($[7] !== className || $[8] !== t10 || $[9] !== t11 || $[10] !== t12 || $[11] !== t9) {
562
- t13 = classNames(["py-4", t9, t10, {
563
- "border-bottom": t11,
564
- [className]: t12
565
- }]);
566
- $[7] = className;
567
- $[8] = t10;
568
- $[9] = t11;
569
- $[10] = t12;
570
- $[11] = t9;
571
- $[12] = t13;
572
- } else {
573
- t13 = $[12];
574
- }
575
- let t14;
576
- if ($[13] !== inner || $[14] !== small) {
577
- t14 = /*#__PURE__*/jsx("div", {
578
- className: "container-sm",
579
- children: small ? /*#__PURE__*/jsx("div", {
580
- className: "row justify-content-center",
581
- children: /*#__PURE__*/jsx("div", {
582
- className: "col-12 col-md-8 col-lg-7",
583
- children: inner
584
- })
585
- }) : inner
586
- });
587
- $[13] = inner;
588
- $[14] = small;
589
- $[15] = t14;
590
- } else {
591
- t14 = $[15];
592
- }
593
- let t15;
594
- if ($[16] !== children || $[17] !== t13 || $[18] !== t14) {
595
- t15 = /*#__PURE__*/jsxs("div", {
596
- className: t13,
597
- children: [t14, children]
598
- });
599
- $[16] = children;
600
- $[17] = t13;
601
- $[18] = t14;
602
- $[19] = t15;
603
- } else {
604
- t15 = $[19];
605
- }
606
- return t15;
607
- }
608
-
609
- function ResourceCreatePage(t0) {
610
- const $ = c(22);
611
- const {
612
- resource
613
- } = t0;
614
- const [, navigate] = useLocation();
615
- const search = useSearch();
616
- const resourceRoute = useResourceUrlGenerator(resource);
617
- let t1;
618
- if ($[0] !== search) {
619
- t1 = queryString.parse(search, {
620
- arrayFormat: "bracket"
621
- });
622
- $[0] = search;
623
- $[1] = t1;
624
- } else {
625
- t1 = $[1];
626
- }
627
- const {
628
- type: t2
629
- } = t1;
630
- const queryType = t2 === undefined ? null : t2;
631
- let t3;
632
- if ($[2] !== queryType) {
633
- t3 = isString(queryType) ? queryType : null;
634
- $[2] = queryType;
635
- $[3] = t3;
636
- } else {
637
- t3 = $[3];
638
- }
639
- const type = t3;
640
- const resourceValues = useResourceValues(resource);
641
- const typeName = useResourceTypeName(resource, type);
642
- let t4;
643
- if ($[4] !== navigate || $[5] !== resourceRoute) {
644
- t4 = () => {
645
- navigate(`${resourceRoute("index")}?created=true`);
646
- };
647
- $[4] = navigate;
648
- $[5] = resourceRoute;
649
- $[6] = t4;
650
- } else {
651
- t4 = $[6];
652
- }
653
- const onComplete = t4;
654
- let t5;
655
- if ($[7] !== resourceValues) {
656
- t5 = /*#__PURE__*/jsx(FormattedMessage, {
657
- id: "6viUpq",
658
- values: resourceValues
659
- });
660
- $[7] = resourceValues;
661
- $[8] = t5;
662
- } else {
663
- t5 = $[8];
664
- }
665
- let t6;
666
- if ($[9] !== typeName) {
667
- t6 = typeName !== null ? /*#__PURE__*/jsxs("span", {
668
- className: "text-body-secondary",
669
- children: [" (", typeName, ")"]
670
- }) : null;
671
- $[9] = typeName;
672
- $[10] = t6;
673
- } else {
674
- t6 = $[10];
675
- }
676
- let t7;
677
- if ($[11] !== t5 || $[12] !== t6) {
678
- t7 = /*#__PURE__*/jsx(PageHeader, {
679
- title: /*#__PURE__*/jsxs(Fragment, {
680
- children: [t5, t6]
681
- }),
682
- small: true
683
- });
684
- $[11] = t5;
685
- $[12] = t6;
686
- $[13] = t7;
687
- } else {
688
- t7 = $[13];
689
- }
690
- let t8;
691
- if ($[14] !== onComplete || $[15] !== resource || $[16] !== t7 || $[17] !== type) {
692
- t8 = /*#__PURE__*/jsx(MainLayout, {
693
- children: /*#__PURE__*/jsx(ResourceFormWrapper, {
694
- resource: resource,
695
- type: type,
696
- onComplete: onComplete,
697
- withContainer: true,
698
- header: t7
699
- })
700
- });
701
- $[14] = onComplete;
702
- $[15] = resource;
703
- $[16] = t7;
704
- $[17] = type;
705
- $[18] = t8;
706
- } else {
707
- t8 = $[18];
708
- }
709
- let t9;
710
- if ($[19] !== resource || $[20] !== t8) {
711
- t9 = /*#__PURE__*/jsx(ResourceProvider, {
712
- resource: resource,
713
- children: t8
714
- });
715
- $[19] = resource;
716
- $[20] = t8;
717
- $[21] = t9;
718
- } else {
719
- t9 = $[21];
720
- }
721
- return t9;
722
- }
723
-
724
- function ResourceDeletePage(t0) {
725
- const $ = c(22);
726
- const {
727
- itemId,
728
- resource
729
- } = t0;
730
- const [, navigate] = useLocation();
731
- const resourceRoute = useResourceUrlGenerator(resource);
732
- const {
733
- item,
734
- isLoading,
735
- error
736
- } = useResourceItem(resource, itemId);
737
- let t1;
738
- if ($[0] !== item) {
739
- t1 = item || {};
740
- $[0] = item;
741
- $[1] = t1;
742
- } else {
743
- t1 = $[1];
744
- }
745
- const {
746
- type: t2
747
- } = t1;
748
- const type = t2 === undefined ? null : t2;
749
- const resourceValues = useResourceValues(resource);
750
- const typeName = useResourceTypeName(resource, type);
751
- let t3;
752
- if ($[2] !== navigate || $[3] !== resourceRoute) {
753
- t3 = () => navigate(`${resourceRoute("index")}?deleted=true`);
754
- $[2] = navigate;
755
- $[3] = resourceRoute;
756
- $[4] = t3;
757
- } else {
758
- t3 = $[4];
759
- }
760
- const onComplete = t3;
761
- let t4;
762
- if ($[5] !== item || $[6] !== onComplete || $[7] !== resource || $[8] !== resourceValues || $[9] !== typeName) {
763
- t4 = item !== null ? /*#__PURE__*/jsx(ResourceFormWrapper, {
764
- resource: resource,
765
- item: item,
766
- onComplete: onComplete,
767
- isDelete: true,
768
- withContainer: true,
769
- header: /*#__PURE__*/jsx(PageHeader, {
770
- title: /*#__PURE__*/jsxs(Fragment, {
771
- children: [/*#__PURE__*/jsx(FormattedMessage, {
772
- id: "zN5N/Q",
773
- values: resourceValues
774
- }), typeName !== null ? /*#__PURE__*/jsxs("span", {
775
- className: "text-body-secondary",
776
- children: [" ", "(", typeName, ")"]
777
- }) : null]
778
- }),
779
- small: true
780
- })
781
- }) : null;
782
- $[5] = item;
783
- $[6] = onComplete;
784
- $[7] = resource;
785
- $[8] = resourceValues;
786
- $[9] = typeName;
787
- $[10] = t4;
788
- } else {
789
- t4 = $[10];
790
- }
791
- let t5;
792
- if ($[11] !== error || $[12] !== isLoading || $[13] !== item) {
793
- t5 = item === null && isLoading && !error ? /*#__PURE__*/jsx(Loading, {
794
- className: "mw-25 my-4 m-auto",
795
- withDelay: true,
796
- children: /*#__PURE__*/jsx(FormattedMessage, {
797
- id: "TV3jir"
798
- })
799
- }) : null;
800
- $[11] = error;
801
- $[12] = isLoading;
802
- $[13] = item;
803
- $[14] = t5;
804
- } else {
805
- t5 = $[14];
806
- }
807
- let t6;
808
- if ($[15] !== isLoading || $[16] !== t4 || $[17] !== t5) {
809
- t6 = /*#__PURE__*/jsxs(MainLayout, {
810
- loading: isLoading,
811
- children: [t4, t5]
812
- });
813
- $[15] = isLoading;
814
- $[16] = t4;
815
- $[17] = t5;
816
- $[18] = t6;
817
- } else {
818
- t6 = $[18];
819
- }
820
- let t7;
821
- if ($[19] !== resource || $[20] !== t6) {
822
- t7 = /*#__PURE__*/jsx(ResourceProvider, {
823
- resource: resource,
824
- children: t6
825
- });
826
- $[19] = resource;
827
- $[20] = t6;
828
- $[21] = t7;
829
- } else {
830
- t7 = $[21];
831
- }
832
- return t7;
833
- }
834
-
835
- function ResourceEditPage(t0) {
836
- const $ = c(23);
837
- const {
838
- itemId,
839
- resource
840
- } = t0;
841
- const {
842
- item,
843
- isLoading,
844
- error
845
- } = useResourceItem(resource, itemId);
846
- let t1;
847
- if ($[0] !== item) {
848
- t1 = item || {};
849
- $[0] = item;
850
- $[1] = t1;
851
- } else {
852
- t1 = $[1];
853
- }
854
- const {
855
- type: t2
856
- } = t1;
857
- const type = t2 === undefined ? null : t2;
858
- const [editItem, setEditItem] = useState(item);
859
- const typeName = useResourceTypeName(resource, type);
860
- let t3;
861
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
862
- t3 = newItem => setEditItem(newItem);
863
- $[2] = t3;
864
- } else {
865
- t3 = $[2];
866
- }
867
- const onComplete = t3;
868
- let t4;
869
- let t5;
870
- if ($[3] !== item) {
871
- t4 = () => {
872
- setEditItem(item);
873
- };
874
- t5 = [item, setEditItem];
875
- $[3] = item;
876
- $[4] = t4;
877
- $[5] = t5;
878
- } else {
879
- t4 = $[4];
880
- t5 = $[5];
881
- }
882
- useEffect(t4, t5);
883
- const resourceValues = useResourceValues(resource);
884
- let t6;
885
- if ($[6] !== editItem || $[7] !== resource || $[8] !== resourceValues || $[9] !== type || $[10] !== typeName) {
886
- t6 = editItem !== null ? /*#__PURE__*/jsx(ResourceFormWrapper, {
887
- resource: resource,
888
- item: editItem,
889
- type: type,
890
- onComplete: onComplete,
891
- withContainer: true,
892
- header: /*#__PURE__*/jsx(PageHeader, {
893
- title: /*#__PURE__*/jsxs(Fragment, {
894
- children: [/*#__PURE__*/jsx(FormattedMessage, {
895
- id: "mCfzkJ",
896
- values: resourceValues
897
- }), typeName !== null ? /*#__PURE__*/jsxs("span", {
898
- className: "text-body-secondary",
899
- children: [" ", "(", typeName, ")"]
900
- }) : null]
901
- }),
902
- small: true
903
- })
904
- }) : null;
905
- $[6] = editItem;
906
- $[7] = resource;
907
- $[8] = resourceValues;
908
- $[9] = type;
909
- $[10] = typeName;
910
- $[11] = t6;
911
- } else {
912
- t6 = $[11];
913
- }
914
- let t7;
915
- if ($[12] !== editItem || $[13] !== error || $[14] !== isLoading) {
916
- t7 = editItem === null && isLoading && !error ? /*#__PURE__*/jsx(Loading, {
917
- className: "mw-25 my-4 m-auto",
918
- withDelay: true,
919
- children: /*#__PURE__*/jsx(FormattedMessage, {
920
- id: "TV3jir"
921
- })
922
- }) : null;
923
- $[12] = editItem;
924
- $[13] = error;
925
- $[14] = isLoading;
926
- $[15] = t7;
927
- } else {
928
- t7 = $[15];
929
- }
930
- let t8;
931
- if ($[16] !== isLoading || $[17] !== t6 || $[18] !== t7) {
932
- t8 = /*#__PURE__*/jsxs(MainLayout, {
933
- loading: isLoading,
934
- children: [t6, t7]
935
- });
936
- $[16] = isLoading;
937
- $[17] = t6;
938
- $[18] = t7;
939
- $[19] = t8;
940
- } else {
941
- t8 = $[19];
942
- }
943
- let t9;
944
- if ($[20] !== resource || $[21] !== t8) {
945
- t9 = /*#__PURE__*/jsx(ResourceProvider, {
946
- resource: resource,
947
- children: t8
948
- });
949
- $[20] = resource;
950
- $[21] = t8;
951
- $[22] = t9;
952
- } else {
953
- t9 = $[22];
954
- }
955
- return t9;
956
- }
957
-
958
- function ResourceCreateButton(t0) {
959
- const $ = c(24);
960
- const {
961
- resource,
962
- size: t1,
963
- className: t2
964
- } = t0;
965
- const size = t1 === undefined ? "lg" : t1;
966
- const className = t2 === undefined ? null : t2;
967
- const {
968
- types: t3
969
- } = resource;
970
- const types = t3 === undefined ? null : t3;
971
- const resourceRoute = useResourceUrlGenerator(resource);
972
- const resourceValues = useResourceValues(resource);
973
- const [dropdownOpened, setDropdownOpened] = useState(false);
974
- let t4;
975
- if ($[0] !== dropdownOpened) {
976
- t4 = e => {
977
- e.preventDefault();
978
- e.stopPropagation();
979
- setDropdownOpened(!dropdownOpened);
980
- };
981
- $[0] = dropdownOpened;
982
- $[1] = t4;
983
- } else {
984
- t4 = $[1];
985
- }
986
- const onClickDropdown = t4;
987
- let t5;
988
- if ($[2] !== className || $[3] !== dropdownOpened || $[4] !== onClickDropdown || $[5] !== resourceRoute || $[6] !== resourceValues || $[7] !== size || $[8] !== types) {
989
- const finalTypes = types !== null ? types.filter(_temp$4) : null;
990
- const hasMultipleTypes = finalTypes !== null && finalTypes.length > 1;
991
- let t6;
992
- if ($[10] !== dropdownOpened) {
993
- t6 = () => {
994
- if (dropdownOpened) {
995
- setDropdownOpened(false);
996
- }
997
- };
998
- $[10] = dropdownOpened;
999
- $[11] = t6;
1000
- } else {
1001
- t6 = $[11];
1002
- }
1003
- const onDropdownClickOutside = t6;
1004
- const t7 = !hasMultipleTypes ? `${resourceRoute("create")}${finalTypes !== null && finalTypes.length === 1 ? `?type=${finalTypes[0].id}` : ""}` : "#";
1005
- const t8 = className !== null;
1006
- let t9;
1007
- if ($[12] !== className || $[13] !== hasMultipleTypes || $[14] !== t8) {
1008
- t9 = classNames([{
1009
- "dropdown-toggle": hasMultipleTypes,
1010
- [className]: t8
1011
- }]);
1012
- $[12] = className;
1013
- $[13] = hasMultipleTypes;
1014
- $[14] = t8;
1015
- $[15] = t9;
1016
- } else {
1017
- t9 = $[15];
1018
- }
1019
- const t10 = hasMultipleTypes ? onClickDropdown : null;
1020
- let t11;
1021
- if ($[16] !== resourceValues) {
1022
- t11 = /*#__PURE__*/jsx(FormattedMessage, {
1023
- id: "l+ddDH",
1024
- values: resourceValues
1025
- });
1026
- $[16] = resourceValues;
1027
- $[17] = t11;
1028
- } else {
1029
- t11 = $[17];
1030
- }
1031
- let t12;
1032
- if ($[18] !== size || $[19] !== t10 || $[20] !== t11 || $[21] !== t7 || $[22] !== t9) {
1033
- t12 = /*#__PURE__*/jsx(Button, {
1034
- href: t7,
1035
- size: size,
1036
- theme: "primary",
1037
- className: t9,
1038
- onClick: t10,
1039
- children: t11
1040
- });
1041
- $[18] = size;
1042
- $[19] = t10;
1043
- $[20] = t11;
1044
- $[21] = t7;
1045
- $[22] = t9;
1046
- $[23] = t12;
1047
- } else {
1048
- t12 = $[23];
1049
- }
1050
- const button = t12;
1051
- t5 = hasMultipleTypes ? /*#__PURE__*/jsxs("div", {
1052
- className: classNames(["dropdown", {
1053
- show: dropdownOpened
1054
- }]),
1055
- children: [button, /*#__PURE__*/jsx(Dropdown, {
1056
- items: finalTypes.map(it => ({
1057
- id: it.id,
1058
- label: it.name,
1059
- href: `${resourceRoute("create")}?type=${it.id}`
1060
- })),
1061
- visible: dropdownOpened,
1062
- align: "end",
1063
- onClickOutside: onDropdownClickOutside
1064
- })]
1065
- }) : button;
1066
- $[2] = className;
1067
- $[3] = dropdownOpened;
1068
- $[4] = onClickDropdown;
1069
- $[5] = resourceRoute;
1070
- $[6] = resourceValues;
1071
- $[7] = size;
1072
- $[8] = types;
1073
- $[9] = t5;
1074
- } else {
1075
- t5 = $[9];
1076
- }
1077
- return t5;
1078
- }
1079
- function _temp$4(t0) {
1080
- const {
1081
- settings: t1
1082
- } = t0;
1083
- const {
1084
- canCreate: t2
1085
- } = t1 === undefined ? {} : t1;
1086
- const canCreate = t2 === undefined ? true : t2;
1087
- return canCreate;
1088
- }
1089
-
1090
- // Kept for backward compatibility with exports
1091
- function ResourceItemsList(t0) {
1092
- const $ = c(8);
1093
- let props;
1094
- let resource;
1095
- if ($[0] !== t0) {
1096
- ({
1097
- resource,
1098
- ...props
1099
- } = t0);
1100
- $[0] = t0;
1101
- $[1] = props;
1102
- $[2] = resource;
1103
- } else {
1104
- props = $[1];
1105
- resource = $[2];
1106
- }
1107
- let t1;
1108
- if ($[3] !== resource) {
1109
- t1 = isObject(resource) ? resource : {
1110
- id: resource
1111
- };
1112
- $[3] = resource;
1113
- $[4] = t1;
1114
- } else {
1115
- t1 = $[4];
1116
- }
1117
- const {
1118
- id: t2
1119
- } = t1;
1120
- const finalResource = t2 === undefined ? null : t2;
1121
- let t3;
1122
- if ($[5] !== finalResource || $[6] !== props) {
1123
- t3 = /*#__PURE__*/jsx(ResourceList, {
1124
- resource: finalResource,
1125
- ...props
1126
- });
1127
- $[5] = finalResource;
1128
- $[6] = props;
1129
- $[7] = t3;
1130
- } else {
1131
- t3 = $[7];
1132
- }
1133
- return t3;
1134
- }
1135
-
1136
- const DEFAULT_ACTIONS = ['create'];
1137
- function ResourceIndexPage(t0) {
1138
- const $ = c(72);
1139
- const {
1140
- resource,
1141
- defaultActions: t1,
1142
- actionsProps: t2
1143
- } = t0;
1144
- const defaultActions = t1 === undefined ? DEFAULT_ACTIONS : t1;
1145
- const actionsProps = t2 === undefined ? null : t2;
1146
- const {
1147
- theme: t3
1148
- } = usePanneauColorScheme();
1149
- const theme = t3 === undefined ? null : t3;
1150
- const {
1151
- name,
1152
- settings: t4,
1153
- index: t5
1154
- } = resource;
1155
- let t6;
1156
- if ($[0] !== t4) {
1157
- t6 = t4 === undefined ? {} : t4;
1158
- $[0] = t4;
1159
- $[1] = t6;
1160
- } else {
1161
- t6 = $[1];
1162
- }
1163
- const settings = t6;
1164
- let t7;
1165
- if ($[2] !== t5) {
1166
- t7 = t5 === undefined ? {} : t5;
1167
- $[2] = t5;
1168
- $[3] = t7;
1169
- } else {
1170
- t7 = $[3];
1171
- }
1172
- const index = t7;
1173
- let t8;
1174
- if ($[4] !== settings) {
1175
- t8 = settings || {};
1176
- $[4] = settings;
1177
- $[5] = t8;
1178
- } else {
1179
- t8 = $[5];
1180
- }
1181
- const {
1182
- canCreate: t9,
1183
- indexIsPaginated: t10
1184
- } = t8;
1185
- const canCreate = t9 === undefined ? true : t9;
1186
- const paginated = t10 === undefined ? false : t10;
1187
- let t11;
1188
- if ($[6] !== index) {
1189
- t11 = index || {};
1190
- $[6] = index;
1191
- $[7] = t11;
1192
- } else {
1193
- t11 = $[7];
1194
- }
1195
- const {
1196
- actions: t12
1197
- } = t11;
1198
- const indexActions = t12 === undefined ? null : t12;
1199
- let t13;
1200
- if ($[8] !== canCreate || $[9] !== defaultActions || $[10] !== indexActions) {
1201
- t13 = indexActions || defaultActions.filter(it => it !== "create" || canCreate);
1202
- $[8] = canCreate;
1203
- $[9] = defaultActions;
1204
- $[10] = indexActions;
1205
- $[11] = t13;
1206
- } else {
1207
- t13 = $[11];
1208
- }
1209
- let t14;
1210
- if ($[12] !== t13) {
1211
- t14 = t13.map(_temp$3);
1212
- $[12] = t13;
1213
- $[13] = t14;
1214
- } else {
1215
- t14 = $[13];
1216
- }
1217
- const finalActions = t14;
1218
- const resourceValues = useResourceValues(resource);
1219
- const actionsComponentsManager = useActionsComponentsManager();
1220
- const [, navigate] = useLocation();
1221
- const search = useSearch();
1222
- let t15;
1223
- if ($[14] !== search) {
1224
- t15 = queryString.parse(search, {
1225
- arrayFormat: "bracket"
1226
- });
1227
- $[14] = search;
1228
- $[15] = t15;
1229
- } else {
1230
- t15 = $[15];
1231
- }
1232
- const query = t15;
1233
- let t16;
1234
- if ($[16] !== query) {
1235
- t16 = omit(query, ["created", "deleted"]);
1236
- $[16] = query;
1237
- $[17] = t16;
1238
- } else {
1239
- t16 = $[17];
1240
- }
1241
- const listQuery = t16;
1242
- let t17;
1243
- if ($[18] !== query) {
1244
- t17 = query || {};
1245
- $[18] = query;
1246
- $[19] = t17;
1247
- } else {
1248
- t17 = $[19];
1249
- }
1250
- const {
1251
- created: t18,
1252
- deleted: t19
1253
- } = t17;
1254
- const created = t18 === undefined ? false : t18;
1255
- const deleted = t19 === undefined ? false : t19;
1256
- const resourceRoute = useResourceUrlGenerator(resource);
1257
- let t20;
1258
- if ($[20] !== resourceRoute) {
1259
- t20 = resourceRoute("index");
1260
- $[20] = resourceRoute;
1261
- $[21] = t20;
1262
- } else {
1263
- t20 = $[21];
1264
- }
1265
- const url = t20;
1266
- let t21;
1267
- if ($[22] !== navigate || $[23] !== url) {
1268
- t21 = submitQuery => {
1269
- const newQuery = submitQuery !== null ? Object.keys(submitQuery).reduce((currentQuery, key) => {
1270
- const value = submitQuery[key];
1271
- return value !== null ? {
1272
- ...currentQuery,
1273
- [key]: value
1274
- } : currentQuery;
1275
- }, {}) : null;
1276
- navigate(`${url}${newQuery !== null ? `?${queryString.stringify(newQuery, {
1277
- arrayFormat: "bracket"
1278
- })}` : ""}`);
1279
- };
1280
- $[22] = navigate;
1281
- $[23] = url;
1282
- $[24] = t21;
1283
- } else {
1284
- t21 = $[24];
1285
- }
1286
- const onQueryChange = t21;
1287
- let t22;
1288
- if ($[25] !== navigate || $[26] !== url) {
1289
- t22 = () => {
1290
- const resetQuery = queryString.stringify(null, {
1291
- arrayFormat: "bracket"
1292
- });
1293
- navigate(`${url}?${resetQuery}`);
1294
- };
1295
- $[25] = navigate;
1296
- $[26] = url;
1297
- $[27] = t22;
1298
- } else {
1299
- t22 = $[27];
1300
- }
1301
- const onQueryReset = t22;
1302
- let t23;
1303
- if ($[28] !== navigate || $[29] !== url) {
1304
- t23 = () => {
1305
- navigate(url, {
1306
- replace: true
1307
- });
1308
- };
1309
- $[28] = navigate;
1310
- $[29] = url;
1311
- $[30] = t23;
1312
- } else {
1313
- t23 = $[30];
1314
- }
1315
- const onClickCloseAlert = t23;
1316
- let t24;
1317
- if ($[31] !== actionsComponentsManager || $[32] !== finalActions || $[33] !== onQueryChange || $[34] !== query || $[35] !== resource) {
1318
- t24 = finalActions.length > 0 ? /*#__PURE__*/jsx("div", {
1319
- className: "d-flex align-items-center",
1320
- children: finalActions.map(t25 => {
1321
- const {
1322
- id,
1323
- component: t26,
1324
- withQuery: t27,
1325
- href: t28,
1326
- ...otherProps
1327
- } = t25;
1328
- const component = t26 === undefined ? Button : t26;
1329
- const withQuery = t27 === undefined ? false : t27;
1330
- const href = t28 === undefined ? null : t28;
1331
- const ActionComponent = isString(component) ? actionsComponentsManager.getComponent(component) : component;
1332
- const isButton = ActionComponent === Button;
1333
- let finalHref = href;
1334
- if (isButton && withQuery && href !== null) {
1335
- finalHref = `${finalHref}${finalHref.indexOf("?") !== -1 ? "&" : "?"}${queryString.stringify(query, {
1336
- arrayFormat: "bracket"
1337
- })}`;
1338
- }
1339
- return ActionComponent !== null ? /*#__PURE__*/jsx(ActionComponent, {
1340
- href: finalHref,
1341
- ...otherProps,
1342
- ...(!isButton ? {
1343
- resource,
1344
- query,
1345
- onQueryChange
1346
- } : {})
1347
- }, `action-${id}`) : null;
1348
- })
1349
- }) : null;
1350
- $[31] = actionsComponentsManager;
1351
- $[32] = finalActions;
1352
- $[33] = onQueryChange;
1353
- $[34] = query;
1354
- $[35] = resource;
1355
- $[36] = t24;
1356
- } else {
1357
- t24 = $[36];
1358
- }
1359
- let t25;
1360
- if ($[37] !== name || $[38] !== t24) {
1361
- t25 = /*#__PURE__*/jsx(PageHeader, {
1362
- title: name,
1363
- actions: t24
1364
- });
1365
- $[37] = name;
1366
- $[38] = t24;
1367
- $[39] = t25;
1368
- } else {
1369
- t25 = $[39];
1370
- }
1371
- let t26;
1372
- if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
1373
- t26 = classNames(["container-sm py-4"]);
1374
- $[40] = t26;
1375
- } else {
1376
- t26 = $[40];
1377
- }
1378
- let t27;
1379
- if ($[41] !== created || $[42] !== onClickCloseAlert || $[43] !== resourceValues) {
1380
- t27 = created ? /*#__PURE__*/jsx(Alert, {
1381
- className: "mb-4",
1382
- onClose: onClickCloseAlert,
1383
- children: /*#__PURE__*/jsx(FormattedMessage, {
1384
- id: "bfP/d8",
1385
- values: resourceValues
1386
- })
1387
- }) : null;
1388
- $[41] = created;
1389
- $[42] = onClickCloseAlert;
1390
- $[43] = resourceValues;
1391
- $[44] = t27;
1392
- } else {
1393
- t27 = $[44];
1394
- }
1395
- let t28;
1396
- if ($[45] !== deleted || $[46] !== onClickCloseAlert || $[47] !== resourceValues) {
1397
- t28 = deleted ? /*#__PURE__*/jsx(Alert, {
1398
- className: "mb-4",
1399
- onClose: onClickCloseAlert,
1400
- children: /*#__PURE__*/jsx(FormattedMessage, {
1401
- id: "dkRdks",
1402
- values: resourceValues
1403
- })
1404
- }) : null;
1405
- $[45] = deleted;
1406
- $[46] = onClickCloseAlert;
1407
- $[47] = resourceValues;
1408
- $[48] = t28;
1409
- } else {
1410
- t28 = $[48];
1411
- }
1412
- let t29;
1413
- if ($[49] !== actionsProps) {
1414
- t29 = actionsProps || {};
1415
- $[49] = actionsProps;
1416
- $[50] = t29;
1417
- } else {
1418
- t29 = $[50];
1419
- }
1420
- let t30;
1421
- if ($[51] !== t29) {
1422
- t30 = {
1423
- size: "sm",
1424
- ...t29
1425
- };
1426
- $[51] = t29;
1427
- $[52] = t30;
1428
- } else {
1429
- t30 = $[52];
1430
- }
1431
- let t31;
1432
- if ($[53] !== listQuery || $[54] !== onQueryChange || $[55] !== onQueryReset || $[56] !== paginated || $[57] !== resource || $[58] !== t30 || $[59] !== theme || $[60] !== url) {
1433
- t31 = /*#__PURE__*/jsx(ResourceItemsList, {
1434
- resource: resource,
1435
- baseUrl: url,
1436
- query: listQuery,
1437
- paginated: paginated,
1438
- onQueryChange: onQueryChange,
1439
- onQueryReset: onQueryReset,
1440
- theme: theme,
1441
- actionsProps: t30
1442
- });
1443
- $[53] = listQuery;
1444
- $[54] = onQueryChange;
1445
- $[55] = onQueryReset;
1446
- $[56] = paginated;
1447
- $[57] = resource;
1448
- $[58] = t30;
1449
- $[59] = theme;
1450
- $[60] = url;
1451
- $[61] = t31;
1452
- } else {
1453
- t31 = $[61];
1454
- }
1455
- let t32;
1456
- if ($[62] !== t27 || $[63] !== t28 || $[64] !== t31) {
1457
- t32 = /*#__PURE__*/jsxs("div", {
1458
- className: t26,
1459
- children: [t27, t28, t31]
1460
- });
1461
- $[62] = t27;
1462
- $[63] = t28;
1463
- $[64] = t31;
1464
- $[65] = t32;
1465
- } else {
1466
- t32 = $[65];
1467
- }
1468
- let t33;
1469
- if ($[66] !== t25 || $[67] !== t32) {
1470
- t33 = /*#__PURE__*/jsxs(MainLayout, {
1471
- children: [t25, t32]
1472
- });
1473
- $[66] = t25;
1474
- $[67] = t32;
1475
- $[68] = t33;
1476
- } else {
1477
- t33 = $[68];
1478
- }
1479
- let t34;
1480
- if ($[69] !== resource || $[70] !== t33) {
1481
- t34 = /*#__PURE__*/jsx(ResourceProvider, {
1482
- resource: resource,
1483
- children: t33
1484
- });
1485
- $[69] = resource;
1486
- $[70] = t33;
1487
- $[71] = t34;
1488
- } else {
1489
- t34 = $[71];
1490
- }
1491
- return t34;
1492
- }
1493
- function _temp$3(it_0) {
1494
- return it_0 === "create" ? {
1495
- id: "create",
1496
- component: ResourceCreateButton,
1497
- size: "md",
1498
- theme: "primary"
1499
- } : it_0;
1500
- }
1501
-
1502
- function ResourceShowPage(t0) {
1503
- const $ = c(19);
1504
- const {
1505
- resource,
1506
- itemId
1507
- } = t0;
1508
- const {
1509
- name
1510
- } = resource;
1511
- const {
1512
- item,
1513
- isLoading,
1514
- error
1515
- } = useResourceItem(resource, itemId);
1516
- let t1;
1517
- if ($[0] !== item) {
1518
- t1 = item || {};
1519
- $[0] = item;
1520
- $[1] = t1;
1521
- } else {
1522
- t1 = $[1];
1523
- }
1524
- const {
1525
- type: t2
1526
- } = t1;
1527
- const type = t2 === undefined ? null : t2;
1528
- let t3;
1529
- if ($[2] !== item || $[3] !== itemId || $[4] !== name || $[5] !== resource || $[6] !== type) {
1530
- t3 = item !== null ? /*#__PURE__*/jsx(ResourceFormWrapper, {
1531
- resource: resource,
1532
- item: item,
1533
- type: type,
1534
- disabled: true,
1535
- header: /*#__PURE__*/jsx(PageHeader, {
1536
- title: `${name} #${itemId}`,
1537
- small: true
1538
- }),
1539
- withContainer: true
1540
- }) : null;
1541
- $[2] = item;
1542
- $[3] = itemId;
1543
- $[4] = name;
1544
- $[5] = resource;
1545
- $[6] = type;
1546
- $[7] = t3;
1547
- } else {
1548
- t3 = $[7];
1549
- }
1550
- let t4;
1551
- if ($[8] !== error || $[9] !== isLoading || $[10] !== item) {
1552
- t4 = item === null && isLoading && !error ? /*#__PURE__*/jsx(Loading, {
1553
- className: "mw-25 my-4 m-auto",
1554
- withDelay: true,
1555
- children: /*#__PURE__*/jsx(FormattedMessage, {
1556
- id: "TV3jir"
1557
- })
1558
- }) : null;
1559
- $[8] = error;
1560
- $[9] = isLoading;
1561
- $[10] = item;
1562
- $[11] = t4;
1563
- } else {
1564
- t4 = $[11];
1565
- }
1566
- let t5;
1567
- if ($[12] !== isLoading || $[13] !== t3 || $[14] !== t4) {
1568
- t5 = /*#__PURE__*/jsxs(MainLayout, {
1569
- loading: isLoading,
1570
- children: [t3, t4]
1571
- });
1572
- $[12] = isLoading;
1573
- $[13] = t3;
1574
- $[14] = t4;
1575
- $[15] = t5;
1576
- } else {
1577
- t5 = $[15];
1578
- }
1579
- let t6;
1580
- if ($[16] !== resource || $[17] !== t5) {
1581
- t6 = /*#__PURE__*/jsx(ResourceProvider, {
1582
- resource: resource,
1583
- children: t5
1584
- });
1585
- $[16] = resource;
1586
- $[17] = t5;
1587
- $[18] = t6;
1588
- } else {
1589
- t6 = $[18];
1590
- }
1591
- return t6;
1592
- }
1593
-
1594
- function ResourceDuplicatePage(t0) {
1595
- const $ = c(22);
1596
- const {
1597
- itemId,
1598
- resource
1599
- } = t0;
1600
- const [, navigate] = useLocation();
1601
- const resourceRoute = useResourceUrlGenerator(resource);
1602
- const {
1603
- item,
1604
- isLoading,
1605
- error
1606
- } = useResourceItem(resource, itemId);
1607
- let t1;
1608
- if ($[0] !== item) {
1609
- t1 = item || {};
1610
- $[0] = item;
1611
- $[1] = t1;
1612
- } else {
1613
- t1 = $[1];
1614
- }
1615
- const {
1616
- type: t2
1617
- } = t1;
1618
- const type = t2 === undefined ? null : t2;
1619
- const resourceValues = useResourceValues(resource);
1620
- const typeName = useResourceTypeName(resource, type);
1621
- let t3;
1622
- if ($[2] !== navigate || $[3] !== resourceRoute) {
1623
- t3 = t4 => {
1624
- const {
1625
- id: t5
1626
- } = t4 === undefined ? {} : t4;
1627
- const id = t5 === undefined ? null : t5;
1628
- return navigate(`${resourceRoute("edit", {
1629
- id
1630
- })}?duplicated=true`);
1631
- };
1632
- $[2] = navigate;
1633
- $[3] = resourceRoute;
1634
- $[4] = t3;
1635
- } else {
1636
- t3 = $[4];
1637
- }
1638
- const onComplete = t3;
1639
- let t4;
1640
- if ($[5] !== item || $[6] !== onComplete || $[7] !== resource || $[8] !== resourceValues || $[9] !== typeName) {
1641
- t4 = item !== null ? /*#__PURE__*/jsx(ResourceFormWrapper, {
1642
- resource: resource,
1643
- item: item,
1644
- onComplete: onComplete,
1645
- isDuplicate: true,
1646
- withContainer: true,
1647
- header: /*#__PURE__*/jsx(PageHeader, {
1648
- title: /*#__PURE__*/jsxs(Fragment, {
1649
- children: [/*#__PURE__*/jsx(FormattedMessage, {
1650
- id: "G7M4nI",
1651
- values: resourceValues
1652
- }), typeName !== null ? /*#__PURE__*/jsxs("span", {
1653
- className: "text-body-secondary",
1654
- children: [" ", "(", typeName, ")"]
1655
- }) : null]
1656
- }),
1657
- small: true
1658
- })
1659
- }) : null;
1660
- $[5] = item;
1661
- $[6] = onComplete;
1662
- $[7] = resource;
1663
- $[8] = resourceValues;
1664
- $[9] = typeName;
1665
- $[10] = t4;
1666
- } else {
1667
- t4 = $[10];
1668
- }
1669
- let t5;
1670
- if ($[11] !== error || $[12] !== isLoading || $[13] !== item) {
1671
- t5 = item === null && isLoading && !error ? /*#__PURE__*/jsx(Loading, {
1672
- className: "mw-25 my-4 m-auto",
1673
- withDelay: true,
1674
- children: /*#__PURE__*/jsx(FormattedMessage, {
1675
- id: "TV3jir"
1676
- })
1677
- }) : null;
1678
- $[11] = error;
1679
- $[12] = isLoading;
1680
- $[13] = item;
1681
- $[14] = t5;
1682
- } else {
1683
- t5 = $[14];
1684
- }
1685
- let t6;
1686
- if ($[15] !== isLoading || $[16] !== t4 || $[17] !== t5) {
1687
- t6 = /*#__PURE__*/jsxs(MainLayout, {
1688
- loading: isLoading,
1689
- children: [t4, t5]
1690
- });
1691
- $[15] = isLoading;
1692
- $[16] = t4;
1693
- $[17] = t5;
1694
- $[18] = t6;
1695
- } else {
1696
- t6 = $[18];
1697
- }
1698
- let t7;
1699
- if ($[19] !== resource || $[20] !== t6) {
1700
- t7 = /*#__PURE__*/jsx(ResourceProvider, {
1701
- resource: resource,
1702
- children: t6
1703
- });
1704
- $[19] = resource;
1705
- $[20] = t6;
1706
- $[21] = t7;
1707
- } else {
1708
- t7 = $[21];
1709
- }
1710
- return t7;
1711
- }
1712
-
1713
- function ResourceLink(t0) {
1714
- const $ = c(6);
1715
- const {
1716
- resource
1717
- } = t0;
1718
- const route = useUrlGenerator();
1719
- const {
1720
- id: resourceId
1721
- } = resource || {};
1722
- const resourceValues = useResourceValues(resource);
1723
- const T0 = Link;
1724
- const t1 = "d-block my-2";
1725
- const t2 = route("resources.index", {
1726
- resource: resourceId
1727
- });
1728
- let t3;
1729
- if ($[0] !== resourceValues) {
1730
- t3 = /*#__PURE__*/jsx(FormattedMessage, {
1731
- id: "FntHPK",
1732
- values: resourceValues
1733
- });
1734
- $[0] = resourceValues;
1735
- $[1] = t3;
1736
- } else {
1737
- t3 = $[1];
1738
- }
1739
- let t4;
1740
- if ($[2] !== T0 || $[3] !== t2 || $[4] !== t3) {
1741
- t4 = /*#__PURE__*/jsx(T0, {
1742
- className: t1,
1743
- href: t2,
1744
- children: t3
1745
- });
1746
- $[2] = T0;
1747
- $[3] = t2;
1748
- $[4] = t3;
1749
- $[5] = t4;
1750
- } else {
1751
- t4 = $[5];
1752
- }
1753
- return t4;
1754
- }
1755
- function HomePage() {
1756
- const $ = c(10);
1757
- const resources = usePanneauResources();
1758
- let T0;
1759
- let t0;
1760
- let t1;
1761
- if ($[0] !== resources) {
1762
- const visibleResources = resources.filter(_temp$2);
1763
- T0 = MainLayout;
1764
- t0 = "container-sm py-4";
1765
- t1 = visibleResources.map(_temp2$2);
1766
- $[0] = resources;
1767
- $[1] = T0;
1768
- $[2] = t0;
1769
- $[3] = t1;
1770
- } else {
1771
- T0 = $[1];
1772
- t0 = $[2];
1773
- t1 = $[3];
1774
- }
1775
- let t2;
1776
- if ($[4] !== t0 || $[5] !== t1) {
1777
- t2 = /*#__PURE__*/jsx("div", {
1778
- className: t0,
1779
- children: t1
1780
- });
1781
- $[4] = t0;
1782
- $[5] = t1;
1783
- $[6] = t2;
1784
- } else {
1785
- t2 = $[6];
1786
- }
1787
- let t3;
1788
- if ($[7] !== T0 || $[8] !== t2) {
1789
- t3 = /*#__PURE__*/jsx(T0, {
1790
- children: t2
1791
- });
1792
- $[7] = T0;
1793
- $[8] = t2;
1794
- $[9] = t3;
1795
- } else {
1796
- t3 = $[9];
1797
- }
1798
- return t3;
1799
- }
1800
- function _temp2$2(resource) {
1801
- const {
1802
- id: resourceId
1803
- } = resource || {};
1804
- return /*#__PURE__*/jsx(ResourceLink, {
1805
- resource: resource
1806
- }, `resource-link-${resourceId}`);
1807
- }
1808
- function _temp$2(t0) {
1809
- const {
1810
- settings: t1
1811
- } = t0;
1812
- const {
1813
- hideInNavbar: t2
1814
- } = t1 === undefined ? {} : t1;
1815
- const hideInNavbar = t2 === undefined ? false : t2;
1816
- return !hideInNavbar;
1817
- }
1818
-
1819
- function AccountPage() {
1820
- const $ = c(1);
1821
- let t0;
1822
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1823
- t0 = /*#__PURE__*/jsx(MainLayout, {
1824
- children: /*#__PURE__*/jsx("div", {
1825
- className: "container-sm py-4",
1826
- children: "Account page"
1827
- })
1828
- });
1829
- $[0] = t0;
1830
- } else {
1831
- t0 = $[0];
1832
- }
1833
- return t0;
1834
- }
1835
-
1836
- function LoginForm(t0) {
1837
- const $ = c(9);
1838
- const {
1839
- className: t1,
1840
- onComplete: t2
1841
- } = t0;
1842
- const className = t1 === undefined ? null : t1;
1843
- const onComplete = t2 === undefined ? null : t2;
1844
- const url = useUrlGenerator();
1845
- const {
1846
- login
1847
- } = useAuth();
1848
- let t3;
1849
- if ($[0] !== login) {
1850
- t3 = (action, t4) => {
1851
- const {
1852
- email,
1853
- password
1854
- } = t4;
1855
- return login(email, password);
1856
- };
1857
- $[0] = login;
1858
- $[1] = t3;
1859
- } else {
1860
- t3 = $[1];
1861
- }
1862
- const postForm = t3;
1863
- let t4;
1864
- if ($[2] !== url) {
1865
- t4 = url("auth.login");
1866
- $[2] = url;
1867
- $[3] = t4;
1868
- } else {
1869
- t4 = $[3];
1870
- }
1871
- let t5;
1872
- if ($[4] !== className || $[5] !== onComplete || $[6] !== postForm || $[7] !== t4) {
1873
- t5 = /*#__PURE__*/jsx(Form, {
1874
- type: "login",
1875
- action: t4,
1876
- postForm: postForm,
1877
- onComplete: onComplete,
1878
- className: className
1879
- });
1880
- $[4] = className;
1881
- $[5] = onComplete;
1882
- $[6] = postForm;
1883
- $[7] = t4;
1884
- $[8] = t5;
1885
- } else {
1886
- t5 = $[8];
1887
- }
1888
- return t5;
1889
- }
1890
-
1891
- function GuestLayout(t0) {
1892
- const $ = c(19);
1893
- const {
1894
- fullscreen: t1,
1895
- children
1896
- } = t0;
1897
- const fullscreen = t1 === undefined ? false : t1;
1898
- const {
1899
- theme: t2,
1900
- background: t3,
1901
- text: t4
1902
- } = usePanneauColorScheme();
1903
- const theme = t2 === undefined ? null : t2;
1904
- const background = t3 === undefined ? null : t3;
1905
- const text = t4 === undefined ? null : t4;
1906
- let t5;
1907
- if ($[0] !== fullscreen) {
1908
- t5 = classNames([{
1909
- "d-flex flex-column min-vh-100": fullscreen
1910
- }]);
1911
- $[0] = fullscreen;
1912
- $[1] = t5;
1913
- } else {
1914
- t5 = $[1];
1915
- }
1916
- const t6 = theme !== null ? theme : undefined;
1917
- let t7;
1918
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1919
- t7 = /*#__PURE__*/jsx(MainNavbar, {
1920
- className: classNames(["sticky-top", "px-3"])
1921
- });
1922
- $[2] = t7;
1923
- } else {
1924
- t7 = $[2];
1925
- }
1926
- let t8;
1927
- if ($[3] !== background || $[4] !== fullscreen || $[5] !== text) {
1928
- t8 = classNames([{
1929
- "d-flex flex-column flex-grow-1": fullscreen
1930
- }, background !== null ? `bg-${background}` : null, text !== null ? `text-${text}` : null]);
1931
- $[3] = background;
1932
- $[4] = fullscreen;
1933
- $[5] = text;
1934
- $[6] = t8;
1935
- } else {
1936
- t8 = $[6];
1937
- }
1938
- let t9;
1939
- if ($[7] !== fullscreen) {
1940
- t9 = classNames({
1941
- "w-100 my-auto": fullscreen
1942
- });
1943
- $[7] = fullscreen;
1944
- $[8] = t9;
1945
- } else {
1946
- t9 = $[8];
1947
- }
1948
- let t10;
1949
- if ($[9] !== children || $[10] !== t9) {
1950
- t10 = /*#__PURE__*/jsx("div", {
1951
- className: t9,
1952
- children: children
1953
- });
1954
- $[9] = children;
1955
- $[10] = t9;
1956
- $[11] = t10;
1957
- } else {
1958
- t10 = $[11];
1959
- }
1960
- let t11;
1961
- if ($[12] !== t10 || $[13] !== t8) {
1962
- t11 = /*#__PURE__*/jsx("div", {
1963
- className: t8,
1964
- children: t10
1965
- });
1966
- $[12] = t10;
1967
- $[13] = t8;
1968
- $[14] = t11;
1969
- } else {
1970
- t11 = $[14];
1971
- }
1972
- let t12;
1973
- if ($[15] !== t11 || $[16] !== t5 || $[17] !== t6) {
1974
- t12 = /*#__PURE__*/jsxs("div", {
1975
- className: t5,
1976
- "data-bs-theme": t6,
1977
- children: [t7, t11]
1978
- });
1979
- $[15] = t11;
1980
- $[16] = t5;
1981
- $[17] = t6;
1982
- $[18] = t12;
1983
- } else {
1984
- t12 = $[18];
1985
- }
1986
- return t12;
1987
- }
1988
-
1989
- function LoginPage() {
1990
- const $ = c(5);
1991
- const route = useUrlGenerator();
1992
- let t0;
1993
- if ($[0] !== route) {
1994
- t0 = () => {
1995
- window.location.href = route("home");
1996
- };
1997
- $[0] = route;
1998
- $[1] = t0;
1999
- } else {
2000
- t0 = $[1];
2001
- }
2002
- const onComplete = t0;
2003
- let t1;
2004
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2005
- t1 = /*#__PURE__*/jsx("h1", {
2006
- className: "mb-4",
2007
- children: /*#__PURE__*/jsx(FormattedMessage, {
2008
- id: "AeOZq+"
2009
- })
2010
- });
2011
- $[2] = t1;
2012
- } else {
2013
- t1 = $[2];
2014
- }
2015
- let t2;
2016
- if ($[3] !== onComplete) {
2017
- t2 = /*#__PURE__*/jsx(GuestLayout, {
2018
- fullscreen: true,
2019
- children: /*#__PURE__*/jsx("div", {
2020
- className: "container-sm py-4",
2021
- children: /*#__PURE__*/jsx("div", {
2022
- className: "row justify-content-center",
2023
- children: /*#__PURE__*/jsxs("div", {
2024
- className: "col-12 col-sm-8 col-md-6",
2025
- children: [t1, /*#__PURE__*/jsx(LoginForm, {
2026
- onComplete: onComplete
2027
- })]
2028
- })
2029
- })
2030
- })
2031
- });
2032
- $[3] = onComplete;
2033
- $[4] = t2;
2034
- } else {
2035
- t2 = $[4];
2036
- }
2037
- return t2;
2038
- }
2039
-
2040
- function ErrorPage(t0) {
2041
- const $ = c(17);
2042
- const {
2043
- statusCode: t1
2044
- } = t0;
2045
- const statusCode = t1 === undefined ? null : t1;
2046
- const code = statusCode || 404;
2047
- let t2;
2048
- bb0: switch (code) {
2049
- case 401:
2050
- {
2051
- let t3;
2052
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2053
- t3 = /*#__PURE__*/jsx(FormattedMessage, {
2054
- id: "6nwWPR"
2055
- });
2056
- $[0] = t3;
2057
- } else {
2058
- t3 = $[0];
2059
- }
2060
- t2 = t3;
2061
- break bb0;
2062
- }
2063
- case 403:
2064
- {
2065
- let t3;
2066
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
2067
- t3 = /*#__PURE__*/jsx(FormattedMessage, {
2068
- id: "Pih2UO"
2069
- });
2070
- $[1] = t3;
2071
- } else {
2072
- t3 = $[1];
2073
- }
2074
- t2 = t3;
2075
- break bb0;
2076
- }
2077
- case 404:
2078
- {
2079
- let t3;
2080
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2081
- t3 = /*#__PURE__*/jsx(FormattedMessage, {
2082
- id: "6Ie+vL"
2083
- });
2084
- $[2] = t3;
2085
- } else {
2086
- t3 = $[2];
2087
- }
2088
- t2 = t3;
2089
- break bb0;
2090
- }
2091
- case 500:
2092
- {
2093
- let t3;
2094
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
2095
- t3 = /*#__PURE__*/jsx(FormattedMessage, {
2096
- id: "owrRHV"
2097
- });
2098
- $[3] = t3;
2099
- } else {
2100
- t3 = $[3];
2101
- }
2102
- t2 = t3;
2103
- break bb0;
2104
- }
2105
- default:
2106
- {
2107
- let t3;
2108
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
2109
- t3 = /*#__PURE__*/jsx(FormattedMessage, {
2110
- id: "6Ie+vL"
2111
- });
2112
- $[4] = t3;
2113
- } else {
2114
- t3 = $[4];
2115
- }
2116
- t2 = t3;
2117
- }
2118
- }
2119
- const title = t2;
2120
- let t3;
2121
- bb1: switch (code) {
2122
- case 401:
2123
- {
2124
- let t4;
2125
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
2126
- t4 = /*#__PURE__*/jsx(FormattedMessage, {
2127
- id: "82P2dS"
2128
- });
2129
- $[5] = t4;
2130
- } else {
2131
- t4 = $[5];
2132
- }
2133
- t3 = t4;
2134
- break bb1;
2135
- }
2136
- case 403:
2137
- {
2138
- let t4;
2139
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
2140
- t4 = /*#__PURE__*/jsx(FormattedMessage, {
2141
- id: "8HFiMs"
2142
- });
2143
- $[6] = t4;
2144
- } else {
2145
- t4 = $[6];
2146
- }
2147
- t3 = t4;
2148
- break bb1;
2149
- }
2150
- case 404:
2151
- {
2152
- let t4;
2153
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
2154
- t4 = /*#__PURE__*/jsx(FormattedMessage, {
2155
- id: "naie2b"
2156
- });
2157
- $[7] = t4;
2158
- } else {
2159
- t4 = $[7];
2160
- }
2161
- t3 = t4;
2162
- break bb1;
2163
- }
2164
- case 500:
2165
- {
2166
- let t4;
2167
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
2168
- t4 = /*#__PURE__*/jsx(FormattedMessage, {
2169
- id: "yALN2p"
2170
- });
2171
- $[8] = t4;
2172
- } else {
2173
- t4 = $[8];
2174
- }
2175
- t3 = t4;
2176
- break bb1;
2177
- }
2178
- default:
2179
- {
2180
- let t4;
2181
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
2182
- t4 = /*#__PURE__*/jsx(FormattedMessage, {
2183
- id: "naie2b"
2184
- });
2185
- $[9] = t4;
2186
- } else {
2187
- t4 = $[9];
2188
- }
2189
- t3 = t4;
2190
- }
2191
- }
2192
- const description = t3;
2193
- let t4;
2194
- if ($[10] !== title) {
2195
- t4 = /*#__PURE__*/jsx("h1", {
2196
- children: title
2197
- });
2198
- $[10] = title;
2199
- $[11] = t4;
2200
- } else {
2201
- t4 = $[11];
2202
- }
2203
- let t5;
2204
- if ($[12] !== description) {
2205
- t5 = /*#__PURE__*/jsx("p", {
2206
- children: description
2207
- });
2208
- $[12] = description;
2209
- $[13] = t5;
2210
- } else {
2211
- t5 = $[13];
2212
- }
2213
- let t6;
2214
- if ($[14] !== t4 || $[15] !== t5) {
2215
- t6 = /*#__PURE__*/jsx(GuestLayout, {
2216
- fullscreen: true,
2217
- children: /*#__PURE__*/jsx("div", {
2218
- className: "container-sm py-4",
2219
- children: /*#__PURE__*/jsx("div", {
2220
- className: "row justify-content-center",
2221
- children: /*#__PURE__*/jsxs("div", {
2222
- className: "col-12 col-sm-8 col-md-6",
2223
- children: [t4, t5]
2224
- })
2225
- })
2226
- })
2227
- });
2228
- $[14] = t4;
2229
- $[15] = t5;
2230
- $[16] = t6;
2231
- } else {
2232
- t6 = $[16];
2233
- }
2234
- return t6;
2235
- }
2236
-
2237
- function createResourceRoutes(resource, {
2238
- route,
2239
- componentsManager,
2240
- pages = {}
2241
- }) {
2242
- const {
2243
- id: resourceId,
2244
- pages: resourcePages = {},
2245
- extraRoutes = []
2246
- } = resource;
2247
- const ResourceIndexComponent = componentsManager.getComponent(resourcePages?.resourceIndexPage?.component) || componentsManager.getComponent(pages?.indexPage?.component) || ResourceIndexPage;
2248
- const ResourceShowComponent = componentsManager.getComponent(resourcePages?.resourceShowPage?.component) || componentsManager.getComponent(pages?.showPage?.component) || ResourceShowPage;
2249
- const ResourceCreateComponent = componentsManager.getComponent(resourcePages?.resourceCreatePage?.component) || componentsManager.getComponent(pages?.createPage?.component) || ResourceCreatePage;
2250
- const ResourceEditComponent = componentsManager.getComponent(resourcePages?.resourceEditPage?.component) || componentsManager.getComponent(pages?.editPage?.component) || ResourceEditPage;
2251
- const ResourceDeleteComponent = componentsManager.getComponent(resourcePages?.resourceDeletePage?.component) || componentsManager.getComponent(pages?.deletePage?.component) || ResourceDeletePage;
2252
- const ResourceDuplicateComponent = componentsManager.getComponent(resourcePages?.resourceDuplicatePage?.component) || componentsManager.getComponent(pages?.duplicatePage?.component) || ResourceDuplicatePage;
2253
- return [/*#__PURE__*/jsx(Route, {
2254
- path: route('resources.create', {
2255
- resource: resourceId
2256
- }),
2257
- children: () => /*#__PURE__*/jsx(ResourceCreateComponent, {
2258
- resource: resource
2259
- })
2260
- }, `${resourceId}-create`), /*#__PURE__*/jsx(Route, {
2261
- path: route('resources.show', {
2262
- resource: resourceId,
2263
- id: ':id'
2264
- }),
2265
- children: ({
2266
- id = null
2267
- }) => /*#__PURE__*/jsx(ResourceShowComponent, {
2268
- itemId: id,
2269
- resource: resource
2270
- })
2271
- }, `${resourceId}-show`), /*#__PURE__*/jsx(Route, {
2272
- path: route('resources.edit', {
2273
- resource: resourceId,
2274
- id: ':id'
2275
- }),
2276
- children: ({
2277
- id = null
2278
- }) => /*#__PURE__*/jsx(ResourceEditComponent, {
2279
- itemId: id,
2280
- resource: resource
2281
- })
2282
- }, `${resourceId}-edit`), /*#__PURE__*/jsx(Route, {
2283
- path: route('resources.delete', {
2284
- resource: resourceId,
2285
- id: ':id'
2286
- }),
2287
- children: ({
2288
- id = null
2289
- }) => /*#__PURE__*/jsx(ResourceDeleteComponent, {
2290
- itemId: id,
2291
- resource: resource
2292
- })
2293
- }, `${resourceId}-delete`), /*#__PURE__*/jsx(Route, {
2294
- path: route('resources.duplicate', {
2295
- resource: resourceId,
2296
- id: ':id'
2297
- }),
2298
- children: ({
2299
- id = null
2300
- }) => /*#__PURE__*/jsx(ResourceDuplicateComponent, {
2301
- itemId: id,
2302
- resource: resource
2303
- })
2304
- }, `${resourceId}-duplicate`), ...extraRoutes.map(({
2305
- path,
2306
- component,
2307
- ...pageProps
2308
- }) => {
2309
- const RouteComponent = componentsManager.getComponent(component);
2310
- return RouteComponent !== null ? /*#__PURE__*/jsx(Route, {
2311
- path: path,
2312
- children: () => /*#__PURE__*/jsx(RouteComponent, {
2313
- resource: resource,
2314
- ...pageProps
2315
- })
2316
- }, `route-${path}`) : null;
2317
- }), /*#__PURE__*/jsx(Route, {
2318
- path: route('resources.index', {
2319
- resource: resourceId
2320
- }),
2321
- children: () => /*#__PURE__*/jsx(ResourceIndexComponent, {
2322
- resource: resource
2323
- })
2324
- }, `${resourceId}-index`)];
2325
- }
2326
-
2327
- function PanneauRoutes(t0) {
2328
- const $ = c(22);
2329
- const {
2330
- statusCode: t1
2331
- } = t0;
2332
- const initialStatusCode = t1 === undefined ? null : t1;
2333
- const routes = useRoutes();
2334
- const [pathname] = useLocation();
2335
- let t2;
2336
- if ($[0] !== initialStatusCode || $[1] !== pathname) {
2337
- t2 = {
2338
- statusCode: initialStatusCode,
2339
- pathname
2340
- };
2341
- $[0] = initialStatusCode;
2342
- $[1] = pathname;
2343
- $[2] = t2;
2344
- } else {
2345
- t2 = $[2];
2346
- }
2347
- const [initialRequest, setInitialRequest] = useState(t2);
2348
- const {
2349
- statusCode,
2350
- pathname: lastPathname
2351
- } = initialRequest;
2352
- const user = useUser();
2353
- const route = useUrlGenerator();
2354
- const resources = usePanneauResources();
2355
- const componentsManager = usePagesComponentsManager();
2356
- let t3;
2357
- let t4;
2358
- if ($[3] !== lastPathname || $[4] !== pathname) {
2359
- t3 = () => {
2360
- if (pathname !== lastPathname) {
2361
- setInitialRequest({
2362
- pathname,
2363
- statusCode: null
2364
- });
2365
- }
2366
- };
2367
- t4 = [pathname, lastPathname];
2368
- $[3] = lastPathname;
2369
- $[4] = pathname;
2370
- $[5] = t3;
2371
- $[6] = t4;
2372
- } else {
2373
- t3 = $[5];
2374
- t4 = $[6];
2375
- }
2376
- useEffect(t3, t4);
2377
- const {
2378
- pages: t5,
2379
- routes: t6
2380
- } = usePanneau() || {};
2381
- const pages = t5 === undefined ? null : t5;
2382
- const routesDefinition = t6 === undefined ? null : t6;
2383
- const builtinPages = ["home", "login", "account", "error", "index", "show", "create", "edit", "delete", "duplicate"];
2384
- const otherPages = Object.keys(pages || {}).filter(key => builtinPages.indexOf(key) === -1).reduce((acc, key_0) => ({
2385
- ...acc,
2386
- [key_0]: pages[key_0]
2387
- }), {});
2388
- const {
2389
- home: t7,
2390
- login: t8,
2391
- account: t9,
2392
- error: t10
2393
- } = pages || {};
2394
- const homePage = t7 === undefined ? null : t7;
2395
- const loginPage = t8 === undefined ? null : t8;
2396
- const accountPage = t9 === undefined ? null : t9;
2397
- const errorPage = t10 === undefined ? null : t10;
2398
- const customRoutes = [...Object.keys(routesDefinition || {}).filter(_temp$1).filter(key_2 => {
2399
- const routeDef = routesDefinition[key_2];
2400
- return isObject(routeDef) && typeof routeDef.component !== "undefined" && typeof routeDef.path !== "undefined";
2401
- }).map(key_3 => routesDefinition[key_3]), ...Object.keys(otherPages).map(key_4 => otherPages[key_4]).filter(_temp2$1)];
2402
- const HomeComponent = componentsManager.getComponent(homePage?.component) || HomePage;
2403
- const LoginComponent = componentsManager.getComponent(loginPage?.component) || LoginPage;
2404
- const AccountComponent = componentsManager.getComponent(accountPage?.component) || AccountPage;
2405
- const ErrorComponent = componentsManager.getComponent(errorPage?.component) || ErrorPage;
2406
- if (statusCode !== null) {
2407
- return /*#__PURE__*/jsx(ErrorComponent, {
2408
- statusCode: statusCode,
2409
- ...errorPage
2410
- });
2411
- }
2412
- if (user === null) {
2413
- let t11;
2414
- if ($[7] !== route) {
2415
- t11 = route("auth.login");
2416
- $[7] = route;
2417
- $[8] = t11;
2418
- } else {
2419
- t11 = $[8];
2420
- }
2421
- const t12 = `${t11}?next=${encodeURIComponent(pathname)}`;
2422
- let t13;
2423
- if ($[9] !== t12) {
2424
- t13 = /*#__PURE__*/jsx(Route, {
2425
- children: /*#__PURE__*/jsx(Redirect, {
2426
- to: t12
2427
- })
2428
- });
2429
- $[9] = t12;
2430
- $[10] = t13;
2431
- } else {
2432
- t13 = $[10];
2433
- }
2434
- return /*#__PURE__*/jsxs(Switch, {
2435
- children: [/*#__PURE__*/jsx(Route, {
2436
- path: routes["auth.login"],
2437
- children: /*#__PURE__*/jsx(LoginComponent, {
2438
- ...loginPage
2439
- })
2440
- }), t13]
2441
- });
2442
- }
2443
- let t11;
2444
- if ($[11] !== routes || $[12] !== user) {
2445
- t11 = user !== null ? /*#__PURE__*/jsx(Route, {
2446
- path: routes["auth.login"],
2447
- children: /*#__PURE__*/jsx(Redirect, {
2448
- to: routes.home,
2449
- replace: true
2450
- })
2451
- }) : null;
2452
- $[11] = routes;
2453
- $[12] = user;
2454
- $[13] = t11;
2455
- } else {
2456
- t11 = $[13];
2457
- }
2458
- let t15;
2459
- if ($[14] !== HomeComponent || $[15] !== homePage) {
2460
- t15 = /*#__PURE__*/jsx(HomeComponent, {
2461
- ...homePage
2462
- });
2463
- $[14] = HomeComponent;
2464
- $[15] = homePage;
2465
- $[16] = t15;
2466
- } else {
2467
- t15 = $[16];
2468
- }
2469
- let t16;
2470
- if ($[17] !== routes.home || $[18] !== t15) {
2471
- t16 = /*#__PURE__*/jsx(Route, {
2472
- path: routes.home,
2473
- children: t15
2474
- });
2475
- $[17] = routes.home;
2476
- $[18] = t15;
2477
- $[19] = t16;
2478
- } else {
2479
- t16 = $[19];
2480
- }
2481
- let t17;
2482
- if ($[20] !== ErrorComponent) {
2483
- t17 = /*#__PURE__*/jsx(Route, {
2484
- children: /*#__PURE__*/jsx(ErrorComponent, {})
2485
- });
2486
- $[20] = ErrorComponent;
2487
- $[21] = t17;
2488
- } else {
2489
- t17 = $[21];
2490
- }
2491
- return /*#__PURE__*/jsxs(Switch, {
2492
- children: [t11, resources.reduce((acc_0, resource) => [...acc_0, ...createResourceRoutes(resource, {
2493
- route,
2494
- componentsManager,
2495
- pages
2496
- })], []), /*#__PURE__*/jsx(Route, {
2497
- path: routes.account,
2498
- children: /*#__PURE__*/jsx(AccountComponent, {
2499
- ...accountPage
2500
- })
2501
- }), customRoutes.map(t12 => {
2502
- const {
2503
- path: t13,
2504
- route: t14,
2505
- component,
2506
- ...props
2507
- } = t12;
2508
- const path_0 = t13 === undefined ? null : t13;
2509
- const pageRoute_0 = t14 === undefined ? null : t14;
2510
- const PageComponent = componentsManager.getComponent(component);
2511
- const finalPath = path_0 || routes[pageRoute_0];
2512
- return PageComponent !== null ? /*#__PURE__*/jsx(Route, {
2513
- path: path_0 || routes[pageRoute_0],
2514
- children: /*#__PURE__*/jsx(PageComponent, {
2515
- ...props
2516
- })
2517
- }, `custom-route-${finalPath}`) : null;
2518
- }), t16, t17]
2519
- });
2520
- }
2521
- function _temp2$1(t0) {
2522
- const {
2523
- path: t1,
2524
- route: t2
2525
- } = t0;
2526
- const path = t1 === undefined ? null : t1;
2527
- const pageRoute = t2 === undefined ? null : t2;
2528
- return path !== null || pageRoute !== null;
2529
- }
2530
- function _temp$1(key_1) {
2531
- return key_1.match(/^(resources\.|auth\.)/) === null && key_1 !== "home" && key_1 !== "account";
2532
- }
2533
-
2534
- const pathToRegexpParser = createPathToRegexpParser();
2535
- const DEFAULT_ROUTES = {};
2536
- const DEFAULT_LOCALES = [];
2537
- function Container(t0) {
2538
- const $ = c(65);
2539
- const {
2540
- definition,
2541
- forms: t1,
2542
- fields: t2,
2543
- components: t3,
2544
- user: t4,
2545
- memoryRouter: t5,
2546
- baseUrl: t6,
2547
- uppy: t7,
2548
- statusCode: t8
2549
- } = t0;
2550
- const providedForms = t1 === undefined ? null : t1;
2551
- const providedFields = t2 === undefined ? null : t2;
2552
- const components = t3 === undefined ? null : t3;
2553
- const user = t4 === undefined ? null : t4;
2554
- const memoryRouter = t5 === undefined ? false : t5;
2555
- const baseUrl = t6 === undefined ? null : t6;
2556
- const uppy = t7 === undefined ? null : t7;
2557
- const statusCode = t8 === undefined ? null : t8;
2558
- let fields;
2559
- let forms;
2560
- let isMemoryRouter;
2561
- let locale;
2562
- let locales;
2563
- let routes;
2564
- let t10;
2565
- let t9;
2566
- if ($[0] !== definition || $[1] !== memoryRouter) {
2567
- const {
2568
- intl: t11,
2569
- routes: t12,
2570
- resources: t13,
2571
- settings: t14,
2572
- forms: t15,
2573
- fields: t16
2574
- } = definition || {};
2575
- forms = t15;
2576
- fields = t16;
2577
- const {
2578
- locale: t17,
2579
- locales: t18,
2580
- messages
2581
- } = t11 === undefined ? {} : t11;
2582
- locale = t17 === undefined ? "en" : t17;
2583
- locales = t18 === undefined ? DEFAULT_LOCALES : t18;
2584
- routes = t12 === undefined ? DEFAULT_ROUTES : t12;
2585
- const resources = t13 === undefined ? [] : t13;
2586
- const {
2587
- memoryRouter: t19
2588
- } = t14 === undefined ? {} : t14;
2589
- const usesMemoryRouter = t19 === undefined ? false : t19;
2590
- isMemoryRouter = memoryRouter || usesMemoryRouter || false;
2591
- t9 = messages;
2592
- t10 = resources.reduce(_temp, {});
2593
- $[0] = definition;
2594
- $[1] = memoryRouter;
2595
- $[2] = fields;
2596
- $[3] = forms;
2597
- $[4] = isMemoryRouter;
2598
- $[5] = locale;
2599
- $[6] = locales;
2600
- $[7] = routes;
2601
- $[8] = t10;
2602
- $[9] = t9;
2603
- } else {
2604
- fields = $[2];
2605
- forms = $[3];
2606
- isMemoryRouter = $[4];
2607
- locale = $[5];
2608
- locales = $[6];
2609
- routes = $[7];
2610
- t10 = $[8];
2611
- t9 = $[9];
2612
- }
2613
- let t11;
2614
- if ($[10] !== t10 || $[11] !== t9) {
2615
- t11 = {
2616
- ...t9,
2617
- ...t10
2618
- };
2619
- $[10] = t10;
2620
- $[11] = t9;
2621
- $[12] = t11;
2622
- } else {
2623
- t11 = $[12];
2624
- }
2625
- const extraMessages = t11;
2626
- let t12;
2627
- if ($[13] !== baseUrl) {
2628
- t12 = () => {
2629
- window.location.href = baseUrl || "/";
2630
- };
2631
- $[13] = baseUrl;
2632
- $[14] = t12;
2633
- } else {
2634
- t12 = $[14];
2635
- }
2636
- const onUnauthorized = t12;
2637
- const onLogout = _temp2;
2638
- const {
2639
- hook: memoryLocationHook,
2640
- searchHook: memorySearchHook
2641
- } = useMemoryRouter();
2642
- const t13 = isMemoryRouter ? memoryLocationHook : undefined;
2643
- const t14 = isMemoryRouter ? memorySearchHook : undefined;
2644
- let t15;
2645
- if ($[15] !== fields) {
2646
- t15 = fields || [];
2647
- $[15] = fields;
2648
- $[16] = t15;
2649
- } else {
2650
- t15 = $[16];
2651
- }
2652
- let t16;
2653
- if ($[17] !== providedFields) {
2654
- t16 = providedFields || [];
2655
- $[17] = providedFields;
2656
- $[18] = t16;
2657
- } else {
2658
- t16 = $[18];
2659
- }
2660
- let t17;
2661
- if ($[19] !== t15 || $[20] !== t16) {
2662
- t17 = [...t15, ...t16];
2663
- $[19] = t15;
2664
- $[20] = t16;
2665
- $[21] = t17;
2666
- } else {
2667
- t17 = $[21];
2668
- }
2669
- let t18;
2670
- if ($[22] !== forms) {
2671
- t18 = forms || [];
2672
- $[22] = forms;
2673
- $[23] = t18;
2674
- } else {
2675
- t18 = $[23];
2676
- }
2677
- let t19;
2678
- if ($[24] !== providedForms) {
2679
- t19 = providedForms || [];
2680
- $[24] = providedForms;
2681
- $[25] = t19;
2682
- } else {
2683
- t19 = $[25];
2684
- }
2685
- let t20;
2686
- if ($[26] !== t18 || $[27] !== t19) {
2687
- t20 = [...t18, ...t19];
2688
- $[26] = t18;
2689
- $[27] = t19;
2690
- $[28] = t20;
2691
- } else {
2692
- t20 = $[28];
2693
- }
2694
- let t21;
2695
- if ($[29] !== statusCode) {
2696
- t21 = /*#__PURE__*/jsx(PanneauRoutes, {
2697
- statusCode: statusCode
2698
- });
2699
- $[29] = statusCode;
2700
- $[30] = t21;
2701
- } else {
2702
- t21 = $[30];
2703
- }
2704
- let t22;
2705
- if ($[31] !== components || $[32] !== t21) {
2706
- t22 = /*#__PURE__*/jsx(ComponentsProvider, {
2707
- components: components,
2708
- children: t21
2709
- });
2710
- $[31] = components;
2711
- $[32] = t21;
2712
- $[33] = t22;
2713
- } else {
2714
- t22 = $[33];
2715
- }
2716
- let t23;
2717
- if ($[34] !== t22 || $[35] !== user) {
2718
- t23 = /*#__PURE__*/jsx(AuthProvider, {
2719
- user: user,
2720
- onLogout: onLogout,
2721
- children: t22
2722
- });
2723
- $[34] = t22;
2724
- $[35] = user;
2725
- $[36] = t23;
2726
- } else {
2727
- t23 = $[36];
2728
- }
2729
- let t24;
2730
- if ($[37] !== baseUrl || $[38] !== onUnauthorized || $[39] !== t23) {
2731
- t24 = /*#__PURE__*/jsx(ListsProvider, {
2732
- children: /*#__PURE__*/jsx(DisplaysProvider, {
2733
- children: /*#__PURE__*/jsx(FiltersProvider, {
2734
- children: /*#__PURE__*/jsx(ActionsProvider, {
2735
- children: /*#__PURE__*/jsx(ModalProvider, {
2736
- children: /*#__PURE__*/jsx(ModalsProvider, {
2737
- children: /*#__PURE__*/jsx(DataProvider, {
2738
- baseUrl: baseUrl,
2739
- onUnauthorized: onUnauthorized,
2740
- children: t23
2741
- })
2742
- })
2743
- })
2744
- })
2745
- })
2746
- })
2747
- });
2748
- $[37] = baseUrl;
2749
- $[38] = onUnauthorized;
2750
- $[39] = t23;
2751
- $[40] = t24;
2752
- } else {
2753
- t24 = $[40];
2754
- }
2755
- let t25;
2756
- if ($[41] !== t20 || $[42] !== t24) {
2757
- t25 = /*#__PURE__*/jsx(FormsProvider, {
2758
- definitions: t20,
2759
- children: t24
2760
- });
2761
- $[41] = t20;
2762
- $[42] = t24;
2763
- $[43] = t25;
2764
- } else {
2765
- t25 = $[43];
2766
- }
2767
- let t26;
2768
- if ($[44] !== t17 || $[45] !== t25) {
2769
- t26 = /*#__PURE__*/jsx(FieldsProvider, {
2770
- definitions: t17,
2771
- children: t25
2772
- });
2773
- $[44] = t17;
2774
- $[45] = t25;
2775
- $[46] = t26;
2776
- } else {
2777
- t26 = $[46];
2778
- }
2779
- let t27;
2780
- if ($[47] !== routes || $[48] !== t26) {
2781
- t27 = /*#__PURE__*/jsx(RoutesProvider, {
2782
- routes: routes,
2783
- children: t26
2784
- });
2785
- $[47] = routes;
2786
- $[48] = t26;
2787
- $[49] = t27;
2788
- } else {
2789
- t27 = $[49];
2790
- }
2791
- let t28;
2792
- if ($[50] !== t27 || $[51] !== uppy) {
2793
- t28 = /*#__PURE__*/jsx(UppyProvider, {
2794
- ...uppy,
2795
- children: t27
2796
- });
2797
- $[50] = t27;
2798
- $[51] = uppy;
2799
- $[52] = t28;
2800
- } else {
2801
- t28 = $[52];
2802
- }
2803
- let t29;
2804
- if ($[53] !== definition || $[54] !== t28) {
2805
- t29 = /*#__PURE__*/jsx(PanneauProvider, {
2806
- definition: definition,
2807
- children: t28
2808
- });
2809
- $[53] = definition;
2810
- $[54] = t28;
2811
- $[55] = t29;
2812
- } else {
2813
- t29 = $[55];
2814
- }
2815
- let t30;
2816
- if ($[56] !== extraMessages || $[57] !== locale || $[58] !== locales || $[59] !== t29) {
2817
- t30 = /*#__PURE__*/jsx(IntlProvider, {
2818
- locale: locale,
2819
- locales: locales,
2820
- extraMessages: extraMessages,
2821
- children: t29
2822
- });
2823
- $[56] = extraMessages;
2824
- $[57] = locale;
2825
- $[58] = locales;
2826
- $[59] = t29;
2827
- $[60] = t30;
2828
- } else {
2829
- t30 = $[60];
2830
- }
2831
- let t31;
2832
- if ($[61] !== t13 || $[62] !== t14 || $[63] !== t30) {
2833
- t31 = /*#__PURE__*/jsx(Router, {
2834
- hook: t13,
2835
- searchHook: t14,
2836
- parser: pathToRegexpParser,
2837
- children: t30
2838
- });
2839
- $[61] = t13;
2840
- $[62] = t14;
2841
- $[63] = t30;
2842
- $[64] = t31;
2843
- } else {
2844
- t31 = $[64];
2845
- }
2846
- return t31;
2847
- }
2848
- function _temp2() {
2849
- window.location.reload();
2850
- }
2851
- function _temp(allMessages, t0) {
2852
- const {
2853
- id,
2854
- intl: t1
2855
- } = t0;
2856
- const {
2857
- messages: t2
2858
- } = t1 === undefined ? {} : t1;
2859
- const resourceMessages = t2 === undefined ? {} : t2;
2860
- return {
2861
- ...allMessages,
2862
- ...Object.keys(resourceMessages).reduce((allResourceMessages, key) => {
2863
- const messageKey = `resources.${id}.${key}`;
2864
- return {
2865
- ...allResourceMessages,
2866
- [messageKey]: resourceMessages[key]
2867
- };
2868
- }, {})
2869
- };
2870
- }
2871
-
2872
- function ResourceFilters(props) {
2873
- const $ = c(2);
2874
- let t0;
2875
- if ($[0] !== props) {
2876
- t0 = /*#__PURE__*/jsx(Filters, {
2877
- ...props
2878
- });
2879
- $[0] = props;
2880
- $[1] = t0;
2881
- } else {
2882
- t0 = $[1];
2883
- }
2884
- return t0;
2885
- }
2886
-
2887
- export { GuestLayout, MainLayout, PageHeader, ResourceFilters, ResourceFormWrapper as ResourceForm, ResourceItemsList, Container as default };
1
+ import { Panneau } from "./Panneau.js";
2
+ import { readBootConfig } from "./boot.js";
3
+ import { createPanneauApp } from "./createPanneauApp.js";
4
+ export { Panneau, createPanneauApp, readBootConfig };