@rebasepro/core 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/components/LoginView/LoginView.d.ts +25 -1
  2. package/dist/components/common/types.d.ts +10 -7
  3. package/dist/components/common/useDebouncedData.d.ts +1 -1
  4. package/dist/core/RebaseProps.d.ts +13 -2
  5. package/dist/core/RebaseRouter.d.ts +1 -1
  6. package/dist/hooks/data/useCollectionFetch.d.ts +12 -1
  7. package/dist/hooks/index.d.ts +0 -1
  8. package/dist/index.es.js +565 -454
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.umd.js +565 -454
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/util/entity_cache.d.ts +0 -5
  13. package/dist/util/index.d.ts +0 -2
  14. package/dist/util/useStorageUploadController.d.ts +2 -2
  15. package/package.json +6 -6
  16. package/src/components/BootstrapAdminBanner.tsx +12 -3
  17. package/src/components/LoginView/LoginView.tsx +177 -10
  18. package/src/components/UserSettingsView.tsx +95 -2
  19. package/src/components/common/types.tsx +7 -7
  20. package/src/components/common/useDebouncedData.ts +2 -2
  21. package/src/core/Rebase.tsx +3 -2
  22. package/src/core/RebaseProps.tsx +15 -2
  23. package/src/core/RebaseRouter.tsx +1 -1
  24. package/src/hooks/data/useCollectionFetch.tsx +27 -4
  25. package/src/hooks/data/useUserSelector.tsx +1 -1
  26. package/src/hooks/index.tsx +0 -1
  27. package/src/hooks/useResolvedComponent.tsx +4 -3
  28. package/src/locales/en.ts +13 -0
  29. package/src/locales/es.ts +11 -1
  30. package/src/util/entity_cache.ts +1 -27
  31. package/src/util/icon_list.ts +2 -2
  32. package/src/util/index.ts +2 -2
  33. package/src/util/previews.ts +9 -1
  34. package/src/util/useStorageUploadController.tsx +4 -4
  35. package/dist/hooks/useValidateAuthenticator.d.ts +0 -21
  36. package/dist/util/icon_synonyms.d.ts +0 -1
  37. package/dist/util/useTraceUpdate.d.ts +0 -2
  38. package/src/hooks/useValidateAuthenticator.tsx +0 -116
  39. package/src/util/icon_synonyms.ts +0 -1
  40. package/src/util/useTraceUpdate.tsx +0 -24
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react-compiler-runtime"), require("react"), require("@rebasepro/ui"), require("notistack"), require("@rebasepro/types"), require("react-router-dom"), require("@rebasepro/common"), require("@rebasepro/utils"), require("fast-equals"), require("react-i18next"), require("i18next"), require("fuse.js"), require("compressorjs")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react-compiler-runtime", "react", "@rebasepro/ui", "notistack", "@rebasepro/types", "react-router-dom", "@rebasepro/common", "@rebasepro/utils", "fast-equals", "react-i18next", "i18next", "fuse.js", "compressorjs"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["Rebase Core"] = {}, global.jsxRuntime, global.reactCompilerRuntime, global.React, global.ui, global.notistack, global.types, global.reactRouterDom, global.common, global.utils, global.fastEquals, global.reactI18next, global.i18next, global.Fuse, global.Compressor));
3
- })(this, (function(exports2, jsxRuntime, reactCompilerRuntime, React, ui, notistack, types, reactRouterDom, common, utils, fastEquals, reactI18next, i18next, Fuse, Compressor) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react-compiler-runtime"), require("react"), require("@rebasepro/ui"), require("notistack"), require("@rebasepro/types"), require("react-router-dom"), require("@rebasepro/common"), require("@rebasepro/utils"), require("react-i18next"), require("fast-equals"), require("i18next"), require("fuse.js"), require("compressorjs")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react-compiler-runtime", "react", "@rebasepro/ui", "notistack", "@rebasepro/types", "react-router-dom", "@rebasepro/common", "@rebasepro/utils", "react-i18next", "fast-equals", "i18next", "fuse.js", "compressorjs"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["Rebase Core"] = {}, global.jsxRuntime, global.reactCompilerRuntime, global.React, global.ui, global.notistack, global.types, global.reactRouterDom, global.common, global.utils, global.reactI18next, global.fastEquals, global.i18next, global.Fuse, global.Compressor));
3
+ })(this, (function(exports2, jsxRuntime, reactCompilerRuntime, React, ui, notistack, types, reactRouterDom, common, utils, reactI18next, fastEquals, i18next, Fuse, Compressor) {
4
4
  "use strict";
5
5
  function PluginProviderStack({
6
6
  plugins,
@@ -258,13 +258,15 @@
258
258
  return React.useContext(RebaseDataContext);
259
259
  };
260
260
  function useCollectionFetch(t0) {
261
- const $ = reactCompilerRuntime.c(25);
261
+ const $ = reactCompilerRuntime.c(30);
262
262
  const {
263
263
  path,
264
264
  collection,
265
265
  filterValues,
266
266
  sortBy,
267
267
  itemCount,
268
+ offset,
269
+ page,
268
270
  searchString
269
271
  } = t0;
270
272
  const dataClient = useData();
@@ -308,8 +310,9 @@
308
310
  const [dataLoading, setDataLoading] = React.useState(false);
309
311
  const [dataLoadingError, setDataLoadingError] = React.useState();
310
312
  const [noMoreToLoad, setNoMoreToLoad] = React.useState(false);
313
+ const [totalCount, setTotalCount] = React.useState();
311
314
  let t3;
312
- if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== orderByParams || $[7] !== path || $[8] !== searchString || $[9] !== whereParams) {
315
+ if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== offset || $[7] !== orderByParams || $[8] !== page || $[9] !== path || $[10] !== searchString || $[11] !== whereParams) {
313
316
  t3 = () => {
314
317
  setDataLoading(true);
315
318
  const onEntitiesUpdate = async (res) => {
@@ -318,12 +321,14 @@
318
321
  setDataLoadingError(void 0);
319
322
  setData(entities.map(_temp$7));
320
323
  setNoMoreToLoad(!res.meta.hasMore);
324
+ setTotalCount(res.meta.total);
321
325
  };
322
326
  const onError = (error) => {
323
327
  console.error("ERROR", error);
324
328
  setDataLoading(false);
325
329
  setData([]);
326
330
  setDataLoadingError(error);
331
+ setTotalCount(void 0);
327
332
  };
328
333
  const accessor = dataClient.collection(path);
329
334
  const hasRelations = collection.properties && Object.values(collection.properties).some(_temp2$4);
@@ -332,6 +337,8 @@
332
337
  return accessor.listen({
333
338
  where: whereParams,
334
339
  limit: itemCount,
340
+ offset,
341
+ page,
335
342
  orderBy: orderByParams,
336
343
  searchString,
337
344
  include: includeParams
@@ -343,6 +350,8 @@
343
350
  accessor.find({
344
351
  where: whereParams,
345
352
  limit: itemCount,
353
+ offset,
354
+ page,
346
355
  orderBy: orderByParams,
347
356
  searchString,
348
357
  include: includeParams
@@ -356,46 +365,52 @@
356
365
  $[3] = collection.properties;
357
366
  $[4] = dataClient;
358
367
  $[5] = itemCount;
359
- $[6] = orderByParams;
360
- $[7] = path;
361
- $[8] = searchString;
362
- $[9] = whereParams;
363
- $[10] = t3;
368
+ $[6] = offset;
369
+ $[7] = orderByParams;
370
+ $[8] = page;
371
+ $[9] = path;
372
+ $[10] = searchString;
373
+ $[11] = whereParams;
374
+ $[12] = t3;
364
375
  } else {
365
- t3 = $[10];
376
+ t3 = $[12];
366
377
  }
367
378
  let t4;
368
- if ($[11] !== collection || $[12] !== currentSort || $[13] !== dataClient || $[14] !== filterValues || $[15] !== itemCount || $[16] !== path || $[17] !== searchString || $[18] !== sortByProperty) {
369
- t4 = [path, itemCount, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
370
- $[11] = collection;
371
- $[12] = currentSort;
372
- $[13] = dataClient;
373
- $[14] = filterValues;
374
- $[15] = itemCount;
375
- $[16] = path;
376
- $[17] = searchString;
377
- $[18] = sortByProperty;
378
- $[19] = t4;
379
- } else {
380
- t4 = $[19];
379
+ if ($[13] !== collection || $[14] !== currentSort || $[15] !== dataClient || $[16] !== filterValues || $[17] !== itemCount || $[18] !== offset || $[19] !== page || $[20] !== path || $[21] !== searchString || $[22] !== sortByProperty) {
380
+ t4 = [path, itemCount, offset, page, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
381
+ $[13] = collection;
382
+ $[14] = currentSort;
383
+ $[15] = dataClient;
384
+ $[16] = filterValues;
385
+ $[17] = itemCount;
386
+ $[18] = offset;
387
+ $[19] = page;
388
+ $[20] = path;
389
+ $[21] = searchString;
390
+ $[22] = sortByProperty;
391
+ $[23] = t4;
392
+ } else {
393
+ t4 = $[23];
381
394
  }
382
395
  React.useEffect(t3, t4);
383
396
  let t5;
384
397
  let t6;
385
- if ($[20] !== data || $[21] !== dataLoading || $[22] !== dataLoadingError || $[23] !== noMoreToLoad) {
398
+ if ($[24] !== data || $[25] !== dataLoading || $[26] !== dataLoadingError || $[27] !== noMoreToLoad || $[28] !== totalCount) {
386
399
  t6 = {
387
400
  data,
388
401
  dataLoading,
389
402
  dataLoadingError,
390
- noMoreToLoad
403
+ noMoreToLoad,
404
+ totalCount
391
405
  };
392
- $[20] = data;
393
- $[21] = dataLoading;
394
- $[22] = dataLoadingError;
395
- $[23] = noMoreToLoad;
396
- $[24] = t6;
406
+ $[24] = data;
407
+ $[25] = dataLoading;
408
+ $[26] = dataLoadingError;
409
+ $[27] = noMoreToLoad;
410
+ $[28] = totalCount;
411
+ $[29] = t6;
397
412
  } else {
398
- t6 = $[24];
413
+ t6 = $[29];
399
414
  }
400
415
  t5 = t6;
401
416
  return t5;
@@ -873,7 +888,7 @@
873
888
  };
874
889
  }, []);
875
890
  const getUser = React.useCallback((uid) => {
876
- return userManagement?.getUser(uid) ?? null;
891
+ return userManagement?.getUser?.(uid) ?? null;
877
892
  }, [userManagement]);
878
893
  return React.useMemo(() => ({
879
894
  items,
@@ -1743,128 +1758,6 @@
1743
1758
  setMode: setModeInternal
1744
1759
  }), [mode, setModeInternal]);
1745
1760
  }
1746
- function useValidateAuthenticator(t0) {
1747
- const $ = reactCompilerRuntime.c(17);
1748
- const {
1749
- disabled,
1750
- authController,
1751
- authenticator,
1752
- storageSource,
1753
- data
1754
- } = t0;
1755
- const authenticationEnabled = Boolean(authenticator);
1756
- const [authLoading, setAuthLoading] = React.useState(authenticationEnabled);
1757
- const [notAllowedError, setNotAllowedError] = React.useState(false);
1758
- const [authVerified, setAuthVerified] = React.useState(!authenticationEnabled || Boolean(authController.loginSkipped));
1759
- const canAccessMainView = authVerified && (!authenticationEnabled || Boolean(authController.user) || Boolean(authController.loginSkipped)) && !notAllowedError;
1760
- let t1;
1761
- let t2;
1762
- if ($[0] !== authController.loginSkipped) {
1763
- t1 = () => {
1764
- if (authController.loginSkipped) {
1765
- setAuthVerified(true);
1766
- }
1767
- };
1768
- t2 = [authController.loginSkipped];
1769
- $[0] = authController.loginSkipped;
1770
- $[1] = t1;
1771
- $[2] = t2;
1772
- } else {
1773
- t1 = $[1];
1774
- t2 = $[2];
1775
- }
1776
- React.useEffect(t1, t2);
1777
- const checkedUserRef = React.useRef(void 0);
1778
- let t3;
1779
- if ($[3] !== authController || $[4] !== authenticator || $[5] !== data || $[6] !== disabled || $[7] !== storageSource) {
1780
- t3 = async () => {
1781
- if (disabled) {
1782
- return;
1783
- }
1784
- if (authController.initialLoading) {
1785
- return;
1786
- }
1787
- if (!authController.user && !authController.loginSkipped) {
1788
- checkedUserRef.current = void 0;
1789
- setAuthLoading(false);
1790
- setAuthVerified(false);
1791
- return;
1792
- }
1793
- const delegateUser = authController.user;
1794
- if (authenticator instanceof Function && delegateUser && !fastEquals.deepEqual(checkedUserRef.current?.uid, delegateUser.uid)) {
1795
- setAuthLoading(true);
1796
- try {
1797
- const allowed = await authenticator({
1798
- user: delegateUser,
1799
- authController,
1800
- data,
1801
- storageSource
1802
- });
1803
- if (!allowed) {
1804
- authController.signOut();
1805
- setNotAllowedError(true);
1806
- }
1807
- } catch (t42) {
1808
- const e = t42;
1809
- setNotAllowedError(e);
1810
- authController.signOut();
1811
- }
1812
- setAuthLoading(false);
1813
- setAuthVerified(true);
1814
- checkedUserRef.current = delegateUser;
1815
- } else {
1816
- setAuthLoading(false);
1817
- }
1818
- if (!authController.initialLoading && !delegateUser) {
1819
- setAuthVerified(true);
1820
- }
1821
- };
1822
- $[3] = authController;
1823
- $[4] = authenticator;
1824
- $[5] = data;
1825
- $[6] = disabled;
1826
- $[7] = storageSource;
1827
- $[8] = t3;
1828
- } else {
1829
- t3 = $[8];
1830
- }
1831
- const checkAuthentication = t3;
1832
- let t4;
1833
- let t5;
1834
- if ($[9] !== checkAuthentication) {
1835
- t4 = () => {
1836
- checkAuthentication();
1837
- };
1838
- t5 = [checkAuthentication];
1839
- $[9] = checkAuthentication;
1840
- $[10] = t4;
1841
- $[11] = t5;
1842
- } else {
1843
- t4 = $[10];
1844
- t5 = $[11];
1845
- }
1846
- React.useEffect(t4, t5);
1847
- let t6;
1848
- const t7 = authenticationEnabled && authLoading;
1849
- let t8;
1850
- if ($[12] !== authVerified || $[13] !== canAccessMainView || $[14] !== notAllowedError || $[15] !== t7) {
1851
- t8 = {
1852
- canAccessMainView,
1853
- authLoading: t7,
1854
- notAllowedError,
1855
- authVerified
1856
- };
1857
- $[12] = authVerified;
1858
- $[13] = canAccessMainView;
1859
- $[14] = notAllowedError;
1860
- $[15] = t7;
1861
- $[16] = t8;
1862
- } else {
1863
- t8 = $[16];
1864
- }
1865
- t6 = t8;
1866
- return t6;
1867
- }
1868
1761
  const RegistryDispatchContext = React.createContext(void 0);
1869
1762
  const RegistryStateContext = React.createContext({
1870
1763
  cmsConfig: null,
@@ -5628,11 +5521,18 @@
5628
5521
  const {
5629
5522
  t
5630
5523
  } = useTranslation();
5524
+ const hasPasswordChange = !!authController.changePassword;
5631
5525
  const [activeTab, setActiveTab] = React.useState("profile");
5632
5526
  const [displayName, setDisplayName] = React.useState(user?.displayName || "");
5633
5527
  const [photoURL, setPhotoURL] = React.useState(user?.photoURL || "");
5634
5528
  const [savingProfile, setSavingProfile] = React.useState(false);
5635
5529
  const [profileError, setProfileError] = React.useState(null);
5530
+ const [currentPassword, setCurrentPassword] = React.useState("");
5531
+ const [newPassword, setNewPassword] = React.useState("");
5532
+ const [confirmPassword, setConfirmPassword] = React.useState("");
5533
+ const [changingPassword, setChangingPassword] = React.useState(false);
5534
+ const [passwordError, setPasswordError] = React.useState(null);
5535
+ const [passwordSuccess, setPasswordSuccess] = React.useState(null);
5636
5536
  const [sessions, setSessions] = React.useState([]);
5637
5537
  const [loadingSessions, setLoadingSessions] = React.useState(false);
5638
5538
  const [sessionsError, setSessionsError] = React.useState(null);
@@ -5660,6 +5560,35 @@
5660
5560
  setSavingProfile(false);
5661
5561
  }
5662
5562
  };
5563
+ const handleChangePassword = async () => {
5564
+ setPasswordError(null);
5565
+ setPasswordSuccess(null);
5566
+ if (newPassword.length < 8) {
5567
+ setPasswordError(t("password_too_short"));
5568
+ return;
5569
+ }
5570
+ if (newPassword !== confirmPassword) {
5571
+ setPasswordError(t("passwords_dont_match"));
5572
+ return;
5573
+ }
5574
+ setChangingPassword(true);
5575
+ try {
5576
+ if (authController.changePassword) {
5577
+ await authController.changePassword(currentPassword, newPassword);
5578
+ setPasswordSuccess(t("password_changed"));
5579
+ setCurrentPassword("");
5580
+ setNewPassword("");
5581
+ setConfirmPassword("");
5582
+ setTimeout(() => {
5583
+ authController.signOut();
5584
+ }, 2e3);
5585
+ }
5586
+ } catch (e_0) {
5587
+ setPasswordError(e_0 instanceof Error ? e_0.message : String(e_0));
5588
+ } finally {
5589
+ setChangingPassword(false);
5590
+ }
5591
+ };
5663
5592
  const loadSessions = async () => {
5664
5593
  setLoadingSessions(true);
5665
5594
  setSessionsError(null);
@@ -5671,8 +5600,8 @@
5671
5600
  } else {
5672
5601
  throw new Error("fetchSessions not implemented in this auth controller.");
5673
5602
  }
5674
- } catch (e_0) {
5675
- setSessionsError(e_0 instanceof Error ? e_0.message : String(e_0));
5603
+ } catch (e_1) {
5604
+ setSessionsError(e_1 instanceof Error ? e_1.message : String(e_1));
5676
5605
  } finally {
5677
5606
  setLoadingSessions(false);
5678
5607
  }
@@ -5689,8 +5618,8 @@
5689
5618
  } else {
5690
5619
  throw new Error("revokeSession not implemented in this auth controller.");
5691
5620
  }
5692
- } catch (e_1) {
5693
- setSessionsError(e_1 instanceof Error ? e_1.message : String(e_1));
5621
+ } catch (e_2) {
5622
+ setSessionsError(e_2 instanceof Error ? e_2.message : String(e_2));
5694
5623
  } finally {
5695
5624
  setRevokingSessionId(null);
5696
5625
  }
@@ -5703,8 +5632,8 @@
5703
5632
  } else {
5704
5633
  throw new Error("revokeAllSessions not implemented in this auth controller.");
5705
5634
  }
5706
- } catch (e_2) {
5707
- setSessionsError(e_2 instanceof Error ? e_2.message : String(e_2));
5635
+ } catch (e_3) {
5636
+ setSessionsError(e_3 instanceof Error ? e_3.message : String(e_3));
5708
5637
  } finally {
5709
5638
  setRevokingAll(false);
5710
5639
  }
@@ -5714,15 +5643,25 @@
5714
5643
  /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h4", className: "mb-8", children: t("account_settings") }),
5715
5644
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Tabs, { value: activeTab, onValueChange: (v) => setActiveTab(v), className: "mb-8", children: [
5716
5645
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "profile", children: t("profile") }),
5646
+ hasPasswordChange && /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "security", children: t("security") }),
5717
5647
  /* @__PURE__ */ jsxRuntime.jsx(ui.Tab, { value: "sessions", children: t("sessions") })
5718
5648
  ] }),
