"use strict";const e=require("zod");e.z.object({news:e.z.string().default("/news"),store:e.z.string().default("/store"),account:e.z.string().default("/account"),orders:e.z.string().default("/orders"),error:e.z.string().default("/error"),twitchDrops:e.z.string().default("/twitch-drops")});const a=e.z.object({index:e.z.string(),detail:e.z.string()}),y=e.z.object({index:e.z.string(),displayNameHistory:e.z.string(),passwordHistory:e.z.string(),emailHistory:e.z.string()}),b=e.z.object({index:e.z.string(),games:e.z.string(),keys:e.z.string(),optionboxes:e.z.string()}),f=e.z.object({index:e.z.string(),detail:e.z.string()});e.z.object({home:e.z.string(),game:a,news:e.z.string(),support:e.z.object({index:e.z.string(),topic:e.z.object({index:e.z.string()}),article:e.z.object({index:e.z.string()}),manage:e.z.object({article:e.z.object({index:e.z.string(),create:e.z.string(),edit:e.z.string()}),topic:e.z.object({index:e.z.string(),create:e.z.string(),edit:e.z.string()})})}),linkAccount:e.z.string(),linkAccountOneTimeCode:e.z.string(),verifyUser:e.z.string(),accountDeletionSuccess:e.z.string(),paymentSuccessCallback:e.z.string(),store:e.z.object({index:e.z.string(),apps:a,dlcs:a,bundles:a,ingameitems:a,codes:a,optionboxes:a}),orders:e.z.object({detail:e.z.string()}),account:e.z.object({index:e.z.string(),overview:e.z.string(),profile:e.z.string(),accountHistory:y,paymentMethods:e.z.string(),changeEmail:e.z.string(),changePassword:e.z.string(),linkedAccounts:e.z.string(),purchasedItems:b,orderHistory:f,redeemCode:e.z.string(),notificationPreferences:e.z.string(),legalAgreements:e.z.string(),personalData:e.z.string(),accountDeletion:e.z.string()}),twitchDrops:e.z.object({index:e.z.string(),claim:e.z.string()}),error:e.z.object({index:e.z.string(),err400:e.z.string(),err401:e.z.string(),err404:e.z.string(),err500:e.z.string(),network:e.z.string(),sessionExpired:e.z.string(),alreadyAuthenticated:e.z.string()})});class g{}g.createWidgetRoutes=r=>{const n=r.store||"/store",o="/game",s="/support",t=r.account||"/account",c=r.orders||"/orders",i=r.error||"/error",u=r.news||"/news",d=r.twitchDrops||"/twitch-drops",z="/link-account",p="/account/activate",m="/verify-user",$="/account-deletion-success",x="/callback/order/success",h={home:"/",game:{index:o,detail:`${o}/:gameId`},news:u,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:z,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 l(h)};function l(r){const n={};for(const o in r){const s=r[o];if(typeof s=="string"){n[o]=w(s);continue}const t=e.z.record(e.z.any()).safeParse(s);if(t.success){const c=l(t.data);n[o]=c}}return n}function w(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}`}}}exports.RouteUtils=g;
