@seliseblocks/genesis-os 4.3.2 → 4.3.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.
@@ -1,6 +1,6 @@
1
1
  import { refractor } from './chunk-FGY7QM3Y.js';
2
- import { useKeyboardShortcut, usePopoverWidth, useBlocksAppConfigStore, useTheme, useLogout, useGetMyOrganizations, useLanguageSwitcher, useGetBlocksNotificationConfig, notificationService, useLogo, useLogin, useSignUpAffordance, useInitiateRedirect, useIcon, initiateService, useGetNotifications, useMarkAsRead, useMarkAllAsRead, usePrefetchRedirect } from './chunk-QMVZVNIZ.js';
3
- import { showErrorToast, getForwardedToPath, formatFullDate, formatDate, debounce, deepEqual, showSuccessToast, isErrorWithErrors, getServiceBaseUrl, getServiceSwaggerUrl } from './chunk-TE3SKUL4.js';
2
+ import { useKeyboardShortcut, usePopoverWidth, useBlocksAppConfigStore, useTheme, useLogout, useGetMyOrganizations, useLanguageSwitcher, useGetBlocksNotificationConfig, notificationService, useLogo, useLogin, useSignUpAffordance, useSignUpRedirect, useInitiateRedirect, useIcon, initiateService, useGetNotifications, useMarkAsRead, useMarkAllAsRead, useDebouncedFuseFilter, usePrefetchRedirect } from './chunk-H47HQ5UX.js';
3
+ import { showErrorToast, createStorage, getForwardedToPath, debounce, formatFullDate, formatDate, deepEqual, showSuccessToast, isErrorWithErrors, getServiceBaseUrl, getServiceSwaggerUrl } from './chunk-TE3SKUL4.js';
4
4
  import { defaultRightSidePanelContextValue, RightSidePanelContext, SidebarContext, DashboardLayoutProvider } from './chunk-WIY77276.js';
5
5
  import { useIsMobile, useIsActiveMenu, useFilteredMenus } from './chunk-NF54AHIF.js';
6
6
  import { PublicGuard, ImpersonationChecker, ImpersonationTerminator, ImpersonationSynchronizer } from './chunk-25L7I5C7.js';
@@ -19,7 +19,7 @@ import { motion, AnimatePresence } from 'framer-motion';
19
19
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
20
20
  import { Slot } from '@radix-ui/react-slot';
21
21
  import { cva } from 'class-variance-authority';
22
- import { X, PanelLeft, MessageSquare, Dot, Calendar as Calendar$1, ChevronDown, ChevronRight, Check, Circle, Search, Loader2, ArrowLeft, ArrowRight, EyeOff, Eye, Trash2, ChevronUp, ChevronsLeft, ChevronLeft, ChevronsRight, MoreHorizontal, Copy, GripVertical, TriangleAlert, Paperclip, ArrowDownToLine, Monitor, Sun, Moon, UserRound, Building2, LogOut, MenuIcon, HourglassIcon, ChevronRightIcon, Globe, Loader, FolderOpen, Edit, Menu, AlertCircle, Archive, LoaderCircle, CircleHelp, CalendarIcon, ArrowDown, ArrowUp, Filter, EllipsisVertical, RotateCcw, CloudUpload, Grip, Bell, Layers, BookOpenText, Plus, Settings2, UsersRound, ArrowUpRight, Pencil, Terminal } from 'lucide-react';
22
+ import { X, PanelLeft, MessageSquare, Dot, Calendar as Calendar$1, ChevronDown, ChevronRight, Check, Circle, Search, Loader2, ArrowLeft, ArrowRight, EyeOff, Eye, Trash2, ChevronUp, ChevronsLeft, ChevronLeft, ChevronsRight, MoreHorizontal, Copy, GripVertical, TriangleAlert, Paperclip, ArrowDownToLine, Moon, Sun, Monitor, UserRound, Building2, LogOut, MenuIcon, HourglassIcon, ChevronRightIcon, Globe, Loader, FolderOpen, Edit, Menu, AlertCircle, Archive, LoaderCircle, CircleHelp, CalendarIcon, ArrowDown, ArrowUp, Filter, EllipsisVertical, RotateCcw, CloudUpload, Grip, Bell, Layers, BookOpenText, Plus, UsersRound, LayoutGrid, List, ArrowUpRight, Pencil, Settings2, Terminal } from 'lucide-react';
23
23
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
24
24
  import * as SheetPrimitive from '@radix-ui/react-dialog';
25
25
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
@@ -28,7 +28,7 @@ import * as LabelPrimitive from '@radix-ui/react-label';
28
28
  import { useFormContext, FormProvider, Controller, useForm } from 'react-hook-form';
29
29
  import { OTPInput, OTPInputContext } from 'input-otp';
30
30
  import { DayPicker } from 'react-day-picker';
31
- import { format } from 'date-fns';
31
+ import { format, formatDistanceToNow } from 'date-fns';
32
32
  import * as PopoverPrimitive from '@radix-ui/react-popover';
33
33
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
34
34
  import * as MenubarPrimitive from '@radix-ui/react-menubar';
@@ -6692,32 +6692,82 @@ var AppSwitcher = ({ forwardedTo }) => {
6692
6692
  )
6693
6693
  ] });
6694
6694
  };
6695
- var OPTIONS = [
6696
- { value: "system", Icon: Monitor, label: "Auto" },
6697
- { value: "light", Icon: Sun, label: "Light" },
6698
- { value: "dark", Icon: Moon, label: "Dark" }
6699
- ];
6700
- function ThemeSwitcher() {
6695
+ var OPTIONS = {
6696
+ system: { Icon: Monitor, label: "Auto" },
6697
+ light: { Icon: Sun, label: "Light" },
6698
+ dark: { Icon: Moon, label: "Dark" }
6699
+ };
6700
+ var OPTION_ORDER = ["system", "light", "dark"];
6701
+ var TRIGGER_BASE_CLASSES = "relative z-50 inline-flex h-9 items-center justify-center gap-2 px-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
6702
+ var TRIGGER_DEFAULT_TYPOGRAPHY_CLASSES = "text-sm font-medium text-muted-foreground hover:text-foreground";
6703
+ function ThemeSwitcher({
6704
+ className,
6705
+ showChevron = true
6706
+ } = {}) {
6701
6707
  const { theme, setTheme } = useTheme();
6702
- return /* @__PURE__ */ jsx(
6703
- Tabs,
6704
- {
6705
- value: theme,
6706
- onValueChange: (value) => setTheme(value),
6707
- children: /* @__PURE__ */ jsx(TabsList, { className: "h-auto gap-0.5 rounded-md !bg-transparent p-0.5", children: OPTIONS.map(({ value, Icon: Icon2, label }) => /* @__PURE__ */ jsxs(
6708
- TabsTrigger,
6708
+ const { Icon: ThemeIcon, label: themeLabel } = OPTIONS[theme];
6709
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
6710
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
6711
+ "button",
6712
+ {
6713
+ type: "button",
6714
+ "aria-label": "Change theme",
6715
+ className: cn(
6716
+ TRIGGER_BASE_CLASSES,
6717
+ className ?? TRIGGER_DEFAULT_TYPOGRAPHY_CLASSES
6718
+ ),
6719
+ children: [
6720
+ /* @__PURE__ */ jsx(ThemeIcon, { className: "h-4 w-4", "aria-hidden": true }),
6721
+ /* @__PURE__ */ jsx("span", { children: themeLabel }),
6722
+ showChevron && /* @__PURE__ */ jsx(
6723
+ ChevronDown,
6724
+ {
6725
+ className: "h-3.5 w-3.5 text-muted-foreground",
6726
+ "aria-hidden": true
6727
+ }
6728
+ )
6729
+ ]
6730
+ }
6731
+ ) }),
6732
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "min-w-40", children: [
6733
+ /* @__PURE__ */ jsx(DropdownMenuLabel, { className: "px-2 py-1.5 text-xs font-medium text-muted-foreground", children: "Appearance" }),
6734
+ /* @__PURE__ */ jsx(
6735
+ DropdownMenuRadioGroup,
6709
6736
  {
6710
- value,
6711
- className: "group h-auto rounded-sm px-2 py-1 text-xs font-medium data-[state=active]:bg-[hsl(var(--primary)/0.1)] data-[state=active]:text-[hsl(var(--primary))] data-[state=inactive]:text-[hsl(var(--muted-foreground)/0.9)] data-[state=active]:shadow-sm data-[state=inactive]:hover:text-[hsl(var(--foreground)/0.9)]",
6712
- children: [
6713
- /* @__PURE__ */ jsx(Icon2, { size: 13, "aria-hidden": true }),
6714
- /* @__PURE__ */ jsx("span", { className: "ml-1.5 hidden group-data-[state=active]:inline", children: label })
6715
- ]
6716
- },
6717
- value
6718
- )) })
6719
- }
6720
- );
6737
+ value: theme,
6738
+ onValueChange: (value) => setTheme(value),
6739
+ children: OPTION_ORDER.map((value) => {
6740
+ const { Icon: Icon2, label } = OPTIONS[value];
6741
+ const isActive = value === theme;
6742
+ return /* @__PURE__ */ jsxs(
6743
+ DropdownMenuRadioItem,
6744
+ {
6745
+ value,
6746
+ className: cn(
6747
+ "gap-2 border border-transparent py-2 hover:border-input",
6748
+ isActive && "text-primary"
6749
+ ),
6750
+ children: [
6751
+ /* @__PURE__ */ jsx(
6752
+ Icon2,
6753
+ {
6754
+ className: cn(
6755
+ "h-4 w-4",
6756
+ isActive ? "text-foreground" : "text-muted-foreground"
6757
+ ),
6758
+ "aria-hidden": true
6759
+ }
6760
+ ),
6761
+ /* @__PURE__ */ jsx("span", { className: cn(isActive && "text-foreground font-medium"), children: label })
6762
+ ]
6763
+ },
6764
+ value
6765
+ );
6766
+ })
6767
+ }
6768
+ )
6769
+ ] })
6770
+ ] });
6721
6771
  }
6722
6772
 
