1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9260],{4864:(e,t,r)=>{r.d(t,{h:()=>a,p4:()=>o,vF:()=>l});var n=r(80367);let o={reset:"\x1b[0m",bright:"\x1b[1m",dim:"\x1b[2m",undim:"\x1b[22m",underscore:"\x1b[4m",blink:"\x1b[5m",reverse:"\x1b[7m",hidden:"\x1b[8m",fg:{black:"\x1b[30m",red:"\x1b[31m",green:"\x1b[32m",yellow:"\x1b[33m",blue:"\x1b[34m",magenta:"\x1b[35m",cyan:"\x1b[36m",white:"\x1b[37m"},bg:{black:"\x1b[40m",red:"\x1b[41m",green:"\x1b[42m",yellow:"\x1b[43m",blue:"\x1b[44m",magenta:"\x1b[45m",cyan:"\x1b[46m",white:"\x1b[47m"}},i=["debug","info","success","warn","error"],s={info:o.fg.blue,success:o.fg.green,warn:o.fg.yellow,error:o.fg.red,debug:o.fg.magenta},a=e=>{let t=e?.disabled!==!0,r=e?.level??"warn",a=e?.disableColors!==void 0?!e.disableColors:1!==(0,n.t)();return{...Object.fromEntries(i.map(n=>[n,(...[l,...u])=>((n,l,u=[])=>{if(!t||!(i.indexOf(n)>=i.indexOf(r)))return;let _=((e,t,r)=>{let n=new Date().toISOString();return r?`${o.dim}${n}${o.reset} ${s[e]}${e.toUpperCase()}${o.reset} ${o.bright}[Better Auth]:${o.reset} ${t}`:`${n} ${e.toUpperCase()} [Better Auth]: ${t}`})(n,l,a);if(!e||"function"!=typeof e.log)return void("error"===n?console.error(_,...u):"warn"===n?console.warn(_,...u):console.log(_,...u));e.log("success"===n?"info":n,l,...u)})(n,l,u)])),get level(){return r}}},l=a()},10694:(e,t,r)=>{r.d(t,{i:()=>A});var n=r(23105),o=r(65965);let i={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},s=[],a=0,l=0,u=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),init:e,lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=a+4;t<s.length;)s[t]===e?s.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){l++;let o=!s.length;for(let o of t)s.push(o,r.value,e,n);if(o){for(a=0;a<s.length;a+=4)s[a](s[a+1],s[a+2],s[a+3]);s.length=0}},off(){},set(e){let t=r.value;t!==e&&(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r},_=(e,t)=>((e,t,r,n)=>(e.events=e.events||{},e.events[15]||(e.events[15]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}))(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}}),E=()=>"undefined"==typeof window;var c=r(51348),d=r(41456),O=r(55805),T=r(55036);let A=(e,t)=>{let r="credentials"in Request.prototype,s=(0,n.vo)(e?.baseURL,e?.basePath,void 0,t)??(e=>{if(void 0!==T){if(T.env.NEXT_PUBLIC_AUTH_URL)return T.env.NEXT_PUBLIC_AUTH_URL;if("undefined"==typeof window){if(T.env.NEXTAUTH_URL)try{return T.env.NEXTAUTH_URL}catch{}if(T.env.VERCEL_URL)try{let t=T.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${T.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",a=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],l={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:A,onError:R,onRequest:f,onResponse:p,...h}=e?.fetchOptions||{},I=(0,O.Hy)({baseURL:s,...r?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?(0,o.O)(e,{strict:!1}):null,customFetchImpl:fetch,...h,plugins:[l,...h.plugins||[],...e?.disableDefaultFetchPlugins?[]:[i],...a]}),{$sessionSignal:N,session:S,broadcastSessionUpdate:L}=function(e,t){let r=u(!1),n=((e,t,r,n)=>{let o=u({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)}),i=async e=>new Promise(i=>{let s="function"==typeof n?n({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):n;r(t,{...s,query:{...s?.query,...e?.query},async onSuccess(e){o.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await s?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,n=t.retryAttempt||0;if(r&&n<r)return;let i=401===e.error.status;o.set({error:e.error,data:i?null:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await s?.onError?.(e)},async onRequest(e){let t=o.get();o.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:o.value.refetch}),await s?.onRequest?.(e)}}).catch(e=>{o.set({error:e,data:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{i(void 0)})});e=Array.isArray(e)?e:[e];let s=!1;for(let t of e)t.subscribe(async()=>{E()||(s?await i():_(o,()=>{let e=setTimeout(async()=>{s||(await i(),s=!0)},0);return()=>{o.off(),t.off(),clearTimeout(e)}}))});return o}
1)(r,"/get-session",e,{method:"GET"}),o=()=>{};return _(n,()=>{let i=(0,c.X)({sessionAtom:n,sessionSignal:r,$fetch:e,options:t});return i.init(),o=i.broadcastSessionUpdate,()=>{i.cleanup()}}),{session:n,$sessionSignal:r,broadcastSessionUpdate:e=>o(e)}}(I,e),m=e?.plugins||[],v={},U={$sessionSignal:N,session:S},b={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},g=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/update-session"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/change-email"===e,callback(e){"/sign-out"===e?L("signout"):("/update-user"===e||"/update-session"===e)&&L("updateUser")}}];for(let e of m)e.getAtoms&&Object.assign(U,e.getAtoms?.(I)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&g.push(...e.atomListeners);let y={notify:e=>{U[e].set(!U[e].get())},listen:(e,t)=>{U[e].subscribe(t)},atoms:U};for(let t of m)t.getActions&&(v=(0,d.$Q)(t.getActions?.(I,y,e)??{},v));return{get baseURL(){return s},pluginsActions:v,pluginsAtoms:U,pluginPathMethods:b,atomListeners:g,$fetch:I,$store:y}}},11874:(e,t,r)=>{r.d(t,{L1:()=>a,tT:()=>l});var n=r(20655);(0,n.E)({FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application",YOU_ARE_NOT_ALLOWED_TO_GET_USER:"You are not allowed to get user",NO_DATA_TO_UPDATE:"No data to update",YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:"You are not allowed to update users",YOU_CANNOT_REMOVE_YOURSELF:"You cannot remove yourself",YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:"You are not allowed to set a non-existent role value",YOU_CANNOT_IMPERSONATE_ADMINS:"You cannot impersonate admins",INVALID_ROLE_TYPE:"Invalid role type"});var o=r(25330);function i(e){return{newRole:e=>{var t;return{authorize(e,r="AND"){let n=!1;for(let[i,s]of Object.entries(e)){let e=t[i];if(!e)return{success:!1,error:`You are not allowed to access resource: ${i}`};if(Array.isArray(s))n=s.every(t=>e.includes(t));else if("object"==typeof s)n="OR"===s.connector?s.actions.some(t=>e.includes(t)):s.actions.every(t=>e.includes(t));else throw new o.$l("Invalid access control request");if(n&&"OR"===r)return{success:n};if(!n&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${i}"`}}return n?{success:n}:{success:!1,error:"Not authorized"}},statements:t=e}},statements:e}}let s=i({user:["create","list","set-role","ban","impersonate","impersonate-admins","delete","set-password","get","update"],session:["list","revoke","delete"]});s.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),s.newRole({user:[],session:[]}),(0,n.E)({INVALID_EMAIL_FORMAT:"Email was not generated in a valid format",FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously",FAILED_TO_DELETE_ANONYMOUS_USER:"Failed to delete anonymous user",USER_IS_NOT_ANONYMOUS:"User is not anonymous",DELETE_ANONYMOUS_USER_DISABLED:"Deleting anonymous users is disabled"});let a=()=>({id:"infer-server-plugin",$InferServerPlugin:{}});(0,n.E)({OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",TOO_MANY_ATTEMPTS:"Too many attempts"}
1),(0,n.E)({INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration",TOKEN_URL_NOT_FOUND:"Invalid OAuth configuration. Token URL not found.",PROVIDER_CONFIG_NOT_FOUND:"No config found for provider",PROVIDER_ID_REQUIRED:"Provider ID is required",INVALID_OAUTH_CONFIG:"Invalid OAuth configuration.",SESSION_REQUIRED:"Session is required",ISSUER_MISMATCH:"OAuth issuer mismatch. The authorization server issuer does not match the expected value (RFC 9207).",ISSUER_MISSING:"OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207)."});let l=()=>({id:"magic-link",$InferServerPlugin:{}});(0,n.E)({INVALID_SESSION_TOKEN:"Invalid session token"}),(0,n.E)({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invali
1d resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role",ROLE_IS_ASSIGNED_TO_MEMBERS:"Cannot delete a role that is assigned to members. Please reassign the members to a different role first"}),r(37029),r(44120),r(82103),r(65965),r(51348),r(10694);let u=i({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]});u.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),u.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),u.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),(0,n.E)({INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",PHONE_NUMBER_NOT_EXIST:"phone number isn't registered",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified",PHONE_NUMBER_CANNOT_BE_UPDATED:"Phone number cannot be updated",SEND_OTP_NOT_IMPLEMENTED:"sendOTP not implemented",TOO_MANY_ATTEMPTS:"Too many attempts"}),(0,n.E)({OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"}),(0,n.E)({INVALID_USERNAME_OR_PASSWORD:"Invalid username or password",EMAIL_NOT_VERIFIED:"Email not verified",UNEXPECTED_ERROR:"Unexpected error",USERNAME_IS_ALREADY_TAKEN:"Username is already taken. Please try another.",USERNAME_TOO_SHORT:"Username is too short",USERNAME_TOO_LONG:"Username is too long",INVALID_USERNAME:"Username is invalid",INVALID_DISPLAY_USERNAME:"Display username is invalid"})},20655:(e,t,r)=>{r.d(t,{E:()=>n});function n(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}},21030:(e,t,r)=>{r.d(t,{KV:()=>n.KV,Nu:()=>n.Nu,_K:()=>n._K,vF:()=>o.vF,yz:()=>n.yz});var n=r(71456);r(80367);var o=r(4864)},22567:(e,t,r)=>{r.d(t,{M:()=>s});var n=r(10694),o=r(49409),i=r(66529);function s(e){var t;let{pluginPathMethods:r,pluginsActions:s,pluginsAtoms:a,$fetch:l,$store:u,atomListeners:_}=(0,n.i)(e),E={};for(let[e,t]of Object.entries(a))E[`use${(0,i.Z)(e)}`]=()=>(function(e,t={}){let r=(0,o.useRef)(e.get()),{keys:n,deps:i=[e,n]}=t,s=(0,o.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n).add(void 0),e.listen((e,r,n)=>{t.has(n)&&o(e,r,n)})}return e.listen(o)},i),a=()=>r.current;return(0,o.useSyncExternalStore)(s,a,a)})(t);return t={...s,...E,$fetch:l,$store:u},function e(n=[]){return new Proxy(function(){},{get(r,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let s=[...n,o],a=t;for(let e of s)if(a&&"object"==typeof a&&e in a)a=a[e];else{a=void 0;break}return"function"==typeof a?a:"object"==typeof(i=a)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?a:e(s)},apply:async(e,t,o)=>{let i="/"+n.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join("/"),s=o[0]||{},u=o[1]||{},{query:E,fetchOptions:c,...d}=s,O={...u,...c},T=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...s}=r||{};return n||(o?.method?o.method:s&&Object.keys(s).length>0?"POST":"GET")}(i,r,s);return await l(i,{...O,body:"GET"===T?void 0:{...d,...O?.body||{}},query:E||O?.query,method:T,async onSuccess(e){if(await O?.onSuccess?.(e),!_||O.disableSignal)return;let t=_.filter(e=>e.matcher(i));if(!t.length)return;let r=new Set;for(let e of t){let t=a[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10),e.callback?.(i)}}})}})}()}},23105:(e,t,r)=>{r.d(t,{$z:()=>l,Jr:()=>u,Ln:()=>_,vo:()=>a});var n=r(21030),o=r(25330);function i(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new o.$l(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof o.$l)throw t;throw new o.$l(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(new URL(e).pathname.replace(/\/+$/,"")||"/")}catch{throw new o.$l(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=e.replace(/\/+$/,"");return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}function s(e,t){return!!e&&""!==e.trim()&&("proto"===t?"http"===e||"https"===e:"host"===t&&![/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))&&(/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e)))}function a(e,t,r,a,u){if(e)return i(e,t);if(!1!==a){let e=n._K.BETTER_AUTH_URL||n._K.NEXT_PUBLIC_BETTER_AUTH_URL||n._K.PUBLIC_BETTER_AUTH_URL||n._K.NUXT_PUBLIC_BETTER_AUTH_URL||n._K.NUXT_PUBLIC_AUTH_URL||("/"!==n._K.BASE_URL?n._K.BASE_URL:void 0);if(e)return i(e,t)}let _=r?.headers.get("x-forwarded-host"),E=r?.headers.get("x-forwarded-proto");if(_&&E&&u&&s(E,"proto")&&s(_,"host"))try{return i(`${E}://${_}`,t)}catch(e){}if(r){let e=l(r.url);if(!e)throw new o.$l("Could not get origin from request. Please provide a valid base URL.");return i(e,t)}if("undefined"!=typeof window&&window.location)return i(window.location.origin,t)}function l(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}function u(e){try{return new URL(e).protocol}catch{return null}}function _(e){try{return new URL(e).host}catch{return null}}},25330:(e,t,r)=>{r.d(t,{LG:()=>s,qU:()=>n,$l:()=>i});let n=(0,r(20655).E)({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",INVALID_USER:"Invalid user",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",TOKEN_EXPIRED:"Token expired",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_
1NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required",METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:"POST method requires deferSessionRefresh to be enabled in session config",BODY_MUST_BE_AN_OBJECT:"Body must be an object",PASSWORD_ALREADY_SET:"User already has a password set"});var o=r(70926),i=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}},s=class e extends o.LG{constructor(...e){super(...e)}static fromStatus(t,r){return new e(t,r)}static from(t,r){return new e(t,{message:r.message,code:r.code})}}},37029:(e,t,r)=>{r.d(t,{i:()=>i});let n=Symbol.for("better-auth:broadcast-channel");var o=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("undefined"!=typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function i(e="better-auth.message"){return globalThis[n]||(globalThis[n]=new o(e)),globalThis[n]}},41456:(e,t,r)=>{function n(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function o(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,o=".",i){if(!n(r))return e(t,{},o,i);let s=Object.assign({},r);for(let r in t){if("__proto__"===r||"constructor"===r)continue;let a=t[r];null!=a&&(i&&i(s,r,a,o)||(Array.isArray(a)&&Array.isArray(s[r])?s[r]=[...a,...s[r]]:n(a)&&n(s[r])?s[r]=e(a,s[r],(o?`${o}.`:"")+r.toString(),i):s[r]=a))}return s})(t,r,"",e),{})}r.d(t,{$Q:()=>i,zG:()=>o});let i=o();o((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),o((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0})},44120:(e,t,r)=>{r.d(t,{x:()=>i});let n=Symbol.for("better-auth:focus-manager");var o=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("undefined"==typeof window||"undefined"==typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function i(){return globalThis[n]||(globalThis[n]=new o),globalThis[n]}},51348:(e,t,r)=>{r.d(t,{X:()=>l});var n=r(37029),o=r(44120),i=r(82103);let s=()=>Math.floor(Date.now()/1e3);function a(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function l(e){let{sessionAtom:t,sessionSignal:r,$fetch:l,options:u={}}=e,_=u.sessionOptions?.refetchInterval??0,E=u.sessionOptions?.refetchOnWindowFocus??!0,c=u.sessionOptions?.refetchWhenOffline??!1,d={lastSync:0,lastSessionRequest:0,cachedSession:void 0},O=e=>{if(!(c||(0,i.Y)().isOnline))return;if(e?.event==="storage"){d.lastSync=s(),r.set(!r.get());return}let n=t.get(),o=()=>{d.lastSessionRequest=s(),l("/get-session").then(async e=>{let{data:o,error:i}=a(e);if(o?.needsRefresh)try{let e=await l("/get-session",{method:"POST"});({data:o,error:i}=a(e))}catch{}let u=o?.session&&o?.user?o:null;t.set({...n,data:u,error:i}),d.lastSync=s(),r.set(!r.get())}).catch(()=>{})};if(e?.event==="poll")return void o();if(e?.event==="visibilitychange"){if(s()-d.lastSessionRequest<5)return;d.lastSessionRequest=s()}if(e?.event==="visibilitychange")return void o();(n?.data===null||n?.data===void 0)&&(d.lastSync=s(),r.set(!r.get()))};return{init:()=>{_&&_>
10&&(d.pollInterval=setInterval(()=>{t.get()?.data&&O({event:"poll"})},1e3*_)),d.unsubscribeBroadcast=(0,n.i)().subscribe(()=>{O({event:"storage"})}),E&&(d.unsubscribeFocus=(0,o.x)().subscribe(()=>{O({event:"visibilitychange"})})),d.unsubscribeOnline=(0,i.Y)().subscribe(e=>{e&&O({event:"visibilitychange"})}),(0,n.i)().setup(),(0,o.x)().setup(),(0,i.Y)().setup()},cleanup:()=>{d.pollInterval&&(clearInterval(d.pollInterval),d.pollInterval=void 0),d.unsubscribeBroadcast&&(d.unsubscribeBroadcast(),d.unsubscribeBroadcast=void 0),d.unsubscribeFocus&&(d.unsubscribeFocus(),d.unsubscribeFocus=void 0),d.unsubscribeOnline&&(d.unsubscribeOnline(),d.unsubscribeOnline=void 0),d.lastSync=0,d.lastSessionRequest=0,d.cachedSession=void 0},triggerRefetch:O,broadcastSessionUpdate:e=>{(0,n.i)().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}},55805:(e,t,r)=>{r.d(t,{Hy:()=>m,zZ:()=>v});var n=Object.defineProperty,o=Object.defineProperties,i=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_=(e,t)=>{for(var r in t||(t={}))a.call(t,r)&&u(e,r,t[r]);if(s)for(var r of s(t))l.call(t,r)&&u(e,r,t[r]);return e},E=(e,t)=>o(e,i(t)),c=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}},d=async(e,t)=>{var r,n,o,i,s,a;let l=t||{},u={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:l,hooks:u};for(let _ of(null==t?void 0:t.plugins)||[]){if(_.init){let n=await (null==(r=_.init)?void 0:r.call(_,e.toString(),t));l=n.options||l,e=n.url}u.onRequest.push(null==(n=_.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=_.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=_.hooks)?void 0:i.onSuccess),u.onError.push(null==(s=_.hooks)?void 0:s.onError),u.onRetry.push(null==(a=_.hooks)?void 0:a.onRetry)}return{url:e,options:l,hooks:u}},O=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},T=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},A=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},R=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function f(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function p(e){try{return JSON.parse(e)}catch(t){return e}}function h(e){return"function"==typeof e}async function I(e){let t=new Headers(null==e?void 0:e.headers);for(let[r,n]of Object.entries(await A(e)||{}))t.set(r,n);if(!t.has("content-type")){let r=f(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var N=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function S(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new N(r.issues);return r.value}var L=["get","post","put","patch","delete"],m=e=>async function(t,r){let n,o=E(_(_({},e),r),{plugins:[...(null==e?void 0:e.plugins)||[],(n=e||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,s;let a=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(a){let r=e;(null==(i=a.config)?void 0:i.prefix)&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,""),a.config.baseURL&&(e=e.replace(a.config.prefix,a.config.baseURL))),(null==(s=a.config)?void 0:s.baseURL)&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,""));let n=a.schema[r];if(n){let r=E(_({},t),{method:n.method,output:n.output});return(null==t?void 0:t.disableValidation)||(r=E(_({},r),{body:n.input?await S(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await S(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await S(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:r}}}return{url:e,options:t}}}),...(null==r?void 0:r.plugins)||[]]});if(null==e?void 0:e.catchAllError)try{return await v(t,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await v(t,o)},v=async(e,t)=>{var r,n,o,i,s,a,l,u;let{hooks:A,url:N,options:m}=await d(e,t),U=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&h(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&h(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(m),b=new AbortController,g=null!=(r=m.signal)?r:b.signal,y=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];L.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[s,a]=e.replace(i,"").split("?"),l=new URLSearchParams(a);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)l.append(e,r);continue}else r=JSON.stringify(t);l.set(e,r)}}if(n)if(Array.isArray(n))for(let[e,t]of s.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];s=s.replace(t,r)}else for(let[e,t]of Object.entries(n))s=s.replace(`:${e}`,String(t));(s=s.split("/").map(encodeURIComponent).join("/")).startsWith("/")&&(s=s.slice(1));let u=l.toString();return(u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${s}${u}`,i):`${i}${s}${u}`}(N,m),D=function(e){if(!(null==e?void 0:e.body))return null;let t=new Headers(null==e?void 0:e.headers);if(f(e.body)&&!t.has("content-type")){for(let[t,r]of Object.entries(null==e?void 0:e.body))r instanceof Date&&(e.body[t]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&"application/x-www-form-urlencoded"===t.get("content-type")&&f(e.body)?new URLSearchParams(e.body).toString():e.body}(m),w=await I(m),C=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return L.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(N,m),P=E(_({},m),{url:y,headers:w,body:D,method:C,signal:g});for(let e of A.onRequest)if(e){let t=await e(P);"object"==typeof t&&null!==t&&(P=t)}("pipeTo"in P&&"function"==typeof P.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pi
1pe))&&!("duplex"in P)&&(P.duplex="half");let{clearTimeout:M}=function(e,t){let r;return!(null==e?void 0:e.signal)&&(null==e?void 0:e.timeout)&&(r=setTimeout(()=>null==t?void 0:t.abort(),null==e?void 0:e.timeout)),{abortTimeout:r,clearTimeout:()=>{r&&clearTimeout(r)}}}(m,b),Y=await U(P.url,P);M();let F={response:Y,request:P};for(let e of A.onResponse)if(e){let r=await e(E(_({},F),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?Y.clone():Y}));r instanceof Response?Y=r:"object"==typeof r&&null!==r&&(Y=r.response)}if(Y.ok){if("HEAD"===P.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return R.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(Y),r={data:null,response:Y,request:P};if("json"===e||"text"===e){let e=await Y.text(),t=null!=(i=P.jsonParser)?i:p;r.data=await t(e)}else r.data=await Y[e]();for(let e of((null==P?void 0:P.output)&&P.output&&!P.disableValidation&&(r.data=await S(P.output,r.data)),A.onSuccess))e&&await e(E(_({},r),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?Y.clone():Y}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let x=null!=(a=null==t?void 0:t.jsonParser)?a:p,B=await Y.text(),H=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(B),V=H?await x(B):null,G={response:Y,responseText:B,request:P,error:E(_({},V),{status:Y.status,statusText:Y.statusText})};for(let e of A.onError)e&&await e(E(_({},G),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?Y.clone():Y}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new O({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new O(e);case"exponential":return new T(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,Y)){for(let e of A.onRetry)e&&await e(F);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await v(e,E(_({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new c(Y.status,Y.statusText,H?V:B);return{data:null,error:E(_({},V),{status:Y.status,statusText:Y.statusText})}}},65965:(e,t,r)=>{r.d(t,{O:()=>a});let n={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},o=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,i={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},s=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function a(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:a=!1,reviver:l,parseDates:u=!0}=t;if("string"!=typeof e)return e;let _=e.trim();if(_.length>0&&'"'===_[0]&&_.endsWith('"')&&!_.slice(1,-1).includes('"'))return _.slice(1,-1);let E=_.toLowerCase();if(E.length<=9&&E in i)return i[E];if(!o.test(_)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(n).some(([e,t])=>{let r=t.test(_);return r&&a&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(_,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){a&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(u&&"string"==typeof t){let e=function(e){let t=s.exec(e);if(!t)return null;let[,r,n,o,i,a,l,u,_,E,c]=t,d=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(a,10),parseInt(l,10),u?parseInt(u.padEnd(3,"0"),10):0));if(_){let e=(60*parseInt(E,10)+parseInt(c,10))*("+"===_?-1:1);d.setUTCMinutes(d.getUTCMinutes()+e)}return d instanceof Date&&!isNaN(d.getTime())?d:null}(t);if(e)return e}return l?l(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}},66529:(e,t,r)=>{r.d(t,{Z:()=>n});function n(e){return e.charAt(0).toUpperCase()+e.slice(1)}},70926:(e,t,r)=>{r.d(t,{LG:()=>l,Ri:()=>a,xH:()=>s,yI:()=>i});
1let n={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var o=class extends Error{constructor(e="INTERNAL_SERVER_ERROR",t,r={},o="number"==typeof e?e:n[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=o,this.name="APIError",this.status=e,this.headers=r,this.statusCode=o,this.body=t}},i=class extends o{constructor(e,t){super(400,{message:e,code:"VALIDATION_ERROR"}),this.message=e,this.issues=t,this.issues=t}},s=class extends Error{constructor(e){super(e),this.name="BetterCallError"}};let a=Symbol.for("better-call:api-error-headers"),l=function(e,t){class r extends e{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n at ");return t.length<=1?e:(t.splice(1,1),t.join("\n at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(r.prototype,"constructor",{get:()=>t,enumerable:!1,configurable:!0}),r}(o,Error)},71456:(e,t,r)=>{r.d(t,{KV:()=>l,Nu:()=>_,_K:()=>s,lh:()=>E,yz:()=>u});var n=r(55036);let o=Object.create(null),i=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),s=new Proxy(o,{get:(e,t)=>i()[t]??o[t],has:(e,t)=>t in i()||t in o,set:(e,t,r)=>(i(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=i(!0);return delete r[t],!0},ownKeys:()=>Object.keys(i(!0))}),a=void 0!==n&&n.env&&"production"||"",l="production"===a,u=()=>"dev"===a||"development"===a,_=()=>"test"===a||function(e){return!!e&&"false"!==e}(s.TEST);function E(e,t){return void 0!==n&&n.env?n.env[e]??t:"undefined"!=typeof Deno?Deno.env.get(e)??t:"undefined"!=typeof Bun?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return E("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return E("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return E("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return E("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return E("NODE_ENV","development")},get PACKAGE_VERSION(){return E("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return E("BETTER_AUTH_TELEMETRY_ENDPOINT","")}})},80367:(e,t,r)=>{r.d(t,{t:()=>a});var n=r(71456);let o={eterm:4,cons25:4,console:4,cygwin:4,dtterm:4,gnome:4,hurd:4,jfbterm:4,konsole:4,kterm:4,mlterm:4,mosh:24,putty:4,st:4,"rxvt-unicode-24bit":24,terminator:24,"xterm-kitty":24},i=new Map(Object.entries({APPVEYOR:8,BUILDKITE:8,CIRCLECI:24,DRONE:8,GITEA_ACTIONS:24,GITHUB_ACTIONS:24,GITLAB_CI:8,TRAVIS:8})),s=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function a(){if(void 0!==(0,n.lh)("FORCE_COLOR"))switch((0,n.lh)("FORCE_COLOR")){case"":case"1":case"true":return 4;case"2":return 8;case"3":return 24;default:return 1}if(void 0!==(0,n.lh)("NODE_DISABLE_COLORS")&&""!==(0,n.lh)("NODE_DISABLE_COLORS")||void 0!==(0,n.lh)("NO_COLOR")&&""!==(0,n.lh)("NO_COLOR")||"dumb"===(0,n.lh)("TERM"))return 1;if((0,n.lh)("TMUX"))return 24;if("TF_BUILD"in n._K&&"AGENT_NAME"in n._K)return 4;if("CI"in n._K){for(let{0:e,1:t}of i)if(e in n._K)return t;return"codeship"===(0,n.lh)("CI_NAME")?8:1}if("TEAMCITY_VERSION"in n._K)return null!==/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec((0,n.lh)("TEAMCITY_VERSION"))?4:1;switch((0,n.lh)("TERM_PROGRAM")){case"iTerm.app":if(!(0,n.lh)("TERM_PROGRAM_VERSION")||null!==/^[0-2]\./.exec((0,n.lh)("TERM_PROGRAM_VERSION")))return 8;return 24;case"HyperTerm":case"MacTerm":return 24;case"Apple_Terminal":return 8}if("truecolor"===(0,n.lh)("COLORTERM")||"24bit"===(0,n.lh)("COLORTERM"))return 24;if((0,n.lh)("TERM")){if(null!==/truecolor/.exec((0,n.lh)("TERM")))return 24;if(null!==/^xterm-256/.exec((0,n.lh)("TERM")))return 8;let e=(0,n.lh)("TERM").toLowerCase();if(o[e])return o[e];if(s.some(t=>null!==t.exec(e)))return 4}return(0,n.lh)("COLORTERM")?4:1}},82103:(e,t,r)=>{r.d(t,{Y:()=>i});let n=Symbol.for("better-auth:online-manager");var o=class{listeners=new Set;isOnline="undefined"==typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}
1setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function i(){return globalThis[n]||(globalThis[n]=new o),globalThis[n]}}}]);
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.