@seliseblocks/genesis-os 4.4.3 → 4.4.4

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 (45) hide show
  1. package/dist/{chunk-MLPOREJO.cjs → chunk-2BZ2C4TS.cjs} +203 -111
  2. package/dist/chunk-2BZ2C4TS.cjs.map +1 -0
  3. package/dist/{chunk-3EGBCU4W.cjs → chunk-AD2ZGEQ5.cjs} +227 -78
  4. package/dist/chunk-AD2ZGEQ5.cjs.map +1 -0
  5. package/dist/{chunk-M3VJ7FLT.js → chunk-EKAGSVC7.js} +200 -55
  6. package/dist/chunk-EKAGSVC7.js.map +1 -0
  7. package/dist/{chunk-VAWEXEJZ.cjs → chunk-I2KRZLP4.cjs} +184 -7
  8. package/dist/chunk-I2KRZLP4.cjs.map +1 -0
  9. package/dist/{chunk-SG6FH72W.js → chunk-R7WBG4YN.js} +183 -8
  10. package/dist/chunk-R7WBG4YN.js.map +1 -0
  11. package/dist/{chunk-5ILZSG2E.js → chunk-VSLB4SJE.js} +112 -20
  12. package/dist/chunk-VSLB4SJE.js.map +1 -0
  13. package/dist/components/index.cjs +342 -342
  14. package/dist/components/index.js +3 -3
  15. package/dist/guards/index.cjs +9 -9
  16. package/dist/guards/index.js +3 -3
  17. package/dist/hooks/index.cjs +68 -56
  18. package/dist/hooks/index.d.cts +30 -2
  19. package/dist/hooks/index.d.ts +30 -2
  20. package/dist/hooks/index.js +2 -2
  21. package/dist/index.cjs +455 -435
  22. package/dist/index.d.cts +3 -3
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +3 -3
  25. package/dist/layouts/index.cjs +10 -10
  26. package/dist/layouts/index.js +3 -3
  27. package/dist/lib/index.cjs +30 -22
  28. package/dist/lib/index.d.cts +38 -3
  29. package/dist/lib/index.d.ts +38 -3
  30. package/dist/lib/index.js +1 -1
  31. package/dist/observability/index.d.cts +1 -1
  32. package/dist/observability/index.d.ts +1 -1
  33. package/dist/pages/index.cjs +8 -8
  34. package/dist/pages/index.js +3 -3
  35. package/dist/{types-CxmwyESB.d.cts → types-CQX9_ck-.d.cts} +21 -1
  36. package/dist/{types-R-boAdbM.d.ts → types-D9odiLzd.d.ts} +21 -1
  37. package/dist/utils/index.cjs +1 -1
  38. package/dist/utils/index.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunk-3EGBCU4W.cjs.map +0 -1
  41. package/dist/chunk-5ILZSG2E.js.map +0 -1
  42. package/dist/chunk-M3VJ7FLT.js.map +0 -1
  43. package/dist/chunk-MLPOREJO.cjs.map +0 -1
  44. package/dist/chunk-SG6FH72W.js.map +0 -1
  45. package/dist/chunk-VAWEXEJZ.cjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkXJ6DPUCV_cjs = require('./chunk-XJ6DPUCV.cjs');
4
- var chunk3EGBCU4W_cjs = require('./chunk-3EGBCU4W.cjs');
4
+ var chunkAD2ZGEQ5_cjs = require('./chunk-AD2ZGEQ5.cjs');
5
5
  var chunkQTSTAWK3_cjs = require('./chunk-QTSTAWK3.cjs');
6
- var chunkVAWEXEJZ_cjs = require('./chunk-VAWEXEJZ.cjs');
6
+ var chunkI2KRZLP4_cjs = require('./chunk-I2KRZLP4.cjs');
7
7
  var chunkX4YCRWXO_cjs = require('./chunk-X4YCRWXO.cjs');
8
8
  var chunkIJMKS4XG_cjs = require('./chunk-IJMKS4XG.cjs');
9
9
  var chunkBPJM3L7O_cjs = require('./chunk-BPJM3L7O.cjs');
