@flinbein/pappai-web 0.1.3 → 0.1.4

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/view-COZX9gMP.js","assets/view-C1Xd5xfT.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/view-DaMjbXs2.js","assets/view-DQzeAZI2.css"])))=>i.map(i=>d[i]);
2
2
  var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=M(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var oe={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),P=Symbol.for(`react.legacy_hidden`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.for(`react.view_transition`),ue=Symbol.for(`react.recoverable`),de=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=de&&e[de]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case le:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function L(e,t){ve++,_e[ve]=e.current,e.current=t}var xe=ye(null),Se=ye(null),Ce=ye(null),we=ye(null);function Te(e,t){switch(L(Ce,t),L(Se,e),L(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(xe),L(xe,e)}function Ee(){be(xe),be(Se),be(Ce)}function De(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,L(we,e)),t=xe.current;var n=dp(t,e.type);t!==n&&(L(Se,e),L(xe,n))}function Oe(e){Se.current===e&&(be(xe),be(Se)),we.current===e&&(be(we),sh._currentValue=ge)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+ke+e+Ae}var Me=!1;function Ne(e,t){if(!e||Me)return``;Me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -10,4 +10,4 @@ Error generating stack: `+e.message+`
10
10
  `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),a=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(R=!0),p=a;break;case`defaultValue`:a!==o&&(R=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[Ct]=r,n[wt]=t,np(n,e,t),Lt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=I.d;I.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?tc(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=It(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Lt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Ce.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+rn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),np(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+rn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},po(a),e}function uh(e){return e?(e=ji,e):ji}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=ho(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=go(e,r,t),n!==null&&(Pd(n,e,t),_o(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=vt(t);var n=Oi(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function vh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(K&6)&&(gd=Ve()+500,Df(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=xn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,$s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Tt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Xe=Jh.inject(qh),Ze=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Sc,s=Cc,c=wc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Tt]=t.current,Wf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=e=>{throw TypeError(e)},y=(e,t,n)=>t.has(e)||v(`Cannot `+n),b=(e,t,n)=>(y(e,t,`read from private field`),n?n.call(e):t.get(e)),x=(e,t,n)=>t.has(e)?v(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),S=(e,t,n,r)=>(y(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function T(e,t){return t+e.replace(/\\/g,`/`)}var E=`popstate`;function D(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function O(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return te(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:M(t)}return ne(t,n,null,e)}function k(e,t){if(e===!1||e==null)throw Error(t)}function A(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function j(){return Math.random().toString(36).substring(2,10)}function ee(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function te(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?N(t):t,state:n,key:t&&t.key||r||j(),mask:i}}function M({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function N(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ne(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=D(e)?e:te(h.location,e,t);n&&n(r,e),l=u()+1;let d=ee(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=D(e)?e:te(h.location,e,t);n&&n(r,e),l=u();let i=ee(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return re(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(E,d),c=e,()=>{i.removeEventListener(E,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function re(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),k(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:M(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}var ie=new URL(`http://localhost`);function ae(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ie)}catch{return ie}}function oe(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function se(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function P(e){let t=e.replace(/[\t\n\r]/g,``),n=0;for(;t.charCodeAt(n)<=32;)n++;if(t=t.slice(n),!C.test(t))return;let r;try{r=new URL(e,ie)}catch{return}if(!se(e,r))throw Error(`External navigation is not allowed`)}function ce(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!oe(i,n),s=!oe(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!se(e,i)||!oe(i,a)))throw Error(`External navigation is not allowed`)}var le,ue=class{constructor(e){if(x(this,le,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(b(this,le).has(e))return b(this,le).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){b(this,le).set(e,t)}};le=new WeakMap;var de=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function fe(e){return de.has(e)}var pe=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function me(e){return pe.has(e)}function he(e){return e.index===!0}function F(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(k(e.index!==!0||!e.children,`Cannot specify children on an index route`),k(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),he(e)){let n={...e,id:s};return r[s]=I(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=I(n,t(n)),e.children&&(n.children=F(e.children,t,o,r,i)),n}})}function I(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ge(e,t,n=`/`){return _e(e,t,n,!1)}function _e(e,t,n,r,i){let a=Ie((typeof t==`string`?N(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ye(e),s=null,c=Fe(a);for(let e=0;s==null&&e<o.length;++e)s=je(o[e],c,r);return s}function ve(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ye(e){let t=be(e);return xe(t),t}function be(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;k(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ke([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(k(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),be(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ke(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Pe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of L(e.path))a(e,t,!0,n)}),t}function L(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=L(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function xe(e){e.sort((e,t)=>e.score===t.score?Ae(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Se=/^:[\w-]+$/,Ce=3,we=2,Te=1,Ee=10,De=-2,Oe=e=>e===`*`;function ke(e,t){let n=e.split(`/`),r=n.length;return n.some(Oe)&&(r+=De),t&&(r+=we),n.filter(e=>!Oe(e)).reduce((e,t)=>e+(Se.test(t)?Ce:t===``?Te:Ee),r)}function Ae(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function je(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Ne(u,l,s.matcher,s.compiledParams):Me(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Me({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ke([a,d.pathname]),pathnameBase:Je(Ke([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ke([a,d.pathnameBase]))}return o}function Me(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Pe(e.path,e.caseSensitive,e.end);return Ne(e,t,n,r)}function Ne(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=qe(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=qe(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Pe(e,t=!1,n=!0){A(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Fe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return A(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ie(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Le({basename:e,pathname:t}){return t===`/`?e:Ke([e,t])}var Re=e=>C.test(e);function ze(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?N(e):e,a;return n?(n=Ge(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Be(n.substring(1),`/`):Be(n,t)):a=t,{pathname:a,search:Ye(r),hash:Xe(i)}}function Be(e,t){let n=qe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ve(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function He(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ue(e){let t=He(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function We(e,t,n,r=!1){let i;typeof e==`string`?i=N(e):(i={...e},k(!i.pathname||!i.pathname.includes(`?`),Ve(`?`,`pathname`,`search`,i)),k(!i.pathname||!i.pathname.includes(`#`),Ve(`#`,`pathname`,`hash`,i)),k(!i.search||!i.search.includes(`#`),Ve(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ze(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ge=e=>e.replace(/[\\/]{2,}/g,`/`),Ke=e=>Ge(e.join(`/`));function qe(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Je=e=>qe(e).replace(/^\/*/,`/`),Ye=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Xe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ze=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Qe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function $e(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function et(e){return Ke(e.map(e=>e.route.path).filter(Boolean))||`/`}var tt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function nt(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(tt)try{let e=new URL(window.location.href),r=w.test(n)?new URL(T(n,e.protocol)):new URL(n),a=Ie(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{A(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var rt=Symbol(`Uninstrumented`);function it(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=ot(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=ot(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[rt]??i,a=ot(n[e],t,(...e)=>ct(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[rt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[rt]??e,r=ot(n.middleware,t,(...e)=>ct(e[0]));return r?(r[rt]=t,r):e})),r}function at(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[rt]??e.navigate,r=ot(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?M(n):`.`,...lt(e,r??{})}});r&&(r[rt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[rt]??e.fetch,r=ot(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...lt(e,i??{})}});r&&(r[rt]=t,e.fetch=r)}return e}function ot(e,t,n){return e.length===0?null:async(...r)=>{let i=await st(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function st(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=st(e,t,n,r-1),a=await o,k(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function ct(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:ut(t),params:{...r},pattern:i,context:dt(n)}}function lt(e,t){return{currentUrl:M(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ut(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function dt(e){if(pt(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var ft=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function pt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===ft}var mt=[`POST`,`PUT`,`PATCH`,`DELETE`],ht=new Set(mt),gt=[`GET`,...mt],_t=new Set(gt),vt=new Set([301,302,303,307,308]),yt=new Set([307,308]),bt={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},St={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Ct=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),wt=`remix-router-transitions`,Tt=Symbol(`ResetLoaderData`),Et,Dt,Ot,kt,At=class{constructor(e){x(this,Et),x(this,Dt),x(this,Ot),x(this,kt),S(this,Et,e),S(this,Dt,ye(e))}get stableRoutes(){return b(this,Et)}get activeRoutes(){return b(this,Ot)??b(this,Et)}get branches(){return b(this,kt)??b(this,Dt)}get hasHMRRoutes(){return b(this,Ot)!=null}setRoutes(e){S(this,Et,e),S(this,Dt,ye(e))}setHmrRoutes(e){S(this,Ot,e),S(this,kt,ye(e))}commitHmrRoutes(){b(this,Ot)&&(S(this,Et,b(this,Ot)),S(this,Dt,b(this,kt)),S(this,Ot,void 0),S(this,kt,void 0))}};Et=new WeakMap,Dt=new WeakMap,Ot=new WeakMap,kt=new WeakMap;function jt(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;k(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Ct,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...it(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new At(F(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||qt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=_e(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=yn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=vn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&lt(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=lt(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>It(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=Lt(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,T={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:bt,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},E=`POP`,D=null,O=!1,j,ee=!1,ne=new Map,ie=null,ae=!1,oe=!1,se=new Set,P=new Map,le=0,de=-1,fe=new Map,pe=new Set,me=new Map,he=new Map,I=new Set,ge=new Map,ye,be=null;function L(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(ye){ye(),ye=void 0;return}A(ge.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=tt({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ye=e});e.history.go(r*-1),et(i,{state:`blocked`,location:n,proceed(){et(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(T.blockers);e.set(i,St),Ce({blockers:e})}}),D?.resolve(),D=null}else return De(t,n)}),n){Un(t,ne);let e=()=>Wn(t,ne);t.addEventListener(`pagehide`,e),ie=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||De(`POP`,T.location,{initialHydration:!0}),C}function xe(){d&&d(),ie&&ie(),f.clear(),j&&j.abort(),T.fetchers.forEach((e,t)=>Ge(T.fetchers,t)),T.blockers.forEach((e,t)=>Qe(t))}function Se(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(T,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function Ce(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),T={...T,...e};let n=[],r=[];T.fetchers.forEach((e,t)=>{e.state===`idle`&&(I.has(t)?n.push(t):r.push(t))}),I.forEach(e=>{!T.fetchers.has(e)&&!P.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(T,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ge(T.fetchers,e)),r.forEach(e=>T.fetchers.delete(e))}function we(t,n,{flushSync:r}={}){let i=T.actionData!=null&&T.navigation.formMethod!=null&&Pn(T.navigation.formMethod)&&T.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?T.actionData:null;let o=n.loaderData?hn(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,c=T.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,St)));let l=!ae&&ct(t,n.matches||T.matches),u=O===!0||T.navigation.formMethod!=null&&Pn(T.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ae||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!ae&&t!==T.location){let e=ne.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:ne.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(ee){let e=ne.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ne.set(T.location.pathname,e)),d={currentLocation:T.location,nextLocation:t}}Ce({...n,actionData:a,loaderData:o,historyAction:E,location:t,initialized:!0,renderFallback:!1,navigation:bt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,O=!1,ee=!1,ae=!1,oe=!1,D?.resolve(),D=null,be?.resolve(),be=null}async function Te(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=Gn();let n=D.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Pt(!1,Nt(T.location,T.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?N(n.mask):{...T.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},w.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),ce(typeof n.mask==`string`?n.mask:M(n.mask),M(o),e.history.createURL(`/`),`reject`)}let s=T.location,l=te(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},ce(t==null?e.history.createHref(T.location):typeof t==`string`?t:M(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Pn(i.formMethod)&&i.formAction===T.location.pathname+T.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=tt({currentLocation:s,nextLocation:l,historyAction:d});m?et(m,{state:`blocked`,location:l,proceed(){et(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),Te(t,n)},reset(){let e=new Map(T.blockers);e.set(m,St),Ce({blockers:e})}}):await De(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function Ee(){be||=Gn(),Be(),Ce({revalidation:`loading`});let e=be.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(De(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(De(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ee===!0}),e)}async function De(t,n,r){j&&j.abort(),j=null,E=t,ae=(r&&r.startUninterruptedRevalidation)===!0,st(T.location,T.matches),O=(r&&r.preventScrollReset)===!0,ee=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&T.matches&&T.matches.length>0&&!y?T.matches:_e(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&T.initialized&&!oe&&Sn(T.location,n)&&!(r&&r.submission&&Pn(r.submission.formMethod))){we(n,{matches:a},{flushSync:o});return}let l=lt(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=nt(n.pathname);we(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;j=new AbortController;let d=ln(e.history,n,j.signal,r&&r.submission),f=e.getContext?await e.getContext():new ue,p;if(r&&r.pendingError)p=[_n(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Pn(r.submission.formMethod)){let i=await Oe(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(Dn(t)&&$e(t.error)&&t.error.status===404){j=null,we(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Rn(n,a,t,r.submission),o=!1,l.active=!1,d=ln(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await ke(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(j=null,we(n,{matches:h||a,...gn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Oe(t,n,i,l,u,d,f,p,m={}){if(Be(),Ce({navigation:zn(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ut(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=vn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=_n(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=nt(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=In(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:yn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Le(t,n,$t(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(On(h)){let n;return n=m&&m.replace!=null?m.replace:cn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===T.location.pathname+T.location.search,await Fe(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(Dn(h)){let e=_n(l,g.route.id);return(m&&m.replace)!==!0&&(E=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function ke(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||Rn(n,i,l,p),x=p||m||Ln(b),S=!ae&&!g;if(d){if(S){let e=Ae(v);Ce({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ut(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=vn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=_n(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=nt(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:w,revalidatingFetchers:E}=Ft(t,u,a,o,e.history,T,i,x,n,g?[]:r,g===!0,oe,se,I,me,pe,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(de=++le,!e.dataStrategy&&!w.some(e=>e.shouldLoad)&&!w.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(T.fetchers),t=Ye(e);return we(n,{matches:i,loaderData:{},errors:v&&Dn(v[1])?{[v[0]]:v[1].error}:null,...gn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Ae(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=je(E)),Ce(e,{flushSync:_})}E.forEach(e=>{qe(e.key),e.controller&&P.set(e.key,e.controller)});let D=()=>E.forEach(e=>qe(e.key));j&&j.signal.addEventListener(`abort`,D);let{loaderResults:O,fetcherResults:k}=await ze(w,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener(`abort`,D),E.forEach(e=>P.delete(e.key));let A=bn(O);if(A)return await Fe(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=bn(k),A)return pe.add(A.key),await Fe(t,A.result,!0,{replace:h}),{shortCircuited:!0};let ee=new Map(T.fetchers),{loaderData:te,errors:M}=mn(T,i,O,v,E,k,ee);g&&T.errors&&(M={...T.errors,...M});let N=Ye(ee),ne=Xe(de,ee),re=N||ne||E.length>0;return{matches:i,loaderData:te,errors:M,...re?{workingFetchers:ee}:{}}}function Ae(e){if(e&&!Dn(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function je(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Bn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Me(t,n,r,i){qe(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=Nt(T.location,T.matches,c,r,n,i?.relative);ce(null,l,e.history.createURL(`/`),`reject`);let u=_e(o,l,c,!1,s.branches),d=lt(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){He(t,n,yn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Pt(!0,l,i);if(m){He(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new ue,g=(i&&i.preventScrollReset)===!0;p&&Pn(p.formMethod)?await Ne(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate):(me.set(t,{routeId:n,path:f}),await Pe(t,n,f,u,h,d.active,a,g,p))}async function Ne(t,n,i,l,u,d,f,p,m,h){Be(),me.delete(t),Ve(t,Vn(m,T.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=ln(e.history,i,g.signal,m);if(d){let e=await ut(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){He(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{He(t,n,yn(404,{pathname:i}),{flushSync:f});return}}let v=In(l,i);if(!v.route.action&&!v.route.lazy){He(t,n,yn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}P.set(t,g);let y=le,b=$t(a,o,_,i,l,v,r,u),x=await Le(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){P.get(t)===g&&P.delete(t);return}if(I.has(t)){if(On(S)||Dn(S)){Ve(t,Hn(void 0));return}}else{if(On(S)){if(P.delete(t),de>y){Ve(t,Hn(void 0));return}return pe.add(t),Ve(t,Bn(m)),Fe(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(Dn(S)){He(t,n,S.error);return}}let C=T.navigation.location||T.location,w=ln(e.history,C,g.signal),D=s.activeRoutes,O=T.navigation.state===`idle`?T.matches:_e(D,T.navigation.location,c,!1,s.branches);k(O,`Didn't find any matches after fetcher action`);let A=++le;fe.set(t,A);let{dsMatches:ee,revalidatingFetchers:te}=Ft(w,u,a,o,e.history,T,O,m,C,r,!1,oe,se,I,me,pe,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),M=Bn(m,S.data),N=new Map(T.fetchers);N.set(t,M),te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=N.get(t),r=Bn(void 0,n?n.data:void 0);N.set(t,r),qe(t),e.controller&&P.set(t,e.controller)}),Ce({fetchers:N});let ne=()=>te.forEach(e=>qe(e.key));g.signal.addEventListener(`abort`,ne);let{loaderResults:re,fetcherResults:ie}=await ze(ee,te,w,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,ne),fe.delete(t),P.delete(t),te.forEach(e=>P.delete(e.key));let ae=T.fetchers.has(t),ce=e=>{if(!ae)return e;let n=new Map(e.fetchers);return n.set(t,Hn(S.data)),{...e,fetchers:n}},ue=bn(re);if(ue)return T=ce(T),Fe(w,ue.result,!1,{preventScrollReset:p});if(ue=bn(ie),ue)return pe.add(ue.key),T=ce(T),Fe(w,ue.result,!1,{preventScrollReset:p});let he=new Map(T.fetchers);ae&&he.set(t,Hn(S.data));let{loaderData:F,errors:ge}=mn(T,O,re,void 0,te,ie,he);Xe(A,he),T.navigation.state===`loading`&&A>de?(k(E,`Expected pending action`),j&&j.abort(),we(T.navigation.location,{matches:O,loaderData:F,errors:ge,fetchers:he})):(Ce({errors:ge,loaderData:hn(T.loaderData,F,O,ge),fetchers:he}),oe=!1)}async function Pe(t,n,i,s,c,l,u,d,f){let p=T.fetchers.get(t);Ve(t,Bn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=ln(e.history,i,m.signal);if(l){let e=await ut(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){He(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{He(t,n,yn(404,{pathname:i}),{flushSync:u});return}}let g=In(s,i);P.set(t,m);let _=le,v=await Le(h,i,$t(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(P.get(t)===m&&P.delete(t),!h.signal.aborted){if(I.has(t))Ve(t,Hn(void 0));else if(On(y)){if(de>_){Ve(t,Hn(void 0));return}pe.add(t),await Fe(h,y,!1,{preventScrollReset:d})}else Dn(y)?He(t,n,y.error):Ve(t,Hn(y.data))}}async function Fe(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(oe=!0);let d=i.response.headers.get(`Location`);k(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=cn(d,p,c,e.history),ce(f,d,p,`allow-explicit`);let m=te(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Re(d)){let n=re(t,d,!0);e=n.origin!==t.location.origin||Ie(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}j=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=T.navigation;!o&&!s&&g&&_&&v&&(o=Ln(T.navigation));let y=o||s;yt.has(i.response.status)&&y&&Pn(y.formMethod)?await De(h,m,{submission:{...y,formAction:d},preventScrollReset:l||O,enableViewTransition:a?ee:void 0}):await De(h,m,{overrideNavigation:Rn(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||O,enableViewTransition:a?ee:void 0})}async function Le(e,t,n,r,i){let a,o={};try{a=await en(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Pn(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;a.hasOwnProperty(e.route.id)||T.loaderData.hasOwnProperty(e.route.id)||T.errors&&T.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(En(r)){let i=r.result;o[t]={type:`redirect`,response:an(i,e,t,n,c)}}else o[t]=await rn(r);return o}async function ze(e,t,n,r,i){let a=Le(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Le(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:yn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Be(){oe=!0,me.forEach((e,t)=>{P.has(t)&&se.add(t),qe(t)})}function Ve(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),Ce({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function He(e,t,n,r={}){let i=_n(T.matches,t),a=new Map(T.fetchers);Ge(a,e),Ce({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ue(e){return he.set(e,(he.get(e)||0)+1),I.has(e)&&I.delete(e),T.fetchers.get(e)||xt}function We(e,t){qe(e,t?.reason),Ve(e,Hn(null))}function Ge(e,t){let n=T.fetchers.get(t);P.has(t)&&!(n&&n.state===`loading`&&fe.has(t))&&qe(t),me.delete(t),fe.delete(t),pe.delete(t),I.delete(t),se.delete(t),e.delete(t)}function Ke(e){let t=(he.get(e)||0)-1;t<=0?(he.delete(e),I.add(e)):he.set(e,t),Ce({fetchers:new Map(T.fetchers)})}function qe(e,t){let n=P.get(e);n&&(n.abort(t),P.delete(e))}function Je(e,t){for(let n of e){let e=t.get(n);k(e,`Expected fetcher: ${n}`);let r=Hn(e.data);t.set(n,r)}}function Ye(e){let t=[],n=!1;for(let r of pe){let i=e.get(r);k(i,`Expected fetcher: ${r}`),i.state===`loading`&&(pe.delete(r),t.push(r),n=!0)}return Je(t,e),n}function Xe(e,t){let n=[];for(let[r,i]of fe)if(i<e){let e=t.get(r);k(e,`Expected fetcher: ${r}`),e.state===`loading`&&(qe(r),fe.delete(r),n.push(r))}return Je(n,t),n.length>0}function Ze(e,t){let n=T.blockers.get(e)||St;return ge.get(e)!==t&&ge.set(e,t),n}function Qe(e){T.blockers.delete(e),ge.delete(e)}function et(e,t){let n=T.blockers.get(e)||St;k(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),Ce({blockers:r})}function tt({currentLocation:e,nextLocation:t,historyAction:n}){if(ge.size===0)return;ge.size>1&&A(!1,`A router only supports one blocker at a time`);let r=Array.from(ge.entries()),[i,a]=r[r.length-1],o=T.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function nt(e){let t=yn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=vn(n);return{notFoundMatches:r,route:i,error:t}}function rt(e,t,n){if(m=e,g=t,h=n||null,!_&&T.navigation===bt){_=!0;let e=ct(T.location,T.matches);e!=null&&Ce({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function ot(e,t){return h&&h(e,t.map(e=>ve(e,T.loaderData)))||e.key}function st(e,t){if(m&&g){let n=ot(e,t);m[n]=g()}}function ct(e,t){if(m){let n=ot(e,t),r=m[n];if(typeof r==`number`)return r}return null}function lt(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:_e(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:_e(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ut(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Vt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=_e(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=_e(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&dt(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=_e(s.activeRoutes,n,c,!0,u),!f||dt(l,f))return{type:`success`,matches:null};l=f}}function dt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ft(e){o={},s.setHmrRoutes(F(e,a,void 0,o))}function pt(e,t,n=!1){Vt(e,t,s,o,a,n),s.hasHMRRoutes||Ce({})}return C={get basename(){return c},get future(){return u},get state(){return T},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:L,subscribe:Se,enableScrollRestoration:rt,navigate:Te,fetch:Me,revalidate:Ee,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ue,resetFetcher:We,deleteFetcher:Ke,dispose:xe,getBlocker:Ze,deleteBlocker:Qe,patchRoutes:pt,_internalFetchControllers:P,_internalSetRoutes:ft,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){Ce(e)}},e.instrumentations&&(C=at(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Mt(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Nt(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=We(r||`.`,Ue(o),Ie(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Fn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Le({basename:n,pathname:c.pathname})),M(c)}function Pt(e,t,n){if(!n||!Mt(n))return{path:t};if(n.formMethod&&!Nn(n.formMethod))return{path:t,error:yn(405,{method:n.formMethod})};let r=()=>({path:t,error:yn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=xn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Pn(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
11
11
  `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Pn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}k(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=dn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=dn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=fn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=fn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Pn(c.formMethod))return{path:t,submission:c};let l=N(t);return e&&l.search&&Fn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:M(l),submission:c}}function Ft(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?Dn(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&Dn(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=et(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!It(s))f=!1;else if(u){let{shouldLoad:e}=Lt(s,a.loaderData,a.errors);f=e}else Rt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Qt(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?zt(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=Bt(i,m);return Qt(n,r,e,c,k,i,l,t,h,m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=_e(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=In(b,e.path),C=new AbortController,w=ln(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=$t(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=$t(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};Bt(S,a)&&(T=$t(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function It(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Lt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!It(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Rt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function zt(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Bt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Vt(e,t,n,r,i,a){let o;if(e){let t=r[e];k(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Ht(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=F(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=F([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Ht(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Ht(e,t)))??!1}var Ut=new WeakMap,Wt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(k(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Ut.get(i);o||(o={},Ut.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=fe(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)A(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)A(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Gt=new WeakMap;function Kt(e,t,n,r,i){let a=n[e.id];if(k(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Gt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{k(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=me(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?A(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?A(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Gt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=Wt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function R(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function qt(e){return e.matches.some(e=>e.route.middleware)?Jt(e,()=>R(e)):R(e)}function Jt(e,t){return Yt(e,t,e=>{if(Mn(e))throw e;return e},wn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=_n(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Yt(e,t,n,r,i){let{matches:a,...o}=e;return await Xt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Xt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Xt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Zt(e,t,n,r,i){let a=Wt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Kt(r.route,Pn(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Qt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Zt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Bt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Bt(a,{...l,defaultShouldRevalidate:e}):Bt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Pn(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Pn(n.method)||!p)?tn({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function $t(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Qt(e,t,n,r,et(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Zt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function en(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:un(t,n),pattern:et(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Jt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function tn({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Pn(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:un(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw yn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw yn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function nn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function rn(e){let{result:t,type:n}=e;if(An(t)){let e;try{e=await nn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Qe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?kn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Cn(t),statusCode:$e(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:$e(t)?t.status:void 0}:kn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function an(e,t,n,r,i){let a=e.headers.get(`Location`);if(k(a,`Redirects returned/thrown from loaders/actions must have a Location header`),ce(a,a,new URL(t.url),`allow-explicit`),!Re(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Nt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var on=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function sn(e){try{return on.includes(new URL(e).protocol)}catch{return!1}}function cn(e,t,n,r){if(Re(e)){let r=e,i=w.test(r)?new URL(T(r,t.protocol)):new URL(r);if(sn(i.toString()))throw Error(`Invalid redirect location`);let a=Ie(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Ge(i.pathname)+i.search+i.hash}try{if(sn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function ln(e,t,n,r){let i=e.createURL(xn(t)).toString(),a={signal:n};if(r&&Pn(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?dn(r.formData):r.formData}return new Request(i,a)}function un(e,t){let n=new URL(e.url),r=typeof t==`string`?N(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function dn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function fn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function pn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&Dn(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(k(!On(f),`Cannot handle redirect results in processLoaderData`),Dn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=_n(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Tt),c||(c=!0,s=$e(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function mn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=pn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(k(s,`Did not find corresponding fetcher result`),Dn(s)){let t=_n(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(On(s))k(!1,`Unhandled fetcher revalidation redirect`);else{let e=Hn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function hn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Tt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function gn(e){return e?Dn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function _n(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function vn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function yn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Qe(e||500,o,Error(s),!0)}function bn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(On(r))return{key:n,result:r}}}function xn(e){return M({...typeof e==`string`?N(e):e,hash:``})}function Sn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Cn(e){return new Qe(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function wn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Tn(t))}function Tn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function En(e){return An(e.result)&&vt.has(e.result.status)}function Dn(e){return e.type===`error`}function On(e){return(e&&e.type)===`redirect`}function kn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function An(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function jn(e){return vt.has(e)}function Mn(e){return An(e)&&jn(e.status)&&e.headers.has(`Location`)}function Nn(e){return _t.has(e.toUpperCase())}function Pn(e){return ht.has(e.toUpperCase())}function Fn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function In(e,t){let n=typeof t==`string`?N(t).search:t.search;if(e[e.length-1].route.index&&Fn(n||``))return e[e.length-1];let r=He(e);return r[r.length-1]}function Ln(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Rn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function zn(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Bn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Vn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Hn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Un(e,t){try{let n=e.sessionStorage.getItem(wt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Wn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(wt,JSON.stringify(n))}catch(e){A(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Gn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Kn=_.createContext(null);Kn.displayName=`DataRouter`;var qn=_.createContext(null);qn.displayName=`DataRouterState`;var Jn=_.createContext(!1);function Yn(){return _.useContext(Jn)}var Xn=_.createContext({isTransitioning:!1});Xn.displayName=`ViewTransition`;var Zn=_.createContext(new Map);Zn.displayName=`Fetchers`;var Qn=_.createContext(null);Qn.displayName=`Await`;var $n=_.createContext(null);$n.displayName=`Navigation`;var er=_.createContext(null);er.displayName=`Location`;var tr=_.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName=`Route`;var nr=_.createContext(null);nr.displayName=`RouteError`;var rr=`REACT_ROUTER_ERROR`,ir=`REDIRECT`,ar=`ROUTE_ERROR_RESPONSE`;function or(e){if(e.startsWith(`${rr}:${ir}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function sr(e){if(e.startsWith(`${rr}:${ar}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Qe(t.status,t.statusText,t.data)}catch{}}function cr(e,{relative:t}={}){k(lr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext($n),{hash:i,pathname:a,search:o}=gr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ke([n,a])),r.createHref({pathname:s,search:o,hash:i})}function lr(){return _.useContext(er)!=null}function ur(){return k(lr(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(er).location}function dr(e){k(lr(),`useMatch() may be used only in the context of a <Router> component.`);let{pathname:t}=ur();return _.useMemo(()=>Me(e,Fe(t)),[t,e])}var fr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function pr(e){_.useContext($n).static||_.useLayoutEffect(e)}function mr(){let{isDataRoute:e}=_.useContext(tr);return e?Mr():hr()}function hr(){k(lr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Kn),{basename:t,navigator:n}=_.useContext($n),{matches:r}=_.useContext(tr),{pathname:i}=ur(),a=JSON.stringify(Ue(r)),o=_.useRef(!1);return pr(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(A(o.current,fr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=We(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ke([t,c.pathname])),ce(typeof r==`string`?r:M(r),n.createHref(c),ae(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}_.createContext(null);function gr(e,{relative:t}={}){let{matches:n}=_.useContext(tr),{pathname:r}=ur(),i=JSON.stringify(Ue(n));return _.useMemo(()=>We(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function _r(e,t,n){k(lr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext($n),{matches:i}=_.useContext(tr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Pr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
12
12
 
13
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=ur(),d;if(t){let e=typeof t==`string`?N(t):t;k(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ge(e,{pathname:p});A(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),A(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=wr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ke([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ke([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(er.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function vr(){let e=jr(),t=$e(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var yr=_.createElement(vr,null),br=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=sr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(tr.Provider,{value:this.props.routeContext},_.createElement(nr.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(Sr,{error:e},t):t}};br.contextType=Jn;var xr=new WeakMap;function Sr({children:e,error:t}){let{basename:n,navigator:r}=_.useContext($n);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=or(t.digest);if(e){let i=xr.get(t);if(i)throw i;let a=nt(e.location,n),o=a.absoluteURL||a.to;if(ce(e.location,o,ae(r),`allow-explicit`),sn(o))throw Error(`Invalid redirect location`);if(tt&&!xr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw xr.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Cr({routeContext:e,match:t,children:n}){let r=_.useContext(Kn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(tr.Provider,{value:e},n)}function wr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);k(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:et(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||yr,o&&(s<0&&c===0?(Pr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(Cr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(br,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Er(e){let t=_.useContext(Kn);return k(t,Tr(e)),t}function Dr(e){let t=_.useContext(qn);return k(t,Tr(e)),t}function Or(e){let t=_.useContext(tr);return k(t,Tr(e)),t}function kr(e){let t=Or(e),n=t.matches[t.matches.length-1];return k(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ar(){return kr(`useRouteId`)}function jr(){let e=_.useContext(nr),t=Dr(`useRouteError`),n=kr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Mr(){let{router:e}=Er(`useNavigate`),t=kr(`useNavigate`),n=_.useRef(!1);return pr(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{A(n.current,fr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Nr={};function Pr(e,t,n){!t&&!Nr[e]&&(Nr[e]=!0,A(!1,n))}var Fr={};function Ir(e,t){!e&&!Fr[t]&&(Fr[t]=!0,console.warn(t))}var Lr=_.useOptimistic,Rr=()=>void 0;function zr(e){return Lr?Lr(e):[e,Rr]}function Br(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&A(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&A(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&A(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Vr=[`HydrateFallback`,`hydrateFallbackElement`],Hr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ur({router:e,flushSync:t,onError:n,useTransitions:r}){r=Yn()||r;let[i,a]=_.useState(e.state),[o,s]=zr(i),[c,l]=_.useState(),[u,d]=_.useState({isTransitioning:!1}),[f,p]=_.useState(),[m,h]=_.useState(),[g,v]=_.useState(),y=_.useRef(new Map),b=_.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:et(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Ir(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Ir(g==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!b)t&&u?t(()=>a(i)):r===!1?a(i):_.startTransition(()=>{r===!0&&s(e=>Wr(e,i)),a(i)});else if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n))}else m?(f?.resolve(),m.skipTransition(),v({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);_.useLayoutEffect(()=>e.subscribe(b),[e,b]),_.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Hr)},[u]),_.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):_.startTransition(()=>{r===!0&&s(e=>Wr(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),_.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),_.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[u.isTransitioning,g]);let x=_.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=_.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return _.createElement(_.Fragment,null,_.createElement(Kn.Provider,{value:C},_.createElement(qn.Provider,{value:o},_.createElement(Zn.Provider,{value:y.current},_.createElement(Xn.Provider,{value:u},_.createElement(qr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},_.createElement(Gr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Wr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Gr=_.memo(Kr);function Kr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return _r(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function qr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){k(!lr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=N(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=Ie(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return A(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement($n.Provider,{value:c},_.createElement(er.Provider,{children:t,value:h}))}_.Component;var Jr=`get`,Yr=`application/x-www-form-urlencoded`;function Xr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Zr(e){return Xr(e)&&e.tagName.toLowerCase()===`button`}function Qr(e){return Xr(e)&&e.tagName.toLowerCase()===`form`}function $r(e){return Xr(e)&&e.tagName.toLowerCase()===`input`}function ei(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ti(e,t){return e.button===0&&(!t||t===`_self`)&&!ei(e)}var ni=null;function ri(){if(ni===null)try{new FormData(document.createElement(`form`),0),ni=!1}catch{ni=!0}return ni}var ii=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ai(e){return e!=null&&!ii.has(e)?(A(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yr}"`),null):e}function oi(e,t){let n,r,i,a,o;if(Qr(e)){let o=e.getAttribute(`action`);r=o?Ie(o,t):null,n=e.getAttribute(`method`)||Jr,i=ai(e.getAttribute(`enctype`))||Yr,a=new FormData(e)}else if(Zr(e)||$r(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ie(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Jr,i=ai(e.getAttribute(`formenctype`))||ai(o.getAttribute(`enctype`))||Yr,a=new FormData(o,e),!ri()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Xr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Jr,r=null,i=Yr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function si(e,t){if(e===!1||e==null)throw Error(t)}function ci(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ie(i.pathname,t)===`/`?`${qe(t)}/_root.${r}`:`${qe(i.pathname)}.${r}`,i}async function li(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ui(e){return e!=null&&typeof e.page==`string`}function di(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function fi(e,t,n){return _i((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await li(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(di).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function pi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function mi(e,t,{includeHydrateFallback:n}={}){return hi(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function hi(e){return[...new Set(e)]}function gi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _i(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ui(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(gi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function vi(){let e=_.useContext(Kn);return si(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function yi(){let e=_.useContext(qn);return si(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var bi=_.createContext(void 0);bi.displayName=`FrameworkContext`;function xi(){let e=_.useContext(bi);return si(e,`You must render this element inside a <HydratedRouter> element`),e}function Si(e,t){let n=_.useContext(bi),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ci(s,p),onBlur:Ci(c,m),onMouseEnter:Ci(l,p),onMouseLeave:Ci(u,m),onTouchStart:Ci(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ci(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function wi({page:e,...t}){let n=Yn(),{nonce:r}=xi(),{router:i}=vi(),a=_.useMemo(()=>ge(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(Ei,{page:e,matches:a,...t}):_.createElement(Di,{page:e,matches:a,...t})):null}function Ti(e){let{manifest:t,routeModules:n}=xi(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return fi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ei({page:e,matches:t,...n}){let r=ur(),{future:i}=xi(),{basename:a}=vi(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=ci(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Di({page:e,matches:t,...n}){let r=ur(),{future:i,manifest:a,routeModules:o}=xi(),{basename:s}=vi(),{loaderData:c,matches:l}=yi(),u=_.useMemo(()=>pi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>pi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=ci(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>mi(d,a),[d,a]),m=Ti(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Oi(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var ki=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ki&&(window.__reactRouterVersion=`7.18.6`)}catch{}function Ai(e,t){return jt({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:O({window:t?.window}),hydrationData:t?.hydrationData||ji(),routes:e,mapRouteProperties:Br,hydrationRouteProperties:Vr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ji(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Mi(e.errors)}),e}function Mi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Qe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ze.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var Ni=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext($n),y=typeof l==`string`&&C.test(l),b=nt(l,h);l=b.to;let x=cr(l,{relative:r}),S=ur(),w=null;if(o){let e=We(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ke([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=Si(n,p),O=Ri(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(b.isExternal||i),j=(A?w:void 0)||b.absoluteURL||x;P(j);let ee=_.createElement(`a`,{...p,...D,href:j,onClick:A?k:e,ref:Oi(m,E),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return T&&!y?_.createElement(_.Fragment,null,ee,_.createElement(wi,{page:x})):ee});Ni.displayName=`Link`;var Pi=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=gr(a,{relative:c.relative}),d=ur(),f=_.useContext(qn),{navigator:p,basename:m}=_.useContext($n),h=f!=null&&Ui(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Ie(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(Ni,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Pi.displayName=`NavLink`;var Fi=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Jr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext($n),g=Vi(),v=Hi(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&C.test(s);return _.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});Fi.displayName=`Form`;function Ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Li(e){let t=_.useContext(Kn);return k(t,Ii(e)),t}function Ri(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=mr(),d=ur(),f=gr(e,{relative:o});return _.useCallback(p=>{if(ti(p,t)){p.preventDefault();let t=n===void 0?M(d)===M(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var zi=0,Bi=()=>`__${String(++zi)}__`;function Vi(){let{router:e}=Li(`useSubmit`),{basename:t}=_.useContext($n),n=Ar(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=oi(e,t);if(a.navigate===!1){let e=a.fetcherKey||Bi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Hi(e,{relative:t}={}){let{basename:n}=_.useContext($n),r=_.useContext(tr);k(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...gr(e||`.`,{relative:t})},o=ur();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ke([n,a.pathname]));let s=M(a);return P(s),s}function Ui(e,{relative:t}={}){let n=_.useContext(Xn);k(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Li(`useViewTransitionState`),i=gr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ie(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ie(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Me(i.pathname,o)!=null||Me(i.pathname,a)!=null}var Wi=g(),Gi=()=>Error(`Соединение с workspace прервано.`),Ki=class{openSocket;checkSession;onExpired;retryMs;socket;timer;stopped=!1;nextId=0;requests=new Map;listeners=new Map;constructor(e,t,n,r=1e3){this.openSocket=e,this.checkSession=t,this.onExpired=n,this.retryMs=r,this.connect()}connect(){let e;try{e=this.openSocket()}catch{this.retry();return}this.socket=e,e.onopen=()=>{if(this.socket===e)for(let t of this.requests.values())t.body!==void 0&&this.send(e,t)},e.onmessage=({data:t})=>{this.socket===e&&typeof t==`string`&&this.message(t)},e.onclose=({code:t})=>{this.socket===e&&(this.disconnect(),t===4401?this.expire():this.retry())};for(let[e,t]of this.listeners)this.add(e,t)}retry(){this.timer=setTimeout(async()=>{try{let e=await this.checkSession();if(this.stopped)return;e?this.connect():this.expire()}catch{this.stopped||this.retry()}},this.retryMs)}expire(){this.stop(),this.onExpired()}disconnect(){this.socket=void 0;for(let e of this.listeners.values())e.active=!1,e.addId=void 0;for(let e of this.requests.values())e.reject(Gi());this.requests.clear()}stop(){this.stopped=!0,clearTimeout(this.timer);let e=this.socket;this.disconnect(),this.listeners.clear(),e?.close()}message(e){let t;try{t=JSON.parse(e)}catch{return}if(t?.jsonrpc!==`2.0`)return;if(t.method===`event`){let e=t.params;if(typeof e?.from!=`string`||typeof e.event!=`string`||!Array.isArray(e.subscriptionIds))return;for(let t of new Set(e.subscriptionIds)){let n=this.listeners.get(t);if(n?.active)try{n.receive(e)}catch(e){console.error(e)}}return}let n=this.requests.get(t.id);n&&(this.requests.delete(t.id),t.error?n.reject(Error(t.error.message)):n.resolve(t.result))}send(e,t){try{e.send(t.body),t.body=void 0}catch{this.disconnect(),e.close(),this.retry()}}request(e,t,n,r){let i=++this.nextId,a=this.socket;if(!a||a.readyState>1)return r(Gi()),i;let o;try{o=JSON.stringify({jsonrpc:`2.0`,id:i,method:e,params:t})}catch(e){return r(Error(String(e))),i}let s={body:o,resolve:n,reject:r};return this.requests.set(i,s),a.readyState===1&&this.send(a,s),i}rpc(e,t){return new Promise((n,r)=>{this.request(e,t,e=>n(e),r)})}add(e,t){let n=this.socket;n&&(t.active=!0,t.addId=this.request(`subscriptions.add`,{subscriptions:[{...t.filter,id:e}]},()=>{this.listeners.get(e)===t&&t.ready?.()},r=>{this.socket===n&&this.listeners.get(e)===t&&(t.active=!1,t.error?.(r))}))}subscribe(e,t,n,r){if(this.stopped)throw Gi();let i=`panel-`+ ++this.nextId,a={filter:e,receive:t,ready:n,error:r,active:!1};return this.listeners.set(i,a),this.add(i,a),()=>{this.listeners.delete(i)&&a.active&&(a.addId!==void 0&&this.requests.get(a.addId)?.body!==void 0?this.requests.delete(a.addId):this.rpc(`subscriptions.delete`,{ids:[i]}).catch(()=>{}))}}},qi={working:`Работает`,stopping:`Останавливается`,stopped:`Остановлена`,error:`Ошибка`};function z(e){return e instanceof Error?e.message:String(e)}function Ji(e){return JSON.stringify(e,null,2)??``}function Yi(e){try{return JSON.parse(e)}catch(e){throw Error(`Проверьте JSON: `+z(e))}}var Xi;function Zi(){Xi?.connection.stop(),Xi=void 0}function Qi(e,t){if(Xi?.user===e){Xi.onExpired=t;return}Zi();let n=new Ki(()=>new WebSocket(new URL(`/api/ws/web`,location.href)),async()=>(await B()).user===e,()=>{if(Xi?.connection!==n)return;let e=Xi.onExpired;Xi=void 0,e()});Xi={user:e,connection:n,onExpired:t}}function $i(...e){if(!Xi)throw Error(`Сессия завершена. Войдите снова.`);return Xi.connection.subscribe(...e)}async function ea(e,t){if(!Xi)throw Error(`Сессия завершена. Войдите снова.`);return Xi.connection.rpc(e,t)}function ta(e,t,n={},r){return ea(`call`,{node:e,method:t,data:n,version:r})}function na(e){return ea(`help`,{node:e,features:!0,doc:!0,schema:!0})}function ra(){return ta(`~`,`$.runners.get`)}async function B(){let e=await fetch(`/api/session`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP `+e.status);return e.json()}async function V(e,t={}){let n=await fetch(`/api/auth/`+e,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error);return r}async function ia(e,t){let n=await V(`register/options`,{email:e,code:t}),r=await navigator.credentials.create({publicKey:PublicKeyCredential.parseCreationOptionsFromJSON(n)});if(!(r instanceof PublicKeyCredential))throw Error(`Регистрация passkey отменена.`);await V(`register/verify`,r.toJSON())}async function aa(){let e=await V(`login/options`),t=await navigator.credentials.get({publicKey:PublicKeyCredential.parseRequestOptionsFromJSON(e)});if(!(t instanceof PublicKeyCredential))throw Error(`Вход с passkey отменён.`);await V(`login/verify`,t.toJSON())}var oa=()=>V(`logout`),sa=e=>V(`recover`,{email:e}),ca=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),la=o(((e,t)=>{t.exports=ca()})),H=la();function ua(){let e=(0,_.useRef)(!0);return(0,_.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var da=(0,_.createContext)(!1);function fa({id:e,submit:t,feedback:n,children:r,hidden:i}){let[a,o]=(0,_.useState)(!1),s=ua();async function c(e){if(e.preventDefault(),!a){n(``),o(!0);try{await t(e.currentTarget)}catch(e){s.current&&n(z(e))}finally{s.current&&o(!1)}}}return(0,H.jsx)(`form`,{id:e,hidden:i,onSubmit:c,children:(0,H.jsx)(da.Provider,{value:a,children:r})})}function pa({disabled:e,children:t}){let n=(0,_.useContext)(da);return(0,H.jsx)(`button`,{type:`submit`,disabled:e||n,children:t})}function ma({run:e,feedback:t,children:n,disabled:r,...i}){let[a,o]=(0,_.useState)(!1),s=ua();async function c(){t(``),o(!0);try{await e()}catch(e){s.current&&t(z(e))}finally{s.current&&o(!1)}}return(0,H.jsx)(`button`,{...i,type:`button`,disabled:r||a,onClick:c,children:n})}function ha(e,t){return String(new FormData(e).get(t)??``)}function ga({nodes:e,type:t,placeholder:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`option`,{value:``,children:n}),e.filter(e=>e.type===t).map(e=>(0,H.jsxs)(`option`,{value:e.id,children:[e.name,` · `,e.id]},e.id))]})}function _a({id:e,close:t,children:n}){let r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{r.current?.showModal()},[]),(0,H.jsx)(`dialog`,{id:e,ref:r,onCancel:t,children:n})}function va(e,t){let n,r=!1;async function i(){try{for(;r;){r=!1;try{let n=await e();r||t(n)}catch(e){if(!r)throw e}}}finally{n=void 0}}return()=>(r=!0,n??=Promise.resolve().then(i))}function ya(e,t,n={}){let{disabled:r=!1,onSubscribed:i,onError:a}=n,o=(0,_.useRef)({callback:t,onSubscribed:i,onError:a});(0,_.useLayoutEffect)(()=>{o.current={callback:t,onSubscribed:i,onError:a}});let s=JSON.stringify({node:e.node,events:e.events});(0,_.useLayoutEffect)(()=>{if(!r)return $i(JSON.parse(s),e=>o.current.callback(e),()=>o.current.onSubscribed?.(),e=>o.current.onError?.(e))},[s,r])}function ba({id:e,onStatus:t,onCatalog:n,feedback:r,refresh:i}){let[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(),[l,u]=(0,_.useState)(),[d,f]=(0,_.useState)(``),p=(0,_.useRef)(null),m=ua(),h=(0,_.useMemo)(()=>va(()=>Promise.all([ta(e,`$.app.get`),ta(e,`$.app.executors.get`)]),([e,n])=>{m.current&&(o(e),c(n),t(e.status))}),[e,m,t]),g=(0,_.useCallback)(()=>{h().catch(e=>{m.current&&r(z(e))})},[h,m,r]);ya({node:e,events:[`$.app.statusChanged`,`$.app.restarted`,`$.node.lastIssueUpdated`]},g,{onSubscribed:g,onError:e=>{r(`Не удалось подписаться на изменения APP: `+z(e)),g()}}),(0,_.useEffect)(()=>{ta(e,`$.app.manifest.get`).then(e=>{m.current&&u(Ji(e))}).catch(e=>{m.current&&r(z(e))})},[e,r,m]);async function v(t){await ta(e,`$.app.`+t),m.current&&await Promise.all([h(),i()])}async function y(){let t=l??``,r=Yi(t);await ta(e,`$.app.manifest.set`,{source:r&&typeof r==`object`&&Object.hasOwn(r,`run`)?{manifest:r}:r});let[i,a]=await Promise.all([ta(e,`$.app.manifest.get`),na(e)]);m.current&&(n(a),p.current?.value===t&&(u(Ji(i)),f(`Манифест сохранён`)),await h())}return(0,H.jsxs)(`section`,{id:`app-management`,children:[(0,H.jsx)(`h2`,{children:`Состояние APP`}),(0,H.jsxs)(`dl`,{className:`app-state`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Статус`}),(0,H.jsx)(`dd`,{id:`app-status`,children:a&&qi[a.status]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Занято слотов`}),(0,H.jsx)(`dd`,{id:`app-active`,children:s&&(s.limit===null?s.active:s.active+` / `+s.limit)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`В очереди`}),(0,H.jsx)(`dd`,{id:`app-queued`,children:s?.queued})]})]}),(0,H.jsx)(`p`,{id:`app-issue`,hidden:!a?.lastIssue,children:a?.lastIssue}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(ma,{id:`app-start`,disabled:a?.status!==`stopped`&&a?.status!==`error`,feedback:r,run:()=>v(`start`),children:`Запустить`}),(0,H.jsx)(ma,{id:`app-stop`,className:`secondary`,disabled:a?.status!==`working`&&a?.status!==`error`,feedback:r,run:()=>v(`stop`),children:`Остановить`}),(0,H.jsx)(ma,{id:`app-restart`,className:`secondary`,disabled:a?.status!==`working`||s?.restarting,feedback:r,run:()=>v(`restart`),children:`Перезапустить`}),(0,H.jsx)(ma,{id:`app-refresh`,className:`secondary`,feedback:r,run:h,children:`Обновить состояние`})]}),(0,H.jsxs)(`details`,{id:`manifest-details`,children:[(0,H.jsx)(`summary`,{children:`Манифест APP`}),(0,H.jsx)(`p`,{id:`manifest-changed`,hidden:!a?.manifestChanged,children:`Новый манифест ожидает завершения постоянного процесса.`}),(0,H.jsxs)(`label`,{children:[`Источник манифеста JSON`,(0,H.jsx)(`textarea`,{id:`app-manifest`,ref:p,rows:10,spellCheck:!1,value:l??``,disabled:l===void 0,onChange:e=>{u(e.target.value),f(``)}})]}),(0,H.jsx)(ma,{id:`app-save`,disabled:l===void 0,feedback:f,run:y,children:`Сохранить манифест`}),(0,H.jsx)(`p`,{id:`app-feedback`,role:`status`,children:d})]})]})}var xa={run:{type:`codex`,settings:{developerInstructions:`Answer the message in data.input in the user's language.`,features:{"agent.execute":{type:`method`,description:`Send a message to the agent`,version:`1`,schema:{input:{type:`object`,properties:{input:{type:`string`,minLength:1}},required:[`input`],additionalProperties:!1},output:{type:`string`}}},"agent.getHistory":{type:`method`,version:`1`,description:`Read conversation history`},"agent.interrupt":{type:`method`,version:`1`,description:`Interrupt the active turn`}}}},executors:{mode:`persistent`,idleTimeoutMs:3e5}},Sa=[[`team`,`TEAM`],[`profile`,`PROFILE`],[`codex`,`APP · Codex`],[`app`,`APP · свой манифест`],[`user`,`USER`]];function Ca(e,t,n){return!n&&(e===`team`||e===`user`)?!1:t[`$.`+(e===`codex`?`app`:e)+`.create`]?.type===`method`}function wa({parent:e,nodes:t,admin:n,catalog:r,type:i,chooseType:a,close:o,refresh:s}){let[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(!1);(0,_.useEffect)(()=>{l(``),d(!1)},[i]);let f=i===`app`||i===`codex`,p=i===`codex`&&!t.some(e=>e.type===`profile`);return(0,H.jsxs)(fa,{id:`create-node`,feedback:l,submit:async t=>{if(u)return;let n=ha(t,`profile`),r={name:ha(t,`name`).trim(),permissions:Yi(ha(t,`permissions`)),...i===`user`&&{email:ha(t,`email`)},...i===`codex`&&{source:{manifest:xa}},...i===`app`&&{source:Yi(ha(t,`source`))},...f&&n&&{profile:n}},a=await ta(e.id,`$.`+(i===`codex`?`app`:i)+`.create`,r);d(!0),await s(a.id)},children:[(0,H.jsx)(`h2`,{children:`Создать ноду`}),(0,H.jsxs)(`p`,{id:`parent-name`,children:[`Родитель: `,e.name]}),(0,H.jsxs)(`label`,{children:[`Тип ноды`,(0,H.jsx)(`select`,{id:`create-type`,value:i,onChange:e=>a(e.target.value),children:Sa.map(([e,t])=>(0,H.jsx)(`option`,{value:e,disabled:!Ca(e,r,n),children:t},e))})]}),(0,H.jsxs)(`label`,{children:[`Название`,(0,H.jsx)(`input`,{id:`create-name`,name:`name`,maxLength:255,required:!0})]}),(0,H.jsxs)(`label`,{id:`email-field`,hidden:i!==`user`,children:[`Email пользователя`,(0,H.jsx)(`input`,{id:`create-email`,name:`email`,type:`email`,disabled:i!==`user`,required:i===`user`})]}),(0,H.jsxs)(`label`,{id:`profile-field`,hidden:!f,children:[`Профиль авторизации`,(0,H.jsx)(`select`,{id:`create-profile`,name:`profile`,required:i===`codex`,children:(0,H.jsx)(ga,{nodes:t,type:`profile`,placeholder:`Выберите профиль`})})]}),(0,H.jsxs)(`label`,{id:`source-field`,hidden:i!==`app`,children:[`Источник манифеста (JSON)`,(0,H.jsx)(`textarea`,{id:`create-source`,name:`source`,rows:7,spellCheck:!1,required:i===`app`})]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Права ноды`}),(0,H.jsxs)(`label`,{children:[`Правила (JSON)`,(0,H.jsx)(`textarea`,{id:`create-permissions`,name:`permissions`,rows:3,spellCheck:!1,defaultValue:`[]`})]})]}),(0,H.jsx)(`p`,{id:`create-error`,role:`alert`,children:c||(p?`Сначала создайте PROFILE для авторизации Codex.`:``)}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(pa,{disabled:u||p,children:`Создать`}),(0,H.jsx)(`button`,{className:`secondary`,type:`button`,"data-close":!0,onClick:o,children:`Отмена`})]})]})}function Ta({nodeId:e,action:t,chooseAction:n,path:r,id:i,children:a}){return(0,H.jsx)(`a`,{id:i,className:`action-link`,"data-action":r,href:`/nodes/`+encodeURIComponent(e)+`/`+r,"aria-current":t===r?`page`:void 0,onClick:e=>{e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),n(r))},children:a})}var Ea=[`Прикладные методы`,`Системные методы`,`События`,`Статьи`];function Da(e,t){return t.type===`method`?+!!e.startsWith(`$.`):t.type===`event`?2:3}function Oa(e){let t=Ea.map(()=>[]);for(let[n,r]of Object.entries(e).sort(([e],[t])=>e.localeCompare(t)))t[Da(n,r)].push(n);return t}function ka({catalog:e,...t}){return(0,H.jsxs)(`section`,{id:`feature-panel`,children:[(0,H.jsx)(`h2`,{children:`Методы и справка`}),Object.keys(e).length===0&&(0,H.jsx)(`p`,{children:`Нет доступных методов, событий или статей.`}),Oa(e).map((e,n)=>e.length>0&&(0,H.jsxs)(`details`,{open:n===0||e.some(e=>t.action===`methods/`+encodeURIComponent(e)),children:[(0,H.jsxs)(`summary`,{children:[Ea[n],` (`,e.length,`)`]}),(0,H.jsx)(`ul`,{className:`action-list`,children:e.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...t,path:`methods/`+encodeURIComponent(e),children:(0,H.jsx)(`code`,{children:e})})},e))})]},n))]})}function Aa({id:e,name:t,catalog:n,feature:r,chooseFeature:i,refresh:a}){let[o,s]=(0,_.useState)(``),c=ua();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h2`,{children:r.type===`method`?`Вызов метода`:`Справка`}),(0,H.jsxs)(`label`,{children:[`Методы, события и статьи`,(0,H.jsx)(`select`,{id:`feature`,value:t,onChange:e=>i(e.target.value),children:Oa(n).map((e,t)=>e.length>0&&(0,H.jsx)(`optgroup`,{label:Ea[t],children:e.map(e=>(0,H.jsx)(`option`,{children:e},e))},t))})]}),(0,H.jsxs)(`p`,{id:`feature-description`,children:[`v`,r.version,` · `,r.description]}),(0,H.jsx)(`pre`,{id:`feature-doc`,children:r.doc}),(0,H.jsxs)(`details`,{id:`schema-block`,hidden:r.schema===void 0,children:[(0,H.jsx)(`summary`,{children:`Схема JSON`}),(0,H.jsx)(`pre`,{id:`feature-schema`,children:Ji(r.schema)})]}),r.type===`method`&&(0,H.jsxs)(fa,{id:`method-call`,feedback:s,submit:async n=>{let i=Yi(ha(n,`arguments`));s(`Выполняется…`);let o=await ta(e,t,i,r.version);s(Ji(o)),c.current&&t.startsWith(`$.`)&&await a()},children:[(0,H.jsxs)(`label`,{children:[`Аргументы метода (JSON)`,(0,H.jsx)(`textarea`,{id:`arguments`,name:`arguments`,rows:5,spellCheck:!1,required:!0,defaultValue:t===`agent.execute`?`{ "input": "" }`:`{}`})]}),(0,H.jsx)(pa,{children:`Вызвать метод`})]}),(0,H.jsx)(`pre`,{id:`method-result`,role:`status`,children:o})]})}function ja({id:e,nodes:t,canImport:n,onStatus:r,feedback:i}){let[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),p=ua(),m=(0,_.useCallback)(async()=>{let t=await ta(e,`$.profile.get`);p.current&&(r(t.status),c(Ji(t.scope)),o(t.status))},[e,p,r]);(0,_.useEffect)(()=>{m().catch(e=>{p.current&&i(z(e))})},[m,p,i]);async function h(t){await ta(e,`$.profile.`+t),p.current&&await m()}return(0,H.jsxs)(`section`,{id:`profile-controls`,children:[(0,H.jsx)(`h2`,{children:`Настройка профиля`}),(0,H.jsxs)(fa,{id:`profile-import`,hidden:!n,feedback:f,submit:async t=>{await ta(e,`codex.setup`,{authFile:ha(t,`authFile`)}),f(`Авторизация импортирована.`)},children:[(0,H.jsxs)(`label`,{children:[`Путь к auth.json на сервере`,(0,H.jsx)(`input`,{id:`auth-file`,name:`authFile`,placeholder:`/tmp/codex-auth.json`,required:!0})]}),(0,H.jsx)(pa,{children:`Импортировать авторизацию Codex`})]}),(0,H.jsxs)(fa,{id:`profile-scope`,feedback:f,submit:async()=>{let t=Yi(s);if(!Array.isArray(t))throw Error(`Область доступа должна быть массивом.`);l&&!t.includes(l)&&t.push(l),await ta(e,`$.profile.scope.set`,{scope:t}),c(Ji(t)),u(``),f(`Область доступа сохранена.`)},children:[(0,H.jsxs)(`label`,{children:[`Область доступа (JSON)`,(0,H.jsx)(`textarea`,{id:`scope`,rows:3,required:!0,spellCheck:!1,disabled:!a,value:s,onChange:e=>c(e.target.value)})]}),(0,H.jsxs)(`label`,{children:[`Добавить APP в конец списка`,(0,H.jsx)(`select`,{id:`scope-app`,value:l,onChange:e=>u(e.target.value),children:(0,H.jsx)(ga,{nodes:t,type:`app`,placeholder:`Не добавлять`})})]}),(0,H.jsx)(pa,{disabled:!a,children:`Сохранить область доступа`})]}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(ma,{id:`enable-profile`,feedback:f,disabled:!a||a===`working`,run:()=>h(`enable`),children:`Включить профиль`}),(0,H.jsx)(ma,{id:`disable-profile`,className:`secondary`,feedback:f,disabled:a!==`working`,run:()=>h(`disable`),children:`Отключить профиль`})]}),(0,H.jsx)(`p`,{id:`profile-result`,role:`status`,children:d})]})}function Ma({id:e,version:t,reply:n,updateReply:r}){let[i,a]=(0,_.useState)(``);return(0,H.jsxs)(`section`,{id:`chat`,children:[(0,H.jsx)(`h2`,{children:`Сообщение агенту`}),(0,H.jsxs)(fa,{id:`send-message`,feedback:()=>{},submit:async()=>{if(i.trim()&&!n?.pending){r({pending:!0,text:`Ожидаем ответ агента…`});try{let n=await ta(e,`agent.execute`,{input:i},t);r({pending:!1,text:typeof n==`string`?n:Ji(n)}),a(e=>e===i?``:e)}catch(e){r({pending:!1,text:z(e)})}}},children:[(0,H.jsxs)(`label`,{children:[`Сообщение`,(0,H.jsx)(`textarea`,{id:`message`,rows:3,required:!0,value:i,onChange:e=>a(e.target.value)})]}),(0,H.jsx)(pa,{disabled:n?.pending,children:`Отправить сообщение`})]}),(0,H.jsx)(`pre`,{id:`reply`,role:`status`,children:n?.text})]})}function Na(e){try{return e.split(`/`).map(decodeURIComponent)}catch{return[]}}function Pa({node:e,nodes:t,admin:n,action:r,chooseAction:i,refresh:a,reply:o,updateReply:s}){let[c,l]=(0,_.useState)(e.status),[u,d]=(0,_.useState)(),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(``),{id:g,type:v}=e;(0,_.useEffect)(()=>{l(e.status)},[e.status]),(0,_.useEffect)(()=>{let e=!0;async function t(){let t=await na(g);if(e&&(d(t),v===`profile`&&n&&t[`codex.setup`]?.type!==`method`)){let t=await ra();e&&p(t.some(e=>e.name===`codex`&&e.available))}}return t().catch(t=>{e&&h(z(t))}),()=>{e=!1}},[g,v,n]);let y=v===`workspace`||v===`team`,b=y&&u?Sa.filter(([e])=>Ca(e,u,n)):[],x=n&&v===`app`,S=v===`app`?u?.[`agent.execute`]:void 0,C=S?.type===`method`,w=Na(r),[T,E]=w,D={nodeId:g,action:w.map(encodeURIComponent).join(`/`),chooseAction:i},O=b.find(([e])=>e===E)?.[0],k=u&&E&&Object.hasOwn(u,E)?u[E]:void 0;function A(){if(w.length===1){if(T===`manage`&&x)return(0,H.jsx)(ba,{id:g,refresh:a,feedback:h,onStatus:l,onCatalog:d});if(T===`profile`&&v===`profile`)return(0,H.jsx)(ja,{id:g,nodes:t,onStatus:l,feedback:h,canImport:u?.[`codex.setup`]?.type===`method`||f});if(T===`chat`&&C)return(0,H.jsx)(Ma,{id:g,version:S.version,reply:o,updateReply:s})}if(!u)return m?null:(0,H.jsx)(`p`,{role:`status`,children:`Загрузка действий…`});if(w.length===2){if(T===`methods`&&E&&k)return(0,H.jsx)(Aa,{id:g,name:E,feature:k,catalog:u,refresh:a,chooseFeature:e=>i(`methods/`+encodeURIComponent(e))},E);if(T===`create`&&O)return(0,H.jsx)(wa,{parent:e,nodes:t,admin:n,catalog:u,type:O,chooseType:e=>i(`create/`+e),close:()=>i(``),refresh:a})}return(0,H.jsx)(`p`,{role:`status`,children:`Для этой ноды действие недоступно.`})}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`section`,{id:`node-content`,className:`node-column`,"aria-labelledby":`node-name`,children:[(0,H.jsxs)(`div`,{className:`node-heading`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{id:`node-type`,className:`type-label`,children:v.toUpperCase()}),(0,H.jsx)(`h1`,{id:`node-name`,children:e.name}),(0,H.jsx)(`code`,{id:`node-id`,children:g})]}),(0,H.jsx)(`span`,{id:`node-status`,className:`status`,hidden:!c,"data-state":c??``,children:c&&qi[c]})]}),y&&(0,H.jsxs)(`section`,{id:`children`,children:[(0,H.jsx)(`h2`,{children:`Дочерние ноды`}),(0,H.jsxs)(`p`,{id:`child-count`,children:[`Видимых дочерних нод: `,t.filter(e=>e.parentId===g).length]})]}),(b.length>0||C||x||v===`profile`)&&(0,H.jsxs)(`section`,{id:`actions`,children:[(0,H.jsx)(`h2`,{children:`Действия`}),(0,H.jsxs)(`ul`,{className:`action-list`,children:[C&&(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...D,id:`show-chat`,path:`chat`,children:`Сообщение агенту`})}),x&&(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...D,id:`show-management`,path:`manage`,children:`Управление APP`})}),v===`profile`&&(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...D,id:`show-profile`,path:`profile`,children:`Настройка профиля`})}),b.map(([e,t],n)=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(Ta,{...D,id:n===0?`new-node`:void 0,path:`create/`+e,children:[`Создать `,t]})},e))]})]}),u?(0,H.jsx)(ka,{...D,catalog:u}):!m&&(0,H.jsx)(`p`,{role:`status`,children:`Загрузка справки…`}),!r&&(0,H.jsx)(`p`,{id:`node-error`,role:`alert`,children:m})]}),r&&(0,H.jsxs)(`section`,{className:`action-column`,"aria-label":`Действие ноды`,children:[A(),(0,H.jsx)(`p`,{id:`node-error`,role:`alert`,children:m})]})]})}var Fa={codexExecutablePath:`/run/pappai/private/tools/codex/0.170.0/bin/codex`,profilesDir:`/run/pappai/private/profiles`,stateDir:`/run/pappai/private/state`};function Ia({feedback:e}){let[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(``),s=ua();return(0,_.useEffect)(()=>{ra().then(n).catch(t=>{s.current&&e(z(t))})},[e,s]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h1`,{children:`Раннеры`}),(0,H.jsx)(`ul`,{id:`runner-list`,children:t.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`strong`,{children:e.name}),(0,H.jsx)(`span`,{children:e.enabled?e.available?`Доступен`:`Недоступен`:`Отключён`})]},e.name))}),(0,H.jsx)(`button`,{id:`new-runner`,onClick:()=>{o(``),i(!0)},children:`Добавить раннер`}),r&&(0,H.jsx)(_a,{id:`runner-dialog`,close:()=>i(!1),children:(0,H.jsxs)(fa,{id:`register-runner`,feedback:o,submit:async t=>{let r=ha(t,`schema`);await ta(`~`,`$.runners.add`,{name:ha(t,`name`),entrypoint:ha(t,`entrypoint`),config:Yi(ha(t,`config`)),...r.trim()?{settingsSchema:Yi(r)}:{}}),i(!1);try{n(await ra())}catch(t){s.current&&e(z(t))}},children:[(0,H.jsx)(`h2`,{children:`Регистрация раннера`}),(0,H.jsx)(`p`,{children:`Укажите пути к установленному пакету и его конфигурацию на сервере.`}),(0,H.jsxs)(`label`,{children:[`Имя раннера`,(0,H.jsx)(`input`,{id:`runner-name`,name:`name`,required:!0,defaultValue:`codex`})]}),(0,H.jsxs)(`label`,{children:[`Точка входа`,(0,H.jsx)(`input`,{id:`entrypoint`,name:`entrypoint`,required:!0,defaultValue:`/run/pappai/private/runners/node_modules/@flinbein/pappai-runner-codex/src/index.mjs`})]}),(0,H.jsxs)(`label`,{children:[`Конфигурация (JSON)`,(0,H.jsx)(`textarea`,{id:`runner-config`,name:`config`,required:!0,rows:6,spellCheck:!1,defaultValue:Ji(Fa)})]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Схема настроек APP`}),(0,H.jsxs)(`label`,{children:[`Схема JSON (необязательно)`,(0,H.jsx)(`textarea`,{id:`runner-schema`,name:`schema`,rows:4,spellCheck:!1})]})]}),(0,H.jsx)(`p`,{id:`runner-error`,role:`alert`,children:a}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(pa,{children:`Зарегистрировать`}),(0,H.jsx)(`button`,{className:`secondary`,type:`button`,"data-close":!0,onClick:()=>i(!1),children:`Отмена`})]})]})})]})}var La=`modulepreload`,Ra=function(e){return`/_web/0.1.3/`+e},za={},Ba=function(e){return e.pathname.endsWith(`.css`)},Va=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Ha=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ra(t,n);let r=s(t),i=Ba(r);return Va(za,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:La,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ua=(0,_.lazy)(()=>Ha(()=>import(`./view-COZX9gMP.js`),__vite__mapDeps([0,1]))),Wa=matchMedia(`(max-width: 45rem)`);function Ga(e){return Wa.addEventListener(`change`,e),()=>Wa.removeEventListener(`change`,e)}function Ka(e){return`/nodes/`+encodeURIComponent(e)}function qa(e){let t={create:`Создать`,chat:`Чат`,manage:`Управление`,profile:`Профиль`},[n,...r]=e.split(`/`),i=r.join(`/`);try{i=decodeURIComponent(i)}catch{}return n===`create`?`Создать `+i.toUpperCase():i||t[n]||n}function Ja({nodes:e,selected:t,folded:n,toggle:r,choose:i}){let a=new Map;for(let t of e){let e=a.get(t.parentId);e?e.push(t):a.set(t.parentId,[t])}function o(e){let s=a.get(e.id),c=!n.has(e.id);return(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`div`,{className:s?void 0:`leaf`,children:[s&&(0,H.jsx)(`button`,{className:`disclosure`,"aria-expanded":c,"aria-label":(c?`Свернуть `:`Развернуть `)+e.name,onClick:()=>r(e.id),children:c?`▾`:`▸`}),(0,H.jsxs)(`button`,{className:`tree-node`,"data-node":e.id,title:e.type.toUpperCase()+` · `+e.id,"aria-current":t===e.id||void 0,onClick:()=>i(e.id),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`node-symbol type-`+e.type}),e.name]})]}),s&&c&&(0,H.jsx)(`ul`,{children:s.map(o)})]},e.id)}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`ul`,{id:`nodes`,"aria-label":`Ноды`,children:a.get(null)?.map(o)}),(0,H.jsx)(`p`,{id:`tree-empty`,hidden:e.length>0,children:`Нет доступных нод.`})]})}function Ya({refresh:e,feedback:t}){let[n,r]=(0,_.useState)(``);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h1`,{children:`Консоль RPC`}),(0,H.jsxs)(fa,{id:`invoke`,feedback:t,submit:async t=>{r(``);let n=await ea(ha(t,`operation`),Yi(ha(t,`params`)));r(Ji(n)),await e()},children:[(0,H.jsxs)(`label`,{children:[`Операция`,(0,H.jsxs)(`select`,{id:`operation`,name:`operation`,children:[(0,H.jsx)(`option`,{children:`call`}),(0,H.jsx)(`option`,{children:`help`}),(0,H.jsx)(`option`,{children:`discover`})]})]}),(0,H.jsxs)(`label`,{children:[`Параметры JSON`,(0,H.jsx)(`textarea`,{id:`params`,name:`params`,rows:8,spellCheck:!1,defaultValue:`{}`})]}),(0,H.jsx)(pa,{children:`Выполнить`})]}),(0,H.jsx)(`h2`,{children:`Результат`}),(0,H.jsx)(`pre`,{id:`output`,"aria-live":`polite`,children:n})]})}function Xa({session:e,feedback:t,signOut:n}){let[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(!1),s=ur(),c=mr(),l=dr(`/nodes/:nodeId/*`),u=l?.params.nodeId??(s.pathname===`/`?r[0]?.id:void 0),d=l?s.pathname.split(`/`).slice(3).join(`/`).replace(/\/$/,``):``,f=s.pathname===`/terminal`,p=new URLSearchParams(s.search).get(`sandbox`)===`1`,[m,h]=(0,_.useState)(f?p:null),[g,v]=(0,_.useState)(`connecting`),[y,b]=(0,_.useState)(),x=(0,_.useSyncExternalStore)(Ga,()=>Wa.matches),S=d?`action`:s.pathname===`/`?`tree`:`node`,C=y?.key===s.key?y.pane:S,w=(0,_.useRef)(null);(0,_.useEffect)(()=>{x&&w.current?.querySelector(`[aria-current="step"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[x,C,s.key]);let T=e=>b({key:s.key,pane:e}),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{E.current&&(E.current.open=!1)},[s.key]),(0,_.useEffect)(()=>{f&&m===null&&(h(p),v(`connecting`))},[f,m,p]);function D(e){m!==e&&(m===null||g===`closed`)&&(h(e),v(`connecting`))}let[O,k]=(0,_.useState)(new Set),[A,j]=(0,_.useState)({}),ee=(0,_.useRef)([]),te=(0,_.useRef)(void 0),[M,N]=(0,_.useState)(``),ne=ua(),re=(0,_.useCallback)(e=>{let t=e.find(e=>e.id===te.current);return t?(te.current=void 0,N(``),c(Ka(t.id)),k(n=>{let r=new Set(n),i=t.parentId;for(;i;)r.delete(i),i=e.find(e=>e.id===i)?.parentId??null;return r}),!0):!1},[c]),ie=(0,_.useMemo)(()=>va(()=>ea(`discover`,{}),e=>{ne.current&&(ee.current=e,i(e),o(!0),te.current&&re(e)||te.current&&(te.current=void 0,N(`Нода создана, но сейчас недоступна в дереве.`)))}),[ne,re]),ae=(0,_.useCallback)(async e=>{if(!e)return ie();if(ne.current&&(te.current=e,!re(ee.current)))try{await ie()}catch(t){ne.current&&te.current===e&&N(`Нода создана. Не удалось обновить дерево: `+z(t))}},[ie,re,ne]),oe=(0,_.useCallback)(()=>{ie().catch(e=>{ne.current&&t(z(e))})},[ie,t,ne]);ya({events:[`$.node.created`,`$.node.deleted`,`$.node.permissions.updated`,`$.app.statusChanged`]},oe,{onSubscribed:oe,onError:e=>{t(`Не удалось подписаться на изменения дерева: `+z(e)),oe()}});function se(e){te.current=void 0,N(``),t(``),c(Ka(e))}let P=r.find(e=>e.id===u),ce=r.find(t=>t.id===e.user)?.name||e.user,le=s.pathname===`/runners`,ue=s.pathname===`/rpc`,de=!!l||s.pathname===`/`,fe=f?`Терминал`:le?`Раннеры`:ue?`Консоль RPC`:P?.name??u,pe=m?`/terminal?sandbox=1`:`/terminal`,me=f&&m===p,he=g===`online`;return(0,H.jsxs)(`div`,{id:`workspace`,"data-pane":C,"data-action":!!(d&&P),children:[(0,H.jsxs)(`nav`,{ref:w,className:`breadcrumbs`,"aria-label":`Колонки`,children:[(0,H.jsx)(`button`,{"aria-current":C===`tree`?`step`:void 0,onClick:()=>T(`tree`),children:`Workspace`}),fe&&s.pathname!==`/`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,H.jsxs)(`button`,{"aria-current":C===`node`?`step`:void 0,onClick:()=>T(`node`),children:[fe,f&&he&&(0,H.jsx)(`i`,{className:`online-dot`,"aria-label":`Подключён`})]})]}),d&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,H.jsx)(`button`,{"aria-current":C===`action`?`step`:void 0,onClick:()=>T(`action`),children:qa(d)})]})]}),(0,H.jsxs)(`aside`,{className:`directory`,"aria-labelledby":`tree-title`,children:[(0,H.jsxs)(`details`,{ref:E,className:`account-menu`,children:[(0,H.jsxs)(`summary`,{"aria-label":`Аккаунт `+ce,children:[(0,H.jsx)(`span`,{className:`avatar`,"aria-hidden":`true`,children:ce?.slice(0,1).toUpperCase()}),(0,H.jsx)(`strong`,{children:ce}),(0,H.jsx)(`span`,{className:`chevron`,"aria-hidden":`true`,children:`⌄`})]}),(0,H.jsxs)(`div`,{className:`account-items`,children:[e.canManageApps&&(0,H.jsx)(Ni,{id:`nav-runners`,to:`/runners`,children:`Раннеры`}),(0,H.jsx)(Ni,{id:`nav-rpc`,to:`/rpc`,children:`Консоль RPC`}),e.canChooseSandbox&&(g===`closed`||m===null)&&(0,H.jsx)(Ni,{id:`isolated-terminal`,to:`/terminal?sandbox=1`,onClick:()=>D(!0),children:`Открыть в песочнице`}),e.canChooseSandbox&&m===!0&&g===`closed`&&(0,H.jsx)(Ni,{to:`/terminal`,onClick:()=>D(!1),children:`Открыть без песочницы`}),(0,H.jsx)(ma,{id:`logout`,feedback:t,run:n,children:`Выйти`})]})]}),(0,H.jsxs)(`div`,{className:`tree-heading`,children:[(0,H.jsx)(`h2`,{id:`tree-title`,children:`Дерево нод`}),(0,H.jsx)(ma,{id:`refresh`,className:`icon`,"aria-label":`Обновить дерево`,title:`Обновить дерево`,run:ae,feedback:t,children:`↻`})]}),(0,H.jsx)(`div`,{className:`tree-scroll`,children:(0,H.jsx)(Ja,{nodes:r,selected:u,folded:O,toggle:e=>k(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),choose:se})}),M&&(0,H.jsx)(`p`,{role:`status`,children:M}),(0,H.jsxs)(`nav`,{className:`tools`,"aria-label":`Инструменты`,children:[(0,H.jsxs)(`a`,{href:`/files/`,target:`_blank`,rel:`noopener`,children:[(0,H.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M3 6h7l2 2h9v11H3z`})}),`Файлы`]}),(0,H.jsxs)(Ni,{id:`nav-terminal`,to:pe,"aria-current":f?`page`:void 0,onClick:()=>T(`node`),children:[(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,H.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`3`}),(0,H.jsx)(`path`,{d:`m6 9 3 3-3 3m5 0h5`})]}),`Терминал`,he&&(0,H.jsx)(`i`,{className:`online-dot`,"aria-label":`Подключён`})]})]})]}),de&&(P?(0,H.jsx)(Pa,{node:P,nodes:r,admin:e.canManageApps,action:d,chooseAction:e=>void c(Ka(P.id)+(e?`/`+e:``)),refresh:ae,reply:A[P.id],updateReply:e=>j(t=>({...t,[P.id]:e}))},P.id):(0,H.jsx)(`section`,{className:C===`action`?`action-column`:`node-column`,children:(0,H.jsx)(`p`,{id:`pick-node`,role:`status`,children:a?u?`Нода недоступна.`:`Выберите ноду в дереве.`:`Загрузка дерева…`})})),le&&(0,H.jsx)(`section`,{id:`runner-panel`,className:`node-column`,children:e.canManageApps?(0,H.jsx)(Ia,{feedback:t}):(0,H.jsx)(`p`,{children:`Нет доступа.`})}),ue&&(0,H.jsx)(`section`,{id:`rpc-panel`,className:`node-column`,children:(0,H.jsx)(Ya,{refresh:ae,feedback:t})}),f&&m!==null&&!me&&(0,H.jsxs)(`section`,{className:`node-column`,children:[(0,H.jsx)(`h1`,{children:`Терминал`}),g===`closed`?(0,H.jsx)(`button`,{onClick:()=>D(p),children:`Открыть новый терминал`}):(0,H.jsx)(`p`,{children:`Во вкладке уже открыт терминал с другим режимом изоляции. Закройте его перед сменой режима.`}),(0,H.jsx)(Ni,{to:pe,children:`Перейти к текущему терминалу`})]}),m!==null&&(0,H.jsx)(`section`,{className:`terminal-column`,hidden:!me,children:(0,H.jsx)(_.Suspense,{fallback:(0,H.jsx)(`p`,{children:`Подключение…`}),children:(0,H.jsx)(Ua,{sandbox:m,visible:me&&(!x||C===`node`),onStatus:v},String(m))})}),!de&&!f&&!le&&!ue&&(0,H.jsxs)(`section`,{className:`node-column`,children:[(0,H.jsx)(`p`,{children:`Страница не найдена.`}),(0,H.jsx)(Ni,{to:`/`,children:`Workspace`})]})]})}function Za({reload:e,feedback:t}){return(0,H.jsxs)(`section`,{id:`signin`,children:[(0,H.jsx)(`h1`,{children:`Вход в workspace`}),(0,H.jsx)(ma,{id:`login`,feedback:t,run:async()=>{await aa(),await e()},children:`Войти с passkey`}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Зарегистрировать passkey`}),(0,H.jsxs)(fa,{id:`activate`,feedback:t,submit:async t=>{await ia(ha(t,`email`),ha(t,`code`)),t.reset(),await e()},children:[(0,H.jsxs)(`label`,{children:[`Email`,(0,H.jsx)(`input`,{name:`email`,type:`email`,autoComplete:`email`,required:!0})]}),(0,H.jsxs)(`label`,{children:[`Одноразовый код`,(0,H.jsx)(`input`,{name:`code`,autoComplete:`one-time-code`,required:!0})]}),(0,H.jsx)(pa,{children:`Зарегистрировать`})]})]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Получить код по email`}),(0,H.jsxs)(fa,{id:`recovery`,feedback:t,submit:async e=>{await sa(ha(e,`email`)),t(`Если восстановление доступно, код придёт на указанный адрес.`)},children:[(0,H.jsxs)(`label`,{children:[`Адрес для восстановления`,(0,H.jsx)(`input`,{name:`email`,type:`email`,autoComplete:`email`,required:!0})]}),(0,H.jsx)(pa,{children:`Запросить код`})]})]})]})}function Qa(){let[e,t]=(0,_.useState)(),[n,r]=(0,_.useState)(``),i=(0,_.useRef)(0),a=(0,_.useCallback)(async()=>{let e=++i.current,n=await B();e===i.current&&(n.user?Qi(n.user,()=>{i.current++,Zi(),t({user:null,canChooseSandbox:!1,canManageApps:!1}),r(`Сессия завершена. Войдите снова.`)}):Zi(),t(n),r(``))},[]);return(0,_.useEffect)(()=>(a().catch(e=>r(z(e))),()=>{i.current++,Zi()}),[a]),(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)(`main`,{children:[e&&(e.user?(0,H.jsx)(Xa,{session:e,feedback:r,signOut:async()=>{await oa(),await a()}},e.user):(0,H.jsx)(Za,{reload:a,feedback:r})),(0,H.jsx)(`p`,{id:`notice`,role:`status`,children:n})]})})}var $a=Ai([{path:`*`,element:(0,H.jsx)(Qa,{})}]);(0,Wi.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(Ur,{router:$a}));export{c as i,m as n,u as r,la as t};
13
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=ur(),d;if(t){let e=typeof t==`string`?N(t):t;k(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ge(e,{pathname:p});A(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),A(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=wr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ke([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ke([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(er.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function vr(){let e=jr(),t=$e(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var yr=_.createElement(vr,null),br=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=sr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(tr.Provider,{value:this.props.routeContext},_.createElement(nr.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(Sr,{error:e},t):t}};br.contextType=Jn;var xr=new WeakMap;function Sr({children:e,error:t}){let{basename:n,navigator:r}=_.useContext($n);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=or(t.digest);if(e){let i=xr.get(t);if(i)throw i;let a=nt(e.location,n),o=a.absoluteURL||a.to;if(ce(e.location,o,ae(r),`allow-explicit`),sn(o))throw Error(`Invalid redirect location`);if(tt&&!xr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw xr.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Cr({routeContext:e,match:t,children:n}){let r=_.useContext(Kn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(tr.Provider,{value:e},n)}function wr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);k(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:et(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||yr,o&&(s<0&&c===0?(Pr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(Cr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(br,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Tr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Er(e){let t=_.useContext(Kn);return k(t,Tr(e)),t}function Dr(e){let t=_.useContext(qn);return k(t,Tr(e)),t}function Or(e){let t=_.useContext(tr);return k(t,Tr(e)),t}function kr(e){let t=Or(e),n=t.matches[t.matches.length-1];return k(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ar(){return kr(`useRouteId`)}function jr(){let e=_.useContext(nr),t=Dr(`useRouteError`),n=kr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Mr(){let{router:e}=Er(`useNavigate`),t=kr(`useNavigate`),n=_.useRef(!1);return pr(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{A(n.current,fr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Nr={};function Pr(e,t,n){!t&&!Nr[e]&&(Nr[e]=!0,A(!1,n))}var Fr={};function Ir(e,t){!e&&!Fr[t]&&(Fr[t]=!0,console.warn(t))}var Lr=_.useOptimistic,Rr=()=>void 0;function zr(e){return Lr?Lr(e):[e,Rr]}function Br(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&A(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:_.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&A(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:_.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&A(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:_.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Vr=[`HydrateFallback`,`hydrateFallbackElement`],Hr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ur({router:e,flushSync:t,onError:n,useTransitions:r}){r=Yn()||r;let[i,a]=_.useState(e.state),[o,s]=zr(i),[c,l]=_.useState(),[u,d]=_.useState({isTransitioning:!1}),[f,p]=_.useState(),[m,h]=_.useState(),[g,v]=_.useState(),y=_.useRef(new Map),b=_.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:et(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),Ir(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Ir(g==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!b)t&&u?t(()=>a(i)):r===!1?a(i):_.startTransition(()=>{r===!0&&s(e=>Wr(e,i)),a(i)});else if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n))}else m?(f?.resolve(),m.skipTransition(),v({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);_.useLayoutEffect(()=>e.subscribe(b),[e,b]),_.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Hr)},[u]),_.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):_.startTransition(()=>{r===!0&&s(e=>Wr(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),_.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),_.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[u.isTransitioning,g]);let x=_.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=_.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return _.createElement(_.Fragment,null,_.createElement(Kn.Provider,{value:C},_.createElement(qn.Provider,{value:o},_.createElement(Zn.Provider,{value:y.current},_.createElement(Xn.Provider,{value:u},_.createElement(qr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},_.createElement(Gr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Wr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Gr=_.memo(Kr);function Kr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return _r(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function qr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){k(!lr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=N(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=Ie(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return A(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement($n.Provider,{value:c},_.createElement(er.Provider,{children:t,value:h}))}_.Component;var Jr=`get`,Yr=`application/x-www-form-urlencoded`;function Xr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Zr(e){return Xr(e)&&e.tagName.toLowerCase()===`button`}function Qr(e){return Xr(e)&&e.tagName.toLowerCase()===`form`}function $r(e){return Xr(e)&&e.tagName.toLowerCase()===`input`}function ei(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ti(e,t){return e.button===0&&(!t||t===`_self`)&&!ei(e)}var ni=null;function ri(){if(ni===null)try{new FormData(document.createElement(`form`),0),ni=!1}catch{ni=!0}return ni}var ii=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ai(e){return e!=null&&!ii.has(e)?(A(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yr}"`),null):e}function oi(e,t){let n,r,i,a,o;if(Qr(e)){let o=e.getAttribute(`action`);r=o?Ie(o,t):null,n=e.getAttribute(`method`)||Jr,i=ai(e.getAttribute(`enctype`))||Yr,a=new FormData(e)}else if(Zr(e)||$r(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ie(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Jr,i=ai(e.getAttribute(`formenctype`))||ai(o.getAttribute(`enctype`))||Yr,a=new FormData(o,e),!ri()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Xr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Jr,r=null,i=Yr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function si(e,t){if(e===!1||e==null)throw Error(t)}function ci(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ie(i.pathname,t)===`/`?`${qe(t)}/_root.${r}`:`${qe(i.pathname)}.${r}`,i}async function li(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ui(e){return e!=null&&typeof e.page==`string`}function di(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function fi(e,t,n){return _i((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await li(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(di).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function pi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function mi(e,t,{includeHydrateFallback:n}={}){return hi(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function hi(e){return[...new Set(e)]}function gi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _i(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!ui(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(gi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function vi(){let e=_.useContext(Kn);return si(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function yi(){let e=_.useContext(qn);return si(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var bi=_.createContext(void 0);bi.displayName=`FrameworkContext`;function xi(){let e=_.useContext(bi);return si(e,`You must render this element inside a <HydratedRouter> element`),e}function Si(e,t){let n=_.useContext(bi),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ci(s,p),onBlur:Ci(c,m),onMouseEnter:Ci(l,p),onMouseLeave:Ci(u,m),onTouchStart:Ci(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ci(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function wi({page:e,...t}){let n=Yn(),{nonce:r}=xi(),{router:i}=vi(),a=_.useMemo(()=>ge(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(Ei,{page:e,matches:a,...t}):_.createElement(Di,{page:e,matches:a,...t})):null}function Ti(e){let{manifest:t,routeModules:n}=xi(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return fi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ei({page:e,matches:t,...n}){let r=ur(),{future:i}=xi(),{basename:a}=vi(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=ci(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Di({page:e,matches:t,...n}){let r=ur(),{future:i,manifest:a,routeModules:o}=xi(),{basename:s}=vi(),{loaderData:c,matches:l}=yi(),u=_.useMemo(()=>pi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>pi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=ci(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>mi(d,a),[d,a]),m=Ti(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Oi(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var ki=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ki&&(window.__reactRouterVersion=`7.18.6`)}catch{}function Ai(e,t){return jt({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:O({window:t?.window}),hydrationData:t?.hydrationData||ji(),routes:e,mapRouteProperties:Br,hydrationRouteProperties:Vr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ji(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Mi(e.errors)}),e}function Mi(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Qe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ze.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var Ni=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext($n),y=typeof l==`string`&&C.test(l),b=nt(l,h);l=b.to;let x=cr(l,{relative:r}),S=ur(),w=null;if(o){let e=We(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ke([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=Si(n,p),O=Ri(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(b.isExternal||i),j=(A?w:void 0)||b.absoluteURL||x;P(j);let ee=_.createElement(`a`,{...p,...D,href:j,onClick:A?k:e,ref:Oi(m,E),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return T&&!y?_.createElement(_.Fragment,null,ee,_.createElement(wi,{page:x})):ee});Ni.displayName=`Link`;var Pi=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=gr(a,{relative:c.relative}),d=ur(),f=_.useContext(qn),{navigator:p,basename:m}=_.useContext($n),h=f!=null&&Ui(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Ie(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(Ni,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Pi.displayName=`NavLink`;var Fi=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Jr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext($n),g=Vi(),v=Hi(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&C.test(s);return _.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});Fi.displayName=`Form`;function Ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Li(e){let t=_.useContext(Kn);return k(t,Ii(e)),t}function Ri(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=mr(),d=ur(),f=gr(e,{relative:o});return _.useCallback(p=>{if(ti(p,t)){p.preventDefault();let t=n===void 0?M(d)===M(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var zi=0,Bi=()=>`__${String(++zi)}__`;function Vi(){let{router:e}=Li(`useSubmit`),{basename:t}=_.useContext($n),n=Ar(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=oi(e,t);if(a.navigate===!1){let e=a.fetcherKey||Bi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Hi(e,{relative:t}={}){let{basename:n}=_.useContext($n),r=_.useContext(tr);k(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...gr(e||`.`,{relative:t})},o=ur();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ke([n,a.pathname]));let s=M(a);return P(s),s}function Ui(e,{relative:t}={}){let n=_.useContext(Xn);k(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Li(`useViewTransitionState`),i=gr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ie(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ie(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Me(i.pathname,o)!=null||Me(i.pathname,a)!=null}var Wi=g(),Gi=()=>Error(`Соединение с workspace прервано.`),Ki=class{openSocket;checkSession;onExpired;retryMs;socket;timer;stopped=!1;nextId=0;requests=new Map;listeners=new Map;constructor(e,t,n,r=1e3){this.openSocket=e,this.checkSession=t,this.onExpired=n,this.retryMs=r,this.connect()}connect(){let e;try{e=this.openSocket()}catch{this.retry();return}this.socket=e,e.onopen=()=>{if(this.socket===e)for(let t of this.requests.values())t.body!==void 0&&this.send(e,t)},e.onmessage=({data:t})=>{this.socket===e&&typeof t==`string`&&this.message(t)},e.onclose=({code:t})=>{this.socket===e&&(this.disconnect(),t===4401?this.expire():this.retry())};for(let[e,t]of this.listeners)this.add(e,t)}retry(){this.timer=setTimeout(async()=>{try{let e=await this.checkSession();if(this.stopped)return;e?this.connect():this.expire()}catch{this.stopped||this.retry()}},this.retryMs)}expire(){this.stop(),this.onExpired()}disconnect(){this.socket=void 0;for(let e of this.listeners.values())e.active=!1,e.addId=void 0;for(let e of this.requests.values())e.reject(Gi());this.requests.clear()}stop(){this.stopped=!0,clearTimeout(this.timer);let e=this.socket;this.disconnect(),this.listeners.clear(),e?.close()}message(e){let t;try{t=JSON.parse(e)}catch{return}if(t?.jsonrpc!==`2.0`)return;if(t.method===`event`){let e=t.params;if(typeof e?.from!=`string`||typeof e.event!=`string`||!Array.isArray(e.subscriptionIds))return;for(let t of new Set(e.subscriptionIds)){let n=this.listeners.get(t);if(n?.active)try{n.receive(e)}catch(e){console.error(e)}}return}let n=this.requests.get(t.id);n&&(this.requests.delete(t.id),t.error?n.reject(Error(t.error.message)):n.resolve(t.result))}send(e,t){try{e.send(t.body),t.body=void 0}catch{this.disconnect(),e.close(),this.retry()}}request(e,t,n,r){let i=++this.nextId,a=this.socket;if(!a||a.readyState>1)return r(Gi()),i;let o;try{o=JSON.stringify({jsonrpc:`2.0`,id:i,method:e,params:t})}catch(e){return r(Error(String(e))),i}let s={body:o,resolve:n,reject:r};return this.requests.set(i,s),a.readyState===1&&this.send(a,s),i}rpc(e,t){return new Promise((n,r)=>{this.request(e,t,e=>n(e),r)})}add(e,t){let n=this.socket;n&&(t.active=!0,t.addId=this.request(`subscriptions.add`,{subscriptions:[{...t.filter,id:e}]},()=>{this.listeners.get(e)===t&&t.ready?.()},r=>{this.socket===n&&this.listeners.get(e)===t&&(t.active=!1,t.error?.(r))}))}subscribe(e,t,n,r){if(this.stopped)throw Gi();let i=`panel-`+ ++this.nextId,a={filter:e,receive:t,ready:n,error:r,active:!1};return this.listeners.set(i,a),this.add(i,a),()=>{this.listeners.delete(i)&&a.active&&(a.addId!==void 0&&this.requests.get(a.addId)?.body!==void 0?this.requests.delete(a.addId):this.rpc(`subscriptions.delete`,{ids:[i]}).catch(()=>{}))}}},qi={working:`Работает`,stopping:`Останавливается`,stopped:`Остановлена`,error:`Ошибка`};function z(e){return e instanceof Error?e.message:String(e)}function Ji(e){return JSON.stringify(e,null,2)??``}function Yi(e){try{return JSON.parse(e)}catch(e){throw Error(`Проверьте JSON: `+z(e))}}var Xi;function Zi(){Xi?.connection.stop(),Xi=void 0}function Qi(e,t){if(Xi?.user===e){Xi.onExpired=t;return}Zi();let n=new Ki(()=>new WebSocket(new URL(`/api/ws/web`,location.href)),async()=>(await B()).user===e,()=>{if(Xi?.connection!==n)return;let e=Xi.onExpired;Xi=void 0,e()});Xi={user:e,connection:n,onExpired:t}}function $i(...e){if(!Xi)throw Error(`Сессия завершена. Войдите снова.`);return Xi.connection.subscribe(...e)}async function ea(e,t){if(!Xi)throw Error(`Сессия завершена. Войдите снова.`);return Xi.connection.rpc(e,t)}function ta(e,t,n={},r){return ea(`call`,{node:e,method:t,data:n,version:r})}function na(e){return ea(`help`,{node:e,features:!0,doc:!0,schema:!0})}function ra(){return ta(`~`,`$.runners.get`)}async function B(){let e=await fetch(`/api/session`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP `+e.status);return e.json()}async function V(e,t={}){let n=await fetch(`/api/auth/`+e,{method:`POST`,credentials:`same-origin`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json();if(!n.ok)throw Error(r.error);return r}async function ia(e,t){let n=await V(`register/options`,{email:e,code:t}),r=await navigator.credentials.create({publicKey:PublicKeyCredential.parseCreationOptionsFromJSON(n)});if(!(r instanceof PublicKeyCredential))throw Error(`Регистрация passkey отменена.`);await V(`register/verify`,r.toJSON())}async function aa(){let e=await V(`login/options`),t=await navigator.credentials.get({publicKey:PublicKeyCredential.parseRequestOptionsFromJSON(e)});if(!(t instanceof PublicKeyCredential))throw Error(`Вход с passkey отменён.`);await V(`login/verify`,t.toJSON())}var oa=()=>V(`logout`),sa=e=>V(`recover`,{email:e}),ca=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),la=o(((e,t)=>{t.exports=ca()})),H=la();function ua(){let e=(0,_.useRef)(!0);return(0,_.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var da=(0,_.createContext)(!1);function fa({id:e,submit:t,feedback:n,children:r,hidden:i}){let[a,o]=(0,_.useState)(!1),s=ua();async function c(e){if(e.preventDefault(),!a){n(``),o(!0);try{await t(e.currentTarget)}catch(e){s.current&&n(z(e))}finally{s.current&&o(!1)}}}return(0,H.jsx)(`form`,{id:e,hidden:i,onSubmit:c,children:(0,H.jsx)(da.Provider,{value:a,children:r})})}function pa({disabled:e,children:t}){let n=(0,_.useContext)(da);return(0,H.jsx)(`button`,{type:`submit`,disabled:e||n,children:t})}function ma({run:e,feedback:t,children:n,disabled:r,...i}){let[a,o]=(0,_.useState)(!1),s=ua();async function c(){t(``),o(!0);try{await e()}catch(e){s.current&&t(z(e))}finally{s.current&&o(!1)}}return(0,H.jsx)(`button`,{...i,type:`button`,disabled:r||a,onClick:c,children:n})}function ha(e,t){return String(new FormData(e).get(t)??``)}function ga({nodes:e,type:t,placeholder:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`option`,{value:``,children:n}),e.filter(e=>e.type===t).map(e=>(0,H.jsxs)(`option`,{value:e.id,children:[e.name,` · `,e.id]},e.id))]})}function _a({id:e,close:t,children:n}){let r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{r.current?.showModal()},[]),(0,H.jsx)(`dialog`,{id:e,ref:r,onCancel:t,children:n})}function va(e,t){let n,r=!1;async function i(){try{for(;r;){r=!1;try{let n=await e();r||t(n)}catch(e){if(!r)throw e}}}finally{n=void 0}}return()=>(r=!0,n??=Promise.resolve().then(i))}function ya(e,t,n={}){let{disabled:r=!1,onSubscribed:i,onError:a}=n,o=(0,_.useRef)({callback:t,onSubscribed:i,onError:a});(0,_.useLayoutEffect)(()=>{o.current={callback:t,onSubscribed:i,onError:a}});let s=JSON.stringify({node:e.node,events:e.events});(0,_.useLayoutEffect)(()=>{if(!r)return $i(JSON.parse(s),e=>o.current.callback(e),()=>o.current.onSubscribed?.(),e=>o.current.onError?.(e))},[s,r])}function ba({id:e,onStatus:t,onCatalog:n,feedback:r,refresh:i}){let[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(),[l,u]=(0,_.useState)(),[d,f]=(0,_.useState)(``),p=(0,_.useRef)(null),m=ua(),h=(0,_.useMemo)(()=>va(()=>Promise.all([ta(e,`$.app.get`),ta(e,`$.app.executors.get`)]),([e,n])=>{m.current&&(o(e),c(n),t(e.status))}),[e,m,t]),g=(0,_.useCallback)(()=>{h().catch(e=>{m.current&&r(z(e))})},[h,m,r]);ya({node:e,events:[`$.app.statusChanged`,`$.app.restarted`,`$.node.lastIssueUpdated`]},g,{onSubscribed:g,onError:e=>{r(`Не удалось подписаться на изменения APP: `+z(e)),g()}}),(0,_.useEffect)(()=>{ta(e,`$.app.manifest.get`).then(e=>{m.current&&u(Ji(e))}).catch(e=>{m.current&&r(z(e))})},[e,r,m]);async function v(t){await ta(e,`$.app.`+t),m.current&&await Promise.all([h(),i()])}async function y(){let t=l??``,r=Yi(t);await ta(e,`$.app.manifest.set`,{source:r&&typeof r==`object`&&Object.hasOwn(r,`run`)?{manifest:r}:r});let[i,a]=await Promise.all([ta(e,`$.app.manifest.get`),na(e)]);m.current&&(n(a),p.current?.value===t&&(u(Ji(i)),f(`Манифест сохранён`)),await h())}return(0,H.jsxs)(`section`,{id:`app-management`,children:[(0,H.jsx)(`h2`,{children:`Состояние APP`}),(0,H.jsxs)(`dl`,{className:`app-state`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Статус`}),(0,H.jsx)(`dd`,{id:`app-status`,children:a&&qi[a.status]})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`Занято слотов`}),(0,H.jsx)(`dd`,{id:`app-active`,children:s&&(s.limit===null?s.active:s.active+` / `+s.limit)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`dt`,{children:`В очереди`}),(0,H.jsx)(`dd`,{id:`app-queued`,children:s?.queued})]})]}),(0,H.jsx)(`p`,{id:`app-issue`,hidden:!a?.lastIssue,children:a?.lastIssue}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(ma,{id:`app-start`,disabled:a?.status!==`stopped`&&a?.status!==`error`,feedback:r,run:()=>v(`start`),children:`Запустить`}),(0,H.jsx)(ma,{id:`app-stop`,className:`secondary`,disabled:a?.status!==`working`&&a?.status!==`error`,feedback:r,run:()=>v(`stop`),children:`Остановить`}),(0,H.jsx)(ma,{id:`app-restart`,className:`secondary`,disabled:a?.status!==`working`||s?.restarting,feedback:r,run:()=>v(`restart`),children:`Перезапустить`}),(0,H.jsx)(ma,{id:`app-refresh`,className:`secondary`,feedback:r,run:h,children:`Обновить состояние`})]}),(0,H.jsxs)(`details`,{id:`manifest-details`,children:[(0,H.jsx)(`summary`,{children:`Манифест APP`}),(0,H.jsx)(`p`,{id:`manifest-changed`,hidden:!a?.manifestChanged,children:`Новый манифест ожидает завершения постоянного процесса.`}),(0,H.jsxs)(`label`,{children:[`Источник манифеста JSON`,(0,H.jsx)(`textarea`,{id:`app-manifest`,ref:p,rows:10,spellCheck:!1,value:l??``,disabled:l===void 0,onChange:e=>{u(e.target.value),f(``)}})]}),(0,H.jsx)(ma,{id:`app-save`,disabled:l===void 0,feedback:f,run:y,children:`Сохранить манифест`}),(0,H.jsx)(`p`,{id:`app-feedback`,role:`status`,children:d})]})]})}var xa={run:{type:`codex`,settings:{developerInstructions:`Answer the message in data.input in the user's language.`,features:{"agent.execute":{type:`method`,description:`Send a message to the agent`,version:`1`,schema:{input:{type:`object`,properties:{input:{type:`string`,minLength:1}},required:[`input`],additionalProperties:!1},output:{type:`string`}}},"agent.getHistory":{type:`method`,version:`1`,description:`Read conversation history`},"agent.interrupt":{type:`method`,version:`1`,description:`Interrupt the active turn`}}}},executors:{mode:`persistent`,idleTimeoutMs:3e5}},Sa=[[`team`,`TEAM`],[`profile`,`PROFILE`],[`codex`,`APP · Codex`],[`app`,`APP · свой манифест`],[`user`,`USER`]];function Ca(e,t,n){return!n&&(e===`team`||e===`user`)?!1:t[`$.`+(e===`codex`?`app`:e)+`.create`]?.type===`method`}function wa({parent:e,nodes:t,admin:n,catalog:r,type:i,chooseType:a,close:o,refresh:s}){let[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(!1);(0,_.useEffect)(()=>{l(``),d(!1)},[i]);let f=i===`app`||i===`codex`,p=i===`codex`&&!t.some(e=>e.type===`profile`);return(0,H.jsxs)(fa,{id:`create-node`,feedback:l,submit:async t=>{if(u)return;let n=ha(t,`profile`),r={name:ha(t,`name`).trim(),permissions:Yi(ha(t,`permissions`)),...i===`user`&&{email:ha(t,`email`)},...i===`codex`&&{source:{manifest:xa}},...i===`app`&&{source:Yi(ha(t,`source`))},...f&&n&&{profile:n}},a=await ta(e.id,`$.`+(i===`codex`?`app`:i)+`.create`,r);d(!0),await s(a.id)},children:[(0,H.jsx)(`h2`,{children:`Создать ноду`}),(0,H.jsxs)(`p`,{id:`parent-name`,children:[`Родитель: `,e.name]}),(0,H.jsxs)(`label`,{children:[`Тип ноды`,(0,H.jsx)(`select`,{id:`create-type`,value:i,onChange:e=>a(e.target.value),children:Sa.map(([e,t])=>(0,H.jsx)(`option`,{value:e,disabled:!Ca(e,r,n),children:t},e))})]}),(0,H.jsxs)(`label`,{children:[`Название`,(0,H.jsx)(`input`,{id:`create-name`,name:`name`,maxLength:255,required:!0})]}),(0,H.jsxs)(`label`,{id:`email-field`,hidden:i!==`user`,children:[`Email пользователя`,(0,H.jsx)(`input`,{id:`create-email`,name:`email`,type:`email`,disabled:i!==`user`,required:i===`user`})]}),(0,H.jsxs)(`label`,{id:`profile-field`,hidden:!f,children:[`Профиль авторизации`,(0,H.jsx)(`select`,{id:`create-profile`,name:`profile`,required:i===`codex`,children:(0,H.jsx)(ga,{nodes:t,type:`profile`,placeholder:`Выберите профиль`})})]}),(0,H.jsxs)(`label`,{id:`source-field`,hidden:i!==`app`,children:[`Источник манифеста (JSON)`,(0,H.jsx)(`textarea`,{id:`create-source`,name:`source`,rows:7,spellCheck:!1,required:i===`app`})]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Права ноды`}),(0,H.jsxs)(`label`,{children:[`Правила (JSON)`,(0,H.jsx)(`textarea`,{id:`create-permissions`,name:`permissions`,rows:3,spellCheck:!1,defaultValue:`[]`})]})]}),(0,H.jsx)(`p`,{id:`create-error`,role:`alert`,children:c||(p?`Сначала создайте PROFILE для авторизации Codex.`:``)}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(pa,{disabled:u||p,children:`Создать`}),(0,H.jsx)(`button`,{className:`secondary`,type:`button`,"data-close":!0,onClick:o,children:`Отмена`})]})]})}function Ta({nodeId:e,action:t,chooseAction:n,path:r,id:i,children:a}){return(0,H.jsx)(`a`,{id:i,className:`action-link`,"data-action":r,href:`/nodes/`+encodeURIComponent(e)+`/`+r,"aria-current":t===r?`page`:void 0,onClick:e=>{e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||(e.preventDefault(),n(r))},children:a})}var Ea=[`Прикладные методы`,`Системные методы`,`События`,`Статьи`];function Da(e,t){return t.type===`method`?+!!e.startsWith(`$.`):t.type===`event`?2:3}function Oa(e){let t=Ea.map(()=>[]);for(let[n,r]of Object.entries(e).sort(([e],[t])=>e.localeCompare(t)))t[Da(n,r)].push(n);return t}function ka({catalog:e,...t}){return(0,H.jsxs)(`section`,{id:`feature-panel`,children:[(0,H.jsx)(`h2`,{children:`Методы и справка`}),Object.keys(e).length===0&&(0,H.jsx)(`p`,{children:`Нет доступных методов, событий или статей.`}),Oa(e).map((e,n)=>e.length>0&&(0,H.jsxs)(`details`,{open:n===0||e.some(e=>t.action===`methods/`+encodeURIComponent(e)),children:[(0,H.jsxs)(`summary`,{children:[Ea[n],` (`,e.length,`)`]}),(0,H.jsx)(`ul`,{className:`action-list`,children:e.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...t,path:`methods/`+encodeURIComponent(e),children:(0,H.jsx)(`code`,{children:e})})},e))})]},n))]})}function Aa({id:e,name:t,catalog:n,feature:r,chooseFeature:i,refresh:a}){let[o,s]=(0,_.useState)(``),c=ua();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h2`,{children:r.type===`method`?`Вызов метода`:`Справка`}),(0,H.jsxs)(`label`,{children:[`Методы, события и статьи`,(0,H.jsx)(`select`,{id:`feature`,value:t,onChange:e=>i(e.target.value),children:Oa(n).map((e,t)=>e.length>0&&(0,H.jsx)(`optgroup`,{label:Ea[t],children:e.map(e=>(0,H.jsx)(`option`,{children:e},e))},t))})]}),(0,H.jsxs)(`p`,{id:`feature-description`,children:[`v`,r.version,` · `,r.description]}),(0,H.jsx)(`pre`,{id:`feature-doc`,children:r.doc}),(0,H.jsxs)(`details`,{id:`schema-block`,hidden:r.schema===void 0,children:[(0,H.jsx)(`summary`,{children:`Схема JSON`}),(0,H.jsx)(`pre`,{id:`feature-schema`,children:Ji(r.schema)})]}),r.type===`method`&&(0,H.jsxs)(fa,{id:`method-call`,feedback:s,submit:async n=>{let i=Yi(ha(n,`arguments`));s(`Выполняется…`);let o=await ta(e,t,i,r.version);s(Ji(o)),c.current&&t.startsWith(`$.`)&&await a()},children:[(0,H.jsxs)(`label`,{children:[`Аргументы метода (JSON)`,(0,H.jsx)(`textarea`,{id:`arguments`,name:`arguments`,rows:5,spellCheck:!1,required:!0,defaultValue:t===`agent.execute`?`{ "input": "" }`:`{}`})]}),(0,H.jsx)(pa,{children:`Вызвать метод`})]}),(0,H.jsx)(`pre`,{id:`method-result`,role:`status`,children:o})]})}function ja({id:e,nodes:t,canImport:n,onStatus:r,feedback:i}){let[a,o]=(0,_.useState)(),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),p=ua(),m=(0,_.useCallback)(async()=>{let t=await ta(e,`$.profile.get`);p.current&&(r(t.status),c(Ji(t.scope)),o(t.status))},[e,p,r]);(0,_.useEffect)(()=>{m().catch(e=>{p.current&&i(z(e))})},[m,p,i]);async function h(t){await ta(e,`$.profile.`+t),p.current&&await m()}return(0,H.jsxs)(`section`,{id:`profile-controls`,children:[(0,H.jsx)(`h2`,{children:`Настройка профиля`}),(0,H.jsxs)(fa,{id:`profile-import`,hidden:!n,feedback:f,submit:async t=>{await ta(e,`codex.setup`,{authFile:ha(t,`authFile`)}),f(`Авторизация импортирована.`)},children:[(0,H.jsxs)(`label`,{children:[`Путь к auth.json на сервере`,(0,H.jsx)(`input`,{id:`auth-file`,name:`authFile`,placeholder:`/tmp/codex-auth.json`,required:!0})]}),(0,H.jsx)(pa,{children:`Импортировать авторизацию Codex`})]}),(0,H.jsxs)(fa,{id:`profile-scope`,feedback:f,submit:async()=>{let t=Yi(s);if(!Array.isArray(t))throw Error(`Область доступа должна быть массивом.`);l&&!t.includes(l)&&t.push(l),await ta(e,`$.profile.scope.set`,{scope:t}),c(Ji(t)),u(``),f(`Область доступа сохранена.`)},children:[(0,H.jsxs)(`label`,{children:[`Область доступа (JSON)`,(0,H.jsx)(`textarea`,{id:`scope`,rows:3,required:!0,spellCheck:!1,disabled:!a,value:s,onChange:e=>c(e.target.value)})]}),(0,H.jsxs)(`label`,{children:[`Добавить APP в конец списка`,(0,H.jsx)(`select`,{id:`scope-app`,value:l,onChange:e=>u(e.target.value),children:(0,H.jsx)(ga,{nodes:t,type:`app`,placeholder:`Не добавлять`})})]}),(0,H.jsx)(pa,{disabled:!a,children:`Сохранить область доступа`})]}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(ma,{id:`enable-profile`,feedback:f,disabled:!a||a===`working`,run:()=>h(`enable`),children:`Включить профиль`}),(0,H.jsx)(ma,{id:`disable-profile`,className:`secondary`,feedback:f,disabled:a!==`working`,run:()=>h(`disable`),children:`Отключить профиль`})]}),(0,H.jsx)(`p`,{id:`profile-result`,role:`status`,children:d})]})}function Ma({id:e,version:t,reply:n,updateReply:r}){let[i,a]=(0,_.useState)(``);return(0,H.jsxs)(`section`,{id:`chat`,children:[(0,H.jsx)(`h2`,{children:`Сообщение агенту`}),(0,H.jsxs)(fa,{id:`send-message`,feedback:()=>{},submit:async()=>{if(i.trim()&&!n?.pending){r({pending:!0,text:`Ожидаем ответ агента…`});try{let n=await ta(e,`agent.execute`,{input:i},t);r({pending:!1,text:typeof n==`string`?n:Ji(n)}),a(e=>e===i?``:e)}catch(e){r({pending:!1,text:z(e)})}}},children:[(0,H.jsxs)(`label`,{children:[`Сообщение`,(0,H.jsx)(`textarea`,{id:`message`,rows:3,required:!0,value:i,onChange:e=>a(e.target.value)})]}),(0,H.jsx)(pa,{disabled:n?.pending,children:`Отправить сообщение`})]}),(0,H.jsx)(`pre`,{id:`reply`,role:`status`,children:n?.text})]})}function Na(e){try{return e.split(`/`).map(decodeURIComponent)}catch{return[]}}function Pa({node:e,nodes:t,admin:n,action:r,chooseAction:i,refresh:a,reply:o,updateReply:s}){let[c,l]=(0,_.useState)(e.status),[u,d]=(0,_.useState)(),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(``),{id:g,type:v}=e;(0,_.useEffect)(()=>{l(e.status)},[e.status]),(0,_.useEffect)(()=>{let e=!0;async function t(){let t=await na(g);if(e&&(d(t),v===`profile`&&n&&t[`codex.setup`]?.type!==`method`)){let t=await ra();e&&p(t.some(e=>e.name===`codex`&&e.available))}}return t().catch(t=>{e&&h(z(t))}),()=>{e=!1}},[g,v,n]);let y=v===`workspace`||v===`team`,b=y&&u?Sa.filter(([e])=>Ca(e,u,n)):[],x=n&&v===`app`,S=v===`app`?u?.[`agent.execute`]:void 0,C=S?.type===`method`,w=Na(r),[T,E]=w,D={nodeId:g,action:w.map(encodeURIComponent).join(`/`),chooseAction:i},O=b.find(([e])=>e===E)?.[0],k=u&&E&&Object.hasOwn(u,E)?u[E]:void 0;function A(){if(w.length===1){if(T===`manage`&&x)return(0,H.jsx)(ba,{id:g,refresh:a,feedback:h,onStatus:l,onCatalog:d});if(T===`profile`&&v===`profile`)return(0,H.jsx)(ja,{id:g,nodes:t,onStatus:l,feedback:h,canImport:u?.[`codex.setup`]?.type===`method`||f});if(T===`chat`&&C)return(0,H.jsx)(Ma,{id:g,version:S.version,reply:o,updateReply:s})}if(!u)return m?null:(0,H.jsx)(`p`,{role:`status`,children:`Загрузка действий…`});if(w.length===2){if(T===`methods`&&E&&k)return(0,H.jsx)(Aa,{id:g,name:E,feature:k,catalog:u,refresh:a,chooseFeature:e=>i(`methods/`+encodeURIComponent(e))},E);if(T===`create`&&O)return(0,H.jsx)(wa,{parent:e,nodes:t,admin:n,catalog:u,type:O,chooseType:e=>i(`create/`+e),close:()=>i(``),refresh:a})}return(0,H.jsx)(`p`,{role:`status`,children:`Для этой ноды действие недоступно.`})}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`section`,{id:`node-content`,className:`node-column`,"aria-labelledby":`node-name`,children:[(0,H.jsxs)(`div`,{className:`node-heading`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{id:`node-type`,className:`type-label`,children:v.toUpperCase()}),(0,H.jsx)(`h1`,{id:`node-name`,children:e.name}),(0,H.jsx)(`code`,{id:`node-id`,children:g})]}),(0,H.jsx)(`span`,{id:`node-status`,className:`status`,hidden:!c,"data-state":c??``,children:c&&qi[c]})]}),y&&(0,H.jsxs)(`section`,{id:`children`,children:[(0,H.jsx)(`h2`,{children:`Дочерние ноды`}),(0,H.jsxs)(`p`,{id:`child-count`,children:[`Видимых дочерних нод: `,t.filter(e=>e.parentId===g).length]})]}),(b.length>0||C||x||v===`profile`)&&(0,H.jsxs)(`section`,{id:`actions`,children:[(0,H.jsx)(`h2`,{children:`Действия`}),(0,H.jsxs)(`ul`,{className:`action-list`,children:[C&&(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...D,id:`show-chat`,path:`chat`,children:`Сообщение агенту`})}),x&&(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...D,id:`show-management`,path:`manage`,children:`Управление APP`})}),v===`profile`&&(0,H.jsx)(`li`,{children:(0,H.jsx)(Ta,{...D,id:`show-profile`,path:`profile`,children:`Настройка профиля`})}),b.map(([e,t],n)=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(Ta,{...D,id:n===0?`new-node`:void 0,path:`create/`+e,children:[`Создать `,t]})},e))]})]}),u?(0,H.jsx)(ka,{...D,catalog:u}):!m&&(0,H.jsx)(`p`,{role:`status`,children:`Загрузка справки…`}),!r&&(0,H.jsx)(`p`,{id:`node-error`,role:`alert`,children:m})]}),r&&(0,H.jsxs)(`section`,{className:`action-column`,"aria-label":`Действие ноды`,children:[A(),(0,H.jsx)(`p`,{id:`node-error`,role:`alert`,children:m})]})]})}var Fa={codexExecutablePath:`/run/pappai/private/tools/codex/0.170.0/bin/codex`,profilesDir:`/run/pappai/private/profiles`,stateDir:`/run/pappai/private/state`};function Ia({feedback:e}){let[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(``),s=ua();return(0,_.useEffect)(()=>{ra().then(n).catch(t=>{s.current&&e(z(t))})},[e,s]),(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h1`,{children:`Раннеры`}),(0,H.jsx)(`ul`,{id:`runner-list`,children:t.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`strong`,{children:e.name}),(0,H.jsx)(`span`,{children:e.enabled?e.available?`Доступен`:`Недоступен`:`Отключён`})]},e.name))}),(0,H.jsx)(`button`,{id:`new-runner`,onClick:()=>{o(``),i(!0)},children:`Добавить раннер`}),r&&(0,H.jsx)(_a,{id:`runner-dialog`,close:()=>i(!1),children:(0,H.jsxs)(fa,{id:`register-runner`,feedback:o,submit:async t=>{let r=ha(t,`schema`);await ta(`~`,`$.runners.add`,{name:ha(t,`name`),entrypoint:ha(t,`entrypoint`),config:Yi(ha(t,`config`)),...r.trim()?{settingsSchema:Yi(r)}:{}}),i(!1);try{n(await ra())}catch(t){s.current&&e(z(t))}},children:[(0,H.jsx)(`h2`,{children:`Регистрация раннера`}),(0,H.jsx)(`p`,{children:`Укажите пути к установленному пакету и его конфигурацию на сервере.`}),(0,H.jsxs)(`label`,{children:[`Имя раннера`,(0,H.jsx)(`input`,{id:`runner-name`,name:`name`,required:!0,defaultValue:`codex`})]}),(0,H.jsxs)(`label`,{children:[`Точка входа`,(0,H.jsx)(`input`,{id:`entrypoint`,name:`entrypoint`,required:!0,defaultValue:`/run/pappai/private/runners/node_modules/@flinbein/pappai-runner-codex/src/index.mjs`})]}),(0,H.jsxs)(`label`,{children:[`Конфигурация (JSON)`,(0,H.jsx)(`textarea`,{id:`runner-config`,name:`config`,required:!0,rows:6,spellCheck:!1,defaultValue:Ji(Fa)})]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Схема настроек APP`}),(0,H.jsxs)(`label`,{children:[`Схема JSON (необязательно)`,(0,H.jsx)(`textarea`,{id:`runner-schema`,name:`schema`,rows:4,spellCheck:!1})]})]}),(0,H.jsx)(`p`,{id:`runner-error`,role:`alert`,children:a}),(0,H.jsxs)(`div`,{className:`app-actions`,children:[(0,H.jsx)(pa,{children:`Зарегистрировать`}),(0,H.jsx)(`button`,{className:`secondary`,type:`button`,"data-close":!0,onClick:()=>i(!1),children:`Отмена`})]})]})})]})}var La=`modulepreload`,Ra=function(e){return`/_web/0.1.4/`+e},za={},Ba=function(e){return e.pathname.endsWith(`.css`)},Va=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Ha=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ra(t,n);let r=s(t),i=Ba(r);return Va(za,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:La,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ua=(0,_.lazy)(()=>Ha(()=>import(`./view-DaMjbXs2.js`),__vite__mapDeps([0,1]))),Wa=matchMedia(`(max-width: 45rem)`);function Ga(e){return Wa.addEventListener(`change`,e),()=>Wa.removeEventListener(`change`,e)}function Ka(e){return`/nodes/`+encodeURIComponent(e)}function qa(e){let t={create:`Создать`,chat:`Чат`,manage:`Управление`,profile:`Профиль`},[n,...r]=e.split(`/`),i=r.join(`/`);try{i=decodeURIComponent(i)}catch{}return n===`create`?`Создать `+i.toUpperCase():i||t[n]||n}function Ja({nodes:e,selected:t,folded:n,toggle:r,choose:i}){let a=new Map;for(let t of e){let e=a.get(t.parentId);e?e.push(t):a.set(t.parentId,[t])}function o(e){let s=a.get(e.id),c=!n.has(e.id);return(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`div`,{className:s?void 0:`leaf`,children:[s&&(0,H.jsx)(`button`,{className:`disclosure`,"aria-expanded":c,"aria-label":(c?`Свернуть `:`Развернуть `)+e.name,onClick:()=>r(e.id),children:c?`▾`:`▸`}),(0,H.jsxs)(`button`,{className:`tree-node`,"data-node":e.id,title:e.type.toUpperCase()+` · `+e.id,"aria-current":t===e.id||void 0,onClick:()=>i(e.id),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`node-symbol type-`+e.type}),e.name]})]}),s&&c&&(0,H.jsx)(`ul`,{children:s.map(o)})]},e.id)}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`ul`,{id:`nodes`,"aria-label":`Ноды`,children:a.get(null)?.map(o)}),(0,H.jsx)(`p`,{id:`tree-empty`,hidden:e.length>0,children:`Нет доступных нод.`})]})}function Ya({refresh:e,feedback:t}){let[n,r]=(0,_.useState)(``);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`h1`,{children:`Консоль RPC`}),(0,H.jsxs)(fa,{id:`invoke`,feedback:t,submit:async t=>{r(``);let n=await ea(ha(t,`operation`),Yi(ha(t,`params`)));r(Ji(n)),await e()},children:[(0,H.jsxs)(`label`,{children:[`Операция`,(0,H.jsxs)(`select`,{id:`operation`,name:`operation`,children:[(0,H.jsx)(`option`,{children:`call`}),(0,H.jsx)(`option`,{children:`help`}),(0,H.jsx)(`option`,{children:`discover`})]})]}),(0,H.jsxs)(`label`,{children:[`Параметры JSON`,(0,H.jsx)(`textarea`,{id:`params`,name:`params`,rows:8,spellCheck:!1,defaultValue:`{}`})]}),(0,H.jsx)(pa,{children:`Выполнить`})]}),(0,H.jsx)(`h2`,{children:`Результат`}),(0,H.jsx)(`pre`,{id:`output`,"aria-live":`polite`,children:n})]})}function Xa({session:e,feedback:t,signOut:n}){let[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(!1),s=ur(),c=mr(),l=dr(`/nodes/:nodeId/*`),u=l?.params.nodeId??(s.pathname===`/`?r[0]?.id:void 0),d=l?s.pathname.split(`/`).slice(3).join(`/`).replace(/\/$/,``):``,f=s.pathname===`/terminal`,p=new URLSearchParams(s.search).get(`sandbox`)===`1`,[m,h]=(0,_.useState)(f?p:null),[g,v]=(0,_.useState)(`connecting`),[y,b]=(0,_.useState)(),x=(0,_.useSyncExternalStore)(Ga,()=>Wa.matches),S=d?`action`:s.pathname===`/`?`tree`:`node`,C=y?.key===s.key?y.pane:S,w=(0,_.useRef)(null);(0,_.useEffect)(()=>{x&&w.current?.querySelector(`[aria-current="step"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[x,C,s.key]);let T=e=>b({key:s.key,pane:e}),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{E.current&&(E.current.open=!1)},[s.key]),(0,_.useEffect)(()=>{f&&m===null&&(h(p),v(`connecting`))},[f,m,p]);function D(e){m!==e&&(m===null||g===`closed`)&&(h(e),v(`connecting`))}let[O,k]=(0,_.useState)(new Set),[A,j]=(0,_.useState)({}),ee=(0,_.useRef)([]),te=(0,_.useRef)(void 0),[M,N]=(0,_.useState)(``),ne=ua(),re=(0,_.useCallback)(e=>{let t=e.find(e=>e.id===te.current);return t?(te.current=void 0,N(``),c(Ka(t.id)),k(n=>{let r=new Set(n),i=t.parentId;for(;i;)r.delete(i),i=e.find(e=>e.id===i)?.parentId??null;return r}),!0):!1},[c]),ie=(0,_.useMemo)(()=>va(()=>ea(`discover`,{}),e=>{ne.current&&(ee.current=e,i(e),o(!0),te.current&&re(e)||te.current&&(te.current=void 0,N(`Нода создана, но сейчас недоступна в дереве.`)))}),[ne,re]),ae=(0,_.useCallback)(async e=>{if(!e)return ie();if(ne.current&&(te.current=e,!re(ee.current)))try{await ie()}catch(t){ne.current&&te.current===e&&N(`Нода создана. Не удалось обновить дерево: `+z(t))}},[ie,re,ne]),oe=(0,_.useCallback)(()=>{ie().catch(e=>{ne.current&&t(z(e))})},[ie,t,ne]);ya({events:[`$.node.created`,`$.node.deleted`,`$.node.permissions.updated`,`$.app.statusChanged`]},oe,{onSubscribed:oe,onError:e=>{t(`Не удалось подписаться на изменения дерева: `+z(e)),oe()}});function se(e){te.current=void 0,N(``),t(``),c(Ka(e))}let P=r.find(e=>e.id===u),ce=r.find(t=>t.id===e.user)?.name||e.user,le=s.pathname===`/runners`,ue=s.pathname===`/rpc`,de=!!l||s.pathname===`/`,fe=f?`Терминал`:le?`Раннеры`:ue?`Консоль RPC`:P?.name??u,pe=m?`/terminal?sandbox=1`:`/terminal`,me=f&&m===p,he=g===`online`;return(0,H.jsxs)(`div`,{id:`workspace`,"data-pane":C,"data-action":!!(d&&P),children:[(0,H.jsxs)(`nav`,{ref:w,className:`breadcrumbs`,"aria-label":`Колонки`,children:[(0,H.jsx)(`button`,{"aria-current":C===`tree`?`step`:void 0,onClick:()=>T(`tree`),children:`Workspace`}),fe&&s.pathname!==`/`&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,H.jsxs)(`button`,{"aria-current":C===`node`?`step`:void 0,onClick:()=>T(`node`),children:[fe,f&&he&&(0,H.jsx)(`i`,{className:`online-dot`,"aria-label":`Подключён`})]})]}),d&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,H.jsx)(`button`,{"aria-current":C===`action`?`step`:void 0,onClick:()=>T(`action`),children:qa(d)})]})]}),(0,H.jsxs)(`aside`,{className:`directory`,"aria-labelledby":`tree-title`,children:[(0,H.jsxs)(`details`,{ref:E,className:`account-menu`,children:[(0,H.jsxs)(`summary`,{"aria-label":`Аккаунт `+ce,children:[(0,H.jsx)(`span`,{className:`avatar`,"aria-hidden":`true`,children:ce?.slice(0,1).toUpperCase()}),(0,H.jsx)(`strong`,{children:ce}),(0,H.jsx)(`span`,{className:`chevron`,"aria-hidden":`true`,children:`⌄`})]}),(0,H.jsxs)(`div`,{className:`account-items`,children:[e.canManageApps&&(0,H.jsx)(Ni,{id:`nav-runners`,to:`/runners`,children:`Раннеры`}),(0,H.jsx)(Ni,{id:`nav-rpc`,to:`/rpc`,children:`Консоль RPC`}),e.canChooseSandbox&&(g===`closed`||m===null)&&(0,H.jsx)(Ni,{id:`isolated-terminal`,to:`/terminal?sandbox=1`,onClick:()=>D(!0),children:`Открыть в песочнице`}),e.canChooseSandbox&&m===!0&&g===`closed`&&(0,H.jsx)(Ni,{to:`/terminal`,onClick:()=>D(!1),children:`Открыть без песочницы`}),(0,H.jsx)(ma,{id:`logout`,feedback:t,run:n,children:`Выйти`})]})]}),(0,H.jsxs)(`div`,{className:`tree-heading`,children:[(0,H.jsx)(`h2`,{id:`tree-title`,children:`Дерево нод`}),(0,H.jsx)(ma,{id:`refresh`,className:`icon`,"aria-label":`Обновить дерево`,title:`Обновить дерево`,run:ae,feedback:t,children:`↻`})]}),(0,H.jsx)(`div`,{className:`tree-scroll`,children:(0,H.jsx)(Ja,{nodes:r,selected:u,folded:O,toggle:e=>k(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),choose:se})}),M&&(0,H.jsx)(`p`,{role:`status`,children:M}),(0,H.jsxs)(`nav`,{className:`tools`,"aria-label":`Инструменты`,children:[(0,H.jsxs)(`a`,{href:`/files/`,target:`_blank`,rel:`noopener`,children:[(0,H.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,H.jsx)(`path`,{d:`M3 6h7l2 2h9v11H3z`})}),`Файлы`]}),(0,H.jsxs)(Ni,{id:`nav-terminal`,to:pe,"aria-current":f?`page`:void 0,onClick:()=>T(`node`),children:[(0,H.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,H.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`3`}),(0,H.jsx)(`path`,{d:`m6 9 3 3-3 3m5 0h5`})]}),`Терминал`,he&&(0,H.jsx)(`i`,{className:`online-dot`,"aria-label":`Подключён`})]})]})]}),de&&(P?(0,H.jsx)(Pa,{node:P,nodes:r,admin:e.canManageApps,action:d,chooseAction:e=>void c(Ka(P.id)+(e?`/`+e:``)),refresh:ae,reply:A[P.id],updateReply:e=>j(t=>({...t,[P.id]:e}))},P.id):(0,H.jsx)(`section`,{className:C===`action`?`action-column`:`node-column`,children:(0,H.jsx)(`p`,{id:`pick-node`,role:`status`,children:a?u?`Нода недоступна.`:`Выберите ноду в дереве.`:`Загрузка дерева…`})})),le&&(0,H.jsx)(`section`,{id:`runner-panel`,className:`node-column`,children:e.canManageApps?(0,H.jsx)(Ia,{feedback:t}):(0,H.jsx)(`p`,{children:`Нет доступа.`})}),ue&&(0,H.jsx)(`section`,{id:`rpc-panel`,className:`node-column`,children:(0,H.jsx)(Ya,{refresh:ae,feedback:t})}),f&&m!==null&&!me&&(0,H.jsxs)(`section`,{className:`node-column`,children:[(0,H.jsx)(`h1`,{children:`Терминал`}),g===`closed`?(0,H.jsx)(`button`,{onClick:()=>D(p),children:`Открыть новый терминал`}):(0,H.jsx)(`p`,{children:`Во вкладке уже открыт терминал с другим режимом изоляции. Закройте его перед сменой режима.`}),(0,H.jsx)(Ni,{to:pe,children:`Перейти к текущему терминалу`})]}),m!==null&&(0,H.jsx)(`section`,{className:`terminal-column`,hidden:!me,children:(0,H.jsx)(_.Suspense,{fallback:(0,H.jsx)(`p`,{children:`Подключение…`}),children:(0,H.jsx)(Ua,{sandbox:m,visible:me&&(!x||C===`node`),onStatus:v},String(m))})}),!de&&!f&&!le&&!ue&&(0,H.jsxs)(`section`,{className:`node-column`,children:[(0,H.jsx)(`p`,{children:`Страница не найдена.`}),(0,H.jsx)(Ni,{to:`/`,children:`Workspace`})]})]})}function Za({reload:e,feedback:t}){return(0,H.jsxs)(`section`,{id:`signin`,children:[(0,H.jsx)(`h1`,{children:`Вход в workspace`}),(0,H.jsx)(ma,{id:`login`,feedback:t,run:async()=>{await aa(),await e()},children:`Войти с passkey`}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Зарегистрировать passkey`}),(0,H.jsxs)(fa,{id:`activate`,feedback:t,submit:async t=>{await ia(ha(t,`email`),ha(t,`code`)),t.reset(),await e()},children:[(0,H.jsxs)(`label`,{children:[`Email`,(0,H.jsx)(`input`,{name:`email`,type:`email`,autoComplete:`email`,required:!0})]}),(0,H.jsxs)(`label`,{children:[`Одноразовый код`,(0,H.jsx)(`input`,{name:`code`,autoComplete:`one-time-code`,required:!0})]}),(0,H.jsx)(pa,{children:`Зарегистрировать`})]})]}),(0,H.jsxs)(`details`,{children:[(0,H.jsx)(`summary`,{children:`Получить код по email`}),(0,H.jsxs)(fa,{id:`recovery`,feedback:t,submit:async e=>{await sa(ha(e,`email`)),t(`Если восстановление доступно, код придёт на указанный адрес.`)},children:[(0,H.jsxs)(`label`,{children:[`Адрес для восстановления`,(0,H.jsx)(`input`,{name:`email`,type:`email`,autoComplete:`email`,required:!0})]}),(0,H.jsx)(pa,{children:`Запросить код`})]})]})]})}function Qa(){let[e,t]=(0,_.useState)(),[n,r]=(0,_.useState)(``),i=(0,_.useRef)(0),a=(0,_.useCallback)(async()=>{let e=++i.current,n=await B();e===i.current&&(n.user?Qi(n.user,()=>{i.current++,Zi(),t({user:null,canChooseSandbox:!1,canManageApps:!1}),r(`Сессия завершена. Войдите снова.`)}):Zi(),t(n),r(``))},[]);return(0,_.useEffect)(()=>(a().catch(e=>r(z(e))),()=>{i.current++,Zi()}),[a]),(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)(`main`,{children:[e&&(e.user?(0,H.jsx)(Xa,{session:e,feedback:r,signOut:async()=>{await oa(),await a()}},e.user):(0,H.jsx)(Za,{reload:a,feedback:r})),(0,H.jsx)(`p`,{id:`notice`,role:`status`,children:n})]})})}var $a=Ai([{path:`*`,element:(0,H.jsx)(Qa,{})}]);(0,Wi.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(Ur,{router:$a}));export{c as i,m as n,u as r,la as t};