6723
6773
  // src/services/user.service.ts
@@ -7733,8 +7783,7 @@ function OidcLayout({
7733
7783
  var LoginHeader = ({
7734
7784
  docsUrl = "https://docs.seliseblocks.com/",
7735
7785
  blocksUrl = "https://seliseblocks.com",
7736
- githubUrl = "https://github.com/SELISEdigitalplatforms",
7737
- signUpUrl
7786
+ githubUrl = "https://github.com/SELISEdigitalplatforms"
7738
7787
  }) => {
7739
7788
  const {
7740
7789
  config: { appLogoUrl }
@@ -7779,8 +7828,13 @@ var LoginHeader = ({
7779
7828
  children: "GitHub"
7780
7829
  }
7781
7830
  ),
7782
- signUpUrl && /* @__PURE__ */ jsx("a", { href: signUpUrl, className: "nav-cta", children: "Sign up" }),
7783
- /* @__PURE__ */ jsx(ThemeSwitcher, {})
7831
+ /* @__PURE__ */ jsx(
7832
+ ThemeSwitcher,
7833
+ {
7834
+ className: "nav-link inline-flex items-center gap-1.5",
7835
+ showChevron: false
7836
+ }
7837
+ )
7784
7838
  ] })
7785
7839
  ] });
7786
7840
  };
@@ -7964,18 +8018,6 @@ var blocksLoginStyles = `
7964
8018
  .blocksLogin-page .nav-link:hover { color: var(--fg); text-shadow: 0 0 12px var(--accent-glow); }
7965
8019
  .blocksLogin-page .nav-link:hover::after { width: 100%; }
7966
8020
 
7967
- .blocksLogin-page .nav-cta {
7968
- font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
7969
- font-weight: 600; color: var(--accent2); text-decoration: none;
7970
- padding: 7px 16px; border-radius: 6px;
7971
- border: 1px solid rgba(0,102,178,0.35); background: rgba(0,102,178,0.06);
7972
- transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
7973
- }
7974
- .blocksLogin-page .nav-cta:hover {
7975
- background: rgba(0,102,178,0.12); border-color: var(--accent);
7976
- box-shadow: 0 0 12px rgba(0,102,178,0.12);
7977
- }
7978
-
7979
8021
  .blocksLogin-page .main {
7980
8022
  flex: 1; min-height: 0; display: grid;
7981
8023
  grid-template-columns: 1fr 400px; gap: 56px;
@@ -8128,10 +8170,15 @@ var blocksLoginStyles = `
8128
8170
  display: inline-flex; align-items: center; gap: 6px;
8129
8171
  color: var(--accent2); text-decoration: none; font-weight: 600;
8130
8172
  transition: gap 0.25s var(--ease-out-expo), text-shadow 0.25s ease;
8173
+ /* Renders as a button: it asks IAM for the signup URL rather than linking to one,
8174
+ so the UA button styling has to be reset back to the inline-link look. */
8175
+ background: none; border: 0; padding: 0; margin: 0;
8176
+ font: inherit; font-weight: 600; cursor: pointer;
8131
8177
  }
8132
- .blocksLogin-page .cta-signup-link:hover { gap: 10px; text-shadow: 0 0 10px var(--accent2-glow); }
8178
+ .blocksLogin-page .cta-signup-link:disabled { cursor: default; opacity: 0.7; }
8179
+ .blocksLogin-page .cta-signup-link:hover:not(:disabled) { gap: 10px; text-shadow: 0 0 10px var(--accent2-glow); }
8133
8180
  .blocksLogin-page .cta-signup-link svg { transition: transform 0.25s var(--ease-out-expo); }
8134
- .blocksLogin-page .cta-signup-link:hover svg { transform: translateX(3px); }
8181
+ .blocksLogin-page .cta-signup-link:hover:not(:disabled) svg { transform: translateX(3px); }
8135
8182
 