5719
5649
  activeTab === "profile" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6 max-w-xl", children: [
5720
5650
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-6 mb-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Avatar, { src: photoURL || void 0, className: "w-24 h-24 text-3xl", children: displayName ? displayName[0].toUpperCase() : user.email ? user.email[0].toUpperCase() : "A" }) }),
5721
- /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("display_name"), value: displayName, onChange: (e_3) => setDisplayName(e_3.target.value) }),
5722
- /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("photo_url"), value: photoURL, onChange: (e_4) => setPhotoURL(e_4.target.value) }),
5651
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("display_name"), value: displayName, onChange: (e_4) => setDisplayName(e_4.target.value) }),
5652
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("photo_url"), value: photoURL, onChange: (e_5) => setPhotoURL(e_5.target.value) }),
5723
5653
  profileError && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { color: "error", children: profileError }),
5724
5654
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", onClick: handleSaveProfile, disabled: savingProfile, children: savingProfile ? t("saving") : t("save_profile") }) })
5725
5655
  ] }),
5656
+ activeTab === "security" && hasPasswordChange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6 max-w-xl", children: [
5657
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h6", className: "mb-2", children: t("change_password") }),
5658
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("current_password"), type: "password", value: currentPassword, onChange: (e_6) => setCurrentPassword(e_6.target.value), autoComplete: "current-password" }),
5659
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("new_password"), type: "password", value: newPassword, onChange: (e_7) => setNewPassword(e_7.target.value), autoComplete: "new-password" }),
5660
+ /* @__PURE__ */ jsxRuntime.jsx(ui.TextField, { label: t("confirm_password"), type: "password", value: confirmPassword, onChange: (e_8) => setConfirmPassword(e_8.target.value), autoComplete: "new-password" }),
5661
+ passwordError && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { color: "error", children: passwordError }),
5662
+ passwordSuccess && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { className: "text-emerald-600 dark:text-emerald-400", children: passwordSuccess }),
5663
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "filled", onClick: handleChangePassword, disabled: changingPassword || !currentPassword || !newPassword || !confirmPassword, children: changingPassword ? t("changing_password") : t("change_password") }) })
5664
+ ] }),
5726
5665
  activeTab === "sessions" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 max-w-3xl", children: loadingSessions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularProgress, {}) }) : sessionsError ? /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { color: "error", children: sessionsError }) : sessions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { children: t("no_active_sessions") }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
