@firecms/core 3.5.2-canary.09e1281 → 3.5.2-canary.c5764a3

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 (27) hide show
  1. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -5
  2. package/dist/components/EntityCollectionView/utils.d.ts +3 -3
  3. package/dist/index.es.js +676 -817
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +670 -811
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/internal/useUnsavedChangesDialog.d.ts +12 -0
  8. package/dist/types/side_dialogs_controller.d.ts +2 -4
  9. package/package.json +3 -3
  10. package/src/components/EntityCollectionView/EntityCollectionView.tsx +111 -12
  11. package/src/components/EntityCollectionView/utils.ts +7 -7
  12. package/src/components/common/default_entity_actions.tsx +1 -2
  13. package/src/core/DefaultAppBar.tsx +9 -12
  14. package/src/core/EntityEditView.tsx +1 -26
  15. package/src/core/SideDialogs.tsx +13 -6
  16. package/src/hooks/useReferenceDialog.tsx +2 -2
  17. package/src/internal/useBuildSideDialogsController.tsx +2 -44
  18. package/src/internal/useUnsavedChangesDialog.tsx +142 -0
  19. package/src/types/side_dialogs_controller.tsx +2 -4
  20. package/dist/components/EntityCollectionView/CollectionCountBadge.d.ts +0 -8
  21. package/dist/components/EntityCollectionView/CollectionPathTitle.d.ts +0 -24
  22. package/dist/components/EntityCollectionView/EntityIdHeaderWidget.d.ts +0 -12
  23. package/dist/internal/useLeavePageConfirmation.d.ts +0 -11
  24. package/src/components/EntityCollectionView/CollectionCountBadge.tsx +0 -17
  25. package/src/components/EntityCollectionView/CollectionPathTitle.tsx +0 -68
  26. package/src/components/EntityCollectionView/EntityIdHeaderWidget.tsx +0 -124
  27. package/src/internal/useLeavePageConfirmation.ts +0 -25
package/dist/index.umd.js CHANGED
@@ -4802,7 +4802,7 @@
4802
4802
  }
4803
4803
  function useDateFnsLocale(locale) {
4804
4804
  const $ = reactCompilerRuntime.c(7);
4805
- const [, forceUpdate] = React.useReducer(_temp$I, 0);
4805
+ const [, forceUpdate] = React.useReducer(_temp$G, 0);
4806
4806
  let t0;
4807
4807
  if ($[0] !== forceUpdate || $[1] !== locale) {
4808
4808
  t0 = () => {
@@ -4845,7 +4845,7 @@
4845
4845
  }
4846
4846
  return t2;
4847
4847
  }
4848
- function _temp$I(count) {
4848
+ function _temp$G(count) {
4849
4849
  return count + 1;
4850
4850
  }
4851
4851
  const CONTAINER_FULL_WIDTH = "100vw";
@@ -5062,7 +5062,7 @@
5062
5062
  }
5063
5063
  setDataLoading(false);
5064
5064
  setDataLoadingError(void 0);
5065
- setData(entities.map(_temp$H));
5065
+ setData(entities.map(_temp$F));
5066
5066
  setNoMoreToLoad(!itemCount || entities.length < itemCount);
5067
5067
  };
5068
5068
  const onError = (error) => {
@@ -5097,7 +5097,7 @@
5097
5097
  orderBy: sortByProperty,
5098
5098
  order: currentSort
5099
5099
  }).then(onEntitiesUpdate).catch(onError);
5100
- return _temp2$i;
5100
+ return _temp2$h;
5101
5101
  }
5102
5102
  };
5103
5103
  $[8] = collection;
@@ -5146,9 +5146,9 @@
5146
5146
  }
5147
5147
  return t6;
5148
5148
  }
5149
- function _temp2$i() {
5149
+ function _temp2$h() {
5150
5150
  }
5151
- function _temp$H(e_1) {
5151
+ function _temp$F(e_1) {
5152
5152
  return {
5153
5153
  ...e_1
5154
5154
  };
@@ -5361,7 +5361,7 @@
5361
5361
  setEntity(CACHE[entityCacheKey(path, entityId)]);
5362
5362
  setDataLoading(false);
5363
5363
  setDataLoadingError(void 0);
5364
- return _temp$G;
5364
+ return _temp$E;
5365
5365
  } else {
5366
5366
  if (entityId && path && collection) {
5367
5367
  if (dataSource.listenEntity) {
@@ -5382,7 +5382,7 @@
5382
5382
  databaseId,
5383
5383
  collection
5384
5384
  }).then(onEntityUpdate).catch(onError);
5385
- return _temp2$h;
5385
+ return _temp2$g;
5386
5386
  }
5387
5387
  } else {
5388
5388
  onEntityUpdate(void 0);
@@ -5430,9 +5430,9 @@
5430
5430
  }
5431
5431
  function _temp3$7() {
5432
5432
  }
5433
- function _temp2$h() {
5433
+ function _temp2$g() {
5434
5434
  }
5435
- function _temp$G() {
5435
+ function _temp$E() {
5436
5436
  }
5437
5437
  async function saveEntityWithCallbacks({
5438
5438
  collection,
@@ -6087,7 +6087,7 @@
6087
6087
  }
6088
6088
  let t9;
6089
6089
  if ($[19] !== url) {
6090
- t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$F, children: t8 }) });
6090
+ t9 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Open image in new tab", side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { className: "invisible group-hover:visible", variant: "filled", component: "a", href: url, rel: "noopener noreferrer", target: "_blank", size: "smallest", onClick: _temp$D, children: t8 }) });
6091
6091
  $[19] = url;
6092
6092
  $[20] = t9;
6093
6093
  } else {
@@ -6121,7 +6121,7 @@
6121
6121
  }
6122
6122
  return t11;
6123
6123
  }
6124
- function _temp$F(e_0) {
6124
+ function _temp$D(e_0) {
6125
6125
  return e_0.stopPropagation();
6126
6126
  }
6127
6127
  const FIRECMS_NS$1 = "firecms_core";
@@ -6188,7 +6188,7 @@
6188
6188
  }
6189
6189
  let t3;
