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CAAC4E,EAAE,CAAGpB,CAAAA,EAAAA,EAAAA,EAAAA,EAA0B,CAAE,YAAaxD,CAAI,CAAC4E,EAAE,GACjDL,CAAAA,EAAAA,EAAAA,EAAAA,EAAiBvE,CAAI,CAAC4E,EAAE,GACjC5E,CAAAA,CAAI,CAAC4E,EAAE,CAAGpB,CAAAA,EAAAA,EAAAA,EAAAA,EAA0BxD,CAAI,CAAC4E,EAAE,GAK/C,IAAMhI,EAAI,MAAMjD,KAASqG,GACzB,GAAIoB,CAAAA,EAAAA,EAAAA,EAAAA,EAAkBxE,GAEpB,MADAiI,QAAQC,KAAK,CAAC,oBAAqB,CAAEC,OAAQJ,EAAOjD,MAAO9E,CAAE,GACvDyE,CAAAA,EAAAA,EAAAA,EAAAA,EAAezE,GAEvB,GAAI,CAAEA,CAAAA,aAAa2G,QAAAA,EACjB,OAAO3G,EAET,IAAMoI,EAAOpB,CAAAA,EAAAA,EAAAA,EAAAA,EAAsBhH,SACnC,cAAmBoI,GAAQtH,IAAAA,OAAOC,IAAI,CAACqH,GAAM7G,MAAM,CAC1C6G,CAAI,CAAC,YAAY,CAEnBA,CACT,CACF","sources":["webpack://_N_E/./src/app/(v2)/(auth)/Auth.tsx","webpack://_N_E/./src/components/common/Spinner.tsx","webpack://_N_E/./src/components/common/Tabs.tsx","webpack://_N_E/./src/lib/client-utils.ts","webpack://_N_E/./src/lib/errors/client.ts","webpack://_N_E/./src/lib/errors/common.ts","webpack://_N_E/./src/lib/type-magic.ts","webpack://_N_E/./src/lib/form.ts","webpack://_N_E/./src/middleware.client-action.ts"],"sourcesContent":["'use client';\n\nimport __middleware_kj6hhp__ from \"@/middleware.client-action\";\nimport { createContext, useEffect, useState } from 'react';\nimport { getUserSessionAction } from '@/actions/userDataActions';\nimport { type UserData } from '@/types/User';\ninterface ContextData {\n reload: () => void;\n loading?: boolean;\n user?: UserData;\n}\nexport const AuthContext = createContext({\n reload: () => {}\n});\n\n// Server components can't use {@link AuthCOntext.Provider} directly so we need\n// to wrap it in a client component.\nexport function Auth({\n children\n}: {\n children: React.ReactNode;\n}) {\n const [loading, setLoading] = useState(true);\n const [user, setUser] = useState();\n const [counter, setCounter] = useState(0);\n const reload = () => setCounter(x => x + 1);\n\n // Re-fetch the user session whenever the session ID changes\n const sessionId = Array.from(document.cookie.matchAll(/(?:^|;)\\s*(?[^=]*)\\s*=\\s*(?[^;]+)/g)).map(x => x.groups || {}).filter(x => x.name === 'user-session-id').map(x => x.value)?.[0];\n useEffect(() => {\n let mounted = true;\n (async () => {\n const session = await __middleware_kj6hhp__({\n path: \"@/actions/userDataActions\",\n name: \"getUserSessionAction\"\n }, getUserSessionAction)();\n if (!mounted) {\n return;\n }\n if (session.signedIn) {\n setUser(session);\n } else {\n setUser(undefined);\n }\n setLoading(false);\n })();\n return () => {\n mounted = false;\n };\n }, [sessionId, counter]);\n return \n {children}\n ;\n}","'use client';\n\nimport React, { useEffect, useState } from 'react';\ninterface SpinnerProps {\n /** Size of the spinner in pixels */\n size?: number;\n /** Color of the spinner arc */\n color?: string;\n /** Thickness of the spinner stroke */\n thickness?: number;\n /** Animation speed multiplier (1 = normal speed) */\n speed?: number;\n /** Optional CSS class name for additional styling */\n className?: string;\n}\nconst Spinner: React.FC = ({\n size = 20,\n color = '#0ea5e9',\n // skyblue color to match your theme\n thickness = 2,\n speed = 1,\n className = ''\n}) => {\n const [rotation, setRotation] = useState(0);\n useEffect(() => {\n let animationFrame: number;\n let startTime: number | null = null;\n const animate = (timestamp: number): void => {\n if (!startTime) startTime = timestamp;\n const elapsed = timestamp - startTime;\n\n // Rotate based on time and speed\n setRotation(elapsed * 0.2 * speed % 360);\n animationFrame = requestAnimationFrame(animate);\n };\n animationFrame = requestAnimationFrame(animate);\n return () => {\n cancelAnimationFrame(animationFrame);\n };\n }, [speed]);\n\n // SVG calculations\n const center = size / 2;\n const radius = center - thickness / 2;\n const circumference = 2 * Math.PI * radius;\n return
\n \n \n \n \n
;\n};\nexport default Spinner;","'use client';\n\nimport { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useState } from 'react';\nexport function Tabs({\n initial,\n style,\n completionStatus = {},\n // completion status\n children,\n onTabChange,\n showNavigation = false\n}: {\n initial?: keyof T;\n style?: React.CSSProperties;\n completionStatus?: {\n [key: string]: boolean;\n };\n children: T;\n onTabChange?: (tab: string) => void;\n showNavigation?: boolean; // Navigation is optional\n}) {\n const [selected, setSelected] = useState(initial ?? Object.keys(children)[0]);\n const handleTabSelect = (tab: keyof T) => {\n setSelected(tab);\n // Call the onTabChange callback if present (needed to trigger login/signup reset)\n if (onTabChange) {\n onTabChange(tab as string);\n }\n };\n\n // Get an array of tab names to determine next/prev\n const tabKeys = Object.keys(children);\n const currentIndex = tabKeys.indexOf(selected as string);\n const hasPrevious = currentIndex > 0;\n const hasNext = currentIndex < tabKeys.length - 1;\n\n // Handle navigation to next or previous tab\n const goToNext = () => {\n if (hasNext) {\n const nextTab = tabKeys[currentIndex + 1];\n handleTabSelect(nextTab);\n }\n };\n const goToPrevious = () => {\n if (hasPrevious) {\n const prevTab = tabKeys[currentIndex - 1];\n handleTabSelect(prevTab);\n }\n };\n return
\n \n\n {children[selected]}\n\n {/* Navigation Buttons - only shown when showNavigation is true */}\n {showNavigation &&
\n \n\n \n
}\n
;\n}","'use client';\n\nimport { Router, type RouterEvent } from 'next/router';\nimport {\n type Dispatch,\n type RefObject,\n type SetStateAction,\n useEffect,\n useRef,\n} from 'react';\n\nimport { type EventMap, type EventTarget } from '@/types/DomEvent';\n\nexport function useIsMounted() {\n const mounted = useRef(false);\n\n useEffect(() => {\n mounted.current = true;\n\n return () => {\n mounted.current = false;\n };\n }, []);\n\n return () => mounted.current;\n}\n\ntype ParametersExceptFirst = F extends (arg0: any, ...rest: infer R) => any\n ? R\n : never;\n\ntype Cleanup = () => void | Promise;\ntype RVal = void | Cleanup;\n\nexport function useAsyncEffect(\n fn: (isMounted: () => boolean) => RVal | Promise,\n ...args: ParametersExceptFirst\n) {\n const mounted = useRef(false);\n const cleanup = useRef();\n\n useEffect(\n () => {\n mounted.current = true;\n\n (async () => {\n const r = await fn(() => mounted.current);\n\n // If there was a previous cleanup function, call it.\n cleanup.current?.();\n\n // If the promise returned a cleanup function; if we're still mounted,\n // store it, otherwise call it.\n if (r) {\n if (mounted.current) {\n cleanup.current = r;\n } else {\n r();\n }\n }\n })();\n\n return () => {\n // Call cleanup (if set) on unmount.\n mounted.current = false;\n cleanup.current?.();\n };\n },\n ...args,\n );\n}\n\nexport function callbackToPromise(\n set: Dispatch void) | undefined>>,\n) {\n return new Promise((resolve) => {\n set(() => (code: string) => {\n resolve(code);\n set(undefined);\n });\n });\n}\n\nexport function useWindowEventListener(\n ...args: Parameters>\n) {\n useEffect(() => {\n window.addEventListener(...args);\n return () => window.removeEventListener(...args);\n }, args);\n}\n\nexport function useEventListener<\n T extends EventTarget,\n K extends keyof EventMap,\n>(\n ref: T | RefObject,\n type: K,\n listener: (this: T, ev: EventMap[K]) => any,\n deps: any[] = [],\n) {\n const target = 'addEventListener' in ref ? ref : ref.current;\n useEffect(() => {\n if (!target) return;\n\n // This is a very simple helper - it's sole purpose is to let the caller be\n // a bit simpler by not having to explicitly write the destructor, while\n // still maintaining type inference for `type` and the parameters of\n // `listener`. `T` is constrained to be one of a hard coded list of targets\n // and other types are constrained similarly so so this point we know `ref`\n // is a valid event target, `type` is one of its events, and `listener` is\n // the appropriate listener for that event. However TypeScript isn't smart\n // enough to realize this is safe. We could use `as` to overcome that but\n // ultimately it doesn't change the fact that we have to tell TypeScript,\n // \"Yes, I know what I'm doing, this is safe\" so we might as well tell\n // TypeScript not to type check the add and remove calls.\n\n // @ts-ignore\n target.addEventListener(type, listener);\n\n return () => {\n // @ts-ignore\n target.removeEventListener(type, listener);\n };\n }, [target, ...deps]);\n}\n\nexport function useRouterEvent(\n type: T,\n handler: (...events: any[]) => void,\n deps: any[] = [],\n) {\n useEffect(() => {\n Router.events.on(type, handler);\n return () => Router.events.off(type, handler);\n }, deps);\n}\n","import { type Dispatch, type SetStateAction } from 'react';\n\nimport {\n type DehydratedError,\n isDehydratedError,\n rehydrateError,\n} from './common';\n\nexport async function throwServerError(\n p: Promise,\n): Promise {\n const r = await p;\n if (isDehydratedError(r)) {\n throw rehydrateError(r);\n }\n return r as T;\n}\n\nexport function callSafe, Out>(\n fn: (...args: In) => Promise,\n isMounted: () => boolean,\n setError: Dispatch>,\n setIsPending: Dispatch>,\n) {\n return async (...args: In) => {\n setError(undefined);\n setIsPending(true);\n\n try {\n await fn(...args);\n } catch (error) {\n setError(`${error}`);\n } finally {\n if (isMounted()) {\n setIsPending(false);\n }\n }\n };\n}\n","type Constructor = new (...args: any) => T;\n\n/**\n * An error with a helper for catching it when thrown by a promise.\n */\nexport abstract class CatchableError extends Error {\n static is(\n this: Constructor,\n err: any,\n ): err is E {\n return typeof err === 'object' && err && err instanceof this;\n }\n\n static catch(err: R | Promise): Promise;\n static catch(\n this: Constructor,\n err: R | Promise,\n onErr: (err: E) => S,\n ): Promise;\n static catch(\n this: Constructor,\n err: R | Promise,\n onErr?: (err: E) => S,\n ): Promise {\n if (typeof err !== 'object' || !err) {\n return Promise.reject(err);\n }\n if ('catch' in err) {\n const self = this as any;\n return err.catch((err) =>\n onErr ? self.catch(err, onErr) : self.catch(err),\n );\n }\n if (typeof err === 'object' && err && err instanceof this) {\n if (typeof onErr === 'function') {\n return Promise.resolve(onErr(err as unknown as E));\n }\n return Promise.resolve(onErr);\n }\n return Promise.reject(err);\n }\n}\n\nconst ctorArgs = Symbol('constructor-args');\n\n/** A user error is an error that is safe for a user to see. */\nexport class UserError extends CatchableError {}\n\nexport class ResponseError extends CatchableError {\n public readonly status: number;\n\n constructor(status: number, message: string) {\n super(message);\n this.status = status;\n }\n}\n\nexport class CapturedError extends Error {\n public readonly id: string;\n\n constructor(id: string) {\n super(\n [\n 'An error occurred in the Server Components render.',\n 'The specific message is omitted in production builds to avoid leaking sensitive details.',\n `If you contact support, provide this error ID: ${id}.`,\n ].join(' '),\n );\n\n this.id = id;\n }\n\n [ctorArgs]() {\n return [this.id];\n }\n}\n\n/**\n * An unknown error is an error of an unknown type that has been passed to the\n * user.\n */\nclass UnknownError extends Error {}\n\nconst KnownErrors = {\n UnknownError,\n UserError,\n CapturedError,\n};\n\nexport type DehydratedError = {\n __dehydrated__: true;\n type: keyof typeof KnownErrors;\n error: string;\n args?: any[];\n};\n\nexport function dehydrateError(err: any): DehydratedError {\n if (typeof err !== 'object' || !err || !(err instanceof Error)) {\n return {\n __dehydrated__: true,\n type: 'UnknownError',\n error: err ?? `${err}`,\n };\n }\n\n for (const [name, ctor] of Object.entries(KnownErrors)) {\n if (err instanceof ctor) {\n return {\n __dehydrated__: true,\n type: name as DehydratedError['type'],\n error: err.message,\n args: ctorArgs in err ? err[ctorArgs]() : undefined,\n };\n }\n }\n\n return {\n __dehydrated__: true,\n type: 'UnknownError',\n error: err.message,\n };\n}\n\nexport function rehydrateError(err: DehydratedError) {\n if (!(err.type in KnownErrors)) {\n return new UnknownError(err.error);\n }\n if (err.args) {\n return new (KnownErrors[err.type] as any)(...err.args);\n }\n return new KnownErrors[err.type](err.error);\n}\n\nexport function isDehydratedError(err: any): err is DehydratedError {\n if (typeof err !== 'object' || !err) return false;\n if (!('__dehydrated__' in err && err.__dehydrated__ === true)) return false;\n if (!('type' in err && typeof err.type === 'string')) return false;\n if (!('error' in err && typeof err.error === 'string')) return false;\n return true;\n}\n","/**\n * A wrapper around {@link Object.fromEntries} that preserves type information.\n */\nexport function objectFromEntries<\n const T extends ReadonlyArray,\n>(entries: T) {\n return Object.fromEntries(entries) as { [K in T[number] as K[0]]: K[1] };\n}\n\nexport type WithOptional = Omit &\n Partial>;\n\nexport const symOriginal = Symbol('original');\n\nexport type WithOriginal = T & { [symOriginal]: T };\n\nexport function overrideMethodWithProxy<\n T extends object,\n M extends Record,\n>(target: T, methods: M): T & M {\n return new Proxy(target, {\n get(target, prop: keyof T | keyof M, receiver) {\n if (prop === symOriginal) {\n return target;\n }\n\n if (!(prop in methods)) {\n return target[prop as keyof T];\n }\n\n return function (this: T, ...args: any[]) {\n return methods[prop].call(this, ...args);\n };\n },\n }) as T & M;\n}\n","import { objectFromEntries } from './type-magic';\n\ntype FormTypes = {\n string: string;\n boolean: boolean;\n file: File;\n};\n\ntype FormValue = FormTypes[keyof FormTypes];\ntype FormFields = Record;\ntype FormMetadata = Record;\n\ntype TypeToName = {\n [K in keyof FormTypes]: FormTypes[K] extends T ? K : never;\n}[keyof FormTypes];\n\ntype MetadataEntries = {\n [K in keyof S]: [K, TypeToName];\n}[keyof S][];\n\ntype FieldEntries = {\n [K in keyof S]: [K, FormTypes[S[K]]];\n}[keyof S][];\n\n/**\n * Constructs {@link FormData} and {@link FormMetadata} for the given form\n * fields.\n */\nexport function constructForm(fields: S) {\n // This metadata isn't currently used but it could be used for server actions.\n const map = ([k, v]: [\n keyof S,\n FormValue | undefined,\n ]): MetadataEntries[number] => {\n if (typeof v === 'string') return [k, 'string' as TypeToName];\n if (typeof v === 'boolean') return [k, 'boolean' as TypeToName];\n if (v instanceof File) return [k, 'file' as TypeToName];\n throw new Error('Unsupported form value');\n };\n const metadata = objectFromEntries(Object.entries(fields).map(map));\n\n const form = new FormData();\n for (const [name, value] of Object.entries(fields)) {\n if (value instanceof File) {\n form.set(name, value);\n } else if (value) {\n form.set(name, `${value}`);\n }\n }\n\n return [form, metadata] as const;\n}\n\n/**\n * Extracts the fields out of the given form using metadata.\n */\nexport function parseForm(metadata: S, form: FormData) {\n const map = ([k, v]: [keyof S, keyof FormTypes]): FieldEntries[number] => {\n let fv = form.get(k as string) as FormTypes[S[keyof S]];\n if (v === 'file') {\n if (!(fv instanceof File))\n throw new Error(`Field ${k as string}: want file, got ${typeof fv}`);\n return [k, fv];\n }\n\n if (typeof fv !== 'string')\n throw new Error(`Field ${k as string}: want string, got ${typeof fv}`);\n\n switch (v) {\n case 'boolean':\n switch (fv.toLowerCase()) {\n case 'true':\n fv = true as FormTypes[S[keyof S]];\n break;\n case 'false':\n fv = false as FormTypes[S[keyof S]];\n break;\n default:\n throw new Error(`Field ${k as string}: want boolean, got \"${fv}\"`);\n }\n }\n\n return [k, fv];\n };\n\n const x = Object.entries(metadata)\n .filter(([k]) => form.has(k))\n .map(map);\n return objectFromEntries(x);\n}\n\nexport function constructFormWithMetadata(fields: S) {\n const [form, metadata] = constructForm(fields);\n if (form.has('--metadata--')) {\n throw new Error('--metadata-- property exists');\n }\n\n form.set('--metadata--', JSON.stringify(metadata));\n return form;\n}\n\nexport function parseFormWithMetadata(form: FormData) {\n const mdstr = form.get('--metadata--');\n if (typeof mdstr !== 'string') return form;\n const metadata = JSON.parse(mdstr);\n\n form.delete('--metadata--');\n return parseForm(metadata, form);\n}\n\nexport function isFile(v: any): v is File {\n if (v instanceof File) {\n return true;\n }\n\n if (v instanceof ArrayBuffer || ArrayBuffer.isView(v) || v instanceof Blob) {\n throw new Error('Data arrays and blobs must be passed as File');\n }\n\n return false;\n}\n\nexport function isObjectWithFile(v: any): v is Record {\n return typeof v === 'object' && v && Object.values(v).some(isFile);\n}\n","import { isDehydratedError, rehydrateError } from './lib/errors/common';\nimport {\n constructFormWithMetadata,\n isFile,\n isObjectWithFile,\n parseFormWithMetadata,\n} from './lib/form';\n\nexport default function middleware(\n props: { path: string; name: string },\n value: any,\n) {\n if (typeof value !== 'function') return value;\n\n return async (...args: any[]) => {\n for (const i in args) {\n if (isFile(args[i])) {\n args[i] = constructFormWithMetadata({ '--value--': args[i] });\n } else if (isObjectWithFile(args[i])) {\n args[i] = constructFormWithMetadata(args[i]);\n }\n }\n\n // This is a server action so the result __must__ be a promise\n const r = await value(...args);\n if (isDehydratedError(r)) {\n console.debug('Rehydrating error', { source: props, error: r });\n throw rehydrateError(r);\n }\n if (!(r instanceof FormData)) {\n return r;\n }\n const data = parseFormWithMetadata(r);\n if ('--value--' in data && Object.keys(data).length === 1) {\n return data['--value--'];\n }\n return data;\n };\n}\n"],"names":["AuthContext","createContext","reload","Auth","param","Array","children","loading","setLoading","useState","user","setUser","counter","setCounter","sessionId","from","document","cookie","matchAll","RegExp","map","x","groups","filter","name","value","useEffect","mounted","session","__middleware_kj6hhp__","path","getUserSessionAction","signedIn","undefined","jsx_runtime","jsx","Provider","data-sentry-element","data-sentry-component","data-sentry-source-file","__webpack_exports__","Z","size","color","thickness","speed","className","rotation","setRotation","animationFrame","startTime","animate","timestamp","elapsed","requestAnimationFrame","cancelAnimationFrame","center","radius","circumference","Math","PI","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","div","concat","jsxs","svg","width","height","viewBox","style","transform","circle","cx","cy","r","fill","stroke","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","Tabs","initial","completionStatus","onTabChange","showNavigation","selected","setSelected","Object","keys","handleTabSelect","tab","tabKeys","currentIndex","indexOf","hasPrevious","hasNext","length","ul","parts","split","number","text","li","a","href","onClick","e","stopPropagation","preventDefault","nativeEvent","stopImmediatePropagation","span","button","disabled","FontAwesomeIcon","icon","faChevronLeft","faChevronRight","useIsMounted","useRef","current","useAsyncEffect","fn","_len","arguments","args","_key","cleanup","callbackToPromise","set","Promise","resolve","code","useWindowEventListener","window","addEventListener","removeEventListener","useEventListener","ref","type","listener","deps","target","throwServerError","p","isDehydratedError","rehydrateError","callSafe","isMounted","setError","setIsPending","error","CatchableError","Error","is","err","catch","onErr","reject","self","ctorArgs","Symbol","UserError","CapturedError","id","constructor","join","UnknownError","KnownErrors","__dehydrated__","objectFromEntries","entries","fromEntries","constructForm","fields","metadata","k","v","File","form","FormData","constructFormWithMetadata","has","JSON","stringify","parseFormWithMetadata","mdstr","get","parse","delete","fv","toLowerCase","isFile","ArrayBuffer","isView","Blob","isObjectWithFile","values","some","middleware","props","i","console","debug","source","data"],"sourceRoot":""}