@nextblock-cms/db 0.0.1 → 0.0.2

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/index.js DELETED
@@ -1,83 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Yi=s=>{let e;return s?e=s:typeof fetch>"u"?e=(...t)=>Promise.resolve().then(()=>bt).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)};class vn extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}}class Vi extends vn{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Mn extends vn{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Bn extends vn{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var on;(function(s){s.Any="any",s.ApNortheast1="ap-northeast-1",s.ApNortheast2="ap-northeast-2",s.ApSouth1="ap-south-1",s.ApSoutheast1="ap-southeast-1",s.ApSoutheast2="ap-southeast-2",s.CaCentral1="ca-central-1",s.EuCentral1="eu-central-1",s.EuWest1="eu-west-1",s.EuWest2="eu-west-2",s.EuWest3="eu-west-3",s.SaEast1="sa-east-1",s.UsEast1="us-east-1",s.UsWest1="us-west-1",s.UsWest2="us-west-2"})(on||(on={}));var Ji=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};class Qi{constructor(e,{headers:t={},customFetch:r,region:n=on.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=Yi(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var r;return Ji(this,void 0,void 0,function*(){try{const{headers:n,method:i,body:o}=t;let a={},{region:c}=t;c||(c=this.region);const l=new URL(`${this.url}/${e}`);c&&c!=="any"&&(a["x-region"]=c,l.searchParams.set("forceFunctionRegion",c));let d;o&&(n&&!Object.prototype.hasOwnProperty.call(n,"Content-Type")||!n)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",d=o):typeof o=="string"?(a["Content-Type"]="text/plain",d=o):typeof FormData<"u"&&o instanceof FormData?d=o:(a["Content-Type"]="application/json",d=JSON.stringify(o)));const h=yield this.fetch(l.toString(),{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),n),body:d}).catch(A=>{throw new Vi(A)}),f=h.headers.get("x-relay-error");if(f&&f==="true")throw new Mn(h);if(!h.ok)throw new Bn(h);let y=((r=h.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),E;return y==="application/json"?E=yield h.json():y==="application/octet-stream"?E=yield h.blob():y==="text/event-stream"?E=h:y==="multipart/form-data"?E=yield h.formData():E=yield h.text(),{data:E,error:null,response:h}}catch(n){return{data:null,error:n,response:n instanceof Bn||n instanceof Mn?n.context:void 0}}})}}function Zi(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function eo(s){if(Object.prototype.hasOwnProperty.call(s,"__esModule"))return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var n=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return s[r]}})}),t}var be={},it={},ot={},at={},ut={},ct={},to=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},vt=to();const ro=vt.fetch,yi=vt.fetch.bind(vt),wi=vt.Headers,no=vt.Request,so=vt.Response,bt=Object.freeze(Object.defineProperty({__proto__:null,Headers:wi,Request:no,Response:so,default:yi,fetch:ro},Symbol.toStringTag,{value:"Module"})),io=eo(bt);var Lt={},Hn;function Ei(){if(Hn)return Lt;Hn=1,Object.defineProperty(Lt,"__esModule",{value:!0});class s extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}}return Lt.default=s,Lt}var Fn;function Ri(){if(Fn)return ct;Fn=1;var s=ct&&ct.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ct,"__esModule",{value:!0});const e=s(io),t=s(Ei());class r{constructor(i){this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=i.headers,this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=i.shouldThrowOnError,this.signal=i.signal,this.isMaybeSingle=i.isMaybeSingle,i.fetch?this.fetch=i.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,o){return this.headers=Object.assign({},this.headers),this.headers[i]=o,this}then(i,o){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const a=this.fetch;let c=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var d,h,f;let y=null,E=null,A=null,_=l.status,p=l.statusText;if(l.ok){if(this.method!=="HEAD"){const g=await l.text();g===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?E=g:E=JSON.parse(g))}const m=(d=this.headers.Prefer)===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),R=(h=l.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");m&&R&&R.length>1&&(A=parseInt(R[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(E)&&(E.length>1?(y={code:"PGRST116",details:`Results contain ${E.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},E=null,A=null,_=406,p="Not Acceptable"):E.length===1?E=E[0]:E=null)}else{const m=await l.text();try{y=JSON.parse(m),Array.isArray(y)&&l.status===404&&(E=[],y=null,_=200,p="OK")}catch{l.status===404&&m===""?(_=204,p="No Content"):y={message:m}}if(y&&this.isMaybeSingle&&(!((f=y==null?void 0:y.details)===null||f===void 0)&&f.includes("0 rows"))&&(y=null,_=200,p="OK"),y&&this.shouldThrowOnError)throw new t.default(y)}return{error:y,data:E,count:A,status:_,statusText:p}});return this.shouldThrowOnError||(c=c.catch(l=>{var d,h,f;return{error:{message:`${(d=l==null?void 0:l.name)!==null&&d!==void 0?d:"FetchError"}: ${l==null?void 0:l.message}`,details:`${(h=l==null?void 0:l.stack)!==null&&h!==void 0?h:""}`,hint:"",code:`${(f=l==null?void 0:l.code)!==null&&f!==void 0?f:""}`},data:null,count:null,status:0,statusText:""}})),c.then(i,o)}returns(){return this}overrideTypes(){return this}}return ct.default=r,ct}var Wn;function Si(){if(Wn)return ut;Wn=1;var s=ut&&ut.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ut,"__esModule",{value:!0});const e=s(Ri());class t extends e.default{select(n){let i=!1;const o=(n??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(n,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:c=a}={}){const l=c?`${c}.order`:"order",d=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${d?`${d},`:""}${n}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(n,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${n}`),this}range(n,i,{foreignTable:o,referencedTable:a=o}={}){const c=typeof a>"u"?"offset":`${a}.offset`,l=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(c,`${n}`),this.url.searchParams.set(l,`${i-n+1}`),this}abortSignal(n){return this.signal=n,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:n=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:c=!1,format:l="text"}={}){var d;const h=[n?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,c?"wal":null].filter(Boolean).join("|"),f=(d=this.headers.Accept)!==null&&d!==void 0?d:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${l}; for="${f}"; options=${h};`,l==="json"?this:this}rollback(){var n;return((n=this.headers.Prefer)!==null&&n!==void 0?n:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}return ut.default=t,ut}var Gn;function bn(){if(Gn)return at;Gn=1;var s=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});const e=s(Si());class t extends e.default{eq(n,i){return this.url.searchParams.append(n,`eq.${i}`),this}neq(n,i){return this.url.searchParams.append(n,`neq.${i}`),this}gt(n,i){return this.url.searchParams.append(n,`gt.${i}`),this}gte(n,i){return this.url.searchParams.append(n,`gte.${i}`),this}lt(n,i){return this.url.searchParams.append(n,`lt.${i}`),this}lte(n,i){return this.url.searchParams.append(n,`lte.${i}`),this}like(n,i){return this.url.searchParams.append(n,`like.${i}`),this}likeAllOf(n,i){return this.url.searchParams.append(n,`like(all).{${i.join(",")}}`),this}likeAnyOf(n,i){return this.url.searchParams.append(n,`like(any).{${i.join(",")}}`),this}ilike(n,i){return this.url.searchParams.append(n,`ilike.${i}`),this}ilikeAllOf(n,i){return this.url.searchParams.append(n,`ilike(all).{${i.join(",")}}`),this}ilikeAnyOf(n,i){return this.url.searchParams.append(n,`ilike(any).{${i.join(",")}}`),this}is(n,i){return this.url.searchParams.append(n,`is.${i}`),this}in(n,i){const o=Array.from(new Set(i)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(n,`in.(${o})`),this}contains(n,i){return typeof i=="string"?this.url.searchParams.append(n,`cs.${i}`):Array.isArray(i)?this.url.searchParams.append(n,`cs.{${i.join(",")}}`):this.url.searchParams.append(n,`cs.${JSON.stringify(i)}`),this}containedBy(n,i){return typeof i=="string"?this.url.searchParams.append(n,`cd.${i}`):Array.isArray(i)?this.url.searchParams.append(n,`cd.{${i.join(",")}}`):this.url.searchParams.append(n,`cd.${JSON.stringify(i)}`),this}rangeGt(n,i){return this.url.searchParams.append(n,`sr.${i}`),this}rangeGte(n,i){return this.url.searchParams.append(n,`nxl.${i}`),this}rangeLt(n,i){return this.url.searchParams.append(n,`sl.${i}`),this}rangeLte(n,i){return this.url.searchParams.append(n,`nxr.${i}`),this}rangeAdjacent(n,i){return this.url.searchParams.append(n,`adj.${i}`),this}overlaps(n,i){return typeof i=="string"?this.url.searchParams.append(n,`ov.${i}`):this.url.searchParams.append(n,`ov.{${i.join(",")}}`),this}textSearch(n,i,{config:o,type:a}={}){let c="";a==="plain"?c="pl":a==="phrase"?c="ph":a==="websearch"&&(c="w");const l=o===void 0?"":`(${o})`;return this.url.searchParams.append(n,`${c}fts${l}.${i}`),this}match(n){return Object.entries(n).forEach(([i,o])=>{this.url.searchParams.append(i,`eq.${o}`)}),this}not(n,i,o){return this.url.searchParams.append(n,`not.${i}.${o}`),this}or(n,{foreignTable:i,referencedTable:o=i}={}){const a=o?`${o}.or`:"or";return this.url.searchParams.append(a,`(${n})`),this}filter(n,i,o){return this.url.searchParams.append(n,`${i}.${o}`),this}}return at.default=t,at}var zn;function Ai(){if(zn)return ot;zn=1;var s=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});const e=s(bn());class t{constructor(n,{headers:i={},schema:o,fetch:a}){this.url=n,this.headers=i,this.schema=o,this.fetch=a}select(n,{head:i=!1,count:o}={}){const a=i?"HEAD":"GET";let c=!1;const l=(n??"*").split("").map(d=>/\s/.test(d)&&!c?"":(d==='"'&&(c=!c),d)).join("");return this.url.searchParams.set("select",l),o&&(this.headers.Prefer=`count=${o}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(n,{count:i,defaultToNull:o=!0}={}){const a="POST",c=[];if(this.headers.Prefer&&c.push(this.headers.Prefer),i&&c.push(`count=${i}`),o||c.push("missing=default"),this.headers.Prefer=c.join(","),Array.isArray(n)){const l=n.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(l.length>0){const d=[...new Set(l)].map(h=>`"${h}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:this.fetch,allowEmpty:!1})}upsert(n,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:c=!0}={}){const l="POST",d=[`resolution=${o?"ignore":"merge"}-duplicates`];if(i!==void 0&&this.url.searchParams.set("on_conflict",i),this.headers.Prefer&&d.push(this.headers.Prefer),a&&d.push(`count=${a}`),c||d.push("missing=default"),this.headers.Prefer=d.join(","),Array.isArray(n)){const h=n.reduce((f,y)=>f.concat(Object.keys(y)),[]);if(h.length>0){const f=[...new Set(h)].map(y=>`"${y}"`);this.url.searchParams.set("columns",f.join(","))}}return new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:this.fetch,allowEmpty:!1})}update(n,{count:i}={}){const o="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),this.headers.Prefer=a.join(","),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:this.fetch,allowEmpty:!1})}delete({count:n}={}){const i="DELETE",o=[];return n&&o.push(`count=${n}`),this.headers.Prefer&&o.unshift(this.headers.Prefer),this.headers.Prefer=o.join(","),new e.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}return ot.default=t,ot}var yt={},wt={},Xn;function oo(){return Xn||(Xn=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.version=void 0,wt.version="0.0.0-automated"),wt}var Kn;function ao(){if(Kn)return yt;Kn=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.DEFAULT_HEADERS=void 0;const s=oo();return yt.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${s.version}`},yt}var Yn;function uo(){if(Yn)return it;Yn=1;var s=it&&it.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(it,"__esModule",{value:!0});const e=s(Ai()),t=s(bn()),r=ao();class n{constructor(o,{headers:a={},schema:c,fetch:l}={}){this.url=o,this.headers=Object.assign(Object.assign({},r.DEFAULT_HEADERS),a),this.schemaName=c,this.fetch=l}from(o){const a=new URL(`${this.url}/${o}`);return new e.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new n(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,a={},{head:c=!1,get:l=!1,count:d}={}){let h;const f=new URL(`${this.url}/rpc/${o}`);let y;c||l?(h=c?"HEAD":"GET",Object.entries(a).filter(([A,_])=>_!==void 0).map(([A,_])=>[A,Array.isArray(_)?`{${_.join(",")}}`:`${_}`]).forEach(([A,_])=>{f.searchParams.append(A,_)})):(h="POST",y=a);const E=Object.assign({},this.headers);return d&&(E.Prefer=`count=${d}`),new t.default({method:h,url:f,headers:E,schema:this.schemaName,body:y,fetch:this.fetch,allowEmpty:!1})}}return it.default=n,it}var Vn;function co(){if(Vn)return be;Vn=1;var s=be&&be.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(be,"__esModule",{value:!0}),be.PostgrestError=be.PostgrestBuilder=be.PostgrestTransformBuilder=be.PostgrestFilterBuilder=be.PostgrestQueryBuilder=be.PostgrestClient=void 0;const e=s(uo());be.PostgrestClient=e.default;const t=s(Ai());be.PostgrestQueryBuilder=t.default;const r=s(bn());be.PostgrestFilterBuilder=r.default;const n=s(Si());be.PostgrestTransformBuilder=n.default;const i=s(Ri());be.PostgrestBuilder=i.default;const o=s(Ei());return be.PostgrestError=o.default,be.default={PostgrestClient:e.default,PostgrestQueryBuilder:t.default,PostgrestFilterBuilder:r.default,PostgrestTransformBuilder:n.default,PostgrestBuilder:i.default,PostgrestError:o.default},be}var lo=co();const ho=Zi(lo),{PostgrestClient:fo,PostgrestQueryBuilder:tc,PostgrestFilterBuilder:rc,PostgrestTransformBuilder:nc,PostgrestBuilder:sc,PostgrestError:ic}=ho;class po{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")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(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.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."};if(typeof process<"u"&&process.versions&&process.versions.node){const t=parseInt(process.versions.node.split(".")[0]);return t>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor: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:
2
- import ws from "ws"
3
- new 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(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
4
-
5
- Suggested solution: ${e.workaround}`),new Error(t)}static createWebSocket(e,t){const r=this.getWebSocketConstructor();return new r(e,t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const go="2.15.1",_o=`realtime-js/${go}`,mo="1.0.0",an=1e4,vo=1e3,bo=100;var Tt;(function(s){s[s.connecting=0]="connecting",s[s.open=1]="open",s[s.closing=2]="closing",s[s.closed=3]="closed"})(Tt||(Tt={}));var ve;(function(s){s.closed="closed",s.errored="errored",s.joined="joined",s.joining="joining",s.leaving="leaving"})(ve||(ve={}));var $e;(function(s){s.close="phx_close",s.error="phx_error",s.join="phx_join",s.reply="phx_reply",s.leave="phx_leave",s.access_token="access_token"})($e||($e={}));var un;(function(s){s.websocket="websocket"})(un||(un={}));var et;(function(s){s.Connecting="connecting",s.Open="open",s.Closing="closing",s.Closed="closed"})(et||(et={}));class yo{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}_decodeBroadcast(e,t,r){const n=t.getUint8(1),i=t.getUint8(2);let o=this.HEADER_LENGTH+2;const a=r.decode(e.slice(o,o+n));o=o+n;const c=r.decode(e.slice(o,o+i));o=o+i;const l=JSON.parse(r.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:c,payload:l}}}class Ti{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var ue;(function(s){s.abstime="abstime",s.bool="bool",s.date="date",s.daterange="daterange",s.float4="float4",s.float8="float8",s.int2="int2",s.int4="int4",s.int4range="int4range",s.int8="int8",s.int8range="int8range",s.json="json",s.jsonb="jsonb",s.money="money",s.numeric="numeric",s.oid="oid",s.reltime="reltime",s.text="text",s.time="time",s.timestamp="timestamp",s.timestamptz="timestamptz",s.timetz="timetz",s.tsrange="tsrange",s.tstzrange="tstzrange"})(ue||(ue={}));const Jn=(s,e,t={})=>{var r;const n=(r=t.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(e).reduce((i,o)=>(i[o]=wo(o,s,e,n),i),{})},wo=(s,e,t,r)=>{const n=e.find(a=>a.name===s),i=n==null?void 0:n.type,o=t[s];return i&&!r.includes(i)?Oi(i,o):cn(o)},Oi=(s,e)=>{if(s.charAt(0)==="_"){const t=s.slice(1,s.length);return Ao(e,t)}switch(s){case ue.bool:return Eo(e);case ue.float4:case ue.float8:case ue.int2:case ue.int4:case ue.int8:case ue.numeric:case ue.oid:return Ro(e);case ue.json:case ue.jsonb:return So(e);case ue.timestamp:return To(e);case ue.abstime:case ue.date:case ue.daterange:case ue.int4range:case ue.int8range:case ue.money:case ue.reltime:case ue.text:case ue.time:case ue.timestamptz:case ue.timetz:case ue.tsrange:case ue.tstzrange:return cn(e);default:return cn(e)}},cn=s=>s,Eo=s=>{switch(s){case"t":return!0;case"f":return!1;default:return s}},Ro=s=>{if(typeof s=="string"){const e=parseFloat(s);if(!Number.isNaN(e))return e}return s},So=s=>{if(typeof s=="string")try{return JSON.parse(s)}catch(e){return console.log(`JSON parse error: ${e}`),s}return s},Ao=(s,e)=>{if(typeof s!="string")return s;const t=s.length-1,r=s[t];if(s[0]==="{"&&r==="}"){let i;const o=s.slice(1,t);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>Oi(e,a))}return s},To=s=>typeof s=="string"?s.replace(" ","T"):s,Pi=s=>{let e=s;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"};class rr{constructor(e,t,r={},n=an){this.channel=e,this.event=t,this.payload=r,this.timeout=n,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Qn;(function(s){s.SYNC="sync",s.JOIN="join",s.LEAVE="leave"})(Qn||(Qn={}));class Ot{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},n=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Ot.syncState(this.state,n,i,o),this.pendingDiffs.forEach(c=>{this.state=Ot.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},n=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(n):(this.state=Ot.syncDiff(this.state,n,i,o),a())}),this.onJoin((n,i,o)=>{this.channel._trigger("presence",{event:"join",key:n,currentPresences:i,newPresences:o})}),this.onLeave((n,i,o)=>{this.channel._trigger("presence",{event:"leave",key:n,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,n){const i=this.cloneDeep(e),o=this.transformState(t),a={},c={};return this.map(i,(l,d)=>{o[l]||(c[l]=d)}),this.map(o,(l,d)=>{const h=i[l];if(h){const f=d.map(_=>_.presence_ref),y=h.map(_=>_.presence_ref),E=d.filter(_=>y.indexOf(_.presence_ref)<0),A=h.filter(_=>f.indexOf(_.presence_ref)<0);E.length>0&&(a[l]=E),A.length>0&&(c[l]=A)}else a[l]=d}),this.syncDiff(i,{joins:a,leaves:c},r,n)}static syncDiff(e,t,r,n){const{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),n||(n=()=>{}),this.map(i,(a,c)=>{var l;const d=(l=e[a])!==null&&l!==void 0?l:[];if(e[a]=this.cloneDeep(c),d.length>0){const h=e[a].map(y=>y.presence_ref),f=d.filter(y=>h.indexOf(y.presence_ref)<0);e[a].unshift(...f)}r(a,d,c)}),this.map(o,(a,c)=>{let l=e[a];if(!l)return;const d=c.map(h=>h.presence_ref);l=l.filter(h=>d.indexOf(h.presence_ref)<0),e[a]=l,n(a,l,c),l.length===0&&delete e[a]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{const n=e[r];return"metas"in n?t[r]=n.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):t[r]=n,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Zn;(function(s){s.ALL="*",s.INSERT="INSERT",s.UPDATE="UPDATE",s.DELETE="DELETE"})(Zn||(Zn={}));var Pt;(function(s){s.BROADCAST="broadcast",s.PRESENCE="presence",s.POSTGRES_CHANGES="postgres_changes",s.SYSTEM="system"})(Pt||(Pt={}));var Fe;(function(s){s.SUBSCRIBED="SUBSCRIBED",s.TIMED_OUT="TIMED_OUT",s.CLOSED="CLOSED",s.CHANNEL_ERROR="CHANNEL_ERROR"})(Fe||(Fe={}));class yn{constructor(e,t={config:{}},r){this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=ve.closed,this.joinedOnce=!1,this.pushBuffer=[],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.timeout=this.socket.timeout,this.joinPush=new rr(this,$e.join,this.params,this.timeout),this.rejoinTimer=new Ti(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ve.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=ve.closed,this.socket._remove(this)}),this._onError(n=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,n),this.state=ve.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ve.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",n=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,n),this.state=ve.errored,this.rejoinTimer.scheduleTimeout())}),this._on($e.reply,{},(n,i)=>{this._trigger(this._replyEventName(i),n)}),this.presence=new Ot(this),this.broadcastEndpointURL=Pi(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var r,n;if(this.socket.isConnected()||this.socket.connect(),this.state==ve.closed){const{config:{broadcast:i,presence:o,private:a}}=this.params,c=(n=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(f=>f.filter))!==null&&n!==void 0?n:[],l=!!this.bindings[Pt.PRESENCE]&&this.bindings[Pt.PRESENCE].length>0,d={},h={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:l}),postgres_changes:c,private:a};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(f=>e==null?void 0:e(Fe.CHANNEL_ERROR,f)),this._onClose(()=>e==null?void 0:e(Fe.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:f})=>{var y;if(this.socket.setAuth(),f===void 0){e==null||e(Fe.SUBSCRIBED);return}else{const E=this.bindings.postgres_changes,A=(y=E==null?void 0:E.length)!==null&&y!==void 0?y:0,_=[];for(let p=0;p<A;p++){const v=E[p],{filter:{event:m,schema:R,table:g,filter:O}}=v,S=f&&f[p];if(S&&S.event===m&&S.schema===R&&S.table===g&&S.filter===O)_.push(Object.assign(Object.assign({},v),{id:S.id}));else{this.unsubscribe(),this.state=ve.errored,e==null||e(Fe.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=_,e&&e(Fe.SUBSCRIBED);return}}).receive("error",f=>{this.state=ve.errored,e==null||e(Fe.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Fe.TIMED_OUT)})}return this}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){return this.state===ve.joined&&e===Pt.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,t,r)}async send(e,t={}){var r,n;if(!this._canPush()&&e.type==="broadcast"){const{event:i,payload:o}=e,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((n=l.body)===null||n===void 0?void 0:n.cancel()),l.ok?"ok":"error"}catch(l){return l.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const l=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),l.receive("ok",()=>i("ok")),l.receive("error",()=>i("error")),l.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=ve.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger($e.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(n=>{r=new rr(this,$e.leave,{},e),r.receive("ok",()=>{t(),n("ok")}).receive("timeout",()=>{t(),n("timed out")}).receive("error",()=>{n("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=ve.closed,this.bindings={}}async _fetchWithTimeout(e,t,r){const n=new AbortController,i=setTimeout(()=>n.abort(),r),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(i),o}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let n=new rr(this,e,t,r);return this._canPush()?n.send():this._addToPushBuffer(n),n}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>bo){const t=this.pushBuffer.shift();t&&(t.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${t.event}`,t.payload))}}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var n,i;const o=e.toLocaleLowerCase(),{close:a,error:c,leave:l,join:d}=$e;if(r&&[a,c,l,d].indexOf(o)>=0&&r!==this._joinRef())return;let f=this._onMessage(o,t,r);if(t&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(n=this.bindings.postgres_changes)===null||n===void 0||n.filter(y=>{var E,A,_;return((E=y.filter)===null||E===void 0?void 0:E.event)==="*"||((_=(A=y.filter)===null||A===void 0?void 0:A.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===o}).map(y=>y.callback(f,r)):(i=this.bindings[o])===null||i===void 0||i.filter(y=>{var E,A,_,p,v,m;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in y){const R=y.id,g=(E=y.filter)===null||E===void 0?void 0:E.event;return R&&((A=t.ids)===null||A===void 0?void 0:A.includes(R))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((_=t.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const R=(v=(p=y==null?void 0:y.filter)===null||p===void 0?void 0:p.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return R==="*"||R===((m=t==null?void 0:t.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return y.type.toLocaleLowerCase()===o}).map(y=>{if(typeof f=="object"&&"ids"in f){const E=f.data,{schema:A,table:_,commit_timestamp:p,type:v,errors:m}=E;f=Object.assign(Object.assign({},{schema:A,table:_,commit_timestamp:p,eventType:v,new:{},old:{},errors:m}),this._getPayloadRecords(E))}y.callback(f,r)})}_isClosed(){return this.state===ve.closed}_isJoined(){return this.state===ve.joined}_isJoining(){return this.state===ve.joining}_isLeaving(){return this.state===ve.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){const n=e.toLocaleLowerCase(),i={type:n,filter:t,callback:r};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this}_off(e,t){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(n=>{var i;return!(((i=n.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&yn.isEqual(n.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on($e.close,{},e)}_onError(e){this._on($e.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ve.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=Jn(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=Jn(e.columns,e.old_record)),t}}const es=()=>{},$t={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Oo=[1e3,2e3,5e3,1e4],Po=1e4,ko=`
6
- addEventListener("message", (e) => {
7
- if (e.data.event === "start") {
8
- setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
9
- }
10
- });`;class Co{constructor(e,t){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=an,this.transport=null,this.heartbeatIntervalMs=$t.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=es,this.ref=0,this.reconnectTimer=null,this.logger=es,this.conn=null,this.sendBuffer=[],this.serializer=new yo,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=n=>{let i;return n?i=n:typeof fetch>"u"?i=(...o)=>Promise.resolve().then(()=>bt).then(({default:a})=>a(...o)).catch(a=>{throw new Error(`Failed to load @supabase/node-fetch: ${a.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...o)=>i(...o)},!(!((r=t==null?void 0:t.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=t.params.apikey,this.endPoint=`${e}/${un.websocket}`,this.httpEndpoint=Pi(e),this._initializeOptions(t),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(t==null?void 0:t.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=po.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const t=e.message;throw t.includes("Node.js")?new Error(`${t}
11
-
12
- To use Realtime in Node.js, you need to provide a WebSocket implementation:
13
-
14
- Option 1: Use Node.js 22+ which has native WebSocket support
15
- Option 2: Install and provide the "ws" package:
16
-
17
- npm install ws
18
-
19
- import ws from "ws"
20
- const client = new RealtimeClient(url, {
21
- ...options,
22
- transport: ws
23
- })`):new Error(`WebSocket not available: ${t}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:mo}))}disconnect(e,t){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},e?this.conn.close(e,t??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Tt.connecting:return et.Connecting;case Tt.open:return et.Open;case Tt.closing:return et.Closing;default:return et.Closed}}isConnected(){return this.connectionState()===et.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,t={config:{}}){const r=`realtime:${e}`,n=this.getChannels().find(i=>i.topic===r);if(n)return n;{const i=new yn(`realtime:${e}`,t,this);return this.channels.push(i),i}}push(e){const{topic:t,event:r,payload:n,ref:i}=e,o=()=>{this.encode(e,a=>{var c;(c=this.conn)===null||c===void 0||c.send(a)})};this.log("push",`${t} ${r} (${i})`,n),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(vo,"heartbeat timeout"),setTimeout(()=>{var t;this.isConnected()||(t=this.reconnectTimer)===null||t===void 0||t.scheduleTimeout()},$t.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,t=>{t.topic==="phoenix"&&t.event==="phx_reply"&&this.heartbeatCallback(t.payload.status==="ok"?"ok":"error"),t.ref&&t.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:n,payload:i,ref:o}=t,a=o?`(${o})`:"",c=i.status||"";this.log("receive",`${c} ${r} ${n} ${a}`.trim(),i),this.channels.filter(l=>l._isMember(r)).forEach(l=>l._trigger(n,i,o)),this._triggerStateCallbacks("message",t)})}_clearTimer(e){var t;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((t=this.reconnectTimer)===null||t===void 0||t.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),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))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var t;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(t=this.reconnectTimer)===null||t===void 0||t.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger($e.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const r=e.match(/\?/)?"&":"?",n=new URLSearchParams(t);return`${e}${r}${n}`}_workerObjectUrl(e){let t;if(e)t=e;else{const r=new Blob([ko],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}_setConnectionState(e,t=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=t)}async _performAuth(e=null){let t;e?t=e:this.accessToken?t=await this.accessToken():t=this.accessTokenValue,this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(r=>{const n={access_token:t,version:_o};t&&r.updateJoinPayload(n),r.joinedOnce&&r._isJoined()&&r._push($e.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(t=>{this.log("error",`error setting auth in ${e}`,t)})}_triggerStateCallbacks(e,t){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(t)}catch(n){this.log("error",`error in ${e} callback`,n)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new Ti(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},$t.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var t,r,n,i,o,a,c,l;if(this.transport=(t=e==null?void 0:e.transport)!==null&&t!==void 0?t:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:an,this.heartbeatIntervalMs=(n=e==null?void 0:e.heartbeatIntervalMs)!==null&&n!==void 0?n:$t.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(a=e==null?void 0:e.reconnectAfterMs)!==null&&a!==void 0?a:(d=>Oo[d-1]||Po),this.encode=(c=e==null?void 0:e.encode)!==null&&c!==void 0?c:((d,h)=>h(JSON.stringify(d))),this.decode=(l=e==null?void 0:e.decode)!==null&&l!==void 0?l:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class wn extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function ye(s){return typeof s=="object"&&s!==null&&"__isStorageError"in s}class xo extends wn{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class ln extends wn{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var jo=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};const ki=s=>{let e;return s?e=s:typeof fetch>"u"?e=(...t)=>Promise.resolve().then(()=>bt).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)},Io=()=>jo(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>bt)).Response:Response}),dn=s=>{if(Array.isArray(s))return s.map(t=>dn(t));if(typeof s=="function"||s!==Object(s))return s;const e={};return Object.entries(s).forEach(([t,r])=>{const n=t.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[n]=dn(r)}),e},No=s=>{if(typeof s!="object"||s===null)return!1;const e=Object.getPrototypeOf(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)};var rt=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};const nr=s=>s.msg||s.message||s.error_description||s.error||JSON.stringify(s),Do=(s,e,t)=>rt(void 0,void 0,void 0,function*(){const r=yield Io();s instanceof r&&!(t!=null&&t.noResolveJson)?s.json().then(n=>{const i=s.status||500,o=(n==null?void 0:n.statusCode)||i+"";e(new xo(nr(n),i,o))}).catch(n=>{e(new ln(nr(n),n))}):e(new ln(nr(s),s))}),Lo=(s,e,t,r)=>{const n={method:s,headers:(e==null?void 0:e.headers)||{}};return s==="GET"||!r?n:(No(r)?(n.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),n.body=JSON.stringify(r)):n.body=r,e!=null&&e.duplex&&(n.duplex=e.duplex),Object.assign(Object.assign({},n),t))};function xt(s,e,t,r,n,i){return rt(this,void 0,void 0,function*(){return new Promise((o,a)=>{s(t,Lo(e,r,n,i)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>Do(c,a,r))})})}function zt(s,e,t,r){return rt(this,void 0,void 0,function*(){return xt(s,"GET",e,t,r)})}function We(s,e,t,r,n){return rt(this,void 0,void 0,function*(){return xt(s,"POST",e,r,n,t)})}function hn(s,e,t,r,n){return rt(this,void 0,void 0,function*(){return xt(s,"PUT",e,r,n,t)})}function $o(s,e,t,r){return rt(this,void 0,void 0,function*(){return xt(s,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),r)})}function Ci(s,e,t,r,n){return rt(this,void 0,void 0,function*(){return xt(s,"DELETE",e,r,n,t)})}var Ae=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};const Uo={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ts={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class qo{constructor(e,t={},r,n){this.url=e,this.headers=t,this.bucketId=r,this.fetch=ki(n)}uploadOrUpdate(e,t,r,n){return Ae(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},ts),n);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),n!=null&&n.headers&&(a=Object.assign(Object.assign({},a),n.headers));const l=this._removeEmptyFolders(t),d=this._getFinalPath(l),h=yield(e=="PUT"?hn:We)(this.fetch,`${this.url}/object/${d}`,i,Object.assign({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:l,id:h.Id,fullPath:h.Key},error:null}}catch(i){if(ye(i))return{data:null,error:i};throw i}})}upload(e,t,r){return Ae(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,n){return Ae(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let c;const l=Object.assign({upsert:ts.upsert},n),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",l.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",l.cacheControl)):(c=r,d["cache-control"]=`max-age=${l.cacheControl}`,d["content-type"]=l.contentType);const h=yield hn(this.fetch,a.toString(),c,{headers:d});return{data:{path:i,fullPath:h.Key},error:null}}catch(c){if(ye(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,t){return Ae(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const n=Object.assign({},this.headers);t!=null&&t.upsert&&(n["x-upsert"]="true");const i=yield We(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:n}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new wn("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(r){if(ye(r))return{data:null,error:r};throw r}})}update(e,t,r){return Ae(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t,r){return Ae(this,void 0,void 0,function*(){try{return{data:yield We(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}})}copy(e,t,r){return Ae(this,void 0,void 0,function*(){try{return{data:{path:(yield We(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}})}createSignedUrl(e,t,r){return Ae(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=yield We(this.fetch,`${this.url}/object/sign/${n}`,Object.assign({expiresIn:t},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}})}createSignedUrls(e,t,r){return Ae(this,void 0,void 0,function*(){try{const n=yield We(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:n.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}})}download(e,t){return Ae(this,void 0,void 0,function*(){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),o=i?`?${i}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield zt(this.fetch,`${this.url}/${n}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(ye(a))return{data:null,error:a};throw a}})}info(e){return Ae(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const r=yield zt(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:dn(r),error:null}}catch(r){if(ye(r))return{data:null,error:r};throw r}})}exists(e){return Ae(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield $o(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(ye(r)&&r instanceof ln){const n=r.originalError;if([400,404].includes(n==null?void 0:n.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&n.push(i);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});c!==""&&n.push(c);let l=n.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${l}`)}}}remove(e){return Ae(this,void 0,void 0,function*(){try{return{data:yield Ci(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(ye(t))return{data:null,error:t};throw t}})}list(e,t,r){return Ae(this,void 0,void 0,function*(){try{const n=Object.assign(Object.assign(Object.assign({},Uo),t),{prefix:e||""});return{data:yield We(this.fetch,`${this.url}/object/list/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(ye(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const Mo="2.10.5",Bo={"X-Client-Info":`storage-js/${Mo}`};var lt=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};class Ho{constructor(e,t={},r,n){const i=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href,this.headers=Object.assign(Object.assign({},Bo),t),this.fetch=ki(r)}listBuckets(){return lt(this,void 0,void 0,function*(){try{return{data:yield zt(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(ye(e))return{data:null,error:e};throw e}})}getBucket(e){return lt(this,void 0,void 0,function*(){try{return{data:yield zt(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(ye(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return lt(this,void 0,void 0,function*(){try{return{data:yield We(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(ye(r))return{data:null,error:r};throw r}})}updateBucket(e,t){return lt(this,void 0,void 0,function*(){try{return{data:yield hn(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(ye(r))return{data:null,error:r};throw r}})}emptyBucket(e){return lt(this,void 0,void 0,function*(){try{return{data:yield We(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(ye(t))return{data:null,error:t};throw t}})}deleteBucket(e){return lt(this,void 0,void 0,function*(){try{return{data:yield Ci(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(ye(t))return{data:null,error:t};throw t}})}}class Fo extends Ho{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new qo(this.url,this.headers,e,this.fetch)}}const Wo="2.55.0";let St="";typeof Deno<"u"?St="deno":typeof document<"u"?St="web":typeof navigator<"u"&&navigator.product==="ReactNative"?St="react-native":St="node";const Go={"X-Client-Info":`supabase-js-${St}/${Wo}`},zo={headers:Go},Xo={schema:"public"},Ko={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Yo={};var Vo=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};const Jo=s=>{let e;return s?e=s:typeof fetch>"u"?e=yi:e=fetch,(...t)=>e(...t)},Qo=()=>typeof Headers>"u"?wi:Headers,Zo=(s,e,t)=>{const r=Jo(t),n=Qo();return(i,o)=>Vo(void 0,void 0,void 0,function*(){var a;const c=(a=yield e())!==null&&a!==void 0?a:s;let l=new n(o==null?void 0:o.headers);return l.has("apikey")||l.set("apikey",s),l.has("Authorization")||l.set("Authorization",`Bearer ${c}`),r(i,Object.assign(Object.assign({},o),{headers:l}))})};var ea=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};function ta(s){return s.endsWith("/")?s:s+"/"}function ra(s,e){var t,r;const{db:n,auth:i,realtime:o,global:a}=s,{db:c,auth:l,realtime:d,global:h}=e,f={db:Object.assign(Object.assign({},c),n),auth:Object.assign(Object.assign({},l),i),realtime:Object.assign(Object.assign({},d),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),a),{headers:Object.assign(Object.assign({},(t=h==null?void 0:h.headers)!==null&&t!==void 0?t:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>ea(this,void 0,void 0,function*(){return""})};return s.accessToken?f.accessToken=s.accessToken:delete f.accessToken,f}const xi="2.71.1",gt=30*1e3,fn=3,sr=fn*gt,na="http://localhost:9999",sa="supabase.auth.token",ia={"X-Client-Info":`gotrue-js/${xi}`},pn="X-Supabase-Api-Version",ji={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},oa=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,aa=600*1e3;class En extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}}function z(s){return typeof s=="object"&&s!==null&&"__isAuthError"in s}class ua extends En{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function ca(s){return z(s)&&s.name==="AuthApiError"}class Ii extends En{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class Ye extends En{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class Xe extends Ye{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function la(s){return z(s)&&s.name==="AuthSessionMissingError"}class Ut extends Ye{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class qt extends Ye{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Mt extends Ye{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function da(s){return z(s)&&s.name==="AuthImplicitGrantRedirectError"}class rs extends Ye{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class gn extends Ye{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function ir(s){return z(s)&&s.name==="AuthRetryableFetchError"}class ns extends Ye{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}}class _n extends Ye{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Xt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ss=`
24
- \r=`.split(""),ha=(()=>{const s=new Array(128);for(let e=0;e<s.length;e+=1)s[e]=-1;for(let e=0;e<ss.length;e+=1)s[ss[e].charCodeAt(0)]=-2;for(let e=0;e<Xt.length;e+=1)s[Xt[e].charCodeAt(0)]=e;return s})();function is(s,e,t){if(s!==null)for(e.queue=e.queue<<8|s,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(Xt[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(Xt[r]),e.queuedBits-=6}}function Ni(s,e,t){const r=ha[s];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(s)}"`)}}function os(s){const e=[],t=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},n={queue:0,queuedBits:0},i=o=>{ga(o,r,t)};for(let o=0;o<s.length;o+=1)Ni(s.charCodeAt(o),n,i);return e.join("")}function fa(s,e){if(s<=127){e(s);return}else if(s<=2047){e(192|s>>6),e(128|s&63);return}else if(s<=65535){e(224|s>>12),e(128|s>>6&63),e(128|s&63);return}else if(s<=1114111){e(240|s>>18),e(128|s>>12&63),e(128|s>>6&63),e(128|s&63);return}throw new Error(`Unrecognized Unicode codepoint: ${s.toString(16)}`)}function pa(s,e){for(let t=0;t<s.length;t+=1){let r=s.charCodeAt(t);if(r>55295&&r<=56319){const n=(r-55296)*1024&65535;r=(s.charCodeAt(t+1)-56320&65535|n)+65536,t+=1}fa(r,e)}}function ga(s,e,t){if(e.utf8seq===0){if(s<=127){t(s);return}for(let r=1;r<6;r+=1)if((s>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=s&31;else if(e.utf8seq===3)e.codepoint=s&15;else if(e.utf8seq===4)e.codepoint=s&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(s<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|s&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function _a(s){const e=[],t={queue:0,queuedBits:0},r=n=>{e.push(n)};for(let n=0;n<s.length;n+=1)Ni(s.charCodeAt(n),t,r);return new Uint8Array(e)}function ma(s){const e=[];return pa(s,t=>e.push(t)),new Uint8Array(e)}function va(s){const e=[],t={queue:0,queuedBits:0},r=n=>{e.push(n)};return s.forEach(n=>is(n,t,r)),is(null,t,r),e.join("")}function ba(s){return Math.round(Date.now()/1e3)+s}function ya(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(s){const e=Math.random()*16|0;return(s=="x"?e:e&3|8).toString(16)})}const Le=()=>typeof window<"u"&&typeof document<"u",Je={tested:!1,writable:!1},Di=()=>{if(!Le())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Je.tested)return Je.writable;const s=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(s,s),globalThis.localStorage.removeItem(s),Je.tested=!0,Je.writable=!0}catch{Je.tested=!0,Je.writable=!1}return Je.writable};function wa(s){const e={},t=new URL(s);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((n,i)=>{e[i]=n})}catch{}return t.searchParams.forEach((r,n)=>{e[n]=r}),e}const Li=s=>{let e;return s?e=s:typeof fetch>"u"?e=(...t)=>Promise.resolve().then(()=>bt).then(({default:r})=>r(...t)):e=fetch,(...t)=>e(...t)},Ea=s=>typeof s=="object"&&s!==null&&"status"in s&&"ok"in s&&"json"in s&&typeof s.json=="function",_t=async(s,e,t)=>{await s.setItem(e,JSON.stringify(t))},Qe=async(s,e)=>{const t=await s.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},ze=async(s,e)=>{await s.removeItem(e)};class Vt{constructor(){this.promise=new Vt.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Vt.promiseConstructor=Promise;function or(s){const e=s.split(".");if(e.length!==3)throw new _n("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!oa.test(e[r]))throw new _n("JWT not in base64url format");return{header:JSON.parse(os(e[0])),payload:JSON.parse(os(e[1])),signature:_a(e[2]),raw:{header:e[0],payload:e[1]}}}async function Ra(s){return await new Promise(e=>{setTimeout(()=>e(null),s)})}function Sa(s,e){return new Promise((r,n)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await s(i);if(!e(i,null,o)){r(o);return}}catch(o){if(!e(i,o)){n(o);return}}})()})}function Aa(s){return("0"+s.toString(16)).substr(-2)}function Ta(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=t.length;let n="";for(let i=0;i<56;i++)n+=t.charAt(Math.floor(Math.random()*r));return n}return crypto.getRandomValues(e),Array.from(e,Aa).join("")}async function Oa(s){const t=new TextEncoder().encode(s),r=await crypto.subtle.digest("SHA-256",t),n=new Uint8Array(r);return Array.from(n).map(i=>String.fromCharCode(i)).join("")}async function Pa(s){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),s;const t=await Oa(s);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function dt(s,e,t=!1){const r=Ta();let n=r;t&&(n+="/PASSWORD_RECOVERY"),await _t(s,`${e}-code-verifier`,n);const i=await Pa(r);return[i,r===i?"plain":"s256"]}const ka=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Ca(s){const e=s.headers.get(pn);if(!e||!e.match(ka))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function xa(s){if(!s)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(s<=e)throw new Error("JWT has expired")}function ja(s){switch(s){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 new Error("Invalid alg claim")}}const Ia=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ht(s){if(!Ia.test(s))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function ar(){const s={};return new Proxy(s,{get:(e,t)=>{if(t==="__isUserNotAvailableProxy")return!0;if(typeof t=="symbol"){const r=t.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new 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 new 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 new 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 as(s){return JSON.parse(JSON.stringify(s))}var Na=function(s,e){var t={};for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(s);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(s,r[n])&&(t[r[n]]=s[r[n]]);return t};const Ze=s=>s.msg||s.message||s.error_description||s.error||JSON.stringify(s),Da=[502,503,504];async function us(s){var e;if(!Ea(s))throw new gn(Ze(s),0);if(Da.includes(s.status))throw new gn(Ze(s),s.status);let t;try{t=await s.json()}catch(i){throw new Ii(Ze(i),i)}let r;const n=Ca(s);if(n&&n.getTime()>=ji["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?r=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(r=t.error_code),r){if(r==="weak_password")throw new ns(Ze(t),s.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Xe}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new ns(Ze(t),s.status,t.weak_password.reasons);throw new ua(Ze(t),s.status||500,r)}const La=(s,e,t,r)=>{const n={method:s,headers:(e==null?void 0:e.headers)||{}};return s==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),n.body=JSON.stringify(r),Object.assign(Object.assign({},n),t))};async function J(s,e,t,r){var n;const i=Object.assign({},r==null?void 0:r.headers);i[pn]||(i[pn]=ji["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(n=r==null?void 0:r.query)!==null&&n!==void 0?n:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await $a(s,e,t+a,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function $a(s,e,t,r,n,i){const o=La(e,r,n,i);let a;try{a=await s(t,Object.assign({},o))}catch(c){throw console.error(c),new gn(Ze(c),0)}if(a.ok||await us(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(c){await us(c)}}function He(s){var e;let t=null;Ba(s)&&(t=Object.assign({},s),s.expires_at||(t.expires_at=ba(s.expires_in)));const r=(e=s.user)!==null&&e!==void 0?e:s;return{data:{session:t,user:r},error:null}}function cs(s){const e=He(s);return!e.error&&s.weak_password&&typeof s.weak_password=="object"&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.message&&typeof s.weak_password.message=="string"&&s.weak_password.reasons.reduce((t,r)=>t&&typeof r=="string",!0)&&(e.data.weak_password=s.weak_password),e}function Ke(s){var e;return{data:{user:(e=s.user)!==null&&e!==void 0?e:s},error:null}}function Ua(s){return{data:s,error:null}}function qa(s){const{action_link:e,email_otp:t,hashed_token:r,redirect_to:n,verification_type:i}=s,o=Na(s,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:r,redirect_to:n,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function Ma(s){return s}function Ba(s){return s.access_token&&s.refresh_token&&s.expires_in}const ur=["global","local","others"];var Ha=function(s,e){var t={};for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(s);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(s,r[n])&&(t[r[n]]=s[r[n]]);return t};class Fa{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=Li(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t=ur[0]){if(ur.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ur.join(", ")}`);try{return await J(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(z(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,t={}){try{return await J(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:Ke})}catch(r){if(z(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:t}=e,r=Ha(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=r==null?void 0:r.newEmail,delete n.newEmail),await J(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:qa,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(z(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await J(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ke})}catch(t){if(z(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,r,n,i,o,a,c;try{const l={nextPage:null,lastPage:0,total:0},d=await J(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(i=(n=e==null?void 0:e.perPage)===null||n===void 0?void 0:n.toString())!==null&&i!==void 0?i:""},xform:Ma});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,y=(c=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&c!==void 0?c:[];return y.length>0&&(y.forEach(E=>{const A=parseInt(E.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(E.split(";")[1].split("=")[1]);l[`${_}Page`]=A}),l.total=parseInt(f)),{data:Object.assign(Object.assign({},h),l),error:null}}catch(l){if(z(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){ht(e);try{return await J(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ke})}catch(t){if(z(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){ht(e);try{return await J(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:Ke})}catch(r){if(z(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,t=!1){ht(e);try{return await J(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:Ke})}catch(r){if(z(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){ht(e.userId);try{const{data:t,error:r}=await J(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:n=>({data:{factors:n},error:null})});return{data:t,error:r}}catch(t){if(z(t))return{data:null,error:t};throw t}}async _deleteFactor(e){ht(e.userId),ht(e.id);try{return{data:await J(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(z(t))return{data:null,error:t};throw t}}}function ls(s={}){return{getItem:e=>s[e]||null,setItem:(e,t)=>{s[e]=t},removeItem:e=>{delete s[e]}}}function Wa(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const ft={debug:!!(globalThis&&Di()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class $i extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Ga extends $i{}async function za(s,e,t){ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",s,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),ft.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",s)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(s,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async n=>{if(n){ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",s,n.name);try{return await t()}finally{ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",s,n.name)}}else{if(e===0)throw ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",s),new Ga(`Acquiring an exclusive Navigator LockManager lock "${s}" immediately failed`);if(ft.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await t()}}))}Wa();const Xa={url:na,storageKey:sa,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ia,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function ds(s,e,t){return await t()}const pt={};class Ct{constructor(e){var t,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=Ct.nextInstanceID,Ct.nextInstanceID+=1,this.instanceID>0&&Le()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const n=Object.assign(Object.assign({},Xa),e);if(this.logDebugMessages=!!n.debug,typeof n.debug=="function"&&(this.logger=n.debug),this.persistSession=n.persistSession,this.storageKey=n.storageKey,this.autoRefreshToken=n.autoRefreshToken,this.admin=new Fa({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=Li(n.fetch),this.lock=n.lock||ds,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,n.lock?this.lock=n.lock:Le()&&(!((t=globalThis==null?void 0:globalThis.navigator)===null||t===void 0)&&t.locks)?this.lock=za:this.lock=ds,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)},this.persistSession?(n.storage?this.storage=n.storage:Di()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ls(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=ls(this.memoryStorage)),Le()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}get jwks(){var e,t;return(t=(e=pt[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&t!==void 0?t:{keys:[]}}set jwks(e){pt[this.storageKey]=Object.assign(Object.assign({},pt[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return(t=(e=pt[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&t!==void 0?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){pt[this.storageKey]=Object.assign(Object.assign({},pt[this.storageKey]),{cachedAt:e})}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${xi}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const t=wa(window.location.href);let r="none";if(this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce"),Le()&&this.detectSessionInUrl&&r!=="none"){const{data:n,error:i}=await this._getSessionFromURL(t,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),da(i)){const c=(e=i.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=n;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return z(t)?{error:t}:{error:new Ii("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{const i=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}},xform:He}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(i){if(z(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var t,r,n;try{let i;if("email"in e){const{email:d,password:h,options:f}=e;let y=null,E=null;this.flowType==="pkce"&&([y,E]=await dt(this.storage,this.storageKey)),i=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(t=f==null?void 0:f.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:y,code_challenge_method:E},xform:He})}else if("phone"in e){const{phone:d,password:h,options:f}=e;i=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(n=f==null?void 0:f.channel)!==null&&n!==void 0?n:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:He})}else throw new qt("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(i){if(z(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let t;if("email"in e){const{email:i,password:o,options:a}=e;t=await J(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:cs})}else if("phone"in e){const{phone:i,password:o,options:a}=e;t=await J(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:cs})}else throw new qt("You must provide either an email or phone number and a password");const{data:r,error:n}=t;return n?{data:{user:null,session:null},error:n}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Ut}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(t){if(z(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,r,n,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(n=e.options)===null||n===void 0?void 0:n.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:t}=e;if(t==="solana")return await this.signInWithSolana(e);throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}async signInWithSolana(e){var t,r,n,i,o,a,c,l,d,h,f,y;let E,A;if("message"in e)E=e.message,A=e.signature;else{const{chain:_,wallet:p,statement:v,options:m}=e;let R;if(Le())if(typeof p=="object")R=p;else{const O=window;if("solana"in O&&typeof O.solana=="object"&&("signIn"in O.solana&&typeof O.solana.signIn=="function"||"signMessage"in O.solana&&typeof O.solana.signMessage=="function"))R=O.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof p!="object"||!(m!=null&&m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");R=p}const g=new URL((t=m==null?void 0:m.url)!==null&&t!==void 0?t:window.location.href);if("signIn"in R&&R.signIn){const O=await R.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},m==null?void 0:m.signInWithSolana),{version:"1",domain:g.host,uri:g.href}),v?{statement:v}:null));let S;if(Array.isArray(O)&&O[0]&&typeof O[0]=="object")S=O[0];else if(O&&typeof O=="object"&&"signedMessage"in O&&"signature"in O)S=O;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in S&&"signature"in S&&(typeof S.signedMessage=="string"||S.signedMessage instanceof Uint8Array)&&S.signature instanceof Uint8Array)E=typeof S.signedMessage=="string"?S.signedMessage:new TextDecoder().decode(S.signedMessage),A=S.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in R)||typeof R.signMessage!="function"||!("publicKey"in R)||typeof R!="object"||!R.publicKey||!("toBase58"in R.publicKey)||typeof R.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");E=[`${g.host} wants you to sign in with your Solana account:`,R.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${g.href}`,`Issued At: ${(n=(r=m==null?void 0:m.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&n!==void 0?n:new Date().toISOString()}`,...!((i=m==null?void 0:m.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...!((o=m==null?void 0:m.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...!((a=m==null?void 0:m.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...!((c=m==null?void 0:m.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...!((l=m==null?void 0:m.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...!((h=(d=m==null?void 0:m.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...m.signInWithSolana.resources.map(S=>`- ${S}`)]:[]].join(`
25
- `);const O=await R.signMessage(new TextEncoder().encode(E),"utf8");if(!O||!(O instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");A=O}}try{const{data:_,error:p}=await J(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:E,signature:va(A)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:He});if(p)throw p;return!_||!_.session||!_.user?{data:{user:null,session:null},error:new Ut}:(_.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),{data:Object.assign({},_),error:p})}catch(_){if(z(_))return{data:{user:null,session:null},error:_};throw _}}async _exchangeCodeForSession(e){const t=await Qe(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(t??"").split("/");try{const{data:i,error:o}=await J(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:He});if(await ze(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new Ut}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:n??null}),error:o})}catch(i){if(z(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:t,provider:r,token:n,access_token:i,nonce:o}=e,a=await J(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:He}),{data:c,error:l}=a;return l?{data:{user:null,session:null},error:l}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new Ut}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:l})}catch(t){if(z(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,r,n,i,o;try{if("email"in e){const{email:a,options:c}=e;let l=null,d=null;this.flowType==="pkce"&&([l,d]=await dt(this.storage,this.storageKey));const{error:h}=await J(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=c==null?void 0:c.data)!==null&&t!==void 0?t:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:l,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:h}}if("phone"in e){const{phone:a,options:c}=e,{data:l,error:d}=await J(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:d}}throw new qt("You must provide either an email or phone number.")}catch(a){if(z(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,r;try{let n,i;"options"in e&&(n=(t=e.options)===null||t===void 0?void 0:t.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await J(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:n,xform:He});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,l=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:l,session:c},error:null}}catch(n){if(z(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithSSO(e){var t,r,n;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await dt(this.storage,this.storageKey)),await J(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:(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&r!==void 0?r:void 0}),!((n=e==null?void 0:e.options)===null||n===void 0)&&n.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:Ua})}catch(i){if(z(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new Xe;const{error:n}=await J(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:n}})}catch(e){if(z(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:r,type:n,options:i}=e,{error:o}=await J(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:r,type:n,options:i}=e,{data:o,error:a}=await J(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new qt("You must provide either an email or phone number and a type")}catch(t){if(z(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await r,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=t();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const n=[...this.pendingInLock];await Promise.all(n),this.pendingInLock.splice(0,n.length)}return await r}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{const 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!",new Error().stack);try{let e=null;const t=await Qe(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<sr:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const o=await Qe(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=ar()}if(this.storage.isServer&&e.user){let o=this.suppressGetSessionWarning;e=new Proxy(e,{get:(c,l,d)=>(!o&&l==="user"&&(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."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,l,d))})}return{data:{session:e},error:null}}const{session:n,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:n},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await J(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Ke}):await this._useSession(async t=>{var r,n,i;const{data:o,error:a}=t;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Xe}:await J(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0,xform:Ke})})}catch(t){if(z(t))return la(t)&&(await this._removeSession(),await ze(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{const{data:n,error:i}=r;if(i)throw i;if(!n.session)throw new Xe;const o=n.session;let a=null,c=null;this.flowType==="pkce"&&e.email!=null&&([a,c]=await dt(this.storage,this.storageKey));const{data:l,error:d}=await J(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:Ke});if(d)throw d;return o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(z(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Xe;const t=Date.now()/1e3;let r=t,n=!0,i=null;const{payload:o}=or(e.access_token);if(o.exp&&(r=o.exp,n=r<=t),n){const{session:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(e.access_token);if(c)throw c;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(t){if(z(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){const{data:o,error:a}=t;if(a)throw a;e=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new Xe;const{session:n,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:n?{data:{user:n.user,session:n},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(z(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e,t){try{if(!Le())throw new Mt("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Mt(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new rs("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Mt("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new rs("No code detected.");const{data:v,error:m}=await this._exchangeCodeForSession(e.code);if(m)throw m;const R=new URL(window.location.href);return R.searchParams.delete("code"),window.history.replaceState(window.history.state,"",R.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:n,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:l}=e;if(!i||!a||!o||!l)throw new Mt("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(a);let f=d+h;c&&(f=parseInt(c));const y=f-d;y*1e3<=gt&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${y}s, should have been closer to ${h}s`);const E=f-h;d-E>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",E,f,d):d-E<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",E,f,d);const{data:A,error:_}=await this._getUser(i);if(_)throw _;const p={provider_token:r,provider_refresh_token:n,access_token:i,expires_in:h,expires_at:f,refresh_token:o,token_type:l,user:A.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:p,redirectType:e.type},error:null}}catch(r){if(z(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await Qe(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;const{data:n,error:i}=t;if(i)return{error:i};const o=(r=n.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(ca(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await ze(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const t=ya(),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(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{const{data:{session:i},error:o}=t;if(o)throw o;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;this.flowType==="pkce"&&([r,n]=await dt(this.storage,this.storageKey,!0));try{return await J(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(i){if(z(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:t,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(z(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{const{data:r,error:n}=await this._useSession(async i=>{var o,a,c,l,d;const{data:h,error:f}=i;if(f)throw f;const y=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await J(this.fetch,"GET",y,{headers:this.headers,jwt:(d=(l=h.session)===null||l===void 0?void 0:l.access_token)!==null&&d!==void 0?d:void 0})});if(n)throw n;return Le()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:e.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(z(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;const{data:i,error:o}=t;if(o)throw o;return await J(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(n=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&n!==void 0?n:void 0})})}catch(t){if(z(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const r=Date.now();return await Sa(async n=>(n>0&&await Ra(200*Math.pow(2,n-1)),this._debug(t,"refreshing attempt",n),await J(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:He})),(n,i)=>{const o=200*Math.pow(2,n);return i&&ir(i)&&Date.now()+o-r<gt})}catch(r){if(this._debug(t,"error",r),z(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const 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),Le()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const n=await Qe(this.storage,this.storageKey);if(n&&this.userStorage){let o=await Qe(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:n.user},await _t(this.userStorage,this.storageKey+"-user",o)),n.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:ar()}else if(n&&!n.user&&!n.user){const o=await Qe(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(n.user=o.user,await ze(this.storage,this.storageKey+"-user"),await _t(this.storage,this.storageKey,n)):n.user=ar()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}const i=((t=n.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<sr;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${sr}s`),i){if(this.autoRefreshToken&&n.refresh_token){const{error:o}=await this._callRefreshToken(n.refresh_token);o&&(console.error(o),ir(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(n.user&&n.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(n.access_token);!a&&(o!=null&&o.user)?(n.user=o.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new Xe;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new Vt;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Xe;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={session:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(n,"error",i),z(i)){const o={session:null,error:i};return ir(i)||await this._removeSession(),(t=this.refreshingDeferred)===null||t===void 0||t.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){const n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,t)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const t=Object.assign({},e),r=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&t.user&&await _t(this.userStorage,this.storageKey+"-user",{user:t.user});const n=Object.assign({},t);delete n.user;const i=as(n);await _t(this.storage,this.storageKey,i)}else{const n=as(t);await _t(this.storage,this.storageKey,n)}}async _removeSession(){this._debug("#_removeSession()"),await ze(this.storage,this.storageKey),await ze(this.storage,this.storageKey+"-code-verifier"),await ze(this.storage,this.storageKey+"-user"),this.userStorage&&await ze(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Le()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),gt);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}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{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((r.expires_at*1e3-e)/gt);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${gt}ms, refresh threshold is ${fn} ticks`),n<=fn&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof $i)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Le()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){const n=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await dt(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});n.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);n.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;const{data:n,error:i}=t;return i?{data:null,error:i}:await J(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(z(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;const{data:i,error:o}=t;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:c,error:l}=await J(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return l?{data:null,error:l}:(e.factorType==="totp"&&(!((n=c==null?void 0:c.totp)===null||n===void 0)&&n.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(t){if(z(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;const{data:n,error:i}=t;if(i)return{data:null,error:i};const{data:o,error:a}=await J(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(z(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var r;const{data:n,error:i}=t;return i?{data:null,error:i}:await J(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(z(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){const{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const r=(e==null?void 0:e.factors)||[],n=r.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=r.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:r,totp:n,phone:i},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,r;const{data:{session:n},error:i}=e;if(i)return{data:null,error:i};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=or(n.access_token);let a=null;o.aal&&(a=o.aal);let c=a;((r=(t=n.user.factors)===null||t===void 0?void 0:t.filter(h=>h.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(c="aal2");const d=o.amr||[];return{data:{currentLevel:a,nextLevel:c,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(a=>a.kid===e);if(r)return r;const n=Date.now();if(r=this.jwks.keys.find(a=>a.kid===e),r&&this.jwks_cached_at+aa>n)return r;const{data:i,error:o}=await J(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=n,r=i.keys.find(a=>a.kid===e),!r)?null:r}async getClaims(e,t={}){try{let r=e;if(!r){const{data:y,error:E}=await this.getSession();if(E||!y.session)return{data:null,error:E};r=y.session.access_token}const{header:n,payload:i,signature:o,raw:{header:a,payload:c}}=or(r);t!=null&&t.allowExpired||xa(i.exp);const l=!n.alg||n.alg.startsWith("HS")||!n.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(n.kid,t!=null&&t.keys?{keys:t.keys}:t==null?void 0:t.jwks);if(!l){const{error:y}=await this.getUser(r);if(y)throw y;return{data:{claims:i,header:n,signature:o},error:null}}const d=ja(n.alg),h=await crypto.subtle.importKey("jwk",l,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,ma(`${a}.${c}`)))throw new _n("Invalid JWT signature");return{data:{claims:i,header:n,signature:o},error:null}}catch(r){if(z(r))return{data:null,error:r};throw r}}}Ct.nextInstanceID=0;const Ka=Ct;class Ya extends Ka{constructor(e){super(e)}}var Va=function(s,e,t,r){function n(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?i(d.value):n(d.value).then(a,c)}l((r=r.apply(s,e||[])).next())})};class Ja{constructor(e,t,r){var n,i,o;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const a=ta(e),c=new URL(a);this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const l=`sb-${c.hostname.split(".")[0]}-auth-token`,d={db:Xo,realtime:Yo,auth:Object.assign(Object.assign({},Ko),{storageKey:l}),global:zo},h=ra(r??{},d);this.storageKey=(n=h.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=h.global.headers)!==null&&i!==void 0?i:{},h.accessToken?(this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(f,y)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(y)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=h.auth)!==null&&o!==void 0?o:{},this.headers,h.global.fetch),this.fetch=Zo(t,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},h.realtime)),this.rest=new fo(new URL("rest/v1",c).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch}),this.storage=new Fo(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new Qi(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={}){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()}_getAccessToken(){var e,t;return Va(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(t=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,storageKey:i,flowType:o,lock:a,debug:c},l,d){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Ya({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),l),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,flowType:o,lock:a,debug:c,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new Co(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,r)=>{this._handleTokenChanged(t,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Rn=(s,e,t)=>new Ja(s,e,t);function Qa(){if(typeof window<"u"||typeof process>"u")return!1;const s=process.version;if(s==null)return!1;const e=s.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}Qa()&&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");const Ui="0.6.1";var Et={},hs;function Za(){if(hs)return Et;hs=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.parse=o,Et.serialize=l;const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,t=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,n=Object.prototype.toString,i=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function o(f,y){const E=new i,A=f.length;if(A<2)return E;const _=(y==null?void 0:y.decode)||d;let p=0;do{const v=f.indexOf("=",p);if(v===-1)break;const m=f.indexOf(";",p),R=m===-1?A:m;if(v>R){p=f.lastIndexOf(";",v-1)+1;continue}const g=a(f,p,v),O=c(f,v,g),S=f.slice(g,O);if(E[S]===void 0){let C=a(f,v+1,R),N=c(f,R,C);const V=_(f.slice(C,N));E[S]=V}p=R+1}while(p<A);return E}function a(f,y,E){do{const A=f.charCodeAt(y);if(A!==32&&A!==9)return y}while(++y<E);return E}function c(f,y,E){for(;y>E;){const A=f.charCodeAt(--y);if(A!==32&&A!==9)return y+1}return E}function l(f,y,E){const A=(E==null?void 0:E.encode)||encodeURIComponent;if(!s.test(f))throw new TypeError(`argument name is invalid: ${f}`);const _=A(y);if(!e.test(_))throw new TypeError(`argument val is invalid: ${y}`);let p=f+"="+_;if(!E)return p;if(E.maxAge!==void 0){if(!Number.isInteger(E.maxAge))throw new TypeError(`option maxAge is invalid: ${E.maxAge}`);p+="; Max-Age="+E.maxAge}if(E.domain){if(!t.test(E.domain))throw new TypeError(`option domain is invalid: ${E.domain}`);p+="; Domain="+E.domain}if(E.path){if(!r.test(E.path))throw new TypeError(`option path is invalid: ${E.path}`);p+="; Path="+E.path}if(E.expires){if(!h(E.expires)||!Number.isFinite(E.expires.valueOf()))throw new TypeError(`option expires is invalid: ${E.expires}`);p+="; Expires="+E.expires.toUTCString()}if(E.httpOnly&&(p+="; HttpOnly"),E.secure&&(p+="; Secure"),E.partitioned&&(p+="; Partitioned"),E.priority)switch(typeof E.priority=="string"?E.priority.toLowerCase():void 0){case"low":p+="; Priority=Low";break;case"medium":p+="; Priority=Medium";break;case"high":p+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${E.priority}`)}if(E.sameSite)switch(typeof E.sameSite=="string"?E.sameSite.toLowerCase():E.sameSite){case!0:case"strict":p+="; SameSite=Strict";break;case"lax":p+="; SameSite=Lax";break;case"none":p+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${E.sameSite}`)}return p}function d(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function h(f){return n.call(f)==="[object Date]"}return Et}var fs=Za();function kt(){return typeof window<"u"&&typeof window.document<"u"}const tt={path:"/",sameSite:"lax",httpOnly:!1,maxAge:400*24*60*60},eu=3180,tu=/^(.*)[.](0|[1-9][0-9]*)$/;function Kt(s,e){if(s===e)return!0;const t=s.match(tu);return!!(t&&t[1]===e)}function qi(s,e,t){const r=eu;let n=encodeURIComponent(e);if(n.length<=r)return[{name:s,value:e}];const i=[];for(;n.length>0;){let o=n.slice(0,r);const a=o.lastIndexOf("%");a>r-3&&(o=o.slice(0,a));let c="";for(;o.length>0;)try{c=decodeURIComponent(o);break}catch(l){if(l instanceof URIError&&o.at(-3)==="%"&&o.length>3)o=o.slice(0,o.length-3);else throw l}i.push(c),n=n.slice(o.length)}return i.map((o,a)=>({name:`${s}.${a}`,value:o}))}async function ps(s,e){const t=await e(s);if(t)return t;let r=[];for(let n=0;;n++){const i=`${s}.${n}`,o=await e(i);if(!o)break;r.push(o)}return r.length>0?r.join(""):null}const Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),gs=`
26
- \r=`.split(""),ru=(()=>{const s=new Array(128);for(let e=0;e<s.length;e+=1)s[e]=-1;for(let e=0;e<gs.length;e+=1)s[gs[e].charCodeAt(0)]=-2;for(let e=0;e<Yt.length;e+=1)s[Yt[e].charCodeAt(0)]=e;return s})();function Mi(s){const e=[];let t=0,r=0;if(su(s,i=>{for(t=t<<8|i,r+=8;r>=6;){const o=t>>r-6&63;e.push(Yt[o]),r-=6}}),r>0)for(t=t<<6-r,r=6;r>=6;){const i=t>>r-6&63;e.push(Yt[i]),r-=6}return e.join("")}function _s(s){const e=[],t=o=>{e.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0};let n=0,i=0;for(let o=0;o<s.length;o+=1){const a=s.charCodeAt(o),c=ru[a];if(c>-1)for(n=n<<6|c,i+=6;i>=8;)iu(n>>i-8&255,r,t),i-=8;else{if(c===-2)continue;throw new Error(`Invalid Base64-URL character "${s.at(o)}" at position ${o}`)}}return e.join("")}function nu(s,e){if(s<=127){e(s);return}else if(s<=2047){e(192|s>>6),e(128|s&63);return}else if(s<=65535){e(224|s>>12),e(128|s>>6&63),e(128|s&63);return}else if(s<=1114111){e(240|s>>18),e(128|s>>12&63),e(128|s>>6&63),e(128|s&63);return}throw new Error(`Unrecognized Unicode codepoint: ${s.toString(16)}`)}function su(s,e){for(let t=0;t<s.length;t+=1){let r=s.charCodeAt(t);if(r>55295&&r<=56319){const n=(r-55296)*1024&65535;r=(s.charCodeAt(t+1)-56320&65535|n)+65536,t+=1}nu(r,e)}}function iu(s,e,t){if(e.utf8seq===0){if(s<=127){t(s);return}for(let r=1;r<6;r+=1)if((s>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=s&31;else if(e.utf8seq===3)e.codepoint=s&15;else if(e.utf8seq===4)e.codepoint=s&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(s<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|s&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}const mt="base64-";function Bi(s,e){const t=s.cookies??null,r=s.cookieEncoding,n={},i={};let o,a;if(t)if("get"in t){const c=async l=>{const d=l.flatMap(f=>[f,...Array.from({length:5}).map((y,E)=>`${f}.${E}`)]),h=[];for(let f=0;f<d.length;f+=1){const y=await t.get(d[f]);!y&&typeof y!="string"||h.push({name:d[f],value:y})}return h};if(o=async l=>await c(l),"set"in t&&"remove"in t)a=async l=>{for(let d=0;d<l.length;d+=1){const{name:h,value:f,options:y}=l[d];f?await t.set(h,f,y):await t.remove(h,y)}};else if(e)a=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 new 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 t)if(o=async()=>await t.getAll(),"setAll"in t)a=t.setAll;else if(e)a=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 new Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)");else throw new Error(`@supabase/ssr: ${e?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).${kt()?" As this is called in a browser runtime, consider removing the cookies option object to use the document.cookie API automatically.":""}`);else if(!e&&kt()){const c=()=>{const l=fs.parse(document.cookie);return Object.keys(l).map(d=>({name:d,value:l[d]??""}))};o=()=>c(),a=l=>{l.forEach(({name:d,value:h,options:f})=>{document.cookie=fs.serialize(d,h,f)})}}else{if(e)throw new 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)");o=()=>[],a=()=>{throw new 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")}}return e?{getAll:o,setAll:a,setItems:n,removedItems:i,storage:{isServer:!0,getItem:async c=>{if(typeof n[c]=="string")return n[c];if(i[c])return null;const l=await o([c]),d=await ps(c,async f=>{const y=(l==null?void 0:l.find(({name:E})=>E===f))||null;return y?y.value:null});if(!d)return null;let h=d;return typeof d=="string"&&d.startsWith(mt)&&(h=_s(d.substring(mt.length))),h},setItem:async(c,l)=>{c.endsWith("-code-verifier")&&await Hi({getAll:o,setAll:a,setItems:{[c]:l},removedItems:{}},{cookieOptions:(s==null?void 0:s.cookieOptions)??null,cookieEncoding:r}),n[c]=l,delete i[c]},removeItem:async c=>{delete n[c],i[c]=!0}}}:{getAll:o,setAll:a,setItems:n,removedItems:i,storage:{isServer:!1,getItem:async c=>{const l=await o([c]),d=await ps(c,async f=>{const y=(l==null?void 0:l.find(({name:E})=>E===f))||null;return y?y.value:null});if(!d)return null;let h=d;return d.startsWith(mt)&&(h=_s(d.substring(mt.length))),h},setItem:async(c,l)=>{const d=await o([c]),h=(d==null?void 0:d.map(({name:v})=>v))||[],f=new Set(h.filter(v=>Kt(v,c)));let y=l;r==="base64url"&&(y=mt+Mi(l));const E=qi(c,y);E.forEach(({name:v})=>{f.delete(v)});const A={...tt,...s==null?void 0:s.cookieOptions,maxAge:0},_={...tt,...s==null?void 0:s.cookieOptions,maxAge:tt.maxAge};delete A.name,delete _.name;const p=[...[...f].map(v=>({name:v,value:"",options:A})),...E.map(({name:v,value:m})=>({name:v,value:m,options:_}))];p.length>0&&await a(p)},removeItem:async c=>{const l=await o([c]),h=((l==null?void 0:l.map(({name:y})=>y))||[]).filter(y=>Kt(y,c)),f={...tt,...s==null?void 0:s.cookieOptions,maxAge:0};delete f.name,h.length>0&&await a(h.map(y=>({name:y,value:"",options:f})))}}}}async function Hi({getAll:s,setAll:e,setItems:t,removedItems:r},n){const i=n.cookieEncoding,o=n.cookieOptions??null,a=await s([...t?Object.keys(t):[],...r?Object.keys(r):[]]),c=(a==null?void 0:a.map(({name:y})=>y))||[],l=Object.keys(r).flatMap(y=>c.filter(E=>Kt(E,y))),d=Object.keys(t).flatMap(y=>{const E=new Set(c.filter(p=>Kt(p,y)));let A=t[y];i==="base64url"&&(A=mt+Mi(A));const _=qi(y,A);return _.forEach(p=>{E.delete(p.name)}),l.push(...E),_}),h={...tt,...o,maxAge:0},f={...tt,...o,maxAge:tt.maxAge};delete h.name,delete f.name,await e([...l.map(y=>({name:y,value:"",options:h})),...d.map(({name:y,value:E})=>({name:y,value:E,options:f}))])}let cr;function ou(s,e,t){var o;const r=kt();if(r&&cr)return cr;if(!s||!e)throw new Error(`@supabase/ssr: Your project's URL and API key are required to create a Supabase client!
27
-
28
- Check your Supabase project's API settings to find these values
29
-
30
- https://supabase.com/dashboard/project/_/settings/api`);const{storage:n}=Bi({...t,cookieEncoding:"base64url"},!1),i=Rn(s,e,{...t,global:{...t==null?void 0:t.global,headers:{...(o=t==null?void 0:t.global)==null?void 0:o.headers,"X-Client-Info":`supabase-ssr/${Ui} createBrowserClient`}},auth:{...t==null?void 0:t.auth,flowType:"pkce",autoRefreshToken:kt(),detectSessionInUrl:kt(),persistSession:!0,storage:n}});return r&&(cr=i),i}function au(s,e,t){var l,d;if(!s||!e)throw new Error(`Your project's URL and Key are required to create a Supabase client!
31
-
32
- Check your Supabase project's API settings to find these values
33
-
34
- https://supabase.com/dashboard/project/_/settings/api`);const{storage:r,getAll:n,setAll:i,setItems:o,removedItems:a}=Bi({...t,cookieEncoding:(t==null?void 0:t.cookieEncoding)??"base64url"},!0),c=Rn(s,e,{...t,global:{...t==null?void 0:t.global,headers:{...(l=t==null?void 0:t.global)==null?void 0:l.headers,"X-Client-Info":`supabase-ssr/${Ui} createServerClient`}},auth:{...(d=t==null?void 0:t.cookieOptions)!=null&&d.name?{storageKey:t.cookieOptions.name}:null,...t==null?void 0:t.auth,flowType:"pkce",autoRefreshToken:!1,detectSessionInUrl:!1,persistSession:!0,storage:r}});return c.auth.onAuthStateChange(async h=>{(Object.keys(o).length>0||Object.keys(a).length>0)&&(h==="SIGNED_IN"||h==="TOKEN_REFRESHED"||h==="USER_UPDATED"||h==="PASSWORD_RECOVERY"||h==="SIGNED_OUT"||h==="MFA_CHALLENGE_VERIFIED")&&await Hi({getAll:n,setAll:i,setItems:o,removedItems:a},{cookieOptions:(t==null?void 0:t.cookieOptions)??null,cookieEncoding:(t==null?void 0:t.cookieEncoding)??"base64url"})}),c}const Fi=()=>{const s=process.env.NEXT_PUBLIC_SUPABASE_URL,e=process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;if(!s||!e)throw new Error(`CRITICAL: Supabase URL or Anon Key is missing. Please ensure NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are set in your production environment. URL_IS_SET: ${!!s}, ANON_KEY_IS_SET: ${!!e}`);return ou(s,e)};async function uu(s,e){const{data:t,error:r}=await s.from("profiles").select("id, full_name, avatar_url, role, updated_at, username, website").eq("id",e).single();return r||!t?null:t}async function cu(){const s=Fi(),{data:e,error:t}=await s.from("languages").select("id, code, name, is_default, is_active, created_at, updated_at").order("name",{ascending:!0});return t?[]:e||[]}var Bt={exports:{}},lr={},dr={},hr={},ms;function lu(){return ms||(ms=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(t,r,n){if(t){n&&(n=n.toLowerCase());for(const a of t){var i,o;const c=(i=a.domain)==null?void 0:i.split(":",1)[0].toLowerCase();if(r===c||n===a.defaultLocale.toLowerCase()||(o=a.locales)!=null&&o.some(l=>l.toLowerCase()===n))return a}}}})(hr)),hr}var fr={},pr={},vs;function du(){return vs||(vs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\/$/,"")||"/"}})(pr)),pr}var gr={},_r={},bs;function Sn(){return bs||(bs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"parsePath",{enumerable:!0,get:function(){return e}});function e(t){const r=t.indexOf("#"),n=t.indexOf("?"),i=n>-1&&(r<0||n<r);return i||r>-1?{pathname:t.substring(0,i?n:r),query:i?t.substring(n,r>-1?r:void 0):"",hash:r>-1?t.slice(r):""}:{pathname:t,query:"",hash:""}}})(_r)),_r}var ys;function Wi(){return ys||(ys=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"addPathPrefix",{enumerable:!0,get:function(){return t}});const e=Sn();function t(r,n){if(!r.startsWith("/")||!n)return r;const{pathname:i,query:o,hash:a}=(0,e.parsePath)(r);return""+n+i+o+a}})(gr)),gr}var mr={},ws;function hu(){return ws||(ws=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"addPathSuffix",{enumerable:!0,get:function(){return t}});const e=Sn();function t(r,n){if(!r.startsWith("/")||!n)return r;const{pathname:i,query:o,hash:a}=(0,e.parsePath)(r);return""+i+n+o+a}})(mr)),mr}var vr={},br={},Es;function An(){return Es||(Es=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"pathHasPrefix",{enumerable:!0,get:function(){return t}});const e=Sn();function t(r,n){if(typeof r!="string")return!1;const{pathname:i}=(0,e.parsePath)(r);return i===n||i.startsWith(n+"/")}})(br)),br}var Rs;function fu(){return Rs||(Rs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"addLocale",{enumerable:!0,get:function(){return r}});const e=Wi(),t=An();function r(n,i,o,a){if(!i||i===o)return n;const c=n.toLowerCase();return!a&&((0,t.pathHasPrefix)(c,"/api")||(0,t.pathHasPrefix)(c,"/"+i.toLowerCase()))?n:(0,e.addPathPrefix)(n,"/"+i)}})(vr)),vr}var Ss;function pu(){return Ss||(Ss=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"formatNextPathnameInfo",{enumerable:!0,get:function(){return i}});const e=du(),t=Wi(),r=hu(),n=fu();function i(o){let a=(0,n.addLocale)(o.pathname,o.locale,o.buildId?void 0:o.defaultLocale,o.ignorePrefix);return(o.buildId||!o.trailingSlash)&&(a=(0,e.removeTrailingSlash)(a)),o.buildId&&(a=(0,r.addPathSuffix)((0,t.addPathPrefix)(a,"/_next/data/"+o.buildId),o.pathname==="/"?"index.json":".json")),a=(0,t.addPathPrefix)(a,o.basePath),!o.buildId&&o.trailingSlash?a.endsWith("/")?a:(0,r.addPathSuffix)(a,"/"):(0,e.removeTrailingSlash)(a)}})(fr)),fr}var yr={},As;function gu(){return As||(As=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getHostname",{enumerable:!0,get:function(){return e}});function e(t,r){let n;if(r!=null&&r.host&&!Array.isArray(r.host))n=r.host.toString().split(":",1)[0];else if(t.hostname)n=t.hostname;else return;return n.toLowerCase()}})(yr)),yr}var wr={},Er={},Ts;function _u(){return Ts||(Ts=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"normalizeLocalePath",{enumerable:!0,get:function(){return t}});const e=new WeakMap;function t(r,n){if(!n)return{pathname:r};let i=e.get(n);i||(i=n.map(d=>d.toLowerCase()),e.set(n,i));let o;const a=r.split("/",2);if(!a[1])return{pathname:r};const c=a[1].toLowerCase(),l=i.indexOf(c);return l<0?{pathname:r}:(o=n[l],r=r.slice(o.length+1)||"/",{pathname:r,detectedLocale:o})}})(Er)),Er}var Rr={},Os;function mu(){return Os||(Os=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"removePathPrefix",{enumerable:!0,get:function(){return t}});const e=An();function t(r,n){if(!(0,e.pathHasPrefix)(r,n))return r;const i=r.slice(n.length);return i.startsWith("/")?i:"/"+i}})(Rr)),Rr}var Ps;function vu(){return Ps||(Ps=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"getNextPathnameInfo",{enumerable:!0,get:function(){return n}});const e=_u(),t=mu(),r=An();function n(i,o){var a;const{basePath:c,i18n:l,trailingSlash:d}=(a=o.nextConfig)!=null?a:{},h={pathname:i,trailingSlash:i!=="/"?i.endsWith("/"):d};c&&(0,r.pathHasPrefix)(h.pathname,c)&&(h.pathname=(0,t.removePathPrefix)(h.pathname,c),h.basePath=c);let f=h.pathname;if(h.pathname.startsWith("/_next/data/")&&h.pathname.endsWith(".json")){const E=h.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),A=E[0];h.buildId=A,f=E[1]!=="index"?"/"+E.slice(1).join("/"):"/",o.parseData===!0&&(h.pathname=f)}if(l){let E=o.i18nProvider?o.i18nProvider.analyze(h.pathname):(0,e.normalizeLocalePath)(h.pathname,l.locales);h.locale=E.detectedLocale;var y;h.pathname=(y=E.pathname)!=null?y:h.pathname,!E.detectedLocale&&h.buildId&&(E=o.i18nProvider?o.i18nProvider.analyze(f):(0,e.normalizeLocalePath)(f,l.locales),E.detectedLocale&&(h.locale=E.detectedLocale))}return h}})(wr)),wr}var ks;function Gi(){return ks||(ks=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"NextURL",{enumerable:!0,get:function(){return c}});const e=lu(),t=pu(),r=gu(),n=vu(),i=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function o(l,d){return new URL(String(l).replace(i,"localhost"),d&&String(d).replace(i,"localhost"))}const a=Symbol("NextURLInternal");class c{constructor(d,h,f){let y,E;typeof h=="object"&&"pathname"in h||typeof h=="string"?(y=h,E=f||{}):E=f||h||{},this[a]={url:o(d,y??E.base),options:E,basePath:""},this.analyze()}analyze(){var d,h,f,y,E;const A=(0,n.getNextPathnameInfo)(this[a].url.pathname,{nextConfig:this[a].options.nextConfig,parseData:!process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,i18nProvider:this[a].options.i18nProvider}),_=(0,r.getHostname)(this[a].url,this[a].options.headers);this[a].domainLocale=this[a].options.i18nProvider?this[a].options.i18nProvider.detectDomainLocale(_):(0,e.detectDomainLocale)((h=this[a].options.nextConfig)==null||(d=h.i18n)==null?void 0:d.domains,_);const p=((f=this[a].domainLocale)==null?void 0:f.defaultLocale)||((E=this[a].options.nextConfig)==null||(y=E.i18n)==null?void 0:y.defaultLocale);this[a].url.pathname=A.pathname,this[a].defaultLocale=p,this[a].basePath=A.basePath??"",this[a].buildId=A.buildId,this[a].locale=A.locale??p,this[a].trailingSlash=A.trailingSlash}formatPathname(){return(0,t.formatNextPathnameInfo)({basePath:this[a].basePath,buildId:this[a].buildId,defaultLocale:this[a].options.forceLocale?void 0:this[a].defaultLocale,locale:this[a].locale,pathname:this[a].url.pathname,trailingSlash:this[a].trailingSlash})}formatSearch(){return this[a].url.search}get buildId(){return this[a].buildId}set buildId(d){this[a].buildId=d}get locale(){return this[a].locale??""}set locale(d){var h,f;if(!this[a].locale||!(!((f=this[a].options.nextConfig)==null||(h=f.i18n)==null)&&h.locales.includes(d)))throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale "${d}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[a].locale=d}get defaultLocale(){return this[a].defaultLocale}get domainLocale(){return this[a].domainLocale}get searchParams(){return this[a].url.searchParams}get host(){return this[a].url.host}set host(d){this[a].url.host=d}get hostname(){return this[a].url.hostname}set hostname(d){this[a].url.hostname=d}get port(){return this[a].url.port}set port(d){this[a].url.port=d}get protocol(){return this[a].url.protocol}set protocol(d){this[a].url.protocol=d}get href(){const d=this.formatPathname(),h=this.formatSearch();return`${this.protocol}//${this.host}${d}${h}${this.hash}`}set href(d){this[a].url=o(d),this.analyze()}get origin(){return this[a].url.origin}get pathname(){return this[a].url.pathname}set pathname(d){this[a].url.pathname=d}get hash(){return this[a].url.hash}set hash(d){this[a].url.hash=d}get search(){return this[a].url.search}set search(d){this[a].url.search=d}get password(){return this[a].url.password}set password(d){this[a].url.password=d}get username(){return this[a].url.username}set username(d){this[a].url.username=d}get basePath(){return this[a].basePath}set basePath(d){this[a].basePath=d.startsWith("/")?d:`/${d}`}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 c(String(this),this[a].options)}}})(dr)),dr}var Sr={},Ar={},Cs;function bu(){return Cs||(Cs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(ge,Te){for(var qe in Te)Object.defineProperty(ge,qe,{enumerable:!0,get:Te[qe]})}e(s,{ACTION_SUFFIX:function(){return E},APP_DIR_ALIAS:function(){return ae},CACHE_ONE_YEAR:function(){return V},DOT_NEXT_ALIAS:function(){return le},ESLINT_DEFAULT_DIRS:function(){return T},GSP_NO_RETURNED_VALUE:function(){return Ue},GSSP_COMPONENT_MEMBER_ERROR:function(){return Ne},GSSP_NO_RETURNED_VALUE:function(){return je},HTML_CONTENT_TYPE_HEADER:function(){return r},INFINITE_CACHE:function(){return ce},INSTRUMENTATION_HOOK_FILENAME:function(){return he},JSON_CONTENT_TYPE_HEADER:function(){return n},MATCHED_PATH_HEADER:function(){return a},MIDDLEWARE_FILENAME:function(){return ie},MIDDLEWARE_LOCATION_REGEXP:function(){return de},NEXT_BODY_SUFFIX:function(){return p},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return N},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return m},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return R},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return C},NEXT_CACHE_TAGS_HEADER:function(){return v},NEXT_CACHE_TAG_MAX_ITEMS:function(){return O},NEXT_CACHE_TAG_MAX_LENGTH:function(){return S},NEXT_DATA_SUFFIX:function(){return A},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return o},NEXT_META_SUFFIX:function(){return _},NEXT_QUERY_PARAM_PREFIX:function(){return i},NEXT_RESUME_HEADER:function(){return g},NON_STANDARD_NODE_ENV:function(){return Re},PAGES_DIR_ALIAS:function(){return _e},PRERENDER_REVALIDATE_HEADER:function(){return c},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return l},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return M},ROOT_DIR_ALIAS:function(){return fe},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return Z},RSC_ACTION_ENCRYPTION_ALIAS:function(){return F},RSC_ACTION_PROXY_ALIAS:function(){return k},RSC_ACTION_VALIDATE_ALIAS:function(){return b},RSC_CACHE_WRAPPER_ALIAS:function(){return L},RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS:function(){return $},RSC_MOD_REF_PROXY_ALIAS:function(){return X},RSC_PREFETCH_SUFFIX:function(){return d},RSC_SEGMENTS_DIR_SUFFIX:function(){return h},RSC_SEGMENT_SUFFIX:function(){return f},RSC_SUFFIX:function(){return y},SERVER_PROPS_EXPORT_ERROR:function(){return ke},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return re},SERVER_PROPS_SSG_CONFLICT:function(){return Ee},SERVER_RUNTIME:function(){return I},SSG_FALLBACK_EXPORT_ERROR:function(){return Ce},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return me},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return xe},TEXT_PLAIN_CONTENT_TYPE_HEADER:function(){return t},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return Ie},WEBPACK_LAYERS:function(){return W},WEBPACK_RESOURCE_QUERIES:function(){return oe}});const t="text/plain",r="text/html; charset=utf-8",n="application/json; charset=utf-8",i="nxtP",o="nxtI",a="x-matched-path",c="x-prerender-revalidate",l="x-prerender-revalidate-if-generated",d=".prefetch.rsc",h=".segments",f=".segment.rsc",y=".rsc",E=".action",A=".json",_=".meta",p=".body",v="x-next-cache-tags",m="x-next-revalidated-tags",R="x-next-revalidate-tag-token",g="next-resume",O=128,S=256,C=1024,N="_N_T_",V=31536e3,ce=4294967294,ie="middleware",de=`(?:src/)?${ie}`,he="instrumentation",_e="private-next-pages",le="private-dot-next",fe="private-next-root-dir",ae="private-next-app-dir",X="private-next-rsc-mod-ref-proxy",b="private-next-rsc-action-validate",k="private-next-rsc-server-reference",L="private-next-rsc-cache-wrapper",$="private-next-rsc-track-dynamic-import",F="private-next-rsc-action-encryption",Z="private-next-rsc-action-client-wrapper",M="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",me="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",re="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",Ee="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",xe="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",ke="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",Ue="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",je="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",Ie="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",Ne="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",Re='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',Ce="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",T=["app","pages","components","lib","src"],I={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},x={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"},W={...x,GROUP:{builtinReact:[x.reactServerComponents,x.actionBrowser],serverOnly:[x.reactServerComponents,x.actionBrowser,x.instrument,x.middleware],neutralTarget:[x.apiNode,x.apiEdge],clientOnly:[x.serverSideRendering,x.appPagesBrowser],bundled:[x.reactServerComponents,x.actionBrowser,x.serverSideRendering,x.appPagesBrowser,x.shared,x.instrument,x.middleware],appPages:[x.reactServerComponents,x.serverSideRendering,x.appPagesBrowser,x.actionBrowser]}},oe={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}})(Ar)),Ar}var xs;function zi(){return xs||(xs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(c,l){for(var d in l)Object.defineProperty(c,d,{enumerable:!0,get:l[d]})}e(s,{fromNodeOutgoingHttpHeaders:function(){return r},normalizeNextQueryParam:function(){return a},splitCookiesString:function(){return n},toNodeOutgoingHttpHeaders:function(){return i},validateURL:function(){return o}});const t=bu();function r(c){const l=new Headers;for(let[d,h]of Object.entries(c)){const f=Array.isArray(h)?h:[h];for(let y of f)typeof y>"u"||(typeof y=="number"&&(y=y.toString()),l.append(d,y))}return l}function n(c){var l=[],d=0,h,f,y,E,A;function _(){for(;d<c.length&&/\s/.test(c.charAt(d));)d+=1;return d<c.length}function p(){return f=c.charAt(d),f!=="="&&f!==";"&&f!==","}for(;d<c.length;){for(h=d,A=!1;_();)if(f=c.charAt(d),f===","){for(y=d,d+=1,_(),E=d;d<c.length&&p();)d+=1;d<c.length&&c.charAt(d)==="="?(A=!0,d=E,l.push(c.substring(h,y)),h=d):d=y+1}else d+=1;(!A||d>=c.length)&&l.push(c.substring(h,c.length))}return l}function i(c){const l={},d=[];if(c)for(const[h,f]of c.entries())h.toLowerCase()==="set-cookie"?(d.push(...n(f)),l[h]=d.length===1?d[0]:d):l[h]=f;return l}function o(c){try{return String(new URL(String(c)))}catch(l){throw Object.defineProperty(new Error(`URL is malformed "${String(c)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:l}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function a(c){const l=[t.NEXT_QUERY_PARAM_PREFIX,t.NEXT_INTERCEPTION_MARKER_PREFIX];for(const d of l)if(c!==d&&c.startsWith(d))return c.substring(d.length);return null}})(Sr)),Sr}var Tr={},js;function yu(){return js||(js=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(i,o){for(var a in o)Object.defineProperty(i,a,{enumerable:!0,get:o[a]})}e(s,{PageSignatureError:function(){return t},RemovedPageError:function(){return r},RemovedUAError:function(){return n}});class t extends Error{constructor({page:o}){super(`The middleware "${o}" accepts an async API directly with the form:
35
-
36
- export function middleware(request, event) {
37
- return NextResponse.redirect('/new-location')
38
- }
39
-
40
- Read more: https://nextjs.org/docs/messages/middleware-new-signature
41
- `)}}class r 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 n 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 ")}}})(Tr)),Tr}var Or={},Pr,Is;function wu(){if(Is)return Pr;Is=1;var s=Object.defineProperty,e=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,n=(g,O)=>{for(var S in O)s(g,S,{get:O[S],enumerable:!0})},i=(g,O,S,C)=>{if(O&&typeof O=="object"||typeof O=="function")for(let N of t(O))!r.call(g,N)&&N!==S&&s(g,N,{get:()=>O[N],enumerable:!(C=e(O,N))||C.enumerable});return g},o=g=>i(s({},"__esModule",{value:!0}),g),a={};n(a,{RequestCookies:()=>p,ResponseCookies:()=>v,parseCookie:()=>l,parseSetCookie:()=>d,stringifyCookie:()=>c}),Pr=o(a);function c(g){var O;const S=["path"in g&&g.path&&`Path=${g.path}`,"expires"in g&&(g.expires||g.expires===0)&&`Expires=${(typeof g.expires=="number"?new Date(g.expires):g.expires).toUTCString()}`,"maxAge"in g&&typeof g.maxAge=="number"&&`Max-Age=${g.maxAge}`,"domain"in g&&g.domain&&`Domain=${g.domain}`,"secure"in g&&g.secure&&"Secure","httpOnly"in g&&g.httpOnly&&"HttpOnly","sameSite"in g&&g.sameSite&&`SameSite=${g.sameSite}`,"partitioned"in g&&g.partitioned&&"Partitioned","priority"in g&&g.priority&&`Priority=${g.priority}`].filter(Boolean),C=`${g.name}=${encodeURIComponent((O=g.value)!=null?O:"")}`;return S.length===0?C:`${C}; ${S.join("; ")}`}function l(g){const O=new Map;for(const S of g.split(/; */)){if(!S)continue;const C=S.indexOf("=");if(C===-1){O.set(S,"true");continue}const[N,V]=[S.slice(0,C),S.slice(C+1)];try{O.set(N,decodeURIComponent(V??"true"))}catch{}}return O}function d(g){if(!g)return;const[[O,S],...C]=l(g),{domain:N,expires:V,httponly:ce,maxage:ie,path:de,samesite:he,secure:_e,partitioned:le,priority:fe}=Object.fromEntries(C.map(([X,b])=>[X.toLowerCase().replace(/-/g,""),b])),ae={name:O,value:decodeURIComponent(S),domain:N,...V&&{expires:new Date(V)},...ce&&{httpOnly:!0},...typeof ie=="string"&&{maxAge:Number(ie)},path:de,...he&&{sameSite:y(he)},..._e&&{secure:!0},...fe&&{priority:A(fe)},...le&&{partitioned:!0}};return h(ae)}function h(g){const O={};for(const S in g)g[S]&&(O[S]=g[S]);return O}var f=["strict","lax","none"];function y(g){return g=g.toLowerCase(),f.includes(g)?g:void 0}var E=["low","medium","high"];function A(g){return g=g.toLowerCase(),E.includes(g)?g:void 0}function _(g){if(!g)return[];var O=[],S=0,C,N,V,ce,ie;function de(){for(;S<g.length&&/\s/.test(g.charAt(S));)S+=1;return S<g.length}function he(){return N=g.charAt(S),N!=="="&&N!==";"&&N!==","}for(;S<g.length;){for(C=S,ie=!1;de();)if(N=g.charAt(S),N===","){for(V=S,S+=1,de(),ce=S;S<g.length&&he();)S+=1;S<g.length&&g.charAt(S)==="="?(ie=!0,S=ce,O.push(g.substring(C,V)),C=S):S=V+1}else S+=1;(!ie||S>=g.length)&&O.push(g.substring(C,g.length))}return O}var p=class{constructor(g){this._parsed=new Map,this._headers=g;const O=g.get("cookie");if(O){const S=l(O);for(const[C,N]of S)this._parsed.set(C,{name:C,value:N})}}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...g){const O=typeof g[0]=="string"?g[0]:g[0].name;return this._parsed.get(O)}getAll(...g){var O;const S=Array.from(this._parsed);if(!g.length)return S.map(([N,V])=>V);const C=typeof g[0]=="string"?g[0]:(O=g[0])==null?void 0:O.name;return S.filter(([N])=>N===C).map(([N,V])=>V)}has(g){return this._parsed.has(g)}set(...g){const[O,S]=g.length===1?[g[0].name,g[0].value]:g,C=this._parsed;return C.set(O,{name:O,value:S}),this._headers.set("cookie",Array.from(C).map(([N,V])=>c(V)).join("; ")),this}delete(g){const O=this._parsed,S=Array.isArray(g)?g.map(C=>O.delete(C)):O.delete(g);return this._headers.set("cookie",Array.from(O).map(([C,N])=>c(N)).join("; ")),S}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(g=>`${g.name}=${encodeURIComponent(g.value)}`).join("; ")}},v=class{constructor(g){this._parsed=new Map;var O,S,C;this._headers=g;const N=(C=(S=(O=g.getSetCookie)==null?void 0:O.call(g))!=null?S:g.get("set-cookie"))!=null?C:[],V=Array.isArray(N)?N:_(N);for(const ce of V){const ie=d(ce);ie&&this._parsed.set(ie.name,ie)}}get(...g){const O=typeof g[0]=="string"?g[0]:g[0].name;return this._parsed.get(O)}getAll(...g){var O;const S=Array.from(this._parsed.values());if(!g.length)return S;const C=typeof g[0]=="string"?g[0]:(O=g[0])==null?void 0:O.name;return S.filter(N=>N.name===C)}has(g){return this._parsed.has(g)}set(...g){const[O,S,C]=g.length===1?[g[0].name,g[0].value,g[0]]:g,N=this._parsed;return N.set(O,R({name:O,value:S,...C})),m(N,this._headers),this}delete(...g){const[O,S]=typeof g[0]=="string"?[g[0]]:[g[0].name,g[0]];return this.set({...S,name:O,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(c).join("; ")}};function m(g,O){O.delete("set-cookie");for(const[,S]of g){const C=c(S);O.append("set-cookie",C)}}function R(g={name:"",value:""}){return typeof g.expires=="number"&&(g.expires=new Date(g.expires)),g.maxAge&&(g.expires=new Date(Date.now()+g.maxAge*1e3)),(g.path===null||g.path===void 0)&&(g.path="/"),g}return Pr}var Ns;function mn(){return Ns||(Ns=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(r,n){for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]})}e(s,{RequestCookies:function(){return t.RequestCookies},ResponseCookies:function(){return t.ResponseCookies},stringifyCookie:function(){return t.stringifyCookie}});const t=wu()})(Or)),Or}var Ds;function Eu(){return Ds||(Ds=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(c,l){for(var d in l)Object.defineProperty(c,d,{enumerable:!0,get:l[d]})}e(s,{INTERNALS:function(){return o},NextRequest:function(){return a}});const t=Gi(),r=zi(),n=yu(),i=mn(),o=Symbol("internal request");class a extends Request{constructor(l,d={}){const h=typeof l!="string"&&"url"in l?l.url:String(l);(0,r.validateURL)(h),process.env.NEXT_RUNTIME!=="edge"&&d.body&&d.duplex!=="half"&&(d.duplex="half"),l instanceof Request?super(l,d):super(h,d);const f=new t.NextURL(h,{headers:(0,r.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:d.nextConfig});this[o]={cookies:new i.RequestCookies(this.headers),nextUrl:f,url:process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE?h:f.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[o].cookies}get nextUrl(){return this[o].nextUrl}get page(){throw new n.RemovedPageError}get ua(){throw new n.RemovedUAError}get url(){return this[o].url}}})(lr)),lr}var kr={},Cr={},Ls;function Ru(){return Ls||(Ls=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ReflectAdapter",{enumerable:!0,get:function(){return e}});class e{static get(r,n,i){const o=Reflect.get(r,n,i);return typeof o=="function"?o.bind(r):o}static set(r,n,i,o){return Reflect.set(r,n,i,o)}static has(r,n){return Reflect.has(r,n)}static deleteProperty(r,n){return Reflect.deleteProperty(r,n)}}})(Cr)),Cr}var $s;function Su(){return $s||($s=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"NextResponse",{enumerable:!0,get:function(){return l}});const e=mn(),t=Gi(),r=zi(),n=Ru(),i=mn(),o=Symbol("internal response"),a=new Set([301,302,303,307,308]);function c(d,h){var f;if(!(d==null||(f=d.request)==null)&&f.headers){if(!(d.request.headers instanceof Headers))throw Object.defineProperty(new Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});const y=[];for(const[E,A]of d.request.headers)h.set("x-middleware-request-"+E,A),y.push(E);h.set("x-middleware-override-headers",y.join(","))}}class l extends Response{constructor(h,f={}){super(h,f);const y=this.headers,E=new i.ResponseCookies(y),A=new Proxy(E,{get(_,p,v){switch(p){case"delete":case"set":return(...m)=>{const R=Reflect.apply(_[p],_,m),g=new Headers(y);return R instanceof i.ResponseCookies&&y.set("x-middleware-set-cookie",R.getAll().map(O=>(0,e.stringifyCookie)(O)).join(",")),c(f,g),R};default:return n.ReflectAdapter.get(_,p,v)}}});this[o]={cookies:A,url:f.url?new t.NextURL(f.url,{headers:(0,r.toNodeOutgoingHttpHeaders)(y),nextConfig:f.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[o].cookies}static json(h,f){const y=Response.json(h,f);return new l(y.body,y)}static redirect(h,f){const y=typeof f=="number"?f:(f==null?void 0:f.status)??307;if(!a.has(y))throw Object.defineProperty(new RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});const E=typeof f=="object"?f:{},A=new Headers(E==null?void 0:E.headers);return A.set("Location",(0,r.validateURL)(h)),new l(null,{...E,headers:A,status:y})}static rewrite(h,f){const y=new Headers(f==null?void 0:f.headers);return y.set("x-middleware-rewrite",(0,r.validateURL)(h)),c(f,y),new l(null,{...f,headers:y})}static next(h){const f=new Headers(h==null?void 0:h.headers);return f.set("x-middleware-next","1"),c(h,f),new l(null,{...h,headers:f})}}})(kr)),kr}var xr={},Us;function Au(){return Us||(Us=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"ImageResponse",{enumerable:!0,get:function(){return e}});function e(){throw Object.defineProperty(new 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})}})(xr)),xr}var jr={},Ir={exports:{}},qs;function Tu(){return qs||(qs=1,(()=>{var s={226:function(n,i){(function(o,a){var c="1.0.35",l="",d="?",h="function",f="undefined",y="object",E="string",A="major",_="model",p="name",v="type",m="vendor",R="version",g="architecture",O="console",S="mobile",C="tablet",N="smarttv",V="wearable",ce="embedded",ie=350,de="Amazon",he="Apple",_e="ASUS",le="BlackBerry",fe="Browser",ae="Chrome",X="Edge",b="Firefox",k="Google",L="Huawei",$="LG",F="Microsoft",Z="Motorola",M="Opera",me="Samsung",re="Sharp",Ee="Sony",xe="Xiaomi",ke="Zebra",Ue="Facebook",je="Chromium OS",Ie="Mac OS",Ne=function(Y,ee){var B={};for(var ne in Y)ee[ne]&&ee[ne].length%2===0?B[ne]=ee[ne].concat(Y[ne]):B[ne]=Y[ne];return B},Re=function(Y){for(var ee={},B=0;B<Y.length;B++)ee[Y[B].toUpperCase()]=Y[B];return ee},Ce=function(Y,ee){return typeof Y===E?T(ee).indexOf(T(Y))!==-1:!1},T=function(Y){return Y.toLowerCase()},I=function(Y){return typeof Y===E?Y.replace(/[^\d\.]/g,l).split(".")[0]:a},x=function(Y,ee){if(typeof Y===E)return Y=Y.replace(/^\s\s*/,l),typeof ee===f?Y:Y.substring(0,ie)},W=function(Y,ee){for(var B=0,ne,De,Oe,Q,H,Pe;B<ee.length&&!H;){var nt=ee[B],st=ee[B+1];for(ne=De=0;ne<nt.length&&!H&&nt[ne];)if(H=nt[ne++].exec(Y),H)for(Oe=0;Oe<st.length;Oe++)Pe=H[++De],Q=st[Oe],typeof Q===y&&Q.length>0?Q.length===2?typeof Q[1]==h?this[Q[0]]=Q[1].call(this,Pe):this[Q[0]]=Q[1]:Q.length===3?typeof Q[1]===h&&!(Q[1].exec&&Q[1].test)?this[Q[0]]=Pe?Q[1].call(this,Pe,Q[2]):a:this[Q[0]]=Pe?Pe.replace(Q[1],Q[2]):a:Q.length===4&&(this[Q[0]]=Pe?Q[3].call(this,Pe.replace(Q[1],Q[2])):a):this[Q]=Pe||a;B+=2}},oe=function(Y,ee){for(var B in ee)if(typeof ee[B]===y&&ee[B].length>0){for(var ne=0;ne<ee[B].length;ne++)if(Ce(ee[B][ne],Y))return B===d?a:B}else if(Ce(ee[B],Y))return B===d?a:B;return Y},ge={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Te={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"},qe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[R,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[R,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,R],[/opios[\/ ]+([\w\.]+)/i],[R,[p,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[R,[p,M]],[/(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],[p,R],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[R,[p,"UC"+fe]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[R,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[R,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[R,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[R,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[R,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+fe],R],[/\bfocus\/([\w\.]+)/i],[R,[p,b+" Focus"]],[/\bopt\/([\w\.]+)/i],[R,[p,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[R,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[R,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[R,[p,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[R,[p,"MIUI "+fe]],[/fxios\/([-\w\.]+)/i],[R,[p,b]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+fe]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 "+fe],R],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],R],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,R],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,Ue],R],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,R],[/\bgsa\/([\w\.]+) .*safari\//i],[R,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[R,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[R,[p,ae+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,ae+" WebView"],R],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[R,[p,"Android "+fe]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,R],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[R,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[R,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[R,oe,ge]],[/(webkit|khtml)\/([\w\.]+)/i],[p,R],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],R],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[R,[p,b+" 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],[p,R],[/(cobalt)\/([\w\.]+)/i],[p,[R,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,T]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,l,T]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,T]]],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],[_,[m,me],[v,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[_,[m,me],[v,S]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[_,[m,he],[v,S]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[_,[m,he],[v,C]],[/(macintosh);/i],[_,[m,he]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[_,[m,re],[v,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[_,[m,L],[v,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[_,[m,L],[v,S]],[/\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],[[_,/_/g," "],[m,xe],[v,S]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[_,/_/g," "],[m,xe],[v,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[_,[m,"OPPO"],[v,S]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[_,[m,"Vivo"],[v,S]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[_,[m,"Realme"],[v,S]],[/\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],[_,[m,Z],[v,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[_,[m,Z],[v,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[_,[m,$],[v,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[_,[m,$],[v,S]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[_,[m,"Lenovo"],[v,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[_,/_/g," "],[m,"Nokia"],[v,S]],[/(pixel c)\b/i],[_,[m,k],[v,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[_,[m,k],[v,S]],[/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],[_,[m,Ee],[v,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[_,"Xperia Tablet"],[m,Ee],[v,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[_,[m,"OnePlus"],[v,S]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[_,[m,de],[v,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[_,/(.+)/g,"Fire Phone $1"],[m,de],[v,S]],[/(playbook);[-\w\),; ]+(rim)/i],[_,m,[v,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[_,[m,le],[v,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[_,[m,_e],[v,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[_,[m,_e],[v,S]],[/(nexus 9)/i],[_,[m,"HTC"],[v,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[_,/_/g," "],[v,S]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[_,[m,"Acer"],[v,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[_,[m,"Meizu"],[v,S]],[/(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],[m,_,[v,S]],[/(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],[m,_,[v,C]],[/(surface duo)/i],[_,[m,F],[v,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[_,[m,"Fairphone"],[v,S]],[/(u304aa)/i],[_,[m,"AT&T"],[v,S]],[/\bsie-(\w*)/i],[_,[m,"Siemens"],[v,S]],[/\b(rct\w+) b/i],[_,[m,"RCA"],[v,C]],[/\b(venue[\d ]{2,7}) b/i],[_,[m,"Dell"],[v,C]],[/\b(q(?:mv|ta)\w+) b/i],[_,[m,"Verizon"],[v,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[_,[m,"Barnes & Noble"],[v,C]],[/\b(tm\d{3}\w+) b/i],[_,[m,"NuVision"],[v,C]],[/\b(k88) b/i],[_,[m,"ZTE"],[v,C]],[/\b(nx\d{3}j) b/i],[_,[m,"ZTE"],[v,S]],[/\b(gen\d{3}) b.+49h/i],[_,[m,"Swiss"],[v,S]],[/\b(zur\d{3}) b/i],[_,[m,"Swiss"],[v,C]],[/\b((zeki)?tb.*\b) b/i],[_,[m,"Zeki"],[v,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],_,[v,C]],[/\b(ns-?\w{0,9}) b/i],[_,[m,"Insignia"],[v,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[_,[m,"NextBook"],[v,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],_,[v,S]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],_,[v,S]],[/\b(ph-1) /i],[_,[m,"Essential"],[v,S]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[_,[m,"Envizen"],[v,C]],[/\b(trio[-\w\. ]+) b/i],[_,[m,"MachSpeed"],[v,C]],[/\btu_(1491) b/i],[_,[m,"Rotor"],[v,C]],[/(shield[\w ]+) b/i],[_,[m,"Nvidia"],[v,C]],[/(sprint) (\w+)/i],[m,_,[v,S]],[/(kin\.[onetw]{3})/i],[[_,/\./g," "],[m,F],[v,S]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[_,[m,ke],[v,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[_,[m,ke],[v,S]],[/smart-tv.+(samsung)/i],[m,[v,N]],[/hbbtv.+maple;(\d+)/i],[[_,/^/,"SmartTV"],[m,me],[v,N]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,$],[v,N]],[/(apple) ?tv/i],[m,[_,he+" TV"],[v,N]],[/crkey/i],[[_,ae+"cast"],[m,k],[v,N]],[/droid.+aft(\w)( bui|\))/i],[_,[m,de],[v,N]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[_,[m,re],[v,N]],[/(bravia[\w ]+)( bui|\))/i],[_,[m,Ee],[v,N]],[/(mitv-\w{5}) bui/i],[_,[m,xe],[v,N]],[/Hbbtv.*(technisat) (.*);/i],[m,_,[v,N]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,x],[_,x],[v,N]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,N]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,_,[v,O]],[/droid.+; (shield) bui/i],[_,[m,"Nvidia"],[v,O]],[/(playstation [345portablevi]+)/i],[_,[m,Ee],[v,O]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[_,[m,F],[v,O]],[/((pebble))app/i],[m,_,[v,V]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[_,[m,he],[v,V]],[/droid.+; (glass) \d/i],[_,[m,k],[v,V]],[/droid.+; (wt63?0{2,3})\)/i],[_,[m,ke],[v,V]],[/(quest( 2| pro)?)/i],[_,[m,Ue],[v,V]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[v,ce]],[/(aeobc)\b/i],[_,[m,de],[v,ce]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[_,[v,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[_,[v,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,S]],[/(android[-\w\. ]{0,9});.+buil/i],[_,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[R,[p,X+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[R,[p,"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],[p,R],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[R,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,R],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[R,oe,Te]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[R,oe,Te]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[R,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,Ie],[R,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[R,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,R],[/\(bb(10);/i],[R,[p,le]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[R,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[R,[p,b+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[R,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[R,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[R,[p,ae+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,je],R],[/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],[p,R],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],R],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,R]]},we=function(Y,ee){if(typeof Y===y&&(ee=Y,Y=a),!(this instanceof we))return new we(Y,ee).getResult();var B=typeof o!==f&&o.navigator?o.navigator:a,ne=Y||(B&&B.userAgent?B.userAgent:l),De=B&&B.userAgentData?B.userAgentData:a,Oe=ee?Ne(qe,ee):qe,Q=B&&B.userAgent==ne;return this.getBrowser=function(){var H={};return H[p]=a,H[R]=a,W.call(H,ne,Oe.browser),H[A]=I(H[R]),Q&&B&&B.brave&&typeof B.brave.isBrave==h&&(H[p]="Brave"),H},this.getCPU=function(){var H={};return H[g]=a,W.call(H,ne,Oe.cpu),H},this.getDevice=function(){var H={};return H[m]=a,H[_]=a,H[v]=a,W.call(H,ne,Oe.device),Q&&!H[v]&&De&&De.mobile&&(H[v]=S),Q&&H[_]=="Macintosh"&&B&&typeof B.standalone!==f&&B.maxTouchPoints&&B.maxTouchPoints>2&&(H[_]="iPad",H[v]=C),H},this.getEngine=function(){var H={};return H[p]=a,H[R]=a,W.call(H,ne,Oe.engine),H},this.getOS=function(){var H={};return H[p]=a,H[R]=a,W.call(H,ne,Oe.os),Q&&!H[p]&&De&&De.platform!="Unknown"&&(H[p]=De.platform.replace(/chrome os/i,je).replace(/macos/i,Ie)),H},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 ne},this.setUA=function(H){return ne=typeof H===E&&H.length>ie?x(H,ie):H,this},this.setUA(ne),this};we.VERSION=c,we.BROWSER=Re([p,R,A]),we.CPU=Re([g]),we.DEVICE=Re([_,m,v,O,S,N,C,V,ce]),we.ENGINE=we.OS=Re([p,R]),typeof i!==f?(n.exports&&(i=n.exports=we),i.UAParser=we):typeof o!==f&&(o.UAParser=we);var Ge=typeof o!==f&&(o.jQuery||o.Zepto);if(Ge&&!Ge.ua){var G=new we;Ge.ua=G.getResult(),Ge.ua.get=function(){return G.getUA()},Ge.ua.set=function(Y){G.setUA(Y);var ee=G.getResult();for(var B in ee)Ge.ua[B]=ee[B]}}})(typeof window=="object"?window:this)}},e={};function t(n){var i=e[n];if(i!==void 0)return i.exports;var o=e[n]={exports:{}},a=!0;try{s[n].call(o.exports,o,o.exports,t),a=!1}finally{a&&delete e[n]}return o.exports}typeof t<"u"&&(t.ab=__dirname+"/");var r=t(226);Ir.exports=r})()),Ir.exports}var Ms;function Bs(){return Ms||(Ms=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(a,c){for(var l in c)Object.defineProperty(a,l,{enumerable:!0,get:c[l]})}e(s,{isBot:function(){return n},userAgent:function(){return o},userAgentFromString:function(){return i}});const t=r(Tu());function r(a){return a&&a.__esModule?a:{default:a}}function n(a){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(a)}function i(a){return{...(0,t.default)(a),isBot:a===void 0?!1:n(a)}}function o({headers:a}){return i(a.get("user-agent")||void 0)}})(jr)),jr}var Nr={},Hs;function Ou(){return Hs||(Hs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"URLPattern",{enumerable:!0,get:function(){return e}});const e=typeof URLPattern>"u"?void 0:URLPattern})(Nr)),Nr}var Dr={},Lr={},$r={},Ur={},qr={},Fs;function Jt(){return Fs||(Fs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(c,l){for(var d in l)Object.defineProperty(c,d,{enumerable:!0,get:l[d]})}e(s,{bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return a}});const t=Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw t}getStore(){}run(){throw t}exit(){throw t}enterWith(){throw t}static bind(l){return l}}const n=typeof globalThis<"u"&&globalThis.AsyncLocalStorage;function i(){return n?new n:new r}function o(c){return n?n.bind(c):r.bind(c)}function a(){return n?n.snapshot():function(c,...l){return c(...l)}}})(qr)),qr}var Ws;function Pu(){return Ws||(Ws=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"workAsyncStorageInstance",{enumerable:!0,get:function(){return t}});const t=(0,Jt().createAsyncLocalStorage)()})(Ur)),Ur}var Gs;function Qt(){return Gs||(Gs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"workAsyncStorage",{enumerable:!0,get:function(){return e.workAsyncStorageInstance}});const e=Pu()})($r)),$r}var zs;function ku(){return zs||(zs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"after",{enumerable:!0,get:function(){return t}});const e=Qt();function t(r){const n=e.workAsyncStorage.getStore();if(!n)throw Object.defineProperty(new 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});const{afterContext:i}=n;return i.after(r)}})(Lr)),Lr}var Xs;function Cu(){return Xs||(Xs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),e(ku(),s);function e(t,r){return Object.keys(t).forEach(function(n){n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})}),t}})(Dr)),Dr}var Mr={},Br={},Hr={},Ks;function xu(){return Ks||(Ks=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"workUnitAsyncStorageInstance",{enumerable:!0,get:function(){return t}});const t=(0,Jt().createAsyncLocalStorage)()})(Hr)),Hr}var Ht={exports:{}},Ys;function ju(){return Ys||(Ys=1,(function(s,e){Object.defineProperty(e,"__esModule",{value:!0});function t(R,g){for(var O in g)Object.defineProperty(R,O,{enumerable:!0,get:g[O]})}t(e,{ACTION_HEADER:function(){return n},FLIGHT_HEADERS:function(){return f},NEXT_ACTION_NOT_FOUND_HEADER:function(){return m},NEXT_DID_POSTPONE_HEADER:function(){return A},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return l},NEXT_HMR_REFRESH_HEADER:function(){return c},NEXT_IS_PRERENDER_HEADER:function(){return v},NEXT_REWRITTEN_PATH_HEADER:function(){return _},NEXT_REWRITTEN_QUERY_HEADER:function(){return p},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return a},NEXT_ROUTER_STALE_TIME_HEADER:function(){return E},NEXT_ROUTER_STATE_TREE_HEADER:function(){return i},NEXT_RSC_UNION_QUERY:function(){return y},NEXT_URL:function(){return d},RSC_CONTENT_TYPE_HEADER:function(){return h},RSC_HEADER:function(){return r}});const r="rsc",n="next-action",i="next-router-state-tree",o="next-router-prefetch",a="next-router-segment-prefetch",c="next-hmr-refresh",l="__next_hmr_refresh_hash__",d="next-url",h="text/x-component",f=[r,i,o,c,a],y="_rsc",E="x-nextjs-stale-time",A="x-nextjs-postponed",_="x-nextjs-rewritten-path",p="x-nextjs-rewritten-query",v="x-nextjs-prerender",m="x-nextjs-action-not-found";(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),s.exports=e.default)})(Ht,Ht.exports)),Ht.exports}var Fr={},Vs;function Tn(){return Vs||(Vs=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"InvariantError",{enumerable:!0,get:function(){return e}});class e extends Error{constructor(r,n){super("Invariant: "+(r.endsWith(".")?r:r+".")+" This is a bug in Next.js.",n),this.name="InvariantError"}}})(Fr)),Fr}var Js;function On(){return Js||(Js=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(A,_){for(var p in _)Object.defineProperty(A,p,{enumerable:!0,get:_[p]})}e(s,{getCacheSignal:function(){return y},getDraftModeProviderForCacheScope:function(){return f},getHmrRefreshHash:function(){return l},getPrerenderResumeDataCache:function(){return a},getRenderResumeDataCache:function(){return c},getRuntimeStagePromise:function(){return E},getServerComponentsHmrCache:function(){return h},isHmrRefresh:function(){return d},throwForMissingRequestStore:function(){return i},throwInvariantForMissingStore:function(){return o},workUnitAsyncStorage:function(){return t.workUnitAsyncStorageInstance}});const t=xu(),r=ju(),n=Tn();function i(A){throw Object.defineProperty(new Error(`\`${A}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E251",enumerable:!1,configurable:!0})}function o(){throw Object.defineProperty(new n.InvariantError("Expected workUnitAsyncStorage to have a store."),"__NEXT_ERROR_CODE",{value:"E696",enumerable:!1,configurable:!0})}function a(A){switch(A.type){case"prerender":case"prerender-runtime":case"prerender-ppr":return A.prerenderResumeDataCache;case"prerender-client":return A.prerenderResumeDataCache;case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return null;default:return A}}function c(A){switch(A.type){case"request":return A.renderResumeDataCache;case"prerender":case"prerender-runtime":case"prerender-client":if(A.renderResumeDataCache)return A.renderResumeDataCache;case"prerender-ppr":return A.prerenderResumeDataCache;case"cache":case"private-cache":case"unstable-cache":case"prerender-legacy":return null;default:return A}}function l(A,_){if(A.dev)switch(_.type){case"cache":case"private-cache":case"prerender":case"prerender-runtime":return _.hmrRefreshHash;case"request":var p;return(p=_.cookies.get(r.NEXT_HMR_REFRESH_HASH_COOKIE))==null?void 0:p.value}}function d(A,_){if(A.dev)switch(_.type){case"cache":case"private-cache":case"request":return _.isHmrRefresh??!1}return!1}function h(A,_){if(A.dev)switch(_.type){case"cache":case"private-cache":case"request":return _.serverComponentsHmrCache}}function f(A,_){if(A.isDraftMode)switch(_.type){case"cache":case"private-cache":case"unstable-cache":case"prerender-runtime":case"request":return _.draftMode}}function y(A){switch(A.type){case"prerender":case"prerender-client":case"prerender-runtime":return A.cacheSignal;case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return null;default:return A}}function E(A){switch(A.type){case"prerender-runtime":case"private-cache":return A.runtimeStagePromise;case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"unstable-cache":return null;default:return A}}})(Br)),Br}var Wr={},Ft={exports:{}},K={};/**
42
- * @license React
43
- * react.production.js
44
- *
45
- * Copyright (c) Meta Platforms, Inc. and affiliates.
46
- *
47
- * This source code is licensed under the MIT license found in the
48
- * LICENSE file in the root directory of this source tree.
49
- */var Qs;function Iu(){if(Qs)return K;Qs=1;var s=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator;function f(b){return b===null||typeof b!="object"?null:(b=h&&b[h]||b["@@iterator"],typeof b=="function"?b:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function _(b,k,L){this.props=b,this.context=k,this.refs=A,this.updater=L||y}_.prototype.isReactComponent={},_.prototype.setState=function(b,k){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,k,"setState")},_.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function p(){}p.prototype=_.prototype;function v(b,k,L){this.props=b,this.context=k,this.refs=A,this.updater=L||y}var m=v.prototype=new p;m.constructor=v,E(m,_.prototype),m.isPureReactComponent=!0;var R=Array.isArray,g={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function S(b,k,L,$,F,Z){return L=Z.ref,{$$typeof:s,type:b,key:k,ref:L!==void 0?L:null,props:Z}}function C(b,k){return S(b.type,k,void 0,void 0,void 0,b.props)}function N(b){return typeof b=="object"&&b!==null&&b.$$typeof===s}function V(b){var k={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(L){return k[L]})}var ce=/\/+/g;function ie(b,k){return typeof b=="object"&&b!==null&&b.key!=null?V(""+b.key):k.toString(36)}function de(){}function he(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(de,de):(b.status="pending",b.then(function(k){b.status==="pending"&&(b.status="fulfilled",b.value=k)},function(k){b.status==="pending"&&(b.status="rejected",b.reason=k)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function _e(b,k,L,$,F){var Z=typeof b;(Z==="undefined"||Z==="boolean")&&(b=null);var M=!1;if(b===null)M=!0;else switch(Z){case"bigint":case"string":case"number":M=!0;break;case"object":switch(b.$$typeof){case s:case e:M=!0;break;case d:return M=b._init,_e(M(b._payload),k,L,$,F)}}if(M)return F=F(b),M=$===""?"."+ie(b,0):$,R(F)?(L="",M!=null&&(L=M.replace(ce,"$&/")+"/"),_e(F,k,L,"",function(Ee){return Ee})):F!=null&&(N(F)&&(F=C(F,L+(F.key==null||b&&b.key===F.key?"":(""+F.key).replace(ce,"$&/")+"/")+M)),k.push(F)),1;M=0;var me=$===""?".":$+":";if(R(b))for(var re=0;re<b.length;re++)$=b[re],Z=me+ie($,re),M+=_e($,k,L,Z,F);else if(re=f(b),typeof re=="function")for(b=re.call(b),re=0;!($=b.next()).done;)$=$.value,Z=me+ie($,re++),M+=_e($,k,L,Z,F);else if(Z==="object"){if(typeof b.then=="function")return _e(he(b),k,L,$,F);throw k=String(b),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return M}function le(b,k,L){if(b==null)return b;var $=[],F=0;return _e(b,$,"","",function(Z){return k.call(L,Z,F++)}),$}function fe(b){if(b._status===-1){var k=b._result;k=k(),k.then(function(L){(b._status===0||b._status===-1)&&(b._status=1,b._result=L)},function(L){(b._status===0||b._status===-1)&&(b._status=2,b._result=L)}),b._status===-1&&(b._status=0,b._result=k)}if(b._status===1)return b._result.default;throw b._result}var ae=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)};function X(){}return K.Children={map:le,forEach:function(b,k,L){le(b,function(){k.apply(this,arguments)},L)},count:function(b){var k=0;return le(b,function(){k++}),k},toArray:function(b){return le(b,function(k){return k})||[]},only:function(b){if(!N(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},K.Component=_,K.Fragment=t,K.Profiler=n,K.PureComponent=v,K.StrictMode=r,K.Suspense=c,K.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=g,K.act=function(){throw Error("act(...) is not supported in production builds of React.")},K.cache=function(b){return function(){return b.apply(null,arguments)}},K.cloneElement=function(b,k,L){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var $=E({},b.props),F=b.key,Z=void 0;if(k!=null)for(M in k.ref!==void 0&&(Z=void 0),k.key!==void 0&&(F=""+k.key),k)!O.call(k,M)||M==="key"||M==="__self"||M==="__source"||M==="ref"&&k.ref===void 0||($[M]=k[M]);var M=arguments.length-2;if(M===1)$.children=L;else if(1<M){for(var me=Array(M),re=0;re<M;re++)me[re]=arguments[re+2];$.children=me}return S(b.type,F,void 0,void 0,Z,$)},K.createContext=function(b){return b={$$typeof:o,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:i,_context:b},b},K.createElement=function(b,k,L){var $,F={},Z=null;if(k!=null)for($ in k.key!==void 0&&(Z=""+k.key),k)O.call(k,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(F[$]=k[$]);var M=arguments.length-2;if(M===1)F.children=L;else if(1<M){for(var me=Array(M),re=0;re<M;re++)me[re]=arguments[re+2];F.children=me}if(b&&b.defaultProps)for($ in M=b.defaultProps,M)F[$]===void 0&&(F[$]=M[$]);return S(b,Z,void 0,void 0,null,F)},K.createRef=function(){return{current:null}},K.forwardRef=function(b){return{$$typeof:a,render:b}},K.isValidElement=N,K.lazy=function(b){return{$$typeof:d,_payload:{_status:-1,_result:b},_init:fe}},K.memo=function(b,k){return{$$typeof:l,type:b,compare:k===void 0?null:k}},K.startTransition=function(b){var k=g.T,L={};g.T=L;try{var $=b(),F=g.S;F!==null&&F(L,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(X,ae)}catch(Z){ae(Z)}finally{g.T=k}},K.unstable_useCacheRefresh=function(){return g.H.useCacheRefresh()},K.use=function(b){return g.H.use(b)},K.useActionState=function(b,k,L){return g.H.useActionState(b,k,L)},K.useCallback=function(b,k){return g.H.useCallback(b,k)},K.useContext=function(b){return g.H.useContext(b)},K.useDebugValue=function(){},K.useDeferredValue=function(b,k){return g.H.useDeferredValue(b,k)},K.useEffect=function(b,k){return g.H.useEffect(b,k)},K.useId=function(){return g.H.useId()},K.useImperativeHandle=function(b,k,L){return g.H.useImperativeHandle(b,k,L)},K.useInsertionEffect=function(b,k){return g.H.useInsertionEffect(b,k)},K.useLayoutEffect=function(b,k){return g.H.useLayoutEffect(b,k)},K.useMemo=function(b,k){return g.H.useMemo(b,k)},K.useOptimistic=function(b,k){return g.H.useOptimistic(b,k)},K.useReducer=function(b,k,L){return g.H.useReducer(b,k,L)},K.useRef=function(b){return g.H.useRef(b)},K.useState=function(b){return g.H.useState(b)},K.useSyncExternalStore=function(b,k,L){return g.H.useSyncExternalStore(b,k,L)},K.useTransition=function(){return g.H.useTransition()},K.version="19.0.0",K}var At={exports:{}};/**
50
- * @license React
51
- * react.development.js
52
- *
53
- * Copyright (c) Meta Platforms, Inc. and affiliates.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE file in the root directory of this source tree.
57
- */At.exports;var Zs;function Nu(){return Zs||(Zs=1,(function(s,e){process.env.NODE_ENV!=="production"&&(function(){function t(u,w){Object.defineProperty(i.prototype,u,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",w[0],w[1])}})}function r(u){return u===null||typeof u!="object"?null:(u=I&&u[I]||u["@@iterator"],typeof u=="function"?u:null)}function n(u,w){u=(u=u.constructor)&&(u.displayName||u.name)||"ReactClass";var P=u+"."+w;x[P]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",w,u),x[P]=!0)}function i(u,w,P){this.props=u,this.context=w,this.refs=ge,this.updater=P||W}function o(){}function a(u,w,P){this.props=u,this.context=w,this.refs=ge,this.updater=P||W}function c(u){return""+u}function l(u){try{c(u);var w=!1}catch{w=!0}if(w){w=console;var P=w.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return P.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),c(u)}}function d(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===Ge?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case re:return"Fragment";case me:return"Portal";case xe:return"Profiler";case Ee:return"StrictMode";case Ie:return"Suspense";case Ne:return"SuspenseList"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case Ue:return(u.displayName||"Context")+".Provider";case ke:return(u._context.displayName||"Context")+".Consumer";case je:var w=u.render;return u=u.displayName,u||(u=w.displayName||w.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case Re:return w=u.displayName||null,w!==null?w:d(u.type)||"Memo";case Ce:w=u._payload,u=u._init;try{return d(u(w))}catch{}}return null}function h(u){return typeof u=="string"||typeof u=="function"||u===re||u===xe||u===Ee||u===Ie||u===Ne||u===T||typeof u=="object"&&u!==null&&(u.$$typeof===Ce||u.$$typeof===Re||u.$$typeof===Ue||u.$$typeof===ke||u.$$typeof===je||u.$$typeof===ee||u.getModuleId!==void 0)}function f(){}function y(){if(B===0){ne=console.log,De=console.info,Oe=console.warn,Q=console.error,H=console.group,Pe=console.groupCollapsed,nt=console.groupEnd;var u={configurable:!0,enumerable:!0,value:f,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}B++}function E(){if(B--,B===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:oe({},u,{value:ne}),info:oe({},u,{value:De}),warn:oe({},u,{value:Oe}),error:oe({},u,{value:Q}),group:oe({},u,{value:H}),groupCollapsed:oe({},u,{value:Pe}),groupEnd:oe({},u,{value:nt})})}0>B&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function A(u){if(st===void 0)try{throw Error()}catch(P){var w=P.stack.trim().match(/\n( *(at )?)/);st=w&&w[1]||"",Cn=-1<P.stack.indexOf(`
58
- at`)?" (<anonymous>)":-1<P.stack.indexOf("@")?"@unknown:0:0":""}return`
59
- `+st+u+Cn}function _(u,w){if(!u||Zt)return"";var P=er.get(u);if(P!==void 0)return P;Zt=!0,P=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var j=null;j=G.H,G.H=null,y();try{var D={DetermineComponentFrameRoot:function(){try{if(w){var Me=function(){throw Error()};if(Object.defineProperty(Me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Me,[])}catch(Be){var Dt=Be}Reflect.construct(u,[],Me)}else{try{Me.call()}catch(Be){Dt=Be}u.call(Me.prototype)}}else{try{throw Error()}catch(Be){Dt=Be}(Me=u())&&typeof Me.catch=="function"&&Me.catch(function(){})}}catch(Be){if(Be&&Dt&&typeof Be.stack=="string")return[Be.stack,Dt.stack]}return[null,null]}};D.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var q=Object.getOwnPropertyDescriptor(D.DetermineComponentFrameRoot,"name");q&&q.configurable&&Object.defineProperty(D.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var U=D.DetermineComponentFrameRoot(),se=U[0],te=U[1];if(se&&te){var pe=se.split(`
60
- `),Se=te.split(`
61
- `);for(U=q=0;q<pe.length&&!pe[q].includes("DetermineComponentFrameRoot");)q++;for(;U<Se.length&&!Se[U].includes("DetermineComponentFrameRoot");)U++;if(q===pe.length||U===Se.length)for(q=pe.length-1,U=Se.length-1;1<=q&&0<=U&&pe[q]!==Se[U];)U--;for(;1<=q&&0<=U;q--,U--)if(pe[q]!==Se[U]){if(q!==1||U!==1)do if(q--,U--,0>U||pe[q]!==Se[U]){var Ve=`
62
- `+pe[q].replace(" at new "," at ");return u.displayName&&Ve.includes("<anonymous>")&&(Ve=Ve.replace("<anonymous>",u.displayName)),typeof u=="function"&&er.set(u,Ve),Ve}while(1<=q&&0<=U);break}}}finally{Zt=!1,G.H=j,E(),Error.prepareStackTrace=P}return pe=(pe=u?u.displayName||u.name:"")?A(pe):"",typeof u=="function"&&er.set(u,pe),pe}function p(u){if(u==null)return"";if(typeof u=="function"){var w=u.prototype;return _(u,!(!w||!w.isReactComponent))}if(typeof u=="string")return A(u);switch(u){case Ie:return A("Suspense");case Ne:return A("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case je:return u=_(u.render,!1),u;case Re:return p(u.type);case Ce:w=u._payload,u=u._init;try{return p(u(w))}catch{}}return""}function v(){var u=G.A;return u===null?null:u.getOwner()}function m(u){if(Y.call(u,"key")){var w=Object.getOwnPropertyDescriptor(u,"key").get;if(w&&w.isReactWarning)return!1}return u.key!==void 0}function R(u,w){function P(){xn||(xn=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",w))}P.isReactWarning=!0,Object.defineProperty(u,"key",{get:P,configurable:!0})}function g(){var u=d(this.type);return In[u]||(In[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function O(u,w,P,j,D,q){return P=q.ref,u={$$typeof:M,type:u,key:w,props:q,_owner:D},(P!==void 0?P:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:g}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function S(u,w){return w=O(u.type,w,void 0,void 0,u._owner,u.props),w._store.validated=u._store.validated,w}function C(u,w){if(typeof u=="object"&&u&&u.$$typeof!==Ki){if(we(u))for(var P=0;P<u.length;P++){var j=u[P];N(j)&&V(j,w)}else if(N(u))u._store&&(u._store.validated=1);else if(P=r(u),typeof P=="function"&&P!==u.entries&&(P=P.call(u),P!==u))for(;!(u=P.next()).done;)N(u.value)&&V(u.value,w)}}function N(u){return typeof u=="object"&&u!==null&&u.$$typeof===M}function V(u,w){if(u._store&&!u._store.validated&&u.key==null&&(u._store.validated=1,w=ce(w),!Nn[w])){Nn[w]=!0;var P="";u&&u._owner!=null&&u._owner!==v()&&(P=null,typeof u._owner.tag=="number"?P=d(u._owner.type):typeof u._owner.name=="string"&&(P=u._owner.name),P=" It was passed a child from "+P+".");var j=G.getCurrentStack;G.getCurrentStack=function(){var D=p(u.type);return j&&(D+=j()||""),D},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',w,P),G.getCurrentStack=j}}function ce(u){var w="",P=v();return P&&(P=d(P.type))&&(w=`
63
-
64
- Check the render method of \``+P+"`."),w||(u=d(u))&&(w=`
65
-
66
- Check the top-level render call using <`+u+">."),w}function ie(u){var w={"=":"=0",":":"=2"};return"$"+u.replace(/[=:]/g,function(P){return w[P]})}function de(u,w){return typeof u=="object"&&u!==null&&u.key!=null?(l(u.key),ie(""+u.key)):w.toString(36)}function he(){}function _e(u){switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:switch(typeof u.status=="string"?u.then(he,he):(u.status="pending",u.then(function(w){u.status==="pending"&&(u.status="fulfilled",u.value=w)},function(w){u.status==="pending"&&(u.status="rejected",u.reason=w)})),u.status){case"fulfilled":return u.value;case"rejected":throw u.reason}}throw u}function le(u,w,P,j,D){var q=typeof u;(q==="undefined"||q==="boolean")&&(u=null);var U=!1;if(u===null)U=!0;else switch(q){case"bigint":case"string":case"number":U=!0;break;case"object":switch(u.$$typeof){case M:case me:U=!0;break;case Ce:return U=u._init,le(U(u._payload),w,P,j,D)}}if(U){U=u,D=D(U);var se=j===""?"."+de(U,0):j;return we(D)?(P="",se!=null&&(P=se.replace(Ln,"$&/")+"/"),le(D,w,P,"",function(pe){return pe})):D!=null&&(N(D)&&(D.key!=null&&(U&&U.key===D.key||l(D.key)),P=S(D,P+(D.key==null||U&&U.key===D.key?"":(""+D.key).replace(Ln,"$&/")+"/")+se),j!==""&&U!=null&&N(U)&&U.key==null&&U._store&&!U._store.validated&&(P._store.validated=2),D=P),w.push(D)),1}if(U=0,se=j===""?".":j+":",we(u))for(var te=0;te<u.length;te++)j=u[te],q=se+de(j,te),U+=le(j,w,P,q,D);else if(te=r(u),typeof te=="function")for(te===u.entries&&(Dn||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Dn=!0),u=te.call(u),te=0;!(j=u.next()).done;)j=j.value,q=se+de(j,te++),U+=le(j,w,P,q,D);else if(q==="object"){if(typeof u.then=="function")return le(_e(u),w,P,j,D);throw w=String(u),Error("Objects are not valid as a React child (found: "+(w==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":w)+"). If you meant to render a collection of children, use an array instead.")}return U}function fe(u,w,P){if(u==null)return u;var j=[],D=0;return le(u,j,"","",function(q){return w.call(P,q,D++)}),j}function ae(u){if(u._status===-1){var w=u._result;w=w(),w.then(function(P){(u._status===0||u._status===-1)&&(u._status=1,u._result=P)},function(P){(u._status===0||u._status===-1)&&(u._status=2,u._result=P)}),u._status===-1&&(u._status=0,u._result=w)}if(u._status===1)return w=u._result,w===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
67
-
68
- Your code should look like:
69
- const MyComponent = lazy(() => import('./MyComponent'))
70
-
71
- Did you accidentally put curly braces around the import?`,w),"default"in w||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
72
-
73
- Your code should look like:
74
- const MyComponent = lazy(() => import('./MyComponent'))`,w),w.default;throw u._result}function X(){var u=G.H;return u===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
75
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
76
- 2. You might be breaking the Rules of Hooks
77
- 3. You might have more than one copy of React in the same app
78
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),u}function b(){}function k(u){if(jt===null)try{var w=("require"+Math.random()).slice(0,7);jt=(s&&s[w]).call(s,"timers").setImmediate}catch{jt=function(j){Un===!1&&(Un=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var D=new MessageChannel;D.port1.onmessage=j,D.port2.postMessage(void 0)}}return jt(u)}function L(u){return 1<u.length&&typeof AggregateError=="function"?new AggregateError(u):u[0]}function $(u,w){w!==It-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),It=w}function F(u,w,P){var j=G.actQueue;if(j!==null)if(j.length!==0)try{Z(j),k(function(){return F(u,w,P)});return}catch(D){G.thrownErrors.push(D)}else G.actQueue=null;0<G.thrownErrors.length?(j=L(G.thrownErrors),G.thrownErrors.length=0,P(j)):w(u)}function Z(u){if(!tr){tr=!0;var w=0;try{for(;w<u.length;w++){var P=u[w];do{G.didUsePromise=!1;var j=P(!1);if(j!==null){if(G.didUsePromise){u[w]=P,u.splice(0,w);return}P=j}else break}while(!0)}u.length=0}catch(D){u.splice(0,w+1),G.thrownErrors.push(D)}finally{tr=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var M=Symbol.for("react.transitional.element"),me=Symbol.for("react.portal"),re=Symbol.for("react.fragment"),Ee=Symbol.for("react.strict_mode"),xe=Symbol.for("react.profiler"),ke=Symbol.for("react.consumer"),Ue=Symbol.for("react.context"),je=Symbol.for("react.forward_ref"),Ie=Symbol.for("react.suspense"),Ne=Symbol.for("react.suspense_list"),Re=Symbol.for("react.memo"),Ce=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),I=Symbol.iterator,x={},W={isMounted:function(){return!1},enqueueForceUpdate:function(u){n(u,"forceUpdate")},enqueueReplaceState:function(u){n(u,"replaceState")},enqueueSetState:function(u){n(u,"setState")}},oe=Object.assign,ge={};Object.freeze(ge),i.prototype.isReactComponent={},i.prototype.setState=function(u,w){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,w,"setState")},i.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};var Te={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},qe;for(qe in Te)Te.hasOwnProperty(qe)&&t(qe,Te[qe]);o.prototype=i.prototype,Te=a.prototype=new o,Te.constructor=a,oe(Te,i.prototype),Te.isPureReactComponent=!0;var we=Array.isArray,Ge=Symbol.for("react.client.reference"),G={H:null,A:null,T:null,S:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null},Y=Object.prototype.hasOwnProperty,ee=Symbol.for("react.client.reference"),B=0,ne,De,Oe,Q,H,Pe,nt;f.__reactDisabledLog=!0;var st,Cn,Zt=!1,er=new(typeof WeakMap=="function"?WeakMap:Map),Ki=Symbol.for("react.client.reference"),xn,jn,In={},Nn={},Dn=!1,Ln=/\/+/g,$n=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var w=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(w))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},Un=!1,jt=null,It=0,Nt=!1,tr=!1,qn=typeof queueMicrotask=="function"?function(u){queueMicrotask(function(){return queueMicrotask(u)})}:k;e.Children={map:fe,forEach:function(u,w,P){fe(u,function(){w.apply(this,arguments)},P)},count:function(u){var w=0;return fe(u,function(){w++}),w},toArray:function(u){return fe(u,function(w){return w})||[]},only:function(u){if(!N(u))throw Error("React.Children.only expected to receive a single React element child.");return u}},e.Component=i,e.Fragment=re,e.Profiler=xe,e.PureComponent=a,e.StrictMode=Ee,e.Suspense=Ie,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,e.act=function(u){var w=G.actQueue,P=It;It++;var j=G.actQueue=w!==null?w:[],D=!1;try{var q=u()}catch(te){G.thrownErrors.push(te)}if(0<G.thrownErrors.length)throw $(w,P),u=L(G.thrownErrors),G.thrownErrors.length=0,u;if(q!==null&&typeof q=="object"&&typeof q.then=="function"){var U=q;return qn(function(){D||Nt||(Nt=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(te,pe){D=!0,U.then(function(Se){if($(w,P),P===0){try{Z(j),k(function(){return F(Se,te,pe)})}catch(Me){G.thrownErrors.push(Me)}if(0<G.thrownErrors.length){var Ve=L(G.thrownErrors);G.thrownErrors.length=0,pe(Ve)}}else te(Se)},function(Se){$(w,P),0<G.thrownErrors.length&&(Se=L(G.thrownErrors),G.thrownErrors.length=0),pe(Se)})}}}var se=q;if($(w,P),P===0&&(Z(j),j.length!==0&&qn(function(){D||Nt||(Nt=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),G.actQueue=null),0<G.thrownErrors.length)throw u=L(G.thrownErrors),G.thrownErrors.length=0,u;return{then:function(te,pe){D=!0,P===0?(G.actQueue=j,k(function(){return F(se,te,pe)})):te(se)}}},e.cache=function(u){return function(){return u.apply(null,arguments)}},e.cloneElement=function(u,w,P){if(u==null)throw Error("The argument must be a React element, but you passed "+u+".");var j=oe({},u.props),D=u.key,q=u._owner;if(w!=null){var U;e:{if(Y.call(w,"ref")&&(U=Object.getOwnPropertyDescriptor(w,"ref").get)&&U.isReactWarning){U=!1;break e}U=w.ref!==void 0}U&&(q=v()),m(w)&&(l(w.key),D=""+w.key);for(se in w)!Y.call(w,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&w.ref===void 0||(j[se]=w[se])}var se=arguments.length-2;if(se===1)j.children=P;else if(1<se){U=Array(se);for(var te=0;te<se;te++)U[te]=arguments[te+2];j.children=U}for(j=O(u.type,D,void 0,void 0,q,j),D=2;D<arguments.length;D++)C(arguments[D],j.type);return j},e.createContext=function(u){return u={$$typeof:Ue,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null},u.Provider=u,u.Consumer={$$typeof:ke,_context:u},u._currentRenderer=null,u._currentRenderer2=null,u},e.createElement=function(u,w,P){if(h(u))for(var j=2;j<arguments.length;j++)C(arguments[j],u);else{if(j="",(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),u===null)var D="null";else we(u)?D="array":u!==void 0&&u.$$typeof===M?(D="<"+(d(u.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):D=typeof u;console.error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,j)}var q;if(j={},D=null,w!=null)for(q in jn||!("__self"in w)||"key"in w||(jn=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),m(w)&&(l(w.key),D=""+w.key),w)Y.call(w,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(j[q]=w[q]);var U=arguments.length-2;if(U===1)j.children=P;else if(1<U){for(var se=Array(U),te=0;te<U;te++)se[te]=arguments[te+2];Object.freeze&&Object.freeze(se),j.children=se}if(u&&u.defaultProps)for(q in U=u.defaultProps,U)j[q]===void 0&&(j[q]=U[q]);return D&&R(j,typeof u=="function"?u.displayName||u.name||"Unknown":u),O(u,D,void 0,void 0,v(),j)},e.createRef=function(){var u={current:null};return Object.seal(u),u},e.forwardRef=function(u){u!=null&&u.$$typeof===Re?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof u!="function"?console.error("forwardRef requires a render function but was given %s.",u===null?"null":typeof u):u.length!==0&&u.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",u.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),u!=null&&u.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var w={$$typeof:je,render:u},P;return Object.defineProperty(w,"displayName",{enumerable:!1,configurable:!0,get:function(){return P},set:function(j){P=j,u.name||u.displayName||(Object.defineProperty(u,"name",{value:j}),u.displayName=j)}}),w},e.isValidElement=N,e.lazy=function(u){return{$$typeof:Ce,_payload:{_status:-1,_result:u},_init:ae}},e.memo=function(u,w){h(u)||console.error("memo: The first argument must be a component. Instead received: %s",u===null?"null":typeof u),w={$$typeof:Re,type:u,compare:w===void 0?null:w};var P;return Object.defineProperty(w,"displayName",{enumerable:!1,configurable:!0,get:function(){return P},set:function(j){P=j,u.name||u.displayName||(Object.defineProperty(u,"name",{value:j}),u.displayName=j)}}),w},e.startTransition=function(u){var w=G.T,P={};G.T=P,P._updatedFibers=new Set;try{var j=u(),D=G.S;D!==null&&D(P,j),typeof j=="object"&&j!==null&&typeof j.then=="function"&&j.then(b,$n)}catch(q){$n(q)}finally{w===null&&P._updatedFibers&&(u=P._updatedFibers.size,P._updatedFibers.clear(),10<u&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),G.T=w}},e.unstable_useCacheRefresh=function(){return X().useCacheRefresh()},e.use=function(u){return X().use(u)},e.useActionState=function(u,w,P){return X().useActionState(u,w,P)},e.useCallback=function(u,w){return X().useCallback(u,w)},e.useContext=function(u){var w=X();return u.$$typeof===ke&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),w.useContext(u)},e.useDebugValue=function(u,w){return X().useDebugValue(u,w)},e.useDeferredValue=function(u,w){return X().useDeferredValue(u,w)},e.useEffect=function(u,w){return X().useEffect(u,w)},e.useId=function(){return X().useId()},e.useImperativeHandle=function(u,w,P){return X().useImperativeHandle(u,w,P)},e.useInsertionEffect=function(u,w){return X().useInsertionEffect(u,w)},e.useLayoutEffect=function(u,w){return X().useLayoutEffect(u,w)},e.useMemo=function(u,w){return X().useMemo(u,w)},e.useOptimistic=function(u,w){return X().useOptimistic(u,w)},e.useReducer=function(u,w,P){return X().useReducer(u,w,P)},e.useRef=function(u){return X().useRef(u)},e.useState=function(u){return X().useState(u)},e.useSyncExternalStore=function(u,w,P){return X().useSyncExternalStore(u,w,P)},e.useTransition=function(){return X().useTransition()},e.version="19.0.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(At,At.exports)),At.exports}var ei;function Du(){return ei||(ei=1,process.env.NODE_ENV==="production"?Ft.exports=Iu():Ft.exports=Nu()),Ft.exports}var Wt={exports:{}},ti;function Lu(){return ti||(ti=1,(function(s,e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,a){for(var c in a)Object.defineProperty(o,c,{enumerable:!0,get:a[c]})}t(e,{DynamicServerError:function(){return n},isDynamicServerError:function(){return i}});const r="DYNAMIC_SERVER_USAGE";class n extends Error{constructor(a){super("Dynamic server usage: "+a),this.description=a,this.digest=r}}function i(o){return typeof o!="object"||o===null||!("digest"in o)||typeof o.digest!="string"?!1:o.digest===r}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),s.exports=e.default)})(Wt,Wt.exports)),Wt.exports}var Gt={exports:{}},ri;function Pn(){return ri||(ri=1,(function(s,e){Object.defineProperty(e,"__esModule",{value:!0});function t(o,a){for(var c in a)Object.defineProperty(o,c,{enumerable:!0,get:a[c]})}t(e,{StaticGenBailoutError:function(){return n},isStaticGenBailoutError:function(){return i}});const r="NEXT_STATIC_GEN_BAILOUT";class n extends Error{constructor(...a){super(...a),this.code=r}}function i(o){return typeof o!="object"||o===null||!("code"in o)?!1:o.code===r}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),s.exports=e.default)})(Gt,Gt.exports)),Gt.exports}var Gr={},ni;function kn(){return ni||(ni=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(l,d){for(var h in d)Object.defineProperty(l,h,{enumerable:!0,get:d[h]})}e(s,{isHangingPromiseRejectionError:function(){return t},makeDevtoolsIOAwarePromise:function(){return c},makeHangingPromise:function(){return o}});function t(l){return typeof l!="object"||l===null||!("digest"in l)?!1:l.digest===r}const r="HANGING_PROMISE_REJECTION";class n extends Error{constructor(d,h){super(`During prerendering, ${h} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${h} 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 "${d}".`),this.route=d,this.expression=h,this.digest=r}}const i=new WeakMap;function o(l,d,h){if(l.aborted)return Promise.reject(new n(d,h));{const f=new Promise((y,E)=>{const A=E.bind(null,new n(d,h));let _=i.get(l);if(_)_.push(A);else{const p=[A];i.set(l,p),l.addEventListener("abort",()=>{for(let v=0;v<p.length;v++)p[v]()},{once:!0})}});return f.catch(a),f}}function a(){}function c(l){return new Promise(d=>{setTimeout(()=>{d(l)},0)})}})(Gr)),Gr}var zr={},si;function $u(){return si||(si=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(o,a){for(var c in a)Object.defineProperty(o,c,{enumerable:!0,get:a[c]})}e(s,{METADATA_BOUNDARY_NAME:function(){return t},OUTLET_BOUNDARY_NAME:function(){return n},ROOT_LAYOUT_BOUNDARY_NAME:function(){return i},VIEWPORT_BOUNDARY_NAME:function(){return r}});const t="__next_metadata_boundary__",r="__next_viewport_boundary__",n="__next_outlet_boundary__",i="__next_root_layout_boundary__"})(zr)),zr}var Xr={},ii;function Uu(){return ii||(ii=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(o,a){for(var c in a)Object.defineProperty(o,c,{enumerable:!0,get:a[c]})}e(s,{atLeastOneTask:function(){return n},scheduleImmediate:function(){return r},scheduleOnNextTick:function(){return t},waitAtLeastOneReactRenderTask:function(){return i}});const t=o=>{Promise.resolve().then(()=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(o,0):process.nextTick(o)})},r=o=>{process.env.NEXT_RUNTIME==="edge"?setTimeout(o,0):setImmediate(o)};function n(){return new Promise(o=>r(o))}function i(){return process.env.NEXT_RUNTIME==="edge"?new Promise(o=>setTimeout(o,0)):new Promise(o=>setImmediate(o))}})(Xr)),Xr}var Kr={},oi;function qu(){return oi||(oi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(i,o){for(var a in o)Object.defineProperty(i,a,{enumerable:!0,get:o[a]})}e(s,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return n}});const t="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(o){super("Bail out to client-side rendering: "+o),this.reason=o,this.digest=t}}function n(i){return typeof i!="object"||i===null||!("digest"in i)?!1:i.digest===t}})(Kr)),Kr}var ai;function Xi(){return ai||(ai=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(T,I){for(var x in I)Object.defineProperty(T,x,{enumerable:!0,get:I[x]})}e(s,{Postpone:function(){return V},PreludeState:function(){return Ie},abortAndThrowOnSynchronousRequestDataAccess:function(){return S},abortOnSynchronousPlatformIOAccess:function(){return g},accessedDynamicData:function(){return ae},annotateDynamicAccess:function(){return F},consumeDynamicAccess:function(){return X},createDynamicTrackingState:function(){return E},createDynamicValidationState:function(){return A},createHangingInputAbortSignal:function(){return $},createRenderInBrowserAbortSignal:function(){return L},delayUntilRuntimeStage:function(){return Ce},formatDynamicAPIAccesses:function(){return b},getFirstDynamicReason:function(){return _},isDynamicPostpone:function(){return de},isPrerenderInterruptedError:function(){return fe},logDisallowedDynamicError:function(){return Ne},markCurrentScopeAsDynamic:function(){return p},postponeWithTracking:function(){return ce},throwIfDisallowedDynamic:function(){return Re},throwToInterruptStaticGeneration:function(){return v},trackAllowedDynamicAccess:function(){return Ue},trackDynamicDataInDynamicRender:function(){return m},trackSynchronousPlatformIOAccessInDev:function(){return O},trackSynchronousRequestDataAccessInDev:function(){return N},useDynamicRouteParams:function(){return Z},warnOnSyncDynamicError:function(){return C}});const t=f(Du()),r=Lu(),n=Pn(),i=On(),o=Qt(),a=kn(),c=$u(),l=Uu(),d=qu(),h=Tn();function f(T){return T&&T.__esModule?T:{default:T}}const y=typeof t.default.unstable_postpone=="function";function E(T){return{isDebugDynamicAccesses:T,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function A(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function _(T){var I;return(I=T.dynamicAccesses[0])==null?void 0:I.expression}function p(T,I,x){if(I)switch(I.type){case"cache":case"unstable-cache":return;case"private-cache":return}if(!(T.forceDynamic||T.forceStatic)){if(T.dynamicShouldError)throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${T.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${x}\`. 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(I)switch(I.type){case"prerender-ppr":return ce(T.route,x,I.dynamicTracking);case"prerender-legacy":I.revalidate=0;const W=Object.defineProperty(new r.DynamicServerError(`Route ${T.route} couldn't be rendered statically because it used ${x}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw T.dynamicUsageDescription=x,T.dynamicUsageStack=W.stack,W;case"request":process.env.NODE_ENV!=="production"&&(I.usedDynamic=!0);break}}}function v(T,I,x){const W=Object.defineProperty(new r.DynamicServerError(`Route ${I.route} couldn't be rendered statically because it used \`${T}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw x.revalidate=0,I.dynamicUsageDescription=T,I.dynamicUsageStack=W.stack,W}function m(T){switch(T.type){case"cache":case"unstable-cache":return;case"private-cache":return;case"prerender":case"prerender-runtime":case"prerender-legacy":case"prerender-ppr":case"prerender-client":break;case"request":process.env.NODE_ENV!=="production"&&(T.usedDynamic=!0);break}}function R(T,I,x){const W=`Route ${T} needs to bail out of prerendering at this point because it used ${I}.`,oe=le(W);x.controller.abort(oe);const ge=x.dynamicTracking;ge&&ge.dynamicAccesses.push({stack:ge.isDebugDynamicAccesses?new Error().stack:void 0,expression:I})}function g(T,I,x,W){const oe=W.dynamicTracking;R(T,I,W),oe&&oe.syncDynamicErrorWithStack===null&&(oe.syncDynamicErrorWithStack=x)}function O(T){T.prerenderPhase=!1}function S(T,I,x,W){if(W.controller.signal.aborted===!1){R(T,I,W);const ge=W.dynamicTracking;ge&&ge.syncDynamicErrorWithStack===null&&(ge.syncDynamicErrorWithStack=x)}throw le(`Route ${T} needs to bail out of prerendering at this point because it used ${I}.`)}function C(T){T.syncDynamicErrorWithStack&&console.error(T.syncDynamicErrorWithStack)}const N=O;function V({reason:T,route:I}){const x=i.workUnitAsyncStorage.getStore(),W=x&&x.type==="prerender-ppr"?x.dynamicTracking:null;ce(I,T,W)}function ce(T,I,x){k(),x&&x.dynamicAccesses.push({stack:x.isDebugDynamicAccesses?new Error().stack:void 0,expression:I}),t.default.unstable_postpone(ie(T,I))}function ie(T,I){return`Route ${T} needs to bail out of prerendering at this point because it used ${I}. 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 de(T){return typeof T=="object"&&T!==null&&typeof T.message=="string"?he(T.message):!1}function he(T){return T.includes("needs to bail out of prerendering at this point because it used")&&T.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(he(ie("%%%","^^^"))===!1)throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});const _e="NEXT_PRERENDER_INTERRUPTED";function le(T){const I=Object.defineProperty(new Error(T),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return I.digest=_e,I}function fe(T){return typeof T=="object"&&T!==null&&T.digest===_e&&"name"in T&&"message"in T&&T instanceof Error}function ae(T){return T.length>0}function X(T,I){return T.dynamicAccesses.push(...I.dynamicAccesses),T.dynamicAccesses}function b(T){return T.filter(I=>typeof I.stack=="string"&&I.stack.length>0).map(({expression:I,stack:x})=>(x=x.split(`
79
- `).slice(4).filter(W=>!(W.includes("node_modules/next/")||W.includes(" (<anonymous>)")||W.includes(" (node:"))).join(`
80
- `),`Dynamic API Usage Debug - ${I}:
81
- ${x}`))}function k(){if(!y)throw Object.defineProperty(new 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})}function L(){const T=new AbortController;return T.abort(Object.defineProperty(new d.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),T.signal}function $(T){switch(T.type){case"prerender":case"prerender-runtime":const I=new AbortController;if(T.cacheSignal)T.cacheSignal.inputReady().then(()=>{I.abort()});else{const x=(0,i.getRuntimeStagePromise)(T);x?x.then(()=>(0,l.scheduleOnNextTick)(()=>I.abort())):(0,l.scheduleOnNextTick)(()=>I.abort())}return I.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function F(T,I){const x=I.dynamicTracking;x&&x.dynamicAccesses.push({stack:x.isDebugDynamicAccesses?new Error().stack:void 0,expression:T})}function Z(T){const I=o.workAsyncStorage.getStore(),x=i.workUnitAsyncStorage.getStore();if(I&&x)switch(x.type){case"prerender-client":case"prerender":{const W=x.fallbackRouteParams;W&&W.size>0&&t.default.use((0,a.makeHangingPromise)(x.renderSignal,I.route,T));break}case"prerender-ppr":{const W=x.fallbackRouteParams;if(W&&W.size>0)return ce(I.route,T,x.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new h.InvariantError(`\`${T}\` was called during a runtime prerender. Next.js should be preventing ${T} 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 h.InvariantError(`\`${T}\` was called inside a cache scope. Next.js should be preventing ${T} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}const M=/\n\s+at Suspense \(<anonymous>\)/,me="body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6",re=new RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:${me}) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${c.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),Ee=new RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`),xe=new RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),ke=new RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function Ue(T,I,x,W){if(!ke.test(I))if(Ee.test(I)){x.hasDynamicMetadata=!0;return}else if(xe.test(I)){x.hasDynamicViewport=!0;return}else if(re.test(I)){x.hasAllowedDynamic=!0,x.hasSuspenseAboveBody=!0;return}else if(M.test(I)){x.hasAllowedDynamic=!0;return}else if(W.syncDynamicErrorWithStack){x.dynamicErrors.push(W.syncDynamicErrorWithStack);return}else{const oe=`Route "${T.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`,ge=je(oe,I);x.dynamicErrors.push(ge);return}}function je(T,I){const x=process.env.NODE_ENV!=="production"&&t.default.captureOwnerStack?t.default.captureOwnerStack():null,W=Object.defineProperty(new Error(T),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return W.stack=W.name+": "+T+(x??I),W}var Ie=(function(T){return T[T.Full=0]="Full",T[T.Empty=1]="Empty",T[T.Errored=2]="Errored",T})({});function Ne(T,I){console.error(I),T.dev||(T.hasReadableErrorStacks?console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${T.route}" in your browser to investigate the error.`):console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
82
- - Start the app in development mode by running \`next dev\`, then open "${T.route}" in your browser to investigate the error.
83
- - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function Re(T,I,x,W){if(I!==0){if(x.hasSuspenseAboveBody)return;if(W.syncDynamicErrorWithStack)throw Ne(T,W.syncDynamicErrorWithStack),new n.StaticGenBailoutError;const oe=x.dynamicErrors;if(oe.length>0){for(let ge=0;ge<oe.length;ge++)Ne(T,oe[ge]);throw new n.StaticGenBailoutError}if(x.hasDynamicViewport)throw console.error(`Route "${T.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 n.StaticGenBailoutError;if(I===1)throw console.error(`Route "${T.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new n.StaticGenBailoutError}else if(x.hasAllowedDynamic===!1&&x.hasDynamicMetadata)throw console.error(`Route "${T.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 n.StaticGenBailoutError}function Ce(T,I){return T.runtimeStagePromise?T.runtimeStagePromise.then(()=>I):I}})(Wr)),Wr}var Yr={},Vr={},Jr={},ui;function Mu(){return ui||(ui=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"afterTaskAsyncStorageInstance",{enumerable:!0,get:function(){return t}});const t=(0,Jt().createAsyncLocalStorage)()})(Jr)),Jr}var ci;function Bu(){return ci||(ci=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"afterTaskAsyncStorage",{enumerable:!0,get:function(){return e.afterTaskAsyncStorageInstance}});const e=Mu()})(Vr)),Vr}var li;function Hu(){return li||(li=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(c,l){for(var d in l)Object.defineProperty(c,d,{enumerable:!0,get:l[d]})}e(s,{isRequestAPICallableInsideAfter:function(){return a},throwForSearchParamsAccessInUseCache:function(){return o},throwWithStaticGenerationBailoutError:function(){return n},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return i}});const t=Pn(),r=Bu();function n(c,l){throw Object.defineProperty(new t.StaticGenBailoutError(`Route ${c} couldn't be rendered statically because it used ${l}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function i(c,l){throw Object.defineProperty(new t.StaticGenBailoutError(`Route ${c} with \`dynamic = "error"\` couldn't be rendered statically because it used ${l}. 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 o(c,l){const d=Object.defineProperty(new Error(`Route ${c.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:"E779",enumerable:!1,configurable:!0});throw Error.captureStackTrace(d,l),c.invalidDynamicUsageError??(c.invalidDynamicUsageError=d),d}function a(){const c=r.afterTaskAsyncStorage.getStore();return(c==null?void 0:c.rootTaskSpawnPhase)==="action"}})(Yr)),Yr}var di;function Fu(){return di||(di=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"connection",{enumerable:!0,get:function(){return a}});const e=Qt(),t=On(),r=Xi(),n=Pn(),i=kn(),o=Hu();function a(){const c="connection",l=e.workAsyncStorage.getStore(),d=t.workUnitAsyncStorage.getStore();if(l){if(d&&d.phase==="after"&&!(0,o.isRequestAPICallableInsideAfter)())throw Object.defineProperty(new Error(`Route ${l.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(l.forceStatic)return Promise.resolve(void 0);if(l.dynamicShouldError)throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${l.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(d)switch(d.type){case"cache":{const h=Object.defineProperty(new Error(`Route ${l.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E752",enumerable:!1,configurable:!0});throw Error.captureStackTrace(h,a),l.invalidDynamicUsageError??(l.invalidDynamicUsageError=h),h}case"private-cache":{const h=Object.defineProperty(new Error(`Route ${l.route} used "connection" inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E753",enumerable:!1,configurable:!0});throw Error.captureStackTrace(h,a),l.invalidDynamicUsageError??(l.invalidDynamicUsageError=h),h}case"unstable-cache":throw Object.defineProperty(new Error(`Route ${l.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,i.makeHangingPromise)(d.renderSignal,l.route,"`connection()`");case"prerender-ppr":return(0,r.postponeWithTracking)(l.route,"connection",d.dynamicTracking);case"prerender-legacy":return(0,r.throwToInterruptStaticGeneration)("connection",l,d);case"request":return(0,r.trackDynamicDataInDynamicRender)(d),process.env.NODE_ENV==="development"?(0,i.makeDevtoolsIOAwarePromise)(void 0):Promise.resolve(void 0)}}(0,t.throwForMissingRequestStore)(c)}})(Mr)),Mr}var Qr={},Zr={},hi;function Wu(){return hi||(hi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(o,a){for(var c in a)Object.defineProperty(o,c,{enumerable:!0,get:a[c]})}e(s,{describeHasCheckingStringProperty:function(){return n},describeStringPropertyAccess:function(){return r},wellKnownProperties:function(){return i}});const t=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function r(o,a){return t.test(a)?"`"+o+"."+a+"`":"`"+o+"["+JSON.stringify(a)+"]`"}function n(o,a){const c=JSON.stringify(a);return"`Reflect.has("+o+", "+c+")`, `"+c+" in "+o+"`, or similar"}const i=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule"])})(Zr)),Zr}var en={},tn={},fi;function Gu(){return fi||(fi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"actionAsyncStorageInstance",{enumerable:!0,get:function(){return t}});const t=(0,Jt().createAsyncLocalStorage)()})(tn)),tn}var pi;function zu(){return pi||(pi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"actionAsyncStorage",{enumerable:!0,get:function(){return e.actionAsyncStorageInstance}});const e=Gu()})(en)),en}var rn={},nn={},gi;function Xu(){return gi||(gi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(ae,X){for(var b in X)Object.defineProperty(ae,b,{enumerable:!0,get:X[b]})}e(s,{bgBlack:function(){return V},bgBlue:function(){return he},bgCyan:function(){return le},bgGreen:function(){return ie},bgMagenta:function(){return _e},bgRed:function(){return ce},bgWhite:function(){return fe},bgYellow:function(){return de},black:function(){return _},blue:function(){return R},bold:function(){return l},cyan:function(){return S},dim:function(){return d},gray:function(){return N},green:function(){return v},hidden:function(){return E},inverse:function(){return y},italic:function(){return h},magenta:function(){return g},purple:function(){return O},red:function(){return p},reset:function(){return c},strikethrough:function(){return A},underline:function(){return f},white:function(){return C},yellow:function(){return m}});var t;const{env:r,stdout:n}=((t=globalThis)==null?void 0:t.process)??{},i=r&&!r.NO_COLOR&&(r.FORCE_COLOR||(n==null?void 0:n.isTTY)&&!r.CI&&r.TERM!=="dumb"),o=(ae,X,b,k)=>{const L=ae.substring(0,k)+b,$=ae.substring(k+X.length),F=$.indexOf(X);return~F?L+o($,X,b,F):L+$},a=(ae,X,b=ae)=>i?k=>{const L=""+k,$=L.indexOf(X,ae.length);return~$?ae+o(L,X,b,$)+X:ae+L+X}:String,c=i?ae=>`\x1B[0m${ae}\x1B[0m`:String,l=a("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),d=a("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),h=a("\x1B[3m","\x1B[23m"),f=a("\x1B[4m","\x1B[24m"),y=a("\x1B[7m","\x1B[27m"),E=a("\x1B[8m","\x1B[28m"),A=a("\x1B[9m","\x1B[29m"),_=a("\x1B[30m","\x1B[39m"),p=a("\x1B[31m","\x1B[39m"),v=a("\x1B[32m","\x1B[39m"),m=a("\x1B[33m","\x1B[39m"),R=a("\x1B[34m","\x1B[39m"),g=a("\x1B[35m","\x1B[39m"),O=a("\x1B[38;2;173;127;168m","\x1B[39m"),S=a("\x1B[36m","\x1B[39m"),C=a("\x1B[37m","\x1B[39m"),N=a("\x1B[90m","\x1B[39m"),V=a("\x1B[40m","\x1B[49m"),ce=a("\x1B[41m","\x1B[49m"),ie=a("\x1B[42m","\x1B[49m"),de=a("\x1B[43m","\x1B[49m"),he=a("\x1B[44m","\x1B[49m"),_e=a("\x1B[45m","\x1B[49m"),le=a("\x1B[46m","\x1B[49m"),fe=a("\x1B[47m","\x1B[49m")})(nn)),nn}var sn={},_i;function Ku(){return _i||(_i=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"LRUCache",{enumerable:!0,get:function(){return r}});class e{constructor(i,o,a){this.prev=null,this.next=null,this.key=i,this.data=o,this.size=a}}class t{constructor(){this.prev=null,this.next=null}}class r{constructor(i,o){this.cache=new Map,this.totalSize=0,this.maxSize=i,this.calculateSize=o,this.head=new t,this.tail=new t,this.head.next=this.tail,this.tail.prev=this.head}addToHead(i){i.prev=this.head,i.next=this.head.next,this.head.next.prev=i,this.head.next=i}removeNode(i){i.prev.next=i.next,i.next.prev=i.prev}moveToHead(i){this.removeNode(i),this.addToHead(i)}removeTail(){const i=this.tail.prev;return this.removeNode(i),i}set(i,o){const a=(this.calculateSize==null?void 0:this.calculateSize.call(this,o))??1;if(a>this.maxSize){console.warn("Single item size exceeds maxSize");return}const c=this.cache.get(i);if(c)c.data=o,this.totalSize=this.totalSize-c.size+a,c.size=a,this.moveToHead(c);else{const l=new e(i,o,a);this.cache.set(i,l),this.addToHead(l),this.totalSize+=a}for(;this.totalSize>this.maxSize&&this.cache.size>0;){const l=this.removeTail();this.cache.delete(l.key),this.totalSize-=l.size}}has(i){return this.cache.has(i)}get(i){const o=this.cache.get(i);if(o)return this.moveToHead(o),o.data}*[Symbol.iterator](){let i=this.head.next;for(;i&&i!==this.tail;){const o=i;yield[o.key,o.data],i=i.next}}remove(i){const o=this.cache.get(i);o&&(this.removeNode(o),this.cache.delete(i),this.totalSize-=o.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}})(sn)),sn}var mi;function Yu(){return mi||(mi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(p,v){for(var m in v)Object.defineProperty(p,m,{enumerable:!0,get:v[m]})}e(s,{bootstrap:function(){return a},error:function(){return l},event:function(){return y},info:function(){return f},prefixes:function(){return n},ready:function(){return h},trace:function(){return E},wait:function(){return c},warn:function(){return d},warnOnce:function(){return _}});const t=Xu(),r=Ku(),n={wait:(0,t.white)((0,t.bold)("○")),error:(0,t.red)((0,t.bold)("⨯")),warn:(0,t.yellow)((0,t.bold)("⚠")),ready:"▲",info:(0,t.white)((0,t.bold)(" ")),event:(0,t.green)((0,t.bold)("✓")),trace:(0,t.magenta)((0,t.bold)("»"))},i={log:"log",warn:"warn",error:"error"};function o(p,...v){(v[0]===""||v[0]===void 0)&&v.length===1&&v.shift();const m=p in i?i[p]:"log",R=n[p];v.length===0?console[m](""):v.length===1&&typeof v[0]=="string"?console[m](" "+R+" "+v[0]):console[m](" "+R,...v)}function a(...p){console.log(" "+p.join(" "))}function c(...p){o("wait",...p)}function l(...p){o("error",...p)}function d(...p){o("warn",...p)}function h(...p){o("ready",...p)}function f(...p){o("info",...p)}function y(...p){o("event",...p)}function E(...p){o("trace",...p)}const A=new r.LRUCache(1e4,p=>p.length);function _(...p){const v=p.join(" ");A.has(v)||(A.set(v,v),d(...p))}})(rn)),rn}var vi;function Vu(){return vi||(vi=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0});function e(p,v){for(var m in v)Object.defineProperty(p,m,{enumerable:!0,get:v[m]})}e(s,{getRootParam:function(){return E},unstable_rootParams:function(){return h}});const t=Tn(),r=Xi(),n=Qt(),i=On(),o=kn(),a=Wu(),c=zu(),l=Yu(),d=new WeakMap;async function h(){(0,l.warnOnce)("`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.");const p=n.workAsyncStorage.getStore();if(!p)throw Object.defineProperty(new t.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});const v=i.workUnitAsyncStorage.getStore();if(!v)throw Object.defineProperty(new Error(`Route ${p.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(v.type){case"cache":case"unstable-cache":throw Object.defineProperty(new Error(`Route ${p.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return f(v.rootParams,p,v);case"private-cache":case"prerender-runtime":case"request":return Promise.resolve(v.rootParams);default:return v}}function f(p,v,m){switch(m.type){case"prerender-client":{const R="`unstable_rootParams`";throw Object.defineProperty(new t.InvariantError(`${R} must not be used within a client component. Next.js should be preventing ${R} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}case"prerender":{const R=m.fallbackRouteParams;if(R){for(const g in p)if(R.has(g)){const O=d.get(p);if(O)return O;const S=(0,o.makeHangingPromise)(m.renderSignal,v.route,"`unstable_rootParams`");return d.set(p,S),S}}break}case"prerender-ppr":{const R=m.fallbackRouteParams;if(R){for(const g in p)if(R.has(g))return y(p,R,v,m)}break}}return Promise.resolve(p)}function y(p,v,m,R){const g=d.get(p);if(g)return g;const O={...p},S=Promise.resolve(O);return d.set(p,S),Object.keys(p).forEach(C=>{a.wellKnownProperties.has(C)||(v.has(C)?Object.defineProperty(O,C,{get(){const N=(0,a.describeStringPropertyAccess)("unstable_rootParams",C);R.type==="prerender-ppr"?(0,r.postponeWithTracking)(m.route,N,R.dynamicTracking):(0,r.throwToInterruptStaticGeneration)(N,m,R)},enumerable:!0}):S[C]=p[C])}),S}function E(p){const v=`\`import('next/root-params').${p}()\``,m=n.workAsyncStorage.getStore();if(!m)throw Object.defineProperty(new t.InvariantError(`Missing workStore in ${v}`),"__NEXT_ERROR_CODE",{value:"E764",enumerable:!1,configurable:!0});const R=i.workUnitAsyncStorage.getStore();if(!R)throw Object.defineProperty(new Error(`Route ${m.route} used ${v} outside of a Server Component. This is not allowed.`),"__NEXT_ERROR_CODE",{value:"E774",enumerable:!1,configurable:!0});const g=c.actionAsyncStorage.getStore();if(g){if(g.isAppRoute)throw Object.defineProperty(new Error(`Route ${m.route} used ${v} inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E765",enumerable:!1,configurable:!0});if(g.isAction&&R.phase==="action")throw Object.defineProperty(new Error(`${v} was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.`),"__NEXT_ERROR_CODE",{value:"E766",enumerable:!1,configurable:!0})}switch(R.type){case"unstable-cache":case"cache":throw Object.defineProperty(new Error(`Route ${m.route} used ${v} inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E760",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return A(p,m,R,v)}return Promise.resolve(R.rootParams[p])}function A(p,v,m,R){switch(m.type){case"prerender-client":throw Object.defineProperty(new t.InvariantError(`${R} must not be used within a client component. Next.js should be preventing ${R} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}const g=m.rootParams;switch(m.type){case"prerender":{if(m.fallbackRouteParams&&m.fallbackRouteParams.has(p))return(0,o.makeHangingPromise)(m.renderSignal,v.route,R);break}case"prerender-ppr":{if(m.fallbackRouteParams&&m.fallbackRouteParams.has(p))return _(p,v,m,R);break}}return Promise.resolve(g[p])}async function _(p,v,m,R){const g=(0,a.describeStringPropertyAccess)(R,p);switch(m.type){case"prerender-ppr":return(0,r.postponeWithTracking)(v.route,g,m.dynamicTracking);case"prerender-legacy":return(0,r.throwToInterruptStaticGeneration)(g,v,m)}}})(Qr)),Qr}var bi;function Ju(){return bi||(bi=1,(function(s,e){const t={NextRequest:Eu().NextRequest,NextResponse:Su().NextResponse,ImageResponse:Au().ImageResponse,userAgentFromString:Bs().userAgentFromString,userAgent:Bs().userAgent,URLPattern:Ou().URLPattern,after:Cu().after,connection:Fu().connection,unstable_rootParams:Vu().unstable_rootParams};s.exports=t,e.NextRequest=t.NextRequest,e.NextResponse=t.NextResponse,e.ImageResponse=t.ImageResponse,e.userAgentFromString=t.userAgentFromString,e.userAgent=t.userAgent,e.URLPattern=t.URLPattern,e.after=t.after,e.connection=t.connection,e.unstable_rootParams=t.unstable_rootParams})(Bt,Bt.exports)),Bt.exports}var Rt=Ju();const Qu=async s=>{try{let e=Rt.NextResponse.next({request:{headers:s.headers}});const t=process.env.NEXT_PUBLIC_SUPABASE_URL,r=process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;if(!t||!r)throw new Error("Missing Supabase environment variables");const i=await au(t,r,{cookies:{getAll(){return s.cookies.getAll()},setAll(o){o.forEach(({name:a,value:c})=>s.cookies.set(a,c)),e=Rt.NextResponse.next({request:s}),o.forEach(({name:a,value:c,options:l})=>e.cookies.set(a,c,l))}}}).auth.getUser();return s.nextUrl.pathname.startsWith("/protected")&&i.error?Rt.NextResponse.redirect(new URL("/sign-in",s.url)):s.nextUrl.pathname==="/"&&!i.error?Rt.NextResponse.redirect(new URL("/protected",s.url)):e}catch{return Rt.NextResponse.next({request:{headers:s.headers}})}},Zu=()=>!process.env.NEXT_PUBLIC_SUPABASE_URL||!process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY?(console.warn("Supabase URL or Anon Key is missing for SSG client. Check .env.local"),{}):Rn(process.env.NEXT_PUBLIC_SUPABASE_URL,process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY),ec={public:{Enums:{menu_location:["HEADER","FOOTER","SIDEBAR"],page_status:["draft","published","archived"],revision_type:["snapshot","diff"],user_role:["ADMIN","WRITER","USER"]}}};exports.Constants=ec;exports.createClient=Fi;exports.getActiveLanguagesClientSide=cu;exports.getProfileWithRoleClientSide=uu;exports.getSsgSupabaseClient=Zu;exports.updateSession=Qu;