6190
6190
  if ($[2] !== url) {
6191
- t3 = /* @__PURE__ */ jsxRuntime.jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$E, target: "_blank", children: [
6191
+ t3 = /* @__PURE__ */ jsxRuntime.jsxs("a", { className: "flex gap-4 break-words items-center font-medium text-primary visited:text-primary dark:visited:text-primary dark:text-primary", href: url, rel: "noopener noreferrer", onMouseDown: _temp$C, target: "_blank", children: [
6192
6192
  t2,
6193
6193
  url
6194
6194
  ] });
@@ -6290,7 +6290,7 @@
6290
6290
  }
6291
6291
  let t7;
6292
6292
  if ($[27] !== t4 || $[28] !== t6 || $[29] !== url) {
6293
- t7 = /* @__PURE__ */ jsxRuntime.jsxs("a", { href: url, rel: "noopener noreferrer", target: "_blank", onClick: _temp2$g, className: "flex flex-col items-center justify-center", style: t4, children: [
6293
+ t7 = /* @__PURE__ */ jsxRuntime.jsxs("a", { href: url, rel: "noopener noreferrer", target: "_blank", onClick: _temp2$f, className: "flex flex-col items-center justify-center", style: t4, children: [
6294
6294
  t5,
6295
6295
  t6
6296
6296
  ] });
@@ -6315,10 +6315,10 @@
6315
6315
  }
6316
6316
  }
6317
6317
  }
6318
- function _temp2$g(e_0) {
6318
+ function _temp2$f(e_0) {
6319
6319
  return e_0.stopPropagation();
6320
6320
  }
6321
- function _temp$E(e) {
6321
+ function _temp$C(e) {
6322
6322
  e.preventDefault();
6323
6323
  }
6324
6324
  function VideoPreview(t0) {
@@ -6452,7 +6452,7 @@
6452
6452
  if (Array.isArray(arrayProperty.of)) {
6453
6453
  let t1;
6454
6454
  if ($[6] !== arrayProperty.of) {
6455
- t1 = arrayProperty.of.map(_temp$D);
6455
+ t1 = arrayProperty.of.map(_temp$B);
6456
6456
  $[6] = arrayProperty.of;
6457
6457
  $[7] = t1;
6458
6458
  } else {
@@ -6590,7 +6590,7 @@
6590
6590
  }
6591
6591
  return content || null;
6592
6592
  }
6593
- function _temp$D(p, i) {
6593
+ function _temp$B(p, i) {
6594
6594
  return renderGenericArrayCell(p, i);
6595
6595
  }
6596
6596
  function renderMap(property, size) {
@@ -7781,7 +7781,7 @@
7781
7781
  timeZoneName: "short"
7782
7782
  });
7783
7783
  const parts = tzFormatter.formatToParts(date);
7784
- t32 = parts.find(_temp$C)?.value ?? "";
7784
+ t32 = parts.find(_temp$A)?.value ?? "";
7785
7785
  $[6] = date;
7786
7786
  $[7] = timezone;
7787
7787
  $[8] = t32;
@@ -7852,7 +7852,7 @@
7852
7852
  }
7853
7853
  return t3;
7854
7854
  }
7855
- function _temp$C(p) {
7855
+ function _temp$A(p) {
7856
7856
  return p.type === "timeZoneName";
7857
7857
  }
7858
7858
  function MapPropertyPreview(t0) {
@@ -7947,7 +7947,7 @@
7947
7947
  }
7948
7948
  let t1;
7949
7949
  if ($[1] !== value) {
7950
- t1 = Object.entries(value).map(_temp$B);
7950
+ t1 = Object.entries(value).map(_temp$z);
7951
7951
  $[1] = value;
7952
7952
  $[2] = t1;
7953
7953
  } else {
@@ -7963,7 +7963,7 @@
7963
7963
  }
7964
7964
  return t2;
7965
7965
  }
7966
- function _temp$B(t0) {
7966
+ function _temp$z(t0) {
7967
7967
  const [key, childValue] = t0;
7968
7968
  const isTimestampObj = childValue && typeof childValue === "object" && (childValue instanceof Date || "_seconds" in childValue && "_nanoseconds" in childValue && typeof childValue._seconds === "number" && typeof childValue._nanoseconds === "number" || "seconds" in childValue && "nanoseconds" in childValue && typeof childValue.seconds === "number" && typeof childValue.nanoseconds === "number");
7969
7969
  const isScalar = childValue && (typeof childValue !== "object" || isTimestampObj);
@@ -9286,7 +9286,7 @@
9286
9286
  console.trace("onChange");
9287
9287
  if (valueType === "number") {
9288
9288
  if (multiple) {
9289
- const newValue = updatedValue.map(_temp$A);
9289
+ const newValue = updatedValue.map(_temp$y);
9290
9290
  updateValue(newValue);
9291
9291
  } else {
9292
9292
  updateValue(parseFloat(updatedValue));
@@ -9339,7 +9339,7 @@
9339
9339
  const handleOpenChange = t4;
9340
9340
  let t5;
9341
9341
  if ($[11] !== disabled || $[12] !== enumValues || $[13] !== internalValue || $[14] !== multiple || $[15] !== onChange || $[16] !== renderValue || $[17] !== small || $[18] !== validValue) {
9342
- t5 = multiple ? /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent outline-none", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue.map(_temp2$f) : [], onValueChange: onChange, onOpenChange: handleOpenChange, children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsxRuntime.jsx(EnumValuesChip, { enumKey: enumConfig.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig.id)) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent outline-none [&_button]:ring-0 [&_button]:ring-offset-0", inputClassName: "ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-offset-0", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue?.toString() : "", onValueChange: onChange, onOpenChange: handleOpenChange, renderValue, children: enumValues?.map((enumConfig_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsxRuntime.jsx(EnumValuesChip, { enumKey: enumConfig_0.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig_0.id)) });
9342
+ t5 = multiple ? /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent outline-none", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue.map(_temp2$e) : [], onValueChange: onChange, onOpenChange: handleOpenChange, children: enumValues?.map((enumConfig) => /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelectItem, { value: String(enumConfig.id), children: /* @__PURE__ */ jsxRuntime.jsx(EnumValuesChip, { enumKey: enumConfig.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig.id)) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent outline-none [&_button]:ring-0 [&_button]:ring-offset-0", inputClassName: "ring-0 ring-offset-0 focus:ring-0 focus-visible:ring-0 outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-offset-0", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue?.toString() : "", onValueChange: onChange, onOpenChange: handleOpenChange, renderValue, children: enumValues?.map((enumConfig_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: String(enumConfig_0.id), children: /* @__PURE__ */ jsxRuntime.jsx(EnumValuesChip, { enumKey: enumConfig_0.id, enumValues, size: small ? "small" : "medium" }) }, enumConfig_0.id)) });
9343
9343
  $[11] = disabled;
9344
9344
  $[12] = enumValues;
9345
9345
  $[13] = internalValue;
@@ -9354,10 +9354,10 @@
9354
9354
  }
9355
9355
  return t5;
9356
9356
  }
9357
- function _temp2$f(v_0) {
9357
+ function _temp2$e(v_0) {
9358
9358
  return v_0.toString();
9359
9359
  }
9360
- function _temp$A(v) {
9360
+ function _temp$y(v) {
9361
9361
  return parseFloat(v);
9362
9362
  }
9363
9363
  function VirtualTableNumberInput(props) {
@@ -9553,7 +9553,7 @@
9553
9553
  const renderValue = t3;
9554
9554
  let t4;
9555
9555
  if ($[7] !== disabled || $[8] !== internalValue || $[9] !== multiple || $[10] !== onChange || $[11] !== renderValue || $[12] !== users || $[13] !== validValue) {
9556
- t4 = multiple ? /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue : [], onValueChange: onChange, children: users?.map(_temp$z) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue : "", onValueChange: onChange, renderValue, children: users?.map(_temp2$e) });
9556
+ t4 = multiple ? /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelect, { inputRef: ref, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, includeClear: false, useChips: false, value: validValue ? internalValue : [], onValueChange: onChange, children: users?.map(_temp$x) }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { inputRef: ref, size: "large", fullWidth: true, className: "w-full h-full p-0 bg-transparent", position: "item-aligned", disabled, padding: false, value: validValue ? internalValue : "", onValueChange: onChange, renderValue, children: users?.map(_temp2$d) });
9557
9557
  $[7] = disabled;
9558
9558
  $[8] = internalValue;
9559
9559
  $[9] = multiple;
@@ -9567,10 +9567,10 @@
9567
9567
  }
9568
9568
  return t4;
9569
9569
  }
9570
- function _temp2$e(user_1) {
9570
+ function _temp2$d(user_1) {
9571
9571
  return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: user_1.uid, children: /* @__PURE__ */ jsxRuntime.jsx(UserDisplay, { user: user_1 }) }, user_1.uid);
9572
9572
  }
9573
- function _temp$z(user_0) {
9573
+ function _temp$x(user_0) {
9574
9574
  return /* @__PURE__ */ jsxRuntime.jsx(ui.MultiSelectItem, { value: user_0.uid, children: /* @__PURE__ */ jsxRuntime.jsx(UserDisplay, { user: user_0 }) }, user_0.uid);
9575
9575
  }
9576
9576
  class ErrorBoundary extends React.Component {
@@ -9818,7 +9818,7 @@
9818
9818
  newValue = [...internalValue];
9819
9819
  newValue = removeDuplicates(newValue);
9820
9820
  setInternalValue(newValue);
9821
- const fieldValue = newValue.filter(_temp$y).map(_temp2$d);
9821
+ const fieldValue = newValue.filter(_temp$w).map(_temp2$c);
9822
9822
  if (multipleFilesSupported) {
9823
9823
  onChange(fieldValue);
9824
9824
  } else {
@@ -9936,10 +9936,10 @@
9936
9936
  }
9937
9937
  return t11;
9938
9938
  }
9939
- function _temp2$d(e_0) {
9939
+ function _temp2$c(e_0) {
9940
9940
  return e_0.storagePathOrDownloadUrl;
9941
9941
  }
9942
- function _temp$y(e) {
9942
+ function _temp$w(e) {
9943
9943
  return !!e.storagePathOrDownloadUrl;
9944
9944
  }
9945
9945
  function getInternalInitialValue(multipleFilesSupported, value, metadata, size) {
@@ -10230,7 +10230,7 @@
10230
10230
  const snackbarContext = useSnackbarController();
10231
10231
  let t1;
10232
10232
  if ($[0] !== storage.acceptedFiles) {
10233
- t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$x).reduce(_temp2$c, {}) : void 0;
10233
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.map(_temp$v).reduce(_temp2$b, {}) : void 0;
10234
10234
  $[0] = storage.acceptedFiles;
10235
10235
  $[1] = t1;
10236
10236
  } else {
@@ -10453,13 +10453,13 @@
10453
10453
  }
10454
10454
  return t20;
10455
10455
  }
10456
- function _temp2$c(a, b) {
10456
+ function _temp2$b(a, b) {
10457
10457
  return {
10458
10458
  ...a,
10459
10459
  ...b
10460
10460
  };
10461
10461
  }
10462
- function _temp$x(e) {
10462
+ function _temp$v(e) {
10463
10463
  return {
10464
10464
  [e]: []
10465
10465
  };
@@ -10569,7 +10569,7 @@
10569
10569
  let t1;
10570
10570
  if ($[2] !== updateValue) {
10571
10571
  t1 = (entities) => {
10572
- updateValue(entities.filter(Boolean).map(_temp$w));
10572
+ updateValue(entities.filter(Boolean).map(_temp$u));
10573
10573
  };
10574
10574
  $[2] = updateValue;
10575
10575
  $[3] = t1;
@@ -10579,7 +10579,7 @@
10579
10579
  const onMultipleEntitiesSelected = t1;
10580
10580
  let t2;
10581
10581
  if ($[4] !== internalValue) {
10582
- t2 = internalValue ? Array.isArray(internalValue) ? internalValue.map(_temp2$b) : internalValue.id ? [internalValue.id] : [] : [];
10582
+ t2 = internalValue ? Array.isArray(internalValue) ? internalValue.map(_temp2$a) : internalValue.id ? [internalValue.id] : [] : [];
10583
10583
  $[4] = internalValue;
10584
10584
  $[5] = t2;
10585
10585
  } else {
@@ -10741,10 +10741,10 @@
10741
10741
  }
10742
10742
  return t10;
10743
10743
  }, equal);
10744
- function _temp$w(e) {
10744
+ function _temp$u(e) {
10745
10745
  return getReferenceFrom(e);
10746
10746
  }
10747
- function _temp2$b(ref) {
10747
+ function _temp2$a(ref) {
10748
10748
  return ref.id;
10749
10749
  }
10750
10750
  yup__namespace.addMethod(yup__namespace.array, "uniqueInArray", function(mapper = (a) => a, message) {
@@ -12399,7 +12399,7 @@
12399
12399
  }
12400
12400
  let t5;
12401
12401
  if ($[15] !== placeholder) {
12402
- t5 = placeholder && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: _temp$v, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx(ui.DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
12402
+ t5 = placeholder && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: _temp$t, className: "flex flex-col items-center justify-center w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsx(ui.DescriptionIcon, { className: "text-surface-700 dark:text-surface-300" }) });
12403
12403
  $[15] = placeholder;
12404
12404
  $[16] = t5;
12405
12405
  } else {
@@ -12422,7 +12422,7 @@
12422
12422
  }
12423
12423
  return t6;
12424
12424
  }
12425
- function _temp$v(e) {
12425
+ function _temp$t(e) {
12426
12426
  return e.stopPropagation();
12427
12427
  }
12428
12428
  const dropZoneClasses = "box-border relative pt-[2px] items-center border border-transparent min-h-[254px] outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid";
@@ -12650,7 +12650,7 @@
12650
12650
  t4 = $[7];
12651
12651
  }
12652
12652
  const style = t4;
12653
- const getImageSizeNumber = _temp$u;
12653
+ const getImageSizeNumber = _temp$s;
12654
12654
  let child;
12655
12655
  if (entry.storagePathOrDownloadUrl) {
12656
12656
  const t52 = `storage_preview_${entry.storagePathOrDownloadUrl}`;
@@ -12725,7 +12725,7 @@
12725
12725
  }
12726
12726
  return t6;
12727
12727
  }
12728
- function _temp$u(previewSize) {
12728
+ function _temp$s(previewSize) {
12729
12729
  switch (previewSize) {
12730
12730
  case "small": {
12731
12731
  return 40;
@@ -12762,7 +12762,7 @@
12762
12762
  const snackbarContext = useSnackbarController();
12763
12763
  let t1;
12764
12764
  if ($[0] !== storage.acceptedFiles) {
12765
- t1 = storage.acceptedFiles ? storage.acceptedFiles.reduce(_temp2$a, {}) : void 0;
12765
+ t1 = storage.acceptedFiles ? storage.acceptedFiles.reduce(_temp2$9, {}) : void 0;
12766
12766
  $[0] = storage.acceptedFiles;
12767
12767
  $[1] = t1;
12768
12768
  } else {
@@ -12955,7 +12955,7 @@
12955
12955
  }
12956
12956
  return t21;
12957
12957
  }
12958
- function _temp2$a(acc, ext) {
12958
+ function _temp2$9(acc, ext) {
12959
12959
  return {
12960
12960
  ...acc,
12961
12961
  [ext]: []
@@ -14498,7 +14498,7 @@
14498
14498
  } else {
14499
14499
  t42 = $[20];
14500
14500
  }
14501
- t3 = Object.entries(mapProperties).filter(_temp$t).map(t42);
14501
+ t3 = Object.entries(mapProperties).filter(_temp$r).map(t42);
14502
14502
  $[6] = autoFocus;
14503
14503
  $[7] = context;
14504
14504
  $[8] = disabled;
@@ -14577,7 +14577,7 @@
14577
14577
  }
14578
14578
  return t10;
14579
14579
  }
14580
- function _temp$t(t0) {
14580
+ function _temp$r(t0) {
14581
14581
  const [, property_0] = t0;
14582
14582
  return !isHidden(property_0);
14583
14583
  }
@@ -15951,7 +15951,7 @@
15951
15951
  const property = t4;
15952
15952
  let t5;
15953
15953
  if ($[9] !== properties) {
15954
- t5 = Object.entries(properties).map(_temp$s);
15954
+ t5 = Object.entries(properties).map(_temp$q);
15955
15955
  $[9] = properties;
15956
15956
  $[10] = t5;
15957
15957
  } else {
@@ -16044,7 +16044,7 @@
16044
16044
  }
16045
16045
  return t11;
16046
16046
  }
16047
- function _temp$s(t0) {
16047
+ function _temp$q(t0) {
16048
16048
  const [key, property_0] = t0;
16049
16049
  return {
16050
16050
  id: key,
@@ -19377,7 +19377,7 @@
19377
19377
  let t1;
19378
19378
  if ($[0] !== text) {
19379
19379
  const urlRegex = /https?:\/\/[^\s]+/g;
19380
- t1 = text.replace(urlRegex, _temp$r);
19380
+ t1 = text.replace(urlRegex, _temp$p);
19381
19381
  $[0] = text;
19382
19382
  $[1] = t1;
19383
19383
  } else {
@@ -19396,7 +19396,7 @@
19396
19396
  }
19397
19397
  return t2;
19398
19398
  };
19399
- function _temp$r(url) {
19399
+ function _temp$p(url) {
19400
19400
  return `<a href="${url}" class="underline" target="_blank">Link</a><br/>`;
19401
19401
  }
19402
19402
  const operationLabels$2 = {
@@ -19709,7 +19709,7 @@
19709
19709
  }
19710
19710
  let t9;
19711
19711
  if ($[24] !== possibleOperations) {
19712
- t9 = possibleOperations.map(_temp2$9);
19712
+ t9 = possibleOperations.map(_temp2$8);
19713
19713
  $[24] = possibleOperations;
19714
19714
  $[25] = t9;
19715
19715
  } else {
@@ -19717,7 +19717,7 @@
19717
19717
  }
19718
19718
  let t10;
19719
19719
  if ($[26] !== operation || $[27] !== t8 || $[28] !== t9) {
19720
- t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, size: "medium", fullWidth: true, position: "item-aligned", onValueChange: t8, renderValue: _temp$q, children: t9 }) });
19720
+ t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, size: "medium", fullWidth: true, position: "item-aligned", onValueChange: t8, renderValue: _temp$o, children: t9 }) });
19721
19721
  $[26] = operation;
19722
19722
  $[27] = t8;
19723
19723
  $[28] = t9;
@@ -19819,10 +19819,10 @@
19819
19819
  function _temp3$5(e_1) {
19820
19820
  return String(e_1);
19821
19821
  }
19822
- function _temp2$9(op_2) {
19822
+ function _temp2$8(op_2) {
19823
19823
  return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: op_2, children: operationLabels$1[op_2] }, op_2);
19824
19824
  }
19825
- function _temp$q(op_1) {
19825
+ function _temp$o(op_1) {
19826
19826
  return operationLabels$1[op_1];
19827
19827
  }
19828
19828
  function BooleanFilterField(t0) {
@@ -19985,7 +19985,7 @@
19985
19985
  }
19986
19986
  let t7;
19987
19987
  if ($[15] !== possibleOperations) {
19988
- t7 = possibleOperations.map(_temp2$8);
19988
+ t7 = possibleOperations.map(_temp2$7);
19989
19989
  $[15] = possibleOperations;
19990
19990
  $[16] = t7;
19991
19991
  } else {
@@ -19993,7 +19993,7 @@
19993
19993
  }
19994
19994
  let t8;
19995
19995
  if ($[17] !== operation || $[18] !== t6 || $[19] !== t7) {
19996
- t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, size: "medium", fullWidth: true, onValueChange: t6, renderValue: _temp$p, children: t7 }) });
19996
+ t8 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[100px]", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select, { value: operation, size: "medium", fullWidth: true, onValueChange: t6, renderValue: _temp$n, children: t7 }) });
19997
19997
  $[17] = operation;
19998
19998
  $[18] = t6;
19999
19999
  $[19] = t7;
@@ -20040,10 +20040,10 @@
20040
20040
  }
20041
20041
  return t12;
20042
20042
  }
20043
- function _temp2$8(op_2) {
20043
+ function _temp2$7(op_2) {
20044
20044
  return /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: op_2, children: operationLabels[op_2] }, op_2);
20045
20045
  }
20046
- function _temp$p(op_1) {
20046
+ function _temp$n(op_1) {
20047
20047
  return operationLabels[op_1];
20048
20048
  }
20049
20049
  const SelectableTable = function SelectableTable2({
@@ -20806,7 +20806,7 @@
20806
20806
  parentCollectionIds
20807
20807
  };
20808
20808
  const searchBlocked = customizationController.plugins?.find((p) => p.collectionView?.blockSearch?.(props));
20809
- const addTextSearchClickListener = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$o);
20809
+ const addTextSearchClickListener = Boolean(dataSource?.initTextSearch) || customizationController.plugins?.find(_temp$m);
20810
20810
  if (addTextSearchClickListener) {
20811
20811
  onTextSearchClick = addTextSearchClickListener ? () => {
20812
20812
  setTextSearchLoading(true);
@@ -20902,7 +20902,7 @@
20902
20902
  }
20903
20903
  return t3;
20904
20904
  }
20905
- function _temp$o(p_0) {
20905
+ function _temp$m(p_0) {
20906
20906
  return Boolean(p_0.collectionView?.onTextSearchClick);
20907
20907
  }
20908
20908
  function DeleteEntityDialog({
@@ -21069,20 +21069,20 @@
21069
21069
  } catch {
21070
21070
  }
21071
21071
  }
21072
- function addRecentId(key, id) {
21073
- const recentIds = getRecentIds(key);
21072
+ function addRecentId(collectionId, id) {
21073
+ const recentIds = getRecentIds(collectionId);
21074
21074
  const newRecentIds = [id, ...recentIds.filter((i) => i !== id)];
21075
21075
  if (newRecentIds.length > 5) {
21076
21076
  newRecentIds.pop();
21077
21077
  }
21078
- saveSearchedIdsLocally(key, newRecentIds);
21078
+ saveSearchedIdsLocally(collectionId, newRecentIds);
21079
21079
  return newRecentIds;
21080
21080
  }
21081
- function saveSearchedIdsLocally(key, ids) {
21082
- setLocalStorageItem("recent_id_searches::" + key, JSON.stringify(ids));
21081
+ function saveSearchedIdsLocally(collectionId, ids) {
21082
+ setLocalStorageItem("recent_id_searches::" + collectionId, JSON.stringify(ids));
21083
21083
  }
21084
- function getRecentIds(key) {
21085
- return getLocalStorageJSON("recent_id_searches::" + key, []);
21084
+ function getRecentIds(collectionId) {
21085
+ return getLocalStorageJSON("recent_id_searches::" + collectionId, []);
21086
21086
  }
21087
21087
  const editEntityAction = {
21088
21088
  icon: /* @__PURE__ */ jsxRuntime.jsx(ui.EditIcon, { size: "small" }),
@@ -21112,7 +21112,7 @@
21112
21112
  entityId: entity.id
21113
21113
  });
21114
21114
  if (collection) {
21115
- addRecentId(fullIdPath ?? fullPath ?? collection.id, entity.id);
21115
+ addRecentId(collection.id, entity.id);
21116
21116
  }
21117
21117
  const path = collection?.collectionGroup ? entity.path : fullPath ?? collection?.path ?? entity.path;
21118
21118
  const resolvedPathSegments = collection?.collectionGroup ? entity.pathSegments : pathSegments ?? entity.pathSegments;
@@ -21565,7 +21565,7 @@
21565
21565
  T0 = ui.Collapse;
21566
21566
  t4 = favouriteCollections.length > 0;
21567
21567
  t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
21568
- t3 = favouriteCollections.map(_temp$n);
21568
+ t3 = favouriteCollections.map(_temp$l);
21569
21569
  $[2] = navigationController;
21570
21570
  $[3] = t1;
21571
21571
  $[4] = T0;
@@ -21599,7 +21599,7 @@
21599
21599
  }
21600
21600
  return t6;
21601
21601
  }
21602
- function _temp$n(entry_0) {
21602
+ function _temp$l(entry_0) {
21603
21603
  return /* @__PURE__ */ jsxRuntime.jsx(NavigationChip, { entry: entry_0 }, entry_0.path);
21604
21604
  }
21605
21605
  const scrollsMap = {};
@@ -21836,7 +21836,7 @@
21836
21836
  }
21837
21837
  let t4;
21838
21838
  if ($[4] !== actions) {
21839
- t4 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5", onClick: _temp$m, children: actions });
21839
+ t4 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5", onClick: _temp$k, children: actions });
21840
21840
  $[4] = actions;
21841
21841
  $[5] = t4;
21842
21842
  } else {
@@ -21923,7 +21923,7 @@
21923
21923
  }
21924
21924
  return t12;
21925
21925
  });
