PageSourceSearch

https://www.aisafetyforum.au/_next/static/immutable/chunks/2o66z6yxc-04f.js

js aisafetyforum.au collected 2026-10-06 21:38:03 UTC 48,846 bytes, 4 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0f72a-288f-0000-cb0e-6a664d3af57a";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="bc2b9565-e75b-5d38-b9f3-614b4c58387d")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,569296,e=>{"use strict";let t;var r,n,o=e.i(200982);e.i(671232);var i=e.i(292105),s=e.i(896729),a=e.i(313422),l=e.i(247167);let u=(e,t,r,n)=>(e.events=e.events||{},e.events[r+10]||(e.events[r+10]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}),c=(e,t)=>u(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}});function d(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function f(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!f(e[r],t[r]))return!1;return!0}if(d(e)&&d(t)){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!(n in t)||!f(e[n],t[n]))return!1;return!0}return!1}function p(e,t){return u(e,({newValue:r,abort:n})=>{t(e.value,r)&&n()},2,t=>{let r=e.set,n=e.setKey;return e.setKey&&(e.setKey=(r,o)=>{let i;if(t({abort:()=>{i=!0},changed:r,newValue:{...e.value,[r]:o}}),!i)return n(r,o)}),e.set=e=>{let n;if(t({abort:()=>{n=!0},newValue:e}),!n)return r(e)},()=>{e.set=r,e.setKey=n}})}let h=[],E=0,R=globalThis.nanostoresGlobal||={epoch:0},g=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),init:e,lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=E+4;t<h.length;)h[t]===e?h.splice(t,4):t+=4;let n=t.indexOf(e);~n&&(t.splice(n,1),--r.lc||r.off())}),notify(e,n){R.epoch++;let o=!h.length;for(let o of t)h.push(o,r.value,e,n);if(o){for(E=0;E<h.length;E+=4)h[E](h[E+1],h[E+2],h[E+3]);h.length=0}},off(){},set(e){let t=r.value;t!==e&&(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r};function y(e,t){return f(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var T=e.i(938748);let _=(0,T.defineErrorCodes)({OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",TOO_MANY_ATTEMPTS:"Too many attempts"}),b=Object.create(null),O=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?b:globalThis),A=new Proxy(b,{get:(e,t)=>O()[t]??b[t],has:(e,t)=>t in O()||t in b,set:(e,t,r)=>(O(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=O(!0);return delete r[t],!0},ownKeys:()=>Object.keys(O(!0))});function m(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}A.NODE_ENV,Object.freeze({get BETTER_AUTH_SECRET(){return m("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return m("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return m("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return m("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return m("NODE_ENV","development")},get PACKAGE_VERSION(){return m("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return m("BETTER_AUTH_TELEMETRY_ENDPOINT","")}}),(0,T.defineErrorCodes)({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 S=class extends Error{status;body;headers;statusCode;constructor(e="INTERNAL_SERVER_ERROR",t,r={},n="number"==typeof e?e:v[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=r,this.statusCode=n,this.name="APIError",this.status=e,this.headers=r,this.statusCode=n,this.body=t}};Symbol.for("better-call:api-error-headers"),r=S,n=Error,Object.defineProperty((class e extends r{#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:()=>n,enumerable:!1,configurable:!0});var w=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}};function I(e){let t=e.length;for(;t>0&&47===e.charCodeAt(t-1);)t--;return t===e.length?e:e.slice(0,t)}function N(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new w(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof w)throw t;throw new w(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(I(new URL(e).pathname)||"/")}catch{throw new w(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=I(e);return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}let L={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*:/},U=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,D={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},P=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/,C=["javascript:","data:","vbscript:"],k={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!C.includes(t.protocol)}(e.data.url)&&"u">typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},j=Symbol.for("better-auth:broadcast-channel");var x=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??"{}");
1t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function F(e="better-auth.message"){return globalThis[j]||(globalThis[j]=new x(e)),globalThis[j]}let B=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 q(){return globalThis[B]||(globalThis[B]=new M),globalThis[B]}let H=Symbol.for("better-auth:online-manager");var V=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 $(){return globalThis[H]||(globalThis[H]=new V),globalThis[H]}let G=()=>Math.floor(Date.now()/1e3);function K(e){return"object"==typeof e&&null!==e&&"data"in e&&"error"in e?e:{data:e,error:null}}function Y(e,t){return f(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function W(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 J(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",o){if(!W(r))return e(t,{},n,o);let i={...r};for(let r of Object.keys(t)){if("__proto__"===r||"constructor"===r)continue;let s=t[r];null!=s&&(o&&o(i,r,s,n)||(Array.isArray(s)&&Array.isArray(i[r])?i[r]=[...s,...i[r]]:W(s)&&W(i[r])?i[r]=e(s,i[r],(n?`${n}.`:"")+r.toString(),o):i[r]=s))}return i})(t,r,"",e),{})}let Q=J();J((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),J((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var X=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}};let z=async(e,t)=>{let r=t||{},n={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:r,hooks:n};for(let c of(null==t?void 0:t.plugins)||[]){var o,i,s,a,l,u;if(c.init){let t=await (null==(u=c.init)?void 0:u.call(c,e.toString(),r));r=t.options||r,e=t.url}n.onRequest.push(null==(o=c.hooks)?void 0:o.onRequest),n.onResponse.push(null==(i=c.hooks)?void 0:i.onResponse),n.onSuccess.push(null==(s=c.hooks)?void 0:s.onSuccess),n.onError.push(null==(a=c.hooks)?void 0:a.onError),n.onRetry.push(null==(l=c.hooks)?void 0:l.onRetry)}return{url:e,options:r,hooks:n}};var Z=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}},ee=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)}};let et=["get","post","put","patch","delete"];function er(e){if(!e.startsWith("@"))return{method:void 0,path:e};let t=e.indexOf("/"),r=e.slice(1,-1===t?void 0:t);return et.includes(r)?{method:r,path:-1===t?e:e.slice(t+1)}:{method:void 0,path:e}}let en=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;
1if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},eo=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ei(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 es(e){try{return JSON.parse(e)}catch(t){return e}}function ea(e){return"function"==typeof e}function el(...e){let t={};for(let r of e)if(r)if(r instanceof Headers)r.forEach((e,r)=>{t[r]=e});else for(let[e,n]of Array.isArray(r)?r:Object.entries(r))null!=n&&(t[e]=n);return t}async function eu(e){let t=new Headers(el(null==e?void 0:e.headers,await en(e)));if(!t.has("content-type")){let r=ei(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var ec=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function ed(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new ec(r.issues);return r.value}function ef(e){return(ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ep(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ep(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=ef(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ef(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==ef(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ep(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}let eE=async(e,t)=>{var r,n,o,i,s,a,l,u;let c,{hooks:d,url:f,options:p}=await z(e,t),h=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("u">typeof globalThis&&ea(globalThis.fetch))return globalThis.fetch;if("u">typeof window&&ea(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(p),E=new AbortController,R=null!=(r=p.signal)?r:E.signal,g=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"",{path:s}=er(e);s!==e&&(e=`/${s}`),i.endsWith("/")||(i+="/");let[a,l]=e.replace(i,"").split("?"),u=new URLSearchParams(l);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)u.append(e,r);continue}else r=JSON.stringify(t);u.set(e,r)}}let c=new Map;if(n)if(Array.isArray(n))for(let[e,t]of a.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];c.set(t,String(r))}else for(let[e,t]of Object.entries(n))c.set(`:${e}`,String(t));a=(a=a.split("/").map(e=>(function(e,t){let r=t.get(e);if(void 0===r)return e.split(":").map(e=>encodeURIComponent(e)).join(":");if("."===r||".."===r)throw TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(r)})(e,c)).join("/")).replace(/^\/+/,"");let d=u.toString();return(d=d.length>0?`?${d}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${a}${d}`,i):`${i}${a}${d}`}(f,p),y=await eu(p),T=function(e,t){let r,{body:n}=e;return n?ei(n)&&"string"!=typeof n?"application/x-www-form-urlencoded"===((r=t.get("content-type"))?r.split(";")[0].trim().toLowerCase():null)?new URLSearchParams(n).toString():JSON.stringify(n):n:null}(p,y),_=function(e,t){if(null==t?void 0:t.method)return t.method.toUpperCase();let{method:r}=er(e);return r?r.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}(f,p),b=eh(eh({},p),{},{url:g,headers:y,body:T,method:_,signal:R});for(let e of d.onRequest)if(e){let t=await e(b);"object"==typeof t&&null!==t&&Object.assign(b,t)}("pipeTo"in b&&"function"==typeof b.pipeTo||"function"==typeof(null==t||null==(n=t.body)?void 0:n.pi
1pe))&&!("duplex"in b)&&(b.duplex="half");let{clearTimeout:O}=(!(null==p?void 0:p.signal)&&(null==p?void 0:p.timeout)&&(c=setTimeout(()=>null==E?void 0:E.abort(),null==p?void 0:p.timeout)),{abortTimeout:c,clearTimeout:()=>{c&&clearTimeout(c)}}),A=await h(b.url,b);O();let m={response:A,request:b};for(let e of d.onResponse)if(e){let r=await e(eh(eh({},m),{},{response:(null==t||null==(i=t.hookOptions)?void 0:i.cloneResponse)?A.clone():A}));r instanceof Response?A=r:"object"==typeof r&&null!==r&&(A=r.response)}if(A.ok){if("HEAD"===b.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return eo.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(A),r={data:null,response:A,request:b};if("json"===e||"text"===e){let e=await A.text();r.data=await (null!=(s=b.jsonParser)?s:es)(e)}else r.data=await A[e]();for(let e of((null==b?void 0:b.output)&&b.output&&!b.disableValidation&&(r.data=await ed(b.output,r.data)),d.onSuccess))e&&await e(eh(eh({},r),{},{response:(null==t||null==(a=t.hookOptions)?void 0:a.cloneResponse)?A.clone():A}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let v=null!=(o=null==t?void 0:t.jsonParser)?o:es,S=await A.text(),w=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(S),I=w?await v(S):null,N={response:A,responseText:S,request:b,error:eh(eh({},I),{},{status:A.status,statusText:A.statusText})};for(let e of d.onError)e&&await e(eh(eh({},N),{},{response:(null==t||null==(l=t.hookOptions)?void 0:l.cloneResponse)?A.clone():A}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new Z({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new Z(e);case"exponential":return new ee(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,A)){for(let e of d.onRetry)e&&await e(m);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await eE(e,eh(eh({},t),{},{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new X(A.status,A.statusText,w?I:S);return{data:null,error:eh(eh({},I),{},{status:A.status,statusText:A.statusText})}},eR=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,eg=/['\u2019]/g;function ey(e){return(e.replace(eg,"").match(eR)??[]).map(e=>e.toLowerCase()).join("-")}var eT=e.i(271645);let e_=function(e){var t;let{pluginPathMethods:r,pluginsActions:n,pluginsAtoms:o,hydrateSession:i,$fetch:s,$store:a,atomListeners:u}=(e=>{var t;let r,n,o,i,s,a,u,d,h,E="credentials"in Request.prototype,R=function(e,t,r,n){if(e)return N(e,t);if(!1!==n){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 N(e,t)}r?.headers.get("x-forwarded-host"),r?.headers.get("x-forwarded-proto");if(r){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(r.url);if(!e)throw new w("Could not get origin from request. Please provide a valid base URL.");return N(e,t)}if("u">typeof window&&window.location)return N(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",y=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:_,onError:b,onRequest:O,onResponse:m,...v}=e?.fetchOptions||{},S=(t={baseURL:R,...E?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let s=e.trim(),a=s.toLowerCase();if(a.length<=9&&a in D)return D[a];
1if(!U.test(s)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(L).some(([e,t])=>{let r=t.test(s);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(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=P.exec(e);if(!t)return null;let[,r,n,o,i,s,a,l,u,c,d]=t,f=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(s,10),parseInt(a,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(c,10)+parseInt(d,10))*("+"===u?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return f instanceof Date&&!isNaN(f.getTime())?f:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...v,plugins:[T,...v.plugins||[],...e?.disableDefaultFetchPlugins?[]:[k],...y]},async function(e,r){let n,o=eh(eh(eh({},t),r),{},{headers:el(null==t?void 0:t.headers,null==r?void 0:r.headers),plugins:[...(null==t?void 0:t.plugins)||[],(n=t||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,s;let a=eh(eh({},t),void 0!==n.query&&{query:eh(eh({},n.query),null==t?void 0:t.query)}),l=(null==(r=n.plugins)||null==(r=r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:r.schema)||n.schema;if(l){let r=e;(null==(o=l.config)?void 0:o.prefix)&&r.startsWith(l.config.prefix)&&(r=r.replace(l.config.prefix,""),l.config.baseURL&&(e=e.replace(l.config.prefix,l.config.baseURL))),(null==(i=l.config)?void 0:i.baseURL)&&r.startsWith(l.config.baseURL)&&(r=r.replace(l.config.baseURL,"")),r.startsWith("/")&&"@"===r.charAt(1)&&(r=r.substring(1));let u=l.schema[r];if(u){let{method:o,path:i}=er(r);o&&(e=e.slice(0,e.length-r.length)+i);let l=null==t?void 0:t.headers;if(u.headers&&!(null==t?void 0:t.disableValidation)){let e={};if(null==t?void 0:t.headers){if(t.headers instanceof Headers)t.headers.forEach((t,r)=>{e[r.toLowerCase()]=t});else if("object"==typeof t.headers)for(let[r,n]of Object.entries(t.headers))null!=n&&(e[r.toLowerCase()]=n)}let r=await ed(u.headers,e),n={};for(let[e,t]of Object.entries(r))n[e.toLowerCase()]=t;l=n}let c=null!=(s=u.method)?s:o;if(a=eh(eh(eh(eh({},a),void 0!==c&&{method:c}),void 0!==u.output&&{output:u.output}),void 0!==l&&{headers:l}),!(null==t?void 0:t.disableValidation)){if(u.query&&(a.query=await ed(u.query,null==t?void 0:t.query),null!==a.query&&"object"==typeof a.query)){let e=eh({},n.query);for(let r of Object.keys(e))(null==t?void 0:t.query)&&Object.prototype.hasOwnProperty.call(t.query,r)&&(e[r]=t.query[r]);a.query=eh(eh({},e),a.query)}a=eh(eh({},a),{},{body:u.input?await ed(u.input,null==t?void 0:t.body):null==t?void 0:t.body,params:u.params?await ed(u.params,null==t?void 0:t.params):null==t?void 0:t.params})}return{url:e,options:a}}}return eh({url:e},(void 0!==t||void 0!==n.query)&&{options:a})}}),...(null==r?void 0:r.plugins)||[]]});if(null==t?void 0:t.catchAllError)try{return await eE(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 eE(e,o)}),{$sessionSignal:I,session:C,broadcastSessionUpdate:j}=(n=g(!1),o=0,i=0,n.listen(()=>{i++,o=0}),p(a=g({data:null,error:null,isPending:!0,isRefetching:!1,refetch:s=e=>d(e)}),Y),u=async(e,t)=>{let r=a.value;if(a.set({...r,isPending:null===r.data,isRefetching:!0,error:null,refetch:s}),e.aborted)return"aborted";try{var n;let r=await S("/get-session",{method:"GET",query:t?.query,signal:e});if(e.aborted)return"aborted";let{data:o,error:i}=K(r),l="fresh";if(o?.needsRefresh)try{let t=await S("/get-session",{method:"POST",signal:e});if(e.aborted)return"aborted";({data:o,error:i}=K(t))}catch{if(e.aborted)return"aborted";l="stale"}if(i){let e=a.value,t=i?.status===401;return a.set({data:t?null:e.data,error:i,isPending:!1,isRefetching:!1,refetch:s}),"failed"}let u=(n=o)&&(null!==n.session||null!==n.user)?n:null,c=a.value,d=null!=c.data&&null!=u&&f(c.data,u)?c.data:u;return a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:s}),l}catch(r){if(e.aborted)return"aborted";let t=a.value;return a.set({data:t.data,error:r,isPending:!1,isRefetching:!1,refetch:s}),"failed"}},d=e=>{o=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?"aborted":u(t.signal,e)),revision:i};r=n;let s=e=>{if(r===n){let t,s;r=void 0,"fresh"===e&&n.revision===i&&(s=(t=a.value.data?.session?.expiresAt)instanceof Date?t.getTime():1/0,o=Math.min(Date.now()+1e3,s))}};return n.promise.then(s,()=>s("failed")),n.promise.then(()=>void 0)},h=()=>{},c(a,()=>{let t;"u"<typeof window||(t=setTimeout(()=>{r?.revision===i?r.promise.then(()=>void 0):Date.now()<o?Promise.resolve():d()},0));let s=function(e){let{fetchSession:t,shouldPollSession:r=()=>!0,sessionSignal:n,options:o={}}=e,i=o.sessionOptions?.refetchInterval??0,s=o.sessionOptions?.refetchOnWindowFocus??!0,a=o.sessionOptions?.refetchWhenOffline??!1,l={isInitialized:!1,lastSessionRequest:0},u=e=>{if(a||$().isOnline){if(e?.event==="storage")return void t();if(e?.event==="poll"){l.lastSessionRequest=G(),t();return}if(e?.event==="visibilitychange"){if(G()-l.lastSessionRequest<5)return;l.lastSessionRequest=G(),t();return}t()}};return{init:()=>{l.isInitialized||(l.isInitialized=!0,i&&i>0&&(l.pollInterval=setInterval(()=>{r()&&u({event:"poll"})},1e3*i)),l.unsubscribeBroadcast=F().subscribe(()=>{u({event:"storage"})}),s&&(l.unsubscribeFocus=q().subscribe(()=>{u({event:"visibilitychange"})})),l.unsubscribeOnline=$().subscribe(e=>{e&&u({event:"visibilitychange"})}),l.unsubscribeSignal=n.listen(()=>{t()}),l.cleanupBroadcastSetup=F().setup(),l.cleanupFocusSetup=q().setup(),l.cleanupOnlineSetup=$().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=>{F().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}({fetchSession:d,shouldPollSession:()=>null!=a.value.data,sessionSignal:n,options:e});return s.init(),h=s.broadcastSessionUpdate,()=>{t&&clearTimeout(t),s.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>h(e)}),x=!1,B=e?.plugins||[],M={},H={$sessionSignal:I,session:C}
1,V={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},W=[{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?j("signout"):("/update-user"===e||"/update-session"===e)&&j("updateUser")}}];for(let e of B)e.getAtoms&&Object.assign(H,e.getAtoms?.(S)),e.pathMethods&&Object.assign(V,e.pathMethods),e.atomListeners&&W.push(...e.atomListeners);let J={notify:e=>{H[e].set(!H[e].get())},listen:(e,t)=>{H[e].subscribe(t)},atoms:H};for(let t of B)t.getActions&&(M=Q(t.getActions?.(S,J,e)??{},M));return{get baseURL(){return R},pluginsActions:M,pluginsAtoms:H,pluginPathMethods:V,atomListeners:W,hydrateSession:e=>{x||null===e||(x=!0,function(e,t){if("u"<typeof window)return;let r=e.get();null===r.data&&null!==t&&e.set({...r,data:t,error:null,isPending:!1})}(C,e))},$sessionSignal:I,$fetch:S,$store:J}})(e),d={};for(let[e,t]of Object.entries(o))d[function(e){return`use${e.charAt(0).toUpperCase()+e.slice(1)}`}(e)]=()=>(function(e,t={}){let r=(0,eT.useRef)(e.get()),{keys:n,deps:o=[e,n]}=t,i=(0,eT.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n).add(void 0),e.listen((e,r,n)=>{t.has(n)&&o(e)})}return e.listen(o)},o),s=()=>r.current;return(0,eT.useSyncExternalStore)(i,s,s)})(t);return t={...n,...d,hydrateSession:i,$fetch:s,$store:a},function e(n=[]){return new Proxy(function(){},{get(r,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let s=[...n,o],a=t;for(let e of s)if(a&&"object"==typeof a&&e in a)a=a[e];else{a=void 0;break}return"function"==typeof a?a:"object"==typeof(i=a)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?a:e(s)},apply:async(e,t,i)=>{let a="/"+n.map(ey).join("/"),l=i[0]||{},c=i[1]||{},{query:d,fetchOptions:f,...p}=l,h={...c,...f},E=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...s}=r||{};return n||(o?.method?o.method:s&&Object.keys(s).length>0?"POST":"GET")}(a,r,l);return await s(a,{...h,body:"GET"===E?void 0:{...p,...h?.body||{}},query:d||h?.query,method:E,async onSuccess(e){if(await h?.onSuccess?.(e),!u||h.disableSignal)return;let t=u.filter(e=>e.matcher(a));if(!t.length)return;let r=new Set;for(let e of t){let t=o[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10),e.callback?.(a)}}})}})}()}({baseURL:window.location.origin,plugins:[{id:"email-otp",version:"1.7.5",$InferServerPlugin:{},atomListeners:[{matcher:e=>"/email-otp/verify-email"===e||"/sign-in/email-otp"===e||"/email-otp/request-email-change"===e,signal:"$sessionSignal"}],$ERROR_CODES:_},(t=g(),{id:"passkey",version:o.t,$InferServerPlugin:{},getActions:(e,r)=>((e,{$listPasskeys:t,$store:r})=>({signIn:{passkey:async(n,a)=>{let l,u=await e("/passkey/generate-authenticate-options",{method:"GET",throw:!1});if(!u.data)return u;let c=u.data.extensions||n?.extensions?{...u.data.extensions||{},...n?.extensions||{}}:void 0;try{l=await (0,s.startAuthentication)({optionsJSON:{...u.data,extensions:c},useBrowserAutofill:n?.autoFill})}catch(e){return{data:null,error:{code:e instanceof i.WebAuthnError?e.code:"AUTH_CANCELLED",message:o.n.AUTH_CANCELLED.message,status:400,statusText:"BAD_REQUEST"}}}try{let{clientExtensionResults:o,...i}=l,s=await e("/passkey/verify-authentication",{body:{response:i},...n?.fetchOptions,...a,method:"POST",throw:!1});if(t.set(Math.random()),r.notify("$sessionSignal"),n?.returnWebAuthnResponse)return{...s,webauthn:{response:l,clientExtensionResults:o}};return s}catch(e){return console.error("[Better Auth] Error verifying passkey",e),{data:null,error:{code:"AUTH_CANCELLED",message:o.n.AUTH_CANCELLED.message,status:400,statusText:"BAD_REQUEST"}}}}},passkey:{addPasskey:async(n,s)=>{let l=await e("/passkey/generate-register-options",{method:"GET",query:{...n?.authenticatorAttachment&&{authenticatorAttachment:n.authenticatorAttachment},...n?.name&&{name:n.name},...n?.context&&{context:n.context}},throw:!1});if(!l.data)return l;try{let o=l.data.extensions||n?.extensions?{...l.data.extensions||{},...n?.extensions||{}}:void 0,i=await (0,a.startRegistration)({optionsJSON:{...l.data,extensions:o},useAutoRegister:n?.useAutoRegister}),{clientExtensionResults:u,...c}=i,d=await e("/passkey/verify-registration",{...n?.fetchOptions,...s,body:{response:c,name:n?.name,...n?.createSession&&{createSession:!0}},method:"POST",throw:!1});if(!d.data)return d;if(t.set(Math.random()),d.data.session&&r.notify("$sessionSignal"),n?.returnWebAuthnResponse)return{...d,webauthn:{response:i,clientExtensionResults:u}};return d}catch(e){if(e instanceof i.WebAuthnError){if("ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED"===e.code)return{data:null,error:{code:e.code,message:o.n.PREVIOUSLY_REGISTERED.message,status:400,statusText:"BAD_REQUEST"}};if("ERROR_CEREMONY_ABORTED"===e.code)return{data:null,error:{code:e.code,message:o.n.REGISTRATION_CANCELLED.message,status:400,statusText:"BAD_REQUEST"}};return{data:null,error:{code:e.code,message:e.message,status:400,statusText:"BAD_REQUEST"}}}return{data:null,error:{code:"UNKNOWN_ERROR",message:e instanceof Error?e.message:o.n.UNKNOWN_ERROR.message,status:500,statusText:"INTERNAL_SERVER_ERROR"}}}}},$Infer:{}}))(e,{$listPasskeys:t,$store:r}),getAtoms:e=>{var r,n;let o,i,s,a,l,u;return{listPasskeys:(r=t,n={method:"GET"},c(o=g({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>i(e)}),()=>p(o,y)),i=async t=>new Promise(r=>{let i="function"==typeof n?n({data:o.get().data,error:o.get().error,
1isPending:o.get().isPending}):n;e("/passkey/list-user-passkeys",{...i,query:{...i?.query,...t?.query},async onSuccess(e){let t=o.get(),r=null!=t.data&&null!=e.data&&f(t.data,e.data)?t.data:e.data;o.set({data:r,error:null,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await i?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,n=t.retryAttempt||0;if(r&&n<r)return;let s=401===e.error.status;o.set({error:e.error,data:s?null:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch}),await i?.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 i?.onRequest?.(e)}}).catch(e=>{o.set({error:e,data:o.get().data,isPending:!1,isRefetching:!1,refetch:o.value.refetch})}).finally(()=>{r(void 0)})}),r=Array.isArray(r)?r:[r],s=!1,a=!1,l=!1,u=()=>{if(s){l=!0;return}s=!0,i().finally(()=>{s=!1;let e=l&&a;l=!1,e&&u()})},c(o,()=>{let e;if("u"<typeof window)return;a=!0;let t=!1,n=r.map(r=>r.listen(()=>{t?i():(t=!0,clearTimeout(e),u())}));return e=setTimeout(()=>{t=!0,u()},0),()=>{for(let e of(a=!1,n))e();clearTimeout(e)}}),o),$listPasskeys:t}},pathMethods:{"/passkey/register":"POST","/passkey/authenticate":"POST"},atomListeners:[{matcher:e=>"/passkey/verify-registration"===e||"/passkey/delete-passkey"===e||"/passkey/update-passkey"===e||"/sign-out"===e,signal:"$listPasskeys"},{matcher:e=>"/passkey/verify-authentication"===e,signal:"$sessionSignal"}],$ERROR_CODES:o.n})]}),{useSession:eb}=e_;e.s(["authClient",0,e_,"useSession",0,eb],569296)},572977,e=>{"use strict";e.s(["getPasskeyName",0,function(){if("u"<typeof navigator)return"Primary passkey";let e=navigator.userAgent,t="Device";e.includes("Mac")?t="Mac":e.includes("iPhone")?t="iPhone":e.includes("iPad")?t="iPad":e.includes("Android")?t="Android":e.includes("Windows")&&(t="Windows");let r="Browser";return e.includes("Edg")?r="Edge":e.includes("Chrome")?r="Chrome":e.includes("Firefox")?r="Firefox":e.includes("Safari")&&(r="Safari"),`${r} on ${t}`}
1])},200982,938748,e=>{"use strict";function t(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}e.s(["defineErrorCodes",0,t],938748);let r=t({CHALLENGE_NOT_FOUND:"Challenge not found",YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:"You are not allowed to register this passkey",FAILED_TO_VERIFY_REGISTRATION:"Failed to verify registration",PASSKEY_NOT_FOUND:"Passkey not found",AUTHENTICATION_FAILED:"Authentication failed",UNABLE_TO_CREATE_SESSION:"Unable to create session",USER_NOT_FOUND:"User not found",FAILED_TO_UPDATE_PASSKEY:"Failed to update passkey",PREVIOUSLY_REGISTERED:"Previously registered",REGISTRATION_CANCELLED:"Registration cancelled",AUTH_CANCELLED:"Auth cancelled",UNKNOWN_ERROR:"Unknown error",SESSION_REQUIRED:"Passkey registration requires an authenticated session",RESOLVE_USER_REQUIRED:"Passkey registration requires either an authenticated session or a resolveUser callback when requireSession is false",RESOLVED_USER_INVALID:"Resolved user is invalid"});e.s(["n",0,r,"t",0,"1.7.5"],200982)},671232,292105,414863,313422,896729,e=>{"use strict";function t(e){let t=new Uint8Array(e),r="";for(let e of t)r+=String.fromCharCode(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function r(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4,n=atob(t.padEnd(t.length+r,"=")),o=new ArrayBuffer(n.length),i=new Uint8Array(o);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return o}function n(){return o.stubThis(globalThis?.PublicKeyCredential!==void 0&&"function"==typeof globalThis.PublicKeyCredential)}let o={stubThis:e=>e};function i(e){let{id:t}=e;return{...e,id:r(t),transports:e.transports}}function s(e){return"localhost"===e||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}class a extends Error{constructor({message:e,code:t,cause:r,name:n}){super(e,{cause:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=n??r.name,this.code=t}}e.s(["WebAuthnError",0,a],292105);let l=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};e.s(["WebAuthnAbortService",0,l],414863);let u=["cross-platform","platform"];function c(e){if(e&&!(0>u.indexOf(e)))return e}async function d(e){let o,u,d,p,h;!e.optionsJSON&&e.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:E,useAutoRegister:R=!1}=e;if(!n())throw Error("WebAuthn is not supported in this browser");let g={...E,challenge:r(E.challenge),user:{...E.user,id:r(E.user.id)},excludeCredentials:E.excludeCredentials?.map(i)},y={};R&&(y.mediation="conditional"),y.publicKey=g,y.signal=l.createNewAbortSignal();try{o=await navigator.credentials.create(y)}catch(e){throw function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new a({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(r.authenticatorSelection?.requireResidentKey===!0)return new a({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&r.authenticatorSelection?.userVerification==="required")return new a({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if(r.authenticatorSelection?.userVerification==="required")return new a({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new a({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new a({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new a(0===r.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=globalThis.location.hostname;if(!s(t))return new a({message:`${globalThis.location.hostname}
1 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rp.id!==t)return new a({message:`The RP ID "${r.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(r.user.id.byteLength<1||r.user.id.byteLength>64)return new a({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new a({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}({error:e,options:y})}if(!o)throw Error("Registration was not completed");let{id:T,rawId:_,response:b,type:O}=o;if("function"==typeof b.getTransports&&(d=b.getTransports()),"function"==typeof b.getPublicKeyAlgorithm)try{p=b.getPublicKeyAlgorithm()}catch(e){f("getPublicKeyAlgorithm()",e)}if("function"==typeof b.getPublicKey)try{let e=b.getPublicKey();null!==e&&(h=t(e))}catch(e){f("getPublicKey()",e)}if("function"==typeof b.getAuthenticatorData)try{u=t(b.getAuthenticatorData())}catch(e){f("getAuthenticatorData()",e)}return{id:T,rawId:t(_),response:{attestationObject:t(b.attestationObject),clientDataJSON:t(b.clientDataJSON),transports:d,publicKeyAlgorithm:p,publicKey:h,authenticatorData:u},type:O,clientExtensionResults:o.getClientExtensionResults(),authenticatorAttachment:c(o.authenticatorAttachment)}}function f(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
2`,t)}e.s(["startRegistration",0,d],313422);let p=e=>e;async function h(e){let o,u,d;!e.optionsJSON&&e.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),e={optionsJSON:e});let{optionsJSON:f,useBrowserAutofill:h=!1,verifyBrowserAutofillInput:E=!0}=e;if(!n())throw Error("WebAuthn is not supported in this browser");f.allowCredentials?.length!==0&&(o=f.allowCredentials?.map(i));let R={...f,challenge:r(f.challenge),allowCredentials:o},g={};if(h){if(!await function(){if(!n())return p(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?p(new Promise(e=>e(!1))):p(e.isConditionalMediationAvailable())}())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&E)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');g.mediation="conditional",R.allowCredentials=[]}g.publicKey=R,g.signal=l.createNewAbortSignal();try{u=await navigator.credentials.get(g)}catch(e){throw function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new a({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new a({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=globalThis.location.hostname;if(!s(t))return new a({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new a({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new a({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}({error:e,options:g})}if(!u)throw Error("Authentication was not completed");let{id:y,rawId:T,response:_,type:b}=u;return _.userHandle&&(d=t(_.userHandle)),{id:y,rawId:t(T),response:{authenticatorData:t(_.authenticatorData),clientDataJSON:t(_.clientDataJSON),signature:t(_.signature),userHandle:d},type:b,clientExtensionResults:u.getClientExtensionResults(),authenticatorAttachment:c(u.authenticatorAttachment)}}e.s(["startAuthentication",0,h],896729),e.s([],671232)}]);
3
4//# chunkId=bc2b9565-e75b-5d38-b9f3-614b4c58387d

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.