const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-segment-context-Dk2VCQ3m.js","assets/rolldown-runtime-S-ySWqyJ.js","assets/framework-CXnKph_e.js","assets/StoryExperience-CXslxCdS.js"])))=>i.map(i=>d[i]); import{n as e,r as t,t as n}from"./rolldown-runtime-S-ySWqyJ.js";import{i as r,n as i,r as a,t as o}from"./framework-CXnKph_e.js";var s=`X-Vinext-Params`,c=`X-Vinext-Mounted-Slots`,l=`X-Vinext-Interception-Context`,u=`X-Vinext-Rsc-Render-Mode`,d=`x-rsc-action`,f=`x-nextjs-action-not-found`,p=`x-action-redirect`,m=`Next-Router-State-Tree`,h=`Next-Router-Prefetch`,g=`Next-Router-Segment-Prefetch`,_=`Next-Url`,v=`[\\u0000-\\u001F \\u200B\\uFEFF]*`,y=`[\\r\\n\\t]*`;function b(e){let t=e.split(``).join(y);return RegExp(`^${v}${t}${y}:`,`i`)}var x=[b(`javascript`),b(`data`),b(`vbscript`)],S=`Next.js has blocked a javascript: URL as a security precaution.`;function C(e){let t=``+e;return x.some(e=>e.test(t))}function ee(e){if(C(e))throw Error(S)}var w=`navigation`,T=`refresh-preserve-ui`,E=`action-rerender-preserve-ui`;function D(e){switch(e){case T:return T;case E:return E;default:return w}}var te=`0.0.50`;function O(e){if(typeof window>`u`)return;let t=window.next;if(t){e.version!==void 0&&(t.version=e.version),e.appDir!==void 0&&(t.appDir=e.appDir),e.router!==void 0&&(t.router=e.router),e.__pendingUrl!==void 0&&(t.__pendingUrl=e.__pendingUrl),e.__internal_src_page!==void 0&&(t.__internal_src_page=e.__internal_src_page);return}window.next={version:e.version??te,...e}}var k=null;function A(e){return Object.values(e).some(e=>typeof e==`function`)?e:null}function j(e){return k=e,k}function M(e,t){k?.onRouterTransitionStart?.(e,t)}function ne(e={}){return{schemaVersion:1,graphVersion:e.graphVersion??null,deploymentVersion:e.deploymentVersion??null,appElementsSchemaVersion:1,rscPayloadSchemaVersion:1,rootBoundaryId:e.rootBoundaryId??null,renderEpoch:e.renderEpoch??null}}function re(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){return typeof e==`string`||e===null}function ie(e){return e.schemaVersion===1&&e.appElementsSchemaVersion===1&&e.rscPayloadSchemaVersion===1}function P(e){return!re(e)||!ie(e)||!N(e.graphVersion)||!N(e.deploymentVersion)||!N(e.rootBoundaryId)||!N(e.renderEpoch)?null:{schemaVersion:1,graphVersion:e.graphVersion,deploymentVersion:e.deploymentVersion,appElementsSchemaVersion:1,rscPayloadSchemaVersion:1,rootBoundaryId:e.rootBoundaryId,renderEpoch:e.renderEpoch}}var F=t(r(),1),I=`\0`,ae=`__artifactCompatibility`,oe=`__interceptionContext`,L=`__layoutIds`,R=`__layoutFlags`,z=`__route`,se=`__rootLayout`,ce=`__VINEXT_UNMATCHED_SLOT__`,B=Symbol.for(`vinext.unmatchedSlot`);function le(e,t){return t===null?e:`${e}${I}${t}`}function ue(e,t){return le(`route:${e}`,t)}function de(e,t){return le(`page:${e}`,t)}function fe(e){return`layout:${e}`}function pe(e){return`template:${e}`}function me(e,t){return`slot:${e}:${t}`}function he(e,t){return le(e,t)}function ge(e){let t=e.indexOf(I),n=t===-1?e:e.slice(0,t);return n.startsWith(`/`)?{interceptionContext:t===-1?null:e.slice(t+1),path:n}:null}function _e(e){return e.startsWith(`/`)?e:null}function ve(e){if(e.startsWith(`route:`)){let t=ge(e.slice(6));return t?{interceptionContext:t.interceptionContext,kind:`route`,path:t.path}:null}if(e.startsWith(`page:`)){let t=ge(e.slice(5));return t?{interceptionContext:t.interceptionContext,kind:`page`,path:t.path}:null}if(e.startsWith(`layout:`)){let t=_e(e.slice(7));return t?{kind:`layout`,treePath:t}:null}if(e.startsWith(`template:`)){let t=_e(e.slice(9));return t?{kind:`template`,treePath:t}:null}if(e.startsWith(`slot:`)){let t=e.slice(5),n=t.indexOf(`:`);if(n<=0)return null;let r=t.slice(0,n),i=_e(t.slice(n+1));return i?{kind:`slot`,name:r,treePath:i}:null}return null}function ye(e){if(!e.startsWith(`slot:`))return!1;let t=e.slice(5),n=t.indexOf(`:`);return n>0&&t.charCodeAt(n+1)===47}function be(e){return{[z]:e.routeId,[oe]:e.interceptionContext,[L]:[...e.layoutIds??[]],[se]:e.rootLayoutTreePath}}function xe(e){let t=!1;for(let[n,r]of Object.entries(e))if(ye(n)&&r===`__VINEXT_UNMATCHED_SLOT__`){t=!0;break}if(!t)return e;let n={};for(let[t,r]of Object.entries(e))n[t]=ye(t)&&r===`__VINEXT_UNMATCHED_SLOT__`?B:r;return n}function Se(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;for(let t of Object.values(e))if(t!==`s`&&t!==`d`)return!1;return!0}function Ce(e){return Se(e)?e:{}}function we(e){if(e===void 0)return[];if(!Array.isArray(e))throw Error(`[vinext] Invalid __layoutIds in App Router payload: expected layout id string[]`);let t=[];for(let n of e){if(typeof n!=`string`)throw Error(`[vinext] Invalid __layoutIds in App Router payload: expected layout id string[]`);if(ve(n)?.kind!==`layout`)throw Error(`[vinext] Invalid __layoutIds in App Router payload: expected layout ids`);t.push(n)}return t}function Te(e){return!(typeof e!=`object`||!e||Array.isArray(e)||(0,F.isValidElement)(e))}function Ee(e,t){return{...e,[R]:t}}function V(e){return Te(e.element)?{...e.element,[R]:e.layoutFlags,[ae]:e.artifactCompatibility??ne()}:e.element}function De(e){return e===void 0?ne():P(e)??ne()}function Oe(e){let t=e[z];if(typeof t!=`string`)throw Error(`[vinext] Missing __route string in App Router payload`);let n=e[oe];if(n!=null&&typeof n!=`string`)throw Error(`[vinext] Invalid __interceptionContext in App Router payload`);let r=e[se];if(r===void 0)throw Error(`[vinext] Missing __rootLayout key in App Router payload`);if(r!==null&&typeof r!=`string`)throw Error(`[vinext] Invalid __rootLayout in App Router payload: expected string or null`);let i=Ce(e[R]),a=we(e[L]);return{artifactCompatibility:De(e[ae]),interceptionContext:n??null,layoutIds:a,layoutFlags:i,routeId:t,rootLayoutTreePath:r}}var H={keys:{artifactCompatibility:ae,interceptionContext:oe,layoutIds:L,layoutFlags:R,rootLayout:se,route:z},unmatchedSlotValue:ce,createMetadataEntries:be,decode:xe,encodeCacheKey:he,encodeLayoutId:fe,encodeOutgoingPayload:V,encodePageId:de,encodeRouteId:ue,encodeSlotId:me,encodeTemplateId:pe,isSlotId:ye,parseElementKey:ve,readMetadata:Oe,withLayoutFlags:Ee};function ke(e){return e&&Array.from(new Set(e.split(/\s+/).filter(Boolean))).sort().join(` `)||null}function Ae(e){return Object.keys(e).filter(t=>{let n=e[t];return H.isSlotId(t)&&n!=null&&n!==B}).sort()}function je(e){return ke(Ae(e).join(` `))}function Me(e,t){return t??e}var Ne=`_rsc`,Pe=`text/x-component`;[`RSC`,`Accept`,m,h,g,_,l,c,u].join(`, `);var Fe=12,Ie=new TextEncoder;function Le(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/,``)}function Re(e){return e??`0`}function ze(e){let t=D(e);return t===`navigation`?null:t}function Be(e,t={}){let n=[e.get(h),e.get(g),e.get(m),e.get(_),e.get(l),e.get(c),...t.includeRenderModeHeader===!1?[]:[ze(e.get(u))]];return n.every(e=>e===null)?null:n.map(Re).join(`,`)}async function Ve(e){let t=await globalThis.crypto.subtle.digest(`SHA-256`,Ie.encode(e));return Le(new Uint8Array(t).subarray(0,Fe))}function He(e){return(e.search.startsWith(`?`)?e.search.slice(1):e.search).split(`&`).filter(e=>e.length>0&&!Ue(e))}function Ue(e){let t=e.indexOf(`=`),n=t===-1?e:e.slice(0,t);try{return decodeURIComponent(n.replaceAll(`+`,` `))===Ne}catch{return n===Ne}}async function We(e){let t=Be(e);return t===null?``:Ve(t)}function Ge(e,t){let n=He(e);n.push(t.length>0?`${Ne}=${t}`:Ne),e.search=`?${n.join(`&`)}`}function Ke(e){let t=He(e);e.search=t.length>0?`?${t.join(`&`)}`:``}function qe(e){return e.endsWith(`.rsc`)?e.slice(0,-4):e}function Je(e={}){let t=new Headers({Accept:Pe,RSC:`1`});e.interceptionContext!==void 0&&e.interceptionContext!==null&&t.set(l,e.interceptionContext),e.mountedSlotsHeader!==void 0&&e.mountedSlotsHeader!==null&&t.set(c,e.mountedSlotsHeader);let n=e.renderMode??`navigation`;return n!==`navigation`&&t.set(u,n),t}function Ye(e){let t=e.indexOf(`#`),n=t===-1?e:e.slice(0,t),r=n.indexOf(`?`),i=r===-1?n:n.slice(0,r),a=r===-1?``:n.slice(r);return`${i.length>1&&i.endsWith(`/`)?i.slice(0,-1):i}.rsc${a}`}async function Xe(e,t){let n=new URL(Ye(e),`http://vinext.local`);return Ge(n,await We(t)),`${n.pathname}${n.search}`}function Ze(e,t){return t?e===t||e.startsWith(t+`/`):!1}function U(e,t){return Ze(e,t)?e.slice(t.length)||`/`:e}function Qe(e){if(typeof window>`u`)return null;try{let t=e.startsWith(`//`)?new URL(e,window.location.origin):new URL(e);if(t.origin===window.location.origin)return t.pathname+t.search+t.hash}catch{}return null}function $e(e,t){let n=Qe(e);if(n==null||!t)return n;try{let e=new URL(n,`http://vinext.local`);return Ze(e.pathname,t)?U(e.pathname,t)+e.search+e.hash:null}catch{return n}}function et(e,t){return!t||!e.startsWith(`/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)?e:t+e}function tt(e,t,n=``){let r=t??(typeof window<`u`?window.location.href:void 0);if(!r||e.startsWith(`/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`))return e;try{let t=new URL(e,r);return(n&&t.pathname===n?``:n?U(t.pathname,n):t.pathname)+t.search+t.hash}catch{return e}}function nt(e,t,n=``){let r=tt(e,t,n);return n?r===``?n:r.startsWith(`?`)||r.startsWith(`#`)?n+r:et(r,n):et(r,n)}function rt(e,t,n=``){try{let r=new URL(t),i=new URL(e,t);return U(r.pathname,n)===U(i.pathname,n)&&r.search===i.search&&i.hash!==``}catch{return!1}}var it=class extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}},at=class extends URLSearchParams{append(e,t){throw new it}delete(e,t){throw new it}set(e,t){throw new it}sort(){throw new it}},ot=Symbol.for(`vinext.layoutSegmentContext`),st=Symbol.for(`vinext.serverInsertedHTMLContext`);function ct(){if(typeof F.createContext!=`function`)return null;let e=globalThis;return e[st]||(e[st]=F.createContext(null)),e[st]??null}ct();function lt(){if(typeof F.createContext!=`function`)return null;let e=globalThis;return e[ot]||(e[ot]=F.createContext({children:[]})),e[ot]??null}var ut=Symbol.for(`vinext.navigation.globalAccessors`),dt=Symbol.for(`vinext.navigation.clientHydrationContext`);function ft(){return globalThis[ut]}function pt(){let e=globalThis;if(Object.prototype.hasOwnProperty.call(e,dt))return e[dt]??null}function mt(e){globalThis[dt]=e}var ht=null,gt=()=>{if(typeof window<`u`){let e=pt();return e===void 0?ht:e}let e=ft();return e?e.getServerContext():ht},_t=e=>{if(typeof window<`u`){ht=e,mt(e);return}let t=ft();t?t.setServerContext(e):ht=e};function vt(e){_t(e)}var W=typeof window>`u`;function yt(){return W?null:U(window.location.pathname,``)}function bt(){return W?`/`:window.location.pathname+window.location.search}function xt(){return W?new Map:(window.__VINEXT_RSC_PREFETCH_CACHE__||(window.__VINEXT_RSC_PREFETCH_CACHE__=new Map),window.__VINEXT_RSC_PREFETCH_CACHE__)}function St(){return W?new Set:(window.__VINEXT_RSC_PREFETCHED_URLS__||(window.__VINEXT_RSC_PREFETCHED_URLS__=new Set),window.__VINEXT_RSC_PREFETCHED_URLS__)}function Ct(){let e=xt();if(e.size<50)return;let t=Date.now(),n=St();for(let[r,i]of e)t-i.timestamp>=3e4&&(e.delete(r),n.delete(r));for(;e.size>=50;){let t=e.keys().next().value;if(t!==void 0)e.delete(t),n.delete(t);else break}}async function wt(e){return{buffer:await e.arrayBuffer(),contentType:e.headers.get(`content-type`)??`text/x-component`,mountedSlotsHeader:e.headers.get(c),paramsHeader:e.headers.get(s),url:e.url}}function Tt(e,t=!0){let n=new Headers({"content-type":e.contentType});return e.mountedSlotsHeader!=null&&n.set(c,e.mountedSlotsHeader),e.paramsHeader!=null&&n.set(s,e.paramsHeader),new Response(t?e.buffer.slice(0):e.buffer,{status:200,headers:n})}function Et(e,t,n=null,r=null){let i=H.encodeCacheKey(e,n),a=xt(),o=St(),s={outcome:`pending`,timestamp:Date.now()};s.pending=t.then(async e=>{e.ok?s.snapshot={...await wt(e),mountedSlotsHeader:r}:(o.delete(i),a.delete(i))}).catch(()=>{o.delete(i),a.delete(i)}).finally(()=>{s.pending=void 0,s.snapshot&&(s.outcome=`cache-seeded`)}),a.set(i,s),Ct()}function Dt(e,t=null,n=null){let r=H.encodeCacheKey(e,t),i=xt(),a=i.get(r);return!a||a.pending||a.outcome!==`cache-seeded`?null:(i.delete(r),St().delete(r),a.snapshot?(a.snapshot.mountedSlotsHeader??null)!==n||Date.now()-a.timestamp>=3e4?null:a.snapshot:null)}var Ot=Symbol.for(`vinext.clientNavigationState`),kt=Symbol.for(`vinext.mountedSlotsHeader`);function At(e){if(W)return;let t=window;t[kt]=e}function jt(){return W?null:window[kt]??null}function G(){if(W)return null;let e=window;return e[Ot]??={listeners:new Set,cachedSearch:window.location.search,cachedReadonlySearchParams:new at(window.location.search),cachedPathname:U(window.location.pathname,``),clientParams:{},clientParamsJson:`{}`,pendingClientParams:null,pendingClientParamsJson:null,pendingPathname:null,pendingPathnameNavId:null,originalPushState:window.history.pushState.bind(window.history),originalReplaceState:window.history.replaceState.bind(window.history),patchInstalled:!1,hasPendingNavigationUpdate:!1,suppressUrlNotifyCount:0,navigationSnapshotActiveCount:0},e[Ot]}function Mt(){let e=G();if(e)for(let t of e.listeners)t()}function Nt(){return G()?.cachedPathname??`/`}function Pt(){let e=G();if(!e)return!1;let t=!1,n=U(window.location.pathname,``);n!==e.cachedPathname&&(e.cachedPathname=n,t=!0);let r=window.location.search;return r!==e.cachedSearch&&(e.cachedSearch=r,e.cachedReadonlySearchParams=new at(r),t=!0),t}function Ft(){let e=G();e&&e.navigationSnapshotActiveCount++}var It=Symbol.for(`vinext.clientNavigationRenderContext`);function Lt(){if(typeof F.createContext!=`function`)return null;let e=globalThis;return e[It]||(e[It]=F.createContext(null)),e[It]??null}function Rt(){let e=Lt();if(!e||typeof F.useContext!=`function`)return null;try{return F.useContext(e)}catch{return null}}function zt(e,t){let n=typeof window<`u`?window.location.origin:`http://localhost`,r=new URL(e,n);return{pathname:U(r.pathname,``),searchParams:new at(r.search),params:t}}var Bt=`{}`;function Vt(e){let t=G();if(!t){let t=JSON.stringify(e);t!==Bt&&(Bt=t);return}let n=JSON.stringify(e);n!==t.clientParamsJson&&(t.clientParams=e,t.clientParamsJson=n,t.pendingClientParams=null,t.pendingClientParamsJson=null,Mt())}function Ht(e){let t=G();if(!t)return;let n=JSON.stringify(e);n!==t.clientParamsJson&&n!==t.pendingClientParamsJson&&(t.pendingClientParams=e,t.pendingClientParamsJson=n,t.hasPendingNavigationUpdate=!0)}function Ut(e,t){let n=G();n&&(n.pendingPathname=U(e,``),n.pendingPathnameNavId=t)}function Wt(e){let t=G();t&&(t.pendingPathnameNavId===null||t.pendingPathnameNavId===e)&&(t.pendingPathname=null,t.pendingPathnameNavId=null)}function Gt(e){let t=G();return t?(t.listeners.add(e),()=>{t.listeners.delete(e)}):()=>{}}function Kt(){if(W)return gt()?.pathname??`/`;let e=Rt(),t=F.useSyncExternalStore(Gt,Nt,()=>gt()?.pathname??`/`);return e&&(G()?.navigationSnapshotActiveCount??0)>0?e.pathname:t}function qt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`)}function Jt(e){return typeof window>`u`?!1:e.startsWith(`#`)?!0:rt(e,window.location.href,``)}function Yt(e){if(!e||e===`#`){window.scrollTo(0,0);return}let t=e.slice(1),n=document.getElementById(t);n&&n.scrollIntoView({behavior:`auto`})}function Xt(e){let t=G();if(!t)return e();t.suppressUrlNotifyCount+=1;try{return e()}finally{--t.suppressUrlNotifyCount}}function K(e,t){if(W)return;let n=G();if(!n)return;(e!==void 0||t?.releaseSnapshot===!0)&&n.navigationSnapshotActiveCount>0&&--n.navigationSnapshotActiveCount;let r=Pt();n.pendingClientParams!==null&&n.pendingClientParamsJson!==null&&(n.clientParams=n.pendingClientParams,n.clientParamsJson=n.pendingClientParamsJson,n.pendingClientParams=null,n.pendingClientParamsJson=null),(n.pendingPathnameNavId===null||e!==void 0&&n.pendingPathnameNavId===e)&&(n.pendingPathname=null,n.pendingPathnameNavId=null);let i=r||n.hasPendingNavigationUpdate;n.hasPendingNavigationUpdate=!1,i&&Mt()}function Zt(e,t,n){Xt(()=>{G()?.originalPushState.call(window.history,e,t,n)})}function q(e,t,n){Xt(()=>{G()?.originalReplaceState.call(window.history,e,t,n)})}function Qt(){q({...window.history.state??{},__vinext_scrollX:window.scrollX,__vinext_scrollY:window.scrollY},``)}function $t(e){if(e&&typeof e==`object`&&`__vinext_scrollY`in e){let{__vinext_scrollX:t,__vinext_scrollY:n}=e;Promise.resolve().then(()=>{let e=window.__VINEXT_RSC_PENDING__??null;e?e.then(()=>{requestAnimationFrame(()=>{window.scrollTo(t,n)})}):requestAnimationFrame(()=>{window.scrollTo(t,n)})})}}async function en(e,t,n,r=!1){let i=e;if(qt(e)){let n=$e(e,``);if(n==null){t===`replace`?window.location.replace(e):window.location.assign(e);return}i=n}let a=nt(i,window.location.href,``);if(M(a,t),t===`push`&&Qt(),Jt(a)){let e=a.includes(`#`)?a.slice(a.indexOf(`#`)):``;t===`replace`?q(null,``,a):Zt(null,``,a),K(),n&&Yt(e);return}let o=a.indexOf(`#`),s=o===-1?``:a.slice(o);typeof window.__VINEXT_RSC_NAVIGATE__==`function`?await window.__VINEXT_RSC_NAVIGATE__(a,0,`navigate`,t,void 0,r):(t===`replace`?q(null,``,a):Zt(null,``,a),K()),n&&(s?Yt(s):window.scrollTo(0,0))}var tn={bfcacheId:`0`,push(e,t){ee(e),!W&&F.startTransition(()=>{en(e,`push`,t?.scroll!==!1,!0)})},replace(e,t){ee(e),!W&&F.startTransition(()=>{en(e,`replace`,t?.scroll!==!1,!0)})},back(){W||window.history.back()},forward(){W||window.history.forward()},refresh(){if(W)return;let e=window.__VINEXT_CLEAR_NAV_CACHES__;typeof e==`function`&&e();let t=window.__VINEXT_RSC_NAVIGATE__;typeof t==`function`&&F.startTransition(()=>{t(window.location.href,0,`refresh`,void 0,void 0,!0)})},prefetch(e){ee(e),!W&&(async()=>{let t=e;if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)){let n=$e(e,``);if(n==null)return;t=n}let n=nt(t,window.location.href,``),r=yt(),i=jt(),a=Je({interceptionContext:r});i&&a.set(c,i);let o=await Xe(n,a),s=H.encodeCacheKey(o,r),l=St();l.has(s)||(l.add(s),Et(o,fetch(o,{headers:a,credentials:`include`,priority:`low`}),r,i))})().catch(e=>{console.error(`[vinext] RSC prefetch setup error:`,e)})}},nn=tn;function rn(){return tn}var an=`NEXT_HTTP_ERROR_FALLBACK`,on=class extends Error{digest;constructor(e,t){super(e),this.digest=t}};function sn(){throw new on(`NEXT_NOT_FOUND`,`${an};404`)}if(!W){let e=G();e&&!e.patchInstalled&&(e.patchInstalled=!0,window.addEventListener(`popstate`,e=>{typeof window.__VINEXT_RSC_NAVIGATE__!=`function`&&(K(),$t(e.state))}),window.history.pushState=function(t,n,r){e.originalPushState.call(window.history,t,n,r),e.suppressUrlNotifyCount===0&&K()},window.history.replaceState=function(t,n,r){e.originalReplaceState.call(window.history,t,n,r),e.suppressUrlNotifyCount===0&&K()})}function cn(e){return!e||typeof e!=`object`||!(`digest`in e)?null:String(e.digest)}function ln(e){let t=cn(e);return t===null?!1:t===`NEXT_NOT_FOUND`||t.startsWith(`NEXT_HTTP_ERROR_FALLBACK;`)||t.startsWith(`NEXT_REDIRECT;`)}var un=e({DevRecoveryBoundary:()=>On,ErrorBoundary:()=>xn,ErrorBoundaryInner:()=>bn,ForbiddenBoundary:()=>Tn,ForbiddenBoundaryInner:()=>wn,NotFoundBoundary:()=>Cn,RedirectBoundary:()=>yn,RedirectErrorBoundary:()=>vn,UnauthorizedBoundary:()=>Dn,UnauthorizedBoundaryInner:()=>En}),J=a();function dn(e){return e==null||e===``?null:e}function Y(e){return{previousPathname:e.pathname,previousResetKey:dn(e.resetKey)}}function fn(e,t){let n=dn(e.previousResetKey),r=dn(t.previousResetKey);return n!==null||r!==null?n!==r:e.previousPathname!==t.previousPathname}function pn(e){return cn(e)?.startsWith(`NEXT_REDIRECT;`)??!1}function mn(e){try{return decodeURIComponent(e)}catch{return e}}function hn(e){let t=e.digest.split(`;`),n=t.length>=5?t.slice(2,-2).join(`;`):t[2];return n?mn(n):null}function gn(e){return e.digest.split(`;`,2)[1]===`push`?`push`:`replace`}function _n({redirect:e,redirectType:t}){let n=rn();return F.useEffect(()=>{F.startTransition(()=>{t===`push`?n.push(e):n.replace(e)})},[e,t,n]),null}var vn=class extends F.Component{constructor(e){super(e),this.state={redirect:null,redirectType:null}}static getDerivedStateFromError(e){if(pn(e)){if(e.handled)return{redirect:null,redirectType:null};let t=hn(e);if(t===null)throw e;return{redirect:t,redirectType:gn(e)}}throw e}render(){let{redirect:e,redirectType:t}=this.state;return e!==null&&t!==null?(0,J.jsx)(_n,{redirect:e,redirectType:t}):this.props.children}};function yn({children:e}){return(0,J.jsx)(vn,{children:e})}var bn=class extends F.Component{constructor(e){super(e),this.state={error:null,...Y(e)}}static getDerivedStateFromProps(e,t){let n=Y(e);return t.error&&fn(n,t)?{error:null,...n}:{error:t.error,...n}}static getDerivedStateFromError(e){if(ln(e))throw e;return{error:{thrownValue:e}}}reset=()=>{this.setState({error:null})};render(){if(this.state.error){let e=this.props.fallback;return(0,J.jsx)(e,{error:this.state.error.thrownValue,reset:this.reset})}return this.props.children}};function xn({fallback:e,children:t,resetKey:n}){return(0,J.jsx)(bn,{pathname:Kt(),resetKey:n,fallback:e,children:t})}var Sn=class extends F.Component{constructor(e){super(e),this.state={notFound:!1,...Y(e)}}static getDerivedStateFromProps(e,t){let n=Y(e);return t.notFound&&fn(n,t)?{notFound:!1,...n}:{notFound:t.notFound,...n}}static getDerivedStateFromError(e){if(e&&typeof e==`object`&&`digest`in e){let t=String(e.digest);if(t===`NEXT_NOT_FOUND`||t===`NEXT_HTTP_ERROR_FALLBACK;404`)return{notFound:!0}}throw e}render(){return this.state.notFound?this.props.fallback:this.props.children}};function Cn({fallback:e,children:t,resetKey:n}){return(0,J.jsx)(Sn,{pathname:Kt(),resetKey:n,fallback:e,children:t})}var wn=class extends F.Component{constructor(e){super(e),this.state={forbidden:!1,...Y(e)}}static getDerivedStateFromProps(e,t){let n=Y(e);return t.forbidden&&fn(n,t)?{forbidden:!1,...n}:{forbidden:t.forbidden,...n}}static getDerivedStateFromError(e){if(e&&typeof e==`object`&&`digest`in e&&String(e.digest)===`NEXT_HTTP_ERROR_FALLBACK;403`)return{forbidden:!0};throw e}render(){return this.state.forbidden?this.props.fallback:this.props.children}};function Tn({fallback:e,children:t,resetKey:n}){return(0,J.jsx)(wn,{pathname:Kt(),resetKey:n,fallback:e,children:t})}var En=class extends F.Component{constructor(e){super(e),this.state={unauthorized:!1,...Y(e)}}static getDerivedStateFromProps(e,t){let n=Y(e);return t.unauthorized&&fn(n,t)?{unauthorized:!1,...n}:{unauthorized:t.unauthorized,...n}}static getDerivedStateFromError(e){if(e&&typeof e==`object`&&`digest`in e&&String(e.digest)===`NEXT_HTTP_ERROR_FALLBACK;401`)return{unauthorized:!0};throw e}render(){return this.state.unauthorized?this.props.fallback:this.props.children}};function Dn({fallback:e,children:t,resetKey:n}){return(0,J.jsx)(En,{pathname:Kt(),resetKey:n,fallback:e,children:t})}var On=class extends F.Component{constructor(e){super(e),this.state={error:null,previousResetKey:e.resetKey}}static getDerivedStateFromProps(e,t){return e.resetKey===t.previousResetKey?null:{error:null,previousResetKey:e.resetKey}}static getDerivedStateFromError(e){if(ln(e))throw e;return{error:{thrownValue:e}}}componentDidCatch(){this.props.onCatch?.(this.props.resetKey)}render(){return this.state.error?null:this.props.children}},kn=e({Children:()=>In,ChildrenContext:()=>Mn,ElementsContext:()=>jn,ParallelSlot:()=>Ln,ParallelSlotsContext:()=>Nn,Slot:()=>Fn,UNMATCHED_SLOT:()=>B,mergeElements:()=>Pn}),An=Object.freeze({}),jn=F.createContext(An),Mn=F.createContext(null),Nn=F.createContext(null);function Pn(e,t,n={}){let r=typeof n==`boolean`?n:n.clearAbsentSlots??!1,i=typeof n==`boolean`?!n:n.preserveAbsentSlots??!0,a=typeof n==`boolean`?[]:n.preserveElementIds??[],o={...t};for(let t of a)if(!Object.hasOwn(o,t)&&Object.hasOwn(e,t)){let n=e[t];n!==void 0&&(o[t]=n)}let s=new Set([...Object.keys(e),...Object.keys(t)].filter(e=>H.isSlotId(e)));for(let n of s)t[n]===B&&Object.hasOwn(e,n)&&(o[n]=e[n]);if(r)for(let e of s)Object.hasOwn(t,e)||delete o[e];else if(i){for(let t of s)if(!Object.hasOwn(o,t)&&Object.hasOwn(e,t)){let n=e[t];n!==void 0&&(o[t]=n)}}return o}function Fn({id:e,children:t,parallelSlots:n}){let r=F.useContext(jn);if(!Object.hasOwn(r,e))return null;let i=r[e];return i===B&&sn(),(0,J.jsx)(Nn.Provider,{value:n??null,children:(0,J.jsx)(Mn.Provider,{value:t??null,children:i})})}function In(){return F.useContext(Mn)}function Ln({name:e}){return F.useContext(Nn)?.[e]??null}j(A(e({})));function Rn(e){return!!e&&typeof e==`object`&&(`returnValue`in e||`root`in e)}function zn(e){return Rn(e)?e.root!==void 0:!0}function Bn(){return globalThis}function Vn(){return Error(`The connection to the page was unexpectedly closed, possibly due to the stop button being clicked, loss of Wi-Fi, or an unstable internet connection.`)}function Hn(e){let t=new TextEncoder;return new ReadableStream({start(n){for(let r of e)n.enqueue(t.encode(r));n.close()}})}function Un(){let e=new TextEncoder;return new ReadableStream({start(t){let n=Bn(),r=n.__VINEXT_RSC_CHUNKS__??[];for(let n of r)t.enqueue(e.encode(n));if(n.__VINEXT_RSC_DONE__){t.close();return}let i=!1,a,o=()=>{let e=a;a=void 0,e?.()},s=()=>{i||(i=!0,o(),t.close())},c=()=>{i||(i=!0,o(),t.error(Vn()))},l=n.__VINEXT_RSC_CHUNKS__??=[];if(l.push=function(...r){let a=Array.prototype.push.apply(this,r);if(i)return a;for(let n of r)t.enqueue(e.encode(n));return n.__VINEXT_RSC_DONE__&&s(),a},typeof document<`u`)if(document.readyState===`loading`)document.addEventListener(`DOMContentLoaded`,c),a=()=>document.removeEventListener(`DOMContentLoaded`,c);else{let e=setTimeout(c);a=()=>clearTimeout(e)}}})}var X={commitCurrent:`NC_COMMIT`,prefetchOnly:`NC_PREFETCH_ONLY`,requestWork:`NC_REQUEST`,rootBoundaryChanged:`NC_ROOT`,rootBoundaryUnknown:`NC_ROOT_UNKNOWN`,staleOperation:`NC_STALE`},Wn={hardNavigate:`NT_HARD_NAVIGATE`,noCommit:`NT_NO_COMMIT`,visibleCommit:`NT_VISIBLE_COMMIT`};function Gn(e){return{...e.activeNavigationId===void 0?{}:{activeNavigationId:e.activeNavigationId},currentRootLayoutTreePath:e.currentRootLayoutTreePath,currentVisibleCommitVersion:e.currentVisibleCommitVersion,nextRootLayoutTreePath:e.nextRootLayoutTreePath,...e.startedNavigationId===void 0?{}:{startedNavigationId:e.startedNavigationId},startedVisibleCommitVersion:e.startedVisibleCommitVersion}}function Kn(e,t={}){return{code:e,fields:{...t}}}function Z(e,t={}){return{schemaVersion:0,entries:[Kn(e,t)]}}function qn(e,t,n={}){return{schemaVersion:e.schemaVersion,entries:[Kn(t,n),...e.entries]}}function Jn(e){return{kind:`requestWork`,token:e.state.nextOperationToken,work:e.work,trace:Z(X.requestWork,{eventKind:e.eventKind,targetHref:Yn(e.work)})}}function Yn(e){switch(e.kind){case`flight`:case`prefetch`:return e.href;case`traverseFlight`:return null;default:throw Error(`[vinext] Unknown requested navigation work: `+String(e))}}function Xn(e){return e.state.traceFields??Gn({currentRootLayoutTreePath:e.state.visibleSnapshot.rootBoundaryId,currentVisibleCommitVersion:e.state.visibleCommitVersion,nextRootLayoutTreePath:e.event.result.targetSnapshot.rootBoundaryId,startedVisibleCommitVersion:e.event.token.baseVisibleCommitVersion})}function Zn(e,t){return e===null||t===null?`rootBoundaryUnknownFallback`:e===t?`currentRootBoundary`:`rootBoundaryChanged`}function Qn(e,t){if(Zn(e.rootBoundaryId,t.rootBoundaryId)!==`currentRootBoundary`)return[];let n=[],r=Math.min(e.layoutIds.length,t.layoutIds.length);for(let i=0;i0?n:null}function lr(e){let t=sr(e)[or];return typeof t==`string`?t:null}function ur(e){return{id:e.id,lane:e.lane,startedVisibleCommitVersion:e.startedVisibleCommitVersion,state:`pending`}}function dr(e,t=``){return e===null?null:U(new URL(e,`http://localhost`).pathname,t)}function fr(e){let t=Je();t.set(d,e.actionId);let n=dr(e.previousNextUrl,e.basePath);n!==null&&t.set(l,n);let r=je(e.elements);return r!==null&&t.set(c,r),{headers:t}}function pr(e){let t=mr(e);return e.startedNavigationId!==e.activeNavigationId||e.pending.action.operation.startedVisibleCommitVersion!==e.currentState.visibleCommitVersion?{disposition:`skip`,preserveElementIds:[],trace:Z(X.staleOperation,t)}:Sr(xr({currentState:e.currentState,pending:e.pending,targetHref:e.targetHref,traceFields:t}))}function mr(e){return{...Gn({activeNavigationId:e.activeNavigationId,currentRootLayoutTreePath:e.currentState.rootLayoutTreePath,currentVisibleCommitVersion:e.currentState.visibleCommitVersion,nextRootLayoutTreePath:e.pending.rootLayoutTreePath,startedNavigationId:e.startedNavigationId,startedVisibleCommitVersion:e.pending.action.operation.startedVisibleCommitVersion}),...e.targetHref===void 0?{}:{targetHref:e.targetHref}}}function hr(e){let t=e.searchParams.toString();return t===``?e.pathname:`${e.pathname}?${t}`}function gr(e){let t=[];for(let n of Ae(e)){let e=H.parseElementKey(n);e?.kind===`slot`&&t.push({ownerLayoutId:H.encodeLayoutId(e.treePath),slotId:n})}return t}function _r(e){return{displayUrl:hr(e.navigationSnapshot),layoutIds:e.layoutIds,matchedUrl:e.navigationSnapshot.pathname,mountedParallelSlots:gr(e.elements),rootBoundaryId:e.rootLayoutTreePath,routeId:e.routeId}}function vr(e){return{displayUrl:hr(e.action.navigationSnapshot),layoutIds:e.action.layoutIds,matchedUrl:e.action.navigationSnapshot.pathname,mountedParallelSlots:gr(e.action.elements),rootBoundaryId:e.rootLayoutTreePath,routeId:e.routeId}}function yr(e){return{baseVisibleCommitVersion:e.pending.action.operation.startedVisibleCommitVersion,deploymentVersion:null,graphVersion:null,lane:e.pending.action.operation.lane,operationId:e.pending.action.operation.id,targetSnapshotFingerprint:br(e.targetSnapshot)}}function br(e){return`${e.routeId}|root:${e.rootBoundaryId??`unknown`}`}function xr(e){let t=vr(e.pending),n=yr({pending:e.pending,targetSnapshot:t});return ar.plan({routeManifest:null,state:{nextOperationToken:n,traceFields:e.traceFields,visibleCommitVersion:e.currentState.visibleCommitVersion,visibleSnapshot:_r(e.currentState)},event:{kind:`flightResponseArrived`,result:{href:e.targetHref??t.displayUrl,targetSnapshot:t},token:n}})}function Sr(e){switch(e.kind){case`proposeCommit`:return{disposition:`dispatch`,preserveAbsentSlots:e.proposal.preserveAbsentSlots,preserveElementIds:e.proposal.preserveElementIds,trace:e.trace};case`hardNavigate`:return{disposition:`hard-navigate`,preserveElementIds:[],trace:e.trace};case`noCommit`:return{disposition:`skip`,preserveElementIds:[],trace:e.trace};case`requestWork`:throw Error(`[vinext] Root-boundary commit planning returned requestWork (${e.work.kind}); flightResponseArrived should never request work`);default:throw Error(`[vinext] Unknown navigation decision: `+String(e))}}async function Cr(e){let t=await e.nextElements,n=H.readMetadata(t),r=e.previousNextUrl===void 0?e.currentState.previousNextUrl:e.previousNextUrl;return{action:{elements:t,interceptionContext:n.interceptionContext,layoutIds:n.layoutIds,layoutFlags:n.layoutFlags,navigationSnapshot:e.navigationSnapshot,operation:ur({id:e.renderId,lane:e.operationLane,startedVisibleCommitVersion:e.currentState.visibleCommitVersion}),previousNextUrl:r,renderId:e.renderId,rootLayoutTreePath:n.rootLayoutTreePath,routeId:n.routeId,type:e.type},interceptionContext:n.interceptionContext,previousNextUrl:r,rootLayoutTreePath:n.rootLayoutTreePath,routeId:n.routeId}}var wr=Symbol(`ApprovedVisibleCommit`);function Tr(e,t){return Er(t),kr(e,t)}function Er(e){if(e[wr]!==!0)throw Error(`[vinext] Visible router state mutation requires ApprovedVisibleCommit`)}function Dr(e,t){return{id:e.id,lane:e.lane,startedVisibleCommitVersion:e.startedVisibleCommitVersion,state:`committed`,visibleCommitVersion:t}}function Or(e,t,n){let r=e.visibleCommitVersion+1;return{...t,activeOperation:Dr(n,r),visibleCommitVersion:r}}function kr(e,t){let{action:n}=t;switch(n.type){case`traverse`:case`navigate`:return Or(e,{elements:Pn(e.elements,n.elements,{clearAbsentSlots:n.type===`traverse`,preserveAbsentSlots:t.decision.preserveAbsentSlots,preserveElementIds:t.decision.preserveElementIds}),interceptionContext:n.interceptionContext,layoutFlags:Mr(e.layoutFlags,n.layoutFlags,t.decision.preserveElementIds),layoutIds:n.layoutIds,navigationSnapshot:n.navigationSnapshot,previousNextUrl:n.previousNextUrl,renderId:n.renderId,rootLayoutTreePath:n.rootLayoutTreePath,routeId:n.routeId},n.operation);case`replace`:return Or(e,{elements:n.elements,interceptionContext:n.interceptionContext,layoutFlags:n.layoutFlags,layoutIds:n.layoutIds,navigationSnapshot:n.navigationSnapshot,previousNextUrl:n.previousNextUrl,renderId:n.renderId,rootLayoutTreePath:n.rootLayoutTreePath,routeId:n.routeId},n.operation);default:{let e=n.type;throw Error(`[vinext] Unknown router action: `+String(e))}}}function Ar(e){let t=pr(e);switch(t.disposition){case`skip`:return{disposition:`no-commit`,trace:t.trace};case`hard-navigate`:return{disposition:`hard-navigate`,trace:t.trace};case`dispatch`:return jr(t.trace,t.preserveElementIds,t.preserveAbsentSlots);default:throw Error(`[vinext] Unknown navigation commit disposition: `+String(t))}}function jr(e=Z(X.commitCurrent),t=[],n=!1){return{disposition:`commit`,preserveAbsentSlots:n,preserveElementIds:[...t],trace:e}}function Mr(e,t,n){let r={...t};for(let t of n){if(Object.hasOwn(r,t))continue;let n=e[t];n&&(r[t]=n)}return r}function Nr(e){return{[wr]:!0,action:e.pending.action,decision:e.decision,interceptionContext:e.pending.interceptionContext,previousNextUrl:e.pending.previousNextUrl,rootLayoutTreePath:e.pending.rootLayoutTreePath,routeId:e.pending.routeId}}function Pr(e){return{operationLane:e.action.operation.lane,pendingOperationId:e.action.operation.id,startedVisibleCommitVersion:e.action.operation.startedVisibleCommitVersion}}function Fr(e,t,n){return qn(e,t,Pr(n))}function Ir(e,t){switch(e.disposition){case`commit`:return{...e,trace:Fr(e.trace,Wn.visibleCommit,t)};case`hard-navigate`:return{...e,trace:Fr(e.trace,Wn.hardNavigate,t)};case`no-commit`:return{...e,trace:Fr(e.trace,Wn.noCommit,t)};default:throw Error(`[vinext] Unknown commit decision: `+String(e))}}function Lr(e){if(e.action.operation.lane!==`hmr`)throw Error(`[vinext] HMR visible commit approval requires an HMR pending operation`);let t=Ir(jr(),e);if(t.disposition!==`commit`)throw Error(`[vinext] HMR visible commit approval did not produce a commit decision`);return Nr({decision:t,pending:e})}function Rr(e){let t=Ir(Ar({activeNavigationId:e.activeNavigationId,currentState:e.currentState,pending:e.pending,startedNavigationId:e.startedNavigationId,targetHref:e.targetHref}),e.pending);switch(t.disposition){case`commit`:return{approvedCommit:Nr({decision:t,pending:e.pending}),decision:t};case`hard-navigate`:case`no-commit`:return{approvedCommit:null,decision:t};default:throw Error(`[vinext] Unknown commit decision: `+String(t))}}async function zr(e){let t=await Cr({currentState:e.currentState,nextElements:e.nextElements,navigationSnapshot:e.navigationSnapshot,operationLane:e.operationLane,previousNextUrl:e.previousNextUrl,renderId:e.renderId,type:e.type}),n=e.getCurrentStateForApproval?.()??e.currentState,r=Rr({activeNavigationId:e.getActiveNavigationId?.()??e.activeNavigationId,currentState:n,pending:t,startedNavigationId:e.startedNavigationId,targetHref:e.targetHref});return{approvedCommit:r.approvedCommit,decision:r.decision,pending:t,trace:r.decision.trace}}var Br=`__vinext_hard_navigation_target__`;function Vr(e){try{return new URL(e,window.location.href).href}catch{return e}}function Hr(){try{return window.sessionStorage.getItem(Br)}catch{return null}}function Ur(e){try{return window.sessionStorage.setItem(Br,e),window.sessionStorage.getItem(Br)===e}catch{return!1}}function Wr(){try{window.sessionStorage.removeItem(Br)}catch{}}function Gr(e,t=`assign`){let n=Vr(e),r=Vr(window.location.href);return Hr()===n&&r===n?(Wr(),console.error(`[vinext] Prevented repeated hard navigation to ${n}; leaving the current document in place to avoid a reload loop.`),!1):!Ur(n)&&r===n?(console.error(`[vinext] Hard navigation to ${n} requires a reload-loop guard, but sessionStorage is unavailable; leaving the current document in place.`),!1):(t===`replace`?window.location.replace(e):window.location.assign(e),!0)}function Kr(e={}){let t=e.commitClientNavigationState??K,n=e.performHardNavigation??Gr,r=0,i=0,a=new Map,o=new Map,s=null,c=null,l=null,u=null,d=null,f=!1;function p(){if(!s)throw Error(`[vinext] Browser router state setter is not initialized`);return s}function m(){if(!c)throw Error(`[vinext] Browser router state is not initialized`);return c.current}function h(){return c||f?Promise.resolve():(d||=new Promise(e=>{u=e}),d)}function g(){f=!0;let e=u;u=null,d=null,e?.()}function _(){return i+=1,i}function v(){return r+=1,r}function y(){return c!==null}function b(e){return e===i}function x(){let e=p();l&&!l.settled&&(l.settled=!0,l.resolve(m()));let t,n=new Promise(e=>{t=e});if(!t)throw Error(`[vinext] Failed to initialize browser router promise`);let r={promise:n,resolve:t,settled:!1};return l=r,e(n),r}function S(e){!e||e.settled||(e.settled=!0,e.resolve(m()),l===e&&(l=null))}function C(e,t){S(t),b(e)&&Wt(e)}function ee(e,t){!e||e.settled||(e.settled=!0,e.resolve(Tr(m(),t)),l===e&&(l=null))}function w(e,t){t&&o.set(e,t)}function T(e){for(let[n,r]of o)n>e||(o.delete(n),n===e?r():t(void 0,{releaseSnapshot:!0}))}function E(e){for(let[t,n]of a)t>e||(a.delete(t),n())}async function D(e,t){if(!y())return;let n=await Cr({currentState:m(),nextElements:e,navigationSnapshot:t,operationLane:`hmr`,renderId:v(),type:`replace`});y()&&k(Lr(n))}function te({renderId:e,children:t}){return(0,F.useLayoutEffect)(()=>{T(e);let t=requestAnimationFrame(()=>{E(e)});return()=>{cancelAnimationFrame(t),E(e)}},[e]),t}function O(e,t){let n=p();if(t){ee(t,e);return}(0,F.startTransition)(()=>{n(Tr(m(),e))})}function k(e){p()(Tr(m(),e))}async function A(e){let r=v(),s,c=new Promise(e=>{s=e,a.set(r,e)}),l=!1;try{let t=await Cr({currentState:m(),nextElements:e.nextElements,navigationSnapshot:e.navigationSnapshot,operationLane:e.operationLane,previousNextUrl:e.previousNextUrl,renderId:r,type:e.actionType}),o=Rr({activeNavigationId:i,currentState:m(),pending:t,startedNavigationId:e.navId,targetHref:e.targetHref});if(o.decision.disposition===`no-commit`)return S(e.pendingRouterState),a.delete(r),s?.(),`no-commit`;if(o.decision.disposition===`hard-navigate`)return S(e.pendingRouterState),a.delete(r),n(e.targetHref)?`hard-navigate`:`no-commit`;let c=o.approvedCommit;if(c===null)throw Error(`[vinext] Commit decision did not approve a visible commit`);w(r,e.createNavigationCommitEffect({href:e.targetHref,historyUpdateMode:e.historyUpdateMode,navId:e.navId,params:e.params,previousNextUrl:c.previousNextUrl})),Ft(),l=!0,O(c,e.pendingRouterState)}catch(n){throw o.delete(r),a.delete(r),l&&t(e.navId),S(e.pendingRouterState),s?.(),n}return c.then(()=>`committed`)}async function j(e,t,r,a){let o=a??m(),s=i,{approvedCommit:c,decision:l,pending:u,trace:d}=await zr({activeNavigationId:i,currentState:o,getActiveNavigationId:()=>i,getCurrentStateForApproval:m,navigationSnapshot:t,nextElements:e,renderId:v(),operationLane:`server-action`,startedNavigationId:s,targetHref:window.location.href,type:`navigate`});if(l.disposition===`hard-navigate`){n(window.location.href);return}if(c){let e=Rr({activeNavigationId:i,currentState:m(),pending:u,startedNavigationId:s,targetHref:window.location.href});if(e.decision.disposition===`hard-navigate`){n(window.location.href);return}e.approvedCommit&&k(e.approvedCommit)}if(r){if(!r.ok)throw r.data;return r.data}}function M(e,t){return s=e,c=t,g(),()=>{s===e&&(s=null),c===t&&(c=null,f=!1)}}return{beginNavigation:_,hasBrowserRouterState:y,getBrowserRouterState:m,isCurrentNavigation:b,waitForBrowserRouterStateReady:h,attachBrowserRouterState:M,beginPendingBrowserRouterState:x,finalizeNavigation:C,renderNavigationPayload:A,commitSameUrlNavigatePayload:j,hmrReplaceTree:D,drainPrePaintEffects:T,NavigationCommitSignal:te}}var qr=`__VINEXT_RSC_FORM_STATE__`;function Jr(e){let t=e.__VINEXT_RSC_FORM_STATE__??null;return delete e[qr],t}function Yr(e){let t={formState:e.formState,onUncaughtError:e.onUncaughtError};return e.onCaughtError?{...t,onCaughtError:e.onCaughtError}:t}function Xr(e){return(t,n)=>{console.error(t),n?.componentStack&&console.error(`The above error occurred in a React component: `+n.componentStack);let r=e();r!==null&&window.location.assign(r)}}var Zr=o(),Qr=`https://nextjs.org/docs/messages/failed-to-find-server-action`;function $r(e){return`Server Action "${e}" was not found on the server. \nRead more: ${Qr}`}function ei(e){return e.headers.get(f)===`1`}function ti(e){return e}function ni(e,t){let n=t?.keyFn??((...e)=>e[0]),r=t?.cache??new Map;return ti(function(...t){let i=n(...t),a=r.get(i);if(a!==void 0)return a;let o=e.apply(this,t);return r.set(i,o),o})}function ri(e){return e.split(`$$cache=`)[0]}function ii(){globalThis.__vite_rsc_require__=e=>e.startsWith(`$$server:`)?(e=e.slice(9),globalThis.__vite_rsc_server_require__(e)):globalThis.__vite_rsc_client_require__(e)}var ai=!1;function oi(e){if(ai)return;ai=!0;let t=ni(t=>e.load(ri(t)));globalThis.__vite_rsc_client_require__=t,ii()}var si=n((e=>{var t=i(),n={stream:!0},r=Object.prototype.hasOwnProperty;function a(e,t){if(e){var n=e[t[0]];if(e=n&&n[t[2]])n=e.name;else{if(e=n&&n[`*`],!e)throw Error(`Could not find the module "`+t[0]+`" in the React Server Consumer Manifest. This is probably a bug in the React Server Components bundler.`);n=t[2]}return t.length===4?[e.id,e.chunks,n,1]:[e.id,e.chunks,n]}return t}function o(e,t){var n=``,r=e[t];if(r)n=r.name;else{var i=t.lastIndexOf(`#`);if(i!==-1&&(n=t.slice(i+1),r=e[t.slice(0,i)]),!r)throw Error(`Could not find the module "`+t+`" in the React Server Manifest. This is probably a bug in the React Server Components bundler.`)}return r.async?[r.id,r.chunks,n,1]:[r.id,r.chunks,n]}var s=new Map;function c(e){var t=__vite_rsc_require__(e);return typeof t.then!=`function`||t.status===`fulfilled`?null:(t.then(function(e){t.status=`fulfilled`,t.value=e},function(e){t.status=`rejected`,t.reason=e}),t)}function l(){}function u(e){for(var t=e[1],n=[],r=0;rl||l===35||l===114||l===120?(u=l,l=3,c++):(u=0,l=3);continue;case 2:m=s[c++],m===44?l=4:d=d<<4|(96s.length&&(m=-1)}var h=s.byteOffset+c;if(-1{t.exports=si()}))(),1);function li(e,t={}){return ci.createFromReadableStream(e,{callServer:fi,findSourceMapURL:hi,...t})}function ui(e,t={}){return ci.createFromFetch(e,{callServer:fi,findSourceMapURL:hi,...t})}var di=ci.encodeReply;function fi(...e){return globalThis.__viteRscCallServer(...e)}function pi(e){globalThis.__viteRscCallServer=e}var mi=ci.createTemporaryReferenceSet;function hi(e,t){let n=new URL(`/__vite_rsc_findSourceMapURL`,import.meta.url);return n.searchParams.set(`filename`,e),n.searchParams.set(`environmentName`,t),n.toString()}var gi=`modulepreload`,_i=function(e){return`/`+e},vi={},yi=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_i(t,n),t in vi)return;vi[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:gi,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},bi={"15c18cfaeeff":async()=>{let e=await yi(()=>import(`./layout-segment-context-Dk2VCQ3m.js`),__vite__mapDeps([0,1,2]));return{get LayoutSegmentProvider(){return e.LayoutSegmentProvider}}},"593f344dc510":async()=>{let e=await yi(()=>Promise.resolve().then(()=>un),void 0);return{get ErrorBoundary(){return e.ErrorBoundary},get ForbiddenBoundary(){return e.ForbiddenBoundary},get NotFoundBoundary(){return e.NotFoundBoundary},get RedirectBoundary(){return e.RedirectBoundary},get UnauthorizedBoundary(){return e.UnauthorizedBoundary}}},"8c0f216c4604":async()=>{let e=await yi(()=>Promise.resolve().then(()=>kn),void 0);return{get Children(){return e.Children},get ParallelSlot(){return e.ParallelSlot},get Slot(){return e.Slot}}},dcb94247ea31:async()=>{let e=await yi(()=>import(`./StoryExperience-CXslxCdS.js`),__vite__mapDeps([3,1,2]));return{get StoryExperience(){return e.StoryExperience}}}};xi();function xi(){oi({load:async e=>{{let t=bi[e];if(!t)throw Error(`client reference not found '${e}'`);return t()}}})}function Si(e){return e===`traverse`?`traverse`:`navigate`}function Ci(e){switch(e){case`navigate`:return`navigation`;case`refresh`:return`refresh`;case`traverse`:return`traverse`;default:throw Error(`[vinext] Unknown navigation kind: `+String(e))}}var wi=50,Ti=5*6e4,Ei=30*6e4,Q=Kr(),Di=Q.NavigationCommitSignal;function Oi(e){if(!e)return null;try{return JSON.parse(decodeURIComponent(e))}catch{return null}}function ki(e){return e instanceof Promise}var Ai={},$=new Map,ji=null;function Mi(){return Q.getBrowserRouterState()}function Ni(){return Q.hasBrowserRouterState()}function Pi(){return Q.waitForBrowserRouterStateReady()}function Fi(){return Q.beginPendingBrowserRouterState()}function Ii(e){Ai=e,Vt(e)}function Li(e){Ai=e,Ht(e)}function Ri(){$.clear()}function zi(){xt().clear(),St().clear()}function Bi(){Ri(),zi()}function Vi(e){let{href:t,historyUpdateMode:n,navId:r,params:i,previousNextUrl:a}=e;return()=>{if(!Q.isCurrentNavigation(r)){K(void 0,{releaseSnapshot:!0});return}let e=new URL(t,window.location.origin).href;Li(i);let o=cr(n===`replace`?window.history.state:null,a);n===`replace`&&window.location.href!==e?q(o,``,t):n===`push`&&window.location.href!==e&&Zt(o,``,t),ji=null,K(r)}}async function Hi(e,t,n,r,i,a,o,s,c=`navigate`,l=`navigation`){try{return await Q.renderNavigationPayload({actionType:c,createNavigationCommitEffect:e=>(ji=e.href,Vi(e)),historyUpdateMode:i,navigationSnapshot:t,nextElements:e,operationLane:l,params:a,pendingRouterState:s,previousNextUrl:o,targetHref:n,navId:r})}catch(e){throw ji=null,e}}async function Ui(e,t,n){let r=zt(window.location.href,Ai);return Q.commitSameUrlNavigatePayload(e,r,t,n)}function Wi(){for(;$.size>=wi;){let e=$.keys().next().value;if(e===void 0)return;$.delete(e)}}function Gi(e,t,n,r){let i=H.encodeCacheKey(e,t),a=$.get(i);if(!a)return null;if((a.response.mountedSlotsHeader??null)!==n)return $.delete(i),null;if(r===`refresh`)return null;if(r===`traverse`){let e=a.expiresAt-Ti;return Date.now()-e>=Ei?($.delete(i),null):($.delete(i),$.set(i,a),a)}return a.expiresAt>Date.now()?($.delete(i),$.set(i,a),a):($.delete(i),null)}function Ki(e,t,n,r){let i=H.encodeCacheKey(e,t);$.delete(i),Wi();let a=Date.now();$.set(i,{params:r,expiresAt:a+Ti,response:n})}function qi(e,t){if(t!==void 0)return{interceptionContext:dr(t,``),previousNextUrl:t};switch(e){case`navigate`:return{interceptionContext:yt(),previousNextUrl:bt()};case`traverse`:{let e=lr(window.history.state);return{interceptionContext:dr(e,``),previousNextUrl:e}}case`refresh`:{let e=Mi().previousNextUrl;return{interceptionContext:dr(e,``),previousNextUrl:e}}default:throw Error(`[vinext] Unknown navigation kind: `+String(e))}}function Ji(e){return Promise.resolve(e).then(e=>H.decode(e))}function Yi({initialElements:e,initialNavigationSnapshot:t}){let n=(0,F.use)(e),r=H.readMetadata(n),[i,a]=(0,F.useState)({activeOperation:null,elements:n,interceptionContext:r.interceptionContext,layoutIds:r.layoutIds,layoutFlags:r.layoutFlags,navigationSnapshot:t,previousNextUrl:null,renderId:0,rootLayoutTreePath:r.rootLayoutTreePath,routeId:r.routeId,visibleCommitVersion:0}),o=ki(i)?(0,F.use)(i):i,s=(0,F.useRef)(o);s.current=o,(0,F.useLayoutEffect)(()=>{let e=Q.attachBrowserRouterState(a,s);return()=>{e(),At(null)}},[a]),(0,F.useLayoutEffect)(()=>{At(je(s.current.elements))},[o.elements]),(0,F.useLayoutEffect)(()=>{o.renderId===0&&q(cr(window.history.state,o.previousNextUrl),``,window.location.href)},[o.previousNextUrl,o.renderId]);let c=(0,F.createElement)(yn,null,(0,F.createElement)(Di,{renderId:o.renderId},(0,F.createElement)(jn.Provider,{value:o.elements},(0,F.createElement)(Fn,{id:o.routeId})))),l=Lt();return l?(0,F.createElement)(l.Provider,{value:o.navigationSnapshot},c):c}function Xi(e,t,n){vt({pathname:e,searchParams:new URLSearchParams(t),params:n})}function Zi(e){try{return decodeURIComponent(e)}catch{return e}}function Qi(e){let t=Zi(e.startsWith(`#`)?e.slice(1):e);requestAnimationFrame(()=>{if(t===``||t===`top`){window.scrollTo(0,0);return}let e=document.getElementById(t);if(e){e.scrollIntoView({behavior:`auto`});return}document.getElementsByName(t)[0]?.scrollIntoView({behavior:`auto`})})}function $i(e){if(!(e&&typeof e==`object`&&`__vinext_scrollY`in e)){window.location.hash&&Qi(window.location.hash);return}let t=Number(e.__vinext_scrollY),n=`__vinext_scrollX`in e?Number(e.__vinext_scrollX):0;requestAnimationFrame(()=>{window.scrollTo(n,t)})}var ea=!1,ta=`__vinext_rsc_initial_reload__`;function na(){try{return sessionStorage.getItem(ta)}catch{return null}}function ra(e){try{sessionStorage.setItem(ta,e)}catch{}}function ia(){try{sessionStorage.removeItem(ta)}catch{}}function aa(e){let t=window.location.pathname+window.location.search;return na()===t?(ia(),console.error(`[vinext] Initial RSC fetch ${e} after reload; aborting hydration. Server-rendered HTML remains visible; client components will not hydrate.`),null):(ra(t),na()===t?(console.warn(`[vinext] Initial RSC fetch ${e}; reloading once to let the server render the HTML error page`),window.location.reload(),null):(console.error(`[vinext] Initial RSC fetch ${e}; sessionStorage unavailable so the reload-loop guard cannot persist — aborting hydration. Server-rendered HTML remains visible; client components will not hydrate.`),null))}async function oa(){let e=Bn();if(e.__VINEXT_RSC__||e.__VINEXT_RSC_CHUNKS__||e.__VINEXT_RSC_DONE__){if(ia(),Wr(),e.__VINEXT_RSC__){let t=e.__VINEXT_RSC__;delete e.__VINEXT_RSC__;let n=t.params??{};return t.params&&Ii(t.params),t.nav&&Xi(t.nav.pathname,t.nav.searchParams,n),Hn(t.rsc)}let t=e.__VINEXT_RSC_PARAMS__??{};return e.__VINEXT_RSC_PARAMS__&&Ii(e.__VINEXT_RSC_PARAMS__),e.__VINEXT_RSC_NAV__&&Xi(e.__VINEXT_RSC_NAV__.pathname,e.__VINEXT_RSC_NAV__.searchParams,t),Un()}let t=Je(),n=await fetch(await Xe(window.location.pathname+window.location.search,t),{credentials:`include`,headers:t});if(!n.ok)return aa(`returned ${n.status}`);let r=n.headers.get(`content-type`)??``;if(!r.startsWith(`text/x-component`))return aa(`returned non-RSC content-type "${r||`(missing)`}"`);if(!n.body)return aa(`returned empty body`);ia(),Wr();let i=Oi(n.headers.get(s)),a=i??{};if(i)try{Ii(i)}catch{}return Xi(window.location.pathname,window.location.search,a),n.body}function sa(){pi(async(e,t)=>{let n=mi(),r=await di(t,{temporaryReferences:n}),i=Mi(),{headers:a}=fr({actionId:e,basePath:``,elements:i.elements,previousNextUrl:i.previousNextUrl}),o=await fetch(await Xe(window.location.pathname+window.location.search,a),{method:`POST`,headers:a,body:r});if(ei(o))throw Error($r(e));let s=o.headers.get(p);if(s){if(C(s)){console.error(S);return}try{if(new URL(s,window.location.origin).origin!==window.location.origin){window.location.href=s;return}}catch{}Bi(),(o.headers.get(`x-action-redirect-type`)??`replace`)===`push`?window.location.assign(s):window.location.replace(s);return}let c=await ui(Promise.resolve(o),{temporaryReferences:n});if(zn(c)&&Bi(),Rn(c)){if(c.root!==void 0)return Ui(Promise.resolve(H.decode(c.root)),c.returnValue,i);if(c.returnValue){if(!c.returnValue.ok)throw c.returnValue.data;return c.returnValue.data}return}return Ui(Promise.resolve(H.decode(c)),void 0,i)})}async function ca(){sa();let e=await oa();e!==null&&la(e)}function la(e){let t=Ji(li(e)),n=zt(window.location.href,Ai);q(cr(window.history.state,null),``,window.location.href);let r=Xr(()=>ji),i=Yr({formState:Jr(Bn()),onUncaughtError:r});window.__VINEXT_RSC_ROOT__=(0,Zr.hydrateRoot)(document,(0,F.createElement)(Yi,{initialElements:t,initialNavigationSnapshot:n}),i),window.__VINEXT_HYDRATED_AT=performance.now(),window.__VINEXT_CLEAR_NAV_CACHES__=Bi,window.__VINEXT_RSC_NAVIGATE__=async function(e,t=0,n=`navigate`,r,i,a=!1){let o=null,l=Q.beginNavigation(),u=e,d=r,f=i,p=t;try{let e=a&&n!==`refresh`;if(e&&Ni())o=Fi();else{if(await Pi(),!Q.isCurrentNavigation(l))return;e&&(o=Fi())}for(;;){if(p>10){console.error(`[vinext] Too many RSC redirects — aborting navigation to prevent infinite loop.`),window.location.href=u;return}let e=new URL(u,window.location.origin),t=qi(n,f),r=t.interceptionContext,i=t.previousNextUrl;Ut(e.pathname,l);let a=Mi().elements,m=je(a),h=Je({interceptionContext:r,renderMode:n===`refresh`?T:void 0});m&&h.set(c,m);let g=await Xe(e.pathname+e.search,h),_=Gi(g,r,m,n);if(_){if(!Q.isCurrentNavigation(l))return;let e=_.params,t=zt(u,e),r=Ji(ui(Promise.resolve(Tt(_.response))));if(!Q.isCurrentNavigation(l))return;await Hi(r,t,u,l,d,e,i,o,Si(n),Ci(n));return}let v,y=null;if(n!==`refresh`){let e=Dt(g,r,m);e&&(v=Tt(e,!1),y=e.url)}if(v||=await fetch(g,{headers:h,credentials:`include`}),!Q.isCurrentNavigation(l))return;let b=(v.headers.get(`content-type`)??``).startsWith(`text/x-component`);if(!v.ok||!b||!v.body){let e=y??v.url,t=u;if(e){let n=new URL(e,window.location.origin);Ke(n);let r=new URL(u,window.location.origin),i=qe(n.pathname);r.pathname.length>1&&r.pathname.endsWith(`/`)&&!i.endsWith(`/`)&&(i+=`/`),t=i+n.search,r.hash&&(t+=r.hash)}window.location.href=t;return}let x=new URL(y??v.url,window.location.origin);Ke(x);let S=new URL(g,window.location.origin);if(x.pathname!==S.pathname){let e=qe(x.pathname)+x.search;q(cr(null,i),``,e),u=e,d=void 0,f=i,p+=1;continue}let C=Oi(v.headers.get(`X-Vinext-Params`))??{},ee=zt(u,C),w=v.body;if(!w)return;let[E,D]=w.tee(),te=new Response(E,{status:v.status,headers:v.headers}),O=new Response(D).arrayBuffer();if(!Q.isCurrentNavigation(l))return;let k=Ji(ui(Promise.resolve(te)));if(!Q.isCurrentNavigation(l)||await Hi(k,ee,u,l,d,C,i,o,Si(n),Ci(n))!==`committed`||!Q.isCurrentNavigation(l))return;let A=await k,j=H.readMetadata(A),M=await O;Ki(g,Me(r,j.interceptionContext),{buffer:M,contentType:v.headers.get(`content-type`)??`text/x-component`,mountedSlotsHeader:v.headers.get(c),paramsHeader:v.headers.get(s),url:v.url},C);return}}catch(e){if(!Q.isCurrentNavigation(l))return;ea||console.error(`[vinext] RSC navigation error:`,e),window.location.href=u}finally{Q.finalizeNavigation(l,o)}},`scrollRestoration`in history&&(history.scrollRestoration=`manual`),window.addEventListener(`popstate`,e=>{M(window.location.href,`traverse`);let t=window.__VINEXT_RSC_NAVIGATE__?.(window.location.href,0,`traverse`)??Promise.resolve();window.__VINEXT_RSC_PENDING__=t,t.finally(()=>{$i(e.state),window.__VINEXT_RSC_PENDING__===t&&(window.__VINEXT_RSC_PENDING__=null)})})}typeof document<`u`&&(O({appDir:!0,router:nn}),window.addEventListener(`pagehide`,()=>{ea=!0}),window.addEventListener(`pageshow`,()=>{ea=!1}),ca()),window.__VINEXT_LINK_PREFETCH_ROUTES__=[{patternParts:[],isDynamic:!1}];export{lt as t};