21926
- function _temp$m(event) {
21926
+ function _temp$k(event) {
21927
21927
  event.preventDefault();
21928
21928
  event.stopPropagation();
21929
21929
  }
@@ -24290,7 +24290,7 @@
24290
24290
  let t19;
24291
24291
  let t20;
24292
24292
  if ($[19] !== items2) {
24293
- t20 = items2.map(_temp$l);
24293
+ t20 = items2.map(_temp$j);
24294
24294
  $[19] = items2;
24295
24295
  $[20] = t20;
24296
24296
  } else {
@@ -24396,7 +24396,7 @@
24396
24396
  }
24397
24397
  return t29;
24398
24398
  });
24399
- function _temp$l(i) {
24399
+ function _temp$j(i) {
24400
24400
  return i.id;
24401
24401
  }
24402
24402
  function Board(t0) {
@@ -26568,7 +26568,7 @@
26568
26568
  }
26569
26569
  let t7;
26570
26570
  if ($[30] !== collection.forceFilter || $[31] !== filtersDialogOpen || $[32] !== resolvedProperties || $[33] !== tableController) {
26571
- t7 = resolvedProperties && tableController.setFilterValues && /* @__PURE__ */ jsxRuntime.jsx(FiltersDialog, { open: filtersDialogOpen, onOpenChange: setFiltersDialogOpen, properties: resolvedProperties, filterValues: tableController.filterValues, setFilterValues: (filterValues_0) => tableController.setFilterValues?.(filterValues_0 ?? {}), forceFilter: collection.forceFilter, allowedFilters: tableController.allowedFilters?.map(_temp$k) });
26571
+ t7 = resolvedProperties && tableController.setFilterValues && /* @__PURE__ */ jsxRuntime.jsx(FiltersDialog, { open: filtersDialogOpen, onOpenChange: setFiltersDialogOpen, properties: resolvedProperties, filterValues: tableController.filterValues, setFilterValues: (filterValues_0) => tableController.setFilterValues?.(filterValues_0 ?? {}), forceFilter: collection.forceFilter, allowedFilters: tableController.allowedFilters?.map(_temp$i) });
26572
26572
  $[30] = collection.forceFilter;
26573
26573
  $[31] = filtersDialogOpen;
26574
26574
  $[32] = resolvedProperties;
@@ -26591,225 +26591,9 @@
26591
26591
  }
26592
26592
  return t8;
26593
26593
  }
26594
- function _temp$k(key_0) {
26594
+ function _temp$i(key_0) {
26595
26595
  return key_0.toString();
26596
26596
  }
26597
- const DEFAULT_ENTITY_OPEN_MODE$1 = "side_panel";
26598
- function EntityIdHeaderWidget(t0) {
26599
- const $ = reactCompilerRuntime.c(53);
26600
- const {
26601
- collection,
26602
- path,
26603
- pathSegments,
26604
- fullIdPath
26605
- } = t0;
26606
- const navigation = useNavigationController();
26607
- const [openPopup, setOpenPopup] = React.useState(false);
26608
- const [searchString, setSearchString] = React.useState("");
26609
- let t1;
26610
- if ($[0] !== fullIdPath) {
26611
- t1 = () => getRecentIds(fullIdPath);
26612
- $[0] = fullIdPath;
26613
- $[1] = t1;
26614
- } else {
26615
- t1 = $[1];
26616
- }
26617
- const [recentIds, setRecentIds] = React.useState(t1);
26618
- const sideEntityController = useSideEntityController();
26619
- const {
26620
- t
26621
- } = useTranslation();
26622
- const openEntityMode = collection?.openEntityMode ?? DEFAULT_ENTITY_OPEN_MODE$1;
26623
- let t2;
26624
- if ($[2] !== openPopup || $[3] !== t) {
26625
- t2 = !openPopup ? t("find_by_id") : void 0;
26626
- $[2] = openPopup;
26627
- $[3] = t;
26628
- $[4] = t2;
26629
- } else {
26630
- t2 = $[4];
26631
- }
26632
- let t3;
26633
- if ($[5] !== fullIdPath) {
26634
- t3 = (open) => {
26635
- if (open) {
26636
- setRecentIds(getRecentIds(fullIdPath));
26637
- }
26638
- setOpenPopup(open);
26639
- };
26640
- $[5] = fullIdPath;
26641
- $[6] = t3;
26642
- } else {
26643
- t3 = $[6];
26644
- }
26645
- let t4;
26646
- let t5;
26647
- if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
26648
- t4 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ui.SearchIcon, { size: "small" }) });
26649
- t5 = ui.cls("my-2 rounded-lg bg-surface-50 dark:bg-surface-950 text-surface-900 dark:text-white");
26650
- $[7] = t4;
26651
- $[8] = t5;
26652
- } else {
26653
- t4 = $[7];
26654
- t5 = $[8];
26655
- }
26656
- let t6;
26657
- if ($[9] !== collection || $[10] !== fullIdPath || $[11] !== navigation || $[12] !== openEntityMode || $[13] !== path || $[14] !== pathSegments || $[15] !== searchString || $[16] !== sideEntityController) {
26658
- t6 = (e) => {
26659
- e.preventDefault();
26660
- const entityId = searchString.trim();
26661
- if (!entityId) {
26662
- return;
26663
- }
26664
- setOpenPopup(false);
26665
- setRecentIds(addRecentId(fullIdPath, entityId));
26666
- navigateToEntity({
26667
- openEntityMode,
26668
- collection,
26669
- entityId,
26670
- path,
26671
- pathSegments,
26672
- fullIdPath,
26673
- sideEntityController,
26674
- navigation
26675
- });
26676
- };
26677
- $[9] = collection;
26678
- $[10] = fullIdPath;
26679
- $[11] = navigation;
26680
- $[12] = openEntityMode;
26681
- $[13] = path;
26682
- $[14] = pathSegments;
26683
- $[15] = searchString;
26684
- $[16] = sideEntityController;
26685
- $[17] = t6;
26686
- } else {
26687
- t6 = $[17];
26688
- }
26689
- let t7;
26690
- if ($[18] !== t) {
26691
- t7 = t("find_entity_by_id");
26692
- $[18] = t;
26693
- $[19] = t7;
26694
- } else {
26695
- t7 = $[19];
26696
- }
26697
- let t8;
26698
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
26699
- t8 = (e_0) => {
26700
- setSearchString(e_0.target.value);
26701
- };
26702
- $[20] = t8;
26703
- } else {
26704
- t8 = $[20];
26705
- }
26706
- let t9;
26707
- if ($[21] !== openPopup || $[22] !== searchString || $[23] !== t7) {
26708
- t9 = /* @__PURE__ */ jsxRuntime.jsx("input", { autoFocus: openPopup, placeholder: t7, onChange: t8, value: searchString, className: "rounded-lg bg-white dark:bg-surface-800 flex-grow bg-transparent outline-none p-2 " + ui.focusedDisabled });
26709
- $[21] = openPopup;
26710
- $[22] = searchString;
26711
- $[23] = t7;
26712
- $[24] = t9;
26713
- } else {
26714
- t9 = $[24];
26715
- }
26716
- const t10 = !searchString.trim();
26717
- let t11;
26718
- if ($[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
26719
- t11 = /* @__PURE__ */ jsxRuntime.jsx(ui.KeyboardTabIcon, {});
26720
- $[25] = t11;
26721
- } else {
26722
- t11 = $[25];
26723
- }
26724
- let t12;
26725
- if ($[26] !== t10) {
26726
- t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", disabled: t10, type: "submit", children: t11 });
26727
- $[26] = t10;
26728
- $[27] = t12;
26729
- } else {
26730
- t12 = $[27];
26731
- }
26732
- let t13;
26733
- if ($[28] !== t12 || $[29] !== t9) {
26734
- t13 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex p-2 w-full gap-2", children: [
26735
- t9,
26736
- t12
26737
- ] });
26738
- $[28] = t12;
26739
- $[29] = t9;
26740
- $[30] = t13;
26741
- } else {
26742
- t13 = $[30];
26743
- }
26744
- let t14;
26745
- if ($[31] !== t13 || $[32] !== t6) {
26746
- t14 = /* @__PURE__ */ jsxRuntime.jsx("form", { noValidate: true, onSubmit: t6, className: "w-96 max-w-full", children: t13 });
26747
- $[31] = t13;
26748
- $[32] = t6;
26749
- $[33] = t14;
26750
- } else {
26751
- t14 = $[33];
26752
- }
26753
- let t15;
26754
- if ($[34] !== collection || $[35] !== fullIdPath || $[36] !== navigation || $[37] !== openEntityMode || $[38] !== path || $[39] !== pathSegments || $[40] !== recentIds || $[41] !== sideEntityController) {
26755
- t15 = recentIds && recentIds.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 p-2", children: recentIds.map((id) => /* @__PURE__ */ jsxRuntime.jsx(ReferencePreview, { reference: new EntityReference(id, path, void 0, pathSegments), hover: true, onClick: () => {
26756
- setOpenPopup(false);
26757
- navigateToEntity({
26758
- openEntityMode,
26759
- collection,
26760
- entityId: id,
26761
- path,
26762
- pathSegments,
26763
- fullIdPath,
26764
- sideEntityController,
26765
- navigation
26766
- });
26767
- }, includeEntityLink: false, size: "small" }, id)) });
26768
- $[34] = collection;
26769
- $[35] = fullIdPath;
26770
- $[36] = navigation;
26771
- $[37] = openEntityMode;
26772
- $[38] = path;
26773
- $[39] = pathSegments;
26774
- $[40] = recentIds;
26775
- $[41] = sideEntityController;
26776
- $[42] = t15;
26777
- } else {
26778
- t15 = $[42];
26779
- }
26780
- let t16;
26781
- if ($[43] !== t14 || $[44] !== t15) {
26782
- t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t5, children: [
26783
- t14,
26784
- t15
26785
- ] });
26786
- $[43] = t14;
26787
- $[44] = t15;
26788
- $[45] = t16;
26789
- } else {
26790
- t16 = $[45];
26791
- }
26792
- let t17;
26793
- if ($[46] !== openPopup || $[47] !== t16 || $[48] !== t3) {
26794
- t17 = /* @__PURE__ */ jsxRuntime.jsx(ui.Popover, { open: openPopup, onOpenChange: t3, sideOffset: 0, align: "start", alignOffset: -117, trigger: t4, children: t16 });
26795
- $[46] = openPopup;
26796
- $[47] = t16;
26797
- $[48] = t3;
26798
- $[49] = t17;
26799
- } else {
26800
- t17 = $[49];
26801
- }
26802
- let t18;
26803
- if ($[50] !== t17 || $[51] !== t2) {
26804
- t18 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: t2, asChild: false, children: t17 });
26805
- $[50] = t17;
26806
- $[51] = t2;
26807
- $[52] = t18;
26808
- } else {
26809
- t18 = $[52];
26810
- }
26811
- return t18;
26812
- }
26813
26597
  const collectionScrollCache = /* @__PURE__ */ new Map();
26814
26598
  function useScrollRestoration() {
26815
26599
  const updateCollectionScroll = ({
@@ -26850,7 +26634,6 @@
26850
26634
  isSubCollection,
26851
26635
  className,
26852
26636
  updateUrl,
26853
- onCountChange,
26854
26637
  ...collectionProp
26855
26638
  }) {
26856
26639
  const context = useFireCMSContext();
@@ -26988,7 +26771,7 @@
26988
26771
  entityId: clickedEntity.id
26989
26772
  });
26990
26773
  if (collection_1) {
26991
- addRecentId(fullIdPath ?? fullPath, clickedEntity.id);
26774
+ addRecentId(collection_1.id, clickedEntity.id);
26992
26775
  }
26993
26776
  const isCollectionGroup = Boolean(collection_1?.collectionGroup);
26994
26777
  const path = isCollectionGroup ? clickedEntity.path : fullPath ?? clickedEntity.path;
@@ -27316,9 +27099,8 @@
27316
27099
  React.useEffect(() => {
27317
27100
  if (docsCount !== void 0) {
27318
27101
  breadcrumbs.updateCount(fullPath, docsCount);
27319
- onCountChange?.(docsCount);
27320
27102
  }
27321
- }, [docsCount, fullPath, breadcrumbs.updateCount, onCountChange]);
27103
+ }, [docsCount, fullPath, breadcrumbs.updateCount]);
27322
27104
  const countFetcher = /* @__PURE__ */ jsxRuntime.jsx(EntitiesCount, { fullPath, pathSegments, collection, filter: tableController.filterValues, sortBy: tableController.sortBy, onCountChange: setDocsCount });
27323
27105
  const buildAdditionalHeaderWidget = React.useCallback(({
27324
27106
  property: property_2,
@@ -27464,100 +27246,301 @@
27464
27246
  }
27465
27247
  };
27466
27248
  }
