import { jsx, jsxs } from "react/jsx-runtime";
import { createRootRoute, Link, Outlet, HeadContent, Scripts, createFileRoute, lazyRouteComponent, createRouter, useRouter } from "@tanstack/react-router";
function NotFoundComponent() {
  return /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-background px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md text-center", children: [
    /* @__PURE__ */ jsx("h1", { className: "text-7xl font-bold text-foreground", children: "404" }),
    /* @__PURE__ */ jsx("h2", { className: "mt-4 text-xl font-semibold text-foreground", children: "Page not found" }),
    /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: "The page you're looking for doesn't exist or has been moved." }),
    /* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
      Link,
      {
        to: "/",
        className: "inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",
        children: "Go home"
      }
    ) })
  ] }) });
}
const Route$f = createRootRoute({
  head: () => ({
    meta: [
      { charSet: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { title: "Pergam Store — Jual Beli Akun Game FF & ML Terpercaya" },
      {
        name: "description",
        content: "Pergam Jb, Pergam Shop, Pergam Store: Pusat jual beli akun game terlengkap. Jual beli akun FF terpercaya, jual ML terpercaya, rental akun, dan jasa jual akun dengan transaksi aman 24/7."
      },
      {
        name: "keywords",
        content: "pergamshop, pergam store, pergam jb, jual beli akun game, jual beli akun ff terpercaya, jual ff terpercaya, jual ml terpercaya, jasa jual akun, rental akun game"
      },
      { name: "author", content: "Pergam Store" },
      { property: "og:title", content: "Pergam Store — Jual Beli Akun Game Terpercaya" },
      {
        property: "og:description",
        content: "Pusat jual beli akun Free Fire (FF), Mobile Legends (ML) terpercaya, rental akun, dan jasa jual akun cepat dan aman."
      },
      { property: "og:type", content: "website" },
      { property: "og:url", content: "https://jbpergam.com" },
      { property: "og:image", content: "https://jbpergam.com/preview.jpg" },
      { name: "twitter:card", content: "summary_large_image" },
      { name: "twitter:title", content: "Pergam Store — Jual Beli Akun Game Terpercaya" },
      {
        name: "twitter:description",
        content: "Pusat jual beli akun Free Fire, Mobile Legends terpercaya, rental akun, dan jasa jual akun cepat dan aman."
      },
      { name: "twitter:image", content: "https://jbpergam.com/preview.jpg" }
    ],
    links: [{ rel: "icon", type: "image/png", href: "/favicon.png" }]
  }),
  component: RootComponent,
  notFoundComponent: NotFoundComponent
});
function RootDocument({ children }) {
  return /* @__PURE__ */ jsxs("html", { lang: "en", className: "dark", suppressHydrationWarning: true, children: [
    /* @__PURE__ */ jsx("head", { suppressHydrationWarning: true, children: /* @__PURE__ */ jsx(HeadContent, {}) }),
    /* @__PURE__ */ jsxs("body", { suppressHydrationWarning: true, children: [
      children,
      /* @__PURE__ */ jsx(Scripts, {})
    ] })
  ] });
}
function RootComponent() {
  return /* @__PURE__ */ jsx(RootDocument, { children: /* @__PURE__ */ jsx(Outlet, {}) });
}
const $$splitComponentImporter$e = () => import("./tentang-C8RkIeKS.js");
const Route$e = createFileRoute("/tentang")({
  head: () => ({
    meta: [{
      title: "Tentang PT PERGAM STORE SENTOSA - Pergam Store"
    }, {
      name: "description",
      content: "Tentang PT PERGAM STORE SENTOSA, marketplace game Pergam Store dengan alamat kantor resmi di Songgom Lor, Songgom, Kabupaten Brebes, Jawa Tengah."
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$e, "component")
});
const $$splitComponentImporter$d = () => import("./produk-BmIOkZQ9.js");
const Route$d = createFileRoute("/produk")({
  head: () => ({
    meta: [{
      title: "Produk — Pergam Store"
    }, {
      name: "description",
      content: "Katalog produk Pergam Store untuk stock akun, rental, dan kategori gaming."
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$d, "component")
});
const $$splitComponentImporter$c = () => import("./layanan-BeuPCtiQ.js");
const Route$c = createFileRoute("/layanan")({
  head: () => ({
    meta: [{
      title: "Layanan — Pergam Store"
    }, {
      name: "description",
      content: "Layanan Pergam Store untuk rental akun, partner resmi, paid promote, dan konsultasi order."
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$c, "component")
});
const BRAND_NAME = "Pergam Store";
const BRAND_DOMAIN = "https://jbpergam.com";
const BRAND_PREVIEW_IMAGE = `${BRAND_DOMAIN}/preview.jpg`;
const BRAND_PREVIEW_IMAGE_ALT = "Pergam Store marketplace akun game, layanan game, dan laporan data bermasalah";
const BRAND_KEYWORDS = "pergam store, pergam jb, pergam shop, jual beli akun game, jual beli akun ff terpercaya, jual ml terpercaya, rental akun game, jasa jual akun, laporan penipu game, data bermasalah game";
const brandUrl = (path = "") => {
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
  return `${BRAND_DOMAIN}${normalizedPath}`;
};
const absoluteBrandAsset = (url) => {
  if (!url) return BRAND_PREVIEW_IMAGE;
  if (/^https?:\/\//i.test(url)) return url;
  return brandUrl(url);
};
const $$splitComponentImporter$b = () => import("./lapor-BQRArsh6.js");
const Route$b = createFileRoute("/lapor")({
  head: () => ({
    meta: [{
      title: `Laporan Publik - ${BRAND_NAME}`
    }, {
      name: "description",
      content: "Cari laporan berdasarkan ID game atau nomor WhatsApp pelaku, dan kirim laporan baru ke Pergam Store."
    }, {
      name: "keywords",
      content: BRAND_KEYWORDS
    }, {
      property: "og:title",
      content: `Data Bermasalah & Laporan Publik - ${BRAND_NAME}`
    }, {
      property: "og:description",
      content: "Cek data bermasalah Pergam Store berdasarkan ID game atau nomor WhatsApp pelaku sebelum transaksi."
    }, {
      property: "og:type",
      content: "website"
    }, {
      property: "og:url",
      content: brandUrl("/lapor")
    }, {
      property: "og:image",
      content: BRAND_PREVIEW_IMAGE
    }, {
      property: "og:image:url",
      content: BRAND_PREVIEW_IMAGE
    }, {
      property: "og:image:alt",
      content: BRAND_PREVIEW_IMAGE_ALT
    }, {
      name: "twitter:card",
      content: "summary_large_image"
    }, {
      name: "twitter:image",
      content: BRAND_PREVIEW_IMAGE
    }],
    links: [{
      rel: "canonical",
      href: brandUrl("/lapor")
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$b, "component")
});
const $$splitComponentImporter$a = () => import("./adminpergam-fqSFtvSK.js");
const Route$a = createFileRoute("/adminpergam")({
  head: () => ({
    meta: [{
      title: "Admin - Pergam Store"
    }, {
      name: "robots",
      content: "noindex, nofollow"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$a, "component")
});
const $$splitComponentImporter$9 = () => import("./index-BHIQDAY-.js");
const Route$9 = createFileRoute("/")({
  head: () => ({
    meta: [{
      title: "Pergam Store — Jual Beli Akun Game FF & ML Terpercaya"
    }, {
      name: "description",
      content: "Pergam Jb, Pergam Shop, Pergam Store: Pusat jual beli akun game terlengkap. Jual beli akun FF terpercaya, jual ML terpercaya, rental akun, dan jasa jual akun dengan transaksi aman 24/7."
    }, {
      name: "keywords",
      content: "pergamshop, pergam store, pergam jb, jual beli akun game, jual beli akun ff terpercaya, jual ff terpercaya, jual ml terpercaya, jasa jual akun, rental akun game"
    }, {
      property: "og:title",
      content: "Pergam Store — Jual Beli Akun Game Terpercaya"
    }, {
      property: "og:description",
      content: "Pusat jual beli akun Free Fire (FF), Mobile Legends (ML) terpercaya, rental akun, dan jasa jual akun cepat dan aman."
    }, {
      property: "og:image",
      content: "https://jbpergam.com/preview.jpg"
    }, {
      name: "twitter:card",
      content: "summary_large_image"
    }, {
      name: "twitter:image",
      content: "https://jbpergam.com/preview.jpg"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$9, "component")
});
const $$splitComponentImporter$8 = () => import("./adminpergam.index-DSWptsnH.js");
const Route$8 = createFileRoute("/adminpergam/")({
  component: lazyRouteComponent($$splitComponentImporter$8, "component")
});
const API_BASE_URL = "https://webjb.mydibikin.my.id/api";
const API_ORIGIN = API_BASE_URL.replace(/\/api$/, "");
async function apiRequest(path, { token, method = "GET", body, headers = {} } = {}) {
  const response = await fetch(`${API_BASE_URL}${path}`, {
    method,
    headers: {
      Accept: "application/json",
      ...body instanceof FormData ? {} : { "Content-Type": "application/json" },
      ...token ? { Authorization: `Bearer ${token}` } : {},
      ...headers
    },
    body: body instanceof FormData ? body : body ? JSON.stringify(body) : void 0
  });
  const data = await response.json().catch(() => ({}));
  if (!response.ok) {
    throw new Error(data.message ?? `API request failed: ${response.status}`);
  }
  return data;
}
function apiGet(path, token) {
  return apiRequest(path, { token });
}
function apiPost(path, body, token) {
  return apiRequest(path, { method: "POST", body, token });
}
function apiPostForm(path, body, token) {
  return apiRequest(path, { method: "POST", body, token });
}
function resolveApiAssetUrl(url) {
  if (!url) return "";
  if (url === "/sample_data.png") return "/contoh-data.png";
  if (/^https?:\/\//i.test(url)) return url;
  if (url.startsWith("/")) return `${API_ORIGIN}${url}`;
  return `${API_ORIGIN}/${url}`;
}
const $$splitComponentImporter$7 = () => import("./lapor._reportId-2lVsxef9.js");
const Route$7 = createFileRoute("/lapor/$reportId")({
  loader: async ({
    params
  }) => {
    const response = await apiGet(`/reports/public/${params.reportId}`);
    return response.data;
  },
  head: ({
    loaderData
  }) => {
    const image = resolveApiAssetUrl(loaderData?.evidence_images?.[0]) || BRAND_PREVIEW_IMAGE;
    return {
      meta: [{
        title: `${loaderData?.title ?? "Detail Laporan"} - ${BRAND_NAME}`
      }, {
        name: "description",
        content: loaderData?.description ?? "Detail laporan publik Pergam Store."
      }, {
        property: "og:title",
        content: `${loaderData?.title ?? "Detail Laporan"} - ${BRAND_NAME}`
      }, {
        property: "og:description",
        content: loaderData?.description ?? "Detail laporan publik Pergam Store."
      }, {
        property: "og:type",
        content: "article"
      }, {
        property: "og:url",
        content: brandUrl(`/lapor/${loaderData?.id ?? ""}`)
      }, {
        property: "og:image",
        content: absoluteBrandAsset(image)
      }, {
        property: "og:image:url",
        content: absoluteBrandAsset(image)
      }, {
        property: "og:image:alt",
        content: loaderData?.title ?? "Detail laporan Pergam Store"
      }, {
        name: "twitter:card",
        content: "summary_large_image"
      }, {
        name: "twitter:image",
        content: absoluteBrandAsset(image)
      }],
      links: [{
        rel: "canonical",
        href: brandUrl(`/lapor/${loaderData?.id ?? ""}`)
      }]
    };
  },
  component: lazyRouteComponent($$splitComponentImporter$7, "component")
});
const $$splitComponentImporter$6 = () => import("./adminpergam.users-BaV_YG0I.js");
const Route$6 = createFileRoute("/adminpergam/users")({
  component: lazyRouteComponent($$splitComponentImporter$6, "component")
});
const $$splitComponentImporter$5 = () => import("./adminpergam.setup-05QeIYtw.js");
const Route$5 = createFileRoute("/adminpergam/setup")({
  head: () => ({
    meta: [{
      title: "Setup Admin Pertama — Pergam Store"
    }, {
      name: "robots",
      content: "noindex, nofollow"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$5, "component")
});
const $$splitComponentImporter$4 = () => import("./adminpergam.settings-BiYd40Jy.js");
const Route$4 = createFileRoute("/adminpergam/settings")({
  component: lazyRouteComponent($$splitComponentImporter$4, "component")
});
const $$splitComponentImporter$3 = () => import("./adminpergam.login-Ctb5XrNp.js");
const Route$3 = createFileRoute("/adminpergam/login")({
  head: () => ({
    meta: [{
      title: "Admin Login — Pergam Store"
    }, {
      name: "robots",
      content: "noindex, nofollow"
    }]
  }),
  component: lazyRouteComponent($$splitComponentImporter$3, "component")
});
const $$splitComponentImporter$2 = () => import("./adminpergam.laporan-DxzzGEZZ.js");
const Route$2 = createFileRoute("/adminpergam/laporan")({
  component: lazyRouteComponent($$splitComponentImporter$2, "component")
});
const $$splitComponentImporter$1 = () => import("./adminpergam.products.new-BJ_xRvEB.js");
const Route$1 = createFileRoute("/adminpergam/products/new")({
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
});
const $$splitComponentImporter = () => import("./adminpergam.products._id-CrBAJYgm.js");
const Route = createFileRoute("/adminpergam/products/$id")({
  component: lazyRouteComponent($$splitComponentImporter, "component")
});
const TentangRoute = Route$e.update({
  id: "/tentang",
  path: "/tentang",
  getParentRoute: () => Route$f
});
const ProdukRoute = Route$d.update({
  id: "/produk",
  path: "/produk",
  getParentRoute: () => Route$f
});
const LayananRoute = Route$c.update({
  id: "/layanan",
  path: "/layanan",
  getParentRoute: () => Route$f
});
const LaporRoute = Route$b.update({
  id: "/lapor",
  path: "/lapor",
  getParentRoute: () => Route$f
});
const AdminpergamRoute = Route$a.update({
  id: "/adminpergam",
  path: "/adminpergam",
  getParentRoute: () => Route$f
});
const IndexRoute = Route$9.update({
  id: "/",
  path: "/",
  getParentRoute: () => Route$f
});
const AdminpergamIndexRoute = Route$8.update({
  id: "/",
  path: "/",
  getParentRoute: () => AdminpergamRoute
});
const LaporReportIdRoute = Route$7.update({
  id: "/$reportId",
  path: "/$reportId",
  getParentRoute: () => LaporRoute
});
const AdminpergamUsersRoute = Route$6.update({
  id: "/users",
  path: "/users",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamSetupRoute = Route$5.update({
  id: "/setup",
  path: "/setup",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamSettingsRoute = Route$4.update({
  id: "/settings",
  path: "/settings",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamLoginRoute = Route$3.update({
  id: "/login",
  path: "/login",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamLaporanRoute = Route$2.update({
  id: "/laporan",
  path: "/laporan",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamProductsNewRoute = Route$1.update({
  id: "/products/new",
  path: "/products/new",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamProductsIdRoute = Route.update({
  id: "/products/$id",
  path: "/products/$id",
  getParentRoute: () => AdminpergamRoute
});
const AdminpergamRouteChildren = {
  AdminpergamLaporanRoute,
  AdminpergamLoginRoute,
  AdminpergamSettingsRoute,
  AdminpergamSetupRoute,
  AdminpergamUsersRoute,
  AdminpergamIndexRoute,
  AdminpergamProductsIdRoute,
  AdminpergamProductsNewRoute
};
const AdminpergamRouteWithChildren = AdminpergamRoute._addFileChildren(
  AdminpergamRouteChildren
);
const LaporRouteChildren = {
  LaporReportIdRoute
};
const LaporRouteWithChildren = LaporRoute._addFileChildren(LaporRouteChildren);
const rootRouteChildren = {
  IndexRoute,
  AdminpergamRoute: AdminpergamRouteWithChildren,
  LaporRoute: LaporRouteWithChildren,
  LayananRoute,
  ProdukRoute,
  TentangRoute
};
const routeTree = Route$f._addFileChildren(rootRouteChildren)._addFileTypes();
function DefaultErrorComponent({ error, reset }) {
  const router2 = useRouter();
  return /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-background px-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md text-center", children: [
    /* @__PURE__ */ jsx("div", { className: "mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10", children: /* @__PURE__ */ jsx(
      "svg",
      {
        xmlns: "http://www.w3.org/2000/svg",
        className: "h-8 w-8 text-destructive",
        fill: "none",
        viewBox: "0 0 24 24",
        stroke: "currentColor",
        strokeWidth: 2,
        children: /* @__PURE__ */ jsx(
          "path",
          {
            strokeLinecap: "round",
            strokeLinejoin: "round",
            d: "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"
          }
        )
      }
    ) }),
    /* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold tracking-tight text-foreground", children: "Something went wrong" }),
    /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: "An unexpected error occurred. Please try again." }),
    false,
    /* @__PURE__ */ jsxs("div", { className: "mt-6 flex items-center justify-center gap-3", children: [
      /* @__PURE__ */ jsx(
        "button",
        {
          onClick: () => {
            router2.invalidate();
            reset();
          },
          className: "inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",
          children: "Try again"
        }
      ),
      /* @__PURE__ */ jsx(
        "a",
        {
          href: "/",
          className: "inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent",
          children: "Go home"
        }
      )
    ] })
  ] }) });
}
const getRouter = () => {
  const router2 = createRouter({
    routeTree,
    context: {},
    scrollRestoration: true,
    defaultPreloadStaleTime: 0,
    defaultErrorComponent: DefaultErrorComponent
  });
  return router2;
};
const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  getRouter
}, Symbol.toStringTag, { value: "Module" }));
export {
  Route$7 as R,
  apiGet as a,
  apiPostForm as b,
  apiPost as c,
  Route as d,
  router as e,
  resolveApiAssetUrl as r
};