@@ -1523,7 +1523,7 @@ function RightSidePanelProvider({
1523
1523
  const close = React8__namespace.useCallback(() => {
1524
1524
  setOpen(false);
1525
1525
  }, [setOpen]);
1526
- chunk3EGBCU4W_cjs.useKeyboardShortcut(shortcut, toggle);
1526
+ chunkAD2ZGEQ5_cjs.useKeyboardShortcut(shortcut, toggle);
1527
1527
  React8__namespace.useEffect(() => {
1528
1528
  if (!syncHash || isControlled || typeof window === "undefined") return;
1529
1529
  const handleHashChange = () => {
@@ -2388,7 +2388,7 @@ var WizardStepIndicator = ({
2388
2388
  color: indicatorColor,
2389
2389
  backgroundColor: isCompleted ? "hsl(var(--foreground))" : "transparent"
2390
2390
  },
2391
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2391
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2392
2392
  className: chunkYAF2X7W5_cjs.cn(
2393
2393
  "flex size-8 items-center justify-center rounded-full border text-lg font-bold",
2394
2394
  className
@@ -2399,7 +2399,7 @@ var WizardStepIndicator = ({
2399
2399
  initial: { scale: 0, opacity: 0 },
2400
2400
  animate: { scale: 1, opacity: 1 },
2401
2401
  exit: { scale: 0, opacity: 0 },
2402
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2402
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2403
2403
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-[18px]", "aria-hidden": true })
2404
2404
  },
2405
2405
  "check"
@@ -2409,7 +2409,7 @@ var WizardStepIndicator = ({
2409
2409
  initial: { scale: 0.8, opacity: 0 },
2410
2410
  animate: { scale: 1, opacity: 1 },
2411
2411
  exit: { scale: 0.8, opacity: 0 },
2412
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2412
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2413
2413
  children: stepNumber
2414
2414
  },
2415
2415
  "number"
@@ -2420,7 +2420,7 @@ var WizardStepIndicator = ({
2420
2420
  var WizardVerticalTrackBar = () => {
2421
2421
  const { currentStep, totalSteps, goToStep, completedSteps, getSteps } = useWizardStepper();
2422
2422
  const steps = getSteps();
2423
- return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: true, transition: chunkVAWEXEJZ_cjs.fadeTransition, children: steps.map((step, index) => {
2423
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: true, transition: chunkI2KRZLP4_cjs.fadeTransition, children: steps.map((step, index) => {
2424
2424
  const stepNumber = index + 1;
2425
2425
  const isCompleted = completedSteps.includes(stepNumber);
2426
2426
  const isCurrent = currentStep === stepNumber;
@@ -2434,7 +2434,7 @@ var WizardVerticalTrackBar = () => {
2434
2434
  {
2435
2435
  layout: true,
2436
2436
  className: "flex items-center gap-2",
2437
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2437
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2438
2438
  children: [
2439
2439
  /* @__PURE__ */ jsxRuntime.jsx(
2440
2440
  Button,
@@ -2461,7 +2461,7 @@ var WizardVerticalTrackBar = () => {
2461
2461
  animate: {
2462
2462
  color: isCurrent || isCompleted ? "hsl(var(--foreground))" : "hsl(var(--muted-foreground))"
2463
2463
  },
2464
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2464
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2465
2465
  className: "ml-4 text-base font-medium",
2466
2466
  children: step.title
2467
2467
  }
@@ -2478,7 +2478,7 @@ var WizardVerticalTrackBar = () => {
2478
2478
  scaleY: isCompleted ? 1 : 0.35,
2479
2479
  backgroundColor: isCompleted ? "hsl(var(--foreground))" : "hsl(var(--border))"
2480
2480
  },
2481
- transition: chunkVAWEXEJZ_cjs.fadeTransition
2481
+ transition: chunkI2KRZLP4_cjs.fadeTransition
2482
2482
  }
2483
2483
  ) : null
2484
2484
  ]
@@ -2495,7 +2495,7 @@ var WizardHorizontalTrackBar = () => {
2495
2495
  {
2496
2496
  layout: true,
2497
2497
  className: "flex w-full flex-row flex-wrap justify-between",
2498
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2498
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2499
2499
  children: steps.map((step, index) => {
2500
2500
  const stepNumber = index + 1;
2501
2501
  const isCompleted = completedSteps.includes(stepNumber);
@@ -2534,7 +2534,7 @@ var WizardHorizontalTrackBar = () => {
2534
2534
  animate: {
2535
2535
  color: isCurrent || isCompleted ? "hsl(var(--foreground))" : "hsl(var(--muted-foreground))"
2536
2536
  },
2537
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2537
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2538
2538
  className: "hidden md:block",
2539
2539
  children: step.title
2540
2540
  }
@@ -2555,11 +2555,11 @@ var WizardStepViewport = ({
2555
2555
  return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsx(
2556
2556
  framerMotion.motion.div,
2557
2557
  {
2558
- variants: chunkVAWEXEJZ_cjs.fadeInUp,
2558
+ variants: chunkI2KRZLP4_cjs.fadeInUp,
2559
2559
  initial: "initial",
2560
2560
  animate: "animate",
2561
2561
  exit: "exit",
2562
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
2562
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
2563
2563
  className,
2564
2564
  children
2565
2565
  },
@@ -3499,7 +3499,7 @@ function MultiSelect({
3499
3499
  onChange,
3500
3500
  value: selectedValues
3501
3501
  }) {
3502
- const [buttonRef, popoverWidth] = chunk3EGBCU4W_cjs.usePopoverWidth();
3502
+ const [buttonRef, popoverWidth] = chunkAD2ZGEQ5_cjs.usePopoverWidth();
3503
3503
  const onSelectHandler = (value) => {
3504
3504
  const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
3505
3505
  onChange(nextValues);
@@ -3815,7 +3815,7 @@ var CopyToClipboardButton = ({
3815
3815
  ),
3816
3816
  initial: false,
3817
3817
  animate: { opacity: isHoverable ? void 0 : 1 },
3818
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
3818
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
3819
3819
  children: [
3820
3820
  /* @__PURE__ */ jsxRuntime.jsx(
3821
3821
  Button,
@@ -3832,7 +3832,7 @@ var CopyToClipboardButton = ({
3832
3832
  initial: { scale: 0.6, opacity: 0 },
3833
3833
  animate: { scale: 1, opacity: 1 },
3834
3834
  exit: { scale: 0.6, opacity: 0 },
3835
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
3835
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
3836
3836
  children: /* @__PURE__ */ jsxRuntime.jsx(
3837
3837
  lucideReact.Check,
3838
3838
  {
@@ -3848,7 +3848,7 @@ var CopyToClipboardButton = ({
3848
3848
  initial: { scale: 0.6, opacity: 0 },
3849
3849
  animate: { scale: 1, opacity: 1 },
3850
3850
  exit: { scale: 0.6, opacity: 0 },
3851
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
3851
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
3852
3852
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "size-4 text-muted-foreground", "aria-hidden": true })
3853
3853
  },
3854
3854
  "copy"
@@ -3861,7 +3861,7 @@ var CopyToClipboardButton = ({
3861
3861
  layout: true,
3862
3862
  className: "pointer-events-none absolute left-8 top-1/2 z-10 hidden -translate-y-1/2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground shadow-md peer-hover:block",
3863
3863
  animate: { opacity: isCopying ? 1 : 0.9 },
3864
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
3864
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
3865
3865
  children: isCopying ? copiedLabel : copyLabel
3866
3866
  }
3867
3867
  )
@@ -5228,7 +5228,7 @@ var InfiniteScroller = ({
5228
5228
  initial: { opacity: 0, height: 0 },
5229
5229
  animate: { opacity: 1, height: "auto" },
5230
5230
  exit: { opacity: 0, height: 0 },
5231
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
5231
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
5232
5232
  children: loadingIndicator
5233
5233
  },
5234
5234
  "loading"
@@ -5239,10 +5239,10 @@ var InfiniteScroller = ({
5239
5239
  framerMotion.motion.div,
5240
5240
  {
5241
5241
  layout: true,
5242
- variants: chunkVAWEXEJZ_cjs.fadeInUp,
5242
+ variants: chunkI2KRZLP4_cjs.fadeInUp,
5243
5243
  initial: "initial",
5244
5244
  animate: "animate",
5245
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
5245
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
5246
5246
  children: renderItem(item, index)
5247
5247
  },
5248
5248
  key
@@ -5254,7 +5254,7 @@ var InfiniteScroller = ({
5254
5254
  className: "flex h-full items-center justify-center text-muted-foreground",
5255
5255
  initial: { opacity: 0 },
5256
5256
  animate: { opacity: 1 },
5257
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
5257
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
5258
5258
  children: emptyContent ?? "No items"
5259
5259
  }
5260
5260
  ) }),
@@ -5265,7 +5265,7 @@ var InfiniteScroller = ({
5265
5265
  initial: { opacity: 0, y: 16 },
5266
5266
  animate: { opacity: 1, y: 0 },
5267
5267
  exit: { opacity: 0, y: 12 },
5268
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
5268
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
5269
5269
  children: /* @__PURE__ */ jsxRuntime.jsx(
5270
5270
  framerMotion.motion.div,
5271
5271
  {
@@ -5903,14 +5903,14 @@ var Timeline = ({
5903
5903
  framerMotion.motion.div,
5904
5904
  {
5905
5905
  className: chunkYAF2X7W5_cjs.cn("mt-4 flex flex-col items-start md:mt-5", className),
5906
- variants: chunkVAWEXEJZ_cjs.staggerContainer,
5906
+ variants: chunkI2KRZLP4_cjs.staggerContainer,
5907
5907
  initial: "initial",
5908
5908
  animate: "animate",
5909
5909
  children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs(
5910
5910
  framerMotion.motion.div,
5911
5911
  {
5912
- variants: chunkVAWEXEJZ_cjs.staggerItem,
5913
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
5912
+ variants: chunkI2KRZLP4_cjs.staggerItem,
5913
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
5914
5914
  className: "flex min-h-[66px] w-full",
5915
5915
  children: [
5916
5916
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkYAF2X7W5_cjs.cn("relative", isMobile ? "w-[30%]" : "w-[16%]"), children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5919,7 +5919,7 @@ var Timeline = ({
5919
5919
  className: "absolute -top-1.5 w-full pr-[18px] text-right md:pr-5",
5920
5920
  initial: { opacity: 0, x: -6 },
5921
5921
  animate: { opacity: 1, x: 0 },
5922
- transition: { ...chunkVAWEXEJZ_cjs.fadeTransition, delay: index * 0.05 },
5922
+ transition: { ...chunkI2KRZLP4_cjs.fadeTransition, delay: index * 0.05 },
5923
5923
  children: leftContent ? leftContent(event) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5924
5924
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs font-medium leading-5 md:text-sm", children: event.time }),
5925
5925
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs font-medium leading-5 md:text-sm", children: event.date })
@@ -5936,7 +5936,7 @@ var Timeline = ({
5936
5936
  ),
5937
5937
  initial: { scaleY: 0 },
5938
5938
  animate: { scaleY: 1 },
5939
- transition: { ...chunkVAWEXEJZ_cjs.fadeTransition, delay: index * 0.05 }
5939
+ transition: { ...chunkI2KRZLP4_cjs.fadeTransition, delay: index * 0.05 }
5940
5940
  }
5941
5941
  ) : null,
5942
5942
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5945,7 +5945,7 @@ var Timeline = ({
5945
5945
  className: "bg-primary relative z-10 size-4 rounded-full",
5946
5946
  initial: { scale: 0 },
5947
5947
  animate: { scale: 1 },
5948
- transition: { ...chunkVAWEXEJZ_cjs.fadeTransition, delay: index * 0.05 + 0.04 }
5948
+ transition: { ...chunkI2KRZLP4_cjs.fadeTransition, delay: index * 0.05 + 0.04 }
5949
5949
  }
5950
5950
  )
5951
5951
  ] }),
@@ -5998,11 +5998,11 @@ var ImportFileModalContent = ({
5998
5998
  return /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { className: chunkYAF2X7W5_cjs.cn("rounded-md sm:max-w-[450px]", className), children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: !showConfirmation ? /* @__PURE__ */ jsxRuntime.jsxs(
5999
5999
  framerMotion.motion.div,
6000
6000
  {
6001
- variants: chunkVAWEXEJZ_cjs.fadeInScale,
6001
+ variants: chunkI2KRZLP4_cjs.fadeInScale,
6002
6002
  initial: "initial",
6003
6003
  animate: "animate",
6004
6004
  exit: "exit",
6005
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
6005
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
6006
6006
  children: [
6007
6007
  /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
6008
6008
  /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-left", children: dialogTitle }),
@@ -6014,7 +6014,7 @@ var ImportFileModalContent = ({
6014
6014
  className: "flex flex-col rounded-md bg-muted/50 px-3 py-2",
6015
6015
  initial: { opacity: 0, y: 6 },
6016
6016
  animate: { opacity: 1, y: 0 },
6017
- transition: { ...chunkVAWEXEJZ_cjs.fadeTransition, delay: 0.05 },
6017
+ transition: { ...chunkI2KRZLP4_cjs.fadeTransition, delay: 0.05 },
6018
6018
  children: [
6019
6019
  /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.div, { className: "flex flex-row items-center", children: [
6020
6020
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -6051,7 +6051,7 @@ var ImportFileModalContent = ({
6051
6051
  initial: { opacity: 0, x: -8 },
6052
6052
  animate: { opacity: 1, x: 0 },
6053
6053
  exit: { opacity: 0, x: 8 },
6054
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
6054
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
6055
6055
  children: /* @__PURE__ */ jsxRuntime.jsxs(FileUploaderItem, { index, children: [
6056
6056
  /* @__PURE__ */ jsxRuntime.jsx(
6057
6057
  lucideReact.Paperclip,
@@ -6101,11 +6101,11 @@ var ImportFileModalContent = ({
6101
6101
  ) : /* @__PURE__ */ jsxRuntime.jsxs(
6102
6102
  framerMotion.motion.div,
6103
6103
  {
6104
- variants: chunkVAWEXEJZ_cjs.fadeInScale,
6104
+ variants: chunkI2KRZLP4_cjs.fadeInScale,
6105
6105
  initial: "initial",
6106
6106
  animate: "animate",
6107
6107
  exit: "exit",
6108
- transition: chunkVAWEXEJZ_cjs.fadeTransition,
6108
+ transition: chunkI2KRZLP4_cjs.fadeTransition,
6109
6109
  children: [
6110
6110
  /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
6111
6111
  /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-left", children: processingTitle }),
@@ -6701,7 +6701,7 @@ function useAppRedirectUrls({
6701
6701
  queries: requests.map(
6702
6702
  ({ clientId, redirectUri, forwardedTo, queryKey }) => ({
6703
6703
  queryKey,
6704
- queryFn: ({ signal }) => chunk3EGBCU4W_cjs.initiateService.fetchRedirectUrl(
6704
+ queryFn: ({ signal }) => chunkAD2ZGEQ5_cjs.initiateService.fetchRedirectUrl(
6705
6705
  { clientId, redirectUri, forwardedTo },
6706
6706
  signal
6707
6707
  ),
@@ -6740,7 +6740,7 @@ function useAppRedirectUrls({
6740
6740
  }
6741
6741
  var AppSwitcher = ({ forwardedTo }) => {
6742
6742
  const [open, setOpen] = React8.useState(false);
6743
- const config = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state.getConfig());
6743
+ const config = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state.getConfig());
6744
6744
  const filteredApps = React8.useMemo(
6745
6745
  () => filteredAppSwitcherData.filter((app) => app.id !== config.name),
6746
6746
  [config.name]
@@ -6779,7 +6779,7 @@ function ThemeSwitcher({
6779
6779
  className,
6780
6780
  showChevron = true
6781
6781
  } = {}) {
6782
- const { theme, setTheme } = chunk3EGBCU4W_cjs.useTheme();
6782
+ const { theme, setTheme } = chunkAD2ZGEQ5_cjs.useTheme();
6783
6783
  const { Icon: ThemeIcon } = OPTIONS[theme];
6784
6784
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
6785
6785
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6847,7 +6847,7 @@ function ThemeSwitcher({
6847
6847
  // src/services/user.service.ts
6848
6848
  var UserService = class {
6849
6849
  async getUserInfo() {
6850
- return chunkVAWEXEJZ_cjs.iamClient.get(`${chunkVAWEXEJZ_cjs.PROFILE_ENDPOINTS.ME}`);
6850
+ return chunkI2KRZLP4_cjs.iamClient.get(`${chunkI2KRZLP4_cjs.PROFILE_ENDPOINTS.ME}`);
6851
6851
  }
6852
6852
  };
6853
6853
  var userService = new UserService();
@@ -6889,14 +6889,14 @@ function UserAvatar({ size = "sm" }) {
6889
6889
  );
6890
6890
  }
6891
6891
  function UserDropdownMenu() {
6892
- const { name } = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state.config);
6892
+ const { name } = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state.config);
6893
6893
  const { data } = useGetUserInfo();
6894
6894
  const userData = data?.data;
6895
- const { isPending, mutateAsync } = chunk3EGBCU4W_cjs.useLogout();
6895
+ const { isPending, mutateAsync } = chunkAD2ZGEQ5_cjs.useLogout();
6896
6896
  const { resetProjectStore } = chunk6GCU5LM7_cjs.useProjectStore();
6897
6897
  const { setUnAuthenticated, clearTokens } = chunk6GCU5LM7_cjs.useAuthStore();
6898
6898
  const { resetSelectedLanguages } = chunk4QN4CYSC_cjs.useLanguageViewStore();
6899
- const { data: myOrgsData, isLoading: isOrgsLoading } = chunk3EGBCU4W_cjs.useGetMyOrganizations();
6899
+ const { data: myOrgsData, isLoading: isOrgsLoading } = chunkAD2ZGEQ5_cjs.useGetMyOrganizations();
6900
6900
  const fullName = [userData?.firstName, userData?.lastName].filter(Boolean).join(" ") || "\u2014";
6901
6901
  const email = userData?.email || "";
6902
6902
  const roles = Object.values(userData?.roles || {}).flat();
@@ -7026,7 +7026,7 @@ var languages = [
7026
7026
  { key: "fr", title: "French" }
7027
7027
  ];
7028
7028
  function LanguageSelector() {
7029
- const { changeLanguage, language } = chunk3EGBCU4W_cjs.useLanguageSwitcher();
7029
+ const { changeLanguage, language } = chunkAD2ZGEQ5_cjs.useLanguageSwitcher();
7030
7030
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
7031
7031
  /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
7032
7032
  "button",
@@ -7164,7 +7164,7 @@ var NotificationListenerService = class {
7164
7164
  if (refreshLogin && navigator.onLine === false) return;
7165
7165
  try {
7166
7166
  if (refreshLogin)
7167
- await refreshLoginCall(chunk3EGBCU4W_cjs.notificationService.getNotifications(1, 1));
7167
+ await refreshLoginCall(chunkAD2ZGEQ5_cjs.notificationService.getNotifications(1, 1));
7168
7168
  if (!this.wanted) return;
7169
7169
  await this.connection.start();
7170
7170
  this.attempt = 0;
@@ -7189,7 +7189,7 @@ var notificationListenerService = new NotificationListenerService();
7189
7189
 
7190
7190
  // src/components/common/notification/use-notification-socket.ts
7191
7191
  function useNotificationSocket() {
7192
- const { data: configData } = chunk3EGBCU4W_cjs.useGetBlocksNotificationConfig(0, 100);
7192
+ const { data: configData } = chunkAD2ZGEQ5_cjs.useGetBlocksNotificationConfig(0, 100);
7193
7193
  const queryClient = reactQuery.useQueryClient();
7194
7194
  notificationListenerService.connect();
7195
7195
  React8.useEffect(() => {
@@ -7204,7 +7204,7 @@ function useNotificationSocket() {
7204
7204
  notificationListenerService.connection.on(
7205
7205
  config.notifyMethod,
7206
7206
  (message) => {
7207
- chunk3EGBCU4W_cjs.notificationService.getNotificationConfig(config, message);
7207
+ chunkAD2ZGEQ5_cjs.notificationService.getNotificationConfig(config, message);
7208
7208
  try {
7209
7209
  const notice = typeof message === "string" ? JSON.parse(message) : message;
7210
7210
  const denom = JSON.parse(
@@ -7228,12 +7228,12 @@ function useNotificationFeed(open) {
7228
7228
  const [notifications, setNotifications] = React8.useState([]);
7229
7229
  const [hasMore, setHasMore] = React8.useState(true);
7230
7230
  const listRef = React8.useRef(null);
7231
- const { data, isLoading, isFetching } = chunk3EGBCU4W_cjs.useGetNotifications(
7231
+ const { data, isLoading, isFetching } = chunkAD2ZGEQ5_cjs.useGetNotifications(
7232
7232
  pageNumber,
7233
7233
  PAGE_SIZE
7234
7234
  );
7235
- const markAsRead = chunk3EGBCU4W_cjs.useMarkAsRead();
7236
- const markAllAsRead = chunk3EGBCU4W_cjs.useMarkAllAsRead();
7235
+ const markAsRead = chunkAD2ZGEQ5_cjs.useMarkAsRead();
7236
+ const markAllAsRead = chunkAD2ZGEQ5_cjs.useMarkAllAsRead();
7237
7237
  React8.useEffect(() => {
7238
7238
  if (!data?.notifications) return;
7239
7239
  setNotifications((prev) => {
@@ -7467,7 +7467,7 @@ function ConsoleHeader() {
7467
7467
  window.addEventListener("scroll", handleScroll);
7468
7468
  return () => window.removeEventListener("scroll", handleScroll);
7469
7469
  }, []);
7470
- const { appLightLogo, appDarkLogo } = chunk3EGBCU4W_cjs.useLogo();
7470
+ const { appLightLogo, appDarkLogo } = chunkAD2ZGEQ5_cjs.useLogo();
7471
7471
  return /* @__PURE__ */ jsxRuntime.jsx(
7472
7472
  "div",
7473
7473
  {
@@ -7646,7 +7646,7 @@ var EnvironmentCard = ({
7646
7646
  className
7647
7647
  }) => {
7648
7648
  const { setSelectedProject, setTenantGroup } = chunk6GCU5LM7_cjs.useProjectStore();
7649
- const { mutateAsync } = chunk3EGBCU4W_cjs.useStartImpersonation();
7649
+ const { mutateAsync } = chunkAD2ZGEQ5_cjs.useStartImpersonation();
7650
7650
  const navigate = reactRouter.useNavigate();
7651
7651
  const handleCardClick = async () => {
7652
7652
  try {
@@ -7700,11 +7700,11 @@ function EnvironmentList({
7700
7700
  }) {
7701
7701
  const navigate = reactRouter.useNavigate();
7702
7702
  const { pathname } = reactRouter.useLocation();
7703
- const { data: projectGroups = [], isLoading } = chunk3EGBCU4W_cjs.useGetProjects({
7703
+ const { data: projectGroups = [], isLoading } = chunkAD2ZGEQ5_cjs.useGetProjects({
7704
7704
  enabled: true
7705
7705
  });
7706
7706
  const { selectedProject, setSelectedProject } = chunk6GCU5LM7_cjs.useProjectStore();
7707
- const { data: projectData } = chunk3EGBCU4W_cjs.useGetProject();
7707
+ const { data: projectData } = chunkAD2ZGEQ5_cjs.useGetProject();
7708
7708
  const pendingProjectRef = React8.useRef(null);
7709
7709
  const redirectRegexMap = React8.useMemo(
7710
7710
  () => Object.entries(redirectPaths).reduce(
@@ -7837,8 +7837,19 @@ function ProtectedGuard({
7837
7837
  React8.useEffect(() => {
7838
7838
  if (!isAuthenticated) navigate(defaultPublicPath);
7839
7839
  }, [isAuthenticated, defaultPublicPath, navigate]);
7840
+ React8.useEffect(
7841
+ () => chunkI2KRZLP4_cjs.subscribeToSignOut(
7842
+ () => window.location.replace(
7843
+ `${window.location.origin}${defaultPublicPath}`
7844
+ )
7845
+ ),
7846
+ [defaultPublicPath]
7847
+ );
7840
7848
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
7841
7849
  }
7850
+
7851
+ // src/guards/sign-in-callback.ts
7852
+ var isSignInCallbackPath = (pathname) => /^\/login\/callback\/?$/.test(pathname);
7842
7853
  var useAppState = () => {
7843
7854
  const [isMounted, setIsMounted] = React8.useState(false);
7844
7855
  React8.useEffect(() => {
@@ -7853,10 +7864,18 @@ function PublicGuard({
7853
7864
  const { isAuthenticated } = chunk6GCU5LM7_cjs.useAuthStore();
7854
7865
  const { isMounted } = useAppState();
7855
7866
  const navigate = reactRouter.useNavigate();
7867
+ const { pathname } = reactRouter.useLocation();
7868
+ const isCompletingSignIn = isSignInCallbackPath(pathname);
7856
7869
  React8.useEffect(() => {
7857
- if (!isMounted) return;
7870
+ if (!isMounted || isCompletingSignIn) return;
7858
7871
  if (isAuthenticated) navigate(defaultProtectedPath, { replace: true });
7859
- }, [isAuthenticated, isMounted, navigate, defaultProtectedPath]);
7872
+ }, [
7873
+ isAuthenticated,
7874
+ isMounted,
7875
+ isCompletingSignIn,
7876
+ navigate,
7877
+ defaultProtectedPath
7878
+ ]);
7860
7879
  if (!isMounted) return null;
7861
7880
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
7862
7881
  }
@@ -7866,9 +7885,10 @@ function AuthResolver({ children }) {
7866
7885
  React8.useEffect(() => {
7867
7886
  if (hasResolved.current) return;
7868
7887
  hasResolved.current = true;
7888
+ if (isSignInCallbackPath(window.location.pathname)) return;
7869
7889
  async function resolve() {
7870
7890
  try {
7871
- const res = await chunkVAWEXEJZ_cjs.iamClient.get(`${chunkVAWEXEJZ_cjs.AUTH_ENDPOINTS.ME}`);
7891
+ const res = await chunkI2KRZLP4_cjs.iamClient.get(`${chunkI2KRZLP4_cjs.AUTH_ENDPOINTS.ME}`);
7872
7892
  setUser(res);
7873
7893
  setAuthenticated();
7874
7894
  } catch {
@@ -7949,6 +7969,11 @@ var AppLoadingSpinner = ({ size = 64 }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRu
7949
7969
  ] });
7950
7970
  var projectNameFor = (projects, tenantId) => tenantId && projects.find((p) => p.tenantId === tenantId)?.name || null;
7951
7971
  var claimKeyOf = (claim) => claim ? `${claim.tabId}|${claim.tenantId}|${claim.ts}` : null;
7972
+ var SESSION_ENDED_CODES = /* @__PURE__ */ new Set([
7973
+ "invalid_refresh_token",
7974
+ "session_expired"
7975
+ ]);
7976
+ var isSessionEnded = (error) => error instanceof chunkX4YCRWXO_cjs.HttpError && error.status === 401 && SESSION_ENDED_CODES.has(String(error.errors?.error ?? ""));
7952
7977
  var useLiveOwnerProbe = ({
7953
7978
  cookieTenantId,
7954
7979
  ownTenantId,
@@ -7958,8 +7983,8 @@ var useLiveOwnerProbe = ({
7958
7983
  if (!cookieTenantId || !ownTenantId || cookieTenantId === ownTenantId) {
7959
7984
  return null;
7960
7985
  }
7961
- const owner = chunkVAWEXEJZ_cjs.readCurrentOwner();
7962
- return owner && owner.tabId !== chunkVAWEXEJZ_cjs.TAB_ID && owner.tenantId === cookieTenantId ? owner : null;
7986
+ const owner = chunkI2KRZLP4_cjs.readCurrentOwner();
7987
+ return owner && owner.tabId !== chunkI2KRZLP4_cjs.TAB_ID && owner.tenantId === cookieTenantId ? owner : null;
7963
7988
  }, [cookieTenantId, ownTenantId]);
7964
7989
  const claimKey = claimKeyOf(foreignClaim);
7965
7990
  const [probedKey, setProbedKey] = React8.useState(null);
@@ -7971,9 +7996,9 @@ var useLiveOwnerProbe = ({
7971
7996
  const claim = foreignClaimRef.current;
7972
7997
  if (!claim || !claimKey) return;
7973
7998
  let cancelled = false;
7974
- void chunkVAWEXEJZ_cjs.isTenantHeldElsewhere(claim.tenantId).then((held) => {
7999
+ void chunkI2KRZLP4_cjs.isTenantHeldElsewhere(claim.tenantId).then((held) => {
7975
8000
  if (cancelled) return;
7976
- if (held && chunkVAWEXEJZ_cjs.isSameClaim(chunkVAWEXEJZ_cjs.readCurrentOwner(), claim)) {
8001
+ if (held && chunkI2KRZLP4_cjs.isSameClaim(chunkI2KRZLP4_cjs.readCurrentOwner(), claim)) {
7977
8002
  onHeldElsewhereRef.current(claim.tenantId);
7978
8003
  }
7979
8004
  setProbedKey(claimKey);
@@ -7987,8 +8012,10 @@ var useLiveOwnerProbe = ({
7987
8012
  var ImpersonationChecker = ({
7988
8013
  children
7989
8014
  }) => {
7990
- const { data, isLoading, isSuccess } = chunk3EGBCU4W_cjs.useImpersonationStatusChecker();
8015
+ const { data } = chunkAD2ZGEQ5_cjs.useImpersonationStatusChecker();
7991
8016
  const { setImpersonation, isInitialized, setInitialized } = chunk4QN4CYSC_cjs.useImpersonateStore();
8017
+ chunkAD2ZGEQ5_cjs.useSessionTenantGuard();
8018
+ chunkAD2ZGEQ5_cjs.useStatusFirstOnTabReturn();
7992
8019
  React8.useEffect(() => {
7993
8020
  if (!data) return;
7994
8021
  setImpersonation(
@@ -7998,7 +8025,7 @@ var ImpersonationChecker = ({
7998
8025
  );
7999
8026
  setInitialized(true);
8000
8027
  }, [data, setImpersonation, setInitialized]);
8001
- if (isLoading || !isSuccess || !isInitialized) return null;
8028
+ if (!data || !isInitialized) return null;
8002
8029
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
8003
8030
  };
8004
8031
  function ImpersonationBlocked({
@@ -8006,6 +8033,8 @@ function ImpersonationBlocked({
8006
8033
  description,
8007
8034
  primaryLabel,
8008
8035
  onPrimary,
8036
+ secondaryLabel,
8037
+ onSecondary,
8009
8038
  consolePath
8010
8039
  }) {
8011
8040
  const navigate = reactRouter.useNavigate();
@@ -8016,6 +8045,7 @@ function ImpersonationBlocked({
8016
8045
  ] }),
8017
8046
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
8018
8047
  primaryLabel && onPrimary && /* @__PURE__ */ jsxRuntime.jsx(Button, { onClick: onPrimary, children: primaryLabel }),
8048
+ secondaryLabel && onSecondary && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", onClick: onSecondary, children: secondaryLabel }),
8019
8049
  consolePath && /* @__PURE__ */ jsxRuntime.jsx(
8020
8050
  Button,
8021
8051
  {
@@ -8044,8 +8074,8 @@ function ImpersonationTerminator({
8044
8074
  detachedTenantId,
8045
8075
  setDetached
8046
8076
  } = chunk4QN4CYSC_cjs.useImpersonateStore();
8047
- const { mutateAsync } = chunk3EGBCU4W_cjs.useStopImpersonation();
8048
- const recordClaimedTenant = chunk3EGBCU4W_cjs.useRecordClaimedTenant();
8077
+ const { mutateAsync } = chunkAD2ZGEQ5_cjs.useStopImpersonation();
8078
+ const recordClaimedTenant = chunkAD2ZGEQ5_cjs.useRecordClaimedTenant();
8049
8079
  const { projects } = chunk6GCU5LM7_cjs.useProjectStore();
8050
8080
  const isTriggering = React8.useRef(false);
8051
8081
  const [isTerminating, setIsTerminating] = React8.useState(false);
@@ -8057,7 +8087,7 @@ function ImpersonationTerminator({
8057
8087
  });
8058
8088
  React8.useEffect(() => {
8059
8089
  if (!rootTenantId) return;
8060
- return chunkVAWEXEJZ_cjs.subscribeToTenantClaims((claim) => {
8090
+ return chunkI2KRZLP4_cjs.subscribeToTenantClaims((claim) => {
8061
8091
  recordClaimedTenant(claim.tenantId, rootTenantId);
8062
8092
  if (claim.tenantId === rootTenantId) {
8063
8093
  setDetached(null);
@@ -8070,25 +8100,36 @@ function ImpersonationTerminator({
8070
8100
  React8.useEffect(() => {
8071
8101
  if (detachedReason === "console") setDetached(null);
8072
8102
  }, [detachedReason, setDetached]);
8103
+ const [returnFailure, setReturnFailure] = React8.useState(
8104
+ null
8105
+ );
8106
+ const signOut = chunkAD2ZGEQ5_cjs.useSignOut();
8107
+ React8.useEffect(() => {
8108
+ if (!isImpersonated) setReturnFailure(null);
8109
+ }, [isImpersonated]);
8073
8110
  React8.useEffect(() => {
8074
8111
  if (isTriggering.current || !isImpersonated) return;
8075
8112
  if (isDetached) return;
8076
8113
  if (isProbingOwner) return;
8114
+ if (returnFailure) return;
8077
8115
  isTriggering.current = true;
8078
8116
  setIsTerminating(true);
8079
8117
  const stopImpersonation = async () => {
8080
- let sessionIsRootScoped = false;
8081
8118
  try {
8082
- await mutateAsync(void 0);
8083
- sessionIsRootScoped = true;
8084
- } catch (error) {
8085
- if (!(error instanceof chunkX4YCRWXO_cjs.HttpError) || error.status !== 401) {
8086
- console.error("Error stopping impersonation:", error);
8119
+ const { status, stopError } = await mutateAsync(void 0);
8120
+ if (!status.impersonated) {
8121
+ terminate(rootTenantId);
8122
+ if (rootTenantId) chunkI2KRZLP4_cjs.claimTenant(rootTenantId);
8123
+ return;
8087
8124
  }
8088
- sessionIsRootScoped = error instanceof chunkX4YCRWXO_cjs.HttpError && error.status === 401;
8125
+ console.error("Error stopping impersonation:", stopError);
8126
+ setReturnFailure(
8127
+ isSessionEnded(stopError) ? "session-ended" : "unconfirmed"
8128
+ );
8129
+ } catch (error) {
8130
+ console.error("Error stopping impersonation:", error);
8131
+ setReturnFailure("unconfirmed");
8089
8132
  } finally {
8090
- terminate(rootTenantId);
8091
- if (sessionIsRootScoped && rootTenantId) chunkVAWEXEJZ_cjs.claimTenant(rootTenantId);
8092
8133
  isTriggering.current = false;
8093
8134
  setIsTerminating(false);
8094
8135
  }
@@ -8100,7 +8141,8 @@ function ImpersonationTerminator({
8100
8141
  isImpersonated,
8101
8142
  isDetached,
8102
8143
  isProbingOwner,
8103
- rootTenantId
8144
+ rootTenantId,
8145
+ returnFailure
8104
8146
  ]);
8105
8147
  if (isDetached) {
8106
8148
  const name = projectNameFor(projects, detachedTenantId);
@@ -8110,7 +8152,35 @@ function ImpersonationTerminator({
8110
8152
  title: name ? `Your session is in ${name}` : "Your session is in a project",
8111
8153
  description: "The project is open in another window. A session can only be in one place at a time.",
8112
8154
  primaryLabel: name ? `Leave ${name}` : "Leave the project",
8113
- onPrimary: () => setDetached(null)
8155
+ onPrimary: () => {
8156
+ setReturnFailure(null);
8157
+ setDetached(null);
8158
+ }
8159
+ }
8160
+ );
8161
+ }
8162
+ if (isImpersonated && returnFailure === "session-ended") {
8163
+ return /* @__PURE__ */ jsxRuntime.jsx(
8164
+ ImpersonationBlocked,
8165
+ {
8166
+ title: "Your session has ended",
8167
+ description: "Sign in again to continue.",
8168
+ primaryLabel: "Sign in again",
8169
+ onPrimary: signOut
8170
+ }
8171
+ );
8172
+ }
8173
+ if (isImpersonated && returnFailure === "unconfirmed") {
8174
+ const name = projectNameFor(projects, impersonatedTenantId);
8175
+ return /* @__PURE__ */ jsxRuntime.jsx(
8176
+ ImpersonationBlocked,
8177
+ {
8178
+ title: "Couldn't return to the console",
8179
+ description: name ? `Your session is still in ${name}. Try again, or sign out.` : "Your session is still in a project. Try again, or sign out.",
8180
+ primaryLabel: "Try again",
8181
+ onPrimary: () => setReturnFailure(null),
8182
+ secondaryLabel: "Sign out",
8183
+ onSecondary: signOut
8114
8184
  }
8115
8185
  );
8116
8186
  }
@@ -8133,9 +8203,9 @@ function ImpersonationSynchronizer({
8133
8203
  setImpersonationError,
8134
8204
  setDetached
8135
8205
  } = chunk4QN4CYSC_cjs.useImpersonateStore();
8136
- const { mutateAsync } = chunk3EGBCU4W_cjs.useStartImpersonation();
8137
- const recordClaimedTenant = chunk3EGBCU4W_cjs.useRecordClaimedTenant();
8138
- const { data: _data } = chunk3EGBCU4W_cjs.useGetProjects({ enabled: true });
8206
+ const { mutateAsync } = chunkAD2ZGEQ5_cjs.useStartImpersonation();
8207
+ const recordClaimedTenant = chunkAD2ZGEQ5_cjs.useRecordClaimedTenant();
8208
+ const { data: _data } = chunkAD2ZGEQ5_cjs.useGetProjects({ enabled: true });
8139
8209
  const { selectedProject, setSelectedProject, projects, setTenantGroup } = chunk6GCU5LM7_cjs.useProjectStore();
8140
8210
  const isTriggering = React8.useRef(false);
8141
8211
  const [isImpersonating, setIsImpersonating] = React8.useState(false);
@@ -8170,7 +8240,7 @@ function ImpersonationSynchronizer({
8170
8240
  ]);
8171
8241
  const getImpersonatedProject = async () => {
8172
8242
  try {
8173
- const res = chunk3EGBCU4W_cjs.projectService.getProject();
8243
+ const res = chunkAD2ZGEQ5_cjs.projectService.getProject();
8174
8244
  return (await res).data;
8175
8245
  } catch (error) {
8176
8246
  console.error("Error fetching projects:", error);
@@ -8231,10 +8301,10 @@ function ImpersonationSynchronizer({
8231
8301
  const isAttached = !!routeTenantId && routeTenantId === impersonatedTenantId && !detachedHere && !impersonationError && !isProbingOwner;
8232
8302
  React8.useEffect(() => {
8233
8303
  if (!isAttached || !routeTenantId) return;
8234
- return chunkVAWEXEJZ_cjs.holdTenant(routeTenantId);
8304
+ return chunkI2KRZLP4_cjs.holdTenant(routeTenantId);
8235
8305
  }, [isAttached, routeTenantId]);
8236
8306
  React8.useEffect(() => {
8237
- return chunkVAWEXEJZ_cjs.subscribeToTenantClaims((claim) => {
8307
+ return chunkI2KRZLP4_cjs.subscribeToTenantClaims((claim) => {
8238
8308
  recordClaimedTenant(claim.tenantId, rootTenantId);
8239
8309
  const mine = routeTenantIdRef.current;
8240
8310
  if (!mine) return;
@@ -8451,7 +8521,7 @@ var LoginHeader = ({
8451
8521
  }) => {
8452
8522
  const {
8453
8523
  config: { appLogoUrl }
8454
- } = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state);
8524
+ } = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state);
8455
8525
  const resolveLogo = (variant) => {
8456
8526
  if (!appLogoUrl) return void 0;
8457
8527
  if (typeof appLogoUrl === "string") return appLogoUrl;
@@ -9716,10 +9786,10 @@ var BlocksLoginPage = ({
9716
9786
  ] });
9717
9787
  };
9718
9788
  var LoginPage = () => {
9719
- const config = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state.getConfig());
9720
- const { start, isLoading } = chunk3EGBCU4W_cjs.useLogin();
9721
- const { canSignUp } = chunk3EGBCU4W_cjs.useSignUpAffordance();
9722
- const { start: startSignUp, isLoading: isSignUpLoading } = chunk3EGBCU4W_cjs.useSignUpRedirect();
9789
+ const config = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state.getConfig());
9790
+ const { start, isLoading } = chunkAD2ZGEQ5_cjs.useLogin();
9791
+ const { canSignUp } = chunkAD2ZGEQ5_cjs.useSignUpAffordance();
9792
+ const { start: startSignUp, isLoading: isSignUpLoading } = chunkAD2ZGEQ5_cjs.useSignUpRedirect();
9723
9793
  return /* @__PURE__ */ jsxRuntime.jsx(
9724
9794
  BlocksLoginPage,
9725
9795
  {
@@ -9834,10 +9904,10 @@ var BentoCard = ({
9834
9904
  );
9835
9905
  var DefaultDoc = () => /* @__PURE__ */ jsxRuntime.jsx(BentoGrid, { children: resources.map((resource) => /* @__PURE__ */ jsxRuntime.jsx(BentoCard, { ...resource }, resource.url)) });
9836
9906
  function useCreateProjectRedirect() {
9837
- const { name } = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state.config);
9907
+ const { name } = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state.config);
9838
9908
  const navigate = reactRouter.useNavigate();
9839
9909
  const osApp = filteredAppSwitcherData.find((app) => app.id === "blocks-os");
9840
- const { isFetching, isReady, redirect } = chunk3EGBCU4W_cjs.usePrefetchRedirect({
9910
+ const { isFetching, isReady, redirect } = chunkAD2ZGEQ5_cjs.usePrefetchRedirect({
9841
9911
  clientId: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.clientId) : "",
9842
9912
  redirectUri: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.redirectUri) : "",
9843
9913
  forwardedTo: "/app/create-project",
@@ -9929,10 +9999,10 @@ function useProjectOverviewRedirect({
9929
9999
  tenantGroupId
9930
10000
  }) {
9931
10001
  const navigate = reactRouter.useNavigate();
9932
- const { name } = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state.config);
10002
+ const { name } = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state.config);
9933
10003
  const osApp = filteredAppSwitcherData.find((app) => app.id === "blocks-os");
9934
10004
  const redirectedRoute = `/app/project/${tenantGroupId}/environments`;
9935
- const { isFetching, isReady, redirect } = chunk3EGBCU4W_cjs.usePrefetchRedirect({
10005
+ const { isFetching, isReady, redirect } = chunkAD2ZGEQ5_cjs.usePrefetchRedirect({
9936
10006
  clientId: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.clientId) : "",
9937
10007
  redirectUri: osApp ? chunkX4YCRWXO_cjs.getRuntimeEnv(osApp.redirectUri) : "",
9938
10008
  forwardedTo: redirectedRoute,
@@ -10292,7 +10362,7 @@ function MultiSelect2({
10292
10362
  onChange,
10293
10363
  value: selectedValues
10294
10364
  }) {
10295
- const [buttonRef, popoverWidth] = chunk3EGBCU4W_cjs.usePopoverWidth();
10365
+ const [buttonRef, popoverWidth] = chunkAD2ZGEQ5_cjs.usePopoverWidth();
10296
10366
  const onSelectHandler = (value) => {
10297
10367
  const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
10298
10368
  onChange(nextValues);
@@ -10573,7 +10643,7 @@ var useProjectListState = (projectGroups) => {
10573
10643
  })),
10574
10644
  [projectGroups]
10575
10645
  );
10576
- const searchedGroups = chunk3EGBCU4W_cjs.useDebouncedFuseFilter(
10646
+ const searchedGroups = chunkAD2ZGEQ5_cjs.useDebouncedFuseFilter(
10577
10647
  searchableGroups,
10578
10648
  searchText,
10579
10649
  SEARCH_OPTIONS
@@ -10643,7 +10713,7 @@ var SelfProjectLoading = ({ viewMode }) => {
10643
10713
  ) });
10644
10714
  };
10645
10715
  var SelfProject = ({ canCreateProject = false }) => {
10646
- const { data, isLoading } = chunk3EGBCU4W_cjs.useGetProjects({ enabled: true });
10716
+ const { data, isLoading } = chunkAD2ZGEQ5_cjs.useGetProjects({ enabled: true });
10647
10717
  const isPending = isLoading;
10648
10718
  const projectGroups = data || [];
10649
10719
  const {
@@ -10764,6 +10834,27 @@ var ConsolePage = ({ canCreateProject = false }) => {
10764
10834
  ] })
10765
10835
  ] });
10766
10836
  };
10837
+ var ANNOUNCE_WAIT_MS = 3e3;
10838
+ var announceNewSession = async () => {
10839
+ const rootTenantId = window.process?.env.BLOCKS_X_BLOCKS_KEY || "";
10840
+ let timer;
10841
+ try {
10842
+ const status = await Promise.race([
10843
+ chunkAD2ZGEQ5_cjs.impersonationService.impersonationStatus({ skipSessionCheck: true }),
10844
+ new Promise((_, reject) => {
10845
+ timer = setTimeout(
10846
+ () => reject(new Error("Impersonation status timed out")),
10847
+ ANNOUNCE_WAIT_MS
10848
+ );
10849
+ })
10850
+ ]);
10851
+ const tenantId = status.impersonated ? status.impersonatedTenantId : rootTenantId;
10852
+ if (tenantId) chunkI2KRZLP4_cjs.claimTenant(tenantId);
10853
+ } catch {
10854
+ } finally {
10855
+ clearTimeout(timer);
10856
+ }
10857
+ };
10767
10858
  var toSafeAppPath = (value) => {
10768
10859
  if (!value || !value.startsWith("/")) return null;
10769
10860
  try {
@@ -10795,8 +10886,9 @@ var CallbackPage = ({ defaultRedirectUrl }) => {
10795
10886
  if (error) callbackUrl.searchParams.set("error", error);
10796
10887
  const headers = {};
10797
10888
  if (tenantId) headers["X-Blocks-Key"] = tenantId;
10798
- fetch(callbackUrl.toString(), { headers, credentials: "include" }).then((res) => {
10889
+ fetch(callbackUrl.toString(), { headers, credentials: "include" }).then(async (res) => {
10799
10890
  if (res.ok) {
10891
+ await announceNewSession();
10800
10892
  setAuthenticated();
10801
10893
  window.location.href = appRedirectUrl;
10802
10894
  } else {
@@ -10812,7 +10904,7 @@ var CallbackPage = ({ defaultRedirectUrl }) => {
10812
10904
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-h-screen items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader, { className: "h-12 w-12 animate-spin text-gray-500" }) });
10813
10905
  };
10814
10906
  function ProfilePage() {
10815
- const { isLoading, error } = chunk3EGBCU4W_cjs.useInitiateRedirect({
10907
+ const { isLoading, error } = chunkAD2ZGEQ5_cjs.useInitiateRedirect({
10816
10908
  clientId: chunkX4YCRWXO_cjs.getRuntimeEnv("BLOCKS_IAM_CLIENT_ID"),
10817
10909
  redirectUri: chunkX4YCRWXO_cjs.getRuntimeEnv("BLOCKS_IAM_CALLBACK_URL"),
10818
10910
  forwardedTo: "/app/profile"
@@ -11090,8 +11182,8 @@ var ConfirmationModal = ({
11090
11182
  ] })
11091
11183
  ] });
11092
11184
  var DashboardOverview = () => {
11093
- const { name } = chunk3EGBCU4W_cjs.useBlocksAppConfigStore((state) => state.config);
11094
- const { data, isFetching } = chunk3EGBCU4W_cjs.useGetProject();
11185
+ const { name } = chunkAD2ZGEQ5_cjs.useBlocksAppConfigStore((state) => state.config);
11186
+ const { data, isFetching } = chunkAD2ZGEQ5_cjs.useGetProject();
11095
11187
  const {
11096
11188
  endpoints,
11097
11189
  isLoading: isLoadingEndpoints,
@@ -11185,11 +11277,11 @@ function ProjectList2({
11185
11277
  }) {
11186
11278
  const navigate = reactRouter.useNavigate();
11187
11279
  const { pathname } = reactRouter.useLocation();
11188
- const { data: projectGroups = [], isLoading } = chunk3EGBCU4W_cjs.useGetProjects({
11280
+ const { data: projectGroups = [], isLoading } = chunkAD2ZGEQ5_cjs.useGetProjects({
11189
11281
  enabled: true
11190
11282
  });
11191
11283
  const { selectedProject, setSelectedProject } = chunk6GCU5LM7_cjs.useProjectStore();
11192
- const { data: projectData } = chunk3EGBCU4W_cjs.useGetProject();
11284
+ const { data: projectData } = chunkAD2ZGEQ5_cjs.useGetProject();
11193
11285
  const pendingProjectRef = React8.useRef(null);
11194
11286
  const redirectRegexMap = React8.useMemo(
11195
11287
  () => Object.entries(redirectPaths).reduce(
@@ -11338,7 +11430,7 @@ var SetCustomDomainDialog = ({
11338
11430
  projectKey,
11339
11431
  projectEnv
11340
11432
  }) => {
11341
- const { mutateAsync, isPending } = chunk3EGBCU4W_cjs.useUpdateRepositories();
11433
+ const { mutateAsync, isPending } = chunkAD2ZGEQ5_cjs.useUpdateRepositories();
11342
11434
  const verifiedDomains = React8.useMemo(
11343
11435
  () => Array.from(
11344
11436
  new Set(domains.filter((d) => d.isDomainVerified).map((d) => d.domain))
@@ -11522,7 +11614,7 @@ var ProjectRepoList = ({
11522
11614
  data: envRepositoriesResponse,
11523
11615
  isLoading: isLoadingEnvRepos,
11524
11616
  isFetching: isFetchingEnvRepos
11525
- } = chunk3EGBCU4W_cjs.useGetEnvRepositories(project?.tenantId || "");
11617
+ } = chunkAD2ZGEQ5_cjs.useGetEnvRepositories(project?.tenantId || "");
11526
11618
  if (isLoading || isLoadingEnvRepos || isFetchingEnvRepos) {
11527
11619
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-6 rounded-lg border bg-card px-2 py-2 shadow-sm md:mt-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid-col-1 grid gap-3 px-2 py-4 md:grid-cols-2 md:gap-4 lg:gap-6", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6"].map((itemKey) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
11528
11620
  /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-5 w-1/2" }),
@@ -11622,7 +11714,7 @@ var EditProjectForm = ({
11622
11714
  onAfterSubmit
11623
11715
  }) => {
11624
11716
  const queryClient = reactQuery.useQueryClient();
11625
- const { mutateAsync, isPending } = chunk3EGBCU4W_cjs.useUpdateTenantGroup();
11717
+ const { mutateAsync, isPending } = chunkAD2ZGEQ5_cjs.useUpdateTenantGroup();
11626
11718
  const form = reactHookForm.useForm({
11627
11719
  resolver: zod$1.zodResolver(editProjectFormSchema),
11628
11720
  defaultValues: {
@@ -11759,7 +11851,7 @@ function SidebarMobileView({
11759
11851
  navigationMenus
11760
11852
  }) {
11761
11853
  const [open, setOpen] = React8.useState(false);
11762
- const { appLightLogo, appDarkLogo } = chunk3EGBCU4W_cjs.useLogo();
11854
+ const { appLightLogo, appDarkLogo } = chunkAD2ZGEQ5_cjs.useLogo();
11763
11855
  const allowedMenu = chunkBPJM3L7O_cjs.useFilteredMenus(navigationMenus);
11764
11856
  return /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onOpenChange: setOpen, children: [
11765
11857
  /* @__PURE__ */ jsxRuntime.jsx(SheetTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "icon", className: "shrink-0", children: [
@@ -11809,8 +11901,8 @@ function SidebarMenuDesktop({
11809
11901
  navigationMenus
11810
11902
  }) {
11811
11903
  const { isSidebarOpen, toggleSidebar } = React8.useContext(chunkIJMKS4XG_cjs.SidebarContext);
11812
- const { appLightLogo, appDarkLogo } = chunk3EGBCU4W_cjs.useLogo();
11813
- const icon = chunk3EGBCU4W_cjs.useIcon();
11904
+ const { appLightLogo, appDarkLogo } = chunkAD2ZGEQ5_cjs.useLogo();
11905
+ const icon = chunkAD2ZGEQ5_cjs.useIcon();
11814
11906
  const allowedMenu = chunkBPJM3L7O_cjs.useFilteredMenus(navigationMenus);
11815
11907
  const { isActivePath: isProjectOverviewRoute } = chunkBPJM3L7O_cjs.useIsActiveMenu("/app/project");
11816
11908
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -11939,7 +12031,7 @@ var ErrorBoundary = class extends React8.Component {
11939
12031
  var ArchiveProject = () => {
11940
12032
  const navigate = reactRouter.useNavigate();
11941
12033
  const projectKey = chunk6GCU5LM7_cjs.useProjectStore().selectedProject?.tenantId || "";
11942
- const { mutateAsync, isPending } = chunk3EGBCU4W_cjs.useDisableProject({ projectKey });
12034
+ const { mutateAsync, isPending } = chunkAD2ZGEQ5_cjs.useDisableProject({ projectKey });
11943
12035
  const onClickHandler = async () => {
11944
12036
  try {
11945
12037
  const res = await mutateAsync();
@@ -12909,7 +13001,7 @@ var ClearButton = ({ onClear }) => {
12909
13001
  };
12910
13002
  function Radio({ label, options, onChange, value }) {
12911
13003
  const [search, setSearch] = React8.useState("");
12912
- const [buttonRef, popoverWidth] = chunk3EGBCU4W_cjs.usePopoverWidth();
13004
+ const [buttonRef, popoverWidth] = chunkAD2ZGEQ5_cjs.usePopoverWidth();
12913
13005
  const isMobile = chunkBPJM3L7O_cjs.useIsMobile();
12914
13006
  const selected = React8.useMemo(
12915
13007
  () => options.find((item) => item.value === value) || null,
@@ -13918,5 +14010,5 @@ exports.usePaginationQueryParams = usePaginationQueryParams;
13918
14010
  exports.useRightSidePanel = useRightSidePanel;
13919
14011
  exports.useSortQueryParams = useSortQueryParams;
13920
14012
  exports.useWizardStepper = useWizardStepper;
13921
- //# sourceMappingURL=chunk-MLPOREJO.cjs.map
13922
- //# sourceMappingURL=chunk-MLPOREJO.cjs.map
14013
+ //# sourceMappingURL=chunk-2BZ2C4TS.cjs.map
14014
+ //# sourceMappingURL=chunk-2BZ2C4TS.cjs.map