27467
- const EntityCollectionView$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27468
- __proto__: null,
27469
- EntityCollectionView: EntityCollectionView$1
27470
- }, Symbol.toStringTag, { value: "Module" }));
27471
- function PropertyConfigBadge(t0) {
27472
- const $ = reactCompilerRuntime.c(6);
27249
+ function EntityIdHeaderWidget(t0) {
27250
+ const $ = reactCompilerRuntime.c(50);
27473
27251
  const {
27474
- propertyConfig,
27475
- disabled
27252
+ collection,
27253
+ path,
27254
+ pathSegments,
27255
+ fullIdPath
27476
27256
  } = t0;
27477
- const classes = "h-8 w-8 flex items-center justify-center rounded-full shadow text-white " + (disabled ? "bg-surface-400 dark:bg-surface-600" : "");
27257
+ const navigation = useNavigationController();
27258
+ const [openPopup, setOpenPopup] = React.useState(false);
27259
+ const [searchString, setSearchString] = React.useState("");
27478
27260
  let t1;
27479
- if ($[0] !== classes || $[1] !== disabled || $[2] !== propertyConfig) {
27480
- const defaultPropertyConfig = typeof propertyConfig?.property === "object" ? getDefaultFieldConfig(propertyConfig.property) : void 0;
27481
- const t2 = !disabled ? propertyConfig?.color ?? defaultPropertyConfig?.color ?? "#888" : void 0;
27482
- let t3;
27483
- if ($[4] !== t2) {
27484
- t3 = {
27485
- background: t2
27486
- };
27487
- $[4] = t2;
27488
- $[5] = t3;
27489
- } else {
27490
- t3 = $[5];
27491
- }
27492
- t1 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, style: t3, children: propertyConfig?.Icon ? getIconForWidget(propertyConfig, "small") : getIconForWidget(defaultPropertyConfig, "small") });
27493
- $[0] = classes;
27494
- $[1] = disabled;
27495
- $[2] = propertyConfig;
27496
- $[3] = t1;
27261
+ if ($[0] !== collection.id) {
27262
+ t1 = getRecentIds(collection.id);
27263
+ $[0] = collection.id;
27264
+ $[1] = t1;
27497
27265
  } else {
27498
- t1 = $[3];
27266
+ t1 = $[1];
27499
27267
  }
27500
- return t1;
27501
- }
27502
- function NotFoundPage() {
27503
- const $ = reactCompilerRuntime.c(16);
27268
+ const [recentIds, setRecentIds] = React.useState(t1);
27269
+ const sideEntityController = useSideEntityController();
27504
27270
  const {
27505
27271
  t
27506
27272
  } = useTranslation();
27507
- let t0;
27508
- if ($[0] !== t) {
27509
- t0 = t("page_not_found");
27510
- $[0] = t;
27511
- $[1] = t0;
27512
- } else {
27513
- t0 = $[1];
27514
- }
27515
- let t1;
27516
- if ($[2] !== t0) {
27517
- t1 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h4", align: "center", gutterBottom: true, children: t0 });
27518
- $[2] = t0;
27519
- $[3] = t1;
27520
- } else {
27521
- t1 = $[3];
27522
- }
27273
+ const openEntityMode = collection?.openEntityMode ?? DEFAULT_ENTITY_OPEN_MODE;
27523
27274
  let t2;
27524
- if ($[4] !== t) {
27525
- t2 = t("page_not_found_body");
27526
- $[4] = t;
27527
- $[5] = t2;
27275
+ if ($[2] !== openPopup || $[3] !== t) {
27276
+ t2 = !openPopup ? t("find_by_id") : void 0;
27277
+ $[2] = openPopup;
27278
+ $[3] = t;
27279
+ $[4] = t2;
27528
27280
  } else {
27529
- t2 = $[5];
27281
+ t2 = $[4];
27530
27282
  }
27531
27283
  let t3;
27532
- if ($[6] !== t2) {
27533
- t3 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { align: "center", gutterBottom: true, children: t2 });
27534
- $[6] = t2;
27535
- $[7] = t3;
27536
- } else {
27537
- t3 = $[7];
27538
- }
27539
27284
  let t4;
27540
- if ($[8] !== t) {
27541
- t4 = t("back_to_home");
27542
- $[8] = t;
27543
- $[9] = t4;
27285
+ if ($[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
27286
+ t3 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { size: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ui.SearchIcon, { size: "small" }) });
27287
+ t4 = ui.cls("my-2 rounded-lg bg-surface-50 dark:bg-surface-950 text-surface-900 dark:text-white");
27288
+ $[5] = t3;
27289
+ $[6] = t4;
27544
27290
  } else {
27545
- t4 = $[9];
27291
+ t3 = $[5];
27292
+ t4 = $[6];
27546
27293
  }
27547
27294
  let t5;
27548
- if ($[10] !== t4) {
27549
- t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", component: reactRouterDom.Link, to: "/", children: t4 });
27550
- $[10] = t4;
27551
- $[11] = t5;
27552
- } else {
27553
- t5 = $[11];
27554
- }
27555
- let t6;
27556
- if ($[12] !== t1 || $[13] !== t3 || $[14] !== t5) {
27557
- t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "m-auto flex items-center flex-col", children: [
27558
- t1,
27559
- t3,
27560
- t5
27295
+ if ($[7] !== collection || $[8] !== fullIdPath || $[9] !== navigation || $[10] !== openEntityMode || $[11] !== path || $[12] !== pathSegments || $[13] !== searchString || $[14] !== sideEntityController) {
27296
+ t5 = (e) => {
27297
+ e.preventDefault();
27298
+ if (!searchString) {
27299
+ return;
27300
+ }
27301
+ setOpenPopup(false);
27302
+ const entityId = searchString.trim();
27303
+ setRecentIds(addRecentId(collection.id, entityId));
27304
+ navigateToEntity({
27305
+ openEntityMode,
27306
+ collection,
27307
+ entityId,
27308
+ path,
27309
+ pathSegments,
27310
+ fullIdPath,
27311
+ sideEntityController,
27312
+ navigation
27313
+ });
27314
+ };
27315
+ $[7] = collection;
27316
+ $[8] = fullIdPath;
27317
+ $[9] = navigation;
27318
+ $[10] = openEntityMode;
27319
+ $[11] = path;
27320
+ $[12] = pathSegments;
27321
+ $[13] = searchString;
27322
+ $[14] = sideEntityController;
27323
+ $[15] = t5;
27324
+ } else {
27325
+ t5 = $[15];
27326
+ }
27327
+ let t6;
27328
+ if ($[16] !== t) {
27329
+ t6 = t("find_entity_by_id");
27330
+ $[16] = t;
27331
+ $[17] = t6;
27332
+ } else {
27333
+ t6 = $[17];
27334
+ }
27335
+ let t7;
27336
+ if ($[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
27337
+ t7 = (e_0) => {
27338
+ setSearchString(e_0.target.value);
27339
+ };
27340
+ $[18] = t7;
27341
+ } else {
27342
+ t7 = $[18];
27343
+ }
27344
+ let t8;
27345
+ if ($[19] !== openPopup || $[20] !== searchString || $[21] !== t6) {
27346
+ t8 = /* @__PURE__ */ jsxRuntime.jsx("input", { autoFocus: openPopup, placeholder: t6, onChange: t7, value: searchString, className: "rounded-lg bg-white dark:bg-surface-800 flex-grow bg-transparent outline-none p-2 " + ui.focusedDisabled });
27347
+ $[19] = openPopup;
27348
+ $[20] = searchString;
27349
+ $[21] = t6;
27350
+ $[22] = t8;
27351
+ } else {
27352
+ t8 = $[22];
27353
+ }
27354
+ const t9 = !searchString.trim();
27355
+ let t10;
27356
+ if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
27357
+ t10 = /* @__PURE__ */ jsxRuntime.jsx(ui.KeyboardTabIcon, {});
27358
+ $[23] = t10;
27359
+ } else {
27360
+ t10 = $[23];
27361
+ }
27362
+ let t11;
27363
+ if ($[24] !== t9) {
27364
+ t11 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", disabled: t9, type: "submit", children: t10 });
27365
+ $[24] = t9;
27366
+ $[25] = t11;
27367
+ } else {
27368
+ t11 = $[25];
27369
+ }
27370
+ let t12;
27371
+ if ($[26] !== t11 || $[27] !== t8) {
27372
+ t12 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex p-2 w-full gap-2", children: [
27373
+ t8,
27374
+ t11
27375
+ ] });
27376
+ $[26] = t11;
27377
+ $[27] = t8;
27378
+ $[28] = t12;
27379
+ } else {
27380
+ t12 = $[28];
27381
+ }
27382
+ let t13;
27383
+ if ($[29] !== t12 || $[30] !== t5) {
27384
+ t13 = /* @__PURE__ */ jsxRuntime.jsx("form", { noValidate: true, onSubmit: t5, className: "w-96 max-w-full", children: t12 });
27385
+ $[29] = t12;
27386
+ $[30] = t5;
27387
+ $[31] = t13;
27388
+ } else {
27389
+ t13 = $[31];
27390
+ }
27391
+ let t14;
27392
+ if ($[32] !== collection || $[33] !== fullIdPath || $[34] !== navigation || $[35] !== openEntityMode || $[36] !== path || $[37] !== pathSegments || $[38] !== recentIds || $[39] !== sideEntityController) {
27393
+ t14 = recentIds && recentIds.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2 p-2", children: recentIds.map((id) => /* @__PURE__ */ jsxRuntime.jsx(ReferencePreview, { reference: new EntityReference(id, path, void 0, pathSegments), hover: true, onClick: () => {
27394
+ setOpenPopup(false);
27395
+ navigateToEntity({
27396
+ openEntityMode,
27397
+ collection,
27398
+ entityId: id,
27399
+ path,
27400
+ pathSegments,
27401
+ fullIdPath,
27402
+ sideEntityController,
27403
+ navigation
27404
+ });
27405
+ }, includeEntityLink: false, size: "small" }, id)) });
27406
+ $[32] = collection;
27407
+ $[33] = fullIdPath;
27408
+ $[34] = navigation;
27409
+ $[35] = openEntityMode;
27410
+ $[36] = path;
27411
+ $[37] = pathSegments;
27412
+ $[38] = recentIds;
27413
+ $[39] = sideEntityController;
27414
+ $[40] = t14;
27415
+ } else {
27416
+ t14 = $[40];
27417
+ }
27418
+ let t15;
27419
+ if ($[41] !== t13 || $[42] !== t14) {
27420
+ t15 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t4, children: [
27421
+ t13,
27422
+ t14
27423
+ ] });
27424
+ $[41] = t13;
27425
+ $[42] = t14;
27426
+ $[43] = t15;
27427
+ } else {
27428
+ t15 = $[43];
27429
+ }
27430
+ let t16;
27431
+ if ($[44] !== openPopup || $[45] !== t15) {
27432
+ t16 = /* @__PURE__ */ jsxRuntime.jsx(ui.Popover, { open: openPopup, onOpenChange: setOpenPopup, sideOffset: 0, align: "start", alignOffset: -117, trigger: t3, children: t15 });
27433
+ $[44] = openPopup;
27434
+ $[45] = t15;
27435
+ $[46] = t16;
27436
+ } else {
27437
+ t16 = $[46];
27438
+ }
27439
+ let t17;
27440
+ if ($[47] !== t16 || $[48] !== t2) {
27441
+ t17 = /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: t2, asChild: false, children: t16 });
27442
+ $[47] = t16;
27443
+ $[48] = t2;
27444
+ $[49] = t17;
27445
+ } else {
27446
+ t17 = $[49];
27447
+ }
27448
+ return t17;
27449
+ }
27450
+ const EntityCollectionView$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27451
+ __proto__: null,
27452
+ EntityCollectionView: EntityCollectionView$1
27453
+ }, Symbol.toStringTag, { value: "Module" }));
27454
+ function PropertyConfigBadge(t0) {
27455
+ const $ = reactCompilerRuntime.c(6);
27456
+ const {
27457
+ propertyConfig,
27458
+ disabled
27459
+ } = t0;
27460
+ const classes = "h-8 w-8 flex items-center justify-center rounded-full shadow text-white " + (disabled ? "bg-surface-400 dark:bg-surface-600" : "");
27461
+ let t1;
27462
+ if ($[0] !== classes || $[1] !== disabled || $[2] !== propertyConfig) {
27463
+ const defaultPropertyConfig = typeof propertyConfig?.property === "object" ? getDefaultFieldConfig(propertyConfig.property) : void 0;
27464
+ const t2 = !disabled ? propertyConfig?.color ?? defaultPropertyConfig?.color ?? "#888" : void 0;
27465
+ let t3;
27466
+ if ($[4] !== t2) {
27467
+ t3 = {
27468
+ background: t2
27469
+ };
27470
+ $[4] = t2;
27471
+ $[5] = t3;
27472
+ } else {
27473
+ t3 = $[5];
27474
+ }
27475
+ t1 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, style: t3, children: propertyConfig?.Icon ? getIconForWidget(propertyConfig, "small") : getIconForWidget(defaultPropertyConfig, "small") });
27476
+ $[0] = classes;
27477
+ $[1] = disabled;
27478
+ $[2] = propertyConfig;
27479
+ $[3] = t1;
27480
+ } else {
27481
+ t1 = $[3];
27482
+ }
27483
+ return t1;
27484
+ }
27485
+ function NotFoundPage() {
27486
+ const $ = reactCompilerRuntime.c(16);
27487
+ const {
27488
+ t
27489
+ } = useTranslation();
27490
+ let t0;
27491
+ if ($[0] !== t) {
27492
+ t0 = t("page_not_found");
27493
+ $[0] = t;
27494
+ $[1] = t0;
27495
+ } else {
27496
+ t0 = $[1];
27497
+ }
27498
+ let t1;
27499
+ if ($[2] !== t0) {
27500
+ t1 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h4", align: "center", gutterBottom: true, children: t0 });
27501
+ $[2] = t0;
27502
+ $[3] = t1;
27503
+ } else {
27504
+ t1 = $[3];
27505
+ }
27506
+ let t2;
27507
+ if ($[4] !== t) {
27508
+ t2 = t("page_not_found_body");
27509
+ $[4] = t;
27510
+ $[5] = t2;
27511
+ } else {
27512
+ t2 = $[5];
27513
+ }
27514
+ let t3;
27515
+ if ($[6] !== t2) {
27516
+ t3 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { align: "center", gutterBottom: true, children: t2 });
27517
+ $[6] = t2;
27518
+ $[7] = t3;
27519
+ } else {
27520
+ t3 = $[7];
27521
+ }
27522
+ let t4;
27523
+ if ($[8] !== t) {
27524
+ t4 = t("back_to_home");
27525
+ $[8] = t;
27526
+ $[9] = t4;
27527
+ } else {
27528
+ t4 = $[9];
27529
+ }
27530
+ let t5;
27531
+ if ($[10] !== t4) {
27532
+ t5 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", component: reactRouterDom.Link, to: "/", children: t4 });
27533
+ $[10] = t4;
27534
+ $[11] = t5;
27535
+ } else {
27536
+ t5 = $[11];
27537
+ }
27538
+ let t6;
27539
+ if ($[12] !== t1 || $[13] !== t3 || $[14] !== t5) {
27540
+ t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full h-full", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "m-auto flex items-center flex-col", children: [
27541
+ t1,
27542
+ t3,
27543
+ t5
27561
27544
  ] }) });
