PageSourceSearch

https://biu.ai/_next/static/chunks/1395-1bc79daf6926b5ce.js

js biu.ai collected 2026-10-05 13:29:43 UTC 38,759 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1395],{294:(e,t,n)=>{n.d(t,{K:()=>i,r:()=>function e(t,n){if(t===n)return!0;if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}if(o(t)&&o(n)){let r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!1;for(let o of r)if(!(o in n)||!e(t[o],n[o]))return!1;return!0}return!1}});var r=n(1787);function o(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function i(e,t){return(0,r.OS)(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}},453:(e,t,n)=>{n.d(t,{M:()=>ec});var r=n(3170);let o=Object.create(null),i=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),a=new Proxy(o,{get:(e,t)=>i()[t]??o[t],has:(e,t)=>t in i()||t in o,set:(e,t,n)=>(i(!0)[t]=n,!0),deleteProperty(e,t){if(!t)return!1;let n=i(!0);return delete n[t],!0},ownKeys:()=>Object.keys(i(!0))});function s(e,t){return void 0!==r&&r.env?r.env[e]??t:"undefined"!=typeof Deno?Deno.env.get(e)??t:"undefined"!=typeof Bun?Bun.env[e]??t:t}a.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return s("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return s("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return s("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return s("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return s("NODE_ENV","development")},get PACKAGE_VERSION(){return s("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return s("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});var l=n(7514);function u(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function c(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new l.$l(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof l.$l)throw t;throw new l.$l(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(u(new URL(e).pathname)||"/")}catch{throw new l.$l(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let n=u(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${n}${t}`):n}let d={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*:/},E=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,f={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},_=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,p=["javascript:","data:","vbscript:"],h={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!p.includes(t.protocol)}(e.data.url)&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}};var T=n(294);let O=Symbol.for("better-auth:broadcast-channel");var g=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("undefined"!=typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function R(e="better-auth.message"){return globalThis[O]||(globalThis[O]=new g(e)),globalThis[O]}let A=Symbol.for("better-auth:focus-manager");var v=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}
1setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("undefined"==typeof window||"undefined"==typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function m(){return globalThis[A]||(globalThis[A]=new v),globalThis[A]}let b=Symbol.for("better-auth:online-manager");var y=class{listeners=new Set;isOnline="undefined"==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("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function I(){return globalThis[b]||(globalThis[b]=new y),globalThis[b]}let N=()=>Math.floor(Date.now()/1e3);var w=n(722),L=n(1787);function S(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function U(e,t){return(0,T.r)(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function D(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 P(e){return(...t)=>t.reduce((t,n)=>(function e(t,n,r=".",o){if(!D(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]]:D(a)&&D(i[n])?i[n]=e(a,i[n],(r?`${r}.`:"")+n.toString(),o):i[n]=a))}return i})(t,n,"",e),{})}let M=P();P((e,t,n)=>{if(void 0!==e[t]&&"function"==typeof n)return e[t]=n(e[t]),!0}),P((e,t,n)=>{if(Array.isArray(e[t])&&"function"==typeof n)return e[t]=n(e[t]),!0});var C=Object.defineProperty,Y=Object.defineProperties,j=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,F=(e,t,n)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t)=>{for(var n in t||(t={}))z.call(t,n)&&F(e,n,t[n]);if(H)for(var n of H(t))B.call(t,n)&&F(e,n,t[n]);return e},W=(e,t)=>Y(e,j(t)),$=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)}},k=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}},V=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}},x=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)}},q=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 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},Z=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function K(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 X(e){try{return JSON.parse(e)}catch(t){return e}}function Q(e){return"function"==typeof e}function J(...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 ee(e){let t=new Headers(J(null==e?void 0:e.headers,await q(e)));if(!t.has("content-type")){let n=K(null==e?void 0:e.body)?"application/json":null;n&&t.set("content-type",n)}return t}var et=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function en(e,t){let n=await e["~standard"].validate(t);if(n.issues)throw new et(n.issues);return n.value}var er=["get","post","put","patch","delete"],eo=async(e,t)=>{var n,r,o,i,a,s,l,u;let{hooks:c,url:d,options:E}=await k(e,t),f=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&Q(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&Q(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(E),_=new AbortController,p=null!=(n=E.signal)?n:_.signal,h=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];er.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}`}(d,E),T=await ee(E),O=function(e,t){let{body:n}=e;return n?K(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}(E,T),g=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 er.includes(r)?r.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(d,E),R=W(G({},E),{url:h,headers:T,body:O,method:g,signal:p});for(let e of c.onRequest)if(e){let t=await e(R);"object"==typeof t&&null!==t&&Object.assign(R,t)}("pipeTo"in R&&"function"==typeof R.pipeTo||"function"==typeof(null==(r=null==t?void 0:t.body)?void 0:r.pipe))&&!("duplex"in R)&&(R.duplex="half");let{clearTimeout:A}=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)}}}(E,_),v=await f(R.url,R);A();let m={response:v,request:R};for(let e of c.onResponse)if(e){let n=await e(W(G({},m),{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"===R.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 Z.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}(v),n={data:null,response:v,request:R};if("json"===e||"text"===e){let e=await v.text(),t=null!=(i=R.jsonParser)?i:X;n.data=await t(e)}else n.data=await v[e]();for(let e of((null==R?void 0:R.output)&&R.output&&!R.disableValidation&&(n.data=await en(R.output,n.data)),c.onSuccess))e&&await e(W(G({},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 b=null!=(s=null==t?void 0:t.jsonParser)?s:X,y=await v.text(),I=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(y),N=I?await b(y):null,w={response:v,responseText:y,request:R,error:W(G({},N),{status:v.status,statusText:v.statusText})};for(let e of c.onError)e&&await e(W(G({},w),{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 V({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new V(e);case"exponential":return new x(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 c.onRetry)e&&await e(m);let o=n.getDelay(r);return await new Promise(e=>setTimeout(e,o)),await eo(e,W(G({},t),{retryAttempt:r+1}))}}if(null==t?void 0:t.throw)throw new $(v.status,v.statusText,I?N:y);return{data:null,error:W(G({},N),{status:v.status,statusText:v.statusText})}},ei=n(3170);let ea=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,es=/['\u2019]/g;function el(e){return(e.replace(es,"").match(ea)??[]).map(e=>e.toLowerCase()).join("-")}var eu=n(6025);function ec(e){var t;let{pluginPathMethods:n,pluginsActions:r,pluginsAtoms:o,$fetch:i,$store:s,atomListeners:u}=((e,t)=>{let n,r="credentials"in Request.prototype,o=function(e,t,n,r,o){if(e)return c(e,t);if(!1!==r){let e=a.BETTER_AUTH_URL||a.NEXT_PUBLIC_BETTER_AUTH_URL||a.PUBLIC_BETTER_AUTH_URL||a.NUXT_PUBLIC_BETTER_AUTH_URL||a.NUXT_PUBLIC_AUTH_URL||("/"!==a.BASE_URL?a.BASE_URL:void 0);if(e)return c(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 l.$l("Could not get origin from request. Please provide a valid base URL.");return c(e,t)}if("undefined"!=typeof window&&window.location)return c(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,void 0)??(e=>{if(void 0!==ei){if(ei.env.NEXT_PUBLIC_AUTH_URL)return ei.env.NEXT_PUBLIC_AUTH_URL;if("undefined"==typeof window){if(ei.env.NEXTAUTH_URL)try{return ei.env.NEXTAUTH_URL}catch{}if(ei.env.VERCEL_URL)try{let t=ei.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${t}${ei.env.VERCEL_URL}`).origin}${e??"/api/auth"}`}catch{}}}})(e?.basePath)??"/api/auth",i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],s={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:p,onRequest:O,onResponse:g,...A}=e?.fetchOptions||{},v=(n={baseURL:o,...r?{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 f)return f[s];if(!E.test(a)){if(n)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(d).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=_.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,...A,plugins:[s,...A.plugins||[],...e?.disableDefaultFetchPlugins?[]:[h],...i]},async function(e,t){let r,o=W(G(G({},n),t),{headers:J(null==n?void 0:n.headers,null==t?void 0:t.headers),plugins:[...(null==n?void 0:n.plugins)||[],(r=n||{},{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 en(r.headers,e),i={};for(let[e,t]of Object.entries(o))i[e.toLowerCase()]=t;n=i}let o=W(G({},t),{method:r.method,output:r.output,headers:n});return(null==t?void 0:t.disableValidation)||(o=W(G({},o),{body:r.input?await en(r.input,null==t?void 0:t.body):null==t?void 0:t.body,params:r.params?await en(r.params,null==t?void 0:t.params):null==t?void 0:t.params,query:r.query?await en(r.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:o}}}return{url:e,options:t}}}),...(null==t?void 0:t.plugins)||[]]});if(null==n?void 0:n.catchAllError)try{return await eo(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 eo(e,o)}),{$sessionSignal:b,session:y,broadcastSessionUpdate:D}=function(e,t){let n,r=(0,w.eU)(!1),o=e=>s(e),i=(0,w.eU)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});(0,T.K)(i,U);let 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 t=>{n?.abort();let r=new AbortController;n=r;let s=i.get();i.set({...s,isPending:null===s.data,isRefetching:!0,error:null,refetch:o});try{var l;let n=await e("/get-session",{method:"GET",query:t?.query,signal:r.signal});if(r.signal.aborted)return void a(r);let{data:s,error:u}=S(n);if(s?.needsRefresh)try{let t=await e("/get-session",{method:"POST",signal:r.signal});if(r.signal.aborted)return void a(r);({data:s,error:u}=S(t))}catch{if(r.signal.aborted)return void a(r)}if(u){let e=i.get(),t=u?.status===401;i.set({data:t?null:e.data,error:u,isPending:!1,isRefetching:!1,refetch:o});return}let c=(l=s)&&(null!==l.session||null!==l.user)?l:null,d=i.get(),E=null!=d.data&&null!=c&&(0,T.r)(d.data,c)?d.data:c;i.set({data:E,error:null,isPending:!1,isRefetching:!1,refetch:o})}catch(t){if(r.signal.aborted)return void a(r);let e=i.get();i.set({data:e.data,error:t,isPending:!1,isRefetching:!1,refetch:o})}},l=()=>{};return(0,L.Rc)(i,()=>{let e;"undefined"!=typeof window&&(e=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||I().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=N(),t();return}if(e?.event==="visibilitychange"){if(N()-l.lastSessionRequest<5)return;l.lastSessionRequest=N(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{n()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=R().subscribe(()=>{u({event:"storage"})}),a&&(l.unsubscribeFocus=m().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=I().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=r.listen(()=>{t()}),l.cleanupBroadcastSetup=R().setup(),l.cleanupFocusSetup=m().setup(),l.cleanupOnlineSetup=I().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=>{R().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:s,shouldPollSession:()=>null!=i.get().data,sessionSignal:r,options:t});return o.init(),l=o.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=n;t?.abort(),t&&a(t),o.cleanup()}}),{session:i,$sessionSignal:r,broadcastSessionUpdate:e=>l(e)}}(v,e),P=e?.plugins||[],C={},Y={$sessionSignal:b,session:y}
1,j={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},H=[{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?D("signout"):("/update-user"===e||"/update-session"===e)&&D("updateUser")}}];for(let e of P)e.getAtoms&&Object.assign(Y,e.getAtoms?.(v)),e.pathMethods&&Object.assign(j,e.pathMethods),e.atomListeners&&H.push(...e.atomListeners);let z={notify:e=>{Y[e].set(!Y[e].get())},listen:(e,t)=>{Y[e].subscribe(t)},atoms:Y};for(let t of P)t.getActions&&(C=M(t.getActions?.(v,z,e)??{},C));return{get baseURL(){return o},pluginsActions:C,pluginsAtoms:Y,pluginPathMethods:j,atomListeners:H,$fetch:v,$store:z}})(e),p={};for(let[e,t]of Object.entries(o))p[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let n=(0,eu.useRef)(e.get()),{keys:r,deps:o=[e,r]}=t,i=(0,eu.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,n,r)})}return e.listen(o)},o),a=()=>n.current;return(0,eu.useSyncExternalStore)(i,a,a)})(t);return t={...r,...p,$fetch:i,$store:s},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 s="/"+r.map(el).join("/"),l=a[0]||{},c=a[1]||{},{query:d,fetchOptions:E,...f}=l,_={...c,...E},p=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")}(s,n,l);return await i(s,{..._,body:"GET"===p?void 0:{...f,..._?.body||{}},query:d||_?.query,method:p,async onSuccess(e){if(await _?.onSuccess?.(e),!u||_.disableSignal)return;let t=u.filter(e=>e.matcher(s));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?.(s)}}})}})}()}},722:(e,t,n)=>{n.d(t,{eU:()=>a});let r=[],o=0,i=globalThis.nanostoresGlobal||={epoch:0},a=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=o+4;t<r.length;)r[t]===e?r.splice(t,4):t+=4;let i=t.indexOf(e);~i&&(t.splice(i,1),--n.lc||n.off())}),notify(e,a){i.epoch++;let s=!r.length;for(let o of t)r.push(o,n.value,e,a);if(s){for(o=0;o<r.length;o+=4)r[o](r[o+1],r[o+2],r[o+3]);r.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}},1787:(e,t,n)=>{n.d(t,{OS:()=>o,Rc:()=>i});let r=(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])}),o=(e,t)=>r(e,t,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}}),i=(e,t)=>r(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}})},7514:(e,t,n)=>{n.d(t,{$l:()=>i});let r={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_IMPLEMENT
1ED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};var o=class extends Error{constructor(e="INTERNAL_SERVER_ERROR",t,n={},o="number"==typeof e?e:r[e]){super(t?.message,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){class n extends e{#e;constructor(...e){if(function(){let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return void 0===e?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,"writable")?e.writable:void 0!==e.set}()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=function(e){let t=e.split("\n    at ");return t.length<=1?e:(t.splice(1,1),t.join("\n    at "))}(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}Object.defineProperty(n.prototype,"constructor",{get:()=>t,enumerable:!1,configurable:!0})}(o,Error);var i=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}}},8711:(e,t,n)=>{n.d(t,{VY:()=>g});var r=n(294),o=n(722),i=n(1787);let a=()=>"undefined"==typeof window;function s(e,t){return(0,r.r)(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}let l=(e,t,n,l)=>{let u=(0,o.eU)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>c(e)});(0,r.K)(u,s);let c=async e=>new Promise(o=>{let i="function"==typeof l?l({data:u.get().data,error:u.get().error,isPending:u.get().isPending}):l;n(t,{...i,query:{...i?.query,...e?.query},async onSuccess(e){let t=u.get(),n=null!=t.data&&null!=e.data&&(0,r.r)(t.data,e.data)?t.data:e.data;u.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:u.value.refetch}),await i?.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 o=401===e.error.status;u.set({error:e.error,data:o?null:u.get().data,isPending:!1,isRefetching:!1,refetch:u.value.refetch}),await i?.onError?.(e)},async onRequest(e){let t=u.get();u.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:u.value.refetch}),await i?.onRequest?.(e)}}).catch(e=>{u.set({error:e,data:u.get().data,isPending:!1,isRefetching:!1,refetch:u.value.refetch})}).finally(()=>{o(void 0)})});e=Array.isArray(e)?e:[e];let d=!1,E=[];for(let t of e){let e=t.subscribe(async()=>{a()||(d?await c():(0,i.Rc)(u,()=>{let e=setTimeout(async()=>{d||(d=!0,await c())},0);return()=>{for(let e of E)e();clearTimeout(e)}}))});E.push(e)}return u};var u=n(7514);function c(e){return"OR"===e?"OR":"AND"}function d(e){return Array.isArray(e)}function E(e,t){return"string"==typeof t&&e.includes(t)}let f={newRole: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=>E(e,t)):t.every(t=>E(e,t)))}(e,function(e){if(d(e))return{actions:e,connector:"AND"};if(!e||"object"!=typeof e)throw new u.$l("Invalid access control request");let{actions:t,connector:n}=e;return d(t)?{actions:t,connector:c(n)}:{actions:[],connector:c(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}}},_=f.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),p=f.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),h=f.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),T={admin:_,owner:p,member:h},O=Object.fromEntries(Object.entries({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"}).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}])),g=e=>{let t=(0,o.eU)(!1),n=(0,o.eU)(!1),r=(0,o.eU)(!1),i=(0,o.eU)(!1),a={admin:_,member:h,owner:p,...e?.roles};return{id:"organization",version:"1.6.19",$InferServerPlugin:{},getActions:(t,n,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:t=>(e=>((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})(e,e.options.roles||T))({role:t.role,options:{ac:e?.ac,roles:a},permissions:t.permissions})}}),getAtoms:e=>{let o=l(t,"/organization/list",e,{method:"GET"});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:i,activeOrganization:l([n],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:o,activeMember:l([n,r],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:l([n,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:O}}}}]);

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.