1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,449438,e=>{"use strict";let t,n,r,o,i;var a,s,l=e.i(487798);let u="1.6.23",c=(e,t,n,r)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],o=r.indexOf(t);r.splice(o,1),r.length||(delete e.events[n],e.events[n+10](),delete e.events[n+10])}),d=(e,t)=>c(e,n=>{let r=t(n);r&&e.events[6].push(r)},5,t=>{let n=e.listen;e.listen=(...r)=>(e.lc||e.active||(e.active=!0,t()),n(...r));let r=e.off;return e.events[6]=[],e.off=()=>{r(),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=r}});function E(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function _(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(!_(e[n],t[n]))return!1;return!0}if(E(e)&&E(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!_(e[r],t[r]))return!1;return!0}return!1}function f(e,t){return c(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()},2,t=>{let n=e.set,r=e.setKey;return e.setKey&&(e.setKey=(n,o)=>{let i;if(t({abort:()=>{i=!0},changed:n,newValue:{...e.value,[n]:o}}),!i)return r(n,o)}),e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}})}let O=[],T=0,p=globalThis.nanostoresGlobal||={epoch:0},h=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=T+4;t<O.length;)O[t]===e?O.splice(t,4):t+=4;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}),notify(e,r){p.epoch++;let o=!O.length;for(let o of t)O.push(o,n.value,e,r);if(o){for(T=0;T<O.length;T+=4)O[T](O[T+1],O[T+2],O[T+3]);O.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},A=()=>"u"<typeof window;function R(e,t){return _(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let g=(e,t,n,r)=>{let o=h({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)});f(o,R);let i=async e=>new Promise(i=>{let a="function"==typeof r?r({data:o.get().data,error:o.get().error,isPending:o.get().isPending}):r;n(t,{...a,query:{...a?.query,...e?.query},async onSuccess(e){let t=o.get(),n=null!=t.data&&null!=e.data&&_(t.data,e.data)?t.data:e.data;o.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await a?.onSuccess?.(e)},async onError(e){let{request:t}=e,n="number"==typeof t.retry?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)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 a?.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 a?.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 a=!1,s=[];for(let t of e){let e=t.subscribe(async()=>{A()||(a?await i():d(o,()=>{let e=setTimeout(async()=>{a||(a=!0,await i())},0);return()=>{for(let e of s)e();clearTimeout(e)}}))});s.push(e)}return o};function I(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}I({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"});let v={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 N=class extends Error{constructor(e="INTERNAL_SERVER_ERROR",t,n={},r="number"==typeof e?e:v[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name="APIError",this.status=e,this.headers=n,this.statusCode=r,this.body=t}};Symbol.for("better-call:api-error-headers"),a=N,s=Error,Object.defineProperty((class e extends a{#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}()){const t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);const 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}}).prototype,"constructor",{get:()=>s,enumerable:!1,configurable:!0});var m=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function L(e){return"OR"===e?"OR":"AND"}function b(e){return Array.isArray(e)}function S(e,t){return"string"==typeof t&&e.includes(t)}let y=e=>{var t;return{authorize(e,n="AND"){let r=!1;for(let[o,i]of Object.entries(e)){let e=t[o];if(!e){if("AND"===n)return{success:!1,error:`You are not allowed to access resource: ${o}`};continue}let a=function(e,{actions:t,connector:n}){return 0!==t.length&&("OR"===n?t.some(t=>S(e,t)):t.every(t=>S(e,t)))}(e,function(e){if(b(e))return{actions:e,connector:"AND"};if(!e||"object"!=typeof e)throw new m("Invalid access control request");let{actions:t,connector:n}=e;return b(t)?{actions:t,connector:L(n)}:{actions:[],connector:L(n)}}(i));if(a&&(r=!0),a&&"OR"===n)return{success:!0};if(!a&&"AND"===n)return{success:!1,error:`unauthorized to access resource "${o}"`}}return r?{success:!0}:{success:!1,error:"Not authorized"}},statements:t=e}}
1,U=y({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),w=y({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),D=y({organization:[],member:[],invitation:[],team:[],ac:["read"]}),C={admin:U,owner:w,member:D},P=I({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"}),M=Object.create(null),Y=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?M:globalThis),F=new Proxy(M,{get:(e,t)=>Y()[t]??M[t],has:(e,t)=>t in Y()||t in M,set:(e,t,n)=>(Y(!0)[t]=n,!0),deleteProperty(e,t){if(!t)return!1;let n=Y(!0);return delete n[t],!0},ownKeys:()=>Object.keys(Y(!0))});function B(e,t){return void 0!==l.default&&l.default.env?l.default.env[e]??t:"u">typeof Deno?Deno.env.get(e)??t:"u">typeof Bun?Bun.env[e]??t:t}function H(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function j(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new m(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof m)throw t;throw new m(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(H(new URL(e).pathname)||"/")}catch{throw new m(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let n=H(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`):n}F.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return B("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return B("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return B("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return B("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return B("NODE_ENV","development")},get PACKAGE_VERSION(){return B("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return B("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});let V={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*:/},z=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,G={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},W=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,k=["javascript:","data:","vbscript:"],x={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&function(e){let t;try{t=new URL(e)}catch{return!0}return!k.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},$=Symbol.for("better-auth:broadcast-channel");var q=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("u">typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("u"<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 K(e="better-auth.message"){return globalThis[$]||(globalThis[$]=new q(e)),globalThis[$]}let Z=Symbol.for("better-auth:focus-manager");var X=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("u"<typeof window||"u"<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 Q(){return globalThis[Z]||(globalThis[Z]=new X),globalThis[Z]}let J=Symbol.for("better-auth:online-manager");var ee=class{listeners=new Set;isOnline="u"<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("u"<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 et(){return globalThis[J]||(globalThis[J]=new ee),globalThis[J]}let en=()=>Math.floor(Date.now()/1e3);function er(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function eo(e,t){return _(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function ei(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 ea(e){return(...t)=>t.reduce((t,n)=>(function e(t,n,r=".",o){if(!ei(n))return e(t,{},r,o);let i={...n};for(let n of Object.keys(t)){if("__proto__"===n||"constructor"===n)continue;let a=t[n];null!=a&&(o&&o(i,n,a,r)||(Array.isArray(a)&&Array.isArray(i[n])?i[n]=[...a,...i[n]]:ei(a)&&ei(i[n])?i[n]=e(a,i[n],(r?`${r}.`:"")+n.toString(),o):i[n]=a))}return i})(t,n,"",e),{})}let es=ea();ea((e,t,n)=>{if(void 0!==e[t]&&"function"==typeof n)return e[t]=n(e[t]),!0}),ea((e,t,n)=>{if(Array.isArray(e[t])&&"function"==typeof n)return e[t]=n(e[t]),!0});var el=Object.defineProperty,eu=Object.defineProperties,ec=Object.getOwnPropertyDescriptors,ed=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,e_=Object.prototype.propertyIsEnumerable,ef=(e,t,n)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eO=(e,t)=>{for(var n in t||(t={}))eE.call(t,n)&&ef(e,n,t[n]);if(ed)for(var n of ed(t))e_.call(t,n)&&ef(e,n,t[n]);return e},eT=(e,t)=>eu(e,ec(t)),ep=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)}},eh=async(e,t)=>{var n,r,o,i,a,s;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 c of(null==t?void 0:t.plugins)||[]){if(c.init){let r=await (null==(n=c.init)?void 0:n.call(c,e.toString(),t));l=r.options||l,e=r.url}u.onRequest.push(null==(r=c.hooks)?void 0:r.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.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==(s=c.hooks)?void 0:s.onRetry)}return{url:e,options:l,hooks:u}},eA=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}},eR=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)}},eg=async e=>{let t={},n=async e=>"function"==typeof e?await e():e;if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if("Basic"===e.auth.type){let[r,o]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!o)return t;t.authorization=`Basic ${btoa(`${r}:${o}`)}`}else if("Custom"===e.auth.type){let[r,o]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!o)return t;t.authorization=`${null!=r?r:""} ${o}`}}return t},eI=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ev(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 eN(e){try{return JSON.parse(e)}catch(t){return e}}function em(e){return"function"==typeof e}function eL(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else for(let[e,r]of Array.isArray(n)?n:Object.entries(n))null!=r&&(t[e]=r);return t}async function eb(e){let t=new Headers(eL(null==e?void 0:e.headers,await eg(e)));if(!t.has("content-type")){let n=ev(null==e?void 0:e.body)?"application/json":null;n&&t.set("content-type",n)}return t}
1var eS=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function ey(e,t){let n=await e["~standard"].validate(t);if(n.issues)throw new eS(n.issues);return n.value}var eU=["get","post","put","patch","delete"],ew=async(e,t)=>{var n,r,o,i,a,s,l,u;let c,{hooks:d,url:E,options:_}=await eh(e,t),f=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&em(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&em(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(_),O=new AbortController,T=null!=(n=_.signal)?n:O.signal,p=function(e,t){let{baseURL:n,params:r,query:o}=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];eU.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[a,s]=e.replace(i,"").split("?"),l=new URLSearchParams(s);for(let[e,t]of Object.entries(o||{})){let n;if(null!=t){if("string"==typeof t)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}}let u=new Map;if(r)if(Array.isArray(r))for(let[e,t]of a.split("/").filter(e=>e.startsWith(":")).entries()){let n=r[e];u.set(t,String(n))}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t));a=(a=a.split("/").map(e=>(function(e,t){let n,r=e;for(let[e,n]of t)r=r.replace(e,n);if("."===(n=r)||".."===n)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(r)})(e,u)).join("/")).replace(/^\/+/,"");let c=l.toString();return(c=c.length>0?`?${c}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${a}${c}`,i):`${i}${a}${c}`}(E,_),h=await eb(_),A=function(e,t){let n,{body:r}=e;return r?ev(r)&&"string"!=typeof r?"application/x-www-form-urlencoded"===((n=t.get("content-type"))?n.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(r).toString():JSON.stringify(r):r:null}(_,h),R=function(e,t){var n;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let r=null==(n=e.split("@")[1])?void 0:n.split("/")[0];return eU.includes(r)?r.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(E,_),g=eT(eO({},_),{url:p,headers:h,body:A,method:R,signal:T});for(let e of d.onRequest)if(e){let t=await e(g);"object"==typeof t&&null!==t&&Object.assign(g,t)}("pipeTo"in g&&"function"==typeof g.pipeTo||"function"==typeof(null==(r=null==t?void 0:t.body)?void 0:r.pipe))&&!("duplex"in g)&&(g.duplex="half");let{clearTimeout:I}=(!(null==_?void 0:_.signal)&&(null==_?void 0:_.timeout)&&(c=setTimeout(()=>null==O?void 0:O.abort(),null==_?void 0:_.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),v=await f(g.url,g);I();let N={response:v,request:g};for(let e of d.onResponse)if(e){let n=await e(eT(eO({},N),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?v.clone():v}));n instanceof Response?v=n:"object"==typeof n&&null!==n&&(v=n.response)}if(v.ok){if("HEAD"===g.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 r=t.split(";").shift()||"";return eI.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}(v),n={data:null,response:v,request:g};if("json"===e||"text"===e){let e=await v.text(),t=null!=(i=g.jsonParser)?i:eN;n.data=await t(e)}else n.data=await v[e]();for(let e of((null==g?void 0:g.output)&&g.output&&!g.disableValidation&&(n.data=await ey(g.output,n.data)),d.onSuccess))e&&await e(eT(eO({},n),{response:(null==(a=null==t?void 0:t.hookOptions)?void 0:a.cloneResponse)?v.clone():v}));return(null==t?void 0:t.throw)?n.data:{data:n.data,error:null}}let m=null!=(s=null==t?void 0:t.jsonParser)?s:eN,L=await v.text(),b=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(L),S=b?await m(L):null,y={response:v,responseText:L,request:g,error:eT(eO({},S),{status:v.status,statusText:v.statusText})};for(let e of d.onError)e&&await e(eT(eO({},y),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?v.clone():v}));if(null==t?void 0:t.retry){let n=function(e){if("number"==typeof e)return new eA({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new eA(e);case"exponential":return new eR(e);default:throw Error("Invalid retry strategy")}}(t.retry),r=null!=(u=t.retryAttempt)?u:0;
1if(await n.shouldAttemptRetry(r,v)){for(let e of d.onRetry)e&&await e(N);let o=n.getDelay(r);return await new Promise(e=>setTimeout(e,o)),await ew(e,eT(eO({},t),{retryAttempt:r+1}))}}if(null==t?void 0:t.throw)throw new ep(v.status,v.statusText,b?S:L);return{data:null,error:eT(eO({},S),{status:v.status,statusText:v.statusText})}};let eD=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,eC=/['\u2019]/g;function eP(e){return(e.replace(eC,"").match(eD)??[]).map(e=>e.toLowerCase()).join("-")}var eM=e.i(842058);let eY=function(e){var t;let{pluginPathMethods:n,pluginsActions:r,pluginsAtoms:o,$fetch:i,$store:a,atomListeners:s}=(e=>{var t;let n,r,o,i,a,s,u,c="credentials"in Request.prototype,E=function(e,t,n,r){if(e)return j(e,t);if(!1!==r){let e=F.BETTER_AUTH_URL||F.NEXT_PUBLIC_BETTER_AUTH_URL||F.PUBLIC_BETTER_AUTH_URL||F.NUXT_PUBLIC_BETTER_AUTH_URL||F.NUXT_PUBLIC_AUTH_URL||("/"!==F.BASE_URL?F.BASE_URL:void 0);if(e)return j(e,t)}n?.headers.get("x-forwarded-host"),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{return null}}(n.url);if(!e)throw new m("Could not get origin from request. Please provide a valid base URL.");return j(e,t)}if("u">typeof window&&window.location)return j(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==l.default){if(l.default.env.NEXT_PUBLIC_AUTH_URL)return l.default.env.NEXT_PUBLIC_AUTH_URL;if("u"<typeof window){if(l.default.env.NEXTAUTH_URL)try{return l.default.env.NEXTAUTH_URL}catch{}if(l.default.env.VERCEL_URL)try{let t=l.default.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${l.default.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",O=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],T={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:p,onError:A,onRequest:R,onResponse:g,...I}=e?.fetchOptions||{},v=(t={baseURL:E,...c?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let a=e.trim(),s=a.toLowerCase();if(s.length<=9&&s in G)return G[s];if(!z.test(a)){if(n)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(V).some(([e,t])=>{let n=t.test(a);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&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){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(i&&"string"==typeof t){let e=function(e){let t=W.exec(e);if(!t)return null;let[,n,r,o,i,a,s,l,u,c,d]=t,E=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(o,10),parseInt(i,10),parseInt(a,10),parseInt(s,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(d,10))*("+"===u?-1:1);E.setUTCMinutes(E.getUTCMinutes()+e)}return E instanceof Date&&!isNaN(E.getTime())?E:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(n)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...I,plugins:[T,...I.plugins||[],...e?.disableDefaultFetchPlugins?[]:[x],...O]},async function(e,n){let r,o=eT(eO(eO({},t),n),{headers:eL(null==t?void 0:t.headers,null==n?void 0:n.headers),plugins:[...(null==t?void 0:t.plugins)||[],(r=t||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var n,o,i,a;let s=(null==(o=null==(n=r.plugins)?void 0:n.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:o.schema)||r.schema;if(s){let n=e;(null==(i=s.config)?void 0:i.prefix)&&n.startsWith(s.config.prefix)&&(n=n.replace(s.config.prefix,""),s.config.baseURL&&(e=e.replace(s.config.prefix,s.config.baseURL))),(null==(a=s.config)?void 0:a.baseURL)&&n.startsWith(s.config.baseURL)&&(n=n.replace(s.config.baseURL,"")),n.startsWith("/")&&"@"===n.charAt(1)&&(n=n.substring(1));let r=s.schema[n];if(r){let n=null==t?void 0:t.headers;if(r.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,r]of Object.entries(t.headers))null!=r&&(e[n.toLowerCase()]=r)}let o=await ey(r.headers,e),i={};for(let[e,t]of Object.entries(o))i[e.toLowerCase()]=t;n=i}let o=eT(eO({},t),{method:r.method,output:r.output,headers:n});return(null==t?void 0:t.disableValidation)||(o=eT(eO({},o),{body:r.input?await ey(r.input,null==t?void 0:t.body):null==t?void 0:t.body,params:r.params?await ey(r.params,null==t?void 0:t.params):null==t?void 0:t.params,query:r.query?await ey(r.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==n?void 0:n.plugins)||[]]});if(null==t?void 0:t.catchAllError)try{return await ew(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 ew(e,o)}),{$sessionSignal:N,session:L,broadcastSessionUpdate:b}=(r=h(!1),f(i=h({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o=e=>s(e)}),eo),a=e=>{if(n!==e)return;let t=i.get();n=void 0,(t.isPending||t.isRefetching)&&i.set({...t,isPending:!1,isRefetching:!1,refetch:o})},s=async e=>{n?.abort();let t=new AbortController;n=t;let r=i.get();i.set({...r,isPending:null===r.data,isRefetching:!0,error:null,refetch:o});try{var s;let n=await v("/get-session",{method:"GET",query:e?.query,signal:t.signal});if(t.signal.aborted)return void a(t);let{data:r,error:l}=er(n);if(r?.needsRefresh)try{let e=await v("/get-session",{method:"POST",signal:t.signal});if(t.signal.aborted)return void a(t);({data:r,error:l}=er(e))}catch{if(t.signal.aborted)return void a(t)}if(l){let e=i.get(),t=l?.status===401;i.set({data:t?null:e.data,error:l,isPending:!1,isRefetching:!1,refetch:o});return}let u=(s=r)&&(null!==s.session||null!==s.user)?s:null,c=i.get(),d=null!=c.data&&null!=u&&_(c.data,u)?c.data:u;i.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o})}catch(n){if(t.signal.aborted)return void a(t);let e=i.get();i.set({data:e.data,error:n,isPending:!1,isRefetching:!1,refetch:o})}},u=()=>{},d(i,()=>{let t;"u"<typeof window||(t=setTimeout(()=>{s()},0));let o=function(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:o={}}=e,i=o.sessionOptions?.refetchInterval??0,a=o.sessionOptions?.refetchOnWindowFocus??!0,s=o.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(s||et().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=en(),t();return}if(e?.event==="visibilitychange"){if(en()-l.lastSessionRequest<5)return;l.lastSessionRequest=en(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{n()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=K().subscribe(()=>{u({event:"storage"})}),a&&(l.unsubscribeFocus=Q().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=et().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=r.listen(()=>{t()}),l.cleanupBroadcastSetup=K().setup(),l.cleanupFocusSetup=Q().setup(),l.cleanupOnlineSetup=et().setup())},cleanup:()=>{l.isInitialized&&(l.pollInterval&&(clearInterval(l.pollInterval),l.pollInterval=void 0),l.unsubscribeBroadcast&&(l.unsubscribeBroadcast(),l.unsubscribeBroadcast=void 0),l.unsubscribeFocus&&(l.unsubscribeFocus(),l.unsubscribeFocus=void 0),l.unsubscribeOnline&&(l.unsubscribeOnline(),l.unsubscribeOnline=void 0),l.unsubscribeSignal&&(l.unsubscribeSignal(),l.unsubscribeSignal=void 0),l.cleanupBroadcastSetup&&(l.cleanupBroadcastSetup(),l.cleanupBroadcastSetup=void 0),l.cleanupFocusSetup&&(l.cleanupFocusSetup(),l.cleanupFocusSetup=void 0),l.cleanupOnlineSetup&&(l.cleanupOnlineSetup(),l.cleanupOnlineSetup=void 0),l.isInitialized=!1,l.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:e=>{K().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:s,shouldPollSession:()=>null!=i.get().data,sessionSignal:r,options:e});return o.init(),u=o.broadcastSessionUpdate,()=>{t&&clearTimeout(t);let e=n;e?.abort(),e&&a(e),o.cleanup()}}),{session:i,$sessionSignal:r,broadcastSessionUpdate:e=>u(e)}),S=e?.plugins||[],y={},U={$sessionSignal:N,session:L}
1,w={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},D=[{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?b("signout"):("/update-user"===e||"/update-session"===e)&&b("updateUser")}}];for(let e of S)e.getAtoms&&Object.assign(U,e.getAtoms?.(v)),e.pathMethods&&Object.assign(w,e.pathMethods),e.atomListeners&&D.push(...e.atomListeners);let C={notify:e=>{U[e].set(!U[e].get())},listen:(e,t)=>{U[e].subscribe(t)},atoms:U};for(let t of S)t.getActions&&(y=es(t.getActions?.(v,C,e)??{},y));return{get baseURL(){return E},pluginsActions:y,pluginsAtoms:U,pluginPathMethods:w,atomListeners:D,$fetch:v,$store:C}})(e),u={};for(let[e,t]of Object.entries(o))u[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let n=(0,eM.useRef)(e.get()),{keys:r,deps:o=[e,r]}=t,i=(0,eM.useCallback)(t=>{let o=e=>{n.current!==e&&(n.current=e,t())};if(o(e.value),r?.length){let t;return t=new Set(r).add(void 0),e.listen((e,n,r)=>{t.has(r)&&o(e)})}return e.listen(o)},o),a=()=>n.current;return(0,eM.useSyncExternalStore)(i,a,a)})(t);return t={...r,...u,$fetch:i,$store:a},function e(r=[]){return new Proxy(function(){},{get(n,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let a=[...r,o],s=t;for(let e of a)if(s&&"object"==typeof s&&e in s)s=s[e];else{s=void 0;break}return"function"==typeof s?s:"object"==typeof(i=s)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?s:e(a)},apply:async(e,t,a)=>{let l="/"+r.map(eP).join("/"),u=a[0]||{},c=a[1]||{},{query:d,fetchOptions:E,..._}=u,f={...c,...E},O=function(e,t,n){let r=t[e],{fetchOptions:o,query:i,...a}=n||{};return r||(o?.method?o.method:a&&Object.keys(a).length>0?"POST":"GET")}(l,n,u);return await i(l,{...f,body:"GET"===O?void 0:{..._,...f?.body||{}},query:d||f?.query,method:O,async onSuccess(e){if(await f?.onSuccess?.(e),!s||f.disableSignal)return;let t=s.filter(e=>e.matcher(l));if(!t.length)return;let n=new Set;for(let e of t){let t=o[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let r=t.get();setTimeout(()=>{t.set(!r)},10),e.callback?.(l)}}})}})}()}({baseURL:l.default.env.NEXT_PUBLIC_API_URL,plugins:[{id:"additional-fields-client",version:u,$InferServerPlugin:{}},(t=h(!1),n=h(!1),r=h(!1),o=h(!1),i={admin:U,member:D,owner:w,...void 0},{id:"organization",version:u,$InferServerPlugin:{},getActions:(e,t,n)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:e=>{let t;return((e,t)=>{if(!e.permissions)return!1;let n=e.role.split(","),r=e.options.creatorRole||"owner",o=n.includes(r),i=e.allowCreatorAllPermissions||!1;if(o&&i)return!0;for(let r of n)if(t[r]?.authorize(e.permissions)?.success)return!0;return!1})(t={role:e.role,options:{ac:void 0,roles:i},permissions:e.permissions},t.options.roles||C)}}}),getAtoms:e=>{let i=g(t,"/organization/list",e,{method:"GET"});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:o,activeOrganization:g([n],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:i,activeMember:g([n,r],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:g([n,o],"/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:P})]}),{signIn:eF,signOut:eB,useSession:eH,signUp:ej,requestPasswordReset:eV,resetPassword:ez}=eY;e.s(["authClient",0,eY,"requestPasswordReset",0,eV,"resetPassword",0,ez,"signIn",0,eF,"signOut",0,eB,"signUp",0,ej,"useSession",0,eH],449438)}]);
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.