27562
27545
  $[12] = t1;
27563
27546
  $[13] = t3;
@@ -27883,7 +27866,7 @@
27883
27866
  }
27884
27867
  let t10;
27885
27868
  if ($[11] !== headerActions) {
27886
- t10 = headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: _temp$j, children: headerActions });
27869
+ t10 = headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: _temp$h, children: headerActions });
27887
27870
  $[11] = headerActions;
27888
27871
  $[12] = t10;
27889
27872
  } else {
@@ -27963,7 +27946,7 @@
27963
27946
  }
27964
27947
  return t16;
27965
27948
  }
27966
- function _temp$j(e) {
27949
+ function _temp$h(e) {
27967
27950
  return e.stopPropagation();
27968
27951
  }
27969
27952
  function DefaultDrawer(t0) {
@@ -28008,10 +27991,10 @@
28008
27991
  navigationEntries,
28009
27992
  groups
28010
27993
  } = navigation.topLevelNavigation;
28011
- const adminViews = navigationEntries.filter(_temp$i) ?? [];
27994
+ const adminViews = navigationEntries.filter(_temp$g) ?? [];
28012
27995
  let t2;
28013
27996
  if ($[1] !== groups) {
28014
- t2 = groups.filter(_temp2$7);
27997
+ t2 = groups.filter(_temp2$6);
28015
27998
  $[1] = groups;
28016
27999
  $[2] = t2;
28017
28000
  } else {
@@ -28148,10 +28131,10 @@
28148
28131
  }
28149
28132
  return t14;
28150
28133
  }
28151
- function _temp2$7(g) {
28134
+ function _temp2$6(g) {
28152
28135
  return g !== "Admin";
28153
28136
  }
28154
- function _temp$i(e) {
28137
+ function _temp$g(e) {
28155
28138
  return e.type === "admin";
28156
28139
  }
28157
28140
  function DrawerToggle() {
@@ -28245,186 +28228,45 @@
28245
28228
  } else {
28246
28229
  t12 = $[21];
28247
28230
  }
28248
- let t13;
28249
- if ($[22] !== t0 || $[23] !== t1 || $[24] !== t12) {
28250
- t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 mt-auto px-4 pt-0.5 pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: t0, side: "right", sideOffset: 12, open: t1, children: t12 }) });
28251
- $[22] = t0;
28252
- $[23] = t1;
28253
- $[24] = t12;
28254
- $[25] = t13;
28255
- } else {
28256
- t13 = $[25];
28257
- }
28258
- return t13;
28259
- }
28260
- function DrawerLogo(t0) {
28261
- const $ = reactCompilerRuntime.c(5);
28262
- const {
28263
- logo
28264
- } = t0;
28265
- const navigation = useNavigationController();
28266
- let t1;
28267
- if ($[0] !== logo) {
28268
- t1 = logo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "Logo", className: "w-[28px] h-[28px] object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(FireCMSLogo, { width: "28px", height: "28px" });
28269
- $[0] = logo;
28270
- $[1] = t1;
28271
- } else {
28272
- t1 = $[1];
28273
- }
28274
- let t2;
28275
- if ($[2] !== navigation.basePath || $[3] !== t1) {
28276
- t2 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center shrink-0 pt-4 pb-0 px-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Home", sideOffset: 20, side: "right", children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Link, { className: "shrink-0 flex items-center justify-center w-[56px] h-[40px]", to: navigation.basePath, children: t1 }) }) });
28277
- $[2] = navigation.basePath;
28278
- $[3] = t1;
28279
- $[4] = t2;
28280
- } else {
28281
- t2 = $[4];
28282
- }
28283
- return t2;
28284
- }
28285
- function CollectionCountBadge(t0) {
28286
- const $ = reactCompilerRuntime.c(3);
28287
- const {
28288
- count
28289
- } = t0;
28290
- if (count === void 0) {
28291
- return null;
28292
- }
28293
- if (count === null) {
28294
- let t12;
28295
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28296
- t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { className: "w-8 h-4 rounded-md" });
28297
- $[0] = t12;
28298
- } else {
28299
- t12 = $[0];
28300
- }
28301
- return t12;
28302
- }
28303
- let t1;
28304
- if ($[1] !== count) {
28305
- t1 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-surface-accent-500 dark:text-surface-accent-400 bg-surface-100 dark:bg-surface-700 px-1 py-0 rounded", children: count });
28306
- $[1] = count;
28307
- $[2] = t1;
28308
- } else {
28309
- t1 = $[2];
28310
- }
28311
- return t1;
28312
- }
28313
- function PathTitle(t0) {
28314
- const $ = reactCompilerRuntime.c(15);
28315
- const {
28316
- parents,
28317
- name,
28318
- count,
28319
- className
28320
- } = t0;
28321
- let t1;
28322
- if ($[0] !== className) {
28323
- t1 = ui.cls("flex flex-col", className);
28324
- $[0] = className;
28325
- $[1] = t1;
28326
- } else {
28327
- t1 = $[1];
28328
- }
28329
- let t2;
28330
- if ($[2] !== parents) {
28331
- t2 = parents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", noWrap: true, children: parents.join(" / ") });
28332
- $[2] = parents;
28333
- $[3] = t2;
28334
- } else {
28335
- t2 = $[3];
28336
- }
28337
- let t3;
28338
- if ($[4] !== name) {
28339
- t3 = /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", noWrap: true, className: "font-medium", children: name });
28340
- $[4] = name;
28341
- $[5] = t3;
28342
- } else {
28343
- t3 = $[5];
28344
- }
28345
- let t4;
28346
- if ($[6] !== count) {
28347
- t4 = /* @__PURE__ */ jsxRuntime.jsx(CollectionCountBadge, { count });
28348
- $[6] = count;
28349
- $[7] = t4;
28350
- } else {
28351
- t4 = $[7];
28352
- }
28353
- let t5;
28354
- if ($[8] !== t3 || $[9] !== t4) {
28355
- t5 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2 min-w-0", children: [
28356
- t3,
28357
- t4
28358
- ] });
28359
- $[8] = t3;
28360
- $[9] = t4;
28361
- $[10] = t5;
28362
- } else {
28363
- t5 = $[10];
28364
- }
28365
- let t6;
28366
- if ($[11] !== t1 || $[12] !== t2 || $[13] !== t5) {
28367
- t6 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t1, children: [
28368
- t2,
28369
- t5
28370
- ] });
28371
- $[11] = t1;
28372
- $[12] = t2;
28373
- $[13] = t5;
28374
- $[14] = t6;
28231
+ let t13;
28232
+ if ($[22] !== t0 || $[23] !== t1 || $[24] !== t12) {
28233
+ t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 mt-auto px-4 pt-0.5 pb-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: t0, side: "right", sideOffset: 12, open: t1, children: t12 }) });
28234
+ $[22] = t0;
28235
+ $[23] = t1;
28236
+ $[24] = t12;
28237
+ $[25] = t13;
28375
28238
  } else {
28376
- t6 = $[14];
28239
+ t13 = $[25];
28377
28240
  }
28378
- return t6;
28241
+ return t13;
28379
28242
  }
28380
- function CollectionPathTitle(t0) {
28381
- const $ = reactCompilerRuntime.c(9);
28243
+ function DrawerLogo(t0) {
28244
+ const $ = reactCompilerRuntime.c(5);
28382
28245
  const {
28383
- path,
28384
- name,
28385
- count
28246
+ logo
28386
28247
  } = t0;
28387
28248
  const navigation = useNavigationController();
28388
28249
  let t1;
28389
- let t2;
28390
- if ($[0] !== navigation.collections) {
28391
- t2 = navigation.collections ?? [];
28392
- $[0] = navigation.collections;
28393
- $[1] = t2;
28394
- } else {
28395
- t2 = $[1];
28396
- }
28397
- let t3;
28398
- if ($[2] !== path || $[3] !== t2) {
28399
- t3 = getNavigationEntriesFromPath({
28400
- path,
28401
- collections: t2
28402
- }).slice(0, -1).map(_temp$h);
28403
- $[2] = path;
28404
- $[3] = t2;
28405
- $[4] = t3;
28250
+ if ($[0] !== logo) {
28251
+ t1 = logo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, alt: "Logo", className: "w-[28px] h-[28px] object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(FireCMSLogo, { width: "28px", height: "28px" });
28252
+ $[0] = logo;
28253
+ $[1] = t1;
28406
28254
  } else {
28407
- t3 = $[4];
28255
+ t1 = $[1];
28408
28256
  }
28409
- t1 = t3;
28410
- const parents = t1;
28411
- let t4;
28412
- if ($[5] !== count || $[6] !== name || $[7] !== parents) {
28413
- t4 = /* @__PURE__ */ jsxRuntime.jsx(PathTitle, { parents, name, count, className: "shrink-0 mx-2 max-w-[140px] sm:max-w-[240px] lg:max-w-[320px]" });
28414
- $[5] = count;
28415
- $[6] = name;
28416
- $[7] = parents;
28417
- $[8] = t4;
28257
+ let t2;
28258
+ if ($[2] !== navigation.basePath || $[3] !== t1) {
28259
+ t2 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row items-center shrink-0 pt-4 pb-0 px-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { title: "Home", sideOffset: 20, side: "right", children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Link, { className: "shrink-0 flex items-center justify-center w-[56px] h-[40px]", to: navigation.basePath, children: t1 }) }) });
28260
+ $[2] = navigation.basePath;
28261
+ $[3] = t1;
28262
+ $[4] = t2;
28418
28263
  } else {
28419
- t4 = $[8];
28264
+ t2 = $[4];
28420
28265
  }
28421
- return t4;
28422
- }
28423
- function _temp$h(entry) {
28424
- return entry.type === "entity" ? entry.entityId : entry.type === "collection" ? entry.collection.name : entry.view.name;
28266
+ return t2;
28425
28267
  }
28426
28268
  const DefaultAppBar = function DefaultAppBar2(t0) {
28427
- const $ = reactCompilerRuntime.c(58);
28269
+ const $ = reactCompilerRuntime.c(54);
28428
28270
  const {
28429
28271
  title,
28430
28272
  endAdornment,
@@ -28445,7 +28287,6 @@
28445
28287
  const logo = logoProp ?? appLogo;
28446
28288
  const navigation = useNavigationController();
28447
28289
  const breadcrumbs = useBreadcrumbsController();
28448
- const lastBreadcrumb = breadcrumbs.breadcrumbs?.[breadcrumbs.breadcrumbs.length - 1];
28449
28290
  const authController = useAuthController();
28450
28291
  const {
28451
28292
  mode,
@@ -28536,39 +28377,30 @@
28536
28377
  }
28537
28378
  let t8;
28538
28379
  if ($[21] !== breadcrumbs.breadcrumbs) {
28539
- t8 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2 items-center", children: breadcrumbs.breadcrumbs.map(_temp$g) }) });
28380
+ t8 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2 items-center", children: breadcrumbs.breadcrumbs.map(_temp$f) }) });
28540
28381
  $[21] = breadcrumbs.breadcrumbs;
28541
28382
  $[22] = t8;
28542
28383
  } else {
28543
28384
  t8 = $[22];
28544
28385
  }
28545
28386
  let t9;
28546
- if ($[23] !== breadcrumbs.breadcrumbs || $[24] !== lastBreadcrumb) {
28547
- t9 = lastBreadcrumb && /* @__PURE__ */ jsxRuntime.jsx(PathTitle, { className: "lg:hidden min-w-0 mr-2", parents: breadcrumbs.breadcrumbs.slice(0, -1).map(_temp2$6), name: lastBreadcrumb.title, count: lastBreadcrumb.count });
28548
- $[23] = breadcrumbs.breadcrumbs;
28549
- $[24] = lastBreadcrumb;
28550
- $[25] = t9;
28387
+ if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28388
+ t9 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow" });
28389
+ $[23] = t9;
28551
28390
  } else {
28552
- t9 = $[25];
28391
+ t9 = $[23];
28553
28392
  }
28554
28393
  let t10;
28555
- if ($[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28556
- t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow" });
28557
- $[26] = t10;
28394
+ if ($[24] !== endAdornment) {
28395
+ t10 = endAdornment && /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: endAdornment });
28396
+ $[24] = endAdornment;
28397
+ $[25] = t10;
28558
28398
  } else {
28559
- t10 = $[26];
28399
+ t10 = $[25];
28560
28400
  }
28561
28401
  let t11;
28562
- if ($[27] !== endAdornment) {
28563
- t11 = endAdornment && /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: endAdornment });
28564
- $[27] = endAdornment;
28565
- $[28] = t11;
28566
- } else {
28567
- t11 = $[28];
28568
- }
28569
- let t12;
28570
- if ($[29] !== includeModeToggle || $[30] !== mode || $[31] !== setMode || $[32] !== t) {
28571
- t12 = includeModeToggle && /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "inherit", "aria-label": "Open drawer", children: mode === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(ui.DarkModeIcon, { size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.LightModeIcon, { size: "small" }) }), children: [
28402
+ if ($[26] !== includeModeToggle || $[27] !== mode || $[28] !== setMode || $[29] !== t) {
28403
+ t11 = includeModeToggle && /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "inherit", "aria-label": "Open drawer", children: mode === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(ui.DarkModeIcon, { size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(ui.LightModeIcon, { size: "small" }) }), children: [
28572
28404
  /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: () => setMode("dark"), children: [
28573
28405
  /* @__PURE__ */ jsxRuntime.jsx(ui.DarkModeIcon, { size: "smallest" }),
28574
28406
  " ",
@@ -28585,106 +28417,101 @@
28585
28417
  t("system_mode")
28586
28418
  ] })
28587
28419
  ] });