5727
5666
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end mb-2", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "text", color: "error", onClick: handleRevokeAll, disabled: revokingAll, children: revokingAll ? t("revoking") : t("revoke_all_sessions") }) }),
5728
5667
  sessions.map((session) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center p-4 bg-white dark:bg-surface-950 border rounded-lg dark:border-surface-700 shadow-sm", children: [
@@ -6421,7 +6360,7 @@
6421
6360
  return t8;
6422
6361
  }
6423
6362
  function LoginView(t0) {
6424
- const $ = reactCompilerRuntime.c(87);
6363
+ const $ = reactCompilerRuntime.c(111);
6425
6364
  const {
6426
6365
  logo,
6427
6366
  authController,
@@ -6430,8 +6369,15 @@
6430
6369
  disabled: t2,
6431
6370
  notAllowedError,
6432
6371
  googleClientId,
6372
+ githubClientId,
6373
+ linkedinClientId,
6374
+ title,
6375
+ subtitle,
6433
6376
  needsSetup,
6434
- registrationEnabled
6377
+ registrationEnabled,
6378
+ additionalComponent,
6379
+ defaultEmail,
6380
+ defaultPassword
6435
6381
  } = t0;
6436
6382
  const disableSignupScreen = t1 === void 0 ? false : t1;
6437
6383
  const disabled = t2 === void 0 ? false : t2;
@@ -6482,26 +6428,76 @@
6482
6428
  t5 = $[6];
6483
6429
  }
6484
6430
  const hasGoogleLogin = t5;
6485
- const hasPasswordReset = caps.passwordReset ?? !!authController.forgotPassword;
6486
- const showRegistration = !disableSignupScreen && canRegister;
6487
6431
  let t6;
6432
+ if ($[7] !== caps.enabledProviders || $[8] !== githubClientId) {
6433
+ t6 = githubClientId && (caps.enabledProviders?.includes("github") ?? false);
6434
+ $[7] = caps.enabledProviders;
6435
+ $[8] = githubClientId;
6436
+ $[9] = t6;
6437
+ } else {
6438
+ t6 = $[9];
6439
+ }
6440
+ const hasGitHubLogin = t6;
6488
6441
  let t7;
6489
- if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6490
- t6 = () => {
6442
+ if ($[10] !== caps.enabledProviders || $[11] !== linkedinClientId) {
6443
+ t7 = linkedinClientId && (caps.enabledProviders?.includes("linkedin") ?? false);
6444
+ $[10] = caps.enabledProviders;
6445
+ $[11] = linkedinClientId;
6446
+ $[12] = t7;
6447
+ } else {
6448
+ t7 = $[12];
6449
+ }
6450
+ const hasLinkedinLogin = t7;
6451
+ const hasPasswordReset = caps.passwordReset ?? !!authController.forgotPassword;
6452
+ const showRegistration = !disableSignupScreen && canRegister;
6453
+ let t8;
6454
+ let t9;
6455
+ if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6456
+ t8 = () => {
6491
6457
  const timer = setTimeout(() => setFadeIn(true), 50);
6492
6458
  return () => clearTimeout(timer);
6493
6459
  };
6494
- t7 = [];
6495
- $[7] = t6;
6496
- $[8] = t7;
6460
+ t9 = [];
6461
+ $[13] = t8;
6462
+ $[14] = t9;
6497
6463
  } else {
6498
- t6 = $[7];
6499
- t7 = $[8];
6464
+ t8 = $[13];
6465
+ t9 = $[14];
6500
6466
  }
