super-time-tracker-ui 0.1.39 → 0.1.41
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.
- package/README.md +88 -88
- package/bin/stt-ui.js +220 -220
- package/dist/standalone/next-output/BUILD_ID +1 -1
- package/dist/standalone/next-output/build-manifest.json +5 -5
- package/dist/standalone/next-output/server/app/_global-error/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/_global-error/page.js +1 -1
- package/dist/standalone/next-output/server/app/_global-error/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/_global-error.html +1 -1
- package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/_not-found/page.js +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/api/auth/signout/route.js +1 -1
- package/dist/standalone/next-output/server/app/api/auth/signout/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/api/sync/import/route.js +1 -1
- package/dist/standalone/next-output/server/app/api/sync/import/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js +1 -1
- package/dist/standalone/next-output/server/app/api/sync/merge-on-load/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/api/sync/pull/route.js +1 -1
- package/dist/standalone/next-output/server/app/api/sync/pull/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/api/sync/push/route.js +1 -1
- package/dist/standalone/next-output/server/app/api/sync/push/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/auth/callback/route.js +1 -1
- package/dist/standalone/next-output/server/app/auth/callback/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/favicon.ico/route.js +1 -1
- package/dist/standalone/next-output/server/app/favicon.ico/route.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/login/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/login/page.js +1 -1
- package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/offline/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/offline/page.js +1 -1
- package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/page.js +1 -1
- package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/pomodoro/page.js +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/register/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/register/page.js +1 -1
- package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/reporting/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/reporting/page.js +1 -1
- package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/search/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/search/page.js +1 -1
- package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/data/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/display/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/goals/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/notifications/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/pomodoro/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/quick-actions/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/settings/tags/page.js +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/sheets/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/sheets/page.js +1 -1
- package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/today/page/build-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/today/page.js +1 -1
- package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0_l72r2.js +1 -1
- package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0a439d6.js +1 -1
- package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0b8a-p3.js +1 -1
- package/dist/standalone/next-output/server/chunks/0prs_next_dist_esm_build_templates_app-route_0e-v8-t.js +1 -1
- package/dist/standalone/next-output/server/chunks/[externals]__11vad82._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[externals]_next_dist_0sqmaqd._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0-taz6n._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__00~g.6x._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__057h~1v._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06666_b._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06h__d_._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06r8z50._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__06wq380._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0_b50~5._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0eruj62._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0fc0f.7._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0g2.yrs._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0g4.zxh._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0hasizg._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0jlfmb8._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0m-c-3t._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mft_cy._.js +78 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0m~u8g4._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0nx-vwn._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0o-u0o6._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0pzvh8l._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0rl2w7-._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wdwx.8._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0wj1pxh._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0y.-jfw._.js +3 -0
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0yqw7pu._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0~22xdv._.js +3 -0
- package/dist/standalone/next-output/server/chunks/_00h8h72._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_01k5l~6._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_01m8bky._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_08yfru9._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_0a9455x._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_0glc6qw._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_0k9xfs_._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_0qc0j~f._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_0s9bykd._.js +1 -1
- package/dist/standalone/next-output/server/chunks/_0ykasjm._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/0prs_next_dist_0gm.sou._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0xgtqus._.js → [root-of-the-server]__03~l7zo._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__07dg5mm._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__08n6l..._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0f0-17f._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0i8nvpz._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0kp4i1o._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__0kehl40._.js → [root-of-the-server]__0mvoac~._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0q5n4_f._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0s2z7s7._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0t9jvpg._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ta228.._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__11yff~n._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__13lfzik._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_09_de1y._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/{_0j8zmg6._.js → _0mb-jfk._.js} +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0n~tafj._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_10n.q--._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_118t3.z._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_119e_ui._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/components_0isp.qn._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/components_entry-list_tsx_02.v.ur._.js +1 -1
- package/dist/standalone/next-output/server/functions-config-manifest.json +11 -1
- package/dist/standalone/next-output/server/middleware-build-manifest.js +5 -5
- package/dist/standalone/next-output/server/middleware-manifest.json +2 -30
- package/dist/standalone/next-output/server/middleware.js +5 -0
- package/dist/standalone/next-output/server/pages/500.html +1 -1
- package/dist/standalone/next-output/static/chunks/01.p8x7rwa_da.js +1 -0
- package/dist/standalone/next-output/static/chunks/0352pgxbvl-fv.css +3 -0
- package/dist/standalone/next-output/static/chunks/05q3gfx1e8sea.js +2 -0
- package/dist/standalone/next-output/static/chunks/{0tunlsiqaj8k7.js → 0_ofg6_dn.8-1.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0fa.o-_asg9n7.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0d1bw0ondgg09.js → 0fxgcr1q998_k.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0j2e~637-6iat.js +1 -0
- package/dist/standalone/next-output/static/chunks/0oqkatex7m1ci.js +1 -0
- package/dist/standalone/next-output/static/chunks/11om1fvdw0yt4.js +1 -0
- package/dist/standalone/next-output/static/chunks/{turbopack-0f5lhej4rg9kr.js → turbopack-0qr4v3fex9a4_.js} +1 -1
- package/dist/standalone/package.json +1 -1
- package/dist/standalone/public/icons/site.webmanifest +19 -1
- package/dist/standalone/public/manifest.webmanifest +30 -30
- package/dist/standalone/public/sw.js +74 -73
- package/package.json +1 -1
- package/dist/standalone/next-output/server/chunks/[externals]_next_dist_0arv.vj._.js +0 -3
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0.8v_6p._.js +0 -3
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__07wrb8~._.js +0 -3
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0_ar6en._.js +0 -3
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0jvridy._.js +0 -3
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0mp257.._.js +0 -3
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0nhm~x6._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0y1l.fp._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_11_k_h_._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +0 -3
- package/dist/standalone/next-output/server/edge/chunks/0iv-_next_dist_esm_build_templates_edge-wrapper_0tu5gg3.js +0 -3
- package/dist/standalone/next-output/server/edge/chunks/0prs_next_dist_esm_build_templates_edge-wrapper_0qnghjz.js +0 -3
- package/dist/standalone/next-output/server/edge/chunks/[root-of-the-server]__0864en3._.js +0 -69
- package/dist/standalone/next-output/static/chunks/0bkrh0v8rs7jg.js +0 -1
- package/dist/standalone/next-output/static/chunks/0dx.1c1lmm455.css +0 -3
- package/dist/standalone/next-output/static/chunks/0lj1_~cxf~l6t.js +0 -1
- package/dist/standalone/next-output/static/chunks/0o1-l.q7jp8h9.js +0 -1
- package/dist/standalone/next-output/static/chunks/0p4cjapdzyl6k.js +0 -2
- package/dist/standalone/next-output/static/chunks/0yhbka048dolq.js +0 -1
- package/dist/standalone/next-output/static/chunks/11cm.4cgwu.ci.js +0 -1
- /package/dist/standalone/next-output/static/{BrJRktoc4eE78z4-7oyH2 → nWINZxUmLtSJoWt1IRxld}/_buildManifest.js +0 -0
- /package/dist/standalone/next-output/static/{BrJRktoc4eE78z4-7oyH2 → nWINZxUmLtSJoWt1IRxld}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/next-output/static/{BrJRktoc4eE78z4-7oyH2 → nWINZxUmLtSJoWt1IRxld}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
module.exports=[21025,(e,t,r)=>{t.exports=e.x("next/dist/build/adapter/setup-node-env.external.js",()=>require("next/dist/build/adapter/setup-node-env.external.js"))},75306,(e,t,r)=>{"use strict";var n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o={},l={RequestCookies:()=>g,ResponseCookies:()=>m,parseCookie:()=>h,parseSetCookie:()=>d,stringifyCookie:()=>u};for(var c in l)n(o,c,{get:l[c],enumerable:!0});function u(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function h(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,s]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=s?s:"true"))}catch{}}return t}function d(e){if(!e)return;let[[t,r],...n]=h(e),{domain:s,expires:i,httponly:a,maxage:o,path:l,samesite:c,secure:u,partitioned:d,priority:g}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,b,y={name:t,value:decodeURIComponent(r),domain:s,...i&&{expires:new Date(i)},...a&&{httpOnly:!0},..."string"==typeof o&&{maxAge:Number(o)},path:l,...c&&{sameSite:p.includes(m=(m=c).toLowerCase())?m:void 0},...u&&{secure:!0},...g&&{priority:f.includes(b=(b=g).toLowerCase())?b:void 0},...d&&{partitioned:!0}};let e={};for(let t in y)y[t]&&(e[t]=y[t]);return e}}t.exports=((e,t,r,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of i(t))a.call(e,l)||l===r||n(e,l,{get:()=>t[l],enumerable:!(o=s(t,l))||o.enumerable});return e})(n({},"__esModule",{value:!0}),o);var p=["strict","lax","none"],f=["low","medium","high"],g=class{constructor(e){this._parsed=new Map,this._headers=e;const t=e.get("cookie");if(t)for(const[e,r]of h(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>u(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>u(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},m=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;const s=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(const e of Array.isArray(s)?s:function(e){if(!e)return[];var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}(s)){const t=d(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,s=this._parsed;return s.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=u(r);t.append("set-cookie",e)}}(s,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(u).join("; ")}}},82617,(e,t,r)=>{(()=>{"use strict";let r,n,s,i,a;var o,l,c,u,h,d,p,f,g,m,b,y,v,w,_,E,S={491:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;let n=r(223),s=r(172),i=r(930),a="context",o=new n.NoopContextManager;class l{static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalContextManager(e){return(0,s.registerGlobal)(a,e,i.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,s.getGlobal)(a)||o}disable(){this._getContextManager().disable(),(0,s.unregisterGlobal)(a,i.DiagAPI.instance())}}t.ContextAPI=l},930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;let n=r(56),s=r(912),i=r(957),a=r(172);class o{constructor(){function e(e){return function(...t){let r=(0,a.getGlobal)("diag");if(r)return r[e](...t)}}const t=this;t.setLogger=(e,r={logLevel:i.DiagLogLevel.INFO})=>{var n,o,l;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(n=e.stack)?n:e.message),!1}"number"==typeof r&&(r={logLevel:r});let c=(0,a.getGlobal)("diag"),u=(0,s.createLogLevelDiagLogger)(null!=(o=r.logLevel)?o:i.DiagLogLevel.INFO,e);if(c&&!r.suppressOverrideMessage){let e=null!=(l=Error().stack)?l:"<failed to generate stacktrace>";c.warn(`Current logger will be overwritten from ${e}`),u.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,a.registerGlobal)("diag",u,t,!0)},t.disable=()=>{(0,a.unregisterGlobal)("diag",t)},t.createComponentLogger=e=>new n.DiagComponentLogger(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){return this._instance||(this._instance=new o),this._instance}}t.DiagAPI=o},653:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;let n=r(660),s=r(172),i=r(930),a="metrics";class o{static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalMeterProvider(e){return(0,s.registerGlobal)(a,e,i.DiagAPI.instance())}getMeterProvider(){return(0,s.getGlobal)(a)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,s.unregisterGlobal)(a,i.DiagAPI.instance())}}t.MetricsAPI=o},181:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;let n=r(172),s=r(874),i=r(194),a=r(277),o=r(369),l=r(930),c="propagation",u=new s.NoopTextMapPropagator;class h{constructor(){this.createBaggage=o.createBaggage,this.getBaggage=a.getBaggage,this.getActiveBaggage=a.getActiveBaggage,this.setBaggage=a.setBaggage,this.deleteBaggage=a.deleteBaggage}static getInstance(){return this._instance||(this._instance=new h),this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(c,e,l.DiagAPI.instance())}inject(e,t,r=i.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=i.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(c,l.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(c)||u}}t.PropagationAPI=h},997:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;let n=r(172),s=r(846),i=r(139),a=r(607),o=r(930),l="trace";class c{constructor(){this._proxyTracerProvider=new s.ProxyTracerProvider,this.wrapSpanContext=i.wrapSpanContext,this.isSpanContextValid=i.isSpanContextValid,this.deleteSpan=a.deleteSpan,this.getSpan=a.getSpan,this.getActiveSpan=a.getActiveSpan,this.getSpanContext=a.getSpanContext,this.setSpan=a.setSpan,this.setSpanContext=a.setSpanContext}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalTracerProvider(e){let t=(0,n.registerGlobal)(l,this._proxyTracerProvider,o.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return(0,n.getGlobal)(l)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(l,o.DiagAPI.instance()),this._proxyTracerProvider=new s.ProxyTracerProvider}}t.TraceAPI=c},277:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;let n=r(491),s=(0,r(780).createContextKey)("OpenTelemetry Baggage Key");function i(e){return e.getValue(s)||void 0}t.getBaggage=i,t.getActiveBaggage=function(){return i(n.ContextAPI.getInstance().active())},t.setBaggage=function(e,t){return e.setValue(s,t)},t.deleteBaggage=function(e){return e.deleteValue(s)}},993:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class r{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new r(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new r(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new r(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new r}}t.BaggageImpl=r},830:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;let n=r(930),s=r(993),i=r(830),a=n.DiagAPI.instance();t.createBaggage=function(e={}){return new s.BaggageImpl(new Map(Object.entries(e)))},t.baggageEntryMetadataFromString=function(e){return"string"!=typeof e&&(a.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:i.baggageEntryMetadataSymbol,toString:()=>e}}},67:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0,t.context=r(491).ContextAPI.getInstance()},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;let n=r(780);t.NoopContextManager=class{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}},780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0,t.createContextKey=function(e){return Symbol.for(e)};class r{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let s=new r(t._currentContext);return s._currentContext.set(e,n),s},t.deleteValue=e=>{let n=new r(t._currentContext);return n._currentContext.delete(e),n}}}t.ROOT_CONTEXT=new r},506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0,t.diag=r(930).DiagAPI.instance()},56:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;let n=r(172);function s(e,t,r){let s=(0,n.getGlobal)("diag");if(s)return r.unshift(t),s[e](...r)}t.DiagComponentLogger=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return s("debug",this._namespace,e)}error(...e){return s("error",this._namespace,e)}info(...e){return s("info",this._namespace,e)}warn(...e){return s("warn",this._namespace,e)}verbose(...e){return s("verbose",this._namespace,e)}}},972:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;let r=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];t.DiagConsoleLogger=class{constructor(){for(let e=0;e<r.length;e++)this[r[e].n]=function(e){return function(...t){if(console){let r=console[e];if("function"!=typeof r&&(r=console.log),"function"==typeof r)return r.apply(console,t)}}}(r[e].c)}}},912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;let n=r(957);t.createLogLevelDiagLogger=function(e,t){function r(r,n){let s=t[r];return"function"==typeof s&&e>=n?s.bind(t):function(){}}return e<n.DiagLogLevel.NONE?e=n.DiagLogLevel.NONE:e>n.DiagLogLevel.ALL&&(e=n.DiagLogLevel.ALL),t=t||{},{error:r("error",n.DiagLogLevel.ERROR),warn:r("warn",n.DiagLogLevel.WARN),info:r("info",n.DiagLogLevel.INFO),debug:r("debug",n.DiagLogLevel.DEBUG),verbose:r("verbose",n.DiagLogLevel.VERBOSE)}}},957:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0,(r=t.DiagLogLevel||(t.DiagLogLevel={}))[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"},172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;let n=r(200),s=r(521),i=r(130),a=s.VERSION.split(".")[0],o=Symbol.for(`opentelemetry.js.api.${a}`),l=n._globalThis;t.registerGlobal=function(e,t,r,n=!1){var i;let a=l[o]=null!=(i=l[o])?i:{version:s.VERSION};if(!n&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(a.version!==s.VERSION){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${s.VERSION}`);return r.error(t.stack||t.message),!1}return a[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${s.VERSION}.`),!0},t.getGlobal=function(e){var t,r;let n=null==(t=l[o])?void 0:t.version;if(n&&(0,i.isCompatible)(n))return null==(r=l[o])?void 0:r[e]},t.unregisterGlobal=function(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${s.VERSION}.`);let r=l[o];r&&delete r[e]}},130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;let n=r(521),s=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function i(e){let t=new Set([e]),r=new Set,n=e.match(s);if(!n)return()=>!1;let i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=i.prerelease)return function(t){return t===e};function a(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let n=e.match(s);if(!n)return a(e);let o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=o.prerelease||i.major!==o.major)return a(e);if(0===i.major)return i.minor===o.minor&&i.patch<=o.patch?(t.add(e),!0):a(e);return i.minor<=o.minor?(t.add(e),!0):a(e)}}t._makeCompatibilityCheck=i,t.isCompatible=i(n.VERSION)},886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0,t.metrics=r(653).MetricsAPI.getInstance()},901:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0,(r=t.ValueType||(t.ValueType={}))[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"},102:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class r{createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=r;class n{}t.NoopMetric=n;class s extends n{add(e,t){}}t.NoopCounterMetric=s;class i extends n{add(e,t){}}t.NoopUpDownCounterMetric=i;class a extends n{record(e,t){}}t.NoopHistogramMetric=a;class o{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=o;class l extends o{}t.NoopObservableCounterMetric=l;class c extends o{}t.NoopObservableGaugeMetric=c;class u extends o{}t.NoopObservableUpDownCounterMetric=u,t.NOOP_METER=new r,t.NOOP_COUNTER_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new a,t.NOOP_UP_DOWN_COUNTER_METRIC=new i,t.NOOP_OBSERVABLE_COUNTER_METRIC=new l,t.NOOP_OBSERVABLE_GAUGE_METRIC=new c,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new u,t.createNoopMeter=function(){return t.NOOP_METER}},660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;let n=r(102);class s{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=s,t.NOOP_METER_PROVIDER=new s},200:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(46),t)},651:(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r._globalThis=void 0,r._globalThis="object"==typeof globalThis?globalThis:e.g},46:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(651),t)},939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0,t.propagation=r(181).PropagationAPI.getInstance()},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0,t.NoopTextMapPropagator=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}},194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},t.defaultTextMapSetter={set(e,t,r){null!=e&&(e[t]=r)}}},845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0,t.trace=r(997).TraceAPI.getInstance()},403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;let n=r(476);t.NonRecordingSpan=class{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}},614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;let n=r(491),s=r(607),i=r(403),a=r(139),o=n.ContextAPI.getInstance();t.NoopTracer=class{startSpan(e,t,r=o.active()){var n;if(null==t?void 0:t.root)return new i.NonRecordingSpan;let l=r&&(0,s.getSpanContext)(r);return"object"==typeof(n=l)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&(0,a.isSpanContextValid)(l)?new i.NonRecordingSpan(l):new i.NonRecordingSpan}startActiveSpan(e,t,r,n){let i,a,l;if(arguments.length<2)return;2==arguments.length?l=t:3==arguments.length?(i=t,l=r):(i=t,a=r,l=n);let c=null!=a?a:o.active(),u=this.startSpan(e,i,c),h=(0,s.setSpan)(c,u);return o.with(h,l,void 0,u)}}},124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;let n=r(614);t.NoopTracerProvider=class{getTracer(e,t,r){return new n.NoopTracer}}},125:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;let n=new(r(614)).NoopTracer;t.ProxyTracer=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):n}}},846:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;let n=r(125),s=new(r(124)).NoopTracerProvider;t.ProxyTracerProvider=class{getTracer(e,t,r){var s;return null!=(s=this.getDelegateTracer(e,t,r))?s:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:s}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)}}},996:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0,(r=t.SamplingDecision||(t.SamplingDecision={}))[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"},607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;let n=r(780),s=r(403),i=r(491),a=(0,n.createContextKey)("OpenTelemetry Context Key SPAN");function o(e){return e.getValue(a)||void 0}function l(e,t){return e.setValue(a,t)}t.getSpan=o,t.getActiveSpan=function(){return o(i.ContextAPI.getInstance().active())},t.setSpan=l,t.deleteSpan=function(e){return e.deleteValue(a)},t.setSpanContext=function(e,t){return l(e,new s.NonRecordingSpan(t))},t.getSpanContext=function(e){var t;return null==(t=o(e))?void 0:t.spanContext()}},325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;let n=r(564);class s{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce((e,t)=>{let r=t.trim(),s=r.indexOf("=");if(-1!==s){let i=r.slice(0,s),a=r.slice(s+1,t.length);(0,n.validateKey)(i)&&(0,n.validateValue)(a)&&e.set(i,a)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new s;return e._internalState=new Map(this._internalState),e}}t.TraceStateImpl=s},564:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;let r="[_0-9a-z-*/]",n=`[a-z]${r}{0,255}`,s=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`,i=RegExp(`^(?:${n}|${s})$`),a=/^[ -~]{0,255}[!-~]$/,o=/,|=/;t.validateKey=function(e){return i.test(e)},t.validateValue=function(e){return a.test(e)&&!o.test(e)}},98:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;let n=r(325);t.createTraceState=function(e){return new n.TraceStateImpl(e)}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;let n=r(475);t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},357:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0,(r=t.SpanKind||(t.SpanKind={}))[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"},139:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;let n=r(476),s=r(403),i=/^([0-9a-f]{32})$/i,a=/^[0-9a-f]{16}$/i;function o(e){return i.test(e)&&e!==n.INVALID_TRACEID}function l(e){return a.test(e)&&e!==n.INVALID_SPANID}t.isValidTraceId=o,t.isValidSpanId=l,t.isSpanContextValid=function(e){return o(e.traceId)&&l(e.spanId)},t.wrapSpanContext=function(e){return new s.NonRecordingSpan(e)}},847:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0,(r=t.SpanStatusCode||(t.SpanStatusCode={}))[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"},475:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0,(r=t.TraceFlags||(t.TraceFlags={}))[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.6.0"}},R={};function T(e){var t=R[e];if(void 0!==t)return t.exports;var r=R[e]={exports:{}},n=!0;try{S[e].call(r.exports,r,r.exports,T),n=!1}finally{n&&delete R[e]}return r.exports}T.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.2_7d7ddfdd25bda7360fc181e5027d31b3/node_modules/next/dist/compiled/@opentelemetry/api/";var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.trace=k.propagation=k.metrics=k.diag=k.context=k.INVALID_SPAN_CONTEXT=k.INVALID_TRACEID=k.INVALID_SPANID=k.isValidSpanId=k.isValidTraceId=k.isSpanContextValid=k.createTraceState=k.TraceFlags=k.SpanStatusCode=k.SpanKind=k.SamplingDecision=k.ProxyTracerProvider=k.ProxyTracer=k.defaultTextMapSetter=k.defaultTextMapGetter=k.ValueType=k.createNoopMeter=k.DiagLogLevel=k.DiagConsoleLogger=k.ROOT_CONTEXT=k.createContextKey=k.baggageEntryMetadataFromString=void 0,o=T(369),Object.defineProperty(k,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return o.baggageEntryMetadataFromString}}),l=T(780),Object.defineProperty(k,"createContextKey",{enumerable:!0,get:function(){return l.createContextKey}}),Object.defineProperty(k,"ROOT_CONTEXT",{enumerable:!0,get:function(){return l.ROOT_CONTEXT}}),c=T(972),Object.defineProperty(k,"DiagConsoleLogger",{enumerable:!0,get:function(){return c.DiagConsoleLogger}}),u=T(957),Object.defineProperty(k,"DiagLogLevel",{enumerable:!0,get:function(){return u.DiagLogLevel}}),h=T(102),Object.defineProperty(k,"createNoopMeter",{enumerable:!0,get:function(){return h.createNoopMeter}}),d=T(901),Object.defineProperty(k,"ValueType",{enumerable:!0,get:function(){return d.ValueType}}),p=T(194),Object.defineProperty(k,"defaultTextMapGetter",{enumerable:!0,get:function(){return p.defaultTextMapGetter}}),Object.defineProperty(k,"defaultTextMapSetter",{enumerable:!0,get:function(){return p.defaultTextMapSetter}}),f=T(125),Object.defineProperty(k,"ProxyTracer",{enumerable:!0,get:function(){return f.ProxyTracer}}),g=T(846),Object.defineProperty(k,"ProxyTracerProvider",{enumerable:!0,get:function(){return g.ProxyTracerProvider}}),m=T(996),Object.defineProperty(k,"SamplingDecision",{enumerable:!0,get:function(){return m.SamplingDecision}}),b=T(357),Object.defineProperty(k,"SpanKind",{enumerable:!0,get:function(){return b.SpanKind}}),y=T(847),Object.defineProperty(k,"SpanStatusCode",{enumerable:!0,get:function(){return y.SpanStatusCode}}),v=T(475),Object.defineProperty(k,"TraceFlags",{enumerable:!0,get:function(){return v.TraceFlags}}),w=T(98),Object.defineProperty(k,"createTraceState",{enumerable:!0,get:function(){return w.createTraceState}}),_=T(139),Object.defineProperty(k,"isSpanContextValid",{enumerable:!0,get:function(){return _.isSpanContextValid}}),Object.defineProperty(k,"isValidTraceId",{enumerable:!0,get:function(){return _.isValidTraceId}}),Object.defineProperty(k,"isValidSpanId",{enumerable:!0,get:function(){return _.isValidSpanId}}),E=T(476),Object.defineProperty(k,"INVALID_SPANID",{enumerable:!0,get:function(){return E.INVALID_SPANID}}),Object.defineProperty(k,"INVALID_TRACEID",{enumerable:!0,get:function(){return E.INVALID_TRACEID}}),Object.defineProperty(k,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return E.INVALID_SPAN_CONTEXT}}),r=T(67),Object.defineProperty(k,"context",{enumerable:!0,get:function(){return r.context}}),n=T(506),Object.defineProperty(k,"diag",{enumerable:!0,get:function(){return n.diag}}),s=T(886),Object.defineProperty(k,"metrics",{enumerable:!0,get:function(){return s.metrics}}),i=T(939),Object.defineProperty(k,"propagation",{enumerable:!0,get:function(){return i.propagation}}),a=T(845),Object.defineProperty(k,"trace",{enumerable:!0,get:function(){return a.trace}}),k.default={context:r.context,diag:n.diag,metrics:s.metrics,propagation:i.propagation,trace:a.trace},t.exports=k})()},33020,(e,t,r)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.2_7d7ddfdd25bda7360fc181e5027d31b3/node_modules/next/dist/compiled/cookie/");var e,r,n,s,i={};i.parse=function(t,r){if("string"!=typeof t)throw TypeError("argument str must be a string");for(var s={},i=t.split(n),a=(r||{}).decode||e,o=0;o<i.length;o++){var l=i[o],c=l.indexOf("=");if(!(c<0)){var u=l.substr(0,c).trim(),h=l.substr(++c,l.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==s[u]&&(s[u]=function(e,t){try{return t(e)}catch(t){return e}}(h,a))}}return s},i.serialize=function(e,t,n){var i=n||{},a=i.encode||r;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!s.test(e))throw TypeError("argument name is invalid");var o=a(t);if(o&&!s.test(o))throw TypeError("argument val is invalid");var l=e+"="+o;if(null!=i.maxAge){var c=i.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(c)}if(i.domain){if(!s.test(i.domain))throw TypeError("option domain is invalid");l+="; Domain="+i.domain}if(i.path){if(!s.test(i.path))throw TypeError("option path is invalid");l+="; Path="+i.path}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw TypeError("option expires is invalid");l+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(l+="; HttpOnly"),i.secure&&(l+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l},e=decodeURIComponent,r=encodeURIComponent,n=/; */,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,t.exports=i})()},72710,(e,t,r)=>{(()=>{"use strict";let e,r,n,s,i;var a={993:e=>{var t=Object.prototype.hasOwnProperty,r="~";function n(){}function s(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw TypeError("The listener must be a function");var o=new s(n,i||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,s=[];if(0===this._eventsCount)return s;for(n in e=this._events)t.call(e,n)&&s.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,i=n.length,a=Array(i);s<i;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,s,i,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,s),!0;case 5:return u.fn.call(u.context,t,n,s,i),!0;case 6:return u.fn.call(u.context,t,n,s,i,a),!0}for(c=1,l=Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,s);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,s){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||s&&!o.once||n&&o.context!==n||a(this,i);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||s&&!o[l].once||n&&o[l].context!==n)&&c.push(o[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o},213:e=>{e.exports=(e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e})))},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=0,s=e.length;for(;s>0;){let i=s/2|0,a=n+i;0>=r(e[a],t)?(n=++a,s-=i+1):s=i}return n}},821:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});let n=r(574);t.default=class{constructor(){this._queue=[]}enqueue(e,t){let r={priority:(t=Object.assign({priority:0},t)).priority,run:e};if(this.size&&this._queue[this.size-1].priority>=t.priority)return void this._queue.push(r);let s=n.default(this._queue,r,(e,t)=>t.priority-e.priority);this._queue.splice(s,0,r)}dequeue(){let e=this._queue.shift();return null==e?void 0:e.run}filter(e){return this._queue.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this._queue.length}}},816:(e,t,r)=>{let n=r(213);class s extends Error{constructor(e){super(e),this.name="TimeoutError"}}let i=(e,t,r)=>new Promise((i,a)=>{if("number"!=typeof t||t<0)throw TypeError("Expected `milliseconds` to be a positive number");if(t===1/0)return void i(e);let o=setTimeout(()=>{if("function"==typeof r){try{i(r())}catch(e){a(e)}return}let n="string"==typeof r?r:`Promise timed out after ${t} milliseconds`,o=r instanceof Error?r:new s(n);"function"==typeof e.cancel&&e.cancel(),a(o)},t);n(e.then(i,a),()=>{clearTimeout(o)})});e.exports=i,e.exports.default=i,e.exports.TimeoutError=s}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}},n=!0;try{a[e](r,r.exports,l),n=!1}finally{n&&delete o[e]}return r.exports}l.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.2_7d7ddfdd25bda7360fc181e5027d31b3/node_modules/next/dist/compiled/p-queue/";var c={};Object.defineProperty(c,"__esModule",{value:!0}),e=l(993),r=l(816),n=l(821),s=()=>{},i=new r.TimeoutError,c.default=class extends e{constructor(e){var t,r,i,a;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=s,this._resolveIdle=s,!("number"==typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},e)).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!=(r=null==(t=e.intervalCap)?void 0:t.toString())?r:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!=(a=null==(i=e.interval)?void 0:i.toString())?a:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=s,0===this._pendingCount&&(this._resolveIdle(),this._resolveIdle=s,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let e=Date.now();if(void 0===this._intervalId){let t=this._intervalEnd-e;if(!(t<0))return void 0===this._timeoutId&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,t={}){return new Promise((n,s)=>{let a=async()=>{this._pendingCount++,this._intervalCount++;try{let a=void 0===this._timeout&&void 0===t.timeout?e():r.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&s(i)});n(await a)}catch(e){s(e)}this._next()};this._queue.enqueue(a,t),this._tryToStartAnother(),this.emit("add")})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this._isPaused&&(this._isPaused=!1,this._processQueue()),this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise(e=>{let t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise(e=>{let t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}},t.exports=c})()},51187,(e,t,r)=>{t.exports=e.x("next/dist/server/lib/incremental-cache/tags-manifest.external.js",()=>require("next/dist/server/lib/incremental-cache/tags-manifest.external.js"))},78500,(e,t,r)=>{t.exports=e.x("node:async_hooks",()=>require("node:async_hooks"))},12580,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={getTestReqInfo:function(){return l},withRequest:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=new(e.r(78500)).AsyncLocalStorage;function a(e,t){let r=t.header(e,"next-test-proxy-port");if(!r)return;let n=t.url(e);return{url:n,proxyPort:Number(r),testData:t.header(e,"next-test-data")||""}}function o(e,t,r){let n=a(e,t);return n?i.run(n,r):r()}function l(e,t){let r=i.getStore();return r||(e&&t?a(e,t):void 0)}},68303,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={handleFetch:function(){return l},interceptFetch:function(){return c},reader:function(){return a}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(12580),a={url:e=>e.url,header:(e,t)=>e.headers.get(t)};async function o(e,t){let{url:r,method:n,headers:s,body:i,cache:a,credentials:o,integrity:l,mode:c,redirect:u,referrer:h,referrerPolicy:d}=t;return{testData:e,api:"fetch",request:{url:r,method:n,headers:[...Array.from(s),["next-test-stack",function(){let e=(Error().stack??"").split("\n");for(let t=1;t<e.length;t++)if(e[t].length>0){e=e.slice(t);break}return(e=(e=(e=e.filter(e=>!e.includes("/next/dist/"))).slice(0,5)).map(e=>e.replace("webpack-internal:///(rsc)/","").trim())).join(" ")}()]],body:i?Buffer.from(await t.arrayBuffer()).toString("base64"):null,cache:a,credentials:o,integrity:l,mode:c,redirect:u,referrer:h,referrerPolicy:d}}}async function l(e,t){let r=(0,i.getTestReqInfo)(t,a);if(!r)return e(t);let{testData:n,proxyPort:s}=r,l=await o(n,t),c=await e(`http://localhost:${s}`,{method:"POST",body:JSON.stringify(l),next:{internal:!0}});if(!c.ok)throw Object.defineProperty(Error(`Proxy request failed: ${c.status}`),"__NEXT_ERROR_CODE",{value:"E146",enumerable:!1,configurable:!0});let u=await c.json(),{api:h}=u;switch(h){case"continue":return e(t);case"abort":case"unhandled":throw Object.defineProperty(Error(`Proxy request aborted [${t.method} ${t.url}]`),"__NEXT_ERROR_CODE",{value:"E145",enumerable:!1,configurable:!0});case"fetch":return function(e){let{status:t,headers:r,body:n}=e.response;return new Response(n?Buffer.from(n,"base64"):null,{status:t,headers:new Headers(r)})}(u);default:return h}}function c(t){return e.g.fetch=function(e,r){var n;return(null==r||null==(n=r.next)?void 0:n.internal)?t(e,r):l(t,new Request(e,r))},()=>{e.g.fetch=t}}},26526,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={interceptTestApis:function(){return o},wrapRequestHandler:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(12580),a=e.r(68303);function o(){return(0,a.interceptFetch)(e.g.fetch)}function l(e){return(t,r)=>(0,i.withRequest)(t,a.reader,()=>e(t,r))}},8735,(e,t,r)=>{t.exports=e.r(14747)},96476,(e,t,r)=>{t.exports=e.x("next/dist/server/lib/incremental-cache/memory-cache.external.js",()=>require("next/dist/server/lib/incremental-cache/memory-cache.external.js"))},55292,(e,t,r)=>{t.exports=e.x("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js",()=>require("next/dist/server/lib/incremental-cache/shared-cache-controls.external.js"))},59073,(e,t,r)=>{(()=>{"use strict";"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.2_7d7ddfdd25bda7360fc181e5027d31b3/node_modules/next/dist/compiled/path-to-regexp/");var e={};(()=>{function t(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var s="",i=r+1;i<e.length;){var a=e.charCodeAt(i);if(a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||95===a){s+=e[i++];continue}break}if(!s)throw TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:s}),r=i;continue}if("("===n){var o=1,l="",i=r+1;if("?"===e[i])throw TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<e.length;){if("\\"===e[i]){l+=e[i++]+e[i++];continue}if(")"===e[i]){if(0==--o){i++;break}}else if("("===e[i]&&(o++,"?"!==e[i+1]))throw TypeError("Capturing groups are not allowed at ".concat(i));l+=e[i++]}if(o)throw TypeError("Unbalanced pattern at ".concat(r));if(!l)throw TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:l}),r=i;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,a=t.delimiter,o=void 0===a?"/#?":a,l=[],c=0,u=0,h="",d=function(e){if(u<r.length&&r[u].type===e)return r[u++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var n=r[u],s=n.type,i=n.index;throw TypeError("Unexpected ".concat(s," at ").concat(i,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},g=function(e){for(var t=0;t<o.length;t++){var r=o[t];if(e.indexOf(r)>-1)return!0}return!1},m=function(e){var t=l[l.length-1],r=e||(t&&"string"==typeof t?t:"");if(t&&!r)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!r||g(r)?"[^".concat(s(o),"]+?"):"(?:(?!".concat(s(r),")[^").concat(s(o),"])+?")};u<r.length;){var b=d("CHAR"),y=d("NAME"),v=d("PATTERN");if(y||v){var w=b||"";-1===i.indexOf(w)&&(h+=w,w=""),h&&(l.push(h),h=""),l.push({name:y||c++,prefix:w,suffix:"",pattern:v||m(w),modifier:d("MODIFIER")||""});continue}var _=b||d("ESCAPED_CHAR");if(_){h+=_;continue}if(h&&(l.push(h),h=""),d("OPEN")){var w=f(),E=d("NAME")||"",S=d("PATTERN")||"",R=f();p("CLOSE"),l.push({name:E||(S?c++:""),pattern:E&&!S?m(w):S,prefix:w,suffix:R,modifier:d("MODIFIER")||""});continue}p("END")}return l}function r(e,t){void 0===t&&(t={});var r=i(t),n=t.encode,s=void 0===n?function(e){return e}:n,a=t.validate,o=void 0===a||a,l=e.map(function(e){if("object"==typeof e)return new RegExp("^(?:".concat(e.pattern,")$"),r)});return function(t){for(var r="",n=0;n<e.length;n++){var i=e[n];if("string"==typeof i){r+=i;continue}var a=t?t[i.name]:void 0,c="?"===i.modifier||"*"===i.modifier,u="*"===i.modifier||"+"===i.modifier;if(Array.isArray(a)){if(!u)throw TypeError('Expected "'.concat(i.name,'" to not repeat, but got an array'));if(0===a.length){if(c)continue;throw TypeError('Expected "'.concat(i.name,'" to not be empty'))}for(var h=0;h<a.length;h++){var d=s(a[h],i);if(o&&!l[n].test(d))throw TypeError('Expected all "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(d,'"'));r+=i.prefix+d+i.suffix}continue}if("string"==typeof a||"number"==typeof a){var d=s(String(a),i);if(o&&!l[n].test(d))throw TypeError('Expected "'.concat(i.name,'" to match "').concat(i.pattern,'", but got "').concat(d,'"'));r+=i.prefix+d+i.suffix;continue}if(!c){var p=u?"an array":"a string";throw TypeError('Expected "'.concat(i.name,'" to be ').concat(p))}}return r}}function n(e,t,r){void 0===r&&(r={});var n=r.decode,s=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var i=n[0],a=n.index,o=Object.create(null),l=1;l<n.length;l++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?o[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return s(e,r)}):o[r.name]=s(n[e],r)}}(l);return{path:i,index:a,params:o}}}function s(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function i(e){return e&&e.sensitive?"":"i"}function a(e,t,r){void 0===r&&(r={});for(var n=r.strict,a=void 0!==n&&n,o=r.start,l=r.end,c=r.encode,u=void 0===c?function(e){return e}:c,h=r.delimiter,d=r.endsWith,p="[".concat(s(void 0===d?"":d),"]|$"),f="[".concat(s(void 0===h?"/#?":h),"]"),g=void 0===o||o?"^":"",m=0;m<e.length;m++){var b=e[m];if("string"==typeof b)g+=s(u(b));else{var y=s(u(b.prefix)),v=s(u(b.suffix));if(b.pattern)if(t&&t.push(b),y||v)if("+"===b.modifier||"*"===b.modifier){var w="*"===b.modifier?"?":"";g+="(?:".concat(y,"((?:").concat(b.pattern,")(?:").concat(v).concat(y,"(?:").concat(b.pattern,"))*)").concat(v,")").concat(w)}else g+="(?:".concat(y,"(").concat(b.pattern,")").concat(v,")").concat(b.modifier);else{if("+"===b.modifier||"*"===b.modifier)throw TypeError('Can not repeat "'.concat(b.name,'" without a prefix and suffix'));g+="(".concat(b.pattern,")").concat(b.modifier)}else g+="(?:".concat(y).concat(v,")").concat(b.modifier)}}if(void 0===l||l)a||(g+="".concat(f,"?")),g+=r.endsWith?"(?=".concat(p,")"):"$";else{var _=e[e.length-1],E="string"==typeof _?f.indexOf(_[_.length-1])>-1:void 0===_;a||(g+="(?:".concat(f,"(?=").concat(p,"))?")),E||(g+="(?=".concat(f,"|").concat(p,")"))}return new RegExp(g,i(r))}function o(e,r,n){if(e instanceof RegExp){var s;if(!r)return e;for(var l=/\((?:\?<(.*?)>)?(?!\?)/g,c=0,u=l.exec(e.source);u;)r.push({name:u[1]||c++,prefix:"",suffix:"",modifier:"",pattern:""}),u=l.exec(e.source);return e}return Array.isArray(e)?(s=e.map(function(e){return o(e,r,n).source}),new RegExp("(?:".concat(s.join("|"),")"),i(n))):a(t(e,n),r,n)}Object.defineProperty(e,"__esModule",{value:!0}),e.pathToRegexp=e.tokensToRegexp=e.regexpToFunction=e.match=e.tokensToFunction=e.compile=e.parse=void 0,e.parse=t,e.compile=function(e,n){return r(t(e,n),n)},e.tokensToFunction=r,e.match=function(e,t){var r=[];return n(o(e,r,t),r,t)},e.regexpToFunction=n,e.tokensToRegexp=a,e.pathToRegexp=o})(),t.exports=e})()},54799,(e,t,r)=>{t.exports=e.x("crypto",()=>require("crypto"))},91987,(e,t,r)=>{"use strict";function n(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"detectDomainLocale",{enumerable:!0,get:function(){return n}})},44202,(e,t,r)=>{"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},49336,(e,t,r)=>{"use strict";function n(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"parsePath",{enumerable:!0,get:function(){return n}})},82181,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addPathPrefix",{enumerable:!0,get:function(){return s}});let n=e.r(49336);function s(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:s,hash:i}=(0,n.parsePath)(e);return`${t}${r}${s}${i}`}},49688,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addPathSuffix",{enumerable:!0,get:function(){return s}});let n=e.r(49336);function s(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:s,hash:i}=(0,n.parsePath)(e);return`${r}${t}${s}${i}`}},83999,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"pathHasPrefix",{enumerable:!0,get:function(){return s}});let n=e.r(49336);function s(e,t){if("string"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+"/")}},83482,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addLocale",{enumerable:!0,get:function(){return i}});let n=e.r(82181),s=e.r(83999);function i(e,t,r,i){if(!t||t===r)return e;let a=e.toLowerCase();return!i&&((0,s.pathHasPrefix)(a,"/api")||(0,s.pathHasPrefix)(a,`/${t.toLowerCase()}`))?e:(0,n.addPathPrefix)(e,`/${t}`)}},82700,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"formatNextPathnameInfo",{enumerable:!0,get:function(){return o}});let n=e.r(44202),s=e.r(82181),i=e.r(49688),a=e.r(83482);function o(e){let t=(0,a.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,i.addPathSuffix)((0,s.addPathPrefix)(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=(0,s.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,i.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},33540,(e,t,r)=>{"use strict";function n(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getHostname",{enumerable:!0,get:function(){return n}})},85800,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"normalizeLocalePath",{enumerable:!0,get:function(){return s}});let n=new WeakMap;function s(e,t){let r;if(!t)return{pathname:e};let s=n.get(t);s||(s=t.map(e=>e.toLowerCase()),n.set(t,s));let i=e.split("/",2);if(!i[1])return{pathname:e};let a=i[1].toLowerCase(),o=s.indexOf(a);return o<0?{pathname:e}:(r=t[o],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}},40789,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"removePathPrefix",{enumerable:!0,get:function(){return s}});let n=e.r(83999);function s(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}},17297,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getNextPathnameInfo",{enumerable:!0,get:function(){return a}});let n=e.r(85800),s=e.r(40789),i=e.r(83999);function a(e,t){let{basePath:r,i18n:a,trailingSlash:o}=t.nextConfig??{},l={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):o};r&&(0,i.pathHasPrefix)(l.pathname,r)&&(l.pathname=(0,s.removePathPrefix)(l.pathname,r),l.basePath=r);let c=l.pathname;if(l.pathname.startsWith("/_next/data/")&&l.pathname.endsWith(".json")){let e=l.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");l.buildId=e[0],c="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(l.pathname=c)}if(a){let e=t.i18nProvider?t.i18nProvider.analyze(l.pathname):(0,n.normalizeLocalePath)(l.pathname,a.locales);l.locale=e.detectedLocale,l.pathname=e.pathname??l.pathname,!e.detectedLocale&&l.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(c):(0,n.normalizeLocalePath)(c,a.locales)).detectedLocale&&(l.locale=e.detectedLocale)}return l}},89962,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextURL",{enumerable:!0,get:function(){return u}});let n=e.r(91987),s=e.r(82700),i=e.r(33540),a=e.r(17297),o=/^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/;function l(e,t){let r=new URL(String(e),t&&String(t));return o.test(r.hostname)&&(r.hostname="localhost"),r}let c=Symbol("NextURLInternal");class u{constructor(e,t,r){let n,s;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,s=r||{}):s=r||t||{},this[c]={url:l(e,n??s.base),options:s,basePath:""},this.analyze()}analyze(){var e,t,r,s,o;let l=(0,a.getNextPathnameInfo)(this[c].url.pathname,{nextConfig:this[c].options.nextConfig,parseData:!0,i18nProvider:this[c].options.i18nProvider}),u=(0,i.getHostname)(this[c].url,this[c].options.headers);this[c].domainLocale=this[c].options.i18nProvider?this[c].options.i18nProvider.detectDomainLocale(u):(0,n.detectDomainLocale)(null==(t=this[c].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,u);let h=(null==(r=this[c].domainLocale)?void 0:r.defaultLocale)||(null==(o=this[c].options.nextConfig)||null==(s=o.i18n)?void 0:s.defaultLocale);this[c].url.pathname=l.pathname,this[c].defaultLocale=h,this[c].basePath=l.basePath??"",this[c].buildId=l.buildId,this[c].locale=l.locale??h,this[c].trailingSlash=l.trailingSlash}formatPathname(){return(0,s.formatNextPathnameInfo)({basePath:this[c].basePath,buildId:this[c].buildId,defaultLocale:this[c].options.forceLocale?void 0:this[c].defaultLocale,locale:this[c].locale,pathname:this[c].url.pathname,trailingSlash:this[c].trailingSlash})}formatSearch(){return this[c].url.search}get buildId(){return this[c].buildId}set buildId(e){this[c].buildId=e}get locale(){return this[c].locale??""}set locale(e){var t,r;if(!this[c].locale||!(null==(r=this[c].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[c].locale=e}get defaultLocale(){return this[c].defaultLocale}get domainLocale(){return this[c].domainLocale}get searchParams(){return this[c].url.searchParams}get host(){return this[c].url.host}set host(e){this[c].url.host=e}get hostname(){return this[c].url.hostname}set hostname(e){this[c].url.hostname=e}get port(){return this[c].url.port}set port(e){this[c].url.port=e}get protocol(){return this[c].url.protocol}set protocol(e){this[c].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[c].url=l(e),this.analyze()}get origin(){return this[c].url.origin}get pathname(){return this[c].url.pathname}set pathname(e){this[c].url.pathname=e}get hash(){return this[c].url.hash}set hash(e){this[c].url.hash=e}get search(){return this[c].url.search}set search(e){this[c].url.search=e}get password(){return this[c].url.password}set password(e){this[c].url.password=e}get username(){return this[c].url.username}set username(e){this[c].url.username=e}get basePath(){return this[c].basePath}set basePath(e){this[c].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new u(String(this),this[c].options)}}},94756,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ACTION_SUFFIX:function(){return m},APP_DIR_ALIAS:function(){return q},CACHE_ONE_YEAR_SECONDS:function(){return A},DOT_NEXT_ALIAS:function(){return U},ESLINT_DEFAULT_DIRS:function(){return eo},GSP_NO_RETURNED_VALUE:function(){return et},GSSP_COMPONENT_MEMBER_ERROR:function(){return es},GSSP_NO_RETURNED_VALUE:function(){return er},HTML_CONTENT_TYPE_HEADER:function(){return a},INFINITE_CACHE:function(){return N},INSTRUMENTATION_HOOK_FILENAME:function(){return L},JSON_CONTENT_TYPE_HEADER:function(){return o},MATCHED_PATH_HEADER:function(){return u},MIDDLEWARE_FILENAME:function(){return I},MIDDLEWARE_LOCATION_REGEXP:function(){return j},NEXT_BODY_SUFFIX:function(){return v},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return x},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return E},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return S},NEXT_CACHE_ROOT_PARAM_TAG_ID:function(){return C},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return P},NEXT_CACHE_TAGS_HEADER:function(){return _},NEXT_CACHE_TAG_MAX_ITEMS:function(){return k},NEXT_CACHE_TAG_MAX_LENGTH:function(){return O},NEXT_DATA_SUFFIX:function(){return b},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return c},NEXT_META_SUFFIX:function(){return y},NEXT_NAV_DEPLOYMENT_ID_HEADER:function(){return w},NEXT_QUERY_PARAM_PREFIX:function(){return l},NEXT_RESUME_HEADER:function(){return R},NEXT_RESUME_STATE_LENGTH_HEADER:function(){return T},NON_STANDARD_NODE_ENV:function(){return ei},PAGES_DIR_ALIAS:function(){return M},PRERENDER_REVALIDATE_HEADER:function(){return h},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return d},PROXY_FILENAME:function(){return D},PROXY_LOCATION_REGEXP:function(){return $},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return K},ROOT_DIR_ALIAS:function(){return B},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return X},RSC_ACTION_ENCRYPTION_ALIAS:function(){return z},RSC_ACTION_PROXY_ALIAS:function(){return G},RSC_ACTION_VALIDATE_ALIAS:function(){return F},RSC_CACHE_WRAPPER_ALIAS:function(){return W},RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS:function(){return V},RSC_MOD_REF_PROXY_ALIAS:function(){return H},RSC_SEGMENTS_DIR_SUFFIX:function(){return p},RSC_SEGMENT_SUFFIX:function(){return f},RSC_SUFFIX:function(){return g},SERVER_PROPS_EXPORT_ERROR:function(){return ee},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return Y},SERVER_PROPS_SSG_CONFLICT:function(){return Q},SERVER_RUNTIME:function(){return el},SSG_FALLBACK_EXPORT_ERROR:function(){return ea},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return J},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return Z},TEXT_PLAIN_CONTENT_TYPE_HEADER:function(){return i},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return en},WEBPACK_LAYERS:function(){return eh},WEBPACK_RESOURCE_QUERIES:function(){return ed},WEB_SOCKET_MAX_RECONNECTIONS:function(){return ec}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i="text/plain",a="text/html; charset=utf-8",o="application/json; charset=utf-8",l="nxtP",c="nxtI",u="x-matched-path",h="x-prerender-revalidate",d="x-prerender-revalidate-if-generated",p=".segments",f=".segment.rsc",g=".rsc",m=".action",b=".json",y=".meta",v=".body",w="x-nextjs-deployment-id",_="x-next-cache-tags",E="x-next-revalidated-tags",S="x-next-revalidate-tag-token",R="next-resume",T="x-next-resume-state-length",k=128,O=256,P=1024,x="_N_T_",C="_N_RP_",A=31536e3,N=0xfffffffe,I="middleware",j=`(?:src/)?${I}`,D="proxy",$=`(?:src/)?${D}`,L="instrumentation",M="private-next-pages",U="private-dot-next",B="private-next-root-dir",q="private-next-app-dir",H="private-next-rsc-mod-ref-proxy",F="private-next-rsc-action-validate",G="private-next-rsc-server-reference",W="private-next-rsc-cache-wrapper",V="private-next-rsc-track-dynamic-import",z="private-next-rsc-action-encryption",X="private-next-rsc-action-client-wrapper",K="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",J="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",Y="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",Q="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",Z="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",ee="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",et="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",er="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",en="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",es="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",ei='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',ea="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",eo=["app","pages","components","lib","src"],el={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},ec=12,eu={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"},eh={...eu,GROUP:{builtinReact:[eu.reactServerComponents,eu.actionBrowser],serverOnly:[eu.reactServerComponents,eu.actionBrowser,eu.instrument,eu.middleware],neutralTarget:[eu.apiNode,eu.apiEdge],clientOnly:[eu.serverSideRendering,eu.appPagesBrowser],bundled:[eu.reactServerComponents,eu.actionBrowser,eu.serverSideRendering,eu.appPagesBrowser,eu.shared,eu.instrument,eu.middleware],appPages:[eu.reactServerComponents,eu.serverSideRendering,eu.appPagesBrowser,eu.actionBrowser]}},ed={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},9635,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={fromNodeOutgoingHttpHeaders:function(){return a},normalizeNextQueryParam:function(){return u},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return l},validateURL:function(){return c}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(94756);function a(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function o(e){var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}function l(e){let t={},r=[];if(e)for(let[n,s]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...o(s)),t[n]=1===r.length?r[0]:r):t[n]=s;return t}function c(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function u(e){for(let t of[i.NEXT_QUERY_PARAM_PREFIX,i.NEXT_INTERCEPTION_MARKER_PREFIX])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}},49616,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={PageSignatureError:function(){return i},RemovedPageError:function(){return a},RemovedUAError:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});class i extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
|
|
2
|
+
|
|
3
|
+
export function middleware(request, event) {
|
|
4
|
+
return NextResponse.redirect('/new-location')
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
8
|
+
`)}}class a extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class o extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}},42105,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={RequestCookies:function(){return i.RequestCookies},ResponseCookies:function(){return i.ResponseCookies},stringifyCookie:function(){return i.stringifyCookie}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(75306)},87054,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={INTERNALS:function(){return c},NextRequest:function(){return u}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(89962),a=e.r(9635),o=e.r(49616),l=e.r(42105),c=Symbol("internal request");class u extends Request{constructor(e,t={}){const r="string"!=typeof e&&"url"in e?e.url:String(e);(0,a.validateURL)(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);const n=new i.NextURL(r,{headers:(0,a.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[c]={cookies:new l.RequestCookies(this.headers),nextUrl:n,url:n.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[c].cookies}get nextUrl(){return this[c].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[c].url}}},56513,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},12136,(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(42105),s=e.r(89962),i=e.r(9635),a=e.r(56513),o=e.r(42105),l=Symbol("internal response"),c=new Set([301,302,303,307,308]);function u(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,s]of e.request.headers)t.set("x-middleware-request-"+n,s),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class h extends Response{constructor(e,t={}){super(e,t);const r=this.headers,c=new Proxy(new o.ResponseCookies(r),{get(e,s,i){switch(s){case"delete":case"set":return(...i)=>{let a=Reflect.apply(e[s],e,i),l=new Headers(r);return a instanceof o.ResponseCookies&&r.set("x-middleware-set-cookie",a.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),u(t,l),a};default:return a.ReflectAdapter.get(e,s,i)}}});this[l]={cookies:c,url:t.url?new s.NextURL(t.url,{headers:(0,i.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[l].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:{},s=new Headers(null==n?void 0:n.headers);return s.set("Location",(0,i.validateURL)(e)),new h(null,{...n,headers:s,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,i.validateURL)(e)),u(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"),u(e,t),new h(null,{...e,headers:t})}}},52325,(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}})},22088,(e,t,r)=>{var n={226:function(t,r){!function(n){"use strict";var s="function",i="undefined",a="object",o="string",l="major",c="model",u="name",h="type",d="vendor",p="version",f="architecture",g="console",m="mobile",b="tablet",y="smarttv",v="wearable",w="embedded",_="Amazon",E="Apple",S="ASUS",R="BlackBerry",T="Browser",k="Chrome",O="Firefox",P="Google",x="Huawei",C="Microsoft",A="Motorola",N="Opera",I="Samsung",j="Sharp",D="Sony",$="Xiaomi",L="Zebra",M="Facebook",U="Chromium OS",B="Mac OS",q=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},H=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},F=function(e,t){return typeof e===o&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,350)},V=function(e,t){for(var r,n,i,o,l,c,u=0;u<t.length&&!l;){var h=t[u],d=t[u+1];for(r=n=0;r<h.length&&!l&&h[r];)if(l=h[r++].exec(e))for(i=0;i<d.length;i++)c=l[++n],typeof(o=d[i])===a&&o.length>0?2===o.length?typeof o[1]==s?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:3===o.length?typeof o[1]!==s||o[1].exec&&o[1].test?this[o[0]]=c?c.replace(o[1],o[2]):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:4===o.length&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0):this[o]=c||void 0;u+=2}},z=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(F(t[r][n],e))return"?"===r?void 0:r}else if(F(t[r],e))return"?"===r?void 0: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"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,p],[/opios[\/ ]+([\w\.]+)/i],[p,[u,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[u,N]],[/(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],[u,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[u,"UC"+T]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[u,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+T],p],[/\bfocus\/([\w\.]+)/i],[p,[u,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[u,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[u,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[u,"MIUI "+T]],[/fxios\/([-\w\.]+)/i],[p,[u,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+T]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+T],p],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,M],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[u,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[u,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[u,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,k+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[u,"Android "+T]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[p,z,{"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],[u,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[u,O+" 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],[u,p],[/(cobalt)\/([\w\.]+)/i],[u,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,G]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,G]]],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],[c,[d,I],[h,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[c,[d,I],[h,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[d,E],[h,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[d,E],[h,b]],[/(macintosh);/i],[c,[d,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[d,j],[h,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[d,x],[h,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[d,x],[h,m]],[/\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],[[c,/_/g," "],[d,$],[h,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/g," "],[d,$],[h,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[c,[d,"OPPO"],[h,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[d,"Vivo"],[h,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[c,[d,"Realme"],[h,m]],[/\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],[c,[d,A],[h,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[d,A],[h,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[d,"LG"],[h,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[d,"LG"],[h,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[d,"Lenovo"],[h,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[d,"Nokia"],[h,m]],[/(pixel c)\b/i],[c,[d,P],[h,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[d,P],[h,m]],[/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],[c,[d,D],[h,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[d,D],[h,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[d,"OnePlus"],[h,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[d,_],[h,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[d,_],[h,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,d,[h,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[d,R],[h,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[d,S],[h,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[d,S],[h,m]],[/(nexus 9)/i],[c,[d,"HTC"],[h,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[c,/_/g," "],[h,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[d,"Acer"],[h,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[d,"Meizu"],[h,m]],[/(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,c,[h,m]],[/(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,c,[h,b]],[/(surface duo)/i],[c,[d,C],[h,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[d,"Fairphone"],[h,m]],[/(u304aa)/i],[c,[d,"AT&T"],[h,m]],[/\bsie-(\w*)/i],[c,[d,"Siemens"],[h,m]],[/\b(rct\w+) b/i],[c,[d,"RCA"],[h,b]],[/\b(venue[\d ]{2,7}) b/i],[c,[d,"Dell"],[h,b]],[/\b(q(?:mv|ta)\w+) b/i],[c,[d,"Verizon"],[h,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[d,"Barnes & Noble"],[h,b]],[/\b(tm\d{3}\w+) b/i],[c,[d,"NuVision"],[h,b]],[/\b(k88) b/i],[c,[d,"ZTE"],[h,b]],[/\b(nx\d{3}j) b/i],[c,[d,"ZTE"],[h,m]],[/\b(gen\d{3}) b.+49h/i],[c,[d,"Swiss"],[h,m]],[/\b(zur\d{3}) b/i],[c,[d,"Swiss"],[h,b]],[/\b((zeki)?tb.*\b) b/i],[c,[d,"Zeki"],[h,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],c,[h,b]],[/\b(ns-?\w{0,9}) b/i],[c,[d,"Insignia"],[h,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[d,"NextBook"],[h,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],c,[h,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],c,[h,m]],[/\b(ph-1) /i],[c,[d,"Essential"],[h,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[d,"Envizen"],[h,b]],[/\b(trio[-\w\. ]+) b/i],[c,[d,"MachSpeed"],[h,b]],[/\btu_(1491) b/i],[c,[d,"Rotor"],[h,b]],[/(shield[\w ]+) b/i],[c,[d,"Nvidia"],[h,b]],[/(sprint) (\w+)/i],[d,c,[h,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[d,C],[h,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[d,L],[h,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[d,L],[h,m]],[/smart-tv.+(samsung)/i],[d,[h,y]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[d,I],[h,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[h,y]],[/(apple) ?tv/i],[d,[c,E+" TV"],[h,y]],[/crkey/i],[[c,k+"cast"],[d,P],[h,y]],[/droid.+aft(\w)( bui|\))/i],[c,[d,_],[h,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[d,j],[h,y]],[/(bravia[\w ]+)( bui|\))/i],[c,[d,D],[h,y]],[/(mitv-\w{5}) bui/i],[c,[d,$],[h,y]],[/Hbbtv.*(technisat) (.*);/i],[d,c,[h,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[c,W],[h,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,c,[h,g]],[/droid.+; (shield) bui/i],[c,[d,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[c,[d,D],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[d,C],[h,g]],[/((pebble))app/i],[d,c,[h,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[d,E],[h,v]],[/droid.+; (glass) \d/i],[c,[d,P],[h,v]],[/droid.+; (wt63?0{2,3})\)/i],[c,[d,L],[h,v]],[/(quest( 2| pro)?)/i],[c,[d,M],[h,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[h,w]],[/(aeobc)\b/i],[c,[d,_],[h,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[c,[h,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[h,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[u,"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],[u,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[p,z,X]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[p,z,X]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,B],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,p],[/\(bb(10);/i],[p,[u,R]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[u,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[u,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[u,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[u,k+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,U],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],[u,p],[/(sunos) ?([\w\.\d]*)/i],[[u,"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],[u,p]]},J=function(e,t){if(typeof e===a&&(t=e,e=void 0),!(this instanceof J))return new J(e,t).getResult();var r=typeof n!==i&&n.navigator?n.navigator:void 0,g=e||(r&&r.userAgent?r.userAgent:""),y=r&&r.userAgentData?r.userAgentData:void 0,v=t?q(K,t):K,w=r&&r.userAgent==g;return this.getBrowser=function(){var e,t={};return t[u]=void 0,t[p]=void 0,V.call(t,g,v.browser),t[l]=typeof(e=t[p])===o?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,w&&r&&r.brave&&typeof r.brave.isBrave==s&&(t[u]="Brave"),t},this.getCPU=function(){var e={};return e[f]=void 0,V.call(e,g,v.cpu),e},this.getDevice=function(){var e={};return e[d]=void 0,e[c]=void 0,e[h]=void 0,V.call(e,g,v.device),w&&!e[h]&&y&&y.mobile&&(e[h]=m),w&&"Macintosh"==e[c]&&r&&typeof r.standalone!==i&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[c]="iPad",e[h]=b),e},this.getEngine=function(){var e={};return e[u]=void 0,e[p]=void 0,V.call(e,g,v.engine),e},this.getOS=function(){var e={};return e[u]=void 0,e[p]=void 0,V.call(e,g,v.os),w&&!e[u]&&y&&"Unknown"!=y.platform&&(e[u]=y.platform.replace(/chrome os/i,U).replace(/macos/i,B)),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 g},this.setUA=function(e){return g=typeof e===o&&e.length>350?W(e,350):e,this},this.setUA(g),this};if(J.VERSION="1.0.35",J.BROWSER=H([u,p,l]),J.CPU=H([f]),J.DEVICE=H([c,d,h,g,m,y,b,v,w]),J.ENGINE=J.OS=H([u,p]),typeof r!==i)t.exports&&(r=t.exports=J),r.UAParser=J;else if(typeof define===s&&define.amd)e.r,void 0!==J&&e.v(J);else typeof n!==i&&(n.UAParser=J);var Y=typeof n!==i&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new J;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var r in t)Y.ua[r]=t[r]}}}(this)}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},a=!0;try{n[e].call(r.exports,r,r.exports,i),a=!1}finally{a&&delete s[e]}return r.exports}i.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.2_7d7ddfdd25bda7360fc181e5027d31b3/node_modules/next/dist/compiled/ua-parser-js/",t.exports=i(226)},14433,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,s={isBot:function(){return o},userAgent:function(){return c},userAgentFromString:function(){return l}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=(n=e.r(22088))&&n.__esModule?n:{default:n};function o(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|GPTBot/i.test(e)}function l(e){return{...(0,a.default)(e),isBot:void 0!==e&&o(e)}}function c({headers:e}){return l(e.get("user-agent")||void 0)}},79457,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"URLPattern",{enumerable:!0,get:function(){return n}});let n="u"<typeof URLPattern?void 0:URLPattern},2423,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"after",{enumerable:!0,get:function(){return s}});let n=e.r(56704);function s(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)}},33354,(e,t,r)=>{"use strict";var n,s;Object.defineProperty(r,"__esModule",{value:!0}),n=e.r(2423),s=r,Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(s,e)||Object.defineProperty(s,e,{enumerable:!0,get:function(){return n[e]}})})},39291,(e,t,r)=>{"use strict";t.exports=e.r(18622)},43005,(e,t,r)=>{"use strict";t.exports=e.r(39291).vendored["react-rsc"].React},4534,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DynamicServerError:function(){return a},isDynamicServerError:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i="DYNAMIC_SERVER_USAGE";class a extends Error{constructor(e){super(`Dynamic server usage: ${e}`),this.description=e,this.digest=i}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===i}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},57573,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={StaticGenBailoutError:function(){return a},isStaticGenBailoutError:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i="NEXT_STATIC_GEN_BAILOUT";class a extends Error{constructor(...e){super(...e),this.code=i}}function o(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===i}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},68720,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"InvariantError",{enumerable:!0,get:function(){return n}});class n extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(".")?e:e+"."} This is a bug in Next.js.`,t),this.name="InvariantError"}}},72003,(e,t,r)=>{"use strict";function n(){let e,t,r=new Promise((r,n)=>{e=r,t=n});return{resolve:e,reject:t,promise:r}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"createPromiseWithResolvers",{enumerable:!0,get:function(){return n}})},61284,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,s={RenderStage:function(){return l},StagedRenderingController:function(){return c}};for(var i in s)Object.defineProperty(r,i,{enumerable:!0,get:s[i]});let a=e.r(68720),o=e.r(72003);var l=((n={})[n.Before=1]="Before",n[n.EarlyStatic=2]="EarlyStatic",n[n.Static=3]="Static",n[n.EarlyRuntime=4]="EarlyRuntime",n[n.Runtime=5]="Runtime",n[n.Dynamic=6]="Dynamic",n[n.Abandoned=7]="Abandoned",n);class c{constructor(e,t,r){this.abortSignal=e,this.abandonController=t,this.shouldTrackSyncIO=r,this.currentStage=1,this.syncInterruptReason=null,this.staticStageEndTime=1/0,this.runtimeStageEndTime=1/0,this.staticStageListeners=[],this.earlyRuntimeStageListeners=[],this.runtimeStageListeners=[],this.dynamicStageListeners=[],this.staticStagePromise=(0,o.createPromiseWithResolvers)(),this.earlyRuntimeStagePromise=(0,o.createPromiseWithResolvers)(),this.runtimeStagePromise=(0,o.createPromiseWithResolvers)(),this.dynamicStagePromise=(0,o.createPromiseWithResolvers)(),e&&e.addEventListener("abort",()=>{let{reason:t}=e;this.staticStagePromise.promise.catch(u),this.staticStagePromise.reject(t),this.earlyRuntimeStagePromise.promise.catch(u),this.earlyRuntimeStagePromise.reject(t),this.runtimeStagePromise.promise.catch(u),this.runtimeStagePromise.reject(t),this.dynamicStagePromise.promise.catch(u),this.dynamicStagePromise.reject(t)},{once:!0}),t&&t.signal.addEventListener("abort",()=>{this.abandonRender()},{once:!0})}onStage(e,t){if(this.currentStage>=e)t();else if(3===e)this.staticStageListeners.push(t);else if(4===e)this.earlyRuntimeStageListeners.push(t);else if(5===e)this.runtimeStageListeners.push(t);else if(6===e)this.dynamicStageListeners.push(t);else throw Object.defineProperty(new a.InvariantError(`Invalid render stage: ${e}`),"__NEXT_ERROR_CODE",{value:"E881",enumerable:!1,configurable:!0})}shouldTrackSyncInterrupt(){if(!this.shouldTrackSyncIO)return!1;switch(this.currentStage){case 1:case 5:case 6:case 7:default:return!1;case 2:case 3:case 4:return!0}}syncInterruptCurrentStageWithReason(e){if(1!==this.currentStage&&7!==this.currentStage){if(this.abandonController)return void this.abandonController.abort();if(this.abortSignal){this.syncInterruptReason=e,this.currentStage=7;return}switch(this.currentStage){case 2:case 3:case 4:this.syncInterruptReason=e,this.advanceStage(6);return;case 5:return}}}getSyncInterruptReason(){return this.syncInterruptReason}getStaticStageEndTime(){return this.staticStageEndTime}getRuntimeStageEndTime(){return this.runtimeStageEndTime}abandonRender(){let{currentStage:e}=this;switch(e){case 2:this.resolveStaticStage();case 3:this.resolveEarlyRuntimeStage();case 4:this.resolveRuntimeStage();case 5:this.currentStage=7;return}}advanceStage(e){if(e<=this.currentStage)return;let t=this.currentStage;if(this.currentStage=e,t<3&&e>=3&&this.resolveStaticStage(),t<4&&e>=4&&this.resolveEarlyRuntimeStage(),t<5&&e>=5&&(this.staticStageEndTime=performance.now()+performance.timeOrigin,this.resolveRuntimeStage()),t<6&&e>=6){this.runtimeStageEndTime=performance.now()+performance.timeOrigin,this.resolveDynamicStage();return}}resolveStaticStage(){let e=this.staticStageListeners;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.staticStagePromise.resolve()}resolveEarlyRuntimeStage(){let e=this.earlyRuntimeStageListeners;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.earlyRuntimeStagePromise.resolve()}resolveRuntimeStage(){let e=this.runtimeStageListeners;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.runtimeStagePromise.resolve()}resolveDynamicStage(){let e=this.dynamicStageListeners;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.dynamicStagePromise.resolve()}getStagePromise(e){switch(e){case 3:return this.staticStagePromise.promise;case 4:return this.earlyRuntimeStagePromise.promise;case 5:return this.runtimeStagePromise.promise;case 6:return this.dynamicStagePromise.promise;default:throw Object.defineProperty(new a.InvariantError(`Invalid render stage: ${e}`),"__NEXT_ERROR_CODE",{value:"E881",enumerable:!1,configurable:!0})}}waitForStage(e){return this.getStagePromise(e)}delayUntilStage(e,t,r){var n,s,i;let a,o=(n=this.getStagePromise(e),s=t,i=r,a=new Promise((e,t)=>{n.then(e.bind(null,i),t)}),void 0!==s&&(a.displayName=s),a);return this.abortSignal&&o.catch(u),o}}function u(){}},92717,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={delayUntilRuntimeStage:function(){return f},getRuntimeStage:function(){return p},isHangingPromiseRejectionError:function(){return a},makeDevtoolsIOAwarePromise:function(){return d},makeHangingPromise:function(){return u}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(61284);function a(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===o}let o="HANGING_PROMISE_REJECTION";class l extends Error{constructor(e,t){super(`During prerendering, ${t} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${e}".`),this.route=e,this.expression=t,this.digest=o}}let c=new WeakMap;function u(e,t,r){if(e.aborted)return Promise.reject(new l(t,r));{let n=new Promise((n,s)=>{let i=s.bind(null,new l(t,r)),a=c.get(e);if(a)a.push(i);else{let t=[i];c.set(e,t),e.addEventListener("abort",()=>{for(let e=0;e<t.length;e++)t[e]()},{once:!0})}});return n.catch(h),n}}function h(){}function d(e,t,r){return t.stagedRendering?t.stagedRendering.delayUntilStage(r,void 0,e):new Promise(t=>{setTimeout(()=>{t(e)},0)})}function p(e){return e.currentStage===i.RenderStage.EarlyStatic||e.currentStage===i.RenderStage.EarlyRuntime?i.RenderStage.EarlyRuntime:i.RenderStage.Runtime}function f(e,t){let{stagedRendering:r}=e;return r?r.waitForStage(p(r)).then(()=>t):t}},6544,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={METADATA_BOUNDARY_NAME:function(){return i},OUTLET_BOUNDARY_NAME:function(){return o},ROOT_LAYOUT_BOUNDARY_NAME:function(){return l},VIEWPORT_BOUNDARY_NAME:function(){return a}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i="__next_metadata_boundary__",a="__next_viewport_boundary__",o="__next_outlet_boundary__",l="__next_root_layout_boundary__"},24157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={atLeastOneTask:function(){return o},scheduleImmediate:function(){return a},scheduleOnNextTick:function(){return i},waitAtLeastOneReactRenderTask:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e=>{Promise.resolve().then(()=>{process.nextTick(e)})},a=e=>{setImmediate(e)};function o(){return new Promise(e=>a(e))}function l(){return new Promise(e=>setImmediate(e))}},41945,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={BailoutToCSRError:function(){return a},isBailoutToCSRError:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i="BAILOUT_TO_CLIENT_SIDE_RENDERING";class a extends Error{constructor(e){super(`Bail out to client-side rendering: ${e}`),this.reason=e,this.digest=i}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===i}},79829,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"INSTANT_VALIDATION_BOUNDARY_NAME",{enumerable:!0,get:function(){return n}});let n="__next_instant_validation_boundary__"},92777,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,s,i,a={DynamicHoleKind:function(){return Q},Postpone:function(){return x},PreludeState:function(){return ei},abortAndThrowOnSynchronousRequestDataAccess:function(){return P},abortOnSynchronousPlatformIOAccess:function(){return O},accessedDynamicData:function(){return L},annotateDynamicAccess:function(){return H},consumeDynamicAccess:function(){return M},createDynamicTrackingState:function(){return w},createDynamicValidationState:function(){return _},createHangingInputAbortSignal:function(){return q},createInstantValidationState:function(){return Z},createRenderInBrowserAbortSignal:function(){return B},formatDynamicAPIAccesses:function(){return U},getFirstDynamicReason:function(){return E},getNavigationDisallowedDynamicReasons:function(){return ec},getStaticShellDisallowedDynamicReasons:function(){return el},isDynamicPostpone:function(){return N},isPrerenderInterruptedError:function(){return $},logDisallowedDynamicError:function(){return ea},markCurrentScopeAsDynamic:function(){return S},postponeWithTracking:function(){return C},throwIfDisallowedDynamic:function(){return eo},throwToInterruptStaticGeneration:function(){return R},trackAllowedDynamicAccess:function(){return Y},trackDynamicDataInDynamicRender:function(){return T},trackDynamicHoleInNavigation:function(){return ee},trackDynamicHoleInRuntimeShell:function(){return er},trackDynamicHoleInStaticShell:function(){return en},trackThrownErrorInNavigation:function(){return et},useDynamicRouteParams:function(){return F},useDynamicSearchParams:function(){return G}};for(var o in a)Object.defineProperty(r,o,{enumerable:!0,get:a[o]});let l=(n=e.r(43005))&&n.__esModule?n:{default:n},c=e.r(4534),u=e.r(57573),h=e.r(32319),d=e.r(56704),p=e.r(92717),f=e.r(6544),g=e.r(24157),m=e.r(41945),b=e.r(68720),y=e.r(79829),v="function"==typeof l.default.unstable_postpone;function w(e){return{isDebugDynamicAccesses:e,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function _(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,dynamicMetadata:null,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function E(e){var t;return null==(t=e.dynamicAccesses[0])?void 0:t.expression}function S(e,t,r){if(t)switch(t.type){case"cache":case"unstable-cache":case"private-cache":return}if(!e.forceDynamic&&!e.forceStatic){if(e.dynamicShouldError)throw Object.defineProperty(new u.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${r}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(t)switch(t.type){case"prerender-ppr":return C(e.route,r,t.dynamicTracking);case"prerender-legacy":t.revalidate=0;let n=Object.defineProperty(new c.DynamicServerError(`Route ${e.route} couldn't be rendered statically because it used ${r}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw e.dynamicUsageDescription=r,e.dynamicUsageStack=n.stack,n}}}function R(e,t,r){let n=Object.defineProperty(new c.DynamicServerError(`Route ${t.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.revalidate=0,t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}function T(e){switch(e.type){case"cache":case"unstable-cache":case"private-cache":return}}function k(e,t,r){let n=D(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`);r.controller.abort(n);let s=r.dynamicTracking;s&&s.dynamicAccesses.push({stack:s.isDebugDynamicAccesses?Error().stack:void 0,expression:t})}function O(e,t,r,n){let s=n.dynamicTracking;k(e,t,n),s&&null===s.syncDynamicErrorWithStack&&(s.syncDynamicErrorWithStack=r)}function P(e,t,r,n){if(!1===n.controller.signal.aborted){k(e,t,n);let s=n.dynamicTracking;s&&null===s.syncDynamicErrorWithStack&&(s.syncDynamicErrorWithStack=r)}throw D(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`)}function x({reason:e,route:t}){let r=h.workUnitAsyncStorage.getStore();C(t,e,r&&"prerender-ppr"===r.type?r.dynamicTracking:null)}function C(e,t,r){(function(){if(!v)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})})(),r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:t}),l.default.unstable_postpone(A(e,t))}function A(e,t){return`Route ${e} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function N(e){return"object"==typeof e&&null!==e&&"string"==typeof e.message&&I(e.message)}function I(e){return e.includes("needs to bail out of prerendering at this point because it used")&&e.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===I(A("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let j="NEXT_PRERENDER_INTERRUPTED";function D(e){let t=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t.digest=j,t}function $(e){return"object"==typeof e&&null!==e&&e.digest===j&&"name"in e&&"message"in e&&e instanceof Error}function L(e){return e.length>0}function M(e,t){return e.dynamicAccesses.push(...t.dynamicAccesses),e.dynamicAccesses}function U(e){return e.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" (<anonymous>)")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}:
|
|
9
|
+
${t}`))}function B(){let e=new AbortController;return e.abort(Object.defineProperty(new m.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),e.signal}function q(e){switch(e.type){case"prerender":case"prerender-runtime":let t=new AbortController;if(e.cacheSignal)e.cacheSignal.inputReady().then(()=>{t.abort()});else if("prerender-runtime"===e.type&&e.stagedRendering){let{stagedRendering:r}=e;r.waitForStage((0,p.getRuntimeStage)(r)).then(()=>(0,g.scheduleOnNextTick)(()=>t.abort()))}else(0,g.scheduleOnNextTick)(()=>t.abort());return t.signal;case"prerender-client":case"validation-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":case"generate-static-params":return}}function H(e,t){let r=t.dynamicTracking;r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:e})}function F(e){let t=d.workAsyncStorage.getStore(),r=h.workUnitAsyncStorage.getStore();if(t&&r)switch(r.type){case"prerender-client":case"prerender":{let n=r.fallbackRouteParams;n&&n.size>0&&l.default.use((0,p.makeHangingPromise)(r.renderSignal,t.route,e));break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n&&n.size>0)return C(t.route,e,r.dynamicTracking);break}case"validation-client":case"prerender-legacy":case"request":case"unstable-cache":break;case"prerender-runtime":throw Object.defineProperty(new b.InvariantError(`\`${e}\` was called during a runtime prerender. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new b.InvariantError(`\`${e}\` was called inside a cache scope. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(new b.InvariantError(`\`${e}\` was called in \`generateStaticParams\`. Next.js should be preventing ${e} from being included in server component files statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1130",enumerable:!1,configurable:!0})}}function G(e){let t=d.workAsyncStorage.getStore(),r=h.workUnitAsyncStorage.getStore();if(t)switch(!r&&(0,h.throwForMissingRequestStore)(e),r.type){case"validation-client":case"request":return;case"prerender-client":l.default.use((0,p.makeHangingPromise)(r.renderSignal,t.route,e));break;case"prerender-legacy":case"prerender-ppr":if(t.forceStatic)return;throw Object.defineProperty(new m.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":throw Object.defineProperty(new b.InvariantError(`\`${e}\` was called from a Server Component. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E795",enumerable:!1,configurable:!0});case"cache":case"unstable-cache":case"private-cache":throw Object.defineProperty(new b.InvariantError(`\`${e}\` was called inside a cache scope. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(new b.InvariantError(`\`${e}\` was called in \`generateStaticParams\`. Next.js should be preventing ${e} from being included in server component files statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E1130",enumerable:!1,configurable:!0})}}let W=/\n\s+at Suspense \(<anonymous>\)/,V=RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${f.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),z=RegExp(`\\n\\s+at ${f.METADATA_BOUNDARY_NAME}[\\n\\s]`),X=RegExp(`\\n\\s+at ${f.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),K=RegExp(`\\n\\s+at ${f.OUTLET_BOUNDARY_NAME}[\\n\\s]`),J=RegExp(`\\n\\s+at ${y.INSTANT_VALIDATION_BOUNDARY_NAME}[\\n\\s]`);function Y(e,t,r,n){if(!K.test(t)){if(z.test(t)){r.hasDynamicMetadata=!0;return}if(X.test(t)){r.hasDynamicViewport=!0;return}if(V.test(t)){r.hasAllowedDynamic=!0,r.hasSuspenseAboveBody=!0;return}else if(W.test(t)){r.hasAllowedDynamic=!0;return}else{if(n.syncDynamicErrorWithStack)return void r.dynamicErrors.push(n.syncDynamicErrorWithStack);let s=es(Object.defineProperty(Error(`Route "${e.route}": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`),"__NEXT_ERROR_CODE",{value:"E1079",enumerable:!1,configurable:!0}),t,null);return void r.dynamicErrors.push(s)}}}var Q=((s={})[s.Runtime=1]="Runtime",s[s.Dynamic=2]="Dynamic",s);function Z(e){return{hasDynamicMetadata:!1,hasAllowedClientDynamicAboveBoundary:!1,dynamicMetadata:null,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[],validationPreventingErrors:[],thrownErrorsOutsideBoundary:[],createInstantStack:e}}function ee(e,t,r,n,s,i){if(K.test(t))return;if(z.test(t)){let n=es(Object.defineProperty(Error(`Route "${e.route}": ${1===s?"Runtime data such as `cookies()`, `headers()`, `params`, or `searchParams` was accessed inside `generateMetadata` or you have file-based metadata such as icons that depend on dynamic params segments.":"Uncached data or `connection()` was accessed inside `generateMetadata`."} Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),"__NEXT_ERROR_CODE",{value:"E1076",enumerable:!1,configurable:!0}),t,r.createInstantStack);r.dynamicMetadata=n;return}if(X.test(t)){let n=es(Object.defineProperty(Error(`Route "${e.route}": ${1===s?"Runtime data such as `cookies()`, `headers()`, `params`, or `searchParams` was accessed inside `generateViewport`.":"Uncached data or `connection()` was accessed inside `generateViewport`."} This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),"__NEXT_ERROR_CODE",{value:"E1086",enumerable:!1,configurable:!0}),t,r.createInstantStack);r.dynamicErrors.push(n);return}let a=J.exec(t);if(a){let e=W.exec(t);if(e&&e.index<a.index){r.hasAllowedDynamic=!0;return}}else if(i.expectedIds.size===i.renderedIds.size){r.hasAllowedClientDynamicAboveBoundary=!0,r.hasAllowedDynamic=!0;return}else{let n=es(Object.defineProperty(Error(`Route "${e.route}": Could not validate \`unstable_instant\` because a Client Component in a parent segment prevented the page from rendering.`),"__NEXT_ERROR_CODE",{value:"E1082",enumerable:!1,configurable:!0}),t,r.createInstantStack);r.validationPreventingErrors.push(n);return}if(n.syncDynamicErrorWithStack){let e=n.syncDynamicErrorWithStack;null!==r.createInstantStack&&void 0===e.cause&&(e.cause=r.createInstantStack()),r.dynamicErrors.push(e);return}let o=es(Object.defineProperty(Error(`Route "${e.route}": ${1===s?"Runtime data such as `cookies()`, `headers()`, `params`, or `searchParams` was accessed outside of `<Suspense>`.":"Uncached data or `connection()` was accessed outside of `<Suspense>`."} This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`),"__NEXT_ERROR_CODE",{value:"E1078",enumerable:!1,configurable:!0}),t,r.createInstantStack);r.dynamicErrors.push(o)}function et(e,t,r,n){let s=J.exec(n);if(s){let i=W.exec(n);if(i&&i.index<s.index)return;let a=es(Object.defineProperty(Error(`Route "${e.route}": Could not validate \`unstable_instant\` because an error prevented the target segment from rendering.`,{cause:r}),"__NEXT_ERROR_CODE",{value:"E1112",enumerable:!1,configurable:!0}),n,null);t.validationPreventingErrors.push(a)}else{let e=es(Object.defineProperty(Error("An error occurred while attempting to validate instant UI. This error may be preventing the validation from completing.",{cause:r}),"__NEXT_ERROR_CODE",{value:"E1118",enumerable:!1,configurable:!0}),n,null);t.thrownErrorsOutsideBoundary.push(e)}}function er(e,t,r,n){if(K.test(t))return;if(z.test(t)){r.dynamicMetadata=es(Object.defineProperty(Error(`Route "${e.route}": Uncached data or \`connection()\` was accessed inside \`generateMetadata\`. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),"__NEXT_ERROR_CODE",{value:"E1080",enumerable:!1,configurable:!0}),t,null);return}if(X.test(t)){let n=es(Object.defineProperty(Error(`Route "${e.route}": Uncached data or \`connection()\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),"__NEXT_ERROR_CODE",{value:"E1077",enumerable:!1,configurable:!0}),t,null);r.dynamicErrors.push(n);return}if(V.test(t)){r.hasAllowedDynamic=!0,r.hasSuspenseAboveBody=!0;return}if(W.test(t)){r.hasAllowedDynamic=!0;return}else if(n.syncDynamicErrorWithStack)return void r.dynamicErrors.push(n.syncDynamicErrorWithStack);let s=es(Object.defineProperty(Error(`Route "${e.route}": Uncached data or \`connection()\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`),"__NEXT_ERROR_CODE",{value:"E1084",enumerable:!1,configurable:!0}),t,null);r.dynamicErrors.push(s)}function en(e,t,r,n){if(!K.test(t)){if(z.test(t)){r.dynamicMetadata=es(Object.defineProperty(Error(`Route "${e.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateMetadata\` or you have file-based metadata such as icons that depend on dynamic params segments. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),"__NEXT_ERROR_CODE",{value:"E1085",enumerable:!1,configurable:!0}),t,null);return}if(X.test(t)){let n=es(Object.defineProperty(Error(`Route "${e.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),"__NEXT_ERROR_CODE",{value:"E1081",enumerable:!1,configurable:!0}),t,null);r.dynamicErrors.push(n);return}if(V.test(t)){r.hasAllowedDynamic=!0,r.hasSuspenseAboveBody=!0;return}else if(W.test(t)){r.hasAllowedDynamic=!0;return}else{if(n.syncDynamicErrorWithStack)return void r.dynamicErrors.push(n.syncDynamicErrorWithStack);let s=es(Object.defineProperty(Error(`Route "${e.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`),"__NEXT_ERROR_CODE",{value:"E1083",enumerable:!1,configurable:!0}),t,null);return void r.dynamicErrors.push(s)}}}function es(e,t,r){return null!==r&&(e.cause=r()),e.stack=e.name+": "+e.message+t,e}var ei=((i={})[i.Full=0]="Full",i[i.Empty=1]="Empty",i[i.Errored=2]="Errored",i);function ea(e,t){console.error(t),console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
|
|
10
|
+
- Start the app in development mode by running \`next dev\`, then open "${e.route}" in your browser to investigate the error.
|
|
11
|
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`)}function eo(e,t,r,n){if(n.syncDynamicErrorWithStack)throw ea(e,n.syncDynamicErrorWithStack),new u.StaticGenBailoutError;if(0!==t){if(r.hasSuspenseAboveBody)return;let n=r.dynamicErrors;if(n.length>0){for(let t=0;t<n.length;t++)ea(e,n[t]);throw new u.StaticGenBailoutError}if(r.hasDynamicViewport)throw console.error(`Route "${e.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new u.StaticGenBailoutError;if(1===t)throw console.error(`Route "${e.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new u.StaticGenBailoutError}else if(!1===r.hasAllowedDynamic&&r.hasDynamicMetadata)throw console.error(`Route "${e.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new u.StaticGenBailoutError}function el(e,t,r,n){if(n||r.hasSuspenseAboveBody)return[];if(0!==t){let n=r.dynamicErrors;if(n.length>0)return n;if(1===t)return[Object.defineProperty(new b.InvariantError(`Route "${e.route}" did not produce a static shell and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E936",enumerable:!1,configurable:!0})]}else if(!1===r.hasAllowedDynamic&&0===r.dynamicErrors.length&&r.dynamicMetadata)return[r.dynamicMetadata];return[]}function ec(e,t,r,n,s){if(n){let{missingSampleErrors:e}=n;if(e.length>0)return e}let{validationPreventingErrors:i}=r;if(i.length>0)return i;if(s.renderedIds.size<s.expectedIds.size){let{thrownErrorsOutsideBoundary:t,createInstantStack:n}=r;if(0===t.length){let t=`Route "${e.route}": Could not validate \`unstable_instant\` because the target segment was prevented from rendering for an unknown reason.`,r=null!==n?n():Error();return r.name="Error",r.message=t,[r]}if(1===t.length){let r=`Route "${e.route}": Could not validate \`unstable_instant\` because the target segment was prevented from rendering, likely due to the following error.`,s=null!==n?n():Error();return s.name="Error",s.message=r,[s,t[0]]}{let r=`Route "${e.route}": Could not validate \`unstable_instant\` because the target segment was prevented from rendering, likely due to one of the following errors.`,s=null!==n?n():Error();return s.name="Error",s.message=r,[s,...t]}}if(0!==t){let n=r.dynamicErrors;if(n.length>0)return n;if(1===t)return r.hasAllowedClientDynamicAboveBoundary?[]:[Object.defineProperty(new b.InvariantError(`Route "${e.route}" failed to render during instant validation and Next.js was unable to determine a reason.`),"__NEXT_ERROR_CODE",{value:"E1055",enumerable:!1,configurable:!0})]}else{let e=r.dynamicErrors;if(e.length>0)return e;if(!1===r.hasAllowedDynamic&&r.dynamicMetadata)return[r.dynamicMetadata]}return[]}},91347,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={isRequestAPICallableInsideAfter:function(){return c},throwForSearchParamsAccessInUseCache:function(){return l},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let i=e.r(57573),a=e.r(24725);function o(e,t){throw Object.defineProperty(new i.StaticGenBailoutError(`Route ${e} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function l(e,t){let r=Object.defineProperty(Error(`Route ${e.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E842",enumerable:!1,configurable:!0});throw Error.captureStackTrace(r,t),e.invalidDynamicUsageError??=r,r}function c(){let e=a.afterTaskAsyncStorage.getStore();return(null==e?void 0:e.rootTaskSpawnPhase)==="action"}},1396,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"connection",{enumerable:!0,get:function(){return u}});let n=e.r(56704),s=e.r(32319),i=e.r(92777),a=e.r(57573),o=e.r(92717),l=e.r(91347);e.r(61284);let c=e.r(68720);function u(){let e=n.workAsyncStorage.getStore(),t=s.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,l.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:"E827",enumerable:!1,configurable:!0});if(e.forceStatic)return Promise.resolve(void 0);if(e.dynamicShouldError)throw Object.defineProperty(new a.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:"E847",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:"E841",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,u),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:"E837",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,u),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:"E840",enumerable:!1,configurable:!0});case"generate-static-params":throw Object.defineProperty(Error(`Route ${e.route} used \`connection()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E1125",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,o.makeHangingPromise)(t.renderSignal,e.route,"`connection()`");case"validation-client":{let e="`connection`";throw Object.defineProperty(new c.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:"E1063",enumerable:!1,configurable:!0})}case"prerender-ppr":return(0,i.postponeWithTracking)(e.route,"connection",t.dynamicTracking);case"prerender-legacy":return(0,i.throwToInterruptStaticGeneration)("connection",e,t);case"request":if((0,i.trackDynamicDataInDynamicRender)(t),t.asyncApiPromises)return t.asyncApiPromises.connection;return Promise.resolve(void 0)}}(0,s.throwForMissingRequestStore)("connection")}},94773,(e,t,r)=>{let n={NextRequest:e.r(87054).NextRequest,NextResponse:e.r(12136).NextResponse,ImageResponse:e.r(52325).ImageResponse,userAgentFromString:e.r(14433).userAgentFromString,userAgent:e.r(14433).userAgent,URLPattern:e.r(79457).URLPattern,after:e.r(33354).after,connection:e.r(1396).connection};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},64742,(e,t,r)=>{"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.parseCookie=h,r.parse=h,r.stringifyCookie=function(e,t){let r=t?.encode||encodeURIComponent,n=[];for(let t of Object.keys(e)){let a=e[t];if(void 0===a)continue;if(!s.test(t))throw TypeError(`cookie name is invalid: ${t}`);let o=r(a);if(!i.test(o))throw TypeError(`cookie val is invalid: ${a}`);n.push(`${t}=${o}`)}return n.join("; ")},r.stringifySetCookie=d,r.serialize=d,r.parseSetCookie=function(e,t){let r=t?.decode||m,n=e.length,s=p(e,0,n),i=f(e,0,s),a=-1===i?{name:"",value:r(g(e,0,s))}:{name:g(e,0,i),value:r(g(e,i+1,s))},o=s+1;for(;o<n;){let t=p(e,o,n),r=f(e,o,t),s=-1===r?g(e,o,t):g(e,o,r),i=-1===r?void 0:g(e,r+1,t);switch(s.toLowerCase()){case"httponly":a.httpOnly=!0;break;case"secure":a.secure=!0;break;case"partitioned":a.partitioned=!0;break;case"domain":a.domain=i;break;case"path":a.path=i;break;case"max-age":i&&l.test(i)&&(a.maxAge=Number(i));break;case"expires":if(!i)break;let c=new Date(i);Number.isFinite(c.valueOf())&&(a.expires=c);break;case"priority":if(!i)break;let u=i.toLowerCase();("low"===u||"medium"===u||"high"===u)&&(a.priority=u);break;case"samesite":if(!i)break;let h=i.toLowerCase();("lax"===h||"strict"===h||"none"===h)&&(a.sameSite=h)}o=t+1}return a},r.stringifySetCookie=d,r.serialize=d;let s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,i=/^[\u0021-\u003A\u003C-\u007E]*$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,l=/^-?\d+$/,c=Object.prototype.toString,u=((n=function(){}).prototype=Object.create(null),n);function h(e,t){let r=new u,n=e.length;if(n<2)return r;let s=t?.decode||m,i=0;do{let t=f(e,i,n);if(-1===t)break;let a=p(e,i,n);if(t>a){i=e.lastIndexOf(";",t-1)+1;continue}let o=g(e,i,t);void 0===r[o]&&(r[o]=s(g(e,t+1,a))),i=a+1}while(i<n)return r}function d(e,t,r){let n="object"==typeof e?e:{...r,name:e,value:String(t)},l=("object"==typeof t?t:r)?.encode||encodeURIComponent;if(!s.test(n.name))throw TypeError(`argument name is invalid: ${n.name}`);let u=n.value?l(n.value):"";if(!i.test(u))throw TypeError(`argument val is invalid: ${n.value}`);let h=n.name+"="+u;if(void 0!==n.maxAge){if(!Number.isInteger(n.maxAge))throw TypeError(`option maxAge is invalid: ${n.maxAge}`);h+="; Max-Age="+n.maxAge}if(n.domain){if(!a.test(n.domain))throw TypeError(`option domain is invalid: ${n.domain}`);h+="; Domain="+n.domain}if(n.path){if(!o.test(n.path))throw TypeError(`option path is invalid: ${n.path}`);h+="; Path="+n.path}if(n.expires){var d;if(d=n.expires,"[object Date]"!==c.call(d)||!Number.isFinite(n.expires.valueOf()))throw TypeError(`option expires is invalid: ${n.expires}`);h+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(h+="; HttpOnly"),n.secure&&(h+="; Secure"),n.partitioned&&(h+="; Partitioned"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError(`option sameSite is invalid: ${n.sameSite}`)}return h}function p(e,t,r){let n=e.indexOf(";",t);return -1===n?r:n}function f(e,t,r){let n=e.indexOf("=",t);return n<r?n:-1}function g(e,t,r){let n=t,s=r;do{let t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<s)for(;s>n;){let t=e.charCodeAt(s-1);if(32!==t&&9!==t)break;s--}return e.slice(n,s)}function m(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},33344,e=>{"use strict";let t,r,n,s;async function i(){return"_ENTRIES"in globalThis&&_ENTRIES.middleware_instrumentation&&await _ENTRIES.middleware_instrumentation}e.i(21025);let a=null;async function o(){if("phase-production-build"===process.env.NEXT_PHASE)return;a||(a=i());let e=await a;if(null==e?void 0:e.register)try{await e.register()}catch(e){throw e.message=`An error occurred while loading instrumentation hook: ${e.message}`,e}}async function l(...e){let t=await i();try{var r;await (null==t||null==(r=t.onRequestError)?void 0:r.call(t,...e))}catch(e){console.error("Error in instrumentation.onRequestError:",e)}}let c=null;class u extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
|
|
12
|
+
|
|
13
|
+
export function middleware(request, event) {
|
|
14
|
+
return NextResponse.redirect('/new-location')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
18
|
+
`)}}class h extends Error{constructor(){super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ")}}class d extends Error{constructor(){super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ")}}let p="x-prerender-revalidate",f=".segments",g=".segment.rsc",m=".rsc",b=".json",y=".meta",v="x-next-cache-tags",w="x-next-revalidated-tags",_="_N_T_",E={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"};function S(e){var t,r,n,s,i,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,i=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),s=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(i=!0,o=s,a.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!i||o>=e.length)&&a.push(e.substring(t,e.length))}return a}function R(e){let t={},r=[];if(e)for(let[n,s]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...S(s)),t[n]=1===r.length?r[0]:r):t[n]=s;return t}function T(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}({...E,GROUP:{builtinReact:[E.reactServerComponents,E.actionBrowser],serverOnly:[E.reactServerComponents,E.actionBrowser,E.instrument,E.middleware],neutralTarget:[E.apiNode,E.apiEdge],clientOnly:[E.serverSideRendering,E.appPagesBrowser],bundled:[E.reactServerComponents,E.actionBrowser,E.serverSideRendering,E.appPagesBrowser,E.shared,E.instrument,E.middleware],appPages:[E.reactServerComponents,E.serverSideRendering,E.appPagesBrowser,E.actionBrowser]}});let k=Symbol("response"),O=Symbol("passThrough"),P=Symbol("waitUntil");class x{constructor(e,t){this[O]=!1,this[P]=t?{kind:"external",function:t}:{kind:"internal",promises:[]}}respondWith(e){this[k]||(this[k]=Promise.resolve(e))}passThroughOnException(){this[O]=!0}waitUntil(e){if("external"===this[P].kind)return(0,this[P].function)(e);this[P].promises.push(e)}}class C extends x{constructor(e){var t;super(e.request,null==(t=e.context)?void 0:t.waitUntil),this.sourcePage=e.page}get request(){throw Object.defineProperty(new u({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new u({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}function A(e){return e.replace(/\/$/,"")||"/"}function N(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function I(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:s}=N(e);return`${t}${r}${n}${s}`}function j(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:n,hash:s}=N(e);return`${r}${t}${n}${s}`}function D(e,t){if("string"!=typeof e)return!1;let{pathname:r}=N(e);return r===t||r.startsWith(t+"/")}let $=new WeakMap;function L(e,t){let r;if(!t)return{pathname:e};let n=$.get(t);n||(n=t.map(e=>e.toLowerCase()),$.set(t,n));let s=e.split("/",2);if(!s[1])return{pathname:e};let i=s[1].toLowerCase(),a=n.indexOf(i);return a<0?{pathname:e}:(r=t[a],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}let M=/^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/;function U(e,t){let r=new URL(String(e),t&&String(t));return M.test(r.hostname)&&(r.hostname="localhost"),r}let B=Symbol("NextURLInternal");class q{constructor(e,t,r){let n,s;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,s=r||{}):s=r||t||{},this[B]={url:U(e,n??s.base),options:s,basePath:""},this.analyze()}analyze(){var e,t,r,n,s;let i=function(e,t){let{basePath:r,i18n:n,trailingSlash:s}=t.nextConfig??{},i={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):s};r&&D(i.pathname,r)&&(i.pathname=function(e,t){if(!D(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:`/${r}`}(i.pathname,r),i.basePath=r);let a=i.pathname;if(i.pathname.startsWith("/_next/data/")&&i.pathname.endsWith(".json")){let e=i.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");i.buildId=e[0],a="index"!==e[1]?`/${e.slice(1).join("/")}`:"/",!0===t.parseData&&(i.pathname=a)}if(n){let e=t.i18nProvider?t.i18nProvider.analyze(i.pathname):L(i.pathname,n.locales);i.locale=e.detectedLocale,i.pathname=e.pathname??i.pathname,!e.detectedLocale&&i.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(a):L(a,n.locales)).detectedLocale&&(i.locale=e.detectedLocale)}return i}(this[B].url.pathname,{nextConfig:this[B].options.nextConfig,parseData:!0,i18nProvider:this[B].options.i18nProvider}),a=function(e,t){let r;if(t?.host&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}(this[B].url,this[B].options.headers);this[B].domainLocale=this[B].options.i18nProvider?this[B].options.i18nProvider.detectDomainLocale(a):function(e,t,r){if(e){for(let n of(r&&(r=r.toLowerCase()),e))if(t===n.domain?.split(":",1)[0].toLowerCase()||r===n.defaultLocale.toLowerCase()||n.locales?.some(e=>e.toLowerCase()===r))return n}}(null==(t=this[B].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,a);let o=(null==(r=this[B].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[B].options.nextConfig)||null==(n=s.i18n)?void 0:n.defaultLocale);this[B].url.pathname=i.pathname,this[B].defaultLocale=o,this[B].basePath=i.basePath??"",this[B].buildId=i.buildId,this[B].locale=i.locale??o,this[B].trailingSlash=i.trailingSlash}formatPathname(){var e;let t;return t=function(e,t,r,n){if(!t||t===r)return e;let s=e.toLowerCase();return!n&&(D(s,"/api")||D(s,`/${t.toLowerCase()}`))?e:I(e,`/${t}`)}((e={basePath:this[B].basePath,buildId:this[B].buildId,defaultLocale:this[B].options.forceLocale?void 0:this[B].defaultLocale,locale:this[B].locale,pathname:this[B].url.pathname,trailingSlash:this[B].trailingSlash}).pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix),(e.buildId||!e.trailingSlash)&&(t=A(t)),e.buildId&&(t=j(I(t,`/_next/data/${e.buildId}`),"/"===e.pathname?"index.json":".json")),t=I(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:j(t,"/"):A(t)}formatSearch(){return this[B].url.search}get buildId(){return this[B].buildId}set buildId(e){this[B].buildId=e}get locale(){return this[B].locale??""}set locale(e){var t,r;if(!this[B].locale||!(null==(r=this[B].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[B].locale=e}get defaultLocale(){return this[B].defaultLocale}get domainLocale(){return this[B].domainLocale}get searchParams(){return this[B].url.searchParams}get host(){return this[B].url.host}set host(e){this[B].url.host=e}get hostname(){return this[B].url.hostname}set hostname(e){this[B].url.hostname=e}get port(){return this[B].url.port}set port(e){this[B].url.port=e}get protocol(){return this[B].url.protocol}set protocol(e){this[B].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[B].url=U(e),this.analyze()}get origin(){return this[B].url.origin}get pathname(){return this[B].url.pathname}set pathname(e){this[B].url.pathname=e}get hash(){return this[B].url.hash}set hash(e){this[B].url.hash=e}get search(){return this[B].url.search}set search(e){this[B].url.search=e}get password(){return this[B].url.password}set password(e){this[B].url.password=e}get username(){return this[B].url.username}set username(e){this[B].url.username=e}get basePath(){return this[B].basePath}set basePath(e){this[B].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new q(String(this),this[B].options)}}var H,F,G,W,V,z,X,K,J,Y,Q,Z,ee,et,er,en,es,ei,ea,eo,el,ec,eu,eh,ed,ep,ef,eg=e.i(75306);let em=Symbol("internal request");class eb extends Request{constructor(e,t={}){const r="string"!=typeof e&&"url"in e?e.url:String(e);T(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);const n=new q(r,{headers:R(this.headers),nextConfig:t.nextConfig});this[em]={cookies:new eg.RequestCookies(this.headers),nextUrl:n,url:n.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[em].cookies}get nextUrl(){return this[em].nextUrl}get page(){throw new h}get ua(){throw new d}get url(){return this[em].url}}class ey{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}let ev=Symbol("internal response"),ew=new Set([301,302,303,307,308]);function e_(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,s]of e.request.headers)t.set("x-middleware-request-"+n,s),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class eE extends Response{constructor(e,t={}){super(e,t);const r=this.headers,n=new Proxy(new eg.ResponseCookies(r),{get(e,n,s){switch(n){case"delete":case"set":return(...s)=>{let i=Reflect.apply(e[n],e,s),a=new Headers(r);return i instanceof eg.ResponseCookies&&r.set("x-middleware-set-cookie",i.getAll().map(e=>(0,eg.stringifyCookie)(e)).join(",")),e_(t,a),i};default:return ey.get(e,n,s)}}});this[ev]={cookies:n,url:t.url?new q(t.url,{headers:R(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[ev].cookies}static json(e,t){let r=Response.json(e,t);return new eE(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!ew.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:{},s=new Headers(null==n?void 0:n.headers);return s.set("Location",T(e)),new eE(null,{...n,headers:s,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",T(e)),e_(t,r),new eE(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),e_(e,t),new eE(null,{...e,headers:t})}}function eS(e,t){let r="string"==typeof t?new URL(t):t,n=new URL(e,t),s=n.origin===r.origin;return{url:s?n.toString().slice(r.origin.length):n.toString(),isRelative:s}}let eR="next-router-prefetch",eT=["rsc","next-router-state-tree",eR,"next-hmr-refresh","next-router-segment-prefetch"],ek="_rsc";function eO(e){return e.startsWith("/")?e:`/${e}`}function eP(e){return eO(e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:`${e}/${t}`:e,""))}class ex extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new ex}}class eC extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return ey.get(t,r,n);let s=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===s);if(void 0!==i)return ey.get(t,i,n)},set(t,r,n,s){if("symbol"==typeof r)return ey.set(t,r,n,s);let i=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===i);return ey.set(t,a??r,n,s)},has(t,r){if("symbol"==typeof r)return ey.has(t,r);let n=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==s&&ey.has(t,s)},deleteProperty(t,r){if("symbol"==typeof r)return ey.deleteProperty(t,r);let n=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===s||ey.deleteProperty(t,s)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return ex.callable;default:return ey.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new eC(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}var eA=e.i(56704);class eN extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new eN}}class eI{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return eN.callable;default:return ey.get(e,t,r)}}})}}let ej=Symbol.for("next.mutated.cookies");class eD{static wrap(e,t){let r=new eg.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let n=[],s=new Set,i=()=>{let e=eA.workAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=1),n=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of n){let r=new eg.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},a=new Proxy(r,{get(e,t,r){switch(t){case ej:return n;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),a}finally{i()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),a}finally{i()}};default:return ey.get(e,t,r)}}});return a}}function e$(e,t){if("action"!==e.phase)throw new eN}var eL=((H=eL||{}).handleRequest="BaseServer.handleRequest",H.run="BaseServer.run",H.pipe="BaseServer.pipe",H.getStaticHTML="BaseServer.getStaticHTML",H.render="BaseServer.render",H.renderToResponseWithComponents="BaseServer.renderToResponseWithComponents",H.renderToResponse="BaseServer.renderToResponse",H.renderToHTML="BaseServer.renderToHTML",H.renderError="BaseServer.renderError",H.renderErrorToResponse="BaseServer.renderErrorToResponse",H.renderErrorToHTML="BaseServer.renderErrorToHTML",H.render404="BaseServer.render404",H),eM=((F=eM||{}).loadDefaultErrorComponents="LoadComponents.loadDefaultErrorComponents",F.loadComponents="LoadComponents.loadComponents",F),eU=((G=eU||{}).getRequestHandler="NextServer.getRequestHandler",G.getRequestHandlerWithMetadata="NextServer.getRequestHandlerWithMetadata",G.getServer="NextServer.getServer",G.getServerRequestHandler="NextServer.getServerRequestHandler",G.createServer="createServer.createServer",G),eB=((W=eB||{}).compression="NextNodeServer.compression",W.getBuildId="NextNodeServer.getBuildId",W.createComponentTree="NextNodeServer.createComponentTree",W.clientComponentLoading="NextNodeServer.clientComponentLoading",W.getLayoutOrPageModule="NextNodeServer.getLayoutOrPageModule",W.generateStaticRoutes="NextNodeServer.generateStaticRoutes",W.generateFsStaticRoutes="NextNodeServer.generateFsStaticRoutes",W.generatePublicRoutes="NextNodeServer.generatePublicRoutes",W.generateImageRoutes="NextNodeServer.generateImageRoutes.route",W.sendRenderResult="NextNodeServer.sendRenderResult",W.proxyRequest="NextNodeServer.proxyRequest",W.runApi="NextNodeServer.runApi",W.render="NextNodeServer.render",W.renderHTML="NextNodeServer.renderHTML",W.imageOptimizer="NextNodeServer.imageOptimizer",W.getPagePath="NextNodeServer.getPagePath",W.getRoutesManifest="NextNodeServer.getRoutesManifest",W.findPageComponents="NextNodeServer.findPageComponents",W.getFontManifest="NextNodeServer.getFontManifest",W.getServerComponentManifest="NextNodeServer.getServerComponentManifest",W.getRequestHandler="NextNodeServer.getRequestHandler",W.renderToHTML="NextNodeServer.renderToHTML",W.renderError="NextNodeServer.renderError",W.renderErrorToHTML="NextNodeServer.renderErrorToHTML",W.render404="NextNodeServer.render404",W.startResponse="NextNodeServer.startResponse",W.route="route",W.onProxyReq="onProxyReq",W.apiResolver="apiResolver",W.internalFetch="internalFetch",W),eq=((V=eq||{}).startServer="startServer.startServer",V),eH=((z=eH||{}).getServerSideProps="Render.getServerSideProps",z.getStaticProps="Render.getStaticProps",z.renderToString="Render.renderToString",z.renderDocument="Render.renderDocument",z.createBodyResult="Render.createBodyResult",z),eF=((X=eF||{}).renderToString="AppRender.renderToString",X.renderToReadableStream="AppRender.renderToReadableStream",X.getBodyResult="AppRender.getBodyResult",X.fetch="AppRender.fetch",X),eG=((K=eG||{}).executeRoute="Router.executeRoute",K),eW=((J=eW||{}).runHandler="Node.runHandler",J),eV=((Y=eV||{}).runHandler="AppRouteRouteHandlers.runHandler",Y),ez=((Q=ez||{}).generateMetadata="ResolveMetadata.generateMetadata",Q.generateViewport="ResolveMetadata.generateViewport",Q),eX=((Z=eX||{}).execute="Middleware.execute",Z);let eK=new Set(["Middleware.execute","BaseServer.handleRequest","Render.getServerSideProps","Render.getStaticProps","AppRender.fetch","AppRender.getBodyResult","Render.renderDocument","Node.runHandler","AppRouteRouteHandlers.runHandler","ResolveMetadata.generateMetadata","ResolveMetadata.generateViewport","NextNodeServer.createComponentTree","NextNodeServer.findPageComponents","NextNodeServer.getLayoutOrPageModule","NextNodeServer.startResponse","NextNodeServer.clientComponentLoading"]),eJ=new Set(["NextNodeServer.findPageComponents","NextNodeServer.createComponentTree","NextNodeServer.clientComponentLoading"]);function eY(e){return null!==e&&"object"==typeof e&&"then"in e&&"function"==typeof e.then}let eQ=process.env.NEXT_OTEL_PERFORMANCE_PREFIX;try{t=e.r(70406)}catch(r){t=e.r(82617)}let{context:eZ,propagation:e0,trace:e1,SpanStatusCode:e2,SpanKind:e3,ROOT_CONTEXT:e4}=t;class e5 extends Error{constructor(e,t){super(),this.bubble=e,this.result=t}}let e6=(e,t)=>{"object"==typeof t&&null!==t&&t instanceof e5&&t.bubble?e.setAttribute("next.bubble",!0):(t&&(e.recordException(t),e.setAttribute("error.type",t.name)),e.setStatus({code:e2.ERROR,message:null==t?void 0:t.message})),e.end()},e8=new Map,e9=t.createContextKey("next.rootSpanId"),e7=0,te={set(e,t,r){e.push({key:t,value:r})}},tt=(s=new class e{getTracerInstance(){return e1.getTracer("next.js","0.0.1")}getContext(){return eZ}getTracePropagationData(){let e=eZ.active(),t=[];return e0.inject(e,t,te),t}getActiveScopeSpan(){return e1.getSpan(null==eZ?void 0:eZ.active())}withPropagatedContext(e,t,r,n=!1){let s=eZ.active();if(n){let n=e0.extract(e4,e,r);if(e1.getSpanContext(n))return eZ.with(n,t);let i=e0.extract(s,e,r);return eZ.with(i,t)}if(e1.getSpanContext(s))return t();let i=e0.extract(s,e,r);return eZ.with(i,t)}trace(...e){let[t,r,n]=e,{fn:s,options:i}="function"==typeof r?{fn:r,options:{}}:{fn:n,options:{...r}},a=i.spanName??t;if(!eK.has(t)&&"1"!==process.env.NEXT_OTEL_VERBOSE||i.hideSpan)return s();let o=this.getSpanContext((null==i?void 0:i.parentSpan)??this.getActiveScopeSpan());o||(o=(null==eZ?void 0:eZ.active())??e4);let l=o.getValue(e9),c="number"!=typeof l||!e8.has(l),u=e7++;return i.attributes={"next.span_name":a,"next.span_type":t,...i.attributes},eZ.with(o.setValue(e9,u),()=>this.getTracerInstance().startActiveSpan(a,i,e=>{let r;eQ&&t&&eJ.has(t)&&(r="performance"in globalThis&&"measure"in performance?globalThis.performance.now():void 0);let n=!1,a=()=>{!n&&(n=!0,e8.delete(u),r&&performance.measure(`${eQ}:next-${(t.split(".").pop()||"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}`,{start:r,end:performance.now()}))};if(c&&e8.set(u,new Map(Object.entries(i.attributes??{}))),s.length>1)try{return s(e,t=>e6(e,t))}catch(t){throw e6(e,t),t}finally{a()}try{let t=s(e);if(eY(t))return t.then(t=>(e.end(),t)).catch(t=>{throw e6(e,t),t}).finally(a);return e.end(),a(),t}catch(t){throw e6(e,t),a(),t}}))}wrap(...e){let t=this,[r,n,s]=3===e.length?e:[e[0],{},e[1]];return eK.has(r)||"1"===process.env.NEXT_OTEL_VERBOSE?function(){let e=n;"function"==typeof e&&"function"==typeof s&&(e=e.apply(this,arguments));let i=arguments.length-1,a=arguments[i];if("function"!=typeof a)return t.trace(r,e,()=>s.apply(this,arguments));{let n=t.getContext().bind(eZ.active(),a);return t.trace(r,e,(e,t)=>(arguments[i]=function(e){return null==t||t(e),n.apply(this,arguments)},s.apply(this,arguments)))}}:s}startSpan(...e){let[t,r]=e,n=this.getSpanContext((null==r?void 0:r.parentSpan)??this.getActiveScopeSpan());return this.getTracerInstance().startSpan(t,r,n)}getSpanContext(e){return e?e1.setSpan(eZ.active(),e):void 0}getRootSpanAttributes(){let e=eZ.active().getValue(e9);return e8.get(e)}setRootSpanAttribute(e,t){let r=eZ.active().getValue(e9),n=e8.get(r);n&&!n.has(e)&&n.set(e,t)}withSpan(e,t){let r=e1.setSpan(eZ.active(),e);return eZ.with(r,t)}},()=>s),tr="__prerender_bypass";Symbol("__next_preview_data"),Symbol(tr);class tn{constructor(e,t,r,n){var s;const i=e&&function(e,t){let r=eC.from(e.headers);return{isOnDemandRevalidate:r.get(p)===t.previewModeId,revalidateOnlyGenerated:r.has("x-prerender-revalidate-if-generated")}}(t,e).isOnDemandRevalidate,a=null==(s=r.get(tr))?void 0:s.value;this._isEnabled=!!(!i&&a&&e&&a===e.previewModeId),this._previewModeId=null==e?void 0:e.previewModeId,this._mutableCookies=n}get isEnabled(){return this._isEnabled}enable(){if(!this._previewModeId)throw Object.defineProperty(Error("Invariant: previewProps missing previewModeId this should never happen"),"__NEXT_ERROR_CODE",{value:"E93",enumerable:!1,configurable:!0});this._mutableCookies.set({name:tr,value:this._previewModeId,httpOnly:!0,sameSite:"none",secure:!0,path:"/"}),this._isEnabled=!0}disable(){this._mutableCookies.set({name:tr,value:"",httpOnly:!0,sameSite:"none",secure:!0,path:"/",expires:new Date(0)}),this._isEnabled=!1}}function ts(e,t){if("x-middleware-set-cookie"in e.headers&&"string"==typeof e.headers["x-middleware-set-cookie"]){let r=e.headers["x-middleware-set-cookie"],n=new Headers;for(let e of S(r))n.append("set-cookie",e);for(let e of new eg.ResponseCookies(n).getAll())t.set(e)}}var ti=e.i(32319),ta=e.i(72710);class to extends Error{constructor(e,t){super(`Invariant: ${e.endsWith(".")?e:e+"."} This is a bug in Next.js.`,t),this.name="InvariantError"}}var tl=e.i(51187);process.env.NEXT_PRIVATE_DEBUG_CACHE,Symbol.for("@next/cache-handlers");let tc=Symbol.for("@next/cache-handlers-map"),tu=Symbol.for("@next/cache-handlers-set"),th=globalThis;function td(){if(th[tc])return th[tc].entries()}async function tp(e,t){if(!e)return t();let r=tf(e);try{return await t()}finally{var n,s,i,a;let t,o,l,c,u=(n=r,s=tf(e),t=new Set(n.pendingRevalidatedTags.map(e=>{let t="object"==typeof e.profile?JSON.stringify(e.profile):e.profile||"";return`${e.tag}:${t}`})),o=new Set(n.pendingRevalidateWrites),{pendingRevalidatedTags:s.pendingRevalidatedTags.filter(e=>{let r="object"==typeof e.profile?JSON.stringify(e.profile):e.profile||"";return!t.has(`${e.tag}:${r}`)}),pendingRevalidates:Object.fromEntries(Object.entries(s.pendingRevalidates).filter(([e])=>!(e in n.pendingRevalidates))),pendingRevalidateWrites:s.pendingRevalidateWrites.filter(e=>!o.has(e))});await (i=e,l=[],(c=(null==(a=u)?void 0:a.pendingRevalidatedTags)??i.pendingRevalidatedTags??[]).length>0&&l.push(tg(c,i.incrementalCache,i)),l.push(...Object.values((null==a?void 0:a.pendingRevalidates)??i.pendingRevalidates??{})),l.push(...(null==a?void 0:a.pendingRevalidateWrites)??i.pendingRevalidateWrites??[]),0!==l.length&&Promise.all(l).then(()=>void 0))}}function tf(e){return{pendingRevalidatedTags:e.pendingRevalidatedTags?[...e.pendingRevalidatedTags]:[],pendingRevalidates:{...e.pendingRevalidates},pendingRevalidateWrites:e.pendingRevalidateWrites?[...e.pendingRevalidateWrites]:[]}}async function tg(e,t,r){if(0===e.length)return;let n=function(){if(th[tu])return th[tu].values()}(),s=[],i=new Map;for(let t of e){let e,r=t.profile;for(let[t]of i)if("string"==typeof t&&"string"==typeof r&&t===r||"object"==typeof t&&"object"==typeof r&&JSON.stringify(t)===JSON.stringify(r)||t===r){e=t;break}let n=e||r;i.has(n)||i.set(n,[]),i.get(n).push(t.tag)}for(let[e,o]of i){let i;if(e){let t;if("object"==typeof e)t=e;else if("string"==typeof e){var a;if(!(t=null==r||null==(a=r.cacheLifeProfiles)?void 0:a[e]))throw Object.defineProperty(Error(`Invalid profile provided "${e}" must be configured under cacheLife in next.config or be "max"`),"__NEXT_ERROR_CODE",{value:"E873",enumerable:!1,configurable:!0})}t&&(i={expire:t.expire})}for(let t of n||[])e?s.push(null==t.updateTags?void 0:t.updateTags.call(t,o,i)):s.push(null==t.updateTags?void 0:t.updateTags.call(t,o));t&&s.push(t.revalidateTag(o,i))}await Promise.all(s)}let tm=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class tb{disable(){throw tm}getStore(){}run(){throw tm}exit(){throw tm}enterWith(){throw tm}static bind(e){return e}}let ty="u">typeof globalThis&&globalThis.AsyncLocalStorage;var tv=e.i(24725);class tw{constructor({waitUntil:e,onClose:t,onTaskError:r}){this.workUnitStores=new Set,this.waitUntil=e,this.onClose=t,this.onTaskError=r,this.callbackQueue=new ta.default,this.callbackQueue.pause()}after(e){if(eY(e))this.waitUntil||t_(),this.waitUntil(e.catch(e=>this.reportTaskError("promise",e)));else if("function"==typeof e)this.addCallback(e);else throw Object.defineProperty(Error("`after()`: Argument must be a promise or a function"),"__NEXT_ERROR_CODE",{value:"E50",enumerable:!1,configurable:!0})}addCallback(e){var t;this.waitUntil||t_();let r=ti.workUnitAsyncStorage.getStore();r&&this.workUnitStores.add(r);let n=tv.afterTaskAsyncStorage.getStore(),s=n?n.rootTaskSpawnPhase:null==r?void 0:r.phase;this.runCallbacksOnClosePromise||(this.runCallbacksOnClosePromise=this.runCallbacksOnClose(),this.waitUntil(this.runCallbacksOnClosePromise));let i=(t=async()=>{try{await tv.afterTaskAsyncStorage.run({rootTaskSpawnPhase:s},()=>e())}catch(e){this.reportTaskError("function",e)}},ty?ty.bind(t):tb.bind(t));this.callbackQueue.add(i)}async runCallbacksOnClose(){return await new Promise(e=>this.onClose(e)),this.runCallbacks()}async runCallbacks(){if(0===this.callbackQueue.size)return;for(let e of this.workUnitStores)e.phase="after";let e=eA.workAsyncStorage.getStore();if(!e)throw Object.defineProperty(new to("Missing workStore in AfterContext.runCallbacks"),"__NEXT_ERROR_CODE",{value:"E547",enumerable:!1,configurable:!0});return tp(e,()=>(this.callbackQueue.start(),this.callbackQueue.onIdle()))}reportTaskError(e,t){if(console.error("promise"===e?"A promise passed to `after()` rejected:":"An error occurred in a function passed to `after()`:",t),this.onTaskError)try{null==this.onTaskError||this.onTaskError.call(this,t)}catch(e){console.error(Object.defineProperty(new to("`onTaskError` threw while handling an error thrown from an `after` task",{cause:e}),"__NEXT_ERROR_CODE",{value:"E569",enumerable:!1,configurable:!0}))}}}function t_(){throw Object.defineProperty(Error("`after()` will not work correctly, because `waitUntil` is not available in the current environment."),"__NEXT_ERROR_CODE",{value:"E91",enumerable:!1,configurable:!0})}function tE(e){let t,r={then:(n,s)=>(t||(t=Promise.resolve(e())),t.then(e=>{r.value=e}).catch(()=>{}),t.then(n,s))};return r}class tS{onClose(e){if(this.isClosed)throw Object.defineProperty(Error("Cannot subscribe to a closed CloseController"),"__NEXT_ERROR_CODE",{value:"E365",enumerable:!1,configurable:!0});this.target.addEventListener("close",e),this.listeners++}dispatchClose(){if(this.isClosed)throw Object.defineProperty(Error("Cannot close a CloseController multiple times"),"__NEXT_ERROR_CODE",{value:"E229",enumerable:!1,configurable:!0});this.listeners>0&&this.target.dispatchEvent(new Event("close")),this.isClosed=!0}constructor(){this.target=new EventTarget,this.listeners=0,this.isClosed=!1}}function tR(){return{previewModeId:process.env.__NEXT_PREVIEW_MODE_ID||"",previewModeSigningKey:process.env.__NEXT_PREVIEW_MODE_SIGNING_KEY||"",previewModeEncryptionKey:process.env.__NEXT_PREVIEW_MODE_ENCRYPTION_KEY||""}}let tT=Symbol.for("@next/request-context");async function tk(e,t,r){let n=new Set;for(let t of(e=>{let t=["/layout"];if(e.startsWith("/")){let r=e.split("/");for(let e=1;e<r.length+1;e++){let n=r.slice(0,e).join("/");n&&(n.endsWith("/page")||n.endsWith("/route")||(n=`${n}${!n.endsWith("/")?"/":""}layout`),t.push(n))}}return t})(e))t=`${_}${t}`,n.add(t);if(t&&(!r||0===r.size)){let e=`${_}${t}`;n.add(e)}n.has(`${_}/`)&&n.add(`${_}/index`),n.has(`${_}/index`)&&n.add(`${_}/`);let s=Array.from(n);return{tags:s,expirationsByCacheKind:function(e){let t=new Map,r=td();if(r)for(let[n,s]of r)"getExpiration"in s&&t.set(n,tE(async()=>s.getExpiration(e)));return t}(s)}}let tO=Symbol.for("NextInternalRequestMeta");class tP extends eb{constructor(e){super(e.input,e.init),this.sourcePage=e.page}get request(){throw Object.defineProperty(new u({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}respondWith(){throw Object.defineProperty(new u({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}waitUntil(){throw Object.defineProperty(new u({page:this.sourcePage}),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0})}}let tx={keys:e=>Array.from(e.keys()),get:(e,t)=>e.get(t)??void 0},tC=(e,t)=>tt().withPropagatedContext(e.headers,t,tx),tA=!1;async function tN(t){var r,n,s,i,a;let l,u,h,d,p;!function(){if(!tA&&(tA=!0,"true"===process.env.NEXT_PRIVATE_TEST_PROXY)){let{interceptTestApis:t,wrapRequestHandler:r}=e.r(26526);t(),tC=r(tC)}}(),await (!c&&(c=o()),c);let f=void 0!==globalThis.__BUILD_MANIFEST;t.request.url=t.request.url.replace(/\.rsc($|\?)/,"$1");let g=t.bypassNextUrl?new URL(t.request.url):new q(t.request.url,{headers:t.request.headers,nextConfig:t.request.nextConfig});for(let e of[...g.searchParams.keys()]){let t=g.searchParams.getAll(e),r=function(e){for(let t of["nxtP","nxtI"])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}(e);if(r){for(let e of(g.searchParams.delete(r),t))g.searchParams.append(r,e);g.searchParams.delete(e)}}let m=process.env.__NEXT_BUILD_ID||"";"buildId"in g&&(m=g.buildId||"",g.buildId="");let b=function(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}(t.request.headers),y=b.has("x-nextjs-data"),v="1"===b.get("rsc");y&&"/index"===g.pathname&&(g.pathname="/");let w=new Map;if(!f)for(let e of eT){let t=b.get(e);null!==t&&(w.set(e,t),b.delete(e))}let _=g.searchParams.get(ek),E=new tP({page:t.page,input:((d=(h="string"==typeof g)?new URL(g):g).searchParams.delete(ek),h?d.toString():d).toString(),init:{body:t.request.body,headers:b,method:t.request.method,nextConfig:t.request.nextConfig,signal:t.request.signal}});t.request.requestMeta&&(a=t.request.requestMeta,E[tO]=a),y&&Object.defineProperty(E,"__isData",{enumerable:!1,value:!0}),!globalThis.__incrementalCacheShared&&t.IncrementalCache&&(globalThis.__incrementalCache=new t.IncrementalCache({CurCacheHandler:t.incrementalCacheHandler,minimalMode:!0,fetchCacheKeyPrefix:"",dev:!1,requestHeaders:t.request.headers,getPrerenderManifest:()=>({version:-1,routes:{},dynamicRoutes:{},notFoundRoutes:[],preview:tR()})}));let S=t.request.waitUntil??(null==(r=null==(p=globalThis[tT])?void 0:p.get())?void 0:r.waitUntil),R=new C({request:E,page:t.page,context:S?{waitUntil:S}:void 0});if((l=await tC(E,()=>{if("/middleware"===t.page||"/src/middleware"===t.page||"/proxy"===t.page||"/src/proxy"===t.page){let e=R.waitUntil.bind(R),r=new tS;return tt().trace(eX.execute,{spanName:`middleware ${E.method}`,attributes:{"http.target":E.nextUrl.pathname,"http.method":E.method}},async()=>{try{var n,s,i,a,o,l;let c=tR(),h=await tk("/",E.nextUrl.pathname,null),d=(o=E.nextUrl,l=e=>{u=e},function(e,t,r,n,s,i,a,o,l,c){function u(e){r&&r.setHeader("Set-Cookie",e)}let h={};return{type:"request",phase:e,implicitTags:i,url:{pathname:n.pathname,search:n.search??""},rootParams:s,get headers(){return h.headers||(h.headers=function(e){let t=eC.from(e);for(let e of eT)t.delete(e);return eC.seal(t)}(t.headers)),h.headers},get cookies(){if(!h.cookies){let e=new eg.RequestCookies(eC.from(t.headers));ts(t,e),h.cookies=eI.seal(e)}return h.cookies},set cookies(value){h.cookies=value},get mutableCookies(){if(!h.mutableCookies){var d,p;let e,n=(d=t.headers,p=a||(r?u:void 0),e=new eg.RequestCookies(eC.from(d)),eD.wrap(e,p));ts(t,n),h.mutableCookies=n}return h.mutableCookies},get userspaceMutableCookies(){if(!h.userspaceMutableCookies){var f;let e;f=this,h.userspaceMutableCookies=e=new Proxy(f.mutableCookies,{get(t,r,n){switch(r){case"delete":return function(...r){return e$(f,"cookies().delete"),t.delete(...r),e};case"set":return function(...r){return e$(f,"cookies().set"),t.set(...r),e};default:return ey.get(t,r,n)}}})}return h.userspaceMutableCookies},get draftMode(){return h.draftMode||(h.draftMode=new tn(o,t,this.cookies,this.mutableCookies)),h.draftMode},renderResumeDataCache:null,isHmrRefresh:l,serverComponentsHmrCache:c||globalThis.__serverComponentsHmrCache,fallbackParams:null}}("action",E,void 0,o,{},h,l,c,!1,void 0)),p=function({page:e,renderOpts:t,isPrefetchRequest:r,buildId:n,deploymentId:s,previouslyRevalidatedTags:i,nonce:a}){let o=!t.shouldWaitOnAllReady&&!t.supportsDynamicResponse&&!t.isDraftMode&&!t.isPossibleServerAction,l=o&&(!!process.env.NEXT_DEBUG_BUILD||"1"===process.env.NEXT_SSG_FETCH_METRICS),c={isStaticGeneration:o,page:e,route:eP(e),incrementalCache:t.incrementalCache||globalThis.__incrementalCache,cacheLifeProfiles:t.cacheLifeProfiles,isBuildTimePrerendering:t.isBuildTimePrerendering,fetchCache:t.fetchCache,isOnDemandRevalidate:t.isOnDemandRevalidate,isDraftMode:t.isDraftMode,isPrefetchRequest:r,buildId:n,deploymentId:s,reactLoadableManifest:(null==t?void 0:t.reactLoadableManifest)||{},assetPrefix:(null==t?void 0:t.assetPrefix)||"",nonce:a,afterContext:function(e){let{waitUntil:t,onClose:r,onAfterTaskError:n}=e;return new tw({waitUntil:t,onClose:r,onTaskError:n})}(t),cacheComponentsEnabled:t.cacheComponents,previouslyRevalidatedTags:i,refreshTagsByCacheKind:function(){let e=new Map,t=td();if(t)for(let[r,n]of t)"refreshTags"in n&&e.set(r,tE(async()=>n.refreshTags()));return e}(),runInCleanSnapshot:ty?ty.snapshot():function(e,...t){return e(...t)},shouldTrackFetchMetrics:l,reactServerErrorsByDigest:new Map};return t.store=c,c}({page:"/",renderOpts:{cacheLifeProfiles:null==(s=t.request.nextConfig)||null==(n=s.experimental)?void 0:n.cacheLife,cacheComponents:!1,experimental:{isRoutePPREnabled:!1,authInterrupts:!!(null==(a=t.request.nextConfig)||null==(i=a.experimental)?void 0:i.authInterrupts)},supportsDynamicResponse:!0,waitUntil:e,onClose:r.onClose.bind(r),onAfterTaskError:void 0},isPrefetchRequest:"1"===E.headers.get(eR),buildId:m??"",deploymentId:!1??"",previouslyRevalidatedTags:[]});return await eA.workAsyncStorage.run(p,()=>ti.workUnitAsyncStorage.run(d,t.handler,E,R))}finally{setTimeout(()=>{r.dispatchClose()},0)}})}return t.handler(E,R)}))&&!(l instanceof Response))throw Object.defineProperty(TypeError("Expected an instance of Response to be returned"),"__NEXT_ERROR_CODE",{value:"E567",enumerable:!1,configurable:!0});l&&u&&l.headers.set("set-cookie",u);let T=null==l?void 0:l.headers.get("x-middleware-rewrite");if(l&&T&&(v||!f)){let e=new q(T,{forceLocale:!0,headers:t.request.headers,nextConfig:t.request.nextConfig});f||e.host!==E.nextUrl.host||(e.buildId=m||e.buildId,l.headers.set("x-middleware-rewrite",String(e)));let{url:r,isRelative:a}=eS(e.toString(),g.toString());!f&&y&&l.headers.set("x-nextjs-rewrite",r);let o=!a&&(null==(i=t.request.nextConfig)||null==(s=i.experimental)||null==(n=s.clientParamParsingOrigins)?void 0:n.some(t=>new RegExp(t).test(e.origin)));v&&(a||o)&&(g.pathname!==e.pathname&&l.headers.set("x-nextjs-rewritten-path",e.pathname),g.search!==e.search&&l.headers.set("x-nextjs-rewritten-query",e.search.slice(1)))}if(l&&T&&v&&_){let e=new URL(T);e.searchParams.has(ek)||(e.searchParams.set(ek,_),l.headers.set("x-middleware-rewrite",e.toString()))}let k=null==l?void 0:l.headers.get("Location");if(l&&k&&!f){let e=new q(k,{forceLocale:!1,headers:t.request.headers,nextConfig:t.request.nextConfig});l=new Response(l.body,l),e.host===g.host&&(e.buildId=m||e.buildId,l.headers.set("Location",eS(e,g).url)),y&&(l.headers.delete("Location"),l.headers.set("x-nextjs-redirect",eS(e.toString(),g.toString()).url))}let O=l||eE.next(),x=O.headers.get("x-middleware-override-headers"),A=[];if(x){for(let[e,t]of w)O.headers.set(`x-middleware-request-${e}`,t),A.push(e);A.length>0&&O.headers.set("x-middleware-override-headers",x+","+A.join(","))}return{response:O,waitUntil:("internal"===R[P].kind?Promise.all(R[P].promises).then(()=>{}):void 0)??Promise.resolve(),fetchMetrics:E.fetchMetrics}}class tI{constructor(){let e,t;this.promise=new Promise((r,n)=>{e=r,t=n}),this.resolve=e,this.reject=t}}class tj{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class tD{constructor(){this.prev=null,this.next=null}}class t${constructor(e,t,r){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.onEvict=r,this.head=new tD,this.tail=new tD,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<=0)throw Object.defineProperty(Error(`LRUCache: calculateSize returned ${r}, but size must be > 0. Items with size 0 would never be evicted, causing unbounded cache growth.`),"__NEXT_ERROR_CODE",{value:"E1045",enumerable:!1,configurable:!0});if(r>this.maxSize)return console.warn("Single item size exceeds maxSize"),!1;let n=this.cache.get(e);if(n)n.data=t,this.totalSize=this.totalSize-n.size+r,n.size=r,this.moveToHead(n);else{let n=new tj(e,t,r);this.cache.set(e,n),this.addToHead(n),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,null==this.onEvict||this.onEvict.call(this,e.key,e.data)}return!0}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}}let{env:tL,stdout:tM}=(null==(el=globalThis)?void 0:el.process)??{},tU=tL&&!tL.NO_COLOR&&(tL.FORCE_COLOR||(null==tM?void 0:tM.isTTY)&&!tL.CI&&"dumb"!==tL.TERM),tB=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),a=i.indexOf(t);return~a?s+tB(i,t,r,a):s+i},tq=(e,t,r=e)=>tU?n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+tB(s,t,r,i)+t:e+s+t}:String,tH=tq("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m");tq("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),tq("\x1b[3m","\x1b[23m"),tq("\x1b[4m","\x1b[24m"),tq("\x1b[7m","\x1b[27m"),tq("\x1b[8m","\x1b[28m"),tq("\x1b[9m","\x1b[29m"),tq("\x1b[30m","\x1b[39m");let tF=tq("\x1b[31m","\x1b[39m"),tG=tq("\x1b[32m","\x1b[39m"),tW=tq("\x1b[33m","\x1b[39m");tq("\x1b[34m","\x1b[39m");let tV=tq("\x1b[35m","\x1b[39m");tq("\x1b[38;2;173;127;168m","\x1b[39m"),tq("\x1b[36m","\x1b[39m");let tz=tq("\x1b[37m","\x1b[39m");tq("\x1b[90m","\x1b[39m"),tq("\x1b[40m","\x1b[49m"),tq("\x1b[41m","\x1b[49m"),tq("\x1b[42m","\x1b[49m"),tq("\x1b[43m","\x1b[49m"),tq("\x1b[44m","\x1b[49m"),tq("\x1b[45m","\x1b[49m"),tq("\x1b[46m","\x1b[49m"),tq("\x1b[47m","\x1b[49m"),tz(tH("○")),tF(tH("⨯")),tW(tH("⚠")),tz(tH(" ")),tG(tH("✓")),tV(tH("»")),new t$(1e4,e=>e.length),new t$(1e4,e=>e.length);var tX=((ee={}).APP_PAGE="APP_PAGE",ee.APP_ROUTE="APP_ROUTE",ee.PAGES="PAGES",ee.FETCH="FETCH",ee.REDIRECT="REDIRECT",ee.IMAGE="IMAGE",ee),tK=((et={}).APP_PAGE="APP_PAGE",et.APP_ROUTE="APP_ROUTE",et.PAGES="PAGES",et.FETCH="FETCH",et.IMAGE="IMAGE",et);function tJ(){}new TextEncoder;let tY=new TextEncoder;function tQ(e){return new ReadableStream({start(t){t.enqueue(tY.encode(e)),t.close()}})}function tZ(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function t0(e,t){let r=new TextDecoder("utf-8",{fatal:!0}),n="";for await(let s of e){if(null==t?void 0:t.aborted)return n;n+=r.decode(s,{stream:!0})}return n+r.decode()}let t1="ResponseAborted";class t2 extends Error{constructor(...e){super(...e),this.name=t1}}let t3=0,t4=0,t5=0;function t6(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===t1}async function t8(e,t,r){try{let n,{errored:s,destroyed:i}=t;if(s||i)return;let a=(n=new AbortController,t.once("close",()=>{t.writableFinished||n.abort(new t2)}),n),o=function(e,t){let r=!1,n=new tI;function s(){n.resolve()}e.on("drain",s),e.once("close",()=>{e.off("drain",s),n.resolve()});let i=new tI;return e.once("finish",()=>{i.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===t3?void 0:{clientComponentLoadStart:t3,clientComponentLoadTimes:t4,clientComponentLoadCount:t5};return e.reset&&(t3=0,t4=0,t5=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),tt().trace(eB.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new tI)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),i.promise}})}(t,r);await e.pipeTo(o,{signal:a.signal})}catch(e){if(t6(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class t9{static #e=this.EMPTY=new t9(null,{metadata:{},contentType:null});static fromStatic(e,t){return new t9(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new to("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return t0(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?tQ(this.response):Buffer.isBuffer(this.response)?tZ(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),s=1;for(;s<e.length-1;s++){let t=e[s];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let i=e[s];return(n=n.then(()=>i.pipeTo(r))).catch(tJ),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[tQ(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[tZ(this.response)]:[this.response]}pipeThrough(e){this.response=this.readable.pipeThrough(e)}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(t6(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await t8(this.readable,e,this.waitUntil)}}function t7(e,t){if(!e)return t;let r=parseInt(e,10);return Number.isFinite(r)&&r>0?r:t}t7(process.env.NEXT_PRIVATE_RESPONSE_CACHE_TTL,1e4),t7(process.env.NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE,150);var re=e.i(8735);class rt{constructor(e){this.fs=e,this.tasks=[]}findOrCreateTask(e){for(let t of this.tasks)if(t[0]===e)return t;let t=this.fs.mkdir(e);t.catch(()=>{});let r=[e,t,[]];return this.tasks.push(r),r}append(e,t){let r=this.findOrCreateTask(re.default.dirname(e)),n=r[1].then(()=>this.fs.writeFile(e,t));n.catch(()=>{}),r[2].push(n)}wait(){return Promise.all(this.tasks.flatMap(e=>e[2]))}}var rr=e.i(96476);class rn{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor(e){this.fs=e.fs,this.flushToDisk=e.flushToDisk,this.serverDistDir=e.serverDistDir,this.revalidatedTags=e.revalidatedTags,e.maxMemoryCacheSize?rn.memoryCache?rn.debug&&console.log("FileSystemCache: memory store already initialized"):(rn.debug&&console.log("FileSystemCache: using memory store for fetch cache"),rn.memoryCache=(0,rr.getMemoryCache)(e.maxMemoryCacheSize)):rn.debug&&console.log("FileSystemCache: not using memory store for fetch cache")}resetRequestCache(){}async revalidateTag(e,t){if(e="string"==typeof e?[e]:e,rn.debug&&console.log("FileSystemCache: revalidateTag",e,t),0===e.length)return;let r=Date.now();for(let n of e){let e=tl.tagsManifest.get(n)||{};if(t){let s={...e};s.stale=r,void 0!==t.expire&&(s.expired=r+1e3*t.expire),tl.tagsManifest.set(n,s)}else tl.tagsManifest.set(n,{...e,expired:r})}}async get(...e){var t,r,n,s,i,a,o,l,c;let[u,h]=e,{kind:d}=h,p=null==(t=rn.memoryCache)?void 0:t.get(u);if(rn.debug&&(d===tK.FETCH?console.log("FileSystemCache: get",u,h.tags,d,!!p):console.log("FileSystemCache: get",u,d,!!p)),!p)try{if(d===tK.APP_ROUTE){let e=this.getFilePath(`${u}.body`,tK.APP_ROUTE),t=await this.fs.readFile(e),{mtime:r}=await this.fs.stat(e),n=JSON.parse(await this.fs.readFile(e.replace(/\.body$/,y),"utf8"));p={lastModified:r.getTime(),value:{kind:tX.APP_ROUTE,body:t,headers:n.headers,status:n.status}}}else{let e=this.getFilePath(d===tK.FETCH?u:`${u}.html`,d),t=await this.fs.readFile(e,"utf8"),{mtime:r}=await this.fs.stat(e);if(d===tK.FETCH){let{tags:e,fetchIdx:n,fetchUrl:s}=h;if(!this.flushToDisk)return null;let i=r.getTime(),l=JSON.parse(t);if(p={lastModified:i,value:l},(null==(a=p.value)?void 0:a.kind)===tX.FETCH){let t=null==(o=p.value)?void 0:o.tags;(null==e?void 0:e.every(e=>null==t?void 0:t.includes(e)))||(rn.debug&&console.log("FileSystemCache: tags vs storedTags mismatch",e,t),await this.set(u,p.value,{fetchCache:!0,tags:e,fetchIdx:n,fetchUrl:s}))}}else if(d===tK.APP_PAGE){let n,s,i;try{n=JSON.parse(await this.fs.readFile(e.replace(/\.html$/,y),"utf8"))}catch{}if(null==n?void 0:n.segmentPaths){let e=new Map;s=e;let t=u+f;await Promise.all(n.segmentPaths.map(async r=>{let n=this.getFilePath(t+r+g,tK.APP_PAGE);try{e.set(r,await this.fs.readFile(n))}catch{}}))}h.isFallback||h.isRoutePPREnabled&&(null==n?void 0:n.postponed)!=null||(i=await this.fs.readFile(this.getFilePath(`${u}${m}`,tK.APP_PAGE))),p={lastModified:r.getTime(),value:{kind:tX.APP_PAGE,html:t,rscData:i,postponed:null==n?void 0:n.postponed,headers:null==n?void 0:n.headers,status:null==n?void 0:n.status,segmentData:s}}}else if(d===tK.PAGES){let e,n={};h.isFallback||(n=JSON.parse(await this.fs.readFile(this.getFilePath(`${u}${b}`,tK.PAGES),"utf8"))),p={lastModified:r.getTime(),value:{kind:tX.PAGES,html:t,pageData:n,headers:null==e?void 0:e.headers,status:null==e?void 0:e.status}}}else throw Object.defineProperty(Error(`Invariant: Unexpected route kind ${d} in file system cache.`),"__NEXT_ERROR_CODE",{value:"E445",enumerable:!1,configurable:!0})}p&&(null==(l=rn.memoryCache)||l.set(u,p))}catch{return null}if((null==p||null==(r=p.value)?void 0:r.kind)===tX.APP_PAGE||(null==p||null==(n=p.value)?void 0:n.kind)===tX.APP_ROUTE||(null==p||null==(s=p.value)?void 0:s.kind)===tX.PAGES){let e=null==(c=p.value.headers)?void 0:c[v];if("string"==typeof e){let t=e.split(",");if(t.length>0&&(0,tl.areTagsExpired)(t,p.lastModified))return rn.debug&&console.log("FileSystemCache: expired tags",t),null}}else if((null==p||null==(i=p.value)?void 0:i.kind)===tX.FETCH){let e=h.kind===tK.FETCH?[...h.tags||[],...h.softTags||[]]:[];if(e.some(e=>this.revalidatedTags.includes(e)))return rn.debug&&console.log("FileSystemCache: was revalidated",e),null;if((0,tl.areTagsExpired)(e,p.lastModified))return rn.debug&&console.log("FileSystemCache: expired tags",e),null}return p??null}async set(e,t,r){var n;if(null==(n=rn.memoryCache)||n.set(e,{value:t,lastModified:Date.now()}),rn.debug&&console.log("FileSystemCache: set",e),!this.flushToDisk||!t)return;let s=new rt(this.fs);if(t.kind===tX.APP_ROUTE){let r=this.getFilePath(`${e}.body`,tK.APP_ROUTE);s.append(r,t.body);let n={headers:t.headers,status:t.status,postponed:void 0,segmentPaths:void 0,prefetchHints:void 0};s.append(r.replace(/\.body$/,y),JSON.stringify(n,null,2))}else if(t.kind===tX.PAGES||t.kind===tX.APP_PAGE){let n=t.kind===tX.APP_PAGE,i=this.getFilePath(`${e}.html`,n?tK.APP_PAGE:tK.PAGES);if(s.append(i,t.html),r.fetchCache||r.isFallback||r.isRoutePPREnabled||s.append(this.getFilePath(`${e}${n?m:b}`,n?tK.APP_PAGE:tK.PAGES),n?t.rscData:JSON.stringify(t.pageData)),(null==t?void 0:t.kind)===tX.APP_PAGE){let e;if(t.segmentData){e=[];let r=i.replace(/\.html$/,f);for(let[n,i]of t.segmentData){e.push(n);let t=r+n+g;s.append(t,i)}}let r={headers:t.headers,status:t.status,postponed:t.postponed,segmentPaths:e,prefetchHints:void 0};s.append(i.replace(/\.html$/,y),JSON.stringify(r))}}else if(t.kind===tX.FETCH){let n=this.getFilePath(e,tK.FETCH);s.append(n,JSON.stringify({...t,tags:r.fetchCache?r.tags:[]}))}await s.wait()}getFilePath(e,t){switch(t){case tK.FETCH:return re.default.join(this.serverDistDir,"..","cache","fetch-cache",e);case tK.PAGES:return re.default.join(this.serverDistDir,"pages",e);case tK.IMAGE:case tK.APP_PAGE:case tK.APP_ROUTE:return re.default.join(this.serverDistDir,"app",e);default:throw Object.defineProperty(Error(`Unexpected file path kind: ${t}`),"__NEXT_ERROR_CODE",{value:"E479",enumerable:!1,configurable:!0})}}}let rs=["(..)(..)","(.)","(..)","(...)"],ri=/\/[^/]*\[[^/]+\][^/]*(?=\/|$)/,ra=/\/\[[^/]+\](?=\/|$)/;"u">typeof performance&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class ro extends Error{}function rl(e){return e.replace(/(?:\/index)?\/?$/,"")||"/"}var rc=e.i(55292);e.i(59073);class ru{static #e=this.debug=!!process.env.NEXT_PRIVATE_DEBUG_CACHE;constructor({fs:e,dev:t,flushToDisk:r,minimalMode:n,serverDistDir:s,requestHeaders:i,maxMemoryCacheSize:a,getPrerenderManifest:o,fetchCacheKeyPrefix:l,CurCacheHandler:c,allowedRevalidateHeaderKeys:u}){var h,d,f,g;this.locks=new Map,this.hasCustomCacheHandler=!!c;const m=Symbol.for("@next/cache-handlers"),b=globalThis;if(c)ru.debug&&console.log("IncrementalCache: using custom cache handler",c.name);else{const t=b[m];(null==t?void 0:t.FetchCache)?(c=t.FetchCache,ru.debug&&console.log("IncrementalCache: using global FetchCache cache handler")):e&&s&&(ru.debug&&console.log("IncrementalCache: using filesystem cache handler"),c=rn)}process.env.__NEXT_TEST_MAX_ISR_CACHE&&(a=parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE,10)),this.dev=t,this.disableForTestmode="true"===process.env.NEXT_PRIVATE_TEST_PROXY,this.minimalMode=n,this.requestHeaders=i,this.allowedRevalidateHeaderKeys=u,this.prerenderManifest=o(),this.cacheControls=new rc.SharedCacheControls(this.prerenderManifest),this.fetchCacheKeyPrefix=l;let y=[];i[p]===(null==(d=this.prerenderManifest)||null==(h=d.preview)?void 0:h.previewModeId)&&(this.isOnDemandRevalidate=!0),n&&(y=this.revalidatedTags=function(e,t){return"string"==typeof e[w]&&e["x-next-revalidate-tag-token"]===t?e[w].split(","):[]}(i,null==(g=this.prerenderManifest)||null==(f=g.preview)?void 0:f.previewModeId)),c&&(this.cacheHandler=new c({dev:t,fs:e,flushToDisk:r,serverDistDir:s,revalidatedTags:y,maxMemoryCacheSize:a,_requestHeaders:i,fetchCacheKeyPrefix:l}))}calculateRevalidate(e,t,r,n){if(r)return Math.floor(performance.timeOrigin+performance.now()-1e3);let s=this.cacheControls.get(rl(e)),i=s?s.revalidate:!n&&1;return"number"==typeof i?1e3*i+t:i}_getPathname(t,r){return r?t:function(t){let r=/^\/index(\/|$)/.test(t)&&!function(e,t=!0){return(void 0!==e.split("/").find(e=>rs.find(t=>e.startsWith(t)))&&(e=function(e){let t,r,n;for(let s of e.split("/"))if(r=rs.find(e=>s.startsWith(e))){[t,n]=e.split(r,2);break}if(!t||!r||!n)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`),"__NEXT_ERROR_CODE",{value:"E269",enumerable:!1,configurable:!0});switch(t=eP(t),r){case"(.)":n="/"===t?`/${n}`:t+"/"+n;break;case"(..)":if("/"===t)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`),"__NEXT_ERROR_CODE",{value:"E207",enumerable:!1,configurable:!0});n=t.split("/").slice(0,-1).concat(n).join("/");break;case"(...)":n="/"+n;break;case"(..)(..)":let s=t.split("/");if(s.length<=2)throw Object.defineProperty(Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`),"__NEXT_ERROR_CODE",{value:"E486",enumerable:!1,configurable:!0});n=s.slice(0,-2).concat(n).join("/");break;default:throw Object.defineProperty(Error("Invariant: unexpected marker"),"__NEXT_ERROR_CODE",{value:"E112",enumerable:!1,configurable:!0})}return{interceptingRoute:t,interceptedRoute:n}}(e).interceptedRoute),t)?ra.test(e):ri.test(e)}(t)?`/index${t}`:"/"===t?"/index":eO(t);{let{posix:t}=e.r(14747),n=t.normalize(r);if(n!==r)throw new ro(`Requested and resolved page mismatch: ${r} ${n}`)}return r}(t)}resetRequestCache(){var e,t;null==(t=this.cacheHandler)||null==(e=t.resetRequestCache)||e.call(t)}async lock(e){for(;;){let t=this.locks.get(e);if(ru.debug&&console.log("IncrementalCache: lock get",e,!!t),!t)break;await t}let{resolve:t,promise:r}=new tI;return ru.debug&&console.log("IncrementalCache: successfully locked",e),this.locks.set(e,r),()=>{t(),this.locks.delete(e)}}async revalidateTag(e,t){var r;return null==(r=this.cacheHandler)?void 0:r.revalidateTag(e,t)}async generateCacheKey(t,r={}){let n=[],s=new TextEncoder,i=new TextDecoder;if(r.body)if(r.body instanceof Uint8Array)n.push(i.decode(r.body)),r._ogBody=r.body;else if("function"==typeof r.body.getReader){let e=r.body,t=[];try{await e.pipeTo(new WritableStream({write(e){"string"==typeof e?(t.push(s.encode(e)),n.push(e)):(t.push(e),n.push(i.decode(e,{stream:!0})))}})),n.push(i.decode());let a=t.reduce((e,t)=>e+t.length,0),o=new Uint8Array(a),l=0;for(let e of t)o.set(e,l),l+=e.length;r._ogBody=o}catch(e){console.error("Problem reading body",e)}}else if("function"==typeof r.body.keys){let e=r.body;for(let t of(r._ogBody=r.body,new Set([...e.keys()]))){let r=e.getAll(t);n.push(`${t}=${(await Promise.all(r.map(async e=>"string"==typeof e?e:await e.text()))).join(",")}`)}}else if("function"==typeof r.body.arrayBuffer){let e=r.body,t=await e.arrayBuffer();n.push(await e.text()),r._ogBody=new Blob([t],{type:e.type})}else"string"==typeof r.body&&(n.push(r.body),r._ogBody=r.body);let a="function"==typeof(r.headers||{}).keys?Object.fromEntries(r.headers):Object.assign({},r.headers);"traceparent"in a&&delete a.traceparent,"tracestate"in a&&delete a.tracestate;let o=JSON.stringify(["v3",this.fetchCacheKeyPrefix||"",t,r.method,a,r.mode,r.redirect,r.credentials,r.referrer,r.referrerPolicy,r.integrity,r.cache,n]);return e.r(54799).createHash("sha256").update(o).digest("hex")}async get(e,t){var r,n,s,i,a,o,l;let c,u;if(t.kind===tK.FETCH){let r=ti.workUnitAsyncStorage.getStore(),n=r?(0,ti.getRenderResumeDataCache)(r):null;if(n){let r=n.fetch.get(e);if((null==r?void 0:r.kind)===tX.FETCH){let n=eA.workAsyncStorage.getStore();if(![...t.tags||[],...t.softTags||[]].some(e=>{var t,r;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==n||null==(r=n.pendingRevalidatedTags)?void 0:r.some(t=>t.tag===e))}))return ru.debug&&console.log("IncrementalCache: rdc:hit",e),{isStale:!1,value:r};ru.debug&&console.log("IncrementalCache: rdc:revalidated-tag",e)}else ru.debug&&console.log("IncrementalCache: rdc:miss",e)}else ru.debug&&console.log("IncrementalCache: rdc:no-resume-data")}if(this.disableForTestmode||this.dev&&(t.kind!==tK.FETCH||"no-cache"===this.requestHeaders["cache-control"]))return null;e=this._getPathname(e,t.kind===tK.FETCH);let h=await (null==(r=this.cacheHandler)?void 0:r.get(e,t));if(t.kind===tK.FETCH){if(!h)return null;if((null==(s=h.value)?void 0:s.kind)!==tX.FETCH)throw Object.defineProperty(new to(`Expected cached value for cache key ${JSON.stringify(e)} to be a "FETCH" kind, got ${JSON.stringify(null==(i=h.value)?void 0:i.kind)} instead.`),"__NEXT_ERROR_CODE",{value:"E653",enumerable:!1,configurable:!0});let r=eA.workAsyncStorage.getStore(),n=[...t.tags||[],...t.softTags||[]];if(n.some(e=>{var t,n;return(null==(t=this.revalidatedTags)?void 0:t.includes(e))||(null==r||null==(n=r.pendingRevalidatedTags)?void 0:n.some(t=>t.tag===e))}))return ru.debug&&console.log("IncrementalCache: expired tag",e),null;let a=ti.workUnitAsyncStorage.getStore();if(a){let t=(0,ti.getPrerenderResumeDataCache)(a);t&&(ru.debug&&console.log("IncrementalCache: rdc:set",e),t.fetch.set(e,h.value))}let o=t.revalidate||h.value.revalidate,l=(performance.timeOrigin+performance.now()-(h.lastModified||0))/1e3>o,c=h.value.data;return(0,tl.areTagsExpired)(n,h.lastModified)?null:((0,tl.areTagsStale)(n,h.lastModified)&&(l=!0),{isStale:l,value:{kind:tX.FETCH,data:c,revalidate:o}})}if((null==h||null==(n=h.value)?void 0:n.kind)===tX.FETCH)throw Object.defineProperty(new to(`Expected cached value for cache key ${JSON.stringify(e)} not to be a ${JSON.stringify(t.kind)} kind, got "FETCH" instead.`),"__NEXT_ERROR_CODE",{value:"E652",enumerable:!1,configurable:!0});let d=null,{isFallback:p}=t,f=this.cacheControls.get(rl(e));if((null==h?void 0:h.lastModified)===-1)c=-1,u=-31536e6;else{let r=performance.timeOrigin+performance.now(),n=(null==h?void 0:h.lastModified)||r;if(void 0===(c=!1!==(u=this.calculateRevalidate(e,n,this.dev??!1,t.isFallback))&&u<r||void 0)&&((null==h||null==(a=h.value)?void 0:a.kind)===tX.APP_PAGE||(null==h||null==(o=h.value)?void 0:o.kind)===tX.APP_ROUTE)){let e=null==(l=h.value.headers)?void 0:l[v];if("string"==typeof e){let t=e.split(",");t.length>0&&((0,tl.areTagsExpired)(t,n)?c=-1:(0,tl.areTagsStale)(t,n)&&(c=!0))}}}return h&&(d={isStale:c,cacheControl:f,revalidateAfter:u,value:h.value,isFallback:p}),!h&&this.prerenderManifest.notFoundRoutes.includes(e)&&(d={isStale:c,value:null,cacheControl:f,revalidateAfter:u,isFallback:p},this.set(e,d.value,{...t,cacheControl:f})),d}async set(e,t,r){if((null==t?void 0:t.kind)===tX.FETCH){let r=ti.workUnitAsyncStorage.getStore(),n=r?(0,ti.getPrerenderResumeDataCache)(r):null;n&&(ru.debug&&console.log("IncrementalCache: rdc:set",e),n.fetch.set(e,t))}if(this.disableForTestmode||this.dev&&!r.fetchCache)return;e=this._getPathname(e,r.fetchCache);let n=JSON.stringify(t).length;if(r.fetchCache&&n>2097152&&!this.hasCustomCacheHandler&&!r.isImplicitBuildTimeCache){let t=`Failed to set Next.js data cache for ${r.fetchUrl||e}, items over 2MB can not be cached (${n} bytes)`;if(this.dev)throw Object.defineProperty(Error(t),"__NEXT_ERROR_CODE",{value:"E1003",enumerable:!1,configurable:!0});console.warn(t);return}try{var s;!r.fetchCache&&r.cacheControl&&this.cacheControls.set(rl(e),r.cacheControl),await (null==(s=this.cacheHandler)?void 0:s.set(e,t,r))}catch(t){console.warn("Failed to update prerender cache for",e,t)}}}var rh=e.i(94773);class rd extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class rp extends rd{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class rf extends rd{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class rg extends rd{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}(er=ec||(ec={})).Any="any",er.ApNortheast1="ap-northeast-1",er.ApNortheast2="ap-northeast-2",er.ApSouth1="ap-south-1",er.ApSoutheast1="ap-southeast-1",er.ApSoutheast2="ap-southeast-2",er.CaCentral1="ca-central-1",er.EuCentral1="eu-central-1",er.EuWest1="eu-west-1",er.EuWest2="eu-west-2",er.EuWest3="eu-west-3",er.SaEast1="sa-east-1",er.UsEast1="us-east-1",er.UsWest1="us-west-1",er.UsWest2="us-west-2";function rm(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>t.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}"function"==typeof SuppressedError&&SuppressedError;class rb{constructor(e,{headers:t={},customFetch:r,region:n=ec.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){var t,r,n,s;return t=this,r=arguments,n=void 0,s=function*(e,t={}){var r;let n,s;try{let i,{headers:a,method:o,body:l,signal:c,timeout:u}=t,h={},{region:d}=t;d||(d=this.region);let p=new URL(`${this.url}/${e}`);d&&"any"!==d&&(h["x-region"]=d,p.searchParams.set("forceFunctionRegion",d)),l&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",i=l):"string"==typeof l?(h["Content-Type"]="text/plain",i=l):"u">typeof FormData&&l instanceof FormData?i=l:(h["Content-Type"]="application/json",i=JSON.stringify(l)):i=!l||"string"==typeof l||"u">typeof Blob&&l instanceof Blob||l instanceof ArrayBuffer||"u">typeof FormData&&l instanceof FormData?l:JSON.stringify(l);let f=c;u&&(s=new AbortController,n=setTimeout(()=>s.abort(),u),c?(f=s.signal,c.addEventListener("abort",()=>s.abort())):f=s.signal);let g=yield this.fetch(p.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:i,signal:f}).catch(e=>{throw new rp(e)}),m=g.headers.get("x-relay-error");if(m&&"true"===m)throw new rf(g);if(!g.ok)throw new rg(g);let b=(null!=(r=g.headers.get("Content-Type"))?r:"text/plain").split(";")[0].trim();return{data:"application/json"===b?yield g.json():"application/octet-stream"===b||"application/pdf"===b?yield g.blob():"text/event-stream"===b?g:"multipart/form-data"===b?yield g.formData():yield g.text(),error:null,response:g}}catch(e){return{data:null,error:e,response:e instanceof rg||e instanceof rf?e.context:void 0}}finally{n&&clearTimeout(n)}},new(n||(n=Promise))(function(e,i){function a(e){try{l(s.next(e))}catch(e){i(e)}}function o(e){try{l(s.throw(e))}catch(e){i(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(a,o)}l((s=s.apply(t,r||[])).next())})}}let ry=e=>Math.min(1e3*2**e,3e4),rv=[520,503],rw=["GET","HEAD","OPTIONS"];var r_=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function rE(e,t){return new Promise(r=>{if(null==t?void 0:t.aborted)return void r();let n=setTimeout(()=>{null==t||t.removeEventListener("abort",s),r()},e);function s(){clearTimeout(n),r()}null==t||t.addEventListener("abort",s)})}var rS=class{constructor(e){var t,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=null!=(t=e.shouldThrowOnError)&&t,this.signal=e.signal,this.isMaybeSingle=null!=(r=e.isMaybeSingle)&&r,this.shouldStripNulls=null!=(n=e.shouldStripNulls)&&n,this.urlLengthLimit=null!=(s=e.urlLengthLimit)?s:8e3,this.retryEnabled=null==(i=e.retry)||i,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if("text/csv"===this.headers.get("Accept"))throw Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),"GET"!==this.method&&"HEAD"!==this.method&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){let e=this.headers.get("Accept");"application/vnd.pgrst.object+json"===e?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):e&&"application/json"!==e||this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}let n=this.fetch,s=(async()=>{let e=0;for(;;){var t,s,i,a,o;let l,c=new Headers(r.headers);e>0&&c.set("X-Retry-Count",String(e));try{l=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(e,t)=>"bigint"==typeof t?t.toString():t),signal:r.signal})}catch(t){if((null==t?void 0:t.name)==="AbortError"||(null==t?void 0:t.code)==="ABORT_ERR"||!rw.includes(r.method))throw t;if(r.retryEnabled&&e<3){let t=ry(e);e++,await rE(t,r.signal);continue}throw t}if(t=r.method,s=l.status,i=e,r.retryEnabled&&!(i>=3)&&rw.includes(t)&&rv.includes(s)&&1){let t=null!=(a=null==(o=l.headers)?void 0:o.get("Retry-After"))?a:null,n=null!==t?1e3*Math.max(0,parseInt(t,10)||0):ry(e);await l.text(),e++,await rE(n,r.signal);continue}return await r.processResponse(l)}})();return this.shouldThrowOnError||(s=s.catch(e=>{var t,r,n,s,i,a;let o="",l="",c="",u=null==e?void 0:e.cause;if(u){let t=null!=(r=null==u?void 0:u.message)?r:"",a=null!=(n=null==u?void 0:u.code)?n:"";o=`${null!=(s=null==e?void 0:e.name)?s:"FetchError"}: ${null==e?void 0:e.message}
|
|
19
|
+
|
|
20
|
+
Caused by: ${null!=(i=null==u?void 0:u.name)?i:"Error"}: ${t}`,a&&(o+=` (${a})`),(null==u?void 0:u.stack)&&(o+=`
|
|
21
|
+
${u.stack}`)}else o=null!=(a=null==e?void 0:e.stack)?a:"";let h=this.url.toString().length;return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ABORT_ERR"?(c="",l="Request was aborted (timeout or manual cancellation)",h>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${h} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((null==u?void 0:u.name)==="HeadersOverflowError"||(null==u?void 0:u.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",l="HTTP headers exceeded server limits (typically 16KB)",h>this.urlLengthLimit&&(l+=`. Your request URL is ${h} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${null!=(t=null==e?void 0:e.name)?t:"FetchError"}: ${null==e?void 0:e.message}`,details:o,hint:l,code:c},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}async processResponse(e){var t,r,n;let s=null,i=null,a=null,o=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(i="text/csv"===this.headers.get("Accept")||this.headers.get("Accept")&&(null==(n=this.headers.get("Accept"))?void 0:n.includes("application/vnd.pgrst.plan+text"))?t:JSON.parse(t))}let c=null==(t=this.headers.get("Prefer"))?void 0:t.match(/count=(exact|planned|estimated)/),u=null==(r=e.headers.get("content-range"))?void 0:r.split("/");c&&u&&u.length>1&&(a=parseInt(u[1])),this.isMaybeSingle&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,a=null,o=406,l="Not Acceptable"):i=1===i.length?i[0]:null)}else{let t=await e.text();try{s=JSON.parse(t),Array.isArray(s)&&404===e.status&&(i=[],s=null,o=200,l="OK")}catch(r){404===e.status&&""===t?(o=204,l="No Content"):s={message:t}}if(s&&this.shouldThrowOnError)throw new r_(s)}return{success:null===s,error:s,data:i,count:a,status:o,statusText:l}}returns(){return this}overrideTypes(){return this}},rR=class extends rS{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){let i=s?`${s}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){let s=void 0===n?"offset":`${n}.offset`,i=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var a;let o=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=null!=(a=this.headers.get("Accept"))?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${o};`),this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};let rT=RegExp("[,()]");var rk=class extends rR{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&rT.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(e=>"string"==typeof e&&rT.test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";"plain"===n?s="pl":"phrase"===n?s="ph":"websearch"===n&&(s="w");let i=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>void 0!==t).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},rO=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:n}=null!=t?t:{},s=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join(""),{url:a,headers:o}=this.cloneRequestState();return a.searchParams.set("select",i),n&&o.append("Prefer",`count=${n}`),new rk({method:r?"HEAD":"GET",url:a,headers:o,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;let{url:s,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);s.searchParams.set("columns",e.join(","))}}return new rk({method:"POST",url:s,headers:i,schema:this.schema,body:e,fetch:null!=(n=this.fetch)?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;let{url:a,headers:o}=this.cloneRequestState();if(o.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),void 0!==t&&a.searchParams.set("on_conflict",t),n&&o.append("Prefer",`count=${n}`),s||o.append("Prefer","missing=default"),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set("columns",e.join(","))}}return new rk({method:"POST",url:a,headers:o,schema:this.schema,body:e,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;let{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new rk({method:"PATCH",url:n,headers:s,schema:this.schema,body:e,fetch:null!=(r=this.fetch)?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;let{url:r,headers:n}=this.cloneRequestState();return e&&n.append("Prefer",`count=${e}`),new rk({method:"DELETE",url:r,headers:n,schema:this.schema,fetch:null!=(t=this.fetch)?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function rP(e){return(rP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function rC(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rx(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=rP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rP(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==rP(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rx(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var rA=class e{constructor(e,{headers:t={},schema:r,fetch:n,timeout:s,urlLengthLimit:i=8e3,retry:a}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=i;const o=null!=n?n:globalThis.fetch;void 0!==s&&s>0?this.fetch=(e,t)=>{let r=new AbortController,n=setTimeout(()=>r.abort(),s),i=null==t?void 0:t.signal;if(i){if(i.aborted)return clearTimeout(n),o(e,t);let s=()=>{clearTimeout(n),r.abort()};return i.addEventListener("abort",s,{once:!0}),o(e,rC(rC({},t),{},{signal:r.signal})).finally(()=>{clearTimeout(n),i.removeEventListener("abort",s)})}return o(e,rC(rC({},t),{},{signal:r.signal})).finally(()=>clearTimeout(n))}:this.fetch=o,this.retry=a}from(e){if(!e||"string"!=typeof e||""===e.trim())throw Error("Invalid relation name: relation must be a non-empty string.");return new rO(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:r=!1,get:n=!1,count:s}={}){var i;let a,o,l=new URL(`${this.url}/rpc/${e}`),c=e=>null!==e&&"object"==typeof e&&(!Array.isArray(e)||e.some(c)),u=r&&Object.values(t).some(c);u?(a="POST",o=t):r||n?(a=r?"HEAD":"GET",Object.entries(t).filter(([e,t])=>void 0!==t).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(",")}}`:`${t}`]).forEach(([e,t])=>{l.searchParams.append(e,t)})):(a="POST",o=t);let h=new Headers(this.headers);return u?h.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&h.set("Prefer",`count=${s}`),new rk({method:a,url:l,headers:h,schema:this.schemaName,body:o,fetch:null!=(i=this.fetch)?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};let rN=class{static detectEnvironment(){var t;if("u">typeof WebSocket)return{type:"native",wsConstructor:WebSocket};let r=globalThis;if("u">typeof globalThis&&void 0!==r.WebSocket)return{type:"native",wsConstructor:r.WebSocket};let n=e.g;if(n&&void 0!==n.WebSocket)return{type:"native",wsConstructor:n.WebSocket};if("u">typeof globalThis&&void 0!==r.WebSocketPair&&void 0===globalThis.WebSocket)return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if("u">typeof globalThis&&r.EdgeRuntime||"u">typeof navigator&&(null==(t=navigator.userAgent)?void 0:t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let s=globalThis.process;if(s){let e=s.versions;if(e&&e.node){let t=parseInt(e.node.replace(/^v/,"").split(".")[0]);return t>=22?void 0!==globalThis.WebSocket?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${t} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${t} detected without native WebSocket support.`,workaround:'For Node.js < 22, install "ws" package and provide it via the transport option:\nimport ws from "ws"\nnew RealtimeClient(url, { transport: ws })'}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
|
|
22
|
+
|
|
23
|
+
Suggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return"native"===e.type||"ws"===e.type}catch(e){return!1}}},rI="2.0.0",rj="errored",rD="joined",r$={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"};class rL{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=null!=e?e:[]}encode(e,t){return e.event!==this.BROADCAST_EVENT||e.payload instanceof ArrayBuffer||"string"!=typeof e.payload.event?t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload])):t(this._binaryEncodeUserBroadcastPush(e))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer(null==(t=e.payload)?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;let n=null!=(r=null==(t=e.payload)?void 0:t.payload)?r:{},s=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(e,t,r){let n=e.topic,s=null!=(p=e.ref)?p:"",i=null!=(f=e.join_ref)?f:"",a=e.payload.event,o=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},l=0===Object.keys(o).length?"":JSON.stringify(o);if(i.length>255)throw Error(`joinRef length ${i.length} exceeds maximum of 255`);if(s.length>255)throw Error(`ref length ${s.length} exceeds maximum of 255`);if(n.length>255)throw Error(`topic length ${n.length} exceeds maximum of 255`);if(a.length>255)throw Error(`userEvent length ${a.length} exceeds maximum of 255`);if(l.length>255)throw Error(`metadata length ${l.length} exceeds maximum of 255`);let c=this.USER_BROADCAST_PUSH_META_LENGTH+i.length+s.length+n.length+a.length+l.length,u=new ArrayBuffer(this.HEADER_LENGTH+c),h=new DataView(u),d=0;h.setUint8(d++,this.KINDS.userBroadcastPush),h.setUint8(d++,i.length),h.setUint8(d++,s.length),h.setUint8(d++,n.length),h.setUint8(d++,a.length),h.setUint8(d++,l.length),h.setUint8(d++,t),Array.from(i,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(s,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(n,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(a,e=>h.setUint8(d++,e.charCodeAt(0))),Array.from(l,e=>h.setUint8(d++,e.charCodeAt(0)));var p,f,g=new Uint8Array(u.byteLength+r.byteLength);return g.set(new Uint8Array(u),0),g.set(new Uint8Array(r),u.byteLength),g.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if("string"==typeof e){let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}return t({})}_binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(e,t,n)}_decodeUserBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+4,l=r.decode(e.slice(o,o+n));o+=n;let c=r.decode(e.slice(o,o+s));o+=s;let u=r.decode(e.slice(o,o+i));o+=i;let h=e.slice(o,e.byteLength),d=a===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,p={type:this.BROADCAST_EVENT,event:c,payload:d};return i>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||(null==(t=null==e?void 0:e.constructor)?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e))):{}}}(en=eu||(eu={})).abstime="abstime",en.bool="bool",en.date="date",en.daterange="daterange",en.float4="float4",en.float8="float8",en.int2="int2",en.int4="int4",en.int4range="int4range",en.int8="int8",en.int8range="int8range",en.json="json",en.jsonb="jsonb",en.money="money",en.numeric="numeric",en.oid="oid",en.reltime="reltime",en.text="text",en.time="time",en.timestamp="timestamp",en.timestamptz="timestamptz",en.timetz="timetz",en.tsrange="tsrange",en.tstzrange="tstzrange";let rM=(e,t,r={})=>{var n;let s=null!=(n=r.skipTypes)?n:[];return t?Object.keys(t).reduce((r,n)=>(r[n]=rU(n,e,t,s),r),{}):{}},rU=(e,t,r,n)=>{let s=t.find(t=>t.name===e),i=null==s?void 0:s.type,a=r[e];return i&&!n.includes(i)?rB(i,a):rq(a)},rB=(e,t)=>{if("_"===e.charAt(0))return rW(t,e.slice(1,e.length));switch(e){case eu.bool:return rH(t);case eu.float4:case eu.float8:case eu.int2:case eu.int4:case eu.int8:case eu.numeric:case eu.oid:return rF(t);case eu.json:case eu.jsonb:return rG(t);case eu.timestamp:return rV(t);case eu.abstime:case eu.date:case eu.daterange:case eu.int4range:case eu.int8range:case eu.money:case eu.reltime:case eu.text:case eu.time:case eu.timestamptz:case eu.timetz:case eu.tsrange:case eu.tstzrange:default:return rq(t)}},rq=e=>e,rH=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},rF=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},rG=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},rW=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch(e){n=s?s.split(","):[]}return n.map(e=>rB(t,e))}return e},rV=e=>"string"==typeof e?e.replace(" ","T"):e,rz=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),""===t.pathname||"/"===t.pathname?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var rX=e=>"function"==typeof e?e:function(){return e},rK=("u">typeof self?self:null)||globalThis,rJ="closed",rY="errored",rQ="joined",rZ="joining",r0="leaving",r1="phx_close",r2="phx_error",r3="phx_reply",r4="phx_leave",r5="websocket",r6="base64url.bearer.phx.",r8=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},r9=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},r7=class{constructor(e,t,r){this.state=rJ,this.topic=e,this.params=rX(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new r8(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new r9(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=rQ,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive("error",e=>{this.state=rY,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=rJ,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=rY,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new r8(this,r4,rX({}),this.timeout).send(),this.state=rY,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(r3,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(!this.joinedOnce)return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush;throw Error("tried to join multiple times. 'join' can only be called a single time per channel instance")}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=rJ,this.bindings=[]}onClose(e){this.on(r1,e)}onError(e){return this.on(r2,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>r.event!==e||void 0!==t&&t!==r.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new r8(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=r0;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(r1,"leave")},r=new r8(this,r4,rX({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic===e&&(!n||n===this.joinRef()||(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=rZ,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(n=>n.event===e&&this.filterBindings(n,t,r));for(let e=0;e<i.length;e++)i[e].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===rJ}isErrored(){return this.state===rY}isJoined(){return this.state===rQ}isJoining(){return this.state===rZ}isLeaving(){return this.state===r0}},ne=class{static request(e,t,r,n,s,i,a){if(rK.XDomainRequest){let r=new rK.XDomainRequest;return this.xdomainRequest(r,e,t,n,s,i,a)}if(rK.XMLHttpRequest){let o=new rK.XMLHttpRequest;return this.xhrRequest(o,e,t,r,n,s,i,a)}if(rK.fetch&&rK.AbortController)return this.fetchRequest(e,t,r,n,s,i,a);throw Error("No suitable XMLHttpRequest implementation found")}static fetchRequest(e,t,r,n,s,i,a){let o={method:e,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),o.signal=l.signal),rK.fetch(t,o).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>a&&a(e)).catch(e=>{"AbortError"===e.name&&i?i():a&&a(null)}),l}static xdomainRequest(e,t,r,n,s,i,a){return e.timeout=s,e.open(t,r),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,i,a,o){for(let[s,a]of(e.open(t,r,!0),e.timeout=i,Object.entries(n)))e.setRequestHeader(s,a);return e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{4===e.readyState&&o&&o(this.parseJSON(e.responseText))},a&&(e.ontimeout=a),e.send(s),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,i=e[n];"object"==typeof i?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},nt=class{constructor(e,t){t&&2===t.length&&t[1].startsWith(r6)&&(this.authToken=atob(t[1].slice(r6.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(RegExp("(.*)/"+r5),"$1/longpoll")}endpointURL(){return ne.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){let e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(410===t&&null!==this.token){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){"string"!=typeof e&&(e=(e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let e=0;e<n;e++)t+=String.fromCharCode(r[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join("\n"),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))})}close(e,t,r){for(let e of this.reqs)e.abort();this.readyState=3;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"u">typeof CloseEvent?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let i,a=()=>{this.reqs.delete(i),n()};i=ne.request(e,this.endpointURL(),t,r,this.timeout,a,e=>{this.reqs.delete(i),this.isActive()&&s(e)}),this.reqs.add(i)}},nr=class e{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,r,n),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,r,n)}),this.pendingDiffs=[],s()}),this.channel.on(n.diff,t=>{let{onJoin:r,onLeave:n,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,r,n),s())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let s=this.clone(e),i={},a={};return this.map(s,(e,r)=>{t[e]||(a[e]=r)}),this.map(t,(e,t)=>{let r=s[e];if(r){let n=t.metas.map(e=>e.phx_ref),s=r.metas.map(e=>e.phx_ref),o=t.metas.filter(e=>0>s.indexOf(e.phx_ref)),l=r.metas.filter(e=>0>n.indexOf(e.phx_ref));o.length>0&&(i[e]=t,i[e].metas=o),l.length>0&&(a[e]=this.clone(r),a[e].metas=l)}else i[e]=t}),this.syncDiff(s,{joins:i,leaves:a},r,n)}static syncDiff(e,t,r,n){let{joins:s,leaves:i}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(s,(t,n)=>{let s=e[t];if(e[t]=this.clone(n),s){let r=e[t].metas.map(e=>e.phx_ref),n=s.metas.filter(e=>0>r.indexOf(e.phx_ref));e[t].metas.unshift(...n)}r(t,s,n)}),this.map(i,(t,r)=>{let s=e[t];if(!s)return;let i=r.metas.map(e=>e.phx_ref);s.metas=s.metas.filter(e=>0>i.indexOf(e.phx_ref)),n(t,s,r),0===s.metas.length&&delete e[t]}),e}static list(e,t){return t||(t=function(e,t){return t}),this.map(e,(e,r)=>t(e,r))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},nn={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){return e.payload.constructor===ArrayBuffer?t(this.binaryEncode(e)):t(JSON.stringify([e.join_ref,e.ref,e.topic,e.event,e.payload]))},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,i,a]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:i}=e,a=this.META_LENGTH+t.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,r.length),l.setUint8(c++,s.length),l.setUint8(c++,n.length),Array.from(t,e=>l.setUint8(c++,e.charCodeAt(0))),Array.from(r,e=>l.setUint8(c++,e.charCodeAt(0))),Array.from(s,e=>l.setUint8(c++,e.charCodeAt(0))),Array.from(n,e=>l.setUint8(c++,e.charCodeAt(0)));var u=new Uint8Array(o.byteLength+i.byteLength);return u.set(new Uint8Array(o),0),u.set(new Uint8Array(i),o.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(e.slice(a,a+n));a+=n;let l=r.decode(e.slice(a,a+s));a+=s;let c=r.decode(e.slice(a,a+i));return a+=i,{join_ref:o,ref:null,topic:l,event:c,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(o,o+n));o+=n;let c=r.decode(e.slice(o,o+s));o+=s;let u=r.decode(e.slice(o,o+i));o+=i;let h=r.decode(e.slice(o,o+a));return o+=a,{join_ref:l,ref:c,topic:u,event:r3,payload:{status:h,response:e.slice(o,e.byteLength)}}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),i=this.HEADER_LENGTH+2,a=r.decode(e.slice(i,i+n));i+=n;let o=r.decode(e.slice(i,i+s));return i+=s,{join_ref:null,ref:null,topic:a,event:o,payload:e.slice(i,e.byteLength)}}},ns=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||1e4,this.transport=t.transport||rK.WebSocket||nt,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=rK&&rK.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=nn.encode.bind(nn),this.defaultDecoder=nn.decode.bind(nn),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==nt?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,r)=>{console.log(`${e}: ${t}`,r)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=rX(t.params||{}),this.endPoint=`${e}/${r5}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new r9(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return nt}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=ne.appendParams(ne.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=rX(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==nt?this.connectWithFallback(nt,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){return e===nt?"LongPoll":e.name}transportConnect(){let e;this.connectClock++,this.closeWasClean=!1,this.authToken&&(e=["phoenix",`${r6}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){let r,n;clearTimeout(this.fallbackTimer);let s=!1,i=!0,a=this.transportName(e),o=t=>{this.log("transport",`falling back to ${a}...`,t),this.off([r,n]),i=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,t),n=this.onError(e=>{this.log("transport","error",e),i&&!s&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!i){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,"true"),this.log("transport",`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),1e3,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();let n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){5!==r&&e.bufferedAmount?setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r):t()}waitForSocketClosed(e,t,r=1){5===r||3===e.readyState?t():setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(r2,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>-1===e.indexOf(t))}channel(e,t={}){let r=new r7(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef)return void this.heartbeatTimeout();this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;if(s&&s===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback("ok"===n.status?"ok":"error",e)}catch(e){this.log("error","error in heartbeat callback",e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${s&&"("+s+")"||""}`.trim(),n);for(let e=0;e<this.channels.length;e++){let a=this.channels[e];a.isMember(t,r,n,i)&&a.trigger(r,n,s,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(t){this.log("error",`error in ${e} callback`,t)}})}catch(t){this.log("error",`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class ni{constructor(e,t){const r=function(e){return(null==e?void 0:e.events)&&{events:e.events}}(t);this.presence=new nr(e.getChannel(),r),this.presence.onJoin((t,r,n)=>{let s=ni.onJoinPayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onLeave((t,r,n)=>{let s=ni.onLeavePayload(t,r,n);e.getChannel().trigger("presence",s)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ni.transformState(this.presence.state)}static transformState(e){return Object.getOwnPropertyNames(e=JSON.parse(JSON.stringify(e))).reduce((t,r)=>{let n=e[r];return t[r]=na(n),t},{})}static onJoinPayload(e,t,r){return{event:"join",key:e,currentPresences:no(t),newPresences:na(r)}}static onLeavePayload(e,t,r){return{event:"leave",key:e,currentPresences:no(t),leftPresences:na(r)}}}function na(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function no(e){return(null==e?void 0:e.metas)?na(e):[]}(es=eh||(eh={})).SYNC="sync",es.JOIN="join",es.LEAVE="leave";class nl{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new ni(this.channel.channelAdapter,t)}}class nc{constructor(e,t,r){const n=function(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch(t){throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${e.event}`,e.payload())}return n}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===rD}isJoined(){return this.state===rD}isJoining(){return"joining"===this.state}isClosed(){return"closed"===this.state}isLeaving(){return"leaving"===this.state}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}(ei=ed||(ed={})).ALL="*",ei.INSERT="INSERT",ei.UPDATE="UPDATE",ei.DELETE="DELETE",(ea=ep||(ep={})).BROADCAST="broadcast",ea.PRESENCE="presence",ea.POSTGRES_CHANGES="postgres_changes",ea.SYSTEM="system",(eo=ef||(ef={})).SUBSCRIBED="SUBSCRIBED",eo.TIMED_OUT="TIMED_OUT",eo.CLOSED="CLOSED",eo.CHANNEL_ERROR="CHANNEL_ERROR";class nu{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new nc(this.socket.socketAdapter,e,this.params),this.presence=new nl(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=rz(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(null==(s=null==(n=this.params.config)?void 0:n.broadcast)?void 0:s.replay))throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,n,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:i,presence:a,private:o}}=this.params,l=null!=(n=null==(r=this.bindings.postgres_changes)?void 0:r.map(e=>e.filter))?n:[],c=!!this.bindings[ep.PRESENCE]&&this.bindings[ep.PRESENCE].length>0||(null==(s=this.params.config.presence)?void 0:s.enabled)===!0,u={},h={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:c}),postgres_changes:l,private:o};this.socket.accessTokenValue&&(u.access_token=this.socket.accessTokenValue),this._onError(t=>{null==e||e(ef.CHANNEL_ERROR,function(e){if(e instanceof Error)return e;if("string"==typeof e)return Error(e);if(e&&"object"==typeof e){if("number"==typeof e.code){let t="string"==typeof e.reason&&e.reason?` (${e.reason})`:"";return Error(`socket closed: ${e.code}${t}`,{cause:e})}return Error("channel error: transport failure",{cause:e})}return Error("channel error: connection lost")}(t))}),this._onClose(()=>null==e?void 0:e(ef.CLOSED)),this.updateJoinPayload(Object.assign({config:h},u)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),void 0===t){null==e||e(ef.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive("error",t=>{this.state=rj;let r=Object.values(t).join(", ")||"error";null==e||e(ef.CHANNEL_ERROR,Error(r,{cause:t}))}).receive("timeout",()=>{null==e||e(ef.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;let n=this.bindings.postgres_changes,s=null!=(r=null==n?void 0:n.length)?r:0,i=[];for(let r=0;r<s;r++){let s=n[r],{filter:{event:a,schema:o,table:l,filter:c}}=s,u=e&&e[r];if(u&&u.event===a&&nu.isFilterValueEqual(u.schema,o)&&nu.isFilterValueEqual(u.table,l)&&nu.isFilterValueEqual(u.filter,c))i.push(Object.assign(Object.assign({},s),{id:u.id}));else{this.unsubscribe(),this.state=rj,null==t||t(ef.CHANNEL_ERROR,Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=rj&&t&&t(ef.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){let n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===ep.PRESENCE||e===ep.POSTGRES_CHANGES;if(n&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(null==t)return Promise.reject(Error("Payload is required for httpSend()"));let s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);let i={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:t,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,i,null!=(n=r.timeout)?n:this.timeout);if(202===a.status)return{success:!0};let o=a.statusText;try{let e=await a.json();o=e.error||e.message||o}catch(e){}return Promise.reject(Error(o))}async send(e,t={}){var r,n;if(this.channelAdapter.canPush()||"broadcast"!==e.type)return new Promise(r=>{var n,s,i;let a=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null==(i=null==(s=null==(n=this.params)?void 0:n.config)?void 0:s.broadcast)?void 0:i.ack)||r("ok"),a.receive("ok",()=>r("ok")),a.receive("error",()=>r("error")),a.receive("timeout",()=>r("timed out"))});{console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");let{event:s,payload:i}=e,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);let o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{let e=await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!=(r=t.timeout)?r:this.timeout);return await (null==(n=e.body)?void 0:n.cancel()),e.ok?"ok":"error"}catch(e){if(e instanceof Error&&"AbortError"===e.name)return"timed out";return"error"}}}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){let n=new AbortController,s=setTimeout(()=>n.abort(),r),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(s),i}_on(e,t,r){let n=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),i={type:n,filter:t,callback:r,ref:s};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,s,i,a,o,l,c;let u=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(u,r))return!1;let h=null==(n=this.bindings[u])?void 0:n.find(t=>t.ref===e.ref);if(!h)return!0;if(!["broadcast","presence","postgres_changes"].includes(u))return h.type.toLocaleLowerCase()===u;if("id"in h){let e=h.id,r=null==(s=h.filter)?void 0:s.event;return e&&(null==(i=t.ids)?void 0:i.includes(e))&&("*"===r||(null==r?void 0:r.toLocaleLowerCase())===(null==(a=t.data)?void 0:a.type.toLocaleLowerCase()))}{let e=null==(l=null==(o=null==h?void 0:h.filter)?void 0:o.event)?void 0:l.toLocaleLowerCase();return"*"===e||e===(null==(c=null==t?void 0:t.event)?void 0:c.toLocaleLowerCase())}})}_notThisChannelEvent(e,t){let{close:r,error:n,leave:s,join:i}=r$;return t&&[r,n,s,i].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if("object"==typeof t&&"ids"in t){let e=t.data,{schema:r,table:n,commit_timestamp:s,type:i,errors:a}=e;return Object.assign(Object.assign({},{schema:r,table:n,commit_timestamp:s,eventType:i,new:{},old:{},errors:a}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error("cannot copy bindings into joined channel");for(let t in e.bindings)for(let r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(null!=e?e:void 0)===(null!=t?t:void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=rM(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=rM(e.columns,e.old_record)),t}}class nh{constructor(e,t){this.socket=new ns(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),n),this.socket.disconnect(()=>{e(),s("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return"connecting"==this.socket.connectionState()}isDisconnecting(){return"closing"==this.socket.connectionState()}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}let nd=[1e3,2e3,5e3,1e4],np=`
|
|
24
|
+
addEventListener("message", (e) => {
|
|
25
|
+
if (e.data.event === "start") {
|
|
26
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
27
|
+
}
|
|
28
|
+
});`;class nf{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){var r;if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new rL,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!(null==(r=null==t?void 0:t.params)?void 0:r.apikey))throw Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey;const n=this._initializeOptions(t);this.socketAdapter=new nh(e,n),this.httpEndpoint=rz(e),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){let e=t.message;if(e.includes("Node.js"))throw Error(`${e}
|
|
29
|
+
|
|
30
|
+
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
31
|
+
|
|
32
|
+
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
33
|
+
Option 2: Install and provide the "ws" package:
|
|
34
|
+
|
|
35
|
+
npm install ws
|
|
36
|
+
|
|
37
|
+
import ws from "ws"
|
|
38
|
+
const client = new RealtimeClient(url, {
|
|
39
|
+
...options,
|
|
40
|
+
transport: ws
|
|
41
|
+
})`);throw Error(`WebSocket not available: ${e}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return(this._cancelPendingDisconnect(),this.isDisconnecting())?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return"ok"===t&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||"closed"}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let r=`realtime:${e}`,n=this.getChannels().find(e=>e.topic===r);if(n)return n;{let r=new nu(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(r),r}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),0===this.channels.length&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),0===this._disconnectOnEmptyChannelsAfterMs){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,0===this.channels.length&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){null!==this._pendingDisconnectTimer&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log("error","Error fetching access token from callback",e),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let r={access_token:t,version:"realtime-js/2.106.0"};t&&e.updateJoinPayload(r),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(r$.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log("error","error waiting for auth on connect",e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{"sent"==t&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log("worker","worker error",e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{"keepAlive"===e.data.event&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([np],{type:"application/javascript"});t=URL.createObjectURL(e)}return t}_initializeOptions(e){var t,r,n,s,i,a,o,l,c,u,h,d;let p,f;this.worker=null!=(t=null==e?void 0:e.worker)&&t,this.accessToken=null!=(r=null==e?void 0:e.accessToken)?r:null;let g={};g.timeout=null!=(n=null==e?void 0:e.timeout)?n:1e4,g.heartbeatIntervalMs=null!=(s=null==e?void 0:e.heartbeatIntervalMs)?s:25e3,this._disconnectOnEmptyChannelsAfterMs=null!=(i=null==e?void 0:e.disconnectOnEmptyChannelsAfterMs)?i:2*(null!=(a=null==e?void 0:e.heartbeatIntervalMs)?a:25e3),g.transport=null!=(o=null==e?void 0:e.transport)?o:rN.getWebSocketConstructor(),g.params=null==e?void 0:e.params,g.logger=null==e?void 0:e.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(null==e?void 0:e.heartbeatCallback),g.sessionStorage=null!=(l=null==e?void 0:e.sessionStorage)?l:function(){let e;try{if("u">typeof globalThis&&globalThis.sessionStorage)return globalThis.sessionStorage}catch(e){}return e=new Map,{get length(){return e.size},clear(){e.clear()},getItem:t=>e.has(t)?e.get(t):null,key(t){var r;return null!=(r=Array.from(e.keys())[t])?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}(),g.reconnectAfterMs=null!=(c=null==e?void 0:e.reconnectAfterMs)?c:e=>nd[e-1]||1e4;let m=null!=(u=null==e?void 0:e.vsn)?u:rI;switch(m){case"1.0.0":p=(e,t)=>t(JSON.stringify(e)),f=(e,t)=>t(JSON.parse(e));break;case rI:p=this.serializer.encode.bind(this.serializer),f=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${g.vsn}`)}return g.vsn=m,g.encode=null!=(h=null==e?void 0:e.encode)?h:p,g.decode=null!=(d=null==e?void 0:e.decode)?d:f,g.beforeReconnect=this._reconnectAuth.bind(this),((null==e?void 0:e.logLevel)||(null==e?void 0:e.log_level))&&(this.logLevel=e.logLevel||e.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker&&(this.workerUrl=null==e?void 0:e.workerUrl,g.autoSendHeartbeat=!this.worker),g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var ng=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown="CommitStateUnknownException"===t.icebergType||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return 404===this.status}isConflict(){return 409===this.status}isAuthenticationTimeout(){return 419===this.status}};async function nm(e){return e&&"none"!==e.type?"bearer"===e.type?{Authorization:`Bearer ${e.token}`}:"header"===e.type?{[e.name]:e.value}:"custom"===e.type?await e.getHeaders():{}:{}}function nb(e){return e.join("\x1f")}var ny=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:nb(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nb(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nb(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nb(e.namespace)}`}),!0}catch(e){if(e instanceof ng&&404===e.status)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof ng&&409===e.status)return;throw e}}};function nv(e){return e.join("\x1f")}var nw=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nv(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${nv(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${nv(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nv(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nv(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nv(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof ng&&404===e.status)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof ng&&409===r.status)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},n_=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=function(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:a}){let o=function(e,t,r){let n=new URL(t,e);if(r)for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);return n.toString()}(e.baseUrl,n,s),l=await nm(e.auth),c=await t(o,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...a},body:i?JSON.stringify(i):void 0}),u=await c.text(),h=(c.headers.get("content-type")||"").includes("application/json"),d=h&&u?JSON.parse(u):u;if(!c.ok){let e=h?d:void 0,t=e?.error;throw new ng(t?.message??`Request failed with status ${c.status}`,{status:c.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:c.status,headers:c.headers,data:d}}}}({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new ny(this.client,t),this.tableOps=new nw(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function nE(e){return(nE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function nR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nS(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=nE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=nE(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==nE(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nS(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var nT=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name="vectors"===t?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function nk(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}var nO=class extends nT{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name="vectors"===n?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return nR({},super.toJSON())}},nP=class extends nT{constructor(e,t,r="storage"){super(e,r),this.name="vectors"===r?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function nx(e,t,r){let n=nR({},e),s=t.toLowerCase();for(let e of Object.keys(n))e.toLowerCase()===s&&delete n[e];return n[s]=r,n}let nC=e=>{if(Array.isArray(e))return e.map(e=>nC(e));if("function"==typeof e||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,r])=>{t[e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,""))]=nC(r)}),t},nA=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error;if("object"==typeof e.error&&null!==e.error){let t=e.error;if("string"==typeof t.message)return t.message}}return JSON.stringify(e)},nN=async(e,t,r,n)=>{if(null!==e&&"object"==typeof e&&"json"in e&&"function"==typeof e.json){let r=parseInt(String(e.status),10);Number.isFinite(r)||(r=500),e.json().then(e=>{let s=(null==e?void 0:e.statusCode)||(null==e?void 0:e.code)||r+"";t(new nO(nA(e),r,s,n))}).catch(()=>{let s=r+"";t(new nO(e.statusText||`HTTP ${r} error`,r,s,n))})}else t(new nP(nA(e),e,n))};async function nI(e,t,r,n,s,i,a){return new Promise((o,l)=>{e(r,((e,t,r,n)=>{let s={method:e,headers:(null==t?void 0:t.headers)||{}};if("GET"===e||"HEAD"===e||!n)return nR(nR({},s),r);if((e=>{if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)})(n)){var i;let e,r=(null==t?void 0:t.headers)||{};for(let[t,n]of Object.entries(r))"content-type"===t.toLowerCase()&&(e=n);s.headers=nx(r,"Content-Type",null!=(i=e)?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return(null==t?void 0:t.duplex)&&(s.duplex=t.duplex),nR(nR({},s),r)})(t,n,s,i)).then(e=>{if(!e.ok)throw e;if(null==n?void 0:n.noResolveJson)return e;if("vectors"===a){let t=e.headers.get("content-type");if("0"===e.headers.get("content-length")||204===e.status||!t||!t.includes("application/json"))return{}}return e.json()}).then(e=>o(e)).catch(e=>nN(e,l,n,a))})}function nj(e="storage"){return{get:async(t,r,n,s)=>nI(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,i)=>nI(t,"POST",r,s,i,n,e),put:async(t,r,n,s,i)=>nI(t,"PUT",r,s,i,n,e),head:async(t,r,n,s)=>nI(t,"HEAD",r,nR(nR({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,i)=>nI(t,"DELETE",r,s,i,n,e)}}let{get:nD,post:n$,put:nL,head:nM,remove:nU}=nj("storage"),nB=nj("vectors");var nq=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=function(e){let t={};for(let[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}(t),this.fetch=(e=>e?(...t)=>e(...t):(...e)=>fetch(...e))(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=nx(this.headers,e,t),this}async handleOperation(e){try{return{data:await e(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nk(e))return{data:null,error:e};throw e}}};r=Symbol.toStringTag;var nH=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[r]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:(await this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nk(e))return{data:null,error:e};throw e}}};n=Symbol.toStringTag;var nF=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[n]="BlobDownloadBuilder",this.promise=null}asStream(){return new nH(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){try{return{data:await (await this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nk(e))return{data:null,error:e};throw e}}};let nG={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nW={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var nV=class extends nq{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let i,a=nR(nR({},nW),n),o=nR(nR({},s.headers),"POST"===e&&{"x-upsert":String(a.upsert)}),l=a.metadata;if("u">typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",a.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):"u">typeof FormData&&r instanceof FormData?((i=r).has("cacheControl")||i.append("cacheControl",a.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&i instanceof ReadableStream||i&&"object"==typeof i&&"pipe"in i&&"function"==typeof i.pipe)&&!a.duplex&&(a.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))o=nx(o,e,t);let c=s._removeEmptyFolders(t),u=s._getFinalPath(c),h=await ("PUT"==e?nL:n$)(s.fetch,`${s.url}/object/${u}`,i,nR({headers:o},(null==a?void 0:a.duplex)?{duplex:a.duplex}:{}));return{path:c,id:h.Id,fullPath:h.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;let i=s._removeEmptyFolders(e),a=s._getFinalPath(i),o=new URL(s.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),s.handleOperation(async()=>{let e,t=nR(nR({},nW),n),a=nR(nR({},s.headers),{"x-upsert":String(t.upsert)}),l=t.metadata;if("u">typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),l&&e.append("metadata",s.encodeMetadata(l)),e.append("",r)):"u">typeof FormData&&r instanceof FormData?((e=r).has("cacheControl")||e.append("cacheControl",t.cacheControl),l&&!e.has("metadata")&&e.append("metadata",s.encodeMetadata(l))):(e=r,a["cache-control"]=`max-age=${t.cacheControl}`,a["content-type"]=t.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),("u">typeof ReadableStream&&e instanceof ReadableStream||e&&"object"==typeof e&&"pipe"in e&&"function"==typeof e.pipe)&&!t.duplex&&(t.duplex="half")),null==n?void 0:n.headers)for(let[e,t]of Object.entries(n.headers))a=nx(a,e,t);return{path:i,fullPath:(await nL(s.fetch,o.toString(),e,nR({headers:a},(null==t?void 0:t.duplex)?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e),s=nR({},r.headers);(null==t?void 0:t.upsert)&&(s["x-upsert"]="true");let i=await n$(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+i.url),o=a.searchParams.get("token");if(!o)throw new nT("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await n$(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await n$(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:null==r?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e),i="object"==typeof(null==r?void 0:r.transform)&&null!==r.transform&&Object.keys(r.transform).length>0,a=await n$(n.fetch,`${n.url}/object/sign/${s}`,nR({expiresIn:t},i?{transform:r.transform}:{}),{headers:n.headers}),o=new URLSearchParams;(null==r?void 0:r.download)&&o.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));let l=o.toString();return{signedUrl:encodeURI(`${n.url}${a.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{let s=await n$(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=new URLSearchParams;(null==r?void 0:r.download)&&i.set("download",!0===r.download?"":r.download),(null==r?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));let a=i.toString();return s.map(e=>nR(nR({},e),{},{signedUrl:e.signedURL?encodeURI(`${n.url}${e.signedURL}${a?`&${a}`:""}`):null}))})}download(e,t,r){let n="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(s,t.transform),(null==t?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));let i=s.toString(),a=this._getFinalPath(e);return new nF(()=>nD(this.fetch,`${this.url}/${n}/${a}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r),this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);return t.handleOperation(async()=>nC(await nD(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t;let r=this._getFinalPath(e);try{return await nM(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(nk(e)){let r=e instanceof nO?e.status:e instanceof nP?null==(t=e.originalError)?void 0:t.status:void 0;if(void 0!==r&&[400,404].includes(r))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let r=this._getFinalPath(e),n=new URLSearchParams;(null==t?void 0:t.download)&&n.set("download",!0===t.download?"":t.download),(null==t?void 0:t.transform)&&this.applyTransformOptsToQuery(n,t.transform),(null==t?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));let s=n.toString(),i="object"==typeof(null==t?void 0:t.transform)&&null!==t.transform&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{let s=nR(nR(nR({},nG),t),{},{prefix:e||""});return await n$(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{let n=nR({},e);return await n$(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return"u">typeof Buffer?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};let nz={"X-Client-Info":"storage-js/2.106.0"};var nX=class extends nq{constructor(e,t={},r,n){const s=new URL(e);(null==n?void 0:n.useNewHostname)&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),super(s.href.replace(/\/$/,""),nR(nR({},nz),t),r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=t.listBucketOptionsToQueryString(e);return await nD(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nD(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await n$(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await nL(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await n$(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},nK=class extends nq{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nz),t),r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await n$(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let r=new URLSearchParams;(null==e?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(null==e?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),(null==e?void 0:e.sortColumn)&&r.set("sortColumn",e.sortColumn),(null==e?void 0:e.sortOrder)&&r.set("sortOrder",e.sortOrder),(null==e?void 0:e.search)&&r.set("search",e.search);let n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await nD(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nU(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!(!(!e||"string"!=typeof e||0===e.length||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\"))&&/^[\w!.\*'() &$@=;:+,?-]+$/.test(e)))throw new nT("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new n_({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(e,t){let r=e[t];return"function"!=typeof r?r:async(...t)=>{try{return{data:await r.apply(e,t),error:null}}catch(e){if(n)throw e;return{data:null,error:e}}}}})}},nJ=class extends nq{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nz),{},{"Content-Type":"application/json"},t),r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await nB.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await nB.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},nY=class extends nq{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nz),{},{"Content-Type":"application/json"},t),r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(void 0!==e.segmentCount){if(e.segmentCount<1||e.segmentCount>16)throw Error("segmentCount must be between 1 and 16");if(void 0!==e.segmentIndex&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},nQ=class extends nq{constructor(e,t={},r){super(e.replace(/\/$/,""),nR(nR({},nz),{},{"Content-Type":"application/json"},t),r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await nB.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},nZ=class extends nQ{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new n0(this.url,this.headers,e,this.fetch)}async createBucket(e){return super.createBucket.call(this,e)}async getBucket(e){return super.getBucket.call(this,e)}async listBuckets(e={}){return super.listBuckets.call(this,e)}async deleteBucket(e){return super.deleteBucket.call(this,e)}},n0=class extends nJ{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){return super.createIndex.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName}))}async listIndexes(e={}){return super.listIndexes.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName}))}async getIndex(e){return super.getIndex.call(this,this.vectorBucketName,e)}async deleteIndex(e){return super.deleteIndex.call(this,this.vectorBucketName,e)}index(e){return new n1(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},n1=class extends nY{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){return super.putVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async getVectors(e){return super.getVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async listVectors(e={}){return super.listVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async queryVectors(e){return super.queryVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}async deleteVectors(e){return super.deleteVectors.call(this,nR(nR({},e),{},{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))}},n2=class extends nX{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new nV(this.url,this.headers,e,this.fetch)}get vectors(){return new nZ(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new nK(this.url+"/iceberg",this.headers,this.fetch)}};let n3="2.106.0",n4={"X-Client-Info":`gotrue-js/${n3}`},n5="X-Supabase-Api-Version",n6={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},n8=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i;class n9 extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function n7(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class se extends n9{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}class st extends n9{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class sr extends n9{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class sn extends sr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function ss(e){return n7(e)&&"AuthSessionMissingError"===e.name}class si extends sr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class sa extends sr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class so extends sr{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class sl extends sr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class sc extends sr{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function su(e){return n7(e)&&"AuthRetryableFetchError"===e.name}class sh extends sr{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class sd extends sr{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}let sp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),sf=" \n\r=".split(""),sg=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<sf.length;t+=1)e[sf[t].charCodeAt(0)]=-2;for(let t=0;t<sp.length;t+=1)e[sp[t].charCodeAt(0)]=t;return e})();function sm(e,t,r){if(null!==e)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;)r(sp[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)r(sp[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function sb(e,t,r){let n=sg[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(-2===n)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function sy(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=e=>{!function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}}(e,n,r)};for(let t=0;t<e.length;t+=1)sb(e.charCodeAt(t),s,i);return t.join("")}function sv(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};for(let t=0;t<e.length;t+=1)sb(e.charCodeAt(t),r,n);return new Uint8Array(t)}function sw(e){let t=[],r={queue:0,queuedBits:0},n=e=>{t.push(e)};return e.forEach(e=>sm(e,r,n)),sm(null,r,n),t.join("")}let s_=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),sE=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},sS=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return null}},sR=async(e,t)=>{await e.removeItem(t)};class sT{constructor(){this.promise=new sT.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function sk(e){let t=e.split(".");if(3!==t.length)throw new sd("Invalid JWT structure");for(let e=0;e<t.length;e++)if(!n8.test(t[e]))throw new sd("JWT not in base64url format");return{header:JSON.parse(sy(t[0])),payload:JSON.parse(sy(t[1])),signature:sv(t[2]),raw:{header:t[0],payload:t[1]}}}async function sO(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function sP(e){return("0"+e.toString(16)).substr(-2)}async function sx(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t))).map(e=>String.fromCharCode(e)).join("")}async function sC(e){return"u">typeof crypto&&void 0!==crypto.subtle&&"u">typeof TextEncoder?btoa(await sx(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):(console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e)}async function sA(e,t,r=!1){let n=function(){let e=new Uint32Array(56);if("u"<typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,sP).join("")}(),s=n;r&&(s+="/recovery"),await sE(e,`${t}-code-verifier`,s);let i=await sC(n),a=n===i?"plain":"s256";return[i,a]}sT.promiseConstructor=Promise;let sN=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i,sI=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function sj(e){if(!sI.test(e))throw Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function sD(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function s$(){return new Proxy({},{get:(e,t)=>{if("__isUserNotAvailableProxy"===t)return!0;if("symbol"==typeof t){let e=t.toString();if("Symbol(Symbol.toPrimitive)"===e||"Symbol(Symbol.toStringTag)"===e||"Symbol(util.inspect.custom)"===e)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function sL(e){return JSON.parse(JSON.stringify(e))}let sM=e=>{if("object"==typeof e&&null!==e){if("string"==typeof e.msg)return e.msg;if("string"==typeof e.message)return e.message;if("string"==typeof e.error_description)return e.error_description;if("string"==typeof e.error)return e.error}return JSON.stringify(e)},sU=[502,503,504,520,521,522,523,524,530];async function sB(e){var t;let r,n;if(!("object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json))throw new sc(sM(e),0);if(sU.includes(e.status))throw new sc(sM(e),e.status);try{r=await e.json()}catch(e){throw new st(sM(e),e)}let s=function(e){let t=e.headers.get(n5);if(!t||!t.match(sN))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch(e){return null}}(e);if(s&&s.getTime()>=n6["2024-01-01"].timestamp&&"object"==typeof r&&r&&"string"==typeof r.code?n=r.code:"object"==typeof r&&r&&"string"==typeof r.error_code&&(n=r.error_code),n){if("weak_password"===n)throw new sh(sM(r),e.status,(null==(t=r.weak_password)?void 0:t.reasons)||[]);else if("session_not_found"===n)throw new sn}else if("object"==typeof r&&r&&"object"==typeof r.weak_password&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0))throw new sh(sM(r),e.status,r.weak_password.reasons);throw new se(sM(r),e.status||500,n)}async function sq(e,t,r,n){var s;let i=Object.assign({},null==n?void 0:n.headers);i[n5]||(i[n5]=n6["2024-01-01"].name),(null==n?void 0:n.jwt)&&(i.Authorization=`Bearer ${n.jwt}`);let a=null!=(s=null==n?void 0:n.query)?s:{};(null==n?void 0:n.redirectTo)&&(a.redirect_to=n.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await sH(e,t,r+o,{headers:i,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function sH(e,t,r,n,s,i){let a,o,l=(o={method:t,headers:(null==n?void 0:n.headers)||{}},"GET"===t?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==n?void 0:n.headers),o.body=JSON.stringify(i),Object.assign(Object.assign({},o),s)));try{a=await e(r,Object.assign({},l))}catch(e){throw console.error(e),new sc(sM(e),0)}if(a.ok||await sB(a),null==n?void 0:n.noResolveJson)return a;try{return await a.json()}catch(e){await sB(e)}}function sF(e){var t,r,n;let s=null;(n=e).access_token&&n.refresh_token&&n.expires_in&&(s=Object.assign({},e),e.expires_at||(s.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r)));return{data:{session:s,user:null!=(t=e.user)?t:null},error:null}}function sG(e){let t=sF(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce((e,t)=>e&&"string"==typeof t,!0)&&(t.data.weak_password=e.weak_password),t}function sW(e){var t;return{data:{user:null!=(t=e.user)?t:e},error:null}}function sV(e){return{data:e,error:null}}function sz(e){let{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=e;return{data:{properties:{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},user:Object.assign({},rm(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function sX(e){return e}let sK=["global","local","others"];class sJ{constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=s_(r),this.experimental=null!=n?n:{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=sK[0]){if(0>sK.indexOf(t))throw Error(`@supabase/auth-js: Parameter scope must be one of ${sK.join(", ")}`);try{return await sq(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(n7(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await sq(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:sW})}catch(e){if(n7(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=rm(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=null==r?void 0:r.newEmail,delete n.newEmail),await sq(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:sz,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(n7(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await sq(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:sW})}catch(e){if(n7(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},c=await sq(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:sX});if(c.error)throw c.error;let u=await c.json(),h=null!=(i=c.headers.get("x-total-count"))?i:0,d=null!=(o=null==(a=c.headers.get("link"))?void 0:a.split(","))?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},u),l),error:null}}catch(e){if(n7(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){sj(e);try{return await sq(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:sW})}catch(e){if(n7(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){sj(e);try{return await sq(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:sW})}catch(e){if(n7(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){sj(e);try{return await sq(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:sW})}catch(e){if(n7(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){sj(e.userId);try{let{data:t,error:r}=await sq(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _deleteFactor(e){sj(e.userId),sj(e.id);try{return{data:await sq(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){var t,r,n,s,i,a,o;try{let l={nextPage:null,lastPage:0,total:0},c=await sq(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:null!=(r=null==(t=null==e?void 0:e.page)?void 0:t.toString())?r:"",per_page:null!=(s=null==(n=null==e?void 0:e.perPage)?void 0:n.toString())?s:""},xform:sX});if(c.error)throw c.error;let u=await c.json(),h=null!=(i=c.headers.get("x-total-count"))?i:0,d=null!=(o=null==(a=c.headers.get("link"))?void 0:a.split(","))?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},u),l),error:null}}catch(e){if(n7(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await sq(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{return await sq(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{return await sq(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{return await sq(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{return await sq(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return(null==e?void 0:e.type)&&(t.type=e.type),await sq(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>{var t;return{data:{providers:null!=(t=null==e?void 0:e.providers)?t:[]},error:null}}})}catch(e){if(n7(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await sq(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{return await sq(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{return await sq(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{return await sq(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){sD(this.experimental),sj(e.userId);try{return await sq(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(n7(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){sD(this.experimental),sj(e.userId),sj(e.passkeyId);try{return await sq(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(n7(e))return{data:null,error:e};throw e}}}function sY(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis;class sQ extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function sZ(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}class s0 extends Error{constructor({message:e,code:t,cause:r,name:n}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=null!=(s=null!=n?n:r instanceof Error?r.name:void 0)?s:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class s1 extends s0{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}let s2=new class{createNewAbortSignal(){if(this.controller){let e=Error("Cancelling existing WebAuthn API call for new one");e.name="AbortError",this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}};function s3(e){if(!e)throw Error("Credential creation options are required");if("u">typeof PublicKeyCredential&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseCreationOptionsFromJSON)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:n}=e,s=rm(e,["challenge","user","excludeCredentials"]),i=sv(t).buffer,a=Object.assign(Object.assign({},r),{id:sv(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e];o.excludeCredentials[e]=Object.assign(Object.assign({},t),{id:sv(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return o}function s4(e){if(!e)throw Error("Credential request options are required");if("u">typeof PublicKeyCredential&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&"function"==typeof PublicKeyCredential.parseRequestOptionsFromJSON)return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,n=rm(e,["challenge","allowCredentials"]),s=sv(t).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e];i.allowCredentials[e]=Object.assign(Object.assign({},t),{id:sv(t.id).buffer,type:t.type||"public-key",transports:t.transports})}}return i}function s5(e){var t;return"toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():{id:e.id,rawId:e.id,response:{attestationObject:sw(new Uint8Array(e.response.attestationObject)),clientDataJSON:sw(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function s6(e){var t;if("toJSON"in e&&"function"==typeof e.toJSON)return e.toJSON();let r=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:sw(new Uint8Array(n.authenticatorData)),clientDataJSON:sw(new Uint8Array(n.clientDataJSON)),signature:sw(new Uint8Array(n.signature)),userHandle:n.userHandle?sw(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:null!=(t=e.authenticatorAttachment)?t:void 0}}function s8(e){return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}async function s9(e){try{let t=await navigator.credentials.create(e);if(!t)return{data:null,error:new s1("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new s1("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){var r,n,s;let{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new s0({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if((null==(r=i.authenticatorSelection)?void 0:r.requireResidentKey)===!0)return new s0({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});else if("conditional"===t.mediation&&(null==(n=i.authenticatorSelection)?void 0:n.userVerification)==="required")return new s0({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});else if((null==(s=i.authenticatorSelection)?void 0:s.userVerification)==="required")return new s0({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new s0({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new s0({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new s0(0===i.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s8(t))return new s0({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(i.rp.id!==t)return new s0({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new s0({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new s0({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new s0({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}async function s7(e){try{let t=await navigator.credentials.get(e);if(!t)return{data:null,error:new s1("Empty credential response",t)};if(!(t instanceof PublicKeyCredential))return{data:null,error:new s1("Browser returned unexpected credential type",t)};return{data:t,error:null}}catch(t){return{data:null,error:function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new s0({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new s0({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s8(t))return new s0({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new s0({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new s0({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return new s0({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}({error:t,options:e})}}}let ie={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},it={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ir(...e){let t=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),r=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),n={};for(let s of e)if(s)for(let e in s){let i=s[e];if(void 0!==i)if(Array.isArray(i))n[e]=i;else if(r(i))n[e]=i;else if(t(i)){let r=n[e];t(r)?n[e]=ir(r,i):n[e]=ir(i)}else n[e]=i}return n}class is{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},s){var i,a,o,l,c;try{let{data:u,error:h}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!u)return{data:null,error:h};let d=null!=n?n:s2.createNewAbortSignal();if("create"===u.webauthn.type){let{user:e}=u.webauthn.credential_options.publicKey;if(!e.name)if(r)e.name=`${e.id}:${r}`;else{let t=(await this.client.getUser()).data.user,r=(null==(i=null==t?void 0:t.user_metadata)?void 0:i.name)||(null==t?void 0:t.email)||(null==t?void 0:t.id)||"User";e.name=`${e.id}:${r}`}e.displayName||(e.displayName=e.name)}switch(u.webauthn.type){case"create":{let t=(a=u.webauthn.credential_options.publicKey,o=null==s?void 0:s.create,ir(ie,a,o||{})),{data:r,error:n}=await s9({publicKey:t,signal:d});if(r)return{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}case"request":{let t=(l=u.webauthn.credential_options.publicKey,c=null==s?void 0:s.request,ir(it,l,c||{})),{data:r,error:n}=await s7(Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:t,signal:d}));if(r)return{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:r}},error:null};return{data:null,error:n}}}}catch(e){if(n7(e))return{data:null,error:e};return{data:null,error:new st("Unexpected error in challenge",e)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t,rpOrigins:r,signal:n}={}},s){if(!t)return{data:null,error:new n9("rpId is required for WebAuthn authentication")};try{1;return{data:null,error:new st("Browser does not support WebAuthn",null)}}catch(e){if(n7(e))return{data:null,error:e};return{data:null,error:new st("Unexpected error in authenticate",e)}}}async _register({friendlyName:e,webauthn:{rpId:t,rpOrigins:r,signal:n}={}},s){if(!t)return{data:null,error:new n9("rpId is required for WebAuthn registration")};try{1;return{data:null,error:new st("Browser does not support WebAuthn",null)}}catch(e){if(n7(e))return{data:null,error:e};return{data:null,error:new st("Unexpected error in register",e)}}}}if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"u">typeof self&&(self.globalThis=self)}let ii={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:n4,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function ia(e,t,r){return await r()}let io={};class il{get jwks(){var e,t;return null!=(t=null==(e=io[this.storageKey])?void 0:e.jwks)?t:{keys:[]}}set jwks(e){io[this.storageKey]=Object.assign(Object.assign({},io[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return null!=(t=null==(e=io[this.storageKey])?void 0:e.cachedAt)?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){io[this.storageKey]=Object.assign(Object.assign({},io[this.storageKey]),{cachedAt:e})}constructor(e){var t,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const n=Object.assign(Object.assign({},ii),e);this.storageKey=n.storageKey,this.instanceID=null!=(t=il.nextInstanceID[this.storageKey])?t:0,il.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!n.debug,"function"==typeof n.debug&&(this.logger=n.debug),this.instanceID,this.persistSession=n.persistSession,this.autoRefreshToken=n.autoRefreshToken,this.experimental=null!=(r=n.experimental)?r:{},this.admin=new sJ({url:n.url,headers:n.headers,fetch:n.fetch,experimental:this.experimental}),this.url=n.url,this.headers=n.headers,this.fetch=s_(n.fetch),this.lock=n.lock||ia,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,this.throwOnError=n.throwOnError,this.lockAcquireTimeout=n.lockAcquireTimeout,n.lock?this.lock=n.lock:(this.persistSession,this.lock=ia),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new is(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(n.storage?this.storage=n.storage:(this.memoryStorage={},this.storage=sY(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=sY(this.memoryStorage)),n.skipAutoInitialize||this.initialize().catch(e=>{this._debug("#initialize()","error",e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${n3}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){try{return await this._recoverAndRefresh(),{error:null}}catch(e){if(n7(e))return this._returnResult({error:e});return this._returnResult({error:new st("Unexpected error during initialization",e)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{let{data:s,error:i}=await sq(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:null!=(r=null==(t=null==e?void 0:e.options)?void 0:t.data)?r:{},gotrue_meta_security:{captcha_token:null==(n=null==e?void 0:e.options)?void 0:n.captchaToken}},xform:sF});if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let a=s.session,o=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){var t,r,n;try{let s;if("email"in e){let{email:r,password:n,options:i}=e,a=null,o=null;"pkce"===this.flowType&&([a,o]=await sA(this.storage,this.storageKey)),s=await sq(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==i?void 0:i.emailRedirectTo,body:{email:r,password:n,data:null!=(t=null==i?void 0:i.data)?t:{},gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:a,code_challenge_method:o},xform:sF})}else if("phone"in e){let{phone:t,password:i,options:a}=e;s=await sq(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:i,data:null!=(r=null==a?void 0:a.data)?r:{},channel:null!=(n=null==a?void 0:a.channel)?n:"sms",gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:sF})}else throw new sa("You must provide either an email or phone number and a password");let{data:i,error:a}=s;if(a||!i)return await sR(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});let o=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if("email"in e){let{email:r,password:n,options:s}=e;t=await sq(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:sG})}else if("phone"in e){let{phone:r,password:n,options:s}=e;t=await sq(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:sG})}else throw new sa("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){let e=new si;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){var t,r,n,s;return await this._handleProviderSignIn(e.provider,{redirectTo:null==(t=e.options)?void 0:t.redirectTo,scopes:null==(r=e.options)?void 0:r.scopes,queryParams:null==(n=e.options)?void 0:n.queryParams,skipBrowserRedirect:null==(s=e.options)?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,s,i,a,o,l,c,u,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let{chain:u,wallet:h,statement:g,options:m}=e;if("object"!=typeof h||!(null==m?void 0:m.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");let b=new URL(null!=(t=null==m?void 0:m.url)?t:window.location.href),y=await h.request({method:"eth_requestAccounts"}).then(e=>e).catch(()=>{throw Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!y||0===y.length)throw Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let v=sZ(y[0]),w=null==(r=null==m?void 0:m.signInWithEthereum)?void 0:r.chainId;w||(w=parseInt(await h.request({method:"eth_chainId"}),16)),p=function(e){var t;let{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:c,scheme:u,uri:h,version:d}=e;if(!Number.isInteger(r))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if("1"!==d)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(null==(t=e.statement)?void 0:t.includes("\n"))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let p=sZ(e.address),f=u?`${u}://${n}`:n,g=e.statement?`${e.statement}
|
|
42
|
+
`:"",m=`${f} wants you to sign in with your Ethereum account:
|
|
43
|
+
${p}
|
|
44
|
+
|
|
45
|
+
${g}`,b=`URI: ${h}
|
|
46
|
+
Version: ${d}
|
|
47
|
+
Chain ID: ${r}${a?`
|
|
48
|
+
Nonce: ${a}`:""}
|
|
49
|
+
Issued At: ${i.toISOString()}`;if(s&&(b+=`
|
|
50
|
+
Expiration Time: ${s.toISOString()}`),o&&(b+=`
|
|
51
|
+
Not Before: ${o.toISOString()}`),l&&(b+=`
|
|
52
|
+
Request ID: ${l}`),c){let e="\nResources:";for(let t of c){if(!t||"string"!=typeof t)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`
|
|
53
|
+
- ${t}`}b+=e}return`${m}
|
|
54
|
+
${b}`}({domain:b.host,address:v,statement:g,uri:b.href,version:"1",chainId:w,nonce:null==(n=null==m?void 0:m.signInWithEthereum)?void 0:n.nonce,issuedAt:null!=(i=null==(s=null==m?void 0:m.signInWithEthereum)?void 0:s.issuedAt)?i:new Date,expirationTime:null==(a=null==m?void 0:m.signInWithEthereum)?void 0:a.expirationTime,notBefore:null==(o=null==m?void 0:m.signInWithEthereum)?void 0:o.notBefore,requestId:null==(l=null==m?void 0:m.signInWithEthereum)?void 0:l.requestId,resources:null==(c=null==m?void 0:m.signInWithEthereum)?void 0:c.resources}),f=await h.request({method:"personal_sign",params:[(d=p,"0x"+Array.from(new TextEncoder().encode(d),e=>e.toString(16).padStart(2,"0")).join("")),v]})}try{let{data:t,error:r}=await sq(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:f},(null==(u=e.options)?void 0:u.captchaToken)?{gotrue_meta_security:{captcha_token:null==(h=e.options)?void 0:h.captchaToken}}:null),xform:sF});if(r)throw r;if(!t||!t.session||!t.user){let e=new si;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){var t,r,n,s,i,a,o,l,c,u,h,d;let p,f;if("message"in e)p=e.message,f=e.signature;else{let{chain:h,wallet:d,statement:g,options:m}=e;if("object"!=typeof d||!(null==m?void 0:m.url))throw Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");let b=new URL(null!=(t=null==m?void 0:m.url)?t:window.location.href);if("signIn"in d&&d.signIn){let e,t=await d.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},null==m?void 0:m.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),g?{statement:g}:null));if(Array.isArray(t)&&t[0]&&"object"==typeof t[0])e=t[0];else if(t&&"object"==typeof t&&"signedMessage"in t&&"signature"in t)e=t;else throw Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in e&&"signature"in e&&("string"==typeof e.signedMessage||e.signedMessage instanceof Uint8Array)&&e.signature instanceof Uint8Array)p="string"==typeof e.signedMessage?e.signedMessage:new TextDecoder().decode(e.signedMessage),f=e.signature;else throw Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in d)||"function"!=typeof d.signMessage||!("publicKey"in d)||"object"!=typeof d||!d.publicKey||!("toBase58"in d.publicKey)||"function"!=typeof d.publicKey.toBase58)throw Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${b.host} wants you to sign in with your Solana account:`,d.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${null!=(n=null==(r=null==m?void 0:m.signInWithSolana)?void 0:r.issuedAt)?n:new Date().toISOString()}`,...(null==(s=null==m?void 0:m.signInWithSolana)?void 0:s.notBefore)?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...(null==(i=null==m?void 0:m.signInWithSolana)?void 0:i.expirationTime)?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...(null==(a=null==m?void 0:m.signInWithSolana)?void 0:a.chainId)?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...(null==(o=null==m?void 0:m.signInWithSolana)?void 0:o.nonce)?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...(null==(l=null==m?void 0:m.signInWithSolana)?void 0:l.requestId)?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...(null==(u=null==(c=null==m?void 0:m.signInWithSolana)?void 0:c.resources)?void 0:u.length)?["Resources",...m.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join("\n");let e=await d.signMessage(new TextEncoder().encode(p),"utf8");if(!e||!(e instanceof Uint8Array))throw Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");f=e}}try{let{data:t,error:r}=await sq(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:sw(f)},(null==(h=e.options)?void 0:h.captchaToken)?{gotrue_meta_security:{captcha_token:null==(d=e.options)?void 0:d.captchaToken}}:null),xform:sF});if(r)throw r;if(!t||!t.session||!t.user){let e=new si;return this._returnResult({data:{user:null,session:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:Object.assign({},t),error:r})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let t=await sS(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(null!=t?t:"").split("/");try{if(!r&&"pkce"===this.flowType)throw new sl;let{data:t,error:s}=await sq(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:sF});if(await sR(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!t||!t.session||!t.user){let e=new si;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("recovery"===n?"PASSWORD_RECOVERY":"SIGNED_IN",t.session)),this._returnResult({data:Object.assign(Object.assign({},t),{redirectType:null!=n?n:null}),error:s})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:r,token:n,access_token:s,nonce:i}=e,{data:a,error:o}=await sq(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:sF});if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let e=new si;return this._returnResult({data:{user:null,session:null},error:e})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:o})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){var t,r,n,s,i;try{if("email"in e){let{email:n,options:s}=e,i=null,a=null;"pkce"===this.flowType&&([i,a]=await sA(this.storage,this.storageKey));let{error:o}=await sq(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!=(t=null==s?void 0:s.data)?t:{},create_user:null==(r=null==s?void 0:s.shouldCreateUser)||r,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}if("phone"in e){let{phone:t,options:r}=e,{data:a,error:o}=await sq(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!=(n=null==r?void 0:r.data)?n:{},create_user:null==(s=null==r?void 0:r.shouldCreateUser)||s,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!=(i=null==r?void 0:r.channel)?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o})}throw new sa("You must provide either an email or phone number.")}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){var t,r;try{let n,s;"options"in e&&(n=null==(t=e.options)?void 0:t.redirectTo,s=null==(r=e.options)?void 0:r.captchaToken);let{data:i,error:a}=await sq(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:n,xform:sF});if(a)throw a;if(!i)throw Error("An error occurred on token verification.");let o=i.session,l=i.user;return(null==o?void 0:o.access_token)&&(await this._saveSession(o),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",o)),this._returnResult({data:{user:l,session:o},error:null})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){var t,r,n,s;try{let i=null,a=null;"pkce"===this.flowType&&([i,a]=await sA(this.storage,this.storageKey));let o=await sq(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!=(r=null==(t=e.options)?void 0:t.redirectTo)?r:void 0}),(null==(n=null==e?void 0:e.options)?void 0:n.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:a}),headers:this.headers,xform:sV});return null==(s=o.data)||s.url,this._returnResult(o)}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new sn;let{error:n}=await sq(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if("email"in e){let{email:r,type:n,options:s}=e,{error:i}=await sq(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},redirectTo:null==s?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}if("phone"in e){let{phone:r,type:n,options:s}=e,{data:i,error:a}=await sq(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:null==i?void 0:i.message_id},error:a})}throw new sa("You must provide either an email or phone number and a type")}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let t=null,r=await sS(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),null!==r&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let n=!!t.expires_at&&1e3*t.expires_at-Date.now()<9e4;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){let e=await sS(this.userStorage,this.storageKey+"-user");(null==e?void 0:e.user)?t.user=e.user:t.user=s$()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){var e;let r={value:this.suppressGetSessionWarning};t.user=(e=t.user,new Proxy(e,{get:(e,t,n)=>{if("__isInsecureUserWarningProxy"===t)return!0;if("symbol"==typeof t){let r=t.toString();if("Symbol(Symbol.toPrimitive)"===r||"Symbol(Symbol.toStringTag)"===r||"Symbol(util.inspect.custom)"===r||"Symbol(nodejs.util.inspect.custom)"===r)return Reflect.get(e,t,n)}return r.value||"string"!=typeof t||(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),r.value=!0),Reflect.get(e,t,n)}})),r.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:s,error:i}=await this._callRefreshToken(t.refresh_token);if(i)return this._returnResult({data:{session:null},error:i});return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{if(e)return await sq(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:sW});return await this._useSession(async e=>{var t,r,n;let{data:s,error:i}=e;if(i)throw i;return(null==(t=s.session)?void 0:t.access_token)||this.hasCustomAuthorizationHeader?await sq(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0,xform:sW}):{data:{user:null},error:new sn}})}catch(e){if(n7(e))return ss(e)&&(await this._removeSession(),await sR(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:n,error:s}=r;if(s)throw s;if(!n.session)throw new sn;let i=n.session,a=null,o=null;"pkce"===this.flowType&&null!=e.email&&([a,o]=await sA(this.storage,this.storageKey));let{data:l,error:c}=await sq(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:o}),jwt:i.access_token,xform:sW});if(c)throw c;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new sn;let t=Date.now()/1e3,r=t,n=!0,s=null,{payload:i}=sk(e.access_token);if(i.exp&&(n=(r=i.exp)<=t),n){let{data:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!t)return{data:{user:null,session:null},error:null};s=t}else{let{data:n,error:i}=await this._getUser(e.access_token);if(i)return this._returnResult({data:{user:null,session:null},error:i});s={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(e){if(n7(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:s}=t;if(s)throw s;e=null!=(r=n.session)?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new sn;let{data:n,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{throw new so("No browser detected.")}catch(e){if(n7(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return"function"==typeof this.detectSessionInUrl?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await sS(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s&&!ss(s))return this._returnResult({error:s});let i=null==(r=n.session)?void 0:r.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(n7(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status||403===t.status)||ss(t)))return this._returnResult({error:t})}return"others"!==e&&(await this._removeSession(),await sR(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=Symbol("auth-callback"),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:s}=t;if(s)throw s;await (null==(r=this.stateChangeEmitters.get(e))?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){await (null==(n=this.stateChangeEmitters.get(e))?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),ss(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;"pkce"===this.flowType&&([r,n]=await sA(this.storage,this.storageKey,!0));try{return await sq(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){var e;try{let{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:null!=(e=t.user.identities)?e:[]},error:null})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:r}=await this._useSession(async t=>{var r,n,s,i,a;let{data:o,error:l}=t;if(l)throw l;let c=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null==(r=e.options)?void 0:r.redirectTo,scopes:null==(n=e.options)?void 0:n.scopes,queryParams:null==(s=e.options)?void 0:s.queryParams,skipBrowserRedirect:!0});return await sq(this.fetch,"GET",c,{headers:this.headers,jwt:null!=(a=null==(i=o.session)?void 0:i.access_token)?a:void 0})});if(r)throw r;return this._returnResult({data:{provider:e.provider,url:null==t?void 0:t.url},error:null})}catch(t){if(n7(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{let{error:n,data:{session:s}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:l,nonce:c}=e,{data:u,error:h}=await sq(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:null!=(r=null==s?void 0:s.access_token)?r:void 0,body:{provider:a,id_token:o,access_token:l,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:sF});if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!u||!u.session||!u.user)return this._returnResult({data:{user:null,session:null},error:new si});return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("USER_UPDATED",u.session)),this._returnResult({data:u,error:h})}catch(e){if(await sR(this.storage,`${this.storageKey}-code-verifier`),n7(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)throw i;return await sq(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!=(n=null==(r=s.session)?void 0:r.access_token)?n:void 0})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{var r,n;let s=Date.now();return await (r=async r=>(r>0&&await sO(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await sq(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:sF})),n=(e,t)=>{let r=200*Math.pow(2,e);return t&&su(t)&&Date.now()+r-s<3e4},new Promise((e,t)=>{(async()=>{for(let s=0;s<1/0;s++)try{let t=await r(s);if(!n(s,null,t))return void e(t)}catch(e){if(!n(s,e))return void t(e)}})()}))}catch(e){if(this._debug(t,"error",e),n7(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await sS(this.storage,this.storageKey);if(n&&this.userStorage){let t=await sS(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!t&&(t={user:n.user},await sE(this.userStorage,this.storageKey+"-user",t)),n.user=null!=(e=null==t?void 0:t.user)?e:s$()}else if(n&&!n.user&&!n.user){let e=await sS(this.storage,this.storageKey+"-user");e&&(null==e?void 0:e.user)?(n.user=e.user,await sR(this.storage,this.storageKey+"-user"),await sE(this.storage,this.storageKey,n)):n.user=s$()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),null!==n&&await this._removeSession();return}let s=(null!=(t=n.expires_at)?t:1/0)*1e3-Date.now()<9e4;if(this._debug(r,`session has${s?"":" not"} expired with margin of 90000s`),s){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=await this._callRefreshToken(n.refresh_token);e&&(console.error(e),su(e)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else if(n.user&&!0===n.user.__isUserNotAvailableProxy)try{let{data:e,error:t}=await this._getUser(n.access_token);!t&&(null==e?void 0:e.user)?(n.user=e.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(e){console.error("Error getting user data:",e),this._debug(r,"error getting user data, skipping SIGNED_IN notification",e)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(r,"error",e),console.error(e);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new sn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new sT;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new sn;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let n={data:t.session,error:null};return this.refreshingDeferred.resolve(n),n}catch(e){if(this._debug(n,"error",e),n7(e)){let r={data:null,error:e};return su(e)||await this._removeSession(),null==(t=this.refreshingDeferred)||t.resolve(r),r}throw null==(r=this.refreshingDeferred)||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(s),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await sR(this.storage,`${this.storageKey}-code-verifier`);let t=Object.assign({},e),r=t.user&&!0===t.user.__isUserNotAvailableProxy;if(this.userStorage){!r&&t.user&&await sE(this.userStorage,this.storageKey+"-user",{user:t.user});let e=Object.assign({},t);delete e.user;let n=sL(e);await sE(this.storage,this.storageKey,n)}else{let e=sL(t);await sE(this.storage,this.storageKey,e)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await sR(this.storage,this.storageKey),await sR(this.storage,this.storageKey+"-code-verifier"),await sR(this.storage,this.storageKey+"-user"),this.userStorage&&await sR(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()"),this.visibilityChangedCallback,this.visibilityChangedCallback=null}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&"object"==typeof t&&"function"==typeof t.unref?t.unref():"u">typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof sQ)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){return this._debug("#_handleVisibilityChange()"),this.autoRefreshToken&&this.startAutoRefresh(),!1}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{"visible"!==document.visibilityState?this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting"):await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){let n=[`provider=${encodeURIComponent(t)}`];if((null==r?void 0:r.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),(null==r?void 0:r.scopes)&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),"pkce"===this.flowType){let[e,t]=await sA(this.storage,this.storageKey),r=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});n.push(r.toString())}if(null==r?void 0:r.queryParams){let e=new URLSearchParams(r.queryParams);n.push(e.toString())}return(null==r?void 0:r.skipBrowserRedirect)&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;return s?this._returnResult({data:null,error:s}):await sq(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},"phone"===e.factorType?{phone:e.phone}:"totp"===e.factorType?{issuer:e.issuer}:{}),{data:o,error:l}=await sq(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:null==(r=null==s?void 0:s.session)?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):("totp"===e.factorType&&"totp"===o.type&&(null==(n=null==o?void 0:o.totp)?void 0:n.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),this._returnResult({data:o,error:null}))})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:"create"===e.webauthn.type?s5(e.webauthn.credential_response):s6(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await sq(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:o}))})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{var r;let{data:n,error:s}=t;if(s)return this._returnResult({data:null,error:s});let i=await sq(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:null==(r=null==n?void 0:n.session)?void 0:r.access_token});if(i.error)return i;let{data:a}=i;if("webauthn"!==a.type)return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:s3(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:s4(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;let{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};let n={all:[],phone:[],totp:[],webauthn:[]};for(let r of null!=(e=null==t?void 0:t.factors)?e:[])n.all.push(r),"verified"===r.status&&n[r.factor_type].push(r);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,s;if(e)try{let{payload:n}=sk(e),s=null;n.aal&&(s=n.aal);let i=s,{data:{user:a},error:o}=await this.getUser(e);if(o)return this._returnResult({data:null,error:o});(null!=(r=null==(t=null==a?void 0:a.factors)?void 0:t.filter(e=>"verified"===e.status))?r:[]).length>0&&(i="aal2");let l=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:l},error:null}}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:i},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:o}=sk(i.access_token),l=null;o.aal&&(l=o.aal);let c=l;return(null!=(s=null==(n=i.user.factors)?void 0:n.filter(e=>"verified"===e.status))?s:[]).length>0&&(c="aal2"),{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:o.amr||[]},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await sq(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new sn})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new sn});let s=await sq(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"approve"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url,s})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new sn});let s=await sq(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:"deny"},xform:e=>({data:e,error:null})});return s.data&&s.data.redirect_url,s})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await sq(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new sn})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await sq(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new sn})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(t=>t.kid===e);if(r)return r;let n=Date.now();if((r=this.jwks.keys.find(t=>t.kid===e))&&this.jwks_cached_at+6e5>n)return r;let{data:s,error:i}=await sq(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return s.keys&&0!==s.keys.length&&(this.jwks=s,this.jwks_cached_at=n,r=s.keys.find(t=>t.kid===e))?r:null}async getClaims(e,t={}){try{var r;let n,s=e;if(!s){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});s=e.session.access_token}let{header:i,payload:a,signature:o,raw:{header:l,payload:c}}=sk(s);(null==t?void 0:t.allowExpired)||function(e){if(!e)throw Error("Missing exp claim");if(e<=Math.floor(Date.now()/1e3))throw Error("JWT has expired")}(a.exp);let u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,(null==t?void 0:t.keys)?{keys:t.keys}:null==t?void 0:t.jwks);if(!u){let{error:e}=await this.getUser(s);if(e)throw e;return{data:{claims:a,header:i,signature:o},error:null}}let h=function(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw Error("Invalid alg claim")}}(i.alg),d=await crypto.subtle.importKey("jwk",u,h,!0,["verify"]);if(!await crypto.subtle.verify(h,d,o,(r=`${l}.${c}`,n=[],!function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(r,e=>n.push(e)),new Uint8Array(n))))throw new sd("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){var t,r,n;sD(this.experimental);try{1;return this._returnResult({data:null,error:new st("Browser does not support WebAuthn",null)})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){var t,r;sD(this.experimental);try{1;return this._returnResult({data:null,error:new st("Browser does not support WebAuthn",null)})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){sD(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new sn});let{data:n,error:s}=await sq(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){sD(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new sn});let{data:s,error:i}=await sq(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){var t;sD(this.experimental);try{let{data:r,error:n}=await sq(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:null==(t=null==e?void 0:e.options)?void 0:t.captchaToken}}});if(n)return this._returnResult({data:null,error:n});return this._returnResult({data:r,error:null})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){sD(this.experimental);try{let{data:t,error:r}=await sq(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:sF});if(r)return this._returnResult({data:null,error:r});return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){sD(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new sn});let{data:n,error:s}=await sq(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){sD(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new sn});let{data:s,error:i}=await sq(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){sD(this.experimental);try{return await this._useSession(async t=>{let{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new sn});let{error:s}=await sq(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(e){if(n7(e))return this._returnResult({data:null,error:e});throw e}}}il.nextInstanceID={};let ic=il,iu="";iu="u">typeof Deno?"deno":"u">typeof document?"web":"u">typeof navigator&&"ReactNative"===navigator.product?"react-native":"node";let ih={headers:{"X-Client-Info":`supabase-js-${iu}/2.106.0`}},id={schema:"public"},ip={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ig={},im={enabled:!1,respectSamplingDecision:!0},ib=null;function iy(e){return(iy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function iv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function iw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iv(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e,t){if("object"!=iy(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=iy(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==iy(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iv(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}async function i_(e,t,r){if(!function(e,t){let r;if(!e||!t||0===t.length)return!1;if(e instanceof URL)r=e;else try{r=new URL(e)}catch(e){return!1}for(let e of t)try{if("string"==typeof e){if(function(e,t){if(t===e)return!0;if(t.startsWith("*.")){let r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}(r.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(r.hostname))return!0}else if("function"==typeof e&&e(r))return!0}catch(e){continue}return!1}("string"==typeof e||e instanceof URL?e:e.url,t))return null;let n=await function(){var e,t,r,n;return e=this,t=void 0,r=void 0,n=function*(){try{let e=yield(null===ib&&(ib=import("@opentelemetry/api").catch(()=>null)),ib);if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let r=t.traceparent;if(!r)return null;return{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}}catch(e){return null}},new(r||(r=Promise))(function(s,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function o(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}();if(!n||!n.traceparent)return null;if(r){let e=function(e){if(!e||"string"!=typeof e)return null;let t=e.split("-");if(4!==t.length)return null;let[r,n,s,i]=t;if(2!==r.length||32!==n.length||16!==s.length||2!==i.length)return null;let a=/^[0-9a-f]+$/i;return a.test(r)&&a.test(n)&&a.test(s)&&a.test(i)&&"00000000000000000000000000000000"!==n&&"0000000000000000"!==s?{version:r,traceId:n,parentId:s,traceFlags:i,isSampled:(1&parseInt(i,16))==1}:null}(n.traceparent);if(e&&!e.isSampled)return null}return n}function iE(e){return"boolean"==typeof e?{enabled:e}:e}var iS=class extends ic{constructor(e){super(e)}},iR=class{constructor(e,t,r){var n,s,i;this.supabaseUrl=e,this.supabaseKey=t;const a=function(e){let t=null==e?void 0:e.trim();if(!t)throw Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(t.endsWith("/")?t:t+"/")}catch(e){throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}(e);if(!t)throw Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l=function(e,t){var r,n,s,i,a,o;let{db:l,auth:c,realtime:u,global:h}=e,{db:d,auth:p,realtime:f,global:g}=t,m=iE(e.tracePropagation),b=iE(t.tracePropagation),y={db:iw(iw({},d),l),auth:iw(iw({},p),c),realtime:iw(iw({},f),u),storage:{},global:iw(iw(iw({},g),h),{},{headers:iw(iw({},null!=(r=null==g?void 0:g.headers)?r:{}),null!=(n=null==h?void 0:h.headers)?n:{})}),tracePropagation:{enabled:null!=(s=null!=(i=null==m?void 0:m.enabled)?i:null==b?void 0:b.enabled)&&s,respectSamplingDecision:null==(a=null!=(o=null==m?void 0:m.respectSamplingDecision)?o:null==b?void 0:b.respectSamplingDecision)||a},accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}(null!=r?r:{},{db:id,realtime:ig,auth:iw(iw({},ip),{},{storageKey:o}),global:ih,tracePropagation:im});this.settings=l,this.storageKey=null!=(n=l.auth.storageKey)?n:"",this.headers=null!=(s=l.global.headers)?s:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(null!=(i=l.auth)?i:{},this.headers,l.global.fetch),this.fetch=((e,t,r,n,s)=>{let i=n?(...e)=>n(...e):(...e)=>fetch(...e),a=Headers,o=(null==s?void 0:s.enabled)===!0,l=(null==s?void 0:s.respectSamplingDecision)!==!1,c=o?function(e){let t=[];try{let r=new URL(e);t.push(r.hostname)}catch(e){}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}(t):null;return async(t,n)=>{var s;let o=null!=(s=await r())?s:e,u=new a(null==n?void 0:n.headers);if(u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${o}`),c){let e=await i_(t,c,l);e&&(e.traceparent&&!u.has("traceparent")&&u.set("traceparent",e.traceparent),e.tracestate&&!u.has("tracestate")&&u.set("tracestate",e.tracestate),e.baggage&&!u.has("baggage")&&u.set("baggage",e.baggage))}return i(t,iw(iw({},n),{},{headers:u}))}})(t,e,this._getAccessToken.bind(this),l.global.fetch,l.tracePropagation),this.realtime=this._initRealtimeClient(iw({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn("Failed to set initial Realtime auth token:",e)),this.rest=new rA(new URL("rest/v1",a).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new n2(this.storageUrl.href,this.headers,this.fetch,null==r?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new rb(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,t;if(this.accessToken)return await this.accessToken();let{data:r}=await this.auth.getSession();return null!=(e=null==(t=r.session)?void 0:t.access_token)?e:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:a,lock:o,debug:l,throwOnError:c,experimental:u,lockAcquireTimeout:h,skipAutoInitialize:d},p,f){let g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new iS({url:this.authUrl.href,headers:iw(iw({},g),p),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:o,debug:l,throwOnError:c,experimental:u,fetch:f,lockAcquireTimeout:h,skipAutoInitialize:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>"authorization"===e.toLowerCase())})}_initRealtimeClient(e){return new nf(this.realtimeUrl.href,iw(iw({},e),{},{params:iw(iw({},{apikey:this.supabaseKey}),null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):"SIGNED_OUT"===e&&(this.realtime.setAuth(),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}};(function(){let e=globalThis.process;if(!e)return!1;let t=e.version;if(null==t)return!1;let r=t.match(/^v(\d+)\./);return!!r&&18>=parseInt(r[1],10)})()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");var iT=e.i(64742);let ik={path:"/",sameSite:"lax",httpOnly:!1,maxAge:3456e4},iO=/^(.*)[.](0|[1-9][0-9]*)$/;function iP(e,t){if(e===t)return!0;let r=e.match(iO);return!!r&&r[1]===t}function ix(e,t,r){let n=r??3180,s=encodeURIComponent(t);if(s.length<=n)return[{name:e,value:t}];let i=[];for(;s.length>0;){let e=s.slice(0,n),t=e.lastIndexOf("%");t>n-3&&(e=e.slice(0,t));let r="";for(;e.length>0;)try{r=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&"%"===e.at(-3)&&e.length>3)e=e.slice(0,e.length-3);else throw t}i.push(r),s=s.slice(e.length)}return i.map((t,r)=>({name:`${e}.${r}`,value:t}))}async function iC(e,t){let r=await t(e);if(r)return r;let n=[];for(let r=0;;r++){let s=`${e}.${r}`,i=await t(s);if(!i)break;n.push(i)}return n.length>0?n.join(""):null}iT.parse,iT.serialize;let iA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),iN=" \n\r=".split(""),iI=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<iN.length;t+=1)e[iN[t].charCodeAt(0)]=-2;for(let t=0;t<iA.length;t+=1)e[iA[t].charCodeAt(0)]=t;return e})();function ij(e){let t=[],r=0,n=0;if(function(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){let t=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127)return t(e);if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(n,t)}}(e,e=>{for(r=r<<8|e,n+=8;n>=6;){let e=r>>n-6&63;t.push(iA[e]),n-=6}}),n>0)for(r<<=6-n,n=6;n>=6;){let e=r>>n-6&63;t.push(iA[e]),n-=6}return t.join("")}let iD="base64-";function i$(e){let t;if(!e.startsWith(iD))return e;try{t=function(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},n={utf8seq:0,codepoint:0},s=0,i=0;for(let t=0;t<e.length;t+=1){let a=iI[e.charCodeAt(t)];if(a>-1)for(s=s<<6|a,i+=6;i>=8;)(function(e,t,r){if(0===t.utf8seq){if(e<=127)return r(e);for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}})(s>>i-8&255,n,r),i-=8;else if(-2===a)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join("")}(e.substring(iD.length))}catch(e){return console.warn("@supabase/ssr: could not base64url-decode chunked cookie value, treating as absent. Cookie chunks may have been written partially across responses.",e),null}try{JSON.parse(t)}catch{return console.warn("@supabase/ssr: chunked cookie decoded to invalid JSON, treating as absent. This usually indicates that cookie chunks from different writes were combined (e.g. response committed before all Set-Cookie headers were sent)."),null}return t}async function iL({getAll:e,setAll:t,setItems:r,removedItems:n},s){let i=s.cookieEncoding,a=s.cookieOptions??null,o=await e([...r?Object.keys(r):[],...n?Object.keys(n):[]]),l=o?.map(({name:e})=>e)||[],c=Object.keys(n).flatMap(e=>l.filter(t=>iP(t,e))),u=Object.keys(r).flatMap(e=>{let t=new Set(l.filter(t=>iP(t,e))),n=r[e];"base64url"===i&&(n=iD+ij(n));let s=ix(e,n);return s.forEach(e=>{t.delete(e.name)}),c.push(...t),s}),h={...ik,...a,maxAge:0},d={...ik,...a,maxAge:ik.maxAge};delete h.name,delete d.name,await t([...c.map(e=>({name:e,value:"",options:h})),...u.map(({name:e,value:t})=>({name:e,value:t,options:d}))],{"Cache-Control":"private, no-cache, no-store, must-revalidate, max-age=0",Expires:"0",Pragma:"no-cache"})}let iM=!1,iU=["@supabase/auth-helpers-nextjs","@supabase/auth-helpers-react","@supabase/auth-helpers-remix","@supabase/auth-helpers-sveltekit"];function iB(){return("https://ctruizaqyeyidujmtxhc.supabase.co".trim()??"").length>0&&("sb_publishable_gTYHeWoWIPPW3SIC4cYaXw_ux7UL_Jb".trim()??"").length>0}async function iq(e){if(!iB())return rh.NextResponse.next({request:e});let{supabase:t,response:r}=function(e){let t=rh.NextResponse.next({request:e}),{anon_key:r,url:n}=function(){if(!iB())throw Error("Supabase is not configured");return{url:"https://ctruizaqyeyidujmtxhc.supabase.co".trim(),anon_key:"sb_publishable_gTYHeWoWIPPW3SIC4cYaXw_ux7UL_Jb".trim()}}();return{supabase:function(e,t,r){if(!function(){if(iM||"u"<typeof process||!process.env?.npm_package_name)return;let e=process.env.npm_package_name;iU.includes(e)&&(iM=!0,console.warn(`
|
|
55
|
+
╔════════════════════════════════════════════════════════════════════════════╗
|
|
56
|
+
║ ⚠️ IMPORTANT: Package Consolidation Notice ║
|
|
57
|
+
║ ║
|
|
58
|
+
║ The ${e.padEnd(35)} package name is deprecated. ║
|
|
59
|
+
║ ║
|
|
60
|
+
║ You are now using @supabase/ssr - a unified solution for all frameworks. ║
|
|
61
|
+
║ ║
|
|
62
|
+
║ The auth-helpers packages have been consolidated into @supabase/ssr ║
|
|
63
|
+
║ to provide better maintenance and consistent APIs across frameworks. ║
|
|
64
|
+
║ ║
|
|
65
|
+
║ Please update your package.json to use @supabase/ssr directly: ║
|
|
66
|
+
║ npm uninstall ${e.padEnd(42)} ║
|
|
67
|
+
║ npm install @supabase/ssr ║
|
|
68
|
+
║ ║
|
|
69
|
+
║ For more information, visit: ║
|
|
70
|
+
║ https://supabase.com/docs/guides/auth/server-side ║
|
|
71
|
+
╚════════════════════════════════════════════════════════════════════════════╝
|
|
72
|
+
`))}(),!e||!t)throw Error(`Your project's URL and Key are required to create a Supabase client!
|
|
73
|
+
|
|
74
|
+
Check your Supabase project's API settings to find these values
|
|
75
|
+
|
|
76
|
+
https://supabase.com/dashboard/project/_/settings/api`);let{storage:n,getAll:s,setAll:i,setItems:a,removedItems:o}=function(e,t){let r,n,s=e.cookies??null,i=e.cookieEncoding,a={},o={},l=()=>{let e=(0,iT.parse)(document.cookie);return Object.keys(e).map(t=>({name:t,value:e[t]??""}))},c=e=>{e.forEach(({name:e,value:t,options:r})=>{document.cookie=(0,iT.serialize)(e,t,r)})};if(s)if("get"in s){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,r)=>`${e}.${r}`)]),r=[];for(let e=0;e<t.length;e+=1){let n=await s.get(t[e]);(n||"string"==typeof n)&&r.push({name:t[e],value:n})}return r};if(r=async t=>await e(t),"set"in s&&"remove"in s)n=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:n,options:i}=e[t];n?await s.set(r,n,i):await s.remove(r,i)}};else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)")}else if("getAll"in s)if(r=async()=>await s.getAll(),"setAll"in s)n=s.setAll;else if(t)n=async()=>{console.warn("@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)");else if(t||1)throw Error(`@supabase/ssr: ${t?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).`);else r=()=>l(),n=c;else if(t||1)if(t)throw Error("@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)");else r=()=>[],n=()=>{throw Error("@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed")};else r=()=>l(),n=c;return t?{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!0,getItem:async e=>{if("string"==typeof a[e])return a[e];if(o[e])return null;let t=await r([e]),n=await iC(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?"string"!=typeof n?n:i$(n):null},setItem:async(t,s)=>{t.endsWith("-code-verifier")&&await iL({getAll:r,setAll:n,setItems:{[t]:s},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:i}),a[t]=s,delete o[t]},removeItem:async e=>{delete a[e],o[e]=!0}}}:{getAll:r,setAll:n,setItems:a,removedItems:o,storage:{isServer:!1,getItem:async e=>{let t=await r([e]),n=await iC(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});return n?i$(n):null},setItem:async(t,s)=>{let a=await r([t]),o=new Set((a?.map(({name:e})=>e)||[]).filter(e=>iP(e,t))),l=s;"base64url"===i&&(l=iD+ij(s));let c=ix(t,l);c.forEach(({name:e})=>{o.delete(e)});let u={...ik,...e?.cookieOptions,maxAge:0},h={...ik,...e?.cookieOptions,maxAge:ik.maxAge};delete u.name,delete h.name;let d=[...[...o].map(e=>({name:e,value:"",options:u})),...c.map(({name:e,value:t})=>({name:e,value:t,options:h}))];d.length>0&&await n(d,{})},removeItem:async t=>{let s=await r([t]),i=(s?.map(({name:e})=>e)||[]).filter(e=>iP(e,t)),a={...ik,...e?.cookieOptions,maxAge:0};delete a.name,i.length>0&&await n(i.map(e=>({name:e,value:"",options:a})),{})}}}}({...r,cookieEncoding:r?.cookieEncoding??"base64url"},!0),l=new iR(e,t,{...r,global:{...r?.global,headers:{...r?.global?.headers,"X-Client-Info":"supabase-ssr/0.10.3 createServerClient"}},auth:{...r?.cookieOptions?.name?{storageKey:r.cookieOptions.name}:null,...r?.auth,flowType:"pkce",autoRefreshToken:!1,detectSessionInUrl:!1,persistSession:!0,skipAutoInitialize:!0,storage:n,...r?.cookies&&"encode"in r.cookies&&"tokens-only"===r.cookies.encode?{userStorage:r?.auth?.userStorage??function(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}()}:null}});return l.auth.onAuthStateChange(async e=>{(Object.keys(a).length>0||Object.keys(o).length>0)&&("SIGNED_IN"===e||"TOKEN_REFRESHED"===e||"USER_UPDATED"===e||"PASSWORD_RECOVERY"===e||"SIGNED_OUT"===e||"MFA_CHALLENGE_VERIFIED"===e)&&await iL({getAll:s,setAll:i,setItems:a,removedItems:o},{cookieOptions:r?.cookieOptions??null,cookieEncoding:r?.cookieEncoding??"base64url"})}),l}(n,r,{cookies:{getAll:()=>e.cookies.getAll(),setAll(r){r.forEach(({name:t,value:r})=>{e.cookies.set(t,r)}),t=rh.NextResponse.next({request:e}),r.forEach(({name:e,value:r,options:n})=>{t.cookies.set(e,r,n)})}}}),response:t}}(e);return await t.auth.getSession(),r}e.s(["config",0,{matcher:["/((?!_next/static|_next/image|favicon.ico|api/focus-nudges|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)"]},"proxy",0,iq],94824);let iH={...e.i(94824)},iF="/proxy",iG=iH.proxy||iH.default;if("function"!=typeof iG)throw new class extends Error{constructor(e){super(e),this.stack=""}}(`The Proxy file "${iF}" must export a function named \`proxy\` or a default function.`);let iW=e=>tN({...e,IncrementalCache:ru,incrementalCacheHandler:null,page:iF,handler:async(...e)=>{try{return await iG(...e)}catch(s){let t=e[0],r=new URL(t.url),n=r.pathname+r.search;throw await l(s,{path:n,method:t.method,headers:Object.fromEntries(t.headers.entries())},{routerKind:"Pages Router",routePath:"/proxy",routeType:"proxy",revalidateReason:void 0}),s}}});async function iV(e,t){let r=await iW({request:{url:e.url,method:e.method,headers:R(e.headers),nextConfig:{basePath:"",i18n:"",trailingSlash:!1,experimental:{cacheLife:{default:{stale:300,revalidate:900,expire:0xfffffffe},seconds:{stale:30,revalidate:1,expire:60},minutes:{stale:300,revalidate:60,expire:3600},hours:{stale:300,revalidate:3600,expire:86400},days:{stale:300,revalidate:86400,expire:604800},weeks:{stale:300,revalidate:604800,expire:2592e3},max:{stale:300,revalidate:2592e3,expire:31536e3}},authInterrupts:!1,clientParamParsingOrigins:[]}},page:{name:iF},body:"GET"!==e.method&&"HEAD"!==e.method?e.body??void 0:void 0,waitUntil:t.waitUntil,requestMeta:t.requestMeta,signal:t.signal||new AbortController().signal}});return null==t.waitUntil||t.waitUntil.call(t,r.waitUntil),r.response}e.s(["default",0,iW,"handler",0,iV],33344)}];
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0mft_cy._.js.map
|