28588
- $[29] = includeModeToggle;
28589
- $[30] = mode;
28590
- $[31] = setMode;
28591
- $[32] = t;
28592
- $[33] = t12;
28420
+ $[26] = includeModeToggle;
28421
+ $[27] = mode;
28422
+ $[28] = setMode;
28423
+ $[29] = t;
28424
+ $[30] = t11;
28593
28425
  } else {
28594
- t12 = $[33];
28426
+ t11 = $[30];
28595
28427
  }
28596
- let t13;
28597
- if ($[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28598
- t13 = /* @__PURE__ */ jsxRuntime.jsx(LanguageToggle, {});
28599
- $[34] = t13;
28428
+ let t12;
28429
+ if ($[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
28430
+ t12 = /* @__PURE__ */ jsxRuntime.jsx(LanguageToggle, {});
28431
+ $[31] = t12;
28600
28432
  } else {
28601
- t13 = $[34];
28433
+ t12 = $[31];
28602
28434
  }
28603
- let t14;
28604
- if ($[35] !== user) {
28605
- t14 = user && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2 mb-2", children: [
28435
+ let t13;
28436
+ if ($[32] !== user) {
28437
+ t13 = user && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2 mb-2", children: [
28606
28438
  user.displayName && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body1", color: "secondary", children: user.displayName }),
28607
28439
  user.email && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", color: "secondary", children: user.email })
28608
28440
  ] });
28609
- $[35] = user;
28610
- $[36] = t14;
28441
+ $[32] = user;
28442
+ $[33] = t13;
28611
28443
  } else {
28612
- t14 = $[36];
28444
+ t13 = $[33];
28613
28445
  }
28614
- let t15;
28615
- if ($[37] !== authController || $[38] !== dropDownActions || $[39] !== navigate || $[40] !== t) {
28616
- t15 = !dropDownActions && /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: async () => {
28446
+ let t14;
28447
+ if ($[34] !== authController || $[35] !== dropDownActions || $[36] !== navigate || $[37] !== t) {
28448
+ t14 = !dropDownActions && /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: async () => {
28617
28449
  await authController.signOut();
28618
28450
  navigate("/");
28619
28451
  }, children: [
28620
28452
  /* @__PURE__ */ jsxRuntime.jsx(ui.LogoutIcon, {}),
28621
28453
  t("log_out")
28622
28454
  ] });
28623
- $[37] = authController;
28624
- $[38] = dropDownActions;
28625
- $[39] = navigate;
28626
- $[40] = t;
28627
- $[41] = t15;
28455
+ $[34] = authController;
28456
+ $[35] = dropDownActions;
28457
+ $[36] = navigate;
28458
+ $[37] = t;
28459
+ $[38] = t14;
28628
28460
  } else {
28629
- t15 = $[41];
28461
+ t14 = $[38];
28630
28462
  }
28631
- let t16;
28632
- if ($[42] !== avatarComponent || $[43] !== dropDownActions || $[44] !== t14 || $[45] !== t15) {
28633
- t16 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: avatarComponent, children: [
28634
- t14,
28463
+ let t15;
28464
+ if ($[39] !== avatarComponent || $[40] !== dropDownActions || $[41] !== t13 || $[42] !== t14) {
28465
+ t15 = /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: avatarComponent, children: [
28466
+ t13,
28635
28467
  dropDownActions,
28636
- t15
28468
+ t14
28637
28469
  ] });
28638
- $[42] = avatarComponent;
28639
- $[43] = dropDownActions;
28640
- $[44] = t14;
28641
- $[45] = t15;
28642
- $[46] = t16;
28470
+ $[39] = avatarComponent;
28471
+ $[40] = dropDownActions;
28472
+ $[41] = t13;
28473
+ $[42] = t14;
28474
+ $[43] = t15;
28643
28475
  } else {
28644
- t16 = $[46];
28476
+ t15 = $[43];
28645
28477
  }
28646
- let t17;
28647
- if ($[47] !== startAdornment || $[48] !== style || $[49] !== t11 || $[50] !== t12 || $[51] !== t16 || $[52] !== t5 || $[53] !== t6 || $[54] !== t7 || $[55] !== t8 || $[56] !== t9) {
28648
- t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { style, className: t5, children: [
28478
+ let t16;
28479
+ if ($[44] !== startAdornment || $[45] !== style || $[46] !== t10 || $[47] !== t11 || $[48] !== t15 || $[49] !== t5 || $[50] !== t6 || $[51] !== t7 || $[52] !== t8) {
28480
+ t16 = /* @__PURE__ */ jsxRuntime.jsxs("div", { style, className: t5, children: [
28649
28481
  t6,
28650
28482
  t7,
28651
28483
  t8,
28652
- t9,
28653
28484
  startAdornment,
28485
+ t9,
28654
28486
  t10,
28655
28487
  t11,
28656
28488
  t12,
28657
- t13,
28658
- t16
28489
+ t15
28659
28490
  ] });
28660
- $[47] = startAdornment;
28661
- $[48] = style;
28662
- $[49] = t11;
28663
- $[50] = t12;
28664
- $[51] = t16;
28665
- $[52] = t5;
28666
- $[53] = t6;
28667
- $[54] = t7;
28668
- $[55] = t8;
28669
- $[56] = t9;
28670
- $[57] = t17;
28491
+ $[44] = startAdornment;
28492
+ $[45] = style;
28493
+ $[46] = t10;
28494
+ $[47] = t11;
28495
+ $[48] = t15;
28496
+ $[49] = t5;
28497
+ $[50] = t6;
28498
+ $[51] = t7;
28499
+ $[52] = t8;
28500
+ $[53] = t16;
28671
28501
  } else {
28672
- t17 = $[57];
28502
+ t16 = $[53];
28673
28503
  }
28674
- return t17;
28504
+ return t16;
28675
28505
  };
28676
- function _temp$g(breadcrumb, index) {
28506
+ function _temp$f(breadcrumb, index) {
28677
28507
  return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
28678
28508
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "caption", color: "secondary", children: "/" }),
28679
28509
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Link, { className: "visited:text-inherit visited:dark:text-inherit block", to: breadcrumb.url, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2 whitespace-nowrap", children: [
28680
28510
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", children: breadcrumb.title }),
28681
- /* @__PURE__ */ jsxRuntime.jsx(CollectionCountBadge, { count: breadcrumb.count })
28511
+ breadcrumb.count !== void 0 && (breadcrumb.count !== null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-surface-accent-500 dark:text-surface-accent-400 bg-surface-100 dark:bg-surface-700 px-1 py-0 rounded", children: breadcrumb.count }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { className: "w-8 h-4 rounded-md" }))
28682
28512
  ] }) }, index)
28683
28513
  ] }, breadcrumb.url + "_" + index);
28684
28514
  }
28685
- function _temp2$6(breadcrumb_0) {
28686
- return breadcrumb_0.title;
28687
- }
28688
28515
  const buildIdsMap = (value) => value && Array.isArray(value) && value.length > 0 ? value.map((v, index) => {
28689
28516
  if (!v) return {};
28690
28517
  return {
@@ -29121,7 +28948,7 @@
29121
28948
  } else {
29122
28949
  const searchResult = iconsSearch.search(value);
29123
28950
  const limited = searchResult.slice(0, 50);
29124
- setKeys(limited.map(_temp$f));
28951
+ setKeys(limited.map(_temp$e));
29125
28952
  }
29126
28953
  }, UPDATE_SEARCH_INDEX_WAIT_MS);
29127
28954
  $[0] = t3;
@@ -29213,7 +29040,7 @@
29213
29040
  }
29214
29041
  return t11;
29215
29042
  }