6501
- React.useEffect(t6, t7);
6502
- let t8;
6503
- if ($[9] !== authController.authProviderError || $[10] !== authController.user) {
6504
- t8 = function buildErrorView2() {
6467
+ React.useEffect(t8, t9);
6468
+ let t10;
6469
+ let t11;
6470
+ if ($[15] !== authController) {
6471
+ t10 = () => {
6472
+ const params = new URLSearchParams(window.location.search);
6473
+ const code = params.get("code");
6474
+ const provider = localStorage.getItem("rebase_oauth_provider");
6475
+ if (code && provider) {
6476
+ localStorage.removeItem("rebase_oauth_provider");
6477
+ const cleanUrl = window.location.origin + window.location.pathname;
6478
+ window.history.replaceState({}, document.title, cleanUrl);
6479
+ if (authController.oauthLogin) {
6480
+ authController.oauthLogin(provider, {
6481
+ code,
6482
+ redirectUri: cleanUrl
6483
+ }).catch((err) => {
6484
+ console.error(`${provider} login failed:`, err);
6485
+ });
6486
+ }
6487
+ }
6488
+ };
6489
+ t11 = [authController];
6490
+ $[15] = authController;
6491
+ $[16] = t10;
6492
+ $[17] = t11;
6493
+ } else {
6494
+ t10 = $[16];
6495
+ t11 = $[17];
6496
+ }
6497
+ React.useEffect(t10, t11);
6498
+ let t12;
6499
+ if ($[18] !== authController.authProviderError || $[19] !== authController.user) {
6500
+ t12 = function buildErrorView2() {
6505
6501
  if (!authController.authProviderError) {
6506
6502
  return null;
6507
6503
  }
@@ -6511,44 +6507,44 @@
6511
6507
  const errorMsg = authController.authProviderError instanceof Error ? authController.authProviderError.message : String(authController.authProviderError);
6512
6508
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: errorMsg }) });
6513
6509
  };
6514
- $[9] = authController.authProviderError;
6515
- $[10] = authController.user;
6516
- $[11] = t8;
6510
+ $[18] = authController.authProviderError;
6511
+ $[19] = authController.user;
6512
+ $[20] = t12;
6517
6513
  } else {
6518
- t8 = $[11];
6514
+ t12 = $[20];
6519
6515
  }
6520
- const buildErrorView = t8;
6516
+ const buildErrorView = t12;
6521
6517
  let logoComponent;
6522
6518
  if (logo) {
6523
- let t92;
6524
- if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6525
- t92 = {
6519
+ let t132;
6520
+ if ($[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6521
+ t132 = {
6526
6522
  height: "100%",
6527
6523
  width: "100%",
6528
6524
  objectFit: "cover"
6529
6525
  };
6530
- $[12] = t92;
6526
+ $[21] = t132;
6531
6527
  } else {
6532
- t92 = $[12];
6528
+ t132 = $[21];
6533
6529
  }
6534
- let t102;
6535
- if ($[13] !== logo) {
6536
- t102 = /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, style: t92, alt: "Logo" });
6537
- $[13] = logo;
6538
- $[14] = t102;
6530
+ let t142;
6531
+ if ($[22] !== logo) {
6532
+ t142 = /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo, style: t132, alt: "Logo" });
6533
+ $[22] = logo;
6534
+ $[23] = t142;
6539
6535
  } else {
6540
- t102 = $[14];
6536
+ t142 = $[23];
6541
6537
  }
6542
- logoComponent = t102;
6538
+ logoComponent = t142;
6543
6539
  } else {
6544
- let t92;
6545
- if ($[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6546
- t92 = /* @__PURE__ */ jsxRuntime.jsx(RebaseLogo, {});
6547
- $[15] = t92;
6540
+ let t132;
6541
+ if ($[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6542
+ t132 = /* @__PURE__ */ jsxRuntime.jsx(RebaseLogo, {});
6543
+ $[24] = t132;
6548
6544
  } else {
6549
- t92 = $[15];
6545
+ t132 = $[24];
6550
6546
  }
6551
- logoComponent = t92;
6547
+ logoComponent = t132;
6552
6548
  }
6553
6549
  let notAllowedMessage;
6554
6550
  if (notAllowedError) {
@@ -6558,277 +6554,316 @@
6558
6554
  if (notAllowedError instanceof Error) {
6559
6555
  notAllowedMessage = notAllowedError.message;
6560
6556
  } else {
6561
- notAllowedMessage = "It looks like you don't have access, based on the specified Authenticator configuration";
6557
+ notAllowedMessage = "It looks like you don't have access, based on the specified access configuration";
6562
6558
  }
6563
6559
  }
6564
6560
  }
6565
- const t9 = fadeIn ? "opacity-100" : "opacity-0";
6566
- let t10;
6567
- if ($[16] !== t9) {
6568
- t10 = ui.cls("relative flex items-center justify-center h-screen w-screen p-4 transition-opacity duration-500 bg-surface-50 dark:bg-surface-800", t9);
6569
- $[16] = t9;
6570
- $[17] = t10;
6571
- } else {
6572
- t10 = $[17];
6573
- }
6574
- let t11;
6575
- if ($[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6576
- t11 = /* @__PURE__ */ jsxRuntime.jsx(LanguageToggle, {});
6577
- $[18] = t11;
6578
- } else {
6579
- t11 = $[18];
6580
- }
6581
- let t12;
6582
- if ($[19] !== colorMode) {
6583
- t12 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "inherit", "aria-label": "Toggle theme", children: colorMode === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(ui.MoonIcon, { size: ui.iconSize.small }) : /* @__PURE__ */ jsxRuntime.jsx(ui.SunIcon, { size: ui.iconSize.small }) });
6584
- $[19] = colorMode;
6585
- $[20] = t12;
6586
- } else {
6587
- t12 = $[20];
6588
- }
6589
- let t13;
6590
- if ($[21] !== setColorMode) {
6591
- t13 = () => setColorMode("dark");
6592
- $[21] = setColorMode;
6593
- $[22] = t13;
6594
- } else {
6595
- t13 = $[22];
6596
- }
6561
+ const t13 = fadeIn ? "opacity-100" : "opacity-0";
6597
6562
  let t14;
6598
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6599
- t14 = /* @__PURE__ */ jsxRuntime.jsx(ui.MoonIcon, { size: ui.iconSize.smallest });
6600
- $[23] = t14;
6563
+ if ($[25] !== t13) {
6564
+ t14 = ui.cls("relative flex items-center justify-center h-screen w-screen p-4 transition-opacity duration-500 bg-surface-50 dark:bg-surface-950 overflow-hidden", t13);
6565
+ $[25] = t13;
6566
+ $[26] = t14;
6601
6567
  } else {
6602
- t14 = $[23];
6568
+ t14 = $[26];
6603
6569
  }
6604
6570
  let t15;
6605
- if ($[24] !== t) {
6606
- t15 = t("dark_mode");
6607
- $[24] = t;
6608
- $[25] = t15;
6609
- } else {
6610
- t15 = $[25];
6611
- }
6612
6571
  let t16;
6613
- if ($[26] !== t13 || $[27] !== t15) {
6614
- t16 = /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: t13, children: [
6615
- t14,
6616
- " ",
6617
- t15
6618
- ] });
6619
- $[26] = t13;
6572
+ if ($[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6573
+ t15 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-primary-500/10 blur-[120px] pointer-events-none" });
6574
+ t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-indigo-500/10 blur-[120px] pointer-events-none" });
6620
6575
  $[27] = t15;
6621
6576
  $[28] = t16;
6622
6577
  } else {
6578
+ t15 = $[27];
6623
6579
  t16 = $[28];
6624
6580
  }
6625
6581
  let t17;
6626
- if ($[29] !== setColorMode) {
6627
- t17 = () => setColorMode("light");
6628
- $[29] = setColorMode;
6629
- $[30] = t17;
6582
+ if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6583
+ t17 = /* @__PURE__ */ jsxRuntime.jsx(LanguageToggle, {});
6584
+ $[29] = t17;
6630
6585
  } else {
6631
- t17 = $[30];
6586
+ t17 = $[29];
6632
6587
  }
6633
6588
  let t18;
6634
- if ($[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6635
- t18 = /* @__PURE__ */ jsxRuntime.jsx(ui.SunIcon, { size: ui.iconSize.smallest });
6589
+ if ($[30] !== colorMode) {
6590
+ t18 = /* @__PURE__ */ jsxRuntime.jsx(ui.IconButton, { color: "inherit", "aria-label": "Toggle theme", children: colorMode === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(ui.MoonIcon, { size: ui.iconSize.small }) : /* @__PURE__ */ jsxRuntime.jsx(ui.SunIcon, { size: ui.iconSize.small }) });
6591
+ $[30] = colorMode;
6636
6592
  $[31] = t18;
6637
6593
  } else {
6638
6594
  t18 = $[31];
6639
6595
  }
6640
6596
  let t19;
6641
- if ($[32] !== t) {
6642
- t19 = t("light_mode");
6643
- $[32] = t;
6597
+ if ($[32] !== setColorMode) {
6598
+ t19 = () => setColorMode("dark");
6599
+ $[32] = setColorMode;
6644
6600
  $[33] = t19;
6645
6601
  } else {
6646
6602
  t19 = $[33];
6647
6603
  }
6648
6604
  let t20;
6649
- if ($[34] !== t17 || $[35] !== t19) {
6650
- t20 = /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: t17, children: [
6651
- t18,
6652
- " ",
6653
- t19
6654
- ] });
6655
- $[34] = t17;
6656
- $[35] = t19;
6657
- $[36] = t20;
6605
+ if ($[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6606
+ t20 = /* @__PURE__ */ jsxRuntime.jsx(ui.MoonIcon, { size: ui.iconSize.smallest });
6607
+ $[34] = t20;
6658
6608
  } else {
6659
- t20 = $[36];
6609
+ t20 = $[34];
6660
6610
  }
6661
6611
  let t21;
6662
- if ($[37] !== setColorMode) {
6663
- t21 = () => setColorMode("system");
6664
- $[37] = setColorMode;
6665
- $[38] = t21;
6612
+ if ($[35] !== t) {
6613
+ t21 = t("dark_mode");
6614
+ $[35] = t;
6615
+ $[36] = t21;
6666
6616
  } else {
6667
- t21 = $[38];
6617
+ t21 = $[36];
6668
6618
  }
6669
6619
  let t22;
6670
- if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6671
- t22 = /* @__PURE__ */ jsxRuntime.jsx(ui.SunMoonIcon, { size: ui.iconSize.smallest });
6620
+ if ($[37] !== t19 || $[38] !== t21) {
6621
+ t22 = /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: t19, children: [
6622
+ t20,
6623
+ " ",
6624
+ t21
6625
+ ] });
6626
+ $[37] = t19;
6627
+ $[38] = t21;
6672
6628
  $[39] = t22;
6673
6629
  } else {
6674
6630
  t22 = $[39];
6675
6631
  }
6676
6632
  let t23;
6677
- if ($[40] !== t) {
6678
- t23 = t("system_mode");
6679
- $[40] = t;
6633
+ if ($[40] !== setColorMode) {
6634
+ t23 = () => setColorMode("light");
6635
+ $[40] = setColorMode;
6680
6636
  $[41] = t23;
6681
6637
  } else {
6682
6638
  t23 = $[41];
6683
6639
  }
6684
6640
  let t24;
6685
- if ($[42] !== t21 || $[43] !== t23) {
6686
- t24 = /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: t21, children: [
6687
- t22,
6688
- " ",
6689
- t23
6690
- ] });
6691
- $[42] = t21;
6692
- $[43] = t23;
6693
- $[44] = t24;
6641
+ if ($[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6642
+ t24 = /* @__PURE__ */ jsxRuntime.jsx(ui.SunIcon, { size: ui.iconSize.smallest });
6643
+ $[42] = t24;
6694
6644
  } else {
6695
- t24 = $[44];
6645
+ t24 = $[42];
6696
6646
  }
6697
6647
  let t25;
6698
- if ($[45] !== t12 || $[46] !== t16 || $[47] !== t20 || $[48] !== t24) {
6699
- t25 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-4 right-4 flex items-center gap-1 z-10", children: [
6700
- t11,
6701
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: t12, children: [
6702
- t16,
6703
- t20,
6704
- t24
6705
- ] })
6706
- ] });
6707
- $[45] = t12;
6708
- $[46] = t16;
6709
- $[47] = t20;
6710
- $[48] = t24;
6711
- $[49] = t25;
6648
+ if ($[43] !== t) {
6649
+ t25 = t("light_mode");
6650
+ $[43] = t;
6651
+ $[44] = t25;
6712
6652
  } else {
6713
- t25 = $[49];
6653
+ t25 = $[44];
6714
6654
  }
