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