spec-snake 0.0.1-beta.0 → 0.0.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Q_AobJB0.js","assets/Header-DN39nNWE.js","assets/ChevronRightIcon-BcBiiChF.js","assets/index-pyqED_5G.js","assets/DocumentIcon-jB6zASay.js","assets/PlusIcon-DqYOBije.js","assets/index-DQxQHK-0.js","assets/index-CT_VQ59w.js","assets/useStepFormStore-CBcs2c-9.js","assets/index-DYnzYTb1.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bw7jLgLx.js","assets/Header-Xv0ztODd.js","assets/ChevronRightIcon-BQ2_ClQu.js","assets/index-Daw2qLfo.js","assets/DocumentIcon-c8sxt6pf.js","assets/PlusIcon-erBdv4vE.js","assets/index-CGVrqKaZ.js","assets/index-CNZpX2BI.js","assets/useStepFormStore-FtcrBUR0.js","assets/index-BB8YfLyh.js"])))=>i.map(i=>d[i]);
2
2
  function ZT(n,i){for(var a=0;a<i.length;a++){const r=i[a];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in n)){const f=Object.getOwnPropertyDescriptor(r,l);f&&Object.defineProperty(n,l,f.get?f:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const f of l)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function a(l){const f={};return l.integrity&&(f.integrity=l.integrity),l.referrerPolicy&&(f.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?f.credentials="include":l.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function r(l){if(l.ep)return;l.ep=!0;const f=a(l);fetch(l.href,f)}})();function JT(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ic={exports:{}},Xa={};var og;function IT(){if(og)return Xa;og=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,l,f){var h=null;if(f!==void 0&&(h=""+f),l.key!==void 0&&(h=""+l.key),"key"in l){f={};for(var d in l)d!=="key"&&(f[d]=l[d])}else f=l;return l=f.ref,{$$typeof:n,type:r,key:h,ref:l!==void 0?l:null,props:f}}return Xa.Fragment=i,Xa.jsx=a,Xa.jsxs=a,Xa}var rg;function $T(){return rg||(rg=1,Ic.exports=IT()),Ic.exports}var X=$T(),$c={exports:{}},lt={};var lg;function WT(){if(lg)return lt;lg=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),S=Symbol.iterator;function T(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,C={};function M(A,F,J){this.props=A,this.context=F,this.refs=C,this.updater=J||E}M.prototype.isReactComponent={},M.prototype.setState=function(A,F){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,F,"setState")},M.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function w(){}w.prototype=M.prototype;function V(A,F,J){this.props=A,this.context=F,this.refs=C,this.updater=J||E}var P=V.prototype=new w;P.constructor=V,_(P,M.prototype),P.isPureReactComponent=!0;var k=Array.isArray;function U(){}var G={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function Z(A,F,J){var I=J.ref;return{$$typeof:n,type:A,key:F,ref:I!==void 0?I:null,props:J}}function nt(A,F){return Z(A.type,F,A.props)}function st(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function Tt(A){var F={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(J){return F[J]})}var Pt=/\/+/g;function Ut(A,F){return typeof A=="object"&&A!==null&&A.key!=null?Tt(""+A.key):F.toString(36)}function zt(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(U,U):(A.status="pending",A.then(function(F){A.status==="pending"&&(A.status="fulfilled",A.value=F)},function(F){A.status==="pending"&&(A.status="rejected",A.reason=F)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function j(A,F,J,I,at){var rt=typeof A;(rt==="undefined"||rt==="boolean")&&(A=null);var gt=!1;if(A===null)gt=!0;else switch(rt){case"bigint":case"string":case"number":gt=!0;break;case"object":switch(A.$$typeof){case n:case i:gt=!0;break;case g:return gt=A._init,j(gt(A._payload),F,J,I,at)}}if(gt)return at=at(A),gt=I===""?"."+Ut(A,0):I,k(at)?(J="",gt!=null&&(J=gt.replace(Pt,"$&/")+"/"),j(at,F,J,"",function(fn){return fn})):at!=null&&(st(at)&&(at=nt(at,J+(at.key==null||A&&A.key===at.key?"":(""+at.key).replace(Pt,"$&/")+"/")+gt)),F.push(at)),1;gt=0;var kt=I===""?".":I+":";if(k(A))for(var Mt=0;Mt<A.length;Mt++)I=A[Mt],rt=kt+Ut(I,Mt),gt+=j(I,F,J,rt,at);else if(Mt=T(A),typeof Mt=="function")for(A=Mt.call(A),Mt=0;!(I=A.next()).done;)I=I.value,rt=kt+Ut(I,Mt++),gt+=j(I,F,J,rt,at);else if(rt==="object"){if(typeof A.then=="function")return j(zt(A),F,J,I,at);throw F=String(A),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return gt}function Q(A,F,J){if(A==null)return A;var I=[],at=0;return j(A,I,"","",function(rt){return F.call(J,rt,at++)}),I}function W(A){if(A._status===-1){var F=A._result;F=F(),F.then(function(J){(A._status===0||A._status===-1)&&(A._status=1,A._result=J)},function(J){(A._status===0||A._status===-1)&&(A._status=2,A._result=J)}),A._status===-1&&(A._status=0,A._result=F)}if(A._status===1)return A._result.default;throw A._result}var ft=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},yt={map:Q,forEach:function(A,F,J){Q(A,function(){F.apply(this,arguments)},J)},count:function(A){var F=0;return Q(A,function(){F++}),F},toArray:function(A){return Q(A,function(F){return F})||[]},only:function(A){if(!st(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return lt.Activity=v,lt.Children=yt,lt.Component=M,lt.Fragment=a,lt.Profiler=l,lt.PureComponent=V,lt.StrictMode=r,lt.Suspense=m,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,lt.__COMPILER_RUNTIME={__proto__:null,c:function(A){return G.H.useMemoCache(A)}},lt.cache=function(A){return function(){return A.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(A,F,J){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var I=_({},A.props),at=A.key;if(F!=null)for(rt in F.key!==void 0&&(at=""+F.key),F)!H.call(F,rt)||rt==="key"||rt==="__self"||rt==="__source"||rt==="ref"&&F.ref===void 0||(I[rt]=F[rt]);var rt=arguments.length-2;if(rt===1)I.children=J;else if(1<rt){for(var gt=Array(rt),kt=0;kt<rt;kt++)gt[kt]=arguments[kt+2];I.children=gt}return Z(A.type,at,I)},lt.createContext=function(A){return A={$$typeof:h,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:f,_context:A},A},lt.createElement=function(A,F,J){var I,at={},rt=null;if(F!=null)for(I in F.key!==void 0&&(rt=""+F.key),F)H.call(F,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(at[I]=F[I]);var gt=arguments.length-2;if(gt===1)at.children=J;else if(1<gt){for(var kt=Array(gt),Mt=0;Mt<gt;Mt++)kt[Mt]=arguments[Mt+2];at.children=kt}if(A&&A.defaultProps)for(I in gt=A.defaultProps,gt)at[I]===void 0&&(at[I]=gt[I]);return Z(A,rt,at)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(A){return{$$typeof:d,render:A}},lt.isValidElement=st,lt.lazy=function(A){return{$$typeof:g,_payload:{_status:-1,_result:A},_init:W}},lt.memo=function(A,F){return{$$typeof:p,type:A,compare:F===void 0?null:F}},lt.startTransition=function(A){var F=G.T,J={};G.T=J;try{var I=A(),at=G.S;at!==null&&at(J,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(U,ft)}catch(rt){ft(rt)}finally{F!==null&&J.types!==null&&(F.types=J.types),G.T=F}},lt.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},lt.use=function(A){return G.H.use(A)},lt.useActionState=function(A,F,J){return G.H.useActionState(A,F,J)},lt.useCallback=function(A,F){return G.H.useCallback(A,F)},lt.useContext=function(A){return G.H.useContext(A)},lt.useDebugValue=function(){},lt.useDeferredValue=function(A,F){return G.H.useDeferredValue(A,F)},lt.useEffect=function(A,F){return G.H.useEffect(A,F)},lt.useEffectEvent=function(A){return G.H.useEffectEvent(A)},lt.useId=function(){return G.H.useId()},lt.useImperativeHandle=function(A,F,J){return G.H.useImperativeHandle(A,F,J)},lt.useInsertionEffect=function(A,F){return G.H.useInsertionEffect(A,F)},lt.useLayoutEffect=function(A,F){return G.H.useLayoutEffect(A,F)},lt.useMemo=function(A,F){return G.H.useMemo(A,F)},lt.useOptimistic=function(A,F){return G.H.useOptimistic(A,F)},lt.useReducer=function(A,F,J){return G.H.useReducer(A,F,J)},lt.useRef=function(A){return G.H.useRef(A)},lt.useState=function(A){return G.H.useState(A)},lt.useSyncExternalStore=function(A,F,J){return G.H.useSyncExternalStore(A,F,J)},lt.useTransition=function(){return G.H.useTransition()},lt.version="19.2.3",lt}var ug;function So(){return ug||(ug=1,$c.exports=WT()),$c.exports}var K=So();const _t=JT(K),AD=ZT({__proto__:null,default:_t},[K]),tx=/<([a-zA-Z0-9]+)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9]+)\/>/,ex={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0};function s0(n,i={}){const a=n.split(tx);if(a.length===1)return n;const r=nx(0,"$lingui$"),l=[],f=a.shift();f&&l.push(f);for(const[h,d,m]of a0(a)){let p=typeof h<"u"?i[h]:void 0;(!p||ex[p.type]&&d)&&(console.error(p?`${p.type} is a void element tag therefore it must have no children`:`Can't use element at index '${h}' as it is not declared in the original translation`),p=_t.createElement(_t.Fragment)),Array.isArray(p)&&(p=_t.createElement(_t.Fragment,{},p)),l.push(_t.cloneElement(p,{key:r()},d?s0(d,i):p.props.children)),m&&l.push(m)}return l.length===1?l[0]:l}function a0(n){if(!n.length)return[];const[i,a,r,l]=n.slice(0,4);return[[i||r,a||"",l]].concat(a0(n.slice(4,n.length)))}const nx=(n=0,i="")=>()=>`${i}_${n++}`;function ix(n){const{render:i,component:a,id:r,message:l,formats:f,lingui:{i18n:h,defaultComponent:d}}=n,{values:m,components:p}=ax(n),g=h&&typeof h._=="function"?h._(r,m,{message:l,formats:f}):r,v=g?s0(g,p):null;if(i===null||a===null)return v;const S=d||sx,T={id:r,message:l,translation:v,children:v};if(i&&a)console.error("You can't use both `component` and `render` prop at the same time. `component` is ignored.");else if(i&&typeof i!="function")console.error(`Invalid value supplied to prop \`render\`. It must be a function, provided ${i}`);else if(a&&typeof a!="function")return console.error(`Invalid value supplied to prop \`component\`. It must be a React component, provided ${a}`),_t.createElement(S,T,v);if(typeof i=="function")return i(T);const E=a||S;return _t.createElement(E,T,v)}const sx=({children:n})=>_t.createElement(_t.Fragment,null,n),ax=n=>{if(!n.values)return{values:void 0,components:n.components};const i={...n.values},a={...n.components};return Object.entries(n.values).forEach(([r,l])=>{if(typeof l=="string"||typeof l=="number")return;const f=Object.keys(a).length;a[f]=_t.createElement(_t.Fragment,null,l),i[r]=`<${f}/>`}),{values:i,components:a}},o0=_t.createContext(null),r0=n=>_t.useContext(o0);function ox(){return r0()}function rx({i18n:n,defaultComponent:i,children:a}){const r=_t.useRef(n.locale),l=_t.useCallback(()=>({i18n:n,defaultComponent:i,_:n.t.bind(n)}),[n,i]),[f,h]=_t.useState(l());return _t.useEffect(()=>{const d=()=>{r.current=n.locale,h(l())},m=n.on("change",d);return r.current!==n.locale&&d(),m},[n,l]),r.current?_t.createElement(o0.Provider,{value:f},a):null}function _D(n){const i=r0();return _t.createElement(ix,{...n,lingui:i})}var _l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ml=typeof window>"u"||"Deno"in globalThis;function en(){}function lx(n,i){return typeof n=="function"?n(i):n}function ux(n){return typeof n=="number"&&n>=0&&n!==1/0}function cx(n,i){return Math.max(n+(i||0)-Date.now(),0)}function cg(n,i){const{type:a="all",exact:r,fetchStatus:l,predicate:f,queryKey:h,stale:d}=n;if(h){if(r){if(i.queryHash!==lh(h,i.options))return!1}else if(!co(i.queryKey,h))return!1}if(a!=="all"){const m=i.isActive();if(a==="active"&&!m||a==="inactive"&&m)return!1}return!(typeof d=="boolean"&&i.isStale()!==d||l&&l!==i.state.fetchStatus||f&&!f(i))}function fg(n,i){const{exact:a,status:r,predicate:l,mutationKey:f}=n;if(f){if(!i.options.mutationKey)return!1;if(a){if(uo(i.options.mutationKey)!==uo(f))return!1}else if(!co(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||l&&!l(i))}function lh(n,i){return(i?.queryKeyHashFn||uo)(n)}function uo(n){return JSON.stringify(n,(i,a)=>Vf(a)?Object.keys(a).sort().reduce((r,l)=>(r[l]=a[l],r),{}):a)}function co(n,i){return n===i?!0:typeof n!=typeof i?!1:n&&i&&typeof n=="object"&&typeof i=="object"?!Object.keys(i).some(a=>!co(n[a],i[a])):!1}function l0(n,i){if(n===i)return n;const a=hg(n)&&hg(i);if(a||Vf(n)&&Vf(i)){const r=a?n:Object.keys(n),l=r.length,f=a?i:Object.keys(i),h=f.length,d=a?[]:{};let m=0;for(let p=0;p<h;p++){const g=a?p:f[p];(!a&&r.includes(g)||a)&&n[g]===void 0&&i[g]===void 0?(d[g]=void 0,m++):(d[g]=l0(n[g],i[g]),d[g]===n[g]&&n[g]!==void 0&&m++)}return l===h&&m===l?n:d}return i}function MD(n,i){if(!i||Object.keys(n).length!==Object.keys(i).length)return!1;for(const a in n)if(n[a]!==i[a])return!1;return!0}function hg(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Vf(n){if(!dg(n))return!1;const i=n.constructor;if(i===void 0)return!0;const a=i.prototype;return!(!dg(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function dg(n){return Object.prototype.toString.call(n)==="[object Object]"}function fx(n){return new Promise(i=>{setTimeout(i,n)})}function hx(n,i,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,i):a.structuralSharing!==!1?l0(n,i):i}function dx(n,i,a=0){const r=[...n,i];return a&&r.length>a?r.slice(1):r}function mx(n,i,a=0){const r=[i,...n];return a&&r.length>a?r.slice(0,-1):r}var uh=Symbol(),px=class extends _l{#t;#e;#n;constructor(){super(),this.#n=n=>{if(!Ml&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(n){this.#t!==n&&(this.#t=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},u0=new px,yx=class extends _l{#t=!0;#e;#n;constructor(){super(),this.#n=n=>{if(!Ml&&window.addEventListener){const i=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(n){this.#n=n,this.#e?.(),this.#e=n(this.setOnline.bind(this))}setOnline(n){this.#t!==n&&(this.#t=n,this.listeners.forEach(a=>{a(n)}))}isOnline(){return this.#t}},ll=new yx;function gx(n){return Math.min(1e3*2**n,3e4)}function c0(n){return(n??"online")==="online"?ll.isOnline():!0}var f0=class{constructor(n){this.revert=n?.revert,this.silent=n?.silent}};function Wc(n){return n instanceof f0}function h0(n){let i=!1,a=0,r=!1,l,f,h;const d=new Promise((M,w)=>{f=M,h=w}),m=M=>{r||(E(new f0(M)),n.abort?.())},p=()=>{i=!0},g=()=>{i=!1},v=()=>u0.isFocused()&&(n.networkMode==="always"||ll.isOnline())&&n.canRun(),S=()=>c0(n.networkMode)&&n.canRun(),T=M=>{r||(r=!0,n.onSuccess?.(M),l?.(),f(M))},E=M=>{r||(r=!0,n.onError?.(M),l?.(),h(M))},_=()=>new Promise(M=>{l=w=>{(r||v())&&M(w)},n.onPause?.()}).then(()=>{l=void 0,r||n.onContinue?.()}),C=()=>{if(r)return;let M;try{M=n.fn()}catch(w){M=Promise.reject(w)}Promise.resolve(M).then(T).catch(w=>{if(r)return;const V=n.retry??(Ml?0:3),P=n.retryDelay??gx,k=typeof P=="function"?P(a,w):P,U=V===!0||typeof V=="number"&&a<V||typeof V=="function"&&V(a,w);if(i||!U){E(w);return}a++,n.onFail?.(a,w),fx(k).then(()=>v()?void 0:_()).then(()=>{i?E(w):C()})})};return{promise:d,cancel:m,continue:()=>(l?.(),d),cancelRetry:p,continueRetry:g,canStart:S,start:()=>(S()?C():_().then(C),d)}}function vx(){let n=[],i=0,a=S=>{S()},r=S=>{S()},l=S=>setTimeout(S,0);const f=S=>{l=S},h=S=>{let T;i++;try{T=S()}finally{i--,i||p()}return T},d=S=>{i?n.push(S):l(()=>{a(S)})},m=S=>(...T)=>{d(()=>{S(...T)})},p=()=>{const S=n;n=[],S.length&&l(()=>{r(()=>{S.forEach(T=>{a(T)})})})};return{batch:h,batchCalls:m,schedule:d,setNotifyFunction:S=>{a=S},setBatchNotifyFunction:S=>{r=S},setScheduler:f}}var fe=vx(),d0=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ux(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Ml?1/0:300*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},Sx=class extends d0{#t;#e;#n;#i;#o;#a;constructor(n){super(),this.#a=!1,this.#o=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#n=n.cache,this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=n.state||Tx(this.options),this.state=this.#t,this.scheduleGc()}get meta(){return this.options.meta}setOptions(n){this.options={...this.#o,...n},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(n,i){const a=hx(this.state.data,n,this.options);return this.#s({data:a,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),a}setState(n,i){this.#s({type:"setState",state:n,setStateOptions:i})}cancel(n){const i=this.#i?.promise;return this.#i?.cancel(n),i?i.then(en).catch(en):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(n=>n.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(n=0){return this.state.isInvalidated||this.state.data===void 0||!cx(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(i=>i!==n),this.observers.length||(this.#i&&(this.#a?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(n,i){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(n&&this.setOptions(n),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const a=new AbortController,r={queryKey:this.queryKey,meta:this.meta},l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#a=!0,a.signal)})};l(r);const f=()=>!this.options.queryFn||this.options.queryFn===uh?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(this.#a=!1,this.options.persister?this.options.persister(this.options.queryFn,r,this):this.options.queryFn(r)),h={fetchOptions:i,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:f};l(h),this.options.behavior?.onFetch(h,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#s({type:"fetch",meta:h.fetchOptions?.meta});const d=m=>{Wc(m)&&m.silent||this.#s({type:"error",error:m}),Wc(m)||(this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#i=h0({fn:h.fetchFn,abort:a.abort.bind(a),onSuccess:m=>{if(m===void 0){d(new Error(`${this.queryHash} data is undefined`));return}this.setData(m),this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(m,p)=>{this.#s({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}),this.#i.start()}#s(n){const i=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...bx(a.data,this.options),fetchMeta:n.meta??null};case"success":return{...a,data:n.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:n.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=n.error;return Wc(r)&&r.revert&&this.#e?{...this.#e,fetchStatus:"idle"}:{...a,error:r,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=i(this.state),fe.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:n})})}};function bx(n,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:c0(i.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Tx(n){const i=typeof n.initialData=="function"?n.initialData():n.initialData,a=i!==void 0,r=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:a?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var xx=class extends _l{constructor(n={}){super(),this.config=n,this.#t=new Map}#t;build(n,i,a){const r=i.queryKey,l=i.queryHash??lh(r,i);let f=this.get(l);return f||(f=new Sx({cache:this,queryKey:r,queryHash:l,options:n.defaultQueryOptions(i),state:a,defaultOptions:n.getQueryDefaults(r)}),this.add(f)),f}add(n){this.#t.has(n.queryHash)||(this.#t.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const i=this.#t.get(n.queryHash);i&&(n.destroy(),i===n&&this.#t.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){fe.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#t.get(n)}getAll(){return[...this.#t.values()]}find(n){const i={exact:!0,...n};return this.getAll().find(a=>cg(i,a))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(a=>cg(n,a)):i}notify(n){fe.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){fe.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){fe.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Ex=class extends d0{#t;#e;#n;constructor(n){super(),this.mutationId=n.mutationId,this.#e=n.mutationCache,this.#t=[],this.state=n.state||Rx(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(i=>i!==n),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(n){this.#n=h0({fn:()=>this.options.mutationFn?this.options.mutationFn(n):Promise.reject(new Error("No mutationFn found")),onFail:(r,l)=>{this.#i({type:"failed",failureCount:r,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const i=this.state.status==="pending",a=!this.#n.canStart();try{if(!i){this.#i({type:"pending",variables:n,isPaused:a}),await this.#e.config.onMutate?.(n,this);const l=await this.options.onMutate?.(n);l!==this.state.context&&this.#i({type:"pending",context:l,variables:n,isPaused:a})}const r=await this.#n.start();return await this.#e.config.onSuccess?.(r,n,this.state.context,this),await this.options.onSuccess?.(r,n,this.state.context),await this.#e.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,n,this.state.context),this.#i({type:"success",data:r}),r}catch(r){try{throw await this.#e.config.onError?.(r,n,this.state.context,this),await this.options.onError?.(r,n,this.state.context),await this.#e.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,n,this.state.context),r}finally{this.#i({type:"error",error:r})}}finally{this.#e.runNext(this)}}#i(n){const i=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),fe.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(n)}),this.#e.notify({mutation:this,type:"updated",action:n})})}};function Rx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ax=class extends _l{constructor(n={}){super(),this.config=n,this.#t=new Map,this.#e=Date.now()}#t;#e;build(n,i,a){const r=new Ex({mutationCache:this,mutationId:++this.#e,options:n.defaultMutationOptions(i),state:a});return this.add(r),r}add(n){const i=kr(n),a=this.#t.get(i)??[];a.push(n),this.#t.set(i,a),this.notify({type:"added",mutation:n})}remove(n){const i=kr(n);if(this.#t.has(i)){const a=this.#t.get(i)?.filter(r=>r!==n);a&&(a.length===0?this.#t.delete(i):this.#t.set(i,a))}this.notify({type:"removed",mutation:n})}canRun(n){const i=this.#t.get(kr(n))?.find(a=>a.state.status==="pending");return!i||i===n}runNext(n){return this.#t.get(kr(n))?.find(a=>a!==n&&a.state.isPaused)?.continue()??Promise.resolve()}clear(){fe.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}getAll(){return[...this.#t.values()].flat()}find(n){const i={exact:!0,...n};return this.getAll().find(a=>fg(i,a))}findAll(n={}){return this.getAll().filter(i=>fg(n,i))}notify(n){fe.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return fe.batch(()=>Promise.all(n.map(i=>i.continue().catch(en))))}};function kr(n){return n.options.scope?.id??String(n.mutationId)}function _x(n){return{onFetch:(i,a)=>{const r=async()=>{const l=i.options,f=i.fetchOptions?.meta?.fetchMore?.direction,h=i.state.data?.pages||[],d=i.state.data?.pageParams||[],m={pages:[],pageParams:[]};let p=!1;const g=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(i.signal.aborted?p=!0:i.signal.addEventListener("abort",()=>{p=!0}),i.signal)})},v=i.options.queryFn&&i.options.queryFn!==uh?i.options.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${i.options.queryHash}'`)),S=async(E,_,C)=>{if(p)return Promise.reject();if(_==null&&E.pages.length)return Promise.resolve(E);const M={queryKey:i.queryKey,pageParam:_,direction:C?"backward":"forward",meta:i.options.meta};g(M);const w=await v(M),{maxPages:V}=i.options,P=C?mx:dx;return{pages:P(E.pages,w,V),pageParams:P(E.pageParams,_,V)}};let T;if(f&&h.length){const E=f==="backward",_=E?Mx:mg,C={pages:h,pageParams:d},M=_(l,C);T=await S(C,M,E)}else{T=await S(m,d[0]??l.initialPageParam);const E=n??h.length;for(let _=1;_<E;_++){const C=mg(l,T);T=await S(T,C)}}return T};i.options.persister?i.fetchFn=()=>i.options.persister?.(r,{queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},a):i.fetchFn=r}}}function mg(n,{pages:i,pageParams:a}){const r=i.length-1;return n.getNextPageParam(i[r],i,a[r],a)}function Mx(n,{pages:i,pageParams:a}){return n.getPreviousPageParam?.(i[0],i,a[0],a)}var Cx=class{#t;#e;#n;#i;#o;#a;#s;#r;constructor(n={}){this.#t=n.queryCache||new xx,this.#e=n.mutationCache||new Ax,this.#n=n.defaultOptions||{},this.#i=new Map,this.#o=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=u0.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#r=ll.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#s?.(),this.#s=void 0,this.#r?.(),this.#r=void 0)}isFetching(n){return this.#t.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#e.findAll({...n,status:"pending"}).length}getQueryData(n){const i=this.defaultQueryOptions({queryKey:n});return this.#t.get(i.queryHash)?.state.data}ensureQueryData(n){const i=this.getQueryData(n.queryKey);if(i===void 0)return this.fetchQuery(n);{const a=this.defaultQueryOptions(n),r=this.#t.build(this,a);return n.revalidateIfStale&&r.isStaleByTime(a.staleTime)&&this.prefetchQuery(a),Promise.resolve(i)}}getQueriesData(n){return this.#t.findAll(n).map(({queryKey:i,state:a})=>{const r=a.data;return[i,r]})}setQueryData(n,i,a){const r=this.defaultQueryOptions({queryKey:n}),f=this.#t.get(r.queryHash)?.state.data,h=lx(i,f);if(h!==void 0)return this.#t.build(this,r).setData(h,{...a,manual:!0})}setQueriesData(n,i,a){return fe.batch(()=>this.#t.findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,i,a)]))}getQueryState(n){const i=this.defaultQueryOptions({queryKey:n});return this.#t.get(i.queryHash)?.state}removeQueries(n){const i=this.#t;fe.batch(()=>{i.findAll(n).forEach(a=>{i.remove(a)})})}resetQueries(n,i){const a=this.#t,r={type:"active",...n};return fe.batch(()=>(a.findAll(n).forEach(l=>{l.reset()}),this.refetchQueries(r,i)))}cancelQueries(n={},i={}){const a={revert:!0,...i},r=fe.batch(()=>this.#t.findAll(n).map(l=>l.cancel(a)));return Promise.all(r).then(en).catch(en)}invalidateQueries(n={},i={}){return fe.batch(()=>{if(this.#t.findAll(n).forEach(r=>{r.invalidate()}),n.refetchType==="none")return Promise.resolve();const a={...n,type:n.refetchType??n.type??"active"};return this.refetchQueries(a,i)})}refetchQueries(n={},i){const a={...i,cancelRefetch:i?.cancelRefetch??!0},r=fe.batch(()=>this.#t.findAll(n).filter(l=>!l.isDisabled()).map(l=>{let f=l.fetch(void 0,a);return a.throwOnError||(f=f.catch(en)),l.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(en)}fetchQuery(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#t.build(this,i);return a.isStaleByTime(i.staleTime)?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(en).catch(en)}fetchInfiniteQuery(n){return n.behavior=_x(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(en).catch(en)}resumePausedMutations(){return ll.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,i){this.#i.set(uo(n),{queryKey:n,defaultOptions:i})}getQueryDefaults(n){const i=[...this.#i.values()];let a={};return i.forEach(r=>{co(n,r.queryKey)&&(a={...a,...r.defaultOptions})}),a}setMutationDefaults(n,i){this.#o.set(uo(n),{mutationKey:n,defaultOptions:i})}getMutationDefaults(n){const i=[...this.#o.values()];let a={};return i.forEach(r=>{co(n,r.mutationKey)&&(a={...a,...r.defaultOptions})}),a}defaultQueryOptions(n){if(n._defaulted)return n;const i={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return i.queryHash||(i.queryHash=lh(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.enabled!==!0&&i.queryFn===uh&&(i.enabled=!1),i}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},m0=K.createContext(void 0),CD=n=>{const i=K.useContext(m0);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},Dx=({client:n,children:i})=>(K.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),X.jsx(m0.Provider,{value:n,children:i}));const Bf=new WeakMap,wx=new WeakMap,ul={current:[]};let tf=!1,no=0;const to=new Set,Qr=new Map;function p0(n){for(const i of n){if(ul.current.includes(i))continue;ul.current.push(i),i.recompute();const a=wx.get(i);if(a)for(const r of a){const l=Bf.get(r);l?.length&&p0(l)}}}function Ox(n){const i={prevVal:n.prevState,currentVal:n.state};for(const a of n.listeners)a(i)}function Lx(n){const i={prevVal:n.prevState,currentVal:n.state};for(const a of n.listeners)a(i)}function y0(n){if(no>0&&!Qr.has(n)&&Qr.set(n,n.prevState),to.add(n),!(no>0)&&!tf)try{for(tf=!0;to.size>0;){const i=Array.from(to);to.clear();for(const a of i){const r=Qr.get(a)??a.prevState;a.prevState=r,Ox(a)}for(const a of i){const r=Bf.get(a);r&&(ul.current.push(a),p0(r))}for(const a of i){const r=Bf.get(a);if(r)for(const l of r)Lx(l)}}}finally{tf=!1,ul.current=[],Qr.clear()}}function io(n){no++;try{n()}finally{if(no--,no===0){const i=to.values().next().value;i&&y0(i)}}}function zx(n){return typeof n=="function"}class Vx{constructor(i,a){this.listeners=new Set,this.subscribe=r=>{var l,f;this.listeners.add(r);const h=(f=(l=this.options)==null?void 0:l.onSubscribe)==null?void 0:f.call(l,r,this);return()=>{this.listeners.delete(r),h?.()}},this.prevState=i,this.state=i,this.options=a}setState(i){var a,r,l;this.prevState=this.state,(a=this.options)!=null&&a.updateFn?this.state=this.options.updateFn(this.prevState)(i):zx(i)?this.state=i(this.prevState):this.state=i,(l=(r=this.options)==null?void 0:r.onUpdate)==null||l.call(r),y0(this)}}const di="__TSR_index",pg="popstate",yg="beforeunload";function Bx(n){let i=n.getLocation();const a=new Set,r=h=>{i=n.getLocation(),a.forEach(d=>d({location:i,action:h}))},l=h=>{n.notifyOnIndexChange??!0?r(h):i=n.getLocation()},f=async({task:h,navigateOpts:d,...m})=>{if(d?.ignoreBlocker??!1){h();return}const g=n.getBlockers?.()??[],v=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&g.length&&v)for(const S of g){const T=cl(m.path,m.state);if(await S.blockerFn({currentLocation:i,nextLocation:T,action:m.type})){n.onBlocked?.();return}}h()};return{get location(){return i},get length(){return n.getLength()},subscribers:a,subscribe:h=>(a.add(h),()=>{a.delete(h)}),push:(h,d,m)=>{const p=i.state[di];d=gg(p+1,d),f({task:()=>{n.pushState(h,d),r({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:h,state:d})},replace:(h,d,m)=>{const p=i.state[di];d=gg(p,d),f({task:()=>{n.replaceState(h,d),r({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:h,state:d})},go:(h,d)=>{f({task:()=>{n.go(h),l({type:"GO",index:h})},navigateOpts:d,type:"GO"})},back:h=>{f({task:()=>{n.back(h?.ignoreBlocker??!1),l({type:"BACK"})},navigateOpts:h,type:"BACK"})},forward:h=>{f({task:()=>{n.forward(h?.ignoreBlocker??!1),l({type:"FORWARD"})},navigateOpts:h,type:"FORWARD"})},canGoBack:()=>i.state[di]!==0,createHref:h=>n.createHref(h),block:h=>{if(!n.setBlockers)return()=>{};const d=n.getBlockers?.()??[];return n.setBlockers([...d,h]),()=>{const m=n.getBlockers?.()??[];n.setBlockers?.(m.filter(p=>p!==h))}},flush:()=>n.flush?.(),destroy:()=>n.destroy?.(),notify:r}}function gg(n,i){i||(i={});const a=ch();return{...i,key:a,__TSR_key:a,[di]:n}}function Ux(n){const i=typeof document<"u"?window:void 0,a=i.history.pushState,r=i.history.replaceState;let l=[];const f=()=>l,h=H=>l=H,d=(H=>H),m=(()=>cl(`${i.location.pathname}${i.location.search}${i.location.hash}`,i.history.state));if(!i.history.state?.__TSR_key&&!i.history.state?.key){const H=ch();i.history.replaceState({[di]:0,key:H,__TSR_key:H},"")}let p=m(),g,v=!1,S=!1,T=!1,E=!1;const _=()=>p;let C,M;const w=()=>{C&&(G._ignoreSubscribers=!0,(C.isPush?i.history.pushState:i.history.replaceState)(C.state,"",C.href),G._ignoreSubscribers=!1,C=void 0,M=void 0,g=void 0)},V=(H,Z,nt)=>{const st=d(Z);M||(g=p),p=cl(Z,nt),C={href:st,state:nt,isPush:C?.isPush||H==="push"},M||(M=Promise.resolve().then(()=>w()))},P=H=>{p=m(),G.notify({type:H})},k=async()=>{if(S){S=!1;return}const H=m(),Z=H.state[di]-p.state[di],nt=Z===1,st=Z===-1,Tt=!nt&&!st||v;v=!1;const Pt=Tt?"GO":st?"BACK":"FORWARD",Ut=Tt?{type:"GO",index:Z}:{type:st?"BACK":"FORWARD"};if(T)T=!1;else{const zt=f();if(typeof document<"u"&&zt.length){for(const j of zt)if(await j.blockerFn({currentLocation:p,nextLocation:H,action:Pt})){S=!0,i.history.go(1),G.notify(Ut);return}}}p=m(),G.notify(Ut)},U=H=>{if(E){E=!1;return}let Z=!1;const nt=f();if(typeof document<"u"&&nt.length)for(const st of nt){const Tt=st.enableBeforeUnload??!0;if(Tt===!0){Z=!0;break}if(typeof Tt=="function"&&Tt()===!0){Z=!0;break}}if(Z)return H.preventDefault(),H.returnValue=""},G=Bx({getLocation:_,getLength:()=>i.history.length,pushState:(H,Z)=>V("push",H,Z),replaceState:(H,Z)=>V("replace",H,Z),back:H=>(H&&(T=!0),E=!0,i.history.back()),forward:H=>{H&&(T=!0),E=!0,i.history.forward()},go:H=>{v=!0,i.history.go(H)},createHref:H=>d(H),flush:w,destroy:()=>{i.history.pushState=a,i.history.replaceState=r,i.removeEventListener(yg,U,{capture:!0}),i.removeEventListener(pg,k)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:f,setBlockers:h,notifyOnIndexChange:!1});return i.addEventListener(yg,U,{capture:!0}),i.addEventListener(pg,k),i.history.pushState=function(...H){const Z=a.apply(i.history,H);return G._ignoreSubscribers||P("PUSH"),Z},i.history.replaceState=function(...H){const Z=r.apply(i.history,H);return G._ignoreSubscribers||P("REPLACE"),Z},G}function cl(n,i){const a=n.indexOf("#"),r=n.indexOf("?"),l=ch();return{href:n,pathname:n.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:n.length),hash:a>-1?n.substring(a):"",search:r>-1?n.slice(r,a===-1?void 0:a):"",state:i||{[di]:0,key:l,__TSR_key:l}}}function ch(){return(Math.random()+1).toString(36).substring(7)}function fl(n){return n[n.length-1]}function jx(n){return typeof n=="function"}function ci(n,i){return jx(n)?n(i):n}const Nx=Object.prototype.hasOwnProperty;function Fe(n,i){if(n===i)return n;const a=i,r=bg(n)&&bg(a);if(!r&&!(hl(n)&&hl(a)))return a;const l=r?n:vg(n);if(!l)return a;const f=r?a:vg(a);if(!f)return a;const h=l.length,d=f.length,m=r?new Array(d):{};let p=0;for(let g=0;g<d;g++){const v=r?g:f[g],S=n[v],T=a[v];if(S===T){m[v]=S,(r?g<h:Nx.call(n,v))&&p++;continue}if(S===null||T===null||typeof S!="object"||typeof T!="object"){m[v]=T;continue}const E=Fe(S,T);m[v]=E,E===S&&p++}return h===d&&p===h?n:m}function vg(n){const i=[],a=Object.getOwnPropertyNames(n);for(const l of a){if(!Object.prototype.propertyIsEnumerable.call(n,l))return!1;i.push(l)}const r=Object.getOwnPropertySymbols(n);for(const l of r){if(!Object.prototype.propertyIsEnumerable.call(n,l))return!1;i.push(l)}return i}function hl(n){if(!Sg(n))return!1;const i=n.constructor;if(typeof i>"u")return!0;const a=i.prototype;return!(!Sg(a)||!a.hasOwnProperty("isPrototypeOf"))}function Sg(n){return Object.prototype.toString.call(n)==="[object Object]"}function bg(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Ki(n,i,a){if(n===i)return!0;if(typeof n!=typeof i)return!1;if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return!1;for(let r=0,l=n.length;r<l;r++)if(!Ki(n[r],i[r],a))return!1;return!0}if(hl(n)&&hl(i)){const r=a?.ignoreUndefined??!0;if(a?.partial){for(const h in i)if((!r||i[h]!==void 0)&&!Ki(n[h],i[h],a))return!1;return!0}let l=0;if(!r)l=Object.keys(n).length;else for(const h in n)n[h]!==void 0&&l++;let f=0;for(const h in i)if((!r||i[h]!==void 0)&&(f++,f>l||!Ki(n[h],i[h],a)))return!1;return l===f}return!1}function Qs(n){let i,a;const r=new Promise((l,f)=>{i=l,a=f});return r.status="pending",r.resolve=l=>{r.status="resolved",r.value=l,i(l),n?.(l)},r.reject=l=>{r.status="rejected",a(l)},r}function Px(n){return typeof n?.message!="string"?!1:n.message.startsWith("Failed to fetch dynamically imported module")||n.message.startsWith("error loading dynamically imported module")||n.message.startsWith("Importing a module script failed")}function mi(n){return!!(n&&typeof n=="object"&&typeof n.then=="function")}function Tg(n){try{return decodeURI(n)}catch{return n.replaceAll(/%[0-9A-F]{2}/gi,i=>{try{return decodeURI(i)}catch{return i}})}}function xg(n,i){if(!n)return n;const a=/%25|%5C/gi;let r=0,l="",f;for(;(f=a.exec(n))!==null;)l+=Tg(n.slice(r,f.index))+f[0],r=a.lastIndex;return l+Tg(r?n.slice(r):n)}var Hx="Invariant failed";function On(n,i){if(!n)throw new Error(Hx)}function dl(n){const i=new Map;let a,r;const l=f=>{f.next&&(f.prev?(f.prev.next=f.next,f.next.prev=f.prev,f.next=void 0,r&&(r.next=f,f.prev=r)):(f.next.prev=void 0,a=f.next,f.next=void 0,r&&(f.prev=r,r.next=f)),r=f)};return{get(f){const h=i.get(f);if(h)return l(h),h.value},set(f,h){if(i.size>=n&&a){const m=a;i.delete(m.key),m.next&&(a=m.next,m.next.prev=void 0),m===r&&(r=void 0)}const d=i.get(f);if(d)d.value=h,l(d);else{const m={key:f,value:h,prev:r};r&&(r.next=m),r=m,a||(a=m),i.set(f,m)}},clear(){i.clear(),a=void 0,r=void 0}}}const Xs=0,Ii=1,$i=2,fo=3,qx=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Gx=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Yx=/^([^{]*)\{\$\}([^}]*)$/;function fh(n,i,a=new Uint16Array(6)){const r=n.indexOf("/",i),l=r===-1?n.length:r,f=n.substring(i,l);if(!f||!f.includes("$"))return a[0]=Xs,a[1]=i,a[2]=i,a[3]=l,a[4]=l,a[5]=l,a;if(f==="$"){const p=n.length;return a[0]=$i,a[1]=i,a[2]=i,a[3]=p,a[4]=p,a[5]=p,a}if(f.charCodeAt(0)===36)return a[0]=Ii,a[1]=i,a[2]=i+1,a[3]=l,a[4]=l,a[5]=l,a;const h=f.match(Yx);if(h){const g=h[1].length;return a[0]=$i,a[1]=i+g,a[2]=i+g+1,a[3]=i+g+2,a[4]=i+g+3,a[5]=n.length,a}const d=f.match(Gx);if(d){const p=d[1],g=d[2],v=d[3],S=p.length;return a[0]=fo,a[1]=i+S,a[2]=i+S+3,a[3]=i+S+3+g.length,a[4]=l-v.length,a[5]=l,a}const m=f.match(qx);if(m){const p=m[1],g=m[2],v=m[3],S=p.length;return a[0]=Ii,a[1]=i+S,a[2]=i+S+2,a[3]=i+S+2+g.length,a[4]=l-v.length,a[5]=l,a}return a[0]=Xs,a[1]=i,a[2]=i,a[3]=l,a[4]=l,a[5]=l,a}function Cl(n,i,a,r,l,f,h){h?.(a);let d=r;{const m=a.fullPath??a.from,p=m.length,g=a.options?.caseSensitive??n;for(;d<p;){const v=fh(m,d,i);let S;const T=d,E=v[5];switch(d=E+1,f++,v[0]){case Xs:{const C=m.substring(v[2],v[3]);if(g){const M=l.static?.get(C);if(M)S=M;else{l.static??=new Map;const w=ho(a.fullPath??a.from);w.parent=l,w.depth=f,S=w,l.static.set(C,w)}}else{const M=C.toLowerCase(),w=l.staticInsensitive?.get(M);if(w)S=w;else{l.staticInsensitive??=new Map;const V=ho(a.fullPath??a.from);V.parent=l,V.depth=f,S=V,l.staticInsensitive.set(M,V)}}break}case Ii:{const C=m.substring(T,v[1]),M=m.substring(v[4],E),w=g&&!!(C||M),V=C?w?C:C.toLowerCase():void 0,P=M?w?M:M.toLowerCase():void 0,k=l.dynamic?.find(U=>U.caseSensitive===w&&U.prefix===V&&U.suffix===P);if(k)S=k;else{const U=nf(Ii,a.fullPath??a.from,w,V,P);S=U,U.depth=f,U.parent=l,l.dynamic??=[],l.dynamic.push(U)}break}case fo:{const C=m.substring(T,v[1]),M=m.substring(v[4],E),w=g&&!!(C||M),V=C?w?C:C.toLowerCase():void 0,P=M?w?M:M.toLowerCase():void 0,k=l.optional?.find(U=>U.caseSensitive===w&&U.prefix===V&&U.suffix===P);if(k)S=k;else{const U=nf(fo,a.fullPath??a.from,w,V,P);S=U,U.parent=l,U.depth=f,l.optional??=[],l.optional.push(U)}break}case $i:{const C=m.substring(T,v[1]),M=m.substring(v[4],E),w=g&&!!(C||M),V=C?w?C:C.toLowerCase():void 0,P=M?w?M:M.toLowerCase():void 0,k=nf($i,a.fullPath??a.from,w,V,P);S=k,k.parent=l,k.depth=f,l.wildcard??=[],l.wildcard.push(k)}}l=S}if((a.path||!a.children)&&!a.isRoot){const v=m.endsWith("/");v||(l.notFound=a),(!l.route||!l.isIndex&&v)&&(l.route=a,l.fullPath=a.fullPath??a.from),l.isIndex||=v}}if(a.children)for(const m of a.children)Cl(n,i,m,d,l,f,h)}function ef(n,i){if(n.prefix&&i.prefix&&n.prefix!==i.prefix){if(n.prefix.startsWith(i.prefix))return-1;if(i.prefix.startsWith(n.prefix))return 1}if(n.suffix&&i.suffix&&n.suffix!==i.suffix){if(n.suffix.endsWith(i.suffix))return-1;if(i.suffix.endsWith(n.suffix))return 1}return n.prefix&&!i.prefix?-1:!n.prefix&&i.prefix?1:n.suffix&&!i.suffix?-1:!n.suffix&&i.suffix?1:n.caseSensitive&&!i.caseSensitive?-1:!n.caseSensitive&&i.caseSensitive?1:0}function Gi(n){if(n.static)for(const i of n.static.values())Gi(i);if(n.staticInsensitive)for(const i of n.staticInsensitive.values())Gi(i);if(n.dynamic?.length){n.dynamic.sort(ef);for(const i of n.dynamic)Gi(i)}if(n.optional?.length){n.optional.sort(ef);for(const i of n.optional)Gi(i)}if(n.wildcard?.length){n.wildcard.sort(ef);for(const i of n.wildcard)Gi(i)}}function ho(n){return{kind:Xs,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,isIndex:!1,notFound:null}}function nf(n,i,a,r,l){return{kind:n,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:i,parent:null,isIndex:!1,notFound:null,caseSensitive:a,prefix:r,suffix:l}}function Fx(n,i){const a=ho("/"),r=new Uint16Array(6);for(const l of n)Cl(!1,r,l,1,a,0);Gi(a),i.masksTree=a,i.flatCache=dl(1e3)}function Kx(n,i){n||="/";const a=i.flatCache.get(n);if(a)return a;const r=hh(n,i.masksTree);return i.flatCache.set(n,r),r}function kx(n,i,a,r,l){n||="/",r||="/";const f=i?`case\0${n}`:n;let h=l.singleCache.get(f);if(!h){h=ho("/");const d=new Uint16Array(6);Cl(i,d,{from:n},1,h,0),l.singleCache.set(f,h)}return hh(r,h,a)}function Qx(n,i,a=!1){const r=a?n:`nofuzz\0${n}`,l=i.matchCache.get(r);if(l!==void 0)return l;n||="/";const f=hh(n,i.segmentTree,a);return f&&(f.branch=Ix(f.route)),i.matchCache.set(r,f),f}function Xx(n){return n==="/"?n:n.replace(/\/{1,}$/,"")}function Zx(n,i=!1,a){const r=ho(n.fullPath),l=new Uint16Array(6),f={},h={};let d=0;return Cl(i,l,n,1,r,0,p=>{if(a?.(p,d),On(!(p.id in f),`Duplicate routes found with id: ${String(p.id)}`),f[p.id]=p,d!==0&&p.path){const g=Xx(p.fullPath);(!h[g]||p.fullPath.endsWith("/"))&&(h[g]=p)}d++}),Gi(r),{processedTree:{segmentTree:r,singleCache:dl(1e3),matchCache:dl(1e3),flatCache:null,masksTree:null},routesById:f,routesByPath:h}}function hh(n,i,a=!1){const r=n.split("/"),l=Wx(n,r,i,a);if(!l)return null;const f=Jx(n,r,l),h="**"in l;return h&&(f["**"]=l["**"]),{route:h?l.node.notFound??l.node.route:l.node.route,params:f}}function Jx(n,i,a){const r=$x(a.node);let l=null;const f={};for(let h=0,d=0,m=0;d<r.length;h++,d++,m++){const p=r[d],g=i[h],v=m;if(g&&(m+=g.length),p.kind===Ii){l??=a.node.fullPath.split("/");const S=l[d],T=p.prefix?.length??0;if(S.charCodeAt(T)===123){const _=p.suffix?.length??0,C=S.substring(T+2,S.length-_-1),M=g.substring(T,g.length-_);f[C]=decodeURIComponent(M)}else{const _=S.substring(1);f[_]=decodeURIComponent(g)}}else if(p.kind===fo){if(a.skipped&1<<d){h--;continue}l??=a.node.fullPath.split("/");const S=l[d],T=p.prefix?.length??0,E=p.suffix?.length??0,_=S.substring(T+3,S.length-E-1),C=p.suffix||p.prefix?g.substring(T,g.length-E):g;C&&(f[_]=decodeURIComponent(C))}else if(p.kind===$i){const S=p,T=n.substring(v+(S.prefix?.length??0),n.length-(S.suffix?.length??0)),E=decodeURIComponent(T);f["*"]=E,f._splat=E;break}}return f}function Ix(n){const i=[n];for(;n.parentRoute;)n=n.parentRoute,i.push(n);return i.reverse(),i}function $x(n){const i=Array(n.depth+1);do i[n.depth]=n,n=n.parent;while(n);return i}function Wx(n,i,a,r){const l=!fl(i),f=l&&n!=="/",h=i.length-(l?1:0),d=[{node:a,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let m=null,p=null,g=null;for(;d.length;){const v=d.pop();let{node:S,index:T,skipped:E,depth:_,statics:C,dynamics:M,optionals:w}=v;r&&S.notFound&&Xr(p,v)&&(p=v);const V=T===h;if(V){if(S.route&&(!f||S.isIndex)&&(Xr(g,v)&&(g=v),C===h&&S.isIndex))return g;if(!S.optional&&!S.wildcard)continue}const P=V?void 0:i[T];let k;if(S.wildcard&&Xr(m,v))for(const U of S.wildcard){const{prefix:G,suffix:H}=U;if(!(G&&(V||!(U.caseSensitive?P:k??=P.toLowerCase()).startsWith(G)))){if(H){if(V)continue;const Z=i.slice(T).join("/").slice(-H.length);if((U.caseSensitive?Z:Z.toLowerCase())!==H)continue}m={node:U,index:T,skipped:E,depth:_,statics:C,dynamics:M,optionals:w};break}}if(S.optional){const U=E|1<<_,G=_+1;for(let H=S.optional.length-1;H>=0;H--){const Z=S.optional[H];d.push({node:Z,index:T,skipped:U,depth:G,statics:C,dynamics:M,optionals:w})}if(!V)for(let H=S.optional.length-1;H>=0;H--){const Z=S.optional[H],{prefix:nt,suffix:st}=Z;if(nt||st){const Tt=Z.caseSensitive?P:k??=P.toLowerCase();if(nt&&!Tt.startsWith(nt)||st&&!Tt.endsWith(st))continue}d.push({node:Z,index:T+1,skipped:E,depth:G,statics:C,dynamics:M,optionals:w+1})}}if(!V&&S.dynamic&&P)for(let U=S.dynamic.length-1;U>=0;U--){const G=S.dynamic[U],{prefix:H,suffix:Z}=G;if(H||Z){const nt=G.caseSensitive?P:k??=P.toLowerCase();if(H&&!nt.startsWith(H)||Z&&!nt.endsWith(Z))continue}d.push({node:G,index:T+1,skipped:E,depth:_+1,statics:C,dynamics:M+1,optionals:w})}if(!V&&S.staticInsensitive){const U=S.staticInsensitive.get(k??=P.toLowerCase());U&&d.push({node:U,index:T+1,skipped:E,depth:_+1,statics:C+1,dynamics:M,optionals:w})}if(!V&&S.static){const U=S.static.get(P);U&&d.push({node:U,index:T+1,skipped:E,depth:_+1,statics:C+1,dynamics:M,optionals:w})}}if(g&&m)return Xr(m,g)?g:m;if(g)return g;if(m)return m;if(r&&p){let v=p.index;for(let T=0;T<p.index;T++)v+=i[T].length;const S=v===n.length?"/":n.slice(v);return{node:p.node,skipped:p.skipped,"**":decodeURIComponent(S)}}return null}function Xr(n,i){return n?i.statics>n.statics||i.statics===n.statics&&(i.dynamics>n.dynamics||i.dynamics===n.dynamics&&(i.optionals>n.optionals||i.optionals===n.optionals&&(i.node.isIndex>n.node.isIndex||i.node.isIndex===n.node.isIndex&&i.depth>n.depth))):!0}function nl(n){return dh(n.filter(i=>i!==void 0).join("/"))}function dh(n){return n.replace(/\/{2,}/g,"/")}function g0(n){return n==="/"?n:n.replace(/^\/{1,}/,"")}function ki(n){const i=n.length;return i>1&&n[i-1]==="/"?n.replace(/\/{1,}$/,""):n}function v0(n){return ki(g0(n))}function ml(n,i){return n?.endsWith("/")&&n!=="/"&&n!==`${i}/`?n.slice(0,-1):n}function tE(n,i,a){return ml(n,a)===ml(i,a)}function eE({base:n,to:i,trailingSlash:a="never",cache:r}){const l=i.startsWith("/"),f=!l&&i===".";let h;if(r){h=l?i:f?n:n+"\0"+i;const v=r.get(h);if(v)return v}let d;if(f)d=n.split("/");else if(l)d=i.split("/");else{for(d=n.split("/");d.length>1&&fl(d)==="";)d.pop();const v=i.split("/");for(let S=0,T=v.length;S<T;S++){const E=v[S];E===""?S?S===T-1&&d.push(E):d=[E]:E===".."?d.pop():E==="."||d.push(E)}}d.length>1&&(fl(d)===""?a==="never"&&d.pop():a==="always"&&d.push(""));let m,p="";for(let v=0;v<d.length;v++){v>0&&(p+="/");const S=d[v];if(!S)continue;m=fh(S,0,m);const T=m[0];if(T===Xs){p+=S;continue}const E=m[5],_=S.substring(0,m[1]),C=S.substring(m[4],E),M=S.substring(m[2],m[3]);T===Ii?p+=_||C?`${_}{$${M}}${C}`:`$${M}`:T===$i?p+=_||C?`${_}{$}${C}`:"$":p+=`${_}{-$${M}}${C}`}p=dh(p);const g=p||"/";return h&&r&&r.set(h,g),g}function sf(n,i,a){const r=i[n];return typeof r!="string"?r:n==="_splat"?encodeURI(r):nE(r,a)}function af({path:n,params:i,decodeCharMap:a}){let r=!1;const l={};if(!n||n==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:r};if(!n.includes("$"))return{interpolatedPath:n,usedParams:l,isMissingParams:r};const f=n.length;let h=0,d,m="";for(;h<f;){const g=h;d=fh(n,g,d);const v=d[5];if(h=v+1,g===v)continue;const S=d[0];if(S===Xs){m+="/"+n.substring(g,v);continue}if(S===$i){const T=i._splat;l._splat=T,l["*"]=T;const E=n.substring(g,d[1]),_=n.substring(d[4],v);if(!T){r=!0,(E||_)&&(m+="/"+E+_);continue}const C=sf("_splat",i,a);m+="/"+E+C+_;continue}if(S===Ii){const T=n.substring(d[2],d[3]);!r&&!(T in i)&&(r=!0),l[T]=i[T];const E=n.substring(g,d[1]),_=n.substring(d[4],v),C=sf(T,i,a)??"undefined";m+="/"+E+C+_;continue}if(S===fo){const T=n.substring(d[2],d[3]),E=i[T];if(E==null)continue;l[T]=E;const _=n.substring(g,d[1]),C=n.substring(d[4],v),M=sf(T,i,a)??"";m+="/"+_+M+C;continue}}return n.endsWith("/")&&(m+="/"),{usedParams:l,interpolatedPath:m||"/",isMissingParams:r}}function nE(n,i){let a=encodeURIComponent(n);if(i)for(const[r,l]of i)a=a.replaceAll(r,l);return a}function Qi(n={}){if(n.isNotFound=!0,n.throw)throw n;return n}function Qe(n){return!!n?.isNotFound}function iE(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const pl="tsr-scroll-restoration-v1_3",sE=(n,i)=>{let a;return(...r)=>{a||(a=setTimeout(()=>{n(...r),a=null},i))}};function aE(){const n=iE();if(!n)return null;const i=n.getItem(pl);let a=i?JSON.parse(i):{};return{state:a,set:r=>(a=ci(r,a)||a,n.setItem(pl,JSON.stringify(a)))}}const Zr=aE(),Uf=n=>n.state.__TSR_key||n.href;function oE(n){const i=[];let a;for(;a=n.parentNode;)i.push(`${n.tagName}:nth-child(${Array.prototype.indexOf.call(a.children,n)+1})`),n=a;return`${i.reverse().join(" > ")}`.toLowerCase()}let yl=!1;function S0({storageKey:n,key:i,behavior:a,shouldScrollRestoration:r,scrollToTopSelectors:l,location:f}){let h;try{h=JSON.parse(sessionStorage.getItem(n)||"{}")}catch(p){console.error(p);return}const d=i||window.history.state?.__TSR_key,m=h[d];yl=!0;t:{if(r&&m&&Object.keys(m).length>0){for(const v in m){const S=m[v];if(v==="window")window.scrollTo({top:S.scrollY,left:S.scrollX,behavior:a});else if(v){const T=document.querySelector(v);T&&(T.scrollLeft=S.scrollX,T.scrollTop=S.scrollY)}}break t}const p=(f??window.location).hash.split("#",2)[1];if(p){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const S=document.getElementById(p);S&&S.scrollIntoView(v)}break t}const g={top:0,left:0,behavior:a};if(window.scrollTo(g),l)for(const v of l){if(v==="window")continue;const S=typeof v=="function"?v():document.querySelector(v);S&&S.scrollTo(g)}}yl=!1}function rE(n,i){if(!Zr&&!n.isServer||((n.options.scrollRestoration??!1)&&(n.isScrollRestoring=!0),n.isServer||n.isScrollRestorationSetup||!Zr))return;n.isScrollRestorationSetup=!0,yl=!1;const r=n.options.getScrollRestorationKey||Uf;window.history.scrollRestoration="manual";const l=f=>{if(yl||!n.isScrollRestoring)return;let h="";if(f.target===document||f.target===window)h="window";else{const m=f.target.getAttribute("data-scroll-restoration-id");m?h=`[data-scroll-restoration-id="${m}"]`:h=oE(f.target)}const d=r(n.state.location);Zr.set(m=>{const p=m[d]||={},g=p[h]||={};if(h==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(h){const v=document.querySelector(h);v&&(g.scrollX=v.scrollLeft||0,g.scrollY=v.scrollTop||0)}return m})};typeof document<"u"&&document.addEventListener("scroll",sE(l,100),!0),n.subscribe("onRendered",f=>{const h=r(f.toLocation);if(!n.resetNextScroll){n.resetNextScroll=!0;return}typeof n.options.scrollRestoration=="function"&&!n.options.scrollRestoration({location:n.latestLocation})||(S0({storageKey:pl,key:h,behavior:n.options.scrollRestorationBehavior,shouldScrollRestoration:n.isScrollRestoring,scrollToTopSelectors:n.options.scrollToTopSelectors,location:n.history.location}),n.isScrollRestoring&&Zr.set(d=>(d[h]||={},d)))})}function lE(n){if(typeof document<"u"&&document.querySelector){const i=n.state.location.state.__hashScrollIntoViewOptions??!0;if(i&&n.state.location.hash!==""){const a=document.getElementById(n.state.location.hash);a&&a.scrollIntoView(i)}}}function uE(n,i=String){const a=new URLSearchParams;for(const r in n){const l=n[r];l!==void 0&&a.set(r,i(l))}return a.toString()}function of(n){return n?n==="false"?!1:n==="true"?!0:+n*0===0&&+n+""===n?+n:n:""}function cE(n){const i=new URLSearchParams(n),a={};for(const[r,l]of i.entries()){const f=a[r];f==null?a[r]=of(l):Array.isArray(f)?f.push(of(l)):a[r]=[f,of(l)]}return a}const fE=dE(JSON.parse),hE=mE(JSON.stringify,JSON.parse);function dE(n){return i=>{i[0]==="?"&&(i=i.substring(1));const a=cE(i);for(const r in a){const l=a[r];if(typeof l=="string")try{a[r]=n(l)}catch{}}return a}}function mE(n,i){const a=typeof i=="function";function r(l){if(typeof l=="object"&&l!==null)try{return n(l)}catch{}else if(a&&typeof l=="string")try{return i(l),n(l)}catch{}return l}return l=>{const f=uE(l,r);return f?`?${f}`:""}}const Le="__root__";function b0(n){if(n.statusCode=n.statusCode||n.code||307,!n.reloadDocument&&typeof n.href=="string")try{new URL(n.href),n.reloadDocument=!0}catch{}const i=new Headers(n.headers);n.href&&i.get("Location")===null&&i.set("Location",n.href);const a=new Response(null,{status:n.statusCode,headers:i});if(a.options=n,n.throw)throw a;return a}function nn(n){return n instanceof Response&&!!n.options}const il=n=>{if(!n.rendered)return n.rendered=!0,n.onReady?.()},Dl=(n,i)=>!!(n.preload&&!n.router.state.matches.some(a=>a.id===i)),mh=(n,i,a=!0)=>{const r={...n.router.options.context??{}},l=a?i:i-1;for(let f=0;f<=l;f++){const h=n.matches[f];if(!h)continue;const d=n.router.getMatch(h.id);d&&Object.assign(r,d.__routeContext,d.__beforeLoadContext)}return r},T0=(n,i)=>{const a=n.router.routesById[i.routeId??""]??n.router.routeTree;!a.options.notFoundComponent&&n.router.options?.defaultNotFoundComponent&&(a.options.notFoundComponent=n.router.options.defaultNotFoundComponent),On(a.options.notFoundComponent);const r=n.matches.find(l=>l.routeId===a.id);On(r,"Could not find match for route: "+a.id),n.updateMatch(r.id,l=>({...l,status:"notFound",error:i,isFetching:!1})),i.routerCode==="BEFORE_LOAD"&&a.parentRoute&&(i.routeId=a.parentRoute.id,T0(n,i))},fi=(n,i,a)=>{if(!(!nn(a)&&!Qe(a))){if(nn(a)&&a.redirectHandled&&!a.options.reloadDocument)throw a;if(i){i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.loaderPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,i._nonReactive.loaderPromise=void 0;const r=nn(a)?"redirected":"notFound";i._nonReactive.error=a,n.updateMatch(i.id,l=>({...l,status:r,isFetching:!1,error:a})),Qe(a)&&!a.routeId&&(a.routeId=i.routeId),i._nonReactive.loadPromise?.resolve()}throw nn(a)?(n.rendered=!0,a.options._fromLocation=n.location,a.redirectHandled=!0,a=n.router.resolveRedirect(a),a):(T0(n,a),a)}},x0=(n,i)=>{const a=n.router.getMatch(i);return!!(!n.router.isServer&&a._nonReactive.dehydrated||n.router.isServer&&a.ssr===!1)},Za=(n,i,a,r)=>{const{id:l,routeId:f}=n.matches[i],h=n.router.looseRoutesById[f];if(a instanceof Promise)throw a;a.routerCode=r,n.firstBadMatchIndex??=i,fi(n,n.router.getMatch(l),a);try{h.options.onError?.(a)}catch(d){a=d,fi(n,n.router.getMatch(l),a)}n.updateMatch(l,d=>(d._nonReactive.beforeLoadPromise?.resolve(),d._nonReactive.beforeLoadPromise=void 0,d._nonReactive.loadPromise?.resolve(),{...d,error:a,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},pE=(n,i,a,r)=>{const l=n.router.getMatch(i),f=n.matches[a-1]?.id,h=f?n.router.getMatch(f):void 0;if(n.router.isShell()){l.ssr=r.id===Le;return}if(h?.ssr===!1){l.ssr=!1;return}const d=T=>T===!0&&h?.ssr==="data-only"?"data-only":T,m=n.router.options.defaultSsr??!0;if(r.options.ssr===void 0){l.ssr=d(m);return}if(typeof r.options.ssr!="function"){l.ssr=d(r.options.ssr);return}const{search:p,params:g}=l,v={search:Jr(p,l.searchError),params:Jr(g,l.paramsError),location:n.location,matches:n.matches.map(T=>({index:T.index,pathname:T.pathname,fullPath:T.fullPath,staticData:T.staticData,id:T.id,routeId:T.routeId,search:Jr(T.search,T.searchError),params:Jr(T.params,T.paramsError),ssr:T.ssr}))},S=r.options.ssr(v);if(mi(S))return S.then(T=>{l.ssr=d(T??m)});l.ssr=d(S??m)},E0=(n,i,a,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const l=a.options.pendingMs??n.router.options.defaultPendingMs;if(!!(n.onReady&&!n.router.isServer&&!Dl(n,i)&&(a.options.loader||a.options.beforeLoad||_0(a))&&typeof l=="number"&&l!==1/0&&(a.options.pendingComponent??n.router.options?.defaultPendingComponent))){const h=setTimeout(()=>{il(n)},l);r._nonReactive.pendingTimeout=h}},yE=(n,i,a)=>{const r=n.router.getMatch(i);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;E0(n,i,a,r);const l=()=>{const f=n.router.getMatch(i);f.preload&&(f.status==="redirected"||f.status==="notFound")&&fi(n,f,f.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(l):l()},gE=(n,i,a,r)=>{const l=n.router.getMatch(i),f=l._nonReactive.loadPromise;l._nonReactive.loadPromise=Qs(()=>{f?.resolve()});const{paramsError:h,searchError:d}=l;h&&Za(n,a,h,"PARSE_PARAMS"),d&&Za(n,a,d,"VALIDATE_SEARCH"),E0(n,i,r,l);const m=new AbortController,p=n.matches[a-1]?.id;(p?n.router.getMatch(p):void 0)?.context??n.router.options.context;let v=!1;const S=()=>{v||(v=!0,n.updateMatch(i,U=>({...U,isFetching:"beforeLoad",fetchCount:U.fetchCount+1,abortController:m})))},T=()=>{l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,n.updateMatch(i,U=>({...U,isFetching:!1}))};if(!r.options.beforeLoad){io(()=>{S(),T()});return}l._nonReactive.beforeLoadPromise=Qs();const E={...mh(n,a,!1),...l.__routeContext},{search:_,params:C,cause:M}=l,w=Dl(n,i),V={search:_,abortController:m,params:C,preload:w,context:E,location:n.location,navigate:U=>n.router.navigate({...U,_fromLocation:n.location}),buildLocation:n.router.buildLocation,cause:w?"preload":M,matches:n.matches,...n.router.options.additionalContext},P=U=>{if(U===void 0){io(()=>{S(),T()});return}(nn(U)||Qe(U))&&(S(),Za(n,a,U,"BEFORE_LOAD")),io(()=>{S(),n.updateMatch(i,G=>({...G,__beforeLoadContext:U})),T()})};let k;try{if(k=r.options.beforeLoad(V),mi(k))return S(),k.catch(U=>{Za(n,a,U,"BEFORE_LOAD")}).then(P)}catch(U){S(),Za(n,a,U,"BEFORE_LOAD")}P(k)},vE=(n,i)=>{const{id:a,routeId:r}=n.matches[i],l=n.router.looseRoutesById[r],f=()=>{if(n.router.isServer){const m=pE(n,a,i,l);if(mi(m))return m.then(d)}return d()},h=()=>gE(n,a,i,l),d=()=>{if(x0(n,a))return;const m=yE(n,a,l);return mi(m)?m.then(h):h()};return f()},so=(n,i,a)=>{const r=n.router.getMatch(i);if(!r||!a.options.head&&!a.options.scripts&&!a.options.headers)return;const l={matches:n.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([a.options.head?.(l),a.options.scripts?.(l),a.options.headers?.(l)]).then(([f,h,d])=>{const m=f?.meta,p=f?.links,g=f?.scripts,v=f?.styles;return{meta:m,links:p,headScripts:g,headers:d,scripts:h,styles:v}})},R0=(n,i,a,r)=>{const l=n.matchPromises[a-1],{params:f,loaderDeps:h,abortController:d,cause:m}=n.router.getMatch(i),p=mh(n,a),g=Dl(n,i);return{params:f,deps:h,preload:!!g,parentMatchPromise:l,abortController:d,context:p,location:n.location,navigate:v=>n.router.navigate({...v,_fromLocation:n.location}),cause:g?"preload":m,route:r,...n.router.options.additionalContext}},Eg=async(n,i,a,r)=>{try{const l=n.router.getMatch(i);try{(!n.router.isServer||l.ssr===!0)&&A0(r);const f=r.options.loader?.(R0(n,i,a,r)),h=r.options.loader&&mi(f);if((h||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||l._nonReactive.minPendingPromise)&&n.updateMatch(i,v=>({...v,isFetching:"loader"})),r.options.loader){const v=h?await f:f;fi(n,n.router.getMatch(i),v),v!==void 0&&n.updateMatch(i,S=>({...S,loaderData:v}))}r._lazyPromise&&await r._lazyPromise;const m=so(n,i,r),p=m?await m:void 0,g=l._nonReactive.minPendingPromise;g&&await g,r._componentsPromise&&await r._componentsPromise,n.updateMatch(i,v=>({...v,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...p}))}catch(f){let h=f;const d=l._nonReactive.minPendingPromise;d&&await d,Qe(f)&&await r.options.notFoundComponent?.preload?.(),fi(n,n.router.getMatch(i),f);try{r.options.onError?.(f)}catch(g){h=g,fi(n,n.router.getMatch(i),g)}const m=so(n,i,r),p=m?await m:void 0;n.updateMatch(i,g=>({...g,error:h,status:"error",isFetching:!1,...p}))}}catch(l){const f=n.router.getMatch(i);if(f){const h=so(n,i,r);if(h){const d=await h;n.updateMatch(i,m=>({...m,...d}))}f._nonReactive.loaderPromise=void 0}fi(n,f,l)}},SE=async(n,i)=>{const{id:a,routeId:r}=n.matches[i];let l=!1,f=!1;const h=n.router.looseRoutesById[r],d=()=>{n.updateMatch(a,g=>({...g,context:mh(n,i)}))};if(x0(n,a)){if(n.router.isServer){const g=so(n,a,h);if(g){const v=await g;n.updateMatch(a,S=>({...S,...v}))}return n.router.getMatch(a)}}else{const g=n.router.getMatch(a);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!n.sync&&!g.preload)return g;await g._nonReactive.loaderPromise;const v=n.router.getMatch(a),S=v._nonReactive.error||v.error;S&&fi(n,v,S)}else{const v=Date.now()-g.updatedAt,S=Dl(n,a),T=S?h.options.preloadStaleTime??n.router.options.defaultPreloadStaleTime??3e4:h.options.staleTime??n.router.options.defaultStaleTime??0,E=h.options.shouldReload,_=typeof E=="function"?E(R0(n,a,i,h)):E,C=!!S&&!n.router.state.matches.some(P=>P.id===a),M=n.router.getMatch(a);M._nonReactive.loaderPromise=Qs(),C!==M.preload&&n.updateMatch(a,P=>({...P,preload:C}));const{status:w,invalid:V}=M;if(l=w==="success"&&(V||(_??v>T)),!(S&&h.options.preload===!1))if(l&&!n.sync)f=!0,(async()=>{try{await Eg(n,a,i,h),d();const P=n.router.getMatch(a);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){nn(P)&&await n.router.navigate(P.options)}})();else if(w!=="success"||l&&n.sync)await Eg(n,a,i,h);else{const P=so(n,a,h);if(P){const k=await P;n.updateMatch(a,U=>({...U,...k}))}}}}const m=n.router.getMatch(a);f||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve()),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,f||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0,f||d();const p=f?m.isFetching:!1;return p!==m.isFetching||m.invalid!==!1?(n.updateMatch(a,g=>({...g,isFetching:p,invalid:!1})),n.router.getMatch(a)):m};async function Rg(n){const i=Object.assign(n,{matchPromises:[]});!i.router.isServer&&i.router.state.matches.some(a=>a._forcePending)&&il(i);try{for(let l=0;l<i.matches.length;l++){const f=vE(i,l);mi(f)&&await f}const a=i.firstBadMatchIndex??i.matches.length;for(let l=0;l<a;l++)i.matchPromises.push(SE(i,l));await Promise.all(i.matchPromises);const r=il(i);mi(r)&&await r}catch(a){if(Qe(a)&&!i.preload){const r=il(i);throw mi(r)&&await r,a}if(nn(a))throw a}return i.matches}async function A0(n){if(!n._lazyLoaded&&n._lazyPromise===void 0&&(n.lazyFn?n._lazyPromise=n.lazyFn().then(i=>{const{id:a,...r}=i.options;Object.assign(n.options,r),n._lazyLoaded=!0,n._lazyPromise=void 0}):n._lazyLoaded=!0),!n._componentsLoaded&&n._componentsPromise===void 0){const i=()=>{const a=[];for(const r of M0){const l=n.options[r]?.preload;l&&a.push(l())}if(a.length)return Promise.all(a).then(()=>{n._componentsLoaded=!0,n._componentsPromise=void 0});n._componentsLoaded=!0,n._componentsPromise=void 0};n._componentsPromise=n._lazyPromise?n._lazyPromise.then(i):i()}return n._componentsPromise}function Jr(n,i){return i?{status:"error",error:i}:{status:"success",value:n}}function _0(n){for(const i of M0)if(n.options[i]?.preload)return!0;return!1}const M0=["component","errorComponent","pendingComponent","notFoundComponent"];function bE(n){return{input:({url:i})=>{for(const a of n)i=C0(a,i);return i},output:({url:i})=>{for(let a=n.length-1;a>=0;a--)i=D0(n[a],i);return i}}}function TE(n){const i=v0(n.basepath),a=`/${i}`,r=`${a}/`,l=n.caseSensitive?a:a.toLowerCase(),f=n.caseSensitive?r:r.toLowerCase();return{input:({url:h})=>{const d=n.caseSensitive?h.pathname:h.pathname.toLowerCase();return d===l?h.pathname="/":d.startsWith(f)&&(h.pathname=h.pathname.slice(a.length)),h},output:({url:h})=>(h.pathname=nl(["/",i,h.pathname]),h)}}function C0(n,i){const a=n?.input?.({url:i});if(a){if(typeof a=="string")return new URL(a);if(a instanceof URL)return a}return i}function D0(n,i){const a=n?.output?.({url:i});if(a){if(typeof a=="string")return new URL(a);if(a instanceof URL)return a}return i}function Xi(n){const i=n.resolvedLocation,a=n.location,r=i?.pathname!==a.pathname,l=i?.href!==a.href,f=i?.hash!==a.hash;return{fromLocation:i,toLocation:a,pathChanged:r,hrefChanged:l,hashChanged:f}}class xE{constructor(i){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=a=>a(),this.update=a=>{a.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,l=this.basepath??r?.basepath??"/",f=this.basepath===void 0,h=r?.rewrite;this.options={...r,...a},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(S=>[encodeURIComponent(S),S])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Ux())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Vx(RE(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(S=>!["redirected"].includes(S.status))}}}),rE(this));let d=!1;const m=this.options.basepath??"/",p=this.options.rewrite;if(f||l!==m||h!==p){this.basepath=m;const S=[];v0(m)!==""&&S.push(TE({basepath:m})),p&&S.push(p),this.rewrite=S.length===0?void 0:S.length===1?S[0]:bE(S),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:a,routesByPath:r,processedTree:l}=Zx(this.routeTree,this.options.caseSensitive,(h,d)=>{h.init({originalIndex:d})});this.options.routeMasks&&Fx(this.options.routeMasks,l),this.routesById=a,this.routesByPath=r,this.processedTree=l;const f=this.options.notFoundRoute;f&&(f.init({originalIndex:99999999999}),this.routesById[f.id]=f)},this.subscribe=(a,r)=>{const l={eventType:a,fn:r};return this.subscribers.add(l),()=>{this.subscribers.delete(l)}},this.emit=a=>{this.subscribers.forEach(r=>{r.eventType===a.type&&r.fn(a)})},this.parseLocation=(a,r)=>{const l=({href:m,state:p})=>{const g=new URL(m,this.origin),v=C0(this.rewrite,g),S=this.options.parseSearch(v.search),T=this.options.stringifySearch(S);return v.search=T,{href:v.href.replace(v.origin,""),publicHref:m,url:v,pathname:xg(v.pathname),searchStr:T,search:Fe(r?.search,S),hash:v.hash.split("#").reverse()[0]??"",state:Fe(r?.state,p)}},f=l(a),{__tempLocation:h,__tempKey:d}=f.state;if(h&&(!d||d===this.tempLocationKey)){const m=l(h);return m.state.key=f.state.key,m.state.__TSR_key=f.state.__TSR_key,delete m.state.__tempLocation,{...m,maskedLocation:f}}return f},this.resolvePathCache=dl(1e3),this.resolvePathWithBase=(a,r)=>eE({base:a,to:dh(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(a,r,l)=>typeof a=="string"?this.matchRoutesInternal({pathname:a,search:r},l):this.matchRoutesInternal(a,r),this.getMatchedRoutes=a=>AE({pathname:a,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=a=>{const r=this.getMatch(a);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const a=this.state.matches.filter(f=>f.status==="pending"),r=this.state.matches.filter(f=>f.isFetching==="loader");new Set([...this.state.pendingMatches??[],...a,...r]).forEach(f=>{this.cancelMatch(f.id)})},this.buildLocation=a=>{const r=(f={})=>{const h=f._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutes(h,{_buildLocation:!0}),m=fl(d);f.from;const p=f.unsafeRelative==="path"?h.pathname:f.from??m.fullPath,g=this.resolvePathWithBase(p,"."),v=m.search,S={...m.params},T=f.to?this.resolvePathWithBase(g,`${f.to}`):this.resolvePathWithBase(g,"."),E=f.params===!1||f.params===null?{}:(f.params??!0)===!0?S:Object.assign(S,ci(f.params,S)),_=af({path:T,params:E}).interpolatedPath,C=this.matchRoutes(_,void 0,{_buildLocation:!0}).map(nt=>this.looseRoutesById[nt.routeId]);if(Object.keys(E).length>0)for(const nt of C){const st=nt.options.params?.stringify??nt.options.stringifyParams;st&&Object.assign(E,st(E))}const M=a.leaveParams?T:xg(af({path:T,params:E,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let w=v;if(a._includeValidateSearch&&this.options.search?.strict){const nt={};C.forEach(st=>{if(st.options.validateSearch)try{Object.assign(nt,jf(st.options.validateSearch,{...nt,...w}))}catch{}}),w=nt}w=_E({search:w,dest:f,destRoutes:C,_includeValidateSearch:a._includeValidateSearch}),w=Fe(v,w);const V=this.options.stringifySearch(w),P=f.hash===!0?h.hash:f.hash?ci(f.hash,h.hash):void 0,k=P?`#${P}`:"";let U=f.state===!0?h.state:f.state?ci(f.state,h.state):{};U=Fe(h.state,U);const G=`${M}${V}${k}`,H=new URL(G,this.origin),Z=D0(this.rewrite,H);return{publicHref:Z.pathname+Z.search+Z.hash,href:G,url:Z,pathname:M,search:w,searchStr:V,state:U,hash:P??"",unmaskOnReload:f.unmaskOnReload}},l=(f={},h)=>{const d=r(f);let m=h?r(h):void 0;if(!m){const p={};if(this.options.routeMasks){const g=Kx(d.pathname,this.processedTree);if(g){Object.assign(p,g.params);const{from:v,params:S,...T}=g.route,E=S===!1||S===null?{}:(S??!0)===!0?p:Object.assign(p,ci(S,p));h={from:a.from,...T,params:E},m=r(h)}}}return m&&(d.maskedLocation=m),d};return a.mask?l(a,{from:a.from,...a.mask}):l(a)},this.commitLocation=({viewTransition:a,ignoreBlocker:r,...l})=>{const f=()=>{const m=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];m.forEach(g=>{l.state[g]=this.latestLocation.state[g]});const p=Ki(l.state,this.latestLocation.state);return m.forEach(g=>{delete l.state[g]}),p},h=ki(this.latestLocation.href)===ki(l.href),d=this.commitLocationPromise;if(this.commitLocationPromise=Qs(()=>{d?.resolve()}),h&&f())this.load();else{let{maskedLocation:m,hashScrollIntoView:p,url:g,...v}=l;m&&(v={...m,state:{...m.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=a,this.history[l.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:r})}return this.resetNextScroll=l.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:a,resetScroll:r,hashScrollIntoView:l,viewTransition:f,ignoreBlocker:h,href:d,...m}={})=>{if(d){const v=this.history.location.state.__TSR_index,S=cl(d,{__TSR_index:a?v:v+1});m.to=S.pathname,m.search=this.options.parseSearch(S.search),m.hash=S.hash.slice(1)}const p=this.buildLocation({...m,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const g=this.commitLocation({...p,viewTransition:f,replace:a,resetScroll:r,hashScrollIntoView:l,ignoreBlocker:h});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:a,reloadDocument:r,href:l,...f})=>{if(!r&&l)try{new URL(`${l}`),r=!0}catch{}if(r){if(l||(l=this.buildLocation({to:a,...f}).url.href),!f.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const m of d)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return f.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...f,href:l,to:a,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==r.publicHref||r.url.origin!==this.origin){const l=this.getParsedLocationHref(r);throw b0({href:l})}}const a=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:a,cachedMatches:r.cachedMatches.filter(l=>!a.some(f=>f.id===l.id))}))},this.load=async a=>{let r,l,f;for(f=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xi({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...Xi({resolvedLocation:p,location:m})}),await Rg({router:this,sync:a?.sync,matches:this.state.pendingMatches,location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],v=[],S=[];io(()=>{this.__store.setState(T=>{const E=T.matches,_=T.pendingMatches||T.matches;return g=E.filter(C=>!_.some(M=>M.id===C.id)),v=_.filter(C=>!E.some(M=>M.id===C.id)),S=_.filter(C=>E.some(M=>M.id===C.id)),{...T,isLoading:!1,loadedAt:Date.now(),matches:_,pendingMatches:void 0,cachedMatches:[...T.cachedMatches,...g.filter(C=>C.status!=="error"&&C.status!=="notFound")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[v,"onEnter"],[S,"onStay"]].forEach(([T,E])=>{T.forEach(_=>{this.looseRoutesById[_.routeId].options[E]?.(_)})})})})}})}catch(m){nn(m)?(r=m,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Qe(m)&&(l=m),this.__store.setState(p=>({...p,statusCode:r?r.status:l?404:p.matches.some(g=>g.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===f&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=f,await f;this.latestLoadPromise&&f!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.__store.state.matches.some(d=>d.status==="error")&&(h=500),h!==void 0&&this.__store.setState(d=>({...d,statusCode:h}))},this.startViewTransition=a=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let l;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const f=this.latestLocation,h=this.state.resolvedLocation,d=typeof r.types=="function"?r.types(Xi({resolvedLocation:h,location:f})):r.types;if(d===!1){a();return}l={update:a,types:d}}else l=a;document.startViewTransition(l)}else a()},this.updateMatch=(a,r)=>{this.startTransition(()=>{const l=this.state.pendingMatches?.some(f=>f.id===a)?"pendingMatches":this.state.matches.some(f=>f.id===a)?"matches":this.state.cachedMatches.some(f=>f.id===a)?"cachedMatches":"";l&&this.__store.setState(f=>({...f,[l]:f[l]?.map(h=>h.id===a?r(h):h)}))})},this.getMatch=a=>{const r=l=>l.id===a;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=a=>{const r=l=>a?.filter?.(l)??!0?{...l,invalid:!0,...a?.forcePending||l.status==="error"||l.status==="notFound"?{status:"pending",error:void 0}:void 0}:l;return this.__store.setState(l=>({...l,matches:l.matches.map(r),cachedMatches:l.cachedMatches.map(r),pendingMatches:l.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:a?.sync})},this.getParsedLocationHref=a=>{let r=a.url.href;return this.origin&&a.url.origin===this.origin&&(r=r.replace(this.origin,"")||"/"),r},this.resolveRedirect=a=>{if(!a.options.href){const r=this.buildLocation(a.options),l=this.getParsedLocationHref(r);a.options.href=r.href,a.headers.set("Location",l)}return a.headers.get("Location")||a.headers.set("Location",a.options.href),a},this.clearCache=a=>{const r=a?.filter;r!==void 0?this.__store.setState(l=>({...l,cachedMatches:l.cachedMatches.filter(f=>!r(f))})):this.__store.setState(l=>({...l,cachedMatches:[]}))},this.clearExpiredCache=()=>{const a=r=>{const l=this.looseRoutesById[r.routeId];if(!l.options.loader)return!0;const f=(r.preload?l.options.preloadGcTime??this.options.defaultPreloadGcTime:l.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=f};this.clearCache({filter:a})},this.loadRouteChunk=A0,this.preloadRoute=async a=>{const r=this.buildLocation(a);let l=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:a});const f=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),h=new Set([...f,...this.state.cachedMatches.map(d=>d.id)]);io(()=>{l.forEach(d=>{h.has(d.id)||this.__store.setState(m=>({...m,cachedMatches:[...m.cachedMatches,d]}))})});try{return l=await Rg({router:this,matches:l,location:r,preload:!0,updateMatch:(d,m)=>{f.has(d)?l=l.map(p=>p.id===d?m(p):p):this.updateMatch(d,m)}}),l}catch(d){if(nn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});Qe(d)||console.error(d);return}},this.matchRoute=(a,r)=>{const l={...a,to:a.to?this.resolvePathWithBase(a.from||"",a.to):void 0,params:a.params||{},leaveParams:!0},f=this.buildLocation(l);if(r?.pending&&this.state.status!=="pending")return!1;const d=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,m=kx(f.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,d.pathname,this.processedTree);return!m||a.params&&!Ki(m.params,a.params,{partial:!0})?!1:r?.includeSearch??!0?Ki(d.search,f.search,{partial:!0})?m.params:!1:m.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(a=>a.status==="notFound"||a.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...i,caseSensitive:i.caseSensitive??!1,notFoundMode:i.notFoundMode??"fuzzy",stringifySearch:i.stringifySearch??hE,parseSearch:i.parseSearch??fE}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(i,a){const r=this.getMatchedRoutes(i.pathname),{foundRoute:l,routeParams:f}=r;let{matchedRoutes:h}=r,d=!1;(l?l.path!=="/"&&f["**"]:ki(i.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:d=!0);const m=(()=>{if(d){if(this.options.notFoundMode!=="root")for(let v=h.length-1;v>=0;v--){const S=h[v];if(S.children)return S.id}return Le}})(),p=[],g=v=>v?.id?v.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((v,S)=>{const T=p[S-1],[E,_,C]=(()=>{const Pt=T?.search??i.search,Ut=T?._strictSearch??void 0;try{const zt=jf(v.options.validateSearch,{...Pt})??void 0;return[{...Pt,...zt},{...Ut,...zt},void 0]}catch(zt){let j=zt;if(zt instanceof gl||(j=new gl(zt.message,{cause:zt})),a?.throwOnError)throw j;return[Pt,{},j]}})(),M=v.options.loaderDeps?.({search:E})??"",w=M?JSON.stringify(M):"",{interpolatedPath:V,usedParams:P}=af({path:v.fullPath,params:f,decodeCharMap:this.pathParamsDecodeCharMap}),k=v.id+V+w,U=this.getMatch(k),G=this.state.matches.find(Pt=>Pt.routeId===v.id),H=U?._strictParams??P;let Z;if(!U){const Pt=v.options.params?.parse??v.options.parseParams;if(Pt)try{Object.assign(H,Pt(H))}catch(Ut){if(Qe(Ut)||nn(Ut)?Z=Ut:Z=new EE(Ut.message,{cause:Ut}),a?.throwOnError)throw Z}}Object.assign(f,H);const nt=G?"stay":"enter";let st;if(U)st={...U,cause:nt,params:G?Fe(G.params,f):f,_strictParams:H,search:Fe(G?G.search:U.search,E),_strictSearch:_};else{const Pt=v.options.loader||v.options.beforeLoad||v.lazyFn||_0(v)?"pending":"success";st={id:k,ssr:this.isServer?void 0:v.options.ssr,index:S,routeId:v.id,params:G?Fe(G.params,f):f,_strictParams:H,pathname:V,updatedAt:Date.now(),search:G?Fe(G.search,E):E,_strictSearch:_,searchError:void 0,status:Pt,isFetching:!1,error:void 0,paramsError:Z,__routeContext:void 0,_nonReactive:{loadPromise:Qs()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:nt,loaderDeps:G?Fe(G.loaderDeps,M):M,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:v.options.staticData||{},fullPath:v.fullPath}}a?.preload||(st.globalNotFound=m===v.id),st.searchError=C;const Tt=g(T);st.context={...Tt,...st.__routeContext,...st.__beforeLoadContext},p.push(st)}),p.forEach((v,S)=>{const T=this.looseRoutesById[v.routeId];if(!this.getMatch(v.id)&&a?._buildLocation!==!0){const _=p[S-1],C=g(_);if(T.options.context){const M={deps:v.loaderDeps,params:v.params,context:C??{},location:i,navigate:w=>this.navigate({...w,_fromLocation:i}),buildLocation:this.buildLocation,cause:v.cause,abortController:v.abortController,preload:!!v.preload,matches:p};v.__routeContext=T.options.context(M)??void 0}v.context={...C,...v.__routeContext,...v.__beforeLoadContext}}}),p}}class gl extends Error{}class EE extends Error{}function RE(n){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:n,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function jf(n,i){if(n==null)return{};if("~standard"in n){const a=n["~standard"].validate(i);if(a instanceof Promise)throw new gl("Async validation not supported");if(a.issues)throw new gl(JSON.stringify(a.issues,void 0,2),{cause:a});return a.value}return"parse"in n?n.parse(i):typeof n=="function"?n(i):{}}function AE({pathname:n,routesById:i,processedTree:a}){const r={},l=ki(n);let f;const h=Qx(l,a,!0);return h&&(f=h.route,Object.assign(r,h.params)),{matchedRoutes:h?.branch||[i[Le]],routeParams:r,foundRoute:f}}function _E({search:n,dest:i,destRoutes:a,_includeValidateSearch:r}){const l=a.reduce((d,m)=>{const p=[];if("search"in m.options)m.options.search?.middlewares&&p.push(...m.options.search.middlewares);else if(m.options.preSearchFilters||m.options.postSearchFilters){const g=({search:v,next:S})=>{let T=v;"preSearchFilters"in m.options&&m.options.preSearchFilters&&(T=m.options.preSearchFilters.reduce((_,C)=>C(_),v));const E=S(T);return"postSearchFilters"in m.options&&m.options.postSearchFilters?m.options.postSearchFilters.reduce((_,C)=>C(_),E):E};p.push(g)}if(r&&m.options.validateSearch){const g=({search:v,next:S})=>{const T=S(v);try{return{...T,...jf(m.options.validateSearch,T)??void 0}}catch{return T}};p.push(g)}return d.concat(p)},[])??[],f=({search:d})=>i.search?i.search===!0?d:ci(i.search,d):{};l.push(f);const h=(d,m)=>{if(d>=l.length)return m;const p=l[d];return p({search:m,next:v=>h(d+1,v)})};return h(0,n)}const ME="Error preloading route! ☝️";class w0{constructor(i){if(this.init=a=>{this.originalIndex=a.originalIndex;const r=this.options,l=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),l?this._path=Le:this.parentRoute||On(!1);let f=l?Le:r?.path;f&&f!=="/"&&(f=g0(f));const h=r?.id||f;let d=l?Le:nl([this.parentRoute.id===Le?"":this.parentRoute.id,h]);f===Le&&(f="/"),d!==Le&&(d=nl(["/",d]));const m=d===Le?"/":nl([this.parentRoute.fullPath,f]);this._path=f,this._id=d,this._fullPath=m,this._to=m},this.addChildren=a=>this._addFileChildren(a),this._addFileChildren=a=>(Array.isArray(a)&&(this.children=a),typeof a=="object"&&a!==null&&(this.children=Object.values(a)),this),this._addFileTypes=()=>this,this.updateLoader=a=>(Object.assign(this.options,a),this),this.update=a=>(Object.assign(this.options,a),this),this.lazy=a=>(this.lazyFn=a,this),this.options=i||{},this.isRoot=!i?.getParentRoute,i?.id&&i?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class CE extends w0{constructor(i){super(i)}}function ph(n){const i=n.errorComponent??wl;return X.jsx(DE,{getResetKey:n.getResetKey,onCatch:n.onCatch,children:({error:a,reset:r})=>a?K.createElement(i,{error:a,reset:r}):n.children})}class DE extends K.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(i){return{resetKey:i.getResetKey()}}static getDerivedStateFromError(i){return{error:i}}reset(){this.setState({error:null})}componentDidUpdate(i,a){a.error&&a.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(i,a){this.props.onCatch&&this.props.onCatch(i,a)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function wl({error:n}){const[i,a]=K.useState(!1);return X.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[X.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[X.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),X.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>a(r=>!r),children:i?"Hide Error":"Show Error"})]}),X.jsx("div",{style:{height:".25rem"}}),i?X.jsx("div",{children:X.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:n.message?X.jsx("code",{children:n.message}):null})}):null]})}function wE({children:n,fallback:i=null}){return OE()?X.jsx(_t.Fragment,{children:n}):X.jsx(_t.Fragment,{children:i})}function OE(){return _t.useSyncExternalStore(LE,()=>!0,()=>!1)}function LE(){return()=>{}}var rf={exports:{}},lf={},uf={exports:{}},cf={};var Ag;function zE(){if(Ag)return cf;Ag=1;var n=So();function i(v,S){return v===S&&(v!==0||1/v===1/S)||v!==v&&S!==S}var a=typeof Object.is=="function"?Object.is:i,r=n.useState,l=n.useEffect,f=n.useLayoutEffect,h=n.useDebugValue;function d(v,S){var T=S(),E=r({inst:{value:T,getSnapshot:S}}),_=E[0].inst,C=E[1];return f(function(){_.value=T,_.getSnapshot=S,m(_)&&C({inst:_})},[v,T,S]),l(function(){return m(_)&&C({inst:_}),v(function(){m(_)&&C({inst:_})})},[v]),h(T),T}function m(v){var S=v.getSnapshot;v=v.value;try{var T=S();return!a(v,T)}catch{return!0}}function p(v,S){return S()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return cf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,cf}var _g;function VE(){return _g||(_g=1,uf.exports=zE()),uf.exports}var Mg;function BE(){if(Mg)return lf;Mg=1;var n=So(),i=VE();function a(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var r=typeof Object.is=="function"?Object.is:a,l=i.useSyncExternalStore,f=n.useRef,h=n.useEffect,d=n.useMemo,m=n.useDebugValue;return lf.useSyncExternalStoreWithSelector=function(p,g,v,S,T){var E=f(null);if(E.current===null){var _={hasValue:!1,value:null};E.current=_}else _=E.current;E=d(function(){function M(U){if(!w){if(w=!0,V=U,U=S(U),T!==void 0&&_.hasValue){var G=_.value;if(T(G,U))return P=G}return P=U}if(G=P,r(V,U))return G;var H=S(U);return T!==void 0&&T(G,H)?(V=U,G):(V=U,P=H)}var w=!1,V,P,k=v===void 0?null:v;return[function(){return M(g())},k===null?void 0:function(){return M(k())}]},[g,v,S,T]);var C=l(p,E[0],E[1]);return h(function(){_.hasValue=!0,_.value=C},[C]),m(C),C},lf}var Cg;function UE(){return Cg||(Cg=1,rf.exports=BE()),rf.exports}var jE=UE();function NE(n,i=r=>r,a={}){const r=a.equal??PE;return jE.useSyncExternalStoreWithSelector(n.subscribe,()=>n.state,()=>n.state,i,r)}function PE(n,i){if(Object.is(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;if(n instanceof Map&&i instanceof Map){if(n.size!==i.size)return!1;for(const[r,l]of n)if(!i.has(r)||!Object.is(l,i.get(r)))return!1;return!0}if(n instanceof Set&&i instanceof Set){if(n.size!==i.size)return!1;for(const r of n)if(!i.has(r))return!1;return!0}if(n instanceof Date&&i instanceof Date)return n.getTime()===i.getTime();const a=Dg(n);if(a.length!==Dg(i).length)return!1;for(let r=0;r<a.length;r++)if(!Object.prototype.hasOwnProperty.call(i,a[r])||!Object.is(n[a[r]],i[a[r]]))return!1;return!0}function Dg(n){return Object.keys(n).concat(Object.getOwnPropertySymbols(n))}const ff=K.createContext(null);function O0(){return typeof document>"u"?ff:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ff,ff)}function ze(n){const i=K.useContext(O0());return n?.warn,i}function Te(n){const i=ze({warn:n?.router===void 0}),a=n?.router||i,r=K.useRef(void 0);return NE(a.__store,l=>{if(n?.select){if(n.structuralSharing??a.options.defaultStructuralSharing){const f=Fe(r.current,n.select(l));return r.current=f,f}return n.select(l)}return l})}const Ol=K.createContext(void 0),HE=K.createContext(void 0);function cn(n){const i=K.useContext(n.from?HE:Ol);return Te({select:r=>{const l=r.matches.find(f=>n.from?n.from===f.routeId:f.id===i);if(On(!((n.shouldThrow??!0)&&!l),`Could not find ${n.from?`an active match from "${n.from}"`:"a nearest match!"}`),l!==void 0)return n.select?n.select(l):l},structuralSharing:n.structuralSharing})}function yh(n){return cn({from:n.from,strict:n.strict,structuralSharing:n.structuralSharing,select:i=>n.select?n.select(i.loaderData):i.loaderData})}function gh(n){const{select:i,...a}=n;return cn({...a,select:r=>i?i(r.loaderDeps):r.loaderDeps})}function vh(n){return cn({from:n.from,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,strict:n.strict,select:i=>{const a=n.strict===!1?i.params:i._strictParams;return n.select?n.select(a):a}})}function Sh(n){return cn({from:n.from,strict:n.strict,shouldThrow:n.shouldThrow,structuralSharing:n.structuralSharing,select:i=>n.select?n.select(i.search):i.search})}const Ir=typeof window<"u"?K.useLayoutEffect:K.useEffect;function hf(n){const i=K.useRef({value:n,prev:null}),a=i.current.value;return n!==a&&(i.current={value:n,prev:a}),i.current.prev}function qE(n,i,a={},r={}){K.useEffect(()=>{if(!n.current||r.disabled||typeof IntersectionObserver!="function")return;const l=new IntersectionObserver(([f])=>{i(f)},a);return l.observe(n.current),()=>{l.disconnect()}},[i,a,r.disabled,n])}function GE(n){const i=K.useRef(null);return K.useImperativeHandle(n,()=>i.current,[]),i}function bh(n){const i=ze();return K.useCallback(a=>i.navigate({...a,from:a.from??n?.from}),[n?.from,i])}var df={exports:{}},le={};var wg;function YE(){if(wg)return le;wg=1;var n=So();function i(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function f(m,p,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:m,containerInfo:p,implementation:g}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return le.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,le.createPortal=function(m,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(i(299));return f(m,p,null,g)},le.flushSync=function(m){var p=h.T,g=r.p;try{if(h.T=null,r.p=2,m)return m()}finally{h.T=p,r.p=g,r.d.f()}},le.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(m,p))},le.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},le.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var g=p.as,v=d(g,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,T=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?r.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:S,fetchPriority:T}):g==="script"&&r.d.X(m,{crossOrigin:v,integrity:S,fetchPriority:T,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},le.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=d(p.as,p.crossOrigin);r.d.M(m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(m)},le.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,v=d(g,p.crossOrigin);r.d.L(m,g,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},le.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=d(p.as,p.crossOrigin);r.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(m)},le.requestFormReset=function(m){r.d.r(m)},le.unstable_batchedUpdates=function(m,p){return m(p)},le.useFormState=function(m,p,g){return h.H.useFormState(m,p,g)},le.useFormStatus=function(){return h.H.useHostTransitionStatus()},le.version="19.2.3",le}var Og;function L0(){if(Og)return df.exports;Og=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),df.exports=YE(),df.exports}var FE=L0();function KE(n,i){const a=ze(),[r,l]=K.useState(!1),f=K.useRef(!1),h=GE(i),{activeProps:d,inactiveProps:m,activeOptions:p,to:g,preload:v,preloadDelay:S,hashScrollIntoView:T,replace:E,startTransition:_,resetScroll:C,viewTransition:M,children:w,target:V,disabled:P,style:k,className:U,onClick:G,onFocus:H,onMouseEnter:Z,onMouseLeave:nt,onTouchStart:st,ignoreBlocker:Tt,params:Pt,search:Ut,hash:zt,state:j,mask:Q,reloadDocument:W,unsafeRelative:ft,from:yt,_fromLocation:A,...F}=n,J=Te({select:Ct=>Ct.location.search,structuralSharing:!0}),I=n.from,at=K.useMemo(()=>({...n,from:I}),[a,J,I,n._fromLocation,n.hash,n.to,n.search,n.params,n.state,n.mask,n.unsafeRelative]),rt=K.useMemo(()=>a.buildLocation({...at}),[a,at]),gt=K.useMemo(()=>{if(P)return;let Ct=rt.maskedLocation?rt.maskedLocation.url.href:rt.url.href,xt=!1;return a.origin&&(Ct.startsWith(a.origin)?Ct=a.history.createHref(Ct.replace(a.origin,""))||"/":xt=!0),{href:Ct,external:xt}},[P,rt.maskedLocation,rt.url,a.origin,a.history]),kt=K.useMemo(()=>{if(gt?.external)return gt.href;try{return new URL(g),g}catch{}},[g,gt]),Mt=n.reloadDocument||kt?!1:v??a.options.defaultPreload,fn=S??a.options.defaultPreloadDelay??0,Bn=Te({select:Ct=>{if(kt)return!1;if(p?.exact){if(!tE(Ct.location.pathname,rt.pathname,a.basepath))return!1}else{const xt=ml(Ct.location.pathname,a.basepath),xe=ml(rt.pathname,a.basepath);if(!(xt.startsWith(xe)&&(xt.length===xe.length||xt[xe.length]==="/")))return!1}return(p?.includeSearch??!0)&&!Ki(Ct.location.search,rt.search,{partial:!p?.exact,ignoreUndefined:!p?.explicitUndefined})?!1:p?.includeHash?Ct.location.hash===rt.hash:!0}}),Ze=K.useCallback(()=>{a.preloadRoute({...at}).catch(Ct=>{console.warn(Ct),console.warn(ME)})},[a,at]),_o=K.useCallback(Ct=>{Ct?.isIntersecting&&Ze()},[Ze]);qE(h,_o,JE,{disabled:!!P||Mt!=="viewport"}),K.useEffect(()=>{f.current||!P&&Mt==="render"&&(Ze(),f.current=!0)},[P,Ze,Mt]);const hn=Ct=>{const xt=Ct.currentTarget.getAttribute("target"),xe=V!==void 0?V:xt;if(!P&&!IE(Ct)&&!Ct.defaultPrevented&&(!xe||xe==="_self")&&Ct.button===0){Ct.preventDefault(),FE.flushSync(()=>{l(!0)});const ea=a.subscribe("onResolved",()=>{ea(),l(!1)});a.navigate({...at,replace:E,resetScroll:C,hashScrollIntoView:T,startTransition:_,viewTransition:M,ignoreBlocker:Tt})}};if(kt)return{...F,ref:h,href:kt,...w&&{children:w},...V&&{target:V},...P&&{disabled:P},...k&&{style:k},...U&&{className:U},...G&&{onClick:G},...H&&{onFocus:H},...Z&&{onMouseEnter:Z},...nt&&{onMouseLeave:nt},...st&&{onTouchStart:st}};const ts=Ct=>{P||Mt&&Ze()},ta=ts,Nl=Ct=>{if(!(P||!Mt))if(!fn)Ze();else{const xt=Ct.target;if(Ja.has(xt))return;const xe=setTimeout(()=>{Ja.delete(xt),Ze()},fn);Ja.set(xt,xe)}},Mo=Ct=>{if(P||!Mt||!fn)return;const xt=Ct.target,xe=Ja.get(xt);xe&&(clearTimeout(xe),Ja.delete(xt))},Un=Bn?ci(d,{})??kE:mf,jn=Bn?mf:ci(m,{})??mf,es=[U,Un.className,jn.className].filter(Boolean).join(" "),Co=(k||Un.style||jn.style)&&{...k,...Un.style,...jn.style};return{...F,...Un,...jn,href:gt?.href,ref:h,onClick:Ia([G,hn]),onFocus:Ia([H,ts]),onMouseEnter:Ia([Z,Nl]),onMouseLeave:Ia([nt,Mo]),onTouchStart:Ia([st,ta]),disabled:!!P,target:V,...Co&&{style:Co},...es&&{className:es},...P&&QE,...Bn&&XE,...r&&ZE}}const mf={},kE={className:"active"},QE={role:"link","aria-disabled":!0},XE={"data-status":"active","aria-current":"page"},ZE={"data-transitioning":"transitioning"},Ja=new WeakMap,JE={rootMargin:"100px"},Ia=n=>i=>{for(const a of n)if(a){if(i.defaultPrevented)return;a(i)}},z0=K.forwardRef((n,i)=>{const{_asChild:a,...r}=n,{type:l,ref:f,...h}=KE(r,i),d=typeof r.children=="function"?r.children({isActive:h["data-status"]==="active"}):r.children;return a===void 0&&delete h.disabled,K.createElement(a||"a",{...h,ref:f},d)});function IE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}let $E=class extends w0{constructor(i){super(i),this.useMatch=a=>cn({select:a?.select,from:this.id,structuralSharing:a?.structuralSharing}),this.useRouteContext=a=>cn({...a,from:this.id,select:r=>a?.select?a.select(r.context):r.context}),this.useSearch=a=>Sh({select:a?.select,structuralSharing:a?.structuralSharing,from:this.id}),this.useParams=a=>vh({select:a?.select,structuralSharing:a?.structuralSharing,from:this.id}),this.useLoaderDeps=a=>gh({...a,from:this.id}),this.useLoaderData=a=>yh({...a,from:this.id}),this.useNavigate=()=>bh({from:this.fullPath}),this.Link=_t.forwardRef((a,r)=>X.jsx(z0,{ref:r,from:this.fullPath,...a})),this.$$typeof=Symbol.for("react.memo")}};function WE(n){return new $E(n)}class tR extends CE{constructor(i){super(i),this.useMatch=a=>cn({select:a?.select,from:this.id,structuralSharing:a?.structuralSharing}),this.useRouteContext=a=>cn({...a,from:this.id,select:r=>a?.select?a.select(r.context):r.context}),this.useSearch=a=>Sh({select:a?.select,structuralSharing:a?.structuralSharing,from:this.id}),this.useParams=a=>vh({select:a?.select,structuralSharing:a?.structuralSharing,from:this.id}),this.useLoaderDeps=a=>gh({...a,from:this.id}),this.useLoaderData=a=>yh({...a,from:this.id}),this.useNavigate=()=>bh({from:this.fullPath}),this.Link=_t.forwardRef((a,r)=>X.jsx(z0,{ref:r,from:this.fullPath,...a})),this.$$typeof=Symbol.for("react.memo")}}function eR(n){return new tR(n)}function pi(n){return typeof n=="object"?new Lg(n,{silent:!0}).createRoute(n):new Lg(n,{silent:!0}).createRoute}class Lg{constructor(i,a){this.path=i,this.createRoute=r=>{this.silent;const l=WE(r);return l.isRoot=!1,l},this.silent=a?.silent}}class zg{constructor(i){this.useMatch=a=>cn({select:a?.select,from:this.options.id,structuralSharing:a?.structuralSharing}),this.useRouteContext=a=>cn({from:this.options.id,select:r=>a?.select?a.select(r.context):r.context}),this.useSearch=a=>Sh({select:a?.select,structuralSharing:a?.structuralSharing,from:this.options.id}),this.useParams=a=>vh({select:a?.select,structuralSharing:a?.structuralSharing,from:this.options.id}),this.useLoaderDeps=a=>gh({...a,from:this.options.id}),this.useLoaderData=a=>yh({...a,from:this.options.id}),this.useNavigate=()=>{const a=ze();return bh({from:a.routesById[this.options.id].fullPath})},this.options=i,this.$$typeof=Symbol.for("react.memo")}}function Vg(n){return typeof n=="object"?new zg(n):i=>new zg({id:n,...i})}function bo(n,i){let a,r,l,f;const h=()=>(a||(a=n().then(m=>{a=void 0,r=m[i]}).catch(m=>{if(l=m,Px(l)&&l instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const p=`tanstack_router_reload:${l.message}`;sessionStorage.getItem(p)||(sessionStorage.setItem(p,"1"),f=!0)}})),a),d=function(p){if(f)throw window.location.reload(),new Promise(()=>{});if(l)throw l;if(!r)throw h();return K.createElement(r,p)};return d.preload=h,d}function nR(){const n=ze(),i=K.useRef({router:n,mounted:!1}),[a,r]=K.useState(!1),{hasPendingMatches:l,isLoading:f}=Te({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(S=>S.status==="pending")}),structuralSharing:!0}),h=hf(f),d=f||a||l,m=hf(d),p=f||l,g=hf(p);return n.startTransition=v=>{r(!0),K.startTransition(()=>{v(),r(!1)})},K.useEffect(()=>{const v=n.history.subscribe(n.load),S=n.buildLocation({to:n.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ki(n.latestLocation.href)!==ki(S.href)&&n.commitLocation({...S,replace:!0}),()=>{v()}},[n,n.history]),Ir(()=>{if(typeof window<"u"&&n.ssr||i.current.router===n&&i.current.mounted)return;i.current={router:n,mounted:!0},(async()=>{try{await n.load()}catch(S){console.error(S)}})()},[n]),Ir(()=>{h&&!f&&n.emit({type:"onLoad",...Xi(n.state)})},[h,n,f]),Ir(()=>{g&&!p&&n.emit({type:"onBeforeRouteMount",...Xi(n.state)})},[p,g,n]),Ir(()=>{if(m&&!d){const v=Xi(n.state);n.emit({type:"onResolved",...v}),n.__store.setState(S=>({...S,status:"idle",resolvedLocation:S.location})),v.hrefChanged&&lE(n)}},[d,m,n]),null}function iR(n){const i=Te({select:a=>`not-found-${a.location.pathname}-${a.status}`});return X.jsx(ph,{getResetKey:()=>i,onCatch:(a,r)=>{if(Qe(a))n.onCatch?.(a,r);else throw a},errorComponent:({error:a})=>{if(Qe(a))return n.fallback?.(a);throw a},children:n.children})}function sR(){return X.jsx("p",{children:"Not Found"})}function Hs(n){return X.jsx(X.Fragment,{children:n.children})}function V0(n,i,a){return i.options.notFoundComponent?X.jsx(i.options.notFoundComponent,{...a}):n.options.defaultNotFoundComponent?X.jsx(n.options.defaultNotFoundComponent,{...a}):X.jsx(sR,{})}function aR({children:n}){const i=ze();return i.isServer?X.jsx("script",{nonce:i.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:n+";document.currentScript.remove()"}}):null}function oR(){const n=ze();if(!n.isScrollRestoring||!n.isServer||typeof n.options.scrollRestoration=="function"&&!n.options.scrollRestoration({location:n.latestLocation}))return null;const a=(n.options.getScrollRestorationKey||Uf)(n.latestLocation),r=a!==Uf(n.latestLocation)?a:void 0,l={storageKey:pl,shouldScrollRestoration:!0};return r&&(l.key=r),X.jsx(aR,{children:`(${S0.toString()})(${JSON.stringify(l)})`})}const B0=K.memo(function({matchId:i}){const a=ze(),r=Te({select:M=>{const w=M.matches.find(V=>V.id===i);return On(w),{routeId:w.routeId,ssr:w.ssr,_displayPending:w._displayPending}},structuralSharing:!0}),l=a.routesById[r.routeId],f=l.options.pendingComponent??a.options.defaultPendingComponent,h=f?X.jsx(f,{}):null,d=l.options.errorComponent??a.options.defaultErrorComponent,m=l.options.onCatch??a.options.defaultOnCatch,p=l.isRoot?l.options.notFoundComponent??a.options.notFoundRoute?.options.component:l.options.notFoundComponent,g=r.ssr===!1||r.ssr==="data-only",v=(!l.isRoot||l.options.wrapInSuspense||g)&&(l.options.wrapInSuspense??f??(l.options.errorComponent?.preload||g))?K.Suspense:Hs,S=d?ph:Hs,T=p?iR:Hs,E=Te({select:M=>M.loadedAt}),_=Te({select:M=>{const w=M.matches.findIndex(V=>V.id===i);return M.matches[w-1]?.routeId}}),C=l.isRoot?l.options.shellComponent??Hs:Hs;return X.jsxs(C,{children:[X.jsx(Ol.Provider,{value:i,children:X.jsx(v,{fallback:h,children:X.jsx(S,{getResetKey:()=>E,errorComponent:d||wl,onCatch:(M,w)=>{if(Qe(M))throw M;m?.(M,w)},children:X.jsx(T,{fallback:M=>{if(!p||M.routeId&&M.routeId!==r.routeId||!M.routeId&&!l.isRoot)throw M;return K.createElement(p,M)},children:g||r._displayPending?X.jsx(wE,{fallback:h,children:X.jsx(Bg,{matchId:i})}):X.jsx(Bg,{matchId:i})})})})}),_===Le&&a.options.scrollRestoration?X.jsxs(X.Fragment,{children:[X.jsx(rR,{}),X.jsx(oR,{})]}):null]})});function rR(){const n=ze(),i=K.useRef(void 0);return X.jsx("script",{suppressHydrationWarning:!0,ref:a=>{a&&(i.current===void 0||i.current.href!==n.latestLocation.href)&&(n.emit({type:"onRendered",...Xi(n.state)}),i.current=n.latestLocation)}},n.latestLocation.state.__TSR_key)}const Bg=K.memo(function({matchId:i}){const a=ze(),{match:r,key:l,routeId:f}=Te({select:m=>{const p=m.matches.find(E=>E.id===i),g=p.routeId,S=(a.routesById[g].options.remountDeps??a.options.defaultRemountDeps)?.({routeId:g,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:S?JSON.stringify(S):void 0,routeId:g,match:{id:p.id,status:p.status,error:p.error,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),h=a.routesById[f],d=K.useMemo(()=>{const m=h.options.component??a.options.defaultComponent;return m?X.jsx(m,{},l):X.jsx(U0,{})},[l,h.options.component,a.options.defaultComponent]);if(r._displayPending)throw a.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw a.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const m=h.options.pendingMinMs??a.options.defaultPendingMinMs;if(m){const p=a.getMatch(r.id);if(p&&!p._nonReactive.minPendingPromise&&!a.isServer){const g=Qs();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw a.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return On(Qe(r.error)),V0(a,h,r.error);if(r.status==="redirected")throw On(nn(r.error)),a.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(a.isServer){const m=(h.options.errorComponent??a.options.defaultErrorComponent)||wl;return X.jsx(m,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return d}),U0=K.memo(function(){const i=ze(),a=K.useContext(Ol),r=Te({select:p=>p.matches.find(g=>g.id===a)?.routeId}),l=i.routesById[r],f=Te({select:p=>{const v=p.matches.find(S=>S.id===a);return On(v),v.globalNotFound}}),h=Te({select:p=>{const g=p.matches,v=g.findIndex(S=>S.id===a);return g[v+1]?.id}}),d=i.options.defaultPendingComponent?X.jsx(i.options.defaultPendingComponent,{}):null;if(f)return V0(i,l,void 0);if(!h)return null;const m=X.jsx(B0,{matchId:h});return r===Le?X.jsx(K.Suspense,{fallback:d,children:m}):m});function lR(){const n=ze(),a=n.routesById[Le].options.pendingComponent??n.options.defaultPendingComponent,r=a?X.jsx(a,{}):null,l=n.isServer||typeof document<"u"&&n.ssr?Hs:K.Suspense,f=X.jsxs(l,{fallback:r,children:[!n.isServer&&X.jsx(nR,{}),X.jsx(uR,{})]});return n.options.InnerWrap?X.jsx(n.options.InnerWrap,{children:f}):f}function uR(){const n=ze(),i=Te({select:l=>l.matches[0]?.id}),a=Te({select:l=>l.loadedAt}),r=i?X.jsx(B0,{matchId:i}):null;return X.jsx(Ol.Provider,{value:i,children:n.options.disableGlobalCatchBoundary?r:X.jsx(ph,{getResetKey:()=>a,errorComponent:wl,onCatch:l=>{l.message||l.toString()},children:r})})}const cR=n=>new fR(n);class fR extends xE{constructor(i){super(i)}}typeof globalThis<"u"?(globalThis.createFileRoute=pi,globalThis.createLazyFileRoute=Vg):typeof window<"u"&&(window.createFileRoute=pi,window.createLazyFileRoute=Vg);function hR({router:n,children:i,...a}){Object.keys(a).length>0&&n.update({...n.options,...a,context:{...n.options.context,...a.context}});const r=O0(),l=X.jsx(r.Provider,{value:n,children:i});return n.options.Wrap?X.jsx(n.options.Wrap,{children:l}):l}function dR({router:n,...i}){return X.jsx(hR,{router:n,...i,children:X.jsx(lR,{})})}var pf={exports:{}},$a={},yf={exports:{}},gf={};var Ug;function mR(){return Ug||(Ug=1,(function(n){function i(j,Q){var W=j.length;j.push(Q);t:for(;0<W;){var ft=W-1>>>1,yt=j[ft];if(0<l(yt,Q))j[ft]=Q,j[W]=yt,W=ft;else break t}}function a(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var Q=j[0],W=j.pop();if(W!==Q){j[0]=W;t:for(var ft=0,yt=j.length,A=yt>>>1;ft<A;){var F=2*(ft+1)-1,J=j[F],I=F+1,at=j[I];if(0>l(J,W))I<yt&&0>l(at,J)?(j[ft]=at,j[I]=W,ft=I):(j[ft]=J,j[F]=W,ft=F);else if(I<yt&&0>l(at,W))j[ft]=at,j[I]=W,ft=I;else break t}}return Q}function l(j,Q){var W=j.sortIndex-Q.sortIndex;return W!==0?W:j.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var h=Date,d=h.now();n.unstable_now=function(){return h.now()-d}}var m=[],p=[],g=1,v=null,S=3,T=!1,E=!1,_=!1,C=!1,M=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function P(j){for(var Q=a(p);Q!==null;){if(Q.callback===null)r(p);else if(Q.startTime<=j)r(p),Q.sortIndex=Q.expirationTime,i(m,Q);else break;Q=a(p)}}function k(j){if(_=!1,P(j),!E)if(a(m)!==null)E=!0,U||(U=!0,Tt());else{var Q=a(p);Q!==null&&zt(k,Q.startTime-j)}}var U=!1,G=-1,H=5,Z=-1;function nt(){return C?!0:!(n.unstable_now()-Z<H)}function st(){if(C=!1,U){var j=n.unstable_now();Z=j;var Q=!0;try{t:{E=!1,_&&(_=!1,w(G),G=-1),T=!0;var W=S;try{e:{for(P(j),v=a(m);v!==null&&!(v.expirationTime>j&&nt());){var ft=v.callback;if(typeof ft=="function"){v.callback=null,S=v.priorityLevel;var yt=ft(v.expirationTime<=j);if(j=n.unstable_now(),typeof yt=="function"){v.callback=yt,P(j),Q=!0;break e}v===a(m)&&r(m),P(j)}else r(m);v=a(m)}if(v!==null)Q=!0;else{var A=a(p);A!==null&&zt(k,A.startTime-j),Q=!1}}break t}finally{v=null,S=W,T=!1}Q=void 0}}finally{Q?Tt():U=!1}}}var Tt;if(typeof V=="function")Tt=function(){V(st)};else if(typeof MessageChannel<"u"){var Pt=new MessageChannel,Ut=Pt.port2;Pt.port1.onmessage=st,Tt=function(){Ut.postMessage(null)}}else Tt=function(){M(st,0)};function zt(j,Q){G=M(function(){j(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(j){switch(S){case 1:case 2:case 3:var Q=3;break;default:Q=S}var W=S;S=Q;try{return j()}finally{S=W}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(j,Q){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var W=S;S=j;try{return Q()}finally{S=W}},n.unstable_scheduleCallback=function(j,Q,W){var ft=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ft+W:ft):W=ft,j){case 1:var yt=-1;break;case 2:yt=250;break;case 5:yt=1073741823;break;case 4:yt=1e4;break;default:yt=5e3}return yt=W+yt,j={id:g++,callback:Q,priorityLevel:j,startTime:W,expirationTime:yt,sortIndex:-1},W>ft?(j.sortIndex=W,i(p,j),a(m)===null&&j===a(p)&&(_?(w(G),G=-1):_=!0,zt(k,W-ft))):(j.sortIndex=yt,i(m,j),E||T||(E=!0,U||(U=!0,Tt()))),j},n.unstable_shouldYield=nt,n.unstable_wrapCallback=function(j){var Q=S;return function(){var W=S;S=Q;try{return j.apply(this,arguments)}finally{S=W}}}})(gf)),gf}var jg;function pR(){return jg||(jg=1,yf.exports=mR()),yf.exports}var Ng;function yR(){if(Ng)return $a;Ng=1;var n=pR(),i=So(),a=L0();function r(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)e+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,s=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(s=e.return),t=e.return;while(t)}return e.tag===3?s:null}function h(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function d(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function m(t){if(f(t)!==t)throw Error(r(188))}function p(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(r(188));return e!==t?null:t}for(var s=t,o=e;;){var u=s.return;if(u===null)break;var c=u.alternate;if(c===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===c.child){for(c=u.child;c;){if(c===s)return m(u),t;if(c===o)return m(u),e;c=c.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=c;else{for(var y=!1,b=u.child;b;){if(b===s){y=!0,s=u,o=c;break}if(b===o){y=!0,o=u,s=c;break}b=b.sibling}if(!y){for(b=c.child;b;){if(b===s){y=!0,s=c,o=u;break}if(b===o){y=!0,o=c,s=u;break}b=b.sibling}if(!y)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:e}function g(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=g(t),e!==null)return e;t=t.sibling}return null}var v=Object.assign,S=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),V=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),nt=Symbol.for("react.memo_cache_sentinel"),st=Symbol.iterator;function Tt(t){return t===null||typeof t!="object"?null:(t=st&&t[st]||t["@@iterator"],typeof t=="function"?t:null)}var Pt=Symbol.for("react.client.reference");function Ut(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Pt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _:return"Fragment";case M:return"Profiler";case C:return"StrictMode";case k:return"Suspense";case U:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case V:return t.displayName||"Context";case w:return(t._context.displayName||"Context")+".Consumer";case P:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case G:return e=t.displayName||null,e!==null?e:Ut(t.type)||"Memo";case H:e=t._payload,t=t._init;try{return Ut(t(e))}catch{}}return null}var zt=Array.isArray,j=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},ft=[],yt=-1;function A(t){return{current:t}}function F(t){0>yt||(t.current=ft[yt],ft[yt]=null,yt--)}function J(t,e){yt++,ft[yt]=t.current,t.current=e}var I=A(null),at=A(null),rt=A(null),gt=A(null);function kt(t,e){switch(J(rt,e),J(at,t),J(I,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Dy(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Dy(e),t=wy(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(I),J(I,t)}function Mt(){F(I),F(at),F(rt)}function fn(t){t.memoizedState!==null&&J(gt,t);var e=I.current,s=wy(e,t.type);e!==s&&(J(at,t),J(I,s))}function Bn(t){at.current===t&&(F(I),F(at)),gt.current===t&&(F(gt),Fa._currentValue=W)}var Ze,_o;function hn(t){if(Ze===void 0)try{throw Error()}catch(s){var e=s.stack.trim().match(/\n( *(at )?)/);Ze=e&&e[1]||"",_o=-1<s.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Ze+t+_o}var ts=!1;function ta(t,e){if(!t||ts)return"";ts=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(e){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(B){var z=B}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(B){z=B}t.call(Y.prototype)}}else{try{throw Error()}catch(B){z=B}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(B){if(B&&z&&typeof B.stack=="string")return[B.stack,z.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=o.DetermineComponentFrameRoot(),y=c[0],b=c[1];if(y&&b){var x=y.split(`
@@ -15,7 +15,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
15
15
  ICU features such as interpolation and plurals will not work properly for that message.
16
16
 
17
17
  Please compile your catalog first.
18
- `)),hi(m)&&N0.test(m)?P0(m):hi(m)?m:ER(m,this._locale,this._locales)(a,r?.formats)}date(i,a){return xh(this._locales||this._locale,i,a)}number(i,a){return Nf(this._locales||this._locale,i,a)}}function OR(n={}){return new wR(n)}const Ll=OR(),LR=JSON.parse('{"/vVlbJ":[["0"]," steps"],"57upzv":["Scenario List"],"6exX+8":["Regenerate"],"7BGeH2":["Failed to generate preview"],"8faOjQ":["Create New"],"9PuK3/":["Switch to preview mode"],"FQs7H0":["Back to Scenario List"],"FxVG/l":["Copied to clipboard"],"G3Kixs":[["0"]," documents available"],"GSr0rF":["Open menu"],"NOdFZR":["Generating..."],"NpRmdU":["Create New Document"],"OW40Ve":["Document has been updated"],"QFXSrR":["Edit Existing"],"T6PvRl":["Required fields are not filled"],"TC9TYf":["Press the button to generate a Design Doc preview"],"Vw8l6h":["An error occurred"],"W/yZH3":["No items. Please add items using the \\"Add\\" button."],"W9q5nG":["Generate preview"],"XvjC4F":["Saving..."],"Z8lGw6":["Share"],"ZGnMhT":["No documents found"],"afF891":["Please generate a preview"],"d61rJy":["Design Doc has been created"],"fQ4jUh":["Create a new document from scratch"],"fsyAH8":["Show preview"],"hUe0iX":["Step navigation"],"hXzOVo":["Next"],"hYgDIe":["Create"],"he3ygx":["Copy"],"iH8pgl":["Back"],"lbNn+H":["No content to save"],"m16xKo":["Add"],"mkMLq4":["Collapse sidebar"],"rdUucN":["Preview"],"tfDRzk":["Save"],"tugdy6":["Expand sidebar"],"vcpc5o":["Close menu"],"wR3B2j":["Switch to edit mode"],"yFRvSy":["Select Document to Edit"],"yz7wBu":["Close"]}'),zR=JSON.parse('{"/vVlbJ":[["0"],"ステップ"],"57upzv":["シナリオ一覧"],"6exX+8":["再生成"],"7BGeH2":["プレビューの生成に失敗しました"],"8faOjQ":["新規作成"],"9PuK3/":["プレビューモードに切り替え"],"FQs7H0":["シナリオ一覧に戻る"],"FxVG/l":["クリップボードにコピーしました"],"G3Kixs":[["0"],"件のドキュメント"],"GSr0rF":["メニューを開く"],"NOdFZR":["生成中..."],"NpRmdU":["新しいドキュメントを作成"],"OW40Ve":["ドキュメントを更新しました"],"QFXSrR":["既存を編集"],"T6PvRl":["必須項目が入力されていません"],"TC9TYf":["ボタンを押すとDesign Docのプレビューが生成されます"],"Vw8l6h":["エラーが発生しました"],"W/yZH3":["項目がありません。「追加」ボタンから追加してください。"],"W9q5nG":["プレビューを生成"],"XvjC4F":["保存中..."],"Z8lGw6":["シェア"],"ZGnMhT":["ドキュメントがありません"],"afF891":["プレビューを生成してください"],"d61rJy":["Design Docを生成しました"],"fQ4jUh":["新しいドキュメントを作成します"],"fsyAH8":["プレビューを表示"],"hUe0iX":["ステップナビゲーション"],"hXzOVo":["次へ"],"hYgDIe":["作成"],"he3ygx":["コピー"],"iH8pgl":["戻る"],"lbNn+H":["保存するコンテンツがありません"],"m16xKo":["追加"],"mkMLq4":["サイドバーを折りたたむ"],"rdUucN":["プレビュー"],"tfDRzk":["保存"],"tugdy6":["サイドバーを展開"],"vcpc5o":["メニューを閉じる"],"wR3B2j":["編集モードに切り替え"],"yFRvSy":["編集するドキュメントを選択"],"yz7wBu":["閉じる"]}'),q0="design-docs-gen-locale",wD={ja:"日本語",en:"English"};Ll.load({ja:zR,en:LR});const VR=()=>{if(typeof localStorage<"u"){const n=localStorage.getItem(q0);if(n==="ja"||n==="en")return n}return null},BR=()=>typeof navigator<"u"&&navigator.language.split("-")[0]==="en"?"en":"ja",UR=()=>VR()??BR(),OD=()=>Ll.locale??"ja",jR=n=>{typeof localStorage<"u"&&localStorage.setItem(q0,n),typeof document<"u"&&(document.documentElement.lang=n),Ll.activate(n)};jR(UR());const Wi=eR({component:U0}),NR=pi("/")({beforeLoad:()=>{throw b0({to:"/scenarios"})}}),PR="modulepreload",HR=function(n){return"/"+n},Gg={},To=function(i,a,r){let l=Promise.resolve();if(a&&a.length>0){let m=function(p){return Promise.all(p.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),d=h?.nonce||h?.getAttribute("nonce");l=m(a.map(p=>{if(p=HR(p),p in Gg)return;Gg[p]=!0;const g=p.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":PR,g||(S.as="script"),S.crossOrigin="",S.href=p,d&&S.setAttribute("nonce",d),document.head.appendChild(S),g)return new Promise((T,E)=>{S.addEventListener("load",T),S.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function f(h){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=h,window.dispatchEvent(d),!d.defaultPrevented)throw h}return l.then(h=>{for(const d of h||[])d.status==="rejected"&&f(d.reason);return i().catch(f)})},qR=async()=>{const n=await fetch("/api/scenarios");if(!n.ok)throw new Error("Failed to fetch scenarios");return(await n.json()).scenarios},GR=()=>({queryKey:["scenarios"],queryFn:qR}),Ln=new Cx({defaultOptions:{queries:{staleTime:1e3*60*5,retry:1}}}),YR=()=>To(()=>import("./index-Q_AobJB0.js"),__vite__mapDeps([0,1,2])),FR=pi("/scenarios/")({loader:async()=>{await Ln.prefetchQuery(GR())},component:bo(YR,"component")}),KR=async n=>{const i=await fetch(`/api/scenarios/${n}/docs`);if(!i.ok)throw new Error(`Failed to fetch docs for scenario ${n}`);return(await i.json()).docs},G0=n=>({queryKey:["scenarios",n,"docs"],queryFn:()=>KR(n)}),kR=async n=>{const i=await fetch(`/api/scenarios/${encodeURIComponent(n)}`);if(!i.ok)throw new Error("Failed to fetch scenario");return await i.json()},zl=n=>({queryKey:["scenarios",n],queryFn:()=>kR(n)}),QR=()=>To(()=>import("./index-pyqED_5G.js"),__vite__mapDeps([3,1,4,5,2])),XR=pi("/scenarios/$scenarioId/")({loader:async({params:n})=>{try{await Promise.all([Ln.fetchQuery(zl(n.scenarioId)),Ln.prefetchQuery(G0(n.scenarioId))])}catch{throw Qi()}},component:bo(QR,"component")}),ZR=()=>To(()=>import("./index-DQxQHK-0.js"),__vite__mapDeps([6,1,4,5,2])),JR=pi("/scenarios/$scenarioId/docs/")({loader:async({params:n})=>{try{await Promise.all([Ln.fetchQuery(zl(n.scenarioId)),Ln.prefetchQuery(G0(n.scenarioId))])}catch{throw Qi()}},component:bo(ZR,"component")});let vf;function IR(n){return{lang:n?.lang??vf?.lang,message:n?.message,abortEarly:n?.abortEarly??vf?.abortEarly,abortPipeEarly:n?.abortPipeEarly??vf?.abortPipeEarly}}let $R;function WR(n){return $R?.get(n)}let tA;function eA(n){return tA?.get(n)}let nA;function iA(n,i){return nA?.get(n)?.get(i)}function Eh(n){const i=typeof n;return i==="string"?`"${n}"`:i==="number"||i==="bigint"||i==="boolean"?`${n}`:i==="object"||i==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":i}function yi(n,i,a,r,l){const f=l&&"input"in l?l.input:a.value,h=l?.expected??n.expects??null,d=l?.received??Eh(f),m={kind:n.kind,type:n.type,input:f,expected:h,received:d,message:`Invalid ${i}: ${h?`Expected ${h} but r`:"R"}eceived ${d}`,requirement:n.requirement,path:l?.path,issues:l?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},p=n.kind==="schema",g=l?.message??n.message??iA(n.reference,m.lang)??(p?eA(m.lang):null)??r.message??WR(m.lang);g!==void 0&&(m.message=typeof g=="function"?g(m):g),p&&(a.typed=!1),a.issues?a.issues.push(m):a.issues=[m]}function Si(n){return{version:1,vendor:"valibot",validate(i){return n["~run"]({value:i},IR())}}}function sA(n,i){const a=[...new Set(n)];return a.length>1?`(${a.join(` ${i} `)})`:a[0]??"never"}function aA(n,i,a){return typeof n.fallback=="function"?n.fallback(i,a):n.fallback}function Y0(n,i,a){return typeof n.default=="function"?n.default(i,a):n.default}function oA(n,i){return{kind:"schema",type:"array",reference:oA,expects:"Array",async:!1,item:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){const l=a.value;if(Array.isArray(l)){a.typed=!0,a.value=[];for(let f=0;f<l.length;f++){const h=l[f],d=this.item["~run"]({value:h},r);if(d.issues){const m={type:"array",origin:"value",input:l,key:f,value:h};for(const p of d.issues)p.path?p.path.unshift(m):p.path=[m],a.issues?.push(p);if(a.issues||(a.issues=d.issues),r.abortEarly){a.typed=!1;break}}d.typed||(a.typed=!1),a.value.push(d.value)}}else yi(this,"type",a,r);return a}}}function rA(n){return{kind:"schema",type:"boolean",reference:rA,expects:"boolean",async:!1,message:n,get"~standard"(){return Si(this)},"~run"(i,a){return typeof i.value=="boolean"?i.typed=!0:yi(this,"type",i,a),i}}}function lA(n,i){return{kind:"schema",type:"literal",reference:lA,expects:Eh(n),async:!1,literal:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){return a.value===this.literal?a.typed=!0:yi(this,"type",a,r),a}}}function uA(n){return{kind:"schema",type:"number",reference:uA,expects:"number",async:!1,message:n,get"~standard"(){return Si(this)},"~run"(i,a){return typeof i.value=="number"&&!isNaN(i.value)?i.typed=!0:yi(this,"type",i,a),i}}}function Rh(n,i){return{kind:"schema",type:"object",reference:Rh,expects:"Object",async:!1,entries:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){const l=a.value;if(l&&typeof l=="object"){a.typed=!0,a.value={};for(const f in this.entries){const h=this.entries[f];if(f in l||(h.type==="exact_optional"||h.type==="optional"||h.type==="nullish")&&h.default!==void 0){const d=f in l?l[f]:Y0(h),m=h["~run"]({value:d},r);if(m.issues){const p={type:"object",origin:"value",input:l,key:f,value:d};for(const g of m.issues)g.path?g.path.unshift(p):g.path=[p],a.issues?.push(g);if(a.issues||(a.issues=m.issues),r.abortEarly){a.typed=!1;break}}m.typed||(a.typed=!1),a.value[f]=m.value}else if(h.fallback!==void 0)a.value[f]=aA(h);else if(h.type!=="exact_optional"&&h.type!=="optional"&&h.type!=="nullish"&&(yi(this,"key",a,r,{input:void 0,expected:`"${f}"`,path:[{type:"object",origin:"key",input:l,key:f,value:l[f]}]}),r.abortEarly))break}}else yi(this,"type",a,r);return a}}}function Ah(n,i){return{kind:"schema",type:"optional",reference:Ah,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,default:i,get"~standard"(){return Si(this)},"~run"(a,r){return a.value===void 0&&(this.default!==void 0&&(a.value=Y0(this,a,r)),a.value===void 0)?(a.typed=!0,a):this.wrapped["~run"](a,r)}}}function cA(n,i){return{kind:"schema",type:"picklist",reference:cA,expects:sA(n.map(Eh),"|"),async:!1,options:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){return this.options.includes(a.value)?a.typed=!0:yi(this,"type",a,r),a}}}function _h(n){return{kind:"schema",type:"string",reference:_h,expects:"string",async:!1,message:n,get"~standard"(){return Si(this)},"~run"(i,a){return typeof i.value=="string"?i.typed=!0:yi(this,"type",i,a),i}}}const Yg=n=>{let i;const a=new Set,r=(p,g)=>{const v=typeof p=="function"?p(i):p;if(!Object.is(v,i)){const S=i;i=g??(typeof v!="object"||v===null)?v:Object.assign({},i,v),a.forEach(T=>T(i,S))}},l=()=>i,d={setState:r,getState:l,getInitialState:()=>m,subscribe:p=>(a.add(p),()=>a.delete(p))},m=i=n(r,l,d);return d},fA=(n=>n?Yg(n):Yg),hA=n=>n;function dA(n,i=hA){const a=_t.useSyncExternalStore(n.subscribe,_t.useCallback(()=>i(n.getState()),[n,i]),_t.useCallback(()=>i(n.getInitialState()),[n,i]));return _t.useDebugValue(a),a}const mA=n=>{const i=fA(n),a=r=>dA(i,r);return Object.assign(a,i),a},Mh=(n=>mA);function Ch(n,i){let a;try{a=n()}catch{return}return{getItem:l=>{var f;const h=m=>m===null?null:JSON.parse(m,void 0),d=(f=a.getItem(l))!=null?f:null;return d instanceof Promise?d.then(h):h(d)},setItem:(l,f)=>a.setItem(l,JSON.stringify(f,void 0)),removeItem:l=>a.removeItem(l)}}const Pf=n=>i=>{try{const a=n(i);return a instanceof Promise?a:{then(r){return Pf(r)(a)},catch(r){return this}}}catch(a){return{then(r){return this},catch(r){return Pf(r)(a)}}}},pA=(n,i)=>(a,r,l)=>{let f={storage:Ch(()=>localStorage),partialize:_=>_,version:0,merge:(_,C)=>({...C,..._}),...i},h=!1;const d=new Set,m=new Set;let p=f.storage;if(!p)return n((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${f.name}', the given storage is currently unavailable.`),a(..._)},r,l);const g=()=>{const _=f.partialize({...r()});return p.setItem(f.name,{state:_,version:f.version})},v=l.setState;l.setState=(_,C)=>(v(_,C),g());const S=n((..._)=>(a(..._),g()),r,l);l.getInitialState=()=>S;let T;const E=()=>{var _,C;if(!p)return;h=!1,d.forEach(w=>{var V;return w((V=r())!=null?V:S)});const M=((C=f.onRehydrateStorage)==null?void 0:C.call(f,(_=r())!=null?_:S))||void 0;return Pf(p.getItem.bind(p))(f.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==f.version){if(f.migrate){const V=f.migrate(w.state,w.version);return V instanceof Promise?V.then(P=>[!0,P]):[!0,V]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var V;const[P,k]=w;if(T=f.merge(k,(V=r())!=null?V:S),a(T,!0),P)return g()}).then(()=>{M?.(T,void 0),T=r(),h=!0,m.forEach(w=>w(T))}).catch(w=>{M?.(void 0,w)})};return l.persist={setOptions:_=>{f={...f,..._},_.storage&&(p=_.storage)},clearStorage:()=>{p?.removeItem(f.name)},getOptions:()=>f,rehydrate:()=>E(),hasHydrated:()=>h,onHydrate:_=>(d.add(_),()=>{d.delete(_)}),onFinishHydration:_=>(m.add(_),()=>{m.delete(_)})},f.skipHydration||E(),T||S},F0=pA,yA="__new__",K0=n=>n??yA,k0=()=>({values:{},errors:{}}),Fg=(n,i)=>n[i]??k0(),Q0=Mh()(F0(n=>({forms:{},setSectionValue:(i,a,r)=>n(l=>{const f=Fg(l.forms,i);return{forms:{...l.forms,[i]:{...f,values:{...f.values,[a]:r}}}}}),setError:(i,a,r)=>n(l=>{const f=Fg(l.forms,i);return{forms:{...l.forms,[i]:{...f,errors:{...f.errors,[a]:r}}}}}),initializeForm:(i,a)=>n(r=>({forms:{...r.forms,[i]:{values:a,errors:{}}}})),resetForm:i=>n(a=>({forms:{...a.forms,[i]:k0()}}))}),{name:"design-docs-step-form",storage:Ch(()=>sessionStorage),partialize:n=>({forms:n.forms})})),gA=n=>{const i=Q0.getState().forms[n];return i==null||Object.keys(i.values).length===0},X0=({initialValues:n,formKey:i})=>{const a=K0(i);gA(a)&&Q0.getState().initializeForm(a,n)},vA=()=>To(()=>import("./index-CT_VQ59w.js"),__vite__mapDeps([7,1,8,5])),SA=Rh({step:Ah(_h())}),bA=pi("/scenarios/$scenarioId/docs/new/")({validateSearch:SA,loaderDeps:({search:n})=>({step:n.step}),loader:async({params:n,deps:i})=>{const a=await Ln.fetchQuery(zl(n.scenarioId)).catch(()=>{throw Qi()}),{steps:r}=a.scenario,l=i.step!=null?r.findIndex(d=>d.slug===i.step):-1,f=l!==-1?l:0,h=r[f];if(h==null)throw Qi();return X0({initialValues:a.formDefaultValues}),{stepIndex:f,prevStep:r[f-1],step:h,nextStep:r[f+1]}},component:bo(vA,"component")}),TA=async(n,i)=>{const a=await fetch(`/api/scenarios/${encodeURIComponent(n)}/docs/${encodeURIComponent(i)}`);if(!a.ok)throw new Error("Failed to fetch doc");return(await a.json()).doc},xA=(n,i)=>({queryKey:["scenarios",n,"docs",i],queryFn:()=>TA(n,i)}),Z0=Mh()(F0(n=>({previews:{},setPreviewContent:(i,a)=>n(r=>({previews:{...r.previews,[i]:a}})),initializePreview:(i,a)=>n(r=>({previews:{...r.previews,[i]:a}})),resetPreview:i=>n(a=>({previews:{...a.previews,[i]:null}}))}),{name:"design-docs-preview",storage:Ch(()=>sessionStorage),partialize:n=>({previews:n.previews})})),EA=n=>{const i=Z0.getState().previews;return!(n in i)},RA=({content:n,formKey:i})=>{const a=K0(i);EA(a)&&Z0.getState().initializePreview(a,n)},AA=()=>To(()=>import("./index-DYnzYTb1.js"),__vite__mapDeps([9,1,8,5])),_A=Rh({step:Ah(_h())}),MA=pi("/scenarios/$scenarioId/docs/$filename/")({validateSearch:_A,loaderDeps:({search:n})=>({step:n.step}),loader:async({params:n,deps:i})=>{const[a,r]=await Promise.all([Ln.fetchQuery(zl(n.scenarioId)),Ln.fetchQuery(xA(n.scenarioId,n.filename))]).catch(()=>{throw Qi()});if(r.metadata==null)throw Qi();const{steps:l}=a.scenario,f=i.step!=null?l.findIndex(p=>p.slug===i.step):-1,h=f!==-1?f:0,d=l[h];if(d==null)throw Qi();const m=n.filename;return X0({initialValues:r.metadata.formData,formKey:m}),RA({content:r.content,formKey:m}),{stepIndex:h,prevStep:l[h-1],step:d,nextStep:l[h+1]}},component:bo(AA,"component")}),CA=NR.update({id:"/",path:"/",getParentRoute:()=>Wi}),DA=FR.update({id:"/scenarios/",path:"/scenarios/",getParentRoute:()=>Wi}),wA=XR.update({id:"/scenarios/$scenarioId/",path:"/scenarios/$scenarioId/",getParentRoute:()=>Wi}),OA=JR.update({id:"/scenarios/$scenarioId/docs/",path:"/scenarios/$scenarioId/docs/",getParentRoute:()=>Wi}),LA=bA.update({id:"/scenarios/$scenarioId/docs/new/",path:"/scenarios/$scenarioId/docs/new/",getParentRoute:()=>Wi}),zA=MA.update({id:"/scenarios/$scenarioId/docs/$filename/",path:"/scenarios/$scenarioId/docs/$filename/",getParentRoute:()=>Wi}),VA={IndexRoute:CA,ScenariosIndexRoute:DA,ScenariosScenarioIdIndexRoute:wA,ScenariosScenarioIdDocsIndexRoute:OA,ScenariosScenarioIdDocsFilenameIndexRoute:zA,ScenariosScenarioIdDocsNewIndexRoute:LA},BA=Wi._addFileChildren(VA)._addFileTypes(),UA=Mh()(n=>({open:!1,message:"",variant:"info",showSnackbar:(i,a="info")=>n({open:!0,message:i,variant:a}),hideSnackbar:()=>n({open:!1})})),Dh=K.createContext({});function wh(n){const i=K.useRef(null);return i.current===null&&(i.current=n()),i.current}const Oh=typeof window<"u",J0=Oh?K.useLayoutEffect:K.useEffect,Vl=K.createContext(null);function Lh(n,i){n.indexOf(i)===-1&&n.push(i)}function zh(n,i){const a=n.indexOf(i);a>-1&&n.splice(a,1)}const zn=(n,i,a)=>a>i?i:a<n?n:a;let Vh=()=>{};const Vn={},I0=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function $0(n){return typeof n=="object"&&n!==null}const W0=n=>/^0[^.\s]+$/u.test(n);function Bh(n){let i;return()=>(i===void 0&&(i=n()),i)}const Xe=n=>n,jA=(n,i)=>a=>i(n(a)),xo=(...n)=>n.reduce(jA),mo=(n,i,a)=>{const r=i-n;return r===0?1:(a-n)/r};class Uh{constructor(){this.subscriptions=[]}add(i){return Lh(this.subscriptions,i),()=>zh(this.subscriptions,i)}notify(i,a,r){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](i,a,r);else for(let f=0;f<l;f++){const h=this.subscriptions[f];h&&h(i,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ln=n=>n*1e3,ke=n=>n/1e3;function tS(n,i){return i?n*(1e3/i):0}const eS=(n,i,a)=>(((1-3*a+3*i)*n+(3*a-6*i))*n+3*i)*n,NA=1e-7,PA=12;function HA(n,i,a,r,l){let f,h,d=0;do h=i+(a-i)/2,f=eS(h,r,l)-n,f>0?a=h:i=h;while(Math.abs(f)>NA&&++d<PA);return h}function Eo(n,i,a,r){if(n===i&&a===r)return Xe;const l=f=>HA(f,0,1,n,a);return f=>f===0||f===1?f:eS(l(f),i,r)}const nS=n=>i=>i<=.5?n(2*i)/2:(2-n(2*(1-i)))/2,iS=n=>i=>1-n(1-i),sS=Eo(.33,1.53,.69,.99),jh=iS(sS),aS=nS(jh),oS=n=>(n*=2)<1?.5*jh(n):.5*(2-Math.pow(2,-10*(n-1))),Nh=n=>1-Math.sin(Math.acos(n)),rS=iS(Nh),lS=nS(Nh),qA=Eo(.42,0,1,1),GA=Eo(0,0,.58,1),uS=Eo(.42,0,.58,1),YA=n=>Array.isArray(n)&&typeof n[0]!="number",cS=n=>Array.isArray(n)&&typeof n[0]=="number",FA={linear:Xe,easeIn:qA,easeInOut:uS,easeOut:GA,circIn:Nh,circInOut:lS,circOut:rS,backIn:jh,backInOut:aS,backOut:sS,anticipate:oS},KA=n=>typeof n=="string",Kg=n=>{if(cS(n)){Vh(n.length===4);const[i,a,r,l]=n;return Eo(i,a,r,l)}else if(KA(n))return FA[n];return n},$r=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function kA(n,i){let a=new Set,r=new Set,l=!1,f=!1;const h=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function m(g){h.has(g)&&(p.schedule(g),n()),g(d)}const p={schedule:(g,v=!1,S=!1)=>{const E=S&&l?a:r;return v&&h.add(g),E.has(g)||E.add(g),g},cancel:g=>{r.delete(g),h.delete(g)},process:g=>{if(d=g,l){f=!0;return}l=!0,[a,r]=[r,a],a.forEach(m),a.clear(),l=!1,f&&(f=!1,p.process(g))}};return p}const QA=40;function fS(n,i){let a=!1,r=!0;const l={delta:0,timestamp:0,isProcessing:!1},f=()=>a=!0,h=$r.reduce((V,P)=>(V[P]=kA(f),V),{}),{setup:d,read:m,resolveKeyframes:p,preUpdate:g,update:v,preRender:S,render:T,postRender:E}=h,_=()=>{const V=Vn.useManualTiming?l.timestamp:performance.now();a=!1,Vn.useManualTiming||(l.delta=r?1e3/60:Math.max(Math.min(V-l.timestamp,QA),1)),l.timestamp=V,l.isProcessing=!0,d.process(l),m.process(l),p.process(l),g.process(l),v.process(l),S.process(l),T.process(l),E.process(l),l.isProcessing=!1,a&&i&&(r=!1,n(_))},C=()=>{a=!0,r=!0,l.isProcessing||n(_)};return{schedule:$r.reduce((V,P)=>{const k=h[P];return V[P]=(U,G=!1,H=!1)=>(a||C(),k.schedule(U,G,H)),V},{}),cancel:V=>{for(let P=0;P<$r.length;P++)h[$r[P]].cancel(V)},state:l,steps:h}}const{schedule:Nt,cancel:gi,state:re,steps:Sf}=fS(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0);let sl;function XA(){sl=void 0}const be={now:()=>(sl===void 0&&be.set(re.isProcessing||Vn.useManualTiming?re.timestamp:performance.now()),sl),set:n=>{sl=n,queueMicrotask(XA)}},hS=n=>i=>typeof i=="string"&&i.startsWith(n),dS=hS("--"),ZA=hS("var(--"),Ph=n=>ZA(n)?JA.test(n.split("/*")[0].trim()):!1,JA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Is={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},po={...Is,transform:n=>zn(0,1,n)},Wr={...Is,default:1},ao=n=>Math.round(n*1e5)/1e5,Hh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function IA(n){return n==null}const $A=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qh=(n,i)=>a=>!!(typeof a=="string"&&$A.test(a)&&a.startsWith(n)||i&&!IA(a)&&Object.prototype.hasOwnProperty.call(a,i)),mS=(n,i,a)=>r=>{if(typeof r!="string")return r;const[l,f,h,d]=r.match(Hh);return{[n]:parseFloat(l),[i]:parseFloat(f),[a]:parseFloat(h),alpha:d!==void 0?parseFloat(d):1}},WA=n=>zn(0,255,n),bf={...Is,transform:n=>Math.round(WA(n))},Yi={test:qh("rgb","red"),parse:mS("red","green","blue"),transform:({red:n,green:i,blue:a,alpha:r=1})=>"rgba("+bf.transform(n)+", "+bf.transform(i)+", "+bf.transform(a)+", "+ao(po.transform(r))+")"};function t_(n){let i="",a="",r="",l="";return n.length>5?(i=n.substring(1,3),a=n.substring(3,5),r=n.substring(5,7),l=n.substring(7,9)):(i=n.substring(1,2),a=n.substring(2,3),r=n.substring(3,4),l=n.substring(4,5),i+=i,a+=a,r+=r,l+=l),{red:parseInt(i,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:l?parseInt(l,16)/255:1}}const Hf={test:qh("#"),parse:t_,transform:Yi.transform},Ro=n=>({test:i=>typeof i=="string"&&i.endsWith(n)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${n}`}),ui=Ro("deg"),un=Ro("%"),ot=Ro("px"),e_=Ro("vh"),n_=Ro("vw"),kg={...un,parse:n=>un.parse(n)/100,transform:n=>un.transform(n*100)},qs={test:qh("hsl","hue"),parse:mS("hue","saturation","lightness"),transform:({hue:n,saturation:i,lightness:a,alpha:r=1})=>"hsla("+Math.round(n)+", "+un.transform(ao(i))+", "+un.transform(ao(a))+", "+ao(po.transform(r))+")"},It={test:n=>Yi.test(n)||Hf.test(n)||qs.test(n),parse:n=>Yi.test(n)?Yi.parse(n):qs.test(n)?qs.parse(n):Hf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Yi.transform(n):qs.transform(n),getAnimatableNone:n=>{const i=It.parse(n);return i.alpha=0,It.transform(i)}},i_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function s_(n){return isNaN(n)&&typeof n=="string"&&(n.match(Hh)?.length||0)+(n.match(i_)?.length||0)>0}const pS="number",yS="color",a_="var",o_="var(",Qg="${}",r_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function yo(n){const i=n.toString(),a=[],r={color:[],number:[],var:[]},l=[];let f=0;const d=i.replace(r_,m=>(It.test(m)?(r.color.push(f),l.push(yS),a.push(It.parse(m))):m.startsWith(o_)?(r.var.push(f),l.push(a_),a.push(m)):(r.number.push(f),l.push(pS),a.push(parseFloat(m))),++f,Qg)).split(Qg);return{values:a,split:d,indexes:r,types:l}}function gS(n){return yo(n).values}function vS(n){const{split:i,types:a}=yo(n),r=i.length;return l=>{let f="";for(let h=0;h<r;h++)if(f+=i[h],l[h]!==void 0){const d=a[h];d===pS?f+=ao(l[h]):d===yS?f+=It.transform(l[h]):f+=l[h]}return f}}const l_=n=>typeof n=="number"?0:It.test(n)?It.getAnimatableNone(n):n;function u_(n){const i=gS(n);return vS(n)(i.map(l_))}const vi={test:s_,parse:gS,createTransformer:vS,getAnimatableNone:u_};function Tf(n,i,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?n+(i-n)*6*a:a<1/2?i:a<2/3?n+(i-n)*(2/3-a)*6:n}function c_({hue:n,saturation:i,lightness:a,alpha:r}){n/=360,i/=100,a/=100;let l=0,f=0,h=0;if(!i)l=f=h=a;else{const d=a<.5?a*(1+i):a+i-a*i,m=2*a-d;l=Tf(m,d,n+1/3),f=Tf(m,d,n),h=Tf(m,d,n-1/3)}return{red:Math.round(l*255),green:Math.round(f*255),blue:Math.round(h*255),alpha:r}}function bl(n,i){return a=>a>0?i:n}const Ht=(n,i,a)=>n+(i-n)*a,xf=(n,i,a)=>{const r=n*n,l=a*(i*i-r)+r;return l<0?0:Math.sqrt(l)},f_=[Hf,Yi,qs],h_=n=>f_.find(i=>i.test(n));function Xg(n){const i=h_(n);if(!i)return!1;let a=i.parse(n);return i===qs&&(a=c_(a)),a}const Zg=(n,i)=>{const a=Xg(n),r=Xg(i);if(!a||!r)return bl(n,i);const l={...a};return f=>(l.red=xf(a.red,r.red,f),l.green=xf(a.green,r.green,f),l.blue=xf(a.blue,r.blue,f),l.alpha=Ht(a.alpha,r.alpha,f),Yi.transform(l))},qf=new Set(["none","hidden"]);function d_(n,i){return qf.has(n)?a=>a<=0?n:i:a=>a>=1?i:n}function m_(n,i){return a=>Ht(n,i,a)}function Gh(n){return typeof n=="number"?m_:typeof n=="string"?Ph(n)?bl:It.test(n)?Zg:g_:Array.isArray(n)?SS:typeof n=="object"?It.test(n)?Zg:p_:bl}function SS(n,i){const a=[...n],r=a.length,l=n.map((f,h)=>Gh(f)(f,i[h]));return f=>{for(let h=0;h<r;h++)a[h]=l[h](f);return a}}function p_(n,i){const a={...n,...i},r={};for(const l in a)n[l]!==void 0&&i[l]!==void 0&&(r[l]=Gh(n[l])(n[l],i[l]));return l=>{for(const f in r)a[f]=r[f](l);return a}}function y_(n,i){const a=[],r={color:0,var:0,number:0};for(let l=0;l<i.values.length;l++){const f=i.types[l],h=n.indexes[f][r[f]],d=n.values[h]??0;a[l]=d,r[f]++}return a}const g_=(n,i)=>{const a=vi.createTransformer(i),r=yo(n),l=yo(i);return r.indexes.var.length===l.indexes.var.length&&r.indexes.color.length===l.indexes.color.length&&r.indexes.number.length>=l.indexes.number.length?qf.has(n)&&!l.values.length||qf.has(i)&&!r.values.length?d_(n,i):xo(SS(y_(r,l),l.values),a):bl(n,i)};function bS(n,i,a){return typeof n=="number"&&typeof i=="number"&&typeof a=="number"?Ht(n,i,a):Gh(n)(n,i)}const v_=n=>{const i=({timestamp:a})=>n(a);return{start:(a=!0)=>Nt.update(i,a),stop:()=>gi(i),now:()=>re.isProcessing?re.timestamp:be.now()}},TS=(n,i,a=10)=>{let r="";const l=Math.max(Math.round(i/a),2);for(let f=0;f<l;f++)r+=Math.round(n(f/(l-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Tl=2e4;function Yh(n){let i=0;const a=50;let r=n.next(i);for(;!r.done&&i<Tl;)i+=a,r=n.next(i);return i>=Tl?1/0:i}function S_(n,i=100,a){const r=a({...n,keyframes:[0,i]}),l=Math.min(Yh(r),Tl);return{type:"keyframes",ease:f=>r.next(l*f).value/i,duration:ke(l)}}const b_=5;function xS(n,i,a){const r=Math.max(i-b_,0);return tS(a-n(r),i-r)}const Yt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ef=.001;function T_({duration:n=Yt.duration,bounce:i=Yt.bounce,velocity:a=Yt.velocity,mass:r=Yt.mass}){let l,f,h=1-i;h=zn(Yt.minDamping,Yt.maxDamping,h),n=zn(Yt.minDuration,Yt.maxDuration,ke(n)),h<1?(l=p=>{const g=p*h,v=g*n,S=g-a,T=Gf(p,h),E=Math.exp(-v);return Ef-S/T*E},f=p=>{const v=p*h*n,S=v*a+a,T=Math.pow(h,2)*Math.pow(p,2)*n,E=Math.exp(-v),_=Gf(Math.pow(p,2),h);return(-l(p)+Ef>0?-1:1)*((S-T)*E)/_}):(l=p=>{const g=Math.exp(-p*n),v=(p-a)*n+1;return-Ef+g*v},f=p=>{const g=Math.exp(-p*n),v=(a-p)*(n*n);return g*v});const d=5/n,m=E_(l,f,d);if(n=ln(n),isNaN(m))return{stiffness:Yt.stiffness,damping:Yt.damping,duration:n};{const p=Math.pow(m,2)*r;return{stiffness:p,damping:h*2*Math.sqrt(r*p),duration:n}}}const x_=12;function E_(n,i,a){let r=a;for(let l=1;l<x_;l++)r=r-n(r)/i(r);return r}function Gf(n,i){return n*Math.sqrt(1-i*i)}const R_=["duration","bounce"],A_=["stiffness","damping","mass"];function Jg(n,i){return i.some(a=>n[a]!==void 0)}function __(n){let i={velocity:Yt.velocity,stiffness:Yt.stiffness,damping:Yt.damping,mass:Yt.mass,isResolvedFromDuration:!1,...n};if(!Jg(n,A_)&&Jg(n,R_))if(n.visualDuration){const a=n.visualDuration,r=2*Math.PI/(a*1.2),l=r*r,f=2*zn(.05,1,1-(n.bounce||0))*Math.sqrt(l);i={...i,mass:Yt.mass,stiffness:l,damping:f}}else{const a=T_(n);i={...i,...a,mass:Yt.mass},i.isResolvedFromDuration=!0}return i}function xl(n=Yt.visualDuration,i=Yt.bounce){const a=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:i}:n;let{restSpeed:r,restDelta:l}=a;const f=a.keyframes[0],h=a.keyframes[a.keyframes.length-1],d={done:!1,value:f},{stiffness:m,damping:p,mass:g,duration:v,velocity:S,isResolvedFromDuration:T}=__({...a,velocity:-ke(a.velocity||0)}),E=S||0,_=p/(2*Math.sqrt(m*g)),C=h-f,M=ke(Math.sqrt(m/g)),w=Math.abs(C)<5;r||(r=w?Yt.restSpeed.granular:Yt.restSpeed.default),l||(l=w?Yt.restDelta.granular:Yt.restDelta.default);let V;if(_<1){const k=Gf(M,_);V=U=>{const G=Math.exp(-_*M*U);return h-G*((E+_*M*C)/k*Math.sin(k*U)+C*Math.cos(k*U))}}else if(_===1)V=k=>h-Math.exp(-M*k)*(C+(E+M*C)*k);else{const k=M*Math.sqrt(_*_-1);V=U=>{const G=Math.exp(-_*M*U),H=Math.min(k*U,300);return h-G*((E+_*M*C)*Math.sinh(H)+k*C*Math.cosh(H))/k}}const P={calculatedDuration:T&&v||null,next:k=>{const U=V(k);if(T)d.done=k>=v;else{let G=k===0?E:0;_<1&&(G=k===0?ln(E):xS(V,k,U));const H=Math.abs(G)<=r,Z=Math.abs(h-U)<=l;d.done=H&&Z}return d.value=d.done?h:U,d},toString:()=>{const k=Math.min(Yh(P),Tl),U=TS(G=>P.next(k*G).value,k,30);return k+"ms "+U},toTransition:()=>{}};return P}xl.applyToOptions=n=>{const i=S_(n,100,xl);return n.ease=i.ease,n.duration=ln(i.duration),n.type="keyframes",n};function Yf({keyframes:n,velocity:i=0,power:a=.8,timeConstant:r=325,bounceDamping:l=10,bounceStiffness:f=500,modifyTarget:h,min:d,max:m,restDelta:p=.5,restSpeed:g}){const v=n[0],S={done:!1,value:v},T=H=>d!==void 0&&H<d||m!==void 0&&H>m,E=H=>d===void 0?m:m===void 0||Math.abs(d-H)<Math.abs(m-H)?d:m;let _=a*i;const C=v+_,M=h===void 0?C:h(C);M!==C&&(_=M-v);const w=H=>-_*Math.exp(-H/r),V=H=>M+w(H),P=H=>{const Z=w(H),nt=V(H);S.done=Math.abs(Z)<=p,S.value=S.done?M:nt};let k,U;const G=H=>{T(S.value)&&(k=H,U=xl({keyframes:[S.value,E(S.value)],velocity:xS(V,H,S.value),damping:l,stiffness:f,restDelta:p,restSpeed:g}))};return G(0),{calculatedDuration:null,next:H=>{let Z=!1;return!U&&k===void 0&&(Z=!0,P(H),G(H)),k!==void 0&&H>=k?U.next(H-k):(!Z&&P(H),S)}}}function M_(n,i,a){const r=[],l=a||Vn.mix||bS,f=n.length-1;for(let h=0;h<f;h++){let d=l(n[h],n[h+1]);if(i){const m=Array.isArray(i)?i[h]||Xe:i;d=xo(m,d)}r.push(d)}return r}function C_(n,i,{clamp:a=!0,ease:r,mixer:l}={}){const f=n.length;if(Vh(f===i.length),f===1)return()=>i[0];if(f===2&&i[0]===i[1])return()=>i[1];const h=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),i=[...i].reverse());const d=M_(i,r,l),m=d.length,p=g=>{if(h&&g<n[0])return i[0];let v=0;if(m>1)for(;v<n.length-2&&!(g<n[v+1]);v++);const S=mo(n[v],n[v+1],g);return d[v](S)};return a?g=>p(zn(n[0],n[f-1],g)):p}function D_(n,i){const a=n[n.length-1];for(let r=1;r<=i;r++){const l=mo(0,i,r);n.push(Ht(a,1,l))}}function w_(n){const i=[0];return D_(i,n.length-1),i}function O_(n,i){return n.map(a=>a*i)}function L_(n,i){return n.map(()=>i||uS).splice(0,n.length-1)}function oo({duration:n=300,keyframes:i,times:a,ease:r="easeInOut"}){const l=YA(r)?r.map(Kg):Kg(r),f={done:!1,value:i[0]},h=O_(a&&a.length===i.length?a:w_(i),n),d=C_(h,i,{ease:Array.isArray(l)?l:L_(i,l)});return{calculatedDuration:n,next:m=>(f.value=d(m),f.done=m>=n,f)}}const z_=n=>n!==null;function Fh(n,{repeat:i,repeatType:a="loop"},r,l=1){const f=n.filter(z_),d=l<0||i&&a!=="loop"&&i%2===1?0:f.length-1;return!d||r===void 0?f[d]:r}const V_={decay:Yf,inertia:Yf,tween:oo,keyframes:oo,spring:xl};function ES(n){typeof n.type=="string"&&(n.type=V_[n.type])}class Kh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(i=>{this.resolve=i})}notifyFinished(){this.resolve()}then(i,a){return this.finished.then(i,a)}}const B_=n=>n/100;class kh extends Kh{constructor(i){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:a}=this.options;a&&a.updatedAt!==be.now()&&this.tick(be.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=i,this.initAnimation(),this.play(),i.autoplay===!1&&this.pause()}initAnimation(){const{options:i}=this;ES(i);const{type:a=oo,repeat:r=0,repeatDelay:l=0,repeatType:f,velocity:h=0}=i;let{keyframes:d}=i;const m=a||oo;m!==oo&&typeof d[0]!="number"&&(this.mixKeyframes=xo(B_,bS(d[0],d[1])),d=[0,100]);const p=m({...i,keyframes:d});f==="mirror"&&(this.mirroredGenerator=m({...i,keyframes:[...d].reverse(),velocity:-h})),p.calculatedDuration===null&&(p.calculatedDuration=Yh(p));const{calculatedDuration:g}=p;this.calculatedDuration=g,this.resolvedDuration=g+l,this.totalDuration=this.resolvedDuration*(r+1)-l,this.generator=p}updateTime(i){const a=Math.round(i-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(i,a=!1){const{generator:r,totalDuration:l,mixKeyframes:f,mirroredGenerator:h,resolvedDuration:d,calculatedDuration:m}=this;if(this.startTime===null)return r.next(0);const{delay:p=0,keyframes:g,repeat:v,repeatType:S,repeatDelay:T,type:E,onUpdate:_,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-l/this.speed,this.startTime)),a?this.currentTime=i:this.updateTime(i);const M=this.currentTime-p*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?M<0:M>l;this.currentTime=Math.max(M,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let V=this.currentTime,P=r;if(v){const H=Math.min(this.currentTime,l)/d;let Z=Math.floor(H),nt=H%1;!nt&&H>=1&&(nt=1),nt===1&&Z--,Z=Math.min(Z,v+1),Z%2&&(S==="reverse"?(nt=1-nt,T&&(nt-=T/d)):S==="mirror"&&(P=h)),V=zn(0,1,nt)*d}const k=w?{done:!1,value:g[0]}:P.next(V);f&&(k.value=f(k.value));let{done:U}=k;!w&&m!==null&&(U=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const G=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return G&&E!==Yf&&(k.value=Fh(g,this.options,C,this.speed)),_&&_(k.value),G&&this.finish(),k}then(i,a){return this.finished.then(i,a)}get duration(){return ke(this.calculatedDuration)}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+ke(i)}get time(){return ke(this.currentTime)}set time(i){i=ln(i),this.currentTime=i,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(i){this.updateTime(be.now());const a=this.playbackSpeed!==i;this.playbackSpeed=i,a&&(this.time=ke(this.currentTime))}play(){if(this.isStopped)return;const{driver:i=v_,startTime:a}=this.options;this.driver||(this.driver=i(l=>this.tick(l))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=a??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(be.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(i){return this.startTime=0,this.tick(i,!0)}attachTimeline(i){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),i.observe(this)}}function U_(n){for(let i=1;i<n.length;i++)n[i]??(n[i]=n[i-1])}const Fi=n=>n*180/Math.PI,Ff=n=>{const i=Fi(Math.atan2(n[1],n[0]));return Kf(i)},j_={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Ff,rotateZ:Ff,skewX:n=>Fi(Math.atan(n[1])),skewY:n=>Fi(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Kf=n=>(n=n%360,n<0&&(n+=360),n),Ig=Ff,$g=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),Wg=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),N_={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$g,scaleY:Wg,scale:n=>($g(n)+Wg(n))/2,rotateX:n=>Kf(Fi(Math.atan2(n[6],n[5]))),rotateY:n=>Kf(Fi(Math.atan2(-n[2],n[0]))),rotateZ:Ig,rotate:Ig,skewX:n=>Fi(Math.atan(n[4])),skewY:n=>Fi(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function kf(n){return n.includes("scale")?1:0}function Qf(n,i){if(!n||n==="none")return kf(i);const a=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,l;if(a)r=N_,l=a;else{const d=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=j_,l=d}if(!l)return kf(i);const f=r[i],h=l[1].split(",").map(H_);return typeof f=="function"?f(h):h[f]}const P_=(n,i)=>{const{transform:a="none"}=getComputedStyle(n);return Qf(a,i)};function H_(n){return parseFloat(n.trim())}const $s=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ws=new Set($s),tv=n=>n===Is||n===ot,q_=new Set(["x","y","z"]),G_=$s.filter(n=>!q_.has(n));function Y_(n){const i=[];return G_.forEach(a=>{const r=n.getValue(a);r!==void 0&&(i.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),i}const Zi={width:({x:n},{paddingLeft:i="0",paddingRight:a="0"})=>n.max-n.min-parseFloat(i)-parseFloat(a),height:({y:n},{paddingTop:i="0",paddingBottom:a="0"})=>n.max-n.min-parseFloat(i)-parseFloat(a),top:(n,{top:i})=>parseFloat(i),left:(n,{left:i})=>parseFloat(i),bottom:({y:n},{top:i})=>parseFloat(i)+(n.max-n.min),right:({x:n},{left:i})=>parseFloat(i)+(n.max-n.min),x:(n,{transform:i})=>Qf(i,"x"),y:(n,{transform:i})=>Qf(i,"y")};Zi.translateX=Zi.x;Zi.translateY=Zi.y;const Ji=new Set;let Xf=!1,Zf=!1,Jf=!1;function RS(){if(Zf){const n=Array.from(Ji).filter(r=>r.needsMeasurement),i=new Set(n.map(r=>r.element)),a=new Map;i.forEach(r=>{const l=Y_(r);l.length&&(a.set(r,l),r.render())}),n.forEach(r=>r.measureInitialState()),i.forEach(r=>{r.render();const l=a.get(r);l&&l.forEach(([f,h])=>{r.getValue(f)?.set(h)})}),n.forEach(r=>r.measureEndState()),n.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zf=!1,Xf=!1,Ji.forEach(n=>n.complete(Jf)),Ji.clear()}function AS(){Ji.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Zf=!0)})}function F_(){Jf=!0,AS(),RS(),Jf=!1}class Qh{constructor(i,a,r,l,f,h=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...i],this.onComplete=a,this.name=r,this.motionValue=l,this.element=f,this.isAsync=h}scheduleResolve(){this.state="scheduled",this.isAsync?(Ji.add(this),Xf||(Xf=!0,Nt.read(AS),Nt.resolveKeyframes(RS))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:a,element:r,motionValue:l}=this;if(i[0]===null){const f=l?.get(),h=i[i.length-1];if(f!==void 0)i[0]=f;else if(r&&a){const d=r.readValue(a,h);d!=null&&(i[0]=d)}i[0]===void 0&&(i[0]=h),l&&f===void 0&&l.set(i[0])}U_(i)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(i=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,i),Ji.delete(this)}cancel(){this.state==="scheduled"&&(Ji.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const K_=n=>n.startsWith("--");function k_(n,i,a){K_(i)?n.style.setProperty(i,a):n.style[i]=a}const Q_=Bh(()=>window.ScrollTimeline!==void 0),X_={};function Z_(n,i){const a=Bh(n);return()=>X_[i]??a()}const _S=Z_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),eo=([n,i,a,r])=>`cubic-bezier(${n}, ${i}, ${a}, ${r})`,ev={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:eo([0,.65,.55,1]),circOut:eo([.55,0,1,.45]),backIn:eo([.31,.01,.66,-.59]),backOut:eo([.33,1.53,.69,.99])};function MS(n,i){if(n)return typeof n=="function"?_S()?TS(n,i):"ease-out":cS(n)?eo(n):Array.isArray(n)?n.map(a=>MS(a,i)||ev.easeOut):ev[n]}function J_(n,i,a,{delay:r=0,duration:l=300,repeat:f=0,repeatType:h="loop",ease:d="easeOut",times:m}={},p=void 0){const g={[i]:a};m&&(g.offset=m);const v=MS(d,l);Array.isArray(v)&&(g.easing=v);const S={delay:r,duration:l,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:f+1,direction:h==="reverse"?"alternate":"normal"};return p&&(S.pseudoElement=p),n.animate(g,S)}function CS(n){return typeof n=="function"&&"applyToOptions"in n}function I_({type:n,...i}){return CS(n)&&_S()?n.applyToOptions(i):(i.duration??(i.duration=300),i.ease??(i.ease="easeOut"),i)}class $_ extends Kh{constructor(i){if(super(),this.finishedTime=null,this.isStopped=!1,!i)return;const{element:a,name:r,keyframes:l,pseudoElement:f,allowFlatten:h=!1,finalKeyframe:d,onComplete:m}=i;this.isPseudoElement=!!f,this.allowFlatten=h,this.options=i,Vh(typeof i.type!="string");const p=I_(i);this.animation=J_(a,r,l,p,f),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!f){const g=Fh(l,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(g):k_(a,r,g),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:i}=this;i==="idle"||i==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const i=this.animation.effect?.getComputedTiming?.().duration||0;return ke(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+ke(i)}get time(){return ke(Number(this.animation.currentTime)||0)}set time(i){this.finishedTime=null,this.animation.currentTime=ln(i)}get speed(){return this.animation.playbackRate}set speed(i){i<0&&(this.finishedTime=null),this.animation.playbackRate=i}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(i){this.animation.startTime=i}attachTimeline({timeline:i,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,i&&Q_()?(this.animation.timeline=i,Xe):a(this)}}const DS={anticipate:oS,backInOut:aS,circInOut:lS};function W_(n){return n in DS}function tM(n){typeof n.ease=="string"&&W_(n.ease)&&(n.ease=DS[n.ease])}const nv=10;class eM extends $_{constructor(i){tM(i),ES(i),super(i),i.startTime&&(this.startTime=i.startTime),this.options=i}updateMotionValue(i){const{motionValue:a,onUpdate:r,onComplete:l,element:f,...h}=this.options;if(!a)return;if(i!==void 0){a.set(i);return}const d=new kh({...h,autoplay:!1}),m=ln(this.finishedTime??this.time);a.setWithVelocity(d.sample(m-nv).value,d.sample(m).value,nv),d.stop()}}const iv=(n,i)=>i==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(vi.test(n)||n==="0")&&!n.startsWith("url("));function nM(n){const i=n[0];if(n.length===1)return!0;for(let a=0;a<n.length;a++)if(n[a]!==i)return!0}function iM(n,i,a,r){const l=n[0];if(l===null)return!1;if(i==="display"||i==="visibility")return!0;const f=n[n.length-1],h=iv(l,i),d=iv(f,i);return!h||!d?!1:nM(n)||(a==="spring"||CS(a))&&r}function If(n){n.duration=0,n.type="keyframes"}const sM=new Set(["opacity","clipPath","filter","transform"]),aM=Bh(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oM(n){const{motionValue:i,name:a,repeatDelay:r,repeatType:l,damping:f,type:h}=n;if(!(i?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:p}=i.owner.getProps();return aM()&&a&&sM.has(a)&&(a!=="transform"||!p)&&!m&&!r&&l!=="mirror"&&f!==0&&h!=="inertia"}const rM=40;class lM extends Kh{constructor({autoplay:i=!0,delay:a=0,type:r="keyframes",repeat:l=0,repeatDelay:f=0,repeatType:h="loop",keyframes:d,name:m,motionValue:p,element:g,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=be.now();const S={autoplay:i,delay:a,type:r,repeat:l,repeatDelay:f,repeatType:h,name:m,motionValue:p,element:g,...v},T=g?.KeyframeResolver||Qh;this.keyframeResolver=new T(d,(E,_,C)=>this.onKeyframesResolved(E,_,S,!C),m,p,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(i,a,r,l){this.keyframeResolver=void 0;const{name:f,type:h,velocity:d,delay:m,isHandoff:p,onUpdate:g}=r;this.resolvedAt=be.now(),iM(i,f,h,d)||((Vn.instantAnimations||!m)&&g?.(Fh(i,r,a)),i[0]=i[i.length-1],If(r),r.repeat=0);const S={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>rM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...r,keyframes:i},T=!p&&oM(S)?new eM({...S,element:S.motionValue.owner.current}):new kh(S);T.finished.then(()=>this.notifyFinished()).catch(Xe),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(i,a){return this.finished.finally(i).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),F_()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(i){this.animation.time=i}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(i){this.animation.speed=i}get startTime(){return this.animation.startTime}attachTimeline(i){return this._animation?this.stopTimeline=this.animation.attachTimeline(i):this.pendingTimeline=i,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const uM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cM(n){const i=uM.exec(n);if(!i)return[,];const[,a,r,l]=i;return[`--${a??r}`,l]}function wS(n,i,a=1){const[r,l]=cM(n);if(!r)return;const f=window.getComputedStyle(i).getPropertyValue(r);if(f){const h=f.trim();return I0(h)?parseFloat(h):h}return Ph(l)?wS(l,i,a+1):l}function Xh(n,i){return n?.[i]??n?.default??n}const OS=new Set(["width","height","top","left","right","bottom",...$s]),fM={test:n=>n==="auto",parse:n=>n},LS=n=>i=>i.test(n),zS=[Is,ot,un,ui,n_,e_,fM],sv=n=>zS.find(LS(n));function hM(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||W0(n):!0}const dM=new Set(["brightness","contrast","saturate","opacity"]);function mM(n){const[i,a]=n.slice(0,-1).split("(");if(i==="drop-shadow")return n;const[r]=a.match(Hh)||[];if(!r)return n;const l=a.replace(r,"");let f=dM.has(i)?1:0;return r!==a&&(f*=100),i+"("+f+l+")"}const pM=/\b([a-z-]*)\(.*?\)/gu,$f={...vi,getAnimatableNone:n=>{const i=n.match(pM);return i?i.map(mM).join(" "):n}},av={...Is,transform:Math.round},yM={rotate:ui,rotateX:ui,rotateY:ui,rotateZ:ui,scale:Wr,scaleX:Wr,scaleY:Wr,scaleZ:Wr,skew:ui,skewX:ui,skewY:ui,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:po,originX:kg,originY:kg,originZ:ot},Zh={borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,backgroundPositionX:ot,backgroundPositionY:ot,...yM,zIndex:av,fillOpacity:po,strokeOpacity:po,numOctaves:av},gM={...Zh,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:$f,WebkitFilter:$f},VS=n=>gM[n];function BS(n,i){let a=VS(n);return a!==$f&&(a=vi),a.getAnimatableNone?a.getAnimatableNone(i):void 0}const vM=new Set(["auto","none","0"]);function SM(n,i,a){let r=0,l;for(;r<n.length&&!l;){const f=n[r];typeof f=="string"&&!vM.has(f)&&yo(f).values.length&&(l=n[r]),r++}if(l&&a)for(const f of i)n[f]=BS(a,l)}class bM extends Qh{constructor(i,a,r,l,f){super(i,a,r,l,f,!0)}readKeyframes(){const{unresolvedKeyframes:i,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let m=0;m<i.length;m++){let p=i[m];if(typeof p=="string"&&(p=p.trim(),Ph(p))){const g=wS(p,a.current);g!==void 0&&(i[m]=g),m===i.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!OS.has(r)||i.length!==2)return;const[l,f]=i,h=sv(l),d=sv(f);if(h!==d)if(tv(h)&&tv(d))for(let m=0;m<i.length;m++){const p=i[m];typeof p=="string"&&(i[m]=parseFloat(p))}else Zi[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:a}=this,r=[];for(let l=0;l<i.length;l++)(i[l]===null||hM(i[l]))&&r.push(l);r.length&&SM(i,r,a)}measureInitialState(){const{element:i,unresolvedKeyframes:a,name:r}=this;if(!i||!i.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Zi[r](i.measureViewportBox(),window.getComputedStyle(i.current)),a[0]=this.measuredOrigin;const l=a[a.length-1];l!==void 0&&i.getValue(r,l).jump(l,!1)}measureEndState(){const{element:i,name:a,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const l=i.getValue(a);l&&l.jump(this.measuredOrigin,!1);const f=r.length-1,h=r[f];r[f]=Zi[a](i.measureViewportBox(),window.getComputedStyle(i.current)),h!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=h),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,m])=>{i.getValue(d).set(m)}),this.resolveNoneKeyframes()}}function TM(n,i,a){if(n instanceof EventTarget)return[n];if(typeof n=="string"){let r=document;const l=a?.[n]??r.querySelectorAll(n);return l?Array.from(l):[]}return Array.from(n)}const US=(n,i)=>i&&typeof n=="number"?i.transform(n):n;function jS(n){return $0(n)&&"offsetHeight"in n}const ov=30,xM=n=>!isNaN(parseFloat(n));class EM{constructor(i,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const l=be.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty()},this.hasAnimated=!1,this.setCurrent(i),this.owner=a.owner}setCurrent(i){this.current=i,this.updatedAt=be.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=xM(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return this.on("change",i)}on(i,a){this.events[i]||(this.events[i]=new Uh);const r=this.events[i].add(a);return i==="change"?()=>{r(),Nt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,a){this.passiveEffect=i,this.stopPassiveEffect=a}set(i){this.passiveEffect?this.passiveEffect(i,this.updateAndNotify):this.updateAndNotify(i)}setWithVelocity(i,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-r}jump(i,a=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(i){this.dependents||(this.dependents=new Set),this.dependents.add(i)}removeDependent(i){this.dependents&&this.dependents.delete(i)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=be.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>ov)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,ov);return tS(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(i){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=i(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zs(n,i){return new EM(n,i)}const{schedule:Jh}=fS(queueMicrotask,!1),tn={x:!1,y:!1};function NS(){return tn.x||tn.y}function RM(n){return n==="x"||n==="y"?tn[n]?null:(tn[n]=!0,()=>{tn[n]=!1}):tn.x||tn.y?null:(tn.x=tn.y=!0,()=>{tn.x=tn.y=!1})}function PS(n,i){const a=TM(n),r=new AbortController,l={passive:!0,...i,signal:r.signal};return[a,l,()=>r.abort()]}function rv(n){return!(n.pointerType==="touch"||NS())}function AM(n,i,a={}){const[r,l,f]=PS(n,a),h=d=>{if(!rv(d))return;const{target:m}=d,p=i(m,d);if(typeof p!="function"||!m)return;const g=v=>{rv(v)&&(p(v),m.removeEventListener("pointerleave",g))};m.addEventListener("pointerleave",g,l)};return r.forEach(d=>{d.addEventListener("pointerenter",h,l)}),f}const HS=(n,i)=>i?n===i?!0:HS(n,i.parentElement):!1,Ih=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,_M=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function MM(n){return _M.has(n.tagName)||n.tabIndex!==-1}const al=new WeakSet;function lv(n){return i=>{i.key==="Enter"&&n(i)}}function Rf(n,i){n.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const CM=(n,i)=>{const a=n.currentTarget;if(!a)return;const r=lv(()=>{if(al.has(a))return;Rf(a,"down");const l=lv(()=>{Rf(a,"up")}),f=()=>Rf(a,"cancel");a.addEventListener("keyup",l,i),a.addEventListener("blur",f,i)});a.addEventListener("keydown",r,i),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),i)};function uv(n){return Ih(n)&&!NS()}function DM(n,i,a={}){const[r,l,f]=PS(n,a),h=d=>{const m=d.currentTarget;if(!uv(d))return;al.add(m);const p=i(m,d),g=(T,E)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",S),al.has(m)&&al.delete(m),uv(T)&&typeof p=="function"&&p(T,{success:E})},v=T=>{g(T,m===window||m===document||a.useGlobalTarget||HS(m,T.target))},S=T=>{g(T,!1)};window.addEventListener("pointerup",v,l),window.addEventListener("pointercancel",S,l)};return r.forEach(d=>{(a.useGlobalTarget?window:d).addEventListener("pointerdown",h,l),jS(d)&&(d.addEventListener("focus",p=>CM(p,l)),!MM(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),f}function qS(n){return $0(n)&&"ownerSVGElement"in n}function wM(n){return qS(n)&&n.tagName==="svg"}const ue=n=>!!(n&&n.getVelocity),OM=[...zS,It,vi],LM=n=>OM.find(LS(n)),$h=K.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function cv(n,i){if(typeof n=="function")return n(i);n!=null&&(n.current=i)}function zM(...n){return i=>{let a=!1;const r=n.map(l=>{const f=cv(l,i);return!a&&typeof f=="function"&&(a=!0),f});if(a)return()=>{for(let l=0;l<r.length;l++){const f=r[l];typeof f=="function"?f():cv(n[l],null)}}}}function VM(...n){return K.useCallback(zM(...n),n)}class BM extends K.Component{getSnapshotBeforeUpdate(i){const a=this.props.childRef.current;if(a&&i.isPresent&&!this.props.isPresent){const r=a.offsetParent,l=jS(r)&&r.offsetWidth||0,f=this.props.sizeRef.current;f.height=a.offsetHeight||0,f.width=a.offsetWidth||0,f.top=a.offsetTop,f.left=a.offsetLeft,f.right=l-f.width-f.left}return null}componentDidUpdate(){}render(){return this.props.children}}function UM({children:n,isPresent:i,anchorX:a,root:r}){const l=K.useId(),f=K.useRef(null),h=K.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=K.useContext($h),m=VM(f,n?.ref);return K.useInsertionEffect(()=>{const{width:p,height:g,top:v,left:S,right:T}=h.current;if(i||!f.current||!p||!g)return;const E=a==="left"?`left: ${S}`:`right: ${T}`;f.current.dataset.motionPopId=l;const _=document.createElement("style");d&&(_.nonce=d);const C=r??document.head;return C.appendChild(_),_.sheet&&_.sheet.insertRule(`
18
+ `)),hi(m)&&N0.test(m)?P0(m):hi(m)?m:ER(m,this._locale,this._locales)(a,r?.formats)}date(i,a){return xh(this._locales||this._locale,i,a)}number(i,a){return Nf(this._locales||this._locale,i,a)}}function OR(n={}){return new wR(n)}const Ll=OR(),LR=JSON.parse('{"/vVlbJ":[["0"]," steps"],"57upzv":["Scenario List"],"6exX+8":["Regenerate"],"7BGeH2":["Failed to generate preview"],"8faOjQ":["Create New"],"9PuK3/":["Switch to preview mode"],"FQs7H0":["Back to Scenario List"],"FxVG/l":["Copied to clipboard"],"G3Kixs":[["0"]," documents available"],"GSr0rF":["Open menu"],"NOdFZR":["Generating..."],"NpRmdU":["Create New Document"],"OW40Ve":["Document has been updated"],"QFXSrR":["Edit Existing"],"T6PvRl":["Required fields are not filled"],"TC9TYf":["Press the button to generate a Design Doc preview"],"Vw8l6h":["An error occurred"],"W/yZH3":["No items. Please add items using the \\"Add\\" button."],"W9q5nG":["Generate preview"],"XvjC4F":["Saving..."],"Z8lGw6":["Share"],"ZGnMhT":["No documents found"],"afF891":["Please generate a preview"],"d61rJy":["Design Doc has been created"],"fQ4jUh":["Create a new document from scratch"],"fsyAH8":["Show preview"],"hUe0iX":["Step navigation"],"hXzOVo":["Next"],"he3ygx":["Copy"],"iH8pgl":["Back"],"lbNn+H":["No content to save"],"m16xKo":["Add"],"mkMLq4":["Collapse sidebar"],"rdUucN":["Preview"],"tfDRzk":["Save"],"tugdy6":["Expand sidebar"],"vcpc5o":["Close menu"],"wR3B2j":["Switch to edit mode"],"yFRvSy":["Select Document to Edit"],"yz7wBu":["Close"]}'),zR=JSON.parse('{"/vVlbJ":[["0"],"ステップ"],"57upzv":["シナリオ一覧"],"6exX+8":["再生成"],"7BGeH2":["プレビューの生成に失敗しました"],"8faOjQ":["新規作成"],"9PuK3/":["プレビューモードに切り替え"],"FQs7H0":["シナリオ一覧に戻る"],"FxVG/l":["クリップボードにコピーしました"],"G3Kixs":[["0"],"件のドキュメント"],"GSr0rF":["メニューを開く"],"NOdFZR":["生成中..."],"NpRmdU":["新しいドキュメントを作成"],"OW40Ve":["ドキュメントを更新しました"],"QFXSrR":["既存を編集"],"T6PvRl":["必須項目が入力されていません"],"TC9TYf":["ボタンを押すとDesign Docのプレビューが生成されます"],"Vw8l6h":["エラーが発生しました"],"W/yZH3":["項目がありません。「追加」ボタンから追加してください。"],"W9q5nG":["プレビューを生成"],"XvjC4F":["保存中..."],"Z8lGw6":["シェア"],"ZGnMhT":["ドキュメントがありません"],"afF891":["プレビューを生成してください"],"d61rJy":["Design Docを生成しました"],"fQ4jUh":["新しいドキュメントを作成します"],"fsyAH8":["プレビューを表示"],"hUe0iX":["ステップナビゲーション"],"hXzOVo":["次へ"],"he3ygx":["コピー"],"iH8pgl":["戻る"],"lbNn+H":["保存するコンテンツがありません"],"m16xKo":["追加"],"mkMLq4":["サイドバーを折りたたむ"],"rdUucN":["プレビュー"],"tfDRzk":["保存"],"tugdy6":["サイドバーを展開"],"vcpc5o":["メニューを閉じる"],"wR3B2j":["編集モードに切り替え"],"yFRvSy":["編集するドキュメントを選択"],"yz7wBu":["閉じる"]}'),q0="design-docs-gen-locale",wD={ja:"日本語",en:"English"};Ll.load({ja:zR,en:LR});const VR=()=>{if(typeof localStorage<"u"){const n=localStorage.getItem(q0);if(n==="ja"||n==="en")return n}return null},BR=()=>typeof navigator<"u"&&navigator.language.split("-")[0]==="en"?"en":"ja",UR=()=>VR()??BR(),OD=()=>Ll.locale??"ja",jR=n=>{typeof localStorage<"u"&&localStorage.setItem(q0,n),typeof document<"u"&&(document.documentElement.lang=n),Ll.activate(n)};jR(UR());const Wi=eR({component:U0}),NR=pi("/")({beforeLoad:()=>{throw b0({to:"/scenarios"})}}),PR="modulepreload",HR=function(n){return"/"+n},Gg={},To=function(i,a,r){let l=Promise.resolve();if(a&&a.length>0){let m=function(p){return Promise.all(p.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),d=h?.nonce||h?.getAttribute("nonce");l=m(a.map(p=>{if(p=HR(p),p in Gg)return;Gg[p]=!0;const g=p.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":PR,g||(S.as="script"),S.crossOrigin="",S.href=p,d&&S.setAttribute("nonce",d),document.head.appendChild(S),g)return new Promise((T,E)=>{S.addEventListener("load",T),S.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function f(h){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=h,window.dispatchEvent(d),!d.defaultPrevented)throw h}return l.then(h=>{for(const d of h||[])d.status==="rejected"&&f(d.reason);return i().catch(f)})},qR=async()=>{const n=await fetch("/api/scenarios");if(!n.ok)throw new Error("Failed to fetch scenarios");return(await n.json()).scenarios},GR=()=>({queryKey:["scenarios"],queryFn:qR}),Ln=new Cx({defaultOptions:{queries:{staleTime:1e3*60*5,retry:1}}}),YR=()=>To(()=>import("./index-Bw7jLgLx.js"),__vite__mapDeps([0,1,2])),FR=pi("/scenarios/")({loader:async()=>{await Ln.prefetchQuery(GR())},component:bo(YR,"component")}),KR=async n=>{const i=await fetch(`/api/scenarios/${n}/docs`);if(!i.ok)throw new Error(`Failed to fetch docs for scenario ${n}`);return(await i.json()).docs},G0=n=>({queryKey:["scenarios",n,"docs"],queryFn:()=>KR(n)}),kR=async n=>{const i=await fetch(`/api/scenarios/${encodeURIComponent(n)}`);if(!i.ok)throw new Error("Failed to fetch scenario");return await i.json()},zl=n=>({queryKey:["scenarios",n],queryFn:()=>kR(n)}),QR=()=>To(()=>import("./index-Daw2qLfo.js"),__vite__mapDeps([3,1,4,5,2])),XR=pi("/scenarios/$scenarioId/")({loader:async({params:n})=>{try{await Promise.all([Ln.fetchQuery(zl(n.scenarioId)),Ln.prefetchQuery(G0(n.scenarioId))])}catch{throw Qi()}},component:bo(QR,"component")}),ZR=()=>To(()=>import("./index-CGVrqKaZ.js"),__vite__mapDeps([6,1,4,5,2])),JR=pi("/scenarios/$scenarioId/docs/")({loader:async({params:n})=>{try{await Promise.all([Ln.fetchQuery(zl(n.scenarioId)),Ln.prefetchQuery(G0(n.scenarioId))])}catch{throw Qi()}},component:bo(ZR,"component")});let vf;function IR(n){return{lang:n?.lang??vf?.lang,message:n?.message,abortEarly:n?.abortEarly??vf?.abortEarly,abortPipeEarly:n?.abortPipeEarly??vf?.abortPipeEarly}}let $R;function WR(n){return $R?.get(n)}let tA;function eA(n){return tA?.get(n)}let nA;function iA(n,i){return nA?.get(n)?.get(i)}function Eh(n){const i=typeof n;return i==="string"?`"${n}"`:i==="number"||i==="bigint"||i==="boolean"?`${n}`:i==="object"||i==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":i}function yi(n,i,a,r,l){const f=l&&"input"in l?l.input:a.value,h=l?.expected??n.expects??null,d=l?.received??Eh(f),m={kind:n.kind,type:n.type,input:f,expected:h,received:d,message:`Invalid ${i}: ${h?`Expected ${h} but r`:"R"}eceived ${d}`,requirement:n.requirement,path:l?.path,issues:l?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},p=n.kind==="schema",g=l?.message??n.message??iA(n.reference,m.lang)??(p?eA(m.lang):null)??r.message??WR(m.lang);g!==void 0&&(m.message=typeof g=="function"?g(m):g),p&&(a.typed=!1),a.issues?a.issues.push(m):a.issues=[m]}function Si(n){return{version:1,vendor:"valibot",validate(i){return n["~run"]({value:i},IR())}}}function sA(n,i){const a=[...new Set(n)];return a.length>1?`(${a.join(` ${i} `)})`:a[0]??"never"}function aA(n,i,a){return typeof n.fallback=="function"?n.fallback(i,a):n.fallback}function Y0(n,i,a){return typeof n.default=="function"?n.default(i,a):n.default}function oA(n,i){return{kind:"schema",type:"array",reference:oA,expects:"Array",async:!1,item:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){const l=a.value;if(Array.isArray(l)){a.typed=!0,a.value=[];for(let f=0;f<l.length;f++){const h=l[f],d=this.item["~run"]({value:h},r);if(d.issues){const m={type:"array",origin:"value",input:l,key:f,value:h};for(const p of d.issues)p.path?p.path.unshift(m):p.path=[m],a.issues?.push(p);if(a.issues||(a.issues=d.issues),r.abortEarly){a.typed=!1;break}}d.typed||(a.typed=!1),a.value.push(d.value)}}else yi(this,"type",a,r);return a}}}function rA(n){return{kind:"schema",type:"boolean",reference:rA,expects:"boolean",async:!1,message:n,get"~standard"(){return Si(this)},"~run"(i,a){return typeof i.value=="boolean"?i.typed=!0:yi(this,"type",i,a),i}}}function lA(n,i){return{kind:"schema",type:"literal",reference:lA,expects:Eh(n),async:!1,literal:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){return a.value===this.literal?a.typed=!0:yi(this,"type",a,r),a}}}function uA(n){return{kind:"schema",type:"number",reference:uA,expects:"number",async:!1,message:n,get"~standard"(){return Si(this)},"~run"(i,a){return typeof i.value=="number"&&!isNaN(i.value)?i.typed=!0:yi(this,"type",i,a),i}}}function Rh(n,i){return{kind:"schema",type:"object",reference:Rh,expects:"Object",async:!1,entries:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){const l=a.value;if(l&&typeof l=="object"){a.typed=!0,a.value={};for(const f in this.entries){const h=this.entries[f];if(f in l||(h.type==="exact_optional"||h.type==="optional"||h.type==="nullish")&&h.default!==void 0){const d=f in l?l[f]:Y0(h),m=h["~run"]({value:d},r);if(m.issues){const p={type:"object",origin:"value",input:l,key:f,value:d};for(const g of m.issues)g.path?g.path.unshift(p):g.path=[p],a.issues?.push(g);if(a.issues||(a.issues=m.issues),r.abortEarly){a.typed=!1;break}}m.typed||(a.typed=!1),a.value[f]=m.value}else if(h.fallback!==void 0)a.value[f]=aA(h);else if(h.type!=="exact_optional"&&h.type!=="optional"&&h.type!=="nullish"&&(yi(this,"key",a,r,{input:void 0,expected:`"${f}"`,path:[{type:"object",origin:"key",input:l,key:f,value:l[f]}]}),r.abortEarly))break}}else yi(this,"type",a,r);return a}}}function Ah(n,i){return{kind:"schema",type:"optional",reference:Ah,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,default:i,get"~standard"(){return Si(this)},"~run"(a,r){return a.value===void 0&&(this.default!==void 0&&(a.value=Y0(this,a,r)),a.value===void 0)?(a.typed=!0,a):this.wrapped["~run"](a,r)}}}function cA(n,i){return{kind:"schema",type:"picklist",reference:cA,expects:sA(n.map(Eh),"|"),async:!1,options:n,message:i,get"~standard"(){return Si(this)},"~run"(a,r){return this.options.includes(a.value)?a.typed=!0:yi(this,"type",a,r),a}}}function _h(n){return{kind:"schema",type:"string",reference:_h,expects:"string",async:!1,message:n,get"~standard"(){return Si(this)},"~run"(i,a){return typeof i.value=="string"?i.typed=!0:yi(this,"type",i,a),i}}}const Yg=n=>{let i;const a=new Set,r=(p,g)=>{const v=typeof p=="function"?p(i):p;if(!Object.is(v,i)){const S=i;i=g??(typeof v!="object"||v===null)?v:Object.assign({},i,v),a.forEach(T=>T(i,S))}},l=()=>i,d={setState:r,getState:l,getInitialState:()=>m,subscribe:p=>(a.add(p),()=>a.delete(p))},m=i=n(r,l,d);return d},fA=(n=>n?Yg(n):Yg),hA=n=>n;function dA(n,i=hA){const a=_t.useSyncExternalStore(n.subscribe,_t.useCallback(()=>i(n.getState()),[n,i]),_t.useCallback(()=>i(n.getInitialState()),[n,i]));return _t.useDebugValue(a),a}const mA=n=>{const i=fA(n),a=r=>dA(i,r);return Object.assign(a,i),a},Mh=(n=>mA);function Ch(n,i){let a;try{a=n()}catch{return}return{getItem:l=>{var f;const h=m=>m===null?null:JSON.parse(m,void 0),d=(f=a.getItem(l))!=null?f:null;return d instanceof Promise?d.then(h):h(d)},setItem:(l,f)=>a.setItem(l,JSON.stringify(f,void 0)),removeItem:l=>a.removeItem(l)}}const Pf=n=>i=>{try{const a=n(i);return a instanceof Promise?a:{then(r){return Pf(r)(a)},catch(r){return this}}}catch(a){return{then(r){return this},catch(r){return Pf(r)(a)}}}},pA=(n,i)=>(a,r,l)=>{let f={storage:Ch(()=>localStorage),partialize:_=>_,version:0,merge:(_,C)=>({...C,..._}),...i},h=!1;const d=new Set,m=new Set;let p=f.storage;if(!p)return n((..._)=>{console.warn(`[zustand persist middleware] Unable to update item '${f.name}', the given storage is currently unavailable.`),a(..._)},r,l);const g=()=>{const _=f.partialize({...r()});return p.setItem(f.name,{state:_,version:f.version})},v=l.setState;l.setState=(_,C)=>(v(_,C),g());const S=n((..._)=>(a(..._),g()),r,l);l.getInitialState=()=>S;let T;const E=()=>{var _,C;if(!p)return;h=!1,d.forEach(w=>{var V;return w((V=r())!=null?V:S)});const M=((C=f.onRehydrateStorage)==null?void 0:C.call(f,(_=r())!=null?_:S))||void 0;return Pf(p.getItem.bind(p))(f.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==f.version){if(f.migrate){const V=f.migrate(w.state,w.version);return V instanceof Promise?V.then(P=>[!0,P]):[!0,V]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,w.state];return[!1,void 0]}).then(w=>{var V;const[P,k]=w;if(T=f.merge(k,(V=r())!=null?V:S),a(T,!0),P)return g()}).then(()=>{M?.(T,void 0),T=r(),h=!0,m.forEach(w=>w(T))}).catch(w=>{M?.(void 0,w)})};return l.persist={setOptions:_=>{f={...f,..._},_.storage&&(p=_.storage)},clearStorage:()=>{p?.removeItem(f.name)},getOptions:()=>f,rehydrate:()=>E(),hasHydrated:()=>h,onHydrate:_=>(d.add(_),()=>{d.delete(_)}),onFinishHydration:_=>(m.add(_),()=>{m.delete(_)})},f.skipHydration||E(),T||S},F0=pA,yA="__new__",K0=n=>n??yA,k0=()=>({values:{},errors:{}}),Fg=(n,i)=>n[i]??k0(),Q0=Mh()(F0(n=>({forms:{},setSectionValue:(i,a,r)=>n(l=>{const f=Fg(l.forms,i);return{forms:{...l.forms,[i]:{...f,values:{...f.values,[a]:r}}}}}),setError:(i,a,r)=>n(l=>{const f=Fg(l.forms,i);return{forms:{...l.forms,[i]:{...f,errors:{...f.errors,[a]:r}}}}}),initializeForm:(i,a)=>n(r=>({forms:{...r.forms,[i]:{values:a,errors:{}}}})),resetForm:i=>n(a=>({forms:{...a.forms,[i]:k0()}}))}),{name:"design-docs-step-form",storage:Ch(()=>sessionStorage),partialize:n=>({forms:n.forms})})),gA=n=>{const i=Q0.getState().forms[n];return i==null||Object.keys(i.values).length===0},X0=({initialValues:n,formKey:i})=>{const a=K0(i);gA(a)&&Q0.getState().initializeForm(a,n)},vA=()=>To(()=>import("./index-CNZpX2BI.js"),__vite__mapDeps([7,1,8,5])),SA=Rh({step:Ah(_h())}),bA=pi("/scenarios/$scenarioId/docs/new/")({validateSearch:SA,loaderDeps:({search:n})=>({step:n.step}),loader:async({params:n,deps:i})=>{const a=await Ln.fetchQuery(zl(n.scenarioId)).catch(()=>{throw Qi()}),{steps:r}=a.scenario,l=i.step!=null?r.findIndex(d=>d.slug===i.step):-1,f=l!==-1?l:0,h=r[f];if(h==null)throw Qi();return X0({initialValues:a.formDefaultValues}),{stepIndex:f,prevStep:r[f-1],step:h,nextStep:r[f+1]}},component:bo(vA,"component")}),TA=async(n,i)=>{const a=await fetch(`/api/scenarios/${encodeURIComponent(n)}/docs/${encodeURIComponent(i)}`);if(!a.ok)throw new Error("Failed to fetch doc");return(await a.json()).doc},xA=(n,i)=>({queryKey:["scenarios",n,"docs",i],queryFn:()=>TA(n,i)}),Z0=Mh()(F0(n=>({previews:{},setPreviewContent:(i,a)=>n(r=>({previews:{...r.previews,[i]:a}})),initializePreview:(i,a)=>n(r=>({previews:{...r.previews,[i]:a}})),resetPreview:i=>n(a=>({previews:{...a.previews,[i]:null}}))}),{name:"design-docs-preview",storage:Ch(()=>sessionStorage),partialize:n=>({previews:n.previews})})),EA=n=>{const i=Z0.getState().previews;return!(n in i)},RA=({content:n,formKey:i})=>{const a=K0(i);EA(a)&&Z0.getState().initializePreview(a,n)},AA=()=>To(()=>import("./index-BB8YfLyh.js"),__vite__mapDeps([9,1,8,5])),_A=Rh({step:Ah(_h())}),MA=pi("/scenarios/$scenarioId/docs/$filename/")({validateSearch:_A,loaderDeps:({search:n})=>({step:n.step}),loader:async({params:n,deps:i})=>{const[a,r]=await Promise.all([Ln.fetchQuery(zl(n.scenarioId)),Ln.fetchQuery(xA(n.scenarioId,n.filename))]).catch(()=>{throw Qi()});if(r.metadata==null)throw Qi();const{steps:l}=a.scenario,f=i.step!=null?l.findIndex(p=>p.slug===i.step):-1,h=f!==-1?f:0,d=l[h];if(d==null)throw Qi();const m=n.filename;return X0({initialValues:r.metadata.formData,formKey:m}),RA({content:r.content,formKey:m}),{stepIndex:h,prevStep:l[h-1],step:d,nextStep:l[h+1]}},component:bo(AA,"component")}),CA=NR.update({id:"/",path:"/",getParentRoute:()=>Wi}),DA=FR.update({id:"/scenarios/",path:"/scenarios/",getParentRoute:()=>Wi}),wA=XR.update({id:"/scenarios/$scenarioId/",path:"/scenarios/$scenarioId/",getParentRoute:()=>Wi}),OA=JR.update({id:"/scenarios/$scenarioId/docs/",path:"/scenarios/$scenarioId/docs/",getParentRoute:()=>Wi}),LA=bA.update({id:"/scenarios/$scenarioId/docs/new/",path:"/scenarios/$scenarioId/docs/new/",getParentRoute:()=>Wi}),zA=MA.update({id:"/scenarios/$scenarioId/docs/$filename/",path:"/scenarios/$scenarioId/docs/$filename/",getParentRoute:()=>Wi}),VA={IndexRoute:CA,ScenariosIndexRoute:DA,ScenariosScenarioIdIndexRoute:wA,ScenariosScenarioIdDocsIndexRoute:OA,ScenariosScenarioIdDocsFilenameIndexRoute:zA,ScenariosScenarioIdDocsNewIndexRoute:LA},BA=Wi._addFileChildren(VA)._addFileTypes(),UA=Mh()(n=>({open:!1,message:"",variant:"info",showSnackbar:(i,a="info")=>n({open:!0,message:i,variant:a}),hideSnackbar:()=>n({open:!1})})),Dh=K.createContext({});function wh(n){const i=K.useRef(null);return i.current===null&&(i.current=n()),i.current}const Oh=typeof window<"u",J0=Oh?K.useLayoutEffect:K.useEffect,Vl=K.createContext(null);function Lh(n,i){n.indexOf(i)===-1&&n.push(i)}function zh(n,i){const a=n.indexOf(i);a>-1&&n.splice(a,1)}const zn=(n,i,a)=>a>i?i:a<n?n:a;let Vh=()=>{};const Vn={},I0=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function $0(n){return typeof n=="object"&&n!==null}const W0=n=>/^0[^.\s]+$/u.test(n);function Bh(n){let i;return()=>(i===void 0&&(i=n()),i)}const Xe=n=>n,jA=(n,i)=>a=>i(n(a)),xo=(...n)=>n.reduce(jA),mo=(n,i,a)=>{const r=i-n;return r===0?1:(a-n)/r};class Uh{constructor(){this.subscriptions=[]}add(i){return Lh(this.subscriptions,i),()=>zh(this.subscriptions,i)}notify(i,a,r){const l=this.subscriptions.length;if(l)if(l===1)this.subscriptions[0](i,a,r);else for(let f=0;f<l;f++){const h=this.subscriptions[f];h&&h(i,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ln=n=>n*1e3,ke=n=>n/1e3;function tS(n,i){return i?n*(1e3/i):0}const eS=(n,i,a)=>(((1-3*a+3*i)*n+(3*a-6*i))*n+3*i)*n,NA=1e-7,PA=12;function HA(n,i,a,r,l){let f,h,d=0;do h=i+(a-i)/2,f=eS(h,r,l)-n,f>0?a=h:i=h;while(Math.abs(f)>NA&&++d<PA);return h}function Eo(n,i,a,r){if(n===i&&a===r)return Xe;const l=f=>HA(f,0,1,n,a);return f=>f===0||f===1?f:eS(l(f),i,r)}const nS=n=>i=>i<=.5?n(2*i)/2:(2-n(2*(1-i)))/2,iS=n=>i=>1-n(1-i),sS=Eo(.33,1.53,.69,.99),jh=iS(sS),aS=nS(jh),oS=n=>(n*=2)<1?.5*jh(n):.5*(2-Math.pow(2,-10*(n-1))),Nh=n=>1-Math.sin(Math.acos(n)),rS=iS(Nh),lS=nS(Nh),qA=Eo(.42,0,1,1),GA=Eo(0,0,.58,1),uS=Eo(.42,0,.58,1),YA=n=>Array.isArray(n)&&typeof n[0]!="number",cS=n=>Array.isArray(n)&&typeof n[0]=="number",FA={linear:Xe,easeIn:qA,easeInOut:uS,easeOut:GA,circIn:Nh,circInOut:lS,circOut:rS,backIn:jh,backInOut:aS,backOut:sS,anticipate:oS},KA=n=>typeof n=="string",Kg=n=>{if(cS(n)){Vh(n.length===4);const[i,a,r,l]=n;return Eo(i,a,r,l)}else if(KA(n))return FA[n];return n},$r=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function kA(n,i){let a=new Set,r=new Set,l=!1,f=!1;const h=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function m(g){h.has(g)&&(p.schedule(g),n()),g(d)}const p={schedule:(g,v=!1,S=!1)=>{const E=S&&l?a:r;return v&&h.add(g),E.has(g)||E.add(g),g},cancel:g=>{r.delete(g),h.delete(g)},process:g=>{if(d=g,l){f=!0;return}l=!0,[a,r]=[r,a],a.forEach(m),a.clear(),l=!1,f&&(f=!1,p.process(g))}};return p}const QA=40;function fS(n,i){let a=!1,r=!0;const l={delta:0,timestamp:0,isProcessing:!1},f=()=>a=!0,h=$r.reduce((V,P)=>(V[P]=kA(f),V),{}),{setup:d,read:m,resolveKeyframes:p,preUpdate:g,update:v,preRender:S,render:T,postRender:E}=h,_=()=>{const V=Vn.useManualTiming?l.timestamp:performance.now();a=!1,Vn.useManualTiming||(l.delta=r?1e3/60:Math.max(Math.min(V-l.timestamp,QA),1)),l.timestamp=V,l.isProcessing=!0,d.process(l),m.process(l),p.process(l),g.process(l),v.process(l),S.process(l),T.process(l),E.process(l),l.isProcessing=!1,a&&i&&(r=!1,n(_))},C=()=>{a=!0,r=!0,l.isProcessing||n(_)};return{schedule:$r.reduce((V,P)=>{const k=h[P];return V[P]=(U,G=!1,H=!1)=>(a||C(),k.schedule(U,G,H)),V},{}),cancel:V=>{for(let P=0;P<$r.length;P++)h[$r[P]].cancel(V)},state:l,steps:h}}const{schedule:Nt,cancel:gi,state:re,steps:Sf}=fS(typeof requestAnimationFrame<"u"?requestAnimationFrame:Xe,!0);let sl;function XA(){sl=void 0}const be={now:()=>(sl===void 0&&be.set(re.isProcessing||Vn.useManualTiming?re.timestamp:performance.now()),sl),set:n=>{sl=n,queueMicrotask(XA)}},hS=n=>i=>typeof i=="string"&&i.startsWith(n),dS=hS("--"),ZA=hS("var(--"),Ph=n=>ZA(n)?JA.test(n.split("/*")[0].trim()):!1,JA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Is={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},po={...Is,transform:n=>zn(0,1,n)},Wr={...Is,default:1},ao=n=>Math.round(n*1e5)/1e5,Hh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function IA(n){return n==null}const $A=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qh=(n,i)=>a=>!!(typeof a=="string"&&$A.test(a)&&a.startsWith(n)||i&&!IA(a)&&Object.prototype.hasOwnProperty.call(a,i)),mS=(n,i,a)=>r=>{if(typeof r!="string")return r;const[l,f,h,d]=r.match(Hh);return{[n]:parseFloat(l),[i]:parseFloat(f),[a]:parseFloat(h),alpha:d!==void 0?parseFloat(d):1}},WA=n=>zn(0,255,n),bf={...Is,transform:n=>Math.round(WA(n))},Yi={test:qh("rgb","red"),parse:mS("red","green","blue"),transform:({red:n,green:i,blue:a,alpha:r=1})=>"rgba("+bf.transform(n)+", "+bf.transform(i)+", "+bf.transform(a)+", "+ao(po.transform(r))+")"};function t_(n){let i="",a="",r="",l="";return n.length>5?(i=n.substring(1,3),a=n.substring(3,5),r=n.substring(5,7),l=n.substring(7,9)):(i=n.substring(1,2),a=n.substring(2,3),r=n.substring(3,4),l=n.substring(4,5),i+=i,a+=a,r+=r,l+=l),{red:parseInt(i,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:l?parseInt(l,16)/255:1}}const Hf={test:qh("#"),parse:t_,transform:Yi.transform},Ro=n=>({test:i=>typeof i=="string"&&i.endsWith(n)&&i.split(" ").length===1,parse:parseFloat,transform:i=>`${i}${n}`}),ui=Ro("deg"),un=Ro("%"),ot=Ro("px"),e_=Ro("vh"),n_=Ro("vw"),kg={...un,parse:n=>un.parse(n)/100,transform:n=>un.transform(n*100)},qs={test:qh("hsl","hue"),parse:mS("hue","saturation","lightness"),transform:({hue:n,saturation:i,lightness:a,alpha:r=1})=>"hsla("+Math.round(n)+", "+un.transform(ao(i))+", "+un.transform(ao(a))+", "+ao(po.transform(r))+")"},It={test:n=>Yi.test(n)||Hf.test(n)||qs.test(n),parse:n=>Yi.test(n)?Yi.parse(n):qs.test(n)?qs.parse(n):Hf.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Yi.transform(n):qs.transform(n),getAnimatableNone:n=>{const i=It.parse(n);return i.alpha=0,It.transform(i)}},i_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function s_(n){return isNaN(n)&&typeof n=="string"&&(n.match(Hh)?.length||0)+(n.match(i_)?.length||0)>0}const pS="number",yS="color",a_="var",o_="var(",Qg="${}",r_=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function yo(n){const i=n.toString(),a=[],r={color:[],number:[],var:[]},l=[];let f=0;const d=i.replace(r_,m=>(It.test(m)?(r.color.push(f),l.push(yS),a.push(It.parse(m))):m.startsWith(o_)?(r.var.push(f),l.push(a_),a.push(m)):(r.number.push(f),l.push(pS),a.push(parseFloat(m))),++f,Qg)).split(Qg);return{values:a,split:d,indexes:r,types:l}}function gS(n){return yo(n).values}function vS(n){const{split:i,types:a}=yo(n),r=i.length;return l=>{let f="";for(let h=0;h<r;h++)if(f+=i[h],l[h]!==void 0){const d=a[h];d===pS?f+=ao(l[h]):d===yS?f+=It.transform(l[h]):f+=l[h]}return f}}const l_=n=>typeof n=="number"?0:It.test(n)?It.getAnimatableNone(n):n;function u_(n){const i=gS(n);return vS(n)(i.map(l_))}const vi={test:s_,parse:gS,createTransformer:vS,getAnimatableNone:u_};function Tf(n,i,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?n+(i-n)*6*a:a<1/2?i:a<2/3?n+(i-n)*(2/3-a)*6:n}function c_({hue:n,saturation:i,lightness:a,alpha:r}){n/=360,i/=100,a/=100;let l=0,f=0,h=0;if(!i)l=f=h=a;else{const d=a<.5?a*(1+i):a+i-a*i,m=2*a-d;l=Tf(m,d,n+1/3),f=Tf(m,d,n),h=Tf(m,d,n-1/3)}return{red:Math.round(l*255),green:Math.round(f*255),blue:Math.round(h*255),alpha:r}}function bl(n,i){return a=>a>0?i:n}const Ht=(n,i,a)=>n+(i-n)*a,xf=(n,i,a)=>{const r=n*n,l=a*(i*i-r)+r;return l<0?0:Math.sqrt(l)},f_=[Hf,Yi,qs],h_=n=>f_.find(i=>i.test(n));function Xg(n){const i=h_(n);if(!i)return!1;let a=i.parse(n);return i===qs&&(a=c_(a)),a}const Zg=(n,i)=>{const a=Xg(n),r=Xg(i);if(!a||!r)return bl(n,i);const l={...a};return f=>(l.red=xf(a.red,r.red,f),l.green=xf(a.green,r.green,f),l.blue=xf(a.blue,r.blue,f),l.alpha=Ht(a.alpha,r.alpha,f),Yi.transform(l))},qf=new Set(["none","hidden"]);function d_(n,i){return qf.has(n)?a=>a<=0?n:i:a=>a>=1?i:n}function m_(n,i){return a=>Ht(n,i,a)}function Gh(n){return typeof n=="number"?m_:typeof n=="string"?Ph(n)?bl:It.test(n)?Zg:g_:Array.isArray(n)?SS:typeof n=="object"?It.test(n)?Zg:p_:bl}function SS(n,i){const a=[...n],r=a.length,l=n.map((f,h)=>Gh(f)(f,i[h]));return f=>{for(let h=0;h<r;h++)a[h]=l[h](f);return a}}function p_(n,i){const a={...n,...i},r={};for(const l in a)n[l]!==void 0&&i[l]!==void 0&&(r[l]=Gh(n[l])(n[l],i[l]));return l=>{for(const f in r)a[f]=r[f](l);return a}}function y_(n,i){const a=[],r={color:0,var:0,number:0};for(let l=0;l<i.values.length;l++){const f=i.types[l],h=n.indexes[f][r[f]],d=n.values[h]??0;a[l]=d,r[f]++}return a}const g_=(n,i)=>{const a=vi.createTransformer(i),r=yo(n),l=yo(i);return r.indexes.var.length===l.indexes.var.length&&r.indexes.color.length===l.indexes.color.length&&r.indexes.number.length>=l.indexes.number.length?qf.has(n)&&!l.values.length||qf.has(i)&&!r.values.length?d_(n,i):xo(SS(y_(r,l),l.values),a):bl(n,i)};function bS(n,i,a){return typeof n=="number"&&typeof i=="number"&&typeof a=="number"?Ht(n,i,a):Gh(n)(n,i)}const v_=n=>{const i=({timestamp:a})=>n(a);return{start:(a=!0)=>Nt.update(i,a),stop:()=>gi(i),now:()=>re.isProcessing?re.timestamp:be.now()}},TS=(n,i,a=10)=>{let r="";const l=Math.max(Math.round(i/a),2);for(let f=0;f<l;f++)r+=Math.round(n(f/(l-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Tl=2e4;function Yh(n){let i=0;const a=50;let r=n.next(i);for(;!r.done&&i<Tl;)i+=a,r=n.next(i);return i>=Tl?1/0:i}function S_(n,i=100,a){const r=a({...n,keyframes:[0,i]}),l=Math.min(Yh(r),Tl);return{type:"keyframes",ease:f=>r.next(l*f).value/i,duration:ke(l)}}const b_=5;function xS(n,i,a){const r=Math.max(i-b_,0);return tS(a-n(r),i-r)}const Yt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ef=.001;function T_({duration:n=Yt.duration,bounce:i=Yt.bounce,velocity:a=Yt.velocity,mass:r=Yt.mass}){let l,f,h=1-i;h=zn(Yt.minDamping,Yt.maxDamping,h),n=zn(Yt.minDuration,Yt.maxDuration,ke(n)),h<1?(l=p=>{const g=p*h,v=g*n,S=g-a,T=Gf(p,h),E=Math.exp(-v);return Ef-S/T*E},f=p=>{const v=p*h*n,S=v*a+a,T=Math.pow(h,2)*Math.pow(p,2)*n,E=Math.exp(-v),_=Gf(Math.pow(p,2),h);return(-l(p)+Ef>0?-1:1)*((S-T)*E)/_}):(l=p=>{const g=Math.exp(-p*n),v=(p-a)*n+1;return-Ef+g*v},f=p=>{const g=Math.exp(-p*n),v=(a-p)*(n*n);return g*v});const d=5/n,m=E_(l,f,d);if(n=ln(n),isNaN(m))return{stiffness:Yt.stiffness,damping:Yt.damping,duration:n};{const p=Math.pow(m,2)*r;return{stiffness:p,damping:h*2*Math.sqrt(r*p),duration:n}}}const x_=12;function E_(n,i,a){let r=a;for(let l=1;l<x_;l++)r=r-n(r)/i(r);return r}function Gf(n,i){return n*Math.sqrt(1-i*i)}const R_=["duration","bounce"],A_=["stiffness","damping","mass"];function Jg(n,i){return i.some(a=>n[a]!==void 0)}function __(n){let i={velocity:Yt.velocity,stiffness:Yt.stiffness,damping:Yt.damping,mass:Yt.mass,isResolvedFromDuration:!1,...n};if(!Jg(n,A_)&&Jg(n,R_))if(n.visualDuration){const a=n.visualDuration,r=2*Math.PI/(a*1.2),l=r*r,f=2*zn(.05,1,1-(n.bounce||0))*Math.sqrt(l);i={...i,mass:Yt.mass,stiffness:l,damping:f}}else{const a=T_(n);i={...i,...a,mass:Yt.mass},i.isResolvedFromDuration=!0}return i}function xl(n=Yt.visualDuration,i=Yt.bounce){const a=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:i}:n;let{restSpeed:r,restDelta:l}=a;const f=a.keyframes[0],h=a.keyframes[a.keyframes.length-1],d={done:!1,value:f},{stiffness:m,damping:p,mass:g,duration:v,velocity:S,isResolvedFromDuration:T}=__({...a,velocity:-ke(a.velocity||0)}),E=S||0,_=p/(2*Math.sqrt(m*g)),C=h-f,M=ke(Math.sqrt(m/g)),w=Math.abs(C)<5;r||(r=w?Yt.restSpeed.granular:Yt.restSpeed.default),l||(l=w?Yt.restDelta.granular:Yt.restDelta.default);let V;if(_<1){const k=Gf(M,_);V=U=>{const G=Math.exp(-_*M*U);return h-G*((E+_*M*C)/k*Math.sin(k*U)+C*Math.cos(k*U))}}else if(_===1)V=k=>h-Math.exp(-M*k)*(C+(E+M*C)*k);else{const k=M*Math.sqrt(_*_-1);V=U=>{const G=Math.exp(-_*M*U),H=Math.min(k*U,300);return h-G*((E+_*M*C)*Math.sinh(H)+k*C*Math.cosh(H))/k}}const P={calculatedDuration:T&&v||null,next:k=>{const U=V(k);if(T)d.done=k>=v;else{let G=k===0?E:0;_<1&&(G=k===0?ln(E):xS(V,k,U));const H=Math.abs(G)<=r,Z=Math.abs(h-U)<=l;d.done=H&&Z}return d.value=d.done?h:U,d},toString:()=>{const k=Math.min(Yh(P),Tl),U=TS(G=>P.next(k*G).value,k,30);return k+"ms "+U},toTransition:()=>{}};return P}xl.applyToOptions=n=>{const i=S_(n,100,xl);return n.ease=i.ease,n.duration=ln(i.duration),n.type="keyframes",n};function Yf({keyframes:n,velocity:i=0,power:a=.8,timeConstant:r=325,bounceDamping:l=10,bounceStiffness:f=500,modifyTarget:h,min:d,max:m,restDelta:p=.5,restSpeed:g}){const v=n[0],S={done:!1,value:v},T=H=>d!==void 0&&H<d||m!==void 0&&H>m,E=H=>d===void 0?m:m===void 0||Math.abs(d-H)<Math.abs(m-H)?d:m;let _=a*i;const C=v+_,M=h===void 0?C:h(C);M!==C&&(_=M-v);const w=H=>-_*Math.exp(-H/r),V=H=>M+w(H),P=H=>{const Z=w(H),nt=V(H);S.done=Math.abs(Z)<=p,S.value=S.done?M:nt};let k,U;const G=H=>{T(S.value)&&(k=H,U=xl({keyframes:[S.value,E(S.value)],velocity:xS(V,H,S.value),damping:l,stiffness:f,restDelta:p,restSpeed:g}))};return G(0),{calculatedDuration:null,next:H=>{let Z=!1;return!U&&k===void 0&&(Z=!0,P(H),G(H)),k!==void 0&&H>=k?U.next(H-k):(!Z&&P(H),S)}}}function M_(n,i,a){const r=[],l=a||Vn.mix||bS,f=n.length-1;for(let h=0;h<f;h++){let d=l(n[h],n[h+1]);if(i){const m=Array.isArray(i)?i[h]||Xe:i;d=xo(m,d)}r.push(d)}return r}function C_(n,i,{clamp:a=!0,ease:r,mixer:l}={}){const f=n.length;if(Vh(f===i.length),f===1)return()=>i[0];if(f===2&&i[0]===i[1])return()=>i[1];const h=n[0]===n[1];n[0]>n[f-1]&&(n=[...n].reverse(),i=[...i].reverse());const d=M_(i,r,l),m=d.length,p=g=>{if(h&&g<n[0])return i[0];let v=0;if(m>1)for(;v<n.length-2&&!(g<n[v+1]);v++);const S=mo(n[v],n[v+1],g);return d[v](S)};return a?g=>p(zn(n[0],n[f-1],g)):p}function D_(n,i){const a=n[n.length-1];for(let r=1;r<=i;r++){const l=mo(0,i,r);n.push(Ht(a,1,l))}}function w_(n){const i=[0];return D_(i,n.length-1),i}function O_(n,i){return n.map(a=>a*i)}function L_(n,i){return n.map(()=>i||uS).splice(0,n.length-1)}function oo({duration:n=300,keyframes:i,times:a,ease:r="easeInOut"}){const l=YA(r)?r.map(Kg):Kg(r),f={done:!1,value:i[0]},h=O_(a&&a.length===i.length?a:w_(i),n),d=C_(h,i,{ease:Array.isArray(l)?l:L_(i,l)});return{calculatedDuration:n,next:m=>(f.value=d(m),f.done=m>=n,f)}}const z_=n=>n!==null;function Fh(n,{repeat:i,repeatType:a="loop"},r,l=1){const f=n.filter(z_),d=l<0||i&&a!=="loop"&&i%2===1?0:f.length-1;return!d||r===void 0?f[d]:r}const V_={decay:Yf,inertia:Yf,tween:oo,keyframes:oo,spring:xl};function ES(n){typeof n.type=="string"&&(n.type=V_[n.type])}class Kh{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(i=>{this.resolve=i})}notifyFinished(){this.resolve()}then(i,a){return this.finished.then(i,a)}}const B_=n=>n/100;class kh extends Kh{constructor(i){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:a}=this.options;a&&a.updatedAt!==be.now()&&this.tick(be.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=i,this.initAnimation(),this.play(),i.autoplay===!1&&this.pause()}initAnimation(){const{options:i}=this;ES(i);const{type:a=oo,repeat:r=0,repeatDelay:l=0,repeatType:f,velocity:h=0}=i;let{keyframes:d}=i;const m=a||oo;m!==oo&&typeof d[0]!="number"&&(this.mixKeyframes=xo(B_,bS(d[0],d[1])),d=[0,100]);const p=m({...i,keyframes:d});f==="mirror"&&(this.mirroredGenerator=m({...i,keyframes:[...d].reverse(),velocity:-h})),p.calculatedDuration===null&&(p.calculatedDuration=Yh(p));const{calculatedDuration:g}=p;this.calculatedDuration=g,this.resolvedDuration=g+l,this.totalDuration=this.resolvedDuration*(r+1)-l,this.generator=p}updateTime(i){const a=Math.round(i-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=a}tick(i,a=!1){const{generator:r,totalDuration:l,mixKeyframes:f,mirroredGenerator:h,resolvedDuration:d,calculatedDuration:m}=this;if(this.startTime===null)return r.next(0);const{delay:p=0,keyframes:g,repeat:v,repeatType:S,repeatDelay:T,type:E,onUpdate:_,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,i):this.speed<0&&(this.startTime=Math.min(i-l/this.speed,this.startTime)),a?this.currentTime=i:this.updateTime(i);const M=this.currentTime-p*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?M<0:M>l;this.currentTime=Math.max(M,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=l);let V=this.currentTime,P=r;if(v){const H=Math.min(this.currentTime,l)/d;let Z=Math.floor(H),nt=H%1;!nt&&H>=1&&(nt=1),nt===1&&Z--,Z=Math.min(Z,v+1),Z%2&&(S==="reverse"?(nt=1-nt,T&&(nt-=T/d)):S==="mirror"&&(P=h)),V=zn(0,1,nt)*d}const k=w?{done:!1,value:g[0]}:P.next(V);f&&(k.value=f(k.value));let{done:U}=k;!w&&m!==null&&(U=this.playbackSpeed>=0?this.currentTime>=l:this.currentTime<=0);const G=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return G&&E!==Yf&&(k.value=Fh(g,this.options,C,this.speed)),_&&_(k.value),G&&this.finish(),k}then(i,a){return this.finished.then(i,a)}get duration(){return ke(this.calculatedDuration)}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+ke(i)}get time(){return ke(this.currentTime)}set time(i){i=ln(i),this.currentTime=i,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=i:this.driver&&(this.startTime=this.driver.now()-i/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(i){this.updateTime(be.now());const a=this.playbackSpeed!==i;this.playbackSpeed=i,a&&(this.time=ke(this.currentTime))}play(){if(this.isStopped)return;const{driver:i=v_,startTime:a}=this.options;this.driver||(this.driver=i(l=>this.tick(l))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=a??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(be.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(i){return this.startTime=0,this.tick(i,!0)}attachTimeline(i){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),i.observe(this)}}function U_(n){for(let i=1;i<n.length;i++)n[i]??(n[i]=n[i-1])}const Fi=n=>n*180/Math.PI,Ff=n=>{const i=Fi(Math.atan2(n[1],n[0]));return Kf(i)},j_={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Ff,rotateZ:Ff,skewX:n=>Fi(Math.atan(n[1])),skewY:n=>Fi(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Kf=n=>(n=n%360,n<0&&(n+=360),n),Ig=Ff,$g=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),Wg=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),N_={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$g,scaleY:Wg,scale:n=>($g(n)+Wg(n))/2,rotateX:n=>Kf(Fi(Math.atan2(n[6],n[5]))),rotateY:n=>Kf(Fi(Math.atan2(-n[2],n[0]))),rotateZ:Ig,rotate:Ig,skewX:n=>Fi(Math.atan(n[4])),skewY:n=>Fi(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function kf(n){return n.includes("scale")?1:0}function Qf(n,i){if(!n||n==="none")return kf(i);const a=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,l;if(a)r=N_,l=a;else{const d=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=j_,l=d}if(!l)return kf(i);const f=r[i],h=l[1].split(",").map(H_);return typeof f=="function"?f(h):h[f]}const P_=(n,i)=>{const{transform:a="none"}=getComputedStyle(n);return Qf(a,i)};function H_(n){return parseFloat(n.trim())}const $s=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ws=new Set($s),tv=n=>n===Is||n===ot,q_=new Set(["x","y","z"]),G_=$s.filter(n=>!q_.has(n));function Y_(n){const i=[];return G_.forEach(a=>{const r=n.getValue(a);r!==void 0&&(i.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),i}const Zi={width:({x:n},{paddingLeft:i="0",paddingRight:a="0"})=>n.max-n.min-parseFloat(i)-parseFloat(a),height:({y:n},{paddingTop:i="0",paddingBottom:a="0"})=>n.max-n.min-parseFloat(i)-parseFloat(a),top:(n,{top:i})=>parseFloat(i),left:(n,{left:i})=>parseFloat(i),bottom:({y:n},{top:i})=>parseFloat(i)+(n.max-n.min),right:({x:n},{left:i})=>parseFloat(i)+(n.max-n.min),x:(n,{transform:i})=>Qf(i,"x"),y:(n,{transform:i})=>Qf(i,"y")};Zi.translateX=Zi.x;Zi.translateY=Zi.y;const Ji=new Set;let Xf=!1,Zf=!1,Jf=!1;function RS(){if(Zf){const n=Array.from(Ji).filter(r=>r.needsMeasurement),i=new Set(n.map(r=>r.element)),a=new Map;i.forEach(r=>{const l=Y_(r);l.length&&(a.set(r,l),r.render())}),n.forEach(r=>r.measureInitialState()),i.forEach(r=>{r.render();const l=a.get(r);l&&l.forEach(([f,h])=>{r.getValue(f)?.set(h)})}),n.forEach(r=>r.measureEndState()),n.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zf=!1,Xf=!1,Ji.forEach(n=>n.complete(Jf)),Ji.clear()}function AS(){Ji.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Zf=!0)})}function F_(){Jf=!0,AS(),RS(),Jf=!1}class Qh{constructor(i,a,r,l,f,h=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...i],this.onComplete=a,this.name=r,this.motionValue=l,this.element=f,this.isAsync=h}scheduleResolve(){this.state="scheduled",this.isAsync?(Ji.add(this),Xf||(Xf=!0,Nt.read(AS),Nt.resolveKeyframes(RS))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:i,name:a,element:r,motionValue:l}=this;if(i[0]===null){const f=l?.get(),h=i[i.length-1];if(f!==void 0)i[0]=f;else if(r&&a){const d=r.readValue(a,h);d!=null&&(i[0]=d)}i[0]===void 0&&(i[0]=h),l&&f===void 0&&l.set(i[0])}U_(i)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(i=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,i),Ji.delete(this)}cancel(){this.state==="scheduled"&&(Ji.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const K_=n=>n.startsWith("--");function k_(n,i,a){K_(i)?n.style.setProperty(i,a):n.style[i]=a}const Q_=Bh(()=>window.ScrollTimeline!==void 0),X_={};function Z_(n,i){const a=Bh(n);return()=>X_[i]??a()}const _S=Z_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),eo=([n,i,a,r])=>`cubic-bezier(${n}, ${i}, ${a}, ${r})`,ev={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:eo([0,.65,.55,1]),circOut:eo([.55,0,1,.45]),backIn:eo([.31,.01,.66,-.59]),backOut:eo([.33,1.53,.69,.99])};function MS(n,i){if(n)return typeof n=="function"?_S()?TS(n,i):"ease-out":cS(n)?eo(n):Array.isArray(n)?n.map(a=>MS(a,i)||ev.easeOut):ev[n]}function J_(n,i,a,{delay:r=0,duration:l=300,repeat:f=0,repeatType:h="loop",ease:d="easeOut",times:m}={},p=void 0){const g={[i]:a};m&&(g.offset=m);const v=MS(d,l);Array.isArray(v)&&(g.easing=v);const S={delay:r,duration:l,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:f+1,direction:h==="reverse"?"alternate":"normal"};return p&&(S.pseudoElement=p),n.animate(g,S)}function CS(n){return typeof n=="function"&&"applyToOptions"in n}function I_({type:n,...i}){return CS(n)&&_S()?n.applyToOptions(i):(i.duration??(i.duration=300),i.ease??(i.ease="easeOut"),i)}class $_ extends Kh{constructor(i){if(super(),this.finishedTime=null,this.isStopped=!1,!i)return;const{element:a,name:r,keyframes:l,pseudoElement:f,allowFlatten:h=!1,finalKeyframe:d,onComplete:m}=i;this.isPseudoElement=!!f,this.allowFlatten=h,this.options=i,Vh(typeof i.type!="string");const p=I_(i);this.animation=J_(a,r,l,p,f),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!f){const g=Fh(l,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(g):k_(a,r,g),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:i}=this;i==="idle"||i==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const i=this.animation.effect?.getComputedTiming?.().duration||0;return ke(Number(i))}get iterationDuration(){const{delay:i=0}=this.options||{};return this.duration+ke(i)}get time(){return ke(Number(this.animation.currentTime)||0)}set time(i){this.finishedTime=null,this.animation.currentTime=ln(i)}get speed(){return this.animation.playbackRate}set speed(i){i<0&&(this.finishedTime=null),this.animation.playbackRate=i}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(i){this.animation.startTime=i}attachTimeline({timeline:i,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,i&&Q_()?(this.animation.timeline=i,Xe):a(this)}}const DS={anticipate:oS,backInOut:aS,circInOut:lS};function W_(n){return n in DS}function tM(n){typeof n.ease=="string"&&W_(n.ease)&&(n.ease=DS[n.ease])}const nv=10;class eM extends $_{constructor(i){tM(i),ES(i),super(i),i.startTime&&(this.startTime=i.startTime),this.options=i}updateMotionValue(i){const{motionValue:a,onUpdate:r,onComplete:l,element:f,...h}=this.options;if(!a)return;if(i!==void 0){a.set(i);return}const d=new kh({...h,autoplay:!1}),m=ln(this.finishedTime??this.time);a.setWithVelocity(d.sample(m-nv).value,d.sample(m).value,nv),d.stop()}}const iv=(n,i)=>i==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(vi.test(n)||n==="0")&&!n.startsWith("url("));function nM(n){const i=n[0];if(n.length===1)return!0;for(let a=0;a<n.length;a++)if(n[a]!==i)return!0}function iM(n,i,a,r){const l=n[0];if(l===null)return!1;if(i==="display"||i==="visibility")return!0;const f=n[n.length-1],h=iv(l,i),d=iv(f,i);return!h||!d?!1:nM(n)||(a==="spring"||CS(a))&&r}function If(n){n.duration=0,n.type="keyframes"}const sM=new Set(["opacity","clipPath","filter","transform"]),aM=Bh(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oM(n){const{motionValue:i,name:a,repeatDelay:r,repeatType:l,damping:f,type:h}=n;if(!(i?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:p}=i.owner.getProps();return aM()&&a&&sM.has(a)&&(a!=="transform"||!p)&&!m&&!r&&l!=="mirror"&&f!==0&&h!=="inertia"}const rM=40;class lM extends Kh{constructor({autoplay:i=!0,delay:a=0,type:r="keyframes",repeat:l=0,repeatDelay:f=0,repeatType:h="loop",keyframes:d,name:m,motionValue:p,element:g,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=be.now();const S={autoplay:i,delay:a,type:r,repeat:l,repeatDelay:f,repeatType:h,name:m,motionValue:p,element:g,...v},T=g?.KeyframeResolver||Qh;this.keyframeResolver=new T(d,(E,_,C)=>this.onKeyframesResolved(E,_,S,!C),m,p,g),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(i,a,r,l){this.keyframeResolver=void 0;const{name:f,type:h,velocity:d,delay:m,isHandoff:p,onUpdate:g}=r;this.resolvedAt=be.now(),iM(i,f,h,d)||((Vn.instantAnimations||!m)&&g?.(Fh(i,r,a)),i[0]=i[i.length-1],If(r),r.repeat=0);const S={startTime:l?this.resolvedAt?this.resolvedAt-this.createdAt>rM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:a,...r,keyframes:i},T=!p&&oM(S)?new eM({...S,element:S.motionValue.owner.current}):new kh(S);T.finished.then(()=>this.notifyFinished()).catch(Xe),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(i,a){return this.finished.finally(i).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),F_()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(i){this.animation.time=i}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(i){this.animation.speed=i}get startTime(){return this.animation.startTime}attachTimeline(i){return this._animation?this.stopTimeline=this.animation.attachTimeline(i):this.pendingTimeline=i,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const uM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cM(n){const i=uM.exec(n);if(!i)return[,];const[,a,r,l]=i;return[`--${a??r}`,l]}function wS(n,i,a=1){const[r,l]=cM(n);if(!r)return;const f=window.getComputedStyle(i).getPropertyValue(r);if(f){const h=f.trim();return I0(h)?parseFloat(h):h}return Ph(l)?wS(l,i,a+1):l}function Xh(n,i){return n?.[i]??n?.default??n}const OS=new Set(["width","height","top","left","right","bottom",...$s]),fM={test:n=>n==="auto",parse:n=>n},LS=n=>i=>i.test(n),zS=[Is,ot,un,ui,n_,e_,fM],sv=n=>zS.find(LS(n));function hM(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||W0(n):!0}const dM=new Set(["brightness","contrast","saturate","opacity"]);function mM(n){const[i,a]=n.slice(0,-1).split("(");if(i==="drop-shadow")return n;const[r]=a.match(Hh)||[];if(!r)return n;const l=a.replace(r,"");let f=dM.has(i)?1:0;return r!==a&&(f*=100),i+"("+f+l+")"}const pM=/\b([a-z-]*)\(.*?\)/gu,$f={...vi,getAnimatableNone:n=>{const i=n.match(pM);return i?i.map(mM).join(" "):n}},av={...Is,transform:Math.round},yM={rotate:ui,rotateX:ui,rotateY:ui,rotateZ:ui,scale:Wr,scaleX:Wr,scaleY:Wr,scaleZ:Wr,skew:ui,skewX:ui,skewY:ui,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:po,originX:kg,originY:kg,originZ:ot},Zh={borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,backgroundPositionX:ot,backgroundPositionY:ot,...yM,zIndex:av,fillOpacity:po,strokeOpacity:po,numOctaves:av},gM={...Zh,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:$f,WebkitFilter:$f},VS=n=>gM[n];function BS(n,i){let a=VS(n);return a!==$f&&(a=vi),a.getAnimatableNone?a.getAnimatableNone(i):void 0}const vM=new Set(["auto","none","0"]);function SM(n,i,a){let r=0,l;for(;r<n.length&&!l;){const f=n[r];typeof f=="string"&&!vM.has(f)&&yo(f).values.length&&(l=n[r]),r++}if(l&&a)for(const f of i)n[f]=BS(a,l)}class bM extends Qh{constructor(i,a,r,l,f){super(i,a,r,l,f,!0)}readKeyframes(){const{unresolvedKeyframes:i,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let m=0;m<i.length;m++){let p=i[m];if(typeof p=="string"&&(p=p.trim(),Ph(p))){const g=wS(p,a.current);g!==void 0&&(i[m]=g),m===i.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!OS.has(r)||i.length!==2)return;const[l,f]=i,h=sv(l),d=sv(f);if(h!==d)if(tv(h)&&tv(d))for(let m=0;m<i.length;m++){const p=i[m];typeof p=="string"&&(i[m]=parseFloat(p))}else Zi[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:i,name:a}=this,r=[];for(let l=0;l<i.length;l++)(i[l]===null||hM(i[l]))&&r.push(l);r.length&&SM(i,r,a)}measureInitialState(){const{element:i,unresolvedKeyframes:a,name:r}=this;if(!i||!i.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Zi[r](i.measureViewportBox(),window.getComputedStyle(i.current)),a[0]=this.measuredOrigin;const l=a[a.length-1];l!==void 0&&i.getValue(r,l).jump(l,!1)}measureEndState(){const{element:i,name:a,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const l=i.getValue(a);l&&l.jump(this.measuredOrigin,!1);const f=r.length-1,h=r[f];r[f]=Zi[a](i.measureViewportBox(),window.getComputedStyle(i.current)),h!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=h),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,m])=>{i.getValue(d).set(m)}),this.resolveNoneKeyframes()}}function TM(n,i,a){if(n instanceof EventTarget)return[n];if(typeof n=="string"){let r=document;const l=a?.[n]??r.querySelectorAll(n);return l?Array.from(l):[]}return Array.from(n)}const US=(n,i)=>i&&typeof n=="number"?i.transform(n):n;function jS(n){return $0(n)&&"offsetHeight"in n}const ov=30,xM=n=>!isNaN(parseFloat(n));class EM{constructor(i,a={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const l=be.now();if(this.updatedAt!==l&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const f of this.dependents)f.dirty()},this.hasAnimated=!1,this.setCurrent(i),this.owner=a.owner}setCurrent(i){this.current=i,this.updatedAt=be.now(),this.canTrackVelocity===null&&i!==void 0&&(this.canTrackVelocity=xM(this.current))}setPrevFrameValue(i=this.current){this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt}onChange(i){return this.on("change",i)}on(i,a){this.events[i]||(this.events[i]=new Uh);const r=this.events[i].add(a);return i==="change"?()=>{r(),Nt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const i in this.events)this.events[i].clear()}attach(i,a){this.passiveEffect=i,this.stopPassiveEffect=a}set(i){this.passiveEffect?this.passiveEffect(i,this.updateAndNotify):this.updateAndNotify(i)}setWithVelocity(i,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=i,this.prevUpdatedAt=this.updatedAt-r}jump(i,a=!0){this.updateAndNotify(i),this.prev=i,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(i){this.dependents||(this.dependents=new Set),this.dependents.add(i)}removeDependent(i){this.dependents&&this.dependents.delete(i)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const i=be.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||i-this.updatedAt>ov)return 0;const a=Math.min(this.updatedAt-this.prevUpdatedAt,ov);return tS(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(i){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=i(a),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Zs(n,i){return new EM(n,i)}const{schedule:Jh}=fS(queueMicrotask,!1),tn={x:!1,y:!1};function NS(){return tn.x||tn.y}function RM(n){return n==="x"||n==="y"?tn[n]?null:(tn[n]=!0,()=>{tn[n]=!1}):tn.x||tn.y?null:(tn.x=tn.y=!0,()=>{tn.x=tn.y=!1})}function PS(n,i){const a=TM(n),r=new AbortController,l={passive:!0,...i,signal:r.signal};return[a,l,()=>r.abort()]}function rv(n){return!(n.pointerType==="touch"||NS())}function AM(n,i,a={}){const[r,l,f]=PS(n,a),h=d=>{if(!rv(d))return;const{target:m}=d,p=i(m,d);if(typeof p!="function"||!m)return;const g=v=>{rv(v)&&(p(v),m.removeEventListener("pointerleave",g))};m.addEventListener("pointerleave",g,l)};return r.forEach(d=>{d.addEventListener("pointerenter",h,l)}),f}const HS=(n,i)=>i?n===i?!0:HS(n,i.parentElement):!1,Ih=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,_M=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function MM(n){return _M.has(n.tagName)||n.tabIndex!==-1}const al=new WeakSet;function lv(n){return i=>{i.key==="Enter"&&n(i)}}function Rf(n,i){n.dispatchEvent(new PointerEvent("pointer"+i,{isPrimary:!0,bubbles:!0}))}const CM=(n,i)=>{const a=n.currentTarget;if(!a)return;const r=lv(()=>{if(al.has(a))return;Rf(a,"down");const l=lv(()=>{Rf(a,"up")}),f=()=>Rf(a,"cancel");a.addEventListener("keyup",l,i),a.addEventListener("blur",f,i)});a.addEventListener("keydown",r,i),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),i)};function uv(n){return Ih(n)&&!NS()}function DM(n,i,a={}){const[r,l,f]=PS(n,a),h=d=>{const m=d.currentTarget;if(!uv(d))return;al.add(m);const p=i(m,d),g=(T,E)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",S),al.has(m)&&al.delete(m),uv(T)&&typeof p=="function"&&p(T,{success:E})},v=T=>{g(T,m===window||m===document||a.useGlobalTarget||HS(m,T.target))},S=T=>{g(T,!1)};window.addEventListener("pointerup",v,l),window.addEventListener("pointercancel",S,l)};return r.forEach(d=>{(a.useGlobalTarget?window:d).addEventListener("pointerdown",h,l),jS(d)&&(d.addEventListener("focus",p=>CM(p,l)),!MM(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),f}function qS(n){return $0(n)&&"ownerSVGElement"in n}function wM(n){return qS(n)&&n.tagName==="svg"}const ue=n=>!!(n&&n.getVelocity),OM=[...zS,It,vi],LM=n=>OM.find(LS(n)),$h=K.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function cv(n,i){if(typeof n=="function")return n(i);n!=null&&(n.current=i)}function zM(...n){return i=>{let a=!1;const r=n.map(l=>{const f=cv(l,i);return!a&&typeof f=="function"&&(a=!0),f});if(a)return()=>{for(let l=0;l<r.length;l++){const f=r[l];typeof f=="function"?f():cv(n[l],null)}}}}function VM(...n){return K.useCallback(zM(...n),n)}class BM extends K.Component{getSnapshotBeforeUpdate(i){const a=this.props.childRef.current;if(a&&i.isPresent&&!this.props.isPresent){const r=a.offsetParent,l=jS(r)&&r.offsetWidth||0,f=this.props.sizeRef.current;f.height=a.offsetHeight||0,f.width=a.offsetWidth||0,f.top=a.offsetTop,f.left=a.offsetLeft,f.right=l-f.width-f.left}return null}componentDidUpdate(){}render(){return this.props.children}}function UM({children:n,isPresent:i,anchorX:a,root:r}){const l=K.useId(),f=K.useRef(null),h=K.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:d}=K.useContext($h),m=VM(f,n?.ref);return K.useInsertionEffect(()=>{const{width:p,height:g,top:v,left:S,right:T}=h.current;if(i||!f.current||!p||!g)return;const E=a==="left"?`left: ${S}`:`right: ${T}`;f.current.dataset.motionPopId=l;const _=document.createElement("style");d&&(_.nonce=d);const C=r??document.head;return C.appendChild(_),_.sheet&&_.sheet.insertRule(`
19
19
  [data-motion-pop-id="${l}"] {
20
20
  position: absolute !important;
21
21
  width: ${p}px !important;