6715
6655
  let t26;
6716
- if ($[50] !== logoComponent) {
6717
- t26 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-32 h-32 m-2 mb-6", children: logoComponent });
6718
- $[50] = logoComponent;
6719
- $[51] = t26;
6656
+ if ($[45] !== t23 || $[46] !== t25) {
6657
+ t26 = /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: t23, children: [
6658
+ t24,
6659
+ " ",
6660
+ t25
6661
+ ] });
6662
+ $[45] = t23;
6663
+ $[46] = t25;
6664
+ $[47] = t26;
6720
6665
  } else {
6721
- t26 = $[51];
6666
+ t26 = $[47];
6722
6667
  }
6723
6668
  let t27;
6724
- if ($[52] !== notAllowedMessage) {
6725
- t27 = notAllowedMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: notAllowedMessage }) });
6726
- $[52] = notAllowedMessage;
6727
- $[53] = t27;
6669
+ if ($[48] !== setColorMode) {
6670
+ t27 = () => setColorMode("system");
6671
+ $[48] = setColorMode;
6672
+ $[49] = t27;
6728
6673
  } else {
6729
- t27 = $[53];
6674
+ t27 = $[49];
6730
6675
  }
6731
6676
  let t28;
6732
- if ($[54] !== buildErrorView || $[55] !== mode) {
6733
- t28 = mode !== "forgot" && buildErrorView();
6734
- $[54] = buildErrorView;
6735
- $[55] = mode;
6736
- $[56] = t28;
6677
+ if ($[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6678
+ t28 = /* @__PURE__ */ jsxRuntime.jsx(ui.SunMoonIcon, { size: ui.iconSize.smallest });
6679
+ $[50] = t28;
6737
6680
  } else {
6738
- t28 = $[56];
6681
+ t28 = $[50];
6682
+ }
6683
+ let t29;
6684
+ if ($[51] !== t) {
6685
+ t29 = t("system_mode");
6686
+ $[51] = t;
6687
+ $[52] = t29;
6688
+ } else {
6689
+ t29 = $[52];
6739
6690
  }
6740
- const t29 = viewVisible ? "opacity-100" : "opacity-0";
6741
6691
  let t30;
6742
- if ($[57] !== t29) {
6743
- t30 = ui.cls("w-full transition-opacity duration-150", t29);
6744
- $[57] = t29;
6745
- $[58] = t30;
6692
+ if ($[53] !== t27 || $[54] !== t29) {
6693
+ t30 = /* @__PURE__ */ jsxRuntime.jsxs(ui.MenuItem, { onClick: t27, children: [
6694
+ t28,
6695
+ " ",
6696
+ t29
6697
+ ] });
6698
+ $[53] = t27;
6699
+ $[54] = t29;
6700
+ $[55] = t30;
6746
6701
  } else {
6747
- t30 = $[58];
6702
+ t30 = $[55];
6748
6703
  }
6749
6704
  let t31;
6750
- if ($[59] !== authController || $[60] !== isBootstrapMode || $[61] !== noUserComponent) {
6751
- t31 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true });
6752
- $[59] = authController;
6753
- $[60] = isBootstrapMode;
6754
- $[61] = noUserComponent;
6755
- $[62] = t31;
6705
+ if ($[56] !== t18 || $[57] !== t22 || $[58] !== t26 || $[59] !== t30) {
6706
+ t31 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-4 right-4 flex items-center gap-1 z-10", children: [
6707
+ t17,
6708
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Menu, { trigger: t18, children: [
6709
+ t22,
6710
+ t26,
6711
+ t30
6712
+ ] })
6713
+ ] });
6714
+ $[56] = t18;
6715
+ $[57] = t22;
6716
+ $[58] = t26;
6717
+ $[59] = t30;
6718
+ $[60] = t31;
6756
6719
  } else {
6757
- t31 = $[62];
6720
+ t31 = $[60];
6758
6721
  }
6759
6722
  let t32;
6760
- if ($[63] !== authController || $[64] !== disableSignupScreen || $[65] !== disabled || $[66] !== googleClientId || $[67] !== hasGoogleLogin || $[68] !== hasPasswordReset || $[69] !== isBootstrapMode || $[70] !== mode || $[71] !== noUserComponent || $[72] !== showRegistration) {
6761
- t32 = !isBootstrapMode && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6723
+ if ($[61] !== logoComponent) {
6724
+ t32 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 m-2 mb-4 drop-shadow-md", children: logoComponent });
6725
+ $[61] = logoComponent;
6726
+ $[62] = t32;
6727
+ } else {
6728
+ t32 = $[62];
6729
+ }
6730
+ let t33;
6731
+ if ($[63] !== notAllowedMessage) {
6732
+ t33 = notAllowedMessage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { error: notAllowedMessage }) });
6733
+ $[63] = notAllowedMessage;
6734
+ $[64] = t33;
6735
+ } else {
6736
+ t33 = $[64];
6737
+ }
6738
+ let t34;
6739
+ if ($[65] !== buildErrorView || $[66] !== mode) {
6740
+ t34 = mode !== "forgot" && buildErrorView();
6741
+ $[65] = buildErrorView;
6742
+ $[66] = mode;
6743
+ $[67] = t34;
6744
+ } else {
6745
+ t34 = $[67];
6746
+ }
6747
+ const t35 = viewVisible ? "opacity-100" : "opacity-0";
6748
+ let t36;
6749
+ if ($[68] !== t35) {
6750
+ t36 = ui.cls("w-full transition-opacity duration-150", t35);
6751
+ $[68] = t35;
6752
+ $[69] = t36;
6753
+ } else {
6754
+ t36 = $[69];
6755
+ }
6756
+ let t37;
6757
+ if ($[70] !== authController || $[71] !== defaultEmail || $[72] !== defaultPassword || $[73] !== isBootstrapMode || $[74] !== noUserComponent) {
6758
+ t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true, defaultEmail, defaultPassword });
6759
+ $[70] = authController;
6760
+ $[71] = defaultEmail;
6761
+ $[72] = defaultPassword;
6762
+ $[73] = isBootstrapMode;
6763
+ $[74] = noUserComponent;
6764
+ $[75] = t37;
6765
+ } else {
6766
+ t37 = $[75];
6767
+ }
6768
+ let t38;
6769
+ if ($[76] !== authController || $[77] !== defaultEmail || $[78] !== defaultPassword || $[79] !== disableSignupScreen || $[80] !== disabled || $[81] !== githubClientId || $[82] !== googleClientId || $[83] !== hasGitHubLogin || $[84] !== hasGoogleLogin || $[85] !== hasLinkedinLogin || $[86] !== hasPasswordReset || $[87] !== isBootstrapMode || $[88] !== linkedinClientId || $[89] !== mode || $[90] !== noUserComponent || $[91] !== showRegistration || $[92] !== subtitle || $[93] !== title) {
6770
+ t38 = !isBootstrapMode && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6762
6771
  mode === "buttons" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full flex flex-col gap-3 mt-2", children: [
6772
+ (title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-2", children: [
6773
+ title && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "h6", className: "mb-0.5 font-bold", children: title }),
6774
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(ui.Typography, { variant: "body2", color: "secondary", className: "mb-4", children: subtitle })
6775
+ ] }),
6763
6776
  /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Sign in with email", icon: /* @__PURE__ */ jsxRuntime.jsx(ui.MailIcon, {}), onClick: () => switchMode("login") }),