8136
8183
  .blocksLogin-page .col-right {
8137
8184
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
@@ -8292,7 +8339,6 @@ var blocksLoginStyles = `
8292
8339
  .blocksLogin-page .feature-pill { padding: 5px 10px; font-size: 0.58rem; }
8293
8340
  .blocksLogin-page .cta-row { gap: 18px; }
8294
8341
  .blocksLogin-page .cta-signup { font-size: 0.78rem; }
8295
- .blocksLogin-page .nav-cta { padding: 6px 12px; font-size: 0.62rem; }
8296
8342
  }
8297
8343
 
8298
8344
  @media (prefers-reduced-motion: reduce) {
@@ -8687,7 +8733,9 @@ var BlocksLoginPage = ({
8687
8733
  loginLabel = "Log in to your account",
8688
8734
  docsUrl = "https://docs.seliseblocks.com/",
8689
8735
  footerLink = { label: "Visit Blocks", url: "https://seliseblocks.com" },
8690
- signUpUrl,
8736
+ showSignUp = false,
8737
+ onSignUp,
8738
+ isSignUpLoading = false,
8691
8739
  carouselItems
8692
8740
  }) => {
8693
8741
  const canvasRef = useRef(null);
@@ -8808,7 +8856,7 @@ var BlocksLoginPage = ({
8808
8856
  }
8809
8857
  }
8810
8858
  ),
8811
- /* @__PURE__ */ jsx(LoginHeader, { signUpUrl }),
8859
+ /* @__PURE__ */ jsx(LoginHeader, {}),
8812
8860
  /* @__PURE__ */ jsxs("main", { className: "main", children: [
8813
8861
  /* @__PURE__ */ jsxs("div", { className: "col-left", children: [
8814
8862
  /* @__PURE__ */ jsx("p", { className: "eyebrow", children: eyebrow }),
@@ -8861,24 +8909,33 @@ var BlocksLoginPage = ({
8861
8909
  }
8862
8910
  )
8863
8911
  ] }),
8864
- signUpUrl && /* @__PURE__ */ jsxs("p", { className: "cta-signup", children: [
8912
+ showSignUp && /* @__PURE__ */ jsxs("p", { className: "cta-signup", children: [
8865
8913
  "Not a member?",
8866
8914
  " ",
8867
- /* @__PURE__ */ jsxs("a", { href: signUpUrl, className: "cta-signup-link", children: [
8868
- "Sign up",
8869
- /* @__PURE__ */ jsx(
8870
- "svg",
8871
- {
8872
- width: "11",
8873
- height: "11",
8874
- viewBox: "0 0 24 24",
8875
- fill: "none",
8876
- stroke: "currentColor",
8877
- strokeWidth: "2.5",
8878
- children: /* @__PURE__ */ jsx("path", { d: "M5 12h14M12 5l7 7-7 7" })
8879
- }
8880
- )
8881
- ] })
8915
+ /* @__PURE__ */ jsxs(
8916
+ "button",
8917
+ {
8918
+ type: "button",
8919
+ onClick: onSignUp,
8920
+ disabled: isSignUpLoading,
8921
+ className: "cta-signup-link",
8922
+ children: [
8923
+ isSignUpLoading ? "Redirecting\u2026" : "Sign up",
8924
+ /* @__PURE__ */ jsx(
8925
+ "svg",
8926
+ {
8927
+ width: "11",
8928
+ height: "11",
8929
+ viewBox: "0 0 24 24",
8930
+ fill: "none",
8931
+ stroke: "currentColor",
8932
+ strokeWidth: "2.5",
8933
+ children: /* @__PURE__ */ jsx("path", { d: "M5 12h14M12 5l7 7-7 7" })
8934
+ }
8935
+ )
8936
+ ]
8937
+ }
8938
+ )
8882
8939
  ] })
8883
8940
  ] }),
8884
8941
  /* @__PURE__ */ jsxs("div", { className: "col-right", children: [
@@ -8997,14 +9054,17 @@ var BlocksLoginPage = ({
8997
9054
  var LoginPage = () => {
8998
9055
  const config = useBlocksAppConfigStore((state) => state.getConfig());
8999
9056
  const { start, isLoading } = useLogin();
9000
- const { signUpUrl } = useSignUpAffordance();
9057
+ const { canSignUp } = useSignUpAffordance();
9058
+ const { start: startSignUp, isLoading: isSignUpLoading } = useSignUpRedirect();
9001
9059
  return /* @__PURE__ */ jsx(
9002
9060
  BlocksLoginPage,
9003
9061
  {
9004
9062
  name: config.name,
9005
9063
  onLogin: start,
9006
9064
  isLoading,
9007
- signUpUrl,
9065
+ showSignUp: canSignUp,
9066
+ onSignUp: startSignUp,
9067
+ isSignUpLoading,
9008
9068
  carouselItems: BLOCKS_PRODUCTS
9009
9069
  }
9010
9070
  );
@@ -9198,52 +9258,141 @@ function useProjectOverviewRedirect({
9198
9258
  isFetching
9199
9259
  };
9200
9260
  }
9201
- var INLINE_LIMIT = 3;
9202
- var ProjectCard = ({
9261
+ var getActionLabels = (canOpen, isShared) => {
9262
+ if (canOpen) {
9263
+ return isShared ? { accessibleLabel: "Open shared project", tooltipLabel: "Open Project" } : {
9264
+ accessibleLabel: "Configure project",
9265
+ tooltipLabel: "Configure Project"
9266
+ };
9267
+ }
9268
+ return {
9269
+ accessibleLabel: "Project access unavailable",
9270
+ tooltipLabel: "Project access unavailable"
9271
+ };
9272
+ };
9273
+ var ProjectActionButton = ({
9203
9274
  project,
9204
- projects,
9205
9275
  isShared,
9206
9276
  canOpen = true
9207
9277
  }) => {
9208
- const navigate = useNavigate();
9209
- const { setTenantGroup, setSelectedProject } = useProjectStore();
9278
+ const { setTenantGroup } = useProjectStore();
9210
9279
  const { handleClick, isDisabled, isFetching } = useProjectOverviewRedirect({
9211
9280
  tenantGroupId: project.tenantGroupId
9212
9281
  });
9213
- const onConfigureClick = () => {
9282
+ const isActionDisabled = !canOpen || isDisabled || isFetching;
9283
+ const { accessibleLabel, tooltipLabel } = getActionLabels(canOpen, isShared);
9284
+ const onClick = () => {
9214
9285
  setTenantGroup(project.tenantGroupId);
9215
9286
  handleClick();
9216
9287
  };
9217
- const onEnvBadgeClick = async (e, envProject) => {
9218
- e.stopPropagation();
9288
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
9289
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
9290
+ Button,
9291
+ {
9292
+ size: "icon",
9293
+ "data-testid": isShared ? "project-card-open-shared" : "project-card-configure",
9294
+ variant: "ghost",
9295
+ className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9296
+ disabled: isActionDisabled,
9297
+ onClick,
9298
+ "aria-label": accessibleLabel,
9299
+ children: /* @__PURE__ */ jsx(Settings2, { size: 16 })
9300
+ }
9301
+ ) }),
9302
+ /* @__PURE__ */ jsx(TooltipContent, { children: tooltipLabel })
9303
+ ] });
9304
+ };
9305
+
9306
+ // src/pages/console/project-list-utils.ts
9307
+ var canOpenProject = (group) => !group.isShared || !group.accessPolicies || group.accessPolicies.length > 0;
9308
+ var getProjectGroupName = (group) => group.projects[0]?.name ?? "";
9309
+ var getLatestProjectUpdate = (group) => group.projects.reduce((latest, project) => {
9310
+ const timestamp = Date.parse(project.lastUpdatedDate);
9311
+ return Number.isFinite(timestamp) ? Math.max(latest, timestamp) : latest;
9312
+ }, 0);
9313
+ var getEnvironmentLabel = (environment) => environmentOptions.find((option) => option.value === environment)?.label ?? environment;
9314
+ var INLINE_LIMIT = 3;
9315
+ var ProjectEnvironments = ({ projects }) => {
9316
+ const navigate = useNavigate();
9317
+ const { setTenantGroup, setSelectedProject } = useProjectStore();
9318
+ const onEnvironmentClick = async (event, project) => {
9319
+ event.stopPropagation();
9219
9320
  try {
9220
- setTenantGroup(envProject.tenantGroupId);
9221
- setSelectedProject(envProject);
9222
- navigate(`/app/${envProject.itemId}/dashboard`);
9223
- } catch (err) {
9224
- console.error("Failed to switch environment", err);
9321
+ setTenantGroup(project.tenantGroupId);
9322
+ setSelectedProject(project);
9323
+ navigate(`/app/${project.itemId}/dashboard`);
9324
+ } catch (error) {
9325
+ console.error("Failed to switch environment", error);
9225
9326
  }
9226
9327
  };
9227
- const renderEnvChip = (envProject) => {
9228
- const label = environmentOptions.find(
9229
- (o) => o.value === envProject.environment
9230
- )?.label;
9231
- return /* @__PURE__ */ jsxs(
9232
- "button",
9233
- {
9234
- onClick: (e) => onEnvBadgeClick(e, envProject),
9235
- className: "group/chip border-primary bg-primary text-primary-foreground hover:text-primary inline-flex cursor-pointer items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium transition-all duration-150 hover:border-blocks-primary-50 hover:bg-blocks-primary-25 active:scale-95",
9236
- children: [
9237
- label,
9238
- /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3 transition-all duration-150 group-hover/chip:translate-x-0.5" })
9239
- ]
9240
- },
9241
- envProject.environment
9242
- );
9243
- };
9328
+ const renderEnvironmentChip = (project) => /* @__PURE__ */ jsxs(
9329
+ "button",
9330
+ {
9331
+ type: "button",
9332
+ onClick: (event) => onEnvironmentClick(event, project),
9333
+ className: "group/chip border-primary bg-primary text-primary-foreground hover:text-primary inline-flex cursor-pointer items-center gap-1 rounded-full border px-2.5 py-0.5 text-xs font-medium transition-all duration-150 hover:border-blocks-primary-50 hover:bg-blocks-primary-25 active:scale-95",
9334
+ children: [
9335
+ getEnvironmentLabel(project.environment),
9336
+ /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3 transition-all duration-150 group-hover/chip:translate-x-0.5" })
9337
+ ]
9338
+ },
9339
+ project.environment
9340
+ );
9341
+ if (projects.length === 0) {
9342
+ return /* @__PURE__ */ jsx("span", { className: "border-border/60 bg-muted/40 text-muted-foreground inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs", children: "No environments" });
9343
+ }
9244
9344
  const hasOverflow = projects.length > INLINE_LIMIT;
9245
9345
  const visibleProjects = hasOverflow ? projects.slice(0, INLINE_LIMIT) : projects;
9246
9346
  const overflowCount = projects.length - INLINE_LIMIT;
9347
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
9348
+ visibleProjects.map(renderEnvironmentChip),
9349
+ hasOverflow && /* @__PURE__ */ jsxs(Popover, { children: [
9350
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
9351
+ "button",
9352
+ {
9353
+ type: "button",
9354
+ onClick: (event) => event.stopPropagation(),
9355
+ className: "border-border/60 bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground inline-flex cursor-pointer items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",
9356
+ children: [
9357
+ "+",
9358
+ overflowCount,
9359
+ " more"
9360
+ ]
9361
+ }
9362
+ ) }),
9363
+ /* @__PURE__ */ jsxs(
9364
+ PopoverContent,
9365
+ {
9366
+ className: "w-52 p-1.5",
9367
+ align: "start",
9368
+ onClick: (event) => event.stopPropagation(),
9369
+ children: [
9370
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-2 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wider", children: "All environments" }),
9371
+ projects.map((project) => /* @__PURE__ */ jsxs(
9372
+ "button",
9373
+ {
9374
+ type: "button",
9375
+ onClick: (event) => onEnvironmentClick(event, project),
9376
+ className: "group/item hover:bg-accent flex w-full items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors",
9377
+ children: [
9378
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: getEnvironmentLabel(project.environment) }),
9379
+ /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground group-hover/item:text-foreground h-3.5 w-3.5 transition-transform duration-150 group-hover/item:translate-x-0.5" })
9380
+ ]
9381
+ },
9382
+ project.environment
9383
+ ))
9384
+ ]
9385
+ }
9386
+ )
9387
+ ] })
9388
+ ] });
9389
+ };
9390
+ var ProjectCard = ({
9391
+ project,
9392
+ projects,
9393
+ isShared,
9394
+ canOpen = true
9395
+ }) => {
9247
9396
  return /* @__PURE__ */ jsxs(Card, { className: "border-border/60 bg-card hover:border-primary/30 group flex h-40 flex-col overflow-hidden rounded-xl border p-4 shadow-sm transition-all duration-200 hover:shadow-md", children: [
9248
9397
  /* @__PURE__ */ jsxs("div", { className: "relative flex items-start justify-between gap-2", children: [
9249
9398
  /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: /* @__PURE__ */ jsx(CardTitle, { className: "line-clamp-3 break-all text-base font-semibold leading-snug", children: project.name }) }),
@@ -9263,171 +9412,660 @@ var ProjectCard = ({
9263
9412
  ]
9264
9413
  }
9265
9414
  ),
9266
- canOpen && /* @__PURE__ */ jsxs(Tooltip, { children: [
9267
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
9268
- Button,
9269
- {
9270
- size: "icon",
9271
- "data-testid": "project-card-open-shared",
9272
- variant: "ghost",
9273
- className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9274
- disabled: isDisabled || isFetching,
9275
- onClick: onConfigureClick,
9276
- "aria-label": "Open shared project",
9277
- children: /* @__PURE__ */ jsx(Settings2, { size: 16 })
9278
- }
9279
- ) }),
9280
- /* @__PURE__ */ jsx(TooltipContent, { children: "Open Project" })
9281
- ] })
9282
- ] }),
9283
- whenFalse: /* @__PURE__ */ jsxs(Tooltip, { children: [
9284
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
9285
- Button,
9415
+ /* @__PURE__ */ jsx(
9416
+ ProjectActionButton,
9286
9417
  {
9287
- size: "icon",
9288
- "data-testid": "project-card-configure",
9289
- variant: "ghost",
9290
- className: "text-primary hover:bg-primary/10 h-8 w-8 shrink-0 transition-colors",
9291
- disabled: isDisabled || isFetching,
9292
- onClick: onConfigureClick,
9293
- children: /* @__PURE__ */ jsx(Settings2, { size: 16 })
9418
+ project,
9419
+ isShared: true,
9420
+ canOpen
9294
9421
  }
9295
- ) }),
9296
- /* @__PURE__ */ jsx(TooltipContent, { children: "Configure Project" })
9297
- ] })
9422
+ )
9423
+ ] }),
9424
+ whenFalse: /* @__PURE__ */ jsx(ProjectActionButton, { project, isShared: false })
9298
9425
  }
9299
9426
  ) })
9300
9427
  ] }),
9301
- /* @__PURE__ */ jsx("div", { className: "mt-auto", children: projects.length === 0 ? /* @__PURE__ */ jsx("span", { className: "border-border/60 bg-muted/40 text-muted-foreground inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs", children: "No environments" }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
9302
- visibleProjects.map((p) => renderEnvChip(p)),
9303
- hasOverflow && /* @__PURE__ */ jsxs(Popover, { children: [
9304
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
9305
- "button",
9306
- {
9307
- onClick: (e) => e.stopPropagation(),
9308
- className: "border-border/60 bg-muted/40 text-muted-foreground hover:bg-muted hover:text-foreground inline-flex cursor-pointer items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",
9309
- children: [
9310
- "+",
9311
- overflowCount,
9312
- " more"
9313
- ]
9314
- }
9315
- ) }),
9316
- /* @__PURE__ */ jsxs(
9317
- PopoverContent,
9318
- {
9319
- className: "w-52 p-1.5",
9320
- align: "start",
9321
- onClick: (e) => e.stopPropagation(),
9322
- children: [
9323
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-2 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wider", children: "All environments" }),
9324
- projects.map((p) => {
9325
- const opt = environmentOptions.find(
9326
- (o) => o.value === p.environment
9327
- );
9328
- return /* @__PURE__ */ jsxs(
9329
- "button",
9330
- {
9331
- onClick: (e) => onEnvBadgeClick(e, p),
9332
- className: "group/item hover:bg-accent flex w-full items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors",
9333
- children: [
9334
- /* @__PURE__ */ jsx("span", { className: "font-medium", children: opt?.label ?? p.environment }),
9335
- /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground group-hover/item:text-foreground h-3.5 w-3.5 transition-transform duration-150 group-hover/item:translate-x-0.5" })
9336
- ]
9337
- },
9338
- p.environment
9339
- );
9340
- })
9341
- ]
9342
- }
9343
- )
9344
- ] })
9345
- ] }) })
9428
+ /* @__PURE__ */ jsx("div", { className: "mt-auto", children: /* @__PURE__ */ jsx(ProjectEnvironments, { projects }) })
9346
9429
  ] });
9347
9430
  };
9348
- var cardVariants = {
9349
- hidden: { opacity: 0, y: 20, scale: 0.97 },
9350
- visible: (i) => ({
9351
- opacity: 1,
9352
- y: 0,
9353
- scale: 1,
9354
- transition: {
9355
- delay: i * 0.06,
9356
- duration: 0.4,
9357
- ease: [0.22, 1, 0.36, 1]
9358
- }
9359
- })
9431
+ var getLastUpdatedLabel = (group) => {
9432
+ const timestamp = getLatestProjectUpdate(group);
9433
+ return timestamp === 0 ? "Unknown" : formatDistanceToNow(timestamp, { addSuffix: true });
9360
9434
  };
9361
- var canOpenProject = (group) => !group.isShared || !group.accessPolicies || group.accessPolicies.length > 0;
9362
- var SelfProjectLoading = () => {
9363
- return /* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6", "sk-7", "sk-8"].map(
9364
- (itemKey) => /* @__PURE__ */ jsx(ProjectCardLoadingSkeleton, {}, itemKey)
9365
- ) });
9435
+ var getLastUpdatedCellLabel = (group) => {
9436
+ const timestamp = getLatestProjectUpdate(group);
9437
+ return timestamp === 0 ? "Not updated yet" : `Updated ${formatDistanceToNow(timestamp, { addSuffix: true })}`;
9366
9438
  };
9367
- var SelfProject = ({ canCreateProject = false }) => {
9368
- const { data: data2, isLoading, isFetching } = useGetProjects({ enabled: true });
9369
- if (isLoading || isFetching) return /* @__PURE__ */ jsx(SelfProjectLoading, {});
9370
- const projectGroups = data2 || [];
9371
- if (!projectGroups.length && canCreateProject)
9372
- return /* @__PURE__ */ jsx(ConsoleCreateProject, {});
9373
- return /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", children: [
9374
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
9375
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
9376
- /* @__PURE__ */ jsx("h2", { className: "shrink-0 text-base font-semibold text-[hsl(var(--high-emphasis))]", children: "Your Blocks Projects" }),
9377
- /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary rounded-full px-2 py-0.5 text-xs font-semibold", children: projectGroups.length })
9378
- ] }),
9379
- canCreateProject && projectGroups.length > 9 && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-[hsl(var(--medium-emphasis))]", children: "Please delete an existing project to create a new one." })
9380
- ] }),
9381
- /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
9382
- projectGroups.length < 10 && /* @__PURE__ */ jsx(
9383
- motion.div,
9384
- {
9385
- variants: cardVariants,
9386
- custom: 0,
9387
- initial: "hidden",
9388
- animate: "visible",
9389
- children: /* @__PURE__ */ jsx(AddProjectCard, {})
9390
- }
9391
- ),
9392
- projectGroups.map((project, i) => /* @__PURE__ */ jsx(
9393
- motion.div,
9394
- {
9395
- variants: cardVariants,
9396
- custom: projectGroups.length < 10 ? i + 1 : i,
9397
- initial: "hidden",
9398
- animate: "visible",
9399
- children: project.projects[0] && /* @__PURE__ */ jsx(
9400
- ProjectCard,
9401
- {
9402
- project: project.projects[0],
9403
- projects: project.projects,
9404
- isShared: project.isShared,
9405
- canOpen: canOpenProject(project)
9406
- }
9407
- )
9408
- },
9409
- project.tenantGroupId
9410
- ))
9411
- ] })
9412
- ] });
9439
+ var CARD_RADIUS = "0.75rem";
9440
+ var ROW_SPACING = "0 0.5rem";
9441
+ var cardCorners = {
9442
+ left: {
9443
+ borderTopLeftRadius: CARD_RADIUS,
9444
+ borderBottomLeftRadius: CARD_RADIUS
9445
+ },
9446
+ right: {
9447
+ borderTopRightRadius: CARD_RADIUS,
9448
+ borderBottomRightRadius: CARD_RADIUS
9449
+ }
9413
9450
  };
9414
- var ConsolePage = ({ canCreateProject = false }) => {
9415
- const { resetSelectedProject, resetTenantGroup } = useProjectStore();
9416
- useEffect(() => {
9417
- resetSelectedProject();
9418
- resetTenantGroup();
9419
- }, [resetSelectedProject, resetTenantGroup]);
9420
- return /* @__PURE__ */ jsxs("div", { className: "relative flex flex-1 flex-col overflow-hidden", children: [
9421
- /* @__PURE__ */ jsx("div", { className: "bg-primary/[0.07] pointer-events-none absolute -top-20 right-0 h-[600px] w-[600px] rounded-full blur-[100px]" }),
9422
- /* @__PURE__ */ jsx("div", { className: "bg-primary/[0.04] pointer-events-none absolute left-1/3 top-10 h-[350px] w-[350px] rounded-full blur-[80px]" }),
9423
- /* @__PURE__ */ jsxs("div", { className: "relative flex flex-1 flex-col gap-12 px-6 py-10 sm:px-10 xl:px-[154px]", children: [
9424
- /* @__PURE__ */ jsx(SelfProject, { canCreateProject }),
9425
- /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-5", children: [
9426
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
9427
- /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold tracking-wide", children: "Resources" }),
9428
- /* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-[hsl(var(--border-default))]" })
9429
- ] }),
9430
- /* @__PURE__ */ jsx(DefaultDoc, {})
9451
+ var SharedStatus = ({ isShared }) => isShared ? /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "flex w-fit items-center gap-1", children: [
9452
+ /* @__PURE__ */ jsx(UsersRound, { size: 16 }),
9453
+ "Shared"
9454
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "\u2014" });
9455
+ var AddProjectListAction = ({ mobile = false }) => {
9456
+ const { handleClick, isDisabled, isFetching } = useCreateProjectRedirect();
9457
+ const action = /* @__PURE__ */ jsxs(
9458
+ Button,
9459
+ {
9460
+ type: "button",
9461
+ variant: "ghost",
9462
+ className: "text-primary w-full justify-start gap-2",
9463
+ disabled: isDisabled || isFetching,
9464
+ onClick: handleClick,
9465
+ children: [
9466
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
9467
+ "Add Project"
9468
+ ]
9469
+ }
9470
+ );
9471
+ if (mobile) {
9472
+ return /* @__PURE__ */ jsx(
9473
+ Card,
9474
+ {
9475
+ "data-testid": "add-project-list-row",
9476
+ className: "border-primary/30 rounded-xl border border-dashed p-2",
9477
+ children: action
9478
+ }
9479
+ );
9480
+ }
9481
+ return /* @__PURE__ */ jsx(TableRow, { "data-testid": "add-project-list-row", className: "border-0", children: /* @__PURE__ */ jsx(
9482
+ TableCell,
9483
+ {
9484
+ colSpan: 5,
9485
+ className: "border-primary/30 border border-dashed bg-transparent p-2",
9486
+ style: { borderRadius: CARD_RADIUS },
9487
+ children: action
9488
+ }
9489
+ ) });
9490
+ };
9491
+ var ProjectMobileList = ({
9492
+ projectGroups,
9493
+ showAddProject
9494
+ }) => /* @__PURE__ */ jsxs("div", { className: "grid gap-3", "data-testid": "project-list-mobile", children: [
9495
+ showAddProject && /* @__PURE__ */ jsx(AddProjectListAction, { mobile: true }),
9496
+ projectGroups.map((group) => {
9497
+ const project = group.projects[0];
9498
+ return /* @__PURE__ */ jsxs(
9499
+ Card,
9500
+ {
9501
+ "data-testid": "project-list-row",
9502
+ className: "border-border/60 space-y-3 rounded-xl border p-4 shadow-sm",
9503
+ children: [
9504
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
9505
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-2", children: [
9506
+ /* @__PURE__ */ jsx(CardTitle, { className: "break-all text-base", children: getProjectGroupName(group) || "Unnamed project" }),
9507
+ /* @__PURE__ */ jsx(SharedStatus, { isShared: group.isShared })
9508
+ ] }),
9509
+ project && /* @__PURE__ */ jsx(
9510
+ ProjectActionButton,
9511
+ {
9512
+ project,
9513
+ isShared: group.isShared,
9514
+ canOpen: canOpenProject(group)
9515
+ }
9516
+ )
9517
+ ] }),
9518
+ /* @__PURE__ */ jsx(ProjectEnvironments, { projects: group.projects }),
9519
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-xs", children: [
9520
+ "Last updated ",
9521
+ getLastUpdatedLabel(group)
9522
+ ] })
9523
+ ]
9524
+ },
9525
+ group.tenantGroupId
9526
+ );
9527
+ })
9528
+ ] });
9529
+ var ProjectList = ({
9530
+ projectGroups,
9531
+ showAddProject
9532
+ }) => {
9533
+ const isMobile = useIsMobile();
9534
+ if (isMobile) {
9535
+ return /* @__PURE__ */ jsx(
9536
+ ProjectMobileList,
9537
+ {
9538
+ projectGroups,
9539
+ showAddProject
9540
+ }
9541
+ );
9542
+ }
9543
+ return /* @__PURE__ */ jsx(
9544
+ Table,
9545
+ {
9546
+ "data-testid": "project-list-table",
9547
+ style: { borderCollapse: "separate", borderSpacing: ROW_SPACING },
9548
+ children: /* @__PURE__ */ jsxs(TableBody, { children: [
9549
+ showAddProject && /* @__PURE__ */ jsx(AddProjectListAction, {}),
9550
+ projectGroups.map((group) => {
9551
+ const project = group.projects[0];
9552
+ return /* @__PURE__ */ jsxs(
9553
+ TableRow,
9554
+ {
9555
+ "data-testid": "project-list-row",
9556
+ className: "border-0",
9557
+ children: [
9558
+ /* @__PURE__ */ jsx(
9559
+ TableCell,
9560
+ {
9561
+ className: "bg-card max-w-64 break-all py-2 font-medium",
9562
+ style: cardCorners.left,
9563
+ children: getProjectGroupName(group) || "Unnamed project"
9564
+ }
9565
+ ),
9566
+ /* @__PURE__ */ jsx(TableCell, { className: "bg-card py-2", children: /* @__PURE__ */ jsx(ProjectEnvironments, { projects: group.projects }) }),
9567
+ /* @__PURE__ */ jsx(TableCell, { className: "bg-card py-2", children: /* @__PURE__ */ jsx(SharedStatus, { isShared: group.isShared }) }),
9568
+ /* @__PURE__ */ jsx(TableCell, { className: "bg-card whitespace-nowrap py-2 text-muted-foreground", children: getLastUpdatedCellLabel(group) }),
9569
+ /* @__PURE__ */ jsx(
9570
+ TableCell,
9571
+ {
9572
+ className: "bg-card py-2 text-right",
9573
+ style: cardCorners.right,
9574
+ children: project && /* @__PURE__ */ jsx(
9575
+ ProjectActionButton,
9576
+ {
9577
+ project,
9578
+ isShared: group.isShared,
9579
+ canOpen: canOpenProject(group)
9580
+ }
9581
+ )
9582
+ }
9583
+ )
9584
+ ]
9585
+ },
9586
+ group.tenantGroupId
9587
+ );
9588
+ })
9589
+ ] })
9590
+ }
9591
+ );
9592
+ };
9593
+ function MultiSelect2({
9594
+ label,
9595
+ options,
9596
+ onChange,
9597
+ value: selectedValues
9598
+ }) {
9599
+ const [buttonRef, popoverWidth] = usePopoverWidth();
9600
+ const onSelectHandler = (value) => {
9601
+ const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
9602
+ onChange(nextValues);
9603
+ };
9604
+ const onResetHandler = () => {
9605
+ onChange([]);
9606
+ };
9607
+ const isMobile = useIsMobile();
9608
+ return /* @__PURE__ */ jsxs(Popover, { children: [
9609
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
9610
+ Button,
9611
+ {
9612
+ ref: buttonRef,
9613
+ variant: "outline",
9614
+ size: "sm",
9615
+ className: "h-8 rounded-md border-dashed",
9616
+ children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between", children: [
9617
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
9618
+ /* @__PURE__ */ jsx(PlusCircledIcon, { className: "mr-2 h-4 w-4" }),
9619
+ /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: label }),
9620
+ /* @__PURE__ */ jsx("span", { className: "sm:hidden", children: label?.split(" ")[0] })
9621
+ ] }),
9622
+ selectedValues?.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
9623
+ /* @__PURE__ */ jsx(
9624
+ Separator,
9625
+ {
9626
+ orientation: "vertical",
9627
+ className: "hidden h-4 sm:mx-2 sm:block"
9628
+ }
9629
+ ),
9630
+ /* @__PURE__ */ jsx("div", { className: "flex space-x-1", children: selectedValues.length > 2 ? /* @__PURE__ */ jsxs(
9631
+ Badge,
9632
+ {
9633
+ variant: "outline",
9634
+ className: "rounded-sm px-1 font-normal",
9635
+ children: [
9636
+ selectedValues.length,
9637
+ " selected"
9638
+ ]
9639
+ }
9640
+ ) : options.filter((option) => selectedValues.includes(option.value)).map((option) => /* @__PURE__ */ jsx(
9641
+ Badge,
9642
+ {
9643
+ variant: "outline",
9644
+ className: "rounded-sm px-1 font-normal",
9645
+ children: option.label
9646
+ },
9647
+ option.value
9648
+ )) })
9649
+ ] })
9650
+ ] })
9651
+ }
9652
+ ) }),
9653
+ /* @__PURE__ */ jsx(
9654
+ PopoverContent,
9655
+ {
9656
+ className: "w-auto p-0 sm:w-full",
9657
+ align: "start",
9658
+ style: isMobile ? { width: popoverWidth ? `${popoverWidth}px` : "auto" } : void 0,
9659
+ children: /* @__PURE__ */ jsxs(Command, { children: [
9660
+ /* @__PURE__ */ jsx(CommandInput, { placeholder: label }),
9661
+ /* @__PURE__ */ jsxs(CommandList, { children: [
9662
+ /* @__PURE__ */ jsx(CommandEmpty, { children: "No results found." }),
9663
+ /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => {
9664
+ const isSelected = selectedValues.includes(option.value);
9665
+ return /* @__PURE__ */ jsxs(
9666
+ CommandItem,
9667
+ {
9668
+ onSelect: () => onSelectHandler(option.value),
9669
+ children: [
9670
+ /* @__PURE__ */ jsx(
9671
+ "div",
9672
+ {
9673
+ className: cn(
9674
+ "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
9675
+ isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
9676
+ ),
9677
+ children: /* @__PURE__ */ jsx(CheckIcon, { className: cn("h-4 w-4") })
9678
+ }
9679
+ ),
9680
+ /* @__PURE__ */ jsx("span", { children: option.label })
9681
+ ]
9682
+ },
9683
+ option.value
9684
+ );
9685
+ }) }),
9686
+ selectedValues.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
9687
+ /* @__PURE__ */ jsx(CommandSeparator, {}),
9688
+ /* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsx(
9689
+ CommandItem,
9690
+ {
9691
+ onSelect: () => onResetHandler(),
9692
+ className: "justify-center text-center",
9693
+ children: "Clear"
9694
+ }
9695
+ ) })
9696
+ ] })
9697
+ ] })
9698
+ ] })
9699
+ }
9700
+ )
9701
+ ] });
9702
+ }
9703
+ var ResetButton = ({ onClick }) => {
9704
+ return /* @__PURE__ */ jsxs(
9705
+ Button,
9706
+ {
9707
+ type: "button",
9708
+ variant: "outline",
9709
+ onClick,
9710
+ className: "h-8 rounded-md px-2 lg:px-3",
9711
+ children: [
9712
+ "Reset",
9713
+ /* @__PURE__ */ jsx(X, { className: "ml-2 h-4 w-4" })
9714
+ ]
9715
+ }
9716
+ );
9717
+ };
9718
+ var SearchInput = ({
9719
+ onChange,
9720
+ placeholder = "Search...",
9721
+ value,
9722
+ className = ""
9723
+ }) => {
9724
+ const [state, setState] = useState(value);
9725
+ const inputRef = useRef(null);
9726
+ useEffect(() => {
9727
+ setState(value);
9728
+ }, [value]);
9729
+ const debounced = useRef(
9730
+ debounce((val) => {
9731
+ onChange(val);
9732
+ }, 300)
9733
+ ).current;
9734
+ useEffect(() => {
9735
+ return () => {
9736
+ debounced.cancel();
9737
+ };
9738
+ }, [debounced]);
9739
+ const handleChange = (event) => {
9740
+ event.stopPropagation();
9741
+ setState(event.target.value);
9742
+ debounced(event.target.value);
9743
+ };
9744
+ const handleClear = (e) => {
9745
+ e.stopPropagation();
9746
+ setState("");
9747
+ onChange("");
9748
+ };
9749
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-md border bg-background flex items-center px-2", children: [
9750
+ /* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
9751
+ /* @__PURE__ */ jsx(
9752
+ Input,
9753
+ {
9754
+ ref: inputRef,
9755
+ placeholder,
9756
+ value: state,
9757
+ onChange: handleChange,
9758
+ className: cn(
9759
+ "h-8 w-52 border-none p-0 focus-visible:ring-0 focus-visible:ring-offset-0",
9760
+ className
9761
+ )
9762
+ }
9763
+ ),
9764
+ /* @__PURE__ */ jsx(
9765
+ Button,
9766
+ {
9767
+ variant: "ghost",
9768
+ size: "xs",
9769
+ className: cn(
9770
+ "h-full p-1 pr-0 hover:bg-transparent",
9771
+ !value && "invisible"
9772
+ ),
9773
+ onClick: handleClear,
9774
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4 text-muted-foreground" })
9775
+ }
9776
+ )
9777
+ ] });
9778
+ };
9779
+ var ProjectToolbar = ({
9780
+ availableEnvironmentOptions,
9781
+ environmentFilter,
9782
+ onEnvironmentFilterChange,
9783
+ onReset,
9784
+ onSearchTextChange,
9785
+ onViewModeChange,
9786
+ searchText,
9787
+ viewMode
9788
+ }) => {
9789
+ const hasActiveFilters = searchText.trim().length > 0 || environmentFilter.length > 0;
9790
+ return /* @__PURE__ */ jsxs(
9791
+ "div",
9792
+ {
9793
+ className: "flex flex-wrap items-center justify-between gap-3",
9794
+ "aria-label": "Project filters and view",
9795
+ children: [
9796
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
9797
+ /* @__PURE__ */ jsx(
9798
+ SearchInput,
9799
+ {
9800
+ value: searchText,
9801
+ onChange: onSearchTextChange,
9802
+ placeholder: "Search projects..."
9803
+ }
9804
+ ),
9805
+ /* @__PURE__ */ jsx(
9806
+ MultiSelect2,
9807
+ {
9808
+ label: "Environment",
9809
+ options: availableEnvironmentOptions,
9810
+ value: environmentFilter,
9811
+ onChange: onEnvironmentFilterChange
9812
+ }
9813
+ ),
9814
+ hasActiveFilters && /* @__PURE__ */ jsx(ResetButton, { onClick: onReset })
9815
+ ] }),
9816
+ /* @__PURE__ */ jsxs(
9817
+ ToggleGroup,
9818
+ {
9819
+ type: "single",
9820
+ variant: "outline",
9821
+ size: "sm",
9822
+ value: viewMode,
9823
+ onValueChange: (value) => {
9824
+ if (value === "grid" || value === "list") onViewModeChange(value);
9825
+ },
9826
+ "aria-label": "Project view",
9827
+ className: "h-8 rounded-md border bg-background p-0.5",
9828
+ children: [
9829
+ /* @__PURE__ */ jsx(
9830
+ ToggleGroupItem,
9831
+ {
9832
+ value: "grid",
9833
+ "aria-label": "Grid view",
9834
+ className: "h-7 w-7 min-w-0 border-0 px-0",
9835
+ children: /* @__PURE__ */ jsx(LayoutGrid, { className: "h-4 w-4" })
9836
+ }
9837
+ ),
9838
+ /* @__PURE__ */ jsx(
9839
+ ToggleGroupItem,
9840
+ {
9841
+ value: "list",
9842
+ "aria-label": "List view",
9843
+ className: "h-7 w-7 min-w-0 border-0 px-0",
9844
+ children: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" })
9845
+ }
9846
+ )
9847
+ ]
9848
+ }
9849
+ )
9850
+ ]
9851
+ }
9852
+ );
9853
+ };
9854
+ var DEFAULT_SORT = {
9855
+ property: "lastUpdatedDate",
9856
+ isDescending: true
9857
+ };
9858
+ var projectViewStorage = createStorage("local", { prefix: "console" });
9859
+ var VIEW_MODE_KEY = "projectsViewMode";
9860
+ var readViewMode = () => {
9861
+ const storedValue = projectViewStorage.get(VIEW_MODE_KEY);
9862
+ return storedValue === "list" || storedValue === "grid" ? storedValue : "grid";
9863
+ };
9864
+ var SEARCH_OPTIONS = {
9865
+ keys: ["representativeName"],
9866
+ threshold: 0.3
9867
+ };
9868
+ var useProjectListState = (projectGroups) => {
9869
+ const [viewMode, setViewMode] = useState(readViewMode);
9870
+ const [searchText, setSearchText] = useState("");
9871
+ const [environmentFilter, setEnvironmentFilter] = useState([]);
9872
+ const [sort, setSort] = useState(DEFAULT_SORT);
9873
+ const searchableGroups = useMemo(
9874
+ () => projectGroups.map((group) => ({
9875
+ group,
9876
+ representativeName: getProjectGroupName(group)
9877
+ })),
9878
+ [projectGroups]
9879
+ );
9880
+ const searchedGroups = useDebouncedFuseFilter(
9881
+ searchableGroups,
9882
+ searchText,
9883
+ SEARCH_OPTIONS
9884
+ );
9885
+ const visibleProjectGroups = useMemo(() => {
9886
+ const filteredGroups = searchedGroups.map(({ group }) => group).filter(
9887
+ (group) => environmentFilter.length === 0 || group.projects.some(
9888
+ (project) => environmentFilter.includes(project.environment)
9889
+ )
9890
+ );
9891
+ return filteredGroups.toSorted((left, right) => {
9892
+ const comparison = sort.property === "name" ? getProjectGroupName(left).localeCompare(getProjectGroupName(right)) : getLatestProjectUpdate(left) - getLatestProjectUpdate(right);
9893
+ return sort.isDescending ? -comparison : comparison;
9894
+ });
9895
+ }, [environmentFilter, searchedGroups, sort]);
9896
+ const availableEnvironmentOptions = useMemo(() => {
9897
+ const presentValues = new Set(
9898
+ projectGroups.flatMap(
9899
+ (group) => group.projects.map((project) => project.environment).filter((environment) => environment.length > 0)
9900
+ )
9901
+ );
9902
+ const knownOptions = environmentOptions.filter((option) => presentValues.delete(option.value)).map(({ label, value }) => ({ label, value }));
9903
+ const unknownOptions = [...presentValues].sort((left, right) => left.localeCompare(right)).map((value) => ({ label: value, value }));
9904
+ return [...knownOptions, ...unknownOptions];
9905
+ }, [projectGroups]);
9906
+ const persistViewMode = useCallback((nextViewMode) => {
9907
+ setViewMode(nextViewMode);
9908
+ projectViewStorage.set(VIEW_MODE_KEY, nextViewMode);
9909
+ }, []);
9910
+ const resetFilters = useCallback(() => {
9911
+ setSearchText("");
9912
+ setEnvironmentFilter([]);
9913
+ }, []);
9914
+ return {
9915
+ availableEnvironmentOptions,
9916
+ environmentFilter,
9917
+ resetFilters,
9918
+ searchText,
9919
+ setEnvironmentFilter,
9920
+ setSearchText,
9921
+ setSort,
9922
+ setViewMode: persistViewMode,
9923
+ sort,
9924
+ viewMode,
9925
+ visibleProjectGroups
9926
+ };
9927
+ };
9928
+ var cardVariants = {
9929
+ hidden: { opacity: 0, y: 20, scale: 0.97 },
9930
+ visible: (i) => ({
9931
+ opacity: 1,
9932
+ y: 0,
9933
+ scale: 1,
9934
+ transition: {
9935
+ delay: i * 0.06,
9936
+ duration: 0.4,
9937
+ ease: [0.22, 1, 0.36, 1]
9938
+ }
9939
+ })
9940
+ };
9941
+ var SelfProjectLoading = ({ viewMode }) => {
9942
+ if (viewMode === "list") {
9943
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5"].map((itemKey) => /* @__PURE__ */ jsx(ProjectListRowLoadingSkeleton, {}, itemKey)) });
9944
+ }
9945
+ return /* @__PURE__ */ jsx("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: ["sk-1", "sk-2", "sk-3", "sk-4", "sk-5", "sk-6", "sk-7", "sk-8"].map(
9946
+ (itemKey) => /* @__PURE__ */ jsx(ProjectCardLoadingSkeleton, {}, itemKey)
9947
+ ) });
9948
+ };
9949
+ var SelfProject = ({ canCreateProject = false }) => {
9950
+ const { data: data2, isLoading, isFetching } = useGetProjects({ enabled: true });
9951
+ const isPending = isLoading || isFetching;
9952
+ const projectGroups = data2 || [];
9953
+ const {
9954
+ availableEnvironmentOptions,
9955
+ environmentFilter,
9956
+ resetFilters,
9957
+ searchText,
9958
+ setEnvironmentFilter,
9959
+ setSearchText,
9960
+ setViewMode,
9961
+ viewMode,
9962
+ visibleProjectGroups
9963
+ } = useProjectListState(projectGroups);
9964
+ if (!isPending && !projectGroups.length && canCreateProject)
9965
+ return /* @__PURE__ */ jsx(ConsoleCreateProject, {});
9966
+ const showAddProject = projectGroups.length < 10 && searchText.trim().length === 0;
9967
+ const hasNoMatches = projectGroups.length > 0 && visibleProjectGroups.length === 0;
9968
+ let projectsContent;
9969
+ if (isPending) {
9970
+ projectsContent = /* @__PURE__ */ jsx(SelfProjectLoading, { viewMode });
9971
+ } else if (viewMode === "grid") {
9972
+ projectsContent = /* @__PURE__ */ jsxs("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
9973
+ showAddProject && /* @__PURE__ */ jsx(
9974
+ motion.div,
9975
+ {
9976
+ variants: cardVariants,
9977
+ custom: 0,
9978
+ initial: "hidden",
9979
+ animate: "visible",
9980
+ children: /* @__PURE__ */ jsx(AddProjectCard, {})
9981
+ }
9982
+ ),
9983
+ visibleProjectGroups.map((project, index) => /* @__PURE__ */ jsx(
9984
+ motion.div,
9985
+ {
9986
+ variants: cardVariants,
9987
+ custom: showAddProject ? index + 1 : index,
9988
+ initial: "hidden",
9989
+ animate: "visible",
9990
+ children: project.projects[0] && /* @__PURE__ */ jsx(
9991
+ ProjectCard,
9992
+ {
9993
+ project: project.projects[0],
9994
+ projects: project.projects,
9995
+ isShared: project.isShared,
9996
+ canOpen: canOpenProject(project)
9997
+ }
9998
+ )
9999
+ },
10000
+ project.tenantGroupId
10001
+ ))
10002
+ ] });
10003
+ } else {
10004
+ projectsContent = /* @__PURE__ */ jsx(
10005
+ ProjectList,
10006
+ {
10007
+ projectGroups: visibleProjectGroups,
10008
+ showAddProject
10009
+ }
10010
+ );
10011
+ }
10012
+ return /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-4", children: [
10013
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-3", children: [
10014
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [
10015
+ /* @__PURE__ */ jsx("h2", { className: "shrink-0 text-base font-semibold text-[hsl(var(--high-emphasis))]", children: "Your Blocks Projects" }),
10016
+ isPending ? /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-8 rounded-full" }) : /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary shrink-0 rounded-full px-2 py-0.5 text-xs font-semibold", children: projectGroups.length })
10017
+ ] }),
10018
+ !isPending && canCreateProject && projectGroups.length > 9 && /* @__PURE__ */ jsx("span", { className: "text-sm text-[hsl(var(--medium-emphasis))]", children: "Please delete an existing project to create a new one." })
10019
+ ] }),
10020
+ (isPending || projectGroups.length > 0) && /* @__PURE__ */ jsx(
10021
+ ProjectToolbar,
10022
+ {
10023
+ availableEnvironmentOptions,
10024
+ environmentFilter,
10025
+ onEnvironmentFilterChange: setEnvironmentFilter,
10026
+ onReset: resetFilters,
10027
+ onSearchTextChange: setSearchText,
10028
+ onViewModeChange: setViewMode,
10029
+ searchText,
10030
+ viewMode
10031
+ }
10032
+ ),
10033
+ projectsContent,
10034
+ hasNoMatches && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center", children: [
10035
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-muted-foreground", children: searchText.trim() ? "No projects match your search" : "No projects match the selected filters" }),
10036
+ /* @__PURE__ */ jsx(
10037
+ Button,
10038
+ {
10039
+ type: "button",
10040
+ variant: "outline",
10041
+ size: "sm",
10042
+ onClick: () => {
10043
+ if (searchText.trim()) setSearchText("");
10044
+ else setEnvironmentFilter([]);
10045
+ },
10046
+ children: searchText.trim() ? "Clear search" : "Clear filters"
10047
+ }
10048
+ )
10049
+ ] })
10050
+ ] });
10051
+ };
10052
+ var ConsolePage = ({ canCreateProject = false }) => {
10053
+ const { resetSelectedProject, resetTenantGroup } = useProjectStore();
10054
+ useEffect(() => {
10055
+ resetSelectedProject();
10056
+ resetTenantGroup();
10057
+ }, [resetSelectedProject, resetTenantGroup]);
10058
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex flex-1 flex-col overflow-hidden", children: [
10059
+ /* @__PURE__ */ jsx("div", { className: "bg-primary/[0.07] pointer-events-none absolute -top-20 right-0 h-[600px] w-[600px] rounded-full blur-[100px]" }),
10060
+ /* @__PURE__ */ jsx("div", { className: "bg-primary/[0.04] pointer-events-none absolute left-1/3 top-10 h-[350px] w-[350px] rounded-full blur-[80px]" }),
10061
+ /* @__PURE__ */ jsxs("div", { className: "relative flex flex-1 flex-col gap-12 px-6 py-10 sm:px-10 xl:px-[154px]", children: [
10062
+ /* @__PURE__ */ jsx(SelfProject, { canCreateProject }),
10063
+ /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-5", children: [
10064
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
10065
+ /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary inline-flex items-center rounded-full px-2.5 py-1 text-xs font-semibold tracking-wide", children: "Resources" }),
10066
+ /* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-[hsl(var(--border-default))]" })
10067
+ ] }),
10068
+ /* @__PURE__ */ jsx(DefaultDoc, {})
9431
10069
  ] })
9432
10070
  ] })
9433
10071
  ] });
@@ -9837,7 +10475,7 @@ var wildcardToRegex2 = (pattern) => {
9837
10475
  const escaped = pattern.replace(/[-/\\^$+?.()|[\]{}]/g, "\\$&");
9838
10476
  return `^${escaped.replace(/\*/g, "[^/]+")}$`;
9839
10477
  };
9840
- function ProjectList({
10478
+ function ProjectList2({
9841
10479
  redirectPaths,
9842
10480
  collapsed = false
9843
10481
  }) {
@@ -10389,8 +11027,8 @@ function EditProject() {
10389
11027
  ] });
10390
11028
  }
10391
11029
  var ProjectCardLoadingSkeleton = () => {
10392
- return /* @__PURE__ */ jsxs(Card, { className: "border-border/60 flex h-[160px] flex-col overflow-hidden rounded-xl border p-4 shadow-sm", children: [
10393
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
11030
+ return /* @__PURE__ */ jsxs(Card, { className: "border-border/60 bg-card flex h-40 flex-col overflow-hidden rounded-xl border p-4 shadow-sm", children: [
11031
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
10394
11032
  /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
10395
11033
  /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4/5" }),
10396
11034
  /* @__PURE__ */ jsx(Skeleton, { className: "mt-1.5 h-4 w-3/5" })
@@ -10403,6 +11041,14 @@ var ProjectCardLoadingSkeleton = () => {
10403
11041
  ] })
10404
11042
  ] });
10405
11043
  };
11044
+ var ProjectListRowLoadingSkeleton = () => {
11045
+ return /* @__PURE__ */ jsxs(Card, { className: "border-border/60 bg-card flex h-14 items-center gap-4 rounded-xl border px-4 py-2 shadow-sm", children: [
11046
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }),
11047
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16 shrink-0 rounded-full" }),
11048
+ /* @__PURE__ */ jsx(Skeleton, { className: "ml-auto h-4 w-20 shrink-0" }),
11049
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8 shrink-0 rounded-md" })
11050
+ ] });
11051
+ };
10406
11052
  function SidebarMobileView({
10407
11053
  redirectPaths,
10408
11054
  navigationMenus
@@ -10440,7 +11086,7 @@ function SidebarMobileView({
10440
11086
  /* @__PURE__ */ jsx(Separator, {}),
10441
11087
  /* @__PURE__ */ jsxs("div", { className: "mt-3 flex w-full flex-col items-start px-6", children: [
10442
11088
  /* @__PURE__ */ jsx("div", { className: "ml-1 text-sm text-low-emphasis", children: "Project" }),
10443
- /* @__PURE__ */ jsx(ProjectList, { redirectPaths })
11089
+ /* @__PURE__ */ jsx(ProjectList2, { redirectPaths })
10444
11090
  ] }),
10445
11091
  /* @__PURE__ */ jsxs("div", { className: "my-3 flex w-full flex-col items-start px-6", children: [
10446
11092
  /* @__PURE__ */ jsx("div", { className: "ml-1 text-sm text-low-emphasis", children: "Environment" }),
@@ -10508,11 +11154,11 @@ function SidebarMenuDesktop({
10508
11154
  isSidebarOpen ? /* @__PURE__ */ jsxs("div", { className: "border-b px-2 pb-2 pt-2", children: [
10509
11155
  /* @__PURE__ */ jsx("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: "Workspace" }),
10510
11156
  /* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
10511
- /* @__PURE__ */ jsx(ProjectList, { redirectPaths }),
11157
+ /* @__PURE__ */ jsx(ProjectList2, { redirectPaths }),
10512
11158
  /* @__PURE__ */ jsx(RenderConditionally, { condition: !isProjectOverviewRoute, children: /* @__PURE__ */ jsx(EnvironmentList, { redirectPaths }) })
10513
11159
  ] })
10514
11160
  ] }) : /* @__PURE__ */ jsxs("div", { className: "border-b py-1", children: [
10515
- /* @__PURE__ */ jsx(ProjectList, { redirectPaths, collapsed: true }),
11161
+ /* @__PURE__ */ jsx(ProjectList2, { redirectPaths, collapsed: true }),
10516
11162
  /* @__PURE__ */ jsx(RenderConditionally, { condition: !isProjectOverviewRoute, children: /* @__PURE__ */ jsx(EnvironmentList, { redirectPaths, collapsed: true }) })
10517
11163
  ] }),
10518
11164
  /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ jsx("nav", { className: cn("grid w-full items-start gap-1 text-sm"), children: allowedMenu.map((menu) => /* @__PURE__ */ jsx(Fragment$1, { children: menu.type === "menu" ? /* @__PURE__ */ jsx(DesktopMenuItem, { menu, isSidebarOpen }) : /* @__PURE__ */ jsx(Separator, {}) }, menu.id)) }) })
@@ -11545,116 +12191,6 @@ var DropdownSearchInput = ({
11545
12191
  )
11546
12192
  ] });
11547
12193
  };
11548
- function MultiSelect2({
11549
- label,
11550
- options,
11551
- onChange,
11552
- value: selectedValues
11553
- }) {
11554
- const [buttonRef, popoverWidth] = usePopoverWidth();
11555
- const onSelectHandler = (value) => {
11556
- const nextValues = selectedValues.includes(value) ? selectedValues.filter((item) => item !== value) : [...selectedValues, value];
11557
- onChange(nextValues);
11558
- };
11559
- const onResetHandler = () => {
11560
- onChange([]);
11561
- };
11562
- const isMobile = useIsMobile();
11563
- return /* @__PURE__ */ jsxs(Popover, { children: [
11564
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
11565
- Button,
11566
- {
11567
- ref: buttonRef,
11568
- variant: "outline",
11569
- size: "sm",
11570
- className: "h-8 border-dashed",
11571
- children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between", children: [
11572
- /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
11573
- /* @__PURE__ */ jsx(PlusCircledIcon, { className: "mr-2 h-4 w-4" }),
11574
- /* @__PURE__ */ jsx("span", { className: "hidden sm:inline", children: label }),
11575
- /* @__PURE__ */ jsx("span", { className: "sm:hidden", children: label?.split(" ")[0] })
11576
- ] }),
11577
- selectedValues?.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
11578
- /* @__PURE__ */ jsx(
11579
- Separator,
11580
- {
11581
- orientation: "vertical",
11582
- className: "hidden h-4 sm:mx-2 sm:block"
11583
- }
11584
- ),
11585
- /* @__PURE__ */ jsx("div", { className: "flex space-x-1", children: selectedValues.length > 2 ? /* @__PURE__ */ jsxs(
11586
- Badge,
11587
- {
11588
- variant: "secondary",
11589
- className: "rounded-sm px-1 font-normal",
11590
- children: [
11591
- selectedValues.length,
11592
- " selected"
11593
- ]
11594
- }
11595
- ) : options.filter((option) => selectedValues.includes(option.value)).map((option) => /* @__PURE__ */ jsx(
11596
- Badge,
11597
- {
11598
- variant: "secondary",
11599
- className: "rounded-sm px-1 font-normal",
11600
- children: option.label
11601
- },
11602
- option.value
11603
- )) })
11604
- ] })
11605
- ] })
11606
- }
11607
- ) }),
11608
- /* @__PURE__ */ jsx(
11609
- PopoverContent,
11610
- {
11611
- className: "w-auto p-0 sm:w-full",
11612
- align: "start",
11613
- style: isMobile ? { width: popoverWidth ? `${popoverWidth}px` : "auto" } : void 0,
11614
- children: /* @__PURE__ */ jsxs(Command, { children: [
11615
- /* @__PURE__ */ jsx(CommandInput, { placeholder: label }),
11616
- /* @__PURE__ */ jsxs(CommandList, { children: [
11617
- /* @__PURE__ */ jsx(CommandEmpty, { children: "No results found." }),
11618
- /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => {
11619
- const isSelected = selectedValues.includes(option.value);
11620
- return /* @__PURE__ */ jsxs(
11621
- CommandItem,
11622
- {
11623
- onSelect: () => onSelectHandler(option.value),
11624
- children: [
11625
- /* @__PURE__ */ jsx(
11626
- "div",
11627
- {
11628
- className: cn(
11629
- "mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
11630
- isSelected ? "bg-primary text-primary-foreground" : "opacity-50 [&_svg]:invisible"
11631
- ),
11632
- children: /* @__PURE__ */ jsx(CheckIcon, { className: cn("h-4 w-4") })
11633
- }
11634
- ),
11635
- /* @__PURE__ */ jsx("span", { children: option.label })
11636
- ]
11637
- },
11638
- option.value
11639
- );
11640
- }) }),
11641
- selectedValues.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
11642
- /* @__PURE__ */ jsx(CommandSeparator, {}),
11643
- /* @__PURE__ */ jsx(CommandGroup, { children: /* @__PURE__ */ jsx(
11644
- CommandItem,
11645
- {
11646
- onSelect: () => onResetHandler(),
11647
- className: "justify-center text-center",
11648
- children: "Clear"
11649
- }
11650
- ) })
11651
- ] })
11652
- ] })
11653
- ] })
11654
- }
11655
- )
11656
- ] });
11657
- }
11658
12194
  var ClearButton = ({ onClear }) => {
11659
12195
  return /* @__PURE__ */ jsx("div", { className: "p-1", children: /* @__PURE__ */ jsx(
11660
12196
  Button,
@@ -11763,82 +12299,6 @@ function Radio({ label, options, onChange, value }) {
11763
12299
  )
11764
12300
  ] });
11765
12301
  }
11766
- var ResetButton = ({ onClick }) => {
11767
- return /* @__PURE__ */ jsxs(
11768
- Button,
11769
- {
11770
- type: "button",
11771
- variant: "outline",
11772
- onClick,
11773
- className: "h-8 px-2 lg:px-3",
11774
- children: [
11775
- "Reset",
11776
- /* @__PURE__ */ jsx(X, { className: "ml-2 h-4 w-4" })
11777
- ]
11778
- }
11779
- );
11780
- };
11781
- var SearchInput = ({
11782
- onChange,
11783
- placeholder = "Search...",
11784
- value,
11785
- className = ""
11786
- }) => {
11787
- const [state, setState] = useState(value);
11788
- const inputRef = useRef(null);
11789
- useEffect(() => {
11790
- setState(value);
11791
- }, [value]);
11792
- const debounced = useRef(
11793
- debounce((val) => {
11794
- onChange(val);
11795
- }, 300)
11796
- ).current;
11797
- useEffect(() => {
11798
- return () => {
11799
- debounced.cancel();
11800
- };
11801
- }, [debounced]);
11802
- const handleChange = (event) => {
11803
- event.stopPropagation();
11804
- setState(event.target.value);
11805
- debounced(event.target.value);
11806
- };
11807
- const handleClear = (e) => {
11808
- e.stopPropagation();
11809
- setState("");
11810
- onChange("");
11811
- };
11812
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center rounded-sm border px-2", children: [
11813
- /* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 text-muted-foreground" }),
11814
- /* @__PURE__ */ jsx(
11815
- Input,
11816
- {
11817
- ref: inputRef,
11818
- placeholder,
11819
- value: state,
11820
- onChange: handleChange,
11821
- className: cn(
11822
- "h-8 w-52 border-none p-0 focus-visible:ring-0 focus-visible:ring-offset-0",
11823
- className
11824
- )
11825
- }
11826
- ),
11827
- /* @__PURE__ */ jsx(
11828
- Button,
11829
- {
11830
- variant: "ghost",
11831
- size: "xs",
11832
- className: cn(
11833
- "h-full p-1 pr-0 hover:bg-transparent",
11834
- !value && "invisible"
11835
- ),
11836
- onClick: handleClear,
11837
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4 text-muted-foreground" })
11838
- }
11839
- )
11840
- ] });
11841
- };
11842
12302
  var sortQueryParsers = (initialValues) => ({
11843
12303
  sortProperty: parseAsString.withDefault(initialValues.property),
11844
12304
  isDescending: parseAsBoolean.withDefault(initialValues.isDescending)
@@ -12396,6 +12856,6 @@ var TablePagination2 = React8.forwardRef(
12396
12856
  );
12397
12857
  TablePagination2.displayName = "TablePagination";
12398
12858
 
12399
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppSwitcher, ArchiveProject, AspectRatio, AuthLayout, Avatar, AvatarFallback, AvatarImage, BackToConsoleNavigator, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CallbackPage, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationModal, ConsoleHeader, ConsoleLayout, ConsolePage, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyToClipboardButton, CopyableSnippet, DEFAULT_KANBAN_COLUMNS, DashboardHeader, DashboardLayout, DashboardOverview, DashboardRoute, DashboardSectionCard, DataTable, DataTableHeaderCell, DateRangePicker, DesktopMenuItem, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditProject, EditProjectDialog, EditProjectForm, EnvironmentCard, EnvironmentList, ErrorBoundary, ErrorDisplay, ErrorDisplayWithCard, FileInput, FileUploader, FileUploaderContent, FileUploaderItem, FilterControls, FilterToolBarMobileView, FilterToolbar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, ImportFileModalContent, InfiniteScroll, InfiniteScroller, InfoTooltip, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, KanbanBoard, KanbanBoardColumn, KanbanBoardContainer, KanbanTaskCard, Label, LanguageSelector, LoadingButton, LoginPage, Logo, MaskedText, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileMenuItem, MultiSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Notification, OidcLayout, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, Popover, PopoverContent, PopoverTrigger, ProfilePage, Progress, ProjectActions, ProjectCardLoadingSkeleton, ProjectDetail, ProjectList, ProjectOverview, ProjectRepoList, PublicLayout, RadioGroup4 as RadioGroup, RadioGroupItem, RenderAlternatively, RenderConditionally, ResizableHandle, ResizablePanel, ResizablePanelGroup, RightSidePanel, RightSidePanelBody, RightSidePanelClose, RightSidePanelDescription, RightSidePanelFooter, RightSidePanelHeader, RightSidePanelProvider, RightSidePanelTitle, RightSidePanelTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectedEnvironment, SelectedProject, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarCollapsedTooltip, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuDesktop, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarMobileView, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableLoadingSkeleton, TablePagination2 as TablePagination, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitcher, Timeline, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserDropdownMenu, WizardHorizontalTrackBar, WizardStepContent, WizardStepIndicator, WizardStepViewport, WizardStepperProvider, WizardVerticalTrackBar, badgeVariants, buttonVariants, editProjectFormDefaultValues, editProjectFormSchema, filteredAppSwitcherData, hasDraggableData, kanbanKeyboardCoordinateGetter, navigationMenuTriggerStyle, paginationQueryParsers, sidebarCollapsedTooltipClass, sortQueryParsers, spinnerVariants, toggleVariants, useFileUpload, useFormField, useNotificationSocket, useOidcContext, usePaginationQueryParams, useRightSidePanel, useSortQueryParams, useWizardStepper };
12400
- //# sourceMappingURL=chunk-VNSES4D3.js.map
12401
- //# sourceMappingURL=chunk-VNSES4D3.js.map
12859
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppSwitcher, ArchiveProject, AspectRatio, AuthLayout, Avatar, AvatarFallback, AvatarImage, BackToConsoleNavigator, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CallbackPage, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmationModal, ConsoleHeader, ConsoleLayout, ConsolePage, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyToClipboardButton, CopyableSnippet, DEFAULT_KANBAN_COLUMNS, DashboardHeader, DashboardLayout, DashboardOverview, DashboardRoute, DashboardSectionCard, DataTable, DataTableHeaderCell, DateRangePicker, DesktopMenuItem, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditProject, EditProjectDialog, EditProjectForm, EnvironmentCard, EnvironmentList, ErrorBoundary, ErrorDisplay, ErrorDisplayWithCard, FileInput, FileUploader, FileUploaderContent, FileUploaderItem, FilterControls, FilterToolBarMobileView, FilterToolbar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, ImportFileModalContent, InfiniteScroll, InfiniteScroller, InfoTooltip, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, KanbanBoard, KanbanBoardColumn, KanbanBoardContainer, KanbanTaskCard, Label, LanguageSelector, LoadingButton, LoginPage, Logo, MaskedText, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileMenuItem, MultiSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Notification, OidcLayout, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, Popover, PopoverContent, PopoverTrigger, ProfilePage, Progress, ProjectActions, ProjectCardLoadingSkeleton, ProjectDetail, ProjectList2 as ProjectList, ProjectListRowLoadingSkeleton, ProjectOverview, ProjectRepoList, PublicLayout, RadioGroup4 as RadioGroup, RadioGroupItem, RenderAlternatively, RenderConditionally, ResizableHandle, ResizablePanel, ResizablePanelGroup, RightSidePanel, RightSidePanelBody, RightSidePanelClose, RightSidePanelDescription, RightSidePanelFooter, RightSidePanelHeader, RightSidePanelProvider, RightSidePanelTitle, RightSidePanelTrigger, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectedEnvironment, SelectedProject, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarCollapsedTooltip, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuDesktop, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarMobileView, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableLoadingSkeleton, TablePagination2 as TablePagination, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitcher, Timeline, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserDropdownMenu, WizardHorizontalTrackBar, WizardStepContent, WizardStepIndicator, WizardStepViewport, WizardStepperProvider, WizardVerticalTrackBar, badgeVariants, buttonVariants, editProjectFormDefaultValues, editProjectFormSchema, filteredAppSwitcherData, hasDraggableData, kanbanKeyboardCoordinateGetter, navigationMenuTriggerStyle, paginationQueryParsers, sidebarCollapsedTooltipClass, sortQueryParsers, spinnerVariants, toggleVariants, useFileUpload, useFormField, useNotificationSocket, useOidcContext, usePaginationQueryParams, useRightSidePanel, useSortQueryParams, useWizardStepper };
12860
+ //# sourceMappingURL=chunk-EF42GERU.js.map
12861
+ //# sourceMappingURL=chunk-EF42GERU.js.map