function E(){return E=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u"&&(n.status=302);let l=new Headers(n.headers);return l.set("Location",e),new Response(null,E({},n,{headers:l}))};var M=["post","put","patch","delete"],ae=new Set(M),C=["get",...M],oe=new Set(C);var ie=Symbol("deferred");var I=(t,e=302)=>T(t,e);var U=-1,$=-2,H=-3,k=-4,z=-5,B=-6,W=-7,V="B",Y="D",F="E",J="M",K="N",N="P",G="R",X="S",Z="Y",Q="U",q="Z",_=class{promise;resolve;reject;constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}};function ee(){let t=new TextDecoder,e="";return new TransformStream({transform(r,n){let l=t.decode(r,{stream:!0}),c=(e+l).split(` `);e=c.pop()||"";for(let i of c)n.enqueue(i)},flush(r){e&&r.enqueue(e)}})}var pe=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var R=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function D(t){let{hydrated:e,values:r}=this;if(typeof t=="number")return O.call(this,t);if(!Array.isArray(t)||!t.length)throw new SyntaxError;let n=r.length;for(let l of t)r.push(l);return e.length=r.length,O.call(this,n)}function O(t){let{hydrated:e,values:r,deferred:n,plugins:l}=this,c,i=[[t,a=>{c=a}]],f=[];for(;i.length>0;){let[a,o]=i.pop();switch(a){case W:o(void 0);continue;case z:o(null);continue;case $:o(NaN);continue;case B:o(1/0);continue;case H:o(-1/0);continue;case k:o(-0);continue}if(e[a]){o(e[a]);continue}let s=r[a];if(!s||typeof s!="object"){e[a]=s,o(s);continue}if(Array.isArray(s))if(typeof s[0]=="string"){let[m,d,y]=s;switch(m){case Y:o(e[a]=new Date(d));continue;case Q:o(e[a]=new URL(d));continue;case V:o(e[a]=BigInt(d));continue;case G:o(e[a]=new RegExp(d,y));continue;case Z:o(e[a]=Symbol.for(d));continue;case X:let g=new Set;e[a]=g;for(let u=1;u{g.add(h)}]);o(g);continue;case J:let b=new Map;e[a]=b;for(let u=1;u{h[1]=p}]),i.push([s[u],p=>{h[0]=p}]),f.push(()=>{b.set(h[0],h[1])})}o(b);continue;case K:let w=Object.create(null);e[a]=w;for(let u of Object.keys(d).reverse()){let h=[];i.push([d[u],p=>{h[1]=p}]),i.push([Number(u.slice(1)),p=>{h[0]=p}]),f.push(()=>{w[h[0]]=h[1]})}o(w);continue;case N:if(e[d])o(e[a]=e[d]);else{let u=new _;n[d]=u,o(e[a]=u.promise)}continue;case F:let[,x,S]=s,P=S&&R&&R[S]?new R[S](x):new Error(x);e[a]=P,o(P);continue;case q:o(e[a]=e[d]);continue;default:if(Array.isArray(l)){let u=[],h=s.slice(1);for(let p=0;p{u[p]=A}])}f.push(()=>{for(let p of l){let v=p(s[0],...u);if(v){o(e[a]=v.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{let m=[];e[a]=m;for(let d=0;d{m[d]=g}])}o(m);continue}else{let m={};e[a]=m;for(let d of Object.keys(s).reverse()){let y=[];i.push([s[d],g=>{y[1]=g}]),i.push([Number(d.slice(1)),g=>{y[0]=g}]),f.push(()=>{m[y[0]]=y[1]})}o(m);continue}}for(;f.length>0;)f.pop()();return c}async function me(t,e){let{plugins:r}=e??{},n=new _,l=t.pipeThrough(ee()).getReader(),c={values:[],hydrated:[],deferred:{},plugins:r},i=await te.call(c,l),f=n.promise;return i.done?n.resolve():f=re.call(c,l).then(n.resolve).catch(a=>{for(let o of Object.values(c.deferred))o.reject(a);n.reject(a)}),{done:f.then(()=>l.closed),value:i.value}}async function te(t){let e=await t.read();if(!e.value)throw new SyntaxError;let r;try{r=JSON.parse(e.value)}catch{throw new SyntaxError}return{done:e.done,value:D.call(this,r)}}async function re(t){let e=await t.read();for(;!e.done;){if(!e.value)continue;let r=e.value;switch(r[0]){case N:{let n=r.indexOf(":"),l=Number(r.slice(1,n)),c=this.deferred[l];if(!c)throw new Error(`Deferred ID ${l} not found in stream`);let i=r.slice(n+1),f;try{f=JSON.parse(i)}catch{throw new SyntaxError}let a=D.call(this,f);c.resolve(a);break}case F:{let n=r.indexOf(":"),l=Number(r.slice(1,n)),c=this.deferred[l];if(!c)throw new Error(`Deferred ID ${l} not found in stream`);let i=r.slice(n+1),f;try{f=JSON.parse(i)}catch{throw new SyntaxError}let a=D.call(this,f);c.reject(a);break}default:throw new SyntaxError}e=await t.read()}}var ne=Symbol("SingleFetchRedirect");export{I as a,me as b,ne as c}; /*! Bundled license information: @remix-run/router/dist/router.js: (** * @remix-run/router v1.20.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT *) @remix-run/server-runtime/dist/esm/responses.js: (** * @remix-run/server-runtime v2.13.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT *) @remix-run/server-runtime/dist/esm/single-fetch.js: (** * @remix-run/server-runtime v2.13.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT *) @remix-run/server-runtime/dist/esm/index.js: (** * @remix-run/server-runtime v2.13.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT *) */