@absolutejs/absolute 0.6.1 → 0.6.2

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.
@@ -32524,6 +32524,7 @@ function becomeIdle(self) {
32524
32524
  });
32525
32525
  }
32526
32526
  }
32527
+ var to2 = (source, ...args) => new Interpolation(source, args);
32527
32528
  globals_exports.assign({
32528
32529
  createStringInterpolator: createStringInterpolator2,
32529
32530
  to: (source, args) => new Interpolation(source, args)
@@ -35140,7 +35141,7 @@ function useQuery(options, queryClient) {
35140
35141
  }
35141
35142
 
35142
35143
  // src/frontend/components/navbar/Navbar.tsx
35143
- var import_react28 = __toESM(require_react(), 1);
35144
+ var import_react26 = __toESM(require_react(), 1);
35144
35145
 
35145
35146
  // node_modules/react-icons/lib/iconBase.mjs
35146
35147
  var import_react16 = __toESM(require_react(), 1);
@@ -35462,7 +35463,7 @@ var profileButtonStyle = {
35462
35463
  };
35463
35464
 
35464
35465
  // src/frontend/components/hamburger/HamburgerMenu.tsx
35465
- var import_react22 = __toESM(require_react(), 1);
35466
+ var import_react21 = __toESM(require_react(), 1);
35466
35467
 
35467
35468
  // src/types/types.ts
35468
35469
  var isNavbarDropdown = (element) => ("links" in element);
@@ -38366,6 +38367,17 @@ var useContainerQuery = () => {
38366
38367
  return { dimensions, ref };
38367
38368
  };
38368
38369
 
38370
+ // node_modules/react-icons/ai/index.mjs
38371
+ function AiOutlineExperiment(props) {
38372
+ return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M512 472a40 40 0 1 0 80 0 40 40 0 1 0-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 0 1-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z" }, child: [] }] })(props);
38373
+ }
38374
+ function AiOutlineMinusCircle(props) {
38375
+ return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" }, child: [] }, { tag: "path", attr: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, child: [] }] })(props);
38376
+ }
38377
+ function AiOutlineMoon(props) {
38378
+ return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024", fill: "currentColor", fillRule: "evenodd" }, child: [{ tag: "path", attr: { d: "M489.493 111.658c30.658-1.792 45.991 36.44 22.59 56.329C457.831 214.095 426 281.423 426 354c0 134.757 109.243 244 244 244 72.577 0 139.905-31.832 186.014-86.084 19.868-23.377 58.064-8.102 56.332 22.53C900.4 745.823 725.141 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.287-386.024 374.198-399.649l.206-.013zm-81.143 79.75-4.112 1.362C271.1 237.943 176 364.092 176 511.5 176 697.344 326.656 848 512.5 848c148.28 0 274.938-96.192 319.453-230.41l.625-1.934-.11.071c-47.18 29.331-102.126 45.755-159.723 46.26L670 662c-170.104 0-308-137.896-308-308 0-58.595 16.476-114.54 46.273-162.467z" }, child: [] }] })(props);
38379
+ }
38380
+
38369
38381
  // node_modules/react-icons/fa/index.mjs
38370
38382
  function FaCheckCircle(props) {
38371
38383
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z" }, child: [] }] })(props);
@@ -38380,11 +38392,39 @@ function FaRegQuestionCircle(props) {
38380
38392
  return GenIcon({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200 110.491 0 200 89.471 200 200 0 110.53-89.431 200-200 200zm107.244-255.2c0 67.052-72.421 68.084-72.421 92.863V300c0 6.627-5.373 12-12 12h-45.647c-6.627 0-12-5.373-12-12v-8.659c0-35.745 27.1-50.034 47.579-61.516 17.561-9.845 28.324-16.541 28.324-29.579 0-17.246-21.999-28.693-39.784-28.693-23.189 0-33.894 10.977-48.942 29.969-4.057 5.12-11.46 6.071-16.666 2.124l-27.824-21.098c-5.107-3.872-6.251-11.066-2.644-16.363C184.846 131.491 214.94 112 261.794 112c49.071 0 101.45 38.304 101.45 88.8zM298 368c0 23.159-18.841 42-42 42s-42-18.841-42-42 18.841-42 42-42 42 18.841 42 42z" }, child: [] }] })(props);
38381
38393
  }
38382
38394
 
38395
+ // node_modules/react-icons/io5/index.mjs
38396
+ function IoSunny(props) {
38397
+ return GenIcon({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 118a22 22 0 0 1-22-22V48a22 22 0 0 1 44 0v48a22 22 0 0 1-22 22zm0 368a22 22 0 0 1-22-22v-48a22 22 0 0 1 44 0v48a22 22 0 0 1-22 22zm113.14-321.14a22 22 0 0 1-15.56-37.55l33.94-33.94a22 22 0 0 1 31.11 31.11l-33.94 33.94a21.93 21.93 0 0 1-15.55 6.44zM108.92 425.08a22 22 0 0 1-15.55-37.56l33.94-33.94a22 22 0 1 1 31.11 31.11l-33.94 33.94a21.94 21.94 0 0 1-15.56 6.45zM464 278h-48a22 22 0 0 1 0-44h48a22 22 0 0 1 0 44zm-368 0H48a22 22 0 0 1 0-44h48a22 22 0 0 1 0 44zm307.08 147.08a21.94 21.94 0 0 1-15.56-6.45l-33.94-33.94a22 22 0 0 1 31.11-31.11l33.94 33.94a22 22 0 0 1-15.55 37.56zM142.86 164.86a21.89 21.89 0 0 1-15.55-6.44l-33.94-33.94a22 22 0 0 1 31.11-31.11l33.94 33.94a22 22 0 0 1-15.56 37.55zM256 358a102 102 0 1 1 102-102 102.12 102.12 0 0 1-102 102z" }, child: [] }] })(props);
38398
+ }
38399
+
38400
+ // src/frontend/components/utils/ProfilePicture.tsx
38401
+ var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
38402
+ var ProfilePicture = ({
38403
+ userImage,
38404
+ backupImage,
38405
+ width = "2rem",
38406
+ height = "2rem",
38407
+ themeSprings
38408
+ }) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(animated.img, {
38409
+ src: userImage ?? backupImage,
38410
+ alt: "Profile",
38411
+ style: {
38412
+ backgroundColor: themeSprings.themeTertiary,
38413
+ borderRadius: "50%",
38414
+ height,
38415
+ objectFit: "cover",
38416
+ width
38417
+ }
38418
+ }, undefined, false, undefined, this);
38419
+
38383
38420
  // src/frontend/components/utils/AnimatedComponents.tsx
38384
38421
  var AnimatedFaChevronDown = animated(FaChevronDown);
38422
+ var AnimatedProfilePicture = animated(ProfilePicture);
38423
+ var AnimatedMoon = animated(AiOutlineMoon);
38424
+ var AnimatedSun = animated(IoSunny);
38385
38425
 
38386
38426
  // src/frontend/components/hamburger/HamburgerDropdown.tsx
38387
- var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
38427
+ var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
38388
38428
  var HamburgerDropdown = ({
38389
38429
  label,
38390
38430
  icon,
@@ -38412,27 +38452,27 @@ var HamburgerDropdown = ({
38412
38452
  transform: isOpen ? "rotate(180deg)" : "rotate(0deg)"
38413
38453
  });
38414
38454
  };
38415
- return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("div", {
38455
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("div", {
38416
38456
  style: { width: "100%" },
38417
38457
  children: [
38418
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("div", {
38458
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("div", {
38419
38459
  style: {
38420
38460
  alignItems: "center",
38421
38461
  display: "flex",
38422
38462
  justifyContent: "space-between"
38423
38463
  },
38424
38464
  children: [
38425
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(animated.a, {
38465
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(animated.a, {
38426
38466
  href,
38427
38467
  style: labelStyle(themeSprings),
38428
38468
  children: [
38429
38469
  icon,
38430
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("span", {
38470
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
38431
38471
  children: label
38432
38472
  }, undefined, false, undefined, this)
38433
38473
  ]
38434
38474
  }, undefined, true, undefined, this),
38435
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AnimatedFaChevronDown, {
38475
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(AnimatedFaChevronDown, {
38436
38476
  onClick: toggleDropdown,
38437
38477
  style: {
38438
38478
  cursor: "pointer",
@@ -38444,14 +38484,14 @@ var HamburgerDropdown = ({
38444
38484
  }, undefined, false, undefined, this)
38445
38485
  ]
38446
38486
  }, undefined, true, undefined, this),
38447
- /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(animated.nav, {
38487
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(animated.nav, {
38448
38488
  ref,
38449
38489
  style: {
38450
38490
  height: dropdownSprings.height,
38451
38491
  opacity: dropdownSprings.opacity,
38452
38492
  overflow: "hidden"
38453
38493
  },
38454
- children: links.map((link, index) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(NavbarLink, {
38494
+ children: links.map((link, index) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(NavbarLink, {
38455
38495
  themeSprings,
38456
38496
  icon: link.icon,
38457
38497
  href: link.href,
@@ -38463,11 +38503,11 @@ var HamburgerDropdown = ({
38463
38503
  };
38464
38504
 
38465
38505
  // src/frontend/components/hamburger/HamburgerHeader.tsx
38466
- var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
38506
+ var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
38467
38507
  var HamburgerHeader = ({
38468
38508
  onClose,
38469
38509
  themeSprings
38470
- }) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(animated.div, {
38510
+ }) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(animated.div, {
38471
38511
  style: {
38472
38512
  alignItems: "center",
38473
38513
  backgroundColor: themeSprings.themePrimary,
@@ -38482,7 +38522,7 @@ var HamburgerHeader = ({
38482
38522
  width: "100%"
38483
38523
  },
38484
38524
  children: [
38485
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("a", {
38525
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV("a", {
38486
38526
  href: "/",
38487
38527
  style: {
38488
38528
  color: "inherit",
@@ -38492,7 +38532,7 @@ var HamburgerHeader = ({
38492
38532
  },
38493
38533
  children: "AbsoluteJS"
38494
38534
  }, undefined, false, undefined, this),
38495
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(FaTimes, {
38535
+ /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(FaTimes, {
38496
38536
  style: {
38497
38537
  cursor: "pointer",
38498
38538
  fontSize: "34px"
@@ -38502,52 +38542,6 @@ var HamburgerHeader = ({
38502
38542
  ]
38503
38543
  }, undefined, true, undefined, this);
38504
38544
 
38505
- // node_modules/zustand/esm/vanilla.mjs
38506
- var createStoreImpl = (createState) => {
38507
- let state;
38508
- const listeners = /* @__PURE__ */ new Set;
38509
- const setState = (partial, replace) => {
38510
- const nextState = typeof partial === "function" ? partial(state) : partial;
38511
- if (!Object.is(nextState, state)) {
38512
- const previousState = state;
38513
- state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
38514
- listeners.forEach((listener) => listener(state, previousState));
38515
- }
38516
- };
38517
- const getState = () => state;
38518
- const getInitialState = () => initialState;
38519
- const subscribe = (listener) => {
38520
- listeners.add(listener);
38521
- return () => listeners.delete(listener);
38522
- };
38523
- const api = { setState, getState, getInitialState, subscribe };
38524
- const initialState = state = createState(setState, getState, api);
38525
- return api;
38526
- };
38527
- var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
38528
-
38529
- // node_modules/zustand/esm/react.mjs
38530
- var import_react21 = __toESM(require_react(), 1);
38531
- var identity = (arg) => arg;
38532
- function useStore(api, selector = identity) {
38533
- const slice = import_react21.default.useSyncExternalStore(api.subscribe, () => selector(api.getState()), () => selector(api.getInitialState()));
38534
- import_react21.default.useDebugValue(slice);
38535
- return slice;
38536
- }
38537
- var createImpl = (createState) => {
38538
- const api = createStore(createState);
38539
- const useBoundStore = (selector) => useStore(api, selector);
38540
- Object.assign(useBoundStore, api);
38541
- return useBoundStore;
38542
- };
38543
- var create2 = (createState) => createState ? createImpl(createState) : createImpl;
38544
-
38545
- // src/frontend/hooks/useThemeStore.ts
38546
- var useThemeStore = create2((set2) => ({
38547
- theme: "dark",
38548
- setTheme: (newTheme) => set2({ theme: newTheme })
38549
- }));
38550
-
38551
38545
  // src/frontend/styles/styles.ts
38552
38546
  var styleReset = `
38553
38547
  * {
@@ -38564,6 +38558,7 @@ var bodyDefault = (themeSprings) => ({
38564
38558
  flexDirection: "column",
38565
38559
  fontFamily: "Poppins, sans-serif",
38566
38560
  height: "100%",
38561
+ lineHeight: "1.4",
38567
38562
  margin: 0
38568
38563
  });
38569
38564
  var mainDefault = {
@@ -38576,8 +38571,8 @@ var htmlDefault = {
38576
38571
  height: "100%"
38577
38572
  };
38578
38573
  var buttonStyle = ({
38579
- backgroundColor = "none",
38580
- color = "white",
38574
+ backgroundColor,
38575
+ color,
38581
38576
  width
38582
38577
  }) => ({
38583
38578
  alignItems: "center",
@@ -38611,26 +38606,6 @@ var paragraphStyle = (themeSprings) => ({
38611
38606
  textAlign: "center"
38612
38607
  });
38613
38608
 
38614
- // src/frontend/components/utils/ProfilePicture.tsx
38615
- var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
38616
- var ProfilePicture = ({
38617
- userImage,
38618
- backupImage,
38619
- width = "2rem",
38620
- height = "2rem",
38621
- themeSprings
38622
- }) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(animated.img, {
38623
- src: userImage ?? backupImage,
38624
- alt: "Profile",
38625
- style: {
38626
- backgroundColor: themeSprings.themeTertiary,
38627
- borderRadius: "50%",
38628
- height,
38629
- objectFit: "cover",
38630
- width
38631
- }
38632
- }, undefined, false, undefined, this);
38633
-
38634
38609
  // src/frontend/components/hamburger/HamburgerUserButtons.tsx
38635
38610
  var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
38636
38611
  var HamburgerUserButtons = ({
@@ -38638,63 +38613,60 @@ var HamburgerUserButtons = ({
38638
38613
  handleSignOut,
38639
38614
  openModal,
38640
38615
  themeSprings
38641
- }) => {
38642
- const theme = useThemeStore((state) => state.theme);
38643
- return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
38644
- style: {
38645
- alignItems: "center",
38646
- display: "flex",
38647
- flexDirection: "column",
38648
- justifyContent: "space-between",
38649
- width: "100%"
38650
- },
38651
- children: [
38652
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(animated.button, {
38653
- onClick: user ? () => handleSignOut() : openModal,
38654
- style: buttonStyle({
38655
- backgroundColor: themeSprings.themeTertiary,
38656
- color: themeSprings.contrastPrimary,
38657
- width: "100%"
38658
- }),
38659
- children: user ? "Sign Out" : "Login"
38660
- }, undefined, false, undefined, this),
38661
- user !== undefined && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
38662
- style: {
38663
- alignItems: "center",
38664
- display: "flex",
38665
- flexDirection: "row",
38666
- gap: "2rem",
38667
- marginTop: "1rem"
38668
- },
38669
- children: [
38670
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(animated.a, {
38671
- href: "/portal",
38672
- children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(ProfilePicture, {
38673
- themeSprings,
38674
- userImage: typeof user.metadata?.profile_picture === "string" ? user.metadata.profile_picture : undefined,
38675
- backupImage: theme === "dark" ? "/assets/svg/default-profile-icon-light.svg" : "/assets/svg/default-profile-icon.svg",
38676
- width: "4rem",
38677
- height: "4rem"
38678
- }, undefined, false, undefined, this)
38679
- }, undefined, false, undefined, this),
38680
- /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(animated.span, {
38681
- style: {
38682
- color: themeSprings.contrastPrimary,
38683
- fontSize: "1.2rem",
38684
- fontWeight: "bold",
38685
- textAlign: "center"
38686
- },
38687
- children: [
38688
- typeof user.metadata?.given_name === "string" ? user.metadata.given_name : "",
38689
- " ",
38690
- typeof user.metadata?.family_name === "string" ? user.metadata.family_name : ""
38691
- ]
38692
- }, undefined, true, undefined, this)
38693
- ]
38694
- }, undefined, true, undefined, this)
38695
- ]
38696
- }, undefined, true, undefined, this);
38697
- };
38616
+ }) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
38617
+ style: {
38618
+ alignItems: "center",
38619
+ display: "flex",
38620
+ flexDirection: "column",
38621
+ justifyContent: "space-between",
38622
+ width: "100%"
38623
+ },
38624
+ children: [
38625
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(animated.button, {
38626
+ onClick: user ? () => handleSignOut() : openModal,
38627
+ style: buttonStyle({
38628
+ backgroundColor: themeSprings.themeTertiary,
38629
+ color: themeSprings.contrastPrimary,
38630
+ width: "100%"
38631
+ }),
38632
+ children: user ? "Sign Out" : "Login"
38633
+ }, undefined, false, undefined, this),
38634
+ user !== undefined && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
38635
+ style: {
38636
+ alignItems: "center",
38637
+ display: "flex",
38638
+ flexDirection: "row",
38639
+ gap: "2rem",
38640
+ marginTop: "1rem"
38641
+ },
38642
+ children: [
38643
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(animated.a, {
38644
+ href: "/portal",
38645
+ children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(AnimatedProfilePicture, {
38646
+ themeSprings,
38647
+ userImage: typeof user.metadata?.profile_picture === "string" ? user.metadata.profile_picture : undefined,
38648
+ backupImage: themeSprings.theme.to((mode) => mode === "dark" ? "/assets/svg/default-profile-icon-light.svg" : "/assets/svg/default-profile-icon.svg"),
38649
+ width: "4rem",
38650
+ height: "4rem"
38651
+ }, undefined, false, undefined, this)
38652
+ }, undefined, false, undefined, this),
38653
+ /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(animated.span, {
38654
+ style: {
38655
+ color: themeSprings.contrastPrimary,
38656
+ fontSize: "1.2rem",
38657
+ fontWeight: "bold",
38658
+ textAlign: "center"
38659
+ },
38660
+ children: [
38661
+ typeof user.metadata?.given_name === "string" ? user.metadata.given_name : "",
38662
+ " ",
38663
+ typeof user.metadata?.family_name === "string" ? user.metadata.family_name : ""
38664
+ ]
38665
+ }, undefined, true, undefined, this)
38666
+ ]
38667
+ }, undefined, true, undefined, this)
38668
+ ]
38669
+ }, undefined, true, undefined, this);
38698
38670
 
38699
38671
  // src/frontend/components/hamburger/HamburgerMenu.tsx
38700
38672
  var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
@@ -38705,7 +38677,7 @@ var HamburgerMenu = ({
38705
38677
  themeSprings,
38706
38678
  handleSignOut
38707
38679
  }) => {
38708
- const [isModalOpen, setIsModalOpen] = import_react22.useState(false);
38680
+ const [isModalOpen, setIsModalOpen] = import_react21.useState(false);
38709
38681
  return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(animated.div, {
38710
38682
  style: {
38711
38683
  background: themeSprings.themeSecondary,
@@ -38785,7 +38757,7 @@ var HamburgerMenu = ({
38785
38757
  };
38786
38758
 
38787
38759
  // src/frontend/components/navbar/NavbarDropdown.tsx
38788
- var import_react23 = __toESM(require_react(), 1);
38760
+ var import_react22 = __toESM(require_react(), 1);
38789
38761
  var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
38790
38762
  var AnimatedFaChevronDown2 = animated(FaChevronDown);
38791
38763
  var NavbarDropdown = ({
@@ -38794,7 +38766,7 @@ var NavbarDropdown = ({
38794
38766
  links,
38795
38767
  themeSprings
38796
38768
  }) => {
38797
- const dropdownRef = import_react23.useRef(null);
38769
+ const dropdownRef = import_react22.useRef(null);
38798
38770
  const [dropdownSpring, dropdownApi] = useSpring(() => ({
38799
38771
  config: { friction: 30, tension: 250 },
38800
38772
  height: 0,
@@ -38896,10 +38868,10 @@ var NavbarLinks = ({ navbarData: navbarData2, themeSprings }) => /* @__PURE__ */
38896
38868
  }, undefined, false, undefined, this);
38897
38869
 
38898
38870
  // src/frontend/components/navbar/NavbarUserButtons.tsx
38899
- var import_react27 = __toESM(require_react(), 1);
38871
+ var import_react25 = __toESM(require_react(), 1);
38900
38872
 
38901
38873
  // src/frontend/components/navbar/DropdownContainer.tsx
38902
- var import_react24 = __toESM(require_react(), 1);
38874
+ var import_react23 = __toESM(require_react(), 1);
38903
38875
  var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
38904
38876
  var DropdownContainer = ({
38905
38877
  spring,
@@ -38909,8 +38881,8 @@ var DropdownContainer = ({
38909
38881
  themeSprings,
38910
38882
  ignoredElements = []
38911
38883
  }) => {
38912
- const dropdownRef = import_react24.useRef(null);
38913
- import_react24.useEffect(() => {
38884
+ const dropdownRef = import_react23.useRef(null);
38885
+ import_react23.useEffect(() => {
38914
38886
  const handleOutsideClick = (event) => {
38915
38887
  if (!(event.target instanceof Node))
38916
38888
  return;
@@ -38948,63 +38920,11 @@ var DropdownContainer = ({
38948
38920
  };
38949
38921
 
38950
38922
  // src/frontend/components/navbar/ThemeButton.tsx
38951
- var import_react26 = __toESM(require_react(), 1);
38952
-
38953
- // node_modules/react-icons/ai/index.mjs
38954
- function AiOutlineExperiment(props) {
38955
- return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M512 472a40 40 0 1 0 80 0 40 40 0 1 0-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 0 1-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z" }, child: [] }] })(props);
38956
- }
38957
- function AiOutlineMinusCircle(props) {
38958
- return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" }, child: [] }, { tag: "path", attr: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, child: [] }] })(props);
38959
- }
38960
- function AiOutlineMoon(props) {
38961
- return GenIcon({ tag: "svg", attr: { viewBox: "0 0 1024 1024", fill: "currentColor", fillRule: "evenodd" }, child: [{ tag: "path", attr: { d: "M489.493 111.658c30.658-1.792 45.991 36.44 22.59 56.329C457.831 214.095 426 281.423 426 354c0 134.757 109.243 244 244 244 72.577 0 139.905-31.832 186.014-86.084 19.868-23.377 58.064-8.102 56.332 22.53C900.4 745.823 725.141 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.287-386.024 374.198-399.649l.206-.013zm-81.143 79.75-4.112 1.362C271.1 237.943 176 364.092 176 511.5 176 697.344 326.656 848 512.5 848c148.28 0 274.938-96.192 319.453-230.41l.625-1.934-.11.071c-47.18 29.331-102.126 45.755-159.723 46.26L670 662c-170.104 0-308-137.896-308-308 0-58.595 16.476-114.54 46.273-162.467z" }, child: [] }] })(props);
38962
- }
38963
-
38964
- // node_modules/react-icons/io5/index.mjs
38965
- function IoSunny(props) {
38966
- return GenIcon({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 118a22 22 0 0 1-22-22V48a22 22 0 0 1 44 0v48a22 22 0 0 1-22 22zm0 368a22 22 0 0 1-22-22v-48a22 22 0 0 1 44 0v48a22 22 0 0 1-22 22zm113.14-321.14a22 22 0 0 1-15.56-37.55l33.94-33.94a22 22 0 0 1 31.11 31.11l-33.94 33.94a21.93 21.93 0 0 1-15.55 6.44zM108.92 425.08a22 22 0 0 1-15.55-37.56l33.94-33.94a22 22 0 1 1 31.11 31.11l-33.94 33.94a21.94 21.94 0 0 1-15.56 6.45zM464 278h-48a22 22 0 0 1 0-44h48a22 22 0 0 1 0 44zm-368 0H48a22 22 0 0 1 0-44h48a22 22 0 0 1 0 44zm307.08 147.08a21.94 21.94 0 0 1-15.56-6.45l-33.94-33.94a22 22 0 0 1 31.11-31.11l33.94 33.94a22 22 0 0 1-15.55 37.56zM142.86 164.86a21.89 21.89 0 0 1-15.55-6.44l-33.94-33.94a22 22 0 0 1 31.11-31.11l33.94 33.94a22 22 0 0 1-15.56 37.55zM256 358a102 102 0 1 1 102-102 102.12 102.12 0 0 1-102 102z" }, child: [] }] })(props);
38967
- }
38968
-
38969
- // src/frontend/hooks/useInitTheme.ts
38970
- var import_react25 = __toESM(require_react(), 1);
38971
- var useInitTheme = () => {
38972
- const setTheme = useThemeStore((state) => state.setTheme);
38973
- const [currentTheme, setCurrentTheme] = import_react25.useState("dark");
38974
- import_react25.useEffect(() => {
38975
- const storedTheme = window.localStorage.getItem("theme");
38976
- const mediaQuery = window.matchMedia("(prefers-color-scheme: light)");
38977
- const applySystemTheme = (event) => {
38978
- setTheme(event.matches ? "light" : "dark");
38979
- setCurrentTheme(event.matches ? "system:light" : "system:dark");
38980
- };
38981
- if (storedTheme === "light") {
38982
- setTheme("light");
38983
- setCurrentTheme("light");
38984
- return;
38985
- }
38986
- if (storedTheme === "dark") {
38987
- setTheme("dark");
38988
- setCurrentTheme("dark");
38989
- return;
38990
- }
38991
- const isLight = mediaQuery.matches;
38992
- setTheme(isLight ? "light" : "dark");
38993
- setCurrentTheme(isLight ? "system:light" : "system:dark");
38994
- mediaQuery.addEventListener("change", applySystemTheme);
38995
- return () => {
38996
- mediaQuery.removeEventListener("change", applySystemTheme);
38997
- };
38998
- }, [setTheme, setCurrentTheme]);
38999
- return { currentTheme, setCurrentTheme, setTheme };
39000
- };
39001
-
39002
- // src/frontend/components/navbar/ThemeButton.tsx
38923
+ var import_react24 = __toESM(require_react(), 1);
39003
38924
  var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
39004
- var ThemeButton = ({ themeSprings }) => {
39005
- const { currentTheme, setCurrentTheme, setTheme } = useInitTheme();
39006
- const detailsRef = import_react26.useRef(null);
39007
- import_react26.useEffect(() => {
38925
+ var ThemeButton = ({ themeSprings, setTheme }) => {
38926
+ const detailsRef = import_react24.useRef(null);
38927
+ import_react24.useEffect(() => {
39008
38928
  const onClickOutside = (event) => {
39009
38929
  const det = detailsRef.current;
39010
38930
  if (!det?.open)
@@ -39019,25 +38939,14 @@ var ThemeButton = ({ themeSprings }) => {
39019
38939
  return () => document.removeEventListener("mousedown", onClickOutside);
39020
38940
  }, []);
39021
38941
  const selectTheme = (option) => {
39022
- if (option === "system") {
39023
- const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
39024
- setTheme(prefersLight ? "light" : "dark");
39025
- setCurrentTheme(prefersLight ? "system:light" : "system:dark");
39026
- window.localStorage.removeItem("theme");
39027
- } else {
39028
- setTheme(option);
39029
- setCurrentTheme(option);
39030
- window.localStorage.setItem("theme", option);
39031
- }
38942
+ setTheme(option);
39032
38943
  if (detailsRef.current)
39033
38944
  detailsRef.current.open = false;
39034
38945
  };
39035
- const icon = currentTheme.includes("dark") ? /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(AiOutlineMoon, {
39036
- style: { height: 24, width: 24 }
39037
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(IoSunny, {
39038
- style: { height: 24, width: 24 }
39039
- }, undefined, false, undefined, this);
39040
- const selected = currentTheme.startsWith("system") ? "system" : currentTheme;
38946
+ const selected = themeSprings.theme.to((t2) => {
38947
+ const sel = t2.startsWith("system") ? "system" : t2;
38948
+ return sel;
38949
+ });
39041
38950
  return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(animated.details, {
39042
38951
  ref: detailsRef,
39043
38952
  style: {
@@ -39060,10 +38969,28 @@ var ThemeButton = ({ themeSprings }) => {
39060
38969
  listStyle: "none",
39061
38970
  margin: 0,
39062
38971
  padding: 0,
38972
+ position: "relative",
39063
38973
  width: "2.5rem"
39064
38974
  },
39065
- children: icon
39066
- }, undefined, false, undefined, this),
38975
+ children: [
38976
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(AnimatedMoon, {
38977
+ style: {
38978
+ height: 24,
38979
+ opacity: themeSprings.theme.to((t2) => t2.endsWith("dark") ? 1 : 0),
38980
+ position: "absolute",
38981
+ width: 24
38982
+ }
38983
+ }, undefined, false, undefined, this),
38984
+ /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(AnimatedSun, {
38985
+ style: {
38986
+ height: 24,
38987
+ opacity: themeSprings.theme.to((t2) => t2.endsWith("dark") ? 0 : 1),
38988
+ position: "absolute",
38989
+ width: 24
38990
+ }
38991
+ }, undefined, false, undefined, this)
38992
+ ]
38993
+ }, undefined, true, undefined, this),
39067
38994
  /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(animated.ul, {
39068
38995
  style: {
39069
38996
  backgroundColor: themeSprings.themeTertiary,
@@ -39077,17 +39004,25 @@ var ThemeButton = ({ themeSprings }) => {
39077
39004
  right: 0,
39078
39005
  top: "3.5rem"
39079
39006
  },
39080
- children: ["system", "light", "dark"].map((opt) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(animated.li, {
39081
- onClick: () => selectTheme(opt),
39082
- style: {
39083
- background: opt === selected ? themeSprings.contrastPrimary : "transparent",
39084
- borderRadius: "0.25rem",
39085
- color: opt === selected ? themeSprings.themeTertiary : themeSprings.contrastPrimary,
39086
- cursor: "pointer",
39087
- padding: "0.25rem 0.5rem"
39088
- },
39089
- children: opt.charAt(0).toUpperCase() + opt.slice(1)
39090
- }, opt, false, undefined, this))
39007
+ children: ["system", "light", "dark"].map((opt) => {
39008
+ const background = to2([selected, themeSprings.themePrimary], (sel, bkg) => sel === opt ? bkg : "transparent");
39009
+ const color = to2([
39010
+ selected,
39011
+ themeSprings.contrastPrimary,
39012
+ themeSprings.contrastSecondary
39013
+ ], (sel, tertiary, contrast) => sel === opt ? tertiary : contrast);
39014
+ return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(animated.li, {
39015
+ onClick: () => selectTheme(opt),
39016
+ style: {
39017
+ background,
39018
+ borderRadius: "0.25rem",
39019
+ color,
39020
+ cursor: "pointer",
39021
+ padding: "0.25rem 0.5rem"
39022
+ },
39023
+ children: opt.charAt(0).toUpperCase() + opt.slice(1)
39024
+ }, opt, false, undefined, this);
39025
+ })
39091
39026
  }, undefined, false, undefined, this)
39092
39027
  ]
39093
39028
  }, undefined, true, undefined, this);
@@ -39098,12 +39033,12 @@ var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
39098
39033
  var NavbarUserButtons = ({
39099
39034
  user,
39100
39035
  handleSignOut,
39101
- themeSprings
39036
+ themeSprings,
39037
+ setTheme
39102
39038
  }) => {
39103
- const [isDropdownOpen, setIsDropdownOpen] = import_react27.useState(false);
39039
+ const [isDropdownOpen, setIsDropdownOpen] = import_react25.useState(false);
39104
39040
  const { isSizeOrLess } = useMediaQuery();
39105
39041
  const isMobile = isSizeOrLess("sm");
39106
- const theme = useThemeStore((state) => state.theme);
39107
39042
  const openDropdown = () => {
39108
39043
  setIsDropdownOpen(true);
39109
39044
  loginDropdownApi.start({ opacity: 1, scale: 1 });
@@ -39124,7 +39059,7 @@ var NavbarUserButtons = ({
39124
39059
  opacity: 0,
39125
39060
  scale: 0
39126
39061
  }));
39127
- const userButtonRef = import_react27.useRef(null);
39062
+ const userButtonRef = import_react25.useRef(null);
39128
39063
  return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("div", {
39129
39064
  style: {
39130
39065
  display: "flex",
@@ -39144,16 +39079,17 @@ var NavbarUserButtons = ({
39144
39079
  user !== undefined && !isMobile && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(animated.a, {
39145
39080
  style: profileButtonStyle,
39146
39081
  href: "/protected",
39147
- children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ProfilePicture, {
39082
+ children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(AnimatedProfilePicture, {
39148
39083
  themeSprings,
39149
39084
  userImage: typeof user.metadata?.profile_picture === "string" ? user.metadata.profile_picture : undefined,
39150
- backupImage: theme === "dark" ? "/assets/svg/default-profile-icon-light.svg" : "/assets/svg/default-profile-icon.svg",
39085
+ backupImage: themeSprings.theme.to((theme) => theme.endsWith("dark") ? "/assets/svg/default-profile-icon-light.svg" : "/assets/svg/default-profile-icon.svg"),
39151
39086
  width: "2.5rem",
39152
39087
  height: "2.5rem"
39153
39088
  }, undefined, false, undefined, this)
39154
39089
  }, undefined, false, undefined, this),
39155
39090
  /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ThemeButton, {
39156
- themeSprings
39091
+ themeSprings,
39092
+ setTheme
39157
39093
  }, undefined, false, undefined, this),
39158
39094
  isDropdownOpen === true && !isMobile && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(DropdownContainer, {
39159
39095
  themeSprings,
@@ -39184,10 +39120,15 @@ var NavbarUserButtons = ({
39184
39120
 
39185
39121
  // src/frontend/components/navbar/Navbar.tsx
39186
39122
  var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
39187
- var Navbar = ({ user, handleSignOut, themeSprings }) => {
39123
+ var Navbar = ({
39124
+ user,
39125
+ handleSignOut,
39126
+ themeSprings,
39127
+ setTheme
39128
+ }) => {
39188
39129
  const { isSizeOrLess } = useMediaQuery();
39189
39130
  const isMobile = isSizeOrLess("sm");
39190
- const navRef = import_react28.useRef(null);
39131
+ const navRef = import_react26.useRef(null);
39191
39132
  const [hamburgerMenuSpring, hamburgerMenuApi] = useSpring(() => ({
39192
39133
  config: { friction: 40, tension: 275 },
39193
39134
  transform: "translateX(100%)",
@@ -39233,7 +39174,8 @@ var Navbar = ({ user, handleSignOut, themeSprings }) => {
39233
39174
  /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(NavbarUserButtons, {
39234
39175
  user,
39235
39176
  handleSignOut,
39236
- themeSprings
39177
+ themeSprings,
39178
+ setTheme
39237
39179
  }, undefined, false, undefined, this),
39238
39180
  isMobile === true && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV("button", {
39239
39181
  style: hamburgerButtonStyle,
@@ -39291,7 +39233,7 @@ var Head = ({
39291
39233
  }, undefined, true, undefined, this);
39292
39234
 
39293
39235
  // src/frontend/components/testing/AuthGrid.tsx
39294
- var import_react31 = __toESM(require_react(), 1);
39236
+ var import_react29 = __toESM(require_react(), 1);
39295
39237
 
39296
39238
  // src/frontend/components/auth/OAuthButton.tsx
39297
39239
  var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
@@ -39347,7 +39289,7 @@ var OAuthButton = ({
39347
39289
  };
39348
39290
 
39349
39291
  // src/frontend/components/utils/ToastProvider.tsx
39350
- var import_react29 = __toESM(require_react(), 1);
39292
+ var import_react27 = __toESM(require_react(), 1);
39351
39293
  var import_react_dom2 = __toESM(require_react_dom(), 1);
39352
39294
 
39353
39295
  // src/frontend/components/utils/Toast.tsx
@@ -39431,17 +39373,17 @@ var Toast = ({ message, action, style, removeToast }) => /* @__PURE__ */ jsx_dev
39431
39373
 
39432
39374
  // src/frontend/components/utils/ToastProvider.tsx
39433
39375
  var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
39434
- var ToastContext = import_react29.createContext(null);
39376
+ var ToastContext = import_react27.createContext(null);
39435
39377
  var useToast = () => {
39436
- const ctx2 = import_react29.useContext(ToastContext);
39378
+ const ctx2 = import_react27.useContext(ToastContext);
39437
39379
  if (!ctx2)
39438
39380
  throw new Error("useToast must be used within ToastProvider");
39439
39381
  return ctx2;
39440
39382
  };
39441
39383
  var ToastProvider = ({ children }) => {
39442
- const [toasts, setToasts] = import_react29.useState([]);
39443
- const [host2, setHost] = import_react29.useState(null);
39444
- import_react29.useEffect(() => {
39384
+ const [toasts, setToasts] = import_react27.useState([]);
39385
+ const [host2, setHost] = import_react27.useState(null);
39386
+ import_react27.useEffect(() => {
39445
39387
  setHost(document.body);
39446
39388
  }, []);
39447
39389
  const addToast = ({
@@ -39483,7 +39425,7 @@ var ToastProvider = ({ children }) => {
39483
39425
  };
39484
39426
 
39485
39427
  // src/frontend/hooks/useAuthModalData.ts
39486
- var import_react30 = __toESM(require_react(), 1);
39428
+ var import_react28 = __toESM(require_react(), 1);
39487
39429
 
39488
39430
  // node_modules/@elysiajs/eden/dist/chunk-XYW4OUFN.mjs
39489
39431
  var s = class extends Error {
@@ -39784,7 +39726,7 @@ var useAuthModalData = ({
39784
39726
  handleSignOut
39785
39727
  }) => {
39786
39728
  const { addToast, registerHost } = useToast();
39787
- const [profile, setProfile] = import_react30.useState();
39729
+ const [profile, setProfile] = import_react28.useState();
39788
39730
  const queryClient = useQueryClient();
39789
39731
  const providerStatuses = useQuery({
39790
39732
  queryKey: ["providerStatuses", modalContent?.providerOption],
@@ -39937,15 +39879,18 @@ var colorRules = [
39937
39879
  ];
39938
39880
  var defaultColorKey = "punctuation";
39939
39881
  var getTokenColorKey = (token) => colorRules.find(([pattern]) => pattern.test(token))?.[1] ?? defaultColorKey;
39940
- var JsonLine = ({ line, needsNewline }) => {
39941
- const theme = useThemeStore((state) => state.theme);
39942
- const colors3 = theme === "dark" ? colorMap.dark : colorMap.light;
39882
+ var JsonLine = ({
39883
+ line,
39884
+ needsNewline,
39885
+ themeSprings
39886
+ }) => {
39887
+ const colors3 = themeSprings.theme.to((mode) => mode === "dark" ? colorMap.dark : colorMap.light);
39943
39888
  const segments = line.split(tokenPattern).filter((segment) => segment);
39944
39889
  return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV("span", {
39945
39890
  children: [
39946
- segments.map((segment, idx) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV("span", {
39891
+ segments.map((segment, idx) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(animated.span, {
39947
39892
  style: {
39948
- color: tokenPattern.test(segment) ? colors3[getTokenColorKey(segment)] : colors3.text
39893
+ color: colors3.to((c6) => tokenPattern.test(segment) ? c6[getTokenColorKey(segment)] : c6.text)
39949
39894
  },
39950
39895
  children: segment
39951
39896
  }, idx, false, undefined, this)),
@@ -39959,7 +39904,8 @@ var JsonLine = ({ line, needsNewline }) => {
39959
39904
  var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
39960
39905
  var HighlightedJson = ({
39961
39906
  data,
39962
- primaryColor: primaryColor2
39907
+ primaryColor: primaryColor2,
39908
+ themeSprings
39963
39909
  }) => {
39964
39910
  const jsonString = JSON.stringify(data ?? {}, null, 2);
39965
39911
  const jsonLines = jsonString.split(`
@@ -39979,6 +39925,7 @@ var HighlightedJson = ({
39979
39925
  },
39980
39926
  children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV("code", {
39981
39927
  children: jsonLines.map((line, lineIndex) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(JsonLine, {
39928
+ themeSprings,
39982
39929
  line,
39983
39930
  needsNewline: lineIndex < jsonLines.length - 1
39984
39931
  }, lineIndex, false, undefined, this))
@@ -40248,6 +40195,7 @@ var AuthModal = ({
40248
40195
  }, undefined, false, undefined, this)
40249
40196
  }, undefined, false, undefined, this),
40250
40197
  isAuthorized && profile && /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(HighlightedJson, {
40198
+ themeSprings,
40251
40199
  data: profile,
40252
40200
  primaryColor: primaryColor2
40253
40201
  }, undefined, false, undefined, this),
@@ -40279,7 +40227,7 @@ var AuthGrid = ({
40279
40227
  handleSignOut,
40280
40228
  themeSprings
40281
40229
  }) => {
40282
- const [modalContent, setModalContent] = import_react31.useState(() => {
40230
+ const [modalContent, setModalContent] = import_react29.useState(() => {
40283
40231
  if (typeof window === "undefined")
40284
40232
  return null;
40285
40233
  const params = new URLSearchParams(window.location.search);
@@ -40469,9 +40417,9 @@ var Legend = ({ themeSprings }) => /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(anim
40469
40417
  }, undefined, true, undefined, this);
40470
40418
 
40471
40419
  // src/frontend/hooks/useAuthStatus.ts
40472
- var import_react32 = __toESM(require_react(), 1);
40420
+ var import_react30 = __toESM(require_react(), 1);
40473
40421
  var useAuthStatus = () => {
40474
- const [user, setUser] = import_react32.useState();
40422
+ const [user, setUser] = import_react30.useState();
40475
40423
  const checkAuthStatus = async () => {
40476
40424
  const response = await fetch("/oauth2/status");
40477
40425
  if (!response.ok && response.statusText === "Unauthorized") {
@@ -40500,7 +40448,7 @@ var useAuthStatus = () => {
40500
40448
  console.error("SignOut failed");
40501
40449
  }
40502
40450
  };
40503
- import_react32.useEffect(() => {
40451
+ import_react30.useEffect(() => {
40504
40452
  checkAuthStatus();
40505
40453
  }, []);
40506
40454
  return {
@@ -40511,9 +40459,9 @@ var useAuthStatus = () => {
40511
40459
  };
40512
40460
 
40513
40461
  // src/frontend/hooks/useCleanPath.ts
40514
- var import_react33 = __toESM(require_react(), 1);
40462
+ var import_react31 = __toESM(require_react(), 1);
40515
40463
  var useCleanPath = () => {
40516
- import_react33.useEffect(() => {
40464
+ import_react31.useEffect(() => {
40517
40465
  const { hash: hash2 } = window.location;
40518
40466
  if (hash2 === "#_=_" || hash2 === "#_") {
40519
40467
  window.history.replaceState(null, document.title, window.location.pathname + window.location.search);
@@ -40521,36 +40469,71 @@ var useCleanPath = () => {
40521
40469
  }, []);
40522
40470
  };
40523
40471
 
40524
- // src/frontend/hooks/useThemeColors.ts
40525
- var import_react34 = __toESM(require_react(), 1);
40526
- var useThemeColors = () => {
40527
- const theme = useThemeStore((state) => state.theme);
40528
- const [themeSprings, themeApi] = useSpring(() => ({
40529
- contrastPrimary: theme === "dark" ? lightPrimaryColor : darkPrimaryColor,
40530
- contrastSecondary: theme === "dark" ? lightSecondaryColor : darkSecondaryColor,
40531
- themePrimary: theme === "dark" ? darkPrimaryColor : lightPrimaryColor,
40532
- themeSecondary: theme === "dark" ? darkSecondaryColor : lightSecondaryColor,
40533
- themeTertiary: theme === "dark" ? darkTertiaryColor : lightTertiaryColor
40534
- }));
40535
- import_react34.useEffect(() => {
40536
- themeApi.start({
40537
- contrastPrimary: theme === "dark" ? lightPrimaryColor : darkPrimaryColor,
40538
- contrastSecondary: theme === "dark" ? lightSecondaryColor : darkSecondaryColor,
40539
- themePrimary: theme === "dark" ? darkPrimaryColor : lightPrimaryColor,
40540
- themeSecondary: theme === "dark" ? darkSecondaryColor : lightSecondaryColor,
40541
- themeTertiary: theme === "dark" ? darkTertiaryColor : lightTertiaryColor
40542
- });
40543
- }, [theme, themeApi]);
40544
- return themeSprings;
40472
+ // src/frontend/hooks/useTheme.ts
40473
+ var import_react32 = __toESM(require_react(), 1);
40474
+ var createPalette = (mode) => ({
40475
+ contrastPrimary: mode.endsWith("dark") ? lightPrimaryColor : darkPrimaryColor,
40476
+ contrastSecondary: mode.endsWith("dark") ? lightSecondaryColor : darkSecondaryColor,
40477
+ theme: mode,
40478
+ themePrimary: mode.endsWith("dark") ? darkPrimaryColor : lightPrimaryColor,
40479
+ themeSecondary: mode.endsWith("dark") ? darkSecondaryColor : lightSecondaryColor,
40480
+ themeTertiary: mode.endsWith("dark") ? darkTertiaryColor : lightTertiaryColor
40481
+ });
40482
+ var useTheme = (initialTheme) => {
40483
+ const browserEnvironmentAvailable = typeof window !== "undefined" && typeof window.matchMedia === "function";
40484
+ const [themeSprings, themeSpringController] = useSpring(() => createPalette(initialTheme ?? "system:dark"));
40485
+ const mediaQueryRef = import_react32.useRef(null);
40486
+ const applySystemChange = (event) => {
40487
+ const updatedThemeMode = event.matches ? "system:dark" : "system:light";
40488
+ themeSpringController.start(createPalette(updatedThemeMode));
40489
+ document.cookie = `theme=${updatedThemeMode}; Max-Age=31536000; Path=/`;
40490
+ };
40491
+ import_react32.useEffect(() => {
40492
+ if (!browserEnvironmentAvailable)
40493
+ return;
40494
+ const shouldFollowSystem = !initialTheme || initialTheme.startsWith("system");
40495
+ if (!shouldFollowSystem)
40496
+ return;
40497
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
40498
+ mediaQueryRef.current = mediaQuery;
40499
+ if (!mediaQuery.matches) {
40500
+ themeSpringController.start(createPalette("system:light"));
40501
+ }
40502
+ mediaQuery.addEventListener("change", applySystemChange);
40503
+ return () => {
40504
+ mediaQuery.removeEventListener("change", applySystemChange);
40505
+ mediaQueryRef.current = null;
40506
+ };
40507
+ }, []);
40508
+ const setTheme = (selectedTheme) => {
40509
+ if (!browserEnvironmentAvailable)
40510
+ return;
40511
+ if (mediaQueryRef.current) {
40512
+ mediaQueryRef.current.removeEventListener("change", applySystemChange);
40513
+ mediaQueryRef.current = null;
40514
+ }
40515
+ let nextThemeMode;
40516
+ if (selectedTheme === "system") {
40517
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
40518
+ nextThemeMode = mediaQuery.matches ? "system:dark" : "system:light";
40519
+ mediaQuery.addEventListener("change", applySystemChange);
40520
+ mediaQueryRef.current = mediaQuery;
40521
+ } else {
40522
+ nextThemeMode = selectedTheme;
40523
+ }
40524
+ themeSpringController.start(createPalette(nextThemeMode));
40525
+ document.cookie = `theme=${nextThemeMode}; Max-Age=31536000; Path=/`;
40526
+ };
40527
+ return [themeSprings, setTheme];
40545
40528
  };
40546
40529
 
40547
40530
  // src/frontend/pages/AuthTesting.tsx
40548
40531
  var jsx_dev_runtime37 = __toESM(require_jsx_dev_runtime(), 1);
40549
40532
  var queryClient = new QueryClient;
40550
- var AuthTesting = () => {
40551
- const { user, handleSignOut } = useAuthStatus();
40533
+ var AuthTesting = ({ theme }) => {
40552
40534
  useCleanPath();
40553
- const themeSprings = useThemeColors();
40535
+ const { user, handleSignOut } = useAuthStatus();
40536
+ const [themeSprings, setTheme] = useTheme(theme);
40554
40537
  return /* @__PURE__ */ jsx_dev_runtime37.jsxDEV("html", {
40555
40538
  lang: "en",
40556
40539
  style: htmlDefault,
@@ -40560,6 +40543,7 @@ var AuthTesting = () => {
40560
40543
  style: bodyDefault(themeSprings),
40561
40544
  children: [
40562
40545
  /* @__PURE__ */ jsx_dev_runtime37.jsxDEV(Navbar, {
40546
+ setTheme,
40563
40547
  user,
40564
40548
  handleSignOut,
40565
40549
  themeSprings
@@ -40607,4 +40591,6 @@ var AuthTesting = () => {
40607
40591
 
40608
40592
  // src/frontend/indexes/AuthTestingIndex.tsx
40609
40593
  var jsx_dev_runtime38 = __toESM(require_jsx_dev_runtime(), 1);
40610
- import_client.hydrateRoot(document, /* @__PURE__ */ jsx_dev_runtime38.jsxDEV(AuthTesting, {}, undefined, false, undefined, this));
40594
+ import_client.hydrateRoot(document, /* @__PURE__ */ jsx_dev_runtime38.jsxDEV(AuthTesting, {
40595
+ ...window.__INITIAL_PROPS__
40596
+ }, undefined, false, undefined, this));