PageSourceSearch

https://www.sleepnumber.com/build/assets/errorBoundaries-CkKDK3WZ.js

js sleepnumber.com collected 2026-10-01 10:28:04 UTC 32,274 bytes, 17 lines download raw bytes

1import{$ as e,A as t,F as n,G as r,H as i,I as a,L as o,P as s,R as c,V as l,Y as u,_ as d,c as f,d as p,f as m,it as h,m as g,w as _,z as v}from"./jsx-runtime-CfwYrey9.js";import{t as y}from"./preload-helper-B6JZccWF.js";function b(e,t){if(e===!1||e==null)throw Error(t)}var ee={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},x=/[&><\u2028\u2029]/g;function te(e){return e.replace(x,e=>ee[e])}var S=class{promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function ne(){let e=new TextDecoder,t=``;return new TransformStream({transform(n,r){let i=e.decode(n,{stream:!0}),a=(t+i).split(`
2`);t=a.pop()||``;for(let e of a)r.enqueue(e)},flush(e){t&&e.enqueue(t)}})}var C=typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0;function w(e){let{hydrated:t,values:n}=this;if(typeof e==`number`)return re.call(this,e);if(!Array.isArray(e)||!e.length)throw SyntaxError();let r=n.length;for(let t of e)n.push(t);return t.length=n.length,re.call(this,r)}function re(e){let{hydrated:t,values:n,deferred:r,plugins:i}=this,a,s=[[e,e=>{a=e}]],c=[];for(;s.length>0;){let[e,a]=s.pop();switch(e){case-7:a(void 0);continue;case-5:a(null);continue;case-2:a(NaN);continue;case-6:a(1/0);continue;case-3:a(-1/0);continue;case-4:a(-0);continue}if(t[e]){a(t[e]);continue}let l=n[e];if(!l||typeof l!=`object`){t[e]=l,a(l);continue}if(Array.isArray(l))if(typeof l[0]==`string`){let[n,u,d]=l;switch(n){case`D`:a(t[e]=new Date(u));continue;case`U`:a(t[e]=new URL(u));continue;case`B`:a(t[e]=BigInt(u));continue;case`R`:a(t[e]=new RegExp(u,d));continue;case`Y`:a(t[e]=Symbol.for(u));continue;case`S`:let n=new Set;t[e]=n;for(let e=l.length-1;e>0;e--)s.push([l[e],e=>{n.add(e)}]);a(n);continue;case`M`:let f=new Map;t[e]=f;for(let e=l.length-2;e>0;e-=2){let t=[];s.push([l[e+1],e=>{t[1]=e}]),s.push([l[e],e=>{t[0]=e}]),c.push(()=>{f.set(t[0],t[1])})}a(f);continue;case`N`:let p=Object.create(null);t[e]=p;for(let e of Object.keys(u).reverse()){let t=[];s.push([u[e],e=>{t[1]=e}]),s.push([Number(e.slice(1)),e=>{t[0]=e}]),c.push(()=>{p[t[0]]=t[1]})}a(p);continue;case`P`:if(t[u])a(t[e]=t[u]);else{let n=new S;r[u]=n,a(t[e]=n.promise)}continue;case`E`:let[,m,h]=l,g=h&&C&&o.includes(h)&&h in C&&typeof C[h]==`function`?new C[h](m):Error(m);t[e]=g,a(g);continue;case`Z`:a(t[e]=t[u]);continue;default:if(Array.isArray(i)){let n=[],r=l.slice(1);for(let e=0;e<r.length;e++){let t=r[e];s.push([t,t=>{n[e]=t}])}c.push(()=>{for(let r of i){let i=r(l[0],...n);if(i){a(t[e]=i.value);return}}throw SyntaxError()});continue}throw SyntaxError()}}else{let n=[];t[e]=n;for(let e=0;e<l.length;e++){let t=l[e];t!==-1&&s.push([t,t=>{n[e]=t}])}a(n);continue}else{let n={};t[e]=n;for(let e of Object.keys(l).reverse()){let t=[];s.push([l[e],e=>{t[1]=e}]),s.push([Number(e.slice(1)),e=>{t[0]=e}]),c.push(()=>{n[t[0]]=t[1]})}a(n);continue}}for(;c.length>0;)c.pop()();return a}async function ie(e,t){let{plugins:n}=t??{},r=new S,i=e.pipeThrough(ne()).getReader(),a={values:[],hydrated:[],deferred:{},plugins:n},o=await ae.call(a,i),s=r.promise;return o.done?r.resolve():s=oe.call(a,i).then(r.resolve).catch(e=>{for(let t of Object.values(a.deferred))t.reject(e);r.reject(e)}),{done:s.then(()=>i.closed),value:o.value}}async function ae(e){let t=await e.read();if(!t.value)throw SyntaxError();let n;try{n=JSON.parse(t.value)}catch{throw SyntaxError()}return{done:t.done,value:w.call(this,n)}}async function oe(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;let n=t.value;switch(n[0]){case`P`:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=w.call(this,a);r.resolve(o);break}case`E`:{let e=n.indexOf(`:`),t=Number(n.slice(1,e)),r=this.deferred[t];if(!r)throw Error(`Deferred ID ${t} not found in stream`);let i=n.slice(e+1),a;try{a=JSON.parse(i)}catch{throw SyntaxError()}let o=w.call(this,a);r.reject(o);break}default:throw SyntaxError()}t=await e.read()}}async function se(e){let t={signal:e.signal};if(e.method!==`GET`){t.method=e.method;let n=e.headers.get(`Content-Type`);n&&/\bapplication\/json\b/.test(n)?(t.headers={"Content-Type":n},t.body=JSON.stringify(await e.json())):n&&/\btext\/plain\b/.test(n)?(t.headers={"Content-Type":n},t.body=await e.text()):n&&/\bapplication\/x-www-form-urlencoded\b/.test(n)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var T=h(e(),1),E=Symbol(`SingleFetchRedirect`),ce=class extends 
2Error{},le=new Set([100,101,204,205]);function ue(e,t,n,r){let i=de(e,e=>{let n=t.routes[e.route.id];return b(n,`Route not found in manifest`),{hasLoader:n.hasLoader,hasClientLoader:n.hasClientLoader}},ve,r);return async e=>e.runClientMiddleware(i)}function de(e,t,n,r,i=()=>!0){return async a=>{let{request:o,matches:s,fetcherKey:c}=a,l=e();if(o.method!==`GET`)return fe(a,n);let u=s.some(e=>{let{hasLoader:n,hasClientLoader:r}=t(e);return e.shouldCallHandler()&&n&&!r});return!r&&!u?pe(a,t,n):c?ge(a,n):me(a,l,t,n,r,i)}}async function fe(e,t){let r=e.matches.find(e=>e.shouldCallHandler());b(r,`No action match found`);let i,a=await r.resolve(async n=>await n(async()=>{let{data:n,status:a}=await t(e,[r.route.id]);return i=a,k(n,r.route.id)}));return n(a.result)||l(a.result)||s(a.result)?{[r.route.id]:a}:{[r.route.id]:{type:a.type,result:v(a.result,i)}}}async function pe(e,t,n){let r=e.matches.filter(e=>e.shouldCallHandler()),i={};return await Promise.all(r.map(async r=>{let a=r.route.id;i[a]=await r.resolve(async i=>{let{hasClientLoader:o}=t(r);return o?i(async()=>{let{data:t}=await n(e,[a]);return k(t,a)}):i()})})),i}async function me(e,t,n,r,i,a=()=>!0){let o=new Set,s=!1,c=e.matches.map(()=>A()),l=A(),u={},d=Promise.all(e.matches.map(async(t,i)=>t.resolve(async d=>{c[i].resolve();let f=t.route.id,{hasLoader:p,hasClientLoader:m}=n(t),h=!t.shouldRevalidateArgs||t.shouldRevalidateArgs.actionStatus==null||t.shouldRevalidateArgs.actionStatus<400;if(!t.shouldCallHandler(h)){s||=t.shouldRevalidateArgs!=null&&p;return}if(a(t)&&m){p&&(s=!0);try{u[f]={type:`data`,result:await d(async()=>{let{data:t}=await r(e,[f]);return k(t,f)})}}catch(e){u[f]={type:`error`,result:e}}return}p&&o.add(f);try{u[f]={type:`data`,result:await d(async()=>k(await l.promise,f))}}catch(e){u[f]={type:`error`,result:e}}})));if(await Promise.all(c.map(e=>e.promise)),(!t.state.initialized&&t.state.navigation.state===`idle`||o.size===0)&&!window.__reactRouterHdrActive)l.resolve({routes:{}});else{let t=i&&s&&o.size>0?[...o.keys()]:void 0;try{let n=await r(e,t);l.resolve(n.data)}catch(e){l.reject(e)}}return await d,await he(l.promise,e.matches,o,u),u}async function he(e,t,n,r){try{let i,a=await e;if(`routes`in a){for(let e of t)if(e.route.id in a.routes){let t=a.routes[e.route.id];if(`error`in t){i=t.error,r[e.route.id]?.result??(r[e.route.id]={type:`error`,result:i});break}}}i!==void 0&&Array.from(n.values()).forEach(e=>{r[e].result instanceof ce&&(r[e].result=i)})}catch{}}async function ge(e,t){let n=e.matches.find(e=>e.shouldCallHandler());b(n,`No fetcher match found`);let r=n.route.id,i=await n.resolve(async n=>n(async()=>{let{data:n}=await t(e,[r]);return k(n,r)}));return{[n.route.id]:i}}function _e(e){let t=e.searchParams.getAll(`index`);e.searchParams.delete(`index`);let n=[];for(let e of t)e&&n.push(e);for(let t of n)e.searchParams.append(`index`,t);return e}function D(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname.endsWith(`/`)?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}async function ve(e,t){let{request:n}=e,r=D(n.url,`data`);n.method===`GET`&&(r=_e(r),t&&r.searchParams.set(`_routes`,t.join(`,`)));let i=await fetch(r,await se(n));if(i.status>=400&&!i.headers.has(`X-Remix-Response`))throw new a(i.status,i.statusText,await i.text());if(i.status===204&&i.headers.has(`X-Remix-Redirect`))return{status:202,data:{redirect:{redirect:i.headers.get(`X-Remix-Redirect`),status:Number(i.headers.get(`X-Remix-Status`)||`302`),revalidate:i.headers.get(`X-Remix-Revalidate`)===`true`,reload:i.headers.get(`X-Remix-Reload-Document`)===`true`,replace:i.headers.get(`X-Remix-Replace`)===`true`}}};if(le.has(i.status)){let e={};return t&&n.method!==`GET`&&(e[t[0]]={data:void 0}),{status:i.status,data:{routes:e}}}b(i.body,`No response body to decode`);try{let e=await O(i.body,window),r;if(n.method===`GET`){let t=e.value;r=E in t?{redirect:t[E]}:{routes:t}}else{let n=e.value,i=t?.[0];b(i,`No routeId found for single fetch call decoding`),r=`redirect`in n?{redirect:n}:{routes:{[i]:n}}}return{status:i.status,data:r}}catch(e){throw Error(`Unable to decode turbo-stream response`,{cause:e})}}function O(e,t){return ie(e,{plugins:[(e,...n)=>{if(e===`SanitizedError`){let[e,r,i]=n,a=Error;e&&o.includes(e)&&e in t&&typeof t[e]==`function`&&(a=t[e]);let s=new a(r);return s.stack=i,{value:s}}if(e===`ErrorResponse`){let[e,t,r]=n;return{value:new a(t,r,e)}
2}if(e===`SingleFetchRedirect`)return{value:{[E]:n[0]}};if(e===`SingleFetchClassInstance`)return{value:n[0]};if(e===`SingleFetchFallback`)return{value:void 0}}]})}function k(e,t){if(`redirect`in e){let{redirect:t,revalidate:n,reload:i,replace:a,status:o}=e.redirect;throw r(t,{status:o,headers:{...n?{"X-Remix-Revalidate":`yes`}:null,...i?{"X-Remix-Reload-Document":`yes`}:null,...a?{"X-Remix-Replace":`yes`}:null}})}let n=e.routes[t];if(n==null)throw new ce(`No result found for routeId "${t}"`);if(`error`in n)throw n.error;if(`data`in n)return n.data;throw Error(`Invalid response found for routeId "${t}"`)}function A(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}async function j(e,t){if(e.id in t)return t[e.id];try{let n=await y(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ye(e,t,n){return R(e.map(e=>{let r=t[e.route.id],i=n.routes[e.route.id];return[i&&i.css?i.css.map(e=>({rel:`stylesheet`,href:e})):[],r?.links?.()||[]]}).flat(2),L(e,n))}function M(e){return e.css?e.css.map(e=>({rel:`stylesheet`,href:e})):[]}async function be(e){if(!e.css)return;let t=M(e);await Promise.all(t.map(P))}async function N(e,t){if(!e.css&&!t.links||!Te())return;let n=[];if(e.css&&n.push(...M(e)),t.links&&n.push(...t.links()),n.length===0)return;let r=[];for(let e of n)!F(e)&&e.rel===`stylesheet`&&r.push({...e,rel:`preload`,as:`style`});await Promise.all(r.map(P))}async function P(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let n=document.createElement(`link`);Object.assign(n,e);function r(){document.head.contains(n)&&document.head.removeChild(n)}n.onload=()=>{r(),t()},n.onerror=()=>{r(),t()},document.head.appendChild(n)})}function F(e){return e!=null&&typeof e.page==`string`}function xe(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Se(e,t,n){return R((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await j(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(xe).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function I(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function L(e,t,{includeHydrateFallback:n}={}){return Ce(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ce(e){return[...new Set(e)]}function we(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function R(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!F(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(we(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var z;function Te(){if(z!==void 0)return z;let e=document.createElement(`link`);return z=e.relList.supports(`preload`),e=null,z}function Ee(){let{nonce:e}=Y();
2return T.createElement($,{title:`Loading...`,renderScripts:!0},null)}function De(e){let t={};return Object.values(e).forEach(e=>{if(e){let n=e.parentId||``;t[n]||(t[n]=[]),t[n].push(e)}}),t}function Oe(e,t,n){let r=Ne(t),i=t.HydrateFallback&&(!n||e.id===`root`)?t.HydrateFallback:e.id===`root`?Ee:void 0,a=t.ErrorBoundary?t.ErrorBoundary:e.id===`root`?()=>T.createElement(at,{error:_()}):void 0;return e.id===`root`&&t.Layout?{...r?{element:T.createElement(t.Layout,null,T.createElement(r,null))}:{Component:r},...a?{errorElement:T.createElement(t.Layout,null,T.createElement(a,null))}:{ErrorBoundary:a},...i?{hydrateFallbackElement:T.createElement(t.Layout,null,T.createElement(i,null))}:{HydrateFallback:i}}:{Component:r,ErrorBoundary:a,HydrateFallback:i}}function ke(e,t,n,r,i,a){return H(t,n,r,i,a,``,De(t),e)}function B(e,t){if(e===`loader`&&!t.hasLoader||e===`action`&&!t.hasAction){let n=`You are trying to call ${e===`action`?`serverAction()`:`serverLoader()`} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(n),new a(400,`Bad Request`,Error(n),!0)}}function V(e,t){let n=e===`clientAction`?`a`:`an`,r=`Route "${t}" does not have ${n} ${e}, but you are trying to submit to it. To fix this, please add ${n} \`${e}\` function to the route`;throw console.error(r),new a(405,`Method Not Allowed`,Error(r),!0)}function H(e,t,n,r,i,a=``,o=De(e),s){return(o[a]||[]).map(a=>{let c=t[a.id];function l(e){return b(typeof e==`function`,`No single fetch function available for route handler`),e()}function u(e){return a.hasLoader?l(e):Promise.resolve(null)}function d(e){if(!a.hasAction)throw V(`action`,a.id);return l(e)}function f(e){y(()=>import(e),[])}function p(e){e.clientActionModule&&f(e.clientActionModule),e.clientLoaderModule&&f(e.clientLoaderModule)}async function m(e){let n=t[a.id],r=n?N(a,n):Promise.resolve();try{return e()}finally{await r}}let h={id:a.id,index:a.index,path:a.path};if(c){Object.assign(h,{...h,...Oe(a,c,i),middleware:c.clientMiddleware,handle:c.handle,shouldRevalidate:Ae(h.path,c,a,r,s)});let e=n&&n.loaderData&&a.id in n.loaderData,t=e?n?.loaderData?.[a.id]:void 0,o=n&&n.errors&&a.id in n.errors,l=o?n?.errors?.[a.id]:void 0,f=s==null&&(c.clientLoader?.hydrate===!0||!a.hasLoader);h.loader=async({request:n,params:r,context:i,pattern:s,url:d},p)=>{let h=f;return f=!1,await m(async()=>(b(c,"No `routeModule` available for critical-route loader"),c.clientLoader?c.clientLoader({request:n,params:r,context:i,pattern:s,url:d,async serverLoader(){if
2(B(`loader`,a),h){if(e)return t;if(o)throw l}return u(p)}}):u(p)))},h.loader.hydrate=Pe(a.id,c.clientLoader,a.hasLoader,i),h.action=({request:e,params:t,context:n,pattern:r,url:o},s)=>m(async()=>{if(b(c,"No `routeModule` available for critical-route action"),!c.clientAction){if(i)throw V(`clientAction`,a.id);return d(s)}return c.clientAction({request:e,params:t,context:n,pattern:r,url:o,async serverAction(){return B(`action`,a),d(s)}})})}else{a.hasClientLoader||(h.loader=(e,t)=>m(()=>u(t))),a.hasClientAction||(h.action=(e,t)=>m(()=>{if(i)throw V(`clientAction`,a.id);return d(t)}));let e;async function n(){return e||=(async()=>{(a.clientLoaderModule||a.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=Me(a,t);return p(a),await e})(),await e}h.lazy={loader:a.hasClientLoader?async()=>{let{clientLoader:e}=a.clientLoaderModule?await y(()=>import(a.clientLoaderModule),[]):await n();return b(e,"No `clientLoader` export found"),(t,n)=>e({...t,async serverLoader(){return B(`loader`,a),u(n)}})}:void 0,action:a.hasClientAction?async()=>{let e=a.clientActionModule?y(()=>import(a.clientActionModule),[]):n();p(a);let{clientAction:t}=await e;return b(t,"No `clientAction` export found"),(e,n)=>t({...e,async serverAction(){return B(`action`,a),d(n)}})}:void 0,middleware:a.hasClientMiddleware?async()=>{let{clientMiddleware:e}=a.clientMiddlewareModule?await y(()=>import(a.clientMiddlewareModule),[]):await n();return b(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await n();return Ae(h.path,e,a,r,s)},handle:async()=>(await n()).handle,Component:async()=>(await n()).Component,ErrorBoundary:a.hasErrorBoundary?async()=>(await n()).ErrorBoundary:void 0}}let g=H(e,t,n,r,i,a.id,o,s);return g.length>0&&(h.children=g),h})}function Ae(e,t,n,r,i){if(i)return je(n.id,t.shouldRevalidate,i);if(!r&&n.hasLoader&&!n.hasClientLoader){let n=e?c(e)[1].map(e=>e.paramName):[],r=e=>n.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:r(t)})}else return e=>r(e)}return t.shouldRevalidate}function je(e,t,n){let r=!1;return i=>r?t?t(i):i.defaultShouldRevalidate:(r=!0,n.has(e))}async function Me(e,t){let n=j(e,t),r=be(e),i=await n;return await Promise.all([r,N(e,i)]),{Component:Ne(i),ErrorBoundary:i.ErrorBoundary,clientMiddleware:i.clientMiddleware,clientAction:i.clientAction,clientLoader:i.clientLoader,handle:i.handle,links:i.links,meta:i.meta,shouldRevalidate:i.shouldRevalidate}}function Ne(e){if(e.default!=null&&!(typeof e.default==`object`&&Object.keys(e.default).length===0))return e.default}function Pe(e,t,n,r){return r&&e!==`root`||t!=null&&(t.hydrate===!0||n!==!0)}var U=new Set,Fe=1e3,W=new Set;function Ie(e){let t=new Set;return e.forEach(e=>{e.startsWith(`/`)||(e=`/${e}`);for(let n=1;n<e.length;n++)e[n]===`/`&&t.add(e.slice(0,n));t.add(e)}),Array.from(t)}function G(e,t){return e.mode===`lazy`&&t===!0}function Le({sri:e,...t},n){let r=new Set(n.state.matches.map(e=>e.route.id)),i=n.state.location.pathname.split(`/`).filter(Boolean),a=[`/`];for(i.pop();i.length>0;)a.push(`/${i.join(`/`)}`),i.pop();a.forEach(e=>{let t=n.match(e);t&&t.forEach(e=>r.add(e.route.id))});let o=[...r].reduce((e,n)=>Object.assign(e,{[n]:t.routes[n]}),{});return{...t,routes:o,sri:e?!0:void 0}}function Re(e,t,n,r,i,a,o){if(G(i,r))return async({path:s,patch:c,signal:l,fetcherKey:d})=>{if(W.has(s))return;let{state:f}=e();await Ue([s],d?window.location.href:u(f.navigation.location||f.location),t,n,r,a,o,i.manifestPath,c,l)}}function ze(e,t,n,r,i,a){T.useEffect(()=>{if(!G(i,r)||window.navigator?.connection?.saveData===!0)return;function o(e){let t=e.tagName===`FORM`?e.getAttribute(`action`):e.getAttribute(`href`);if(!t)return;let n=e.tagName===`A`?e.pathname:new URL(t,window.location.origin).pathname;W.has(n)||U.add(n)}async function s(){document.querySelectorAll(`a[data-discover], form[data-discover]`).forEach(o);let s=Array.from(U.keys()).filter(e=>W.has(e)?(U.delete(e),!1):!0);if(s.length!==0)try{await Ue(s,null,t,n,r,a,e.basename,i.manifestPath,e.patchRoutes)}catch(e){console.error(`Failed to fetch manifest patches`,e)}}let c=Ge(s,100);s();let l=new MutationObserver(()=>c());return l.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-discover`,`href`,`action`]}),()=>l.disconnect()},[r,a,t,n,e,i])}function Be(e,t){let n=e||`/__manifest`;return t==null?n:i([t,n])}var K=`react-router-manifest-version`,Ve=5e3,q;async function He(e,t,n){if(q)return q;if(!e){try{sessionStorage.removeItem(K)}catch{}return!1}if(!n)return console.warn(`Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a 
2new document navigation to sync up with the latest manifest.`),!0;let r=!1;try{r=sessionStorage.getItem(K)===t,r||sessionStorage.setItem(K,t)}catch{}if(r)throw Error(`Unable to discover routes due to manifest version mismatch.`);let i,a=new Promise((e,t)=>{i=t});q=a;let o=()=>{clearTimeout(s),window.removeEventListener(`pageshow`,c),q=void 0,i(Error(`Unable to discover routes due to manifest version mismatch.`))},s=setTimeout(o,Ve),c=e=>{e.persisted&&o()};window.addEventListener(`pageshow`,c);try{window.location.href=n,console.warn(`Detected manifest version mismatch, reloading...`)}catch{o()}return a}async function Ue(e,t,n,r,i,a,o,s,c,l){e=Ie(e);let u=new URLSearchParams;u.set(`paths`,e.sort().join(`,`)),u.set(`version`,n.version);let d=new URL(Be(s,o),window.location.origin);if(d.search=u.toString(),d.toString().length>7680){U.clear();return}let f;try{let e=await fetch(d,{signal:l});if(!e.ok)throw Error(`${e.status} ${e.statusText}`);if(await He(e.status===204&&e.headers.has(`X-Remix-Reload-Document`),n.version,t))return;f=await e.json()}catch(e){if(l?.aborted)return;throw e}if(l?.aborted)return;let p=new Set(Object.keys(n.routes)),m=Object.values(f).reduce((e,t)=>(t&&!p.has(t.id)&&(e[t.id]=t),e),{});Object.assign(n.routes,m),e.forEach(e=>We(e,W));let h=new Set;Object.values(m).forEach(e=>{e&&(!e.parentId||!m[e.parentId])&&h.add(e.parentId)}),h.forEach(e=>c(e||null,H(m,r,null,i,a,e)))}function We(e,t){if(t.size>=Fe){let e=t.values().next().value;e!==void 0&&t.delete(e)}t.add(e)}function Ge(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}var J=T.createContext(void 0);J.displayName=`FrameworkContext`;function Y(){let e=T.useContext(J);return b(e,`You must render this element inside a <HydratedRouter> element`),e}function Ke(e,t){let n=T.useContext(J),[r,i]=T.useState(!1),[a,o]=T.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=T.useRef(null);T.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),T.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:X(s,p),onBlur:X(c,m),onMouseEnter:X(l,p),onMouseLeave:X(u,m),onTouchStart:X(d,p)}]:[a,f,{}]:[!1,f,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Z(e,t,n){if(n&&!Q)return[e[0]];if(t){let n=e.findIndex(e=>t[e.route.id]!==void 0);return e.slice(0,n+1)}return e}var qe=`data-react-router-critical-css`;function Je({nonce:e,crossOrigin:t}){let{isSpaMode:n,manifest:r,routeModules:i,criticalCss:a,nonce:o}=Y(),{matches:s}=g(`Links`),{errors:c}=m(`Links`),l=Z(s,c,n),u=T.useMemo(()=>ye(l,i,r),[l,i,r]);return e==null&&o&&(e=o),T.createElement(T.Fragment,null,typeof a==`string`?T.createElement(`style`,{[qe]:``,nonce:e,dangerouslySetInnerHTML:{__html:a}}):null,typeof a==`object`?T.createElement(`link`,{[qe]:``,rel:`stylesheet`,href:a.href,nonce:e,crossOrigin:t}):null,u.map(({key:n,link:r})=>F(r)?T.createElement(Ye,{key:n,nonce:e,...r,crossOrigin:r.crossOrigin??t}):T.createElement(`link`,{key:n,nonce:e,...r,crossOrigin:r.crossOrigin??t})))}function Ye({page:e,...n}){let r=t(),{nonce:i}=Y(),{router:a}=p(`PrefetchPageLinks`),o=T.useMemo(()=>a.match(e),[a,a.routes,e]);return o?(n.nonce==null&&i&&(n={...n,nonce:i}),r?T.createElement(Ze,{page:e,matches:o,...n}):T.createElement(Qe,{page:e,matches:o,...n})):null}function Xe(e){let{manifest:t,routeModules:n}=Y(),[r,i]=T.useState([]);return T.useEffect(()=>{let r=!1;return Se(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ze({page:e,matches:t,...n}){let r=d(),i=T.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=D(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return T.createElement(T.Fragment,null,i.map(e=>T.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Qe({page:e,matches:t,...n}){let r=d(),{manifest:i,routeModules:a}=Y(),{matches:o}=g(`PrefetchPageLinks`),{loaderData:s}=m(`PrefetchPageLinks`),c=T.useMemo(()=>I(e,t,o,i,r,`data`),[e,t,o,i,r]),l=T.useMemo(()=>I(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=T.useMemo(()=>
2{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=D(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),f=T.useMemo(()=>L(l,i),[l,i]),p=Xe(l);return T.createElement(T.Fragment,null,u.map(e=>T.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),f.map(e=>T.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),p.map(({key:e,link:t})=>T.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function $e(){let{isSpaMode:e,routeModules:t}=Y(),{matches:n}=g(`Meta`),{errors:r,loaderData:i}=m(`Meta`),a=d(),o=Z(n,r,e),s=null;r&&(s=r[o[o.length-1].route.id]);let c=[],l=null,u=[];for(let e=0;e<o.length;e++){let n=o[e],r=n.route.id,d=i[r],f=n.params,p=t[r],m=[],h={id:r,loaderData:d,meta:[],params:n.params,pathname:n.pathname,handle:n.route.handle,error:s};if(u[e]=h,p?.meta?m=typeof p.meta==`function`?p.meta({loaderData:d,params:f,location:a,matches:u,error:s}):Array.isArray(p.meta)?[...p.meta]:p.meta:l&&(m=[...l]),m||=[],!Array.isArray(m))throw Error(`The route at `+n.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.
3
4To reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta`);h.meta=m,u[e]=h,c=[...m],l=c}return T.createElement(T.Fragment,null,c.flat().map(e=>{if(!e)return null;if(`tagName`in e){let{tagName:t,...n}=e;if(!et(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let r=t;return T.createElement(r,{key:JSON.stringify(n),...n})}if(`title`in e)return T.createElement(`title`,{key:`title`},String(e.title));if(`charset`in e&&(e.charSet??=e.charset,delete e.charset),`charSet`in e&&e.charSet!=null)return typeof e.charSet==`string`?T.createElement(`meta`,{key:`charSet`,charSet:e.charSet}):null;if(`script:ld+json`in e)try{let t=JSON.stringify(e[`script:ld+json`]);return T.createElement(`script`,{key:`script:ld+json:${t}`,type:`application/ld+json`,dangerouslySetInnerHTML:{__html:te(t)}})}catch{return null}return T.createElement(`meta`,{key:JSON.stringify(e),...e})}))}function et(e){return typeof e==`string`&&/^(meta|link)$/.test(e)}var Q=!1;function tt(){Q=!0}function nt(e){let{manifest:n,serverHandoffString:r,isSpaMode:i,renderMeta:a,routeDiscovery:o,ssr:s,nonce:c}=Y(),{router:l,static:u,staticContext:d}=p(`Scripts`),{matches:m}=g(`Scripts`),h=t(),_=G(o,s);e.nonce==null&&c&&(e={...e,nonce:c}),a&&(a.didRenderScripts=!0);let v=Z(m,null,i);T.useEffect(()=>{tt()},[]);let y=T.useMemo(()=>{if(h)return null;let t=d?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:` `,i=u?`${n.hmr?.runtime?`import ${JSON.stringify(n.hmr.runtime)};`:``}${_?``:`import ${JSON.stringify(n.url)}`};
5${v.map((e,t)=>{let r=`route${t}`,i=n.routes[e.route.id];b(i,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:o,clientMiddlewareModule:s,hydrateFallbackModule:c,module:l}=i,u=[...a?[{module:a,varName:`${r}_clientAction`}]:[],...o?[{module:o,varName:`${r}_clientLoader`}]:[],...s?[{module:s,varName:`${r}_clientMiddleware`}]:[],...c?[{module:c,varName:`${r}_HydrateFallback`}]:[],{module:l,varName:`${r}_main`}];return u.length===1?`import * as ${r} from ${JSON.stringify(l)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join(`
6`),`const ${r} = {${u.map(e=>`...${e.varName}`).join(`,`)}};`].join(`
7`)}).join(`
8`)}
9  ${_?`window.__reactRouterManifest = ${JSON.stringify(Le(n,l),null,2)};`:``}
10  window.__reactRouterRouteModules = {${v.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(`,`)}};
11
12import(${JSON.stringify(n.entry.module)});`:` `;return T.createElement(T.Fragment,null,T.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t},type:void 0}),T.createElement(`script`,{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:i},type:`module`,async:!0}))},[]),ee=Q||h?[]:[...new Set(n.entry.imports.concat(L(v,n,{includeHydrateFallback:!0})))],x=typeof n.sri==`object`?n.sri:{};return f(!h,`The <Scripts /> element is a no-op when using RSC and can be safely removed.`),Q||h?null:T.createElement(T.Fragment,null,typeof n.sri==`object`?T.createElement(`script`,{...e,"rr-importmap":``,type:`importmap`,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:x})}}):null,_?null:T.createElement(`link`,{rel:`modulepreload`,href:n.url,crossOrigin:e.crossOrigin,integrity:x[n.url],nonce:e.nonce,suppressHydrationWarning:!0}),T.createElement(`link`,{rel:`modulepreload`,href:n.entry.module,crossOrigin:e.crossOrigin,integrity:x[n.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),ee.map(t=>T.createElement(`link`,{key:t,rel:`modulepreload`,href:t,crossOrigin:e.crossOrigin,integrity:x[t],nonce:e.nonce,suppressHydrationWarning:!0})),y)}function rt(...e){return t=>
12{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var it=class extends T.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location===e.location?{error:e.error||t.error,location:t.location}:{error:e.error||null,location:e.location}}render(){return this.state.error?T.createElement(at,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function at({error:e,isOutsideRemixApp:t}){let{nonce:n}=Y();console.error(e);let r=T.createElement(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:`
13        console.log(
14          "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
15        );
16      `}});if(l(e))return T.createElement($,{title:`Unhandled Thrown Response!`},T.createElement(`h1`,{style:{fontSize:`24px`}},e.status,` `,e.statusText),null);let i;if(e instanceof Error)i=e;else{let t=e==null?`Unknown Error`:typeof e==`object`&&`toString`in e?e.toString():JSON.stringify(e);i=Error(t)}return T.createElement($,{title:`Application Error!`,isOutsideRemixApp:t},T.createElement(`h1`,{style:{fontSize:`24px`}},`Application Error`),T.createElement(`pre`,{style:{padding:`2rem`,background:`hsla(10, 50%, 50%, 0.1)`,color:`red`,overflow:`auto`}},i.stack),r)}function $({title:e,renderScripts:t,isOutsideRemixApp:n,children:r}){let{routeModules:i}=Y();return i.root?.Layout&&!n?r:T.createElement(`html`,{lang:`en`},T.createElement(`head`,null,T.createElement(`meta`,{charSet:`utf-8`}),T.createElement(`meta`,{name:`viewport`,content:`width=device-width,initial-scale=1,viewport-fit=cover`}),T.createElement(`title`,null,e)),T.createElement(`body`,null,T.createElement(`main`,{style:{fontFamily:`system-ui, sans-serif`,padding:`2rem`}},r,t?T.createElement(nt,null):null)))}export{Ye as a,Ke as c,H as d,ke as f,te as g,ue as h,$e as i,Re as l,O as m,J as n,nt as o,Pe as p,Je as r,rt as s,it as t,ze as u};
17//# sourceMappingURL=errorBoundaries-CkKDK3WZ.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.