6764
6777
  hasGoogleLogin && googleClientId && /* @__PURE__ */ jsxRuntime.jsx(GoogleLoginButton, { disabled, googleClientId, authController }),
6778
+ hasGitHubLogin && githubClientId && /* @__PURE__ */ jsxRuntime.jsx(GitHubLoginButton, { disabled, githubClientId }),
6779
+ hasLinkedinLogin && linkedinClientId && /* @__PURE__ */ jsxRuntime.jsx(LinkedInLoginButton, { disabled, linkedinClientId }),
6765
6780
  showRegistration && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Typography, { variant: "body2", color: "secondary", children: [
6766
6781
  "Don't have an account?",
6767
6782
  " ",
6768
6783
  /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "font-semibold hover:underline cursor-pointer text-primary-600 dark:text-primary-400", onClick: () => switchMode("register"), children: "Create one" })
6769
6784
  ] }) })
6770
6785
  ] }),
6771
- mode === "login" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0 }),
6772
- mode === "register" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login") }),
6786
+ mode === "login" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0, defaultEmail, defaultPassword }),
6787
+ mode === "register" && /* @__PURE__ */ jsxRuntime.jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login"), defaultEmail, defaultPassword }),
6773
6788
  mode === "forgot" && authController.forgotPassword && /* @__PURE__ */ jsxRuntime.jsx(ForgotPasswordForm, { authController, onClose: () => switchMode("login") })
6774
6789
  ] });
6775
- $[63] = authController;
6776
- $[64] = disableSignupScreen;
6777
- $[65] = disabled;
6778
- $[66] = googleClientId;
6779
- $[67] = hasGoogleLogin;
6780
- $[68] = hasPasswordReset;
6781
- $[69] = isBootstrapMode;
6782
- $[70] = mode;
6783
- $[71] = noUserComponent;
6784
- $[72] = showRegistration;
6785
- $[73] = t32;
6786
- } else {
6787
- t32 = $[73];
6790
+ $[76] = authController;
6791
+ $[77] = defaultEmail;
6792
+ $[78] = defaultPassword;
6793
+ $[79] = disableSignupScreen;
6794
+ $[80] = disabled;
6795
+ $[81] = githubClientId;
6796
+ $[82] = googleClientId;
6797
+ $[83] = hasGitHubLogin;
6798
+ $[84] = hasGoogleLogin;
6799
+ $[85] = hasLinkedinLogin;
6800
+ $[86] = hasPasswordReset;
6801
+ $[87] = isBootstrapMode;
6802
+ $[88] = linkedinClientId;
6803
+ $[89] = mode;
6804
+ $[90] = noUserComponent;
6805
+ $[91] = showRegistration;
6806
+ $[92] = subtitle;
6807
+ $[93] = title;
6808
+ $[94] = t38;
6809
+ } else {
6810
+ t38 = $[94];
6788
6811
  }
6789
- let t33;
6790
- if ($[74] !== t30 || $[75] !== t31 || $[76] !== t32) {
6791
- t33 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t30, children: [
6792
- t31,
6793
- t32
6812
+ let t39;
6813
+ if ($[95] !== t36 || $[96] !== t37 || $[97] !== t38) {
6814
+ t39 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t36, children: [
6815
+ t37,
6816
+ t38
6794
6817
  ] });
6795
- $[74] = t30;
6796
- $[75] = t31;
6797
- $[76] = t32;
6798
- $[77] = t33;
6818
+ $[95] = t36;
6819
+ $[96] = t37;
6820
+ $[97] = t38;
6821
+ $[98] = t39;
6799
6822
  } else {
6800
- t33 = $[77];
6823
+ t39 = $[98];
6801
6824
  }
6802
- let t34;
6803
- if ($[78] !== t26 || $[79] !== t27 || $[80] !== t28 || $[81] !== t33) {
6804
- t34 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center w-[480px] max-w-full p-8 sm:p-10", children: [
6805
- t26,
6806
- t27,
6807
- t28,
6808
- t33
6825
+ let t40;
6826
+ if ($[99] !== additionalComponent) {
6827
+ t40 = additionalComponent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: additionalComponent });
6828
+ $[99] = additionalComponent;
6829
+ $[100] = t40;
6830
+ } else {
6831
+ t40 = $[100];
6832
+ }
6833
+ let t41;
6834
+ if ($[101] !== t32 || $[102] !== t33 || $[103] !== t34 || $[104] !== t39 || $[105] !== t40) {
6835
+ t41 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col items-center w-[440px] max-w-full p-8 sm:p-10 bg-white/70 dark:bg-surface-900/60 backdrop-blur-xl border border-surface-200/50 dark:border-surface-800/50 rounded-2xl shadow-2xl z-10 transition-all duration-300 hover:shadow-primary-500/5", children: [
6836
+ t32,
6837
+ t33,
6838
+ t34,
6839
+ t39,
6840
+ t40
6809
6841
  ] });
6810
- $[78] = t26;
6811
- $[79] = t27;
6812
- $[80] = t28;
6813
- $[81] = t33;
6814
- $[82] = t34;
6842
+ $[101] = t32;
6843
+ $[102] = t33;
6844
+ $[103] = t34;
6845
+ $[104] = t39;
6846
+ $[105] = t40;
6847
+ $[106] = t41;
6815
6848
  } else {
6816
- t34 = $[82];
6849
+ t41 = $[106];
6817
6850
  }
6818
- let t35;
6819
- if ($[83] !== t10 || $[84] !== t25 || $[85] !== t34) {
6820
- t35 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t10, children: [
6821
- t25,
6822
- t34
6851
+ let t42;
6852
+ if ($[107] !== t14 || $[108] !== t31 || $[109] !== t41) {
6853
+ t42 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t14, children: [
6854
+ t15,
6855
+ t16,
6856
+ t31,
6857
+ t41
6823
6858
  ] });
6824
- $[83] = t10;
6825
- $[84] = t25;
6826
- $[85] = t34;
6827
- $[86] = t35;
6859
+ $[107] = t14;
6860
+ $[108] = t31;
6861
+ $[109] = t41;
6862
+ $[110] = t42;
6828
6863
  } else {
6829
- t35 = $[86];
6864
+ t42 = $[110];
6830
6865
  }
6831
- return t35;
6866
+ return t42;
6832
6867
  }
6833
6868
  function _temp2() {
6834
6869
  }
@@ -6872,7 +6907,7 @@
6872
6907
  }
6873
6908
  let t4;
6874
6909
  if ($[7] !== disabled || $[8] !== onClick || $[9] !== t3) {
6875
- t4 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { disabled, className: "w-full", variant: "outlined", size: "large", onClick, children: t3 });
6910
+ t4 = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { disabled, className: "w-full transition-transform duration-200 active:scale-[0.98]", variant: "outlined", size: "large", onClick, children: t3 });
6876
6911
  $[7] = disabled;
6877
6912
  $[8] = onClick;
6878
6913
  $[9] = t3;
@@ -6984,6 +7019,102 @@
6984
7019
  }
6985
7020
  return t5;
6986
7021
  }