29216
- function _temp$f(e) {
29043
+ function _temp$e(e) {
29217
29044
  return e.item.key;
29218
29045
  }
29219
29046
  function FieldCaption(t0) {
@@ -29672,7 +29499,7 @@
29672
29499
  i18n
29673
29500
  } = useTranslation();
29674
29501
  const plugins = React.useContext(CustomizationControllerContext)?.plugins;
29675
- const runsProPlugin = plugins?.some(_temp$e) ?? false;
29502
+ const runsProPlugin = plugins?.some(_temp$d) ?? false;
29676
29503
  const [dismissed, setDismissed] = React.useState(_temp2$5);
29677
29504
  const [dismissedForGood, setDismissedForGood] = React.useState(_temp3$4);
29678
29505
  const content = licenseStatus ? buildBannerContent(licenseStatus, t, i18n?.language, runsProPlugin) : null;
@@ -29762,7 +29589,7 @@
29762
29589
  function _temp2$5() {
29763
29590
  return readDismissed(sessionDismissals);
29764
29591
  }
29765
- function _temp$e(plugin) {
29592
+ function _temp$d(plugin) {
29766
29593
  return PRO_PLUGIN_KEYS.includes(plugin.key);
29767
29594
  }
29768
29595
  function buildBannerContent(status, t, language, runsProPlugin) {
@@ -29902,32 +29729,64 @@
29902
29729
  }
29903
29730
  }
29904
29731
  function useReferenceDialog(referenceDialogProps) {
29732
+ const $ = reactCompilerRuntime.c(9);
29905
29733
  const navigation = useNavigationController();
29906
29734
  const sideDialogsController = useSideDialogsController();
29907
- const open = React.useCallback(() => {
29908
- if (referenceDialogProps.path) {
29909
- let usedCollection = referenceDialogProps.collection;
29910
- if (!usedCollection) usedCollection = navigation.getCollection(referenceDialogProps.path);
29911
- if (!usedCollection) throw Error("Not able to resolve the collection in useReferenceDialog. Make sure a collection is registered in path " + referenceDialogProps.path);
29912
- sideDialogsController.open({
29913
- key: `reference_${referenceDialogProps.path}`,
29914
- component: /* @__PURE__ */ jsxRuntime.jsx(ReferenceSelectionTable, { collection: usedCollection, ...referenceDialogProps }),
29915
- width: "90vw",
29916
- onClose: () => {
29917
- referenceDialogProps.onClose?.();
29735
+ let t0;
29736
+ if ($[0] !== navigation || $[1] !== referenceDialogProps || $[2] !== sideDialogsController) {
29737
+ t0 = () => {
29738
+ if (referenceDialogProps.path) {
29739
+ let usedCollection = referenceDialogProps.collection;
29740
+ if (!usedCollection) {
29741
+ usedCollection = navigation.getCollection(referenceDialogProps.path);
29918
29742
  }
29919
- });
29920
- } else {
29921
- throw Error("useReferenceDialog: You are trying to open a reference dialog, but have not declared the `path`");
29922
- }
29923
- }, [navigation, referenceDialogProps, sideDialogsController]);
29924
- const close = React.useCallback(() => {
29925
- sideDialogsController.close(`reference_${referenceDialogProps.path}`);
29926
- }, [sideDialogsController, referenceDialogProps.path]);
29927
- return {
29928
- open,
29929
- close
29930
- };
29743
+ if (!usedCollection) {
29744
+ throw Error("Not able to resolve the collection in useReferenceDialog. Make sure a collection is registered in path " + referenceDialogProps.path);
29745
+ }
29746
+ sideDialogsController.open({
29747
+ key: `reference_${referenceDialogProps.path}`,
29748
+ component: /* @__PURE__ */ jsxRuntime.jsx(ReferenceSelectionTable, { collection: usedCollection, ...referenceDialogProps }),
29749
+ width: "90vw",
29750
+ onClose: () => {
29751
+ referenceDialogProps.onClose?.();
29752
+ }
29753
+ });
29754
+ } else {
29755
+ throw Error("useReferenceDialog: You are trying to open a reference dialog, but have not declared the `path`");
29756
+ }
29757
+ };
29758
+ $[0] = navigation;
29759
+ $[1] = referenceDialogProps;
29760
+ $[2] = sideDialogsController;
29761
+ $[3] = t0;
29762
+ } else {
29763
+ t0 = $[3];
29764
+ }
29765
+ const open = t0;
29766
+ let t1;
29767
+ if ($[4] !== sideDialogsController) {
29768
+ t1 = () => {
29769
+ sideDialogsController.close();
29770
+ };
29771
+ $[4] = sideDialogsController;
29772
+ $[5] = t1;
29773
+ } else {
29774
+ t1 = $[5];
29775
+ }
29776
+ const close = t1;
29777
+ let t2;
29778
+ if ($[6] !== close || $[7] !== open) {
29779
+ t2 = {
29780
+ open,
29781
+ close
29782
+ };
29783
+ $[6] = close;
29784
+ $[7] = open;
29785
+ $[8] = t2;
29786
+ } else {
29787
+ t2 = $[8];
29788
+ }
29789
+ return t2;
29931
29790
  }
29932
29791
  const fireCMSLogo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAa9SURBVHgB7Z1NbBNHFMf/a7uBEgMOHy2pSlnUql+oEG7lgNgcqZAgR9RKSU5tT9mcqp6SXNoj5tBzHAmk3ggSUo/Ziko9skXqoVIlJm3Von4IhzhAIIk7b9ab+COJvZ63610nP8netWx5Z//73syb2Zm3BjqJXc4BixaQMgHjDFCWW5iVb83aH5eL8jdC7lS2a/Ny3wGyLvJGER3CQJRsCHZBfrqCBpHaRkCJuXYb2O9EKWg0AtpKtDF5gnJr5BA+BSVm/sAsQiY8AZW1PSHR7IhE2wwhX1NAWlrlywIhwC9gPISrR8iyFJDvnQIzvALapRH5PgG+uo0bAbLIfLYAJngEtJ+awOq03LOQCAxZN6bGOdw6BV3GyV1X7iEx4hFlGQGs3qt4jBbtW6Cq65bIXW0km7x06XG0SXsCei57S+4NoDtwZUs91I5LBxfQE28O8W0o2kVIEQeDihhMwO4Vz0cEFbF1AbtfPB8RRMTWBNw54vmIVkVsMYxRDYaJnYOpztl+1LQn1VxAu3QN3dPaBkGe80sTzX60vQt7geY0IsDcMw8r+wPO9N6H2TOPXHpBbn9DcfWgehHu09OYf/YGnNJ5uE9OIyJkjyWb3+rLrQVU9R71MMIbELD238XlvjsYOXQTuUywIbziSg6zC5cw8+/HcBbPI0RkwdJnt6oPtxFw6ZbX5eFn5PANDB+5qQTkQCyfwNSfX6Lw3ycICTkclh3c7IvNBQzJdUmwide+YhOunpCFHN1sFGcrAR+AsdUl95zo/xr2q98gCkhAEpIEZUQAL6Qr99XUNY2tsL3EOp5HjcPc2x9FJh5BVQQdk47NiAlkGgZOai2QOWD2xWM+kZah1nvwl+84W2xpfS9OVlthnQWuWugS8QgKhebeuYiBfffBRK7eCutduGng2ApxEM+HX0RjrPrThoD2Y7b7tHERz4dEvPXmVbXl+DvvNq1HlQWmLoMBClPiJJ4PlWn65KfgIbVuhV4jojrNLz2CJlTIBx+cQpwZ+vVbzBYvQZP1xqRigWkLDEybnyHuXDv+BYcrS4PrsWinIqC++17J3Qmth8EJeQlPTErTVDbqQAuajEUYKOsyfPgm9DGU0Rkc9V8S6r56KMDWH8V50SctMKM9WErumzSGj9yAPj0WubAFTXhcIlp4LnrZTFVmhbYNtWiMXaXI4Cm3cUYKmNIa80mieD76UYOyQGgN2SdZQLrnovsXJKAJDRgK0TE4upzaFpjLsHTQO8JB/R6JmYEuyz3A4gEkkuW90EVfwLvyZtXffUgkB03gfWihP0N1h0MCCmhQTOu7QadY0C97UdsCxd64rGQIjtijXXahbYHuvn4kFbf3GDQhC1zTCobcfdqF6Bhur+7FN8gCUy40KGb2wjlgImmQ++pf/LV5skABTb6ncCBhMF10Rwq46kCT/LFzSBozr5yFPituqjJNQUCDpLkxuS9DeUXVXbnybWgydXwQSWHquAUGHHrzBXSgCV3RJFghWV/hKIf7GsroKgKqelB7mfzoW0OIO0zWJ3nu0LsnoKoH9a2Qru64eRFxpXB0gMn6UPCnuFV35a6DgXz/h7F0Zd6La6y3GXUTLEt0f1i7g2guFzH387TaxgESb/DUKEffV/0d8tmT/oe6wYQyixUyF1gLCrGG3r3KWZaavAt1Aq7QghIWs4mDiCQelYGxvy5UBpAqagX0GhMWK1RHq4jIMOrR1rHPnv6cebCjPFO/4KZxmYM3V4ZyIJhgZPIPBxO/zyEKrvefw+TrlrJARmrqPp9IF9qE3biQ1VEsGlIUEGChDWGXyFwshMDIPy7G/voRA0sPwQFVEddl+MQU422CMYt876a9hCaLDVfJlUNrBQaePIQthbywIAJbJbnnjAyMZw+9F3LcSVnjMm0sNiTsEq2JuIYIIDHNZ0VYjx/gxPMicivPar4nweZ7cmoUmSwuwpHw0e0yHTVf8m8v5uvXRuwcZESS379tXpwW7sqtTELlVdlxuM3EI5oLqGLDNFWgAjsHUTnnpuymPWlE8Kc98dlNvNNAMAGJ3dRPNQSf2qEOkKYbIN3UsLjtiEcEt8BquiLEocGT7GS7mX/1BCS8fjMF2wmbZaTyUk9tlxOmFfQFJLwcM1JE4wqSgSNddpQjBSiPgD67SWiZsBcn5V8PIzZCkrvSTTPprsxZzsMRkPDCHQsdtcjwhPMJT8BqvHwM8pUaRuiQaCkHWKOBAAchE42APusPI1Bi0gMJTPAgvPk9NDmgGx9GsBVK0NIA1Mg3rdlTCx9z3rYha5zY2NLjMMo/eXMboxWsnv8Br15XnnLWoGsAAAAASUVORK5CYII=";
29933
29792
  function useBrowserTitleAndIcon(name, logo) {
@@ -30586,7 +30445,7 @@
30586
30445
  t0 = $[0];
30587
30446
  }
30588
30447
  const configCache = React.useRef(t0);
30589
- const getCollectionFromStorage = _temp$d;
30448
+ const getCollectionFromStorage = _temp$c;
30590
30449
  let t1;
30591
30450
  if ($[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
30592
30451
  t1 = (path) => {
@@ -30709,7 +30568,7 @@
30709
30568
  }
30710
30569
  return t11;
30711
30570
  }
30712
- function _temp$d(storageKey) {
30571
+ function _temp$c(storageKey) {
30713
30572
  return getLocalStorageJSON(storageKey, {});
30714
30573
  }
30715
30574
  function useBuildModeController() {
@@ -30872,32 +30731,78 @@
30872
30731
  }
30873
30732
  return t7;
30874
30733
  }
30875
- function useLeavePageConfirmation(when) {
30876
- const $ = reactCompilerRuntime.c(3);
30877
- let t0;
30878
- let t1;
30879
- if ($[0] !== when) {
30880
- t0 = () => {
30881
- if (!when) {
30882
- return;
30734
+ function useNavigationUnsavedChangesDialog(when, onSuccess) {
30735
+ const [isDialogOpen, setIsDialogOpen] = React.useState(false);
30736
+ const [pendingNavigation, setPendingNavigation] = React.useState(null);
30737
+ const handleCancel = React.useCallback(() => {
30738
+ setIsDialogOpen(false);
30739
+ setPendingNavigation(null);
30740
+ }, []);
30741
+ const handleOk = React.useCallback(() => {
30742
+ setIsDialogOpen(false);
30743
+ if (pendingNavigation) {
30744
+ onSuccess();
30745
+ if (pendingNavigation.type === "popstate") {
30746
+ window.history.go(pendingNavigation.delta);
30747
+ } else if (pendingNavigation.type === "link") {
30748
+ window.location.href = pendingNavigation.href;
30749
+ }
30750
+ setPendingNavigation(null);
30751
+ }
30752
+ }, [onSuccess, pendingNavigation]);
30753
+ const handleBeforeUnload = React.useCallback((e) => {
30754
+ if (when) {
30755
+ e.preventDefault();
30756
+ e.returnValue = "";
30757
+ }
30758
+ }, [when]);
30759
+ const handlePopState = React.useCallback((e_0) => {
30760
+ if (when) {
30761
+ e_0.preventDefault();
30762
+ setPendingNavigation({
30763
+ type: "popstate",
30764
+ delta: -1
30765
+ });
30766
+ setIsDialogOpen(true);
30767
+ }
30768
+ }, [when]);
30769
+ const handleLinkClick = React.useCallback((e_1) => {
30770
+ if (!when) return;
30771
+ const target = e_1.target;
30772
+ const anchor = target.closest("a[href]");
30773
+ if (anchor && anchor.host === window.location.host) {
30774
+ e_1.preventDefault();
30775
+ const href = anchor.getAttribute("href");
30776
+ if (href) {
30777
+ setPendingNavigation({
30778
+ type: "link",
30779
+ href
30780
+ });
30781
+ setIsDialogOpen(true);
30883
30782
  }
30884
- const handleBeforeUnload = _temp$c;
30783
+ }
30784
+ }, [when]);
30785
+ React.useEffect(() => {
30786
+ if (when) {
30885
30787
  window.addEventListener("beforeunload", handleBeforeUnload);
30886
- return () => window.removeEventListener("beforeunload", handleBeforeUnload);
30788
+ window.addEventListener("popstate", handlePopState);
30789
+ document.addEventListener("click", handleLinkClick);
30790
+ } else {
30791
+ window.removeEventListener("beforeunload", handleBeforeUnload);
30792
+ window.removeEventListener("popstate", handlePopState);
30793
+ document.removeEventListener("click", handleLinkClick);
30794
+ }
30795
+ return () => {
30796
+ window.removeEventListener("beforeunload", handleBeforeUnload);
30797
+ window.removeEventListener("popstate", handlePopState);
30798
+ document.removeEventListener("click", handleLinkClick);
30887
30799
  };
30888
- t1 = [when];
30889
- $[0] = when;
30890
- $[1] = t0;
30891
- $[2] = t1;
30892
- } else {
30893
- t0 = $[1];
30894
- t1 = $[2];
30895
- }
30896
- React.useEffect(t0, t1);
30897
- }
30898
- function _temp$c(e) {
30899
- e.preventDefault();
30900
- e.returnValue = "";
30800
+ }, [when, handleBeforeUnload, handlePopState, handleLinkClick]);
30801
+ return {
30802
+ navigationWasBlocked: isDialogOpen,
30803
+ handleCancel,
30804
+ handleOk
30805
+ };
30901
30806
  }
30902
30807
  function UnsavedChangesDialog(t0) {
30903
30808
  const $ = reactCompilerRuntime.c(30);
@@ -31217,14 +31122,17 @@
31217
31122
  const widthRef = React.useRef(panel?.width);
31218
31123
  const width = widthRef.current;
31219
31124
  const sideDialogsController = useSideDialogsController();
31220
- useLeavePageConfirmation(blocked && !drawerCloseRequested);
31125
+ const {
31126
+ handleOk: handleNavigationOk,
31127
+ handleCancel: handleNavigationCancel
31128
+ } = useNavigationUnsavedChangesDialog(blocked && !drawerCloseRequested, () => setBlocked(false));
31221
31129
  React.useEffect(() => {
31222
31130
  if (panel) widthRef.current = panel.width;
31223
31131
  }, [panel]);
31224
31132
  const handleDrawerCloseOk = () => {
31225
31133
  setBlocked(false);
31226
31134
  setDrawerCloseRequested(false);
31227
- sideDialogsController.close(panel?.key);
31135
+ sideDialogsController.close();
31228
31136
  panel?.onClose?.();
31229
31137
  };
31230
31138
  const handleDrawerCloseCancel = () => {
@@ -31234,7 +31142,7 @@
31234
31142
  if (blocked && !force) {
31235
31143
  setDrawerCloseRequested(true);
31236
31144
  } else {
31237
- sideDialogsController.close(panel?.key);
31145
+ sideDialogsController.close();
31238
31146
  panel?.onClose?.();
31239
31147
  }
31240
31148
  };
@@ -31267,7 +31175,7 @@
31267
31175
  width
31268
31176
  } })
31269
31177
  ] }),
31270
- /* @__PURE__ */ jsxRuntime.jsx(UnsavedChangesDialog, { open: drawerCloseRequested, handleOk: handleDrawerCloseOk, handleCancel: handleDrawerCloseCancel, body: blockedNavigationMessage })
31178
+ /* @__PURE__ */ jsxRuntime.jsx(UnsavedChangesDialog, { open: drawerCloseRequested, handleOk: drawerCloseRequested ? handleDrawerCloseOk : handleNavigationOk, handleCancel: drawerCloseRequested ? handleDrawerCloseCancel : handleNavigationCancel, body: blockedNavigationMessage })
31271
31179
  ] });
31272
31180
  }
31273
31181
  function EntityEditViewFormActions({
@@ -31733,9 +31641,6 @@
31733
31641
  }, [selectedTabProp]);
31734
31642
  const subcollections = (collection.subcollections ?? []).filter((c) => !c.hideFromNavigation);
31735
31643
  const subcollectionsCount = subcollections?.length ?? 0;
31736
- const [subcollectionCounts, setSubcollectionCounts] = React.useState({});
31737
- const selectedSubcollection = subcollections.find((subcollection) => (subcollection.id ?? subcollection.path) === selectedTab);
31738
- const selectedSubcollectionDataSource = useDataSource();
31739
31644
  const customViews = collection.entityViews ?? [];
31740
31645
  const customViewsCount = customViews?.length ?? 0;
31741
31646
  const includeJsonView = collection.includeJsonView === void 0 ? true : collection.includeJsonView;
@@ -31809,18 +31714,15 @@
31809
31714
  const jsonView = selectedTab === JSON_TAB_VALUE || mountedTabsRef.current.has(JSON_TAB_VALUE) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cls("relative flex-1 h-full overflow-auto w-full", {
31810
31715
  "hidden": selectedTab !== JSON_TAB_VALUE
31811
31716
  }), role: "tabpanel", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(EntityJsonPreview, { values: formContext?.values ?? entity?.values ?? {} }) }) }, "json_view") : null;
