@superinterface/server 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_btwyo7 +1 -1
  5. package/.next/fallback-build-manifest.json +2 -2
  6. package/.next/server/app/_not-found.html +1 -1
  7. package/.next/server/app/_not-found.rsc +1 -1
  8. package/.next/server/app/index.html +1 -1
  9. package/.next/server/app/index.rsc +1 -1
  10. package/.next/server/chunks/[root-of-the-server]__228bff78._.js +10 -10
  11. package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +1 -1
  12. package/.next/server/chunks/[root-of-the-server]__3307123c._.js +10 -10
  13. package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +1 -1
  14. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +10 -10
  15. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +1 -1
  16. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +10 -10
  17. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +1 -1
  18. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +10 -10
  19. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +1 -1
  20. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +10 -10
  21. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +1 -1
  22. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +10 -10
  23. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +1 -1
  24. package/.next/server/pages/404.html +1 -1
  25. package/.next/server/pages/500.html +1 -1
  26. package/.next/trace +1 -1
  27. package/dist/lib/prisma/index.d.ts.map +1 -1
  28. package/dist/lib/prisma/index.js +11 -4
  29. package/package.json +11 -3
  30. /package/.next/static/{X1k4ISA6YteJsnJalPLxm → jt8inwg6nWaLQZ4qpiSJ-}/_buildManifest.js +0 -0
  31. /package/.next/static/{X1k4ISA6YteJsnJalPLxm → jt8inwg6nWaLQZ4qpiSJ-}/_clientMiddlewareManifest.json +0 -0
  32. /package/.next/static/{X1k4ISA6YteJsnJalPLxm → jt8inwg6nWaLQZ4qpiSJ-}/_ssgManifest.js +0 -0
@@ -16,23 +16,23 @@ ${t}`))}function B(){let e=new AbortController;return e.abort(Object.definePrope
16
16
  Read more: https://nextjs.org/docs/messages/middleware-request-page
17
17
  `)}}class s extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
18
18
  Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
