Edit: /tmp/tsx-0/17887-af9c909331d78808bb2fde63cd49056c0f568509 (4113B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/context/request-state.mjs\";(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var request_state_exports={};__export(request_state_exports,{defineRequestState:()=>defineRequestState,getCurrentRequestState:()=>getCurrentRequestState,getRequestStateAsyncLocalStorage:()=>getRequestStateAsyncLocalStorage,hasRequestState:()=>hasRequestState,runWithRequestState:()=>runWithRequestState});module.exports=__toCommonJS(request_state_exports);var import_global=require(\"./global.mjs\");var import_async_hooks=require(\"@better-auth/core/async_hooks\");const ensureAsyncStorage=__name(async()=>{const betterAuthGlobal=(0,import_global.__getBetterAuthGlobal)();if(!betterAuthGlobal.context.requestStateAsyncStorage){const AsyncLocalStorage=await(0,import_async_hooks.getAsyncLocalStorage)();betterAuthGlobal.context.requestStateAsyncStorage=new AsyncLocalStorage}return betterAuthGlobal.context.requestStateAsyncStorage},\"ensureAsyncStorage\");async function getRequestStateAsyncLocalStorage(){return ensureAsyncStorage()}__name(getRequestStateAsyncLocalStorage,\"getRequestStateAsyncLocalStorage\");async function hasRequestState(){return(await ensureAsyncStorage()).getStore()!==void 0}__name(hasRequestState,\"hasRequestState\");async function getCurrentRequestState(){const store=(await ensureAsyncStorage()).getStore();if(!store)throw new Error(\"No request state found. Please make sure you are calling this function within a `runWithRequestState` callback.\");return store}__name(getCurrentRequestState,\"getCurrentRequestState\");async function runWithRequestState(store,fn){return(await ensureAsyncStorage()).run(store,fn)}__name(runWithRequestState,\"runWithRequestState\");function defineRequestState(initFn){const ref=Object.freeze({});return{get ref(){return ref},async get(){const store=await getCurrentRequestState();if(!store.has(ref)){const initialValue=await initFn();store.set(ref,initialValue);return initialValue}return store.get(ref)},async set(value){(await getCurrentRequestState()).set(ref,value)}}}__name(defineRequestState,\"defineRequestState\");0&&(module.exports={defineRequestState,getCurrentRequestState,getRequestStateAsyncLocalStorage,hasRequestState,runWithRequestState});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,sXAAsC,wBACtC,uBAAqC,yCAGrC,MAAM,mBAAqB,gBAAY,CACtC,MAAM,oBAAmB,qCAAsB,EAC/C,GAAI,CAAC,iBAAiB,QAAQ,yBAA0B,CACvD,MAAM,kBAAoB,QAAM,yCAAqB,EACrD,iBAAiB,QAAQ,yBAA2B,IAAI,iBACzD,CACA,OAAO,iBAAiB,QAAQ,wBACjC,EAP2B,sBAQ3B,eAAe,kCAAmC,CACjD,OAAO,mBAAmB,CAC3B,CAFe,4EAGf,eAAe,iBAAkB,CAChC,OAAQ,MAAM,mBAAmB,GAAG,SAAS,IAAM,MACpD,CAFe,0CAGf,eAAe,wBAAyB,CACvC,MAAM,OAAS,MAAM,mBAAmB,GAAG,SAAS,EACpD,GAAI,CAAC,MAAO,MAAM,IAAI,MAAM,iHAAiH,EAC7I,OAAO,KACR,CAJe,wDAKf,eAAe,oBAAoB,MAAO,GAAI,CAC7C,OAAQ,MAAM,mBAAmB,GAAG,IAAI,MAAO,EAAE,CAClD,CAFe,kDAGf,SAAS,mBAAmB,OAAQ,CACnC,MAAM,IAAM,OAAO,OAAO,CAAC,CAAC,EAC5B,MAAO,CACN,IAAI,KAAM,CACT,OAAO,GACR,EACA,MAAM,KAAM,CACX,MAAM,MAAQ,MAAM,uBAAuB,EAC3C,GAAI,CAAC,MAAM,IAAI,GAAG,EAAG,CACpB,MAAM,aAAe,MAAM,OAAO,EAClC,MAAM,IAAI,IAAK,YAAY,EAC3B,OAAO,YACR,CACA,OAAO,MAAM,IAAI,GAAG,CACrB,EACA,MAAM,IAAI,MAAO,EACf,MAAM,uBAAuB,GAAG,IAAI,IAAK,KAAK,CAChD,CACD,CACD,CAnBS","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/context/request-state.mjs"],"sourcesContent":[null]}}