7022
+ const GitHubIcon = () => {
7023
+ const $ = reactCompilerRuntime.c(1);
7024
+ let t0;
7025
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7026
+ t0 = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.579.688.481C19.137 20.162 22 16.418 22 12c0-5.523-4.477-10-10-10z" }) });
7027
+ $[0] = t0;
7028
+ } else {
7029
+ t0 = $[0];
7030
+ }
7031
+ return t0;
7032
+ };
7033
+ function GitHubLoginButton(t0) {
7034
+ const $ = reactCompilerRuntime.c(6);
7035
+ const {
7036
+ disabled,
7037
+ githubClientId
7038
+ } = t0;
7039
+ let t1;
7040
+ if ($[0] !== githubClientId) {
7041
+ t1 = () => {
7042
+ localStorage.setItem("rebase_oauth_provider", "github");
7043
+ const redirectUri = encodeURIComponent(window.location.origin + window.location.pathname);
7044
+ window.location.href = `https://github.com/login/oauth/authorize?client_id=${githubClientId}&redirect_uri=${redirectUri}&scope=${"read:user,user:email"}`;
7045
+ };
7046
+ $[0] = githubClientId;
7047
+ $[1] = t1;
7048
+ } else {
7049
+ t1 = $[1];
7050
+ }
7051
+ const handleClick = t1;
7052
+ let t2;
7053
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7054
+ t2 = /* @__PURE__ */ jsxRuntime.jsx(GitHubIcon, {});
7055
+ $[2] = t2;
7056
+ } else {
7057
+ t2 = $[2];
7058
+ }
7059
+ let t3;
7060
+ if ($[3] !== disabled || $[4] !== handleClick) {
7061
+ t3 = /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Sign in with GitHub", icon: t2, onClick: handleClick });
7062
+ $[3] = disabled;
7063
+ $[4] = handleClick;
7064
+ $[5] = t3;
7065
+ } else {
7066
+ t3 = $[5];
7067
+ }
7068
+ return t3;
7069
+ }
7070
+ const LinkedInIcon = () => {
7071
+ const $ = reactCompilerRuntime.c(1);
7072
+ let t0;
7073
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7074
+ t0 = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z" }) });
7075
+ $[0] = t0;
7076
+ } else {
7077
+ t0 = $[0];
7078
+ }
7079
+ return t0;
7080
+ };
7081
+ function LinkedInLoginButton(t0) {
7082
+ const $ = reactCompilerRuntime.c(6);
7083
+ const {
7084
+ disabled,
7085
+ linkedinClientId
7086
+ } = t0;
7087
+ let t1;
7088
+ if ($[0] !== linkedinClientId) {
7089
+ t1 = () => {
7090
+ localStorage.setItem("rebase_oauth_provider", "linkedin");
7091
+ const redirectUri = encodeURIComponent(window.location.origin + window.location.pathname);
7092
+ window.location.href = `https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=${linkedinClientId}&redirect_uri=${redirectUri}&scope=${"openid profile email"}`;
7093
+ };
7094
+ $[0] = linkedinClientId;
7095
+ $[1] = t1;
7096
+ } else {
7097
+ t1 = $[1];
7098
+ }
7099
+ const handleClick = t1;
7100
+ let t2;
7101
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7102
+ t2 = /* @__PURE__ */ jsxRuntime.jsx(LinkedInIcon, {});
7103
+ $[2] = t2;
7104
+ } else {
7105
+ t2 = $[2];
7106
+ }
7107
+ let t3;
7108
+ if ($[3] !== disabled || $[4] !== handleClick) {
7109
+ t3 = /* @__PURE__ */ jsxRuntime.jsx(LoginButton, { disabled, text: "Sign in with LinkedIn", icon: t2, onClick: handleClick });
7110
+ $[3] = disabled;
7111
+ $[4] = handleClick;
7112
+ $[5] = t3;
7113
+ } else {
7114
+ t3 = $[5];
7115
+ }
7116
+ return t3;
7117
+ }
6987
7118
  function LoginForm(t0) {
6988
7119
  const $ = reactCompilerRuntime.c(67);
6989
7120
  const {
@@ -6994,12 +7125,14 @@
6994
7125
  noUserComponent,
6995
7126
  bootstrapMode: t1,
6996
7127
  switchToRegister,
6997
- switchToLogin
7128
+ switchToLogin,
7129
+ defaultEmail,
7130
+ defaultPassword
6998
7131
  } = t0;
6999
7132
  const bootstrapMode = t1 === void 0 ? false : t1;
7000
7133
  const passwordRef = React.useRef(null);
7001
- const [email, setEmail] = React.useState();
7002
- const [password, setPassword] = React.useState();
7134
+ const [email, setEmail] = React.useState(defaultEmail);
7135
+ const [password, setPassword] = React.useState(defaultPassword);
7003
7136
  const [displayName, setDisplayName] = React.useState();
7004
7137
  let t2;
7005
7138
  let t3;
@@ -7541,14 +7674,18 @@
7541
7674
  if (!userManagement || !loggedInUser) {
7542
7675
  return null;
7543
7676
  }
7677
+ const loggedInUserRoles = loggedInUser.roles ?? [];
7678
+ const isLoggedInUserAdmin = loggedInUserRoles.length === 0 || loggedInUserRoles.some((r) => r === "admin");
7679
+ if (!isLoggedInUserAdmin) {
7680
+ return null;
7681
+ }
7544
7682
  const {
7545
- users,
7683
+ hasAdminUsers,
7546
7684
  loading: delegateLoading,
7547
7685
  bootstrapAdmin,
7548
7686
  usersError
7549
7687
  } = userManagement;
7550
- const hasAdmin = users.some((u) => u.roles?.includes("admin"));
7551
- if (delegateLoading || hasAdmin || usersError || !bootstrapAdmin) {
7688
+ if (delegateLoading || hasAdminUsers || usersError || !bootstrapAdmin) {
7552
7689
  return null;
7553
7690
  }
7554
7691
  const handleBootstrap = async () => {
@@ -7722,6 +7859,9 @@
7722
7859
  navigation_drawer: "Navigation drawer",
7723
7860
  collapse: "Collapse",
7724
7861
  expand: "Expand",
7862
+ change_language: "Change language",
7863
+ toggle_theme: "Toggle theme",
7864
+ user_menu: "User menu",
7725
7865
  // ─── Error states ─────────────────────────────────────────────
7726
7866
  error: "Error",
7727
7867
  error_uploading_file: "Error uploading file",
@@ -7983,7 +8123,17 @@
7983
8123
  select_references: "Select references",
7984
8124
  account_settings: "Account Settings",
7985
8125
  profile: "Profile",
8126
+ security: "Security",
7986
8127
  sessions: "Sessions",
8128
+ change_password: "Change Password",
8129
+ current_password: "Current Password",
8130
+ new_password: "New Password",
8131
+ confirm_password: "Confirm New Password",
8132
+ password_changed: "Password changed successfully. You will be logged out.",
8133
+ passwords_dont_match: "Passwords don't match",
8134
+ password_too_short: "Password must be at least 8 characters",
8135
+ password_change_not_available: "Password change is not available for accounts using external sign-in providers.",
8136
+ changing_password: "Changing...",
7987
8137
  display_name: "Display Name",
7988
8138
  photo_url: "Photo URL",
7989
8139
  save_profile: "Save Profile",
@@ -9050,7 +9200,17 @@
9050
9200
  select_references: "Select references",
9051
9201
  account_settings: "Account Settings",
9052
9202
  profile: "Profile",
9053
- sessions: "Sessions",
9203
+ sessions: "Sesiones",
9204
+ security: "Seguridad",
9205
+ change_password: "Cambiar Contraseña",
9206
+ current_password: "Contraseña Actual",
9207
+ new_password: "Nueva Contraseña",
9208
+ confirm_password: "Confirmar Nueva Contraseña",
9209
+ password_changed: "Contraseña cambiada con éxito. Se cerrará tu sesión.",
9210
+ passwords_dont_match: "Las contraseñas no coinciden",
9211
+ password_too_short: "La contraseña debe tener al menos 8 caracteres",
9212
+ password_change_not_available: "El cambio de contraseña no está disponible para cuentas que usan proveedores de inicio de sesión externos.",
9213
+ changing_password: "Cambiando...",
9054
9214
  display_name: "Display Name",
9055
9215
  photo_url: "Photo URL",
9056
9216
  save_profile: "Save Profile",
@@ -13666,7 +13826,8 @@
13666
13826
  apiKey,
13667
13827
  userManagement: _userManagement,
13668
13828
  effectiveRoleController,
13669
- apiUrl
13829
+ apiUrl,
13830
+ translations
13670
13831
  } = props;
13671
13832
  const plugins = pluginsProp;
13672
13833
  if (plugins) {
@@ -13741,7 +13902,7 @@
13741
13902
  if (authController.authError) {
13742
13903
  return /* @__PURE__ */ jsxRuntime.jsx(ui.CenteredView, { maxWidth: "md", children: /* @__PURE__ */ jsxRuntime.jsx(ErrorView, { title: "Error loading auth", error: authController.authError }) });
13743
13904
  }
13744
- const content = /* @__PURE__ */ jsxRuntime.jsx(RebaseI18nProvider, { locale, children: /* @__PURE__ */ jsxRuntime.jsx(SnackbarProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(ModeControllerProvider, { value: modeController, children: /* @__PURE__ */ jsxRuntime.jsx(AdminModeControllerProvider, { value: adminModeController, children: /* @__PURE__ */ jsxRuntime.jsx(RebaseClientInstanceContext.Provider, { value: client, children: /* @__PURE__ */ jsxRuntime.jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsxRuntime.jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsxRuntime.jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsxRuntime.jsx(StorageSourceContext.Provider, { value: resolvedStorage, children: /* @__PURE__ */ jsxRuntime.jsx(RebaseDataContext.Provider, { value: resolvedData, children: /* @__PURE__ */ jsxRuntime.jsx(DatabaseAdminContext.Provider, { value: resolvedDatabaseAdmin, children: /* @__PURE__ */ jsxRuntime.jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsxRuntime.jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsxRuntime.jsx(EffectiveRoleControllerContext.Provider, { value: activeEffectiveRoleController, children: /* @__PURE__ */ jsxRuntime.jsx(DialogsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(RebaseInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
13905
+ const content = /* @__PURE__ */ jsxRuntime.jsx(RebaseI18nProvider, { locale, translations, children: /* @__PURE__ */ jsxRuntime.jsx(SnackbarProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(ModeControllerProvider, { value: modeController, children: /* @__PURE__ */ jsxRuntime.jsx(AdminModeControllerProvider, { value: adminModeController, children: /* @__PURE__ */ jsxRuntime.jsx(RebaseClientInstanceContext.Provider, { value: client, children: /* @__PURE__ */ jsxRuntime.jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsxRuntime.jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsxRuntime.jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsxRuntime.jsx(StorageSourceContext.Provider, { value: resolvedStorage, children: /* @__PURE__ */ jsxRuntime.jsx(RebaseDataContext.Provider, { value: resolvedData, children: /* @__PURE__ */ jsxRuntime.jsx(DatabaseAdminContext.Provider, { value: resolvedDatabaseAdmin, children: /* @__PURE__ */ jsxRuntime.jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsxRuntime.jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsxRuntime.jsx(EffectiveRoleControllerContext.Provider, { value: activeEffectiveRoleController, children: /* @__PURE__ */ jsxRuntime.jsx(DialogsProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(RebaseInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
13745
13906
  const resolvedApiUrl = apiUrl ?? client?.baseUrl;
13746
13907
  if (resolvedApiUrl) {
13747
13908
  return /* @__PURE__ */ jsxRuntime.jsx(ApiConfigProvider, { apiUrl: resolvedApiUrl, getAuthToken: authController.getAuthToken, children: content });
@@ -14183,9 +14344,6 @@
14183
14344
  function getEntityFromMemoryCache(path) {
14184
14345
  return entityCache.get(path);
14185
14346
  }
14186
- function hasEntityInCache(path) {
14187
- return entityCache.has(path);
14188
- }
14189
14347
  function getEntityFromCache(path) {
14190
14348
  if (isSessionStorageAvailable) {
14191
14349
  try {
@@ -14213,23 +14371,6 @@
14213
14371
  }
14214
14372
  }
14215
14373
  }
14216
- function clearEntityCache() {
14217
- entityCache.clear();
14218
- if (isSessionStorageAvailable) {
14219
- try {
14220
- const keysToRemove = [];
14221
- for (let i = 0; i < sessionStorage.length; i++) {
14222
- const fullKey = sessionStorage.key(i);
14223
- if (fullKey && fullKey.startsWith(LOCAL_STORAGE_PREFIX)) {
14224
- keysToRemove.push(fullKey);
14225
- }
14226
- }
14227
- keysToRemove.forEach((key) => sessionStorage.removeItem(key));
14228
- } catch (error) {
14229
- console.error("Failed to clear entity cache from sessionStorage:", error);
14230
- }
14231
- }
14232
- }
14233
14374
  function flattenKeys(obj, prefix = "", result = []) {
14234
14375
  if (utils.isObject(obj) || Array.isArray(obj)) {
14235
14376
  const plainObject = utils.isPlainObject(obj);
@@ -14468,37 +14609,6 @@
14468
14609
  });
14469
14610
  });
14470
14611
  }
14471
- function printChanged(props, prev, path = "", depth = 0, maxDepth = 10) {
14472
- if (depth > maxDepth) {
14473
- return;
14474
- }
14475
- if (props && prev && typeof props === "object" && typeof prev === "object") {
14476
- Object.keys(props).forEach((key) => {
14477
- printChanged(props[key], prev[key], path + "." + key, depth + 1, maxDepth);
14478
- });
14479
- } else if (props !== prev) {
14480
- console.log("Changed props:", path);
14481
- }
14482
- }
14483
- function useTraceUpdate(props, t0) {
14484
- const $ = reactCompilerRuntime.c(3);
14485
- const maxDepth = t0 === void 0 ? 3 : t0;
14486
- const prev = React.useRef(props);
14487
- let t1;
14488
- if ($[0] !== maxDepth || $[1] !== props) {
14489
- t1 = () => {
14490
- console.log("Changed props:");
14491
- printChanged(props, prev.current, "", 0, maxDepth);
14492
- prev.current = props;
14493
- };
14494
- $[0] = maxDepth;
14495
- $[1] = props;
14496
- $[2] = t1;
14497
- } else {
14498
- t1 = $[2];
14499
- }
14500
- React.useEffect(t1);
14501
- }
14502
14612
  function isReferenceProperty(property) {
14503
14613
  if (!property) return null;
14504
14614
  if (property.type === "reference") return true;
@@ -14517,6 +14627,10 @@
14517
14627
  }
14518
14628
  return false;
14519
14629
  }
14630
+ function isHiddenProperty(property) {
14631
+ if (!property) return false;
14632
+ return Boolean(property.ui?.hideFromCollection);
14633
+ }
14520
14634
  function getEntityPreviewKeys(authController, targetCollection, fields, previewProperties, limit = 3) {
14521
14635
  const allProperties = Object.keys(targetCollection.properties);
14522
14636
  let listProperties = previewProperties?.filter((p) => allProperties.includes(p));
@@ -14533,7 +14647,7 @@
14533
14647
  return !isIdProp && key !== "id";
14534
14648
  }).filter((key) => {
14535
14649
  const property = targetCollection.properties[key];
14536
- return property && !common.isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property);
14650
+ return property && !common.isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property) && !isHiddenProperty(property);
14537
14651
  }).slice(0, limit);
14538
14652
  }
14539
14653
  }
@@ -14547,6 +14661,9 @@
14547
14661
  const property = collection.properties[key];
14548
14662
  if (property && !common.isPropertyBuilder(property)) {
14549
14663
  const prop = property;
14664
+ if (isHiddenProperty(prop)) {
14665
+ continue;
14666
+ }
14550
14667
  if (prop.type === "string" && !prop.ui?.multiline && !prop.ui?.markdown && !prop.storage && !prop.isId) {
14551
14668
  if (!firstStringCandidate) {
14552
14669
  firstStringCandidate = key;
@@ -14944,7 +15061,6 @@
14944
15061
  exports2.UserSettingsView = UserSettingsView;
14945
15062
  exports2.buildCollapsedDefaults = buildCollapsedDefaults;
14946
15063
  exports2.buildEnumLabel = buildEnumLabel;
14947
- exports2.clearEntityCache = clearEntityCache;
14948
15064
  exports2.clearEntityFetchCache = clearEntityFetchCache;
14949
15065
  exports2.createFormexStub = createFormexStub;
14950
15066
  exports2.deleteEntityWithCallbacks = deleteEntityWithCallbacks;
@@ -14961,12 +15077,9 @@
14961
15077
  exports2.getIcon = getIcon;
14962
15078
  exports2.getRowHeight = getRowHeight;
14963
15079
  exports2.getSubcollectionColumnId = getSubcollectionColumnId;
14964
- exports2.hasEntityInCache = hasEntityInCache;
14965
- exports2.iconSynonyms = iconSynonyms;
14966
15080
  exports2.iconsSearch = iconsSearch;
14967
15081
  exports2.isEnumValueDisabled = isEnumValueDisabled;
14968
15082
  exports2.populateEntityFetchCache = populateEntityFetchCache;
14969
- exports2.printChanged = printChanged;
14970
15083
  exports2.removeEntityFromCache = removeEntityFromCache;
14971
15084
  exports2.removeEntityFromMemoryCache = removeEntityFromMemoryCache;
14972
15085
  exports2.resolveComponentRef = resolveComponentRef;
@@ -15017,12 +15130,10 @@
15017
15130
  exports2.useStudioNavigationState = useStudioNavigationState;
15018
15131
  exports2.useStudioSideEntityController = useStudioSideEntityController;
15019
15132
  exports2.useStudioUrlController = useStudioUrlController;
15020
- exports2.useTraceUpdate = useTraceUpdate;
15021
15133
  exports2.useTranslation = useTranslation;
15022
15134
  exports2.useUnsavedChangesDialog = useUnsavedChangesDialog;
15023
15135
  exports2.useUserConfigurationPersistence = useUserConfigurationPersistence;
15024
15136
  exports2.useUserSelector = useUserSelector;
15025
- exports2.useValidateAuthenticator = useValidateAuthenticator;
15026
15137
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
15027
15138
  }));
15028
15139
  //# sourceMappingURL=index.umd.js.map