1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9523],{9523:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f,prisma:()=>h});var r,i=n(59072),c=n(96763),o=n(95704);let a=new Set(["P1001","P1002","P1008","P1017","P2024"]);function s(e){var t;return e instanceof i.Prisma.PrismaClientUnknownRequestError&&(null!=(t=null==e?void 0:e.message)?t:"").includes("Engine is not yet connected")}function l(e){if(e instanceof i.Prisma.PrismaClientInitializationError||e instanceof i.Prisma.PrismaClientRustPanicError)return!0;let t=null==e?void 0:e.code;return!!("string"==typeof t&&a.has(t)||s(e))}class u{buildClient(){return new i.PrismaClient({datasources:{db:{url:function(e){var t,n,r;if(!e)throw Error("DATABASE_URL is not defined");let i=[],c=null!=(t=o.env.PRISMA_CONNECTION_LIMIT)?t:"10",a=null!=(n=o.env.PRISMA_POOL_TIMEOUT)?n:"20",s=null!=(r=o.env.PRISMA_CONNECT_TIMEOUT)?r:"15";return(e.includes("connection_limit=")||i.push("connection_limit=".concat(c)),e.includes("pool_timeout=")||i.push("pool_timeout=".concat(a)),e.includes("connect_timeout=")||i.push("connect_timeout=".concat(s)),0===i.length)?e:"".concat(e).concat(e.includes("?")?"&":"?").concat(i.join("&"))}(o.env.DATABASE_URL)}},log:"1"===o.env.PRISMA_LOG_QUERY?["query"]:["error"],errorFormat:"pretty"})}initializeClient(){try{this.client=this.buildClient(),this.connectPromise=this.client.$connect().catch(e=>{console.error("Initial database $connect failed (queries will recover):",e)})}catch(e){console.error("Failed to initialize database client:",e)}}async getClient(){if(!this.client)throw new c.MP;return this.connectPromise&&(await this.connectPromise,this.connectPromise=null),this.client}async execute(e){let t=await this.getClient();try{return await e(t)}catch(o){if(!(0,c.qI)(o)&&!l(o))throw o;let t=[100,250,500],n=o instanceof i.Prisma.PrismaClientRustPanicError,r=o;for(let i=0;i<t.length;i++){console.warn("Database operation hit connectivity error; reconnect+retry attempt ".concat(i+1,"/").concat(t.length,":"),r),await new Promise(e=>setTimeout(e,t[i]));try{let t=0!==i||n?"replace":"heal",r=await this.recoverClient(t);return await e(r)}catch(e){if(r=e,!(0,c.qI)(e)&&!l(e))throw e}}throw console.error("Database recovery exhausted all attempts; surfacing DATABASE_UNAVAILABLE. Last error:",r),new c.MP}}async executeOnce(e){let t=await this.getClient();try{return await e(t)}catch(t){if(s(t)){console.warn("executeOnce: engine not connected (query never dispatched); recovering and retrying once:",t);try{let t=await this.recoverClient("replace");return await e(t)}catch(e){if((0,c.qI)(e)||l(e))throw console.error("executeOnce: retry after recovery failed:",e),new c.MP;throw e}}if((0,c.qI)(t)||l(t))throw console.error("executeOnce: connectivity error on non-retryable operation:",t),new c.MP;throw t}}async recoverClient(e){if(this.recoverPromise)return this.recoverPromise;this.recoverPromise=(async()=>{let t=this.client;if(!t){this.initializeClient();let e=this.client;if(!e)throw new c.MP;return this.connectPromise&&(await this.connectPromise,this.connectPromise=null),e}if("heal"===e)return await t.$connect(),t;let n=this.buildClient();return await n.$connect(),this.client=n,this.connectPromise=null,t.$disconnect().catch(()=>{}),n})();try{return await this.recoverPromise}finally{this.recoverPromise=null}}async disconnect(){var e;await (null==(e=this.client)?void 0:e.$disconnect())}constructor(){this.client=null,this.connectPromise=null,this.recoverPromise=null,this.initializeClient()}}let h=null!=(r=globalThis.__xclausePrisma)?r:function(e){return new Proxy({},{get(t,n){if("string"==typeof n){if("$disconnect"===n)return()=>e.disconnect();if("$connect"===n)return async()=>(await e.getClient()).$connect();if("$queryRaw"===n||"$queryRawUnsafe"===n)return async function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.execute(e=>e[n](...r))};if("$executeRaw"===n||"$executeRawUnsafe"===n)return async function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.executeOnce(e=>e[n](...r))};if("$transaction"===n)return async function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return"function"==typeof r[0]?e.executeOnce(e=>e[n](...r)):e.execute(e=>e[n](...r))};let t=new Set(["create","createMany","createManyAndReturn","update","updateMany","upsert","delete","deleteMany"]);return new Proxy({},{get(r,i){if("string"==typeof i)return async function(){for(var r=arguments.length,c=Array(r),o=0;o<r;o++)c[o]=arguments[o];return t.has(i)?e.executeOnce(e=>e[n][i](...c)):e.execute(e=>e[n][i](...c))}}})}}})}(new u);globalThis.__xclausePrisma=h;let f=h},96763:(e,t,n)=>{n.d(t,{MP:()=>i,qI:()=>c});let r="DATABASE_UNAVAILABLE";
1class i extends Error{constructor(e="We're experiencing a temporary database connectivity issue. Please try again in a moment."){super(e),this.code="DATABASE_UNAVAILABLE",this.digest=r,this.name="DatabaseUnavailableError",Object.setPrototypeOf(this,i.prototype)}}function c(e){return e instanceof i||"object"==typeof e&&null!==e&&("DATABASE_UNAVAILABLE"===e.code||e.digest===r||"DatabaseUnavailableError"===e.name)}}}]);
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.