PageSourceSearch

https://llmrefs.com/_next/static/chunks/c5ae614f4359ae45.js

js llmrefs.com collected 2026-10-01 12:20:09 UTC 48,681 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,415960,e=>{"use strict";e.s(["authClient",()=>eH,"useUser",()=>ek],415960);let t="1.6.23";function n(e){return Object.fromEntries(Object.entries(e).map(e=>{let[t,n]=e;return[t,{code:t,message:n,toString:()=>t}]}))}let o=n({OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",TOO_MANY_ATTEMPTS:"Too many attempts"});var r=e.i(586550);let i=(e,t,n,o)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=o(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],r=o.indexOf(t);o.splice(r,1),o.length||(delete e.events[n],e.events[n+10](),delete e.events[n+10])}),a=(e,t)=>i(e,n=>{let o=t(n);o&&e.events[6].push(o)},5,t=>{let n=e.listen;e.listen=function(){for(var o=arguments.length,r=Array(o),i=0;i<o;i++)r[i]=arguments[i];return e.lc||e.active||(e.active=!0,t()),n(...r)};let o=e.off;return e.events[6]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=n,e.off=o}});function l(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function s(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!s(e[n],t[n]))return!1;return!0}if(l(e)&&l(t)){let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let o of n)if(!(o in t)||!s(e[o],t[o]))return!1;return!0}return!1}function u(e,t){return i(e,n=>{let{newValue:o,abort:r}=n;t(e.value,o)&&r()},2,t=>{let n=e.set,o=e.setKey;return e.setKey&&(e.setKey=(n,r)=>{let i;if(t({abort:()=>{i=!0},changed:n,newValue:{...e.value,[n]:r}}),!i)return o(n,r)}),e.set=e=>{let o;if(t({abort:()=>{o=!0},newValue:e}),!o)return n(e)},()=>{e.set=n,e.setKey=o}})}let c=[],d=0,_=0,E=e=>{let t=[],n={get:()=>(n.lc||n.listen(()=>{})(),n.value),init:e,lc:0,listen:e=>(n.lc=t.push(e),()=>{for(let t=d+4;t<c.length;)c[t]===e?c.splice(t,4):t+=4;let o=t.indexOf(e);~o&&(t.splice(o,1),--n.lc||n.off())}),notify(e,o){_++;let r=!c.length;for(let r of t)c.push(r,n.value,e,o);if(r){for(d=0;d<c.length;d+=4)c[d](c[d+1],c[d+2],c[d+3]);c.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},f=()=>"undefined"==typeof window;function p(e,t){return s(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let O=(e,t,n,o)=>{let r=E({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)});u(r,p);let i=async e=>new Promise(i=>{let a="function"==typeof o?o({data:r.get().data,error:r.get().error,isPending:r.get().isPending}):o;n(t,{...a,query:{...null==a?void 0:a.query,...null==e?void 0:e.query},async onSuccess(e){var t;let n=r.get(),o=null!=n.data&&null!=e.data&&s(n.data,e.data)?n.data:e.data;r.set({data:o,error:null,isPending:!1,isRefetching:!1,refetch:r.value.refetch}),await (null==a||null==(t=a.onSuccess)?void 0:t.call(a,e))},async onError(e){var t,n;let{request:o}=e,i="number"==typeof o.retry?o.retry:null==(t=o.retry)?void 0:t.attempts,l=o.retryAttempt||0;if(i&&l<i)return;let s=401===e.error.status;r.set({error:e.error,data:s?null:r.get().data,isPending:!1,isRefetching:!1,refetch:r.value.refetch}),await (null==a||null==(n=a.onError)?void 0:n.call(a,e))},async onRequest(e){var t;let n=r.get();r.set({isPending:null===n.data,data:n.data,error:null,isRefetching:!0,refetch:r.value.refetch}),await (null==a||null==(t=a.onRequest)?void 0:t.call(a,e))}}).catch(e=>{r.set({error:e,data:r.get().data,isPending:!1,isRefetching:!1,refetch:r.value.refetch})}).finally(()=>{i(void 0)})});e=Array.isArray(e)?e:[e];let l=!1,c=[];for(let t of e){let e=t.subscribe(async()=>{f()||(l?await i():a(r,()=>{let e=setTimeout(async()=>{l||(l=!0,await i())},0);return()=>{for(let e of c)e();clearTimeout(e)}}))});c.push(e)}return r};n({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",CHANGE_EMAIL_DISABLED:"Change email is disabled",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 T=e.i(376054),h=e.i(136927),v=e.i(550475);let A={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 R=class extends Error{constructor(e="INTERNAL_SERVER_ERROR",t,n={},o="number"==typeof e?e:A[e]){super(null==t?void 0:t.message,(null==t?void 0:t.cause)?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=o,this.name="APIError",this.status=e,this.headers=n,this.statusCode=o,this.body=t}};Symbol.for("better-call:api-error-headers"),function(e,t){var n=new WeakMap;Object.defineProperty((class t extends e{get errorStack(){return(0,T._)(this,n)}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),(0,h._)(this,n,{writable:!0,value:void 0}),Error.stackTraceLimit=t}else super(...e),(0,h._)(this,n,{writable:!0,value:void 0});let t=Error().stack;t&&(0,v._)(this,n,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)))}}).prototype,"constructor",{get:()=>t,enumerable:!1,configurable:!0})}(R,Error);var g=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function I(e){return"OR"===e?"OR":"AND"}function m(e){return Array.isArray(e)}function N(e,t){return"string"==typeof t&&e.includes(t)}let b={newRole:e=>{var t;return{authorize(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AND",o=!1;for(let[r,i]of Object.entries(e)){let e=t[r];if(!e){if("AND"===n)return{success:!1,error:"You are not allowed to access resource: ".concat(r)};continue}let a=function(e,t){let{actions:n,connector:o}=t;return 0!==n.length&&("OR"===o?n.some(t=>N(e,t)):n.every(t=>N(e,t)))}(e,function(e){if(m(e))return{actions:e,connector:"AND"};if(!e||"object"!=typeof e)throw new g("Invalid access control request");let{actions:t,connector:n}=e;return m(t)?{actions:t,connector:I(n)}:{actions:[],connector:I(n)}}(i));if(a&&(o=!0),a&&"OR"===n)return{success:!0};if(!a&&"AND"===n)return{success:!1,error:'unauthorized to access resource "'.concat(r,'"')}}return o?{success:!0}:{success:!1,error:"Not authorized"}},statements:t=e}}}
1,L=b.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),y=b.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),S=b.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),w={admin:L,owner:y,member:S},U=n({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",EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION:"Email verification required to view or list invitations for the session email",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",INVALID_TEAM_ID:"Team id contains a reserved character"}),D=["javascript:","data:","vbscript:"];function P(e){let t;try{t=new URL(e)}catch(e){return!0}return!D.includes(t.protocol)}let C=!1,M={dismissed:["credential_returned","cancel_called"],skipped:["user_cancel","tap_outside"]},Y=()=>new Promise((e,t)=>{if(window.googleScriptInitialized)return void e();let n=document.createElement("script");n.src="https://accounts.google.com/gsi/client",n.async=!0,n.defer=!0,n.onload=()=>{window.googleScriptInitialized=!0,e()},n.onerror=()=>{t(Error("Failed to load Google Identity Services script"))},document.head.appendChild(n)}),F=Object.create(null),B=e=>{var t,n;return(null==(t=globalThis.process)?void 0:t.env)||(null==(n=globalThis.Deno)?void 0:n.env.toObject())||globalThis.__env__||(e?F:globalThis)},H=new Proxy(F,{get(e,t){var n;return null!=(n=B()[t])?n:F[t]},has:(e,t)=>t in B()||t in F,set:(e,t,n)=>(B(!0)[t]=n,!0),deleteProperty(e,t){if(!t)return!1;let n=B(!0);return delete n[t],!0},ownKeys:()=>Object.keys(B(!0))});function k(e,t){var n,o,i;return void 0!==r.default&&r.default.env?null!=(n=r.default.env[e])?n:t:"undefined"!=typeof Deno?null!=(o=Deno.env.get(e))?o:t:"undefined"!=typeof Bun&&null!=(i=Bun.env[e])?i:t}function j(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function G(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/api/auth";try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new g("Invalid base URL: ".concat(e,". URL must include 'http://' or 'https://'"))}catch(t){if(t instanceof g)throw t;throw new g("Invalid base URL: ".concat(e,". Please provide a valid base URL."),{cause:t})}if(function(e){try{return"/"!==(j(new URL(e).pathname)||"/")}catch(t){throw new g("Invalid base URL: ".concat(e,". Please provide a valid base URL."))}}(e))return e;let n=j(e);return t&&"/"!==t?(t=t.startsWith("/")?t:"/".concat(t),"".concat(n).concat(t)):n}H.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return k("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return k("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return k("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return k("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return k("NODE_ENV","development")},get PACKAGE_VERSION(){return k("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return k("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});let z={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*:/},V=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,W={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},x=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,q={id:"redirect",name:"Redirect",hooks:{onSuccess(e){var t,n;if((null==(t=e.data)?void 0:t.url)&&(null==(n=e.data)?void 0:n.redirect)&&P(e.data.url)&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch(e){}}}};var K=e.i(868275);let Z=Symbol.for("better-auth:broadcast-channel");var X=class{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(e){}}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{var t;if(e.key!==this.name)return;let n=JSON.parse(null!=(t=e.newValue)?t:"{}");(null==n?void 0:n.event)==="session"&&(null==n?void 0:n.data)&&this.listeners.forEac
1h(e=>e(n))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}constructor(e="better-auth.message"){(0,K._)(this,"listeners",new Set),(0,K._)(this,"name",void 0),this.name=e}};function $(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"better-auth.message";return globalThis[Z]||(globalThis[Z]=new X(e)),globalThis[Z]}let Q=Symbol.for("better-auth:focus-manager");var J=class{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)}}constructor(){(0,K._)(this,"listeners",new Set)}};function ee(){return globalThis[Q]||(globalThis[Q]=new J),globalThis[Q]}let et=Symbol.for("better-auth:online-manager");var en=class{subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(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)}}constructor(){(0,K._)(this,"listeners",new Set),(0,K._)(this,"isOnline","undefined"==typeof navigator||navigator.onLine)}};function eo(){return globalThis[et]||(globalThis[et]=new en),globalThis[et]}let er=()=>Math.floor(Date.now()/1e3);function ei(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function ea(e,t){return s(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function el(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 es(e){return function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return n.reduce((t,n)=>(function e(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3?arguments[3]:void 0;if(!el(n))return e(t,{},o,r);let i={...n};for(let n of Object.keys(t)){if("__proto__"===n||"constructor"===n)continue;let a=t[n];null!=a&&(r&&r(i,n,a,o)||(Array.isArray(a)&&Array.isArray(i[n])?i[n]=[...a,...i[n]]:el(a)&&el(i[n])?i[n]=e(a,i[n],(o?"".concat(o,"."):"")+n.toString(),r):i[n]=a))}return i})(t,n,"",e),{})}}let eu=es();es((e,t,n)=>{if(void 0!==e[t]&&"function"==typeof n)return e[t]=n(e[t]),!0}),es((e,t,n)=>{if(Array.isArray(e[t])&&"function"==typeof n)return e[t]=n(e[t]),!0});var ec=Object.defineProperty,ed=Object.defineProperties,e_=Object.getOwnPropertyDescriptors,eE=Object.getOwnPropertySymbols,ef=Object.prototype.hasOwnProperty,ep=Object.prototype.propertyIsEnumerable,eO=(e,t,n)=>t in e?ec(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eT=(e,t)=>{for(var n in t||(t={}))ef.call(t,n)&&eO(e,n,t[n]);if(eE)for(var n of eE(t))ep.call(t,n)&&eO(e,n,t[n]);return e},eh=(e,t)=>ed(e,e_(t)),ev=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},eA=async(e,t)=>{var n,o,r,i,a,l;let s=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:s,hooks:u};for(let c of(null==t?void 0:t.plugins)||[]){if(c.init){let o=await (null==(n=c.init)?void 0:n.call(c,e.toString(),t));s=o.options||s,e=o.url}u.onRequest.push(null==(o=c.hooks)?void 0:o.onRequest),u.onResponse.push(null==(r=c.hooks)?void 0:r.onResponse),u.onSuccess.push(null==(i=c.hooks)?void 0:i.onSuccess),u.onError.push(null==(a=c.hooks)?void 0:a.onError),u.onRetry.push(null==(l=c.hooks)?void 0:l.onRetry)}return{url:e,options:s,hooks:u}},eR=class{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}constructor(e){this.options=e}},eg=class{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)}constructor(e){this.options=e}},eI=async e=>{let t={},n=async e=>"function"==typeof e?await e():e;
1if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let o=await n(e.auth.token);if(!o)return t;t.authorization="Bearer ".concat(o)}else if("Basic"===e.auth.type){let[o,r]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!o||!r)return t;t.authorization="Basic ".concat(btoa("".concat(o,":").concat(r)))}else if("Custom"===e.auth.type){let[o,r]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!r)return t;t.authorization="".concat(null!=o?o:""," ").concat(r)}}return t},em=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function eN(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 eb(e){try{return JSON.parse(e)}catch(t){return e}}function eL(e){return"function"==typeof e}function ey(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let o={};for(let e of t)if(e)if(e instanceof Headers)e.forEach((e,t)=>{o[t]=e});else for(let[t,n]of Array.isArray(e)?e:Object.entries(e))null!=n&&(o[t]=n);return o}async function eS(e){let t=new Headers(ey(null==e?void 0:e.headers,await eI(e)));if(!t.has("content-type")){let n=eN(null==e?void 0:e.body)?"application/json":null;n&&t.set("content-type",n)}return t}var ew=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function eU(e,t){let n=await e["~standard"].validate(t);if(n.issues)throw new ew(n.issues);return n.value}var eD=["get","post","put","patch","delete"],eP=async(e,t)=>{var n,o,r,i,a,l,s,u;let{hooks:c,url:d,options:_}=await eA(e,t),E=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&eL(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&eL(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(_),f=new AbortController,p=null!=(n=_.signal)?n:f.signal,O=function(e,t){let{baseURL:n,params:o,query:r}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):n||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];eD.includes(t)&&(e=e.replace("@".concat(t,"/"),"/"))}i.endsWith("/")||(i+="/");let[a,l]=e.replace(i,"").split("?"),s=new URLSearchParams(l);for(let[e,t]of Object.entries(r||{})){let n;if(null!=t){if("string"==typeof t)n=t;else if(Array.isArray(t)){for(let n of t)s.append(e,n);continue}else n=JSON.stringify(t);s.set(e,n)}}let u=new Map;if(o)if(Array.isArray(o))for(let[e,t]of a.split("/").filter(e=>e.startsWith(":")).entries()){let n=o[e];u.set(t,String(n))}else for(let[e,t]of Object.entries(o))u.set(":".concat(e),String(t));a=(a=a.split("/").map(e=>(function(e,t){let n,o=e;for(let[e,n]of t)o=o.replace(e,n);if("."===(n=o)||".."===n)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(o)})(e,u)).join("/")).replace(/^\/+/,"");let c=s.toString();return(c=c.length>0?"?".concat(c).replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL("".concat(a).concat(c),i):"".concat(i).concat(a).concat(c)}(d,_),T=await eS(_),h=function(e,t){let{body:n}=e;return n?eN(n)&&"string"!=typeof n?"application/x-www-form-urlencoded"===function(e){let t=e.get("content-type");return t?t.split(";")[0].trim().toLowerCase():null}(t)?new URLSearchParams(n).toString():JSON.stringify(n):n:null}(_,T),v=function(e,t){var n;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let o=null==(n=e.split("@")[1])?void 0:n.split("/")[0];return eD.includes(o)?o.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(d,_),A=eh(eT({},_),{url:O,headers:T,body:h,method:v,signal:p});for(let e of c.onRequest)if(e){let t=await e(A);"object"==typeof t&&null!==t&&Object.assign(A,t)}("pipeTo"in A&&"function"==typeof A.pipeTo||"function"==typeof(null==(o=null==t?void 0:t.body)?void 0:o.pipe))&&!("duplex"in A)&&(A.duplex="half");let{clearTimeout:R}=function(e,t){let n;return!(null==e?void 0:e.signal)&&(null==e?void 0:e.timeout)&&(n=setTimeout(()=>null==t?void 0:t.abort(),null==e?void 0:e.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}(_,f),g=await E(A.url,A);R();let I={response:g,request:A};for(let e of c.onResponse)if(e){let n=await e(eh(eT({},I),{response:(null==(r=null==t?void 0:t.hookOptions)?void 0:r.cloneResponse)?g.clone():g}));n instanceof Response?g=n:"object"==typeof n&&null!==n&&(g=n.response)}if(g.ok){if("HEAD"===A.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let o=t.split(";").shift()||"";return em.test(o)?"json":n.has(o)||o.startsWith("text/")?"text":"blob"}(g),n={data:null,response:g,request:A};if("json"===e||"text"===e){let e=await g.text(),t=null!=(i=A.jsonParser)?i:eb;n.data=await t(e)}else n.data=await g[e]();for(let e of((null==A?void 0:A.output)&&A.output&&!A.disableValidation&&(n.data=await eU(A.output,n.data)),c.onSuccess))e&&await e(eh(eT({},n),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?g.clone():g}));return(null==t?void 0:t.throw)?n.data:{data:n.data,error:null}}let m=null!=(l=null==t?void 0:t.jsonParser)?l:eb,N=await g.text(),b=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(N),L=b?await m(N):null,y={response:g,responseText:N,request:A,error:eh(eT({},L),{status:g.status,statusText:g.statusText})};for(let e of c.onError)e&&await e(eh(eT({},y),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?g.clone():g}));if(null==t?void 0:t.retry){let n=function(e){if("number"==typeof e)return new eR({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new eR(e);case"exponential":return new eg(e);default:throw Error("Invalid retry strategy")}}(t.retry),o=null!=(u=t.retryAttempt)?u:0;
1if(await n.shouldAttemptRetry(o,g)){for(let e of c.onRetry)e&&await e(I);let r=n.getDelay(o);return await new Promise(e=>setTimeout(e,r)),await eP(e,eh(eT({},t),{retryAttempt:o+1}))}}if(null==t?void 0:t.throw)throw new ev(g.status,g.statusText,b?L:N);return{data:null,error:eh(eT({},L),{status:g.status,statusText:g.statusText})}};let eC=RegExp("[\\p{Ll}\\d]+|\\p{Lu}+(?!\\p{Ll})|\\p{Lu}[\\p{Ll}\\d]+|\\p{Lo}+","gu"),eM=/['\u2019]/g;function eY(e){var t;return(null!=(t=e.replace(eM,"").match(eC))?t:[]).map(e=>e.toLowerCase()).join("-")}var eF=e.i(527259),eB=e.i(93425);let eH=function(e){var t;let{pluginPathMethods:n,pluginsActions:o,pluginsAtoms:i,$fetch:l,$store:c,atomListeners:d}=((e,t)=>{var n,o,i,l,c,d,_,f,p,O;let T,h="credentials"in Request.prototype,v=null!=(f=null!=(_=function(e,t,n,o,r){if(e)return G(e,t);if(!1!==o){let e=H.BETTER_AUTH_URL||H.NEXT_PUBLIC_BETTER_AUTH_URL||H.PUBLIC_BETTER_AUTH_URL||H.NUXT_PUBLIC_BETTER_AUTH_URL||H.NUXT_PUBLIC_AUTH_URL||("/"!==H.BASE_URL?H.BASE_URL:void 0);if(e)return G(e,t)}null==n||n.headers.get("x-forwarded-host"),null==n||n.headers.get("x-forwarded-proto");if(n){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch(e){return null}}(n.url);if(!e)throw new g("Could not get origin from request. Please provide a valid base URL.");return G(e,t)}if("undefined"!=typeof window&&window.location)return G(window.location.origin,t)}(null==e?void 0:e.baseURL,null==e?void 0:e.basePath,void 0,t))?_:(e=>{if(void 0!==r.default){if(r.default.env.NEXT_PUBLIC_AUTH_URL)return r.default.env.NEXT_PUBLIC_AUTH_URL;if("undefined"==typeof window){if(r.default.env.NEXTAUTH_URL)try{return r.default.env.NEXTAUTH_URL}catch(e){}if(r.default.env.VERCEL_URL)try{let t=r.default.env.VERCEL_URL.startsWith("http")?"":"https://";return"".concat(new URL("".concat(t).concat(r.default.env.VERCEL_URL)).origin).concat(null!=e?e:"/api/auth")}catch(e){}}}})(null==e?void 0:e.basePath))?f:"/api/auth",A=(null==e||null==(n=e.plugins)?void 0:n.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e))||[],R={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:null==e||null==(o=e.fetchOptions)?void 0:o.onSuccess,onError:null==e||null==(i=e.fetchOptions)?void 0:i.onError,onRequest:null==e||null==(l=e.fetchOptions)?void 0:l.onRequest,onResponse:null==e||null==(c=e.fetchOptions)?void 0:c.onResponse}},{onSuccess:I,onError:m,onRequest:N,onResponse:b,...L}=(null==e?void 0:e.fetchOptions)||{},y=(T={baseURL:v,...h?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{strict:!0};return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{strict:n=!1,warnings:o=!1,reviver:r,parseDates:i=!0}=t;if("string"!=typeof e)return e;let a=e.trim(),l=a.toLowerCase();if(l.length<=9&&l in W)return W[l];if(!V.test(a)){if(n)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(z).some(e=>{let[t,n]=e,r=n.test(a);return r&&o&&console.warn("[better-json] Detected potential prototype pollution attempt using ".concat(t," pattern")),r})&&n)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){o&&console.warn('[better-json] Dropping "'.concat(e,'" key to prevent prototype pollution'));return}if(i&&"string"==typeof t){let e=function(e){let t=x.exec(e);if(!t)return null;let[,n,o,r,i,a,l,s,u,c,d]=t,_=new Date(Date.UTC(parseInt(n,10),parseInt(o,10)-1,parseInt(r,10),parseInt(i,10),parseInt(a,10),parseInt(l,10),s?parseInt(s.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(d,10))*("+"===u?-1:1);_.setUTCMinutes(_.getUTCMinutes()+e)}return _ instanceof Date&&!isNaN(_.getTime())?_:null}(t);if(e)return e}return r?r(e,t):t})}catch(t){if(n)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...L,plugins:[R,...L.plugins||[],...(null==e?void 0:e.disableDefaultFetchPlugins)?[]:[q],...A]},async function(e,t){let n,o=eh(eT(eT({},T),t),{headers:ey(null==T?void 0:T.headers,null==t?void 0:t.headers),plugins:[...(null==T?void 0:T.plugins)||[],(n=T||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var o,r,i,a;let l=(null==(r=null==(o=n.plugins)?void 0:o.find(t=>{var n;return null!=(n=t.schema)&&!!n.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:r.schema)||n.schema;if(l){let n=e;(null==(i=l.config)?void 0:i.prefix)&&n.startsWith(l.config.prefix)&&(n=n.replace(l.config.prefix,""),l.config.baseURL&&(e=e.replace(l.config.prefix,l.config.baseURL))),(null==(a=l.config)?void 0:a.baseURL)&&n.startsWith(l.config.baseURL)&&(n=n.replace(l.config.baseURL,"")),n.startsWith("/")&&"@"===n.charAt(1)&&(n=n.substring(1));let o=l.schema[n];if(o){let n=null==t?void 0:t.headers;if(o.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEac
1h((t,n)=>{e[n.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[n,o]of Object.entries(t.headers))null!=o&&(e[n.toLowerCase()]=o)}let r=await eU(o.headers,e),i={};for(let[e,t]of Object.entries(r))i[e.toLowerCase()]=t;n=i}let r=eh(eT({},t),{method:o.method,output:o.output,headers:n});return(null==t?void 0:t.disableValidation)||(r=eh(eT({},r),{body:o.input?await eU(o.input,null==t?void 0:t.body):null==t?void 0:t.body,params:o.params?await eU(o.params,null==t?void 0:t.params):null==t?void 0:t.params,query:o.query?await eU(o.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:r}}}return{url:e,options:t}}}),...(null==t?void 0:t.plugins)||[]]});if(null==T?void 0:T.catchAllError)try{return await eP(e,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 eP(e,o)}),{$sessionSignal:S,session:w,broadcastSessionUpdate:U}=function(e,t){let n,o=E(!1),r=e=>c(e),i=E({data:null,error:null,isPending:!0,isRefetching:!1,refetch:r});u(i,ea);let l=e=>{if(n!==e)return;let t=i.get();n=void 0,(t.isPending||t.isRefetching)&&i.set({...t,isPending:!1,isRefetching:!1,refetch:r})},c=async t=>{null==n||n.abort();let o=new AbortController;n=o;let a=i.get();i.set({...a,isPending:null===a.data,isRefetching:!0,error:null,refetch:r});try{var u;let n=await e("/get-session",{method:"GET",query:null==t?void 0:t.query,signal:o.signal});if(o.signal.aborted)return void l(o);let{data:a,error:c}=ei(n);if(null==a?void 0:a.needsRefresh)try{let t=await e("/get-session",{method:"POST",signal:o.signal});if(o.signal.aborted)return void l(o);({data:a,error:c}=ei(t))}catch(e){if(o.signal.aborted)return void l(o)}if(c){let e=i.get(),t=(null==c?void 0:c.status)===401;i.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:r});return}let d=(u=a)&&(null!==u.session||null!==u.user)?u:null,_=i.get(),E=null!=_.data&&null!=d&&s(_.data,d)?_.data:d;i.set({data:E,error:null,isPending:!1,isRefetching:!1,refetch:r})}catch(t){if(o.signal.aborted)return void l(o);let e=i.get();i.set({data:e.data,error:t,isPending:!1,isRefetching:!1,refetch:r})}},d=()=>{};return a(i,()=>{let e;"undefined"!=typeof window&&(e=setTimeout(()=>{c()},0));let r=function(e){var t,n,o,r,i,a;let{fetchSession:l,shouldPollSession:s=()=>!0,sessionSignal:u,options:c={}}=e,d=null!=(r=null==(t=c.sessionOptions)?void 0:t.refetchInterval)?r:0,_=null==(i=null==(n=c.sessionOptions)?void 0:n.refetchOnWindowFocus)||i,E=null!=(a=null==(o=c.sessionOptions)?void 0:o.refetchWhenOffline)&&a,f={isInitialized:!1,lastSessionRequest:0},p=e=>{if(E||eo().isOnline){if((null==e?void 0:e.event)==="storage")return void l();if((null==e?void 0:e.event)==="poll"){f.lastSessionRequest=er(),l();return}if((null==e?void 0:e.event)==="visibilitychange"){if(er()-f.lastSessionRequest<5)return;f.lastSessionRequest=er(),l();return}l()}};return{init:()=>{f.isInitialized||(f.isInitialized=!0,d&&d>0&&(f.pollInterval=setInterval(()=>{s()&&p({event:"poll"})},1e3*d)),f.unsubscribeBroadcast=$().subscribe(()=>{p({event:"storage"})}),_&&(f.unsubscribeFocus=ee().subscribe(()=>{p({event:"visibilitychange"})})),f.unsubscribeOnline=eo().subscribe(e=>{e&&p({event:"visibilitychange"})}),f.unsubscribeSignal=u.listen(()=>{l()}),f.cleanupBroadcastSetup=$().setup(),f.cleanupFocusSetup=ee().setup(),f.cleanupOnlineSetup=eo().setup())},cleanup:()=>{f.isInitialized&&(f.pollInterval&&(clearInterval(f.pollInterval),f.pollInterval=void 0),f.unsubscribeBroadcast&&(f.unsubscribeBroadcast(),f.unsubscribeBroadcast=void 0),f.unsubscribeFocus&&(f.unsubscribeFocus(),f.unsubscribeFocus=void 0),f.unsubscribeOnline&&(f.unsubscribeOnline(),f.unsubscribeOnline=void 0),f.unsubscribeSignal&&(f.unsubscribeSignal(),f.unsubscribeSignal=void 0),f.cleanupBroadcastSetup&&(f.cleanupBroadcastSetup(),f.cleanupBroadcastSetup=void 0),f.cleanupFocusSetup&&(f.cleanupFocusSetup(),f.cleanupFocusSetup=void 0),f.cleanupOnlineSetup&&(f.cleanupOnlineSetup(),f.cleanupOnlineSetup=void 0),f.isInitialized=!1,f.lastSessionRequest=0)},triggerRefetch:p,broadcastSessionUpdate:e=>{$().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:c,shouldPollSession:()=>null!=i.get().data,sessionSignal:o,options:t});return r.init(),d=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=n;null==t||t.abort(),t&&l(t),r.cleanup()}}),{session:i,$sessionSignal:o,broadcastSessionUpdate:e=>d(e)}}(y,e),D=(null==e?void 0:e.plugins)||[],P={},C={$sessionSignal:S,session:w}
1,M={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},Y=[{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||"/revoke-other-sessions"===e||"/change-email"===e||"/change-password"===e,callback(e){"/sign-out"===e?U("signout"):("/update-user"===e||"/update-session"===e)&&U("updateUser")}}];for(let e of D)e.getAtoms&&Object.assign(C,null==(p=e.getAtoms)?void 0:p.call(e,y)),e.pathMethods&&Object.assign(M,e.pathMethods),e.atomListeners&&Y.push(...e.atomListeners);let F={notify:e=>{C[e].set(!C[e].get())},listen:(e,t)=>{C[e].subscribe(t)},atoms:C};for(let t of D)t.getActions&&(P=eu(null!=(O=null==(d=t.getActions)?void 0:d.call(t,y,F,e))?O:{},P));return{get baseURL(){return v},pluginsActions:P,pluginsAtoms:C,pluginPathMethods:M,atomListeners:Y,$fetch:y,$store:F}})(e),_={};for(let[e,t]of Object.entries(i))_[function(e){return"use".concat(e.charAt(0).toUpperCase()+e.slice(1))}(e)]=()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,eF.useRef)(e.get()),{keys:o,deps:r=[e,o]}=t,i=(0,eF.useCallback)(t=>{let r=e=>{n.current!==e&&(n.current=e,t())};if(r(e.value),null==o?void 0:o.length){let t;return t=new Set(o).add(void 0),e.listen((e,n,o)=>{t.has(o)&&r(e,n,o)})}return e.listen(r)},r),a=()=>n.current;return(0,eF.useSyncExternalStore)(i,a,a)})(t);return t={...o,..._,$fetch:l,$store:c},function e(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new Proxy(function(){},{get(n,r){var i;if("string"!=typeof r||"then"===r||"catch"===r||"finally"===r)return;let a=[...o,r],l=t;for(let e of a)if(l&&"object"==typeof l&&e in l)l=l[e];else{l=void 0;break}return"function"==typeof l?l:"object"==typeof(i=l)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?l:e(a)},apply:async(e,t,r)=>{let a="/"+o.map(eY).join("/"),s=r[0]||{},u=r[1]||{},{query:c,fetchOptions:_,...E}=s,f={...u,..._},p=function(e,t,n){let o=t[e],{fetchOptions:r,query:i,...a}=n||{};return o||((null==r?void 0:r.method)?r.method:a&&Object.keys(a).length>0?"POST":"GET")}(a,n,s);return await l(a,{...f,body:"GET"===p?void 0:{...E,...(null==f?void 0:f.body)||{}},query:c||(null==f?void 0:f.query),method:p,async onSuccess(e){var t,n;if(await (null==f||null==(t=f.onSuccess)?void 0:t.call(f,e)),!d||f.disableSignal)return;let o=d.filter(e=>e.matcher(a));if(!o.length)return;let r=new Set;for(let e of o){let t=i[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let o=t.get();setTimeout(()=>{t.set(!o)},10),null==(n=e.callback)||n.call(e,a)}}})}})}()}({plugins:[{id:"additional-fields-client",version:t,$InferServerPlugin:{}},(e=>{let n=E(!1),o=E(!1),r=E(!1),i=E(!1),a={admin:L,member:S,owner:y,...null==e?void 0:e.roles};return{id:"organization",version:t,$InferServerPlugin:{},getActions:(t,n,o)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:t=>(e=>((e,t)=>{var n,o;if(!e.permissions)return!1;let r=e.role.split(","),i=e.options.creatorRole||"owner",a=r.includes(i),l=e.allowCreatorAllPermissions||!1;if(a&&l)return!0;for(let i of r)if(null==(n=null==(o=t[i])?void 0:o.authorize(e.permissions))?void 0:n.success)return!0;return!1})(e,e.options.roles||w))({role:t.role,options:{ac:null==e?void 0:e.ac,roles:a},permissions:t.permissions})}}),getAtoms:e=>{let t=O(n,"/organization/list",e,{method:"GET"});return{$listOrg:n,$activeOrgSignal:o,$activeMemberSignal:r,$activeMemberRoleSignal:i,activeOrganization:O([o],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:t,activeMember:O([o,r],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:O([o,i],"/organization/get-active-member-role",e,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher:e=>"/organization/create"===e||"/organization/delete"===e||"/organization/update"===e,signal:"$listOrg"},{matcher:e=>"/sign-out"===e||e.startsWith("/organization"),signal:"$activeOrgSignal"},{matcher:e=>e.startsWith("/organization/set-active")||"/organization/create"===e||"/organization/delete"===e||"/organization/remove-member"===e||"/organization/leave"===e||"/organization/accept-invitation"===e,signal:"$sessionSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberSignal"},{matcher:e=>e.includes("/organization/update-member-role")||e.startsWith("/organization/set-active"),signal:"$activeMemberRoleSignal"}],$ERROR_CODES:U}})({schema:{}}
1),{id:"email-otp",version:t,$InferServerPlugin:{},atomListeners:[{matcher:e=>"/email-otp/verify-email"===e||"/sign-in/email-otp"===e||"/email-otp/request-email-change"===e,signal:"$sessionSignal"}],$ERROR_CODES:o},(e=>({id:"one-tap",version:t,fetchPlugins:[{id:"fedcm-signout-handle",name:"FedCM Sign-Out Handler",hooks:{async onResponse(t){var n;t.request.url.toString().includes("/sign-out")&&(null==(n=e.promptOptions)?void 0:n.fedCM)!==!1&&"undefined"!=typeof window&&"IdentityCredential"in window&&navigator.credentials.preventSilentAccess()}}}],getActions:(t,n)=>({oneTap:async(n,o)=>{var r,i,a,l,s,u;if(C)return void console.warn("A Google One Tap request is already in progress. Please wait.");if("undefined"==typeof window||!window.document)return void console.warn("Google One Tap is only available in browser environments");if(null==n?void 0:n.button){await Y();let u="string"==typeof n.button.container?document.querySelector(n.button.container):n.button.container;if(!u)return void console.error("Google One Tap: Button container not found",n.button.container);async function c(e){var r,i;if((null==(r=await t("/one-tap/callback",{method:"POST",body:{idToken:e,callbackURL:null==n?void 0:n.callbackURL},...null==n?void 0:n.fetchOptions,...o}))||!r.error)&&(!(null==n?void 0:n.fetchOptions)&&!o||(null==n?void 0:n.callbackURL))){let e=null!=(i=null==n?void 0:n.callbackURL)?i:"/";P(e)&&(window.location.href=e)}}let{autoSelect:d,cancelOnTapOutside:_,context:E}=null!=n?n:{},f=null!=(l=null!=E?E:e.context)?l:"signin",p=(null==(r=e.promptOptions)?void 0:r.fedCM)!==!1;return null==(i=window.google)||i.accounts.id.initialize({client_id:e.clientId,callback:async e=>{try{await c(e.credential)}catch(e){console.error("Error during button callback:",e)}},auto_select:d,cancel_on_tap_outside:_,context:f,ux_mode:(null==n?void 0:n.uxMode)||"popup",nonce:null==n?void 0:n.nonce,itp_support:!0,use_fedcm_for_prompt:p,...e.additionalOptions}),void(null==(a=window.google)||a.accounts.id.renderButton(u,null!=(s=n.button.config)?s:{type:"icon"}))}async function d(e){var r,i;if((null==(r=await t("/one-tap/callback",{method:"POST",body:{idToken:e,callbackURL:null==n?void 0:n.callbackURL},...null==n?void 0:n.fetchOptions,...o}))||!r.error)&&(!(null==n?void 0:n.fetchOptions)&&!o||(null==n?void 0:n.callbackURL))){let e=null!=(i=null==n?void 0:n.callbackURL)?i:"/";P(e)&&(window.location.href=e)}}let{autoSelect:_,cancelOnTapOutside:E,context:f}=null!=n?n:{},p=null!=(u=null!=f?f:e.context)?u:"signin";C=!0;try{await Y(),await new Promise((t,o)=>{var r,i,a,l,s,u;let c=!1,f=null!=(s=null==(r=e.promptOptions)?void 0:r.baseDelay)?s:1e3,O=null!=(u=null==(i=e.promptOptions)?void 0:i.maxAttempts)?u:5,T=(null==(a=e.promptOptions)?void 0:a.fedCM)!==!1;null==(l=window.google)||l.accounts.id.initialize({client_id:e.clientId,callback:async e=>{c=!0;try{await d(e.credential),t()}catch(e){console.error("Error during One Tap callback:",e),o(e)}},auto_select:_,cancel_on_tap_outside:E,context:p,ux_mode:(null==n?void 0:n.uxMode)||"popup",nonce:null==n?void 0:n.nonce,itp_support:!0,use_fedcm_for_prompt:T,...e.additionalOptions});let h=e=>{var o;c||null==(o=window.google)||o.accounts.id.prompt(o=>{var r,i,a,l,s,u,d,_,E,p;if(!c)if(null==(r=o.isDismissedMoment)?void 0:r.call(o)){let r=null==(l=o.getDismissedReason)?void 0:l.call(o);if(M.dismissed.includes(r)){null==n||null==(s=n.onPromptNotification)||s.call(n,o),t();return}if(e<O){let t=Math.pow(2,e)*f;setTimeout(()=>h(e+1),t)}else null==n||null==(u=n.onPromptNotification)||u.call(n,o),t()}else if(null==(i=o.isSkippedMoment)?void 0:i.call(o)){let r=null==(d=o.getSkippedReason)?void 0:d.call(o);if(!r||M.skipped.includes(r)){null==n||null==(_=n.onPromptNotification)||_.call(n,o),t();return}if(e<O){let t=Math.pow(2,e)*f;setTimeout(()=>h(e+1),t)}else null==n||null==(E=n.onPromptNotification)||E.call(n,o),t()}else(null==(a=o.isNotDisplayed)?void 0:a.call(o))&&(null==n||null==(p=n.onPromptNotification)||p.call(n,o),t())})};h(0)})}catch(e){throw console.error("Error during Google One Tap flow:",e),e}finally{C=!1}}}),getAtoms:e=>({})}))({clientId:eB.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,autoSelect:!0,cancelOnTapOutside:!1,uxMode:"popup",context:"signin",promptOptions:{fedCM:!0},additionalOptions:{}}),{id:"infer-server-plugin",version:t,$InferServerPlugin:{}}]}
1),ek=()=>{let{data:e,refetch:t,isPending:n}=eH.useSession();return{user:(null==e?void 0:e.user)||null,isLoadingUser:n,refetchUser:()=>{t().catch(console.error)}}}}]);

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.