31812
- const subCollectionsViews = subcollections && subcollections.map((subcollection_0) => {
31813
- const subcollectionId = subcollection_0.id ?? subcollection_0.path;
31814
- const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection_0.path)}` : void 0;
31717
+ const subCollectionsViews = subcollections && subcollections.map((subcollection) => {
31718
+ const subcollectionId = subcollection.id ?? subcollection.path;
31719
+ const newFullPath = usedEntity ? `${path}/${usedEntity?.id}/${removeInitialAndTrailingSlashes(subcollection.path)}` : void 0;
31815
31720
  const newFullIdPath = fullIdPath && usedEntity ? `${fullIdPath}/${encodeEntityId(usedEntity.id)}/${removeInitialAndTrailingSlashes(subcollectionId)}` : void 0;
31816
- const newPathSegments = buildSubcollectionPathSegments(pathSegments, usedEntity?.id, subcollection_0.path);
31721
+ const newPathSegments = buildSubcollectionPathSegments(pathSegments, usedEntity?.id, subcollection.path);
31817
31722
  if (selectedTab !== subcollectionId) return null;
31818
31723
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 h-full overflow-auto w-full", role: "tabpanel", children: [
31819
31724
  globalLoading && /* @__PURE__ */ jsxRuntime.jsx(CircularProgressCenter, {}),
31820
- !globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView$1, { fullPath: newFullPath, pathSegments: newPathSegments, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection_0, openEntityMode: layout, onCountChange: (count) => setSubcollectionCounts((counts) => counts[subcollectionId] === count ? counts : {
31821
- ...counts,
31822
- [subcollectionId]: count
31823
- }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", children: t("youd_need_to_save_before_additional_collections") }) }))
31725
+ !globalLoading && (usedEntity && newFullPath ? /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView$1, { fullPath: newFullPath, pathSegments: newPathSegments, fullIdPath: newFullIdPath, parentCollectionIds: [...parentCollectionIds, collection.id], isSubCollection: true, updateUrl: false, ...subcollection, openEntityMode: layout }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center w-full h-full p-3", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "label", children: t("youd_need_to_save_before_additional_collections") }) }))
31824
31726
  ] }, `subcol_${subcollectionId}`);
31825
31727
  }).filter(Boolean);
31826
31728
  const onSideTabClick = (value_0) => {
@@ -31856,7 +31758,7 @@
31856
31758
  onSaved?.(res);
31857
31759
  formProps?.onSaved?.(res);
31858
31760
  }, Builder: selectedSecondaryForm?.Builder });
31859
- const subcollectionTabs = subcollections && subcollections.filter((sub) => !groupedViews.includes(sub.id ?? sub.path)).map((subcollection_1) => /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { className: "text-sm min-w-[120px]", value: subcollection_1.id ?? subcollection_1.path, children: subcollection_1.name }, `entity_detail_collection_tab_${subcollection_1.name}`));
31761
+ const subcollectionTabs = subcollections && subcollections.filter((sub) => !groupedViews.includes(sub.id ?? sub.path)).map((subcollection_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { className: "text-sm min-w-[120px]", value: subcollection_0.id ?? subcollection_0.path, children: subcollection_0.name }, `entity_detail_collection_tab_${subcollection_0.name}`));
31860
31762
  const customViewTabsStart = resolvedEntityViews.filter((view) => view.position === "start" && !groupedViews.includes(view.key)).map((view_0) => /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { className: !view_0.tabComponent ? "text-sm min-w-[120px]" : void 0, value: view_0.key, children: view_0.tabComponent ?? view_0.name }, `entity_detail_collection_tab_${view_0.name}`));
31861
31763
  const customViewTabsEnd = resolvedEntityViews.filter((view_1) => (!view_1.position || view_1.position === "end") && !groupedViews.includes(view_1.key)).map((view_2) => /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { className: !view_2.tabComponent ? "text-sm min-w-[120px]" : void 0, value: view_2.key, children: view_2.tabComponent ?? view_2.name }, `entity_detail_collection_tab_${view_2.name}`));
31862
31764
  const viewGroupMenus = collection.viewGroups?.map((group) => {
@@ -31865,17 +31767,13 @@
31865
31767
  group.name,
31866
31768
  /* @__PURE__ */ jsxRuntime.jsx(ui.ExpandMoreIcon, { className: "ml-1 -mr-1", size: "small" })
31867
31769
  ] }), children: group.views.map((viewId) => {
31868
- const subcollection_2 = subcollections.find((s) => (s.id ?? s.path) === viewId);
31770
+ const subcollection_1 = subcollections.find((s) => (s.id ?? s.path) === viewId);
31869
31771
  const customView_0 = resolvedEntityViews.find((v) => v.key === viewId);
31870
- const name = subcollection_2?.name ?? customView_0?.name ?? viewId;
31772
+ const name = subcollection_1?.name ?? customView_0?.name ?? viewId;
31871
31773
  return /* @__PURE__ */ jsxRuntime.jsx(ui.MenuItem, { onClick: () => onSideTabClick(viewId), className: selectedTab === viewId ? "bg-surface-accent-100 dark:bg-surface-accent-900" : "", children: name }, `view_group_${group.name}_${viewId}`);
31872
31774
  }) }, `view_group_${group.name}`);
31873
31775
  });
31874
31776
  const shouldShowTopBar = Boolean(barActions) || hasAdditionalViews;
31875
- const subcollectionTitle = layout === "side_panel" && selectedSubcollection && usedEntity ? (() => {
31876
- const subcollectionId_0 = selectedSubcollection.id ?? selectedSubcollection.path;
31877
- return /* @__PURE__ */ jsxRuntime.jsx(CollectionPathTitle, { path: fullIdPath ? `${fullIdPath}/${encodeEntityId(usedEntity.id)}/${removeInitialAndTrailingSlashes(subcollectionId_0)}` : `${path}/${usedEntity.id}/${removeInitialAndTrailingSlashes(selectedSubcollection.path)}`, name: selectedSubcollection.name, count: subcollectionCounts[subcollectionId_0] ?? (selectedSubcollectionDataSource.countEntities ? null : void 0) });
31878
- })() : null;
31879
31777
  let result = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col h-full w-full bg-white dark:bg-surface-900", children: [
31880
31778
  shouldShowTopBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cls("h-14 items-center overflow-hidden w-full border-b pl-2 pr-2 flex gap-2 bg-surface-50 dark:bg-surface-900", ui.defaultBorderMixin), children: [
31881
31779
  barActions?.({
@@ -31884,7 +31782,6 @@
31884
31782
  values: formContext?.values ?? usedEntity?.values ?? {},
31885
31783
  status
31886
31784
  }),
31887
- subcollectionTitle,
31888
31785
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-grow" }),
31889
31786
  pluginActionsTop,
31890
31787
  globalLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "self-center", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, { size: "small" }) }),
@@ -32136,7 +32033,7 @@
32136
32033
  };
32137
32034
  };
32138
32035
  function useBuildSideDialogsController() {
32139
- const $ = reactCompilerRuntime.c(23);
32036
+ const $ = reactCompilerRuntime.c(21);
32140
32037
  const location = reactRouterDom.useLocation();
32141
32038
  const navigate = reactRouterDom.useNavigate();
32142
32039
  let t0;
@@ -32159,78 +32056,46 @@
32159
32056
  const routesCount = React.useRef(0);
32160
32057
  let t2;
32161
32058
  if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32162
- t2 = {};
32163
- $[2] = t2;
32164
- } else {
32165
- t2 = $[2];
32166
- }
32167
- const entryKeysOfPanelsWithoutUrl = React.useRef(t2);
32168
- let t3;
32169
- if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
32170
- t3 = (newPanels) => {
32059
+ t2 = (newPanels) => {
32171
32060
  sidePanelsRef.current = newPanels;
32172
32061
  setSidePanels(newPanels);
32173
32062
  };
32174
- $[3] = t3;
32063
+ $[2] = t2;
32175
32064
  } else {
32176
- t3 = $[3];
32065
+ t2 = $[2];
32177
32066
  }
32178
- const updateSidePanels = t3;
32179
- let t4;
32180
- if ($[4] !== location.key || $[5] !== location.state) {
32181
- t4 = () => {
32067
+ const updateSidePanels = t2;
32068
+ let t3;
32069
+ if ($[3] !== location.state) {
32070
+ t3 = () => {
32182
32071
  const state = location.state;
32183
32072
  const panelKeys = state?.panels ?? [];
32184
- const panelsInHistory = panelKeys.map((key) => routesStore.current[key]).filter(_temp$a);
32185
- const keptPanels = [];
32186
- let matched = 0;
32187
- for (const panel of sidePanelsRef.current) {
32188
- if (panelsInHistory[matched]?.key === panel.key) {
32189
- keptPanels.push(panel);
32190
- matched++;
32191
- } else {
32192
- if (!panel.urlPath && (keptPanels.length > 0 || entryKeysOfPanelsWithoutUrl.current[panel.key] === location.key)) {
32193
- keptPanels.push(panel);
32194
- } else {
32195
- break;
32196
- }
32197
- }
32198
- }
32199
- const newPanels_0 = [...keptPanels, ...panelsInHistory.slice(matched)];
32073
+ const newPanels_0 = panelKeys.map((key) => routesStore.current[key]).filter(_temp$a);
32200
32074
  if (!equal(sidePanelsRef.current.map(_temp2$4), newPanels_0.map(_temp3$3))) {
32201
32075
  updateSidePanels(newPanels_0);
32202
32076
  }
32203
32077
  };
32204
- $[4] = location.key;
32205
- $[5] = location.state;
32078
+ $[3] = location.state;
32079
+ $[4] = t3;
32080
+ } else {
32081
+ t3 = $[4];
32082
+ }
32083
+ let t4;
32084
+ if ($[5] !== location) {
32085
+ t4 = [location];
32086
+ $[5] = location;
32206
32087
  $[6] = t4;
32207
32088
  } else {
32208
32089
  t4 = $[6];
32209
32090
  }
32091
+ React.useEffect(t3, t4);
32210
32092
  let t5;
32211
- if ($[7] !== location) {
32212
- t5 = [location];
32213
- $[7] = location;
32214
- $[8] = t5;
32215
- } else {
32216
- t5 = $[8];
32217
- }
32218
- React.useEffect(t4, t5);
32219
- let t6;
32220
- if ($[9] !== location || $[10] !== navigate) {
32221
- t6 = (key_0) => {
32093
+ if ($[7] !== location || $[8] !== navigate) {
32094
+ t5 = () => {
32222
32095
  const currentPanels = sidePanelsRef.current;
32223
32096
  if (currentPanels.length === 0) {
32224
32097
  return;
32225
32098
  }
32226
- const index = key_0 !== void 0 ? currentPanels.findLastIndex((p_2) => p_2.key === key_0) : -1;
32227
- if (index !== -1 && index < currentPanels.length - 1 && !currentPanels[index].urlPath) {
32228
- updateSidePanels(currentPanels.filter((_, i) => i !== index));
32229
- if (routesCount.current > 0) {
32230
- routesCount.current = routesCount.current - 1;
32231
- }
32232
- return;
32233
- }
32234
32099
  const lastSidePanel = currentPanels[currentPanels.length - 1];
32235
32100
  const updatedPanels = [...currentPanels.slice(0, -1)];
32236
32101
  updateSidePanels(updatedPanels);
@@ -32252,31 +32117,28 @@
32252
32117
  }
32253
32118
  }
32254
32119
  };
32255
- $[9] = location;
32256
- $[10] = navigate;
32257
- $[11] = t6;
32120
+ $[7] = location;
32121
+ $[8] = navigate;
32122
+ $[9] = t5;
32258
32123
  } else {
32259
- t6 = $[11];
32124
+ t5 = $[9];
32260
32125
  }
32261
- const close = t6;
32262
- let t7;
32263
- if ($[12] !== location || $[13] !== navigate) {
32264
- t7 = (panelProps) => {
32126
+ const close = t5;
32127
+ let t6;
32128
+ if ($[10] !== location || $[11] !== navigate) {
32129
+ t6 = (panelProps) => {
32265
32130
  const newPanels_1 = Array.isArray(panelProps) ? panelProps : [panelProps];
32266
- newPanels_1.forEach((panel_0) => {
32267
- routesStore.current[panel_0.key] = panel_0;
32268
- if (!panel_0.urlPath) {
32269
- entryKeysOfPanelsWithoutUrl.current[panel_0.key] = location.key;
32270
- }
32131
+ newPanels_1.forEach((panel) => {
32132
+ routesStore.current[panel.key] = panel;
32271
32133
  });
32272
32134
  routesCount.current = routesCount.current + newPanels_1.length;
32273
32135
  const baseLocation_0 = location.state?.base_location ?? location;
32274
32136
  const currentPanels_0 = sidePanelsRef.current;
32275
32137
  const updatedPanels_0 = [...currentPanels_0, ...newPanels_1];
32276
32138
  updateSidePanels(updatedPanels_0);
32277
- newPanels_1.forEach((panel_1) => {
32278
- if (panel_1.urlPath) {
32279
- navigate(panel_1.urlPath, {
32139
+ newPanels_1.forEach((panel_0) => {
32140
+ if (panel_0.urlPath) {
32141
+ navigate(panel_0.urlPath, {
32280
32142
  state: {
32281
32143
  base_location: baseLocation_0,
32282
32144
  panels: updatedPanels_0.map(_temp5$1)
@@ -32285,30 +32147,27 @@
32285
32147
  }
32286
32148
  });
32287
32149
  };
32288
- $[12] = location;
32289
- $[13] = navigate;
32290
- $[14] = t7;
32150
+ $[10] = location;
32151
+ $[11] = navigate;
32152
+ $[12] = t6;
32291
32153
  } else {
32292
- t7 = $[14];
32154
+ t6 = $[12];
32293
32155
  }
32294
- const open = t7;
32295
- let t8;
32296
- if ($[15] !== location || $[16] !== navigate) {
32297
- t8 = (panelProps_0) => {
32156
+ const open = t6;
32157
+ let t7;
32158
+ if ($[13] !== location || $[14] !== navigate) {
32159
+ t7 = (panelProps_0) => {
32298
32160
  const newPanels_2 = Array.isArray(panelProps_0) ? panelProps_0 : [panelProps_0];
32299
- newPanels_2.forEach((panel_2) => {
32300
- routesStore.current[panel_2.key] = panel_2;
32301
- if (!panel_2.urlPath) {
32302
- entryKeysOfPanelsWithoutUrl.current[panel_2.key] = location.key;
32303
- }
32161
+ newPanels_2.forEach((panel_1) => {
32162
+ routesStore.current[panel_1.key] = panel_1;
32304
32163
  });
32305
32164
  const baseLocation_1 = location.state?.base_location ?? location;
32306
32165
  const currentPanels_1 = sidePanelsRef.current;
32307
32166
  const updatedPanels_1 = [...currentPanels_1.slice(0, -newPanels_2.length), ...newPanels_2];
32308
32167
  updateSidePanels(updatedPanels_1);
32309
- newPanels_2.forEach((panel_3) => {
32310
- if (panel_3.urlPath) {
32311
- navigate(panel_3.urlPath, {
32168
+ newPanels_2.forEach((panel_2) => {
32169
+ if (panel_2.urlPath) {
32170
+ navigate(panel_2.urlPath, {
32312
32171
  replace: true,
32313
32172
  state: {
32314
32173
  base_location: baseLocation_1,
@@ -32318,41 +32177,41 @@
32318
32177
  }
32319
32178
  });
32320
32179
  };
32321
- $[15] = location;
32322
- $[16] = navigate;
32323
- $[17] = t8;
32180
+ $[13] = location;
32181
+ $[14] = navigate;
32182
+ $[15] = t7;
32324
32183
  } else {
32325
- t8 = $[17];
32184
+ t7 = $[15];
32326
32185
  }
32327
- const replace = t8;
32328
- let t9;
32329
- if ($[18] !== close || $[19] !== open || $[20] !== replace || $[21] !== sidePanels) {
32330
- t9 = {
32186
+ const replace = t7;
32187
+ let t8;
32188
+ if ($[16] !== close || $[17] !== open || $[18] !== replace || $[19] !== sidePanels) {
32189
+ t8 = {
32331
32190
  sidePanels,
32332
32191
  setSidePanels: updateSidePanels,
32333
32192
  close,
32334
32193
  open,
32335
32194
  replace
32336
32195
  };
32337
- $[18] = close;
32338
- $[19] = open;
32339
- $[20] = replace;
32340
- $[21] = sidePanels;
32341
- $[22] = t9;
32196
+ $[16] = close;
32197
+ $[17] = open;
32198
+ $[18] = replace;
32199
+ $[19] = sidePanels;
32200
+ $[20] = t8;
32342
32201
  } else {
32343
- t9 = $[22];
32202
+ t8 = $[20];
32344
32203
  }
32345
- return t9;
32346
- }
32347
- function _temp6$1(p_5) {
32348
- return p_5.key;
32204
+ return t8;
32349
32205
  }
32350
- function _temp5$1(p_4) {
32206
+ function _temp6$1(p_4) {
32351
32207
  return p_4.key;
32352
32208
  }
32353
- function _temp4$2(p_3) {
32209
+ function _temp5$1(p_3) {
32354
32210
  return p_3.key;
32355
32211
  }
32212
+ function _temp4$2(p_2) {
32213
+ return p_2.key;
32214
+ }
32356
32215
  function _temp3$3(p_1) {
32357
32216
  return p_1.key;
32358
32217
  }