PageSourceSearch

https://www.paxhistoria.co/_next/static/immutable/chunks/15ihcsmst0qh6.js

js paxhistoria.co collected 2026-10-02 19:24:06 UTC 30,488 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="a8fad987-fb87-ace6-c6b5-70a10111034a")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,554247,e=>{"use strict";var t=e.i(843476),r=e.i(500932),a=e.i(271645),s=e.i(86610),i=e.i(516263),n=e.i(822126),o=e.i(609867),l=e.i(742214),c=e.i(709375),d=e.i(176009);e.i(488474);var u=e.i(566510),h=e.i(683095),m=e.i(904770),p=e.i(330247),b=e.i(939359),x=e.i(657688),f=e.i(266027),y=e.i(912598),g=e.i(618566),j=e.i(337001),v=e.i(630082),k=e.i(729031),P=e.i(638692);function N({isOpen:e,onClose:r}){let[S]=(0,c.useAuthState)(d.auth),{loadReCaptcha:w}=(0,h.useLoadReCaptcha)(),{executeRecaptcha:T,loaded:C}=(0,u.useReCaptcha)(),[A,_]=(0,a.useState)(!1),[M,E]=(0,a.useState)(null),R=(0,v.useGlobeImageForColorScheme)(),{client:O}=(0,p.useStatsigClient)(),F=(0,g.usePathname)(),{openFullSiteBanModal:D}=(0,j.useFullSiteBanModal)(),B=(0,y.useQueryClient)(),{data:L}=(0,f.useQuery)({queryKey:["authRedirect"],queryFn:async()=>void 0,enabled:!1,staleTime:1/0,gcTime:1/0,refetchOnMount:!1,refetchOnWindowFocus:!1,retry:!1});(0,a.useEffect)(()=>{e&&w()},[e,w]);let U=L?.errorCode||L?.errorMessage?L?.errorMessage||"Failed to link Google account.":null,[K,I]=(0,a.useState)(null),$=e?U??"":"__closed__";K!==$&&(I($),e&&U&&E(U));let G=async()=>{E(null),_(!0);try{if(!S||!S.isAnonymous)return void r();if((0,m.shouldUsePopupAuth)()&&C){let e=await T("linkWithGoogle"),t=await (0,m.linkAnonymousWithGooglePopup)(e,O);if(t.linked)return void r();if("account-disabled"===t.errorCode){D(),r();return}if("account-exists"===t.errorCode)E("This Google account already has a Pax Historia account. Guest progress cannot be merged."),B.setQueryData(["authRedirect"],{signedInSuccesfully:!1,idToken:null,errorCode:"account-exists",errorMessage:"This Google account already has a Pax Historia account. Guest progress cannot be merged."});else{let e=t.errorMessage||"Failed to link Google account.";E(e),B.setQueryData(["authRedirect"],{signedInSuccesfully:!1,idToken:null,errorCode:t.errorCode||"link-failed",errorMessage:e})}}else(0,k.storeAuthRedirectDestination)(F),await (0,m.linkAnonymousWithGoogleRedirect)(O)}catch(t){let e=t?.message||"Failed to link Google account.";E(e),B.setQueryData(["authRedirect"],{signedInSuccesfully:!1,idToken:null,errorCode:"exception",errorMessage:e})}finally{_(!1)}};return e?(0,t.jsx)(o.Modal,{isOpen:e,size:"4xl",backdrop:"blur",onClose:r,classNames:P.AUTH_INTERRUPT_MODAL_CLASSNAMES,children:(0,t.jsx)(l.ModalContent,{className:"",children:(0,t.jsxs)("div",{className:"p-8 py-16 md:grid md:grid-cols-2 md:gap-8",children:[(0,t.jsxs)("div",{className:"hidden flex-col md:flex",children:[(0,t.jsxs)("div",{className:"flex h-full flex-col justify-center",children:[(0,t.jsx)(x.default,{src:R,alt:"Pax Globe",width:64,height:64,className:"mb-4"}),(0,t.jsx)("h2",{className:"mb-8 text-4xl",children:"Full Account Required"})]}),(0,t.jsxs)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:[(0,t.jsx)("p",{className:"mb-3",children:"You're currently playing as a guest. Link your Google account to unlock:"}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-5",children:[(0,t.jsx)("li",{children:"Daily check-in bonus tokens"}),(0,t.jsxs)("li",{children:["Instant ",(0,t.jsx)("span",{className:"font-semibold",children:"1 token"})," bonus"]}),(0,t.jsx)("li",{children:"Save progress across all your devices"}),(0,t.jsx)("li",{children:"Appear on leaderboards"})]})]})]}),(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)("div",{className:"mb-4 flex justify-center md:hidden",children:(0,t.jsx)(x.default,{src:R,alt:"Pax Globe",width:64,height:64})}),(0,t.jsx)("h2",{className:"mb-8 text-center text-4xl md:hidden",children:"Full Account Required"}),(0,t.jsxs)("div",{className:"mb-8 text-left text-sm text-gray-700 md:hidden dark:text-gray-300",children:[(0,t.jsx)("p",{className:"mb-4 text-center",children:"You're currently playing as a guest. Link your Google account to unlock:"}),(0,t.jsxs)("ul",{className:"list-disc space-y-1 pl-5",children:[(0,t.jsx)("li",{children:"Daily check-in bonus tokens"}),(0,t.jsxs)("li",{children:["Instant ",(0,t.jsx)("span",{className:"font-semibold",children:"1 token"})," bonus"]}),(0,t.jsx)("li",{children:"Save progress across all your devices"}),(0,t.jsx)("li",{children:"Appear on leaderboards"})]})]}),(0,t.jsxs)("div",{className:"flex h-full flex-col justify-center",children:[(0,t.jsx)(s.Button,{className:"h-14 w-full justify-center px-4 text-lg",variant:"bordered",startContent:!A&&C&&(0,t.jsx)(b.default,{className:"h-6 w-6"}),isLoading:A||!C,onPress:G,children:A?"Linking Account...":"Link Google Account"}),M&&(0,t.jsx)(i.Card,{className:"mt-4 border border-red-500/30 bg-red-500/10",children:(0,t.jsx)(n.CardBody,{children:(0,t.jsx)("div",{className:"text-center text-sm text-red-600 dark:text-red-500",children:M})})})]})]})]})})},"upgrade-account-modal"):null}var S=e.i(344940);let w=(0,a.createContext)(null),T=(0,a.createContext)(!1);e.s(["AuthModalsProvider",0,function(e){let s,i,n,o,l,c,d=(0,r.c)(12),{children:u}=e,[h,m]=(0,a.useState)(!1),[p,b]=(0,a.useState)(!1);d[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>m(!0),d[0]=s):s=d[0];let x=s;d[1]===Symbol.for("react.memo_cache_sentinel")?(i=()=>b(!0),d[1]=i):i=d[1];let f=i;d[2]===Symbol.for("react.memo_cache_sentinel")?(n={openUpgrade:x,openGetStarted:f},d[2]=n):n=d[2];let y=n,g=h||p;return d[3]!==h?(o=h&&(0,t.jsx)(N,{isOpen:!0,onClose:()=>m(!1)}),d[3]=h,d[4]=o):o=d[4],d[5]!==p?(l=p&&(0,t.jsx)(S.default,{currentUser:null,isOpen:!0,onClose:()=>b(!1),hideTriggerButton:!0}),d[5]=p,d[6]=l):l=d[6],d[7]!==u||d[8]!==g||d[9]!==o||d[10]!==l?(c=(0,t.jsx)(w.Provider,{value:y,children:(0,t.jsxs)(T.Provider,{value:g,children:[u,o,l]})}),d[7]=u,d[8]=g,d[9]=o,d[10]=l,d[11]=c):c=d[11],c},"useAuthModalOpen",0,function(){return(0,a.useContext)(T)},"useAuthModals",0,function(){let e=(0,a.useContext)(w);if(!e)throw Error("useAuthModals must be used within AuthModalsProvider");return e}],554247)},270797,716253,e=>{"use strict";var t=e.i(843476),r=e.i(500932),a=e.i(271645),s=e.i(86610),i=e.i(284075),n=e.i(609867),o=e.i(367907),l=e.i(742214),c=e.i(869889),d=e.i(24878),u=e.i(926696),h=e.i(780370),m=e.i(712386),p=e.i(385371),b=e.i(657688),x=e.i(522016),f=e.i(709375),y=e.i(176009),g=e.i(282946),j=e.i(834648),v=e.i(97693);let k=["token_purchase","session_id"];async function P(e){let t=await fetch("/api/tokens/create-checkout-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e,returnPath:function(){let e=new URLSearchParams(window.location.search);for(let t of k)e.delete(t);let t=e.toString();return window.location.pathname+(t?`?${t}`:"")}()})});if(!t.ok)throw Error("Failed to create checkout session");let{url:r}=await t.json();window.location.href=r}async function N(e,t){let r=await fetch("/api/subscription/create-checkout-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e,...t?.paidTrial?{paid_trial:!0}:{}})});if(!r.ok)throw Error((await r.json()).error||"Failed to create checkout session");let{url:a}=await r.json();window.location.href=a}e.s(["purchaseTokens",0,P,"subscribe",0,N],716253),e.i(84987);var S=e.i(23931),w=e.i(630082),T=e.i(504411),C=e.i(767848);let A=new Set(["active","trialing","past_due","unpaid","paused"]);function _({isOpen:e,onClose:r,initialTab:k}){let[N,M]=(0,a.useState)(!1),E=(0,w.useGlobeImageForColorScheme)(),[R,O]=(0,a.useState)(k||"subscribe"),[F,D]=(0,a.useState)(null),[B]=(0,f.useAuthState)(y.auth),{data:L}=(0,g.useUserPrivateProfile)(B?.uid??""),{data:U}=(0,j.useUserPublicProfile)(B?.uid??""),{t:K,isLoading:I}=(0,S.useTranslations)("navbar","tokensModal"),{t:$}=(0,S.useTranslations)("account","patron"),G=A.has(L?.subscriptionStatus??"inactive"),H=L?.subscriptionPlan??null,Q=(0,T.getPatronEntitlementTier)(L??null),V=(0,T.canManagePatronBilling)(Q),q=(0,T.getPatronPaymentPendingStatus)(L??null),z=!!L?.freeTrialEligibilityStatus?.blocked&&!!L?.freeTrialEligibilityStatus?.lastCheckoutFailedAt&&L?.patronSubscriptionTrialStatus!=="paid_trial",W=e=>{let t=Math.round(100*e)/100,r=Math.round(t);if(.05>Math.abs(t-r))return`${r}`;let a=Math.round(10*e)/10;return`${a%1==0?a.toFixed(0):a.toString()}`},Y=e=>(0,p.tokensToDisplayDollars)(e),J=(0,a.useCallback)((e,t)=>{let r=Y(t);return r<=0?0:e/r},[]),X=(0,a.useMemo)(()=>{let e=m.TOKEN_PURCHASE_PRICES.basic;return J(e.price,e.tokens)},[J]),Z=(0,a.useMemo)(()=>{let e=m.TOKEN_PURCHASE_PRICES.pro;return J(e.price,e.tokens)},[J]),ee=e=>`$${e.toFixed(2)}`,et=e=>`$${e.toFixed(2)}/token`,er=e=>`${Math.round(100*e)}%`,ea=void 0!==L,[es,ei]=(0,a.useState)(0),[en,eo]=(0,a.useState)(e);en!==e&&(eo(e),e||(O(k||"subscribe"),D(null),ei(e=>e+1)));let[el,ec]=(0,a.useState)(null);e&&ea&&el!==es&&G&&"subscribe"===R&&(ec(es),O("one-time"),F?.tab==="subscribe"&&D(null));let ed=async e=>{M(!0);try{await P(e)}catch(e){alert("Failed to process token purchase. Please try again.")}finally{M(!1)}},eu=async e=>{M(!0);try{let t=await fetch("/api/subscription/create-checkout-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to create checkout session")}let{url:r}=await t.json();window.location.href=r}catch(e){alert(e instanceof Error?e.message:"Failed to start subscription process. Please try again.")}finally{M(!1)}},eh=async e=>{M(!0);try{let t=await fetch("/api/subscription/create-checkout-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:"patron",...e?.paidTrial?{paid_trial:!0}:{},...e?.skipTrial?{skip_trial:!0}:{},...e?.providerPreference?{providerPreference:e.providerPreference}:{}})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to create checkout session")}let{url:r}=await t.json();window.location.href=r}catch(e){alert(e instanceof Error?e.message:"Failed to start subscription process. Please try again.")}finally{M(!1)}},em=async()=>
2{if("patron"===R&&!V)return z?void await eh({paidTrial:!0}):void await eu("patron");if(F)if("one-time"===F.tab)await ed(F.planKey);else if("patron"===F.tab){if(V)return;await eu("patron")}else{if(G)return;await eu(F.planKey)}},ep=(0,a.useMemo)(()=>{if(!F)return null;if("one-time"===F.tab){let e=m.TOKEN_PURCHASE_PRICES[F.planKey],t=Y(e.tokens),r=J(e.price,e.tokens),a=Math.max(0,(X-r)/X);return{kind:"One-time",name:`${F.planKey} package`,priceDisplay:ee(e.price),tokensCount:t,pricePerToken:r,savingsVsBasic:a}}{if("patron"===F.tab)return{kind:"Patron",name:m.PATRON_PLAN.name,priceDisplay:`${ee(m.PATRON_PLAN.price)}/month`,tokensCount:0,pricePerToken:0,savingsVsBasic:0,savingsVsProOneTime:0,creatorTokens:m.PATRON_PLAN.creatorTokens};let e=m.SUBSCRIPTION_PLANS[F.planKey],t=Y(e.tokens),r=J(e.price,e.tokens),a=Math.max(0,(X-r)/X),s=Math.max(0,(Z-r)/Z);return{kind:"Subscription",name:e.name,priceDisplay:`${ee(e.price)}/month`,tokensCount:t,pricePerToken:r,savingsVsBasic:a,savingsVsProOneTime:s}}},[F,X,Z,J]);return e&&!I&&K?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(n.Modal,{isOpen:e,onClose:r,size:"2xl",backdrop:"blur",scrollBehavior:"inside",children:(0,t.jsxs)(l.ModalContent,{children:[(0,t.jsx)(d.ModalHeader,{children:(0,t.jsxs)("div",{className:"flex w-full items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-primary/10 rounded-md p-1.5",children:(0,t.jsx)(b.default,{src:"/images/pax-token-icon.png",width:28,height:28,alt:"Pax Token"})}),(0,t.jsx)("h2",{className:"text-2xl font-semibold md:text-3xl",children:K.getMoreTokens("Get more tokens")})]})}),(0,t.jsx)(o.ModalBody,{children:(0,t.jsxs)("div",{className:"flex flex-col gap-6 pb-4",children:[(0,t.jsx)("section",{className:"flex flex-col gap-4",children:(0,t.jsxs)(h.Tabs,{selectedKey:R,onSelectionChange:e=>{O(e),"subscribe"===e&&G&&D(null),"patron"===e&&V&&D(null)},"aria-label":"Select purchase type",variant:"underlined",color:"primary",children:[(0,t.jsxs)(u.Tab,{title:K.patron("Patron"),children:[q?(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(C.PatronPaymentNeededCard,{status:q})}):V?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"bg-secondary/10 mt-2 rounded-md border p-4",children:[(0,t.jsx)("div",{className:"mb-2 font-medium",children:K.youArePatron("You are a Pax Patron!")}),(0,t.jsxs)("div",{className:"mb-2",children:[K.badgeVisibility("Badge visibility:")," ",(0,t.jsx)("span",{className:"font-medium",children:U?.isPublicPatron?K.visibleOnProfile("Visible on profile"):K.hiddenFromProfile("Hidden from profile")})]}),(0,t.jsxs)("div",{className:"mb-2",children:[K.openRouter("OpenRouter:")," ",(0,t.jsx)("span",{className:"font-medium",children:L?.openRouterApiKey&&L?.useOpenRouterKeyWhenPossible?K.enabled("Enabled"):L?.openRouterApiKey?K.configuredButDisabled("Configured but disabled"):K.notConfigured("Not configured")})]}),(0,t.jsxs)("div",{className:"mb-3",children:[K.patronTokens("Patron tokens:")," ",(0,t.jsx)("span",{className:"font-medium",children:K.unused(`${L?.patronTokens??0} unused`,{count:L?.patronTokens??0})})]}),(0,t.jsxs)("div",{children:[K.managePatronSettings("You can manage your patron settings in your")," ",(0,t.jsx)(x.default,{href:"/account",className:"text-primary underline",children:K.accountSettingsLink("account settings")}),"."]})]}),(0,t.jsxs)("div",{className:"mb-3 rounded-lg border border-blue-500/30 bg-blue-500/10 p-3 text-sm",children:[(0,t.jsx)("div",{className:"mb-1 font-medium text-blue-600 dark:text-blue-400",children:K.needHelp("Need Help?")}),(0,t.jsxs)("p",{children:[K.needHelpContent("Please email us at")," ",(0,t.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 underline hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:"[email protected]"})," ",K.ifYouFaceIssues("if you face any unexpected issues with your Patron subscription.")," ",(0,t.jsx)("a",{href:"https://www.youtube.com/watch?v=wLGxDuf6E9A",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:K.thisYoutubeVideo("This youtube video")})," ",K.and("and")," ",(0,t.jsx)("a",{href:"https://wiki.paxhistoria.co/wiki/Pax_Patron",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:K.thisArticle("This article")})," ",K.answersCommonQuestions("also answer some common questions.")]})]})]}):(0,t.jsx)(v.default,{showPurchaseButton:!1,hasActivePatronSubscription:V,freeTrialEligibilityStatus:L?.freeTrialEligibilityStatus??null,patronSubscriptionTrialStatus:L?.patronSubscriptionTrialStatus??null}),z&&!V&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(s.Button,{color:"primary",variant:"solid",onPress:()=>eh({paidTrial:!0}),isLoading:N,children:$?.startPaidTrial("Start paid trial")??"Start paid trial"})})]},"patron"),(0,t.jsx)(u.Tab,{title:K.subscribe("Subscribe"),children:G?(0,t.jsxs)("div",{className:"bg-secondary/10 mt-2 rounded-md border p-4 text-sm",children:[(0,t.jsxs)("div",{className:"mb-1 font-medium",children:[K.alreadySubscribed("You already subscribed"),H?` ${K.toSubscription(`to ${m.SUBSCRIPTION_PLANS[H].name}`,{planName:m.SUBSCRIPTION_PLANS[H].name})}`:"","."]}),(0,t.jsxs)("div",{children:[K.manageSubscriptionSettings("You can manage your subscription in your")," ",(0,t.jsx)(x.default,{href:"/account",className:"text-primary underline",children:K.accountSettingsLink("account settings")}),"."]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-3 md:grid-cols-3",children:Object.entries(m.SUBSCRIPTION_PLANS).map(([e,r])=>{let a=Y(r.tokens),s=J(r.price,r.tokens),n=F?.tab==="subscribe"&&F.planKey===e,o="regular"===e,l=Math.max(0,(X-s)/X),c=Math.max(0,(Z-s)/Z);return(0,t.jsxs)("button",{type:"button",onClick:()=>D({tab:"subscribe",planKey:e}),className:`relative flex flex-col gap-2 rounded-lg border p-4 text-left transition-all hover:shadow-md ${n?"border-primary ring-primary/30 ring-2":"border-secondary/30 hover:border-primary/50"}`,"aria-pressed":n,children:[o&&(0,t.jsx)("div",{className:"absolute -top-3 left-1/2 z-10 -translate-x-1/2",children:(0,t.jsx)(i.Chip,{color:"primary",size:"sm",variant:"solid",children:K.mostPopular("Most Popular")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.default,{src:E,width:18,height:18,alt:"Pax"}),(0,t.jsx)("div",{className:"font-semibold",children:r.name})]}),(0,t.jsxs)("div",{className:"text-primary text-lg font-bold",children:[ee(r.price),K.perMonth("/month")]}),(0,t.jsxs)("ul",{className:"list-disc space-y-0.5 pl-5 text-xs",children:[(0,t.jsxs)("li",{children:[W(a)," ",K.tokensPerMonth("tokens/month")]}),(0,t.jsx)("li",{children:et(s)}),(0,t.jsx)("li",{children:K.saveVsBasic(`Save ${er(l)} vs Basic one-time / ${er(c)} vs Pro one-time`,{basicPct:er(l),proPct:er(c)})})]})]},e)})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:K.billedMonthly("Billed monthly. Cancel anytime.")})]})},"subscribe"),(0,t.jsxs)(u.Tab,{title:K.oneTime("One-time"),children:[(0,t.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-3 md:grid-cols-3",children:Object.entries(m.TOKEN_PURCHASE_PRICES).filter(([e])=>"enterprise"!==e).map(([e,r])=>{let a=Y(r.tokens),s=J(r.price,r.tokens),n=F?.tab==="one-time"&&F.planKey===e,o="regular"===e,l=Math.max(0,(X-s)/X);return(0,t.jsxs)("button",{type:"button",onClick:()=>D({tab:"one-time",planKey:e}),className:`relative flex flex-col gap-2 rounded-lg border p-4 text-left transition-all hover:shadow-md ${n?"border-primary ring-primary/30 ring-2":"border-secondary/30 hover:border-primary/50"}`,"aria-pressed":n,children:[(0,t.jsx)("div",{className:"absolute -top-3 -left-3 rounded-full bg-white p-1 shadow-sm dark:bg-gray-900",children:(0,t.jsx)(b.default,{src:"/images/pax-token-icon.png",width:20,height:20,alt:"Token"})}),o&&(0,t.jsx)("div",{className:"absolute -top-3 left-1/2 z-10 -translate-x-1/2",children:(0,t.jsx)(i.Chip,{color:"primary",size:"sm",variant:"solid",children:K.mostPopular("Most Popular")})}),(0,t.jsxs)("div",{className:"font-semibold capitalize",children:[e," ",K.package("package")]}),(0,t.jsx)("div",{className:"text-primary text-lg font-bold",children:ee(r.price)}),(0,t.jsxs)("ul",{className:"list-disc space-y-0.5 pl-5 text-xs",children:[(0,t.jsxs)("li",{children:[W(a)," ",K.tokens("tokens")]}),(0,t.jsx)("li",{children:et(s)}),"basic"!==e&&(0,t.jsx)("li",{children:K.saveVsBasicSimple(`Save ${er(l)} vs Basic`,{pct:er(l)})})]})]},e)})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:K.oneTimePurchase("One-time purchase. Tokens never expire.")})]},"one-time")]})}),(0,t.jsxs)("div",{className:"flex items-start gap-2.5 rounded-lg border border-blue-500/15 bg-blue-500/5 px-3 py-2.5 text-xs",children:[(0,t.jsxs)("svg",{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-blue-500 dark:text-blue-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}
2),(0,t.jsxs)("p",{className:"text-foreground/60",children:[(0,t.jsx)("span",{className:"text-foreground/80 font-medium",children:K.whyTokensTitle("Why tokens?")})," ",K.whyTokensFirstSentence("Every game turn uses cutting-edge AI models that are expensive to run.")," ","(",(0,t.jsx)("a",{href:"https://paxhistoria.co/arena",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",children:K.whyTokensMoreInfo("more info")}),")"," ",K.whyTokensSecondSentence("Tokens help us cover these costs while keeping Pax Historia accessible and free to try.")]})]})]})}),(0,t.jsx)(c.ModalFooter,{children:(0,t.jsxs)("div",{className:"flex w-full flex-row justify-between gap-3",children:[(0,t.jsx)("div",{className:"hidden text-sm whitespace-nowrap sm:block",children:"patron"===R?(0,t.jsx)("div",{className:"font-medium",children:"$12/month"}):ep?(0,t.jsx)("div",{className:"",children:(0,t.jsxs)("span",{className:"font-medium",children:[ep.priceDisplay,(0,t.jsxs)(t.Fragment,{children:[" ","• ",W(ep.tokensCount),F?.tab==="subscribe"?" tokens/month":" tokens"]})]})}):(0,t.jsx)("div",{className:"",children:K.selectAPlan("Select a plan")})}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-end gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-1 text-xs whitespace-nowrap",children:[(0,t.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),K.securedByStripe("Secured by Stripe")]}),(0,t.jsx)(s.Button,{color:"primary",variant:"solid",isDisabled:"patron"===R?V:!F||G&&F?.tab==="subscribe"||V&&F?.tab==="patron",isLoading:N,onPress:em,children:"patron"===R?z?$?.startPaidTrial("Start paid trial")??"Start paid trial":K.checkout("Checkout"):K.continue("Continue")})]})]})})]})},"tokens-subscriptions-modal")}):null}let M=(0,a.createContext)(null);e.s(["TokensPurchaseModalProvider",0,function(e){let s,i,n,o,l,c=(0,r.c)(9),{children:d}=e,[u,h]=(0,a.useState)(!1),[m,p]=(0,a.useState)(void 0);c[0]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{p(e),h(!0)},c[0]=s):s=c[0];let b=s;c[1]===Symbol.for("react.memo_cache_sentinel")?(i=()=>h(!1),c[1]=i):i=c[1];let x=i;return c[2]===Symbol.for("react.memo_cache_sentinel")?(n={openTokensPurchase:b,closeTokensPurchase:x},c[2]=n):n=c[2],c[3]!==m||c[4]!==u?(o=u&&(0,t.jsx)(_,{isOpen:!0,onClose:x,initialTab:m}),c[3]=m,c[4]=u,c[5]=o):o=c[5],c[6]!==d||c[7]!==o?(l=(0,t.jsxs)(M.Provider,{value:n,children:[d,o]}),c[6]=d,c[7]=o,c[8]=l):l=c[8],l},"useTokensPurchaseModal",0,function(){let e=(0,a.useContext)(M);if(!e)throw Error("useTokensPurchaseModal must be used within TokensPurchaseModalProvider");return e}],270797)},437305,e=>{"use strict";var t=e.i(500932),r=e.i(271645);e.s(["BanApiError",0,class extends Error{banDetails;constructor(e,t){super(e),this.name="BanApiError",this.banDetails=t??null}},"useBanErrorHandler",0,function(){let e,a,s,i,n=(0,t.c)(6),[o,l]=(0,r.useState)(null),[c,d]=(0,r.useState)(!1);n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{d(!1),l(null)},n[0]=e):e=n[0];let u=e;n[1]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{if(e?.banDetails&&"object"==typeof e.banDetails){let t=e.banDetails;if(t.banType&&t.reason)return l(t),d(!0),!0}return!1},n[1]=a):a=n[1];let h=a;n[2]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{if(e&&"object"==typeof e&&"banDetails"in e){let t=e.banDetails;if(t&&"object"==typeof t&&t.banType&&t.reason)return l(t),d(!0),!0}return!1},n[2]=s):s=n[2];let m=s;return n[3]!==o||n[4]!==c?(i={banDetails:o,isBanModalOpen:c,closeBanModal:u,handleBanError:h,handleBanFromError:m},n[3]=o,n[4]=c,n[5]=i):i=n[5],i}])},834648,786479,611263,e=>{"use strict";var t=e.i(500932),r=e.i(271645),a=e.i(266027),s=e.i(954616),i=e.i(912598);e.i(151718);var n=e.i(770964),o=e.i(176009);e.i(436180);var l=e.i(970799),c=e.i(263802);function d(e){if(!e)return null;if("function"==typeof e?.toDate)try{let t=e.toDate();return t instanceof Date&&!Number.isNaN(t.getTime())?t:null}catch{return null}if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;let t="number"==typeof e?e:Date.parse(String(e));return Number.isFinite(t)?new Date(t):null}let u=async e=>{let t=(0,l.doc)(o.db,"userPublicProfiles",e),r=(await (0,c.getDoc)(t)).data();if(!r)throw Error("Profile not found");return{...r,createdAt:d(r.createdAt),lastActive:d(r.lastActive),...void 0!==r.lastClaimed?{lastClaimed:d(r.lastClaimed)}:{}}
2};e.s(["getUserPublicProfileFromFirebase",0,u],786479);var h=e.i(437305);let m=e=>["accountBans",e];async function p(){let e=await fetch("/api/account/bans"),t=await e.json();if(!t.success)throw Error(t.error);return t.data}async function b(e){let t=await fetch("/api/user/profile",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json().catch(()=>null);if(!t.ok||!r||!r.success){var a;let e,s;throw a=`Failed to update profile (${t.status})`,s="string"==typeof(e=r&&"object"==typeof r?r:{}).error?e.error:a,e.banDetails&&"object"==typeof e.banDetails?new h.BanApiError(s,e.banDetails):Error(s)}return r.data}async function x(e,t){let r=o.auth.currentUser;if(!r||r.uid!==e)return;let a={};if(void 0!==t.displayName&&(a.displayName=t.displayName),void 0!==t.photoURL&&(a.photoURL=t.photoURL||null),0!==Object.keys(a).length)try{await (0,n.updateProfile)(r,a)}catch(e){console.warn("Failed to refresh the Firebase Auth profile:",e)}}function f(e){let r,a=(0,t.c)(3),s=(0,i.useQueryClient)();return a[0]!==e||a[1]!==s?(r=t=>{t instanceof h.BanApiError&&s.invalidateQueries({queryKey:m(e)})},a[0]=e,a[1]=s,a[2]=r):r=a[2],r}function y(e){let r,a,n=(0,t.c)(6),o=(0,i.useQueryClient)(),l=f(e);return n[0]!==e||n[1]!==o?(r=t=>{o.setQueryData(["publicProfile",e],e=>e?{...e,...t}:e),x(e,t)},n[0]=e,n[1]=o,n[2]=r):r=n[2],n[3]!==l||n[4]!==r?(a={mutationFn:g,onSuccess:r,onError:l},n[3]=l,n[4]=r,n[5]=a):a=n[5],(0,s.useMutation)(a)}function g(e){return b(e)}function j(e,a){let s,i,n,o=(0,t.c)(5),l=(0,r.useRef)(null);return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>()=>{null!==l.current&&window.clearTimeout(l.current)},i=[],o[0]=s,o[1]=i):(s=o[0],i=o[1]),(0,r.useEffect)(s,i),o[2]!==a||o[3]!==e?(n=t=>{null!==l.current&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{l.current=null,e(t)},a)},o[2]=a,o[3]=e,o[4]=n):n=o[4],n}function v(e,t,r){return e===(t??"")||e===(r??"")}async function k(e){return{photoURL:(await b({photoURL:e})).photoURL??e}}e.s(["accountBansQueryKey",0,m,"useAccountBans",0,function(e,r){let s,i,n=(0,t.c)(5),o=e??"";n[0]!==o?(s=m(o),n[0]=o,n[1]=s):s=n[1];let l=r&&!!e;return n[2]!==s||n[3]!==l?(i={queryKey:s,queryFn:p,enabled:l,staleTime:3e5,gcTime:9e5,retry:1},n[2]=s,n[3]=l,n[4]=i):i=n[4],(0,a.useQuery)(i)}],611263),e.s(["useEditableDisplayName",0,function(e,a,s){let i,n,o,l=(0,t.c)(8),{mutate:c}=y(e),[d,u]=(0,r.useState)(a??""),[h,m]=(0,r.useState)(a);l[0]!==a||l[1]!==c?(i=e=>{let t=e.trim().slice(0,30),r=(a??"").trim();t&&t!==r&&c({displayName:t},{onError:()=>u(e=>e.trim().slice(0,30)===t?a??"":e)})},l[0]=a,l[1]=c,l[2]=i):i=l[2];let p=j(i,void 0===s?600:s);a!==h&&(m(a),v(d,h,a)&&u(a??"")),l[3]!==p?(n=e=>{u(e),p(e)},l[3]=p,l[4]=n):n=l[4];let b=n;return l[5]!==b||l[6]!==d?(o={value:d,setValue:b},l[5]=b,l[6]=d,l[7]=o):o=l[7],o},"useEditableTextField",0,function(e,a,s,i){let n,o,l,c=(0,t.c)(9),{mutate:d}=y(e),[u,h]=(0,r.useState)(s??""),[m,p]=(0,r.useState)(s);c[0]!==s||c[1]!==a||c[2]!==d?(n=e=>{let t=e.trim();if(t===(s??"").trim())return;let r="region"!==a||t?t:"World";d("region"===a?{region:r}:{profileDescription:r},{onError:()=>h(e=>e.trim()===t?s??"":e)})},c[0]=s,c[1]=a,c[2]=d,c[3]=n):n=c[3];let b=j(n,void 0===i?600:i);s!==m&&(p(s),v(u,m,s)&&h(s??"")),c[4]!==b?(o=e=>{h(e),b(e)},c[4]=b,c[5]=o):o=c[5];let x=o;return c[6]!==x||c[7]!==u?(l={value:u,setValue:x},c[6]=x,c[7]=u,c[8]=l):l=c[8],l},"useMutateUserPublicProfile",0,y,"useUpdateProfilePicture",0,function(e){let r,a,n=(0,t.c)(6),o=(0,i.useQueryClient)(),l=f(e);return n[0]!==e||n[1]!==o?(r=t=>{let{photoURL:r}=t;o.setQueryData(["publicProfile",e],e=>e?{...e,photoURL:r}:e),x(e,{photoURL:r})},n[0]=e,n[1]=o,n[2]=r):r=n[2],n[3]!==l||n[4]!==r?(a={mutationFn:k,onSuccess:r,onError:l},n[3]=l,n[4]=r,n[5]=a):a=n[5],(0,s.useMutation)(a)},"useUserPublicProfile",0,function(e,r){let s,i,n,o=(0,t.c)(8);o[0]!==e?(s=["publicProfile",e],i=()=>u(e),o[0]=e,o[1]=s,o[2]=i):(s=o[1],i=o[2]);let l=r?.enabled??!0,c=r?.select;return o[3]!==s||o[4]!==i||o[5]!==l||o[6]!==c?(n={queryKey:s,queryFn:i,staleTime:6e5,gcTime:9e5,retry:1,enabled:l,select:c},o[3]=s,o[4]=i,o[5]=l,o[6]=c,o[7]=n):n=o[7],(0,a.useQuery)(n)}],834648)},939701,e=>{"use strict";var t=e.i(273830),r=(0,e.i(950908).tv)({slots:{base:["group","relative","overflow-hidden","bg-content3 dark:bg-content2","pointer-events-none","before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dar
2k:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2","data-[loaded=true]:pointer-events-auto","data-[loaded=true]:overflow-visible","data-[loaded=true]:!bg-transparent","data-[loaded=true]:before:opacity-0 data-[loaded=true]:before:-z-10 data-[loaded=true]:before:animate-none","data-[loaded=true]:after:opacity-0"],content:["opacity-0","group-data-[loaded=true]:opacity-100"]},variants:{disableAnimation:{true:{base:"before:animate-none before:transition-none after:transition-none",content:"transition-none"},false:{base:"before:animate-shimmer transition-background !duration-300",content:"transition-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{}}),a=e.i(635809),s=e.i(75540),i=e.i(271645),n=e.i(595494),o=e.i(843476),l=(0,t.forwardRef)((e,l)=>{let{Component:c,children:d,getSkeletonProps:u,getContentProps:h}=function(e){var o,l;let c=(0,n.useProviderContext)(),[d,u]=(0,t.mapPropsVariants)(e,r.variantKeys),{as:h,children:m,isLoaded:p=!1,className:b,classNames:x,...f}=d,y=null!=(l=null!=(o=e.disableAnimation)?o:null==c?void 0:c.disableAnimation)&&l,g=(0,i.useMemo)(()=>r({...u,disableAnimation:y}),[(0,s.objectToDeps)(u),y,m]),j=(0,a.cn)(null==x?void 0:x.base,b);return{Component:h||"div",children:m,slots:g,classNames:x,getSkeletonProps:(e={})=>({"data-loaded":(0,s.dataAttr)(p),className:g.base({class:(0,a.cn)(j,null==e?void 0:e.className)}),...f}),getContentProps:(e={})=>({className:g.content({class:(0,a.cn)(null==x?void 0:x.content,null==e?void 0:e.className)})})}}({...e});return(0,o.jsx)(c,{ref:l,...u(),children:(0,o.jsx)("div",{...h(),children:d})})});l.displayName="HeroUI.Skeleton",e.s(["Skeleton",0,l],939701)}]);
3
4//# debugId=a8fad987-fb87-ace6-c6b5-70a10111034a

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.