19
- `)}}},60306,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{INTERNALS:function(){return a},NextRequest:function(){return u}});let n=e.r(95340),i=e.r(68794),s=e.r(31048),o=e.r(89193),a=Symbol("internal request");class u extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let s=new n.NextURL(r,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[a]={cookies:new o.RequestCookies(this.headers),nextUrl:s,url:s.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[a].cookies}get nextUrl(){return this[a].nextUrl}get page(){throw new s.RemovedPageError}get ua(){throw new s.RemovedUAError}get url(){return this[a].url}}},24173,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextResponse",{enumerable:!0,get:function(){return h}});let n=e.r(89193),i=e.r(95340),s=e.r(68794),o=e.r(99667),a=e.r(89193),u=Symbol("internal response"),c=new Set([301,302,303,307,308]);function l(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class h extends Response{constructor(e,t={}){super(e,t);let r=this.headers,c=new Proxy(new a.ResponseCookies(r),{get(e,i,s){switch(i){case"delete":case"set":return(...s)=>{let o=Reflect.apply(e[i],e,s),u=new Headers(r);return o instanceof a.ResponseCookies&&r.set("x-middleware-set-cookie",o.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),l(t,u),o};default:return o.ReflectAdapter.get(e,i,s)}}});this[u]={cookies:c,url:t.url?new i.NextURL(t.url,{headers:(0,s.toNodeOutgoingHttpHeaders)(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[u].cookies}static json(e,t){let r=Response.json(e,t);return new h(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!c.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",(0,s.validateURL)(e)),new h(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,s.validateURL)(e)),l(t,r),new h(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),l(e,t),new h(null,{...e,headers:t})}}},17878,(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageResponse",{enumerable:!0,get:function(){return n}})},35235,(e,t,r)=>{(()=>{var r={226:function(t,r){!function(n,i){"use strict";var s="function",o="undefined",a="object",u="string",c="major",l="model",h="name",f="type",d="vendor",p="version",g="architecture",m="console",y="mobile",b="tablet",v="smarttv",_="wearable",w="embedded",E="Amazon",S="Apple",R="ASUS",x="BlackBerry",A="Browser",T="Chrome",P="Firefox",O="Google",C="Huawei",I="Microsoft",N="Motorola",L="Opera",M="Samsung",D="Sharp",k="Sony",B="Xiaomi",j="Zebra",U="Facebook",F="Chromium OS",q="Mac OS",$=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},G=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},H=function(e,t){return typeof e===u&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},Q=function(e,t){for(var r,n,o,u,c,l,h=0;h<t.length&&!c;){var f=t[h],d=t[h+1];for(r=n=0;r<f.length&&!c&&f[r];)if(c=f[r++].exec(e))for(o=0;o<d.length;o++)l=c[++n],typeof(u=d[o])===a&&u.length>0?2===u.length?typeof u[1]==s?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==s||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):void 0:this[u[0]]=l?u[1].call(this,l,u[2]):void 0:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):i):this[u]=l||i;h+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(H(t[r][n],e))return"?"===r?i:r}else if(H(t[r],e))return"?"===r?i:r;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,p],[/opios[\/ ]+([\w\.]+)/i],[p,[h,L+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[h,L]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[h,"UC"+A]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+A],p],[/\bfocus\/([\w\.]+)/i],[p,[h,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[h,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[h,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[h,"MIUI "+A]],[/fxios\/([-\w\.]+)/i],[p,[h,P]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+A]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+A],p],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[h,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,T+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[h,"Android "+A]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[p,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[h,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[h,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,p],[/(cobalt)\/([\w\.]+)/i],[h,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,V]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,M],[f,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,M],[f,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[d,S],[f,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[f,b]],[/(macintosh);/i],[l,[d,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,D],[f,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,C],[f,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,C],[f,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,B],[f,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,B],[f,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[f,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[f,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[f,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,N],[f,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,N],[f,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,"LG"],[f,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,"LG"],[f,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[f,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[f,y]],[/(pixel c)\b/i],[l,[d,O],[f,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[f,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,k],[f,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,k],[f,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[f,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,E],[f,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,E],[f,y]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[f,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,x],[f,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,R],[f,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,R],[f,y]],[/(nexus 9)/i],[l,[d,"HTC"],[f,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[f,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[f,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[f,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[f,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[f,b]],[/(surface duo)/i],[l,[d,I],[f,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[f,y]],[/(u304aa)/i],[l,[d,"AT&T"],[f,y]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[f,y]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[f,b]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[f,b]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[f,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[f,b]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[f,b]],[/\b(k88) b/i],[l,[d,"ZTE"],[f,b]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[f,y]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[f,y]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[f,b]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[f,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[f,b]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[f,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[f,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[f,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[f,y]],[/\b(ph-1) /i],[l,[d,"Essential"],[f,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[f,b]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[f,b]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[f,b]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[f,b]],[/(sprint) (\w+)/i],[d,l,[f,y]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,I],[f,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,j],[f,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,j],[f,y]],[/smart-tv.+(samsung)/i],[d,[f,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,M],[f,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[f,v]],[/(apple) ?tv/i],[d,[l,S+" TV"],[f,v]],[/crkey/i],[[l,T+"cast"],[d,O],[f,v]],[/droid.+aft(\w)( bui|\))/i],[l,[d,E],[f,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,D],[f,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,k],[f,v]],[/(mitv-\w{5}) bui/i],[l,[d,B],[f,v]],[/Hbbtv.*(technisat) (.*);/i],[d,l,[f,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[l,W],[f,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[f,m]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[f,m]],[/(playstation [345portablevi]+)/i],[l,[d,k],[f,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,I],[f,m]],[/((pebble))app/i],[d,l,[f,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[d,S],[f,_]],[/droid.+; (glass) \d/i],[l,[d,O],[f,_]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,j],[f,_]],[/(quest( 2| pro)?)/i],[l,[d,U],[f,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[f,w]],[/(aeobc)\b/i],[l,[d,E],[f,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[f,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[f,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,y]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[h,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[p,Y,X]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[p,Y,X]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,q],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,p],[/\(bb(10);/i],[p,[h,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[h,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[h,T+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,p],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,p]]},K=function(e,t){if(typeof e===a&&(t=e,e=i),!(this instanceof K))return new K(e,t).getResult();var r=typeof n!==o&&n.navigator?n.navigator:i,m=e||(r&&r.userAgent?r.userAgent:""),v=r&&r.userAgentData?r.userAgentData:i,_=t?$(z,t):z,w=r&&r.userAgent==m;return this.getBrowser=function(){var e,t={};return t[h]=i,t[p]=i,Q.call(t,m,_.browser),t[c]=typeof(e=t[p])===u?e.replace(/[^\d\.]/g,"").split(".")[0]:i,w&&r&&r.brave&&typeof r.brave.isBrave==s&&(t[h]="Brave"),t},this.getCPU=function(){var e={};return e[g]=i,Q.call(e,m,_.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[l]=i,e[f]=i,Q.call(e,m,_.device),w&&!e[f]&&v&&v.mobile&&(e[f]=y),w&&"Macintosh"==e[l]&&r&&typeof r.standalone!==o&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[l]="iPad",e[f]=b),e},this.getEngine=function(){var e={};return e[h]=i,e[p]=i,Q.call(e,m,_.engine),e},this.getOS=function(){var e={};return e[h]=i,e[p]=i,Q.call(e,m,_.os),w&&!e[h]&&v&&"Unknown"!=v.platform&&(e[h]=v.platform.replace(/chrome os/i,F).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return m},this.setUA=function(e){return m=typeof e===u&&e.length>350?W(e,350):e,this},this.setUA(m),this};if(K.VERSION="1.0.35",K.BROWSER=G([h,p,c]),K.CPU=G([g]),K.DEVICE=G([l,d,f,m,y,v,b,_,w]),K.ENGINE=K.OS=G([h,p]),typeof r!==o)t.exports&&(r=t.exports=K),r.UAParser=K;else if(typeof define===s&&define.amd)e.r,void 0!==K&&e.v(K);else typeof n!==o&&(n.UAParser=K);var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Z=new K;J.ua=Z.getResult(),J.ua.get=function(){return Z.getUA()},J.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)J.ua[r]=t[r]}}}(this)}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}},o=!0;try{r[e].call(s.exports,s,s.exports,i),o=!1}finally{o&&delete n[e]}return s.exports}i.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/ua-parser-js/",t.exports=i(226)})()},43632,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isBot:function(){return i},userAgent:function(){return o},userAgentFromString:function(){return s}});let n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(35235));function i(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function s(e){return{...(0,n.default)(e),isBot:void 0!==e&&i(e)}}function o({headers:e}){return s(e.get("user-agent")||void 0)}},95437,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"URLPattern",{enumerable:!0,get:function(){return n}});let n="undefined"==typeof URLPattern?void 0:URLPattern},92028,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"after",{enumerable:!0,get:function(){return i}});let n=e.r(56704);function i(e){let t=n.workAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});let{afterContext:r}=t;return r.after(e)}},33062,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(e.r(92028),r)},20955,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"connection",{enumerable:!0,get:function(){return c}});let n=e.r(56704),i=e.r(32319),s=e.r(30810),o=e.r(78506),a=e.r(53920),u=e.r(44261);function c(){let e=n.workAsyncStorage.getStore(),t=i.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(e.forceStatic)return Promise.resolve(void 0);if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(t)switch(t.type){case"cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E752",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"private-cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E753",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,a.makeHangingPromise)(t.renderSignal,e.route,"`connection()`");case"prerender-ppr":return(0,s.postponeWithTracking)(e.route,"connection",t.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)("connection",e,t);case"request":return(0,s.trackDynamicDataInDynamicRender)(t),Promise.resolve(void 0)}}(0,i.throwForMissingRequestStore)("connection")}},73298,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{describeHasCheckingStringProperty:function(){return s},describeStringPropertyAccess:function(){return i},wellKnownProperties:function(){return o}});let n=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function i(e,t){return n.test(t)?"`"+e+"."+t+"`":"`"+e+"["+JSON.stringify(t)+"]`"}function s(e,t){let r=JSON.stringify(t);return"`Reflect.has("+e+", "+r+")`, `"+r+" in "+e+"`, or similar"}let o=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule"])},30548,(e,t,r)=>{"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bgBlack:function(){return T},bgBlue:function(){return I},bgCyan:function(){return L},bgGreen:function(){return O},bgMagenta:function(){return N},bgRed:function(){return P},bgWhite:function(){return M},bgYellow:function(){return C},black:function(){return y},blue:function(){return w},bold:function(){return l},cyan:function(){return R},dim:function(){return h},gray:function(){return A},green:function(){return v},hidden:function(){return g},inverse:function(){return p},italic:function(){return f},magenta:function(){return E},purple:function(){return S},red:function(){return b},reset:function(){return c},strikethrough:function(){return m},underline:function(){return d},white:function(){return x},yellow:function(){return _}});let{env:i,stdout:s}=(null==(n=globalThis)?void 0:n.process)??{},o=i&&!i.NO_COLOR&&(i.FORCE_COLOR||(null==s?void 0:s.isTTY)&&!i.CI&&"dumb"!==i.TERM),a=(e,t,r,n)=>{let i=e.substring(0,n)+r,s=e.substring(n+t.length),o=s.indexOf(t);return~o?i+a(s,t,r,o):i+s},u=(e,t,r=e)=>o?n=>{let i=""+n,s=i.indexOf(t,e.length);return~s?e+a(i,t,r,s)+t:e+i+t}:String,c=o?e=>`\x1b[0m${e}\x1b[0m`:String,l=u("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),h=u("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),f=u("\x1b[3m","\x1b[23m"),d=u("\x1b[4m","\x1b[24m"),p=u("\x1b[7m","\x1b[27m"),g=u("\x1b[8m","\x1b[28m"),m=u("\x1b[9m","\x1b[29m"),y=u("\x1b[30m","\x1b[39m"),b=u("\x1b[31m","\x1b[39m"),v=u("\x1b[32m","\x1b[39m"),_=u("\x1b[33m","\x1b[39m"),w=u("\x1b[34m","\x1b[39m"),E=u("\x1b[35m","\x1b[39m"),S=u("\x1b[38;2;173;127;168m","\x1b[39m"),R=u("\x1b[36m","\x1b[39m"),x=u("\x1b[37m","\x1b[39m"),A=u("\x1b[90m","\x1b[39m"),T=u("\x1b[40m","\x1b[49m"),P=u("\x1b[41m","\x1b[49m"),O=u("\x1b[42m","\x1b[49m"),C=u("\x1b[43m","\x1b[49m"),I=u("\x1b[44m","\x1b[49m"),N=u("\x1b[45m","\x1b[49m"),L=u("\x1b[46m","\x1b[49m"),M=u("\x1b[47m","\x1b[49m")},65477,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"LRUCache",{enumerable:!0,get:function(){return s}});class n{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class i{constructor(){this.prev=null,this.next=null}}class s{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new i,this.tail=new i,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r>this.maxSize)return void console.warn("Single item size exceeds maxSize");let i=this.cache.get(e);if(i)i.data=t,this.totalSize=this.totalSize-i.size+r,i.size=r,this.moveToHead(i);else{let i=new n(e,t,r);this.cache.set(e,i),this.addToHead(i),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}},40463,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bootstrap:function(){return u},error:function(){return l},event:function(){return p},info:function(){return d},prefixes:function(){return s},ready:function(){return f},trace:function(){return g},wait:function(){return c},warn:function(){return h},warnOnce:function(){return y}});let n=e.r(30548),i=e.r(65477),s={wait:(0,n.white)((0,n.bold)("○")),error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("⚠")),ready:"▲",info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("✓")),trace:(0,n.magenta)((0,n.bold)("»"))},o={log:"log",warn:"warn",error:"error"};function a(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in o?o[e]:"log",n=s[e];0===t.length?console[r](""):1===t.length&&"string"==typeof t[0]?console[r](" "+n+" "+t[0]):console[r](" "+n,...t)}function u(...e){console.log(" "+e.join(" "))}function c(...e){a("wait",...e)}function l(...e){a("error",...e)}function h(...e){a("warn",...e)}function f(...e){a("ready",...e)}function d(...e){a("info",...e)}function p(...e){a("event",...e)}function g(...e){a("trace",...e)}let m=new i.LRUCache(1e4,e=>e.length);function y(...e){let t=e.join(" ");m.has(t)||(m.set(t,t),h(...e))}},70808,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{getRootParam:function(){return d},unstable_rootParams:function(){return f}});let n=e.r(4784),i=e.r(30810),s=e.r(56704),o=e.r(32319),a=e.r(53920),u=e.r(73298),c=e.r(20635),l=e.r(40463),h=new WeakMap;async function f(){(0,l.warnOnce)("`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.");let e=s.workAsyncStorage.getStore();if(!e)throw Object.defineProperty(new n.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});let t=o.workUnitAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(t.type){case"cache":case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return function(e,t,r){switch(r.type){case"prerender-client":{let e="`unstable_rootParams`";throw Object.defineProperty(new n.InvariantError(`${e} must not be used within a client component. Next.js should be preventing ${e} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}case"prerender":{let n=r.fallbackRouteParams;if(n){for(let i in e)if(n.has(i)){let n=h.get(e);if(n)return n;let i=(0,a.makeHangingPromise)(r.renderSignal,t.route,"`unstable_rootParams`");return h.set(e,i),i}}break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n){for(let s in e)if(n.has(s))return function(e,t,r,n){let s=h.get(e);if(s)return s;let o={...e},a=Promise.resolve(o);return h.set(e,a),Object.keys(e).forEach(s=>{u.wellKnownProperties.has(s)||(t.has(s)?Object.defineProperty(o,s,{get(){let e=(0,u.describeStringPropertyAccess)("unstable_rootParams",s);"prerender-ppr"===n.type?(0,i.postponeWithTracking)(r.route,e,n.dynamicTracking):(0,i.throwToInterruptStaticGeneration)(e,r,n)},enumerable:!0}):a[s]=e[s])}),a}(e,n,t,r)}}}return Promise.resolve(e)}(t.rootParams,e,t);case"private-cache":case"prerender-runtime":case"request":return Promise.resolve(t.rootParams);default:return t}}function d(e){let t=`\`import('next/root-params').${e}()\``,r=s.workAsyncStorage.getStore();if(!r)throw Object.defineProperty(new n.InvariantError(`Missing workStore in ${t}`),"__NEXT_ERROR_CODE",{value:"E764",enumerable:!1,configurable:!0});let i=o.workUnitAsyncStorage.getStore();if(!i)throw Object.defineProperty(Error(`Route ${r.route} used ${t} outside of a Server Component. This is not allowed.`),"__NEXT_ERROR_CODE",{value:"E774",enumerable:!1,configurable:!0});let u=c.actionAsyncStorage.getStore();if(u){if(u.isAppRoute)throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E765",enumerable:!1,configurable:!0});if(u.isAction&&"action"===i.phase)throw Object.defineProperty(Error(`${t} was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.`),"__NEXT_ERROR_CODE",{value:"E766",enumerable:!1,configurable:!0})}switch(i.type){case"unstable-cache":case"cache":throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E760",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":var l=e,h=r,f=i,d=t;if("prerender-client"===f.type)throw Object.defineProperty(new n.InvariantError(`${d} must not be used within a client component. Next.js should be preventing ${d} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});let g=f.rootParams;switch(f.type){case"prerender":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return(0,a.makeHangingPromise)(f.renderSignal,h.route,d);break;case"prerender-ppr":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return p(l,h,f,d)}return Promise.resolve(g[l])}return Promise.resolve(i.rootParams[e])}async function p(e,t,r,n){let s=(0,u.describeStringPropertyAccess)(n,e);switch(r.type){case"prerender-ppr":return(0,i.postponeWithTracking)(t.route,s,r.dynamicTracking);case"prerender-legacy":return(0,i.throwToInterruptStaticGeneration)(s,t,r)}}},49493,(e,t,r)=>{let n={NextRequest:e.r(60306).NextRequest,NextResponse:e.r(24173).NextResponse,ImageResponse:e.r(17878).ImageResponse,userAgentFromString:e.r(43632).userAgentFromString,userAgent:e.r(43632).userAgent,URLPattern:e.r(95437).URLPattern,after:e.r(33062).after,connection:e.r(20955).connection,unstable_rootParams:e.r(70808).unstable_rootParams};t.exports=n,r.NextRequest=n.NextRequest,r.NextResponse=n.NextResponse,r.ImageResponse=n.ImageResponse,r.userAgentFromString=n.userAgentFromString,r.userAgent=n.userAgent,r.URLPattern=n.URLPattern,r.after=n.after,r.connection=n.connection,r.unstable_rootParams=n.unstable_rootParams},81962,(e,t,r)=>{"use strict";function n(e){let t=null!=e;return function(r){let n=r.length-1;if(1===n)return[];if("}"!==r[n])throw Error("Invalid array text - must end with }");let i=0;if("["===r[0]&&(i=r.indexOf("=")+1),"{"!==r[i++])throw Error("Invalid array text - must start with {");let s=[],o=s,a=[],u=i,c="",l=!0;for(;i<n;++i){let s=r[i];if('"'===s){u=++i;let n=r.indexOf('"',u),s=r.indexOf("\\",u);for(;-1!==s&&s<n;)i=s,c+=r.slice(u,i),u=++i,n===i++&&(n=r.indexOf('"',i)),s=r.indexOf("\\",i);i=n,c+=r.slice(u,i),o.push(t?e(c):c),c="",l=!1}else if("{"===s){let e=[];o.push(e),a.push(o),o=e,u=i+1,l=!0}else if(","===s)l=!0;else if("}"===s){l=!1;let e=a.pop();if(void 0===e)throw Error("Invalid array text - too many '}'");o=e}else if(l){for(u=i;","!==(s=r[i])&&"}"!==s&&i<n;)++i;let a=r.slice(u,i--);o.push("NULL"===a?null:t?e(a):a),l=!1}else throw Error("Was expecting delimeter")}return s}}let i=n();r.parse=(e,t)=>null!=t?n(t)(e):i(e)},29173,(e,t,r)=>{t.exports=e.x("@prisma/client",()=>require("@prisma/client"))},24493,e=>{"use strict";let t,r;e.s(["resolvePrisma",()=>rq],24493);var n,i,s,o,a,u,c,l,h,f,d=Object.create,p=Object.defineProperty,g=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,y=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,v=(e,t)=>p(e,"name",{value:t,configurable:!0}),_=(e,t)=>()=>(e&&(t=e(e=0)),t),w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),E=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},S=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of m(t))b.call(e,i)||i===r||p(e,i,{get:()=>t[i],enumerable:!(n=g(t,i))||n.enumerable});return e},R=(e,t,r)=>(r=null!=e?d(y(e)):{},S(!t&&e&&e.__esModule?r:p(r,"default",{value:e,enumerable:!0}),e)),x=e=>S(p({},"__esModule",{value:!0}),e),A=(e,t,r)=>((e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),T=w(e=>{C(),e.byteLength=u,e.toByteArray=l,e.fromByteArray=d;var t,r,n=[],i=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t<r;++t)n[t]=o[t],i[o.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=a(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function l(e){var t,r,n=a(e),o=n[0],u=n[1],l=new s(c(e,o,u)),h=0,f=u>0?o-4:o;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(h((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function d(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));return 1===i?s.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&s.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),s.join("")}i[45]=62,i[95]=63,v(a,"getLens"),v(u,"byteLength"),v(c,"_byteLength"),v(l,"toByteArray"),v(h,"tripletToBase64"),v(f,"encodeChunk"),v(d,"fromByteArray")}),P=w(e=>{C(),e.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),d=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}}),O=w(e=>{C();var t=T(),r=P(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(){try{let e=new Uint8Array(1),t={foo:v(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(eo(e,ArrayBuffer)||e&&eo(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(eo(e,SharedArrayBuffer)||e&&eo(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=g(e);if(i)return i;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}function l(e){return u(e),s(e<0?0:0|m(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|b(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function f(e){let t=e.length<0?0:0|m(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(eo(e,Uint8Array)){let t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}function p(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function g(e){if(o.isBuffer(e)){let t=0|m(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||ea(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function y(e){return+e!=e&&(e=0),o.alloc(+e)}function b(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||eo(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ei(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}function _(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),ea(r*=1)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){let s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(v(c,"read"),i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function R(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(ea(n))break;e[r+i]=n}return i}function x(e,t,r,n){return es(et(t,e.length-r),e,r,n)}function A(e,t,r,n){return es(er(t),e,r,n)}function O(e,t,r,n){return es(ei(t),e,r,n)}function I(e,t,r,n){return es(en(t,e.length-r),e,r,n)}function N(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function L(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return M(n)}function M(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}function D(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=eu[e[n]];return i}function j(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function q(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function $(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function G(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function H(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function V(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}e.Buffer=o,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),v(i,"typedArraySupport"),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:v(function(){if(o.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:v(function(){if(o.isBuffer(this))return this.byteOffset},"get")}),v(s,"createBuffer"),v(o,"Buffer"),o.poolSize=8192,v(a,"from"),o.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),v(u,"assertSize"),v(c,"alloc"),o.alloc=function(e,t,r){return c(e,t,r)},v(l,"allocUnsafe"),o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},v(h,"fromString"),v(f,"fromArrayLike"),v(d,"fromArrayView"),v(p,"fromArrayBuffer"),v(g,"fromObject"),v(m,"checked"),v(y,"SlowBuffer"),o.isBuffer=v(function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},"isBuffer"),o.compare=v(function(e,t){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),eo(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},"compare"),o.isEncoding=v(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding"),o.concat=v(function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(eo(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},"concat"),v(b,"byteLength"),o.byteLength=b,v(_,"slowToString"),o.prototype._isBuffer=!0,v(w,"swap"),o.prototype.swap16=v(function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},"swap16"),o.prototype.swap32=v(function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},"swap32"),o.prototype.swap64=v(function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},"swap64"),o.prototype.toString=v(function(){let e=this.length;return 0===e?"":0==arguments.length?L(this,0,e):_.apply(this,arguments)},"toString"),o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=v(function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},"equals"),o.prototype.inspect=v(function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},"inspect"),n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=v(function(e,t,r,n,i){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,u=Math.min(s,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:+(a<s)},"compare"),v(E,"bidirectionalIndexOf"),v(S,"arrayIndexOf"),o.prototype.includes=v(function(e,t,r){return -1!==this.indexOf(e,t,r)},"includes"),o.prototype.indexOf=v(function(e,t,r){return E(this,e,t,r,!0)},"indexOf"),o.prototype.lastIndexOf=v(function(e,t,r){return E(this,e,t,r,!1)},"lastIndexOf"),v(R,"hexWrite"),v(x,"utf8Write"),v(A,"asciiWrite"),v(O,"base64Write"),v(I,"ucs2Write"),o.prototype.write=v(function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return A(this,e,t,r);case"base64":return O(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write"),o.prototype.toJSON=v(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON"),v(N,"base64Slice"),v(L,"utf8Slice"),v(M,"decodeCodePointsArray"),v(D,"asciiSlice"),v(k,"latin1Slice"),v(B,"hexSlice"),v(j,"utf16leSlice"),o.prototype.slice=v(function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},"slice"),v(U,"checkOffset"),o.prototype.readUintLE=o.prototype.readUIntLE=v(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},"readUIntLE"),o.prototype.readUintBE=o.prototype.readUIntBE=v(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},"readUIntBE"),o.prototype.readUint8=o.prototype.readUInt8=v(function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},"readUInt8"),o.prototype.readUint16LE=o.prototype.readUInt16LE=v(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE"),o.prototype.readUint16BE=o.prototype.readUInt16BE=v(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE"),o.prototype.readUint32LE=o.prototype.readUInt32LE=v(function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},"readUInt32LE"),o.prototype.readUint32BE=o.prototype.readUInt32BE=v(function(e,t){return e>>>=0,t||U(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE"),o.prototype.readBigUInt64LE=ec(v(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))},"readBigUInt64LE")),o.prototype.readBigUInt64BE=ec(v(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)},"readBigUInt64BE")),o.prototype.readIntLE=v(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},"readIntLE"),o.prototype.readIntBE=v(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},"readIntBE"),o.prototype.readInt8=v(function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},"readInt8"),o.prototype.readInt16LE=v(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},"readInt16LE"),o.prototype.readInt16BE=v(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},"readInt16BE"),o.prototype.readInt32LE=v(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE"),o.prototype.readInt32BE=v(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE"),o.prototype.readBigInt64LE=ec(v(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])},"readBigInt64LE")),o.prototype.readBigInt64BE=ec(v(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)},"readBigInt64BE")),o.prototype.readFloatLE=v(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!0,23,4)},"readFloatLE"),o.prototype.readFloatBE=v(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!1,23,4)},"readFloatBE"),o.prototype.readDoubleLE=v(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!0,52,8)},"readDoubleLE"),o.prototype.readDoubleBE=v(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!1,52,8)},"readDoubleBE"),v(F,"checkInt"),o.prototype.writeUintLE=o.prototype.writeUIntLE=v(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},"writeUIntLE"),o.prototype.writeUintBE=o.prototype.writeUIntBE=v(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},"writeUIntBE"),o.prototype.writeUint8=o.prototype.writeUInt8=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},"writeUInt8"),o.prototype.writeUint16LE=o.prototype.writeUInt16LE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeUInt16LE"),o.prototype.writeUint16BE=o.prototype.writeUInt16BE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeUInt16BE"),o.prototype.writeUint32LE=o.prototype.writeUInt32LE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},"writeUInt32LE"),o.prototype.writeUint32BE=o.prototype.writeUInt32BE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeUInt32BE"),v(q,"wrtBigUInt64LE"),v($,"wrtBigUInt64BE"),o.prototype.writeBigUInt64LE=ec(v(function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),o.prototype.writeBigUInt64BE=ec(v(function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),o.prototype.writeIntLE=v(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntLE"),o.prototype.writeIntBE=v(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntBE"),o.prototype.writeInt8=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},"writeInt8"),o.prototype.writeInt16LE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeInt16LE"),o.prototype.writeInt16BE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeInt16BE"),o.prototype.writeInt32LE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE"),o.prototype.writeInt32BE=v(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeInt32BE"),o.prototype.writeBigInt64LE=ec(v(function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),o.prototype.writeBigInt64BE=ec(v(function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE")),v(G,"checkIEEE754"),v(H,"writeFloat"),o.prototype.writeFloatLE=v(function(e,t,r){return H(this,e,t,!0,r)},"writeFloatLE"),o.prototype.writeFloatBE=v(function(e,t,r){return H(this,e,t,!1,r)},"writeFloatBE"),v(V,"writeDouble"),o.prototype.writeDoubleLE=v(function(e,t,r){return V(this,e,t,!0,r)},"writeDoubleLE"),o.prototype.writeDoubleBE=v(function(e,t,r){return V(this,e,t,!1,r)},"writeDoubleBE"),o.prototype.copy=v(function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},"copy"),o.prototype.fill=v(function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this},"fill");var W={};function Q(e,t,r){var n;W[e]=(v(n=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}\
19
+ `)}}},60306,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{INTERNALS:function(){return a},NextRequest:function(){return u}});let n=e.r(95340),i=e.r(68794),s=e.r(31048),o=e.r(89193),a=Symbol("internal request");class u extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let s=new n.NextURL(r,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[a]={cookies:new o.RequestCookies(this.headers),nextUrl:s,url:s.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[a].cookies}get nextUrl(){return this[a].nextUrl}get page(){throw new s.RemovedPageError}get ua(){throw new s.RemovedUAError}get url(){return this[a].url}}},24173,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextResponse",{enumerable:!0,get:function(){return h}});let n=e.r(89193),i=e.r(95340),s=e.r(68794),o=e.r(99667),a=e.r(89193),u=Symbol("internal response"),c=new Set([301,302,303,307,308]);function l(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class h extends Response{constructor(e,t={}){super(e,t);let r=this.headers,c=new Proxy(new a.ResponseCookies(r),{get(e,i,s){switch(i){case"delete":case"set":return(...s)=>{let o=Reflect.apply(e[i],e,s),u=new Headers(r);return o instanceof a.ResponseCookies&&r.set("x-middleware-set-cookie",o.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),l(t,u),o};default:return o.ReflectAdapter.get(e,i,s)}}});this[u]={cookies:c,url:t.url?new i.NextURL(t.url,{headers:(0,s.toNodeOutgoingHttpHeaders)(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[u].cookies}static json(e,t){let r=Response.json(e,t);return new h(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!c.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",(0,s.validateURL)(e)),new h(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,s.validateURL)(e)),l(t,r),new h(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),l(e,t),new h(null,{...e,headers:t})}}},17878,(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageResponse",{enumerable:!0,get:function(){return n}})},35235,(e,t,r)=>{(()=>{var r={226:function(t,r){!function(n,i){"use strict";var s="function",o="undefined",a="object",u="string",c="major",l="model",h="name",f="type",d="vendor",p="version",g="architecture",m="console",y="mobile",b="tablet",v="smarttv",_="wearable",w="embedded",E="Amazon",S="Apple",R="ASUS",x="BlackBerry",A="Browser",T="Chrome",P="Firefox",O="Google",C="Huawei",I="Microsoft",N="Motorola",L="Opera",M="Samsung",D="Sharp",k="Sony",B="Xiaomi",j="Zebra",U="Facebook",F="Chromium OS",q="Mac OS",$=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},G=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},H=function(e,t){return typeof e===u&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},Q=function(e,t){for(var r,n,o,u,c,l,h=0;h<t.length&&!c;){var f=t[h],d=t[h+1];for(r=n=0;r<f.length&&!c&&f[r];)if(c=f[r++].exec(e))for(o=0;o<d.length;o++)l=c[++n],typeof(u=d[o])===a&&u.length>0?2===u.length?typeof u[1]==s?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==s||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):void 0:this[u[0]]=l?u[1].call(this,l,u[2]):void 0:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):i):this[u]=l||i;h+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(H(t[r][n],e))return"?"===r?i:r}else if(H(t[r],e))return"?"===r?i:r;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,p],[/opios[\/ ]+([\w\.]+)/i],[p,[h,L+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[h,L]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[h,"UC"+A]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+A],p],[/\bfocus\/([\w\.]+)/i],[p,[h,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[h,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[h,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[h,"MIUI "+A]],[/fxios\/([-\w\.]+)/i],[p,[h,P]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+A]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+A],p],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[h,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,T+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[h,"Android "+A]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[p,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[h,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[h,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,p],[/(cobalt)\/([\w\.]+)/i],[h,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,V]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,M],[f,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,M],[f,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[d,S],[f,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[f,b]],[/(macintosh);/i],[l,[d,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,D],[f,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,C],[f,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,C],[f,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,B],[f,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,B],[f,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[f,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[f,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[f,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,N],[f,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,N],[f,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,"LG"],[f,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,"LG"],[f,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[f,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[f,y]],[/(pixel c)\b/i],[l,[d,O],[f,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[f,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,k],[f,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,k],[f,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[f,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,E],[f,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,E],[f,y]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[f,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,x],[f,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,R],[f,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,R],[f,y]],[/(nexus 9)/i],[l,[d,"HTC"],[f,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[f,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[f,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[f,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[f,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[f,b]],[/(surface duo)/i],[l,[d,I],[f,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[f,y]],[/(u304aa)/i],[l,[d,"AT&T"],[f,y]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[f,y]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[f,b]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[f,b]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[f,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[f,b]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[f,b]],[/\b(k88) b/i],[l,[d,"ZTE"],[f,b]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[f,y]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[f,y]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[f,b]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[f,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[f,b]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[f,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[f,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[f,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[f,y]],[/\b(ph-1) /i],[l,[d,"Essential"],[f,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[f,b]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[f,b]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[f,b]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[f,b]],[/(sprint) (\w+)/i],[d,l,[f,y]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,I],[f,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,j],[f,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,j],[f,y]],[/smart-tv.+(samsung)/i],[d,[f,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,M],[f,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[f,v]],[/(apple) ?tv/i],[d,[l,S+" TV"],[f,v]],[/crkey/i],[[l,T+"cast"],[d,O],[f,v]],[/droid.+aft(\w)( bui|\))/i],[l,[d,E],[f,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,D],[f,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,k],[f,v]],[/(mitv-\w{5}) bui/i],[l,[d,B],[f,v]],[/Hbbtv.*(technisat) (.*);/i],[d,l,[f,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[l,W],[f,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[f,m]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[f,m]],[/(playstation [345portablevi]+)/i],[l,[d,k],[f,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,I],[f,m]],[/((pebble))app/i],[d,l,[f,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[d,S],[f,_]],[/droid.+; (glass) \d/i],[l,[d,O],[f,_]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,j],[f,_]],[/(quest( 2| pro)?)/i],[l,[d,U],[f,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[f,w]],[/(aeobc)\b/i],[l,[d,E],[f,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[f,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[f,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,y]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[h,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[p,Y,X]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[p,Y,X]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,q],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,p],[/\(bb(10);/i],[p,[h,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[h,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[h,T+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,p],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,p]]},K=function(e,t){if(typeof e===a&&(t=e,e=i),!(this instanceof K))return new K(e,t).getResult();var r=typeof n!==o&&n.navigator?n.navigator:i,m=e||(r&&r.userAgent?r.userAgent:""),v=r&&r.userAgentData?r.userAgentData:i,_=t?$(z,t):z,w=r&&r.userAgent==m;return this.getBrowser=function(){var e,t={};return t[h]=i,t[p]=i,Q.call(t,m,_.browser),t[c]=typeof(e=t[p])===u?e.replace(/[^\d\.]/g,"").split(".")[0]:i,w&&r&&r.brave&&typeof r.brave.isBrave==s&&(t[h]="Brave"),t},this.getCPU=function(){var e={};return e[g]=i,Q.call(e,m,_.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[l]=i,e[f]=i,Q.call(e,m,_.device),w&&!e[f]&&v&&v.mobile&&(e[f]=y),w&&"Macintosh"==e[l]&&r&&typeof r.standalone!==o&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[l]="iPad",e[f]=b),e},this.getEngine=function(){var e={};return e[h]=i,e[p]=i,Q.call(e,m,_.engine),e},this.getOS=function(){var e={};return e[h]=i,e[p]=i,Q.call(e,m,_.os),w&&!e[h]&&v&&"Unknown"!=v.platform&&(e[h]=v.platform.replace(/chrome os/i,F).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return m},this.setUA=function(e){return m=typeof e===u&&e.length>350?W(e,350):e,this},this.setUA(m),this};if(K.VERSION="1.0.35",K.BROWSER=G([h,p,c]),K.CPU=G([g]),K.DEVICE=G([l,d,f,m,y,v,b,_,w]),K.ENGINE=K.OS=G([h,p]),typeof r!==o)t.exports&&(r=t.exports=K),r.UAParser=K;else if(typeof define===s&&define.amd)e.r,void 0!==K&&e.v(K);else typeof n!==o&&(n.UAParser=K);var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Z=new K;J.ua=Z.getResult(),J.ua.get=function(){return Z.getUA()},J.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)J.ua[r]=t[r]}}}(this)}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}},o=!0;try{r[e].call(s.exports,s,s.exports,i),o=!1}finally{o&&delete n[e]}return s.exports}i.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/ua-parser-js/",t.exports=i(226)})()},43632,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isBot:function(){return i},userAgent:function(){return o},userAgentFromString:function(){return s}});let n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(35235));function i(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function s(e){return{...(0,n.default)(e),isBot:void 0!==e&&i(e)}}function o({headers:e}){return s(e.get("user-agent")||void 0)}},95437,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"URLPattern",{enumerable:!0,get:function(){return n}});let n="undefined"==typeof URLPattern?void 0:URLPattern},92028,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"after",{enumerable:!0,get:function(){return i}});let n=e.r(56704);function i(e){let t=n.workAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});let{afterContext:r}=t;return r.after(e)}},33062,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(e.r(92028),r)},20955,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"connection",{enumerable:!0,get:function(){return c}});let n=e.r(56704),i=e.r(32319),s=e.r(30810),o=e.r(78506),a=e.r(53920),u=e.r(44261);function c(){let e=n.workAsyncStorage.getStore(),t=i.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(e.forceStatic)return Promise.resolve(void 0);if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(t)switch(t.type){case"cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E752",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"private-cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E753",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,a.makeHangingPromise)(t.renderSignal,e.route,"`connection()`");case"prerender-ppr":return(0,s.postponeWithTracking)(e.route,"connection",t.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)("connection",e,t);case"request":return(0,s.trackDynamicDataInDynamicRender)(t),Promise.resolve(void 0)}}(0,i.throwForMissingRequestStore)("connection")}},73298,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{describeHasCheckingStringProperty:function(){return s},describeStringPropertyAccess:function(){return i},wellKnownProperties:function(){return o}});let n=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function i(e,t){return n.test(t)?"`"+e+"."+t+"`":"`"+e+"["+JSON.stringify(t)+"]`"}function s(e,t){let r=JSON.stringify(t);return"`Reflect.has("+e+", "+r+")`, `"+r+" in "+e+"`, or similar"}let o=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule"])},30548,(e,t,r)=>{"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bgBlack:function(){return T},bgBlue:function(){return I},bgCyan:function(){return L},bgGreen:function(){return O},bgMagenta:function(){return N},bgRed:function(){return P},bgWhite:function(){return M},bgYellow:function(){return C},black:function(){return y},blue:function(){return w},bold:function(){return l},cyan:function(){return R},dim:function(){return h},gray:function(){return A},green:function(){return v},hidden:function(){return g},inverse:function(){return p},italic:function(){return f},magenta:function(){return E},purple:function(){return S},red:function(){return b},reset:function(){return c},strikethrough:function(){return m},underline:function(){return d},white:function(){return x},yellow:function(){return _}});let{env:i,stdout:s}=(null==(n=globalThis)?void 0:n.process)??{},o=i&&!i.NO_COLOR&&(i.FORCE_COLOR||(null==s?void 0:s.isTTY)&&!i.CI&&"dumb"!==i.TERM),a=(e,t,r,n)=>{let i=e.substring(0,n)+r,s=e.substring(n+t.length),o=s.indexOf(t);return~o?i+a(s,t,r,o):i+s},u=(e,t,r=e)=>o?n=>{let i=""+n,s=i.indexOf(t,e.length);return~s?e+a(i,t,r,s)+t:e+i+t}:String,c=o?e=>`\x1b[0m${e}\x1b[0m`:String,l=u("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),h=u("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),f=u("\x1b[3m","\x1b[23m"),d=u("\x1b[4m","\x1b[24m"),p=u("\x1b[7m","\x1b[27m"),g=u("\x1b[8m","\x1b[28m"),m=u("\x1b[9m","\x1b[29m"),y=u("\x1b[30m","\x1b[39m"),b=u("\x1b[31m","\x1b[39m"),v=u("\x1b[32m","\x1b[39m"),_=u("\x1b[33m","\x1b[39m"),w=u("\x1b[34m","\x1b[39m"),E=u("\x1b[35m","\x1b[39m"),S=u("\x1b[38;2;173;127;168m","\x1b[39m"),R=u("\x1b[36m","\x1b[39m"),x=u("\x1b[37m","\x1b[39m"),A=u("\x1b[90m","\x1b[39m"),T=u("\x1b[40m","\x1b[49m"),P=u("\x1b[41m","\x1b[49m"),O=u("\x1b[42m","\x1b[49m"),C=u("\x1b[43m","\x1b[49m"),I=u("\x1b[44m","\x1b[49m"),N=u("\x1b[45m","\x1b[49m"),L=u("\x1b[46m","\x1b[49m"),M=u("\x1b[47m","\x1b[49m")},65477,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"LRUCache",{enumerable:!0,get:function(){return s}});class n{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class i{constructor(){this.prev=null,this.next=null}}class s{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new i,this.tail=new i,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r>this.maxSize)return void console.warn("Single item size exceeds maxSize");let i=this.cache.get(e);if(i)i.data=t,this.totalSize=this.totalSize-i.size+r,i.size=r,this.moveToHead(i);else{let i=new n(e,t,r);this.cache.set(e,i),this.addToHead(i),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}},40463,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bootstrap:function(){return u},error:function(){return l},event:function(){return p},info:function(){return d},prefixes:function(){return s},ready:function(){return f},trace:function(){return g},wait:function(){return c},warn:function(){return h},warnOnce:function(){return y}});let n=e.r(30548),i=e.r(65477),s={wait:(0,n.white)((0,n.bold)("○")),error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("⚠")),ready:"▲",info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("✓")),trace:(0,n.magenta)((0,n.bold)("»"))},o={log:"log",warn:"warn",error:"error"};function a(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in o?o[e]:"log",n=s[e];0===t.length?console[r](""):1===t.length&&"string"==typeof t[0]?console[r](" "+n+" "+t[0]):console[r](" "+n,...t)}function u(...e){console.log(" "+e.join(" "))}function c(...e){a("wait",...e)}function l(...e){a("error",...e)}function h(...e){a("warn",...e)}function f(...e){a("ready",...e)}function d(...e){a("info",...e)}function p(...e){a("event",...e)}function g(...e){a("trace",...e)}let m=new i.LRUCache(1e4,e=>e.length);function y(...e){let t=e.join(" ");m.has(t)||(m.set(t,t),h(...e))}},70808,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{getRootParam:function(){return d},unstable_rootParams:function(){return f}});let n=e.r(4784),i=e.r(30810),s=e.r(56704),o=e.r(32319),a=e.r(53920),u=e.r(73298),c=e.r(20635),l=e.r(40463),h=new WeakMap;async function f(){(0,l.warnOnce)("`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.");let e=s.workAsyncStorage.getStore();if(!e)throw Object.defineProperty(new n.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});let t=o.workUnitAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(t.type){case"cache":case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return function(e,t,r){switch(r.type){case"prerender-client":{let e="`unstable_rootParams`";throw Object.defineProperty(new n.InvariantError(`${e} must not be used within a client component. Next.js should be preventing ${e} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}case"prerender":{let n=r.fallbackRouteParams;if(n){for(let i in e)if(n.has(i)){let n=h.get(e);if(n)return n;let i=(0,a.makeHangingPromise)(r.renderSignal,t.route,"`unstable_rootParams`");return h.set(e,i),i}}break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n){for(let s in e)if(n.has(s))return function(e,t,r,n){let s=h.get(e);if(s)return s;let o={...e},a=Promise.resolve(o);return h.set(e,a),Object.keys(e).forEach(s=>{u.wellKnownProperties.has(s)||(t.has(s)?Object.defineProperty(o,s,{get(){let e=(0,u.describeStringPropertyAccess)("unstable_rootParams",s);"prerender-ppr"===n.type?(0,i.postponeWithTracking)(r.route,e,n.dynamicTracking):(0,i.throwToInterruptStaticGeneration)(e,r,n)},enumerable:!0}):a[s]=e[s])}),a}(e,n,t,r)}}}return Promise.resolve(e)}(t.rootParams,e,t);case"private-cache":case"prerender-runtime":case"request":return Promise.resolve(t.rootParams);default:return t}}function d(e){let t=`\`import('next/root-params').${e}()\``,r=s.workAsyncStorage.getStore();if(!r)throw Object.defineProperty(new n.InvariantError(`Missing workStore in ${t}`),"__NEXT_ERROR_CODE",{value:"E764",enumerable:!1,configurable:!0});let i=o.workUnitAsyncStorage.getStore();if(!i)throw Object.defineProperty(Error(`Route ${r.route} used ${t} outside of a Server Component. This is not allowed.`),"__NEXT_ERROR_CODE",{value:"E774",enumerable:!1,configurable:!0});let u=c.actionAsyncStorage.getStore();if(u){if(u.isAppRoute)throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E765",enumerable:!1,configurable:!0});if(u.isAction&&"action"===i.phase)throw Object.defineProperty(Error(`${t} was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.`),"__NEXT_ERROR_CODE",{value:"E766",enumerable:!1,configurable:!0})}switch(i.type){case"unstable-cache":case"cache":throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E760",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":var l=e,h=r,f=i,d=t;if("prerender-client"===f.type)throw Object.defineProperty(new n.InvariantError(`${d} must not be used within a client component. Next.js should be preventing ${d} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});let g=f.rootParams;switch(f.type){case"prerender":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return(0,a.makeHangingPromise)(f.renderSignal,h.route,d);break;case"prerender-ppr":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return p(l,h,f,d)}return Promise.resolve(g[l])}return Promise.resolve(i.rootParams[e])}async function p(e,t,r,n){let s=(0,u.describeStringPropertyAccess)(n,e);switch(r.type){case"prerender-ppr":return(0,i.postponeWithTracking)(t.route,s,r.dynamicTracking);case"prerender-legacy":return(0,i.throwToInterruptStaticGeneration)(s,t,r)}}},49493,(e,t,r)=>{let n={NextRequest:e.r(60306).NextRequest,NextResponse:e.r(24173).NextResponse,ImageResponse:e.r(17878).ImageResponse,userAgentFromString:e.r(43632).userAgentFromString,userAgent:e.r(43632).userAgent,URLPattern:e.r(95437).URLPattern,after:e.r(33062).after,connection:e.r(20955).connection,unstable_rootParams:e.r(70808).unstable_rootParams};t.exports=n,r.NextRequest=n.NextRequest,r.NextResponse=n.NextResponse,r.ImageResponse=n.ImageResponse,r.userAgentFromString=n.userAgentFromString,r.userAgent=n.userAgent,r.URLPattern=n.URLPattern,r.after=n.after,r.connection=n.connection,r.unstable_rootParams=n.unstable_rootParams},81962,(e,t,r)=>{"use strict";function n(e){let t=null!=e;return function(r){let n=r.length-1;if(1===n)return[];if("}"!==r[n])throw Error("Invalid array text - must end with }");let i=0;if("["===r[0]&&(i=r.indexOf("=")+1),"{"!==r[i++])throw Error("Invalid array text - must start with {");let s=[],o=s,a=[],u=i,c="",l=!0;for(;i<n;++i){let s=r[i];if('"'===s){u=++i;let n=r.indexOf('"',u),s=r.indexOf("\\",u);for(;-1!==s&&s<n;)i=s,c+=r.slice(u,i),u=++i,n===i++&&(n=r.indexOf('"',i)),s=r.indexOf("\\",i);i=n,c+=r.slice(u,i),o.push(t?e(c):c),c="",l=!1}else if("{"===s){let e=[];o.push(e),a.push(o),o=e,u=i+1,l=!0}else if(","===s)l=!0;else if("}"===s){l=!1;let e=a.pop();if(void 0===e)throw Error("Invalid array text - too many '}'");o=e}else if(l){for(u=i;","!==(s=r[i])&&"}"!==s&&i<n;)++i;let a=r.slice(u,i--);o.push("NULL"===a?null:t?e(a):a),l=!1}else throw Error("Was expecting delimeter")}return s}}let i=n();r.parse=(e,t)=>null!=t?n(t)(e):i(e)},29173,(e,t,r)=>{t.exports=e.x("@prisma/client",()=>require("@prisma/client"))},24493,e=>{"use strict";let t,r,n;e.s(["resolvePrisma",()=>r$],24493);var i,s,o,a,u,c,l,h,f,d,p=Object.create,g=Object.defineProperty,m=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,b=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty,_=(e,t)=>g(e,"name",{value:t,configurable:!0}),w=(e,t)=>()=>(e&&(t=e(e=0)),t),E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),S=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},R=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of y(t))v.call(e,i)||i===r||g(e,i,{get:()=>t[i],enumerable:!(n=m(t,i))||n.enumerable});return e},x=(e,t,r)=>(r=null!=e?p(b(e)):{},R(!t&&e&&e.__esModule?r:g(r,"default",{value:e,enumerable:!0}),e)),A=e=>R(g({},"__esModule",{value:!0}),e),T=(e,t,r)=>((e,t,r)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),P=E(e=>{I(),e.byteLength=u,e.toByteArray=l,e.fromByteArray=d;var t,r,n=[],i=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t<r;++t)n[t]=o[t],i[o.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=a(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function l(e){var t,r,n=a(e),o=n[0],u=n[1],l=new s(c(e,o,u)),h=0,f=u>0?o-4:o;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(h((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function d(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));return 1===i?s.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&s.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),s.join("")}i[45]=62,i[95]=63,_(a,"getLens"),_(u,"byteLength"),_(c,"_byteLength"),_(l,"toByteArray"),_(h,"tripletToBase64"),_(f,"encodeChunk"),_(d,"fromByteArray")}),O=E(e=>{I(),e.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),d=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}}),C=E(e=>{I();var t=P(),r=O(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(){try{let e=new Uint8Array(1),t={foo:_(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(eo(e,ArrayBuffer)||e&&eo(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(eo(e,SharedArrayBuffer)||e&&eo(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=g(e);if(i)return i;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}function l(e){return u(e),s(e<0?0:0|m(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|b(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function f(e){let t=e.length<0?0:0|m(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(eo(e,Uint8Array)){let t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}function p(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function g(e){if(o.isBuffer(e)){let t=0|m(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||ea(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function y(e){return+e!=e&&(e=0),o.alloc(+e)}function b(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||eo(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ei(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),ea(r*=1)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){let s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(_(c,"read"),i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function R(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(ea(n))break;e[r+i]=n}return i}function x(e,t,r,n){return es(et(t,e.length-r),e,r,n)}function A(e,t,r,n){return es(er(t),e,r,n)}function T(e,t,r,n){return es(ei(t),e,r,n)}function C(e,t,r,n){return es(en(t,e.length-r),e,r,n)}function N(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function L(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return M(n)}function M(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}function D(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=eu[e[n]];return i}function j(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function q(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function $(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function G(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function H(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function V(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}e.Buffer=o,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),_(i,"typedArraySupport"),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:_(function(){if(o.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:_(function(){if(o.isBuffer(this))return this.byteOffset},"get")}),_(s,"createBuffer"),_(o,"Buffer"),o.poolSize=8192,_(a,"from"),o.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),_(u,"assertSize"),_(c,"alloc"),o.alloc=function(e,t,r){return c(e,t,r)},_(l,"allocUnsafe"),o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},_(h,"fromString"),_(f,"fromArrayLike"),_(d,"fromArrayView"),_(p,"fromArrayBuffer"),_(g,"fromObject"),_(m,"checked"),_(y,"SlowBuffer"),o.isBuffer=_(function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},"isBuffer"),o.compare=_(function(e,t){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),eo(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},"compare"),o.isEncoding=_(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding"),o.concat=_(function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(eo(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},"concat"),_(b,"byteLength"),o.byteLength=b,_(v,"slowToString"),o.prototype._isBuffer=!0,_(w,"swap"),o.prototype.swap16=_(function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},"swap16"),o.prototype.swap32=_(function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},"swap32"),o.prototype.swap64=_(function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},"swap64"),o.prototype.toString=_(function(){let e=this.length;return 0===e?"":0==arguments.length?L(this,0,e):v.apply(this,arguments)},"toString"),o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=_(function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},"equals"),o.prototype.inspect=_(function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},"inspect"),n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=_(function(e,t,r,n,i){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,u=Math.min(s,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:+(a<s)},"compare"),_(E,"bidirectionalIndexOf"),_(S,"arrayIndexOf"),o.prototype.includes=_(function(e,t,r){return -1!==this.indexOf(e,t,r)},"includes"),o.prototype.indexOf=_(function(e,t,r){return E(this,e,t,r,!0)},"indexOf"),o.prototype.lastIndexOf=_(function(e,t,r){return E(this,e,t,r,!1)},"lastIndexOf"),_(R,"hexWrite"),_(x,"utf8Write"),_(A,"asciiWrite"),_(T,"base64Write"),_(C,"ucs2Write"),o.prototype.write=_(function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return A(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write"),o.prototype.toJSON=_(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON"),_(N,"base64Slice"),_(L,"utf8Slice"),_(M,"decodeCodePointsArray"),_(D,"asciiSlice"),_(k,"latin1Slice"),_(B,"hexSlice"),_(j,"utf16leSlice"),o.prototype.slice=_(function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},"slice"),_(U,"checkOffset"),o.prototype.readUintLE=o.prototype.readUIntLE=_(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},"readUIntLE"),o.prototype.readUintBE=o.prototype.readUIntBE=_(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},"readUIntBE"),o.prototype.readUint8=o.prototype.readUInt8=_(function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},"readUInt8"),o.prototype.readUint16LE=o.prototype.readUInt16LE=_(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE"),o.prototype.readUint16BE=o.prototype.readUInt16BE=_(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE"),o.prototype.readUint32LE=o.prototype.readUInt32LE=_(function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},"readUInt32LE"),o.prototype.readUint32BE=o.prototype.readUInt32BE=_(function(e,t){return e>>>=0,t||U(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE"),o.prototype.readBigUInt64LE=ec(_(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))},"readBigUInt64LE")),o.prototype.readBigUInt64BE=ec(_(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)},"readBigUInt64BE")),o.prototype.readIntLE=_(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},"readIntLE"),o.prototype.readIntBE=_(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},"readIntBE"),o.prototype.readInt8=_(function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},"readInt8"),o.prototype.readInt16LE=_(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},"readInt16LE"),o.prototype.readInt16BE=_(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},"readInt16BE"),o.prototype.readInt32LE=_(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE"),o.prototype.readInt32BE=_(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE"),o.prototype.readBigInt64LE=ec(_(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])},"readBigInt64LE")),o.prototype.readBigInt64BE=ec(_(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)},"readBigInt64BE")),o.prototype.readFloatLE=_(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!0,23,4)},"readFloatLE"),o.prototype.readFloatBE=_(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!1,23,4)},"readFloatBE"),o.prototype.readDoubleLE=_(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!0,52,8)},"readDoubleLE"),o.prototype.readDoubleBE=_(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!1,52,8)},"readDoubleBE"),_(F,"checkInt"),o.prototype.writeUintLE=o.prototype.writeUIntLE=_(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},"writeUIntLE"),o.prototype.writeUintBE=o.prototype.writeUIntBE=_(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},"writeUIntBE"),o.prototype.writeUint8=o.prototype.writeUInt8=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},"writeUInt8"),o.prototype.writeUint16LE=o.prototype.writeUInt16LE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeUInt16LE"),o.prototype.writeUint16BE=o.prototype.writeUInt16BE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeUInt16BE"),o.prototype.writeUint32LE=o.prototype.writeUInt32LE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},"writeUInt32LE"),o.prototype.writeUint32BE=o.prototype.writeUInt32BE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeUInt32BE"),_(q,"wrtBigUInt64LE"),_($,"wrtBigUInt64BE"),o.prototype.writeBigUInt64LE=ec(_(function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),o.prototype.writeBigUInt64BE=ec(_(function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),o.prototype.writeIntLE=_(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntLE"),o.prototype.writeIntBE=_(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntBE"),o.prototype.writeInt8=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},"writeInt8"),o.prototype.writeInt16LE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeInt16LE"),o.prototype.writeInt16BE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeInt16BE"),o.prototype.writeInt32LE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE"),o.prototype.writeInt32BE=_(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeInt32BE"),o.prototype.writeBigInt64LE=ec(_(function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),o.prototype.writeBigInt64BE=ec(_(function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE")),_(G,"checkIEEE754"),_(H,"writeFloat"),o.prototype.writeFloatLE=_(function(e,t,r){return H(this,e,t,!0,r)},"writeFloatLE"),o.prototype.writeFloatBE=_(function(e,t,r){return H(this,e,t,!1,r)},"writeFloatBE"),_(V,"writeDouble"),o.prototype.writeDoubleLE=_(function(e,t,r){return V(this,e,t,!0,r)},"writeDoubleLE"),o.prototype.writeDoubleBE=_(function(e,t,r){return V(this,e,t,!1,r)},"writeDoubleBE"),o.prototype.copy=_(function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},"copy"),o.prototype.fill=_(function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this},"fill");var W={};function Q(e,t,r){var n;W[e]=(_(n=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}\
20
20
  ]: ${this.message}`}},"NodeError"),n)}function Y(e){let t="",r=e.length,n=+("-"===e[0]);for(;r>=n+4;r-=3)t=`\
21
21
  _${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function X(e,t,r){K(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&J(t,e.length-(r+1))}function z(e,t,r,n,i,s){if(e>r||e<t){let n="bigint"==typeof t?"n":"",i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n}\
22
22
  ** ${(s+1)*8}${n}`:`>= -(2${n} ** ${(s+1)*8-1}${n}) and < 2 ** ${(s+1)*8-1}${n}`:`>= ${t}${n} a\
23
- nd <= ${r}${n}`,new W.ERR_OUT_OF_RANGE("value",i,e)}X(n,i,s)}function K(e,t){if("number"!=typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function J(e,t,r){throw Math.floor(e)!==e?(K(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}v(Q,"E"),Q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received typ\
23
+ nd <= ${r}${n}`,new W.ERR_OUT_OF_RANGE("value",i,e)}X(n,i,s)}function K(e,t){if("number"!=typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function J(e,t,r){throw Math.floor(e)!==e?(K(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}_(Q,"E"),Q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received typ\
24
24
  e ${typeof t}`},TypeError),Q("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out o\
25
25
  f range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Y(i)),i+="n"),n+=` It must be ${t}. Re\
26
- ceived ${i}`},RangeError),v(Y,"addNumericalSeparator"),v(X,"checkBounds"),v(z,"checkIntBI"),v(K,"validateNumber"),v(J,"boundsError");var Z=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){t=t||1/0;let r,n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function er(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function en(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}function ei(e){return t.toByteArray(ee(e))}function es(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function eo(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ea(e){return e!=e}v(ee,"base64clean"),v(et,"utf8ToBytes"),v(er,"asciiToBytes"),v(en,"utf16leToBytes"),v(ei,"base64ToBytes"),v(es,"blitBuffer"),v(eo,"isInstance"),v(ea,"numberIsNaN");var eu=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function ec(e){return typeof BigInt>"u"?el:e}function el(){throw Error("BigInt not supported")}v(ec,"defineBigIntMethod"),v(el,"BufferBigIntNotDefined")}),C=_(()=>{c=globalThis,l=globalThis.setImmediate??(e=>setTimeout(e,0)),globalThis.clearImmediate??(e=>clearTimeout(e)),h="function"==typeof globalThis.Buffer&&"function"==typeof globalThis.Buffer.allocUnsafe?globalThis.Buffer:O().Buffer,(f=globalThis.process??{}).env??(f.env={});try{f.nextTick(()=>{})}catch{let e=Promise.resolve();f.nextTick=e.then.bind(e)}}),I=w((e,t)=>{C();var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:v(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply");function s(e){console&&console.warn&&console.warn(e)}r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?v(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):v(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys"),v(s,"ProcessEmitWarning");var o=Number.isNaN||v(function(e){return e!=e},"NumberIsNaN");function a(){a.init.call(this)}v(a,"EventEmitter"),t.exports=a,t.exports.once=_,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s(u)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?b(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function _(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(i,"errorListener"),v(s,"resolver"),E(e,t,s,{once:!0}),"error"!==t&&w(e,i,{once:!0})})}function w(e,t,r){"function"==typeof e.on&&E(e,"error",t,r)}function E(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,v(function i(s){n.once&&e.removeEventListener(t,i),r(s)},"wrapListener"));else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}v(c,"checkListener"),Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:v(function(){return u},"get"),set:v(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e},"set")}),a.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=v(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners"),v(l,"_getMaxListeners"),a.prototype.getMaxListeners=v(function(){return l(this)},"getMaxListeners"),a.prototype.emit=v(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var c=u.length,l=m(u,c),r=0;r<c;++r)i(l[r],this,t);return!0},"emit"),v(h,"_addListener"),a.prototype.addListener=v(function(e,t){return h(this,e,t,!1)},"addListener"),a.prototype.on=a.prototype.addListener,a.prototype.prependListener=v(function(e,t){return h(this,e,t,!0)},"prependListener"),v(f,"onceWrapper"),v(d,"_onceWrap"),a.prototype.once=v(function(e,t){return c(t),this.on(e,d(this,e,t)),this},"once"),a.prototype.prependOnceListener=v(function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},"prependOnceListener"),a.prototype.removeListener=v(function(e,t){var r,n,i,s,o;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},"removeListener"),a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=v(function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},"removeAllListeners"),v(p,"_listeners"),a.prototype.listeners=v(function(e){return p(this,e,!0)},"listeners"),a.prototype.rawListeners=v(function(e){return p(this,e,!1)},"rawListeners"),a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,v(g,"listenerCount"),a.prototype.eventNames=v(function(){return this._eventsCount>0?r(this._events):[]},"eventNames"),v(m,"arrayClone"),v(y,"spliceOne"),v(b,"unwrapListeners"),v(_,"once"),v(w,"addErrorHandlerIfEventEmitter"),v(E,"eventTargetAgnosticAddListener")}),N={};function L(e){return 0}E(N,{Socket:()=>B,isIP:()=>L});var M,D,k,B,j=_(()=>{C(),M=R(I(),1),v(L,"isIP"),D=/^[^.]+\./,k=class e extends M.EventEmitter{constructor(){super(...arguments),A(this,"opts",{}),A(this,"connecting",!1),A(this,"pending",!0),A(this,"writable",!0),A(this,"encrypted",!1),A(this,"authorized",!1),A(this,"destroyed",!1),A(this,"ws",null),A(this,"writeBuffer"),A(this,"tlsState",0),A(this,"tlsRead"),A(this,"tlsWrite")}static get poolQueryViaFetch(){return e.opts.poolQueryViaFetch??e.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){e.opts.poolQueryViaFetch=t}static get fetchEndpoint(){return e.opts.fetchEndpoint??e.defaults.fetchEndpoint}static set fetchEndpoint(t){e.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(e){console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){return e.opts.fetchFunction??e.defaults.fetchFunction}static set fetchFunction(t){e.opts.fetchFunction=t}static get webSocketConstructor(){return e.opts.webSocketConstructor??e.defaults.webSocketConstructor}static set webSocketConstructor(t){e.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??e.webSocketConstructor}set webSocketConstructor(e){this.opts.webSocketConstructor=e}static get wsProxy(){return e.opts.wsProxy??e.defaults.wsProxy}static set wsProxy(t){e.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??e.wsProxy}set wsProxy(e){this.opts.wsProxy=e}static get coalesceWrites(){return e.opts.coalesceWrites??e.defaults.coalesceWrites}static set coalesceWrites(t){e.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??e.coalesceWrites}set coalesceWrites(e){this.opts.coalesceWrites=e}static get useSecureWebSocket(){return e.opts.useSecureWebSocket??e.defaults.useSecureWebSocket}static set useSecureWebSocket(t){e.opts.useSecureWebSocket=t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??e.useSecureWebSocket}set useSecureWebSocket(e){this.opts.useSecureWebSocket=e}static get forceDisablePgSSL(){return e.opts.forceDisablePgSSL??e.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){e.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??e.forceDisablePgSSL}set forceDisablePgSSL(e){this.opts.forceDisablePgSSL=e}static get disableSNI(){return e.opts.disableSNI??e.defaults.disableSNI}static set disableSNI(t){e.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??e.disableSNI}set disableSNI(e){this.opts.disableSNI=e}static get disableWarningInBrowsers(){return e.opts.disableWarningInBrowsers??e.defaults.disableWarningInBrowsers}static set disableWarningInBrowsers(t){e.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){return this.opts.disableWarningInBrowsers??e.disableWarningInBrowsers}set disableWarningInBrowsers(e){this.opts.disableWarningInBrowsers=e}static get pipelineConnect(){return e.opts.pipelineConnect??e.defaults.pipelineConnect}static set pipelineConnect(t){e.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect??e.pipelineConnect}set pipelineConnect(e){this.opts.pipelineConnect=e}static get subtls(){return e.opts.subtls??e.defaults.subtls}static set subtls(t){e.opts.subtls=t}get subtls(){return this.opts.subtls??e.subtls}set subtls(e){this.opts.subtls=e}static get pipelineTLS(){return e.opts.pipelineTLS??e.defaults.pipelineTLS}static set pipelineTLS(t){e.opts.pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??e.pipelineTLS}set pipelineTLS(e){this.opts.pipelineTLS=e}static get rootCerts(){return e.opts.rootCerts??e.defaults.rootCerts}static set rootCerts(t){e.opts.rootCerts=t}get rootCerts(){return this.opts.rootCerts??e.rootCerts}set rootCerts(e){this.opts.rootCerts=e}wsProxyAddrForHost(e,t){let r=this.wsProxy;if(void 0===r)throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string");return"function"==typeof r?r(e,t):`${r}?address=${e}:${t}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,r){this.connecting=!0,r&&this.once("connect",r);let n=v(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),i=v((e,t=!1)=>{e.binaryType="arraybuffer",e.addEventListener("error",e=>{this.emit("error",e),this.emit("close")}),e.addEventListener("message",e=>{if(0===this.tlsState){let t=h.from(e.data);this.emit("data",t)}}),e.addEventListener("close",()=>{this.emit("close")}),t?n():e.addEventListener("open",n)},"configureWebSocket"),s;try{s=this.wsProxyAddrForHost(t,"string"==typeof e?parseInt(e,10):e)}catch(e){this.emit("error",e),this.emit("close");return}try{let e=(this.useSecureWebSocket?"wss:":"ws:")+"//"+s;if(void 0!==this.webSocketConstructor)this.ws=new this.webSocketConstructor(e),i(this.ws);else try{this.ws=new WebSocket(e),i(this.ws)}catch{this.ws=new __unstable_WebSocket(e),i(this.ws)}}catch(e){fetch((this.useSecureWebSocket?"https:":"http:")+"//"+s,{headers:{Upgrade:"websocket"}}).then(t=>{if(this.ws=t.webSocket,null==this.ws)throw e;this.ws.accept(),i(this.ws,!0)}).catch(e=>{this.emit("error",Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \
26
+ ceived ${i}`},RangeError),_(Y,"addNumericalSeparator"),_(X,"checkBounds"),_(z,"checkIntBI"),_(K,"validateNumber"),_(J,"boundsError");var Z=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){t=t||1/0;let r,n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function er(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function en(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}function ei(e){return t.toByteArray(ee(e))}function es(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function eo(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ea(e){return e!=e}_(ee,"base64clean"),_(et,"utf8ToBytes"),_(er,"asciiToBytes"),_(en,"utf16leToBytes"),_(ei,"base64ToBytes"),_(es,"blitBuffer"),_(eo,"isInstance"),_(ea,"numberIsNaN");var eu=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function ec(e){return typeof BigInt>"u"?el:e}function el(){throw Error("BigInt not supported")}_(ec,"defineBigIntMethod"),_(el,"BufferBigIntNotDefined")}),I=w(()=>{l=globalThis,h=globalThis.setImmediate??(e=>setTimeout(e,0)),globalThis.clearImmediate??(e=>clearTimeout(e)),f="function"==typeof globalThis.Buffer&&"function"==typeof globalThis.Buffer.allocUnsafe?globalThis.Buffer:C().Buffer,(d=globalThis.process??{}).env??(d.env={});try{d.nextTick(()=>{})}catch{let e=Promise.resolve();d.nextTick=e.then.bind(e)}}),N=E((e,t)=>{I();var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:_(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply");function s(e){console&&console.warn&&console.warn(e)}r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?_(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):_(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys"),_(s,"ProcessEmitWarning");var o=Number.isNaN||_(function(e){return e!=e},"NumberIsNaN");function a(){a.init.call(this)}_(a,"EventEmitter"),t.exports=a,t.exports.once=v,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s(u)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?b(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function v(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}_(i,"errorListener"),_(s,"resolver"),E(e,t,s,{once:!0}),"error"!==t&&w(e,i,{once:!0})})}function w(e,t,r){"function"==typeof e.on&&E(e,"error",t,r)}function E(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,_(function i(s){n.once&&e.removeEventListener(t,i),r(s)},"wrapListener"));else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}_(c,"checkListener"),Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:_(function(){return u},"get"),set:_(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e},"set")}),a.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=_(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners"),_(l,"_getMaxListeners"),a.prototype.getMaxListeners=_(function(){return l(this)},"getMaxListeners"),a.prototype.emit=_(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var c=u.length,l=m(u,c),r=0;r<c;++r)i(l[r],this,t);return!0},"emit"),_(h,"_addListener"),a.prototype.addListener=_(function(e,t){return h(this,e,t,!1)},"addListener"),a.prototype.on=a.prototype.addListener,a.prototype.prependListener=_(function(e,t){return h(this,e,t,!0)},"prependListener"),_(f,"onceWrapper"),_(d,"_onceWrap"),a.prototype.once=_(function(e,t){return c(t),this.on(e,d(this,e,t)),this},"once"),a.prototype.prependOnceListener=_(function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},"prependOnceListener"),a.prototype.removeListener=_(function(e,t){var r,n,i,s,o;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},"removeListener"),a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=_(function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},"removeAllListeners"),_(p,"_listeners"),a.prototype.listeners=_(function(e){return p(this,e,!0)},"listeners"),a.prototype.rawListeners=_(function(e){return p(this,e,!1)},"rawListeners"),a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,_(g,"listenerCount"),a.prototype.eventNames=_(function(){return this._eventsCount>0?r(this._events):[]},"eventNames"),_(m,"arrayClone"),_(y,"spliceOne"),_(b,"unwrapListeners"),_(v,"once"),_(w,"addErrorHandlerIfEventEmitter"),_(E,"eventTargetAgnosticAddListener")}),L={};function M(e){return 0}S(L,{Socket:()=>j,isIP:()=>M});var D,k,B,j,U=w(()=>{I(),D=x(N(),1),_(M,"isIP"),k=/^[^.]+\./,B=class e extends D.EventEmitter{constructor(){super(...arguments),T(this,"opts",{}),T(this,"connecting",!1),T(this,"pending",!0),T(this,"writable",!0),T(this,"encrypted",!1),T(this,"authorized",!1),T(this,"destroyed",!1),T(this,"ws",null),T(this,"writeBuffer"),T(this,"tlsState",0),T(this,"tlsRead"),T(this,"tlsWrite")}static get poolQueryViaFetch(){return e.opts.poolQueryViaFetch??e.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){e.opts.poolQueryViaFetch=t}static get fetchEndpoint(){return e.opts.fetchEndpoint??e.defaults.fetchEndpoint}static set fetchEndpoint(t){e.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(e){console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){return e.opts.fetchFunction??e.defaults.fetchFunction}static set fetchFunction(t){e.opts.fetchFunction=t}static get webSocketConstructor(){return e.opts.webSocketConstructor??e.defaults.webSocketConstructor}static set webSocketConstructor(t){e.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??e.webSocketConstructor}set webSocketConstructor(e){this.opts.webSocketConstructor=e}static get wsProxy(){return e.opts.wsProxy??e.defaults.wsProxy}static set wsProxy(t){e.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??e.wsProxy}set wsProxy(e){this.opts.wsProxy=e}static get coalesceWrites(){return e.opts.coalesceWrites??e.defaults.coalesceWrites}static set coalesceWrites(t){e.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??e.coalesceWrites}set coalesceWrites(e){this.opts.coalesceWrites=e}static get useSecureWebSocket(){return e.opts.useSecureWebSocket??e.defaults.useSecureWebSocket}static set useSecureWebSocket(t){e.opts.useSecureWebSocket=t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??e.useSecureWebSocket}set useSecureWebSocket(e){this.opts.useSecureWebSocket=e}static get forceDisablePgSSL(){return e.opts.forceDisablePgSSL??e.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){e.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??e.forceDisablePgSSL}set forceDisablePgSSL(e){this.opts.forceDisablePgSSL=e}static get disableSNI(){return e.opts.disableSNI??e.defaults.disableSNI}static set disableSNI(t){e.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??e.disableSNI}set disableSNI(e){this.opts.disableSNI=e}static get disableWarningInBrowsers(){return e.opts.disableWarningInBrowsers??e.defaults.disableWarningInBrowsers}static set disableWarningInBrowsers(t){e.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){return this.opts.disableWarningInBrowsers??e.disableWarningInBrowsers}set disableWarningInBrowsers(e){this.opts.disableWarningInBrowsers=e}static get pipelineConnect(){return e.opts.pipelineConnect??e.defaults.pipelineConnect}static set pipelineConnect(t){e.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect??e.pipelineConnect}set pipelineConnect(e){this.opts.pipelineConnect=e}static get subtls(){return e.opts.subtls??e.defaults.subtls}static set subtls(t){e.opts.subtls=t}get subtls(){return this.opts.subtls??e.subtls}set subtls(e){this.opts.subtls=e}static get pipelineTLS(){return e.opts.pipelineTLS??e.defaults.pipelineTLS}static set pipelineTLS(t){e.opts.pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??e.pipelineTLS}set pipelineTLS(e){this.opts.pipelineTLS=e}static get rootCerts(){return e.opts.rootCerts??e.defaults.rootCerts}static set rootCerts(t){e.opts.rootCerts=t}get rootCerts(){return this.opts.rootCerts??e.rootCerts}set rootCerts(e){this.opts.rootCerts=e}wsProxyAddrForHost(e,t){let r=this.wsProxy;if(void 0===r)throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string");return"function"==typeof r?r(e,t):`${r}?address=${e}:${t}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,r){this.connecting=!0,r&&this.once("connect",r);let n=_(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),i=_((e,t=!1)=>{e.binaryType="arraybuffer",e.addEventListener("error",e=>{this.emit("error",e),this.emit("close")}),e.addEventListener("message",e=>{if(0===this.tlsState){let t=f.from(e.data);this.emit("data",t)}}),e.addEventListener("close",()=>{this.emit("close")}),t?n():e.addEventListener("open",n)},"configureWebSocket"),s;try{s=this.wsProxyAddrForHost(t,"string"==typeof e?parseInt(e,10):e)}catch(e){this.emit("error",e),this.emit("close");return}try{let e=(this.useSecureWebSocket?"wss:":"ws:")+"//"+s;if(void 0!==this.webSocketConstructor)this.ws=new this.webSocketConstructor(e),i(this.ws);else try{this.ws=new WebSocket(e),i(this.ws)}catch{this.ws=new __unstable_WebSocket(e),i(this.ws)}}catch(e){fetch((this.useSecureWebSocket?"https:":"http:")+"//"+s,{headers:{Upgrade:"websocket"}}).then(t=>{if(this.ws=t.webSocket,null==this.ws)throw e;this.ws.accept(),i(this.ws,!0)}).catch(e=>{this.emit("error",Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \
27
27
  to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\
28
- ket--undefined. Details: ${e}`)),this.emit("close")})}}async startTls(e){if(void 0===this.subtls)throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let t=await this.subtls.TrustedCert.databaseFromPEM(this.rootCerts),r=new this.subtls.WebSocketReadQueue(this.ws),n=r.read.bind(r),i=this.rawWrite.bind(this),{read:s,write:o}=await this.subtls.startTls(e,t,n,i,{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=s,this.tlsWrite=o,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this.tlsRead();if(void 0===e)break;{let t=h.from(e);this.emit("data",t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws&&this.ws.send(e);return}if(void 0===this.writeBuffer)this.writeBuffer=e,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",r=e=>{}){return 0===e.length?r():("string"==typeof e&&(e=h.from(e,t)),0===this.tlsState?(this.rawWrite(e),r()):1===this.tlsState?this.once("secureConnection",()=>{this.write(e,t,r)}):(this.tlsWrite(e),r())),!0}end(e=h.alloc(0),t="utf8",r=()=>{}){return this.write(e,t,()=>{this.ws.close(),r()}),this}destroy(){return this.destroyed=!0,this.end()}},v(k,"Socket"),A(k,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:v((e,t,r)=>"https://"+(r?.jwtAuth?e.replace(D,"apiauth."):e.replace(D,"api."))+"/sql","fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0,wsProxy:v(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1,disableWarningInBrowsers:!1}),A(k,"opts",{}),B=k}),U={};function F(e,t=!1){let{protocol:r}=new URL(e),{username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,searchParams:l,hash:h}=new URL("http:"+e.substring(r.length));i=decodeURIComponent(i),n=decodeURIComponent(n),u=decodeURIComponent(u);let f=n+":"+i,d=t?Object.fromEntries(l.entries()):c;return{href:e,protocol:r,auth:f,username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,query:d,hash:h}}E(U,{parse:()=>F});var q=_(()=>{C(),v(F,"parse")}),$=w(e=>{C(),e.parse=function(e,t){return new r(e,t).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return"\\"===e?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&("NULL"!==(t=this.recorded.join(""))||e||(t=null),null!==t&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if("["===this.source[0])for(;!this.isEof()&&"="!==this.nextCharacter().value;);}parse(t){var r,n,i;for(this.consumeDimensions();!this.isEof();)if("{"!==(r=this.nextCharacter()).value||i){if("}"!==r.value||i)'"'!==r.value||r.escaped?","!==r.value||i?this.record(r.value):this.newEntry():(i&&this.newEntry(!0),i=!i);else if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else this.dimension++,this.dimension>1&&(n=new e(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);if(0!==this.dimension)throw Error("array dimension not balanced");return this.entries}};v(t,"ArrayParser");var r=t;function n(e){return e}v(n,"identity")}),G=w((e,t)=>{C();var r=$();t.exports={create:v(function(e,t){return{parse:v(function(){return r.parse(e,t)},"parse")}},"create")}}),H=w((e,t)=>{C();var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;function o(e){var t=n.exec(e);if(t){var r=parseInt(t[1],10);t[4]&&(r=u(r));var i=new Date(r,parseInt(t[2],10)-1,t[3]);return c(r)&&i.setFullYear(r),i}}function a(e){if(e.endsWith("+00"))return 0;var t=i.exec(e.split(" ")[1]);if(t){var r=t[1];return"Z"===r?0:(3600*parseInt(t[2],10)+60*parseInt(t[3]||0,10)+parseInt(t[4]||0,10))*("-"===r?-1:1)*1e3}}function u(e){return-(e-1)}function c(e){return e>=0&&e<100}t.exports=v(function(e){if(s.test(e))return Number(e.replace("i","I"));var t=r.exec(e);if(!t)return o(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=u(i));var l=parseInt(t[2],10)-1,h=t[3],f=parseInt(t[4],10),d=parseInt(t[5],10),p=parseInt(t[6],10),g=t[7];g=g?1e3*parseFloat(g):0;var m,y=a(e);return null!=y?(m=new Date(Date.UTC(i,l,h,f,d,p,g)),c(i)&&m.setUTCFullYear(i),0!==y&&m.setTime(m.getTime()-y)):(m=new Date(i,l,h,f,d,p,g),c(i)&&m.setFullYear(i)),m},"parseDate"),v(o,"getDate"),v(a,"timeZoneOffset"),v(u,"bcYearToNegativeYear"),v(c,"is0To99")}),V=w((e,t)=>{C(),t.exports=n;var r=Object.prototype.hasOwnProperty;function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}v(n,"extend")}),W=w((e,t)=>{C();var r=V();function n(e){if(!(this instanceof n))return new n(e);r(this,d(e))}t.exports=n,v(n,"PostgresInterval");var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&0>e.indexOf("seconds")&&e.push("seconds"),0===e.length?"0":e.map(function(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),t+" "+e},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},o=["years","months","days"],a=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){return"P"+o.map(e,this).join("")+"T"+a.map(e,this).join("");function e(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),t+s[e]}};var u="([+-]?\\d+)",c=new RegExp([u+"\\s+years?",u+"\\s+mons?",u+"\\s+days?","([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e){return"("+e+")?"}).join("\\s*")),l={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function f(e){return parseInt(e+"000000".slice(e.length),10)/1e3}function d(e){if(!e)return{};var t=c.exec(e),r="-"===t[8];return Object.keys(l).reduce(function(e,n){var i=t[l[n]];return i&&(i="milliseconds"===n?f(i):parseInt(i,10))&&(r&&~h.indexOf(n)&&(i*=-1),e[n]=i),e},{})}v(f,"parseMilliseconds"),v(d,"parse")}),Q=w((e,t)=>{C(),t.exports=v(function(e){if(/^\\x/.test(e))return new h(e.substr(2),"hex");for(var t="",r=0;r<e.length;)if("\\"!==e[r])t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var n=1;r+n<e.length&&"\\"===e[r+n];)n++;for(var i=0;i<Math.floor(n/2);++i)t+="\\";r+=2*Math.floor(n/2)}return new h(t,"binary")},"parseBytea")}),Y=w((e,t)=>{C();var r=$(),n=G(),i=H(),s=W(),o=Q();function a(e){return v(function(t){return null===t?t:e(t)},"nullAllowed")}function u(e){return null===e?e:"TRUE"===e||"t"===e||"true"===e||"y"===e||"yes"===e||"on"===e||"1"===e}function c(e){return e?r.parse(e,u):null}function l(e){return parseInt(e,10)}function h(e){return e?r.parse(e,a(l)):null}function f(e){return e?r.parse(e,a(function(e){return w(e).trim()})):null}v(a,"allowNull"),v(u,"parseBool"),v(c,"parseBoolArray"),v(l,"parseBaseTenInt"),v(h,"parseIntegerArray"),v(f,"parseBigIntegerArray");var d=v(function(e){return e?n.create(e,function(e){return null!==e&&(e=S(e)),e}).parse():null},"parsePointArray"),p=v(function(e){return e?n.create(e,function(e){return null!==e&&(e=parseFloat(e)),e}).parse():null},"parseFloatArray"),g=v(function(e){return e?n.create(e).parse():null},"parseStringArray"),m=v(function(e){return e?n.create(e,function(e){return null!==e&&(e=i(e)),e}).parse():null},"parseDateArray"),y=v(function(e){return e?n.create(e,function(e){return null!==e&&(e=s(e)),e}).parse():null},"parseIntervalArray"),b=v(function(e){return e?r.parse(e,a(o)):null},"parseByteAArray"),_=v(function(e){return parseInt(e,10)},"parseInteger"),w=v(function(e){var t=String(e);return/^\d+$/.test(t)?t:e},"parseBigInteger"),E=v(function(e){return e?r.parse(e,a(JSON.parse)):null},"parseJsonArray"),S=v(function(e){return"("!==e[0]?null:{x:parseFloat((e=e.substring(1,e.length-1).split(","))[0]),y:parseFloat(e[1])}},"parsePoint"),R=v(function(e){if("<"!==e[0]&&"("!==e[1])return null;for(var t="(",r="",n=!1,i=2;i<e.length-1;i++){if(n||(t+=e[i]),")"===e[i]){n=!0;continue}n&&","!==e[i]&&(r+=e[i])}var s=S(t);return s.radius=parseFloat(r),s},"parseCircle");t.exports={init:v(function(e){e(20,w),e(21,_),e(23,_),e(26,_),e(700,parseFloat),e(701,parseFloat),e(16,u),e(1082,i),e(1114,i),e(1184,i),e(600,S),e(651,g),e(718,R),e(1e3,c),e(1001,b),e(1005,h),e(1007,h),e(1028,h),e(1016,f),e(1017,d),e(1021,p),e(1022,p),e(1231,p),e(1014,g),e(1015,g),e(1008,g),e(1009,g),e(1040,g),e(1041,g),e(1115,m),e(1182,m),e(1185,m),e(1186,s),e(1187,y),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,E),e(3807,E),e(3907,g),e(2951,g),e(791,g),e(1183,g),e(1270,g)},"init")}}),X=w((e,t)=>{function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),n="";t<0&&(t=~t+(0===r),r=~r+1>>>0,n="-");var i,s,o,a,u,c,l="";if(i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";return l=a+o+l,n+(o=""+(s=0x100000000*(i=t%1e6)+r)%1e6)+l}C(),v(r,"readInt8"),t.exports=r}),z=w((e,t)=>{C();var r=X(),n=v(function(e,t,r,n,i){r=r||0,n=n||!1,i=i||function(e,t,r){return e*Math.pow(2,r)+t};var s=r>>3,o=v(function(e){return n?255&~e:e},"inv"),a=255,u=8-r%8;t<u&&(a=255<<8-t&255,u=t),r&&(a>>=r%8);var c=0;r%8+t>=8&&(c=i(0,o(e[s])&a,u));for(var l=t+r>>3,h=s+1;h<l;h++)c=i(c,o(e[h]),8);var f=(t+r)%8;return f>0&&(c=i(c,o(e[l])>>8-f,f)),c},"parseBits"),i=v(function(e,t,r){var i=Math.pow(2,r-1)-1,s=n(e,1),o=n(e,r,1);if(0===o)return 0;var a=1,u=n(e,t,r+1,!1,v(function(e,t,r){0===e&&(e=1);for(var n=1;n<=r;n++)a/=2,(t&1<<r-n)>0&&(e+=a);return e},"parsePrecisionBits"));return o==Math.pow(2,r+1)-1?0===u?0===s?1/0:-1/0:NaN:(0===s?1:-1)*Math.pow(2,o-i)*u},"parseFloatFromBits"),s=v(function(e){return 1==n(e,1)?-1*(n(e,15,1,!0)+1):n(e,15,1)},"parseInt16"),o=v(function(e){return 1==n(e,1)?-1*(n(e,31,1,!0)+1):n(e,31,1)},"parseInt32"),a=v(function(e){return i(e,23,8)},"parseFloat32"),u=v(function(e){return i(e,52,11)},"parseFloat64"),c=v(function(e){var t=n(e,16,32);if(49152==t)return NaN;for(var r=Math.pow(1e4,n(e,16,16)),i=0,s=n(e,16),o=0;o<s;o++)i+=n(e,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,n(e,16,48));return(0===t?1:-1)*Math.round(i*a)/a},"parseNumeric"),l=v(function(e,t){var r=n(t,1),i=n(t,63,1),s=new Date((0===r?1:-1)*i/1e3+9466848e5);return e||s.setTime(s.getTime()+6e4*s.getTimezoneOffset()),s.usec=i%1e3,s.getMicroSeconds=function(){return this.usec},s.setMicroSeconds=function(e){this.usec=e},s.getUTCMicroSeconds=function(){return this.usec},s},"parseDate"),h=v(function(e){for(var t=n(e,32),r=(n(e,32,32),n(e,32,64)),i=96,s=[],o=0;o<t;o++)s[o]=n(e,32,i),i+=64;var a=v(function(t){var r,s=n(e,32,i);return(i+=32,0xffffffff==s)?null:23==t||20==t?(r=n(e,8*s,i),i+=8*s,r):25==t?e.toString(this.encoding,i>>3,(i+=s<<3)>>3):void console.log("ERROR: ElementType not implemented: "+t)},"parseElement"),u=v(function(e,t){var r,n=[];if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=u(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=a(t);return n},"parse");return u(s,r)},"parseArray"),f=v(function(e){return e.toString("utf8")},"parseText"),d=v(function(e){return null===e?null:n(e,8)>0},"parseBool");t.exports={init:v(function(e){e(20,r),e(21,s),e(23,o),e(26,o),e(1700,c),e(700,a),e(701,u),e(16,d),e(1114,l.bind(null,!1)),e(1184,l.bind(null,!0)),e(1e3,h),e(1007,h),e(1016,h),e(1008,h),e(1009,h),e(25,f)},"init")}}),K=w((e,t)=>{C(),t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}}),J=w(e=>{C();var t=Y(),r=z(),n=G(),i=K();e.getTypeParser=a,e.setTypeParser=u,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function o(e){return String(e)}function a(e,t){return s[t=t||"text"]&&s[t][e]||o}function u(e,t,r){"function"==typeof t&&(r=t,t="text"),s[t][e]=r}v(o,"noParse"),v(a,"getTypeParser"),v(u,"setTypeParser"),t.init(function(e,t){s.text[e]=t}),r.init(function(e,t){s.binary[e]=t})}),Z=w((e,t)=>{C();var r=J();function n(e){this._types=e||r,this.text={},this.binary={}}v(n,"TypeOverrides"),n.prototype.getOverrides=function(e){switch(e){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(e,t,r){"function"==typeof t&&(r=t,t="text"),this.getOverrides(t)[e]=r},n.prototype.getTypeParser=function(e,t){return t=t||"text",this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=n});function ee(e){let t=0x6a09e667,r=0xbb67ae85,n=0x3c6ef372,i=0xa54ff53a,s=0x510e527f,o=0x9b05688c,a=0x1f83d9ab,u=0x5be0cd19,c=0,l=0,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=v((e,t)=>e>>>t|e<<32-t,"rrot"),d=new Uint32Array(64),p=new Uint8Array(64),g=v(()=>{for(let e=0,t=0;e<16;e++,t+=4)d[e]=p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3];for(let e=16;e<64;e++){let t=f(d[e-15],7)^f(d[e-15],18)^d[e-15]>>>3,r=f(d[e-2],17)^f(d[e-2],19)^d[e-2]>>>10;d[e]=d[e-16]+t+d[e-7]+r|0}let e=t,c=r,g=n,m=i,y=s,b=o,v=a,_=u;for(let t=0;t<64;t++){let r=_+(f(y,6)^f(y,11)^f(y,25))+(y&b^~y&v)+h[t]+d[t]|0,n=(f(e,2)^f(e,13)^f(e,22))+(e&c^e&g^c&g)|0;_=v,v=b,b=y,y=m+r|0,m=g,g=c,c=e,e=r+n|0}t=t+e|0,r=r+c|0,n=n+g|0,i=i+m|0,s=s+y|0,o=o+b|0,a=a+v|0,u=u+_|0,l=0},"process"),m=v(e=>{"string"==typeof e&&(e=new TextEncoder().encode(e));for(let t=0;t<e.length;t++)p[l++]=e[t],64===l&&g();c+=e.length},"add"),y=v(()=>{if(p[l++]=128,64==l&&g(),l+8>64){for(;l<64;)p[l++]=0;g()}for(;l<58;)p[l++]=0;let e=8*c;p[l++]=e/0x10000000000&255,p[l++]=e/0x100000000&255,p[l++]=e>>>24,p[l++]=e>>>16&255,p[l++]=e>>>8&255,p[l++]=255&e,g();let h=new Uint8Array(32);return h[0]=t>>>24,h[1]=t>>>16&255,h[2]=t>>>8&255,h[3]=255&t,h[4]=r>>>24,h[5]=r>>>16&255,h[6]=r>>>8&255,h[7]=255&r,h[8]=n>>>24,h[9]=n>>>16&255,h[10]=n>>>8&255,h[11]=255&n,h[12]=i>>>24,h[13]=i>>>16&255,h[14]=i>>>8&255,h[15]=255&i,h[16]=s>>>24,h[17]=s>>>16&255,h[18]=s>>>8&255,h[19]=255&s,h[20]=o>>>24,h[21]=o>>>16&255,h[22]=o>>>8&255,h[23]=255&o,h[24]=a>>>24,h[25]=a>>>16&255,h[26]=a>>>8&255,h[27]=255&a,h[28]=u>>>24,h[29]=u>>>16&255,h[30]=u>>>8&255,h[31]=255&u,h},"digest");return void 0===e?{add:m,digest:y}:(m(e),y())}var et,er,en=_(()=>{C(),v(ee,"sha256")}),ei=_(()=>{C(),v(et=class e{constructor(){A(this,"_dataLength",0),A(this,"_bufferLength",0),A(this,"_state",new Int32Array(4)),A(this,"_buffer",new ArrayBuffer(68)),A(this,"_buffer8"),A(this,"_buffer32"),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(t){let r=e.hexChars,n=e.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=8*a,i=t[a],o=0;o<8;o+=2)n[s+1+o]=r.charAt(15&i),i>>>=4,n[s+0+o]=r.charAt(15&i),i>>>=4;return n.join("")}static _md5cycle(e,t){let r=e[0],n=e[1],i=e[2],s=e[3];r+=(n&i|~n&s)+t[0]-0x28955b88|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[1]-0x173848aa|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[2]+0x242070db|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[3]-0x3e423112|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[4]-0xa83f051|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[5]+0x4787c62a|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[6]-0x57cfb9ed|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[7]-0x2b96aff|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[8]+0x698098d8|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[9]-0x74bb0851|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[11]-0x76a32842|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[12]+0x6b901122|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[13]-0x2678e6d|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[14]-0x5986bc72|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[15]+0x49b40821|0,r+=((n=(n<<22|n>>>10)+i|0)&s|i&~s)+t[1]-0x9e1da9e|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[6]-0x3fbf4cc0|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[11]+0x265e5a51|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[0]-0x16493856|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[5]-0x29d0efa3|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[10]+0x2441453|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[15]-0x275e197f|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[4]-0x182c0438|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[9]+0x21e1cde6|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[14]-0x3cc8f82a|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[3]-0xb2af279|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[8]+0x455a14ed|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[13]-0x561c16fb|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[2]-0x3105c08|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[7]+0x676f02d9|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[12]-0x72d5b376|0,r+=((n=(n<<20|n>>>12)+i|0)^i^s)+t[5]-378558|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[8]-0x788e097f|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[11]+0x6d9d6122|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[14]-0x21ac7f4|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[1]-0x5b4115bc|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[4]+0x4bdecfa9|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[7]-0x944b4a0|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[10]-0x41404390|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[13]+0x289b7ec6|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[0]-0x155ed806|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[3]-0x2b10cf7b|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[6]+0x4881d05|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[9]-0x262b2fc7|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[12]-0x1924661b|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[15]+0x1fa27cf8|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[2]-0x3b53a99b|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~s))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[7]+0x432aff97|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[14]-0x546bdc59|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[5]-0x36c5fc7|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[3]-0x70f3336e|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[10]-1051523|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[1]-0x7a7ba22f|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[15]-0x1d31920|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[6]-0x5cfebcec|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[13]+0x4e0811a1|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[11]-0x42c50dcb|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[2]+0x2ad7d2bb|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[9]-0x14792c6f|0,n=(n<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o;for(o=0;o<t.length;o+=1){if((s=t.charCodeAt(o))<128)r[i++]=s;else if(s<2048)r[i++]=(s>>>6)+192,r[i++]=63&s|128;else if(s<55296||s>56319)r[i++]=(s>>>12)+224,r[i++]=s>>>6&63|128,r[i++]=63&s|128;else{if((s=(s-55296)*1024+(t.charCodeAt(++o)-56320)+65536)>1114111)throw Error("Unicode standard supports code points up to U+10FFFF");r[i++]=(s>>>18)+240,r[i++]=s>>>12&63|128,r[i++]=s>>>6&63|128,r[i++]=63&s|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t[o++];if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,r=e.state,n=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let r=this._bufferLength,n=this._buffer8,i=this._buffer32,s=(r>>2)+1;this._dataLength+=r;let o=8*this._dataLength;if(n[r]=128,n[r+1]=n[r+2]=n[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=0xffffffff)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;let t=parseInt(e[2],16),r=parseInt(e[1],16)||0;i[14]=t,i[15]=r}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}},"Md5"),A(et,"stateIdentity",new Int32Array([0x67452301,-0x10325477,-0x67452302,0x10325476])),A(et,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),A(et,"hexChars","0123456789abcdef"),A(et,"hexOut",[]),A(et,"onePassHasher",new et),er=et}),es={};function eo(e){return crypto.getRandomValues(h.alloc(e))}function ea(e){if("sha256"===e)return{update:v(function(e){return{digest:v(function(){return h.from(ee(e))},"digest")}},"update")};if("md5"===e)return{update:v(function(e){return{digest:v(function(){return"string"==typeof e?er.hashStr(e):er.hashByteArray(e)},"digest")}},"update")};throw Error(`Hash type '${e}' not supported`)}function eu(e,t){if("sha256"!==e)throw Error(`\
29
- Only sha256 is supported (requested: '${e}')`);return{update:v(function(e){return{digest:v(function(){"string"==typeof t&&(t=new TextEncoder().encode(t)),"string"==typeof e&&(e=new TextEncoder().encode(e));let r=t.length;if(r>64)t=ee(t);else if(r<64){let e=new Uint8Array(64);e.set(t),t=e}let n=new Uint8Array(64),i=new Uint8Array(64);for(let e=0;e<64;e++)n[e]=54^t[e],i[e]=92^t[e];let s=new Uint8Array(e.length+64);s.set(n,0),s.set(e,64);let o=new Uint8Array(96);return o.set(i,0),o.set(ee(s),64),h.from(ee(o))},"digest")}},"update")}}E(es,{createHash:()=>ea,createHmac:()=>eu,randomBytes:()=>eo});var ec=_(()=>{C(),en(),ei(),v(eo,"randomBytes"),v(ea,"createHash"),v(eu,"createHmac")}),el=w((e,t)=>{C(),t.exports={host:"localhost",user:"win32"===f.platform?f.env.USERNAME:f.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var r=J(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(e){r.setTypeParser(20,"text",e?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",e?r.getTypeParser(1007,"text"):i)})}),eh=w((e,t)=>{C();var r=(ec(),x(es)),n=el();function i(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function s(e){for(var t="{",r=0;r<e.length;r++)r>0&&(t+=","),null===e[r]||typeof e[r]>"u"?t+="NULL":Array.isArray(e[r])?t+=s(e[r]):e[r]instanceof h?t+="\\\\x"+e[r].toString("hex"):t+=i(o(e[r]));return t+"}"}v(i,"escapeElement"),v(s,"arrayString");var o=v(function(e,t){if(null==e)return null;if(e instanceof h)return e;if(ArrayBuffer.isView(e)){var r=h.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?l(e):c(e):Array.isArray(e)?s(e):"object"==typeof e?a(e,t):e.toString()},"prepareValue");function a(e,t){if(e&&"function"==typeof e.toPostgres){if(-1!==(t=t||[]).indexOf(e))throw Error('circular reference detected while preparing "'+e+'" for query');return t.push(e),o(e.toPostgres(o),t)}return JSON.stringify(e)}function u(e,t){for(e=""+e;e.length<t;)e="0"+e;return e}function c(e){var t=-e.getTimezoneOffset(),r=e.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);var i=u(r,4)+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+u(e.getHours(),2)+":"+u(e.getMinutes(),2)+":"+u(e.getSeconds(),2)+"."+u(e.getMilliseconds(),3);return t<0?(i+="-",t*=-1):i+="+",i+=u(Math.floor(t/60),2)+":"+u(t%60,2),n&&(i+=" BC"),i}function l(e){var t=e.getUTCFullYear(),r=t<1;r&&(t=Math.abs(t)+1);var n=u(t,4)+"-"+u(e.getUTCMonth()+1,2)+"-"+u(e.getUTCDate(),2)+"T"+u(e.getUTCHours(),2)+":"+u(e.getUTCMinutes(),2)+":"+u(e.getUTCSeconds(),2)+"."+u(e.getUTCMilliseconds(),3);return n+="+00:00",r&&(n+=" BC"),n}function f(e,t,r){return e="string"==typeof e?{text:e}:e,t&&("function"==typeof t?e.callback=t:e.values=t),r&&(e.callback=r),e}v(a,"prepareObject"),v(u,"pad"),v(c,"dateToString"),v(l,"dateToStringUTC"),v(f,"normalizeQueryConfig");var d=v(function(e){return r.createHash("md5").update(e,"utf-8").digest("hex")},"md5"),p=v(function(e,t,r){var n=d(t+e);return"md5"+d(h.concat([h.from(n),r]))},"postgresMd5PasswordHash");t.exports={prepareValue:v(function(e){return o(e)},"prepareValueWrapper"),normalizeQueryConfig:f,postgresMd5PasswordHash:p,md5:d}}),ef={};E(ef,{default:()=>ed});var ed,ep=_(()=>{C(),ed={}}),eg=w((e,t)=>{C();var r=(ec(),x(es));function n(e){if(-1===e.indexOf("SCRAM-SHA-256"))throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let t=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:t,response:"n,,n=*,r="+t,message:"SASLInitialResponse"}}function i(e,t,r){if("SASLInitialResponse"!==e.message)throw Error("SASL: Last message was not SASLInitialResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if("string"!=typeof r)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=c(r);if(n.nonce.startsWith(e.clientNonce)){if(n.nonce.length===e.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var i=g(t,h.from(n.salt,"base64"),n.iteration),s=p(i,"Client Key"),o=d(s),a="n=*,r="+e.clientNonce,u="r="+n.nonce+",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,m=a+","+u+","+l,y=f(s,p(o,m)).toString("base64"),b=p(i,"Server Key"),v=p(b,m);e.message="SASLResponse",e.serverSignature=v.toString("base64"),e.response=l+",p="+y}function s(e,t){if("SASLResponse"!==e.message)throw Error("SASL: Last message was not SASLResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=l(t);if(r!==e.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function o(e){if("string"!=typeof e)throw TypeError("SASL: text must be a string");return e.split("").map((t,r)=>e.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function a(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function u(e){if("string"!=typeof e)throw TypeError("SASL: attribute pairs text must be a string");return new Map(e.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]}))}function c(e){let t=u(e),r=t.get("r");if(r){if(!o(r))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=t.get("s");if(n){if(!a(n))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=t.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");return{nonce:r,salt:n,iteration:parseInt(i,10)}}function l(e){let t=u(e).get("v");if(t){if(!a(t))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}}function f(e,t){if(!h.isBuffer(e))throw TypeError("first argument must be a Buffer");if(!h.isBuffer(t))throw TypeError("second argument must be a Buffer");if(e.length!==t.length)throw Error("Buffer lengths must match");if(0===e.length)throw Error("Buffers cannot be empty");return h.from(e.map((r,n)=>e[n]^t[n]))}function d(e){return r.createHash("sha256").update(e).digest()}function p(e,t){return r.createHmac("sha256",e).update(t).digest()}function g(e,t,r){for(var n=p(e,h.concat([t,h.from([0,0,0,1])])),i=n,s=0;s<r-1;s++)i=f(i,n=p(e,n));return i}v(n,"startSession"),v(i,"continueSession"),v(s,"finalizeSession"),v(o,"isPrintableChars"),v(a,"isBase64"),v(u,"parseAttributePairs"),v(c,"parseServerFirstMessage"),v(l,"parseServerFinalMessage"),v(f,"xorBuffers"),v(d,"sha256"),v(p,"hmacSha256"),v(g,"Hi"),t.exports={startSession:n,continueSession:i,finalizeSession:s}}),em={};function ey(...e){return e.join("/")}E(em,{join:()=>ey});var eb=_(()=>{C(),v(ey,"join")}),ev={};function e_(e,t){t(Error("No filesystem"))}E(ev,{stat:()=>e_});var ew=_(()=>{C(),v(e_,"stat")}),eE={};E(eE,{default:()=>eS});var eS,eR=_(()=>{C(),eS={}}),ex={};E(ex,{StringDecoder:()=>eT});var eA,eT,eP=_(()=>{C(),v(eA=class{constructor(e){A(this,"td"),this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}},"StringDecoder"),eT=eA}),eO=w((e,t)=>{C();var{Transform:r}=(eR(),x(eE)),{StringDecoder:n}=(eP(),x(ex)),i=Symbol("last"),s=Symbol("decoder");function o(e,t,r){let n;if(this.overflow){if(1===(n=this[s].write(e).split(this.matcher)).length)return r();n.shift(),this.overflow=!1}else this[i]+=this[s].write(e),n=this[i].split(this.matcher);this[i]=n.pop();for(let e=0;e<n.length;e++)try{u(this,this.mapper(n[e]))}catch(e){return r(e)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow)return void r(Error("maximum buffer reached"));r()}function a(e){if(this[i]+=this[s].end(),this[i])try{u(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function u(e,t){void 0!==t&&e.push(t)}function c(e){return e}function l(e,t,u){switch(e=e||/\r?\n/,t=t||c,u=u||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||e[Symbol.split]||(u=e,e=/\r?\n/);break;case 2:"function"==typeof e?(u=t,t=e,e=/\r?\n/):"object"==typeof t&&(u=t,t=c)}(u=Object.assign({},u)).autoDestroy=!0,u.transform=o,u.flush=a,u.readableObjectMode=!0;let l=new r(u);return l[i]="",l[s]=new n("utf8"),l.matcher=e,l.mapper=t,l.maxLength=u.maxLength,l.skipOverflow=u.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}v(o,"transform"),v(a,"flush"),v(u,"push"),v(c,"noop"),v(l,"split"),t.exports=l}),eC=w((e,t)=>{C();var r=(eb(),x(em)),n=(eR(),x(eE)).Stream,i=eO(),s=(ep(),x(ef)),o="win32"===f.platform,a=f.stderr;function u(e){return(61440&e)==32768}v(u,"isRegFile");var c=["host","port","database","user","password"],l=c.length,h=c[l-1];function d(){if(a instanceof n&&!0===a.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
- `);a.write(s.format.apply(s,e))}}v(d,"warn"),Object.defineProperty(t.exports,"isWin",{get:v(function(){return o},"get"),set:v(function(e){o=e},"set")}),t.exports.warnTo=function(e){var t=a;return a=e,t},t.exports.getFileName=function(e){var t=e||f.env;return t.PGPASSFILE||(o?r.join(t.APPDATA||"./","postgresql","pgpass.conf"):r.join(t.HOME||"./",".pgpass"))},t.exports.usePgPass=function(e,t){return!Object.prototype.hasOwnProperty.call(f.env,"PGPASSWORD")&&(!!o||(t=t||"<unkn>",u(e.mode)?!(63&e.mode)||(d('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',t),!1):(d('WARNING: password file "%s" is not a plain file',t),!1)))};var p=t.exports.match=function(e,t){return c.slice(0,-1).reduce(function(r,n,i){return 1==i&&Number(e[n]||5432)===Number(t[n])?r&&!0:r&&("*"===t[n]||t[n]===e[n])},!0)};t.exports.getPassword=function(e,t,r){var n,s=t.pipe(i());function o(t){var r=g(t);r&&m(r)&&p(e,r)&&(n=r[h],s.end())}v(o,"onLine");var a=v(function(){t.destroy(),r(n)},"onEnd"),u=v(function(e){t.destroy(),d("WARNING: error on reading file: %s",e),r(void 0)},"onErr");t.on("error",u),s.on("data",o).on("end",a).on("error",u)};var g=t.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t="",r="",n=0,i=0,s={},o=v(function(t,r,n){var i=e.substring(r,n);Object.hasOwnProperty.call(f.env,"PGPASS_NO_DEESCAPE")||(i=i.replace(/\\([:\\])/g,"$1")),s[c[t]]=i},"addToObj"),a=0;a<e.length-1;a+=1){if(t=e.charAt(a+1),r=e.charAt(a),n==l-1){o(n,i);break}a>=0&&":"==t&&"\\"!==r&&(o(n,i,a+1),i=a+2,n+=1)}return s=Object.keys(s).length===l?s:null},m=t.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return"*"===e||isFinite(e=Number(e))&&e>0&&e<0x20000000000000&&Math.floor(e)===e},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},r=0;r<c.length;r+=1)if(!(0,t[r])(e[c[r]]||""))return!1;return!0}}),eI=w((e,t)=>{C(),eb(),x(em);var r=(ew(),x(ev)),n=eC();t.exports=function(e,t){var i=n.getFileName();r.stat(i,function(s,o){if(s||!n.usePgPass(o,i))return t(void 0);var a=r.createReadStream(i);n.getPassword(e,a,t)})},t.exports.warnTo=n.warnTo}),eN={};E(eN,{default:()=>eL});var eL,eM=_(()=>{C(),eL={}}),eD=w((e,t)=>{C();var r=(q(),x(U)),n=(ew(),x(ev));function i(e){if("/"===e.charAt(0)){var t=e.split(" ");return{host:t[0],database:t[1]}}var i=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)?encodeURI(e).replace(/\%25(\d\d)/g,"%$1"):e,!0),t=i.query;for(var s in t)Array.isArray(t[s])&&(t[s]=t[s][t[s].length-1]);var o=(i.auth||":").split(":");if(t.user=o[0],t.password=o.splice(1).join(":"),t.port=i.port,"socket:"==i.protocol)return t.host=decodeURI(i.pathname),t.database=i.query.db,t.client_encoding=i.query.encoding,t;t.host||(t.host=i.hostname);var a=i.pathname;if(!t.host&&a&&/^%2f/i.test(a)){var u=a.split("/");t.host=decodeURIComponent(u[0]),a=u.splice(1).join("/")}switch(a&&"/"===a.charAt(0)&&(a=a.slice(1)||null),t.database=a&&decodeURI(a),("true"===t.ssl||"1"===t.ssl)&&(t.ssl=!0),"0"===t.ssl&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl.cert=n.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=n.readFileSync(t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=n.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":t.ssl=!1;break;case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":t.ssl.rejectUnauthorized=!1}return t}v(i,"parse"),t.exports=i,i.parse=i}),ek=w((e,t)=>{C();var r=(eM(),x(eN)),n=el(),i=eD().parse,s=v(function(e,t,r){return void 0===r?r=f.env["PG"+e.toUpperCase()]:!1===r||(r=f.env[r]),t[e]||r||n[e]},"val"),o=v(function(){switch(f.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return n.ssl},"readSSLConfigFromEnvironment"),a=v(function(e){return"'"+(""+e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),u=v(function(e,t,r){var n=t[r];null!=n&&e.push(r+"="+a(n))},"add"),c=class{constructor(e){(e="string"==typeof e?i(e):e||{}).connectionString&&(e=Object.assign({},e,i(e.connectionString))),this.user=s("user",e),this.database=s("database",e),void 0===this.database&&(this.database=this.user),this.port=parseInt(s("port",e),10),this.host=s("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",e)}),this.binary=s("binary",e),this.options=s("options",e),this.ssl=typeof e.ssl>"u"?o():e.ssl,"string"==typeof this.ssl&&"true"===this.ssl&&(this.ssl=!0),"no-verify"===this.ssl&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",e),this.replication=s("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",e,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",e,!1),this.statement_timeout=s("statement_timeout",e,!1),this.lock_timeout=s("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",e,!1),this.query_timeout=s("query_timeout",e,!1),void 0===e.connectionTimeoutMillis?this.connect_timeout=f.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),!1===e.keepAlive?this.keepalives=0:!0===e.keepAlive&&(this.keepalives=1),"number"==typeof e.keepAliveInitialDelayMillis&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];u(t,this,"user"),u(t,this,"password"),u(t,this,"port"),u(t,this,"application_name"),u(t,this,"fallback_application_name"),u(t,this,"connect_timeout"),u(t,this,"options");var n="object"==typeof this.ssl?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(u(t,n,"sslmode"),u(t,n,"sslca"),u(t,n,"sslkey"),u(t,n,"sslcert"),u(t,n,"sslrootcert"),this.database&&t.push("dbname="+a(this.database)),this.replication&&t.push("replication="+a(this.replication)),this.host&&t.push("host="+a(this.host)),this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+a(this.client_encoding)),r.lookup(this.host,function(r,n){return r?e(r,null):(t.push("hostaddr="+a(n)),e(null,t.join(" ")))})}};v(c,"ConnectionParameters"),t.exports=c}),eB=w((e,t)=>{C();var r=J(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray="array"===e,this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){var t;(t=e.text?n.exec(e.text):n.exec(e.command))&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=Array(e.length),r=0,n=e.length;r<n;r++){var i=e[r];null!==i?t[r]=this._parsers[r](i):t[r]=null}return t}parseRow(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r],s=this.fields[r].name;null!==i?t[s]=this._parsers[r](i):t[s]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var n=e[t];this._types?this._parsers[t]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=r.getTypeParser(n.dataTypeID,n.format||"text")}}};v(i,"Result"),t.exports=i}),ej=w((e,t)=>{C();var{EventEmitter:r}=I(),n=eB(),i=eh(),s=class extends r{constructor(e,t,r){super(),e=i.normalizeQueryConfig(e,t,r),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,f.domain&&e.callback&&(this.callback=f.domain.bind(e.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return!!this.name||!!this.rows||!!this.text&&!!this.values&&this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){f.nextTick(()=>{throw e})}this.emit("end",this._results)}submit(e){if("string"!=typeof this.text&&"string"!=typeof this.name)return Error("A query must have either text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this.name];return this.text&&t&&this.text!==t?Error(`Prepared statements must be unique - '${this.name}\
31
- ' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:i.prepareValue})}catch(t){this.handleError(t,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};v(s,"Query"),t.exports=s}),eU=w(e=>{C(),Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(e,t,r){super(e),this.length=t,this.name=r}};v(t,"DatabaseError"),e.DatabaseError=t;var r=class{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}};v(r,"CopyDataMessage"),e.CopyDataMessage=r;var n=class{constructor(e,t,r,n){this.length=e,this.name=t,this.binary=r,this.columnTypes=Array(n)}};v(n,"CopyResponse"),e.CopyResponse=n;var i=class{constructor(e,t,r,n,i,s,o){this.name=e,this.tableID=t,this.columnID=r,this.dataTypeID=n,this.dataTypeSize=i,this.dataTypeModifier=s,this.format=o}};v(i,"Field"),e.Field=i;var s=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=Array(this.fieldCount)}};v(s,"RowDescriptionMessage"),e.RowDescriptionMessage=s;var o=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}};v(o,"ParameterDescriptionMessage"),e.ParameterDescriptionMessage=o;var a=class{constructor(e,t,r){this.length=e,this.parameterName=t,this.parameterValue=r,this.name="parameterStatus"}};v(a,"ParameterStatusMessage"),e.ParameterStatusMessage=a;var u=class{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}};v(u,"AuthenticationMD5Password"),e.AuthenticationMD5Password=u;var c=class{constructor(e,t,r){this.length=e,this.processID=t,this.secretKey=r,this.name="backendKeyData"}};v(c,"BackendKeyDataMessage"),e.BackendKeyDataMessage=c;var l=class{constructor(e,t,r,n){this.length=e,this.processId=t,this.channel=r,this.payload=n,this.name="notification"}};v(l,"NotificationResponseMessage"),e.NotificationResponseMessage=l;var h=class{constructor(e,t){this.length=e,this.status=t,this.name="readyForQuery"}};v(h,"ReadyForQueryMessage"),e.ReadyForQueryMessage=h;var f=class{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};v(f,"CommandCompleteMessage"),e.CommandCompleteMessage=f;var d=class{constructor(e,t){this.length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};v(d,"DataRowMessage"),e.DataRowMessage=d;var p=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};v(p,"NoticeMessage"),e.NoticeMessage=p}),eF=w(e=>{C(),Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=h.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,r=t.length+(t.length>>1)+e;this.buffer=h.allocUnsafe(r),t.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(e){let t=h.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=t}else this.ensure(1);return this.buffer[this.offset++]=0,this}addString(e=""){let t=h.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)}return this.buffer.slice(5*!e,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=h.allocUnsafe(this.size),t}};v(t,"Writer"),e.Writer=t}),eq=w(e=>{C(),Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=eF(),r=new t.Writer,n=v(e=>{for(let t of(r.addInt16(3).addInt16(0),Object.keys(e)))r.addCString(t).addCString(e[t]);r.addCString("client_encoding").addCString("UTF8");let n=r.addCString("").flush(),i=n.length+4;return new t.Writer().addInt32(i).add(n).flush()},"startup"),i=v(()=>{let e=h.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(0x4d2162f,4),e},"requestSsl"),s=v(e=>r.addCString(e).flush(112),"password"),o=v(function(e,t){return r.addCString(e).addInt32(h.byteLength(t)).addString(t),r.flush(112)},"sendSASLInitialResponseMessage"),a=v(function(e){return r.addString(e).flush(112)},"sendSCRAMClientFinalMessage"),u=v(e=>r.addCString(e).flush(81),"query"),c=[],l=v(e=>{let t=e.name||"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let n=e.types||c,i=n.length,s=r.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)s.addInt32(n[e]);return r.flush(80)},"parse"),f=new t.Writer,d=v(function(e,t){for(let n=0;n<e.length;n++){let i=t?t(e[n],n):e[n];null==i?(r.addInt16(0),f.addInt32(-1)):i instanceof h?(r.addInt16(1),f.addInt32(i.length),f.add(i)):(r.addInt16(0),f.addInt32(h.byteLength(i)),f.addString(i))}},"writeValues"),p=v((e={})=>{let t=e.portal||"",n=e.statement||"",i=e.binary||!1,s=e.values||c,o=s.length;return r.addCString(t).addCString(n),r.addInt16(o),d(s,e.valueMapper),r.addInt16(o),r.add(f.flush()),r.addInt16(+!!i),r.flush(66)},"bind"),g=h.from([69,0,0,0,9,0,0,0,0,0]),m=v(e=>{if(!e||!e.portal&&!e.rows)return g;let t=e.portal||"",r=e.rows||0,n=h.byteLength(t),i=4+n+1+4,s=h.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(t,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},"execute"),y=v((e,t)=>{let r=h.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(e,8),r.writeInt32BE(t,12),r},"cancel"),b=v((e,t)=>{let r=4+h.byteLength(t)+1,n=h.allocUnsafe(1+r);return n[0]=e,n.writeInt32BE(r,1),n.write(t,5,"utf-8"),n[r]=0,n},"cstringMessage"),_=r.addCString("P").flush(68),w=r.addCString("S").flush(68),E=v(e=>e.name?b(68,`${e.type}${e.name||""}`):"P"===e.type?_:w,"describe"),S=v(e=>b(67,`${e.type}${e.name||""}`),"close"),R=v(e=>r.add(e).flush(100),"copyData"),x=v(e=>b(102,e),"copyFail"),A=v(e=>h.from([e,0,0,0,4]),"codeOnlyBuffer"),T=A(72),P=A(83),O=A(88),I=A(99);e.serialize={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:a,query:u,parse:l,bind:p,execute:m,describe:E,close:S,flush:v(()=>T,"flush"),sync:v(()=>P,"sync"),end:v(()=>O,"end"),copyData:R,copyDone:v(()=>I,"copyDone"),copyFail:x,cancel:y}}),e$=w(e=>{C(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=h.allocUnsafe(0),r=class{constructor(e=0){this.offset=e,this.buffer=t,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){let e=this.offset,t=e;for(;0!==this.buffer[t++];);return this.offset=t,this.buffer.toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}};v(r,"BufferReader"),e.BufferReader=r}),eG=w(e=>{C(),Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=eU(),r=e$(),n=h.allocUnsafe(0),i=class{constructor(e){if(this.buffer=n,this.bufferLength=0,this.bufferOffset=0,this.reader=new r.BufferReader,e?.mode==="binary")throw Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let r=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=r;){let e=this.buffer[i],n=this.buffer.readUInt32BE(i+1),s=1+n;if(s+i<=r)t(this.handlePacket(i+5,e,n,this.buffer)),i+=s;else break}i===r?(this.buffer=n,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=r-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let r=2*this.buffer.byteLength;for(;t>=r;)r*=2;e=h.allocUnsafe(r)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,r,n,i){switch(r){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e,n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this.parseParameterStatusMessage(e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData(e,n,i);default:return new t.DatabaseError("received invalid response: "+r.toString(16),n,"error")}}parseReadyForQueryMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.string(1);return new t.ReadyForQueryMessage(r,i)}parseCommandCompleteMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring();return new t.CommandCompleteMessage(r,i)}parseCopyData(e,r,n){let i=n.slice(e,e+(r-4));return new t.CopyDataMessage(r,i)}parseCopyInMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyInResponse")}parseCopyOutMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyOutResponse")}parseCopyMessage(e,r,n,i){this.reader.setBuffer(e,n);let s=0!==this.reader.byte(),o=this.reader.int16(),a=new t.CopyResponse(r,i,s,o);for(let e=0;e<o;e++)a.columnTypes[e]=this.reader.int16();return a}parseNotificationMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(r,i,s,o)}parseRowDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.RowDescriptionMessage(r,i);for(let e=0;e<i;e++)s.fields[e]=this.parseField();return s}parseField(){let e=this.reader.cstring(),r=this.reader.uint32(),n=this.reader.int16(),i=this.reader.uint32(),s=this.reader.int16(),o=this.reader.int32(),a=0===this.reader.int16()?"text":"binary";return new t.Field(e,r,n,i,s,o,a)}parseParameterDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.ParameterDescriptionMessage(r,i);for(let e=0;e<i;e++)s.dataTypeIDs[e]=this.reader.int32();return s}parseDataRowMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();s[e]=-1===t?null:this.reader.string(t)}return new t.DataRowMessage(r,s)}parseParameterStatusMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring(),s=this.reader.cstring();return new t.ParameterStatusMessage(r,i,s)}parseBackendKeyData(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.int32();return new t.BackendKeyDataMessage(r,i,s)}parseAuthenticationResponse(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s={name:"authenticationOk",length:r};switch(i){case 0:break;case 3:8===s.length&&(s.name="authenticationCleartextPassword");break;case 5:if(12===s.length){s.name="authenticationMD5Password";let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(r,e)}break;case 10:{let e;s.name="authenticationSASL",s.mechanisms=[];do(e=this.reader.cstring())&&s.mechanisms.push(e);while(e)}break;case 11:s.name="authenticationSASLContinue",s.data=this.reader.string(r-8);break;case 12:s.name="authenticationSASLFinal",s.data=this.reader.string(r-8);break;default:throw Error("Unknown authenticationOk message type "+i)}return s}parseErrorMessage(e,r,n,i){this.reader.setBuffer(e,n);let s={},o=this.reader.string(1);for(;"\0"!==o;)s[o]=this.reader.cstring(),o=this.reader.string(1);let a=s.M,u="notice"===i?new t.NoticeMessage(r,a):new t.DatabaseError(a,r,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u.position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s,u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u.routine=s.R,u}};v(i,"Parser"),e.Parser=i}),eH=w(e=>{C(),Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=eU();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:v(function(){return t.DatabaseError},"get")});var r=eq();Object.defineProperty(e,"serialize",{enumerable:!0,get:v(function(){return r.serialize},"get")});var n=eG();function i(e,t){let r=new n.Parser;return e.on("data",e=>r.parse(e,t)),new Promise(t=>e.on("end",()=>t()))}v(i,"parse"),e.parse=i}),eV={};function eW({socket:e,servername:t}){return e.startTls(t),e}E(eV,{connect:()=>eW});var eQ=_(()=>{C(),v(eW,"connect")}),eY=w((e,t)=>{C();var r=(j(),x(N)),n=I().EventEmitter,{parse:i,serialize:s}=eH(),o=s.flush(),a=s.sync(),u=s.end(),c=class extends n{constructor(e){super(),e=e||{},this.stream=e.stream||new r.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;var t=this;this.on("newListener",function(e){"message"===e&&(t._emitMessage=!0)})}connect(e,t){var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=v(function(e){n._ending&&("ECONNRESET"===e.code||"EPIPE"===e.code)||n.emit("error",e)},"reportStreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(e){switch(e.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",Error("There was an error establishing an SSL connection"))}var s=(eQ(),x(eV));let o={socket:n.stream};!0!==n.ssl&&(Object.assign(o,n.ssl),"key"in n.ssl&&(o.key=n.ssl.key)),0===r.isIP(t)&&(o.servername=t);try{n.stream=s.connect(o)}catch(e){return n.emit("error",e)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{this.emit("end")}),i(e,e=>{var t="error"===e.name?"errorMessage":e.name;this._emitMessage&&this.emit("message",e),this.emit(t,e)})}requestSsl(){this.stream.write(s.requestSsl())}startup(e){this.stream.write(s.startup(e))}cancel(e,t){this._send(s.cancel(e,t))}password(e){this._send(s.password(e))}sendSASLInitialResponseMessage(e,t){this._send(s.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(s.sendSCRAMClientFinalMessage(e))}_send(e){return!!this.stream.writable&&this.stream.write(e)}query(e){this._send(s.query(e))}parse(e){this._send(s.parse(e))}bind(e){this._send(s.bind(e))}execute(e){this._send(s.execute(e))}flush(){this.stream.writable&&this.stream.write(o)}sync(){this._ending=!0,this._send(o),this._send(a)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){return(this._ending=!0,this._connecting&&this.stream.writable)?this.stream.write(u,()=>{this.stream.end()}):void this.stream.end()}close(e){this._send(s.close(e))}describe(e){this._send(s.describe(e))}sendCopyFromChunk(e){this._send(s.copyData(e))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(e){this._send(s.copyFail(e))}};v(c,"Connection"),t.exports=c}),eX=w((e,t)=>{C();var r=I().EventEmitter,n=(ep(),x(ef),eh()),i=eg(),s=eI(),o=Z(),a=ek(),u=ej(),l=el(),h=eY(),d=class extends r{constructor(e){super(),this.connectionParameters=new a(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||c.Promise,this._types=new o(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection=t.connection||new h({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||l.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=v(t=>{f.nextTick(()=>{t.handleError(e,this.connection)})},"enqueueError");this.activeQuery&&(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){var t=this,r=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error("Client has already been connected. You cannot reuse a client.");f.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{r._ending=!0,r.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){t.ssl?r.requestSsl():r.startup(t.getStartupConf())}),r.on("sslconnect",function(){r.startup(t.getStartupConf())}),this._attachListeners(r),r.once("end",()=>{let e=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),f.nextTick(()=>{this.emit("end")})})}connect(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;"function"==typeof this.password?this._Promise.resolve().then(()=>this.password()).then(r=>{if(void 0!==r){if("string"!=typeof r)return void t.emit("error",TypeError("Password must be a string"));this.connectionParameters.password=this.password=r}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit("error",e)}):null!==this.password?e():s(this.connectionParameters,t=>{void 0!==t&&(this.connectionParameters.password=this.password=t),e()})}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(()=>{let t=n.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{this.saslSession=i.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){i.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}_handleAuthSASLFinal(e){i.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t)return void this._handleErrorEvent(e);this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},r=e.application_name||e.fallback_application_name;return r&&(t.application_name=r),e.replication&&(t.replication=""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var r=this.connection;this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){r.cancel(e.processID,e.secretKey)})}else -1!==e.queryQueue.indexOf(t)&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,r){return this._types.setTypeParser(e,t,r)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,r="'",n=0;n<e.length;n++){var i=e[n];"'"===i?r+=i+i:"\\"===i?(r+=i+i,t=!0):r+=i}return r+="'",!0===t&&(r=" E"+r),r}_pulseQueryQueue(){if(!0===this.readyForQuery)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&f.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");return"function"==typeof e.submit?(s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(n.callback=n.callback||t)):(s=this.connectionParameters.query_timeout,(n=new u(e,t,r)).callback||(i=new this._Promise((e,t)=>{n.callback=(r,n)=>r?t(r):e(n)}))),s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");f.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this.queryQueue.indexOf(n);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?f.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"),this.connection)}):(this.queryQueue.push(n),this._pulseQueryQueue()):f.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),i}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(!e)return this._Promise.resolve();else e();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),!e)return new this._Promise(e=>{this.connection.once("end",e)});this.connection.once("end",e)}};v(d,"Client"),d.Query=u,t.exports=d}),ez=w((e,t)=>{C();var r=I().EventEmitter,n=v(function(){},"NOOP"),i=v((e,t)=>{let r=e.findIndex(t);return -1===r?void 0:e.splice(r,1)[0]},"removeWhere"),s=class{constructor(e,t,r){this.client=e,this.idleListener=t,this.timeoutId=r}};v(s,"IdleItem");var o=class{constructor(e){this.callback=e}};function a(){throw Error("Release called on client which has already been released to the pool.")}function u(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:v(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function h(e,t){return v(function r(n){n.client=t,t.removeListener("error",r),t.on("error",()=>{e.log("additional client error after disconnection due to error",n)}),e._remove(t),e.emit("error",n,t)},"idleListener")}v(o,"PendingItem"),v(a,"throwOnDoubleRelease"),v(u,"promisify"),v(h,"makeIdleListener");var d=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),null!=e&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),null!=e&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||t||e3().Client,this.Promise=this.options.Promise||c.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended)return void this.log("pulse queue ended");if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length)return void this.log("no queued requests");if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout(t.timeoutId);let r=t.client;r.ref&&r.ref();let n=t.idleListener;return this._acquireClient(r,e,n,!1)}if(!this._isFull())return this.newClient(e);throw Error("unexpected condition")}_remove(e){let t=i(this._idle,t=>t.client===e);void 0!==t&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(t=>t!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let t=Error("Cannot use a pool after calling end on the pool");return e?e(t):this.Promise.reject(t)}let t=u(this.Promise,e),r=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&f.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new o(t.callback)),r;let e=v((e,r,n)=>{clearTimeout(s),t.callback(e,r,n)},"queueCallback"),n=new o(e),s=setTimeout(()=>{i(this._pendingQueue,t=>t.callback===e),n.timedOut=!0,t.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(n),r}return this.newClient(new o(t.callback)),r}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let r=h(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy():t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect(a=>{if(i&&clearTimeout(i),t.on("error",r),a)this.log("client failed to connect",a),this._clients=this._clients.filter(e=>e!==t),s&&(a=Error("Connection terminated due to connection timeout",{cause:a})),this._pulseQueue(),e.timedOut||e.callback(a,void 0,n);else{if(this.log("new client connected"),0!==this.options.maxLifetimeSeconds){let e=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(t),-1!==this._idle.findIndex(e=>e.client===t)&&this._acquireClient(t,new o((e,t,r)=>r()),r,!1)},1e3*this.options.maxLifetimeSeconds);e.unref(),t.once("end",()=>clearTimeout(e))}return this._acquireClient(t,e,r,!0)}})}_acquireClient(e,t,r,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,r),e.removeListener("error",r),t.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,r=>{if(r)return e.release(r),t.callback(r,void 0,n);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let r=!1;return n=>{r&&a(),r=!0,this._release(e,t,n)}}_release(e,t,r){let n;if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",r,e),r||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e)){this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue();return}this.options.idleTimeoutMillis&&this._isAboveMin()&&(n=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&n.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new s(e,t,n)),this._pulseQueue()}query(e,t,r){if("function"==typeof e){let t=u(this.Promise,e);return l(function(){return t.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),t.result}"function"==typeof t&&(r=t,t=void 0);let n=u(this.Promise,r);return r=n.callback,this.connect((n,i)=>{if(n)return r(n);let s=!1,o=v(e=>{s||(s=!0,i.release(e),r(e))},"onError");i.once("error",o),this.log("dispatching query");try{i.query(e,t,(e,t)=>{if(this.log("query dispatched"),i.removeListener("error",o),!s)return s=!0,i.release(e),e?r(e):r(void 0,t)})}catch(e){return i.release(e),r(e)}}),n.result}end(e){if(this.log("ending"),this.ending){let t=Error("Called end on pool more than once");return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=u(this.Promise,e);return this._endCallback=t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+ +!!this._expired.has(t),0)}get totalCount(){return this._clients.length}};v(d,"Pool"),t.exports=d}),eK={};E(eK,{default:()=>eJ});var eJ,eZ=_(()=>{C(),eJ={}}),e0=w((e,t)=>{t.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javascript & libpq with the same API",keywords:["database","libpq","pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/brianc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-postgres.git",directory:"packages/pg"},author:"Brian Carlson <brian.m.carlson@gmail.com>",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0","pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-types":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491a178655"}}),e1=w((e,t)=>{C();var r=I().EventEmitter,n=(ep(),x(ef)),i=eh(),s=t.exports=function(e,t,n){r.call(this),e=i.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state="new",this._arrayMode="array"===e.rowMode,this._emitRowEvents=!1,this.on("newListener",(function(e){"row"===e&&(this._emitRowEvents=!0)}).bind(this))};n.inherits(s,r);var o={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var r in t)e[o[r]||r]=t[r];this.callback?this.callback(e):this.emit("error",e),this.state="error"},s.prototype.then=function(e,t){return this._getPromise().then(e,t)},s.prototype.catch=function(e){return this._getPromise().catch(e)},s.prototype._getPromise=function(){return this._promise||(this._promise=new Promise((function(e,t){this._once("end",e),this._once("error",t)}).bind(this))),this._promise},s.prototype.submit=function(e){this.state="running";var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var r=v(function(r,n,i){if(e.native.arrayMode=!1,l(function(){t.emit("_done")}),r)return t.handleError(r);t._emitRowEvents&&(i.length>1?n.forEach((e,r)=>{e.forEach(e=>{t.emit("row",e,i[r])})}):n.forEach(function(e){t.emit("row",e,i)})),t.state="end",t.emit("end",i),t.callback&&t.callback(null,i)},"after");if(f.domain&&(r=f.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var n=(this.values||[]).map(i.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepa\
32
- red statements must be unique - '${this.name}' was used for a different statement`);return r(e)}return e.native.execute(this.name,n,r)}return e.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,n,r))})}if(this.values){if(!Array.isArray(this.values)){let e=Error("Query values must be an array");return r(e)}var s=this.values.map(i.prepareValue);e.native.query(this.text,s,r)}else e.native.query(this.text,r)}}),e2=w((e,t)=>{C();var r=(eZ(),x(eK)),n=Z(),i=(e0(),I().EventEmitter),s=(ep(),x(ef)),o=ek(),a=e1(),u=t.exports=function(e){i.call(this),e=e||{},this._Promise=e.Promise||c.Promise,this._types=new n(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new o(e);this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};u.Query=a,s.inherits(u,i),u.prototype._errorAllQueries=function(e){let t=v(t=>{f.nextTick(()=>{t.native=this.native,t.handleError(e)})},"enqueueError");this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},u.prototype._connect=function(e){var t=this;if(this._connecting)return void f.nextTick(()=>e(Error("Client has already been connected. You cannot reuse a client.")));this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(r)return e(r);t.native.connect(n,function(r){if(r)return t.native.end(),e(r);t._connected=!0,t.native.on("error",function(e){t._queryable=!1,t._errorAllQueries(e),t.emit("error",e)}),t.native.on("notification",function(e){t.emit("notification",{channel:e.relname,payload:e.extra})}),t.emit("connect"),t._pulseQueryQueue(!0),e()})})},u.prototype.connect=function(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})},u.prototype.query=function(e,t,r){var n,i,s,o,u;if(null==e)throw TypeError("Client was passed a null or undefined query");if("function"==typeof e.submit)s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(e.callback=t);else if(s=this.connectionParameters.query_timeout,!(n=new a(e,t,r)).callback){let e,t;i=new this._Promise((r,n)=>{e=r,t=n}),n.callback=(r,n)=>r?t(r):e(n)}return s&&(u=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");f.nextTick(()=>{n.handleError(e,this.connection)}),u(e),n.callback=()=>{};var t=this._queryQueue.indexOf(n);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),u(e,t)}),this._queryable?this._ending?(n.native=this.native,f.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"))})):(this._queryQueue.push(n),this._pulseQueryQueue()):(n.native=this.native,f.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"))})),i},u.prototype.end=function(e){var t,r=this;return this._ending=!0,this._connected||this.once("connect",this.end.bind(this,e)),e||(t=new this._Promise(function(t,r){e=v(e=>e?r(e):t(),"cb")})),this.native.end(function(){r._errorAllQueries(Error("Connection terminated")),f.nextTick(()=>{r.emit("end"),e&&e()})}),t},u.prototype._hasActiveQuery=function(){return this._activeQuery&&"error"!==this._activeQuery.state&&"end"!==this._activeQuery.state},u.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit("drain");return}this._activeQuery=t,t.submit(this);var r=this;t.once("_done",function(){r._pulseQueryQueue()})}},u.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):-1!==this._queryQueue.indexOf(e)&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},u.prototype.ref=function(){},u.prototype.unref=function(){},u.prototype.setTypeParser=function(e,t,r){return this._types.setTypeParser(e,t,r)},u.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}}),e6=w((e,t)=>{C(),t.exports=e2()}),e3=w((e,t)=>{C();var r=eX(),n=el(),i=eY(),s=ez(),{DatabaseError:o}=eH(),a=v(e=>{var t;return v(t=class extends s{constructor(t){super(t,e)}},"BoundPool"),t},"poolFactory"),u=v(function(e){this.defaults=n,this.Client=e,this.Query=this.Client.Query,this.Pool=a(this.Client),this._pools=[],this.Connection=i,this.types=J(),this.DatabaseError=o},"PG");"u">typeof f.env.NODE_PG_FORCE_NATIVE?t.exports=new u(e6()):(t.exports=new u(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(e6())}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}}))});C(),C(),j(),q(),C();var e5=Object.defineProperty,e4=Object.defineProperties,e8=Object.getOwnPropertyDescriptors,e9=Object.getOwnPropertySymbols,e7=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,tt=v((e,t,r)=>t in e?e5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),tr=v((e,t)=>{for(var r in t||(t={}))e7.call(t,r)&&tt(e,r,t[r]);if(e9)for(var r of e9(t))te.call(t,r)&&tt(e,r,t[r]);return e},"__spreadValues"),tn=v((e,t)=>e4(e,e8(t)),"__spreadProps"),ti=2===new Uint8Array(new Uint16Array([258]).buffer)[0],ts=new TextDecoder,to=new TextEncoder,ta=to.encode("0123456789abcdef"),tu=to.encode("0123456789ABCDEF"),tc=to.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").slice();function tl(e,{alphabet:t,scratchArr:r}={}){if(!n)if(n=new Uint16Array(256),i=new Uint16Array(256),ti)for(let e=0;e<256;e++)n[e]=ta[15&e]<<8|ta[e>>>4],i[e]=tu[15&e]<<8|tu[e>>>4];else for(let e=0;e<256;e++)n[e]=ta[15&e]|ta[e>>>4]<<8,i[e]=tu[15&e]|tu[e>>>4]<<8;e.byteOffset%4!=0&&(e=new Uint8Array(e));let s=e.length,o=s>>>2,a=r||new Uint16Array(s),u=new Uint32Array(e.buffer,e.byteOffset,o),c=new Uint32Array(a.buffer,a.byteOffset,s>>>1),l="upper"===t?i:n,h=0,f=0,d;if(ti)for(;h<o;)d=u[h++],c[f++]=l[d>>>8&255]<<16|l[255&d],c[f++]=l[d>>>24]<<16|l[d>>>16&255];else for(;h<o;)d=u[h++],c[f++]=l[d>>>24]<<16|l[d>>>16&255],c[f++]=l[d>>>8&255]<<16|l[255&d];for(h<<=2;h<s;)a[h]=l[e[h++]];return ts.decode(a.subarray(0,s))}function th(e,t={}){let r="",n=e.length,i=Math.ceil(n/504e3),s=new Uint16Array(i>1?504e3:n);for(let n=0;n<i;n++){let i=504e3*n,o=i+504e3;r+=tl(e.subarray(i,o),tn(tr({},t),{scratchArr:s}))}return r}function tf(e,t={}){return"upper"!==t.alphabet&&"function"==typeof e.toHex?e.toHex():th(e,t)}tc[62]=45,tc[63]=95,v(tl,"_toHex"),v(th,"_toHexChunked"),v(tf,"toHex"),C();var td=class e{constructor(e,t){this.strings=e,this.values=t}toParameterizedQuery(t={query:"",params:[]}){let{strings:r,values:n}=this;for(let i=0,s=r.length;i<s;i++)if(t.query+=r[i],i<n.length){let r=n[i];if(r instanceof tg)t.query+=r.sql;else if(r instanceof tA)if(r.queryData instanceof e)r.queryData.toParameterizedQuery(t);else{if(r.queryData.params?.length)throw Error("This query is not composable");t.query+=r.queryData.query}else{let{params:e}=t;e.push(r),t.query+="$"+e.length,(r instanceof h||ArrayBuffer.isView(r))&&(t.query+="::bytea")}}return t}};v(td,"SqlTemplate");var tp=class{constructor(e){this.sql=e}};v(tp,"UnsafeRawSql");var tg=tp;function tm(){}C(),v(tm,"warnIfBrowser"),j();var ty=R(Z()),tb=R(eh()),tv=class e extends Error{constructor(t){super(t),A(this,"name","NeonDbError"),A(this,"severity"),A(this,"code"),A(this,"detail"),A(this,"hint"),A(this,"position"),A(this,"internalPosition"),A(this,"internalQuery"),A(this,"where"),A(this,"schema"),A(this,"table"),A(this,"column"),A(this,"dataType"),A(this,"constraint"),A(this,"file"),A(this,"line"),A(this,"routine"),A(this,"sourceError"),"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}};v(tv,"NeonDbError");var t_="transaction() expects an array of queries, or a function returning an array of queries",tw=["severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine"];function tE(e){return e instanceof h?"\\x"+tf(e):e}function tS(e){let{query:t,params:r}=e instanceof td?e.toParameterizedQuery():e;return{query:t,params:r.map(e=>tE((0,tb.prepareValue)(e)))}}function tR(e,{arrayMode:t,fullResults:r,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,authToken:a,disableWarningInBrowsers:u}={}){let c;if(!e)throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?");try{c=F(e)}catch{throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(e))}let{protocol:l,username:h,hostname:f,port:d,pathname:p}=c;if("postgres:"!==l&&"postgresql:"!==l||!h||!f||!p)throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function g(e,...t){if(!(Array.isArray(e)&&Array.isArray(e.raw)&&Array.isArray(t)))throw Error('This function can now be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).');return new tA(m,new td(e,t))}async function m(c,l,h){let p,{fetchEndpoint:g,fetchFunction:m}=B,y=Array.isArray(c)?{queries:c.map(e=>tS(e))}:tS(c),b=n??{},v=t??!1,_=r??!1,w=i,E=s,S=o;void 0!==h&&(void 0!==h.fetchOptions&&(b={...b,...h.fetchOptions}),void 0!==h.arrayMode&&(v=h.arrayMode),void 0!==h.fullResults&&(_=h.fullResults),void 0!==h.isolationLevel&&(w=h.isolationLevel),void 0!==h.readOnly&&(E=h.readOnly),void 0!==h.deferrable&&(S=h.deferrable)),void 0===l||Array.isArray(l)||void 0===l.fetchOptions||(b={...b,...l.fetchOptions});let R=a;Array.isArray(l)||l?.authToken===void 0||(R=l.authToken);let x="function"==typeof g?g(f,d,{jwtAuth:void 0!==R}):g,A={"Neon-Connection-String":e,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true"},T=await tP(R);T&&(A.Authorization=`Bearer ${T}`),Array.isArray(c)&&(void 0!==w&&(A["Neon-Batch-Isolation-Level"]=w),void 0!==E&&(A["Neon-Batch-Read-Only"]=String(E)),void 0!==S&&(A["Neon-Batch-Deferrable"]=String(S))),u||B.disableWarningInBrowsers||tm();try{p=await (m??fetch)(x,{method:"POST",body:JSON.stringify(y),headers:A,...b})}catch(t){let e=new tv(`Error connecting to database: ${t}`);throw e.sourceError=t,e}if(p.ok){let e=await p.json();if(Array.isArray(c)){let t=e.results;if(!Array.isArray(t))throw new tv("Neon internal error: unexpected result format");return t.map((e,t)=>{let r=l[t]??{};return tT(e,{arrayMode:r.arrayMode??v,fullResults:r.fullResults??_,types:r.types})})}{let t=l??{};return tT(e,{arrayMode:t.arrayMode??v,fullResults:t.fullResults??_,types:t.types})}}{let{status:e}=p;if(400===e){let e=await p.json(),t=new tv(e.message);for(let r of tw)t[r]=e[r]??void 0;throw t}{let t=await p.text();throw new tv(`Server error (HTTP status ${e}): ${t}`)}}}return v(g,"templateFn"),g.query=(e,t,r)=>new tA(m,{query:e,params:t??[]},r),g.unsafe=e=>new tg(e),g.transaction=async(e,t)=>{if("function"==typeof e&&(e=e(g)),!Array.isArray(e))throw Error(t_);return e.forEach(e=>{if(!(e instanceof tA))throw Error(t_)}),m(e.map(e=>e.queryData),e.map(e=>e.opts??{}),t)},v(m,"execute"),g}v(tE,"encodeBuffersAsBytea"),v(tS,"prepareQuery"),v(tR,"neon");var tx=class{constructor(e,t,r){this.execute=e,this.queryData=t,this.opts=r}then(e,t){return this.execute(this.queryData,this.opts).then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch(e)}finally(e){return this.execute(this.queryData,this.opts).finally(e)}};v(tx,"NeonQueryPromise");var tA=tx;function tT(e,{arrayMode:t,fullResults:r,types:n}){let i=new ty.default(n),s=e.fields.map(e=>e.name),o=e.fields.map(e=>i.getTypeParser(e.dataTypeID)),a=!0===t?e.rows.map(e=>e.map((e,t)=>null===e?null:o[t](e))):e.rows.map(e=>Object.fromEntries(e.map((e,t)=>[s[t],null===e?null:o[t](e)])));return r?(e.viaNeonFetch=!0,e.rowAsArray=t,e.rows=a,e._parsers=o,e._types=i,e):a}async function tP(e){if("string"==typeof e)return e;if("function"==typeof e)try{return await Promise.resolve(e())}catch(t){let e=new tv("Error getting auth token.");throw t instanceof Error&&(e=new tv(`Error getting auth token: ${t.message}`)),e}}v(tT,"processQueryResult"),v(tP,"getAuthToken"),C();var tO=R(e3());C();var tC=R(e3()),tI=class extends tC.Client{constructor(e){super(e),this.config=e}get neonConfig(){return this.connection.stream}connect(e){let{neonConfig:t}=this;t.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&t.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let r="string"!=typeof this.config&&this.config?.host!==void 0||"string"!=typeof this.config&&this.config?.connectionString!==void 0||void 0!==f.env.PGHOST,n=f.env.USER??f.env.USERNAME;if(!r&&"localhost"===this.host&&this.user===n&&this.database===n&&null===this.password)throw Error(`No database host or connection string wa\
28
+ ket--undefined. Details: ${e}`)),this.emit("close")})}}async startTls(e){if(void 0===this.subtls)throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let t=await this.subtls.TrustedCert.databaseFromPEM(this.rootCerts),r=new this.subtls.WebSocketReadQueue(this.ws),n=r.read.bind(r),i=this.rawWrite.bind(this),{read:s,write:o}=await this.subtls.startTls(e,t,n,i,{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=s,this.tlsWrite=o,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this.tlsRead();if(void 0===e)break;{let t=f.from(e);this.emit("data",t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws&&this.ws.send(e);return}if(void 0===this.writeBuffer)this.writeBuffer=e,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",r=e=>{}){return 0===e.length?r():("string"==typeof e&&(e=f.from(e,t)),0===this.tlsState?(this.rawWrite(e),r()):1===this.tlsState?this.once("secureConnection",()=>{this.write(e,t,r)}):(this.tlsWrite(e),r())),!0}end(e=f.alloc(0),t="utf8",r=()=>{}){return this.write(e,t,()=>{this.ws.close(),r()}),this}destroy(){return this.destroyed=!0,this.end()}},_(B,"Socket"),T(B,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:_((e,t,r)=>"https://"+(r?.jwtAuth?e.replace(k,"apiauth."):e.replace(k,"api."))+"/sql","fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0,wsProxy:_(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1,disableWarningInBrowsers:!1}),T(B,"opts",{}),j=B}),F={};function q(e,t=!1){let{protocol:r}=new URL(e),{username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,searchParams:l,hash:h}=new URL("http:"+e.substring(r.length));i=decodeURIComponent(i),n=decodeURIComponent(n),u=decodeURIComponent(u);let f=n+":"+i,d=t?Object.fromEntries(l.entries()):c;return{href:e,protocol:r,auth:f,username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,query:d,hash:h}}S(F,{parse:()=>q});var $=w(()=>{I(),_(q,"parse")}),G=E(e=>{I(),e.parse=function(e,t){return new r(e,t).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return"\\"===e?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&("NULL"!==(t=this.recorded.join(""))||e||(t=null),null!==t&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if("["===this.source[0])for(;!this.isEof()&&"="!==this.nextCharacter().value;);}parse(t){var r,n,i;for(this.consumeDimensions();!this.isEof();)if("{"!==(r=this.nextCharacter()).value||i){if("}"!==r.value||i)'"'!==r.value||r.escaped?","!==r.value||i?this.record(r.value):this.newEntry():(i&&this.newEntry(!0),i=!i);else if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else this.dimension++,this.dimension>1&&(n=new e(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);if(0!==this.dimension)throw Error("array dimension not balanced");return this.entries}};_(t,"ArrayParser");var r=t;function n(e){return e}_(n,"identity")}),H=E((e,t)=>{I();var r=G();t.exports={create:_(function(e,t){return{parse:_(function(){return r.parse(e,t)},"parse")}},"create")}}),V=E((e,t)=>{I();var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;function o(e){var t=n.exec(e);if(t){var r=parseInt(t[1],10);t[4]&&(r=u(r));var i=new Date(r,parseInt(t[2],10)-1,t[3]);return c(r)&&i.setFullYear(r),i}}function a(e){if(e.endsWith("+00"))return 0;var t=i.exec(e.split(" ")[1]);if(t){var r=t[1];return"Z"===r?0:(3600*parseInt(t[2],10)+60*parseInt(t[3]||0,10)+parseInt(t[4]||0,10))*("-"===r?-1:1)*1e3}}function u(e){return-(e-1)}function c(e){return e>=0&&e<100}t.exports=_(function(e){if(s.test(e))return Number(e.replace("i","I"));var t=r.exec(e);if(!t)return o(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=u(i));var l=parseInt(t[2],10)-1,h=t[3],f=parseInt(t[4],10),d=parseInt(t[5],10),p=parseInt(t[6],10),g=t[7];g=g?1e3*parseFloat(g):0;var m,y=a(e);return null!=y?(m=new Date(Date.UTC(i,l,h,f,d,p,g)),c(i)&&m.setUTCFullYear(i),0!==y&&m.setTime(m.getTime()-y)):(m=new Date(i,l,h,f,d,p,g),c(i)&&m.setFullYear(i)),m},"parseDate"),_(o,"getDate"),_(a,"timeZoneOffset"),_(u,"bcYearToNegativeYear"),_(c,"is0To99")}),W=E((e,t)=>{I(),t.exports=n;var r=Object.prototype.hasOwnProperty;function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}_(n,"extend")}),Q=E((e,t)=>{I();var r=W();function n(e){if(!(this instanceof n))return new n(e);r(this,d(e))}t.exports=n,_(n,"PostgresInterval");var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&0>e.indexOf("seconds")&&e.push("seconds"),0===e.length?"0":e.map(function(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),t+" "+e},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},o=["years","months","days"],a=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){return"P"+o.map(e,this).join("")+"T"+a.map(e,this).join("");function e(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),t+s[e]}};var u="([+-]?\\d+)",c=new RegExp([u+"\\s+years?",u+"\\s+mons?",u+"\\s+days?","([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e){return"("+e+")?"}).join("\\s*")),l={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function f(e){return parseInt(e+"000000".slice(e.length),10)/1e3}function d(e){if(!e)return{};var t=c.exec(e),r="-"===t[8];return Object.keys(l).reduce(function(e,n){var i=t[l[n]];return i&&(i="milliseconds"===n?f(i):parseInt(i,10))&&(r&&~h.indexOf(n)&&(i*=-1),e[n]=i),e},{})}_(f,"parseMilliseconds"),_(d,"parse")}),Y=E((e,t)=>{I(),t.exports=_(function(e){if(/^\\x/.test(e))return new f(e.substr(2),"hex");for(var t="",r=0;r<e.length;)if("\\"!==e[r])t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var n=1;r+n<e.length&&"\\"===e[r+n];)n++;for(var i=0;i<Math.floor(n/2);++i)t+="\\";r+=2*Math.floor(n/2)}return new f(t,"binary")},"parseBytea")}),X=E((e,t)=>{I();var r=G(),n=H(),i=V(),s=Q(),o=Y();function a(e){return _(function(t){return null===t?t:e(t)},"nullAllowed")}function u(e){return null===e?e:"TRUE"===e||"t"===e||"true"===e||"y"===e||"yes"===e||"on"===e||"1"===e}function c(e){return e?r.parse(e,u):null}function l(e){return parseInt(e,10)}function h(e){return e?r.parse(e,a(l)):null}function f(e){return e?r.parse(e,a(function(e){return w(e).trim()})):null}_(a,"allowNull"),_(u,"parseBool"),_(c,"parseBoolArray"),_(l,"parseBaseTenInt"),_(h,"parseIntegerArray"),_(f,"parseBigIntegerArray");var d=_(function(e){return e?n.create(e,function(e){return null!==e&&(e=S(e)),e}).parse():null},"parsePointArray"),p=_(function(e){return e?n.create(e,function(e){return null!==e&&(e=parseFloat(e)),e}).parse():null},"parseFloatArray"),g=_(function(e){return e?n.create(e).parse():null},"parseStringArray"),m=_(function(e){return e?n.create(e,function(e){return null!==e&&(e=i(e)),e}).parse():null},"parseDateArray"),y=_(function(e){return e?n.create(e,function(e){return null!==e&&(e=s(e)),e}).parse():null},"parseIntervalArray"),b=_(function(e){return e?r.parse(e,a(o)):null},"parseByteAArray"),v=_(function(e){return parseInt(e,10)},"parseInteger"),w=_(function(e){var t=String(e);return/^\d+$/.test(t)?t:e},"parseBigInteger"),E=_(function(e){return e?r.parse(e,a(JSON.parse)):null},"parseJsonArray"),S=_(function(e){return"("!==e[0]?null:{x:parseFloat((e=e.substring(1,e.length-1).split(","))[0]),y:parseFloat(e[1])}},"parsePoint"),R=_(function(e){if("<"!==e[0]&&"("!==e[1])return null;for(var t="(",r="",n=!1,i=2;i<e.length-1;i++){if(n||(t+=e[i]),")"===e[i]){n=!0;continue}n&&","!==e[i]&&(r+=e[i])}var s=S(t);return s.radius=parseFloat(r),s},"parseCircle");t.exports={init:_(function(e){e(20,w),e(21,v),e(23,v),e(26,v),e(700,parseFloat),e(701,parseFloat),e(16,u),e(1082,i),e(1114,i),e(1184,i),e(600,S),e(651,g),e(718,R),e(1e3,c),e(1001,b),e(1005,h),e(1007,h),e(1028,h),e(1016,f),e(1017,d),e(1021,p),e(1022,p),e(1231,p),e(1014,g),e(1015,g),e(1008,g),e(1009,g),e(1040,g),e(1041,g),e(1115,m),e(1182,m),e(1185,m),e(1186,s),e(1187,y),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,E),e(3807,E),e(3907,g),e(2951,g),e(791,g),e(1183,g),e(1270,g)},"init")}}),z=E((e,t)=>{function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),n="";t<0&&(t=~t+(0===r),r=~r+1>>>0,n="-");var i,s,o,a,u,c,l="";if(i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";return l=a+o+l,n+(o=""+(s=0x100000000*(i=t%1e6)+r)%1e6)+l}I(),_(r,"readInt8"),t.exports=r}),K=E((e,t)=>{I();var r=z(),n=_(function(e,t,r,n,i){r=r||0,n=n||!1,i=i||function(e,t,r){return e*Math.pow(2,r)+t};var s=r>>3,o=_(function(e){return n?255&~e:e},"inv"),a=255,u=8-r%8;t<u&&(a=255<<8-t&255,u=t),r&&(a>>=r%8);var c=0;r%8+t>=8&&(c=i(0,o(e[s])&a,u));for(var l=t+r>>3,h=s+1;h<l;h++)c=i(c,o(e[h]),8);var f=(t+r)%8;return f>0&&(c=i(c,o(e[l])>>8-f,f)),c},"parseBits"),i=_(function(e,t,r){var i=Math.pow(2,r-1)-1,s=n(e,1),o=n(e,r,1);if(0===o)return 0;var a=1,u=n(e,t,r+1,!1,_(function(e,t,r){0===e&&(e=1);for(var n=1;n<=r;n++)a/=2,(t&1<<r-n)>0&&(e+=a);return e},"parsePrecisionBits"));return o==Math.pow(2,r+1)-1?0===u?0===s?1/0:-1/0:NaN:(0===s?1:-1)*Math.pow(2,o-i)*u},"parseFloatFromBits"),s=_(function(e){return 1==n(e,1)?-1*(n(e,15,1,!0)+1):n(e,15,1)},"parseInt16"),o=_(function(e){return 1==n(e,1)?-1*(n(e,31,1,!0)+1):n(e,31,1)},"parseInt32"),a=_(function(e){return i(e,23,8)},"parseFloat32"),u=_(function(e){return i(e,52,11)},"parseFloat64"),c=_(function(e){var t=n(e,16,32);if(49152==t)return NaN;for(var r=Math.pow(1e4,n(e,16,16)),i=0,s=n(e,16),o=0;o<s;o++)i+=n(e,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,n(e,16,48));return(0===t?1:-1)*Math.round(i*a)/a},"parseNumeric"),l=_(function(e,t){var r=n(t,1),i=n(t,63,1),s=new Date((0===r?1:-1)*i/1e3+9466848e5);return e||s.setTime(s.getTime()+6e4*s.getTimezoneOffset()),s.usec=i%1e3,s.getMicroSeconds=function(){return this.usec},s.setMicroSeconds=function(e){this.usec=e},s.getUTCMicroSeconds=function(){return this.usec},s},"parseDate"),h=_(function(e){for(var t=n(e,32),r=(n(e,32,32),n(e,32,64)),i=96,s=[],o=0;o<t;o++)s[o]=n(e,32,i),i+=64;var a=_(function(t){var r,s=n(e,32,i);return(i+=32,0xffffffff==s)?null:23==t||20==t?(r=n(e,8*s,i),i+=8*s,r):25==t?e.toString(this.encoding,i>>3,(i+=s<<3)>>3):void console.log("ERROR: ElementType not implemented: "+t)},"parseElement"),u=_(function(e,t){var r,n=[];if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=u(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=a(t);return n},"parse");return u(s,r)},"parseArray"),f=_(function(e){return e.toString("utf8")},"parseText"),d=_(function(e){return null===e?null:n(e,8)>0},"parseBool");t.exports={init:_(function(e){e(20,r),e(21,s),e(23,o),e(26,o),e(1700,c),e(700,a),e(701,u),e(16,d),e(1114,l.bind(null,!1)),e(1184,l.bind(null,!0)),e(1e3,h),e(1007,h),e(1016,h),e(1008,h),e(1009,h),e(25,f)},"init")}}),J=E((e,t)=>{I(),t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}}),Z=E(e=>{I();var t=X(),r=K(),n=H(),i=J();e.getTypeParser=a,e.setTypeParser=u,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function o(e){return String(e)}function a(e,t){return s[t=t||"text"]&&s[t][e]||o}function u(e,t,r){"function"==typeof t&&(r=t,t="text"),s[t][e]=r}_(o,"noParse"),_(a,"getTypeParser"),_(u,"setTypeParser"),t.init(function(e,t){s.text[e]=t}),r.init(function(e,t){s.binary[e]=t})}),ee=E((e,t)=>{I();var r=Z();function n(e){this._types=e||r,this.text={},this.binary={}}_(n,"TypeOverrides"),n.prototype.getOverrides=function(e){switch(e){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(e,t,r){"function"==typeof t&&(r=t,t="text"),this.getOverrides(t)[e]=r},n.prototype.getTypeParser=function(e,t){return t=t||"text",this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=n});function et(e){let t=0x6a09e667,r=0xbb67ae85,n=0x3c6ef372,i=0xa54ff53a,s=0x510e527f,o=0x9b05688c,a=0x1f83d9ab,u=0x5be0cd19,c=0,l=0,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=_((e,t)=>e>>>t|e<<32-t,"rrot"),d=new Uint32Array(64),p=new Uint8Array(64),g=_(()=>{for(let e=0,t=0;e<16;e++,t+=4)d[e]=p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3];for(let e=16;e<64;e++){let t=f(d[e-15],7)^f(d[e-15],18)^d[e-15]>>>3,r=f(d[e-2],17)^f(d[e-2],19)^d[e-2]>>>10;d[e]=d[e-16]+t+d[e-7]+r|0}let e=t,c=r,g=n,m=i,y=s,b=o,v=a,_=u;for(let t=0;t<64;t++){let r=_+(f(y,6)^f(y,11)^f(y,25))+(y&b^~y&v)+h[t]+d[t]|0,n=(f(e,2)^f(e,13)^f(e,22))+(e&c^e&g^c&g)|0;_=v,v=b,b=y,y=m+r|0,m=g,g=c,c=e,e=r+n|0}t=t+e|0,r=r+c|0,n=n+g|0,i=i+m|0,s=s+y|0,o=o+b|0,a=a+v|0,u=u+_|0,l=0},"process"),m=_(e=>{"string"==typeof e&&(e=new TextEncoder().encode(e));for(let t=0;t<e.length;t++)p[l++]=e[t],64===l&&g();c+=e.length},"add"),y=_(()=>{if(p[l++]=128,64==l&&g(),l+8>64){for(;l<64;)p[l++]=0;g()}for(;l<58;)p[l++]=0;let e=8*c;p[l++]=e/0x10000000000&255,p[l++]=e/0x100000000&255,p[l++]=e>>>24,p[l++]=e>>>16&255,p[l++]=e>>>8&255,p[l++]=255&e,g();let h=new Uint8Array(32);return h[0]=t>>>24,h[1]=t>>>16&255,h[2]=t>>>8&255,h[3]=255&t,h[4]=r>>>24,h[5]=r>>>16&255,h[6]=r>>>8&255,h[7]=255&r,h[8]=n>>>24,h[9]=n>>>16&255,h[10]=n>>>8&255,h[11]=255&n,h[12]=i>>>24,h[13]=i>>>16&255,h[14]=i>>>8&255,h[15]=255&i,h[16]=s>>>24,h[17]=s>>>16&255,h[18]=s>>>8&255,h[19]=255&s,h[20]=o>>>24,h[21]=o>>>16&255,h[22]=o>>>8&255,h[23]=255&o,h[24]=a>>>24,h[25]=a>>>16&255,h[26]=a>>>8&255,h[27]=255&a,h[28]=u>>>24,h[29]=u>>>16&255,h[30]=u>>>8&255,h[31]=255&u,h},"digest");return void 0===e?{add:m,digest:y}:(m(e),y())}var er,en,ei=w(()=>{I(),_(et,"sha256")}),es=w(()=>{I(),_(er=class e{constructor(){T(this,"_dataLength",0),T(this,"_bufferLength",0),T(this,"_state",new Int32Array(4)),T(this,"_buffer",new ArrayBuffer(68)),T(this,"_buffer8"),T(this,"_buffer32"),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(t){let r=e.hexChars,n=e.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=8*a,i=t[a],o=0;o<8;o+=2)n[s+1+o]=r.charAt(15&i),i>>>=4,n[s+0+o]=r.charAt(15&i),i>>>=4;return n.join("")}static _md5cycle(e,t){let r=e[0],n=e[1],i=e[2],s=e[3];r+=(n&i|~n&s)+t[0]-0x28955b88|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[1]-0x173848aa|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[2]+0x242070db|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[3]-0x3e423112|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[4]-0xa83f051|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[5]+0x4787c62a|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[6]-0x57cfb9ed|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[7]-0x2b96aff|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[8]+0x698098d8|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[9]-0x74bb0851|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[11]-0x76a32842|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[12]+0x6b901122|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[13]-0x2678e6d|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[14]-0x5986bc72|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[15]+0x49b40821|0,r+=((n=(n<<22|n>>>10)+i|0)&s|i&~s)+t[1]-0x9e1da9e|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[6]-0x3fbf4cc0|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[11]+0x265e5a51|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[0]-0x16493856|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[5]-0x29d0efa3|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[10]+0x2441453|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[15]-0x275e197f|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[4]-0x182c0438|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[9]+0x21e1cde6|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[14]-0x3cc8f82a|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[3]-0xb2af279|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[8]+0x455a14ed|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[13]-0x561c16fb|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[2]-0x3105c08|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[7]+0x676f02d9|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[12]-0x72d5b376|0,r+=((n=(n<<20|n>>>12)+i|0)^i^s)+t[5]-378558|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[8]-0x788e097f|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[11]+0x6d9d6122|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[14]-0x21ac7f4|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[1]-0x5b4115bc|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[4]+0x4bdecfa9|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[7]-0x944b4a0|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[10]-0x41404390|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[13]+0x289b7ec6|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[0]-0x155ed806|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[3]-0x2b10cf7b|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[6]+0x4881d05|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[9]-0x262b2fc7|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[12]-0x1924661b|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[15]+0x1fa27cf8|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[2]-0x3b53a99b|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~s))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[7]+0x432aff97|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[14]-0x546bdc59|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[5]-0x36c5fc7|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[3]-0x70f3336e|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[10]-1051523|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[1]-0x7a7ba22f|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[15]-0x1d31920|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[6]-0x5cfebcec|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[13]+0x4e0811a1|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[11]-0x42c50dcb|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[2]+0x2ad7d2bb|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[9]-0x14792c6f|0,n=(n<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o;for(o=0;o<t.length;o+=1){if((s=t.charCodeAt(o))<128)r[i++]=s;else if(s<2048)r[i++]=(s>>>6)+192,r[i++]=63&s|128;else if(s<55296||s>56319)r[i++]=(s>>>12)+224,r[i++]=s>>>6&63|128,r[i++]=63&s|128;else{if((s=(s-55296)*1024+(t.charCodeAt(++o)-56320)+65536)>1114111)throw Error("Unicode standard supports code points up to U+10FFFF");r[i++]=(s>>>18)+240,r[i++]=s>>>12&63|128,r[i++]=s>>>6&63|128,r[i++]=63&s|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t[o++];if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,r=e.state,n=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let r=this._bufferLength,n=this._buffer8,i=this._buffer32,s=(r>>2)+1;this._dataLength+=r;let o=8*this._dataLength;if(n[r]=128,n[r+1]=n[r+2]=n[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=0xffffffff)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;let t=parseInt(e[2],16),r=parseInt(e[1],16)||0;i[14]=t,i[15]=r}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}},"Md5"),T(er,"stateIdentity",new Int32Array([0x67452301,-0x10325477,-0x67452302,0x10325476])),T(er,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),T(er,"hexChars","0123456789abcdef"),T(er,"hexOut",[]),T(er,"onePassHasher",new er),en=er}),eo={};function ea(e){return crypto.getRandomValues(f.alloc(e))}function eu(e){if("sha256"===e)return{update:_(function(e){return{digest:_(function(){return f.from(et(e))},"digest")}},"update")};if("md5"===e)return{update:_(function(e){return{digest:_(function(){return"string"==typeof e?en.hashStr(e):en.hashByteArray(e)},"digest")}},"update")};throw Error(`Hash type '${e}' not supported`)}function ec(e,t){if("sha256"!==e)throw Error(`\
29
+ Only sha256 is supported (requested: '${e}')`);return{update:_(function(e){return{digest:_(function(){"string"==typeof t&&(t=new TextEncoder().encode(t)),"string"==typeof e&&(e=new TextEncoder().encode(e));let r=t.length;if(r>64)t=et(t);else if(r<64){let e=new Uint8Array(64);e.set(t),t=e}let n=new Uint8Array(64),i=new Uint8Array(64);for(let e=0;e<64;e++)n[e]=54^t[e],i[e]=92^t[e];let s=new Uint8Array(e.length+64);s.set(n,0),s.set(e,64);let o=new Uint8Array(96);return o.set(i,0),o.set(et(s),64),f.from(et(o))},"digest")}},"update")}}S(eo,{createHash:()=>eu,createHmac:()=>ec,randomBytes:()=>ea});var el=w(()=>{I(),ei(),es(),_(ea,"randomBytes"),_(eu,"createHash"),_(ec,"createHmac")}),eh=E((e,t)=>{I(),t.exports={host:"localhost",user:"win32"===d.platform?d.env.USERNAME:d.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var r=Z(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(e){r.setTypeParser(20,"text",e?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",e?r.getTypeParser(1007,"text"):i)})}),ef=E((e,t)=>{I();var r=(el(),A(eo)),n=eh();function i(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function s(e){for(var t="{",r=0;r<e.length;r++)r>0&&(t+=","),null===e[r]||typeof e[r]>"u"?t+="NULL":Array.isArray(e[r])?t+=s(e[r]):e[r]instanceof f?t+="\\\\x"+e[r].toString("hex"):t+=i(o(e[r]));return t+"}"}_(i,"escapeElement"),_(s,"arrayString");var o=_(function(e,t){if(null==e)return null;if(e instanceof f)return e;if(ArrayBuffer.isView(e)){var r=f.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?l(e):c(e):Array.isArray(e)?s(e):"object"==typeof e?a(e,t):e.toString()},"prepareValue");function a(e,t){if(e&&"function"==typeof e.toPostgres){if(-1!==(t=t||[]).indexOf(e))throw Error('circular reference detected while preparing "'+e+'" for query');return t.push(e),o(e.toPostgres(o),t)}return JSON.stringify(e)}function u(e,t){for(e=""+e;e.length<t;)e="0"+e;return e}function c(e){var t=-e.getTimezoneOffset(),r=e.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);var i=u(r,4)+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+u(e.getHours(),2)+":"+u(e.getMinutes(),2)+":"+u(e.getSeconds(),2)+"."+u(e.getMilliseconds(),3);return t<0?(i+="-",t*=-1):i+="+",i+=u(Math.floor(t/60),2)+":"+u(t%60,2),n&&(i+=" BC"),i}function l(e){var t=e.getUTCFullYear(),r=t<1;r&&(t=Math.abs(t)+1);var n=u(t,4)+"-"+u(e.getUTCMonth()+1,2)+"-"+u(e.getUTCDate(),2)+"T"+u(e.getUTCHours(),2)+":"+u(e.getUTCMinutes(),2)+":"+u(e.getUTCSeconds(),2)+"."+u(e.getUTCMilliseconds(),3);return n+="+00:00",r&&(n+=" BC"),n}function h(e,t,r){return e="string"==typeof e?{text:e}:e,t&&("function"==typeof t?e.callback=t:e.values=t),r&&(e.callback=r),e}_(a,"prepareObject"),_(u,"pad"),_(c,"dateToString"),_(l,"dateToStringUTC"),_(h,"normalizeQueryConfig");var d=_(function(e){return r.createHash("md5").update(e,"utf-8").digest("hex")},"md5"),p=_(function(e,t,r){var n=d(t+e);return"md5"+d(f.concat([f.from(n),r]))},"postgresMd5PasswordHash");t.exports={prepareValue:_(function(e){return o(e)},"prepareValueWrapper"),normalizeQueryConfig:h,postgresMd5PasswordHash:p,md5:d}}),ed={};S(ed,{default:()=>ep});var ep,eg=w(()=>{I(),ep={}}),em=E((e,t)=>{I();var r=(el(),A(eo));function n(e){if(-1===e.indexOf("SCRAM-SHA-256"))throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let t=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:t,response:"n,,n=*,r="+t,message:"SASLInitialResponse"}}function i(e,t,r){if("SASLInitialResponse"!==e.message)throw Error("SASL: Last message was not SASLInitialResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if("string"!=typeof r)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=c(r);if(n.nonce.startsWith(e.clientNonce)){if(n.nonce.length===e.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var i=g(t,f.from(n.salt,"base64"),n.iteration),s=p(i,"Client Key"),o=d(s),a="n=*,r="+e.clientNonce,u="r="+n.nonce+",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,m=a+","+u+","+l,y=h(s,p(o,m)).toString("base64"),b=p(i,"Server Key"),v=p(b,m);e.message="SASLResponse",e.serverSignature=v.toString("base64"),e.response=l+",p="+y}function s(e,t){if("SASLResponse"!==e.message)throw Error("SASL: Last message was not SASLResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=l(t);if(r!==e.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function o(e){if("string"!=typeof e)throw TypeError("SASL: text must be a string");return e.split("").map((t,r)=>e.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function a(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function u(e){if("string"!=typeof e)throw TypeError("SASL: attribute pairs text must be a string");return new Map(e.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]}))}function c(e){let t=u(e),r=t.get("r");if(r){if(!o(r))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=t.get("s");if(n){if(!a(n))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=t.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");return{nonce:r,salt:n,iteration:parseInt(i,10)}}function l(e){let t=u(e).get("v");if(t){if(!a(t))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}}function h(e,t){if(!f.isBuffer(e))throw TypeError("first argument must be a Buffer");if(!f.isBuffer(t))throw TypeError("second argument must be a Buffer");if(e.length!==t.length)throw Error("Buffer lengths must match");if(0===e.length)throw Error("Buffers cannot be empty");return f.from(e.map((r,n)=>e[n]^t[n]))}function d(e){return r.createHash("sha256").update(e).digest()}function p(e,t){return r.createHmac("sha256",e).update(t).digest()}function g(e,t,r){for(var n=p(e,f.concat([t,f.from([0,0,0,1])])),i=n,s=0;s<r-1;s++)i=h(i,n=p(e,n));return i}_(n,"startSession"),_(i,"continueSession"),_(s,"finalizeSession"),_(o,"isPrintableChars"),_(a,"isBase64"),_(u,"parseAttributePairs"),_(c,"parseServerFirstMessage"),_(l,"parseServerFinalMessage"),_(h,"xorBuffers"),_(d,"sha256"),_(p,"hmacSha256"),_(g,"Hi"),t.exports={startSession:n,continueSession:i,finalizeSession:s}}),ey={};function eb(...e){return e.join("/")}S(ey,{join:()=>eb});var ev=w(()=>{I(),_(eb,"join")}),e_={};function ew(e,t){t(Error("No filesystem"))}S(e_,{stat:()=>ew});var eE=w(()=>{I(),_(ew,"stat")}),eS={};S(eS,{default:()=>eR});var eR,ex=w(()=>{I(),eR={}}),eA={};S(eA,{StringDecoder:()=>eP});var eT,eP,eO=w(()=>{I(),_(eT=class{constructor(e){T(this,"td"),this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}},"StringDecoder"),eP=eT}),eC=E((e,t)=>{I();var{Transform:r}=(ex(),A(eS)),{StringDecoder:n}=(eO(),A(eA)),i=Symbol("last"),s=Symbol("decoder");function o(e,t,r){let n;if(this.overflow){if(1===(n=this[s].write(e).split(this.matcher)).length)return r();n.shift(),this.overflow=!1}else this[i]+=this[s].write(e),n=this[i].split(this.matcher);this[i]=n.pop();for(let e=0;e<n.length;e++)try{u(this,this.mapper(n[e]))}catch(e){return r(e)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow)return void r(Error("maximum buffer reached"));r()}function a(e){if(this[i]+=this[s].end(),this[i])try{u(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function u(e,t){void 0!==t&&e.push(t)}function c(e){return e}function l(e,t,u){switch(e=e||/\r?\n/,t=t||c,u=u||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||e[Symbol.split]||(u=e,e=/\r?\n/);break;case 2:"function"==typeof e?(u=t,t=e,e=/\r?\n/):"object"==typeof t&&(u=t,t=c)}(u=Object.assign({},u)).autoDestroy=!0,u.transform=o,u.flush=a,u.readableObjectMode=!0;let l=new r(u);return l[i]="",l[s]=new n("utf8"),l.matcher=e,l.mapper=t,l.maxLength=u.maxLength,l.skipOverflow=u.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}_(o,"transform"),_(a,"flush"),_(u,"push"),_(c,"noop"),_(l,"split"),t.exports=l}),eI=E((e,t)=>{I();var r=(ev(),A(ey)),n=(ex(),A(eS)).Stream,i=eC(),s=(eg(),A(ed)),o="win32"===d.platform,a=d.stderr;function u(e){return(61440&e)==32768}_(u,"isRegFile");var c=["host","port","database","user","password"],l=c.length,h=c[l-1];function f(){if(a instanceof n&&!0===a.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
+ `);a.write(s.format.apply(s,e))}}_(f,"warn"),Object.defineProperty(t.exports,"isWin",{get:_(function(){return o},"get"),set:_(function(e){o=e},"set")}),t.exports.warnTo=function(e){var t=a;return a=e,t},t.exports.getFileName=function(e){var t=e||d.env;return t.PGPASSFILE||(o?r.join(t.APPDATA||"./","postgresql","pgpass.conf"):r.join(t.HOME||"./",".pgpass"))},t.exports.usePgPass=function(e,t){return!Object.prototype.hasOwnProperty.call(d.env,"PGPASSWORD")&&(!!o||(t=t||"<unkn>",u(e.mode)?!(63&e.mode)||(f('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',t),!1):(f('WARNING: password file "%s" is not a plain file',t),!1)))};var p=t.exports.match=function(e,t){return c.slice(0,-1).reduce(function(r,n,i){return 1==i&&Number(e[n]||5432)===Number(t[n])?r&&!0:r&&("*"===t[n]||t[n]===e[n])},!0)};t.exports.getPassword=function(e,t,r){var n,s=t.pipe(i());function o(t){var r=g(t);r&&m(r)&&p(e,r)&&(n=r[h],s.end())}_(o,"onLine");var a=_(function(){t.destroy(),r(n)},"onEnd"),u=_(function(e){t.destroy(),f("WARNING: error on reading file: %s",e),r(void 0)},"onErr");t.on("error",u),s.on("data",o).on("end",a).on("error",u)};var g=t.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t="",r="",n=0,i=0,s={},o=_(function(t,r,n){var i=e.substring(r,n);Object.hasOwnProperty.call(d.env,"PGPASS_NO_DEESCAPE")||(i=i.replace(/\\([:\\])/g,"$1")),s[c[t]]=i},"addToObj"),a=0;a<e.length-1;a+=1){if(t=e.charAt(a+1),r=e.charAt(a),n==l-1){o(n,i);break}a>=0&&":"==t&&"\\"!==r&&(o(n,i,a+1),i=a+2,n+=1)}return s=Object.keys(s).length===l?s:null},m=t.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return"*"===e||isFinite(e=Number(e))&&e>0&&e<0x20000000000000&&Math.floor(e)===e},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},r=0;r<c.length;r+=1)if(!(0,t[r])(e[c[r]]||""))return!1;return!0}}),eN=E((e,t)=>{I(),ev(),A(ey);var r=(eE(),A(e_)),n=eI();t.exports=function(e,t){var i=n.getFileName();r.stat(i,function(s,o){if(s||!n.usePgPass(o,i))return t(void 0);var a=r.createReadStream(i);n.getPassword(e,a,t)})},t.exports.warnTo=n.warnTo}),eL={};S(eL,{default:()=>eM});var eM,eD=w(()=>{I(),eM={}}),ek=E((e,t)=>{I();var r=($(),A(F)),n=(eE(),A(e_));function i(e){if("/"===e.charAt(0)){var t=e.split(" ");return{host:t[0],database:t[1]}}var i=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)?encodeURI(e).replace(/\%25(\d\d)/g,"%$1"):e,!0),t=i.query;for(var s in t)Array.isArray(t[s])&&(t[s]=t[s][t[s].length-1]);var o=(i.auth||":").split(":");if(t.user=o[0],t.password=o.splice(1).join(":"),t.port=i.port,"socket:"==i.protocol)return t.host=decodeURI(i.pathname),t.database=i.query.db,t.client_encoding=i.query.encoding,t;t.host||(t.host=i.hostname);var a=i.pathname;if(!t.host&&a&&/^%2f/i.test(a)){var u=a.split("/");t.host=decodeURIComponent(u[0]),a=u.splice(1).join("/")}switch(a&&"/"===a.charAt(0)&&(a=a.slice(1)||null),t.database=a&&decodeURI(a),("true"===t.ssl||"1"===t.ssl)&&(t.ssl=!0),"0"===t.ssl&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl.cert=n.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=n.readFileSync(t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=n.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":t.ssl=!1;break;case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":t.ssl.rejectUnauthorized=!1}return t}_(i,"parse"),t.exports=i,i.parse=i}),eB=E((e,t)=>{I();var r=(eD(),A(eL)),n=eh(),i=ek().parse,s=_(function(e,t,r){return void 0===r?r=d.env["PG"+e.toUpperCase()]:!1===r||(r=d.env[r]),t[e]||r||n[e]},"val"),o=_(function(){switch(d.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return n.ssl},"readSSLConfigFromEnvironment"),a=_(function(e){return"'"+(""+e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),u=_(function(e,t,r){var n=t[r];null!=n&&e.push(r+"="+a(n))},"add"),c=class{constructor(e){(e="string"==typeof e?i(e):e||{}).connectionString&&(e=Object.assign({},e,i(e.connectionString))),this.user=s("user",e),this.database=s("database",e),void 0===this.database&&(this.database=this.user),this.port=parseInt(s("port",e),10),this.host=s("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",e)}),this.binary=s("binary",e),this.options=s("options",e),this.ssl=typeof e.ssl>"u"?o():e.ssl,"string"==typeof this.ssl&&"true"===this.ssl&&(this.ssl=!0),"no-verify"===this.ssl&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",e),this.replication=s("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",e,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",e,!1),this.statement_timeout=s("statement_timeout",e,!1),this.lock_timeout=s("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",e,!1),this.query_timeout=s("query_timeout",e,!1),void 0===e.connectionTimeoutMillis?this.connect_timeout=d.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),!1===e.keepAlive?this.keepalives=0:!0===e.keepAlive&&(this.keepalives=1),"number"==typeof e.keepAliveInitialDelayMillis&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];u(t,this,"user"),u(t,this,"password"),u(t,this,"port"),u(t,this,"application_name"),u(t,this,"fallback_application_name"),u(t,this,"connect_timeout"),u(t,this,"options");var n="object"==typeof this.ssl?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(u(t,n,"sslmode"),u(t,n,"sslca"),u(t,n,"sslkey"),u(t,n,"sslcert"),u(t,n,"sslrootcert"),this.database&&t.push("dbname="+a(this.database)),this.replication&&t.push("replication="+a(this.replication)),this.host&&t.push("host="+a(this.host)),this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+a(this.client_encoding)),r.lookup(this.host,function(r,n){return r?e(r,null):(t.push("hostaddr="+a(n)),e(null,t.join(" ")))})}};_(c,"ConnectionParameters"),t.exports=c}),ej=E((e,t)=>{I();var r=Z(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray="array"===e,this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){var t;(t=e.text?n.exec(e.text):n.exec(e.command))&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=Array(e.length),r=0,n=e.length;r<n;r++){var i=e[r];null!==i?t[r]=this._parsers[r](i):t[r]=null}return t}parseRow(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r],s=this.fields[r].name;null!==i?t[s]=this._parsers[r](i):t[s]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var n=e[t];this._types?this._parsers[t]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=r.getTypeParser(n.dataTypeID,n.format||"text")}}};_(i,"Result"),t.exports=i}),eU=E((e,t)=>{I();var{EventEmitter:r}=N(),n=ej(),i=ef(),s=class extends r{constructor(e,t,r){super(),e=i.normalizeQueryConfig(e,t,r),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,d.domain&&e.callback&&(this.callback=d.domain.bind(e.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return!!this.name||!!this.rows||!!this.text&&!!this.values&&this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){d.nextTick(()=>{throw e})}this.emit("end",this._results)}submit(e){if("string"!=typeof this.text&&"string"!=typeof this.name)return Error("A query must have either text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this.name];return this.text&&t&&this.text!==t?Error(`Prepared statements must be unique - '${this.name}\
31
+ ' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:i.prepareValue})}catch(t){this.handleError(t,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};_(s,"Query"),t.exports=s}),eF=E(e=>{I(),Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(e,t,r){super(e),this.length=t,this.name=r}};_(t,"DatabaseError"),e.DatabaseError=t;var r=class{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}};_(r,"CopyDataMessage"),e.CopyDataMessage=r;var n=class{constructor(e,t,r,n){this.length=e,this.name=t,this.binary=r,this.columnTypes=Array(n)}};_(n,"CopyResponse"),e.CopyResponse=n;var i=class{constructor(e,t,r,n,i,s,o){this.name=e,this.tableID=t,this.columnID=r,this.dataTypeID=n,this.dataTypeSize=i,this.dataTypeModifier=s,this.format=o}};_(i,"Field"),e.Field=i;var s=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=Array(this.fieldCount)}};_(s,"RowDescriptionMessage"),e.RowDescriptionMessage=s;var o=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}};_(o,"ParameterDescriptionMessage"),e.ParameterDescriptionMessage=o;var a=class{constructor(e,t,r){this.length=e,this.parameterName=t,this.parameterValue=r,this.name="parameterStatus"}};_(a,"ParameterStatusMessage"),e.ParameterStatusMessage=a;var u=class{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}};_(u,"AuthenticationMD5Password"),e.AuthenticationMD5Password=u;var c=class{constructor(e,t,r){this.length=e,this.processID=t,this.secretKey=r,this.name="backendKeyData"}};_(c,"BackendKeyDataMessage"),e.BackendKeyDataMessage=c;var l=class{constructor(e,t,r,n){this.length=e,this.processId=t,this.channel=r,this.payload=n,this.name="notification"}};_(l,"NotificationResponseMessage"),e.NotificationResponseMessage=l;var h=class{constructor(e,t){this.length=e,this.status=t,this.name="readyForQuery"}};_(h,"ReadyForQueryMessage"),e.ReadyForQueryMessage=h;var f=class{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};_(f,"CommandCompleteMessage"),e.CommandCompleteMessage=f;var d=class{constructor(e,t){this.length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};_(d,"DataRowMessage"),e.DataRowMessage=d;var p=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};_(p,"NoticeMessage"),e.NoticeMessage=p}),eq=E(e=>{I(),Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=f.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,r=t.length+(t.length>>1)+e;this.buffer=f.allocUnsafe(r),t.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(e){let t=f.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=t}else this.ensure(1);return this.buffer[this.offset++]=0,this}addString(e=""){let t=f.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)}return this.buffer.slice(5*!e,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=f.allocUnsafe(this.size),t}};_(t,"Writer"),e.Writer=t}),e$=E(e=>{I(),Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=eq(),r=new t.Writer,n=_(e=>{for(let t of(r.addInt16(3).addInt16(0),Object.keys(e)))r.addCString(t).addCString(e[t]);r.addCString("client_encoding").addCString("UTF8");let n=r.addCString("").flush(),i=n.length+4;return new t.Writer().addInt32(i).add(n).flush()},"startup"),i=_(()=>{let e=f.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(0x4d2162f,4),e},"requestSsl"),s=_(e=>r.addCString(e).flush(112),"password"),o=_(function(e,t){return r.addCString(e).addInt32(f.byteLength(t)).addString(t),r.flush(112)},"sendSASLInitialResponseMessage"),a=_(function(e){return r.addString(e).flush(112)},"sendSCRAMClientFinalMessage"),u=_(e=>r.addCString(e).flush(81),"query"),c=[],l=_(e=>{let t=e.name||"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let n=e.types||c,i=n.length,s=r.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)s.addInt32(n[e]);return r.flush(80)},"parse"),h=new t.Writer,d=_(function(e,t){for(let n=0;n<e.length;n++){let i=t?t(e[n],n):e[n];null==i?(r.addInt16(0),h.addInt32(-1)):i instanceof f?(r.addInt16(1),h.addInt32(i.length),h.add(i)):(r.addInt16(0),h.addInt32(f.byteLength(i)),h.addString(i))}},"writeValues"),p=_((e={})=>{let t=e.portal||"",n=e.statement||"",i=e.binary||!1,s=e.values||c,o=s.length;return r.addCString(t).addCString(n),r.addInt16(o),d(s,e.valueMapper),r.addInt16(o),r.add(h.flush()),r.addInt16(+!!i),r.flush(66)},"bind"),g=f.from([69,0,0,0,9,0,0,0,0,0]),m=_(e=>{if(!e||!e.portal&&!e.rows)return g;let t=e.portal||"",r=e.rows||0,n=f.byteLength(t),i=4+n+1+4,s=f.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(t,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},"execute"),y=_((e,t)=>{let r=f.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(e,8),r.writeInt32BE(t,12),r},"cancel"),b=_((e,t)=>{let r=4+f.byteLength(t)+1,n=f.allocUnsafe(1+r);return n[0]=e,n.writeInt32BE(r,1),n.write(t,5,"utf-8"),n[r]=0,n},"cstringMessage"),v=r.addCString("P").flush(68),w=r.addCString("S").flush(68),E=_(e=>e.name?b(68,`${e.type}${e.name||""}`):"P"===e.type?v:w,"describe"),S=_(e=>b(67,`${e.type}${e.name||""}`),"close"),R=_(e=>r.add(e).flush(100),"copyData"),x=_(e=>b(102,e),"copyFail"),A=_(e=>f.from([e,0,0,0,4]),"codeOnlyBuffer"),T=A(72),P=A(83),O=A(88),C=A(99);e.serialize={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:a,query:u,parse:l,bind:p,execute:m,describe:E,close:S,flush:_(()=>T,"flush"),sync:_(()=>P,"sync"),end:_(()=>O,"end"),copyData:R,copyDone:_(()=>C,"copyDone"),copyFail:x,cancel:y}}),eG=E(e=>{I(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=f.allocUnsafe(0),r=class{constructor(e=0){this.offset=e,this.buffer=t,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){let e=this.offset,t=e;for(;0!==this.buffer[t++];);return this.offset=t,this.buffer.toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}};_(r,"BufferReader"),e.BufferReader=r}),eH=E(e=>{I(),Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=eF(),r=eG(),n=f.allocUnsafe(0),i=class{constructor(e){if(this.buffer=n,this.bufferLength=0,this.bufferOffset=0,this.reader=new r.BufferReader,e?.mode==="binary")throw Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let r=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=r;){let e=this.buffer[i],n=this.buffer.readUInt32BE(i+1),s=1+n;if(s+i<=r)t(this.handlePacket(i+5,e,n,this.buffer)),i+=s;else break}i===r?(this.buffer=n,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=r-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let r=2*this.buffer.byteLength;for(;t>=r;)r*=2;e=f.allocUnsafe(r)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,r,n,i){switch(r){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e,n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this.parseParameterStatusMessage(e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData(e,n,i);default:return new t.DatabaseError("received invalid response: "+r.toString(16),n,"error")}}parseReadyForQueryMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.string(1);return new t.ReadyForQueryMessage(r,i)}parseCommandCompleteMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring();return new t.CommandCompleteMessage(r,i)}parseCopyData(e,r,n){let i=n.slice(e,e+(r-4));return new t.CopyDataMessage(r,i)}parseCopyInMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyInResponse")}parseCopyOutMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyOutResponse")}parseCopyMessage(e,r,n,i){this.reader.setBuffer(e,n);let s=0!==this.reader.byte(),o=this.reader.int16(),a=new t.CopyResponse(r,i,s,o);for(let e=0;e<o;e++)a.columnTypes[e]=this.reader.int16();return a}parseNotificationMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(r,i,s,o)}parseRowDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.RowDescriptionMessage(r,i);for(let e=0;e<i;e++)s.fields[e]=this.parseField();return s}parseField(){let e=this.reader.cstring(),r=this.reader.uint32(),n=this.reader.int16(),i=this.reader.uint32(),s=this.reader.int16(),o=this.reader.int32(),a=0===this.reader.int16()?"text":"binary";return new t.Field(e,r,n,i,s,o,a)}parseParameterDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.ParameterDescriptionMessage(r,i);for(let e=0;e<i;e++)s.dataTypeIDs[e]=this.reader.int32();return s}parseDataRowMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();s[e]=-1===t?null:this.reader.string(t)}return new t.DataRowMessage(r,s)}parseParameterStatusMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring(),s=this.reader.cstring();return new t.ParameterStatusMessage(r,i,s)}parseBackendKeyData(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.int32();return new t.BackendKeyDataMessage(r,i,s)}parseAuthenticationResponse(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s={name:"authenticationOk",length:r};switch(i){case 0:break;case 3:8===s.length&&(s.name="authenticationCleartextPassword");break;case 5:if(12===s.length){s.name="authenticationMD5Password";let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(r,e)}break;case 10:{let e;s.name="authenticationSASL",s.mechanisms=[];do(e=this.reader.cstring())&&s.mechanisms.push(e);while(e)}break;case 11:s.name="authenticationSASLContinue",s.data=this.reader.string(r-8);break;case 12:s.name="authenticationSASLFinal",s.data=this.reader.string(r-8);break;default:throw Error("Unknown authenticationOk message type "+i)}return s}parseErrorMessage(e,r,n,i){this.reader.setBuffer(e,n);let s={},o=this.reader.string(1);for(;"\0"!==o;)s[o]=this.reader.cstring(),o=this.reader.string(1);let a=s.M,u="notice"===i?new t.NoticeMessage(r,a):new t.DatabaseError(a,r,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u.position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s,u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u.routine=s.R,u}};_(i,"Parser"),e.Parser=i}),eV=E(e=>{I(),Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=eF();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:_(function(){return t.DatabaseError},"get")});var r=e$();Object.defineProperty(e,"serialize",{enumerable:!0,get:_(function(){return r.serialize},"get")});var n=eH();function i(e,t){let r=new n.Parser;return e.on("data",e=>r.parse(e,t)),new Promise(t=>e.on("end",()=>t()))}_(i,"parse"),e.parse=i}),eW={};function eQ({socket:e,servername:t}){return e.startTls(t),e}S(eW,{connect:()=>eQ});var eY=w(()=>{I(),_(eQ,"connect")}),eX=E((e,t)=>{I();var r=(U(),A(L)),n=N().EventEmitter,{parse:i,serialize:s}=eV(),o=s.flush(),a=s.sync(),u=s.end(),c=class extends n{constructor(e){super(),e=e||{},this.stream=e.stream||new r.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;var t=this;this.on("newListener",function(e){"message"===e&&(t._emitMessage=!0)})}connect(e,t){var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=_(function(e){n._ending&&("ECONNRESET"===e.code||"EPIPE"===e.code)||n.emit("error",e)},"reportStreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(e){switch(e.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",Error("There was an error establishing an SSL connection"))}var s=(eY(),A(eW));let o={socket:n.stream};!0!==n.ssl&&(Object.assign(o,n.ssl),"key"in n.ssl&&(o.key=n.ssl.key)),0===r.isIP(t)&&(o.servername=t);try{n.stream=s.connect(o)}catch(e){return n.emit("error",e)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{this.emit("end")}),i(e,e=>{var t="error"===e.name?"errorMessage":e.name;this._emitMessage&&this.emit("message",e),this.emit(t,e)})}requestSsl(){this.stream.write(s.requestSsl())}startup(e){this.stream.write(s.startup(e))}cancel(e,t){this._send(s.cancel(e,t))}password(e){this._send(s.password(e))}sendSASLInitialResponseMessage(e,t){this._send(s.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(s.sendSCRAMClientFinalMessage(e))}_send(e){return!!this.stream.writable&&this.stream.write(e)}query(e){this._send(s.query(e))}parse(e){this._send(s.parse(e))}bind(e){this._send(s.bind(e))}execute(e){this._send(s.execute(e))}flush(){this.stream.writable&&this.stream.write(o)}sync(){this._ending=!0,this._send(o),this._send(a)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){return(this._ending=!0,this._connecting&&this.stream.writable)?this.stream.write(u,()=>{this.stream.end()}):void this.stream.end()}close(e){this._send(s.close(e))}describe(e){this._send(s.describe(e))}sendCopyFromChunk(e){this._send(s.copyData(e))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(e){this._send(s.copyFail(e))}};_(c,"Connection"),t.exports=c}),ez=E((e,t)=>{I();var r=N().EventEmitter,n=(eg(),A(ed),ef()),i=em(),s=eN(),o=ee(),a=eB(),u=eU(),c=eh(),h=eX(),f=class extends r{constructor(e){super(),this.connectionParameters=new a(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||l.Promise,this._types=new o(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection=t.connection||new h({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||c.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=_(t=>{d.nextTick(()=>{t.handleError(e,this.connection)})},"enqueueError");this.activeQuery&&(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){var t=this,r=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error("Client has already been connected. You cannot reuse a client.");d.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{r._ending=!0,r.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){t.ssl?r.requestSsl():r.startup(t.getStartupConf())}),r.on("sslconnect",function(){r.startup(t.getStartupConf())}),this._attachListeners(r),r.once("end",()=>{let e=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),d.nextTick(()=>{this.emit("end")})})}connect(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;"function"==typeof this.password?this._Promise.resolve().then(()=>this.password()).then(r=>{if(void 0!==r){if("string"!=typeof r)return void t.emit("error",TypeError("Password must be a string"));this.connectionParameters.password=this.password=r}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit("error",e)}):null!==this.password?e():s(this.connectionParameters,t=>{void 0!==t&&(this.connectionParameters.password=this.password=t),e()})}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(()=>{let t=n.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{this.saslSession=i.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){i.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}_handleAuthSASLFinal(e){i.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t)return void this._handleErrorEvent(e);this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},r=e.application_name||e.fallback_application_name;return r&&(t.application_name=r),e.replication&&(t.replication=""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var r=this.connection;this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){r.cancel(e.processID,e.secretKey)})}else -1!==e.queryQueue.indexOf(t)&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,r){return this._types.setTypeParser(e,t,r)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,r="'",n=0;n<e.length;n++){var i=e[n];"'"===i?r+=i+i:"\\"===i?(r+=i+i,t=!0):r+=i}return r+="'",!0===t&&(r=" E"+r),r}_pulseQueryQueue(){if(!0===this.readyForQuery)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&d.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");return"function"==typeof e.submit?(s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(n.callback=n.callback||t)):(s=this.connectionParameters.query_timeout,(n=new u(e,t,r)).callback||(i=new this._Promise((e,t)=>{n.callback=(r,n)=>r?t(r):e(n)}))),s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");d.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this.queryQueue.indexOf(n);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?d.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"),this.connection)}):(this.queryQueue.push(n),this._pulseQueryQueue()):d.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),i}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(!e)return this._Promise.resolve();else e();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),!e)return new this._Promise(e=>{this.connection.once("end",e)});this.connection.once("end",e)}};_(f,"Client"),f.Query=u,t.exports=f}),eK=E((e,t)=>{I();var r=N().EventEmitter,n=_(function(){},"NOOP"),i=_((e,t)=>{let r=e.findIndex(t);return -1===r?void 0:e.splice(r,1)[0]},"removeWhere"),s=class{constructor(e,t,r){this.client=e,this.idleListener=t,this.timeoutId=r}};_(s,"IdleItem");var o=class{constructor(e){this.callback=e}};function a(){throw Error("Release called on client which has already been released to the pool.")}function u(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:_(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function c(e,t){return _(function r(n){n.client=t,t.removeListener("error",r),t.on("error",()=>{e.log("additional client error after disconnection due to error",n)}),e._remove(t),e.emit("error",n,t)},"idleListener")}_(o,"PendingItem"),_(a,"throwOnDoubleRelease"),_(u,"promisify"),_(c,"makeIdleListener");var f=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),null!=e&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),null!=e&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||t||e5().Client,this.Promise=this.options.Promise||l.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended)return void this.log("pulse queue ended");if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length)return void this.log("no queued requests");if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout(t.timeoutId);let r=t.client;r.ref&&r.ref();let n=t.idleListener;return this._acquireClient(r,e,n,!1)}if(!this._isFull())return this.newClient(e);throw Error("unexpected condition")}_remove(e){let t=i(this._idle,t=>t.client===e);void 0!==t&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(t=>t!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let t=Error("Cannot use a pool after calling end on the pool");return e?e(t):this.Promise.reject(t)}let t=u(this.Promise,e),r=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&d.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new o(t.callback)),r;let e=_((e,r,n)=>{clearTimeout(s),t.callback(e,r,n)},"queueCallback"),n=new o(e),s=setTimeout(()=>{i(this._pendingQueue,t=>t.callback===e),n.timedOut=!0,t.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(n),r}return this.newClient(new o(t.callback)),r}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let r=c(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy():t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect(a=>{if(i&&clearTimeout(i),t.on("error",r),a)this.log("client failed to connect",a),this._clients=this._clients.filter(e=>e!==t),s&&(a=Error("Connection terminated due to connection timeout",{cause:a})),this._pulseQueue(),e.timedOut||e.callback(a,void 0,n);else{if(this.log("new client connected"),0!==this.options.maxLifetimeSeconds){let e=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(t),-1!==this._idle.findIndex(e=>e.client===t)&&this._acquireClient(t,new o((e,t,r)=>r()),r,!1)},1e3*this.options.maxLifetimeSeconds);e.unref(),t.once("end",()=>clearTimeout(e))}return this._acquireClient(t,e,r,!0)}})}_acquireClient(e,t,r,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,r),e.removeListener("error",r),t.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,r=>{if(r)return e.release(r),t.callback(r,void 0,n);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let r=!1;return n=>{r&&a(),r=!0,this._release(e,t,n)}}_release(e,t,r){let n;if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",r,e),r||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e)){this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue();return}this.options.idleTimeoutMillis&&this._isAboveMin()&&(n=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&n.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new s(e,t,n)),this._pulseQueue()}query(e,t,r){if("function"==typeof e){let t=u(this.Promise,e);return h(function(){return t.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),t.result}"function"==typeof t&&(r=t,t=void 0);let n=u(this.Promise,r);return r=n.callback,this.connect((n,i)=>{if(n)return r(n);let s=!1,o=_(e=>{s||(s=!0,i.release(e),r(e))},"onError");i.once("error",o),this.log("dispatching query");try{i.query(e,t,(e,t)=>{if(this.log("query dispatched"),i.removeListener("error",o),!s)return s=!0,i.release(e),e?r(e):r(void 0,t)})}catch(e){return i.release(e),r(e)}}),n.result}end(e){if(this.log("ending"),this.ending){let t=Error("Called end on pool more than once");return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=u(this.Promise,e);return this._endCallback=t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+ +!!this._expired.has(t),0)}get totalCount(){return this._clients.length}};_(f,"Pool"),t.exports=f}),eJ={};S(eJ,{default:()=>eZ});var eZ,e0=w(()=>{I(),eZ={}}),e1=E((e,t)=>{t.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javascript & libpq with the same API",keywords:["database","libpq","pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/brianc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-postgres.git",directory:"packages/pg"},author:"Brian Carlson <brian.m.carlson@gmail.com>",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0","pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-types":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491a178655"}}),e2=E((e,t)=>{I();var r=N().EventEmitter,n=(eg(),A(ed)),i=ef(),s=t.exports=function(e,t,n){r.call(this),e=i.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state="new",this._arrayMode="array"===e.rowMode,this._emitRowEvents=!1,this.on("newListener",(function(e){"row"===e&&(this._emitRowEvents=!0)}).bind(this))};n.inherits(s,r);var o={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var r in t)e[o[r]||r]=t[r];this.callback?this.callback(e):this.emit("error",e),this.state="error"},s.prototype.then=function(e,t){return this._getPromise().then(e,t)},s.prototype.catch=function(e){return this._getPromise().catch(e)},s.prototype._getPromise=function(){return this._promise||(this._promise=new Promise((function(e,t){this._once("end",e),this._once("error",t)}).bind(this))),this._promise},s.prototype.submit=function(e){this.state="running";var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var r=_(function(r,n,i){if(e.native.arrayMode=!1,h(function(){t.emit("_done")}),r)return t.handleError(r);t._emitRowEvents&&(i.length>1?n.forEach((e,r)=>{e.forEach(e=>{t.emit("row",e,i[r])})}):n.forEach(function(e){t.emit("row",e,i)})),t.state="end",t.emit("end",i),t.callback&&t.callback(null,i)},"after");if(d.domain&&(r=d.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var n=(this.values||[]).map(i.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepa\
32
+ red statements must be unique - '${this.name}' was used for a different statement`);return r(e)}return e.native.execute(this.name,n,r)}return e.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,n,r))})}if(this.values){if(!Array.isArray(this.values)){let e=Error("Query values must be an array");return r(e)}var s=this.values.map(i.prepareValue);e.native.query(this.text,s,r)}else e.native.query(this.text,r)}}),e6=E((e,t)=>{I();var r=(e0(),A(eJ)),n=ee(),i=(e1(),N().EventEmitter),s=(eg(),A(ed)),o=eB(),a=e2(),u=t.exports=function(e){i.call(this),e=e||{},this._Promise=e.Promise||l.Promise,this._types=new n(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new o(e);this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};u.Query=a,s.inherits(u,i),u.prototype._errorAllQueries=function(e){let t=_(t=>{d.nextTick(()=>{t.native=this.native,t.handleError(e)})},"enqueueError");this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},u.prototype._connect=function(e){var t=this;if(this._connecting)return void d.nextTick(()=>e(Error("Client has already been connected. You cannot reuse a client.")));this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(r)return e(r);t.native.connect(n,function(r){if(r)return t.native.end(),e(r);t._connected=!0,t.native.on("error",function(e){t._queryable=!1,t._errorAllQueries(e),t.emit("error",e)}),t.native.on("notification",function(e){t.emit("notification",{channel:e.relname,payload:e.extra})}),t.emit("connect"),t._pulseQueryQueue(!0),e()})})},u.prototype.connect=function(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})},u.prototype.query=function(e,t,r){var n,i,s,o,u;if(null==e)throw TypeError("Client was passed a null or undefined query");if("function"==typeof e.submit)s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(e.callback=t);else if(s=this.connectionParameters.query_timeout,!(n=new a(e,t,r)).callback){let e,t;i=new this._Promise((r,n)=>{e=r,t=n}),n.callback=(r,n)=>r?t(r):e(n)}return s&&(u=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");d.nextTick(()=>{n.handleError(e,this.connection)}),u(e),n.callback=()=>{};var t=this._queryQueue.indexOf(n);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),u(e,t)}),this._queryable?this._ending?(n.native=this.native,d.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"))})):(this._queryQueue.push(n),this._pulseQueryQueue()):(n.native=this.native,d.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"))})),i},u.prototype.end=function(e){var t,r=this;return this._ending=!0,this._connected||this.once("connect",this.end.bind(this,e)),e||(t=new this._Promise(function(t,r){e=_(e=>e?r(e):t(),"cb")})),this.native.end(function(){r._errorAllQueries(Error("Connection terminated")),d.nextTick(()=>{r.emit("end"),e&&e()})}),t},u.prototype._hasActiveQuery=function(){return this._activeQuery&&"error"!==this._activeQuery.state&&"end"!==this._activeQuery.state},u.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit("drain");return}this._activeQuery=t,t.submit(this);var r=this;t.once("_done",function(){r._pulseQueryQueue()})}},u.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):-1!==this._queryQueue.indexOf(e)&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},u.prototype.ref=function(){},u.prototype.unref=function(){},u.prototype.setTypeParser=function(e,t,r){return this._types.setTypeParser(e,t,r)},u.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}}),e3=E((e,t)=>{I(),t.exports=e6()}),e5=E((e,t)=>{I();var r=ez(),n=eh(),i=eX(),s=eK(),{DatabaseError:o}=eV(),a=_(e=>{var t;return _(t=class extends s{constructor(t){super(t,e)}},"BoundPool"),t},"poolFactory"),u=_(function(e){this.defaults=n,this.Client=e,this.Query=this.Client.Query,this.Pool=a(this.Client),this._pools=[],this.Connection=i,this.types=Z(),this.DatabaseError=o},"PG");"u">typeof d.env.NODE_PG_FORCE_NATIVE?t.exports=new u(e3()):(t.exports=new u(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(e3())}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}}))});I(),I(),U(),$(),I();var e4=Object.defineProperty,e8=Object.defineProperties,e9=Object.getOwnPropertyDescriptors,e7=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable,tr=_((e,t,r)=>t in e?e4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),tn=_((e,t)=>{for(var r in t||(t={}))te.call(t,r)&&tr(e,r,t[r]);if(e7)for(var r of e7(t))tt.call(t,r)&&tr(e,r,t[r]);return e},"__spreadValues"),ti=_((e,t)=>e8(e,e9(t)),"__spreadProps"),ts=2===new Uint8Array(new Uint16Array([258]).buffer)[0],to=new TextDecoder,ta=new TextEncoder,tu=ta.encode("0123456789abcdef"),tc=ta.encode("0123456789ABCDEF"),tl=ta.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").slice();function th(e,{alphabet:t,scratchArr:r}={}){if(!i)if(i=new Uint16Array(256),s=new Uint16Array(256),ts)for(let e=0;e<256;e++)i[e]=tu[15&e]<<8|tu[e>>>4],s[e]=tc[15&e]<<8|tc[e>>>4];else for(let e=0;e<256;e++)i[e]=tu[15&e]|tu[e>>>4]<<8,s[e]=tc[15&e]|tc[e>>>4]<<8;e.byteOffset%4!=0&&(e=new Uint8Array(e));let n=e.length,o=n>>>2,a=r||new Uint16Array(n),u=new Uint32Array(e.buffer,e.byteOffset,o),c=new Uint32Array(a.buffer,a.byteOffset,n>>>1),l="upper"===t?s:i,h=0,f=0,d;if(ts)for(;h<o;)d=u[h++],c[f++]=l[d>>>8&255]<<16|l[255&d],c[f++]=l[d>>>24]<<16|l[d>>>16&255];else for(;h<o;)d=u[h++],c[f++]=l[d>>>24]<<16|l[d>>>16&255],c[f++]=l[d>>>8&255]<<16|l[255&d];for(h<<=2;h<n;)a[h]=l[e[h++]];return to.decode(a.subarray(0,n))}function tf(e,t={}){let r="",n=e.length,i=Math.ceil(n/504e3),s=new Uint16Array(i>1?504e3:n);for(let n=0;n<i;n++){let i=504e3*n,o=i+504e3;r+=th(e.subarray(i,o),ti(tn({},t),{scratchArr:s}))}return r}function td(e,t={}){return"upper"!==t.alphabet&&"function"==typeof e.toHex?e.toHex():tf(e,t)}tl[62]=45,tl[63]=95,_(th,"_toHex"),_(tf,"_toHexChunked"),_(td,"toHex"),I();var tp=class e{constructor(e,t){this.strings=e,this.values=t}toParameterizedQuery(t={query:"",params:[]}){let{strings:r,values:n}=this;for(let i=0,s=r.length;i<s;i++)if(t.query+=r[i],i<n.length){let r=n[i];if(r instanceof tm)t.query+=r.sql;else if(r instanceof tT)if(r.queryData instanceof e)r.queryData.toParameterizedQuery(t);else{if(r.queryData.params?.length)throw Error("This query is not composable");t.query+=r.queryData.query}else{let{params:e}=t;e.push(r),t.query+="$"+e.length,(r instanceof f||ArrayBuffer.isView(r))&&(t.query+="::bytea")}}return t}};_(tp,"SqlTemplate");var tg=class{constructor(e){this.sql=e}};_(tg,"UnsafeRawSql");var tm=tg;function ty(){}I(),_(ty,"warnIfBrowser"),U();var tb=x(ee()),tv=x(ef()),t_=class e extends Error{constructor(t){super(t),T(this,"name","NeonDbError"),T(this,"severity"),T(this,"code"),T(this,"detail"),T(this,"hint"),T(this,"position"),T(this,"internalPosition"),T(this,"internalQuery"),T(this,"where"),T(this,"schema"),T(this,"table"),T(this,"column"),T(this,"dataType"),T(this,"constraint"),T(this,"file"),T(this,"line"),T(this,"routine"),T(this,"sourceError"),"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}};_(t_,"NeonDbError");var tw="transaction() expects an array of queries, or a function returning an array of queries",tE=["severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine"];function tS(e){return e instanceof f?"\\x"+td(e):e}function tR(e){let{query:t,params:r}=e instanceof tp?e.toParameterizedQuery():e;return{query:t,params:r.map(e=>tS((0,tv.prepareValue)(e)))}}function tx(e,{arrayMode:t,fullResults:r,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,authToken:a,disableWarningInBrowsers:u}={}){let c;if(!e)throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?");try{c=q(e)}catch{throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(e))}let{protocol:l,username:h,hostname:f,port:d,pathname:p}=c;if("postgres:"!==l&&"postgresql:"!==l||!h||!f||!p)throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function g(e,...t){if(!(Array.isArray(e)&&Array.isArray(e.raw)&&Array.isArray(t)))throw Error('This function can now be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).');return new tT(m,new tp(e,t))}async function m(c,l,h){let p,{fetchEndpoint:g,fetchFunction:m}=j,y=Array.isArray(c)?{queries:c.map(e=>tR(e))}:tR(c),b=n??{},v=t??!1,_=r??!1,w=i,E=s,S=o;void 0!==h&&(void 0!==h.fetchOptions&&(b={...b,...h.fetchOptions}),void 0!==h.arrayMode&&(v=h.arrayMode),void 0!==h.fullResults&&(_=h.fullResults),void 0!==h.isolationLevel&&(w=h.isolationLevel),void 0!==h.readOnly&&(E=h.readOnly),void 0!==h.deferrable&&(S=h.deferrable)),void 0===l||Array.isArray(l)||void 0===l.fetchOptions||(b={...b,...l.fetchOptions});let R=a;Array.isArray(l)||l?.authToken===void 0||(R=l.authToken);let x="function"==typeof g?g(f,d,{jwtAuth:void 0!==R}):g,A={"Neon-Connection-String":e,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true"},T=await tO(R);T&&(A.Authorization=`Bearer ${T}`),Array.isArray(c)&&(void 0!==w&&(A["Neon-Batch-Isolation-Level"]=w),void 0!==E&&(A["Neon-Batch-Read-Only"]=String(E)),void 0!==S&&(A["Neon-Batch-Deferrable"]=String(S))),u||j.disableWarningInBrowsers||ty();try{p=await (m??fetch)(x,{method:"POST",body:JSON.stringify(y),headers:A,...b})}catch(t){let e=new t_(`Error connecting to database: ${t}`);throw e.sourceError=t,e}if(p.ok){let e=await p.json();if(Array.isArray(c)){let t=e.results;if(!Array.isArray(t))throw new t_("Neon internal error: unexpected result format");return t.map((e,t)=>{let r=l[t]??{};return tP(e,{arrayMode:r.arrayMode??v,fullResults:r.fullResults??_,types:r.types})})}{let t=l??{};return tP(e,{arrayMode:t.arrayMode??v,fullResults:t.fullResults??_,types:t.types})}}{let{status:e}=p;if(400===e){let e=await p.json(),t=new t_(e.message);for(let r of tE)t[r]=e[r]??void 0;throw t}{let t=await p.text();throw new t_(`Server error (HTTP status ${e}): ${t}`)}}}return _(g,"templateFn"),g.query=(e,t,r)=>new tT(m,{query:e,params:t??[]},r),g.unsafe=e=>new tm(e),g.transaction=async(e,t)=>{if("function"==typeof e&&(e=e(g)),!Array.isArray(e))throw Error(tw);return e.forEach(e=>{if(!(e instanceof tT))throw Error(tw)}),m(e.map(e=>e.queryData),e.map(e=>e.opts??{}),t)},_(m,"execute"),g}_(tS,"encodeBuffersAsBytea"),_(tR,"prepareQuery"),_(tx,"neon");var tA=class{constructor(e,t,r){this.execute=e,this.queryData=t,this.opts=r}then(e,t){return this.execute(this.queryData,this.opts).then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch(e)}finally(e){return this.execute(this.queryData,this.opts).finally(e)}};_(tA,"NeonQueryPromise");var tT=tA;function tP(e,{arrayMode:t,fullResults:r,types:n}){let i=new tb.default(n),s=e.fields.map(e=>e.name),o=e.fields.map(e=>i.getTypeParser(e.dataTypeID)),a=!0===t?e.rows.map(e=>e.map((e,t)=>null===e?null:o[t](e))):e.rows.map(e=>Object.fromEntries(e.map((e,t)=>[s[t],null===e?null:o[t](e)])));return r?(e.viaNeonFetch=!0,e.rowAsArray=t,e.rows=a,e._parsers=o,e._types=i,e):a}async function tO(e){if("string"==typeof e)return e;if("function"==typeof e)try{return await Promise.resolve(e())}catch(t){let e=new t_("Error getting auth token.");throw t instanceof Error&&(e=new t_(`Error getting auth token: ${t.message}`)),e}}_(tP,"processQueryResult"),_(tO,"getAuthToken"),I();var tC=x(e5());I();var tI=x(e5()),tN=class extends tI.Client{constructor(e){super(e),this.config=e}get neonConfig(){return this.connection.stream}connect(e){let{neonConfig:t}=this;t.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&t.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let r="string"!=typeof this.config&&this.config?.host!==void 0||"string"!=typeof this.config&&this.config?.connectionString!==void 0||void 0!==d.env.PGHOST,n=d.env.USER??d.env.USERNAME;if(!r&&"localhost"===this.host&&this.user===n&&this.database===n&&null===this.password)throw Error(`No database host or connection string wa\
33
33
  s set, and key parameters have default values (host: localhost, user: ${n}, db: ${n}, password: null\
34
34
  ). Is an environment variable missing? Alternatively, if you intended to connect with these paramete\
35
- rs, please set the host to 'localhost' explicitly.`);let i=super.connect(e),s=t.pipelineTLS&&this.ssl,o="password"===t.pipelineConnect;if(!s&&!t.pipelineConnect)return i;let a=this.connection;if(s&&a.on("connect",()=>a.stream.emit("data","S")),o){a.removeAllListeners("authenticationCleartextPassword"),a.removeAllListeners("readyForQuery"),a.once("readyForQuery",()=>a.on("readyForQuery",this._handleReadyForQuery.bind(this)));let e=this.ssl?"sslconnect":"connect";a.on(e,()=>{this.neonConfig.disableWarningInBrowsers||tm(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return i}async _handleAuthSASLContinue(e){if(typeof crypto>"u"||void 0===crypto.subtle||void 0===crypto.subtle.importKey)throw Error("Cannot use SASL auth when `crypto.subtle` is not defined");let t=crypto.subtle,r=this.saslSession,n=this.password,i=e.data;if("SASLInitialResponse"!==r.message||"string"!=typeof n||"string"!=typeof i)throw Error("SASL: protocol error");let s=Object.fromEntries(i.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]})),o=s.r,a=s.s,u=s.i;if(!o||!/^[!-+--~]+$/.test(o))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!a||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(a))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!u||!/^[1-9][0-9]*$/.test(u))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!o.startsWith(r.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(o.length===r.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let c=parseInt(u,10),l=h.from(a,"base64"),f=new TextEncoder,d=f.encode(n),p=await t.importKey("raw",d,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),g=new Uint8Array(await t.sign("HMAC",p,h.concat([l,h.from([0,0,0,1])]))),m=g;for(var y=0;y<c-1;y++)g=new Uint8Array(await t.sign("HMAC",p,g)),m=h.from(m.map((e,t)=>m[t]^g[t]));let b=m,v=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),_=new Uint8Array(await t.sign("HMAC",v,f.encode("Client Key"))),w=await t.digest("SHA-256",_),E="n=*,r="+r.clientNonce,S="r="+o+",s="+a+",i="+c,R="c=biws,r="+o,x=E+","+S+","+R,A=await t.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var T=new Uint8Array(await t.sign("HMAC",A,f.encode(x))),P=h.from(_.map((e,t)=>_[t]^T[t])).toString("base64");let O=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await t.sign("HMAC",O,f.encode("Server Key")),I=await t.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var N=h.from(await t.sign("HMAC",I,f.encode(x)));r.message="SASLResponse",r.serverSignature=N.toString("base64"),r.response=R+",p="+P,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};v(tI,"NeonClient"),j();var tN=R(ek());function tL(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:v(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t})}}v(tL,"promisify");var tM=class extends tO.Pool{constructor(){super(...arguments),A(this,"Client",tI),A(this,"hasFetchUnsupportedListeners",!1),A(this,"addListener",this.on)}on(e,t){return"error"!==e&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,r){if(!B.poolQueryViaFetch||this.hasFetchUnsupportedListeners||"function"==typeof e)return super.query(e,t,r);"function"==typeof t&&(r=t,t=void 0);let n=tL(this.Promise,r);r=n.callback;try{let n=new tN.default(this.options),i=encodeURIComponent,s=encodeURI,o=`postgresql://${i(n.user)}:${i(n.password)}@${i(n.host)}\
36
- /${s(n.database)}`,a="string"==typeof e?e:e.text,u=t??e.values??[];tR(o,{fullResults:!0,arrayMode:"array"===e.rowMode}).query(a,u,{types:e.types??this.options?.types}).then(e=>r(void 0,e)).catch(e=>r(e))}catch(e){r(e)}return n.result}};v(tM,"NeonPool"),j();var tD=R(e3());tD.DatabaseError,tD.defaults,tD.escapeIdentifier,tD.escapeLiteral;var tk=tD.types,tB=Object.defineProperty,tj={};((e,t)=>{for(var r in t)tB(e,r,{get:t[r],enumerable:!0})})(tj,{$:()=>tF,bgBlack:()=>t4,bgBlue:()=>re,bgCyan:()=>rr,bgGreen:()=>t9,bgMagenta:()=>rt,bgRed:()=>t8,bgWhite:()=>rn,bgYellow:()=>t7,black:()=>tz,blue:()=>t0,bold:()=>tG,cyan:()=>t2,dim:()=>tH,gray:()=>t3,green:()=>tJ,grey:()=>t5,hidden:()=>tY,inverse:()=>tQ,italic:()=>tV,magenta:()=>t1,red:()=>tK,reset:()=>t$,strikethrough:()=>tX,underline:()=>tW,white:()=>t6,yellow:()=>tZ});var tU=!0;"undefined"!=typeof process&&({FORCE_COLOR:s,NODE_DISABLE_COLORS:o,NO_COLOR:a,TERM:u}=process.env||{},tU=process.stdout&&process.stdout.isTTY);var tF={enabled:!o&&null==a&&"dumb"!==u&&(null!=s&&"0"!==s||tU)};function tq(e,t){let r=RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return tF.enabled&&null!=e?n+(~(""+e).indexOf(i)?e.replace(r,i+n):e)+i:e}}var t$=tq(0,0),tG=tq(1,22),tH=tq(2,22),tV=tq(3,23),tW=tq(4,24),tQ=tq(7,27),tY=tq(8,28),tX=tq(9,29),tz=tq(30,39),tK=tq(31,39),tJ=tq(32,39),tZ=tq(33,39),t0=tq(34,39),t1=tq(35,39),t2=tq(36,39),t6=tq(37,39),t3=tq(90,39),t5=tq(90,39),t4=tq(40,49),t8=tq(41,49),t9=tq(42,49),t7=tq(43,49),re=tq(44,49),rt=tq(45,49),rr=tq(46,49),rn=tq(47,49),ri=["green","yellow","blue","magenta","cyan","red"],rs=[],ro=Date.now(),ra=0,ru="undefined"!=typeof process?process.env:{};globalThis.DEBUG??=ru.DEBUG??"",globalThis.DEBUG_COLORS??=!ru.DEBUG_COLORS||"true"===ru.DEBUG_COLORS;var rc={enable(e){"string"==typeof e&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(t=>""!==t&&"-"!==t[0]&&e.match(RegExp(t.split("*").join(".*")+"$"))),n=t.some(t=>""!==t&&"-"===t[0]&&e.match(RegExp(t.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}},rl=new Proxy(function(e){let t={color:ri[ra++%ri.length],enabled:rc.enabled(e),namespace:e,log:rc.log,extend:()=>{}};return new Proxy((...e)=>{let{enabled:r,namespace:n,color:i,log:s}=t;if(0!==e.length&&rs.push([n,...e]),rs.length>100&&rs.shift(),rc.enabled(n)||r){let t=e.map(e=>"string"==typeof e?e:function(e,t=2){let r=new Set;return JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular *]";r.add(t)}else if("bigint"==typeof t)return t.toString();return t},t)}(e)),r=`+${Date.now()-ro}ms`;ro=Date.now(),globalThis.DEBUG_COLORS?s(tj[i](tG(n)),...t,tj[i](r)):s(n,...t,r)}},{get:(e,r)=>t[r],set:(e,r,n)=>t[r]=n})},{get:(e,t)=>rc[t],set:(e,t,r)=>rc[t]=r}),rh=class extends Error{name="DriverAdapterError";cause;constructor(e){super("string"==typeof e.message?e.message:e.kind),this.cause=e}};rl("driver-adapter-utils");var rf={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Text:7,Date:8,Time:9,DateTime:10,Json:11,Bytes:13,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,BytesArray:77,UuidArray:78};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose");var rd=e.i(81962),rp="@prisma/adapter-neon",{builtins:rg,getTypeParser:rm}=tk,ry={BIT_ARRAY:1561,BOOL_ARRAY:1e3,BYTEA_ARRAY:1001,BPCHAR_ARRAY:1014,CHAR_ARRAY:1002,CIDR_ARRAY:651,DATE_ARRAY:1182,FLOAT4_ARRAY:1021,FLOAT8_ARRAY:1022,INET_ARRAY:1041,INT2_ARRAY:1005,INT4_ARRAY:1007,INT8_ARRAY:1016,JSONB_ARRAY:3807,JSON_ARRAY:199,MONEY_ARRAY:791,NUMERIC_ARRAY:1231,OID_ARRAY:1028,TEXT_ARRAY:1009,TIMESTAMP_ARRAY:1115,TIME_ARRAY:1183,UUID_ARRAY:2951,VARBIT_ARRAY:1563,VARCHAR_ARRAY:1015,XML_ARRAY:143},rb=class e extends Error{static typeNames={16:"bool",17:"bytea",18:"char",19:"name",20:"int8",21:"int2",22:"int2vector",23:"int4",24:"regproc",25:"text",26:"oid",27:"tid",28:"xid",29:"cid",30:"oidvector",32:"pg_ddl_command",71:"pg_type",75:"pg_attribute",81:"pg_proc",83:"pg_class",114:"json",142:"xml",194:"pg_node_tree",269:"table_am_handler",325:"index_am_handler",600:"point",601:"lseg",602:"path",603:"box",604:"polygon",628:"line",650:"cidr",700:"float4",701:"float8",705:"unknown",718:"circle",774:"macaddr8",790:"money",829:"macaddr",869:"inet",1033:"aclitem",1042:"bpchar",1043:"varchar",1082:"date",1083:"time",1114:"timestamp",1184:"timestamptz",1186:"interval",1266:"timetz",1560:"bit",1562:"varbit",1700:"numeric",1790:"refcursor",2202:"regprocedure",2203:"regoper",2204:"regoperator",2205:"regclass",2206:"regtype",2249:"record",2275:"cstring",2276:"any",2277:"anyarray",2278:"void",2279:"trigger",2280:"language_handler",2281:"internal",2283:"anyelement",2287:"_record",2776:"anynonarray",2950:"uuid",2970:"txid_snapshot",3115:"fdw_handler",3220:"pg_lsn",3310:"tsm_handler",3361:"pg_ndistinct",3402:"pg_dependencies",3500:"anyenum",3614:"tsvector",3615:"tsquery",3642:"gtsvector",3734:"regconfig",3769:"regdictionary",3802:"jsonb",3831:"anyrange",3838:"event_trigger",3904:"int4range",3906:"numrange",3908:"tsrange",3910:"tstzrange",3912:"daterange",3926:"int8range",4072:"jsonpath",4089:"regnamespace",4096:"regrole",4191:"regcollation",4451:"int4multirange",4532:"nummultirange",4533:"tsmultirange",4534:"tstzmultirange",4535:"datemultirange",4536:"int8multirange",4537:"anymultirange",4538:"anycompatiblemultirange",4600:"pg_brin_bloom_summary",4601:"pg_brin_minmax_multi_summary",5017:"pg_mcv_list",5038:"pg_snapshot",5069:"xid8",5077:"anycompatible",5078:"anycompatiblearray",5079:"anycompatiblenonarray",5080:"anycompatiblerange"};type;constructor(t){super(),this.type=e.typeNames[t]||"Unknown",this.message=`Unsupported column type ${this.type}`}};function rv(e){return t=>(0,rd.parse)(t,e)}function r_(e){return e}function rw(e){return e}function rE(e){return new Date(`${e}Z`).toISOString().replace(/(\.000)?Z$/,"+00:00")}function rS(e){return e}function rR(e){return e.slice(1)}function rx(e){return e}function rA(e){return Array.from(new Uint8Array(e))}var rT=rm(rg.BYTEA),rP=rm(ry.BYTEA_ARRAY);function rO(e){return e}var rC={[rg.NUMERIC]:r_,[ry.NUMERIC_ARRAY]:rv(r_),[rg.TIME]:rS,[ry.TIME_ARRAY]:rv(rS),[rg.TIMETZ]:function(e){return e.replace(/[+-]\d{2}(:\d{2})?$/,"")},[rg.DATE]:rw,[ry.DATE_ARRAY]:rv(rw),[rg.TIMESTAMP]:rE,[ry.TIMESTAMP_ARRAY]:rv(rE),[rg.TIMESTAMPTZ]:function(e){return new Date(e.replace(/[+-]\d{2}(:\d{2})?$/,"Z")).toISOString().replace(/(\.000)?Z$/,"+00:00")},[rg.MONEY]:rR,[ry.MONEY_ARRAY]:rv(rR),[rg.JSON]:rx,[ry.JSON_ARRAY]:rv(rx),[rg.JSONB]:rx,[ry.JSONB_ARRAY]:rv(rx),[rg.BYTEA]:function(e){return rA(rT(e))},[ry.BYTEA_ARRAY]:function(e){return rP(e).map(e=>e?rA(e):null)},[ry.BIT_ARRAY]:rv(rO),[ry.VARBIT_ARRAY]:rv(rO),[ry.XML_ARRAY]:rv(function(e){return e})},rI=rl("prisma:driver-adapter:neon"),rN=class{provider="postgres";adapterName=rp;async queryRaw(e){rI("[js::query_raw] %O",e);let{fields:t,rows:r}=await this.performIO(e),n=t.map(e=>e.name),i=[];try{i=t.map(e=>(function(e){switch(e){case rg.INT2:case rg.INT4:return rf.Int32;case rg.INT8:return rf.Int64;case rg.FLOAT4:return rf.Float;case rg.FLOAT8:return rf.Double;case rg.BOOL:return rf.Boolean;case rg.DATE:return rf.Date;case rg.TIME:case rg.TIMETZ:return rf.Time;case rg.TIMESTAMP:case rg.TIMESTAMPTZ:return rf.DateTime;case rg.NUMERIC:case rg.MONEY:return rf.Numeric;case rg.JSON:case rg.JSONB:return rf.Json;case rg.UUID:return rf.Uuid;case rg.OID:return rf.Int64;case rg.BPCHAR:case rg.TEXT:case rg.VARCHAR:case rg.BIT:case rg.VARBIT:case rg.INET:case rg.CIDR:case rg.XML:return rf.Text;case rg.BYTEA:return rf.Bytes;case ry.INT2_ARRAY:case ry.INT4_ARRAY:return rf.Int32Array;case ry.FLOAT4_ARRAY:return rf.FloatArray;case ry.FLOAT8_ARRAY:return rf.DoubleArray;case ry.NUMERIC_ARRAY:case ry.MONEY_ARRAY:return rf.NumericArray;case ry.BOOL_ARRAY:return rf.BooleanArray;case ry.CHAR_ARRAY:return rf.CharacterArray;case ry.BPCHAR_ARRAY:case ry.TEXT_ARRAY:case ry.VARCHAR_ARRAY:case ry.VARBIT_ARRAY:case ry.BIT_ARRAY:case ry.INET_ARRAY:case ry.CIDR_ARRAY:case ry.XML_ARRAY:return rf.TextArray;case ry.DATE_ARRAY:return rf.DateArray;case ry.TIME_ARRAY:return rf.TimeArray;case ry.TIMESTAMP_ARRAY:return rf.DateTimeArray;case ry.JSON_ARRAY:case ry.JSONB_ARRAY:return rf.JsonArray;case ry.BYTEA_ARRAY:return rf.BytesArray;case ry.UUID_ARRAY:return rf.UuidArray;case ry.INT8_ARRAY:case ry.OID_ARRAY:return rf.Int64Array;default:if(e>=1e4)return rf.Text;throw new rb(e)}})(e.dataTypeID))}catch(e){if(e instanceof rb)throw new rh({kind:"UnsupportedNativeDataType",type:e.type});throw e}return{columnNames:n,columnTypes:i,rows:r}}async executeRaw(e){return rI("[js::execute_raw] %O",e),(await this.performIO(e)).rowCount??0}},rL=class extends rN{constructor(e){super(),this.client=e}async performIO(e){let{sql:t,args:r}=e;try{return await this.client.query({text:t,rowMode:"array",types:{getTypeParser:(e,t)=>"text"===t&&rC[e]?rC[e]:tk.getTypeParser(e,t)}},r.map((t,r)=>(function e(t,r){if(null===t)return null;if(Array.isArray(t)&&"list"===r.arity)return t.map(t=>e(t,r));if("string"==typeof t&&"datetime"===r.scalarType&&(t=new Date(t)),t instanceof Date)switch(r.dbType){case"TIME":case"TIMETZ":var n=t;let i=(e,t=2)=>String(e).padStart(t,"0"),s=n.getUTCMilliseconds();return i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+(s?"."+String(s).padStart(3,"0"):"");case"DATE":var o=t;let a=(e,t=2)=>String(e).padStart(t,"0");return o.getUTCFullYear()+"-"+a(o.getUTCMonth()+1)+"-"+a(o.getUTCDate());default:var u=t;let c=(e,t=2)=>String(e).padStart(t,"0"),l=u.getUTCMilliseconds();return u.getUTCFullYear()+"-"+c(u.getUTCMonth()+1)+"-"+c(u.getUTCDate())+" "+c(u.getUTCHours())+":"+c(u.getUTCMinutes())+":"+c(u.getUTCSeconds())+(l?"."+String(l).padStart(3,"0"):"")}return"string"==typeof t&&"bytes"===r.scalarType?Buffer.from(t,"base64"):Array.isArray(t)&&"bytes"===r.scalarType?Buffer.from(t):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):t})(t,e.argTypes[r])))}catch(e){this.onError(e)}}onError(e){throw rI("Error in onError: %O",e),new rh(function(e){var t;if("string"==typeof(t=e).code&&"string"==typeof t.message&&"string"==typeof t.severity&&("string"==typeof t.detail||void 0===t.detail)&&("string"==typeof t.column||void 0===t.column)&&("string"==typeof t.hint||void 0===t.hint))return{originalCode:e.code,originalMessage:e.message,...function(e){switch(e.code){case"22001":return{kind:"LengthMismatch",column:e.column};case"22003":return{kind:"ValueOutOfRange",cause:e.message};case"23505":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"UniqueConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23502":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"NullConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23503":{let t;return e.column?t={fields:[e.column]}:e.constraint&&(t={index:e.constraint}),{kind:"ForeignKeyConstraintViolation",constraint:t}}case"3D000":return{kind:"DatabaseDoesNotExist",db:e.message.split(" ").at(1)?.split('"').at(1)};case"28000":return{kind:"DatabaseAccessDenied",db:e.message.split(",").find(e=>e.startsWith(" database"))?.split('"').at(1)};case"28P01":return{kind:"AuthenticationFailed",user:e.message.split(" ").pop()?.split('"').at(1)};case"40001":return{kind:"TransactionWriteConflict"};case"42P01":return{kind:"TableDoesNotExist",table:e.message.split(" ").at(1)?.split('"').at(1)};case"42703":return{kind:"ColumnNotFound",column:e.message.split(" ").at(1)?.split('"').at(1)};case"42P04":return{kind:"DatabaseAlreadyExists",db:e.message.split(" ").at(1)?.split('"').at(1)};case"53300":return{kind:"TooManyConnections",cause:e.message};default:return{kind:"postgres",code:e.code??"N/A",severity:e.severity??"N/A",message:e.message,detail:e.detail,column:e.column,hint:e.hint}}}(e)};throw e}(e))}},rM=class extends rL{constructor(e,t){super(e),this.options=t}async commit(){rI("[js::commit]"),this.client.release()}async rollback(){rI("[js::rollback]"),this.client.release()}},rD=class extends rL{constructor(e,t){super(e),this.options=t}isRunning=!0;executeScript(e){throw Error("Not implemented yet")}async startTransaction(e){let t={usePhantomQuery:!1};rI("%s options: %O","[js::startTransaction]",t);let r=await this.client.connect().catch(e=>this.onError(e));r.on("error",e=>{rI(`Error from pool connection: ${e.message} %O`,e),this.options?.onConnectionError?.(e)});try{let n=new rM(r,t);return await n.executeRaw({sql:"BEGIN",args:[],argTypes:[]}),e&&await n.executeRaw({sql:`SET TRANSACTION ISOLATION LEVEL ${e}`,args:[],argTypes:[]}),n}catch(e){r.release(e),this.onError(e)}}getConnectionInfo(){return{schemaName:this.options?.schema,supportsRelationJoins:!0}}async dispose(){this.isRunning&&(await this.client.end(),this.isRunning=!1)}underlyingDriver(){return this.client}},rk=class{constructor(e,t){this.config=e,this.options=t}provider="postgres";adapterName=rp;async connect(){let e=new tM(this.config);return e.on("error",e=>{rI(`Error from pool client: ${e.message} %O`,e),this.options?.onPoolError?.(e)}),new rD(e,this.options)}},rB=e.i(29173);let rj=Symbol.for("superinterface.server.prisma"),rU=()=>{let e=globalThis;if(e[rj])return e[rj];if(e.prisma)return e[rj]=e.prisma,e.prisma;let r=(()=>{if(t)return t();let e=new rk({connectionString:`${process.env.DATABASE_URL}`});return new rB.PrismaClient({adapter:e,transactionOptions:{timeout:15e3}})})();return e[rj]=r,e.prisma||(e.prisma=r),r},rF=()=>rU();new Proxy({},{get(e,t,n){let i=r??(r=rF()),s=Reflect.get(i,t,n);return"function"==typeof s?s.bind(i):s},set:(e,t,n,i)=>Reflect.set(r??(r=rF()),t,n,i),has:(e,t)=>Reflect.has(r??(r=rF()),t),ownKeys:()=>Reflect.ownKeys(r??(r=rF())),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(r??(r=rF()),t)});let rq=e=>{if(e){let t=globalThis;return t[rj]=e,t.prisma||(t.prisma=e),r=e,e}return rU()}},55897,e=>{"use strict";e.s(["validate",()=>r],55897);let t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,r=function(e){return"string"==typeof e&&t.test(e)}}];
35
+ rs, please set the host to 'localhost' explicitly.`);let i=super.connect(e),s=t.pipelineTLS&&this.ssl,o="password"===t.pipelineConnect;if(!s&&!t.pipelineConnect)return i;let a=this.connection;if(s&&a.on("connect",()=>a.stream.emit("data","S")),o){a.removeAllListeners("authenticationCleartextPassword"),a.removeAllListeners("readyForQuery"),a.once("readyForQuery",()=>a.on("readyForQuery",this._handleReadyForQuery.bind(this)));let e=this.ssl?"sslconnect":"connect";a.on(e,()=>{this.neonConfig.disableWarningInBrowsers||ty(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return i}async _handleAuthSASLContinue(e){if(typeof crypto>"u"||void 0===crypto.subtle||void 0===crypto.subtle.importKey)throw Error("Cannot use SASL auth when `crypto.subtle` is not defined");let t=crypto.subtle,r=this.saslSession,n=this.password,i=e.data;if("SASLInitialResponse"!==r.message||"string"!=typeof n||"string"!=typeof i)throw Error("SASL: protocol error");let s=Object.fromEntries(i.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]})),o=s.r,a=s.s,u=s.i;if(!o||!/^[!-+--~]+$/.test(o))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!a||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(a))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!u||!/^[1-9][0-9]*$/.test(u))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!o.startsWith(r.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(o.length===r.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let c=parseInt(u,10),l=f.from(a,"base64"),h=new TextEncoder,d=h.encode(n),p=await t.importKey("raw",d,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),g=new Uint8Array(await t.sign("HMAC",p,f.concat([l,f.from([0,0,0,1])]))),m=g;for(var y=0;y<c-1;y++)g=new Uint8Array(await t.sign("HMAC",p,g)),m=f.from(m.map((e,t)=>m[t]^g[t]));let b=m,v=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),_=new Uint8Array(await t.sign("HMAC",v,h.encode("Client Key"))),w=await t.digest("SHA-256",_),E="n=*,r="+r.clientNonce,S="r="+o+",s="+a+",i="+c,R="c=biws,r="+o,x=E+","+S+","+R,A=await t.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var T=new Uint8Array(await t.sign("HMAC",A,h.encode(x))),P=f.from(_.map((e,t)=>_[t]^T[t])).toString("base64");let O=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await t.sign("HMAC",O,h.encode("Server Key")),I=await t.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var N=f.from(await t.sign("HMAC",I,h.encode(x)));r.message="SASLResponse",r.serverSignature=N.toString("base64"),r.response=R+",p="+P,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};_(tN,"NeonClient"),U();var tL=x(eB());function tM(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:_(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t})}}_(tM,"promisify");var tD=class extends tC.Pool{constructor(){super(...arguments),T(this,"Client",tN),T(this,"hasFetchUnsupportedListeners",!1),T(this,"addListener",this.on)}on(e,t){return"error"!==e&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,r){if(!j.poolQueryViaFetch||this.hasFetchUnsupportedListeners||"function"==typeof e)return super.query(e,t,r);"function"==typeof t&&(r=t,t=void 0);let n=tM(this.Promise,r);r=n.callback;try{let n=new tL.default(this.options),i=encodeURIComponent,s=encodeURI,o=`postgresql://${i(n.user)}:${i(n.password)}@${i(n.host)}\
36
+ /${s(n.database)}`,a="string"==typeof e?e:e.text,u=t??e.values??[];tx(o,{fullResults:!0,arrayMode:"array"===e.rowMode}).query(a,u,{types:e.types??this.options?.types}).then(e=>r(void 0,e)).catch(e=>r(e))}catch(e){r(e)}return n.result}};_(tD,"NeonPool"),U();var tk=x(e5());tk.DatabaseError,tk.defaults,tk.escapeIdentifier,tk.escapeLiteral;var tB=tk.types,tj=Object.defineProperty,tU={};((e,t)=>{for(var r in t)tj(e,r,{get:t[r],enumerable:!0})})(tU,{$:()=>tq,bgBlack:()=>t8,bgBlue:()=>rt,bgCyan:()=>rn,bgGreen:()=>t7,bgMagenta:()=>rr,bgRed:()=>t9,bgWhite:()=>ri,bgYellow:()=>re,black:()=>tK,blue:()=>t1,bold:()=>tH,cyan:()=>t6,dim:()=>tV,gray:()=>t5,green:()=>tZ,grey:()=>t4,hidden:()=>tX,inverse:()=>tY,italic:()=>tW,magenta:()=>t2,red:()=>tJ,reset:()=>tG,strikethrough:()=>tz,underline:()=>tQ,white:()=>t3,yellow:()=>t0});var tF=!0;"undefined"!=typeof process&&({FORCE_COLOR:o,NODE_DISABLE_COLORS:a,NO_COLOR:u,TERM:c}=process.env||{},tF=process.stdout&&process.stdout.isTTY);var tq={enabled:!a&&null==u&&"dumb"!==c&&(null!=o&&"0"!==o||tF)};function t$(e,t){let r=RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return tq.enabled&&null!=e?n+(~(""+e).indexOf(i)?e.replace(r,i+n):e)+i:e}}var tG=t$(0,0),tH=t$(1,22),tV=t$(2,22),tW=t$(3,23),tQ=t$(4,24),tY=t$(7,27),tX=t$(8,28),tz=t$(9,29),tK=t$(30,39),tJ=t$(31,39),tZ=t$(32,39),t0=t$(33,39),t1=t$(34,39),t2=t$(35,39),t6=t$(36,39),t3=t$(37,39),t5=t$(90,39),t4=t$(90,39),t8=t$(40,49),t9=t$(41,49),t7=t$(42,49),re=t$(43,49),rt=t$(44,49),rr=t$(45,49),rn=t$(46,49),ri=t$(47,49),rs=["green","yellow","blue","magenta","cyan","red"],ro=[],ra=Date.now(),ru=0,rc="undefined"!=typeof process?process.env:{};globalThis.DEBUG??=rc.DEBUG??"",globalThis.DEBUG_COLORS??=!rc.DEBUG_COLORS||"true"===rc.DEBUG_COLORS;var rl={enable(e){"string"==typeof e&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(t=>""!==t&&"-"!==t[0]&&e.match(RegExp(t.split("*").join(".*")+"$"))),n=t.some(t=>""!==t&&"-"===t[0]&&e.match(RegExp(t.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}},rh=new Proxy(function(e){let t={color:rs[ru++%rs.length],enabled:rl.enabled(e),namespace:e,log:rl.log,extend:()=>{}};return new Proxy((...e)=>{let{enabled:r,namespace:n,color:i,log:s}=t;if(0!==e.length&&ro.push([n,...e]),ro.length>100&&ro.shift(),rl.enabled(n)||r){let t=e.map(e=>"string"==typeof e?e:function(e,t=2){let r=new Set;return JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular *]";r.add(t)}else if("bigint"==typeof t)return t.toString();return t},t)}(e)),r=`+${Date.now()-ra}ms`;ra=Date.now(),globalThis.DEBUG_COLORS?s(tU[i](tH(n)),...t,tU[i](r)):s(n,...t,r)}},{get:(e,r)=>t[r],set:(e,r,n)=>t[r]=n})},{get:(e,t)=>rl[t],set:(e,t,r)=>rl[t]=r}),rf=class extends Error{name="DriverAdapterError";cause;constructor(e){super("string"==typeof e.message?e.message:e.kind),this.cause=e}};rh("driver-adapter-utils");var rd={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Text:7,Date:8,Time:9,DateTime:10,Json:11,Bytes:13,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,BytesArray:77,UuidArray:78};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose");var rp=e.i(81962),rg="@prisma/adapter-neon",{builtins:rm,getTypeParser:ry}=tB,rb={BIT_ARRAY:1561,BOOL_ARRAY:1e3,BYTEA_ARRAY:1001,BPCHAR_ARRAY:1014,CHAR_ARRAY:1002,CIDR_ARRAY:651,DATE_ARRAY:1182,FLOAT4_ARRAY:1021,FLOAT8_ARRAY:1022,INET_ARRAY:1041,INT2_ARRAY:1005,INT4_ARRAY:1007,INT8_ARRAY:1016,JSONB_ARRAY:3807,JSON_ARRAY:199,MONEY_ARRAY:791,NUMERIC_ARRAY:1231,OID_ARRAY:1028,TEXT_ARRAY:1009,TIMESTAMP_ARRAY:1115,TIME_ARRAY:1183,UUID_ARRAY:2951,VARBIT_ARRAY:1563,VARCHAR_ARRAY:1015,XML_ARRAY:143},rv=class e extends Error{static typeNames={16:"bool",17:"bytea",18:"char",19:"name",20:"int8",21:"int2",22:"int2vector",23:"int4",24:"regproc",25:"text",26:"oid",27:"tid",28:"xid",29:"cid",30:"oidvector",32:"pg_ddl_command",71:"pg_type",75:"pg_attribute",81:"pg_proc",83:"pg_class",114:"json",142:"xml",194:"pg_node_tree",269:"table_am_handler",325:"index_am_handler",600:"point",601:"lseg",602:"path",603:"box",604:"polygon",628:"line",650:"cidr",700:"float4",701:"float8",705:"unknown",718:"circle",774:"macaddr8",790:"money",829:"macaddr",869:"inet",1033:"aclitem",1042:"bpchar",1043:"varchar",1082:"date",1083:"time",1114:"timestamp",1184:"timestamptz",1186:"interval",1266:"timetz",1560:"bit",1562:"varbit",1700:"numeric",1790:"refcursor",2202:"regprocedure",2203:"regoper",2204:"regoperator",2205:"regclass",2206:"regtype",2249:"record",2275:"cstring",2276:"any",2277:"anyarray",2278:"void",2279:"trigger",2280:"language_handler",2281:"internal",2283:"anyelement",2287:"_record",2776:"anynonarray",2950:"uuid",2970:"txid_snapshot",3115:"fdw_handler",3220:"pg_lsn",3310:"tsm_handler",3361:"pg_ndistinct",3402:"pg_dependencies",3500:"anyenum",3614:"tsvector",3615:"tsquery",3642:"gtsvector",3734:"regconfig",3769:"regdictionary",3802:"jsonb",3831:"anyrange",3838:"event_trigger",3904:"int4range",3906:"numrange",3908:"tsrange",3910:"tstzrange",3912:"daterange",3926:"int8range",4072:"jsonpath",4089:"regnamespace",4096:"regrole",4191:"regcollation",4451:"int4multirange",4532:"nummultirange",4533:"tsmultirange",4534:"tstzmultirange",4535:"datemultirange",4536:"int8multirange",4537:"anymultirange",4538:"anycompatiblemultirange",4600:"pg_brin_bloom_summary",4601:"pg_brin_minmax_multi_summary",5017:"pg_mcv_list",5038:"pg_snapshot",5069:"xid8",5077:"anycompatible",5078:"anycompatiblearray",5079:"anycompatiblenonarray",5080:"anycompatiblerange"};type;constructor(t){super(),this.type=e.typeNames[t]||"Unknown",this.message=`Unsupported column type ${this.type}`}};function r_(e){return t=>(0,rp.parse)(t,e)}function rw(e){return e}function rE(e){return e}function rS(e){return new Date(`${e}Z`).toISOString().replace(/(\.000)?Z$/,"+00:00")}function rR(e){return e}function rx(e){return e.slice(1)}function rA(e){return e}function rT(e){return Array.from(new Uint8Array(e))}var rP=ry(rm.BYTEA),rO=ry(rb.BYTEA_ARRAY);function rC(e){return e}var rI={[rm.NUMERIC]:rw,[rb.NUMERIC_ARRAY]:r_(rw),[rm.TIME]:rR,[rb.TIME_ARRAY]:r_(rR),[rm.TIMETZ]:function(e){return e.replace(/[+-]\d{2}(:\d{2})?$/,"")},[rm.DATE]:rE,[rb.DATE_ARRAY]:r_(rE),[rm.TIMESTAMP]:rS,[rb.TIMESTAMP_ARRAY]:r_(rS),[rm.TIMESTAMPTZ]:function(e){return new Date(e.replace(/[+-]\d{2}(:\d{2})?$/,"Z")).toISOString().replace(/(\.000)?Z$/,"+00:00")},[rm.MONEY]:rx,[rb.MONEY_ARRAY]:r_(rx),[rm.JSON]:rA,[rb.JSON_ARRAY]:r_(rA),[rm.JSONB]:rA,[rb.JSONB_ARRAY]:r_(rA),[rm.BYTEA]:function(e){return rT(rP(e))},[rb.BYTEA_ARRAY]:function(e){return rO(e).map(e=>e?rT(e):null)},[rb.BIT_ARRAY]:r_(rC),[rb.VARBIT_ARRAY]:r_(rC),[rb.XML_ARRAY]:r_(function(e){return e})},rN=rh("prisma:driver-adapter:neon"),rL=class{provider="postgres";adapterName=rg;async queryRaw(e){rN("[js::query_raw] %O",e);let{fields:t,rows:r}=await this.performIO(e),n=t.map(e=>e.name),i=[];try{i=t.map(e=>(function(e){switch(e){case rm.INT2:case rm.INT4:return rd.Int32;case rm.INT8:return rd.Int64;case rm.FLOAT4:return rd.Float;case rm.FLOAT8:return rd.Double;case rm.BOOL:return rd.Boolean;case rm.DATE:return rd.Date;case rm.TIME:case rm.TIMETZ:return rd.Time;case rm.TIMESTAMP:case rm.TIMESTAMPTZ:return rd.DateTime;case rm.NUMERIC:case rm.MONEY:return rd.Numeric;case rm.JSON:case rm.JSONB:return rd.Json;case rm.UUID:return rd.Uuid;case rm.OID:return rd.Int64;case rm.BPCHAR:case rm.TEXT:case rm.VARCHAR:case rm.BIT:case rm.VARBIT:case rm.INET:case rm.CIDR:case rm.XML:return rd.Text;case rm.BYTEA:return rd.Bytes;case rb.INT2_ARRAY:case rb.INT4_ARRAY:return rd.Int32Array;case rb.FLOAT4_ARRAY:return rd.FloatArray;case rb.FLOAT8_ARRAY:return rd.DoubleArray;case rb.NUMERIC_ARRAY:case rb.MONEY_ARRAY:return rd.NumericArray;case rb.BOOL_ARRAY:return rd.BooleanArray;case rb.CHAR_ARRAY:return rd.CharacterArray;case rb.BPCHAR_ARRAY:case rb.TEXT_ARRAY:case rb.VARCHAR_ARRAY:case rb.VARBIT_ARRAY:case rb.BIT_ARRAY:case rb.INET_ARRAY:case rb.CIDR_ARRAY:case rb.XML_ARRAY:return rd.TextArray;case rb.DATE_ARRAY:return rd.DateArray;case rb.TIME_ARRAY:return rd.TimeArray;case rb.TIMESTAMP_ARRAY:return rd.DateTimeArray;case rb.JSON_ARRAY:case rb.JSONB_ARRAY:return rd.JsonArray;case rb.BYTEA_ARRAY:return rd.BytesArray;case rb.UUID_ARRAY:return rd.UuidArray;case rb.INT8_ARRAY:case rb.OID_ARRAY:return rd.Int64Array;default:if(e>=1e4)return rd.Text;throw new rv(e)}})(e.dataTypeID))}catch(e){if(e instanceof rv)throw new rf({kind:"UnsupportedNativeDataType",type:e.type});throw e}return{columnNames:n,columnTypes:i,rows:r}}async executeRaw(e){return rN("[js::execute_raw] %O",e),(await this.performIO(e)).rowCount??0}},rM=class extends rL{constructor(e){super(),this.client=e}async performIO(e){let{sql:t,args:r}=e;try{return await this.client.query({text:t,rowMode:"array",types:{getTypeParser:(e,t)=>"text"===t&&rI[e]?rI[e]:tB.getTypeParser(e,t)}},r.map((t,r)=>(function e(t,r){if(null===t)return null;if(Array.isArray(t)&&"list"===r.arity)return t.map(t=>e(t,r));if("string"==typeof t&&"datetime"===r.scalarType&&(t=new Date(t)),t instanceof Date)switch(r.dbType){case"TIME":case"TIMETZ":var n=t;let i=(e,t=2)=>String(e).padStart(t,"0"),s=n.getUTCMilliseconds();return i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+(s?"."+String(s).padStart(3,"0"):"");case"DATE":var o=t;let a=(e,t=2)=>String(e).padStart(t,"0");return o.getUTCFullYear()+"-"+a(o.getUTCMonth()+1)+"-"+a(o.getUTCDate());default:var u=t;let c=(e,t=2)=>String(e).padStart(t,"0"),l=u.getUTCMilliseconds();return u.getUTCFullYear()+"-"+c(u.getUTCMonth()+1)+"-"+c(u.getUTCDate())+" "+c(u.getUTCHours())+":"+c(u.getUTCMinutes())+":"+c(u.getUTCSeconds())+(l?"."+String(l).padStart(3,"0"):"")}return"string"==typeof t&&"bytes"===r.scalarType?Buffer.from(t,"base64"):Array.isArray(t)&&"bytes"===r.scalarType?Buffer.from(t):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):t})(t,e.argTypes[r])))}catch(e){this.onError(e)}}onError(e){throw rN("Error in onError: %O",e),new rf(function(e){var t;if("string"==typeof(t=e).code&&"string"==typeof t.message&&"string"==typeof t.severity&&("string"==typeof t.detail||void 0===t.detail)&&("string"==typeof t.column||void 0===t.column)&&("string"==typeof t.hint||void 0===t.hint))return{originalCode:e.code,originalMessage:e.message,...function(e){switch(e.code){case"22001":return{kind:"LengthMismatch",column:e.column};case"22003":return{kind:"ValueOutOfRange",cause:e.message};case"23505":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"UniqueConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23502":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"NullConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23503":{let t;return e.column?t={fields:[e.column]}:e.constraint&&(t={index:e.constraint}),{kind:"ForeignKeyConstraintViolation",constraint:t}}case"3D000":return{kind:"DatabaseDoesNotExist",db:e.message.split(" ").at(1)?.split('"').at(1)};case"28000":return{kind:"DatabaseAccessDenied",db:e.message.split(",").find(e=>e.startsWith(" database"))?.split('"').at(1)};case"28P01":return{kind:"AuthenticationFailed",user:e.message.split(" ").pop()?.split('"').at(1)};case"40001":return{kind:"TransactionWriteConflict"};case"42P01":return{kind:"TableDoesNotExist",table:e.message.split(" ").at(1)?.split('"').at(1)};case"42703":return{kind:"ColumnNotFound",column:e.message.split(" ").at(1)?.split('"').at(1)};case"42P04":return{kind:"DatabaseAlreadyExists",db:e.message.split(" ").at(1)?.split('"').at(1)};case"53300":return{kind:"TooManyConnections",cause:e.message};default:return{kind:"postgres",code:e.code??"N/A",severity:e.severity??"N/A",message:e.message,detail:e.detail,column:e.column,hint:e.hint}}}(e)};throw e}(e))}},rD=class extends rM{constructor(e,t){super(e),this.options=t}async commit(){rN("[js::commit]"),this.client.release()}async rollback(){rN("[js::rollback]"),this.client.release()}},rk=class extends rM{constructor(e,t){super(e),this.options=t}isRunning=!0;executeScript(e){throw Error("Not implemented yet")}async startTransaction(e){let t={usePhantomQuery:!1};rN("%s options: %O","[js::startTransaction]",t);let r=await this.client.connect().catch(e=>this.onError(e));r.on("error",e=>{rN(`Error from pool connection: ${e.message} %O`,e),this.options?.onConnectionError?.(e)});try{let n=new rD(r,t);return await n.executeRaw({sql:"BEGIN",args:[],argTypes:[]}),e&&await n.executeRaw({sql:`SET TRANSACTION ISOLATION LEVEL ${e}`,args:[],argTypes:[]}),n}catch(e){r.release(e),this.onError(e)}}getConnectionInfo(){return{schemaName:this.options?.schema,supportsRelationJoins:!0}}async dispose(){this.isRunning&&(await this.client.end(),this.isRunning=!1)}underlyingDriver(){return this.client}},rB=class{constructor(e,t){this.config=e,this.options=t}provider="postgres";adapterName=rg;async connect(){let e=new tD(this.config);return e.on("error",e=>{rN(`Error from pool client: ${e.message} %O`,e),this.options?.onPoolError?.(e)}),new rk(e,this.options)}},rj=e.i(29173);let rU=Symbol.for("superinterface.server.prisma"),rF=()=>{let e=globalThis;if(e[rU])return e[rU];if(e.prisma)return e[rU]=e.prisma,e.prisma;let n=(()=>{if(t)return t();let e=`${process.env.DATABASE_URL}`;return r||(r=new rB({connectionString:e})),new rj.PrismaClient({adapter:r,transactionOptions:{timeout:15e3}})})();return e[rU]=n,e.prisma||(e.prisma=n),n},rq=()=>rF();new Proxy({},{get(e,t,r){let i=n??(n=rq()),s=Reflect.get(i,t,r);return"function"==typeof s?s.bind(i):s},set:(e,t,r,i)=>Reflect.set(n??(n=rq()),t,r,i),has:(e,t)=>Reflect.has(n??(n=rq()),t),ownKeys:()=>Reflect.ownKeys(n??(n=rq())),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(n??(n=rq()),t)});let r$=e=>{if(e){let t=globalThis;return t[rU]=e,t.prisma||(t.prisma=e),n=e,e}return rF()}},55897,e=>{"use strict";e.s(["validate",()=>r],55897);let t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,r=function(e){return"string"==typeof e&&t.test(e)}}];
37
37
 
38
38
  //# sourceMappingURL=%5Broot-of-the-server%5D__6b8ba839._.js.map