PageSourceSearch

https://utmax.tech/_next/static/chunks/4630-4deb920964244f98.js

js utmax.tech collected 2026-10-02 02:08:33 UTC 84,176 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4630],{1777:(e,t,a)=>{a.d(t,{U:()=>c});var r=a(95155),n=a(47603),s=a(78890),i=a(29722),l=a(71548),o=a(38692),d=a(56290);function c({className:e,compact:t}){let{isDark:a,toggleTheme:u}=(0,l.D)(),x=(0,o.zh)({transform:a?"rotate(180deg) scale(1.1)":"rotate(0deg) scale(1)",config:{tension:300,friction:10,mass:1}});return(0,r.jsxs)("button",{type:"button",onClick:u,title:a?"Switch to light mode":"Switch to dark mode","aria-label":a?"Switch to light mode":"Switch to dark mode",className:(0,i.A)("inline-flex items-center justify-center gap-2 rounded-lg border transition-colors relative","border-slate-200 bg-white text-slate-700 hover:bg-slate-50 hover:text-slate-900","dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-white",t?"p-2.5":"px-3.5 py-2 text-sm font-semibold",e),children:[(0,r.jsx)(o.CS.div,{style:x,className:"flex items-center justify-center",children:a?(0,r.jsx)(d.$,{icon:n.A,className:"h-4 w-4"}):(0,r.jsx)(d.$,{icon:s.A,className:"h-4 w-4"})}),!t&&(0,r.jsx)("span",{children:a?"Light":"Dark"})]})}},29855:(e,t,a)=>{a.d(t,{rb:()=>u});var r=a(95155);function n({className:e}){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,"aria-hidden":"true",children:(0,r.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.451-6.231Zm-1.161 17.52h1.833L7.084 4.126H5.117l11.966 15.644Z"})})}function s({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,r.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,r.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"}),(0,r.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}function i({className:e}){return(0,r.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:e,"aria-hidden":"true",children:(0,r.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}function l({className:e}){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:e,"aria-hidden":"true",children:(0,r.jsx)("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"})})}function o({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("path",{fill:"#627EEA",d:"M12 1.5l6.3 10.35-6.3 3.72-6.3-3.72L12 1.5z",opacity:"0.85"}),(0,r.jsx)("path",{fill:"#627EEA",d:"M12 17.2l6.3-3.73L12 22.5l-6.3-9.03 6.3 3.43z",opacity:"0.65"}),(0,r.jsx)("path",{fill:"#FFFFFF",d:"M12 6.9v5l5.55-2.48L12 6.9z",opacity:"0.35"})]})}function d({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10.5",fill:"#1DB954"}),(0,r.jsx)("path",{fill:"#fff",d:"M17.4 10.1a.9.9 0 0 1-1.24.3c-2.44-1.49-6.15-1.93-9.03-1.06a.9.9 0 1 1-.52-1.72c3.31-1 7.5-.5 10.42 1.3.42.26.56.8.37 1.18zm-1.13 2.72a.75.75 0 0 1-1.03.25c-2.06-1.27-5.2-1.64-7.63
1-.9a.75.75 0 1 1-.44-1.44c2.83-.86 6.35-.44 8.77 1.05.35.22.46.68.33 1.04zm-1.06 2.63a.6.6 0 0 1-.83.2c-1.8-1.1-4.07-1.35-6.74-.74a.6.6 0 1 1-.27-1.17c2.92-.67 5.44-.38 7.47.86.28.17.37.55.2.85z"})]})}function c({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("path",{fill:"#F25022",d:"M2 2h9.5v9.5H2z"}),(0,r.jsx)("path",{fill:"#7FBA00",d:"M12.5 2H22v9.5h-9.5z"}),(0,r.jsx)("path",{fill:"#00A4EF",d:"M2 12.5h9.5V22H2z"}),(0,r.jsx)("path",{fill:"#FFB900",d:"M12.5 12.5H22V22h-9.5z"})]})}function u({provider:e,className:t="h-4 w-4"}){switch(e){case"x":return(0,r.jsx)(n,{className:t});case"google":return(0,r.jsx)(s,{className:t});case"github":return(0,r.jsx)(i,{className:t});case"discord":return(0,r.jsx)(l,{className:t});case"spotify":return(0,r.jsx)(d,{className:t});case"azure":return(0,r.jsx)(c,{className:t});case"wallet":return(0,r.jsx)(o,{className:t});case"email":return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:[(0,r.jsx)("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),(0,r.jsx)("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]});default:return null}}},60028:(e,t,a)=>{a.d(t,{AE:()=>u,EZ:()=>s,FA:()=>i,FN:()=>d,Gx:()=>l,N$:()=>n,Q8:()=>x,er:()=>o,ny:()=>c});var r=a(12115);let n="utmax:auth-changed",s="utmax:open-login",i="utmax:auth-complete";function l(){window.dispatchEvent(new CustomEvent(n))}function o(e){if(!e?.user)return null;let t=e.linkedAccounts.find(t=>t.provider===e.loginProvider)??e.linkedAccounts[0],a=t?.handle?.trim().replace(/^@/,"");return a?`@${a}`:e.user.email??e.user.name}function d(){(0,r.useEffect)(()=>{try{let e=new URLSearchParams(window.location.search);if("1"===e.get("auth_complete")){localStorage.setItem(i,String(Date.now())),e.delete("auth_complete");let t=e.toString();window.history.replaceState(null,"",`${window.location.pathname}${t?`?${t}`:""}`),window.close();return}}catch{}function e(e){e.key===i&&window.dispatchEvent(new CustomEvent(n))}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[])}function c(){window.dispatchEvent(new CustomEvent(s))}function u(e){let t=window.open(e,"utmax-oauth","width=540,height=760");return t?.focus(),t}function x(){let[e,t]=(0,r.useState)(null),[a,s]=(0,r.useState)(!0),[i,o]=(0,r.useState)(0),d=(0,r.useCallback)(()=>o(e=>e+1),[]);return(0,r.useEffect)(()=>{let e=!1,a={user:null,loginProvider:null,accounts:[],linkedAccounts:[]};return async function(){try{let r=await fetch("/api/auth/session",{cache:"no-store"}),n=r.ok?await r.json():a;e||t(n)}catch{e||t(a)}finally{e||s(!1)}}(),()=>{e=!0}},[i]),(0,r.useEffect)(()=>(window.addEventListener(n,d),()=>window.removeEventListener(n,d)),[d]),{session:e,loading:a,refresh:d,signOut:(0,r.useCallback)(async()=>{try{await fetch("/api/auth/signout",{method:"POST"})}finally{l()}},[])}}},64630:(e,t,a)=>{a.d(t,{AppHeader:()=>eQ});var r=a(95155),n=a(5772),s=a(73321),i=a(9751),l=a(82749),o=a(9005),d=a(50981),c=a(96304),u=a(90446),x=a(36619),h=a(17356),m=a(22200),p=a(32133),b=a(5736),f=a(96395),g=a(98500),w=a.n(g),k=a(12115),v=a(80642),y=a(46821),j=a(29722),N=a(33261),z=a(92571);let C="utmax-browser-id";var S=a(71899),E=a(48723);let A=null;function T({siteKey:e,onToken:t,resetSignal:a}){let n=(0,k.useRef)(null),s=(0,k.useRef)(null),i=(0,k.useRef)(t);return(0,k.useEffect)(()=>{i.current=t},[t]),(0,k.useEffect)(()=>{let t=!1;return(window.turnstile?Promise.resolve(window.turnstile):A||(A=new Promise((e,t)=>{let a=document.createElement("script");a.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",a.async=!0,a.dataset.utmaxTurnstile="true",a.onload=()=>{window.turnstile?e(window.turnstile):t(Error("turnstile script loaded without API"))},a.onerror=()=>{A=null,t(Error("failed to load turnstile script"))},document.head.appendChild(a)}))).then(a=>{t||!n.current||s.current||(s.current=a.render(n.current,{sitekey:e,theme:"auto",callback:e=>i.current(e),"expired-callback":()=>i.current(""),"error-callback":()=>i.current("")}))}).catch(()=>{}),()=>{if(t=!0,s.current){try{window.turnstile?.remove(s.current)}catch{}s.current=null}}},[e]),(0,k.useEffect)(()=>
1{if(0===a)return;let e=s.current;if(e)try{window.turnstile?.reset(e)}catch{}i.current("")},[a]),(0,r.jsx)("div",{ref:n,"data-turnstile-gate":"true",className:"flex justify-center"})}var L=a(47753);let $={initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.15}},transition:{duration:.2,ease:"easeOut"}},P=[{id:"instagram",label:"Instagram"},{id:"x",label:"X"}],M=[{value:"privacy",label:"Privacy"},{value:"hello",label:"Hello"},{value:"feedback",label:"Feedback"},{value:"bug-report",label:"Bug Report"}];function D({triggerless:e}={}){let[t,a]=(0,k.useState)(!1),[n,s]=(0,k.useState)("feedback"),[i,l]=(0,k.useState)(""),[d,c]=(0,k.useState)(""),[u,x]=(0,k.useState)(""),[h,m]=(0,k.useState)(""),[b,f]=(0,k.useState)(""),[g,w]=(0,k.useState)(""),[j,N]=(0,k.useState)(""),[A,I]=(0,k.useState)(!1),[_,F]=(0,k.useState)(null),[U,O]=(0,k.useState)(!1),R=(0,k.useId)(),W=(0,k.useRef)(null),B=(0,k.useRef)(null),H=(0,S.g)(t,W,B),[q,X]=(0,k.useState)(""),[Q,J]=(0,k.useState)(0),V=q.length>0,Z=(0,k.useCallback)(()=>{s("feedback"),l(""),c(""),x(""),m(""),f(""),w(""),N(""),F(null),O(!1),X(""),J(e=>e+1)},[]);(0,k.useEffect)(()=>{function e(e){let t=e.detail?.mode||"feedback";s(t),l(e.detail?.category||("error"===t?"bug-report":"")),c(e.detail?.hiddenLogs||""),m(e.detail?.message??("error"===t?"Error report.":"")),a(!0)}return window.addEventListener("utmax:open-feedback",e),window.addEventListener("utmax:open-contact",e),()=>{window.removeEventListener("utmax:open-feedback",e),window.removeEventListener("utmax:open-contact",e)}},[]);let G=(0,k.useCallback)(()=>{a(!1),I(!1)},[]);async function K(e){e.preventDefault(),F(null);let t=h.trim(),a=b.trim(),r=j.trim();if(!i)return void F("Choose a contact category.");if(!t)return void F("Please describe your feedback or issue.");if(!a&&!r)return void F("Enter your email or a social handle so we can follow up with you.");if(r&&!g)return void F("Choose a platform for your social handle.");I(!0);try{var s;let e=await fetch("/api/contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:i,name:u.trim(),message:t,email:a,socialPlatform:r?g:"",socialHandle:r,errorDetails:"error"===n&&d||void 0,clientMeta:(s=L.hl,{browserId:function(){try{let e=localStorage.getItem(C);if(e)return e;let t=crypto.randomUUID();return localStorage.setItem(C,t),t}catch{return"unavailable"}}(),submittedAt:new Date().toISOString(),pageUrl:window.location.href,referrer:document.referrer||"",userAgent:navigator.userAgent,language:navigator.language,languages:[...navigator.languages??[]],timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:navigator.platform,screen:`${window.screen.width}x${window.screen.height}`,viewport:`${window.innerWidth}x${window.innerHeight}`,devicePixelRatio:window.devicePixelRatio,colorScheme:document.documentElement.classList.contains("dark")||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"unknown",cookieEnabled:navigator.cookieEnabled,online:navigator.onLine,appVersion:s,appContext:function(){try{let e=localStorage.getItem("utmax-app");if(!e)return;let t=JSON.parse(e);return{savedScheduleCount:t.savedSchedules?.length??0,plannedCourseCount:t.plannedCourses?.length??0,courseCount:t.courses?.length??0,activeScheduleId:t.activeScheduleId??null,builderDraftActive:!!t.builderDraft}}catch{return}}()}),turnstileToken:q})}),l=await e.json();if(!e.ok){F(l.error||"Could not send feedback. Try again later."),X(""),J(e=>e+1);return}O(!0)}catch{F("Network error. Check your connection and try again."),X(""),J(e=>e+1)}finally{I(!1)}}return(0,k.useEffect)(()=>{if(!t)return;function e(e){"Escape"===e.key&&G()}document.addEventListener("keydown",e);let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=a}},[t,G]),(0,k.useEffect)(()=>{if(!t){let e=window.setTimeout(Z,300);return()=>window.clearTimeout(e)}},[t,Z]),(0,r.jsxs)(r.Fragment,{children:[!e&&(0,r.jsx)("button",{type:"button",onClick:()=>a(!0),className:"rounded-lg px-3 py-2 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-100 hover:text-max-primary dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-max-accent",children:"Feedback"}),H&&(0,r.jsxs)("div",{ref:W,className:"fixed inset-0 z-[300] flex items-end justify-center p-3 sm:items-center sm:p-4 opacity-0",role:"presentation",onMouseDown:e=>{e.target===e.currentTarget&&G()},children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[1px]","aria-hidden":!0,onMouseDown:G}),(0,r.jsxs)("div",{ref:B,role:"dialog","aria-modal":"true","aria-labelledby":R,className:"relative z-10 flex max-h-[92vh] w-full max-w-lg flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-2xl dark:border-slate-700 dark:bg-slate-900",children:[(0,r.jsxs)("div",{className:"flex shrink-0 items-start justify-between gap-3 border-b border-slate-200 px-4 py-3 dark:border-slate-700",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("h2",{id:R,className:"flex items-center gap-2 text-base font-semibold text-slate-900 dark:text-slate-100",children:[(0,r.jsx)(p.A,{className:"h-4 w-4 text-max-primary"}),"error"===n?"Oops we ran into an issue!":"Send feedback"]}),(0,r.jsx)("p",{className:"mt-0.5 text-xs app-muted",children:"error"===n?"Your error logs have been attached to this report automatically.":"Bug reports, ideas, or questions. We'll get back to you."})]}),(0,r.jsx)("button",{type:"button",onClick:G,className:"rounded-lg p-1.5 text-black hover:bg-gray-100 dark:text-white dark:hover:bg-gray-800","aria-label":"Close feedback form",children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})]}),U?(0,r.jsxs)("div",{className:"space-y-4 p-4",children:[(0,r.jsxs)("div",{className:"rounded-lg border border-green-300 bg-green-50 px-4 py-3 text-sm text-green-900 dark:border-green-700 dark:bg-green-950/40 dark:text-green-100",children:[(0,r.jsx)("p",{className:"font-semibold",children:"Thanks! Feedback sent."}),(0,r.jsx)("p",{className:"mt-1 text-xs",children:"We'll reach out using the contact info you provided."})]}),(0,r.jsx)("button",{type:"button",onClick:G,className:"w-full rounded-lg bg-max-primary px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition-all duration-300 hover:scale-[1.04] active:scale-[0.98] hover:bg-max-primary-dark",children:"Close"})]}):(0,r.jsxs)("form",{onSubmit:e=>void K(e),className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[(0,r.jsxs)("div",{className:"space-y-3 p-4",children:[(0,r.jsxs)("label",{className:"block",children:[(0,r.jsxs)("span",{className:"mb-1 block text-xs font-medium text-slate-900 dark:text-slate-100",children:["Name ",(0,r.jsx)("span",{className:"font-normal app-muted",children:"(optional)"})]}),(0,r.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),autoComplete:"name",className:"app-input",placeholder:"Your name"})]}),(0,r.jsxs)("label",{className:"block",children:[(0,r.jsxs)("span",{className:"mb-1 block text-xs font-medium text-slate-900 dark:text-slate-100",children:["Category ",(0,r.jsx)("span",{className:"text-max-primary",children:"*"})]}),(0,r.jsx)(E.A,{value:i,onChange:e=>
1l(e),options:[{value:"",label:"Choose a category"},...M]})]}),(0,r.jsxs)("label",{className:"block",children:[(0,r.jsxs)("span",{className:"mb-1 block text-xs font-medium text-slate-900 dark:text-slate-100",children:["error"===n?"Any additional context?":"Message","feedback"===n&&(0,r.jsx)("span",{className:"text-max-primary",children:" *"})]}),(0,r.jsx)("textarea",{value:h,onChange:e=>m(e.target.value),required:"feedback"===n,rows:4,className:"app-textarea",placeholder:"error"===n?"What were you trying to do?":"What happened? What were you trying to do?"})]}),(0,r.jsxs)("fieldset",{className:"rounded-lg border border-slate-200 p-3 dark:border-slate-700",children:[(0,r.jsxs)("legend",{className:"px-1 text-xs font-medium text-slate-900 dark:text-slate-100",children:["How can we reach you?"," ",(0,r.jsx)("span",{className:"text-max-primary",children:"*"})]}),(0,r.jsx)("p",{className:"mb-3 text-xs app-muted",children:"Email or at least one social handle is required."}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("label",{className:"block",children:[(0,r.jsx)("span",{className:"mb-1 block text-xs app-muted",children:"Email"}),(0,r.jsx)("input",{type:"email",value:b,onChange:e=>f(e.target.value),autoComplete:"email",className:"app-input",placeholder:"[email protected]"})]}),(0,r.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[7rem_1fr]",children:[(0,r.jsxs)("label",{className:"block",children:[(0,r.jsx)("span",{className:"mb-1 block text-xs app-muted",children:"Platform"}),(0,r.jsx)(E.A,{value:g,onChange:e=>w(e),options:[{value:"",label:"-"},...P.map(e=>({value:e.id,label:e.label}))]})]}),(0,r.jsxs)("label",{className:"block",children:[(0,r.jsx)("span",{className:"mb-1 block text-xs app-muted",children:"Handle / username"}),(0,r.jsx)("input",{type:"text",value:j,onChange:e=>N(e.target.value),className:"app-input",placeholder:"@username"})]})]})]})]}),_&&(0,r.jsx)("p",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-200",children:_})]}),(0,r.jsx)("div",{className:"mt-auto flex shrink-0 flex-col items-center justify-center border-t border-slate-200 p-4 dark:border-slate-700 min-h-[88px]",children:(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:V?(0,r.jsx)(y.P.div,{...$,className:"flex w-full gap-2",children:(0,r.jsx)("button",{type:"submit",disabled:A,className:"inline-flex flex-1 items-center justify-center gap-2 rounded-lg bg-max-primary px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition-all duration-300 hover:scale-[1.04] active:scale-[0.98] hover:bg-max-primary-dark disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100",children:A?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.A,{className:"h-4 w-4 animate-spin"}),"Sending..."]}):"error"===n?"Report issue":"Send feedback"})},"buttons"):(0,r.jsxs)(y.P.div,{...$,className:"flex w-full flex-col items-center justify-center gap-2",children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-slate-500 dark:text-slate-400",children:"Quick human check before sending"}),(0,r.jsx)(T,{siteKey:"0x4AAAAAAFFrbN2QT6tXZ0_h",onToken:X,resetSignal:Q})]},"captcha")})})]})]})]})]})}var I=a(1777),_=a(63187);function F(){let e=(0,k.useRef)(null);return(0,k.useEffect)(()=>{let t,a=0,r=!1;return async function(){try{let e=Date.now(),t=await fetch(`/api/time?_cb=${e}`,{cache:"no-store"});if(!t.ok)throw Error("Time API failed");let r=(await t.json()).time+900,n=Date.now();a=r-n+(n-e)/2}catch(e){console.error("Failed to sync UTMAX server time",e)}r||function n(){r||(e.current&&(e.current.textContent=new Date(Date.now()+a).toLocaleTimeString("en-US",{timeZone:"America/Chicago",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})),t=requestAnimationFrame(n))}()}(),()=>{r=!0,t&&cancelAnimationFrame(t)}},[]),(0,r.jsx)(_.K,{className:"flex items-center gap-2.5 px-3.5 py-1.5",children:(0,r.jsxs)("span",{className:"flex flex-col items-center leading-none",children:[(0,r.jsx)("span",{className:"text-xs font-bold uppercase tracking-[0.14em] text-max-primary/90 dark:text-max-primary-bright/90",children:"Campus Time"}),(0,r.jsx)("span",{ref:e,className:"mt-0.5 font-mono text-2xl font-semibold tracking-tight tabular-nums text-slate-800 dark:text-slate-100",children:"Syncing..."})]})})}var U=a(12363),O=a(88359),R=a(90175),W=a(29855),B=a(47650),H=a(60028),q=a(75796),X=a(31966),Q=a(47421),J=a(61491);function V({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 16 26",className:e,"aria-hidden":"true",children:[(0,r.jsx)("path",{fill:"#343434",d:"M8 0v9.55l7.46 3.33z"}),(0,r.jsx)("path",{fill:"#8C8C8C",d:"M8 0L.54 12.88 8 9.55z"}),(0,r.jsx)("path",{fill:"#3C3C3B",d:"M8 18.62V26l7.47-10.32z"}),(0,r.jsx)("path",{fill:"#8C8C8C",d:"M8 26v-7.38L.54 15.68z"}),(0,r.jsx)("path",{fill:"#141414",d:"M8 17.21l7.47-4.33L8 9.55z"}),(0,r.jsx)("path",{fill:"#393939",d:"M.54 12.88L8 17.21V9.55z"})]})}function Z({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"utmax-solana-grad",x1:"0",y1:"1",x2:"1",y2:"0",children:[(0,r.jsx)("stop",{offset:"0",stopColor:"#9945FF"}),(0,r.jsx)("stop",{offset:"1",stopColor:"#14F195"})]})}),(0,r.jsx)("path",{fill:"url(#utmax-solana-grad)",d:"M5.6 17.2c.2-.2.5-.3.8-.3h13c.5 0 .7.6.4 1l-2.2 2.2c-.2.2-.5.3-.8.3H4.6c-.5 0-.7-.6-.4-1zm0-13.3c.2-.2.5-.3.8-.3h13c.5 0 .7.6.4 1l-2.2 2.2c-.2.2-.5.3-.8.3H4.6c-.5 0-.7-.6-.4-1zm12.8 7.2c-.2-.2-.5-.3-.8-.3H4.6c-.5 0-.7.6-.4 1l2.2 2.2c.2.2.5.3.8.3h13c.5 0 .7-.6.4-1z"})]})}let G={MetaMask:"https://metamask.io/download/",Rabby:"https://rabby.io/","Coinbase Wallet":"https://www.coinbase.com/wallet/downloads",Trust:"https://trustwallet.com/download",Brave:"https://brave.com/wallet/"},K={Phantom:"https://phantom.app/download",Solflare:"https://solflare.com/download",Backpack:"https://backpack.app/download"};function Y(){return window.ethereum??null}async function ee(e={}){let t=e.wallet;if(t?.chain==="sol"&&t.provider)return void await ea(t.provider,e.onStep);let a=t?.provider&&"function"==typeof t.provider.request?t.provider:Y();if(!a)throw Error("No Web3 wallet found. Install MetaMask (metamask.io) or another browser wallet, then try again.");await et(a,e.onStep)}async function et(e,t){var a;t?.("connecting");let r=await e.request({method:"eth_requestAccounts"}),n=r?.[0];if(!n)throw Error("No account was selected in your wallet.");t?.("signing");let s=await fetch("/api/auth/siwe/nonce",{method:"POST"});if(!s.ok)throw Error("Could not start the wallet login. Try again.");let{nonce:i}=await s.json(),l=Number.parseInt(await e.request({method:"eth_chainId"}),16),o=(a={domain:window.location.host,address:n,uri:window.location.origin,chainId:Number.isFinite(l)&&l>0?l:1,nonce:i},[`${a.domain} wants you to sign in with your Ethereum account:`,a.address,"\nLogin to UTMAX — confirm control of your wallet to continue.\n",`URI: ${a.uri}`,"Version: 1",`Chain ID: ${a.chainId}`,`Nonce: ${a.nonce}`,`Issued At: ${new Date().toISOString()}`].join("\n")),d=await e.request({method:"personal_sign",params:["0x"+Array.from(new TextEncoder().encode(o),e=>e.toString(16).padStart(2,"0")).join(""),n]});t?.("verifying");let c=await fetch("/api/auth/siwe/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:o,signature:d,chain:"evm"})});if(!c.ok)throw Error(er((await c.json().catch(()=>({}))).error))}async function ea(e,t){var r;t?.("connecting");let n=await e.connect(),s=n?.publicKey?.toString();if(!s)throw Error("No account was selected in your wallet.");t?.("signing");let i=await fetch("/api/auth/siwe/nonce",{method:"POST"});if(!i.ok)throw Error("Could not start the wallet login. Try again.");let{nonce:l}=await i.json(),o=(r={domain:window.location.host,address:s,uri:window.location.origin,nonce:l},[`${r.domain} wants you to sign in with your Solana account:`,r.address,"\nLogin to UTMAX — confirm control of your wallet to continue.\n",`URI: ${r.uri}`,"Version: 1\nChain ID: 101",`Nonce: ${r.nonce}`,`Issued At: ${new Date().toISOString()}`].join("\n")),d=await e.signMessage(new TextEncoder().encode(o),"utf8"),c=d instanceof Uint8Array?d:d.signature;if(!c)throw Error("The wallet did not return a signature.");let{base58Encode:u}=await a.e(7014).then(a.bind(a,37014)),x=u(c);t?.("verifying");let h=await fetch("/api/auth/siwe/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:o,signature:x,chain:"sol"})});if(!h.ok)throw Error(er((await h.json().catch(()=>({}))).error))}
1function er(e){switch(e){case"invalid_nonce":case"domain_mismatch":case"expired":case"stale":return"That login attempt expired — try again.";case"signature_mismatch":return"The signature didn't match the request.";case"already_linked":return"This wallet is linked to a different account.";default:return"Wallet verification failed. Try again."}}function en(e){return/4001|user rejected|user denied|User denied/i.test(e)}var es=a(64577),ei=a(50825);let el={initial:{opacity:0,x:-32},animate:{opacity:1,x:0},exit:{opacity:0,x:28,transition:{duration:.15}},transition:{duration:.22,ease:"easeOut"}},eo={connecting:"Requesting accounts…",signing:"Approve in your wallet…",verifying:"Verifying signature…"};function ed({chain:e,className:t}){return"sol"===e?(0,r.jsx)(Z,{className:t}):(0,r.jsx)(V,{className:t})}function ec({onDone:e,onCancel:t,onError:a}){let[n,s]=(0,k.useState)(null),[i,l]=(0,k.useState)("evm"),[o,d]=(0,k.useState)(null),[c,u]=(0,k.useState)(null);async function x(t){if(t.provider&&!o){d(t.id),a("");try{await ee({onStep:u,wallet:t}),e()}catch(t){let e=t instanceof Error?t.message:"Wallet login failed";a(en(e)?"Wallet request was rejected.":e)}finally{d(null),u(null)}}}(0,k.useEffect)(()=>{let e,t=!1;return(e=new Map,new Promise(t=>{let a=t=>{let a=t.detail;a?.info?.name&&a.provider&&e.set(`evm:${a.info.uuid}`,{id:`evm:${a.info.name.toLowerCase().replace(/\s+/g,"-")}`,name:a.info.name,chain:"evm",provider:a.provider,icon:"string"==typeof a.info.icon&&a.info.icon?a.info.icon:void 0})};window.addEventListener("eip6963:announceProvider",a),window.dispatchEvent(new Event("eip6963:requestProvider"));let r=window,n=r.phantom?.solana;n&&e.set("sol:phantom",{id:"sol:phantom",name:"Phantom",chain:"sol",provider:n}),r.solflare&&e.set("sol:solflare",{id:"sol:solflare",name:"Solflare",chain:"sol",provider:r.solflare}),r.backpack&&e.set("sol:backpack",{id:"sol:backpack",name:"Backpack",chain:"sol",provider:r.backpack}),window.setTimeout(()=>{if(window.removeEventListener("eip6963:announceProvider",a),![...e.values()].some(e=>"evm"===e.chain)){let t=Y();if(t){let a=r.ethereum,n=a?.isRabby?"Rabby":a?.isCoinbaseWallet?"Coinbase Wallet":"Browser Wallet";e.set("evm:legacy",{id:"evm:legacy",name:n,chain:"evm",provider:t})}}for(let[t,a]of Object.entries(G)){let r=`evm:${t.toLowerCase().replace(/\s+/g,"-")}`;[...e.values()].some(e=>e.name===t)||e.set(r,{id:r,name:t,chain:"evm",installUrl:a})}for(let[t,a]of Object.entries(K))if(![...e.values()].some(e=>e.name===t)){let r=`sol:${t.toLowerCase()}`;e.set(r,{id:r,name:t,chain:"sol",installUrl:a})}t([...e.values()])},450)})).then(e=>{t||(s(e),!e.some(e=>"evm"===e.chain&&e.provider)&&e.some(e=>"sol"===e.chain&&e.provider)&&l("sol"))}),()=>{t=!0}},[]);let h=(n??[]).filter(e=>e.chain===i),m=h.filter(e=>e.provider);return c&&eo[c],(0,r.jsxs)(y.P.div,{...el,"data-testid":"wallet-picker",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button","data-wallet-back":"true",onClick:t,disabled:null!==o,className:"rounded-lg border-2 border-zinc-300 bg-white p-1.5 text-black transition hover:border-black dark:border-zinc-700 dark:bg-zinc-900 dark:text-white dark:hover:border-white disabled:opacity-40","aria-label":"Back to login options",children:(0,r.jsx)(X.A,{className:"h-4 w-4"})}),(0,r.jsx)("h3",{className:"text-sm font-black uppercase tracking-[0.15em] text-black dark:text-white",children:"Connect a wallet"})]}),(0,r.jsx)("div",{className:"mb-3 grid grid-cols-2 gap-2 rounded-xl border-2 border-zinc-200 bg-zinc-50 p-1 dark:border-zinc-800 dark:bg-zinc-900",children:["evm","sol"].map(e=>{let t=i===e;return(0,r.jsxs)("button",{type:"button","data-wallet-chain":e,onClick:()=>l(e),disabled:null!==o,className:(0,j.A)("flex items-center justify-center gap-2 rounded-lg px-3 py-2 text-sm font-bold transition",t?"bg-black text-white shadow-sm dark:bg-white dark:text-black":"text-zinc-700 hover:bg-zinc-200/70 dark:text-zinc-200 dark:hover:bg-zinc-800",null!==o&&!t&&"cursor-not-allowed opacity-50"),children:[(0,r.jsx)(ed,{chain:e,className:(0,j.A)("h-4 w-4",t&&"brightness-0 invert")}),"evm"===e?"Ethereum":"Solana"]},e)})}),(0,r.jsxs)("div",{className:"space-y-2","data-testid":"wallet-list",children:[null===n&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-1 py-3 text-sm font-semibold text-zinc-600 dark:text-zinc-300",children:[(0,r.jsx)(z.A,{className:"h-4 w-4 animate-spin"}),"Detecting wallets…"]}),null!==n&&0===m.length&&(0,r.jsxs)("p",{className:"px-1 pb-1 text-sm font-semibold text-zinc-700 dark:text-zinc-200",children:["No ","evm"===i?"Ethereum":"Solana"," wallets detected in this browser — install one below, then reopen this picker."]}),h.map(e=>
1{let t=o===e.id,a=null!==o&&o!==e.id||!e.provider;return(0,r.jsxs)("button",{type:"button","data-wallet-option":e.id,onClick:()=>void x(e),disabled:a,className:(0,j.A)("flex w-full items-center gap-3 rounded-xl border-2 px-3.5 py-3 text-left text-sm font-bold transition-all",e.provider?"glow-rainbow border-zinc-300 bg-white text-black hover:border-black hover:bg-zinc-100 dark:border-zinc-700 dark:bg-zinc-900 dark:text-white dark:hover:border-white dark:hover:bg-zinc-800":"cursor-default border-dashed border-zinc-300 bg-zinc-50 text-zinc-500 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-400",a&&e.provider&&"cursor-not-allowed opacity-40"),children:[e.icon?(0,r.jsx)("img",{src:e.icon,alt:"",className:"h-6 w-6 rounded"}):(0,r.jsx)(ed,{chain:e.chain,className:"h-5 w-5"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.name}),t?(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 text-xs font-bold",children:[(0,r.jsx)(z.A,{className:"h-3.5 w-3.5 animate-spin"}),c?eo[c].replace("…",""):"…"]}):e.provider?(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-1 rounded-full border-2 border-emerald-600/20 bg-emerald-50 px-2 py-0.5 text-[10px] font-black uppercase tracking-wider text-emerald-700 dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-300",children:[(0,r.jsx)(es.A,{className:"h-3 w-3"}),"Detected"]}):(0,r.jsxs)("a",{href:e.installUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"flex shrink-0 items-center gap-1 text-xs font-bold underline decoration-zinc-400 decoration-2 underline-offset-4 hover:text-black dark:hover:text-white",children:[(0,r.jsx)(ei.A,{className:"h-3.5 w-3.5"}),"Install"]})]},e.id)})]}),c&&(0,r.jsx)("p",{className:"mt-3 text-center text-xs font-bold uppercase tracking-[0.15em] text-zinc-700 dark:text-zinc-200",children:eo[c]})]})}let eu="0x4AAAAAAFFrbN2QT6tXZ0_h",ex="utmax:providers-cache-v1",eh={initial:{opacity:0,x:-32},animate:{opacity:1,x:0},exit:{opacity:0,x:28,transition:{duration:.15}},transition:{duration:.22,ease:"easeOut"}},em={initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-8,transition:{duration:.15}},transition:{duration:.2,ease:"easeOut"}},ep=[V,Z,function({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#F7931A"}),(0,r.jsx)("text",{x:"12",y:"17",textAnchor:"middle",fontSize:"13",fontWeight:"bold",fill:"#fff",fontFamily:"Arial, sans-serif",children:"₿"})]})},function({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#0052FF"}),(0,r.jsx)("rect",{x:"5",y:"10.5",width:"14",height:"3",rx:"1.5",fill:"#fff"})]})},function({className:e}){return(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:e,"aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#FF0420"}),(0,r.jsx)("text",{x:"12",y:"16.5",textAnchor:"middle",fontSize:"10",fontWeight:"bold",fill:"#fff",fontFamily:"Arial, sans-serif",children:"OP"})]})}];function eb({next:e,onAuthenticated:t}){let a=function(){try{let e=localStorage.getItem(ex);if(!e)return null;let t=JSON.parse(e);return Date.now()-t.at<3e5?t:null}catch{return null}}(),[n,s]=(0,k.useState)(a?.socialIds??R.D3),[i,l]=(0,k.useState)(a?.providers??R.rQ.map(e=>({...e,configured:"wallet"===e.id}))),[o,d]=(0,k.useState)(a?.emailConfigured??!1),[c,u]=(0,k.useState)("idle"),[x,h]=(0,k.useState)(""),[m,p]=(0,k.useState)(""),[b,f]=(0,k.useState)("idle"),[g,w]=(0,k.useState)(!1),[N,C]=(0,k.useState)(null),[S,E]=(0,k.useState)(null),[A,L]=(0,k.useState)(0),[$,P]=(0,k.useState)(0),[M,D]=(0,k.useState)(""),[I,_]=(0,k.useState)(0),F=(0,k.useRef)(null),U=(0,k.useRef)(null),O=M.length>0;(0,k.useEffect)(()=>{let e=!1;return(async()=>{try{let a=await fetch("/api/auth/providers",{cache:"no-store"});if(!a.ok)return;let r=await a.json();if(e)return;let n="supabase"===r.emailDelivery;l(r.providers),s(R.D3),d(n);var t={providers:r.providers,socialIds:R.D3,emailConfigured:n,at:Date.now()};try{localStorage.setItem(ex,JSON.stringify(t))}catch{}}catch{}})(),()=>{e=!0}},[]),(0,k.useEffect)(()=>
1{if(A<=0)return;let e=setInterval(()=>L(e=>Math.max(0,e-1)),1e3);return()=>clearInterval(e)},[A]),(0,k.useEffect)(()=>{let e=setInterval(()=>P(e=>(e+1)%ep.length),1800);return()=>clearInterval(e)},[]);let B=(0,k.useCallback)(()=>{(0,H.Gx)(),t()},[t]),V=(0,k.useCallback)(e=>{C(e),E(null),f("idle")},[]);async function Z(){if(!S){if(!O)return void V("Complete the captcha check first.");C(null),E("email");try{let e=await fetch("/api/auth/email/otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x,turnstileToken:M})}),t=await e.json().catch(()=>({}));if(!e.ok)throw"captcha_failed"===t.error&&(D(""),_(e=>e+1)),Error(ef(e.status,t.error));_(e=>e+1),u("code-sent"),L(30),setTimeout(()=>U.current?.focus(),80)}catch(e){V(e instanceof Error?e.message:"Could not send the code")}finally{E(null)}}}async function G(){if(!S){if(!O)return void V("Complete the captcha check first.");C(null),E("email");try{let e=await fetch("/api/auth/email/magic",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x,turnstileToken:M})}),t=await e.json().catch(()=>({}));if(!e.ok)throw"captcha_failed"===t.error&&(D(""),_(e=>e+1)),Error(ef(e.status,t.error));_(e=>e+1),u("magic-sent"),L(30)}catch(e){V(e instanceof Error?e.message:"Could not send the link")}finally{E(null)}}}async function K(){if(!S){C(null),E("email");try{let r=await fetch("/api/auth/email/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x,code:m})}),n=await r.json().catch(()=>({}));if(!r.ok){var e,t,a;throw Error((e=r.status,t=n.error,a=n.attemptsLeft,"invalid_code"===t?`Wrong code.${void 0!==a?` ${a} attempt${1===a?"":"s"} left.`:""}`:"otp_expired"===t?"That code expired — request a new one.":"email_in_use"===t?"That email belongs to a different account.":401===e?"Wrong code.":"Could not verify the code."))}B()}catch(e){V(e instanceof Error?e.message:"Could not verify the code")}finally{E(null)}}}let Y=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x.trim());return(0,r.jsxs)("div",{children:[N&&(0,r.jsx)("div",{role:"alert",className:"mb-5 flex items-start gap-2.5 rounded-xl border-2 border-red-300 bg-red-50 px-4 py-3 text-sm font-semibold text-red-800 dark:border-red-500/40 dark:bg-red-500/15 dark:text-red-200",children:N}),(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:g?(0,r.jsx)(y.P.div,{...eh,children:(0,r.jsx)(ec,{onDone:B,onCancel:()=>{w(!1),f("idle")},onError:function(e){e?V(en(e)?"Wallet request was rejected.":e):C(null)}})},"wallet-picker"):"idle"===c?(0,r.jsxs)(y.P.div,{...eh,className:"space-y-5",children:[(0,r.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[...n,"wallet"].filter(e=>"wallet"===e||i.find(t=>t.id===e)?.configured).map(t=>{let a,n="wallet"===t,s=i.find(e=>e.id===t),l=n?"idle"!==b:S===t,o=n?"idle"!==b||null!==S:null!==S&&!l;return(0,r.jsxs)("button",{type:"button","data-auth-provider":t,onClick:()=>n?void(!S&&(C(null),w(!0))):function(t){if(S)return;let a=i.find(e=>e.id===t);if(a&&!a.configured){var r;let e;return void V((r=t,e=R.rQ.find(e=>e.id===r),`${e?.label??r} login is not enabled yet — turn the ${e?.label??r} provider on in the Supabase dashboard (Authentication → Providers).`))}E(t),C(null);let n=`/api/auth/oauth/${t}?redirect_to=${encodeURIComponent(e)}`;(0,H.AE)(n)||window.location.assign(n)}(t),disabled:o,title:n?"Connect Wallet":s?.verb,className:(0,j.A)("glow-rainbow group flex items-center justify-center gap-2.5 rounded-xl border-2 px-3 py-3 text-sm font-bold transition-all","border-zinc-300 bg-white text-black","hover:border-black hover:bg-zinc-100","dark:border-zinc-700 dark:bg-zinc-900 dark:text-white","dark:hover:border-white dark:hover:bg-zinc-800",o&&"cursor-not-allowed opacity-40 hover:border-zinc-300 hover:bg-white dark:hover:border-zinc-700 dark:hover:bg-zinc-900"),children:[l?(0,r.jsx)(z.A,{className:"h-4 w-4 animate-spin text-black dark:text-white"}):n?(0,r.jsx)("span",{className:"relative flex h-5 w-5 items-center justify-center",children:(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:(0,r.jsx)(y.P.span,{initial:{opacity:0,scale:.4,rotate:-18}
1,animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:.4,rotate:18},transition:{duration:.3,ease:"easeOut"},className:"absolute inset-0 flex items-center justify-center",children:(a=ep[$],(0,r.jsx)(a,{className:"h-5 w-5"}))},$)})}):(0,r.jsx)(W.rb,{provider:t,className:"h-4 w-4"}),n?(0,r.jsx)("span",{children:l?"connecting"===b?"Requesting…":"signing"===b?"Check wallet…":"Verifying…":"Web3 Wallet"}):(0,r.jsxs)(r.Fragment,{children:["x"!==t&&(s?.label??t),"x"===t&&(0,r.jsx)("span",{className:"sr-only",children:s?.label??"X"})]})]},t)})}),(0,r.jsxs)("div",{className:"flex items-center gap-3","aria-hidden":"true",children:[(0,r.jsx)("div",{className:"h-px flex-1 bg-zinc-300 dark:bg-zinc-700"}),(0,r.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-[0.2em] text-zinc-800 dark:text-zinc-100",children:"or"}),(0,r.jsx)("div",{className:"h-px flex-1 bg-zinc-300 dark:bg-zinc-700"})]}),(0,r.jsxs)("div",{className:"rounded-xl border-2 border-zinc-200 bg-zinc-50 p-4 dark:border-zinc-800 dark:bg-zinc-900",children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-[11px] font-bold uppercase tracking-[0.15em] text-black dark:text-white",children:[(0,r.jsx)(q.A,{className:"h-3.5 w-3.5"}),"Email"]}),o?(0,r.jsxs)("div",{className:"flex gap-2.5",children:[(0,r.jsx)("input",{ref:F,type:"email",inputMode:"email",autoComplete:"email",placeholder:"[email protected]",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Y&&u("choose")},className:"min-w-0 flex-1 rounded-lg border-2 border-zinc-300 bg-white px-3 py-2.5 text-sm font-medium text-black placeholder:font-normal placeholder:text-zinc-400 focus:border-black focus:outline-none dark:border-zinc-700 dark:bg-zinc-950 dark:text-white dark:placeholder:text-zinc-500 dark:focus:border-white"}),(0,r.jsxs)("button",{type:"button","data-auth-email-continue":"true",onClick:()=>u("choose"),disabled:!Y,className:"glow-rainbow inline-flex shrink-0 items-center gap-1.5 rounded-lg bg-black px-4 py-2.5 text-sm font-bold text-white transition hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-40 dark:bg-white dark:text-black dark:hover:bg-zinc-200",children:["Continue",(0,r.jsx)(X.A,{className:"h-4 w-4 rotate-180"})]})]}):(0,r.jsx)("p",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:"Email login is not enabled on this deploy yet — turn the Email provider on in the Supabase dashboard (Authentication → Providers)."})]})]},"main"):(0,r.jsxs)(y.P.div,{initial:eh.initial,animate:eh.animate,exit:eh.exit,transition:eh.transition,className:"space-y-5",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{u("choose"===c?"idle":"choose"),p("")},className:"inline-flex items-center gap-1.5 text-xs font-bold text-zinc-800 transition hover:text-black dark:text-zinc-100 dark:hover:text-white",children:[(0,r.jsx)(X.A,{className:"h-4 w-4"}),"choose"===c?"Use a different method":"Code or Magic Link"]}),"choose"===c&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-extrabold tracking-tight text-black dark:text-white",children:"Code or Magic Link"}),(0,r.jsxs)("p",{className:"mt-1 text-sm font-medium text-zinc-800 dark:text-zinc-100",children:["How should we sign you in as"," ",(0,r.jsx)("span",{className:"font-bold text-black dark:text-white",children:x}),"?"]}),(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:O?(0,r.jsxs)(y.P.div,{...em,className:"mt-4 grid gap-3 sm:grid-cols-2",children:[(0,r.jsxs)("button",{type:"button","data-auth-send-email":"otp",onClick:Z,disabled:null!==S,className:(0,j.A)("glow-rainbow flex w-full items-start gap-3.5 rounded-xl border-2 border-zinc-300 bg-white px-4 py-4 text-left transition-all","hover:border-black hover:bg-zinc-50","dark:border-zinc-700 dark:bg-zinc-900 dark:hover:border-white",null!==S&&"cursor-not-allowed opacity-50"),children:[(0,r.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-black text-white dark:bg-white dark:text-black",children:"email"===S?(0,r.jsx)(z.A,{className:"h-5 w-5 animate-spin"}):(0,r.jsx)(Q.A,{className:"h-5 w-5"})}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block text-sm font-bold text-black dark:text-white",children:"Email me a 6-digit code"}),(0,r.jsx)("span",{className:"mt-0.5 block text-xs font-medium text-zinc-700 dark:text-zinc-200",children:"Fastest way in — type it right here."})]})]}),(0,r.jsxs)("button",{type:"button","data-auth-send-email":"magic",onClick:G,disabled:null!==S,className:(0,j.A)("glow-rainbow flex w-full items-start gap-3.5 rounded-xl border-2 border-zinc-300 bg-white px-4 py-4 text-left transition-all","hover:border-black hover:bg-zinc-50","dark:border-zinc-700 dark:bg-zinc-900 dark:hover:border-white",null!==S&&"cursor-not-allowed opacity-50"),children:[(0,r.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-black text-white dark:bg-white dark:text-black",children:(0,r.jsx)(J.A,{className:"h-5 w-5"})}),(0,r.jsxs)("span",{children:[(0,r.jsx)("span",{className:"block text-sm font-bold text-black dark:text-white",children:"Send a one-time magic link"}),(0,r.jsx)("span",{className:"mt-0.5 block text-xs font-medium text-zinc-700 dark:text-zinc-200",children:"Opens from your inbox — expires in 10 minutes."})]})]})]},"options"):(0,r.jsxs)(y.P.div,{...em,className:"mt-4",children:[(0,r.jsx)("p",{className:"mb-2 text-xs font-bold text-zinc-800 dark:text-zinc-100",children:"Qu
1ick human check — then pick how to sign in."}),(0,r.jsx)(T,{siteKey:eu,onToken:D,resetSignal:I})]},"captcha")})]}),"code-sent"===c&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-extrabold tracking-tight text-black dark:text-white",children:"Enter your code"}),(0,r.jsxs)("p",{className:"mt-1 text-sm font-medium text-zinc-800 dark:text-zinc-100",children:["Sent to"," ",(0,r.jsx)("span",{className:"font-bold text-black dark:text-white",children:x})]}),(0,r.jsxs)("div",{className:"mt-4 flex items-center gap-2.5",children:[(0,r.jsx)("input",{ref:U,type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,placeholder:"••••••",value:m,onChange:e=>p(e.target.value.replace(/\D/g,"").slice(0,6)),onKeyDown:e=>{"Enter"===e.key&&6===m.length&&K()},className:"w-44 rounded-lg border-2 border-zinc-300 bg-white px-3 py-3 text-center font-mono text-2xl font-bold tracking-[0.4em] text-black focus:border-black focus:outline-none dark:border-zinc-700 dark:bg-zinc-950 dark:text-white dark:focus:border-white"}),(0,r.jsxs)("button",{type:"button","data-auth-verify":"otp",onClick:K,disabled:6!==m.length||null!==S,className:"glow-rainbow inline-flex items-center gap-1.5 rounded-lg bg-black px-5 py-3 text-sm font-bold text-white transition hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-40 dark:bg-white dark:text-black dark:hover:bg-zinc-200",children:["email"===S?(0,r.jsx)(z.A,{className:"h-4 w-4 animate-spin"}):null,"Verify & log in"]})]}),(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:O?(0,r.jsx)(y.P.div,{...em,className:"mt-4",children:(0,r.jsx)("button",{type:"button",onClick:Z,disabled:A>0||null!==S,className:"text-xs font-bold text-zinc-800 underline decoration-zinc-500 decoration-2 underline-offset-4 transition hover:text-black disabled:opacity-40 dark:text-zinc-100 dark:hover:text-white",children:A>0?`Resend code in ${A}s`:"Resend code"})},"resend"):(0,r.jsxs)(y.P.div,{...em,className:"mt-4",children:[(0,r.jsx)("p",{className:"mb-2 text-xs font-bold text-zinc-800 dark:text-zinc-100",children:"One more human check to resend."}),(0,r.jsx)(T,{siteKey:eu,onToken:D,resetSignal:I})]},"captcha")})]}),"magic-sent"===c&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-lg font-extrabold tracking-tight text-black dark:text-white",children:"Check your inbox"}),(0,r.jsxs)("p",{className:"mt-2 text-sm font-semibold leading-relaxed text-zinc-900 dark:text-zinc-100",children:["Magic link sent to"," ",(0,r.jsx)("span",{className:"font-bold text-black dark:text-white",children:x})," — open it on this device to finish logging in. Links expire in 10 minutes."]}),(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:O?(0,r.jsx)(y.P.div,{...em,className:"mt-4",children:(0,r.jsx)("button",{type:"button",onClick:G,disabled:A>0||null!==S,className:"text-xs font-bold text-zinc-800 underline decoration-zinc-500 decoration-2 underline-offset-4 transition hover:text-black disabled:opacity-40 dark:text-zinc-100 dark:hover:text-white",children:A>0?`Resend link in ${A}s`:"Resend link"})},"resend"):(0,r.jsxs)(y.P.div,{...em,className:"mt-4",children:[(0,r.jsx)("p",{className:"mb-2 text-xs font-bold text-zinc-800 dark:text-zinc-100",children:"One more human check to resend."}),(0,r.jsx)(T,{siteKey:eu,onToken:D,resetSignal:I})]},"captcha")})]})]},c)})]})}function ef(e,t){return"rate_limited"===t?"Too many emails requested — try again in a few minutes.":"captcha_failed"===t?"Captcha verification failed — give it another go.":"invalid_email"===t||400===e?"That email address doesn't look right.":"Could not send the email. Try again shortly."}var eg=a(99314),ew=a(92e3),ek=a(52427),ev=a(66763),ey=a(65377),ej=a(51128),eN=a(7428),ez=a(51629);let eC=Object.fromEntries(R.rQ.map(e=>[e.id,e.label]));function eS(e){return e?eC[e]??e:"Unknown"}function eE(e){return R.rQ.some(t=>t.id===e)?e:null}
1let eA={idle:"Sync on",syncing:"Syncing…",synced:"Synced",error:"Sync error"};function eT(){let e=(0,k.useSyncExternalStore)(ez.s0,ez.OJ),t=eA[e.status]??"Sync on",a="synced"===e.status&&e.at?`Last synced ${new Date(e.at).toLocaleTimeString()}`:t;return(0,r.jsxs)("span",{"data-hub-sync-status":"true","data-sync-state":e.status,title:a,className:"inline-flex items-center gap-1.5 rounded-full border-2 border-zinc-200 bg-zinc-50 px-2.5 py-0.5 text-xs font-bold text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"error"===e.status?"h-2 w-2 rounded-full bg-red-500":"synced"===e.status?"h-2 w-2 rounded-full bg-emerald-500":"h-2 w-2 animate-pulse rounded-full bg-zinc-400"}),t]})}function eL({onAddEmail:e,onClosed:t}){let{session:a,loading:n,refresh:s,signOut:i}=(0,H.Q8)(),[l,o]=(0,k.useState)(null),[d,c]=(0,k.useState)(new Set),[u,x]=(0,k.useState)(null),[h,m]=(0,k.useState)(!1),[p,b]=(0,k.useState)(!1),[f,g]=(0,k.useState)(null),w=(0,k.useCallback)(async()=>{try{let e=await fetch("/api/user/stats",{cache:"no-store"});if(!e.ok)return;o(await e.json())}catch{}},[]);(0,k.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/auth/providers",{cache:"no-store"});if(!t.ok)return;let a=await t.json();if(e)return;let r=new Set;for(let e of a.providers)e.configured&&r.add(e.id);"supabase"===a.emailDelivery&&r.add("email"),c(r)}catch{}})(),()=>{e=!0}},[]),(0,k.useEffect)(()=>{w()},[w]),(0,k.useEffect)(()=>{function e(){w()}return window.addEventListener(H.N$,e),()=>window.removeEventListener(H.N$,e)},[w]);let v=(0,k.useSyncExternalStore)(ez.s0,ez.OJ),y=(0,k.useRef)(v.at);(0,k.useEffect)(()=>{"synced"===v.status&&y.current!==v.at&&(y.current=v.at,w())},[v.status,v.at,w]);let j=a?.user??null,N=a?.linkedAccounts??[],C=a?.loginProvider??null,S=new Set(N.map(e=>e.provider)),E=(0,H.er)(a),A=(0,k.useCallback)(e=>{let t=`/api/auth/oauth/${e}?link=1&redirect_to=${encodeURIComponent("/auth/link-complete")}`;(0,H.AE)(t)||window.location.assign(t)},[]),T=(0,k.useCallback)(()=>{g(null),m(!0)},[]),L=(0,k.useCallback)(e=>{g(e?en(e)?"Wallet request was rejected.":e:null),e||((0,H.Gx)(),s(),m(!1))},[s]),$=(0,k.useCallback)(async(e,t)=>{x(t),g(null);try{let t=await fetch("/api/auth/unlink",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})});if(!t.ok){let e=await t.json().catch(()=>({}));g("last_login"===e.error?"You can't remove your only login.":"Couldn't remove that login.");return}(0,H.Gx)(),s()}finally{x(null)}},[s]),P=(0,k.useCallback)(async()=>{await i(),t()},[i,t]);if(n||!j)return(0,r.jsx)("div",{className:"flex min-h-40 items-center justify-center",children:(0,r.jsx)(z.A,{className:"h-6 w-6 animate-spin text-black dark:text-white"})});let M=j.name.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""),D=[];for(let e of["google","github","discord","x","spotify","azure"])!S.has(e)&&e!==C&&d.has(e)&&D.push(e);!S.has("wallet")&&"wallet"!==C&&d.has("wallet")&&D.push("wallet"),!S.has("email")&&"email"!==C&&d.has("email")&&D.push("email");let I=N.find(e=>e.provider===C)?.handle??N.find(e=>e.handle)?.handle??null;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-4 border-b-2 border-zinc-200 pb-5 dark:border-zinc-800",children:[(0,r.jsxs)("span",{className:"relative shrink-0",children:[j.image?(0,r.jsx)("img",{src:j.image,alt:j.name,className:"h-14 w-14 rounded-full border-2 border-zinc-200 object-cover dark:border-zinc-700"}):(0,r.jsx)("span",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-black text-lg font-black text-white dark:bg-white dark:text-black",children:M||"?"}),C&&eE(C)&&(0,r.jsx)("span",{title:`Logged in with ${eS(C)}`,className:"absolute -bottom-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full border-2 border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-950",children:(0,r.jsx)(W.rb,{provider:eE(C),className:"h-3 w-3"})})]}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"truncate text-lg font-extrabold tracking-tight text-black dark:text-white",children:j.name}),(0,r.jsx)("p",{className:"truncate text-sm font-medium text-zinc-700 dark:text-zinc-200",children:E??j.email??"Wallet account"}),(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,r.jsx)(eT,{}),I&&(0,r.jsxs)("button",{type:"button","data-hub-copy-handle":"true",title:`Copy @${I.replace(/^@/,"")}`,onClick:()=>{navigator.clipboard?.writeText(`@${I.replace(/^@/,"")}`).then(()=>{b(!0),window.setTimeout(()=>b(!1),1600)}).catch(()=>{})},className:"inline-flex items-center gap-1.5 rounded-full border-2 border-zinc-200 bg-zinc-50 px-2.5 py-0.5 text-xs font-bold text-zinc-800 transition hover:border-black hover:text-black dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:hover:border-white dark:hover:text-white",children:[p?(0,r.jsx)(es.A,{className:"h-3 w-3"}):(0,r.jsx)(eg.A,{className:"h-3 w-3"}),p?"Copied!":`@${I.replace(/^@/,"")}`]}
1),C&&(0,r.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-bold text-zinc-800 dark:text-zinc-100",children:[eE(C)&&(0,r.jsx)(W.rb,{provider:eE(C),className:"h-3.5 w-3.5"}),"Logged in with ",eS(C)]})]})]})]}),(0,r.jsxs)("div",{className:"grid gap-x-8 sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"py-5",children:[(0,r.jsxs)("p",{className:"mb-2.5 text-[11px] font-bold uppercase tracking-[0.15em] text-black dark:text-white",children:["Linked logins \xb7 ",N.length]}),(0,r.jsx)("div",{className:"space-y-1.5",children:N.map(e=>{let t=eE(e.provider),a=e.handle?`@${e.handle.replace(/^@/,"")}`:e.email?e.email:e.displayName?e.displayName.length>20?`${e.displayName.slice(0,10)}…${e.displayName.slice(-8)}`:e.displayName:null,n=e.provider===C;return(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border-2 border-zinc-200 px-3 py-2.5 dark:border-zinc-800",children:[e.image?(0,r.jsxs)("span",{className:"relative shrink-0",children:[(0,r.jsx)("img",{src:e.image,alt:e.displayName??eS(e.provider),className:"h-9 w-9 rounded-full border-2 border-zinc-200 object-cover dark:border-zinc-700"}),t&&(0,r.jsx)("span",{title:eS(e.provider),className:"absolute -bottom-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-950",children:(0,r.jsx)(W.rb,{provider:t,className:"h-2.5 w-2.5"})})]}):(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 border-zinc-200 bg-zinc-100 dark:border-zinc-700 dark:bg-zinc-800",children:t&&(0,r.jsx)(W.rb,{provider:t,className:"h-4 w-4"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"flex items-center gap-2 truncate text-sm font-bold text-black dark:text-white",children:[eS(e.provider),n&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-black px-2 py-0.5 text-[9px] font-black uppercase tracking-wider text-white dark:bg-white dark:text-black",children:[(0,r.jsx)(es.A,{className:"h-2.5 w-2.5"})," Active"]})]}),a&&(0,r.jsx)("p",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-200",children:e.profileUrl?(0,r.jsx)("a",{href:e.profileUrl,target:"_blank",rel:"noopener noreferrer",className:"underline decoration-zinc-400 decoration-2 underline-offset-4 transition hover:text-black dark:hover:text-white",children:a}):a})]}),u===e.provider?(0,r.jsx)(z.A,{className:"h-4 w-4 shrink-0 animate-spin text-black dark:text-white"}):(0,r.jsx)("button",{type:"button","data-hub-unlink":e.provider,onClick:()=>{let t=eE(e.provider);t&&$(e.id,t)},disabled:N.length<=1,title:N.length<=1?"You can't remove your only login":`Unlink ${eS(e.provider)}`,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-zinc-700 transition hover:bg-zinc-100 hover:text-black disabled:cursor-not-allowed disabled:opacity-30 dark:text-zinc-200 dark:hover:bg-zinc-800 dark:hover:text-white",children:(0,r.jsx)(ew.A,{className:"h-3.5 w-3.5"})})]},e.id)})})]}),(0,r.jsxs)("div",{className:"sm:border-l-2 sm:border-zinc-200 sm:pl-8 dark:sm:border-zinc-800",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2.5 pt-5",children:[(0,r.jsx)(e$,{icon:ek.A,label:"Calendars created",value:l?.calendars??0}),(0,r.jsx)(e$,{icon:ev.A,label:"Preferences set",value:l?.preferences??0}),(0,r.jsx)(e$,{icon:ey.A,label:"Searches saved",value:l?.urls??0}),(0,r.jsx)(e$,{icon:ej.A,label:"Logins linked",value:N.length})]}),(0,r.jsxs)("div",{className:"pt-5",children:[(0,r.jsx)("p",{className:"mb-2.5 text-[11px] font-bold uppercase tracking-[0.15em] text-black dark:text-white",children:"Add a login"}),(0,r.jsxs)("p",{className:"mb-3 text-xs font-medium leading-relaxed text-zinc-700 dark:text-zinc-200",children:[C?(0,r.jsxs)(r.Fragment,{children:["You're logged in with"," ",(0,r.jsx)("span",{className:"font-bold text-black dark:text-white",children:eS(C)}),". Link another login and it signs into this same account — schedules, preferences and recents follow you across all of them."]}):(0,r.jsx)(r.Fragment,{children:"Link another login and it signs into this same account — schedules, preferences and recents follow you across all of them."})," ","If a login you add already belongs to another UTMAX account, we'll ask before merging that account's saved data into this one."]}),D.length?(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:D.map(t=>(0,r.jsxs)("button",{type:"button","data-hub-link":t,onClick:()=>{"wallet"===t?T():"email"===t?e():A(t)},disabled:null!==u,className:"glow-rainbow inline-flex items-center gap-2 rounded-lg border-2 border-zinc-300 bg-white px-3 py-2 text-xs font-bold text-black transition hover:border-black hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-40 dark:border-zinc-700 dark:bg-zinc-900 dark:text-white dark:hover:border-white",children:[eE(t)&&(0,r.jsx)(W.rb,{provider:eE(t),className:"h-3.5 w-3.5"}),`Add ${eS(t)}`]},t))}):(0,r.jsx)("p",{className:"text-xs font-semibold text-zinc-800 dark:text-zinc-100",children:"Every available login is already linked."}),h&&(0,r.jsx)("div",{className:"mt-4 rounded-xl border-2 border-zinc-200 bg-zinc-50 p-4 dark:border-zinc-800 dark:bg-zinc-900",children:(0,r.jsx)(ec,{onDone:()=>L(""),onCancel:()=>m(!1),onError:L})}),f&&(0,r.jsx)("p",{className:"mt-3 rounded-lg border-2 border-red-600/60 bg-red-50 px-3 py-2 text-xs font-semibold text-red-700 dark:bg-red-950/40 dark:text-red-300",children:f})]})]})]}),(0,r.jsx)("div",{className:"border-t-2 border-zinc-200 pt-5 dark:border-zinc-800",children:(0,r.jsxs)("button",{type:"button","data-hub-signout":"true",onClick:()=>void P(),className:"flex w-full items-center justify-center gap-2 rounded-xl border-2 border-black bg-transparent px-4 py-3 text-sm font-bold text-black transition hover:bg-black hover:text-white dark:border-white dark:text-white dark:hover:bg-white dark:hover:text-black",children:[(0,r.jsx)(eN.A,{className:"h-4 w-4"}),"Sign out"]})})]})}function e$({icon:e,label:t,value:a}){return(0,r.jsxs)("div",{className:"rounded-xl border-2 border-zinc-200 bg-zinc-50 px-3 py-3.5 text-center dark:border-zinc-800 dark:bg-zinc-900",children:[(0,r.jsx)(e,{className:"mx-auto h-4 w-4 text-black dark:text-white"}),(0,r.jsx)("p",{className:"mt-1.5 text-2xl font-black tabular-nums tracking-tight text-black dark:text-white",children:a}),(0,r.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-zinc-700 dark:text-zinc-200",children:t})]})}function eP(){let[e,t]=(0,k.useState)(!1),[a,n]=(0,k.useState)("/"),[s,i]=(0,k.useState)("auto"),[l,d]=(0,k.useState)(null),[c,u]=(0,k.useState)(0);(0,k.useEffect)(()=>{function e(){var e;n(!(e=`${window.location.pathname}${window.location.search}`).startsWith("/")||e.startsWith("//")?"/":e),i("auto"),d(null),t(!0)}return window.addEventListener(H.EZ,e),()=>window.removeEventListener(H.EZ,e)},[]),(0,k.useEffect)(()=>
1{if(e)return window.addEventListener(H.N$,t),()=>window.removeEventListener(H.N$,t);function t(){u(e=>e+1)}},[e]);let x=(0,k.useCallback)(()=>t(!1),[]);(0,k.useEffect)(()=>{if(!e)return;let t=!1;return d(null),(async()=>{try{let e=await fetch("/api/auth/session",{cache:"no-store"}),a=await e.json();t||d(!!a?.user)}catch{t||d(!1)}})(),()=>{t=!0}},[e,c]),(0,k.useEffect)(()=>{if(e)return document.addEventListener("keydown",t),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=""};function t(e){"Escape"===e.key&&x()}},[e,x]);let h=e&&"auto"===s&&!0===l,m=e&&("login"===s||!1===l);return"u"<typeof document?null:(0,B.createPortal)((0,r.jsx)(v.N,{children:e&&(0,r.jsx)(y.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},"data-login-overlay":"true",className:"fixed inset-0 z-[10000] overflow-y-auto bg-zinc-950/80 backdrop-blur-md",onClick:x,children:(0,r.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-4 sm:p-8",children:(0,r.jsxs)(y.P.div,{initial:{opacity:0,scale:.96,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.97,y:8},transition:{duration:.18,ease:"easeOut"},role:"dialog","aria-modal":"true","aria-label":h?"Account hub":"Login to UTMAX",onClick:e=>e.stopPropagation(),className:"relative w-full max-w-3xl overflow-hidden rounded-3xl border-2 border-zinc-200 bg-white shadow-2xl shadow-zinc-950/60 dark:border-zinc-800 dark:bg-zinc-950",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-7 pt-6",children:[(0,r.jsx)("h2",{className:"text-lg font-extrabold tracking-tight text-black dark:text-white",children:h?"Your account":"Login"}),(0,r.jsx)("button",{type:"button","data-login-close":"true",onClick:x,"aria-label":"Close",className:"-mr-2 rounded-lg p-2 text-zinc-600 transition hover:bg-zinc-100 hover:text-black dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-white",children:(0,r.jsx)(o.A,{className:"h-5 w-5"})})]}),(0,r.jsx)("div",{className:"px-7 pb-7 pt-6",children:h?(0,r.jsx)(eL,{onAddEmail:()=>i("login"),onClosed:x}):m?(0,r.jsx)(eb,{next:a,onAuthenticated:()=>{i("auto"),u(e=>e+1)}}):(0,r.jsx)("div",{className:"flex min-h-40 items-center justify-center",children:(0,r.jsx)("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-zinc-300 border-t-black dark:border-t-white"})})})]})})},"login-overlay")}),document.body)}let eM=Object.fromEntries(R.rQ.map(e=>[e.id,e.label]));function eD(e){return R.rQ.some(t=>t.id===e)?e:null}function eI(){let{session:e,loading:t}=(0,H.Q8)(),[a,n]=function(e){let[t,a]=(0,k.useState)(e);return[t,(0,k.useCallback)(e=>{a(e),e&&setTimeout(()=>a(null),6e3)},[])]}(function(){let[e,t]=(0,k.useState)(null);return(0,k.useEffect)(()=>{try{let e=new URLSearchParams(window.location.search),a=e.get("auth_error");if(!a){if(e.get("code")&&!e.get("flow")){t(`Sign-in finished but the callback URL isn't allowlisted for this domain. In Supabase → Authentication → URL Configuration → Redirect URLs, add: ${window.location.origin}/api/auth/callback/** — then log in again.`),e.delete("code");let a=e.toString();window.history.replaceState(null,"",`${window.location.pathname}${a?`?${a}`:""}`)}return}t({provider_not_configured:"That login method isn't set up on this deploy yet.",invalid_state:"That login attempt expired — please try again.",missing_params:"The login provider didn't complete the handshake.",oauth_failed:"Login failed — please try again.",already_linked:"That login is already linked to a different account.",email_in_use:"That email belongs to a different account. Log in with email to link it.",invalid_link:"That link expired or was already used."}[a]??"Something went wrong logging in."),e.delete("auth_error");let r=e.toString();window.history.replaceState(null,"",`${window.location.pathname}${r?`?${r}`:""}`)}catch{}},[]),e}());(0,H.FN)();let s=e?.user??null,i=e?.accounts??[],l=e?.loginProvider??null,o=e?.linkedAccounts??[],d=o.find(e=>e.provider===l)?.handle??o.find(e=>e.handle)?.handle??null,c=d?`@${d.replace(/^@/,"")}`:s?.email??`${i.length} login${1===i.length?"":"s"}
1 linked`,u=(0,H.er)(e),x=(s?.name??"?").split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join("");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"relative",children:t?(0,r.jsx)("div",{"aria-hidden":"true",className:"h-10 w-24 animate-pulse rounded-lg bg-slate-200/70 dark:bg-slate-800/70"}):s?(0,r.jsxs)("button",{type:"button","data-user-menu":"chip",onClick:H.ny,title:`${s.name} — open account hub`,className:(0,j.A)("flex max-w-[13rem] items-center gap-2 rounded-lg border py-1.5 pl-1.5 pr-2 transition-colors","border-slate-200 bg-white hover:bg-slate-50","dark:border-slate-700 dark:bg-slate-800 dark:hover:bg-slate-700"),children:[(0,r.jsxs)("span",{className:"relative inline-flex",children:[(0,r.jsx)(e_,{user:s,initials:x}),l&&(0,r.jsx)("span",{title:`Logged in with ${!l?"Unknown":eM[l]??l}`,className:"absolute -bottom-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900",children:eD(l)&&(0,r.jsx)(W.rb,{provider:eD(l),className:"h-2.5 w-2.5"})})]}),(0,r.jsxs)("span",{className:"hidden min-w-0 flex-col items-start leading-tight sm:flex",children:[(0,r.jsx)("span",{className:"max-w-[8.5rem] truncate text-xs font-bold",children:u??s.name}),(0,r.jsx)("span",{className:"max-w-[8.5rem] truncate text-[10px] font-medium text-slate-500 dark:text-slate-400",children:c})]}),(0,r.jsx)(U.A,{className:"h-3.5 w-3.5 shrink-0 text-slate-400"})]}):(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("div",{"data-user-menu":"guest",title:"You're browsing as a guest",className:"hidden items-center gap-1.5 rounded-lg border border-dashed border-slate-300 px-2.5 py-1.5 text-xs font-semibold text-slate-500 sm:flex dar
1k:border-slate-600 dark:text-slate-400",children:[(0,r.jsx)(O.A,{className:"h-3.5 w-3.5"}),"Guest"]}),(0,r.jsx)("button",{type:"button","data-user-menu":"login-now",onClick:H.ny,className:"inline-flex items-center gap-1.5 rounded-lg bg-max-primary px-3 py-1.5 text-xs font-bold text-white shadow-sm shadow-max-primary/20 transition hover:bg-max-primary-dark focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-max-primary/40",children:"Login Now"})]})}),(0,r.jsx)(v.N,{children:a&&(0,r.jsx)(y.P.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:12},role:"status",className:"fixed bottom-5 left-1/2 z-[10001] -translate-x-1/2 rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-xs font-semibold text-slate-800 shadow-xl dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100",children:a},"auth-toast")}),(0,r.jsx)(eP,{})]})}function e_({user:e,initials:t,size:a="sm"}){let n="lg"===a?"h-10 w-10 text-sm":"h-7 w-7 text-[10px]";return e.image?(0,r.jsx)("img",{src:e.image,alt:e.name,className:(0,j.A)("shrink-0 rounded-full border border-slate-200 object-cover dark:border-slate-700",n)}):(0,r.jsx)("span",{"aria-hidden":"true",className:(0,j.A)("flex shrink-0 items-center justify-center rounded-full bg-max-primary font-black text-white",n),children:t||(0,r.jsx)(O.A,{className:"h-4 w-4"})})}var eF=a(1792),eU=a(28674),eO=a(62338),eR=a(31408),eW=a(56290),eB=a(48164);function eH(){let{isMissing:e}=(0,eU.Z)();return e?(0,r.jsxs)("a",{href:eF.Ul,target:"_blank",rel:"noopener noreferrer",className:"hidden items-center gap-1.5 rounded-lg border border-orange-300 bg-orange-100 px-3 py-1.5 text-xs font-bold text-orange-800 shadow-sm transition-colors hover:bg-orange-200 hover:text-orange-950 dar
1k:border-orange-500/40 dark:bg-orange-500/10 dark:text-orange-300 dark:hover:border-orange-500/60 dark:hover:bg-orange-500/20 xl:inline-flex",children:["Install extension",(0,r.jsx)(eW.$,{icon:i.A,className:"h-3.5 w-3.5"})]}):null}function eq({open:e,onClose:t}){let{isMissing:a}=(0,eU.Z)(),[n,s]=(0,k.useState)("idle");async function c(){if(s("opening"),!a)try{if(await (0,eB.openLoginTabViaExtension)())return void s("opened")}catch{}window.open("https://utdirect.utexas.edu/registration/chooseSemester.WBX","_blank","noopener,noreferrer"),s("opened")}return((0,k.useEffect)(()=>{e||s("idle")},[e]),e)?(0,r.jsx)("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[10000] flex items-center justify-center bg-slate-950/70 p-4 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"w-full max-w-md overflow-hidden rounded-2xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-slate-900 text-slate-900 dark:text-white",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 border-b border-slate-200 pb-4 dark:border-slate-800",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-slate-100 text-slate-900 dark:bg-slate-800 dark:text-white",children:(0,r.jsx)(l.A,{className:"h-5 w-5 stroke-[2.5]"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-base font-bold text-slate-900 dark:text-white",children:"Live Seat Sync & Login"}),(0,r.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"UT Direct live course availability"})]})]}),(0,r.jsx)("button",{type:"button",onClick:t,className:"rounded-lg p-1.5 text-slate-500 hover:bg-slate-100 dark:hover:bg-slate-800",children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"space-y-4 py-4",children:[(0,r.jsx)("p",{className:"text-xs leading-relaxed text-slate-600 dark:text-slate-300",children:"Sign in to UT Direct with your EID + Duo 2-Factor Authentication. The UTMAX browser extension will automatically capture live section seats and sync your registration schedule in real-time."}),a?(0,r.jsxs)("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-3 text-xs text-slate-700 dark:border-slate-800 dark:bg-slate-800/60 dark:text-slate-300 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 font-bold text-slate-900 dark:text-white",children:[(0,r.jsx)(d.A,{className:"h-4 w-4 text-slate-900 dark:text-white"}),"UTMAX Browser Extension Recommended"]}),(0,r.jsx)("p",{className:"text-[11px] text-slate-600 dark:text-slate-400",children:"Install the extension to enable automatic background live seat scraping and one-click schedule importing directly on UT Direct."}),(0,r.jsxs)("a",{href:eF.Ul,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-bold text-slate-900 dark:text-white underline hover:opacity-80",children:["Install Chrome Extension ",(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"})]})]}):(0,r.jsxs)("div",{className:"rounded-xl border border-emerald-200 bg-emerald-50/80 p-3 text-xs text-emerald-900 dark:border-emerald-800/50 dark:bg-emerald-950/30 dark:text-emerald-200 flex items-center gap-2.5",children:[(0,r.jsx)(d.A,{className:"h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400"}),(0,r.jsx)("span",{children:"UTMAX Browser Extension is connected and active."})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2.5 border-t border-slate-200 pt-4 dark:border-slate-800",children:[(0,r.jsx)("button",{type:"button",onClick:t,className:"rounded-lg px-3.5 py-2 text-xs font-semibold text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:"Close"}),(0,r.jsxs)("button",{type:"button",onClick:c,disabled:"opening"===n,className:"inline-flex items-center gap-2 rounded-lg bg-slate-900 px-4 py-2 text-xs font-bold text-white shadow-sm transition hover:bg-slate-800 dark:bg-white dark:text-slate-900 dark:hover:bg-slate-100 disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,r.jsx)(l.A,{className:`h-3.5 w-3.5 ${"opening"===n?"animate-spin":""}`}),"opening"===n?"Opening...":"opened"===n?"Re-open Login Tab":"Log In to UT Direct"]})]})]})}):null}function eX(){let[e,t]=(0,k.useState)(!1),a=(0,k.useRef)(null),{authStatus:n}=(0,eO.n)(),{advancedView:s,setAdvancedView:i}=(0,eR.H)(),g=n?.loggedIn===!0;return(0,k.useEffect)(()=>
1{if(e)return document.addEventListener("mousedown",r),document.addEventListener("keydown",n),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",n)};function r(e){a.current&&!a.current.contains(e.target)&&t(!1)}function n(e){"Escape"===e.key&&t(!1)}},[e]),(0,r.jsxs)("div",{ref:a,className:"relative",children:[(0,r.jsx)("button",{id:"hamburger-menu-button","data-demo-target":"hamburger-menu-button",type:"button",onClick:()=>t(e=>!e),"aria-label":e?"Close menu":"Open menu","aria-expanded":e,className:(0,j.$)("inline-flex items-center justify-center rounded-lg border transition-colors","border-slate-200 bg-white text-slate-700 hover:bg-slate-50 hover:text-slate-900","dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-white","p-2.5"),children:(0,r.jsx)(v.N,{mode:"wait",initial:!1,children:e?(0,r.jsx)(y.P.span,{initial:{rotate:-90,opacity:0},animate:{rotate:0,opacity:1},exit:{rotate:90,opacity:0},transition:{duration:.15},className:"flex",children:(0,r.jsx)(o.A,{className:"h-4 w-4"})},"close"):(0,r.jsx)(y.P.span,{initial:{rotate:90,opacity:0},animate:{rotate:0,opacity:1},exit:{rotate:-90,opacity:0},transition:{duration:.15},className:"flex",children:(0,r.jsx)(c.A,{className:"h-4 w-4"})},"menu")})}),(0,r.jsx)(v.N,{children:e&&(0,r.jsxs)(y.P.div,{initial:{opacity:0,y:-8,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.97},transition:{duration:.18,ease:"easeOut"},"data-demo-target":"hamburger-menu",className:(0,j.$)("absolute right-0 top-full z-[9999] mt-2 w-72 origin-top-right overflow-hidden","rounded-xl border shadow-lg","border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900"),children:[(0,r.jsx)("div",{className:"border-b border-slate-200 px-3 py-3 dark:border-slate-700",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg px-1 text-sm font-semibold text-slate-900 dark:text-white",children:[(0,r.jsx)("span",{children:"Advanced View"}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":s,"aria-label":"Advanced View",onClick:()=>i(!s),className:(0,j.$)("relative h-6 w-11 shrink-0 overflow-hidden rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-max-primary focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-900",s?"bg-max-primary":"bg-slate-300 dark:bg-slate-700"),children:(0,r.jsx)("span",{className:(0,j.$)("pointer-events-none absolute left-0 top-1 h-4 w-4 rounded-full bg-white shadow-sm transition-transform",s?"translate-x-6":"translate-x-1")})})]})}),(0,r.jsxs)("div",{className:"px-1 py-1.5 border-b border-slate-200 dark:border-slate-700",children:[(0,r.jsx)("p",{className:"mb-1 px-3 pt-1 text-xs font-semibold uppercase tracking-widest text-slate-400 dark:text-slate-500",children:"Our partner sites"}),(0,r.jsx)("a",{href:"https://utmap.app",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:"utmap.app — campus map"}),(0,r.jsxs)(w(),{href:eF.MA,target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(d.A,{className:"h-4 w-4 shrink-0 text-slate-900 dark:text-white"}),"Partner Portal"]})]}),(0,r.jsxs)("div",{className:"px-1 py-1.5",children:[(0,r.jsx)("p",{className:"mb-1 px-3 pt-1 text-xs font-semibold uppercase tracking-widest text-slate-400 dark:text-slate-500",children:"Navigation"}),(0,r.jsxs)("button",{type:"button","data-demo-target":"demo-trigger",onClick:()=>{t(!1),(0,f.bs)()},className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(u.A,{className:"h-4 w-4 shrink-0 text-slate-900 dark:text-white"}),"Demo Walkthrough"]}),g?(0,r.jsxs)("div",{className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-bold text-emerald-600 dark:text-emerald-400",children:[(0,r.jsx)(d.A,{className:"h-4 w-4 shrink-0"}),"Live Data Active"]}):(0,r.jsxs)("button",{type:"button",onClick:()=>
1{t(!1),window.dispatchEvent(new CustomEvent("utmax:open-live-sync",{detail:{force:!0}}))},className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(l.A,{className:"h-4 w-4 shrink-0 text-slate-900 dark:text-white"}),"Live Seat Sync & Login"]}),(0,r.jsxs)(w(),{href:"/sim",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(x.A,{className:"h-4 w-4 shrink-0 text-slate-900 dark:text-white"}),"Simulator"]}),(0,r.jsxs)(w(),{href:eF.CJ,target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(h.A,{className:"h-4 w-4 shrink-0 text-slate-700 dark:text-slate-300"}),"Help & Tutorials"]}),(0,r.jsxs)(w(),{href:"/docs/mcp",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(m.A,{className:"h-4 w-4 shrink-0 text-slate-700 dark:text-slate-300"}),"MCP Documentation"]}),(0,r.jsxs)("button",{type:"button",onClick:function(){t(!1),window.dispatchEvent(new CustomEvent("utmax:open-feedback"))},className:"flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(p.A,{className:"h-4 w-4 shrink-0 text-slate-700 dark:text-slate-300"}),"Send Feedback"]}),(0,r.jsxs)(w(),{href:eF.r8,target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-100 dark:text-white dark:hover:bg-slate-800",children:[(0,r.jsx)(b.A,{className:"h-4 w-4 shrink-0 text-slate-700 dark:text-slate-300"}),"Privacy Policy"]})]})]},"dropdown")})]})}function eQ({className:e,showDemoButton:t}={}){let[a,i]=(0,k.useState)(!1),[l,o]=(0,k.useState)(!1),c=(0,s.usePathname)()??"",{authStatus:u}=(0,eO.n)(),x=u?.loggedIn===!0;return(0,k.useEffect)(()=>{i(!0)},[]),(0,k.useEffect)(()=>{let e=0;function t(t){let a=t?.detail?.force===!0,r=Date.now(),n=e;try{let e=Number(localStorage.getItem(eF.jH));Number.isFinite(e)&&e>0&&(n=e)}catch{}if(a||!(r-n<eF.d3)){e=r;try{localStorage.setItem(eF.jH,r.toString())}catch{}o(!0)}}function a(){o(!1)}function r(){let t=Date.now();e=t;try{localStorage.setItem(eF.jH,t.toString())}catch{}o(!0)}return window.addEventListener("utmax:open-live-sync",t),window.addEventListener("utmax:auth-success",a),window.addEventListener("utmax:session-expired",r),()=>{window.removeEventListener("utmax:open-live-sync",t),window.removeEventListener("utmax:auth-success",a),window.removeEventListener("utmax:session-expired",r)}},[]),(0,r.jsxs)(r.Fragment,{children:[("/privacy"===c||"/sim"===c)&&(0,r.jsx)("div",{className:"w-full bg-slate-100 text-slate-700 dark:bg-slate-900/90 dark:text-slate-300 border-b border-slate-200 dark:border-slate-800 px-4 py-1.5 text-center text-xs font-medium tracking-tight",children:"UTMAX is an independent student project and is not affiliated with, endorsed by, or officially connected to The University of Texas at Austin."}),(0,r.jsx)("div",{className:"relative z-[100] w-full shrink-0 overflow-visible py-2 px-4 border-b border-slate-200/80 bg-white/95 text-slate-800 backdrop-blur-md dark:border-slate-800 dark:bg-slate-900/95 dark:text-slate-100 mb-2.5",children:(0,r.jsxs)(_.K,{as:"header",className:(0,j.$)("relative flex shrink-0 items-center justify-between gap-3",e),children:[(0,r.jsxs)("div",{className:"z-10 flex items-center gap-3",children:[(0,r.jsx)(w(),{href:"/",target:"_blank",rel:"noopener noreferrer",className:"group flex items-center transition-opacity hover:opacity-90",children:(0,r.jsx)(n.default,{src:"/utmaxlogo.png",alt:"UTMAX",width:160,height:90,className:"h-12 w-auto object-contain drop-shadow-sm",priority:!0})}),(0,r.jsx)(eH,{})]}),(0,r.jsx)("div",{className:"pointer-events-none absolute left-1/2 top-1/2 hidden -translate-x-1/2 -translate-y-1/2 md:block",children:(0,r.jsx)(F,{})}),(0,r.jsxs)("div",{className:"z-10 flex items-center gap-2",children:[(0,r.jsxs)("nav",{className:"flex items-center gap-0.5",children:[(0,r.jsx)("a",{href:eF.Ul,target:"_blank",rel:"noopener noreferrer",className:"rounded-lg px-3 py-2 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-100 hover:text-max-primary dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-max-accent",children:"Extension"}),x&&(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-1.5 rounded-lg border border-emerald-200/60 bg-emerald-50/80 px-2.5 py-1.5 text-xs font-semibold text-emerald-700 shadow-sm dark:border-emerald-800/40 dark:bg-emerald-950/40 dark:text-emerald-300 cursor-default",title:"UTMAX is connected to UT Direct and syncing live seats.",children:[(0,r.jsx)(d.A,{className:"h-3.5 w-3.5"}),"Live Data"]})]}),(0,r.jsx)(I.U,{}),(0,r.jsx)(eI,{}),(0,r.jsx)(eX,{})]})]})}),(0,r.jsx)(N.E,{}),(0,r.jsx)(D,{triggerless:!0}),(0,r.jsx)(eq,{open:l&&!x,onClose:()=>o(!1)})]})}},71548:(e,t,a)=>{a.d(t,{D:()=>c,ThemeProvider:()=>d});var r=a(95155),n=a(12115),s=a(45911);let i="ut-registration-theme",l=(0,n.createContext)(null);function o(e){document.documentElement.classList.toggle("dark","dark"===e)}function d({children:e}
1){let[t,a]=(0,n.useState)("light"),[c,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=localStorage.getItem(i),t="dark"===e||"light"===e?e:"light";a(t),o(t),u(!0)},[]);let x=(0,n.useCallback)(e=>{a(e),localStorage.setItem(i,e),o(e)},[]),h=(0,n.useRef)(!1),m=(0,n.useCallback)(()=>{h.current||a(e=>{let t="dark"===e?"light":"dark",a="dark"===t?"#0f172a":"#ffffff";h.current=!0;let r=document.createElement("div");r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100vw",r.style.height="100vh",r.style.zIndex="99999",r.style.display="grid",r.style.pointerEvents="none";let n=Math.ceil(window.innerWidth/80),l=Math.ceil(window.innerHeight/80);r.style.gridTemplateColumns=`repeat(${n}, 1fr)`,r.style.gridTemplateRows=`repeat(${l}, 1fr)`,document.body.appendChild(r);let d=[];for(let e=0;e<n*l;e++){let e=document.createElement("div");e.style.backgroundColor=a,e.style.opacity="0",r.appendChild(e),d.push(e)}return s.os.fromTo(d,{opacity:0,scale:.5,rotationY:90},{opacity:1,scale:1,rotationY:0,duration:.6,ease:"back.out(1.5)",stagger:{amount:.8,grid:[l,n],from:"start"},onComplete:()=>{localStorage.setItem(i,t),o(t),s.os.to(r,{opacity:0,duration:.5,ease:"power2.inOut",onComplete:()=>{r.remove(),h.current=!1}})}}),t})},[]);return(0,r.jsx)(l.Provider,{value:{theme:t,isDark:!!c&&"dark"===t,toggleTheme:m,setTheme:x},children:e})}function c(){let e=(0,n.useContext)(l);if(!e)throw Error("useTheme must be used within ThemeProvider");return e}},90175:(e,t,a)=>{a.d(t,{D3:()=>n,rQ:()=>r});let r=[{id:"x",label:"X",verb:"Continue with X"},{id:"google",label:"Google",verb:"Continue with Google"},{id:"github",label:"GitHub",verb:"Continue with GitHub"},{id:"discord",label:"Discord",verb:"Continue with Discord"},{id:"spotify",label:"Spotify",verb:"Continue with Spotify"},{id:"azure",label:"Microsoft",verb:"Continue with Microsoft"},{id:"wallet",label:"Web3 Wallet",verb:"Connect Wallet"},{id:"email",label:"Email",verb:"Continue with Email"}],n=["x","google","github","discord","spotify","azure"]}}]);

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.