import { z as e } from "zod";
e.object({
  news: e.string().default("/news"),
  store: e.string().default("/store"),
  account: e.string().default("/account"),
  orders: e.string().default("/orders"),
  error: e.string().default("/error"),
  twitchDrops: e.string().default("/twitch-drops")
});
const a = e.object({ index: e.string(), detail: e.string() }), y = e.object({
  index: e.string(),
  displayNameHistory: e.string(),
  passwordHistory: e.string(),
  emailHistory: e.string()
}), b = e.object({
  index: e.string(),
  games: e.string(),
  keys: e.string(),
  optionboxes: e.string()
}), f = e.object({
  index: e.string(),
  detail: e.string()
});
e.object({
  home: e.string(),
  game: a,
  news: e.string(),
  support: e.object({
    index: e.string(),
    topic: e.object({
      index: e.string()
    }),
    article: e.object({
      index: e.string()
    }),
    manage: e.object({
      article: e.object({
        index: e.string(),
        create: e.string(),
        edit: e.string()
      }),
      topic: e.object({
        index: e.string(),
        create: e.string(),
        edit: e.string()
      })
    })
  }),
  linkAccount: e.string(),
  linkAccountOneTimeCode: e.string(),
  verifyUser: e.string(),
  accountDeletionSuccess: e.string(),
  paymentSuccessCallback: e.string(),
  store: e.object({
    index: e.string(),
    apps: a,
    dlcs: a,
    bundles: a,
    ingameitems: a,
    codes: a,
    optionboxes: a
  }),
  orders: e.object({
    detail: e.string()
  }),
  account: e.object({
    index: e.string(),
    overview: e.string(),
    profile: e.string(),
    accountHistory: y,
    paymentMethods: e.string(),
    changeEmail: e.string(),
    changePassword: e.string(),
    linkedAccounts: e.string(),
    purchasedItems: b,
    orderHistory: f,
    redeemCode: e.string(),
    notificationPreferences: e.string(),
    legalAgreements: e.string(),
    personalData: e.string(),
    accountDeletion: e.string()
  }),
  twitchDrops: e.object({
    index: e.string(),
    claim: e.string()
  }),
  error: e.object({
    index: e.string(),
    err400: e.string(),
    err401: e.string(),
    err404: e.string(),
    err500: e.string(),
    network: e.string(),
    sessionExpired: e.string(),
    alreadyAuthenticated: e.string()
  })
});
class w {
}
w.createWidgetRoutes = (r) => {
  const n = r.store || "/store", o = "/game", s = "/support", t = r.account || "/account", c = r.orders || "/orders", i = r.error || "/error", l = r.news || "/news", d = r.twitchDrops || "/twitch-drops", u = "/link-account", p = "/account/activate", m = "/verify-user", $ = "/account-deletion-success", x = "/callback/order/success", h = {
    home: "/",
    game: {
      index: o,
      detail: `${o}/:gameId`
    },
    news: l,
    support: {
      index: s,
      topic: {
        index: `${s}/topic/:slug`
      },
      article: {
        index: `${s}/article/:slug`
      },
      manage: {
        article: {
          index: `${s}/manage/article`,
          create: `${s}/manage/article/create`,
          edit: `${s}/manage/article/:slug`
        },
        topic: {
          index: `${s}/manage/topic`,
          create: `${s}/manage/topic/create`,
          edit: `${s}/manage/topic/:slug`
        }
      }
    },
    linkAccount: u,
    linkAccountOneTimeCode: p,
    verifyUser: m,
    accountDeletionSuccess: $,
    paymentSuccessCallback: x,
    store: {
      index: n,
      apps: {
        index: `${n}/apps`,
        detail: `${n}/apps/:itemId`
      },
      dlcs: {
        index: `${n}/dlcs`,
        detail: `${n}/dlcs/:itemId`
      },
      bundles: {
        index: `${n}/bundles`,
        detail: `${n}/bundles/:itemId`
      },
      ingameitems: {
        index: `${n}/in-game-items`,
        detail: `${n}/in-game-items/:itemId`
      },
      codes: {
        index: `${n}/codes`,
        detail: `${n}/codes/:itemId`
      },
      optionboxes: {
        index: `${n}/optionboxes`,
        detail: `${n}/optionboxes/:itemId`
      }
    },
    orders: {
      detail: `${c}/:orderNo`
    },
    account: {
      index: t,
      overview: `${t}/overview`,
      profile: `${t}/profile`,
      accountHistory: {
        index: `${t}/account-history`,
        displayNameHistory: `${t}/account-history/display-name`,
        passwordHistory: `${t}/account-history/password`,
        emailHistory: `${t}/account-history/email-address`
      },
      paymentMethods: `${t}/payment-methods`,
      changeEmail: `${t}/change-email`,
      changePassword: `${t}/change-password`,
      linkedAccounts: `${t}/linked-accounts`,
      purchasedItems: {
        index: `${t}/purchased-items`,
        games: `${t}/purchased-items/games`,
        keys: `${t}/purchased-items/keys`,
        optionboxes: `${t}/purchased-items/optionboxes`
      },
      orderHistory: {
        index: `${t}/order-history`,
        detail: `${t}/order-history/:orderNo`
      },
      redeemCode: `${t}/redeem-code`,
      notificationPreferences: `${t}/notification-preferences`,
      legalAgreements: `${t}/legal-agreements`,
      personalData: `${t}/personal-data`,
      accountDeletion: `${t}/account-deletion`
    },
    twitchDrops: {
      index: d,
      claim: `${d}/claim`
    },
    error: {
      index: i,
      err400: `${i}/400`,
      err401: `${i}/401`,
      err404: `${i}/404`,
      err500: `${i}/500`,
      network: `${i}/network-error`,
      sessionExpired: `${i}/login-session-expired`,
      alreadyAuthenticated: `${i}/already-authenticated`
    }
  };
  return g(h);
};
function g(r) {
  const n = {};
  for (const o in r) {
    const s = r[o];
    if (typeof s == "string") {
      n[o] = k(s);
      continue;
    }
    const t = e.record(e.any()).safeParse(s);
    if (t.success) {
      const c = g(t.data);
      n[o] = c;
    }
  }
  return n;
}
function k(r) {
  return {
    link: r,
    makePath: ({
      params: n,
      state: o,
      query: s
    }) => {
      const t = s ? `?${new URLSearchParams(s).toString()}` : "";
      let c = r;
      if (n)
        for (const i in n)
          c = c.replace(`:${i}`, `${n[i]}`);
      return o ? { hash: "", key: "", pathname: c, search: t, state: o } : `${c}${t}`;
    }
  };
}
export {
  w as R
};
