const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_404-Vqc28kfV.js","assets/vendor-Bp0M7_Z3.js","assets/preload-DNrUkv91.js"])))=>i.map(i=>d[i]);
import { _ as __vitePreload } from "./preload-DNrUkv91.js";
import { t as twMerge, c as clsx, j as jsxDevRuntimeExports, u as useNavigate, a as useLocation, r as reactExports, S as Slot, b as cva, C as CircleAlert, D as Download, d as Cloud, L as Link, A as ArrowRight, e as Shield, f as Database, g as Smartphone, X, M as Menu, h as Search, B as Bell, i as ChevronDown, k as Settings, l as CircleHelp, m as LogOut, R as Root, I as Indicator, O as Overlay, P as Portal, n as Content, o as Close, T as Title, p as Description, q as Root$1, s as Trigger, v as Root$2, w as Plus, x as RefreshCw, y as Clock, H as HardDrive, z as CircleCheckBig, E as Trash2, Q as QrCode, F as QRCode, W as Wifi, G as WifiOff, J as Trigger$1, K as Icon, N as ScrollUpButton, U as ChevronUp, V as ScrollDownButton, Y as Portal$1, Z as Content2, _ as Viewport, $ as Label$1, a0 as Item, a1 as ItemIndicator, a2 as Check, a3 as ItemText, a4 as Separator, a5 as Root2, a6 as Value, a7 as Upload, a8 as CircleX, a9 as RotateCcw, aa as toast, ab as LoaderCircle, ac as List, ad as Trigger$2, ae as Content$1, af as Root2$1, ag as CircleCheck, ah as FolderOpen, ai as Info, aj as Checkbox$1, ak as CheckboxIndicator, al as Rocket, am as User, an as Lock, ao as Root$3, ap as Thumb, aq as Calendar, ar as SquarePen, as as createBrowserRouter, at as RouterProvider2, au as Outlet, av as QueryClient, aw as ReactDOM, ax as React, ay as QueryClientProvider } from "./vendor-Bp0M7_Z3.js";
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function Website({
  children,
  config = {},
  className
}) {
  const {
    layout = {
      maxWidth: "full",
      padding: "md",
      background: "default",
      minHeight: true
    }
  } = config;
  const getBackgroundClass = () => {
    switch (layout.background) {
      case "muted":
        return "bg-muted";
      case "gradient":
        return "bg-gradient-to-b from-background to-muted/20";
      default:
        return "bg-background";
    }
  };
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: cn(
    layout.minHeight !== false && "min-h-screen",
    getBackgroundClass(),
    "flex flex-col",
    className
  ), children }, void 0, false, {
    fileName: "/app/src/layouts/Website.tsx",
    lineNumber: 74,
    columnNumber: 5
  }, this);
}
function RootLayout({ children }) {
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Website, { children }, void 0, false, {
    fileName: "/app/src/layouts/RootLayout.tsx",
    lineNumber: 31,
    columnNumber: 5
  }, this);
}
function Spinner({ className }) {
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: `inline-block ${className || ""}`, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
    "svg",
    {
      className: "animate-spin h-8 w-8 text-gray-600",
      xmlns: "http://www.w3.org/2000/svg",
      fill: "none",
      viewBox: "0 0 24 24",
      children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          "circle",
          {
            className: "opacity-10",
            cx: "12",
            cy: "12",
            r: "10",
            stroke: "currentColor",
            strokeWidth: "4"
          },
          void 0,
          false,
          {
            fileName: "/app/src/components/Spinner.tsx",
            lineNumber: 14,
            columnNumber: 9
          },
          this
        ),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          "path",
          {
            className: "opacity-20",
            fill: "currentColor",
            d: "m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
          },
          void 0,
          false,
          {
            fileName: "/app/src/components/Spinner.tsx",
            lineNumber: 22,
            columnNumber: 9
          },
          this
        )
      ]
    },
    void 0,
    true,
    {
      fileName: "/app/src/components/Spinner.tsx",
      lineNumber: 8,
      columnNumber: 7
    },
    this
  ) }, void 0, false, {
    fileName: "/app/src/components/Spinner.tsx",
    lineNumber: 7,
    columnNumber: 5
  }, this);
}
function SetupCheck({ children }) {
  const navigate = useNavigate();
  const location = useLocation();
  const [setupChecked, setSetupChecked] = reactExports.useState(false);
  const [error, setError] = reactExports.useState(null);
  reactExports.useEffect(() => {
    if (location.pathname.startsWith("/login") || location.pathname.startsWith("/setup") || location.pathname.startsWith("/api")) {
      console.log("[SetupCheck] Skipping check for:", location.pathname);
      setSetupChecked(true);
      return;
    }
    console.log("[SetupCheck] Checking setup status for:", location.pathname);
    fetch("/api/setup/status").then((res) => res.json()).then((data) => {
      var _a;
      const setupCompleted = ((_a = data.config) == null ? void 0 : _a.setupCompleted) || false;
      console.log("[SetupCheck] Setup status:", { setupCompleted, pathname: location.pathname });
      if (!setupCompleted) {
        console.log("[SetupCheck] Setup not complete, redirecting to /setup");
        navigate("/setup", { replace: true });
        return;
      }
      fetch("/api/auth/current-user").then((authRes) => {
        if (authRes.ok) {
          console.log("[SetupCheck] User is logged in");
          if (location.pathname === "/") {
            console.log("[SetupCheck] Redirecting to /dashboard");
            navigate("/dashboard", { replace: true });
          } else {
            setSetupChecked(true);
          }
        } else {
          console.log("[SetupCheck] User not logged in");
          if (location.pathname.startsWith("/dashboard")) {
            console.log("[SetupCheck] Dashboard requires login, redirecting to /login");
            navigate("/login", { replace: true });
          } else if (location.pathname === "/") {
            console.log("[SetupCheck] Home page, redirecting to /login");
            navigate("/login", { replace: true });
          } else {
            setSetupChecked(true);
          }
        }
      }).catch((authErr) => {
        console.error("[SetupCheck] Auth check failed:", authErr);
        if (location.pathname.startsWith("/dashboard") || location.pathname === "/") {
          console.log("[SetupCheck] Auth failed, redirecting to /login");
          navigate("/login", { replace: true });
        } else {
          setSetupChecked(true);
        }
      });
    }).catch((err) => {
      console.error("[SetupCheck] Setup status check failed:", err);
      console.log("[SetupCheck] API failed, redirecting to /setup");
      navigate("/setup", { replace: true });
    });
  }, [location.pathname, navigate]);
  if (!setupChecked) {
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-center items-center h-screen", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Spinner, {}, void 0, false, {
        fileName: "/app/src/components/SetupCheck.tsx",
        lineNumber: 91,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "mt-4 text-muted-foreground", children: "Checking system status..." }, void 0, false, {
        fileName: "/app/src/components/SetupCheck.tsx",
        lineNumber: 92,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/components/SetupCheck.tsx",
      lineNumber: 90,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/components/SetupCheck.tsx",
      lineNumber: 89,
      columnNumber: 7
    }, this);
  }
  if (error) {
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-center items-center h-screen", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-destructive", children: error }, void 0, false, {
      fileName: "/app/src/components/SetupCheck.tsx",
      lineNumber: 103,
      columnNumber: 11
    }, this) }, void 0, false, {
      fileName: "/app/src/components/SetupCheck.tsx",
      lineNumber: 102,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/components/SetupCheck.tsx",
      lineNumber: 101,
      columnNumber: 7
    }, this);
  }
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children }, void 0, false, {
    fileName: "/app/src/components/SetupCheck.tsx",
    lineNumber: 110,
    columnNumber: 10
  }, this);
}
const buttonVariants = cva(
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground hover:bg-primary/90",
        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
        outline: "border border-input bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline"
      },
      size: {
        default: "h-10 px-4 py-2",
        sm: "h-9 rounded-md px-3",
        lg: "h-11 rounded-md px-8",
        icon: "h-10 w-10"
      }
    },
    defaultVariants: {
      variant: "default",
      size: "default"
    }
  }
);
const Button = reactExports.forwardRef(
  ({ className, variant, size, asChild = false, ...props }, ref) => {
    const Comp = asChild ? Slot : "button";
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
      Comp,
      {
        className: cn(buttonVariants({ variant, size, className })),
        ref,
        ...props
      },
      void 0,
      false,
      {
        fileName: "/app/src/components/ui/button.tsx",
        lineNumber: 46,
        columnNumber: 4
      },
      void 0
    );
  }
);
Button.displayName = "Button";
const Card = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    className: cn(
      "rounded-lg border bg-card text-card-foreground shadow-sm",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/card.tsx",
    lineNumber: 9,
    columnNumber: 3
  },
  void 0
));
Card.displayName = "Card";
const CardHeader = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    className: cn("flex flex-col space-y-1.5 p-6", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/card.tsx",
    lineNumber: 24,
    columnNumber: 3
  },
  void 0
));
CardHeader.displayName = "CardHeader";
const CardTitle = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    className: cn(
      "text-2xl font-semibold leading-none tracking-tight",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/card.tsx",
    lineNumber: 36,
    columnNumber: 3
  },
  void 0
));
CardTitle.displayName = "CardTitle";
const CardDescription = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    className: cn("text-sm text-muted-foreground", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/card.tsx",
    lineNumber: 51,
    columnNumber: 3
  },
  void 0
));
CardDescription.displayName = "CardDescription";
const CardContent = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { ref, className: cn("p-6 pt-0", className), ...props }, void 0, false, {
  fileName: "/app/src/components/ui/card.tsx",
  lineNumber: 63,
  columnNumber: 3
}, void 0));
CardContent.displayName = "CardContent";
const CardFooter = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    className: cn("flex items-center p-6 pt-0", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/card.tsx",
    lineNumber: 71,
    columnNumber: 3
  },
  void 0
));
CardFooter.displayName = "CardFooter";
const alertVariants = cva(
  "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
  {
    variants: {
      variant: {
        default: "bg-background text-foreground",
        destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
      }
    },
    defaultVariants: {
      variant: "default"
    }
  }
);
const Alert = reactExports.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    role: "alert",
    className: cn(alertVariants({ variant }), className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/alert.tsx",
    lineNumber: 26,
    columnNumber: 3
  },
  void 0
));
Alert.displayName = "Alert";
const AlertTitle = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "h5",
  {
    ref,
    className: cn("mb-1 font-medium leading-none tracking-tight", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/alert.tsx",
    lineNumber: 39,
    columnNumber: 3
  },
  void 0
));
AlertTitle.displayName = "AlertTitle";
const AlertDescription = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    ref,
    className: cn("text-sm [&_p]:leading-relaxed", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/alert.tsx",
    lineNumber: 51,
    columnNumber: 3
  },
  void 0
));
AlertDescription.displayName = "AlertDescription";
function PreviewModeBanner() {
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { className: "mb-6 border-yellow-500 bg-yellow-50 dark:bg-yellow-950", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4 text-yellow-600" }, void 0, false, {
      fileName: "/app/src/components/PreviewModeBanner.tsx",
      lineNumber: 8,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertTitle, { className: "text-yellow-800 dark:text-yellow-200", children: "Preview Mode - UI Demonstration Only" }, void 0, false, {
      fileName: "/app/src/components/PreviewModeBanner.tsx",
      lineNumber: 9,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { className: "mt-2 text-yellow-700 dark:text-yellow-300", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "mb-3", children: "This is a preview deployment showing the URVault interface. Full functionality (database, file storage, device pairing) requires the self-hosted version." }, void 0, false, {
        fileName: "/app/src/components/PreviewModeBanner.tsx",
        lineNumber: 13,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
        Button,
        {
          variant: "outline",
          size: "sm",
          className: "border-yellow-600 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-400 dark:text-yellow-300 dark:hover:bg-yellow-900",
          onClick: () => window.location.href = "/assets/urvault-production-20260210_042816.tar.gz",
          children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "mr-2 h-4 w-4" }, void 0, false, {
              fileName: "/app/src/components/PreviewModeBanner.tsx",
              lineNumber: 23,
              columnNumber: 11
            }, this),
            "Download Full Version"
          ]
        },
        void 0,
        true,
        {
          fileName: "/app/src/components/PreviewModeBanner.tsx",
          lineNumber: 17,
          columnNumber: 9
        },
        this
      )
    ] }, void 0, true, {
      fileName: "/app/src/components/PreviewModeBanner.tsx",
      lineNumber: 12,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/components/PreviewModeBanner.tsx",
    lineNumber: 7,
    columnNumber: 5
  }, this);
}
function HomePage() {
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-h-screen bg-gradient-to-b from-background to-muted", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("header", { className: "border-b border-border bg-background/95 backdrop-blur-sm", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "container mx-auto px-4 py-4 flex items-center justify-between", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Cloud, { className: "h-8 w-8 text-primary" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 14,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-2xl font-bold", children: "Applesauce" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 15,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 13,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Link, { to: "/dashboard", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { children: [
        "Open Dashboard",
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ArrowRight, { className: "ml-2 h-4 w-4" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 20,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 18,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 17,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 12,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 11,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("section", { className: "container mx-auto px-4 py-20 text-center", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(PreviewModeBanner, {}, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 28,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "max-w-3xl mx-auto space-y-6", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h2", { className: "text-5xl font-bold tracking-tight", children: "Your Personal Mobile Backup Server" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 30,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xl text-muted-foreground", children: "Self-hosted backup solution for mobile devices with end-to-end encryption, integrity verification, and complete control over your data." }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 33,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-4 justify-center", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Link, { to: "/dashboard", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { size: "lg", children: [
            "Get Started",
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ArrowRight, { className: "ml-2 h-5 w-5" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 41,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 39,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 38,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: "#features", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { size: "lg", variant: "outline", children: "Learn More" }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 45,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 44,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 37,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 29,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 27,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("section", { id: "features", className: "container mx-auto px-4 py-20", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center mb-12", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "text-3xl font-bold mb-4", children: "Features" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 56,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Everything you need for secure mobile backups" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 57,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 55,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Shield, { className: "h-10 w-10 text-primary mb-2" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 63,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "End-to-End Encryption" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 64,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 62,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "AES-256-GCM encryption ensures your backups are secure and private." }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 67,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 66,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 61,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-10 w-10 text-primary mb-2" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 75,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Integrity Verification" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 76,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 74,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "SHA-256 hashing and CRC32 checksums detect corruption and tampering." }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 79,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 78,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 73,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-10 w-10 text-primary mb-2" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 87,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Multi-Device Support" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 88,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 86,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Manage backups from multiple mobile devices in one place." }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 91,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 90,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 85,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Cloud, { className: "h-10 w-10 text-primary mb-2" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 99,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Self-Hosted" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 100,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 98,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Complete control over your data. No cloud subscriptions required." }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 103,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 102,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 97,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 60,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 54,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("section", { className: "container mx-auto px-4 py-20 bg-muted/50", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center mb-12", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "text-3xl font-bold mb-4", children: "How It Works" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 114,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Simple setup, powerful features" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 115,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 113,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "max-w-4xl mx-auto space-y-8", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-6 items-start", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-shrink-0 w-12 h-12 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-lg", children: "1" }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 120,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h4", { className: "text-xl font-semibold mb-2", children: "Pair Your Device" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 124,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Generate a pairing code in the dashboard and enter it in your mobile app to connect securely." }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 125,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 123,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 119,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-6 items-start", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-shrink-0 w-12 h-12 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-lg", children: "2" }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 132,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h4", { className: "text-xl font-semibold mb-2", children: "Configure Backups" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 136,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Choose what to backup, enable encryption, and set up automatic scheduling from your mobile device." }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 137,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 135,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 131,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-6 items-start", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-shrink-0 w-12 h-12 rounded-full bg-primary text-primary-foreground flex items-center justify-center font-bold text-lg", children: "3" }, void 0, false, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 144,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h4", { className: "text-xl font-semibold mb-2", children: "Manage & Restore" }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 148,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "View all backups in the dashboard, verify integrity, and restore data whenever needed." }, void 0, false, {
              fileName: "/app/src/pages/index.tsx",
              lineNumber: 149,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/index.tsx",
            lineNumber: 147,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 143,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 118,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 112,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("section", { className: "container mx-auto px-4 py-20 text-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "max-w-2xl mx-auto space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "text-3xl font-bold", children: "Ready to Get Started?" }, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 160,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xl text-muted-foreground", children: "Open the dashboard to pair your first device and start backing up." }, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 161,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Link, { to: "/dashboard", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { size: "lg", children: [
        "Open Dashboard",
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ArrowRight, { className: "ml-2 h-5 w-5" }, void 0, false, {
          fileName: "/app/src/pages/index.tsx",
          lineNumber: 167,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 165,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 164,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 159,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 158,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("footer", { className: "border-t border-border bg-background", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "container mx-auto px-4 py-8 text-center text-sm text-muted-foreground", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { children: "URVault - Self-hosted mobile backup server" }, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 176,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "mt-2", children: "Built with React, TypeScript, and Node.js" }, void 0, false, {
        fileName: "/app/src/pages/index.tsx",
        lineNumber: 177,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 175,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/index.tsx",
      lineNumber: 174,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/index.tsx",
    lineNumber: 9,
    columnNumber: 5
  }, this);
}
const maxWidthClasses = {
  sm: "max-w-screen-sm",
  md: "max-w-screen-md",
  lg: "max-w-screen-lg",
  xl: "max-w-screen-xl",
  "2xl": "max-w-screen-2xl",
  full: "max-w-full"
};
function useDarkMode() {
  const [dark, setDark] = reactExports.useState(() => {
    try { const s = localStorage.getItem("cv-theme"); if (s) return s === "dark"; return !!(window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches); } catch(e) { return false; }
  });
  reactExports.useEffect(() => {
    document.documentElement.classList.toggle("dark", dark);
    try { localStorage.setItem("cv-theme", dark ? "dark" : "light"); } catch(e) {}
  }, [dark]);
  return [dark, setDark];
}
function Dashboard({
  children,
  config = {},
  className
}) {
  const [sidebarOpen, setSidebarOpen] = reactExports.useState(() => { try { return localStorage.getItem('cv-sidebar') === '1'; } catch(e) { return false; } });
  const _setSidebar = reactExports.useCallback((v) => { try { localStorage.setItem('cv-sidebar', v ? '1' : '0'); } catch(e) {} setSidebarOpen(v); }, []);
  const [userMenuOpen, setUserMenuOpen] = reactExports.useState(false);
  const [darkMode, setDarkMode] = useDarkMode();
  const navigate = useNavigate();
  const location = useLocation();
  const {
    sidebar = {},
    header = {},
    main = {}
  } = config;
  const {
    logo = { text: "URVault" },
    navigation = {
      main: [
        { title: "Overview",   href: "/dashboard",           icon: Database,    active: location.pathname === "/dashboard" },
        { title: "Devices",    href: "/dashboard/devices",   icon: Smartphone,  active: location.pathname === "/dashboard/devices" },
        { title: "Backups",    href: "/dashboard/backups",   icon: Cloud,       active: location.pathname === "/dashboard/backups" },
        { title: "Files",      href: "/dashboard/files",     icon: FolderOpen,  active: location.pathname === "/dashboard/files" },
        { title: "Storage",    href: "/dashboard/storage",   icon: HardDrive,   active: location.pathname === "/dashboard/storage" },
        { title: "Schedules",  href: "/dashboard/schedules", icon: Clock,       active: location.pathname === "/dashboard/schedules" },
        { title: "Setup",      href: "/dashboard/setup",     icon: Settings,    active: location.pathname === "/dashboard/setup" }
      ],
      secondary: [
        { title: "Health Check", href: "/api/health/",  icon: Shield },
        { title: "Server Home",  href: "/",             icon: Rocket }
      ]
    },
    footer: sidebarFooter,
    className: sidebarClassName
  } = sidebar;
  const {
    search = { enabled: true, placeholder: "Search..." },
    notifications = { enabled: true, count: 0 },
    user = { name: "User", email: "user@example.com", initials: "U" },
    actions: headerActions,
    className: headerClassName
  } = header;
  const {
    maxWidth = "full",
    padding = true,
    className: mainClassName
  } = main;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: cn("flex h-screen bg-gray-50/50", className), children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("aside", { className: cn(
      "fixed inset-y-0 left-0 z-50 w-64 bg-white border-r transform transition-transform duration-200 ease-in-out lg:translate-x-0 lg:static lg:inset-0",
      sidebarOpen ? "translate-x-0" : "-translate-x-full",
      sidebarClassName
    ), children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex h-full flex-col", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex h-14 items-center justify-between px-4 border-b", children: [
        logo.href ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: logo.href, className: "flex items-center gap-2 font-semibold", children: [
          logo.image && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("img", { src: logo.image, alt: logo.text, className: "h-6 w-6" }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 133,
            columnNumber: 19
          }, this),
          logo.text && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: logo.text }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 135,
            columnNumber: 31
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 131,
          columnNumber: 15
        }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2 font-semibold", children: [
          logo.image && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("img", { src: logo.image, alt: logo.text, className: "h-6 w-6" }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 140,
            columnNumber: 19
          }, this),
          logo.text && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: logo.text }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 142,
            columnNumber: 31
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 138,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          Button,
          {
            variant: "ghost",
            size: "icon",
            className: "lg:hidden",
            onClick: () => _setSidebar(false),
            children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(X, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 151,
              columnNumber: 15
            }, this)
          },
          void 0,
          false,
          {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 145,
            columnNumber: 13
          },
          this
        )
      ] }, void 0, true, {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 129,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("nav", { className: "flex-1 space-y-1 px-2 py-4 overflow-y-auto", children: [
        navigation.main && navigation.main.length > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-1", children: navigation.main.map((item, index) => {
          const Icon2 = item.icon;
          return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            "a",
            {
              href: item.href,
              className: cn(
                "flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-colors",
                item.active ? "bg-gray-100 text-gray-900" : "text-gray-600 hover:bg-gray-50 hover:text-gray-900"
              ),
              children: [
                Icon2 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Icon2, { className: "h-4 w-4" }, void 0, false, {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 172,
                  columnNumber: 32
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "flex-1", children: item.title }, void 0, false, {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 173,
                  columnNumber: 23
                }, this),
                item.badge !== void 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "ml-auto flex h-5 min-w-[20px] items-center justify-center rounded-full bg-gray-200 px-1 text-xs", children: item.badge }, void 0, false, {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 175,
                  columnNumber: 25
                }, this)
              ]
            },
            index,
            true,
            {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 162,
              columnNumber: 21
            },
            this
          );
        }) }, void 0, false, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 158,
          columnNumber: 15
        }, this),
        navigation.secondary && navigation.secondary.length > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "my-4 border-t" }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 187,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-1", children: navigation.secondary.map((item, index) => {
            const Icon2 = item.icon;
            return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              "a",
              {
                href: item.href,
                className: "flex items-center gap-3 rounded-lg px-3 py-2 text-sm text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900",
                children: [
                  Icon2 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Icon2, { className: "h-4 w-4" }, void 0, false, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 197,
                    columnNumber: 34
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: item.title }, void 0, false, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 198,
                    columnNumber: 25
                  }, this)
                ]
              },
              index,
              true,
              {
                fileName: "/app/src/layouts/Dashboard.tsx",
                lineNumber: 192,
                columnNumber: 23
              },
              this
            );
          }) }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 188,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 186,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 156,
        columnNumber: 11
      }, this),
      sidebarFooter && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "border-t p-4", children: sidebarFooter }, void 0, false, {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 209,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/layouts/Dashboard.tsx",
      lineNumber: 127,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/layouts/Dashboard.tsx",
      lineNumber: 122,
      columnNumber: 7
    }, this),
    sidebarOpen && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
      "div",
      {
        className: "fixed inset-0 z-40 bg-black/50 lg:hidden",
        onClick: () => _setSidebar(false)
      },
      void 0,
      false,
      {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 218,
        columnNumber: 9
      },
      this
    ),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("header", { className: cn(
        "flex h-14 items-center gap-4 border-b bg-white px-4 lg:px-6",
        headerClassName
      ), children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          Button,
          {
            variant: "ghost",
            size: "icon",
            className: "lg:hidden",
            onClick: () => _setSidebar(true),
            children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Menu, { className: "h-5 w-5" }, void 0, false, {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 238,
              columnNumber: 13
            }, this)
          },
          void 0,
          false,
          {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 232,
            columnNumber: 11
          },
          this
        ),
        search.enabled && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-1 max-w-md", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "relative", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Search, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-gray-400" }, void 0, false, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 245,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            "input",
            {
              type: "search",
              placeholder: search.placeholder,
              className: "w-full rounded-lg border bg-gray-50 pl-8 pr-3 py-2 text-sm outline-none focus:bg-white focus:ring-2 focus:ring-gray-200"
            },
            void 0,
            false,
            {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 246,
              columnNumber: 17
            },
            this
          )
        ] }, void 0, true, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 244,
          columnNumber: 15
        }, this) }, void 0, false, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 243,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "ml-auto flex items-center gap-2", children: [
          headerActions,
          reactExports.createElement(Button, { variant: "ghost", size: "icon", onClick: () => setDarkMode(function(d){return !d;}), title: darkMode ? "Switch to light mode" : "Switch to dark mode" },
            reactExports.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
              darkMode
                ? [reactExports.createElement("circle", {key:"c", cx:"12", cy:"12", r:"4"}), reactExports.createElement("path", {key:"p", d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"})]
                : reactExports.createElement("path", {d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})
            )
          ),
          notifications.enabled && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "ghost", size: "icon", className: "relative", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Bell, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 262,
              columnNumber: 17
            }, this),
            notifications.count && notifications.count > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "absolute -top-1 -right-1 h-4 w-4 rounded-full bg-red-500 text-[10px] font-medium text-white flex items-center justify-center", children: notifications.count > 9 ? "9+" : notifications.count }, void 0, false, {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 264,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 261,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "relative", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: "ghost",
                className: "relative flex items-center gap-2 px-2",
                onClick: () => setUserMenuOpen(!userMenuOpen),
                children: [
                  user.avatar ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                    "img",
                    {
                      src: user.avatar,
                      alt: user.name,
                      className: "h-8 w-8 rounded-full"
                    },
                    void 0,
                    false,
                    {
                      fileName: "/app/src/layouts/Dashboard.tsx",
                      lineNumber: 279,
                      columnNumber: 19
                    },
                    this
                  ) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-gray-200 text-sm font-medium", children: user.initials }, void 0, false, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 285,
                    columnNumber: 19
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "hidden lg:block text-left", children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm font-medium", children: user.name }, void 0, false, {
                      fileName: "/app/src/layouts/Dashboard.tsx",
                      lineNumber: 290,
                      columnNumber: 19
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-xs text-gray-500", children: user.email }, void 0, false, {
                      fileName: "/app/src/layouts/Dashboard.tsx",
                      lineNumber: 291,
                      columnNumber: 19
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 289,
                    columnNumber: 17
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ChevronDown, { className: "h-4 w-4 text-gray-500 hidden lg:block" }, void 0, false, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 293,
                    columnNumber: 17
                  }, this)
                ]
              },
              void 0,
              true,
              {
                fileName: "/app/src/layouts/Dashboard.tsx",
                lineNumber: 273,
                columnNumber: 15
              },
              this
            ),
            userMenuOpen && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                "div",
                {
                  className: "fixed inset-0 z-10",
                  onClick: () => setUserMenuOpen(false)
                },
                void 0,
                false,
                {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 299,
                  columnNumber: 19
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "absolute right-0 top-full z-50 mt-2 w-56 rounded-lg border bg-white shadow-lg", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "p-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "px-2 py-1.5 text-sm text-gray-900", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: user.name }, void 0, false, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 306,
                    columnNumber: 25
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-gray-500", children: user.email }, void 0, false, {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 307,
                    columnNumber: 25
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 305,
                  columnNumber: 23
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "my-1 border-t" }, void 0, false, {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 309,
                  columnNumber: 23
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  "button",
                  {
                    onClick: () => {
                      console.log("[Dashboard] Settings clicked, navigating to /dashboard/setup");
                      setUserMenuOpen(false);
                      navigate("/dashboard/setup");
                    },
                    className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm text-gray-700 hover:bg-gray-100",
                    children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Settings, { className: "h-4 w-4" }, void 0, false, {
                        fileName: "/app/src/layouts/Dashboard.tsx",
                        lineNumber: 318,
                        columnNumber: 25
                      }, this),
                      "Settings"
                    ]
                  },
                  void 0,
                  true,
                  {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 310,
                    columnNumber: 23
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  "a",
                  {
                    href: "/assets/docs/README.md",
                    target: "_blank",
                    rel: "noopener noreferrer",
                    onClick: () => {
                      console.log("[Dashboard] Help clicked, opening documentation");
                      setUserMenuOpen(false);
                    },
                    className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm text-gray-700 hover:bg-gray-100",
                    children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleHelp, { className: "h-4 w-4" }, void 0, false, {
                        fileName: "/app/src/layouts/Dashboard.tsx",
                        lineNumber: 331,
                        columnNumber: 25
                      }, this),
                      "Help & Documentation"
                    ]
                  },
                  void 0,
                  true,
                  {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 321,
                    columnNumber: 23
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "my-1 border-t" }, void 0, false, {
                  fileName: "/app/src/layouts/Dashboard.tsx",
                  lineNumber: 334,
                  columnNumber: 23
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  "button",
                  {
                    onClick: () => {
                      setUserMenuOpen(false);
                      localStorage.removeItem("admin_logged_in");
                      sessionStorage.clear();
                      window.location.href = "/login";
                    },
                    className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm text-gray-700 hover:bg-gray-100",
                    children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LogOut, { className: "h-4 w-4" }, void 0, false, {
                        fileName: "/app/src/layouts/Dashboard.tsx",
                        lineNumber: 348,
                        columnNumber: 25
                      }, this),
                      "Log out"
                    ]
                  },
                  void 0,
                  true,
                  {
                    fileName: "/app/src/layouts/Dashboard.tsx",
                    lineNumber: 335,
                    columnNumber: 23
                  },
                  this
                )
              ] }, void 0, true, {
                fileName: "/app/src/layouts/Dashboard.tsx",
                lineNumber: 304,
                columnNumber: 21
              }, this) }, void 0, false, {
                fileName: "/app/src/layouts/Dashboard.tsx",
                lineNumber: 303,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/layouts/Dashboard.tsx",
              lineNumber: 298,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/layouts/Dashboard.tsx",
            lineNumber: 272,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/layouts/Dashboard.tsx",
          lineNumber: 256,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 227,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("main", { className: cn(
        "flex-1 overflow-y-auto",
        padding && "p-4 lg:p-6",
        mainClassName
      ), children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: cn(
        "mx-auto",
        maxWidthClasses[maxWidth]
      ), children }, void 0, false, {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 365,
        columnNumber: 11
      }, this) }, void 0, false, {
        fileName: "/app/src/layouts/Dashboard.tsx",
        lineNumber: 360,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/layouts/Dashboard.tsx",
      lineNumber: 225,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/layouts/Dashboard.tsx",
    lineNumber: 120,
    columnNumber: 5
  }, this);
}
const badgeVariants = cva(
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
  {
    variants: {
      variant: {
        default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
        secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
        destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
        outline: "text-foreground"
      }
    },
    defaultVariants: {
      variant: "default"
    }
  }
);
function Badge({ className, variant, ...props }) {
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: cn(badgeVariants({ variant }), className), ...props }, void 0, false, {
    fileName: "/app/src/components/ui/badge.tsx",
    lineNumber: 32,
    columnNumber: 5
  }, this);
}
const Progress = reactExports.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Root,
  {
    ref,
    className: cn(
      "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
      className
    ),
    ...props,
    children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
      Indicator,
      {
        className: "h-full w-full flex-1 bg-primary transition-all",
        style: { transform: `translateX(-${100 - (value || 0)}%)` }
      },
      void 0,
      false,
      {
        fileName: "/app/src/components/ui/progress.tsx",
        lineNumber: 18,
        columnNumber: 5
      },
      void 0
    )
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/progress.tsx",
    lineNumber: 10,
    columnNumber: 3
  },
  void 0
));
Progress.displayName = Root.displayName;
const Dialog = Root$1;
const DialogTrigger = Trigger;
const DialogPortal = Portal;
const DialogOverlay = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Overlay,
  {
    ref,
    className: cn(
      "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/dialog.tsx",
    lineNumber: 21,
    columnNumber: 3
  },
  void 0
));
DialogOverlay.displayName = Overlay.displayName;
const DialogContent = reactExports.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogPortal, { children: [
  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogOverlay, {}, void 0, false, {
    fileName: "/app/src/components/ui/dialog.tsx",
    lineNumber: 37,
    columnNumber: 5
  }, void 0),
  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
    Content,
    {
      ref,
      className: cn(
        "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
        className
      ),
      ...props,
      children: [
        children,
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(X, { className: "h-4 w-4" }, void 0, false, {
            fileName: "/app/src/components/ui/dialog.tsx",
            lineNumber: 48,
            columnNumber: 9
          }, void 0),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "sr-only", children: "Close" }, void 0, false, {
            fileName: "/app/src/components/ui/dialog.tsx",
            lineNumber: 49,
            columnNumber: 9
          }, void 0)
        ] }, void 0, true, {
          fileName: "/app/src/components/ui/dialog.tsx",
          lineNumber: 47,
          columnNumber: 7
        }, void 0)
      ]
    },
    void 0,
    true,
    {
      fileName: "/app/src/components/ui/dialog.tsx",
      lineNumber: 38,
      columnNumber: 5
    },
    void 0
  )
] }, void 0, true, {
  fileName: "/app/src/components/ui/dialog.tsx",
  lineNumber: 36,
  columnNumber: 3
}, void 0));
DialogContent.displayName = Content.displayName;
const DialogHeader = ({
  className,
  ...props
}) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    className: cn(
      "flex flex-col space-y-1.5 text-center sm:text-left",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/dialog.tsx",
    lineNumber: 60,
    columnNumber: 3
  },
  void 0
);
DialogHeader.displayName = "DialogHeader";
const DialogFooter = ({
  className,
  ...props
}) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  "div",
  {
    className: cn(
      "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/dialog.tsx",
    lineNumber: 74,
    columnNumber: 3
  },
  void 0
);
DialogFooter.displayName = "DialogFooter";
const DialogTitle = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Title,
  {
    ref,
    className: cn(
      "text-lg font-semibold leading-none tracking-tight",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/dialog.tsx",
    lineNumber: 88,
    columnNumber: 3
  },
  void 0
));
DialogTitle.displayName = Title.displayName;
const DialogDescription = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Description,
  {
    ref,
    className: cn("text-sm text-muted-foreground", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/dialog.tsx",
    lineNumber: 103,
    columnNumber: 3
  },
  void 0
));
DialogDescription.displayName = Description.displayName;
const Input = reactExports.forwardRef(
  ({ className, type, ...props }, ref) => {
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
      "input",
      {
        type,
        className: cn(
          "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
          className
        ),
        ref,
        ...props
      },
      void 0,
      false,
      {
        fileName: "/app/src/components/ui/input.tsx",
        lineNumber: 8,
        columnNumber: 7
      },
      void 0
    );
  }
);
Input.displayName = "Input";
const labelVariants = cva(
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
);
const Label = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Root$2,
  {
    ref,
    className: cn(labelVariants(), className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/label.tsx",
    lineNumber: 16,
    columnNumber: 3
  },
  void 0
));
Label.displayName = Root$2.displayName;
async function fetchDevices() {
  const response = await fetch("/api/devices");
  if (!response.ok) {
    throw new Error("Failed to fetch devices");
  }
  return response.json();
}
async function generatePairingToken() {
  const response = await fetch("/api/devices/generate-token", {
    method: "POST",
    headers: { "Content-Type": "application/json" }
  });
  if (!response.ok) {
    throw new Error("Failed to generate pairing token");
  }
  return response.json();
}
async function deleteDevice(deviceId) {
  const response = await fetch(`/api/devices/${deviceId}`, {
    method: "DELETE"
  });
  if (!response.ok) {
    throw new Error("Failed to delete device");
  }
}
async function fetchBackups(deviceId) {
  const url = "/api/backup/list";
  const response = await fetch(url);
  if (!response.ok) {
    throw new Error("Failed to fetch backups");
  }
  return response.json();
}
function formatFileSize(sizeInMB) {
  if (sizeInMB < 1024) {
    return `${sizeInMB.toFixed(2)} MB`;
  }
  return `${(sizeInMB / 1024).toFixed(2)} GB`;
}
async function fetchDeviceBackupStatus(deviceId) {
  const response = await fetch(`/api/devices/${deviceId}/backup-status`);
  if (!response.ok) {
    throw new Error("Failed to fetch device backup status");
  }
  return response.json();
}
function useCurrentUser() {
  const [user, setUser] = reactExports.useState(null);
  const [loading, setLoading] = reactExports.useState(true);
  const [error, setError] = reactExports.useState(null);
  reactExports.useEffect(() => {
    let mounted = true;
    const fetchUser = async () => {
      try {
        const res = await fetch("/api/auth/current-user");
        if (!res.ok) {
          const errorText = await res.text();
          console.error("Failed to fetch user:", res.status, errorText);
          throw new Error(`Failed to fetch user: ${res.status}`);
        }
        const data = await res.json();
        if (mounted) {
          setUser(data.user);
          setError(null);
        }
      } catch (err) {
        console.error("Error fetching user:", err);
        if (mounted) {
          setError(err instanceof Error ? err.message : "Unknown error");
          setUser(null);
        }
      } finally {
        if (mounted) {
          setLoading(false);
        }
      }
    };
    fetchUser();
    return () => {
      mounted = false;
    };
  }, []);
  return { user, loading, error };
}
function DashboardHome() {
  const navigate = useNavigate();
  const currentUser = useCurrentUser();
  const [stats, setStats] = reactExports.useState({
    totalDevices: 0,
    activeDevices: 0,
    totalBackups: 0,
    completedBackups: 0,
    totalStorage: 0,
    recentBackups: [],
    devices: []
  });
  const [loading, setLoading] = reactExports.useState(true);
  const [refreshing, setRefreshing] = reactExports.useState(false);
  const [pairingToken, setPairingToken] = reactExports.useState("");
  const [qrCodeDataUrl, setQrCodeDataUrl] = reactExports.useState("");
  const [showPairingDialog, setShowPairingDialog] = reactExports.useState(false);
  const [generatingToken, setGeneratingToken] = reactExports.useState(false);
  const loadStats = async (isRefresh = false) => {
    try {
      if (isRefresh) setRefreshing(true);
      else setLoading(true);
      const [devicesData, backupsData] = await Promise.all([
        fetchDevices(),
        fetchBackups()
      ]);
      const devices = devicesData.devices || [];
      const backups = backupsData.backups || [];
      const devicesWithStatus = await Promise.all(
        devices.map(async (device) => {
          try {
            const backupStatus = await fetchDeviceBackupStatus(device.id);
            return { ...device, backupStatus };
          } catch (error) {
            console.error(`Failed to fetch backup status for device ${device.id}:`, error);
            return device;
          }
        })
      );
      const activeDevices = devices.filter((d) => d.isConnected).length;
      const completedBackups = backups.filter((b) => b.status === "completed").length;
      const totalStorage = backups.reduce((sum, b) => sum + (b.size || 0), 0);
      const deviceNameMap = {};
      devices.forEach((d) => { deviceNameMap[d.deviceId || d.device_id || d.id] = d.name || d.device_name || d.deviceId; });
      // Group individual file records by backup session (backupId prefix before '_f')
      const sessionMap = {};
      backups.forEach((b) => {
        const sessionId = b.backupId && b.backupId.includes('_f') ? b.backupId.split('_f')[0] : b.backupId;
        if (!sessionMap[sessionId]) {
          sessionMap[sessionId] = { ...b, fileCount: 1, totalSize: b.size || 0, deviceName: deviceNameMap[b.deviceId || b.device_id] || "Unknown Device" };
        } else {
          sessionMap[sessionId].fileCount += 1;
          sessionMap[sessionId].totalSize += (b.size || 0);
          if (b.startedAt && (!sessionMap[sessionId].startedAt || new Date(b.startedAt) > new Date(sessionMap[sessionId].startedAt))) {
            sessionMap[sessionId].startedAt = b.startedAt;
          }
        }
      });
      const recentBackups = Object.values(sessionMap)
        .sort((a, b2) => new Date(b2.startedAt || 0) - new Date(a.startedAt || 0))
        .slice(0, 5)
        .map((s) => ({ ...s, size: s.totalSize }));
      setStats({
        totalDevices: devices.length,
        activeDevices,
        totalBackups: backups.length,
        completedBackups,
        totalStorage,
        recentBackups,
        devices: devicesWithStatus
      });
    } catch (error) {
      console.error("Failed to load stats:", error);
    } finally {
      setLoading(false);
      setRefreshing(false);
    }
  };
  reactExports.useEffect(() => {
    loadStats();
    const interval = setInterval(() => loadStats(true), 3e4);
    return () => clearInterval(interval);
  }, []);
  reactExports.useEffect(() => {
    if (!showPairingDialog) return;
    const openedAt = Date.now();
    const poll = setInterval(async () => {
      try {
        const res = await fetch("/api/devices", { cache: "no-store" });
        const d = await res.json();
        const devs = d.devices || [];
        const anyRecent = devs.some((dev) => {
          const seen = new Date(dev.lastSeen || dev.last_seen || 0).getTime();
          return seen > openedAt - 5000;
        });
        if (anyRecent || devs.length > stats.totalDevices) {
          clearInterval(poll);
          setShowPairingDialog(false);
          loadStats(true);
        }
      } catch (e) {}
    }, 3000);
    return () => clearInterval(poll);
  }, [showPairingDialog]);
  const handleGenerateToken = async () => {
    try {
      setGeneratingToken(true);
      const response = await generatePairingToken();
      if (response.success && response.token) {
        setPairingToken(response.token);
        const qrDataUrl = await QRCode.toDataURL(response.qrData, {
          width: 256,
          margin: 2,
          color: {
            dark: "#000000",
            light: "#FFFFFF"
          }
        });
        setQrCodeDataUrl(qrDataUrl);
        setShowPairingDialog(true);
      }
    } catch (error) {
      console.error("Failed to generate pairing token:", error);
    } finally {
      setGeneratingToken(false);
    }
  };
  const handleDeleteDevice = async (deviceId) => {
    if (!confirm("Are you sure you want to delete this device? This action cannot be undone.")) {
      return;
    }
    try {
      await deleteDevice(String(deviceId));
      await loadStats();
    } catch (error) {
      console.error("Failed to delete device:", error);
      alert("Failed to delete device. Please try again.");
    }
  };
  const getStatusBadge = (status) => {
    const colors = {
      active: "bg-green-100 text-green-800 border-green-200",
      inactive: "bg-gray-100 text-gray-800 border-gray-200",
      pending: "bg-yellow-100 text-yellow-800 border-yellow-200",
      completed: "bg-green-100 text-green-800 border-green-200",
      failed: "bg-red-100 text-red-800 border-red-200",
      in_progress: "bg-blue-100 text-blue-800 border-blue-200"
    };
    return colors[status] || "bg-gray-100 text-gray-800";
  };
  const formatDate = (dateString) => {
    const date = new Date(dateString);
    const now = /* @__PURE__ */ new Date();
    const diff = now.getTime() - date.getTime();
    const minutes = Math.floor(diff / 6e4);
    const hours = Math.floor(diff / 36e5);
    const days = Math.floor(diff / 864e5);
    if (minutes < 1) return "Just now";
    if (minutes < 60) return `${minutes}m ago`;
    if (hours < 24) return `${hours}h ago`;
    if (days < 7) return `${days}d ago`;
    return date.toLocaleDateString();
  };
  const successRate = stats.totalBackups > 0 ? Math.round(stats.completedBackups / stats.totalBackups * 100) : 0;
  const dashboardConfig = (currentUser == null ? void 0 : currentUser.user) ? {
    header: {
      user: {
        name: currentUser.user.name || currentUser.user.email,
        email: currentUser.user.email,
        initials: currentUser.user.name ? currentUser.user.name.substring(0, 2).toUpperCase() : "U"
      }
    }
  } : void 0;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold", children: "URVault" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 233,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Backup server dashboard" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 234,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 232,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              onClick: handleGenerateToken,
              disabled: generatingToken,
              size: "lg",
              className: "gap-2",
              children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-5 w-5" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 243,
                  columnNumber: 15
                }, this),
                "Add Device"
              ]
            },
            void 0,
            true,
            {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 237,
              columnNumber: 13
            },
            this
          ),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              onClick: () => navigate("/dashboard/setup"),
              variant: "outline",
              size: "lg",
              children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Settings, { className: "h-5 w-5" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 251,
                columnNumber: 15
              }, this)
            },
            void 0,
            false,
            {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 246,
              columnNumber: 13
            },
            this
          ),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              onClick: () => navigate("/dashboard/files"),
              variant: "outline",
              size: "lg",
              children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-5 w-5" }, void 0, false, {}, this)
            },
            void 0,
            false,
            {},
            this
          ),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              onClick: () => loadStats(true),
              disabled: refreshing,
              variant: "outline",
              size: "lg",
              children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RefreshCw, { className: `h-5 w-5 ${refreshing ? "animate-spin" : ""}` }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 259,
                columnNumber: 15
              }, this)
            },
            void 0,
            false,
            {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 253,
              columnNumber: 13
            },
            this
          )
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 236,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/index.tsx",
        lineNumber: 231,
        columnNumber: 9
      }, this),
      loading ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 266,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Loading dashboard..." }, void 0, false, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 267,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/index.tsx",
        lineNumber: 265,
        columnNumber: 11
      }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4 md:grid-cols-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Devices" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 275,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 276,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 274,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold", children: stats.totalDevices }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 279,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: [
                stats.activeDevices,
                " active"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 280,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 278,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 273,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Backups" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 288,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 289,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 287,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold", children: stats.totalBackups }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 292,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: [
                stats.completedBackups,
                " completed"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 293,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 291,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 286,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Storage Used" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 301,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 302,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 300,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold", children: formatFileSize(stats.totalStorage) }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 305,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Total backup size" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 306,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 304,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 299,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Success Rate" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 312,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 313,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 311,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold", children: [
                successRate,
                "%"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 316,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: successRate, className: "mt-2" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 317,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 315,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 310,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 272,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Connected Devices" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 325,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: stats.devices.length === 0 ? "No devices connected yet" : `${stats.devices.length} device(s) paired` }, void 0, false, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 326,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 324,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: stats.devices.length === 0 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-8", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-12 w-12 mx-auto mb-4 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 333,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground mb-4", children: "Get started by adding your first device" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 334,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleGenerateToken, disabled: generatingToken, children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-4 w-4 mr-2" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 336,
                columnNumber: 23
              }, this),
              "Add Device"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 335,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 332,
            columnNumber: 19
          }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: stats.devices.map((device) => {
            const backupStatus = device.backupStatus;
            const hasProgress = (backupStatus == null ? void 0 : backupStatus.status) === "in_progress" && backupStatus.progress;
            return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "p-4 border rounded-lg space-y-3 cursor-pointer hover:bg-accent/50 transition-colors", onClick: () => navigate("/dashboard/files?deviceId=" + (device.deviceId || device.device_id || device.id)), children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: `w-2 h-2 rounded-full ${device.lastSeen && (Date.now() - new Date(device.lastSeen).getTime() < 600000) ? "bg-green-500" : "bg-gray-400"}` }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 351,
                    columnNumber: 31
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-medium", children: device.name }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 353,
                      columnNumber: 33
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: [
                      device.model || "Unknown model",
                      " • Last seen ",
                      formatDate(device.lastSeen)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 354,
                      columnNumber: 33
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 352,
                    columnNumber: 31
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 350,
                  columnNumber: 29
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: "bg-purple-100 text-purple-800 border-purple-200", children: "Paired" }, void 0, false, { fileName: "/app/src/pages/dashboard/index.tsx", lineNumber: 359, columnNumber: 31 }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: device.lastSeen && (Date.now() - new Date(device.lastSeen).getTime() < 600000) ? "bg-green-100 text-green-800 border-green-200" : "bg-gray-100 text-gray-800 border-gray-200", children: device.lastSeen && (Date.now() - new Date(device.lastSeen).getTime() < 600000) ? "Connected" : "Offline" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 360,
                    columnNumber: 31
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                    Button,
                    {
                      variant: "ghost",
                      size: "sm",
                      onClick: (e) => { e.stopPropagation(); handleDeleteDevice(device.id); },
                      className: "text-red-600 hover:text-red-700 hover:bg-red-50",
                      children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Trash2, { className: "h-4 w-4" }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/index.tsx",
                        lineNumber: 369,
                        columnNumber: 33
                      }, this)
                    },
                    void 0,
                    false,
                    {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 363,
                      columnNumber: 31
                    },
                    this
                  )
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 359,
                  columnNumber: 29
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 349,
                columnNumber: 27
              }, this),
              backupStatus && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between pt-2 border-t", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
                  backupStatus.status === "no_backup" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 380,
                      columnNumber: 37
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-muted-foreground", children: "No backup exists" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 381,
                      columnNumber: 37
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 379,
                    columnNumber: 35
                  }, this),
                  backupStatus.status === "completed" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 386,
                      columnNumber: 37
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-green-600 font-medium", children: "Backup complete" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 387,
                      columnNumber: 37
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 385,
                    columnNumber: 35
                  }, this),
                  backupStatus.status === "in_progress" && hasProgress && backupStatus.progress && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-4 w-4 text-blue-600 animate-spin" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 392,
                      columnNumber: 37
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-blue-600 font-medium", children: [
                      "Backup in progress ",
                      backupStatus.progress.filesUploaded,
                      "/",
                      backupStatus.progress.totalFiles
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 393,
                      columnNumber: 37
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 391,
                    columnNumber: 35
                  }, this),
                  backupStatus.status === "in_progress" && !hasProgress && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-4 w-4 text-blue-600 animate-spin" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 400,
                      columnNumber: 37
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-blue-600 font-medium", children: "Backup in progress" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 401,
                      columnNumber: 37
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 399,
                    columnNumber: 35
                  }, this),
                  backupStatus.status === "failed" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4 text-red-600" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 406,
                      columnNumber: 37
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-red-600 font-medium", children: "Backup failed" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/index.tsx",
                      lineNumber: 407,
                      columnNumber: 37
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/index.tsx",
                    lineNumber: 405,
                    columnNumber: 35
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 377,
                  columnNumber: 31
                }, this),
                hasProgress && backupStatus.progress && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-xs text-muted-foreground", children: [
                  backupStatus.progress.percentComplete,
                  "%"
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 412,
                  columnNumber: 33
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 376,
                columnNumber: 29
              }, this),
              hasProgress && backupStatus.progress && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: backupStatus.progress.percentComplete, className: "h-2" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 421,
                columnNumber: 29
              }, this)
            ] }, device.id, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 347,
              columnNumber: 25
            }, this);
          }) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 341,
            columnNumber: 19
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 330,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 323,
          columnNumber: 13
        }, this),
        stats.recentBackups.length > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Recent Backups" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 435,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Latest backup activity" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 436,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 434,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: stats.recentBackups.map((backup) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between p-3 border rounded-lg cursor-pointer hover:bg-accent/50 transition-colors", onClick: () => navigate("/dashboard/files?deviceId=" + (backup.deviceId || backup.device_id || "")), children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-5 w-5 text-muted-foreground" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 443,
                columnNumber: 27
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-medium", children: [
                  backup.deviceName,
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "ml-2 text-xs font-normal text-muted-foreground uppercase tracking-wide", children: backup.backupType || backup.backup_type }, void 0, false, {}, this)
                ] }, void 0, true, {}, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: [
                  backup.fileCount > 1 ? `${backup.fileCount} files` : "1 file",
                  " • ",
                  formatFileSize(backup.size),
                  " • ",
                  formatDate(backup.startedAt)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 446,
                  columnNumber: 29
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 444,
                columnNumber: 27
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 442,
              columnNumber: 25
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
              backup.status === "in_progress" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Progress,
                {
                  value: backup.uploaded_size / backup.size * 100,
                  className: "w-24"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/index.tsx",
                  lineNumber: 454,
                  columnNumber: 29
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: getStatusBadge(backup.status), children: backup.status.replace("_", " ") }, void 0, false, {
                fileName: "/app/src/pages/dashboard/index.tsx",
                lineNumber: 459,
                columnNumber: 27
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 452,
              columnNumber: 25
            }, this)
          ] }, backup.id, true, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 441,
            columnNumber: 23
          }, this)) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 439,
            columnNumber: 19
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 438,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 433,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/index.tsx",
        lineNumber: 270,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/index.tsx",
      lineNumber: 229,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: showPairingDialog, onOpenChange: setShowPairingDialog, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { className: "sm:max-w-md", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: "Pair New Device" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 477,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: "Enter this pairing code in your mobile app to connect your device" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 478,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/index.tsx",
        lineNumber: 476,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-center p-8 bg-muted rounded-lg", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
          qrCodeDataUrl ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            "img",
            {
              src: qrCodeDataUrl,
              alt: "Pairing QR Code",
              className: "mx-auto mb-4 rounded-lg",
              style: { width: "256px", height: "256px" }
            },
            void 0,
            false,
            {
              fileName: "/app/src/pages/dashboard/index.tsx",
              lineNumber: 486,
              columnNumber: 19
            },
            this
          ) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(QrCode, { className: "h-16 w-16 mx-auto mb-4 text-muted-foreground" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 493,
            columnNumber: 19
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-xl font-mono font-bold tracking-wider break-all", children: pairingToken }, void 0, false, {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 495,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 484,
          columnNumber: 15
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 483,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "This code expires in 15 minutes. Open your mobile app and enter the code to complete pairing." }, void 0, false, {
          fileName: "/app/src/pages/dashboard/index.tsx",
          lineNumber: 508,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          Button,
          {
            onClick: () => setShowPairingDialog(false),
            className: "w-full",
            children: "Done"
          },
          void 0,
          false,
          {
            fileName: "/app/src/pages/dashboard/index.tsx",
            lineNumber: 511,
            columnNumber: 13
          },
          this
        )
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/index.tsx",
        lineNumber: 482,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/index.tsx",
      lineNumber: 475,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/index.tsx",
      lineNumber: 474,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/dashboard/index.tsx",
    lineNumber: 228,
    columnNumber: 5
  }, this);
}
function DevicesPage() {
  const [devices, setDevices] = reactExports.useState([]);
  const [filteredDevices, setFilteredDevices] = reactExports.useState([]);
  const [loading, setLoading] = reactExports.useState(true);
  const { user: currentUser } = useCurrentUser();
  const [searchQuery, setSearchQuery] = reactExports.useState("");
  const [filterStatus, setFilterStatus] = reactExports.useState("all");
  const [showQRDialog, setShowQRDialog] = reactExports.useState(false);
  const [qrCodeUrl, setQrCodeUrl] = reactExports.useState("");
  const [pairingToken, setPairingToken] = reactExports.useState("");
  const [tokenExpiry, setTokenExpiry] = reactExports.useState(null);
  const [generatingQR, setGeneratingQR] = reactExports.useState(false);
  const [showRecoveryDialog, setShowRecoveryDialog] = reactExports.useState(false);
  const [recoveryForm, setRecoveryForm] = reactExports.useState({ username: "", password: "", oldDeviceId: "", newDeviceId: "" });
  const [recoveryResult, setRecoveryResult] = reactExports.useState(null);
  const [recoveryLoading, setRecoveryLoading] = reactExports.useState(false);
  reactExports.useRef(null);
  reactExports.useEffect(() => {
    loadDevices();
  }, []);
  reactExports.useEffect(() => {
    filterDevicesList();
  }, [devices, searchQuery, filterStatus]);
  reactExports.useEffect(() => {
    if (!showQRDialog) return;
    const openedAt = Date.now();
    const baseline = devices.length;
    const poll = setInterval(async () => {
      try {
        const res = await fetch("/api/devices", { cache: "no-store" });
        const d = await res.json();
        const devs = d.devices || [];
        const anyRecent = devs.some((dev) => {
          const seen = new Date(dev.lastSeen || dev.last_seen || 0).getTime();
          return seen > openedAt - 5000;
        });
        if (anyRecent || devs.length > baseline) {
          clearInterval(poll);
          setDevices(devs);
          setShowQRDialog(false);
        }
      } catch (e) {}
    }, 3000);
    return () => clearInterval(poll);
  }, [showQRDialog]);
  const loadDevices = async () => {
    setLoading(true);
    try {
      const data = await fetchDevices();
      setDevices(data.devices);
    } catch (error) {
      console.error("Failed to load devices:", error);
    } finally {
      setLoading(false);
    }
  };
  const handleRecoverDevice = async () => {
    setRecoveryLoading(true);
    setRecoveryResult(null);
    try {
      const res = await fetch("/api/devices/recover", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(recoveryForm)
      });
      const data = await res.json();
      setRecoveryResult(data);
    } catch (err) {
      setRecoveryResult({ success: false, message: "Network error: " + err.message });
    } finally {
      setRecoveryLoading(false);
    }
  };
  const filterDevicesList = () => {
    let filtered = devices;
    if (filterStatus !== "all") {
      filtered = filtered.filter((d) => d.status === filterStatus);
    }
    if (searchQuery) {
      const query = searchQuery.toLowerCase();
      filtered = filtered.filter(
        (d) => {
          var _a;
          return d.device_name.toLowerCase().includes(query) || ((_a = d.device_model) == null ? void 0 : _a.toLowerCase().includes(query)) || d.device_id.toLowerCase().includes(query);
        }
      );
    }
    setFilteredDevices(filtered);
  };
  const generateQRCode = async () => {
    setGeneratingQR(true);
    try {
      const response = await fetch("/api/devices/generate-token", {
        method: "POST",
        headers: { "Content-Type": "application/json" }
      });
      const data = await response.json();
      if (data.success) {
        setPairingToken(data.token);
        setTokenExpiry(new Date(data.expiresAt));
        const qrDataUrl = await QRCode.toDataURL(data.qrData, {
          width: 300,
          margin: 2,
          color: {
            dark: "#000000",
            light: "#FFFFFF"
          }
        });
        setQrCodeUrl(qrDataUrl);
        setShowQRDialog(true);
      } else {
        console.error("Failed to generate pairing token:", data.error);
        alert("Failed to generate QR code. Please try again.");
      }
    } catch (error) {
      console.error("QR code generation error:", error);
      alert("Failed to generate QR code. Please try again.");
    } finally {
      setGeneratingQR(false);
    }
  };
  const getStatusIcon = (status) => {
    switch (status) {
      case "active":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Wifi, { className: "h-4 w-4 text-green-600" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 131,
          columnNumber: 16
        }, this);
      case "inactive":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(WifiOff, { className: "h-4 w-4 text-gray-400" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 133,
          columnNumber: 16
        }, this);
      case "pending":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-4 w-4 text-yellow-600" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 135,
          columnNumber: 16
        }, this);
      default:
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-4 w-4" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 137,
          columnNumber: 16
        }, this);
    }
  };
  const getStatusBadge = (status) => {
    const colors = {
      active: "bg-green-100 text-green-800 border-green-200",
      inactive: "bg-gray-100 text-gray-800 border-gray-200",
      pending: "bg-yellow-100 text-yellow-800 border-yellow-200"
    };
    return colors[status] || "bg-gray-100 text-gray-800";
  };
  const formatDate = (dateString) => {
    const date = new Date(dateString);
    const now = /* @__PURE__ */ new Date();
    const diff = now.getTime() - date.getTime();
    const minutes = Math.floor(diff / 6e4);
    const hours = Math.floor(diff / 36e5);
    const days = Math.floor(diff / 864e5);
    if (minutes < 1) return "Just now";
    if (minutes < 60) return `${minutes}m ago`;
    if (hours < 24) return `${hours}h ago`;
    if (days < 7) return `${days}d ago`;
    return date.toLocaleDateString();
  };
  const stats = {
    total: devices.length,
    active: devices.filter((d) => d.status === "active").length,
    inactive: devices.filter((d) => d.status === "inactive").length,
    pending: devices.filter((d) => d.status === "pending").length
  };
  const dashboardConfig = currentUser ? {
    header: {
      user: {
        name: currentUser.fullName || currentUser.username,
        email: currentUser.email,
        initials: currentUser.initials
      }
    }
  } : void 0;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold", children: "Devices" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 188,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Manage connected devices and pairing" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 189,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 187,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: generateQRCode, disabled: generatingQR, children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-4 w-4 mr-2" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 193,
              columnNumber: 15
            }, this),
            generatingQR ? "Generating..." : "Add Device"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 192,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: loadDevices, variant: "outline", size: "sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RefreshCw, { className: "h-4 w-4 mr-2" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 197,
              columnNumber: 15
            }, this),
            "Refresh"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 196,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", onClick: () => { setRecoveryResult(null); setShowRecoveryDialog(true); }, children: "Recovery Tool" }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 196, columnNumber: 13 }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 191,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/devices.tsx",
        lineNumber: 186,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4 md:grid-cols-4", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Total Devices" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 207,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 208,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 206,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold", children: stats.total }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 211,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 210,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 205,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "cursor-pointer hover:bg-accent", onClick: () => setFilterStatus("active"), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Active" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 217,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Wifi, { className: "h-4 w-4 text-green-600" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 218,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 216,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold text-green-600", children: stats.active }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 221,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 220,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 215,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "cursor-pointer hover:bg-accent", onClick: () => setFilterStatus("pending"), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Pending" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 227,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-4 w-4 text-yellow-600" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 228,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 226,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold text-yellow-600", children: stats.pending }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 231,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 230,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 225,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "cursor-pointer hover:bg-accent", onClick: () => setFilterStatus("inactive"), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Inactive" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 237,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(WifiOff, { className: "h-4 w-4 text-gray-400" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 238,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 236,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold text-gray-400", children: stats.inactive }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 241,
            columnNumber: 15
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 240,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 235,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/devices.tsx",
        lineNumber: 204,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Device List" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 251,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: [
              filteredDevices.length,
              " device",
              filteredDevices.length !== 1 ? "s" : "",
              " found"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 252,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 250,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "all" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("all"),
                children: "All"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 255,
                columnNumber: 17
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "active" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("active"),
                children: "Active"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 262,
                columnNumber: 17
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "pending" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("pending"),
                children: "Pending"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 269,
                columnNumber: 17
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "inactive" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("inactive"),
                children: "Inactive"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 276,
                columnNumber: 17
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 254,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 249,
          columnNumber: 13
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 248,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "relative mb-4", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 288,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Input,
              {
                placeholder: "Search devices by name, model, or ID...",
                value: searchQuery,
                onChange: (e) => setSearchQuery(e.target.value),
                className: "pl-10"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 289,
                columnNumber: 15
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 287,
            columnNumber: 13
          }, this),
          loading ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RefreshCw, { className: "h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 299,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Loading devices..." }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 300,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 298,
            columnNumber: 15
          }, this) : filteredDevices.length === 0 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-12 w-12 mx-auto mb-4 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 304,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground mb-2", children: "No devices found" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 305,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "Try adjusting your search or filters" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 306,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 303,
            columnNumber: 15
          }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: filteredDevices.map((device) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            "div",
            {
              className: "flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent transition-colors",
              children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-4", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "p-2 rounded-lg bg-muted", children: getStatusIcon(device.status) }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/devices.tsx",
                    lineNumber: 316,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: device.device_name }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/devices.tsx",
                      lineNumber: 320,
                      columnNumber: 25
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground", children: [
                      device.device_model || "Unknown model",
                      device.os_version && ` • ${device.os_version}`
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/devices.tsx",
                      lineNumber: 321,
                      columnNumber: 25
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-xs text-muted-foreground mt-1", children: [
                      "ID: ",
                      device.device_id
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/devices.tsx",
                      lineNumber: 325,
                      columnNumber: 25
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/devices.tsx",
                    lineNumber: 319,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/devices.tsx",
                  lineNumber: 315,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-4", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex flex-col items-end gap-1", children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-1", children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: "bg-purple-100 text-purple-800 border-purple-200", children: "Paired" }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 332, columnNumber: 25 }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: device.lastSeen && (Date.now() - new Date(device.lastSeen).getTime() < 600000) ? "bg-green-100 text-green-800 border-green-200" : "bg-gray-100 text-gray-800 border-gray-200", children: device.lastSeen && (Date.now() - new Date(device.lastSeen).getTime() < 600000) ? "Connected" : "Offline" }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 333, columnNumber: 25 }, this)
                    ] }, void 0, true, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 331, columnNumber: 23 }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-xs text-muted-foreground mt-1", children: [
                      "Last seen: ",
                      formatDate(device.lastSeen)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/devices.tsx",
                      lineNumber: 335,
                      columnNumber: 25
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/devices.tsx",
                    lineNumber: 331,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", children: "View Details" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/devices.tsx",
                    lineNumber: 339,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/devices.tsx",
                  lineNumber: 330,
                  columnNumber: 21
                }, this)
              ]
            },
            device.id,
            true,
            {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 311,
              columnNumber: 19
            },
            this
          )) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 309,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 286,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/devices.tsx",
        lineNumber: 247,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-5 w-5" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 354,
              columnNumber: 15
            }, this),
            "Pair New Device"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 353,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Instructions for connecting a new device" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 357,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 352,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-primary text-primary-foreground font-bold text-sm", children: "1" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 362,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: "Install URVault App" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 366,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground", children: "Download and install the URVault mobile app on your device" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 367,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 365,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 361,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-primary text-primary-foreground font-bold text-sm", children: "2" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 371,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: "Enter Server URL" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 375,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground", children: "Configure the app with your server address" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 376,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("code", { className: "block mt-1 p-2 bg-muted rounded text-xs", children: "https://vm6tgfyizy.preview.c24.airoapp.ai" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 377,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 374,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 370,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-primary text-primary-foreground font-bold text-sm", children: "3" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 381,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: "Complete Pairing" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 385,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground", children: "Follow the in-app instructions to pair your device" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/devices.tsx",
                lineNumber: 386,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 384,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 380,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 360,
          columnNumber: 13
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 359,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/devices.tsx",
        lineNumber: 351,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/devices.tsx",
      lineNumber: 184,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: showQRDialog, onOpenChange: setShowQRDialog, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { className: "sm:max-w-md", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: "Pair New Device" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 398,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: "Scan this QR code with your mobile app to pair your device instantly." }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 399,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/devices.tsx",
        lineNumber: 397,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex flex-col items-center gap-4 py-4", children: [
        qrCodeUrl && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "p-4 bg-white rounded-lg border-2 border-border", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("img", { src: qrCodeUrl, alt: "Pairing QR Code", className: "w-64 h-64" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 406,
          columnNumber: 17
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 405,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center space-y-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm font-medium", children: "Steps to pair:" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 410,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("ol", { className: "text-sm text-muted-foreground space-y-1", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "1. Open URVault mobile app" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 412,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: '2. Tap "Add Server" or "Pair Device"' }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 413,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "3. Scan this QR code" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 414,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "4. Your device will be paired automatically!" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/devices.tsx",
              lineNumber: 415,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/devices.tsx",
            lineNumber: 411,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 409,
          columnNumber: 13
        }, this),
        tokenExpiry && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-xs text-muted-foreground", children: [
          "QR code expires at ",
          tokenExpiry.toLocaleTimeString()
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 419,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: () => setShowQRDialog(false), variant: "outline", className: "w-full", children: "Close" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/devices.tsx",
          lineNumber: 423,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/devices.tsx",
        lineNumber: 403,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/devices.tsx",
      lineNumber: 396,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/devices.tsx",
      lineNumber: 395,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: showRecoveryDialog, onOpenChange: setShowRecoveryDialog, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { className: "sm:max-w-md", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: "Device Recovery Tool" }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 395, columnNumber: 9 }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: "Transfer all backup records from an old Device ID to a new one. Requires admin credentials." }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 396, columnNumber: 9 }, this)
      ] }, void 0, true, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 397, columnNumber: 7 }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3 pt-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("input", { className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm", placeholder: "Admin username", value: recoveryForm.username, onChange: (e) => setRecoveryForm({ ...recoveryForm, username: e.target.value }) }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 398, columnNumber: 9 }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("input", { type: "password", className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm", placeholder: "Admin password", value: recoveryForm.password, onChange: (e) => setRecoveryForm({ ...recoveryForm, password: e.target.value }) }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 399, columnNumber: 9 }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("input", { className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm", placeholder: "Old Device ID", value: recoveryForm.oldDeviceId, onChange: (e) => setRecoveryForm({ ...recoveryForm, oldDeviceId: e.target.value }) }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 400, columnNumber: 9 }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("input", { className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm", placeholder: "New Device ID", value: recoveryForm.newDeviceId, onChange: (e) => setRecoveryForm({ ...recoveryForm, newDeviceId: e.target.value }) }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 401, columnNumber: 9 }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleRecoverDevice, disabled: recoveryLoading, className: "w-full", children: recoveryLoading ? "Processing..." : "Transfer Backups" }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 402, columnNumber: 9 }, this),
        recoveryResult && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: recoveryResult.success ? "text-sm text-green-600 mt-1" : "text-sm text-red-600 mt-1", children: recoveryResult.success ? "✓ " + (recoveryResult.message || "Transfer complete") : "✗ " + (recoveryResult.error || recoveryResult.message || "Transfer failed") }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 403, columnNumber: 9 }, this)
      ] }, void 0, true, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 404, columnNumber: 7 }, this)
    ] }, void 0, true, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 405, columnNumber: 5 }, this) }, void 0, false, { fileName: "/app/src/pages/dashboard/devices.tsx", lineNumber: 406, columnNumber: 3 }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/dashboard/devices.tsx",
    lineNumber: 183,
    columnNumber: 5
  }, this);
}
const Select = Root2;
const SelectValue = Value;
const SelectTrigger = reactExports.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Trigger$1,
  {
    ref,
    className: cn(
      "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
      className
    ),
    ...props,
    children: [
      children,
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Icon, { asChild: true, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ChevronDown, { className: "h-4 w-4 opacity-50" }, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 29,
        columnNumber: 7
      }, void 0) }, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 28,
        columnNumber: 5
      }, void 0)
    ]
  },
  void 0,
  true,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 19,
    columnNumber: 3
  },
  void 0
));
SelectTrigger.displayName = Trigger$1.displayName;
const SelectScrollUpButton = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  ScrollUpButton,
  {
    ref,
    className: cn(
      "flex cursor-default items-center justify-center py-1",
      className
    ),
    ...props,
    children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ChevronUp, { className: "h-4 w-4" }, void 0, false, {
      fileName: "/app/src/components/ui/select.tsx",
      lineNumber: 47,
      columnNumber: 5
    }, void 0)
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 39,
    columnNumber: 3
  },
  void 0
));
SelectScrollUpButton.displayName = ScrollUpButton.displayName;
const SelectScrollDownButton = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  ScrollDownButton,
  {
    ref,
    className: cn(
      "flex cursor-default items-center justify-center py-1",
      className
    ),
    ...props,
    children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ChevronDown, { className: "h-4 w-4" }, void 0, false, {
      fileName: "/app/src/components/ui/select.tsx",
      lineNumber: 64,
      columnNumber: 5
    }, void 0)
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 56,
    columnNumber: 3
  },
  void 0
));
SelectScrollDownButton.displayName = ScrollDownButton.displayName;
const SelectContent = reactExports.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Portal$1, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Content2,
  {
    ref,
    className: cn(
      "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
      position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
      className
    ),
    position,
    ...props,
    children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectScrollUpButton, {}, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 86,
        columnNumber: 7
      }, void 0),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
        Viewport,
        {
          className: cn(
            "p-1",
            position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
          ),
          children
        },
        void 0,
        false,
        {
          fileName: "/app/src/components/ui/select.tsx",
          lineNumber: 87,
          columnNumber: 7
        },
        void 0
      ),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectScrollDownButton, {}, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 96,
        columnNumber: 7
      }, void 0)
    ]
  },
  void 0,
  true,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 75,
    columnNumber: 5
  },
  void 0
) }, void 0, false, {
  fileName: "/app/src/components/ui/select.tsx",
  lineNumber: 74,
  columnNumber: 3
}, void 0));
SelectContent.displayName = Content2.displayName;
const SelectLabel = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Label$1,
  {
    ref,
    className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 106,
    columnNumber: 3
  },
  void 0
));
SelectLabel.displayName = Label$1.displayName;
const SelectItem = reactExports.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Item,
  {
    ref,
    className: cn(
      "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
      className
    ),
    ...props,
    children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ItemIndicator, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Check, { className: "h-4 w-4" }, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 128,
        columnNumber: 9
      }, void 0) }, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 127,
        columnNumber: 7
      }, void 0) }, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 126,
        columnNumber: 5
      }, void 0),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(ItemText, { children }, void 0, false, {
        fileName: "/app/src/components/ui/select.tsx",
        lineNumber: 132,
        columnNumber: 5
      }, void 0)
    ]
  },
  void 0,
  true,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 118,
    columnNumber: 3
  },
  void 0
));
SelectItem.displayName = Item.displayName;
const SelectSeparator = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Separator,
  {
    ref,
    className: cn("-mx-1 my-1 h-px bg-muted", className),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/select.tsx",
    lineNumber: 141,
    columnNumber: 3
  },
  void 0
));
SelectSeparator.displayName = Separator.displayName;
function BackupsPage() {
  const [backups, setBackups] = reactExports.useState([]);
  const [filteredBackups, setFilteredBackups] = reactExports.useState([]);
  const [loading, setLoading] = reactExports.useState(true);
  const { user: currentUser } = useCurrentUser();
  const [searchQuery, setSearchQuery] = reactExports.useState("");
  const [filterStatus, setFilterStatus] = reactExports.useState("all");
  const [filterType, setFilterType] = reactExports.useState("all");
  const [activeUploads, setActiveUploads] = reactExports.useState([]);
  const [uploadDialogOpen, setUploadDialogOpen] = reactExports.useState(false);
  const [uploadFile, setUploadFile] = reactExports.useState(null);
  const [uploadDeviceId, setUploadDeviceId] = reactExports.useState("");
  const [uploadBackupType, setUploadBackupType] = reactExports.useState("full");
  const [uploading, setUploading] = reactExports.useState(false);
  const [restoreDialogOpen, setRestoreDialogOpen] = reactExports.useState(false);
  const [restoreBackup, setRestoreBackup] = reactExports.useState(null);
  const [restoreDeviceId, setRestoreDeviceId] = reactExports.useState("");
  const [restoring, setRestoring] = reactExports.useState(false);
  const [devices, setDevices] = reactExports.useState([]);
  reactExports.useEffect(() => {
    loadBackups();
    loadUploadProgress();
    loadDevices();
    const interval = setInterval(() => {
      loadUploadProgress();
    }, 2e3);
    return () => clearInterval(interval);
  }, []);
  reactExports.useEffect(() => {
    filterBackupsList();
  }, [backups, searchQuery, filterStatus, filterType]);
  const loadBackups = async () => {
    setLoading(true);
    try {
      const data = await fetchBackups();
      setBackups(data.backups);
    } catch (error) {
      console.error("Failed to load backups:", error);
    } finally {
      setLoading(false);
    }
  };
  const loadUploadProgress = async () => {
    try {
      const response = await fetch("/api/backup/progress");
      const data = await response.json();
      if (data.success) {
        setActiveUploads(Array.isArray(data.progress) ? data.progress : []);
      }
    } catch (error) {
      console.error("Failed to load upload progress:", error);
    }
  };
  const loadDevices = async () => {
    try {
      const response = await fetch("/api/devices");
      const data = await response.json();
      if (data.success) {
        setDevices(data.devices.map((d) => ({
          id: d.device_id || d.deviceId,
          name: d.device_name || d.name || d.device_id || d.deviceId
        })));
      }
    } catch (error) {
      console.error("Failed to load devices:", error);
    }
  };
  const handleUploadBackup = async () => {
    if (!uploadFile || !uploadDeviceId) {
      toast.error("Please select a file and device");
      return;
    }
    setUploading(true);
    try {
      const formData = new FormData();
      formData.append("file", uploadFile);
      formData.append("deviceId", uploadDeviceId);
      formData.append("backupType", uploadBackupType);
      const response = await fetch("/api/backup/upload", {
        method: "POST",
        body: formData
      });
      const data = await response.json();
      if (data.success) {
        toast.success("Backup uploaded successfully");
        setUploadDialogOpen(false);
        setUploadFile(null);
        setUploadDeviceId("");
        setUploadBackupType("full");
        loadBackups();
      } else {
        toast.error(data.error || "Upload failed");
      }
    } catch (error) {
      console.error("Upload error:", error);
      toast.error("Failed to upload backup");
    } finally {
      setUploading(false);
    }
  };
  const handleRestoreBackup = async () => {
    if (!restoreBackup || !restoreDeviceId) {
      toast.error("Please select a device");
      return;
    }
    setRestoring(true);
    try {
      const response = await fetch(`/api/backup/${restoreBackup.backup_id}/restore`, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ deviceId: restoreDeviceId })
      });
      const data = await response.json();
      if (data.success) {
        toast.success("Restore initiated successfully");
        setRestoreDialogOpen(false);
        setRestoreBackup(null);
        setRestoreDeviceId("");
      } else {
        toast.error(data.error || "Restore failed");
      }
    } catch (error) {
      console.error("Restore error:", error);
      toast.error("Failed to restore backup");
    } finally {
      setRestoring(false);
    }
  };
  const filterBackupsList = () => {
    let filtered = backups;
    if (filterStatus !== "all") {
      filtered = filtered.filter((b) => b.status === filterStatus);
    }
    if (filterType !== "all") {
      filtered = filtered.filter((b) => b.backup_type === filterType);
    }
    if (searchQuery) {
      const query = searchQuery.toLowerCase();
      filtered = filtered.filter(
        (b) => b.backup_id.toLowerCase().includes(query) || b.device_id.toLowerCase().includes(query) || b.backup_type.toLowerCase().includes(query)
      );
    }
    setFilteredBackups(filtered);
  };
  const getStatusIcon = (status) => {
    switch (status) {
      case "completed":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4 text-green-600" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 244,
          columnNumber: 16
        }, this);
      case "failed":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleX, { className: "h-4 w-4 text-red-600" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 246,
          columnNumber: 16
        }, this);
      case "in_progress":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Upload, { className: "h-4 w-4 text-blue-600 animate-pulse" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 248,
          columnNumber: 16
        }, this);
      case "pending":
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-4 w-4 text-yellow-600" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 250,
          columnNumber: 16
        }, this);
      default:
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-4 w-4" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 252,
          columnNumber: 16
        }, this);
    }
  };
  const getStatusBadge = (status) => {
    const colors = {
      completed: "bg-green-100 text-green-800 border-green-200",
      failed: "bg-red-100 text-red-800 border-red-200",
      in_progress: "bg-blue-100 text-blue-800 border-blue-200",
      pending: "bg-yellow-100 text-yellow-800 border-yellow-200"
    };
    return colors[status] || "bg-gray-100 text-gray-800";
  };
  const getVerificationBadge = (status) => {
    if (!status) return null;
    const colors = {
      passed: "bg-green-100 text-green-800 border-green-200",
      failed: "bg-red-100 text-red-800 border-red-200",
      pending: "bg-yellow-100 text-yellow-800 border-yellow-200"
    };
    return colors[status] || "bg-gray-100 text-gray-800";
  };
  const formatDate = (dateString) => {
    const date = new Date(dateString);
    return date.toLocaleString();
  };
  const formatDuration = (startDate, endDate) => {
    const start = new Date(startDate).getTime();
    const end = endDate ? new Date(endDate).getTime() : Date.now();
    const duration = Math.floor((end - start) / 1e3);
    if (duration < 60) return `${duration}s`;
    if (duration < 3600) return `${Math.floor(duration / 60)}m`;
    return `${Math.floor(duration / 3600)}h ${Math.floor(duration % 3600 / 60)}m`;
  };
  const stats = {
    total: backups.length,
    completed: backups.filter((b) => b.status === "completed").length,
    inProgress: backups.filter((b) => b.status === "in_progress").length,
    failed: backups.filter((b) => b.status === "failed").length,
    pending: backups.filter((b) => b.status === "pending").length,
    totalSize: backups.reduce((sum, b) => sum + (b.size || 0), 0),
    encrypted: backups.filter((b) => b.encryption_enabled).length,
    verified: backups.filter((b) => b.verification_status === "passed").length
  };
  const backupTypes = [...new Set(backups.map((b) => b.backup_type))];
  const dashboardConfig = currentUser ? {
    header: {
      user: {
        name: currentUser.fullName || currentUser.username,
        email: currentUser.email,
        initials: currentUser.initials
      }
    }
  } : void 0;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold", children: "Backups" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 320,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "View and manage all backup operations" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 321,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 319,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: uploadDialogOpen, onOpenChange: setUploadDialogOpen, children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "default", size: "sm", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-4 w-4 mr-2" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 327,
                columnNumber: 19
              }, this),
              "Upload Backup"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 326,
              columnNumber: 17
            }, this) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 325,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: "Upload Backup" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 333,
                  columnNumber: 19
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: "Upload a backup file from your computer to the server" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 334,
                  columnNumber: 19
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 332,
                columnNumber: 17
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4 py-4", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "device", children: "Device" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 340,
                    columnNumber: 21
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: uploadDeviceId, onValueChange: setUploadDeviceId, children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, { placeholder: "Select device" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 343,
                      columnNumber: 25
                    }, this) }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 342,
                      columnNumber: 23
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: devices.map((device) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: device.id, children: device.name }, device.id, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 347,
                      columnNumber: 27
                    }, this)) }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 345,
                      columnNumber: 23
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 341,
                    columnNumber: 21
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 339,
                  columnNumber: 19
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "backupType", children: "Backup Type" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 355,
                    columnNumber: 21
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: uploadBackupType, onValueChange: setUploadBackupType, children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, {}, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 358,
                      columnNumber: 25
                    }, this) }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 357,
                      columnNumber: 23
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "full", children: "Full Backup" }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 361,
                        columnNumber: 25
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "incremental", children: "Incremental Backup" }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 362,
                        columnNumber: 25
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "differential", children: "Differential Backup" }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 363,
                        columnNumber: 25
                      }, this)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 360,
                      columnNumber: 23
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 356,
                    columnNumber: 21
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 354,
                  columnNumber: 19
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "file", children: "Backup File" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 368,
                    columnNumber: 21
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                    Input,
                    {
                      id: "file",
                      type: "file",
                      onChange: (e) => {
                        var _a;
                        return setUploadFile(((_a = e.target.files) == null ? void 0 : _a[0]) || null);
                      },
                      accept: ".zip,.tar,.gz,.enc,.pdf,.jpg,.png"
                    },
                    void 0,
                    false,
                    {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 369,
                      columnNumber: 21
                    },
                    this
                  ),
                  uploadFile && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: [
                    "Selected: ",
                    uploadFile.name,
                    " (",
                    formatFileSize(uploadFile.size),
                    ")"
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 376,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 367,
                  columnNumber: 19
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 338,
                columnNumber: 17
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogFooter, { children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => setUploadDialogOpen(false), disabled: uploading, children: "Cancel" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 383,
                  columnNumber: 19
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleUploadBackup, disabled: uploading || !uploadFile || !uploadDeviceId, children: uploading ? "Uploading..." : "Upload" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 386,
                  columnNumber: 19
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 382,
                columnNumber: 17
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 331,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 324,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: loadBackups, variant: "outline", size: "sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RefreshCw, { className: "h-4 w-4 mr-2" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 393,
              columnNumber: 15
            }, this),
            "Refresh"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 392,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 323,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 318,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Total Backups" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 403,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-4 w-4 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 404,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 402,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold", children: stats.total }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 407,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground mt-1", children: [
              formatFileSize(stats.totalSize),
              " total"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 408,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 406,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 401,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "cursor-pointer hover:bg-accent", onClick: () => setFilterStatus("completed"), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Completed" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 416,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4 text-green-600" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 417,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 415,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold text-green-600", children: stats.completed }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 420,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground mt-1", children: [
              stats.verified,
              " verified"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 421,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 419,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 414,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "cursor-pointer hover:bg-accent", onClick: () => setFilterStatus("in_progress"), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "In Progress" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 429,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Upload, { className: "h-4 w-4 text-blue-600" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 430,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 428,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold text-blue-600", children: stats.inProgress }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 433,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground mt-1", children: "Active uploads" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 434,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 432,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 427,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "cursor-pointer hover:bg-accent", onClick: () => setFilterStatus("failed"), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-sm font-medium", children: "Failed" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 442,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleX, { className: "h-4 w-4 text-red-600" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 443,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 441,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-2xl font-bold text-red-600", children: stats.failed }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 446,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground mt-1", children: "Requires attention" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 447,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 445,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 440,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 400,
        columnNumber: 9
      }, this),
      activeUploads.length > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Upload, { className: "h-5 w-5" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 459,
              columnNumber: 17
            }, this),
            "Active Uploads"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 458,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: [
            activeUploads.length,
            " upload",
            activeUploads.length !== 1 ? "s" : "",
            " in progress"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 462,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 457,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: activeUploads.map((upload) => {
          const progress = upload.uploaded_chunks / upload.total_chunks * 100;
          const uploadedSize = formatFileSize(upload.uploaded_size);
          const totalSize = upload.total_size ? formatFileSize(upload.total_size) : "Unknown";
          return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between text-sm", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: upload.file_name }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 476,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-muted-foreground", children: [
                upload.uploaded_chunks,
                " / ",
                upload.total_chunks,
                " chunks"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 477,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 475,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: progress, className: "h-2" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 481,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                uploadedSize,
                " / ",
                totalSize
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 483,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                Math.round(progress),
                "%"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 484,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 482,
              columnNumber: 23
            }, this)
          ] }, upload.id, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 474,
            columnNumber: 21
          }, this);
        }) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 467,
          columnNumber: 15
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 466,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 456,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Backup List" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 499,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: [
              filteredBackups.length,
              " backup",
              filteredBackups.length !== 1 ? "s" : "",
              " found"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 500,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 498,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "all" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("all"),
                children: "All"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 503,
                columnNumber: 17
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "completed" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("completed"),
                children: "Completed"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 510,
                columnNumber: 17
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "in_progress" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("in_progress"),
                children: "In Progress"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 517,
                columnNumber: 17
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Button,
              {
                variant: filterStatus === "failed" ? "default" : "outline",
                size: "sm",
                onClick: () => setFilterStatus("failed"),
                children: "Failed"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 524,
                columnNumber: 17
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 502,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 497,
          columnNumber: 13
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 496,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "relative flex-1", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 538,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  placeholder: "Search backups by ID, device, or type...",
                  value: searchQuery,
                  onChange: (e) => setSearchQuery(e.target.value),
                  className: "pl-10"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 539,
                  columnNumber: 19
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 537,
              columnNumber: 17
            }, this),
            backupTypes.length > 1 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              "select",
              {
                value: filterType,
                onChange: (e) => setFilterType(e.target.value),
                className: "px-3 py-2 border border-input rounded-md bg-background text-sm",
                children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("option", { value: "all", children: "All Types" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 552,
                    columnNumber: 21
                  }, this),
                  backupTypes.map((type) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("option", { value: type, children: type }, type, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 554,
                    columnNumber: 23
                  }, this))
                ]
              },
              void 0,
              true,
              {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 547,
                columnNumber: 19
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 536,
            columnNumber: 15
          }, this),
          loading ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RefreshCw, { className: "h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 562,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Loading backups..." }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 563,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 561,
            columnNumber: 17
          }, this) : filteredBackups.length === 0 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-12 w-12 mx-auto mb-4 text-muted-foreground" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 567,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground mb-2", children: "No backups found" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 568,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "Try adjusting your search or filters" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 569,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 566,
            columnNumber: 17
          }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: filteredBackups.map((backup) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            "div",
            {
              className: "p-4 rounded-lg border border-border hover:bg-accent transition-colors",
              children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start justify-between", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-4 flex-1", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "p-2 rounded-lg bg-muted", children: getStatusIcon(backup.status) }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 580,
                    columnNumber: 27
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-1", children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2 mb-1", children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "font-medium", children: backup.backup_type }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 585,
                        columnNumber: 31
                      }, this),
                      backup.encryption_enabled && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: "bg-blue-50 text-blue-700 border-blue-200", children: [
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Shield, { className: "h-3 w-3 mr-1" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 588,
                          columnNumber: 35
                        }, this),
                        "Encrypted"
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 587,
                        columnNumber: 33
                      }, this)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 584,
                      columnNumber: 29
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground space-y-1", children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                        "Backup ID: ",
                        backup.backup_id
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 594,
                        columnNumber: 31
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                        "Device: ",
                        backup.device_id
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 595,
                        columnNumber: 31
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-4", children: [
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: [
                          "Size: ",
                          formatFileSize(backup.size)
                        ] }, void 0, true, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 597,
                          columnNumber: 33
                        }, this),
                        backup.file_count > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: [
                          backup.file_count,
                          " files"
                        ] }, void 0, true, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 598,
                          columnNumber: 59
                        }, this),
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: [
                          "Duration: ",
                          formatDuration(backup.startedAt, backup.completedAt)
                        ] }, void 0, true, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 599,
                          columnNumber: 33
                        }, this)
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 596,
                        columnNumber: 31
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                        "Started: ",
                        formatDate(backup.startedAt)
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 601,
                        columnNumber: 31
                      }, this),
                      backup.completedAt && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                        "Completed: ",
                        formatDate(backup.completedAt)
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 603,
                        columnNumber: 33
                      }, this)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 593,
                      columnNumber: 29
                    }, this),
                    backup.status === "in_progress" && backup.size > 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "mt-3", children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between text-xs text-muted-foreground mb-1", children: [
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: "Upload Progress" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 611,
                          columnNumber: 35
                        }, this),
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: [
                          Math.round(backup.uploaded_size / backup.size * 100),
                          "%"
                        ] }, void 0, true, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 612,
                          columnNumber: 35
                        }, this)
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 610,
                        columnNumber: 33
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: backup.uploaded_size / backup.size * 100 }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 614,
                        columnNumber: 33
                      }, this)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 609,
                      columnNumber: 31
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 583,
                    columnNumber: 27
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 579,
                  columnNumber: 25
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex flex-col items-end gap-2", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: getStatusBadge(backup.status), children: backup.status.replace("_", " ") }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 621,
                    columnNumber: 27
                  }, this),
                  backup.verification_status && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: getVerificationBadge(backup.verification_status), children: backup.verification_status === "passed" ? "✓ Verified" : backup.verification_status === "failed" ? "✗ Failed" : "Pending" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 625,
                    columnNumber: 29
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2 mt-2", children: [
                    backup.status === "completed" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                        Button,
                        {
                          variant: "outline",
                          size: "sm",
                          onClick: () => {
                            setRestoreBackup(backup);
                            setRestoreDialogOpen(true);
                          },
                          children: [
                            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RotateCcw, { className: "h-4 w-4 mr-1" }, void 0, false, {
                              fileName: "/app/src/pages/dashboard/backups.tsx",
                              lineNumber: 641,
                              columnNumber: 35
                            }, this),
                            "Restore"
                          ]
                        },
                        void 0,
                        true,
                        {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 633,
                          columnNumber: 33
                        },
                        this
                      ),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", children: [
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "h-4 w-4 mr-1" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/backups.tsx",
                          lineNumber: 645,
                          columnNumber: 35
                        }, this),
                        "Download"
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/backups.tsx",
                        lineNumber: 644,
                        columnNumber: 33
                      }, this)
                    ] }, void 0, true, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 632,
                      columnNumber: 31
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Trash2, { className: "h-4 w-4 text-red-500" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 651,
                      columnNumber: 31
                    }, this) }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/backups.tsx",
                      lineNumber: 650,
                      columnNumber: 29
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/backups.tsx",
                    lineNumber: 630,
                    columnNumber: 27
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 620,
                  columnNumber: 25
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 578,
                columnNumber: 23
              }, this)
            },
            backup.id,
            false,
            {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 574,
              columnNumber: 21
            },
            this
          )) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 572,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 535,
          columnNumber: 13
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 534,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 495,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4 md:grid-cols-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Storage Statistics" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 668,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Backup storage breakdown" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 669,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 667,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm", children: "Total Storage Used" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 673,
                columnNumber: 17
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "font-bold", children: formatFileSize(stats.totalSize) }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 674,
                columnNumber: 17
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 672,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm", children: "Encrypted Backups" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 677,
                columnNumber: 17
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "font-bold", children: [
                stats.encrypted,
                " / ",
                stats.total
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 678,
                columnNumber: 17
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 676,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm", children: "Verified Backups" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 681,
                columnNumber: 17
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "font-bold", children: [
                stats.verified,
                " / ",
                stats.completed
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 682,
                columnNumber: 17
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 680,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 671,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 666,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Backup Types" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 689,
              columnNumber: 15
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Distribution by backup type" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 690,
              columnNumber: 15
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 688,
            columnNumber: 13
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-3", children: backupTypes.length === 0 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "No backup types yet" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 694,
            columnNumber: 17
          }, this) : backupTypes.map((type) => {
            const count = backups.filter((b) => b.backup_type === type).length;
            const percentage = Math.round(count / stats.total * 100);
            return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between text-sm mb-1", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: type }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 702,
                  columnNumber: 25
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "font-bold", children: [
                  count,
                  " (",
                  percentage,
                  "%)"
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/backups.tsx",
                  lineNumber: 703,
                  columnNumber: 25
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 701,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: percentage }, void 0, false, {
                fileName: "/app/src/pages/dashboard/backups.tsx",
                lineNumber: 705,
                columnNumber: 23
              }, this)
            ] }, type, true, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 700,
              columnNumber: 21
            }, this);
          }) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 692,
            columnNumber: 13
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 687,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 665,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/backups.tsx",
      lineNumber: 316,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: restoreDialogOpen, onOpenChange: setRestoreDialogOpen, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: "Restore Backup" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 719,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: "Restore this backup to a device. The device will receive the backup data." }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 720,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 718,
        columnNumber: 11
      }, this),
      restoreBackup && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4 py-4", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "rounded-lg border border-border p-4 space-y-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-muted-foreground", children: "Backup ID:" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 728,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "ml-2 font-mono", children: restoreBackup.backup_id }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 729,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 727,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-muted-foreground", children: "Type:" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 732,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "ml-2", children: restoreBackup.backup_type }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 733,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 731,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-muted-foreground", children: "Size:" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 736,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "ml-2", children: formatFileSize(restoreBackup.size) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 737,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 735,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-muted-foreground", children: "Created:" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 740,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "ml-2", children: formatDate(restoreBackup.startedAt) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 741,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 739,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 726,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "restoreDevice", children: "Select Device" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 745,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: restoreDeviceId, onValueChange: setRestoreDeviceId, children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, { placeholder: "Choose device to restore to" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 748,
              columnNumber: 21
            }, this) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 747,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: devices.map((device) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: device.id, children: device.name }, device.id, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 752,
              columnNumber: 23
            }, this)) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/backups.tsx",
              lineNumber: 750,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 746,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "The backup will be sent to the selected device for restoration." }, void 0, false, {
            fileName: "/app/src/pages/dashboard/backups.tsx",
            lineNumber: 758,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 744,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 725,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogFooter, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => setRestoreDialogOpen(false), disabled: restoring, children: "Cancel" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 765,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleRestoreBackup, disabled: restoring || !restoreDeviceId, children: restoring ? "Restoring..." : "Restore Backup" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/backups.tsx",
          lineNumber: 768,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/backups.tsx",
        lineNumber: 764,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/backups.tsx",
      lineNumber: 717,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/backups.tsx",
      lineNumber: 716,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/dashboard/backups.tsx",
    lineNumber: 315,
    columnNumber: 5
  }, this);
}
function FilesPage() {
  const [filesData, setFilesData] = reactExports.useState({ byDevice: [] });
  const [loading, setLoading] = reactExports.useState(true);
  const [error, setError] = reactExports.useState(null);
  const [selectedDevice, setSelectedDevice] = reactExports.useState(null);
  const [selectedSession, setSelectedSession] = reactExports.useState(null);
  const [previewFile, setPreviewFile] = reactExports.useState(null);
  const [deleteTarget, setDeleteTarget] = reactExports.useState(null);
  const [deleting, setDeleting] = reactExports.useState(false);
  const _filesLocation = useLocation();
  const _filesUrlDeviceId = new URLSearchParams(_filesLocation.search).get("deviceId");
  const { user: currentUser } = useCurrentUser();
  const dashboardConfig = currentUser ? {
    header: {
      user: {
        name: currentUser.fullName || currentUser.username,
        email: currentUser.email,
        initials: currentUser.initials
      }
    }
  } : void 0;

  const loadFiles = () => {
    setLoading(true);
    fetch("/api/backup/files")
      .then((r) => r.json())
      .then((data) => { if (data.success) { setFilesData(data); if (_filesUrlDeviceId) { const _match = (data.byDevice || []).find(function(g){return g.deviceId === _filesUrlDeviceId;}); if (_match) setSelectedDevice(_match); } } else setError(data.error || "Failed to load files"); })
      .catch((e) => setError(e.message))
      .finally(() => setLoading(false));
  };

  reactExports.useEffect(() => { loadFiles(); }, []);

  // Helpers
  const getFolder = (fileName) => {
    if (!fileName || !fileName.includes("/")) return "Root";
    return fileName.split("/").slice(0, -1).join("/");
  };
  const getBaseName = (fileName) => {
    if (!fileName) return "";
    return fileName.includes("/") ? fileName.split("/").pop() : fileName;
  };
  const fmtDate = (ts) => ts ? new Date(ts).toLocaleDateString() : "";
  const fmtDateTime = (ts) => ts ? new Date(ts).toLocaleString(undefined, {
    month: 'short', day: 'numeric', year: 'numeric', hour: 'numeric', minute: '2-digit'
  }) : "";
  const groupBySession = (files) => {
    const map = {};
    files.forEach((f) => {
      const sid = f.backupId.includes('_f') ? f.backupId.split('_f')[0] : f.backupId;
      if (!map[sid]) map[sid] = { sessionId: sid, backupType: f.backupType, startedAt: f.startedAt || f.completedAt, files: [] };
      map[sid].files.push(f);
      if (f.startedAt && (!map[sid].startedAt || f.startedAt < map[sid].startedAt)) map[sid].startedAt = f.startedAt;
    });
    return Object.values(map).sort((a, b) => new Date(b.startedAt) - new Date(a.startedAt));
  };

  const handleDelete = async () => {
    if (!deleteTarget) return;
    setDeleting(true);
    try {
      const res = await fetch(`/api/backup/delete/${deleteTarget.backupId}?deviceId=${deleteTarget.deviceId}`, { method: "DELETE" });
      const data = await res.json();
      if (data.success) {
        setFilesData((prev) => ({
          ...prev,
          byDevice: prev.byDevice.map((g) => ({
            ...g,
            files: g.files.filter((f) => f.backupId !== deleteTarget.backupId)
          })).filter((g) => g.files.length > 0)
        }));
        if (selectedDevice) {
          setSelectedDevice((prev) => prev ? ({ ...prev, files: prev.files.filter((f) => f.backupId !== deleteTarget.backupId) }) : null);
        }
        if (selectedSession) {
          setSelectedSession((prev) => prev ? ({ ...prev, files: prev.files.filter((f) => f.backupId !== deleteTarget.backupId) }) : null);
        }
        setDeleteTarget(null);
      } else {
        alert("Delete failed: " + (data.error || "Unknown error"));
      }
    } catch (e) {
      alert("Delete failed: " + e.message);
    } finally {
      setDeleting(false);
    }
  };

  // --- File row component ---
  const renderFileRow = (file) => {
    const baseName = getBaseName(file.fileName);
    const dlUrl = `/api/backup/download/${file.backupId}?deviceId=${file.deviceId}`;
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between p-3 border rounded-lg hover:bg-blue-50/50", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3 min-w-0", children: [
        file.isImage && file.previewUrl
          ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("img", { src: file.previewUrl, alt: baseName, className: "h-12 w-12 object-cover rounded border flex-shrink-0", loading: "lazy" }, void 0, false, {}, this)
          : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-10 w-10 text-blue-400 flex-shrink-0" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-w-0", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-medium truncate", children: baseName }, void 0, false, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: [formatFileSize(file.size), " \u2022 ", fmtDate(file.completedAt || file.startedAt), file.fileName && file.fileName.includes("/") ? [" \u2022 ", getFolder(file.fileName)] : null] }, void 0, true, {}, this)
        ] }, void 0, true, {}, this)
      ] }, void 0, true, {}, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-1 flex-shrink-0 ml-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { variant: "outline", className: "text-xs hidden sm:inline-flex", children: file.backupType }, void 0, false, {}, this),
        file.isImage && file.previewUrl && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", onClick: () => setPreviewFile(file), children: "View" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: dlUrl, className: "inline-flex items-center gap-1 rounded-md border border-blue-200 px-2 py-1.5 text-xs font-medium text-blue-700 hover:bg-blue-50", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "h-3 w-3" }, void 0, false, {}, this),
          "Save"
        ] }, void 0, true, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "ghost", size: "sm", className: "text-red-600 hover:text-red-700 hover:bg-red-50 px-2", onClick: () => setDeleteTarget(file), children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Trash2, { className: "h-3.5 w-3.5" }, void 0, false, {}, this) }, void 0, false, {}, this)
      ] }, void 0, true, {}, this)
    ] }, file.backupId, true, {}, this);
  };

  // --- Level 2: Session list for a device ---
  const renderSessionList = (group) => {
    const sessions = groupBySession(group.files);
    const totalSize = group.files.reduce((s, f) => s + (f.size || 0), 0);
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between flex-wrap gap-3", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", onClick: () => { setSelectedDevice(null); setSelectedSession(null); }, children: "\u2190 All Devices" }, void 0, false, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-2xl font-bold flex items-center gap-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-6 w-6 text-blue-600" }, void 0, false, {}, this),
              group.deviceName
            ] }, void 0, true, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: [group.files.length, " files \u2022 ", formatFileSize(totalSize), " \u2022 ", sessions.length, " session(s)"] }, void 0, true, {}, this)
          ] }, void 0, true, {}, this)
        ] }, void 0, true, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: `/api/backup/device-archive/${group.deviceId}`, className: "inline-flex items-center gap-2 rounded-md bg-blue-600 text-white px-3 py-2 text-sm font-medium hover:bg-blue-700", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "h-4 w-4" }, void 0, false, {}, this),
          "Download All as ZIP"
        ] }, void 0, true, {}, this)
      ] }, void 0, true, {}, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: sessions.map((session) => {
        const sessionSize = session.files.reduce((s, f) => s + (f.size || 0), 0);
        const isFullBackup = session.backupType === "full";
        return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "border rounded-xl p-4 hover:shadow-md hover:border-blue-400 hover:bg-blue-50/40 cursor-pointer transition-all bg-white flex items-center justify-between gap-3", onClick: () => setSelectedSession(session), children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3 min-w-0", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FolderOpen, { className: "h-7 w-7 text-blue-500 flex-shrink-0" }, void 0, false, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-w-0", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2 flex-wrap", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-semibold", children: fmtDateTime(session.startedAt) }, void 0, false, {}, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { className: isFullBackup ? "bg-green-100 text-green-800 border-green-200" : "bg-blue-100 text-blue-800 border-blue-200", children: session.backupType || "unknown" }, void 0, false, {}, this)
              ] }, void 0, true, {}, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: [session.files.length, " file(s) \u2022 ", formatFileSize(sessionSize)] }, void 0, true, {}, this)
            ] }, void 0, true, {}, this)
          ] }, void 0, true, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: `/api/backup/session-archive/${session.sessionId}`, onClick: (e) => e.stopPropagation(), className: "inline-flex items-center gap-1 rounded border border-blue-200 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-50", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "h-3 w-3" }, void 0, false, {}, this),
              "Session ZIP"
            ] }, void 0, true, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-blue-400 text-xl", children: "\u203a" }, void 0, false, {}, this)
          ] }, void 0, true, {}, this)
        ] }, session.sessionId, true, {}, this);
      }) }, void 0, false, {}, this)
    ] }, void 0, true, {}, this);
  };

  // --- Level 3: Session detail (files within a session) ---
  const renderSessionDetail = (session) => {
    const byFolder = {};
    session.files.forEach((f) => {
      const folder = getFolder(f.fileName);
      if (!byFolder[folder]) byFolder[folder] = [];
      byFolder[folder].push(f);
    });
    const sessionSize = session.files.reduce((s, f) => s + (f.size || 0), 0);
    const isFullBackup = session.backupType === "full";
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between flex-wrap gap-3", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", size: "sm", onClick: () => setSelectedSession(null), children: "\u2190 Backups" }, void 0, false, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-2xl font-bold flex items-center gap-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FolderOpen, { className: "h-6 w-6 text-blue-600" }, void 0, false, {}, this),
              fmtDateTime(session.startedAt),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { className: isFullBackup ? "bg-green-100 text-green-800 border-green-200" : "bg-blue-100 text-blue-800 border-blue-200", children: session.backupType || "unknown" }, void 0, false, {}, this)
            ] }, void 0, true, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: [session.files.length, " file(s) \u2022 ", formatFileSize(sessionSize)] }, void 0, true, {}, this)
          ] }, void 0, true, {}, this)
        ] }, void 0, true, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: `/api/backup/session-archive/${session.sessionId}`, className: "inline-flex items-center gap-2 rounded-md bg-blue-600 text-white px-3 py-2 text-sm font-medium hover:bg-blue-700", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "h-4 w-4" }, void 0, false, {}, this),
          "Download Session ZIP"
        ] }, void 0, true, {}, this)
      ] }, void 0, true, {}, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: Object.entries(byFolder).map(([folder, folderFiles]) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "pb-3", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-base font-semibold", children: ["/ ", folder] }, void 0, true, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-muted-foreground", children: [folderFiles.length, " file(s)"] }, void 0, true, {}, this)
        ] }, void 0, true, {}, this) }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "pt-0", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: folderFiles.map((f) => renderFileRow(f)) }, void 0, false, {}, this) }, void 0, false, {}, this)
      ] }, folder, true, {}, this)) }, void 0, false, {}, this)
    ] }, void 0, true, {}, this);
  };

  // --- Level 1: Device swim lanes ---
  const renderDeviceList = () => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: filesData.byDevice.map((group) => {
    const totalSize = group.files.reduce((s, f) => s + (f.size || 0), 0);
    const fullCount = group.files.filter((f) => f.backupType === "full").length;
    const incrCount = group.files.filter((f) => f.backupType === "incremental").length;
    const lastFile = group.files.reduce((latest, f) => {
      const ts = new Date(f.completedAt || f.startedAt || 0).getTime();
      return ts > (latest ? new Date(latest.completedAt || latest.startedAt || 0).getTime() : 0) ? f : latest;
    }, null);
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "border rounded-xl p-5 hover:shadow-md hover:border-blue-400 hover:bg-blue-50/40 cursor-pointer transition-all bg-white", onClick: () => setSelectedDevice(group), children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between flex-wrap gap-3", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-3", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Smartphone, { className: "h-8 w-8 text-blue-600" }, void 0, false, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-lg font-semibold", children: group.deviceName }, void 0, false, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: ["Last backup: ", lastFile ? fmtDate(lastFile.completedAt || lastFile.startedAt) : "Unknown"] }, void 0, true, {}, this)
          ] }, void 0, true, {}, this)
        ] }, void 0, true, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-4 text-sm", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-bold text-lg text-blue-700", children: group.files.length }, void 0, false, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground text-xs", children: "Files" }, void 0, false, {}, this)
          ] }, void 0, true, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-bold text-lg text-blue-700", children: formatFileSize(totalSize) }, void 0, false, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground text-xs", children: "Total" }, void 0, false, {}, this)
          ] }, void 0, true, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-bold text-lg text-blue-700", children: fullCount }, void 0, false, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground text-xs", children: "Full" }, void 0, false, {}, this)
          ] }, void 0, true, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-bold text-lg text-blue-700", children: incrCount }, void 0, false, {}, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground text-xs", children: "Incremental" }, void 0, false, {}, this)
          ] }, void 0, true, {}, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-blue-400 text-xl", children: "\u203a" }, void 0, false, {}, this)
        ] }, void 0, true, {}, this)
      ] }, void 0, true, {}, this)
    ] }, group.deviceId, true, {}, this);
  }) }, void 0, false, {}, this);

  // --- Main render ---
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
      !selectedDevice && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold text-blue-900", children: "Browse Files" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Select a device to browse its backed-up files" }, void 0, false, {}, this)
      ] }, void 0, true, {}, this),
      loading ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Loading files..." }, void 0, false, {}, this)
      ] }, void 0, true, {}, this) : error ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12 text-red-600", children: error }, void 0, false, {}, this) : filesData.byDevice.length === 0 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center py-12", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-12 w-12 mx-auto mb-4 text-muted-foreground" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "No backup files found. Connect a device and run a backup first." }, void 0, false, {}, this)
      ] }, void 0, true, {}, this) : selectedDevice && selectedSession ? renderSessionDetail(selectedSession) : selectedDevice ? renderSessionList(selectedDevice) : renderDeviceList()
    ] }, void 0, true, {}, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: !!previewFile, onOpenChange: (o) => { if (!o) setPreviewFile(null); }, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { className: "max-w-3xl", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: previewFile && getBaseName(previewFile.fileName) }, void 0, false, {}, this) }, void 0, false, {}, this),
      previewFile && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("img", { src: previewFile.previewUrl, alt: previewFile.fileName, className: "max-w-full max-h-[70vh] object-contain rounded" }, void 0, false, {}, this) }, void 0, false, {}, this),
      previewFile && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-end gap-2 pt-2", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("a", { href: `/api/backup/download/${previewFile.backupId}?deviceId=${previewFile.deviceId}`, className: "inline-flex items-center gap-2 rounded-md bg-blue-600 text-white px-3 py-2 text-sm font-medium hover:bg-blue-700", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Download, { className: "h-4 w-4" }, void 0, false, {}, this),
        "Download"
      ] }, void 0, true, {}, this) }, void 0, false, {}, this)
    ] }, void 0, true, {}, this) }, void 0, false, {}, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: !!deleteTarget, onOpenChange: (o) => { if (!o) setDeleteTarget(null); }, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { className: "text-red-600", children: "\u26a0\ufe0f Permanent Delete — Are You Sure?" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: ["This may be the ", /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: "only copy" }, void 0, false, {}, this), " of this file. Deletion is permanent and cannot be undone."] }, void 0, true, {}, this)
      ] }, void 0, true, {}, this),
      deleteTarget && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "my-2 p-3 bg-red-50 rounded border border-red-200 text-sm font-medium text-red-800", children: getBaseName(deleteTarget.fileName) }, void 0, false, {}, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-end gap-3 pt-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => setDeleteTarget(null), disabled: deleting, children: "Cancel — Keep File" }, void 0, false, {}, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "destructive", onClick: handleDelete, disabled: deleting, children: deleting ? "Deleting..." : "Delete Forever" }, void 0, false, {}, this)
      ] }, void 0, true, {}, this)
    ] }, void 0, true, {}, this) }, void 0, false, {}, this)
  ] }, void 0, true, {}, this);
}
function StorageSettings() {
  const { user: currentUser } = useCurrentUser();
  const [storageType, setStorageType] = reactExports.useState("local");
  const [config, setConfig] = reactExports.useState({});
  const [currentConfig, setCurrentConfig] = reactExports.useState(null);
  const [loading, setLoading] = reactExports.useState(false);
  const [testing, setTesting] = reactExports.useState(false);
  const [testResult, setTestResult] = reactExports.useState(null);
  reactExports.useEffect(() => {
    fetchCurrentConfig();
  }, []);
  const fetchCurrentConfig = async () => {
    try {
      const response = await fetch("/api/storage/config");
      const data = await response.json();
      if (data.success && data.config) {
        setCurrentConfig(data.config);
        setStorageType(data.config.storageType);
        setConfig(data.config.config);
      }
    } catch (error) {
      console.error("Failed to fetch storage config:", error);
    }
  };
  const handleStorageTypeChange = (value) => {
    setStorageType(value);
    setTestResult(null);
    switch (value) {
      case "local":
        setConfig({ basePath: "/private/backups" });
        break;
      case "s3":
        setConfig({ accessKeyId: "", secretAccessKey: "", region: "us-east-1", bucket: "" });
        break;
      case "gcs":
        setConfig({ projectId: "", keyFilename: "", bucket: "" });
        break;
      case "azure":
        setConfig({ accountName: "", accountKey: "", containerName: "" });
        break;
    }
  };
  const handleConfigChange = (key, value) => {
    setConfig({ ...config, [key]: value });
    setTestResult(null);
  };
  const testConnection = async () => {
    setTesting(true);
    setTestResult(null);
    try {
      const response = await fetch("/api/storage/test", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ storageType, config })
      });
      const data = await response.json();
      setTestResult({
        success: data.success,
        message: data.message || data.error
      });
      if (data.success) {
        toast.success("Connection test successful!");
      } else {
        toast.error("Connection test failed");
      }
    } catch (error) {
      setTestResult({
        success: false,
        message: "Failed to test connection"
      });
      toast.error("Failed to test connection");
    } finally {
      setTesting(false);
    }
  };
  const saveConfiguration = async () => {
    setLoading(true);
    try {
      const response = await fetch("/api/storage/config", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ storageType, config })
      });
      const data = await response.json();
      if (data.success) {
        toast.success("Storage configuration saved successfully!");
        fetchCurrentConfig();
      } else {
        toast.error(data.error || "Failed to save configuration");
      }
    } catch (error) {
      toast.error("Failed to save configuration");
    } finally {
      setLoading(false);
    }
  };
  const dashboardConfig = currentUser ? {
    header: {
      user: {
        name: currentUser.fullName || currentUser.username,
        email: currentUser.email,
        initials: currentUser.initials
      }
    }
  } : void 0;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold", children: "Storage Settings" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 141,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground mt-2", children: "Configure where your backup files are stored" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 142,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/storage.tsx",
      lineNumber: 140,
      columnNumber: 9
    }, this),
    currentConfig && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 150,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: [
        "Currently using ",
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: currentConfig.storageType.toUpperCase() }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 152,
          columnNumber: 31
        }, this),
        " storage"
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 151,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/storage.tsx",
      lineNumber: 149,
      columnNumber: 11
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Storage Provider" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 160,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Choose where to store your backup files" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 161,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 159,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-4", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Storage Type" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 167,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: storageType, onValueChange: handleStorageTypeChange, children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, {}, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 170,
              columnNumber: 19
            }, this) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 169,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "local", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-4 w-4" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 175,
                  columnNumber: 23
                }, this),
                "Local Storage"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 174,
                columnNumber: 21
              }, this) }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 173,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "s3", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Cloud, { className: "h-4 w-4" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 181,
                  columnNumber: 23
                }, this),
                "AWS S3"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 180,
                columnNumber: 21
              }, this) }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 179,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "gcs", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Cloud, { className: "h-4 w-4" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 187,
                  columnNumber: 23
                }, this),
                "Google Cloud Storage"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 186,
                columnNumber: 21
              }, this) }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 185,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "azure", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Cloud, { className: "h-4 w-4" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 193,
                  columnNumber: 23
                }, this),
                "Azure Blob Storage"
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 192,
                columnNumber: 21
              }, this) }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 191,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 172,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 168,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 166,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4 pt-4 border-t", children: [
          storageType === "local" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "basePath", children: "Base Path" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 205,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Input,
              {
                id: "basePath",
                value: config.basePath || "",
                onChange: (e) => handleConfigChange("basePath", e.target.value),
                placeholder: "/private/backups"
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 206,
                columnNumber: 19
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "Directory where backup files will be stored" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 212,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 204,
            columnNumber: 17
          }, this),
          storageType === "s3" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "accessKeyId", children: "Access Key ID" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 221,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "accessKeyId",
                  value: config.accessKeyId || "",
                  onChange: (e) => handleConfigChange("accessKeyId", e.target.value),
                  placeholder: "AKIAIOSFODNN7EXAMPLE"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 222,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 220,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "secretAccessKey", children: "Secret Access Key" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 230,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "secretAccessKey",
                  type: "password",
                  value: config.secretAccessKey || "",
                  onChange: (e) => handleConfigChange("secretAccessKey", e.target.value),
                  placeholder: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 231,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 229,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "region", children: "Region" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 240,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "region",
                  value: config.region || "",
                  onChange: (e) => handleConfigChange("region", e.target.value),
                  placeholder: "us-east-1"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 241,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 239,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "bucket", children: "Bucket Name" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 249,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "bucket",
                  value: config.bucket || "",
                  onChange: (e) => handleConfigChange("bucket", e.target.value),
                  placeholder: "my-backup-bucket"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 250,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 248,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 219,
            columnNumber: 17
          }, this),
          storageType === "gcs" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "projectId", children: "Project ID" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 263,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "projectId",
                  value: config.projectId || "",
                  onChange: (e) => handleConfigChange("projectId", e.target.value),
                  placeholder: "my-project-123456"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 264,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 262,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "keyFilename", children: "Key File Path" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 272,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "keyFilename",
                  value: config.keyFilename || "",
                  onChange: (e) => handleConfigChange("keyFilename", e.target.value),
                  placeholder: "/path/to/service-account-key.json"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 273,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 271,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "bucket", children: "Bucket Name" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 281,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "bucket",
                  value: config.bucket || "",
                  onChange: (e) => handleConfigChange("bucket", e.target.value),
                  placeholder: "my-backup-bucket"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 282,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 280,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 261,
            columnNumber: 17
          }, this),
          storageType === "azure" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "accountName", children: "Account Name" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 295,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "accountName",
                  value: config.accountName || "",
                  onChange: (e) => handleConfigChange("accountName", e.target.value),
                  placeholder: "mystorageaccount"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 296,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 294,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "accountKey", children: "Account Key" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 304,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "accountKey",
                  type: "password",
                  value: config.accountKey || "",
                  onChange: (e) => handleConfigChange("accountKey", e.target.value),
                  placeholder: "your-account-key"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 305,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 303,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "containerName", children: "Container Name" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/storage.tsx",
                lineNumber: 314,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "containerName",
                  value: config.containerName || "",
                  onChange: (e) => handleConfigChange("containerName", e.target.value),
                  placeholder: "backups"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 315,
                  columnNumber: 21
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 313,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 293,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 202,
          columnNumber: 13
        }, this),
        testResult && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { variant: testResult.success ? "default" : "destructive", children: [
          testResult.success ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 330,
            columnNumber: 19
          }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleX, { className: "h-4 w-4" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 332,
            columnNumber: 19
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: testResult.message }, void 0, false, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 334,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 328,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2 pt-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              onClick: testConnection,
              disabled: testing || loading,
              variant: "outline",
              children: [
                testing && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 345,
                  columnNumber: 29
                }, this),
                "Test Connection"
              ]
            },
            void 0,
            true,
            {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 340,
              columnNumber: 15
            },
            this
          ),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              onClick: saveConfiguration,
              disabled: loading || testing || testResult && !testResult.success,
              children: [
                loading && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/storage.tsx",
                  lineNumber: 352,
                  columnNumber: 29
                }, this),
                "Save Configuration"
              ]
            },
            void 0,
            true,
            {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 348,
              columnNumber: 15
            },
            this
          )
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 339,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 165,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/storage.tsx",
      lineNumber: 158,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4 md:grid-cols-2", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-base", children: "Local Storage" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 363,
          columnNumber: 15
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 362,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "text-sm text-muted-foreground", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { children: "Store backups on the server's local file system. Best for self-hosted deployments with large storage capacity." }, void 0, false, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 366,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("ul", { className: "list-disc list-inside mt-2 space-y-1", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "No additional costs" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 368,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "Fast access" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 369,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "Full control" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 370,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 367,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 365,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 361,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-base", children: "Cloud Storage" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 377,
          columnNumber: 15
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 376,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "text-sm text-muted-foreground", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { children: "Store backups in cloud storage services. Ideal for scalability and high availability." }, void 0, false, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 380,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("ul", { className: "list-disc list-inside mt-2 space-y-1", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "Scalable storage" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 382,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "High availability" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 383,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { children: "Geographic redundancy" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/storage.tsx",
              lineNumber: 384,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/storage.tsx",
            lineNumber: 381,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/storage.tsx",
          lineNumber: 379,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/storage.tsx",
        lineNumber: 375,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/storage.tsx",
      lineNumber: 360,
      columnNumber: 9
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/dashboard/storage.tsx",
    lineNumber: 139,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "/app/src/pages/dashboard/storage.tsx",
    lineNumber: 138,
    columnNumber: 5
  }, this);
}
const Tabs = Root2$1;
const TabsList = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  List,
  {
    ref,
    className: cn(
      "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/tabs.tsx",
    lineNumber: 12,
    columnNumber: 3
  },
  void 0
));
TabsList.displayName = List.displayName;
const TabsTrigger = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Trigger$2,
  {
    ref,
    className: cn(
      "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/tabs.tsx",
    lineNumber: 27,
    columnNumber: 3
  },
  void 0
));
TabsTrigger.displayName = Trigger$2.displayName;
const TabsContent = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Content$1,
  {
    ref,
    className: cn(
      "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
      className
    ),
    ...props
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/tabs.tsx",
    lineNumber: 42,
    columnNumber: 3
  },
  void 0
));
TabsContent.displayName = Content$1.displayName;
function SetupPage() {
  const { user: currentUser } = useCurrentUser();
  const [pathInfo, setPathInfo] = reactExports.useState(null);
  const [diskSpace, setDiskSpace] = reactExports.useState(null);
  const [storageConfig, setStorageConfig] = reactExports.useState({
    maxBackupSize: 10,
    maxTotalStorage: 100,
    retentionDays: 30,
    autoCleanup: true,
    compressionEnabled: true
  });
  const [loading, setLoading] = reactExports.useState(true);
  const [saving, setSaving] = reactExports.useState(false);
  const [message, setMessage] = reactExports.useState(null);
  reactExports.useEffect(() => {
    loadSystemInfo();
  }, []);
  const loadSystemInfo = async () => {
    try {
      const pathRes = await fetch("/api/storage/config");
      if (pathRes.ok) {
        const data = await pathRes.json();
        setPathInfo(data.pathInfo);
      }
      const limitsRes = await fetch("/api/storage/limits");
      if (limitsRes.ok) {
        const data = await limitsRes.json();
        if (data.config) {
          setStorageConfig(data.config);
        }
      }
      const spaceRes = await fetch("/api/storage/disk-space");
      if (spaceRes.ok) {
        const data = await spaceRes.json();
        setDiskSpace(data);
      }
    } catch (error) {
      console.error("Failed to load system info:", error);
    } finally {
      setLoading(false);
    }
  };
  const handleSaveConfig = async () => {
    setSaving(true);
    setMessage(null);
    try {
      const res = await fetch("/api/storage/limits", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(storageConfig)
      });
      if (res.ok) {
        setMessage({ type: "success", text: "Storage configuration saved successfully" });
      } else {
        const error = await res.json();
        setMessage({ type: "error", text: error.message || "Failed to save configuration" });
      }
    } catch (error) {
      setMessage({ type: "error", text: "Failed to save configuration" });
    } finally {
      setSaving(false);
    }
  };
  const formatBytes = (bytes) => {
    if (bytes === 0) return "0 B";
    const k = 1024;
    const sizes = ["B", "KB", "MB", "GB", "TB"];
    const i = Math.floor(Math.log(bytes) / Math.log(k));
    return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
  };
  if (loading) {
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 125,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Loading system information..." }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 126,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/setup.tsx",
      lineNumber: 124,
      columnNumber: 11
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/setup.tsx",
      lineNumber: 123,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/setup.tsx",
      lineNumber: 122,
      columnNumber: 7
    }, this);
  }
  const dashboardConfig = currentUser ? {
    header: {
      user: {
        name: currentUser.fullName || currentUser.username,
        email: currentUser.email,
        initials: currentUser.initials
      }
    }
  } : void 0;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold", children: "Server Setup" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 147,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground mt-2", children: "Configure storage paths, disk space allocation, and system settings" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 148,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/setup.tsx",
      lineNumber: 146,
      columnNumber: 9
    }, this),
    message && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { variant: message.type === "error" ? "destructive" : "default", children: [
      message.type === "success" ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 155,
        columnNumber: 43
      }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 155,
        columnNumber: 82
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: message.text }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 156,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/setup.tsx",
      lineNumber: 154,
      columnNumber: 11
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Tabs, { defaultValue: "storage", className: "space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsList, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsTrigger, { value: "storage", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-4 w-4 mr-2" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 163,
            columnNumber: 15
          }, this),
          "Storage"
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 162,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsTrigger, { value: "paths", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FolderOpen, { className: "h-4 w-4 mr-2" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 167,
            columnNumber: 15
          }, this),
          "Paths"
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 166,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsTrigger, { value: "database", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-4 w-4 mr-2" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 171,
            columnNumber: 15
          }, this),
          "Database"
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 170,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 161,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsContent, { value: "storage", className: "space-y-6", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Disk Space" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 180,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Current disk usage and available space" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 181,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 179,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-4", children: diskSpace ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between text-sm", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: [
                  "Used: ",
                  formatBytes(diskSpace.used)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 188,
                  columnNumber: 25
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { children: [
                  "Free: ",
                  formatBytes(diskSpace.free)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 189,
                  columnNumber: 25
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 187,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: diskSpace.percentUsed, className: "h-2" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 191,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground text-center", children: [
                diskSpace.percentUsed.toFixed(1),
                "% used of ",
                formatBytes(diskSpace.total)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 192,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 186,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid grid-cols-3 gap-4 pt-4 border-t", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-2xl font-bold", children: formatBytes(diskSpace.total) }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 199,
                  columnNumber: 25
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Total" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 200,
                  columnNumber: 25
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 198,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-2xl font-bold", children: formatBytes(diskSpace.used) }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 203,
                  columnNumber: 25
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Used" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 204,
                  columnNumber: 25
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 202,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-2xl font-bold text-green-600", children: formatBytes(diskSpace.free) }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 207,
                  columnNumber: 25
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Available" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 208,
                  columnNumber: 25
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 206,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 197,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 185,
            columnNumber: 19
          }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Info, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 214,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: "Disk space information not available" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 215,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 213,
            columnNumber: 19
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 183,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 178,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Storage Configuration" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 224,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Configure backup storage limits and retention policies" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 225,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 223,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-6 md:grid-cols-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "maxBackupSize", children: "Maximum Backup Size (GB)" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 230,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Input,
                  {
                    id: "maxBackupSize",
                    type: "number",
                    min: "1",
                    max: "1000",
                    value: storageConfig.maxBackupSize,
                    onChange: (e) => setStorageConfig({ ...storageConfig, maxBackupSize: parseInt(e.target.value) })
                  },
                  void 0,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/setup.tsx",
                    lineNumber: 231,
                    columnNumber: 21
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Maximum size for a single backup file" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 241,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 229,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "maxTotalStorage", children: "Maximum Total Storage (GB)" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 245,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Input,
                  {
                    id: "maxTotalStorage",
                    type: "number",
                    min: "10",
                    max: "10000",
                    value: storageConfig.maxTotalStorage,
                    onChange: (e) => setStorageConfig({ ...storageConfig, maxTotalStorage: parseInt(e.target.value) })
                  },
                  void 0,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/setup.tsx",
                    lineNumber: 246,
                    columnNumber: 21
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Maximum total storage for all backups" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 256,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 244,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "retentionDays", children: "Retention Period (Days)" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 260,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Input,
                  {
                    id: "retentionDays",
                    type: "number",
                    min: "1",
                    max: "365",
                    value: storageConfig.retentionDays,
                    onChange: (e) => setStorageConfig({ ...storageConfig, retentionDays: parseInt(e.target.value) })
                  },
                  void 0,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/setup.tsx",
                    lineNumber: 261,
                    columnNumber: 21
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "How long to keep backups before auto-deletion" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 271,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 259,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "autoCleanup", children: "Auto Cleanup" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 275,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Select,
                  {
                    value: storageConfig.autoCleanup ? "enabled" : "disabled",
                    onValueChange: (value) => setStorageConfig({ ...storageConfig, autoCleanup: value === "enabled" }),
                    children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { id: "autoCleanup", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, {}, void 0, false, {
                        fileName: "/app/src/pages/dashboard/setup.tsx",
                        lineNumber: 283,
                        columnNumber: 25
                      }, this) }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/setup.tsx",
                        lineNumber: 282,
                        columnNumber: 23
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: [
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "enabled", children: "Enabled" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/setup.tsx",
                          lineNumber: 286,
                          columnNumber: 25
                        }, this),
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "disabled", children: "Disabled" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/setup.tsx",
                          lineNumber: 287,
                          columnNumber: 25
                        }, this)
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/setup.tsx",
                        lineNumber: 285,
                        columnNumber: 23
                      }, this)
                    ]
                  },
                  void 0,
                  true,
                  {
                    fileName: "/app/src/pages/dashboard/setup.tsx",
                    lineNumber: 276,
                    columnNumber: 21
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Automatically delete old backups" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 290,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 274,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "compressionEnabled", children: "Compression" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 294,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Select,
                  {
                    value: storageConfig.compressionEnabled ? "enabled" : "disabled",
                    onValueChange: (value) => setStorageConfig({ ...storageConfig, compressionEnabled: value === "enabled" }),
                    children: [
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { id: "compressionEnabled", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, {}, void 0, false, {
                        fileName: "/app/src/pages/dashboard/setup.tsx",
                        lineNumber: 302,
                        columnNumber: 25
                      }, this) }, void 0, false, {
                        fileName: "/app/src/pages/dashboard/setup.tsx",
                        lineNumber: 301,
                        columnNumber: 23
                      }, this),
                      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: [
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "enabled", children: "Enabled" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/setup.tsx",
                          lineNumber: 305,
                          columnNumber: 25
                        }, this),
                        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "disabled", children: "Disabled" }, void 0, false, {
                          fileName: "/app/src/pages/dashboard/setup.tsx",
                          lineNumber: 306,
                          columnNumber: 25
                        }, this)
                      ] }, void 0, true, {
                        fileName: "/app/src/pages/dashboard/setup.tsx",
                        lineNumber: 304,
                        columnNumber: 23
                      }, this)
                    ]
                  },
                  void 0,
                  true,
                  {
                    fileName: "/app/src/pages/dashboard/setup.tsx",
                    lineNumber: 295,
                    columnNumber: 21
                  },
                  this
                ),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Compress backups to save space" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 309,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 293,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 228,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-end pt-4 border-t", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleSaveConfig, disabled: saving, children: saving ? "Saving..." : "Save Configuration" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 314,
              columnNumber: 19
            }, this) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 313,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 227,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 222,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 176,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsContent, { value: "paths", className: "space-y-6", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Storage Paths" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 325,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "System directories used by URVault" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 326,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 324,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: pathInfo ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Info, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 332,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: [
              "Platform: ",
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: pathInfo.platform }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 334,
                columnNumber: 35
              }, this),
              " | Mode:",
              " ",
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: pathInfo.isDevelopment ? "Development" : "Production" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 335,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 333,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 331,
            columnNumber: 21
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3 p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FolderOpen, { className: "h-5 w-5 text-muted-foreground mt-0.5" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 341,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-1 min-w-0", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm font-medium", children: "Application Data" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 343,
                  columnNumber: 27
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground break-all", children: pathInfo.appDataDir }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 344,
                  columnNumber: 27
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 342,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 340,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3 p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-5 w-5 text-muted-foreground mt-0.5" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 349,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-1 min-w-0", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm font-medium", children: "Backups Directory" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 351,
                  columnNumber: 27
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground break-all", children: pathInfo.backupsDir }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 352,
                  columnNumber: 27
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 350,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 348,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3 p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FolderOpen, { className: "h-5 w-5 text-muted-foreground mt-0.5" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 357,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-1 min-w-0", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm font-medium", children: "Temporary Files" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 359,
                  columnNumber: 27
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground break-all", children: pathInfo.tempDir }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 360,
                  columnNumber: 27
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 358,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 356,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start gap-3 p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FolderOpen, { className: "h-5 w-5 text-muted-foreground mt-0.5" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 365,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex-1 min-w-0", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm font-medium", children: "Logs Directory" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 367,
                  columnNumber: 27
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground break-all", children: pathInfo.logsDir }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/setup.tsx",
                  lineNumber: 368,
                  columnNumber: 27
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 366,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 364,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 339,
            columnNumber: 21
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 330,
          columnNumber: 19
        }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 375,
            columnNumber: 21
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: "Path information not available" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 376,
            columnNumber: 21
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 374,
          columnNumber: 19
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 328,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 323,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 322,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(TabsContent, { value: "database", className: "space-y-6", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { children: "Database Configuration" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 386,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Current database connection settings" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 387,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 385,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Info, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 392,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: [
              "Database settings are configured in the ",
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("code", { className: "text-xs", children: ".env" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 394,
                columnNumber: 63
              }, this),
              " file"
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 393,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 391,
            columnNumber: 19
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm font-medium", children: "Host" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 400,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-muted-foreground", children: "Configured via .env" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 401,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 399,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm font-medium", children: "Port" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 404,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-muted-foreground", children: "Configured via .env" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 405,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 403,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm font-medium", children: "Database" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 408,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-muted-foreground", children: "Configured via .env" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 409,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 407,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between p-3 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm font-medium", children: "User" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 412,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm text-muted-foreground", children: "Configured via .env" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/setup.tsx",
                lineNumber: 413,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/setup.tsx",
              lineNumber: 411,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/setup.tsx",
            lineNumber: 398,
            columnNumber: 19
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 390,
          columnNumber: 17
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/setup.tsx",
          lineNumber: 389,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 384,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/dashboard/setup.tsx",
        lineNumber: 383,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/setup.tsx",
      lineNumber: 160,
      columnNumber: 9
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/dashboard/setup.tsx",
    lineNumber: 145,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "/app/src/pages/dashboard/setup.tsx",
    lineNumber: 144,
    columnNumber: 5
  }, this);
}
const Checkbox = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Checkbox$1,
  {
    ref,
    className: cn(
      "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
      className
    ),
    ...props,
    children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
      CheckboxIndicator,
      {
        className: cn("flex items-center justify-center text-current"),
        children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Check, { className: "h-4 w-4" }, void 0, false, {
          fileName: "/app/src/components/ui/checkbox.tsx",
          lineNumber: 22,
          columnNumber: 7
        }, void 0)
      },
      void 0,
      false,
      {
        fileName: "/app/src/components/ui/checkbox.tsx",
        lineNumber: 19,
        columnNumber: 5
      },
      void 0
    )
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/checkbox.tsx",
    lineNumber: 11,
    columnNumber: 3
  },
  void 0
));
Checkbox.displayName = Checkbox$1.displayName;
function SetupWizard() {
  const navigate = useNavigate();
  const [currentStep, setCurrentStep] = reactExports.useState("welcome");
  const [loading, setLoading] = reactExports.useState(true);
  const [submitting, setSubmitting] = reactExports.useState(false);
  const [error, setError] = reactExports.useState(null);
  const [setupStatus, setSetupStatus] = reactExports.useState(null);
  const [adminForm, setAdminForm] = reactExports.useState({
    username: "",
    email: "",
    password: "",
    confirmPassword: "",
    fullName: ""
  });
  const [adminMode, setAdminMode] = reactExports.useState("create");
  const [adminExists, setAdminExists] = reactExports.useState(false);
  const [storageForm, setStorageForm] = reactExports.useState({
    storagePath: "",
    maxBackupSize: 10,
    maxTotalStorage: 100,
    retentionDays: 0,
    // 0 = keep forever
    autoCleanup: false,
    // Disabled by default - keep forever
    compressionEnabled: true
  });
  const [drives, setDrives] = reactExports.useState([]);
  const [loadingDrives, setLoadingDrives] = reactExports.useState(false);
  reactExports.useEffect(() => {
    checkSetupStatus();
    checkAdminExists();
  }, []);
  reactExports.useEffect(() => {
    if (currentStep === "storage") {
      loadDrives();
    }
  }, [currentStep]);
  const loadDrives = async () => {
    setLoadingDrives(true);
    try {
      const res = await fetch("/api/storage/drives");
      if (res.ok) {
        const data = await res.json();
        setDrives(data.drives || []);
        if (data.drives && data.drives.length === 1) {
          setStorageForm((prev) => ({ ...prev, storagePath: data.drives[0].path }));
        }
      }
    } catch (error2) {
      console.error("Failed to load drives:", error2);
    } finally {
      setLoadingDrives(false);
    }
  };
  const checkSetupStatus = async () => {
    var _a;
    try {
      const res = await fetch("/api/setup/status");
      if (res.ok) {
        const data = await res.json();
        setSetupStatus(data.config || {});
        if (((_a = data.config) == null ? void 0 : _a.setupCompleted) && currentStep !== "welcome") {
          setCurrentStep("welcome");
        }
      }
    } catch (error2) {
      console.error("Failed to check setup status:", error2);
    } finally {
      setLoading(false);
    }
  };
  const checkAdminExists = async () => {
    try {
      const res = await fetch("/api/auth/check-admin");
      if (res.ok) {
        const data = await res.json();
        setAdminExists(data.adminExists);
        if (data.adminExists) {
          setAdminMode("login");
        }
      }
    } catch (error2) {
      console.error("Failed to check admin existence:", error2);
    }
  };
  const getStepNumber = (step) => {
    const steps = ["welcome", "admin", "storage", "verify", "complete"];
    return steps.indexOf(step) + 1;
  };
  const getProgress = () => {
    return getStepNumber(currentStep) / 5 * 100;
  };
  const handleAdminSubmit = async () => {
    setError(null);
    if (adminMode === "login") {
      if (!adminForm.username || !adminForm.password) {
        setError("Username and password are required");
        return;
      }
      setSubmitting(true);
      try {
        const res = await fetch("/api/auth/login", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({
            username: adminForm.username,
            password: adminForm.password
          })
        });
        if (res.ok) {
          localStorage.setItem("admin_logged_in", "true");
          setCurrentStep("storage");
        } else {
          const data = await res.json();
          setError(data.error || "Login failed");
        }
      } catch (error2) {
        setError("Login failed");
      } finally {
        setSubmitting(false);
      }
    } else if (adminMode === "create") {
      if (!adminForm.username || !adminForm.email || !adminForm.password) {
        setError("Please fill in all required fields");
        return;
      }
      if (adminForm.password.length < 8) {
        setError("Password must be at least 8 characters");
        return;
      }
      if (adminForm.password !== adminForm.confirmPassword) {
        setError("Passwords do not match");
        return;
      }
      setSubmitting(true);
      try {
        const res = await fetch("/api/auth/setup", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({
            username: adminForm.username,
            email: adminForm.email,
            password: adminForm.password,
            fullName: adminForm.fullName || void 0
          })
        });
        if (res.ok) {
          localStorage.setItem("admin_logged_in", "true");
          setCurrentStep("storage");
        } else {
          const data = await res.json();
          setError(data.error || "Failed to create admin account");
        }
      } catch (error2) {
        setError("Failed to create admin account");
      } finally {
        setSubmitting(false);
      }
    }
  };
  const handleStorageSubmit = async () => {
    setError(null);
    if (drives.length > 1 && !storageForm.storagePath) {
      setError("Please select a storage drive");
      return;
    }
    setSubmitting(true);
    try {
      const res = await fetch("/api/storage/limits", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(storageForm)
      });
      if (res.ok) {
        setCurrentStep("verify");
        setTimeout(() => handleComplete(), 1500);
      } else {
        const data = await res.json();
        setError(data.message || "Failed to save storage configuration");
      }
    } catch (error2) {
      setError("Failed to save storage configuration");
    } finally {
      setSubmitting(false);
    }
  };
  const handleComplete = async () => {
    try {
      const res = await fetch("/api/setup/complete", {
        method: "POST"
      });
      if (res.ok) {
        setSetupStatus({ ...setupStatus, setupCompleted: true });
        setCurrentStep("complete");
      } else {
        const data = await res.json();
        console.error("Failed to complete setup:", data);
        setError(data.error || "Failed to complete setup");
      }
    } catch (error2) {
      console.error("Failed to mark setup as complete:", error2);
      setError("Failed to complete setup");
    }
  };
  if (loading) {
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-h-screen flex items-center justify-center bg-background", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "h-12 w-12 animate-spin text-primary mx-auto mb-4" }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 278,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Loading setup wizard..." }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 279,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 277,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 276,
      columnNumber: 7
    }, this);
  }
  if ((setupStatus == null ? void 0 : setupStatus.setupCompleted) && currentStep === "welcome") {
    return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-h-screen bg-gradient-to-b from-background to-muted py-12 px-4", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "max-w-2xl mx-auto space-y-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center mb-8", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold mb-2", children: "URVault Setup" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 291,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Modify your server configuration" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 292,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 290,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-6 w-6 text-green-600" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 298,
              columnNumber: 17
            }, this),
            "Setup Already Complete"
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 297,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Your URVault server is configured and running" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 301,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 296,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 307,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: "Setup was completed successfully. You can modify individual settings below or return to the dashboard." }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 308,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 306,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between p-4 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "font-medium", children: "Admin Account" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 316,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "Manage administrator credentials" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 317,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 315,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: () => setCurrentStep("admin"), variant: "outline", children: "Modify" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 319,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 314,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between p-4 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "font-medium", children: "Storage Configuration" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 326,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "Update storage limits and retention" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 327,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 325,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: () => setCurrentStep("storage"), variant: "outline", children: "Modify" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 329,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 324,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between p-4 border rounded-lg", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "font-medium", children: "Database Connection" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 336,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "Verify database status" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 337,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 335,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: () => setCurrentStep("verify"), variant: "outline", children: "Verify" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 339,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 334,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 313,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between pt-4", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => navigate("/dashboard"), children: "Return to Dashboard" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 346,
            columnNumber: 17
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 345,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 305,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 295,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 289,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 288,
      columnNumber: 7
    }, this);
  }
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-h-screen flex items-center justify-center bg-background p-4", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "w-full max-w-2xl", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center mb-8", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-4xl font-bold mb-2", children: "URVault Setup" }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 362,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Let's get your backup server configured" }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 363,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 361,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "mb-8", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Progress, { value: getProgress(), className: "h-2" }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 368,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground text-center mt-2", children: [
        "Step ",
        getStepNumber(currentStep),
        " of 5"
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 369,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 367,
      columnNumber: 9
    }, this),
    error && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { variant: "destructive", className: "mb-6", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4" }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 377,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: error }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 378,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 376,
      columnNumber: 11
    }, this),
    currentStep === "welcome" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Rocket, { className: "h-6 w-6" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 387,
            columnNumber: 17
          }, this),
          "Welcome to URVault"
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 386,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Your self-hosted mobile backup solution" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 390,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 385,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm", children: "URVault is now installed and ready to be configured. This wizard will guide you through:" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 396,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("ul", { className: "space-y-2 text-sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 401,
                columnNumber: 21
              }, this),
              "Creating your administrator account"
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 400,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 405,
                columnNumber: 21
              }, this),
              "Configuring storage limits and retention"
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 404,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 409,
                columnNumber: 21
              }, this),
              "Verifying database connection"
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 408,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 399,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm text-muted-foreground", children: "This should only take a few minutes." }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 413,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 395,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: () => setCurrentStep("admin"), size: "lg", children: "Get Started" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 419,
          columnNumber: 17
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 418,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 394,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 384,
      columnNumber: 11
    }, this),
    currentStep === "admin" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(User, { className: "h-6 w-6" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 432,
            columnNumber: 17
          }, this),
          adminMode === "login" ? "Admin Login" : adminMode === "recover" ? "Recover Admin Account" : "Create Admin Account"
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 431,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: adminMode === "login" ? "An admin account already exists. Please login to continue setup." : adminMode === "recover" ? "Reset your admin password to regain access" : "This account will have full access to manage URVault" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 435,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 430,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: [
        adminExists && adminMode === "login" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 446,
            columnNumber: 19
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: "Note:" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 448,
              columnNumber: 21
            }, this),
            " Only one admin account per instance. This is a single-user system designed for one PC."
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 447,
            columnNumber: 19
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 445,
          columnNumber: 17
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "username", children: "Username *" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 455,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Input,
              {
                id: "username",
                value: adminForm.username,
                onChange: (e) => setAdminForm({ ...adminForm, username: e.target.value }),
                placeholder: "admin",
                required: true
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 456,
                columnNumber: 19
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 454,
            columnNumber: 17
          }, this),
          adminMode === "create" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "email", children: "Email *" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 468,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "email",
                  type: "email",
                  value: adminForm.email,
                  onChange: (e) => setAdminForm({ ...adminForm, email: e.target.value }),
                  placeholder: "admin@example.com",
                  required: true
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 469,
                  columnNumber: 23
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 467,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "fullName", children: "Full Name" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 480,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "fullName",
                  value: adminForm.fullName,
                  onChange: (e) => setAdminForm({ ...adminForm, fullName: e.target.value }),
                  placeholder: "John Doe"
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 481,
                  columnNumber: 23
                },
                this
              )
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 479,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 466,
            columnNumber: 19
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "password", children: "Password *" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 492,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Input,
              {
                id: "password",
                type: "password",
                value: adminForm.password,
                onChange: (e) => setAdminForm({ ...adminForm, password: e.target.value }),
                placeholder: adminMode === "create" ? "Minimum 8 characters" : "Enter your password",
                required: true
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 493,
                columnNumber: 19
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 491,
            columnNumber: 17
          }, this),
          adminMode === "create" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "confirmPassword", children: "Confirm Password *" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 505,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              Input,
              {
                id: "confirmPassword",
                type: "password",
                value: adminForm.confirmPassword,
                onChange: (e) => setAdminForm({ ...adminForm, confirmPassword: e.target.value }),
                placeholder: "Re-enter password",
                required: true
              },
              void 0,
              false,
              {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 506,
                columnNumber: 21
              },
              this
            )
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 504,
            columnNumber: 19
          }, this),
          adminMode === "login" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
            Button,
            {
              type: "button",
              variant: "link",
              className: "px-0 text-sm",
              onClick: () => setAdminMode("recover"),
              children: "Forgot password? Recover account"
            },
            void 0,
            false,
            {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 519,
              columnNumber: 21
            },
            this
          ) }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 518,
            columnNumber: 19
          }, this),
          adminMode === "recover" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 532,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: "Password Recovery:" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 534,
                columnNumber: 23
              }, this),
              " Since this is a self-hosted system, password recovery requires database access. Please contact your system administrator or manually reset the password in the database."
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 533,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 531,
            columnNumber: 19
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 453,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between", children: [
          adminMode === "recover" ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => setAdminMode("login"), children: "Back to Login" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 542,
            columnNumber: 19
          }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => setCurrentStep("welcome"), children: (setupStatus == null ? void 0 : setupStatus.setupCompleted) ? "Back to Setup Menu" : "Back" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 546,
            columnNumber: 19
          }, this),
          adminMode !== "recover" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleAdminSubmit, disabled: submitting, children: submitting ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 554,
              columnNumber: 25
            }, this),
            adminMode === "login" ? "Logging in..." : "Creating..."
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 553,
            columnNumber: 23
          }, this) : adminMode === "login" ? "Login" : "Continue" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 551,
            columnNumber: 19
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 540,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 443,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 429,
      columnNumber: 11
    }, this),
    currentStep === "storage" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HardDrive, { className: "h-6 w-6" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 572,
            columnNumber: 17
          }, this),
          "Storage Configuration"
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 571,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Configure backup storage location and limits" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 575,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 570,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          loadingDrives ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "h-4 w-4 animate-spin" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 584,
              columnNumber: 21
            }, this),
            "Loading available drives..."
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 583,
            columnNumber: 19
          }, this) : drives.length > 1 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "storagePath", children: "Storage Drive *" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 589,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
              "select",
              {
                id: "storagePath",
                className: "w-full px-3 py-2 border border-input rounded-md bg-background",
                value: storageForm.storagePath,
                onChange: (e) => setStorageForm({ ...storageForm, storagePath: e.target.value }),
                required: true,
                children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("option", { value: "", children: "Select a drive..." }, void 0, false, {
                    fileName: "/app/src/pages/setup-wizard.tsx",
                    lineNumber: 597,
                    columnNumber: 23
                  }, this),
                  drives.map((drive) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("option", { value: drive.path, children: [
                    drive.label,
                    " - ",
                    (drive.freeSpace / 1024 ** 3).toFixed(1),
                    " GB free of ",
                    (drive.totalSpace / 1024 ** 3).toFixed(1),
                    " GB"
                  ] }, drive.path, true, {
                    fileName: "/app/src/pages/setup-wizard.tsx",
                    lineNumber: 599,
                    columnNumber: 25
                  }, this))
                ]
              },
              void 0,
              true,
              {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 590,
                columnNumber: 21
              },
              this
            ),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Select the drive where backups will be stored" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 604,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 588,
            columnNumber: 19
          }, this) : drives.length === 1 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Storage Drive" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 610,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "p-3 border border-input rounded-md bg-muted", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-sm font-medium", children: drives[0].label }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 612,
                columnNumber: 23
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: [
                (drives[0].freeSpace / 1024 ** 3).toFixed(1),
                " GB free of ",
                (drives[0].totalSpace / 1024 ** 3).toFixed(1),
                " GB"
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 613,
                columnNumber: 23
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 611,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Only one drive detected - automatically selected" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 617,
              columnNumber: 21
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 609,
            columnNumber: 19
          }, this) : null,
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4 md:grid-cols-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "maxBackupSize", children: "Max Backup Size (GB)" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 625,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "maxBackupSize",
                  type: "number",
                  min: "1",
                  max: "1000",
                  value: storageForm.maxBackupSize,
                  onChange: (e) => setStorageForm({ ...storageForm, maxBackupSize: parseInt(e.target.value) })
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 626,
                  columnNumber: 21
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Maximum size for a single backup" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 636,
                columnNumber: 21
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 624,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "maxTotalStorage", children: "Max Total Storage (GB)" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 640,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "maxTotalStorage",
                  type: "number",
                  min: "10",
                  max: "10000",
                  value: storageForm.maxTotalStorage,
                  onChange: (e) => setStorageForm({ ...storageForm, maxTotalStorage: parseInt(e.target.value) })
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 641,
                  columnNumber: 21
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: "Maximum storage for all backups" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 651,
                columnNumber: 21
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 639,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "retentionDays", children: "Retention Period (Days)" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 655,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Input,
                {
                  id: "retentionDays",
                  type: "number",
                  min: "0",
                  max: "3650",
                  value: storageForm.retentionDays,
                  onChange: (e) => setStorageForm({ ...storageForm, retentionDays: parseInt(e.target.value) })
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 656,
                  columnNumber: 21
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground", children: storageForm.retentionDays === 0 ? "Keep backups forever (recommended for perpetual archive)" : `Delete backups older than ${storageForm.retentionDays} days` }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 666,
                columnNumber: 21
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 654,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 623,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-3", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center space-x-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Checkbox,
                {
                  id: "autoCleanup",
                  checked: storageForm.autoCleanup,
                  onCheckedChange: (checked) => setStorageForm({ ...storageForm, autoCleanup: checked === true }),
                  disabled: storageForm.retentionDays === 0
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 676,
                  columnNumber: 21
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "autoCleanup", className: "cursor-pointer", children: "Enable automatic cleanup based on retention period" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 684,
                columnNumber: 21
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 675,
              columnNumber: 19
            }, this),
            storageForm.retentionDays === 0 && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-xs text-muted-foreground ml-6", children: 'Auto-cleanup is disabled when retention is set to "keep forever"' }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 689,
              columnNumber: 21
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center space-x-2", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                Checkbox,
                {
                  id: "compressionEnabled",
                  checked: storageForm.compressionEnabled,
                  onCheckedChange: (checked) => setStorageForm({ ...storageForm, compressionEnabled: checked === true })
                },
                void 0,
                false,
                {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 695,
                  columnNumber: 21
                },
                this
              ),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "compressionEnabled", className: "cursor-pointer", children: "Enable compression to save disk space (recommended)" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 702,
                columnNumber: 21
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 694,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 674,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleAlert, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 709,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("strong", { children: "Perpetual Backup Policy:" }, void 0, false, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 711,
                columnNumber: 21
              }, this),
              " By default, backups are kept forever to maintain a complete archive of your mobile device history. Files can only be deleted from the central server dashboard, not from mobile devices."
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 710,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 708,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 580,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-between", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "outline", onClick: () => setCurrentStep("welcome"), children: (setupStatus == null ? void 0 : setupStatus.setupCompleted) ? "Back to Setup Menu" : "Back" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 717,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleStorageSubmit, disabled: submitting, children: submitting ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 723,
              columnNumber: 23
            }, this),
            "Saving..."
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 722,
            columnNumber: 21
          }, this) : "Continue" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 720,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 716,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 579,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 569,
      columnNumber: 11
    }, this),
    currentStep === "verify" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Database, { className: "h-6 w-6" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 740,
            columnNumber: 17
          }, this),
          "Verifying Configuration"
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 739,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Checking database connection and settings" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 743,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 738,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex flex-col items-center justify-center py-8", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "h-16 w-16 animate-spin text-primary mb-4" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 749,
          columnNumber: 17
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Verifying your setup..." }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 750,
          columnNumber: 17
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 748,
        columnNumber: 15
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 747,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 737,
      columnNumber: 11
    }, this),
    currentStep === "complete" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-6 w-6 text-green-600" }, void 0, false, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 761,
            columnNumber: 17
          }, this),
          "Setup Complete!"
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 760,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "URVault is ready to protect your mobile data" }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 764,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 759,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "space-y-6", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 771,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: "Your URVault server has been successfully configured and is ready to use." }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 772,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 770,
            columnNumber: 17
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2 text-sm", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "font-medium", children: "Next steps:" }, void 0, false, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 778,
              columnNumber: 19
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("ul", { className: "space-y-2 ml-4", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 781,
                  columnNumber: 23
                }, this),
                "Pair your mobile device using the QR code"
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 780,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 785,
                  columnNumber: 23
                }, this),
                "Create your first backup"
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 784,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("li", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheck, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                  fileName: "/app/src/pages/setup-wizard.tsx",
                  lineNumber: 789,
                  columnNumber: 23
                }, this),
                "Set up automatic backup schedules"
              ] }, void 0, true, {
                fileName: "/app/src/pages/setup-wizard.tsx",
                lineNumber: 788,
                columnNumber: 21
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/setup-wizard.tsx",
              lineNumber: 779,
              columnNumber: 19
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 777,
            columnNumber: 17
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 769,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          Button,
          {
            onClick: () => {
              navigate("/dashboard");
            },
            size: "lg",
            children: "Go to Dashboard"
          },
          void 0,
          false,
          {
            fileName: "/app/src/pages/setup-wizard.tsx",
            lineNumber: 797,
            columnNumber: 17
          },
          this
        ) }, void 0, false, {
          fileName: "/app/src/pages/setup-wizard.tsx",
          lineNumber: 796,
          columnNumber: 15
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/setup-wizard.tsx",
        lineNumber: 768,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/setup-wizard.tsx",
      lineNumber: 758,
      columnNumber: 11
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/setup-wizard.tsx",
    lineNumber: 359,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "/app/src/pages/setup-wizard.tsx",
    lineNumber: 358,
    columnNumber: 5
  }, this);
}
function LoginPage() {
  const navigate = useNavigate();
  const [loading, setLoading] = reactExports.useState(false);
  const [error, setError] = reactExports.useState(null);
  const [username, setUsername] = reactExports.useState("");
  const [password, setPassword] = reactExports.useState("");
  reactExports.useEffect(() => {
    const loggedIn = localStorage.getItem("admin_logged_in");
    if (loggedIn === "true") {
      navigate("/dashboard");
    }
  }, [navigate]);
  const handleSubmit = async (e) => {
    e.preventDefault();
    setError(null);
    if (!username || !password) {
      setError("Please enter both username and password");
      return;
    }
    setLoading(true);
    try {
      const res = await fetch("/api/auth/login", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ username, password })
      });
      if (res.ok) {
        localStorage.setItem("admin_logged_in", "true");
        navigate("/dashboard");
      } else {
        const data = await res.json();
        setError(data.error || "Invalid username or password");
      }
    } catch (error2) {
      setError("Login failed. Please try again.");
    } finally {
      setLoading(false);
    }
  };
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800 p-4", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { className: "w-full max-w-md", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { className: "space-y-1 text-center", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "w-16 h-16 bg-primary rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Lock, { className: "w-8 h-8 text-primary-foreground" }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 65,
        columnNumber: 15
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 64,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 63,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "text-2xl font-bold", children: "URVault" }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 68,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: "Sign in to access your backup server" }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 69,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/login.tsx",
      lineNumber: 62,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
      error && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Alert, { variant: "destructive", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(AlertDescription, { children: error }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 75,
        columnNumber: 17
      }, this) }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 74,
        columnNumber: 15
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "username", children: "Username" }, void 0, false, {
          fileName: "/app/src/pages/login.tsx",
          lineNumber: 80,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          Input,
          {
            id: "username",
            type: "text",
            placeholder: "Enter your username",
            value: username,
            onChange: (e) => setUsername(e.target.value),
            disabled: loading,
            autoFocus: true
          },
          void 0,
          false,
          {
            fileName: "/app/src/pages/login.tsx",
            lineNumber: 81,
            columnNumber: 15
          },
          this
        )
      ] }, void 0, true, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 79,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { htmlFor: "password", children: "Password" }, void 0, false, {
          fileName: "/app/src/pages/login.tsx",
          lineNumber: 93,
          columnNumber: 15
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
          Input,
          {
            id: "password",
            type: "password",
            placeholder: "Enter your password",
            value: password,
            onChange: (e) => setPassword(e.target.value),
            disabled: loading
          },
          void 0,
          false,
          {
            fileName: "/app/src/pages/login.tsx",
            lineNumber: 94,
            columnNumber: 15
          },
          this
        )
      ] }, void 0, true, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 92,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { type: "submit", className: "w-full", disabled: loading, children: loading ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(jsxDevRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }, void 0, false, {
          fileName: "/app/src/pages/login.tsx",
          lineNumber: 107,
          columnNumber: 19
        }, this),
        "Signing in..."
      ] }, void 0, true, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 106,
        columnNumber: 17
      }, this) : "Sign In" }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 104,
        columnNumber: 13
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-center text-sm text-muted-foreground", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
        "button",
        {
          type: "button",
          onClick: () => navigate("/setup"),
          className: "text-primary hover:underline",
          children: "Need to configure your server?"
        },
        void 0,
        false,
        {
          fileName: "/app/src/pages/login.tsx",
          lineNumber: 116,
          columnNumber: 15
        },
        this
      ) }, void 0, false, {
        fileName: "/app/src/pages/login.tsx",
        lineNumber: 115,
        columnNumber: 13
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/login.tsx",
      lineNumber: 72,
      columnNumber: 11
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/login.tsx",
      lineNumber: 71,
      columnNumber: 9
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/login.tsx",
    lineNumber: 61,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "/app/src/pages/login.tsx",
    lineNumber: 60,
    columnNumber: 5
  }, this);
}
const Switch = reactExports.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
  Root$3,
  {
    className: cn(
      "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
      className
    ),
    ...props,
    ref,
    children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
      Thumb,
      {
        className: cn(
          "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
        )
      },
      void 0,
      false,
      {
        fileName: "/app/src/components/ui/switch.tsx",
        lineNumber: 20,
        columnNumber: 5
      },
      void 0
    )
  },
  void 0,
  false,
  {
    fileName: "/app/src/components/ui/switch.tsx",
    lineNumber: 12,
    columnNumber: 3
  },
  void 0
));
Switch.displayName = Root$3.displayName;
function SchedulesPage() {
  const [schedules, setSchedules] = reactExports.useState([]);
  const [devices, setDevices] = reactExports.useState([]);
  const [loading, setLoading] = reactExports.useState(true);
  const { user: currentUser } = useCurrentUser();
  const [showCreateDialog, setShowCreateDialog] = reactExports.useState(false);
  const [selectedDevice, setSelectedDevice] = reactExports.useState("");
  const [scheduleName, setScheduleName] = reactExports.useState("");
  const [frequency, setFrequency] = reactExports.useState("daily");
  const [timeOfDay, setTimeOfDay] = reactExports.useState("02:00");
  const [daysOfWeek, setDaysOfWeek] = reactExports.useState([]);
  const [dayOfMonth, setDayOfMonth] = reactExports.useState(1);
  const [backupType, setBackupType] = reactExports.useState("full");
  const [wifiOnly, setWifiOnly] = reactExports.useState(true);
  const [minBattery, setMinBattery] = reactExports.useState(20);
  const [creating, setCreating] = reactExports.useState(false);
  reactExports.useEffect(() => {
    loadData();
  }, []);
  const loadData = async () => {
    setLoading(true);
    try {
      const schedulesRes = await fetch("/api/schedules");
      const schedulesData = await schedulesRes.json();
      if (schedulesData.success) {
        setSchedules(schedulesData.schedules);
      }
      const devicesRes = await fetch("/api/devices");
      const devicesData = await devicesRes.json();
      if (devicesData.success) {
        setDevices(devicesData.devices);
      }
    } catch (error) {
      console.error("Failed to load data:", error);
      toast.error("Failed to load schedules");
    } finally {
      setLoading(false);
    }
  };
  const handleCreateSchedule = async () => {
    if (!selectedDevice || !scheduleName) {
      toast.error("Please fill in all required fields");
      return;
    }
    setCreating(true);
    try {
      const response = await fetch("/api/schedules", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          deviceId: selectedDevice,
          scheduleName,
          frequency,
          timeOfDay,
          daysOfWeek: frequency === "weekly" ? daysOfWeek : void 0,
          dayOfMonth: frequency === "monthly" ? dayOfMonth : void 0,
          backupType,
          conditions: { wifiOnly, minBattery }
        })
      });
      const data = await response.json();
      if (data.success) {
        toast.success("Schedule created successfully");
        setShowCreateDialog(false);
        resetForm();
        loadData();
      } else {
        toast.error(data.error || "Failed to create schedule");
      }
    } catch (error) {
      console.error("Failed to create schedule:", error);
      toast.error("Failed to create schedule");
    } finally {
      setCreating(false);
    }
  };
  const resetForm = () => {
    setSelectedDevice("");
    setScheduleName("");
    setFrequency("daily");
    setTimeOfDay("02:00");
    setDaysOfWeek([]);
    setDayOfMonth(1);
    setBackupType("full");
    setWifiOnly(true);
    setMinBattery(20);
  };
  const toggleDay = (day) => {
    setDaysOfWeek(
      (prev) => prev.includes(day) ? prev.filter((d) => d !== day) : [...prev, day]
    );
  };
  const formatNextRun = (dateString) => {
    if (!dateString) return "Not scheduled";
    const date = new Date(dateString);
    const now = /* @__PURE__ */ new Date();
    const diff = date.getTime() - now.getTime();
    const hours = Math.floor(diff / 36e5);
    const days = Math.floor(hours / 24);
    if (days > 1) return `in ${days} days`;
    if (hours > 1) return `in ${hours} hours`;
    return "Soon";
  };
  const getFrequencyBadge = (freq) => {
    const colors = {
      daily: "bg-blue-100 text-blue-800",
      weekly: "bg-green-100 text-green-800",
      monthly: "bg-purple-100 text-purple-800"
    };
    return colors[freq] || "bg-gray-100 text-gray-800";
  };
  const dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
  const dashboardConfig = currentUser ? {
    header: {
      user: {
        name: currentUser.fullName || currentUser.username,
        email: currentUser.email,
        initials: currentUser.initials
      }
    }
  } : void 0;
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dashboard, { config: dashboardConfig, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-6", children: [
    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h1", { className: "text-3xl font-bold", children: "Backup Schedules" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 181,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground", children: "Automate your backups with custom schedules" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 182,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 180,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Dialog, { open: showCreateDialog, onOpenChange: setShowCreateDialog, children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { size: "lg", className: "shadow-lg", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-5 w-5 mr-2" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 188,
              columnNumber: 19
            }, this),
            "Create Schedule"
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 187,
            columnNumber: 17
          }, this) }, void 0, false, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 186,
            columnNumber: 15
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogContent, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogHeader, { children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogTitle, { children: "Create Backup Schedule" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 194,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DialogDescription, { children: "Set up an automated backup schedule for your device" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 195,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 193,
              columnNumber: 17
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4 py-4", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Device" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 201,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: selectedDevice, onValueChange: setSelectedDevice, children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, { placeholder: "Select a device" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 204,
                    columnNumber: 25
                  }, this) }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 203,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: devices.map((device) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: device.device_id, children: device.name }, device.device_id, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 208,
                    columnNumber: 27
                  }, this)) }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 206,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 202,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 200,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Schedule Name" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 217,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Input,
                  {
                    value: scheduleName,
                    onChange: (e) => setScheduleName(e.target.value),
                    placeholder: "e.g., Daily Evening Backup"
                  },
                  void 0,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 218,
                    columnNumber: 21
                  },
                  this
                )
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 216,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Frequency" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 226,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: frequency, onValueChange: (v) => setFrequency(v), children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, {}, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 229,
                    columnNumber: 25
                  }, this) }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 228,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "daily", children: "Daily" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 232,
                      columnNumber: 25
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "weekly", children: "Weekly" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 233,
                      columnNumber: 25
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "monthly", children: "Monthly" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 234,
                      columnNumber: 25
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 231,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 227,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 225,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Time of Day" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 240,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Input,
                  {
                    type: "time",
                    value: timeOfDay,
                    onChange: (e) => setTimeOfDay(e.target.value)
                  },
                  void 0,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 241,
                    columnNumber: 21
                  },
                  this
                )
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 239,
                columnNumber: 19
              }, this),
              frequency === "weekly" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Days of Week" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 250,
                  columnNumber: 23
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: dayNames.map((day, index) => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Button,
                  {
                    type: "button",
                    variant: daysOfWeek.includes(index) ? "default" : "outline",
                    size: "sm",
                    onClick: () => toggleDay(index),
                    children: day
                  },
                  index,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 253,
                    columnNumber: 27
                  },
                  this
                )) }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 251,
                  columnNumber: 23
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 249,
                columnNumber: 21
              }, this),
              frequency === "monthly" && /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Day of Month" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 269,
                  columnNumber: 23
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                  Input,
                  {
                    type: "number",
                    min: 1,
                    max: 31,
                    value: dayOfMonth,
                    onChange: (e) => setDayOfMonth(parseInt(e.target.value))
                  },
                  void 0,
                  false,
                  {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 270,
                    columnNumber: 23
                  },
                  this
                )
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 268,
                columnNumber: 21
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Backup Type" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 281,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Select, { value: backupType, onValueChange: setBackupType, children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectTrigger, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectValue, {}, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 284,
                    columnNumber: 25
                  }, this) }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 283,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectContent, { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "full", children: "Full Backup" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 287,
                      columnNumber: 25
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SelectItem, { value: "incremental", children: "Incremental Backup" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 288,
                      columnNumber: 25
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 286,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 282,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 280,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-4 pt-4 border-t", children: [
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Backup Conditions" }, void 0, false, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 294,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center justify-between", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "font-medium", children: "WiFi Only" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 298,
                      columnNumber: 25
                    }, this),
                    /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground", children: "Only backup when connected to WiFi" }, void 0, false, {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 299,
                      columnNumber: 25
                    }, this)
                  ] }, void 0, true, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 297,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Switch, { checked: wifiOnly, onCheckedChange: setWifiOnly }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 301,
                    columnNumber: 23
                  }, this)
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 296,
                  columnNumber: 21
                }, this),
                /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "space-y-2", children: [
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Label, { children: "Minimum Battery Level (%)" }, void 0, false, {
                    fileName: "/app/src/pages/dashboard/schedules.tsx",
                    lineNumber: 305,
                    columnNumber: 23
                  }, this),
                  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(
                    Input,
                    {
                      type: "number",
                      min: 0,
                      max: 100,
                      value: minBattery,
                      onChange: (e) => setMinBattery(parseInt(e.target.value))
                    },
                    void 0,
                    false,
                    {
                      fileName: "/app/src/pages/dashboard/schedules.tsx",
                      lineNumber: 306,
                      columnNumber: 23
                    },
                    this
                  )
                ] }, void 0, true, {
                  fileName: "/app/src/pages/dashboard/schedules.tsx",
                  lineNumber: 304,
                  columnNumber: 21
                }, this)
              ] }, void 0, true, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 293,
                columnNumber: 19
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: handleCreateSchedule, disabled: creating, className: "w-full", children: creating ? "Creating..." : "Create Schedule" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 316,
                columnNumber: 19
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 199,
              columnNumber: 17
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 192,
            columnNumber: 15
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 185,
          columnNumber: 13
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: loadData, variant: "outline", size: "sm", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RefreshCw, { className: "h-4 w-4 mr-2" }, void 0, false, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 323,
            columnNumber: 15
          }, this),
          "Refresh"
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 322,
          columnNumber: 13
        }, this)
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 184,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/schedules.tsx",
      lineNumber: 179,
      columnNumber: 9
    }, this),
    loading ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "py-8 text-center text-muted-foreground", children: "Loading schedules..." }, void 0, false, {
      fileName: "/app/src/pages/dashboard/schedules.tsx",
      lineNumber: 331,
      columnNumber: 13
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/schedules.tsx",
      lineNumber: 330,
      columnNumber: 11
    }, this) : schedules.length === 0 ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { className: "py-12 text-center", children: [
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Calendar, { className: "h-12 w-12 mx-auto text-muted-foreground mb-4" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 338,
        columnNumber: 15
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("h3", { className: "text-lg font-semibold mb-2", children: "No Schedules Yet" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 339,
        columnNumber: 15
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("p", { className: "text-muted-foreground mb-4", children: "Create your first backup schedule to automate your backups" }, void 0, false, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 340,
        columnNumber: 15
      }, this),
      /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { onClick: () => setShowCreateDialog(true), children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Plus, { className: "h-4 w-4 mr-2" }, void 0, false, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 344,
          columnNumber: 17
        }, this),
        "Create Schedule"
      ] }, void 0, true, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 343,
        columnNumber: 15
      }, this)
    ] }, void 0, true, {
      fileName: "/app/src/pages/dashboard/schedules.tsx",
      lineNumber: 337,
      columnNumber: 13
    }, this) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/schedules.tsx",
      lineNumber: 336,
      columnNumber: 11
    }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid gap-4", children: schedules.map((schedule) => {
      var _a;
      return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Card, { children: [
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardHeader, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-start justify-between", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardTitle, { className: "flex items-center gap-2", children: [
              schedule.schedule_name,
              schedule.enabled ? /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleCheckBig, { className: "h-4 w-4 text-green-600" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 359,
                columnNumber: 27
              }, this) : /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CircleX, { className: "h-4 w-4 text-gray-400" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 361,
                columnNumber: 27
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 356,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardDescription, { children: [
              "Device: ",
              ((_a = devices.find((d) => d.device_id === schedule.device_id)) == null ? void 0 : _a.name) || schedule.device_id
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 364,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 355,
            columnNumber: 21
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex gap-2", children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SquarePen, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 370,
              columnNumber: 25
            }, this) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 369,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Trash2, { className: "h-4 w-4" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 373,
              columnNumber: 25
            }, this) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 372,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 368,
            columnNumber: 21
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 354,
          columnNumber: 19
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 353,
          columnNumber: 17
        }, this),
        /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(CardContent, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground mb-1", children: "Frequency" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 381,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Badge, { className: getFrequencyBadge(schedule.frequency), children: schedule.frequency }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 382,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 380,
            columnNumber: 21
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground mb-1", children: "Time" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 387,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex items-center gap-1", children: [
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Clock, { className: "h-4 w-4" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 389,
                columnNumber: 25
              }, this),
              /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("span", { className: "text-sm font-medium", children: schedule.time_of_day || "Not set" }, void 0, false, {
                fileName: "/app/src/pages/dashboard/schedules.tsx",
                lineNumber: 390,
                columnNumber: 25
              }, this)
            ] }, void 0, true, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 388,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 386,
            columnNumber: 21
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground mb-1", children: "Next Run" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 394,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm font-medium", children: formatNextRun(schedule.next_run) }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 395,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 393,
            columnNumber: 21
          }, this),
          /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { children: [
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm text-muted-foreground mb-1", children: "Backup Type" }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 398,
              columnNumber: 23
            }, this),
            /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "text-sm font-medium capitalize", children: schedule.backup_type }, void 0, false, {
              fileName: "/app/src/pages/dashboard/schedules.tsx",
              lineNumber: 399,
              columnNumber: 23
            }, this)
          ] }, void 0, true, {
            fileName: "/app/src/pages/dashboard/schedules.tsx",
            lineNumber: 397,
            columnNumber: 21
          }, this)
        ] }, void 0, true, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 379,
          columnNumber: 19
        }, this) }, void 0, false, {
          fileName: "/app/src/pages/dashboard/schedules.tsx",
          lineNumber: 378,
          columnNumber: 17
        }, this)
      ] }, schedule.id, true, {
        fileName: "/app/src/pages/dashboard/schedules.tsx",
        lineNumber: 352,
        columnNumber: 15
      }, this);
    }) }, void 0, false, {
      fileName: "/app/src/pages/dashboard/schedules.tsx",
      lineNumber: 350,
      columnNumber: 11
    }, this)
  ] }, void 0, true, {
    fileName: "/app/src/pages/dashboard/schedules.tsx",
    lineNumber: 178,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "/app/src/pages/dashboard/schedules.tsx",
    lineNumber: 177,
    columnNumber: 5
  }, this);
}
const NotFoundPage = reactExports.lazy(() => __vitePreload(() => import("./_404-Vqc28kfV.js"), true ? __vite__mapDeps([0,1,2]) : void 0));
const routes = [
  {
    path: "/",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(HomePage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 19,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DashboardHome, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 23,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard/devices",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(DevicesPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 27,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard/backups",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(BackupsPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 31,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard/files",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(FilesPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 33,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard/storage",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(StorageSettings, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 35,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard/schedules",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SchedulesPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 39,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/dashboard/setup",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SetupPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 43,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/login",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(LoginPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 47,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "/setup",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SetupWizard, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 51,
      columnNumber: 14
    }, void 0)
  },
  {
    path: "*",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(NotFoundPage, {}, void 0, false, {
      fileName: "/app/src/routes.tsx",
      lineNumber: 55,
      columnNumber: 14
    }, void 0)
  }
];
const SpinnerFallback = () => /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV("div", { className: "flex justify-center py-8 h-screen items-center", children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Spinner, {}, void 0, false, {
  fileName: "/app/src/App.tsx",
  lineNumber: 10,
  columnNumber: 5
}, void 0) }, void 0, false, {
  fileName: "/app/src/App.tsx",
  lineNumber: 9,
  columnNumber: 3
}, void 0);
const router = createBrowserRouter([
  {
    path: "/",
    element: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SpinnerFallback, {}, void 0, false, {
      fileName: "/app/src/App.tsx",
      lineNumber: 19,
      columnNumber: 27
    }, void 0), children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(SetupCheck, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RootLayout, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(Outlet, {}, void 0, false, {
      fileName: "/app/src/App.tsx",
      lineNumber: 22,
      columnNumber: 13
    }, void 0) }, void 0, false, {
      fileName: "/app/src/App.tsx",
      lineNumber: 21,
      columnNumber: 11
    }, void 0) }, void 0, false, {
      fileName: "/app/src/App.tsx",
      lineNumber: 20,
      columnNumber: 9
    }, void 0) }, void 0, false, {
      fileName: "/app/src/App.tsx",
      lineNumber: 19,
      columnNumber: 7
    }, void 0),
    children: routes
  }
]);
function App() {
  return /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(RouterProvider2, { router }, void 0, false, {
    fileName: "/app/src/App.tsx",
    lineNumber: 32,
    columnNumber: 10
  }, this);
}
{
  const meta = document.createElement("meta");
  meta.name = "robots";
  meta.content = "noindex, nofollow";
  document.head.appendChild(meta);
}
const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 1e3 * 60 * 5,
      // 5 minutes
      gcTime: 1e3 * 60 * 10,
      // 10 minutes (formerly cacheTime)
      retry: 1,
      refetchOnWindowFocus: false
    },
    mutations: {
      retry: 0
    }
  }
});
const rootElement = document.getElementById("app");
if (!rootElement) throw new Error("Root element not found");
const root = ReactDOM.createRoot(rootElement);
root.render(
  /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(React.StrictMode, { children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxDevRuntimeExports.jsxDEV(App, {}, void 0, false, {
    fileName: "/app/src/main.tsx",
    lineNumber: 45,
    columnNumber: 7
  }, void 0) }, void 0, false, {
    fileName: "/app/src/main.tsx",
    lineNumber: 44,
    columnNumber: 5
  }, void 0) }, void 0, false, {
    fileName: "/app/src/main.tsx",
    lineNumber: 43,
    columnNumber: 3
  }, void 0)
);
